{"version":3,"file":"odx-angular-components-error-page.mjs","sources":["../../../../libs/angular/components/error-page/src/lib/error-page.config.ts","../../../../libs/angular/components/error-page/src/lib/error-page.component.ts","../../../../libs/angular/components/error-page/src/lib/error-page.component.html","../../../../libs/angular/components/error-page/src/odx-angular-components-error-page.ts"],"sourcesContent":["import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { DynamicContent } from '@odx/angular/cdk/dynamic-view';\nimport { ConfigDependencies, ConfigProvider, createConfigTokens } from '@odx/angular/utils';\n\n/**\n * Defines the configuration for an error page used within an application. This can include custom icons,\n * titles, descriptions, actions, and an optional error message.\n * @property {string} [icon] - The name of the icon to display on the error page (e.g., `core::error`).\n * @property {DynamicContent} title - The title content for the error page, which can be a string or a dynamic template.\n * @property {DynamicContent} [description] - Optional description content for the error page.\n * @property { { label: DynamicContent; action: () => void; }[] } actions - A list of actions that can be taken from the error page, each with a label and an action function.\n * @property {DynamicContent} [errorMessage] - Optional additional error message content.\n */\nexport interface ErrorPageConfig {\n  icon?: string | null;\n  title: DynamicContent;\n  description?: DynamicContent;\n  actions: {\n    label: DynamicContent;\n    action: () => void;\n  }[];\n\n  errorMessage?: DynamicContent;\n}\n\nexport const { ErrorPageConfig, ErrorPageDefaultConfig, injectErrorPageConfig, provideErrorPageConfig } = createConfigTokens(\n  'ErrorPage',\n  '@odx/components/error-page',\n  {\n    title: '',\n    actions: [],\n  } as ErrorPageConfig,\n);\n\n/**\n * Configures and provides the necessary providers for an error page, using a configuration object that specifies\n * icons, titles, descriptions, and actions.\n *\n * @param {ConfigProvider<Partial<ErrorPageConfig>, D>} config - A configuration object or provider function that supplies an `ErrorPageConfig`.\n * @returns {EnvironmentProviders} Returns a configuration that can be used to register the error page providers.\n *\n */\nexport function configureErrorPage<D extends ConfigDependencies>(config: ConfigProvider<Partial<ErrorPageConfig>, D>): EnvironmentProviders {\n  return makeEnvironmentProviders([provideErrorPageConfig(config)]);\n}\n","import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core';\nimport { CoreModule } from '@odx/angular';\nimport { DynamicViewDirective } from '@odx/angular/cdk/dynamic-view';\nimport { ButtonComponent } from '@odx/angular/components/button';\nimport { IconComponent } from '@odx/angular/components/icon';\nimport { LogoDirective } from '@odx/angular/components/logo';\nimport { CSSComponent } from '@odx/angular/internal';\nimport { injectElement } from '@odx/angular/utils';\nimport { injectErrorPageConfig } from './error-page.config';\n\n/**\n * Represents the ErrorPageComponent class.\n * This component is responsible for displaying an error page.\n */\n@CSSComponent('error-page')\n@Component({\n  standalone: true,\n  selector: 'odx-error-page',\n  templateUrl: './error-page.component.html',\n  imports: [LogoDirective, IconComponent, CoreModule, ButtonComponent, DynamicViewDirective],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n})\nexport class ErrorPageComponent {\n  public readonly element = injectElement();\n\n  /**\n   * Represents the options for the error page component.\n   *\n   * @type {ErrorPageConfig}\n   */\n  public options = injectErrorPageConfig();\n}\n","@let icon = options.icon;\n\n<div class=\"odx-error-page__container\">\n  @if (icon !== null) {\n    <div class=\"odx-error-page__icon-container\">\n      @if (icon) {\n        <odx-icon size=\"xlarge\" [name]=\"icon\" />\n      } @else {\n        <odx-logo size=\"large\" />\n      }\n    </div>\n  }\n\n  <div class=\"odx-error-page__title\">\n    <ng-template [odxDynamicView]=\"options.title\" />\n  </div>\n  @if (options.description; as description) {\n    <div class=\"odx-error-page__description\">\n      <ng-template [odxDynamicView]=\"description\" />\n    </div>\n  }\n  <div class=\"odx-error-page__actions\">\n    @for (button of options.actions; let isFirst = $first; track $index) {\n      <button [variant]=\"isFirst ? 'primary' : 'secondary'\" odxButton (click)=\"button.action()\">\n        <ng-template [odxDynamicView]=\"button.label\" />\n      </button>\n    }\n  </div>\n</div>\n@if (options.errorMessage; as errorMessage) {\n  <div class=\"odx-error-page__footer\">\n    <ng-template [odxDynamicView]=\"errorMessage\" />\n  </div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n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