@cngx/common 0.1.0-rc.1 → 0.1.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"cngx-common-stepper.mjs","sources":["../../../projects/common/stepper/commit-handler.ts","../../../projects/common/stepper/stepper-config.ts","../../../projects/common/stepper/stepper-host.token.ts","../../../projects/common/stepper/step-tree.util.ts","../../../projects/common/stepper/presenter.directive.ts","../../../projects/common/stepper/step-group-host.token.ts","../../../projects/common/stepper/step-panel-host.token.ts","../../../projects/common/stepper/step-content.directive.ts","../../../projects/common/stepper/step-label.directive.ts","../../../projects/common/stepper/step.directive.ts","../../../projects/common/stepper/step-group.directive.ts","../../../projects/common/stepper/slots/step-indicator.directive.ts","../../../projects/common/stepper/slots/step-badge.directive.ts","../../../projects/common/stepper/slots/step-busy-spinner.directive.ts","../../../projects/common/stepper/slots/step-rejection.directive.ts","../../../projects/common/stepper/slots/step-error.directive.ts","../../../projects/common/stepper/slots/step-group-header.directive.ts","../../../projects/common/stepper/slots/stepper-empty.directive.ts","../../../projects/common/stepper/slots/dot-stepper-dot.directive.ts","../../../projects/common/stepper/slots/stepper-template-cascade.ts","../../../projects/common/stepper/glyphs.ts","../../../projects/common/stepper/router-sync.directive.ts","../../../projects/common/stepper/i18n/stepper-i18n.ts","../../../projects/common/stepper/status-label.ts","../../../projects/common/stepper/mobile-viewport.ts","../../../projects/common/stepper/stepper-host-attrs.ts","../../../projects/common/stepper/strip-keyboard-nav.ts","../../../projects/common/stepper/stepper-state-view.ts","../../../projects/common/stepper/slot-context-builders.ts","../../../projects/common/stepper/announcement-builders.ts","../../../projects/common/stepper/swipe-nav.directive.ts","../../../projects/common/stepper/stepper-count.ts","../../../projects/common/stepper/controls/stepper-previous.directive.ts","../../../projects/common/stepper/controls/stepper-next.directive.ts","../../../projects/common/stepper/controls/stepper-complete.directive.ts","../../../projects/common/stepper/create-stepper-host-proxy.ts","../../../projects/common/stepper/provide-cngx-stepper.ts","../../../projects/common/stepper/public-api.ts","../../../projects/common/stepper/cngx-common-stepper.ts"],"sourcesContent":["import { InjectionToken, type Signal } from '@angular/core';\nimport { isObservable, type Observable, type Subscription } from 'rxjs';\n\nimport { type CngxCommitController, type CngxCommitHandle } from '@cngx/common/data';\n\nimport type { CngxStepperCommitAction } from './presenter.directive';\n\n/**\n * Adapter between the lifted commit-controller and the stepper's\n * action shape. The presenter delegates to `beginTransition` on\n * every step change driven by `commitAction`.\n *\n * @category common/stepper\n */\nexport interface CngxStepperCommitHandler {\n /**\n * Start a transition commit. Returns synchronously; the controller's\n * `state` signal reports the in-flight status.\n *\n * @param onResolve fires `true` on accept, `false` on rejection;\n * skipped on supersede.\n */\n beginTransition(\n fromIndex: number,\n toIndex: number,\n action: CngxStepperCommitAction,\n onResolve: (accept: boolean) => void,\n ): void;\n\n /** Cancel the in-flight transition without firing callbacks. */\n cancel(): void;\n\n /** Live `pending` flag from the controller. */\n readonly isCommitting: Signal<boolean>;\n}\n\n/**\n * Options for {@link createStepperCommitHandler}.\n *\n * @category common/stepper\n */\nexport interface CngxStepperCommitHandlerOptions {\n readonly controller: CngxCommitController<number>;\n}\n\n/**\n * Build a stepper commit handler over an existing {@link CngxCommitController}.\n * Resolves `Observable<boolean>` / `Promise<boolean>` / `boolean` returns into\n * a unified `accept: boolean` outcome.\n *\n * @category common/stepper\n */\nexport function createStepperCommitHandler(\n opts: CngxStepperCommitHandlerOptions,\n): CngxStepperCommitHandler {\n const { controller } = opts;\n return {\n isCommitting: controller.isCommitting,\n\n beginTransition(fromIndex, toIndex, action, onResolve) {\n controller.begin(\n (handlers) => runStepperAction(action, fromIndex, toIndex, handlers),\n toIndex,\n fromIndex,\n {\n onSuccess: () => onResolve(true),\n onError: () => onResolve(false),\n },\n );\n },\n\n cancel() {\n controller.cancel();\n },\n };\n}\n\n/** @internal */\nfunction runStepperAction(\n action: CngxStepperCommitAction,\n fromIndex: number,\n toIndex: number,\n handlers: {\n readonly onSuccess: (committed: number | undefined) => void;\n readonly onError: (err: unknown) => void;\n },\n): CngxCommitHandle {\n let cancelled = false;\n let unsubscribe: (() => void) | null = null;\n\n const safeSuccess = (accept: boolean): void => {\n if (cancelled) {\n return;\n }\n if (accept) {\n handlers.onSuccess(toIndex);\n } else {\n handlers.onError(new Error('Stepper transition refused by commitAction'));\n }\n };\n const safeError = (err: unknown): void => {\n if (cancelled) {\n return;\n }\n handlers.onError(err);\n };\n\n let result: boolean | Promise<boolean> | Observable<boolean>;\n try {\n result = action(fromIndex, toIndex);\n } catch (err: unknown) {\n safeError(err);\n return {\n cancel: () => {\n cancelled = true;\n },\n };\n }\n\n if (isObservable(result)) {\n // Synchronous Observables (`of(true)`) emit inside `.subscribe`\n // before the assignment binds - `sub` would be in TDZ. Declare\n // the handle on a `let` first.\n let sub: Subscription | null = null;\n sub = result.subscribe({\n next: (accept) => {\n safeSuccess(accept);\n sub?.unsubscribe();\n },\n error: (err: unknown) => safeError(err),\n });\n unsubscribe = () => sub?.unsubscribe();\n } else if (result != null && typeof (result as { then?: unknown }).then === 'function') {\n (result as Promise<boolean>).then(safeSuccess, safeError);\n } else {\n safeSuccess(result as boolean);\n }\n\n return {\n cancel: () => {\n cancelled = true;\n unsubscribe?.();\n },\n };\n}\n\n/**\n * Factory signature for {@link CngxStepperCommitHandler}. Override\n * {@link CNGX_STEPPER_COMMIT_HANDLER_FACTORY} for retry-with-backoff,\n * telemetry, or offline queues.\n *\n * @category common/stepper\n */\nexport type CngxStepperCommitHandlerFactory = (\n opts: CngxStepperCommitHandlerOptions,\n) => CngxStepperCommitHandler;\n\n/**\n * DI token carrying the factory the presenter uses to allocate its commit\n * handler. Symmetric to the select family's `CNGX_ARRAY_COMMIT_HANDLER_FACTORY`.\n *\n * @category common/stepper\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/commit-handler.ts\n * @since 0.1.0\n */\nexport const CNGX_STEPPER_COMMIT_HANDLER_FACTORY =\n new InjectionToken<CngxStepperCommitHandlerFactory>('CngxStepperCommitHandlerFactory', {\n providedIn: 'root',\n factory: () => createStepperCommitHandler,\n });\n","import {\n type EnvironmentProviders,\n inject,\n InjectionToken,\n makeEnvironmentProviders,\n type Provider,\n type TemplateRef,\n} from '@angular/core';\n\nimport type { CngxDotStepperDotContext } from './slots/dot-stepper-dot.directive';\nimport type { CngxStepBadgeContext } from './slots/step-badge.directive';\nimport type { CngxStepBusySpinnerContext } from './slots/step-busy-spinner.directive';\nimport type { CngxStepErrorContext } from './slots/step-error.directive';\nimport type { CngxStepGroupHeaderContext } from './slots/step-group-header.directive';\nimport type { CngxStepIndicatorContext } from './slots/step-indicator.directive';\nimport type { CngxStepRejectionContext } from './slots/step-rejection.directive';\n\n/**\n * Aria-label overrides for the stepper landmark region. Library\n * defaults are English; locales come from consumer overrides.\n *\n * Per-step navigation labels (`previousStep`, `nextStep`) live in\n * {@link CngxStepperI18n} - SR phrasing, not landmark naming.\n * Splitting the surfaces avoids a dual-override path for the same string.\n *\n * @category common/stepper\n */\nexport interface CngxStepperAriaLabels {\n readonly stepperRegion?: string;\n}\n\n/**\n * Fallback labels for derived strings (group descriptors, badge SR\n * announcements). English defaults; consumer overrides per locale.\n *\n * @category common/stepper\n */\nexport interface CngxStepperFallbackLabels {\n readonly groupRoleDescription?: string;\n readonly stepRoleDescription?: string;\n}\n\n/**\n * Per-slot template overrides for `<cngx-stepper>`. Middle tier of\n * the 3-stage cascade: per-instance directive > this field > built-in\n * markup. Apply via the `with*Template` feature builders below.\n *\n * @category common/stepper\n */\nexport interface CngxStepperTemplates {\n readonly indicator?: TemplateRef<CngxStepIndicatorContext>;\n readonly badge?: TemplateRef<CngxStepBadgeContext>;\n readonly busySpinner?: TemplateRef<CngxStepBusySpinnerContext>;\n readonly rejection?: TemplateRef<CngxStepRejectionContext>;\n readonly stepError?: TemplateRef<CngxStepErrorContext>;\n readonly groupHeader?: TemplateRef<CngxStepGroupHeaderContext>;\n readonly empty?: TemplateRef<void>;\n readonly dotStepperDot?: TemplateRef<CngxDotStepperDotContext>;\n}\n\n/**\n * Selectable visual skin for the cngx-standard stepper. The skin is a\n * pure thematic concern - every value renders the same structure, same\n * slots, same ARIA, same keyboard behaviour, and only redirects CSS via\n * the `[data-skin]` host attribute. The Material twin\n * (`<cngx-mat-stepper>`) ignores this setting.\n *\n * @category common/stepper\n */\nexport type CngxStepperSkin =\n | 'classic'\n | 'linear-minimal'\n | 'stripe-status-rich'\n | 'path-chevron'\n | 'pill-segment'\n | 'chips'\n | 'breadcrumb';\n\n/**\n * Mobile auto-collapse target. Under a narrow viewport\n * (`max-width: 480px`), `<cngx-stepper>` falls back to one of the\n * compact variants instead of rendering the full strip. Set to\n * `'off'` to retain the classic strip on every viewport.\n *\n * @category common/stepper\n */\nexport type CngxStepperMobileCollapse = 'text' | 'dots' | 'off';\n\n/**\n * Header-navigation policy for `<cngx-stepper>`. `'none'` renders the\n * step headers as inert labels - the footer is the sole navigation\n * control. `'visited'` (default) keeps the headers as focusable\n * buttons; reachability folds into the `linear` axis (`linear=false`\n * is free click-through, `linear=true` is backward-to-visited only,\n * with linear-unreachable headers marked `aria-disabled`). There is no\n * discrete `'free'` value - `'free'` is `'visited'` + `linear=false`.\n *\n * @category common/stepper\n */\nexport type CngxStepperHeaderNavigation = 'none' | 'visited';\n\n/**\n * Where the mobile auto-collapse indicator (text caption or dot row)\n * sits relative to the active step's panel content under narrow\n * viewports. `'top'` (default) keeps the indicator above the panel;\n * `'bottom'` flips it below so the user reads content first and the\n * navigation cue sits at the thumb zone. Ignored when the classic\n * strip is on screen (`displayMode === 'classic'`).\n *\n * @category common/stepper\n */\nexport type CngxStepperMobileIndicatorPosition = 'top' | 'bottom';\n\n/**\n * Default media query the mobile auto-collapse policy reacts to. The\n * literal lives on a single exported const so the runtime, the config\n * default, and any JSDoc cross-references stay in lockstep. Consumers\n * override the query via {@link withStepperMobileBreakpoint}.\n *\n * @category common/stepper\n */\nexport const STEPPER_DEFAULT_MOBILE_BREAKPOINT = '(max-width: 480px)';\n\n/**\n * Stepper config surface. Resolution priority: per-instance Input\n * > `provideStepperConfigAt` (viewProviders) > `provideStepperConfig`\n * (root) > library default. Canonical cngx config shape.\n *\n * @category common/stepper\n */\nexport interface CngxStepperConfig {\n readonly defaultOrientation?: 'horizontal' | 'vertical';\n readonly defaultLinear?: boolean;\n readonly defaultCommitMode?: 'optimistic' | 'pessimistic';\n readonly routerSyncMode?: 'fragment' | 'queryParam';\n readonly routerSyncParam?: string;\n readonly skin?: CngxStepperSkin;\n /**\n * Header-navigation policy. `'none'` makes the step headers inert\n * labels (footer-only navigation); `'visited'` (default) keeps them\n * focusable buttons whose reachability folds into the `linear` axis.\n * Per-instance `[headerNavigation]` Input still wins.\n */\n readonly headerNavigation?: CngxStepperHeaderNavigation;\n /**\n * Opt-in connector rail between adjacent step indicators on the\n * classic skin. Off by default. The rule is double-scoped on\n * `[data-skin='classic']`, so the four other skins are mechanically\n * untouched (each ships its own inter-step decoration). Per-instance\n * `[connectors]` Input still wins.\n */\n readonly connectors?: boolean;\n readonly mobileCollapse?: CngxStepperMobileCollapse;\n /**\n * Media query the mobile auto-collapse policy reacts to. Default\n * {@link STEPPER_DEFAULT_MOBILE_BREAKPOINT}. Tablet consumers can\n * re-aim the trigger via {@link withStepperMobileBreakpoint}.\n */\n readonly mobileBreakpoint?: string;\n /**\n * Where the mobile auto-collapse indicator sits relative to the\n * panel content. Default `'top'`. Override per-instance via the\n * `[mobileIndicatorPosition]` input or app-wide via\n * {@link withStepperMobileIndicatorPosition}.\n */\n readonly mobileIndicatorPosition?: CngxStepperMobileIndicatorPosition;\n /**\n * Whether horizontal swipe gestures advance/retreat the active step\n * while the stepper is in mobile-collapse mode (`'dots'` / `'text'`).\n * Default `true`. Override per-instance via the `[mobileSwipe]` input\n * or app-wide via {@link withStepperMobileSwipe}. Ignored on the\n * classic strip and on the Material twin (`<cngx-mat-stepper>`).\n */\n readonly mobileSwipe?: boolean;\n readonly ariaLabels?: CngxStepperAriaLabels;\n readonly fallbackLabels?: CngxStepperFallbackLabels;\n readonly templates?: CngxStepperTemplates;\n}\n\n/** @internal */\nconst STEPPER_CONFIG_DEFAULTS: Required<\n Omit<CngxStepperConfig, 'ariaLabels' | 'fallbackLabels' | 'templates'>\n> & {\n ariaLabels: CngxStepperAriaLabels;\n fallbackLabels: CngxStepperFallbackLabels;\n templates: CngxStepperTemplates;\n} = {\n defaultOrientation: 'horizontal',\n defaultLinear: false,\n defaultCommitMode: 'pessimistic',\n routerSyncMode: 'fragment',\n routerSyncParam: 'step',\n skin: 'classic',\n headerNavigation: 'visited',\n connectors: false,\n mobileCollapse: 'text',\n mobileBreakpoint: STEPPER_DEFAULT_MOBILE_BREAKPOINT,\n mobileIndicatorPosition: 'top',\n mobileSwipe: true,\n ariaLabels: {\n stepperRegion: 'Stepper',\n },\n fallbackLabels: {\n groupRoleDescription: 'step group',\n stepRoleDescription: 'stepper',\n },\n templates: {},\n};\n\n/**\n * DI token for the resolved stepper config. `providedIn: 'root'` with\n * library defaults; override via {@link provideStepperConfig} (root)\n * or {@link provideStepperConfigAt} (component scope).\n *\n * @category common/stepper\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/stepper-config.ts\n * @since 0.1.0\n */\nexport const CNGX_STEPPER_CONFIG = new InjectionToken<CngxStepperConfig>('CngxStepperConfig', {\n providedIn: 'root',\n factory: () => STEPPER_CONFIG_DEFAULTS,\n});\n\n/**\n * Feature signature - each `with*` builder reduces over the config.\n * Hidden `_target: 'config'` discriminator routes through the family\n * aggregator {@link provideCngxStepper}.\n *\n * @category common/stepper\n */\nexport type CngxStepperConfigFeature = ((config: CngxStepperConfig) => CngxStepperConfig) & {\n readonly _target: 'config';\n};\n\n/**\n * Brands a config mutator with `_target: 'config'`. Every `with*`\n * config feature returns one of these.\n *\n * @internal\n */\nfunction defineStepperConfigFeature(\n fn: (config: CngxStepperConfig) => CngxStepperConfig,\n): CngxStepperConfigFeature {\n return Object.assign(fn, { _target: 'config' as const });\n}\n\n/**\n * Override the default orientation. Per-instance `[orientation]`\n * Input still wins; this only moves the cascade default.\n *\n * @category common/stepper\n */\nexport function withStepperDefaultOrientation(\n orientation: 'horizontal' | 'vertical',\n): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({\n ...cfg,\n defaultOrientation: orientation,\n }));\n}\n\n/**\n * Override the default linear-progression setting. Per-instance\n * `[linear]` Input still wins.\n *\n * @category common/stepper\n */\nexport function withStepperLinear(linear: boolean): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({ ...cfg, defaultLinear: linear }));\n}\n\n/**\n * Override the default commit mode for async step transitions.\n * `'optimistic'` advances on action dispatch and rolls back on error;\n * `'pessimistic'` waits for success. Per-instance `[commitMode]`\n * Input still wins.\n *\n * @category common/stepper\n */\nexport function withStepperCommitMode(\n mode: 'optimistic' | 'pessimistic',\n): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({\n ...cfg,\n defaultCommitMode: mode,\n }));\n}\n\n/**\n * Configure router synchronisation for the active step. `mode` chooses\n * the URL surface (URL fragment or query parameter); `param` names the\n * key (default `'step'`).\n *\n * @category common/stepper\n */\nexport function withStepperRouterSync(\n mode: 'fragment' | 'queryParam',\n param = 'step',\n): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({\n ...cfg,\n routerSyncMode: mode,\n routerSyncParam: param,\n }));\n}\n\n/**\n * Select the visual skin for the cngx-standard `<cngx-stepper>`. The\n * default is `'classic'`. Per-instance `[skin]` Input still wins; this\n * moves the cascade default. Structure, slots, ARIA, and keyboard\n * behaviour are identical across skins - only the `[data-skin]` host\n * attribute changes the CSS layer that paints the strip.\n *\n * @category common/stepper\n */\nexport function withStepperSkin(skin: CngxStepperSkin): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({ ...cfg, skin }));\n}\n\n/**\n * Opt the classic `<cngx-stepper>` skin into the connector-rail\n * presentation: a solid completed/upcoming rail between adjacent step\n * indicators, horizontal and vertical, with per-segment coloring driven\n * by the preceding step's `[data-state]`. The rule is double-scoped on\n * `[data-skin='classic']`; the four other skins each ship their own\n * inter-step decoration and ignore this flag. Per-instance\n * `[connectors]` Input still wins.\n *\n * @category common/stepper\n */\nexport function withStepperConnectors(on: boolean): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({ ...cfg, connectors: on }));\n}\n\n/**\n * Configure the mobile auto-collapse target for `<cngx-stepper>`. Under\n * a narrow viewport (`max-width: 480px`), the classic strip swaps to\n * the chosen variant - `'text'` (default) renders `<cngx-text-stepper>`,\n * `'dots'` renders `<cngx-dot-stepper>`, `'off'` keeps the classic\n * strip. The Material twin `<cngx-mat-stepper>` ignores this setting.\n *\n * @category common/stepper\n */\nexport function withStepperMobileCollapse(\n mode: CngxStepperMobileCollapse,\n): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({ ...cfg, mobileCollapse: mode }));\n}\n\n/**\n * Override the media query the mobile auto-collapse policy reacts to.\n * Default `'(max-width: 480px)'`. Useful for tablet-tier consumers\n * who want the collapse to engage at 768px or for design systems\n * aligned with `--mat-sys-breakpoint-*` tokens.\n *\n * @category common/stepper\n */\nexport function withStepperMobileBreakpoint(query: string): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({ ...cfg, mobileBreakpoint: query }));\n}\n\n/**\n * Set the app-wide default position of the mobile auto-collapse\n * indicator relative to panel content. `'top'` keeps the indicator\n * above (library default); `'bottom'` flips it below so panel content\n * reads first and the navigation cue sits at thumb height. Per-\n * instance `[mobileIndicatorPosition]` on `<cngx-stepper>` still\n * wins.\n *\n * @category common/stepper\n */\nexport function withStepperMobileIndicatorPosition(\n position: CngxStepperMobileIndicatorPosition,\n): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({ ...cfg, mobileIndicatorPosition: position }));\n}\n\n/**\n * Toggle the built-in horizontal-swipe navigation on `<cngx-stepper>`\n * in mobile-collapse mode. Default `true` - the `'dots'` and `'text'`\n * variants read as carousels, so users expect to swipe. Per-instance\n * `[mobileSwipe]` Input still wins; the classic strip is unaffected.\n *\n * @category common/stepper\n */\nexport function withStepperMobileSwipe(enabled: boolean): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({ ...cfg, mobileSwipe: enabled }));\n}\n\n/**\n * Set the app-wide default header-navigation policy for\n * `<cngx-stepper>`. `'none'` renders inert label headers (footer-only\n * navigation); `'visited'` (library default) keeps the headers as\n * focusable buttons whose reachability folds into the `linear` axis.\n * Per-instance `[headerNavigation]` Input still wins.\n *\n * @category common/stepper\n */\nexport function withStepperHeaderNavigation(\n mode: CngxStepperHeaderNavigation,\n): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({ ...cfg, headerNavigation: mode }));\n}\n\n/**\n * Merge ARIA labels into the cascade. Keys not provided keep their\n * library defaults; per-instance overrides on the stepper still win.\n *\n * @category common/stepper\n */\nexport function withStepperAriaLabels(labels: CngxStepperAriaLabels): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({\n ...cfg,\n ariaLabels: { ...cfg.ariaLabels, ...labels },\n }));\n}\n\n/**\n * Merge text fallback labels (button captions, error strings) into the\n * cascade. Used when a slot directive is not present.\n *\n * @category common/stepper\n */\nexport function withStepperFallbackLabels(\n labels: CngxStepperFallbackLabels,\n): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({\n ...cfg,\n fallbackLabels: { ...cfg.fallbackLabels, ...labels },\n }));\n}\n\n/**\n * Override the default `*cngxStepIndicator` template app-wide.\n * Per-instance directive still wins; this only moves the cascade\n * middle tier.\n *\n * @category common/stepper\n */\nexport function withStepIndicatorTemplate(\n template: TemplateRef<CngxStepIndicatorContext>,\n): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({\n ...cfg,\n templates: { ...cfg.templates, indicator: template },\n }));\n}\n\n/**\n * Override the default `*cngxStepBadge` template app-wide.\n *\n * @category common/stepper\n */\nexport function withStepBadgeTemplate(\n template: TemplateRef<CngxStepBadgeContext>,\n): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({\n ...cfg,\n templates: { ...cfg.templates, badge: template },\n }));\n}\n\n/**\n * Override the default `*cngxStepBusySpinner` template app-wide.\n *\n * @category common/stepper\n */\nexport function withStepBusySpinnerTemplate(\n template: TemplateRef<CngxStepBusySpinnerContext>,\n): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({\n ...cfg,\n templates: { ...cfg.templates, busySpinner: template },\n }));\n}\n\n/**\n * Override the default `*cngxStepRejection` template app-wide.\n * Symmetric with the upcoming tabs `cngxTabRejectionIcon` (Phase 4).\n *\n * @category common/stepper\n */\nexport function withStepRejectionTemplate(\n template: TemplateRef<CngxStepRejectionContext>,\n): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({\n ...cfg,\n templates: { ...cfg.templates, rejection: template },\n }));\n}\n\n/**\n * Override the default `*cngxStepError` template app-wide. The slot\n * renders the per-step validation reason on the skins with a label area\n * (classic / stripe-status-rich). Per-instance directive still wins;\n * this moves the cascade middle tier.\n *\n * @category common/stepper\n */\nexport function withStepErrorTemplate(\n template: TemplateRef<CngxStepErrorContext>,\n): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({\n ...cfg,\n templates: { ...cfg.templates, stepError: template },\n }));\n}\n\n/**\n * Override the default `*cngxStepGroupHeader` template app-wide.\n *\n * @category common/stepper\n */\nexport function withStepGroupHeaderTemplate(\n template: TemplateRef<CngxStepGroupHeaderContext>,\n): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({\n ...cfg,\n templates: { ...cfg.templates, groupHeader: template },\n }));\n}\n\n/**\n * Override the default `*cngxStepperEmpty` template app-wide.\n *\n * @category common/stepper\n */\nexport function withStepperEmptyTemplate(template: TemplateRef<void>): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({\n ...cfg,\n templates: { ...cfg.templates, empty: template },\n }));\n}\n\n/**\n * Override the default `*cngxDotStepperDot` template app-wide. The\n * `<cngx-dot-stepper>` variant resolves the cascade per dot:\n * per-instance directive > this feature > built-in empty body\n * (the dot fill is painted by `.cngx-dot-stepper__dot` regardless).\n *\n * @category common/stepper\n */\nexport function withDotStepperDotTemplate(\n template: TemplateRef<CngxDotStepperDotContext>,\n): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({\n ...cfg,\n templates: { ...cfg.templates, dotStepperDot: template },\n }));\n}\n\n/** @internal */\nfunction resolveFeatures(features: readonly CngxStepperConfigFeature[]): CngxStepperConfig {\n return features.reduce<CngxStepperConfig>((cfg, feat) => feat(cfg), STEPPER_CONFIG_DEFAULTS);\n}\n\n/**\n * Root-level provider for the stepper config. Apply once in the\n * application providers array. Sibling of `provideTabsConfig` /\n * `provideSelectConfig`.\n *\n * @category common/stepper\n */\nexport function provideStepperConfig(\n ...features: readonly CngxStepperConfigFeature[]\n): EnvironmentProviders {\n return makeEnvironmentProviders([\n { provide: CNGX_STEPPER_CONFIG, useValue: resolveFeatures(features) },\n ]);\n}\n\n/**\n * Component-scoped config override. Spread the returned `Provider[]`\n * into `providers` or `viewProviders` - `viewProviders` cannot accept\n * opaque {@link EnvironmentProviders}, so the twin returns a list.\n * Sibling of `provideTabsConfigAt`.\n *\n * Resolution priority: per-instance Input > viewProviders (`At`) >\n * root provider > library default.\n *\n * ```ts\n * @Component({\n * viewProviders: [...provideStepperConfigAt(withStepperLinear(true))],\n * })\n * ```\n *\n * @category common/stepper\n */\nexport function provideStepperConfigAt(\n ...features: readonly CngxStepperConfigFeature[]\n): Provider[] {\n return [{ provide: CNGX_STEPPER_CONFIG, useValue: resolveFeatures(features) }];\n}\n\n/**\n * Inject the resolved stepper config in an injection context.\n *\n * @category common/stepper\n */\nexport function injectStepperConfig(): CngxStepperConfig {\n return inject(CNGX_STEPPER_CONFIG);\n}\n","import { InjectionToken, type Signal } from '@angular/core';\n\nimport type { CngxAsyncState, StatusTransition } from '@cngx/core/utils';\n\nimport type { CngxErrorAggregatorContract } from '@cngx/common/interactive';\n\n/**\n * Status enum for a single step. Driven by the presenter's commit-controller\n * lifecycle plus the optional `errorAggregator`.\n *\n * @category common/stepper\n */\nexport type CngxStepStatus = 'idle' | 'pending' | 'success' | 'error' | 'disabled' | 'busy';\n\n/**\n * Step-tree node. Either a terminal `step` (has its own panel) or a\n * `group` carrying nested children. Discriminated by `kind`.\n *\n * @category common/stepper\n */\nexport interface CngxStepNode {\n readonly id: string;\n readonly kind: 'step' | 'group';\n readonly label: Signal<string>;\n readonly disabled: Signal<boolean>;\n /** Live step status. Reactive to commit-controller + aggregator. */\n readonly state: Signal<CngxStepStatus>;\n /** Optional error aggregator signal for badge / SR phrasing. */\n readonly errorAggregator?: Signal<CngxErrorAggregatorContract | undefined>;\n /**\n * Message carried by a direct `[error]` string input on the step, or\n * `undefined` when `[error]` is boolean / absent. Pure data carrier\n * read by the `*cngxStepError` slot + the mini-skin aggregate line -\n * not a swap surface.\n */\n readonly errorMessage?: Signal<string | undefined>;\n /** Direct children for group nodes; empty for step nodes. */\n readonly children: readonly CngxStepNode[];\n /** DFS depth (root = 0). */\n readonly depth: number;\n /** Parent group id, or `null` for root. */\n readonly parentId: string | null;\n /** Flat-projection index inside `flatSteps()`. -1 for groups. */\n readonly flatIndex: number;\n}\n\n/**\n * Handle a `CngxStep` / `CngxStepGroup` passes to its host. The host owns\n * the registry; the atom owns its own state slot.\n *\n * @internal\n */\nexport interface CngxStepRegistration {\n readonly id: string;\n readonly kind: 'step' | 'group';\n readonly label: Signal<string>;\n readonly disabled: Signal<boolean>;\n readonly state: Signal<CngxStepStatus>;\n readonly errorAggregator?: Signal<CngxErrorAggregatorContract | undefined>;\n /**\n * Resolved message from a direct `[error]` string input, or\n * `undefined` for boolean / absent. Pure data carrier (not a swap\n * token); surfaced on {@link CngxStepNode.errorMessage}.\n */\n readonly errorMessage?: Signal<string | undefined>;\n}\n\n/**\n * Contract atoms see via {@link CNGX_STEPPER_HOST}. Mirrors the\n * directive's surface 1:1 - atoms never reach the concrete class.\n *\n * @category common/stepper\n */\nexport interface CngxStepperHost {\n readonly stepTree: Signal<readonly CngxStepNode[]>;\n readonly flatSteps: Signal<readonly CngxStepNode[]>;\n /**\n * Step-only flat projection (group nodes filtered out).\n * Structural-equal via `flatStepsEqual`; the single source for any\n * step-count / step-position lookup.\n *\n * **Contract:** variant and skin organisms MUST read this signal\n * directly. Local re-derivation (e.g. `flatSteps().filter(...)`\n * inside a variant's `computed`) is rejected at review time -\n * the projection's equality contract is the load-bearing\n * invariant, and a local re-filter breaks the shape-stable\n * short-circuit that downstream consumers rely on. Add lookup\n * helpers as methods on this contract rather than re-deriving.\n *\n * @category common/stepper\n */\n readonly stepsOnly: Signal<readonly CngxStepNode[]>;\n readonly activeStepIndex: Signal<number>;\n readonly activeStepId: Signal<string | null>;\n\n /** Step-only count - the length of {@link stepsOnly}. */\n readonly stepCount: Signal<number>;\n\n /** `true` when the active step is the first one (no earlier step). */\n readonly isFirstStep: Signal<boolean>;\n\n /** `true` when the active step is the last one (no later step). */\n readonly isLastStep: Signal<boolean>;\n\n /**\n * `true` when {@link selectPrevious} would move - i.e. an enabled\n * step precedes the active one. The single gate a Back affordance\n * reads; never re-derive it from {@link stepsOnly} at the call site.\n */\n readonly canGoPrevious: Signal<boolean>;\n\n /**\n * `true` when {@link selectNext} would move - i.e. an enabled,\n * linear-unblocked step follows the active one. Derived from the same\n * predicates `select()` enforces, so a Next affordance can never\n * drift from the navigation it gates.\n */\n readonly canGoNext: Signal<boolean>;\n\n /**\n * `true` while a commit is in flight (`commitState.status() ===\n * 'pending'`). Drives the busy-disable on nav affordances. Keyed on\n * the strict `'pending'` status, consistent with the per-step busy\n * gate.\n */\n readonly busy: Signal<boolean>;\n\n /**\n * Label of the step {@link selectNext} would land on, or `undefined`\n * when none follows. Resolved through the enabled-step traversal so a\n * \"Continue to {{ label }}\" affordance announces the real target.\n */\n readonly nextStepLabel: Signal<string | undefined>;\n\n /**\n * Label of the step {@link selectPrevious} would land on, or\n * `undefined` when none precedes.\n */\n readonly previousStepLabel: Signal<string | undefined>;\n\n readonly linear: Signal<boolean>;\n readonly orientation: Signal<'horizontal' | 'vertical'>;\n readonly commitState: CngxAsyncState<number | undefined>;\n readonly intendedStepIndex: Signal<number | undefined>;\n\n /**\n * Reactive current/previous pair for the commit-state status. The\n * organism's `<span cngxLiveRegion>` reads this tracker on every\n * `pending → success / error` transition. Allocated once per\n * presenter - consumers MUST read this rather than calling\n * `createTransitionTracker` locally so the `linkedSignal` is shared.\n */\n readonly commitTransition: StatusTransition;\n\n /**\n * Index of the most recently refused commit target, or `undefined`\n * when no rejection is pending. Set by the rejection arm of\n * `select()`; cleared by a successful re-pick of the same target\n * or via {@link clearLastFailed}. Drives strip rejection decoration\n * and the `commitRolledBackTo` chain in `liveAnnouncement`.\n */\n readonly lastFailedIndex: Signal<number | undefined>;\n\n /**\n * Origin captured at commit-window open - the safe-harbour the user\n * is returned to on optimistic rollback. Resolves the origin label\n * for the `commitRolledBackTo(originLabel)` phrase. Cleared on\n * success; retained on rejection through the persistence window.\n */\n readonly originIndexDuringCommit: Signal<number | undefined>;\n\n /**\n * `true` when the header at the given step-only index may be\n * navigated to: the step is enabled and not blocked by the `linear`\n * gate. The single reachability predicate a header affordance reads -\n * the organism MUST call this rather than reaching the presenter's\n * private linear-block check. Out-of-range indices return `false`.\n */\n canNavigateTo(index: number): boolean;\n\n select(index: number): void;\n selectNext(): void;\n selectPrevious(): void;\n selectById(id: string): void;\n reset(): void;\n\n /**\n * Drop the persisted {@link lastFailedIndex} flag. Idempotent;\n * safe to wire to a Dismiss button or aggregator-cleared.\n */\n clearLastFailed(): void;\n\n register(handle: CngxStepRegistration, parentId?: string | null): void;\n unregister(id: string): void;\n}\n\n/**\n * DI token carrying the presenter's contract to atoms + organism shells.\n * Atoms inject `optional: true` and either register here or fall through\n * {@link CNGX_STEP_GROUP_HOST} when nested in a group.\n *\n * @category common/stepper\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/stepper-host.token.ts\n * @since 0.1.0\n */\nexport const CNGX_STEPPER_HOST = new InjectionToken<CngxStepperHost>('CngxStepperHost');\n","import type { CngxStepNode } from './stepper-host.token';\n\n/**\n * DFS-flatten a step tree. Group nodes emit before their children;\n * the consumer keys off `kind` to render a panel container vs. a\n * group header.\n *\n * @internal\n */\nexport function flattenStepTree(nodes: readonly CngxStepNode[]): readonly CngxStepNode[] {\n const out: CngxStepNode[] = [];\n let flatIndex = 0;\n const visit = (list: readonly CngxStepNode[]): void => {\n for (const node of list) {\n // Re-emit with the live flatIndex; registry-builder seeds -1\n // so it doesn't need to know the final ordering.\n out.push({ ...node, flatIndex: node.kind === 'step' ? flatIndex : -1 });\n if (node.kind === 'step') {\n flatIndex++;\n }\n if (node.children.length > 0) {\n visit(node.children);\n }\n }\n };\n visit(nodes);\n return out;\n}\n\n/**\n * Structural equality for the step-tree registry signal. Shape only -\n * id, kind, depth, parentId, children length. Reactive fields\n * (`label`, `disabled`, `state`, `errorAggregator`) are signals; their\n * own subscribers track identity changes.\n *\n * @internal\n */\nexport function stepTreeEqual(a: readonly CngxStepNode[], b: readonly CngxStepNode[]): boolean {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n const x = a[i];\n const y = b[i];\n if (x.id !== y.id || x.kind !== y.kind || x.depth !== y.depth || x.parentId !== y.parentId) {\n return false;\n }\n if (!stepTreeEqual(x.children, y.children)) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Structural equality for `flatSteps`. Adds `flatIndex` (shifts when\n * a sibling is inserted) on top of the {@link stepTreeEqual} fields.\n *\n * Use only on projections where every step carries a real\n * DFS-assigned `flatIndex` and `depth` - for `-1` placeholders, use\n * {@link stepNodesEqual}.\n *\n * @internal Exported from `public-api.ts` so the cngx-stepper and\n * cngx-mat-stepper organisms share the comparator across the\n * secondary-entry boundary (Sheriff forbids deep-relative imports).\n *\n * @category common/stepper\n */\nexport function flatStepsEqual(a: readonly CngxStepNode[], b: readonly CngxStepNode[]): boolean {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (\n a[i].id !== b[i].id ||\n a[i].kind !== b[i].kind ||\n a[i].depth !== b[i].depth ||\n a[i].flatIndex !== b[i].flatIndex\n ) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Structural equality for any flat node array - `id`, `kind`,\n * `parentId` only, ignoring `flatIndex` and `depth`. Use for\n * `CngxStepGroup.children` and other `-1`-placeholder projections.\n *\n * @internal\n */\nexport function stepNodesEqual(a: readonly CngxStepNode[], b: readonly CngxStepNode[]): boolean {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (a[i].id !== b[i].id || a[i].kind !== b[i].kind || a[i].parentId !== b[i].parentId) {\n return false;\n }\n }\n return true;\n}\n","import {\n afterNextRender,\n computed,\n Directive,\n inject,\n input,\n isDevMode,\n model,\n signal,\n type Signal,\n} from '@angular/core';\n\nimport { CNGX_COMMIT_CONTROLLER_FACTORY, type CngxCommitController } from '@cngx/common/data';\nimport {\n CNGX_STATEFUL,\n createTransitionTracker,\n type CngxAsyncState,\n type StatusTransition,\n} from '@cngx/core/utils';\nimport type { Observable } from 'rxjs';\n\nimport {\n CNGX_STEPPER_COMMIT_HANDLER_FACTORY,\n type CngxStepperCommitHandler,\n} from './commit-handler';\nimport { injectStepperConfig } from './stepper-config';\nimport {\n CNGX_STEPPER_HOST,\n type CngxStepperHost,\n type CngxStepNode,\n type CngxStepRegistration,\n type CngxStepStatus,\n} from './stepper-host.token';\nimport { flatStepsEqual, flattenStepTree, stepTreeEqual } from './step-tree.util';\n\n/**\n * Async-commit action for stepper transitions. Receives the origin\n * and target indices; resolves `true` to advance, `false` to refuse.\n * The `Observable | Promise | sync` union matches every cngx\n * commit-action signature.\n *\n * @category common/stepper\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/presenter.directive.ts\n * @since 0.1.0\n */\nexport type CngxStepperCommitAction = (\n fromIndex: number,\n toIndex: number,\n) => boolean | Promise<boolean> | Observable<boolean>;\n\n/**\n * Stepper presenter - the brain of every stepper / wizard flow.\n * Holds the active-step model, registry, linear policy, orientation,\n * and commit-controller lifecycle. Provides {@link CNGX_STEPPER_HOST}\n * for atom registration and {@link CNGX_STATEFUL} so transition\n * bridges (`<cngx-toast-on />`, `<cngx-banner-on />`) compose without\n * explicit `[state]` wiring.\n *\n * Sheriff: common Level 2. Pure directive - zero template, zero CSS.\n * Level-4 organisms compose this via `hostDirectives`.\n *\n * @category common/stepper\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/presenter.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStep, CngxStepGroup, CngxStepperRouterSync, CNGX_STEPPER_HOST, CNGX_STEPPER_CONFIG\n * <example-url>http://localhost:4200/#/ui/stepper/stepper-commit-action/pessimistic-optimistic-commits-with-bridge-directives</example-url>\n */\n@Directive({\n selector: '[cngxStepper]',\n exportAs: 'cngxStepper',\n standalone: true,\n providers: [\n { provide: CNGX_STEPPER_HOST, useExisting: CngxStepperPresenter },\n { provide: CNGX_STATEFUL, useExisting: CngxStepperPresenter },\n ],\n})\nexport class CngxStepperPresenter implements CngxStepperHost {\n private readonly config = injectStepperConfig();\n\n readonly activeStepIndex = model<number>(0);\n // Raw *Input slots default undefined so the cascade resolves through\n // CNGX_STEPPER_CONFIG. Must stay public - the template type-checker\n // rejects protected/private on hostDirective alias bindings.\n readonly linearInput = input<boolean | undefined>(undefined, {\n alias: 'linear',\n });\n readonly linear = computed<boolean>(\n () => this.linearInput() ?? this.config.defaultLinear ?? false,\n );\n\n readonly orientationInput = input<'horizontal' | 'vertical' | undefined>(undefined, {\n alias: 'orientation',\n });\n readonly orientation = computed<'horizontal' | 'vertical'>(\n () => this.orientationInput() ?? this.config.defaultOrientation ?? 'horizontal',\n );\n\n readonly commitAction = input<CngxStepperCommitAction | null>(null);\n readonly commitModeInput = input<'optimistic' | 'pessimistic' | undefined>(undefined, {\n alias: 'commitMode',\n });\n readonly commitMode = computed<'optimistic' | 'pessimistic'>(\n () => this.commitModeInput() ?? this.config.defaultCommitMode ?? 'pessimistic',\n );\n\n private readonly genericFactory = inject(CNGX_COMMIT_CONTROLLER_FACTORY);\n private readonly commitController: CngxCommitController<number> = this.genericFactory<number>();\n private readonly commitHandler: CngxStepperCommitHandler = inject(\n CNGX_STEPPER_COMMIT_HANDLER_FACTORY,\n )({ controller: this.commitController });\n\n /** Producer surface for the `CNGX_STATEFUL` bridge contract. */\n readonly state: CngxAsyncState<number | undefined> = this.commitController.state;\n\n /**\n * Step index the user is committing to. Tracked separately from\n * `state.data()` because the AsyncState data slot only updates on\n * success. Drives per-step `aria-busy` in the organism.\n */\n readonly intendedStepIndex: Signal<number | undefined> = this.commitController.intendedValue;\n\n /**\n * Reactive current/previous pair for the commit-state status. Skin\n * sub-components mount a `<span cngxLiveRegion>` reading this\n * tracker. Allocated once per presenter - the underlying\n * `linkedSignal` is shared across all consumers.\n */\n readonly commitTransition: StatusTransition = createTransitionTracker(() =>\n this.commitController.state.status(),\n );\n\n // Persistence-of-error surface - see CngxStepperHost.lastFailedIndex\n // / originIndexDuringCommit for the contract.\n private readonly lastFailedIndexState = signal<number | undefined>(undefined);\n private readonly originIndexDuringCommitState = signal<number | undefined>(undefined);\n /** {@inheritDoc CngxStepperHost.lastFailedIndex} */\n readonly lastFailedIndex: Signal<number | undefined> = this.lastFailedIndexState.asReadonly();\n /** {@inheritDoc CngxStepperHost.originIndexDuringCommit} */\n readonly originIndexDuringCommit: Signal<number | undefined> =\n this.originIndexDuringCommitState.asReadonly();\n\n private readonly treeState = signal<readonly CngxStepNode[]>([], {\n equal: stepTreeEqual,\n });\n readonly stepTree: Signal<readonly CngxStepNode[]> = this.treeState.asReadonly();\n\n readonly flatSteps: Signal<readonly CngxStepNode[]> = computed(\n () => flattenStepTree(this.stepTree()),\n { equal: flatStepsEqual },\n );\n\n /**\n * Step-only flat projection - terminal nodes in DFS order.\n * Structural-equal via `flatStepsEqual` so downstream computeds\n * don't cascade on shape-stable re-emits. Single source for every\n * `select*` / `clamp` / `activeStepId` lookup - never re-filter\n * `flatSteps()`.\n */\n readonly stepsOnly: Signal<readonly CngxStepNode[]> = computed(\n () => this.flatSteps().filter((n) => n.kind === 'step'),\n { equal: flatStepsEqual },\n );\n\n private readonly clampedIndex = computed(() => {\n const stepCount = this.stepsOnly().length;\n if (stepCount === 0) {\n return 0;\n }\n const i = this.activeStepIndex();\n return Math.max(0, Math.min(i, stepCount - 1));\n });\n\n readonly activeStepId: Signal<string | null> = computed(() => {\n const idx = this.clampedIndex();\n return this.stepsOnly()[idx]?.id ?? null;\n });\n\n readonly commitState = this.commitController.state;\n\n /**\n * Next enabled step-only index after the active one, skipping\n * disabled steps. Returns `stepsOnly().length` when no enabled step\n * follows. Single source for `selectNext()` and the `canGoNext`\n * bound - the traversal lives here, never re-walked at the call site.\n */\n private readonly nextEnabledIndex = computed(() => {\n const stepsOnly = this.stepsOnly();\n let next = this.activeStepIndex() + 1;\n while (next < stepsOnly.length && stepsOnly[next].disabled()) {\n next++;\n }\n return next;\n });\n\n /**\n * Previous enabled step-only index before the active one, skipping\n * disabled steps. Returns `-1` when no enabled step precedes. Single\n * source for `selectPrevious()` and the `canGoPrevious` bound.\n */\n private readonly previousEnabledIndex = computed(() => {\n const stepsOnly = this.stepsOnly();\n let prev = this.activeStepIndex() - 1;\n while (prev >= 0 && stepsOnly[prev].disabled()) {\n prev--;\n }\n return prev;\n });\n\n /** {@inheritDoc CngxStepperHost.stepCount} */\n readonly stepCount: Signal<number> = computed(() => this.stepsOnly().length);\n\n /** {@inheritDoc CngxStepperHost.isFirstStep} */\n readonly isFirstStep: Signal<boolean> = computed(() => this.clampedIndex() <= 0);\n\n /** {@inheritDoc CngxStepperHost.isLastStep} */\n readonly isLastStep: Signal<boolean> = computed(\n () => this.clampedIndex() >= this.stepCount() - 1,\n );\n\n /**\n * {@inheritDoc CngxStepperHost.canGoNext}\n *\n * Derives from the same `nextEnabledIndex` + `isLinearBlocked`\n * predicates `select()`/`selectNext()` enforce, so the affordance can\n * never drift from the navigation it gates.\n */\n readonly canGoNext: Signal<boolean> = computed(() => {\n const next = this.nextEnabledIndex();\n return next < this.stepCount() && !this.isLinearBlocked(next);\n });\n\n /** {@inheritDoc CngxStepperHost.canGoPrevious} */\n readonly canGoPrevious: Signal<boolean> = computed(() => this.previousEnabledIndex() >= 0);\n\n /** {@inheritDoc CngxStepperHost.busy} */\n readonly busy: Signal<boolean> = computed(() => this.commitState.status() === 'pending');\n\n /** {@inheritDoc CngxStepperHost.nextStepLabel} */\n readonly nextStepLabel: Signal<string | undefined> = computed(() =>\n this.stepsOnly()[this.nextEnabledIndex()]?.label(),\n );\n\n /** {@inheritDoc CngxStepperHost.previousStepLabel} */\n readonly previousStepLabel: Signal<string | undefined> = computed(() =>\n this.stepsOnly()[this.previousEnabledIndex()]?.label(),\n );\n\n constructor() {\n if (isDevMode()) {\n afterNextRender(() => {\n const stepNodes = this.flatSteps().filter((n) => n.kind === 'step');\n if (stepNodes.length > 6 && stepNodes.every((n) => n.parentId === null)) {\n console.warn(\n '[cngx-stepper] more than 6 steps at the same depth; consider wrapping logical groups in <cngx-step-group> for better UX',\n );\n }\n });\n }\n }\n\n // Flat id lookup; rebuilt into the hierarchical tree on each\n // register/unregister.\n private readonly registry = new Map<\n string,\n { reg: CngxStepRegistration; parentId: string | null; childIds: string[] }\n >();\n private readonly insertionOrder: string[] = [];\n\n register(handle: CngxStepRegistration, parentId: string | null = null): void {\n if (this.registry.has(handle.id)) {\n // Idempotent re-register - replace the handle, keep the ordering slot.\n const entry = this.registry.get(handle.id)!;\n entry.reg = handle;\n entry.parentId = parentId;\n } else {\n this.registry.set(handle.id, { reg: handle, parentId, childIds: [] });\n this.insertionOrder.push(handle.id);\n if (parentId !== null) {\n const parent = this.registry.get(parentId);\n if (parent) {\n parent.childIds.push(handle.id);\n }\n }\n }\n this.rebuildTree();\n }\n\n unregister(id: string): void {\n const entry = this.registry.get(id);\n if (!entry) {\n return;\n }\n if (entry.parentId !== null) {\n const parent = this.registry.get(entry.parentId);\n if (parent) {\n parent.childIds = parent.childIds.filter((c) => c !== id);\n }\n }\n this.registry.delete(id);\n const insertIdx = this.insertionOrder.indexOf(id);\n if (insertIdx >= 0) {\n this.insertionOrder.splice(insertIdx, 1);\n }\n this.rebuildTree();\n }\n\n private rebuildTree(): void {\n const buildNode = (id: string, depth: number): CngxStepNode => {\n const entry = this.registry.get(id)!;\n const children = entry.childIds.map((cid) => buildNode(cid, depth + 1));\n return {\n id,\n kind: entry.reg.kind,\n label: entry.reg.label,\n disabled: entry.reg.disabled,\n state: entry.reg.state,\n errorAggregator: entry.reg.errorAggregator,\n errorMessage: entry.reg.errorMessage,\n children,\n depth,\n parentId: entry.parentId,\n flatIndex: -1,\n };\n };\n const rootIds = this.insertionOrder.filter((id) => this.registry.get(id)!.parentId === null);\n this.treeState.set(rootIds.map((id) => buildNode(id, 0)));\n }\n\n /** {@inheritDoc CngxStepperHost.clearLastFailed} */\n clearLastFailed(): void {\n this.lastFailedIndexState.set(undefined);\n }\n\n /**\n * Linear-gate predicate: `true` when linear mode forbids advancing to\n * `target` because an incomplete (non-`success`, non-disabled) step\n * sits between the active index and `target`. The single home for the\n * linear slice check - `select()` and the `canGoNext` bound both\n * consume it so the gate can never drift between navigation and its\n * affordance.\n */\n private isLinearBlocked(target: number): boolean {\n if (!this.linear() || target <= this.activeStepIndex()) {\n return false;\n }\n return this.stepsOnly()\n .slice(this.activeStepIndex(), target)\n .some((n) => n.state() !== 'success' && !n.disabled());\n }\n\n /**\n * {@inheritDoc CngxStepperHost.canNavigateTo}\n *\n * Wraps the private {@link isLinearBlocked} predicate plus the\n * per-step `disabled` check. The header-reachability contract surface;\n * `isLinearBlocked` stays private so the organism reads this method,\n * never the internal gate.\n */\n canNavigateTo(index: number): boolean {\n const stepsOnly = this.stepsOnly();\n if (index < 0 || index >= stepsOnly.length) {\n return false;\n }\n if (stepsOnly[index].disabled()) {\n return false;\n }\n return !this.isLinearBlocked(index);\n }\n\n select(index: number): void {\n const stepsOnly = this.stepsOnly();\n if (stepsOnly.length === 0) {\n return;\n }\n const target = Math.max(0, Math.min(index, stepsOnly.length - 1));\n if (this.isLinearBlocked(target)) {\n return;\n }\n if (stepsOnly[target].disabled()) {\n return;\n }\n const previous = this.activeStepIndex();\n if (target === previous) {\n return;\n }\n\n const action = this.commitAction();\n if (!action) {\n // No-action fast path - sync move, no commit window opens, so\n // `originIndexDuringCommit` stays untouched. Clear the rejection\n // flag if the user re-picked a previously-failed target.\n this.activeStepIndex.set(target);\n if (this.lastFailedIndexState() === target) {\n this.lastFailedIndexState.set(undefined);\n }\n return;\n }\n\n // Commit-gated transition. Pessimistic holds at `previous` until\n // the action resolves; optimistic advances now and rolls back on\n // rejection. Supersede comes from the lifted commit-controller -\n // a rapid second select() cancels the in-flight runner.\n //\n // Capture the safe-harbour origin exactly once on commit-window\n // open. Written ONLY on this path so a stale origin never lingers\n // into a non-commit navigation.\n this.originIndexDuringCommitState.set(previous);\n const mode = this.commitMode();\n if (mode === 'optimistic') {\n this.activeStepIndex.set(target);\n }\n this.commitHandler.beginTransition(previous, target, action, (accept) => {\n if (accept) {\n // Success - origin no longer needed; clear the rejection\n // flag if the user re-picked the failed target.\n this.originIndexDuringCommitState.set(undefined);\n if (this.lastFailedIndexState() === target) {\n this.lastFailedIndexState.set(undefined);\n }\n if (mode === 'pessimistic') {\n this.activeStepIndex.set(target);\n }\n } else {\n // Reject - flag the target; RETAIN the origin so\n // `liveAnnouncement` can resolve the origin label for the\n // rich rollback phrase. Optimistic rolls back; pessimistic\n // never moved.\n this.lastFailedIndexState.set(target);\n if (mode === 'optimistic') {\n this.activeStepIndex.set(previous);\n }\n }\n });\n }\n\n selectNext(): void {\n const next = this.nextEnabledIndex();\n if (next < this.stepsOnly().length) {\n this.select(next);\n }\n }\n\n selectPrevious(): void {\n const prev = this.previousEnabledIndex();\n if (prev >= 0) {\n this.activeStepIndex.set(prev);\n }\n }\n\n selectById(id: string): void {\n const stepsOnly = this.stepsOnly();\n const idx = stepsOnly.findIndex((n) => n.id === id);\n if (idx >= 0) {\n this.select(idx);\n }\n }\n\n reset(): void {\n this.activeStepIndex.set(0);\n this.commitController.cancel();\n }\n}\n\nexport type { CngxStepStatus };\n","import { InjectionToken } from '@angular/core';\n\nimport type { CngxStepRegistration } from './stepper-host.token';\n\n/**\n * Contract a `CngxStep` sees when it injects a parent group via\n * {@link CNGX_STEP_GROUP_HOST}. Mirrors the presenter's `register` /\n * `unregister` so atoms stay agnostic of root vs. nested host.\n *\n * Surface is registration-only - `id` and `aggregatedStatus` are\n * concrete-class details, not part of the token contract.\n *\n * @category common/stepper\n */\nexport interface CngxStepGroupHost {\n register(handle: CngxStepRegistration): void;\n unregister(id: string): void;\n}\n\n/**\n * DI token providing a `CngxStepGroup`'s contract to nested `CngxStep` atoms.\n * Steps inject this `optional: true` and fall back to {@link CNGX_STEPPER_HOST}.\n *\n * @category common/stepper\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/step-group-host.token.ts\n * @since 0.1.0\n */\nexport const CNGX_STEP_GROUP_HOST = new InjectionToken<CngxStepGroupHost>('CngxStepGroupHost');\n","import { InjectionToken, type Signal, type TemplateRef } from '@angular/core';\n\nimport type { CngxStepNode } from './stepper-host.token';\n\n/**\n * Context delivered to `*cngxStepLabel` templates. Gives typed access\n * to live step state without reaching into the host token.\n *\n * `index` is 1-based in the step-only flat projection (groups excluded).\n * `active` reflects `presenter.activeStepId`; `busy` mirrors\n * `presenter.intendedStepIndex` matching this step; `disabled` reads\n * `node.disabled()`.\n *\n * @category common/stepper\n */\nexport interface CngxStepLabelContext {\n readonly node: CngxStepNode;\n readonly index: number;\n readonly active: boolean;\n readonly busy: boolean;\n readonly disabled: boolean;\n}\n\n/**\n * Context delivered to `*cngxStepContent` templates. Mirrors\n * {@link CngxStepLabelContext} - content templates need the same\n * derivations to gate inner controls on `disabled` / `busy`.\n *\n * @category common/stepper\n */\nexport interface CngxStepContentContext {\n readonly node: CngxStepNode;\n readonly index: number;\n readonly active: boolean;\n readonly busy: boolean;\n readonly disabled: boolean;\n}\n\n/**\n * Contract Level-4 organisms (and consumer-authored stepper skins)\n * consume to render the panel body. Narrower than the presenter's\n * full interface - just enough to project label / content templates\n * and react to active-step changes.\n *\n * @category common/stepper\n */\nexport interface CngxStepPanelHost {\n readonly flatSteps: Signal<readonly CngxStepNode[]>;\n readonly activeStepIndex: Signal<number>;\n readonly activeStepId: Signal<string | null>;\n /** Resolves a step id to its `*cngxStepLabel` template (consumer-supplied). */\n labelTemplateFor(id: string): TemplateRef<CngxStepLabelContext> | null;\n /** Resolves a step id to its `*cngxStepContent` template (consumer-supplied). */\n contentTemplateFor(id: string): TemplateRef<CngxStepContentContext> | null;\n}\n\n/**\n * DI token providing the rendering-surface contract to organism shells\n * (`<cngx-stepper>`, `<cngx-mat-stepper>`) and consumer-authored skins.\n *\n * @category common/stepper\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/step-panel-host.token.ts\n * @since 0.1.0\n */\nexport const CNGX_STEP_PANEL_HOST = new InjectionToken<CngxStepPanelHost>('CngxStepPanelHost');\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport type { CngxStepContentContext } from './step-panel-host.token';\n\n/**\n * Marker directive carrying a `CngxStep`'s content template.\n * Discovered via `contentChild(CngxStepContent)`. Typed with\n * {@link CngxStepContentContext} so `let-busy=\"busy\"` etc. gives\n * typed access to live step state.\n *\n * ```html\n * <ng-template cngxStepContent let-busy=\"busy\">\n * <input [disabled]=\"busy\">\n * </ng-template>\n * ```\n *\n * @category common/stepper\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/step-content.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStep, CngxStepLabel\n * <example-url>http://localhost:4200/#/ui/stepper/stepper-horizontal/three-step-wizard</example-url>\n */\n@Directive({\n selector: 'ng-template[cngxStepContent]',\n standalone: true,\n})\nexport class CngxStepContent {\n readonly templateRef = inject<TemplateRef<CngxStepContentContext>>(TemplateRef);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport type { CngxStepLabelContext } from './step-panel-host.token';\n\n/**\n * Marker directive carrying a `CngxStep`'s label template.\n * Discovered via `contentChild(CngxStepLabel)`. Typed with\n * {@link CngxStepLabelContext} for typed `let-node=\"node\"` /\n * `let-active=\"active\"` access.\n *\n * ```html\n * <ng-template cngxStepLabel let-node=\"node\">\n * {{ node.label() }}\n * </ng-template>\n * ```\n *\n * @category common/stepper\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/step-label.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStep, CngxStepContent, CngxStepGroupHeader\n * <example-url>http://localhost:4200/#/ui/stepper/stepper-custom-labels/mixing-code-label-code-input-with-code-cngxsteplabel-code-slot</example-url>\n */\n@Directive({\n selector: 'ng-template[cngxStepLabel]',\n standalone: true,\n})\nexport class CngxStepLabel {\n readonly templateRef = inject<TemplateRef<CngxStepLabelContext>>(TemplateRef);\n}\n","import {\n computed,\n contentChild,\n DestroyRef,\n Directive,\n inject,\n input,\n linkedSignal,\n type Signal,\n} from '@angular/core';\n\nimport { nextUid } from '@cngx/core/utils';\n\nimport type { CngxErrorAggregatorContract } from '@cngx/common/interactive';\n\nimport { CNGX_STEP_GROUP_HOST } from './step-group-host.token';\nimport { CngxStepContent } from './step-content.directive';\nimport { CngxStepLabel } from './step-label.directive';\nimport { CNGX_STEPPER_HOST, type CngxStepStatus } from './stepper-host.token';\n\n/**\n * Single-step atom. Registers with the nearest host - either a\n * `CngxStepGroup` ({@link CNGX_STEP_GROUP_HOST}) or the root\n * `CngxStepperPresenter` ({@link CNGX_STEPPER_HOST}).\n *\n * `state` is a `linkedSignal` over `[disabled]`, `[completed]`, and\n * the optional `[errorAggregator]`'s `hasError()`.\n *\n * @category common/stepper\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/step.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStepGroup, CngxStepperPresenter, CngxStepLabel, CngxStepContent\n * <example-url>http://localhost:4200/#/ui/stepper/stepper-horizontal/three-step-wizard</example-url>\n */\n@Directive({\n selector: '[cngxStep]',\n exportAs: 'cngxStep',\n standalone: true,\n})\nexport class CngxStep {\n readonly id = input<string>(nextUid('cngx-step'));\n readonly disabled = input<boolean>(false);\n readonly completed = input<boolean>(false);\n readonly label = input<string>('');\n readonly errorAggregator = input<CngxErrorAggregatorContract | undefined>(undefined);\n\n /**\n * Direct error flag for the common \"this step is invalid\" case - no\n * `errorAggregator` boilerplate required. `true` or a non-empty string\n * drives the error state; a string doubles as the inline message\n * (surfaced via the `*cngxStepError` slot and the mini-skin aggregate\n * line). `false` / `''` clear it. The aggregator stays the rich\n * multi-source forms path; the two channels compose (either errors).\n */\n readonly error = input<string | boolean>(false);\n\n /**\n * Resolved direct-error message: the `[error]` string when non-empty,\n * else `undefined`. Carried onto the registration / node so the error\n * slot + aggregate line can render it. `computed` over the input -\n * never written.\n */\n readonly errorMessage: Signal<string | undefined> = computed(() => {\n const value = this.error();\n return typeof value === 'string' && value !== '' ? value : undefined;\n });\n\n protected readonly labelSlot = contentChild(CngxStepLabel);\n protected readonly contentSlot = contentChild(CngxStepContent);\n\n readonly labelTemplate = this.labelSlot;\n readonly contentTemplate = this.contentSlot;\n\n /**\n * Per-step status derived from inputs + aggregator. `linkedSignal`\n * with structural equal - never written via `effect`.\n */\n readonly state: Signal<CngxStepStatus> = linkedSignal({\n source: () => {\n const directError = this.error();\n return {\n disabled: this.disabled(),\n completed: this.completed(),\n errored:\n (directError !== false && directError !== '') ||\n (this.errorAggregator()?.hasError?.() ?? false),\n };\n },\n computation: ({ disabled, completed, errored }) => {\n if (disabled) {\n return 'disabled';\n }\n if (errored) {\n return 'error';\n }\n if (completed) {\n return 'success';\n }\n return 'idle';\n },\n equal: Object.is,\n });\n\n constructor() {\n const groupHost = inject(CNGX_STEP_GROUP_HOST, { optional: true });\n const stepperHost = inject(CNGX_STEPPER_HOST, { optional: true });\n const host = groupHost ?? stepperHost;\n if (!host) {\n throw new Error(\n 'CngxStep: no enclosing CngxStepperPresenter or CngxStepGroup found. ' +\n 'Wrap the step inside an element carrying [cngxStepper] or [cngxStepGroup].',\n );\n }\n const stepId = this.id();\n host.register({\n id: stepId,\n kind: 'step',\n label: this.label,\n disabled: this.disabled,\n state: this.state,\n errorAggregator: this.errorAggregator,\n errorMessage: this.errorMessage,\n });\n inject(DestroyRef).onDestroy(() => host.unregister(stepId));\n }\n}\n","import { computed, DestroyRef, Directive, inject, input, signal, type Signal } from '@angular/core';\n\nimport { nextUid } from '@cngx/core/utils';\n\nimport { CNGX_STEP_GROUP_HOST, type CngxStepGroupHost } from './step-group-host.token';\nimport {\n CNGX_STEPPER_HOST,\n type CngxStepRegistration,\n type CngxStepStatus,\n} from './stepper-host.token';\n\n/**\n * Step-group atom. Registers with the root presenter as a `kind: 'group'`\n * node and provides {@link CNGX_STEP_GROUP_HOST} so nested `CngxStep`\n * atoms register with the group, not the root.\n *\n * `aggregatedStatus` rolls up child states: `error` if any errored,\n * `success` if all are success, `pending` if any is pending or busy,\n * otherwise `idle`.\n *\n * @category common/stepper\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/step-group.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStep, CngxStepperPresenter, CngxStepGroupHeader\n * <example-url>http://localhost:4200/#/ui/stepper/stepper-hierarchical/group-nested-steps-trailing-root-step</example-url>\n */\n@Directive({\n selector: '[cngxStepGroup]',\n exportAs: 'cngxStepGroup',\n standalone: true,\n providers: [{ provide: CNGX_STEP_GROUP_HOST, useExisting: CngxStepGroup }],\n})\nexport class CngxStepGroup implements CngxStepGroupHost {\n readonly id = input<string>(nextUid('cngx-step-group'));\n readonly disabled = input<boolean>(false);\n readonly label = input<string>('');\n\n // Local child registry - only feeds `aggregatedStatus` below.\n // The presenter owns the canonical tree.\n private readonly childRegistry = signal<readonly CngxStepRegistration[]>([]);\n\n readonly aggregatedStatus: Signal<CngxStepStatus> = computed(\n () => {\n const states = this.childRegistry().map((c) => c.state());\n if (states.length === 0) {\n return 'idle';\n }\n if (states.some((s) => s === 'error')) {\n return 'error';\n }\n if (states.some((s) => s === 'pending' || s === 'busy')) {\n return 'pending';\n }\n if (states.every((s) => s === 'success')) {\n return 'success';\n }\n return 'idle';\n },\n { equal: Object.is },\n );\n\n private readonly stepperHost = inject(CNGX_STEPPER_HOST, { optional: true });\n\n constructor() {\n if (!this.stepperHost) {\n throw new Error(\n 'CngxStepGroup: no enclosing CngxStepperPresenter found. ' +\n 'Wrap the group inside an element carrying [cngxStepper].',\n );\n }\n const groupId = this.id();\n this.stepperHost.register({\n id: groupId,\n kind: 'group',\n label: this.label,\n disabled: this.disabled,\n state: this.aggregatedStatus,\n });\n const stepperHost = this.stepperHost;\n inject(DestroyRef).onDestroy(() => stepperHost.unregister(groupId));\n }\n\n register(handle: CngxStepRegistration): void {\n this.childRegistry.update((cur) => [...cur, handle]);\n // Forward to the root with this group as parent so the tree shape is correct.\n this.stepperHost!.register(handle, this.id());\n }\n\n unregister(id: string): void {\n this.childRegistry.update((cur) => cur.filter((c) => c.id !== id));\n this.stepperHost!.unregister(id);\n }\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport type { CngxStepNode, CngxStepStatus } from '../stepper-host.token';\n\n/**\n * Context passed to the `*cngxStepIndicator` template. Drives the\n * numbered / checkmark / error glyph inside each step button. The\n * `<button>` shell - `aria-current`, `aria-controls`, click handler -\n * stays library-owned.\n *\n * `status` mirrors `node.state()`. `busy` is the presenter-derived\n * \"this step is the in-flight commit target\" flag - independent of\n * `status === 'pending'` (which is the aggregate landmark state).\n *\n * @category common/stepper/slots\n */\nexport interface CngxStepIndicatorContext {\n /** Convenience alias for `position` - usable as `let-position` shorthand. */\n readonly $implicit: number;\n /** 1-based position of this step in the flat step-only projection. */\n readonly position: number;\n /** The step node carrying id / label / disabled / state signals. */\n readonly node: CngxStepNode;\n /** `true` when this step is the current `activeStepId`. */\n readonly active: boolean;\n /** Live step status - drives the visual variant (idle / success / error / busy). */\n readonly status: CngxStepStatus;\n /** `true` when this step is the in-flight commit target. */\n readonly busy: boolean;\n}\n\n/**\n * Slot directive for the indicator-glyph template on `<cngx-stepper>`.\n * Discovered via `contentChild`; cascades through\n * `CNGX_STEPPER_CONFIG.templates.indicator` before falling back to\n * the built-in numeric span (`{{ position }}`).\n *\n * ```html\n * <cngx-stepper>\n * <ng-template cngxStepIndicator let-position let-node=\"node\" let-status=\"status\">\n * @if (status === 'success') {\n * <my-icon name=\"check\" />\n * } @else if (status === 'error') {\n * <my-icon name=\"alert\" />\n * } @else {\n * <span class=\"my-step-num\">{{ position }}</span>\n * }\n * </ng-template>\n * </cngx-stepper>\n * ```\n *\n * @category common/stepper/slots\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/slots/step-indicator.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStepBadge, CngxStepBusySpinner, CngxStepRejection, CngxStepGroupHeader\n * <example-url>http://localhost:4200/#/ui/stepper/stepper-slot-overrides/custom-indicator-glyph-via-code-cngxstepindicator-code</example-url>\n * <example-url>http://localhost:4200/#/ui/stepper/stepper-slot-overrides/cross-skin-indicator-override</example-url>\n */\n@Directive({\n selector: 'ng-template[cngxStepIndicator]',\n exportAs: 'cngxStepIndicator',\n standalone: true,\n})\nexport class CngxStepIndicator {\n readonly templateRef = inject<TemplateRef<CngxStepIndicatorContext>>(TemplateRef);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport type { CngxStepNode } from '../stepper-host.token';\n\n/**\n * Context passed to the `*cngxStepBadge` template. Drives the error\n * badge inside a step button when `errorAggregator?.shouldShow()` is\n * truthy. Consumers swap the built-in `'!'` glyph for a counter pill\n * or branded marker; the visibility gate stays library-owned.\n *\n * @category common/stepper/slots\n */\nexport interface CngxStepBadgeContext {\n /** Aggregated error count for this step (≥ 1 when shown). */\n readonly count: number;\n /** The step node carrying id / label / state signals. */\n readonly node: CngxStepNode;\n}\n\n/**\n * Slot directive for the error-badge template on `<cngx-stepper>`.\n * Discovered via `contentChild`; cascades through\n * `CNGX_STEPPER_CONFIG.templates.badge` before falling back to\n * `CNGX_STEPPER_GLYPHS.errorBadge`.\n *\n * ```html\n * <cngx-stepper>\n * <ng-template cngxStepBadge let-count=\"count\">\n * <span class=\"my-badge-pill\">{{ count }}</span>\n * </ng-template>\n * </cngx-stepper>\n * ```\n *\n * @category common/stepper/slots\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/slots/step-badge.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStepIndicator, CngxStepBusySpinner, CngxStepRejection\n * <example-url>http://localhost:4200/#/ui/stepper/stepper-slot-overrides/custom-error-badge-via-code-cngxstepbadge-code</example-url>\n * <example-url>http://localhost:4200/#/ui/stepper/stepper-error-aggregation/per-step-error-badges</example-url>\n */\n@Directive({\n selector: 'ng-template[cngxStepBadge]',\n exportAs: 'cngxStepBadge',\n standalone: true,\n})\nexport class CngxStepBadge {\n readonly templateRef = inject<TemplateRef<CngxStepBadgeContext>>(TemplateRef);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport type { CngxStepNode } from '../stepper-host.token';\n\n/**\n * Context passed to the `*cngxStepBusySpinner` template. Drives the\n * pending-commit overlay on the in-flight target step. Renders only\n * when the step matches `presenter.intendedStepIndex()` with\n * `commitState.status() === 'pending'`.\n *\n * @category common/stepper/slots\n */\nexport interface CngxStepBusySpinnerContext {\n /** The step node carrying id / label / state signals. */\n readonly node: CngxStepNode;\n}\n\n/**\n * Slot directive for the busy-spinner template on `<cngx-stepper>`.\n * Discovered via `contentChild`; cascades through\n * `CNGX_STEPPER_CONFIG.templates.busySpinner` before falling back to\n * the built-in pulse-animation span.\n *\n * ```html\n * <cngx-stepper>\n * <ng-template cngxStepBusySpinner>\n * <my-spinner size=\"sm\" />\n * </ng-template>\n * </cngx-stepper>\n * ```\n *\n * @category common/stepper/slots\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/slots/step-busy-spinner.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStepIndicator, CngxStepBadge, CngxStepRejection\n * <example-url>http://localhost:4200/#/ui/stepper/stepper-slot-overrides/custom-busy-spinner-via-code-cngxstepbusyspinner-code</example-url>\n */\n@Directive({\n selector: 'ng-template[cngxStepBusySpinner]',\n exportAs: 'cngxStepBusySpinner',\n standalone: true,\n})\nexport class CngxStepBusySpinner {\n readonly templateRef = inject<TemplateRef<CngxStepBusySpinnerContext>>(\n TemplateRef,\n );\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport type { CngxStepNode } from '../stepper-host.token';\n\n/**\n * Context passed to the `*cngxStepRejection` template. Renders on the\n * strip step the most recent commit was rolled back FROM - sibling of\n * the tabs `cngxTabRejectionIcon` slot. Renders only when\n * `presenter.lastFailedIndex()` matches the step's flat-index.\n *\n * `originLabel` is the safe-harbour step's label, derived from\n * `presenter.originIndexDuringCommit()`. May be `undefined` when the\n * origin index is out of range (synchronous-rejection edge case);\n * gate richer UI on its presence.\n *\n * @category common/stepper/slots\n */\nexport interface CngxStepRejectionContext {\n /** Flat-index of the rejected step (`presenter.lastFailedIndex()`). */\n readonly failedIndex: number;\n /** Resolved label of the safe-harbour step, when derivable. */\n readonly originLabel: string | undefined;\n /** The rejected step node carrying id / label / state signals. */\n readonly node: CngxStepNode;\n}\n\n/**\n * Slot directive for the rejection-decoration template on\n * `<cngx-stepper>`. Discovered via `contentChild`; cascades through\n * `CNGX_STEPPER_CONFIG.templates.rejection` before falling back to\n * `CNGX_STEPPER_GLYPHS.rejectionIcon`.\n *\n * Symmetric context shape with the upcoming tabs `cngxTabRejectionIcon`\n * slot so consumer templates port directly between the two families.\n *\n * ```html\n * <cngx-stepper>\n * <ng-template cngxStepRejection let-failedIndex=\"failedIndex\" let-originLabel=\"originLabel\">\n * <my-icon name=\"rollback\" />\n * @if (originLabel) {\n * <span class=\"cngx-sr-only\">Rolled back to {{ originLabel }}</span>\n * }\n * </ng-template>\n * </cngx-stepper>\n * ```\n *\n * @category common/stepper/slots\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/slots/step-rejection.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStepBadge, CngxStepIndicator, CngxStepBusySpinner\n * <example-url>http://localhost:4200/#/ui/stepper/stepper-slot-overrides/rejection-decoration-via-code-cngxsteprejection-code</example-url>\n */\n@Directive({\n selector: 'ng-template[cngxStepRejection]',\n exportAs: 'cngxStepRejection',\n standalone: true,\n})\nexport class CngxStepRejection {\n readonly templateRef = inject<TemplateRef<CngxStepRejectionContext>>(TemplateRef);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport type { CngxStepNode } from '../stepper-host.token';\n\n/**\n * Context passed to the `*cngxStepError` template. Renders the\n * validation-error reason for a step in the error state - sibling of\n * the commit-channel `*cngxStepRejection` slot. The two channels stay\n * distinct: rejection decorates the step a commit rolled back FROM;\n * this slot surfaces the per-step validation message.\n *\n * `message` resolves the direct `[error]` string > the first\n * aggregator label > the i18n `errored` status phrase, so a template\n * that renders `{{ message }}` always shows a non-empty reason.\n * `errorLabels` / `announcement` expose the richer aggregator surface\n * for consumers that want a list or the full SR phrase.\n *\n * @category common/stepper/slots\n */\nexport interface CngxStepErrorContext {\n /** The errored step node carrying id / label / state signals. */\n readonly node: CngxStepNode;\n /** Resolved error reason (direct `[error]` string > aggregator label > i18n). */\n readonly message: string;\n /** Aggregator error labels, or an empty array when none. */\n readonly errorLabels: readonly string[];\n /** Aggregator SR announcement phrase, or an empty string when none. */\n readonly announcement: string;\n}\n\n/**\n * Slot directive for the per-step error-message template on\n * `<cngx-stepper>`. Discovered via `contentChild`; cascades through\n * `CNGX_STEPPER_CONFIG.templates.stepError` before falling back to the\n * built-in `{{ message }}` text. Mirrors {@link CngxStepRejection} so\n * consumer-authored templates read the same way across both channels.\n *\n * ```html\n * <cngx-stepper>\n * <ng-template cngxStepError let-message=\"message\" let-errorLabels=\"errorLabels\">\n * <strong>{{ message }}</strong>\n * @if (errorLabels.length > 1) {\n * <ul>\n * @for (label of errorLabels; track label) {\n * <li>{{ label }}</li>\n * }\n * </ul>\n * }\n * </ng-template>\n * </cngx-stepper>\n * ```\n *\n * @category common/stepper/slots\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/slots/step-error.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStepRejection, CngxStepBadge, CngxStep\n */\n@Directive({\n selector: 'ng-template[cngxStepError]',\n exportAs: 'cngxStepError',\n standalone: true,\n})\nexport class CngxStepError {\n readonly templateRef = inject<TemplateRef<CngxStepErrorContext>>(TemplateRef);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport type { CngxStepNode, CngxStepStatus } from '../stepper-host.token';\n\n/**\n * Context passed to the `*cngxStepGroupHeader` template. Drives the\n * group-row landmark for `kind === 'group'` nodes. The `role=\"group\"`\n * + `aria-roledescription` shell stays library-owned.\n *\n * `group` carries a `CngxStepNode` with the runtime guarantee\n * `kind === 'group'` (the slot only fires for group nodes).\n * `expanded` is reserved for future collapsible groups - passed `true`\n * today; declaring it now avoids a breaking change later.\n *\n * @category common/stepper/slots\n */\nexport interface CngxStepGroupHeaderContext {\n /** The group node carrying id / label / state / children signals. */\n readonly group: CngxStepNode;\n /** Reserved - `true` while the group's children are visible. */\n readonly expanded: boolean;\n /** Aggregated group status (rolls up children - drives heading variant). */\n readonly status: CngxStepStatus;\n}\n\n/**\n * Slot directive for the group-header template on `<cngx-stepper>`.\n * Discovered via `contentChild`; cascades through\n * `CNGX_STEPPER_CONFIG.templates.groupHeader` before falling back to\n * the built-in `<span class=\"cngx-stepper__group-label\">`.\n *\n * ```html\n * <cngx-stepper>\n * <ng-template cngxStepGroupHeader let-group=\"group\" let-status=\"status\">\n * <h4 [class.is-error]=\"status === 'error'\">{{ group.label() }}</h4>\n * </ng-template>\n * </cngx-stepper>\n * ```\n *\n * @category common/stepper/slots\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/slots/step-group-header.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStepGroup, CngxStepIndicator, CngxStepLabel\n * <example-url>http://localhost:4200/#/ui/stepper/stepper-slot-overrides/custom-group-header-via-code-cngxstepgroupheader-code</example-url>\n */\n@Directive({\n selector: 'ng-template[cngxStepGroupHeader]',\n exportAs: 'cngxStepGroupHeader',\n standalone: true,\n})\nexport class CngxStepGroupHeader {\n readonly templateRef = inject<TemplateRef<CngxStepGroupHeaderContext>>(TemplateRef);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\n/**\n * Slot directive for the empty-state placeholder on `<cngx-stepper>`.\n * Rendered when `flatSteps()` is empty - async-loading or\n * server-driven step lists get a \"no steps yet\" landmark rather than\n * a collapsed strip.\n *\n * Discovered via `contentChild`; cascades through\n * `CNGX_STEPPER_CONFIG.templates.empty` before falling back to no\n * markup (Honest-Absence default).\n *\n * ```html\n * <cngx-stepper>\n * <ng-template cngxStepperEmpty>\n * <cngx-empty-state heading=\"No steps configured yet\" />\n * </ng-template>\n * </cngx-stepper>\n * ```\n *\n * @category common/stepper/slots\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/slots/stepper-empty.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStepIndicator, CngxStepGroupHeader\n * <example-url>http://localhost:4200/#/ui/stepper/stepper-slot-overrides/empty-state-placeholder-via-code-cngxstepperempty-code</example-url>\n */\n@Directive({\n selector: 'ng-template[cngxStepperEmpty]',\n exportAs: 'cngxStepperEmpty',\n standalone: true,\n})\nexport class CngxStepperEmpty {\n readonly templateRef = inject<TemplateRef<void>>(TemplateRef);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport type { CngxStepNode } from '../stepper-host.token';\n\n/**\n * Context passed to the `*cngxDotStepperDot` template. Drives the dot\n * body inside `<cngx-dot-stepper>`. The `<span class=\"cngx-dot-stepper__dot\">`\n * shell - `role=\"img\"`, `aria-current`, `aria-label`, class\n * modifiers - stays library-owned; only the dot body content becomes\n * overrideable so consumers can swap the default empty body for an\n * icon, glyph, or branded indicator.\n *\n * Smaller than {@link CngxStepIndicatorContext} on purpose - the dot\n * stepper does not surface step status/busy state visually, so the\n * context strips to the four fields a consumer actually needs.\n *\n * @category common/stepper/slots\n */\nexport interface CngxDotStepperDotContext {\n /** Convenience alias for `index` - usable as `let-index` shorthand. */\n readonly $implicit: number;\n /** 0-based position of this dot in the step-only projection. */\n readonly index: number;\n /** The step node carrying id / label / state signals. */\n readonly node: CngxStepNode;\n /** `true` when this dot represents the current active step. */\n readonly active: boolean;\n /** `true` when this dot represents a completed (already-traversed) step. */\n readonly completed: boolean;\n}\n\n/**\n * Slot directive for the dot-body template on `<cngx-dot-stepper>`.\n * Discovered via `contentChild`; cascades through\n * `CNGX_STEPPER_CONFIG.templates.dotStepperDot` before falling back to\n * the built-in empty body (the span itself paints the dot fill via CSS).\n *\n * ```html\n * <cngx-dot-stepper [(activeStepIndex)]=\"active\" aria-label=\"Carousel\">\n * <ng-template cngxDotStepperDot let-index let-active=\"active\" let-completed=\"completed\">\n * @if (active) {\n * <svg viewBox=\"0 0 10 10\" aria-hidden=\"true\"><circle cx=\"5\" cy=\"5\" r=\"3\" fill=\"currentColor\" /></svg>\n * } @else if (completed) {\n * <svg viewBox=\"0 0 10 10\" aria-hidden=\"true\"><path d=\"M2 5l2 2 4-4\" stroke=\"currentColor\" fill=\"none\" /></svg>\n * }\n * </ng-template>\n * <div cngxStep label=\"Slide 1\"></div>\n * <div cngxStep label=\"Slide 2\"></div>\n * </cngx-dot-stepper>\n * ```\n *\n * @category common/stepper/slots\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/slots/dot-stepper-dot.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStepIndicator, CngxStepBadge, CngxStepBusySpinner, CngxStepRejection\n * <example-url>http://localhost:4200/#/ui/stepper/dot-stepper/icon-dots-via-code-cngxdotstepperdot-code</example-url>\n * <example-url>http://localhost:4200/#/ui/stepper/dot-stepper/mobile-carousel</example-url>\n */\n@Directive({\n selector: 'ng-template[cngxDotStepperDot]',\n exportAs: 'cngxDotStepperDot',\n standalone: true,\n})\nexport class CngxDotStepperDot {\n readonly templateRef = inject<TemplateRef<CngxDotStepperDotContext>>(TemplateRef);\n}\n","import { computed, type Signal, type TemplateRef } from '@angular/core';\n\nimport type { CngxStepperConfig } from '../stepper-config';\nimport type {\n CngxStepBadge,\n CngxStepBadgeContext,\n} from './step-badge.directive';\nimport type {\n CngxStepBusySpinner,\n CngxStepBusySpinnerContext,\n} from './step-busy-spinner.directive';\nimport type {\n CngxStepGroupHeader,\n CngxStepGroupHeaderContext,\n} from './step-group-header.directive';\nimport type {\n CngxStepIndicator,\n CngxStepIndicatorContext,\n} from './step-indicator.directive';\nimport type {\n CngxStepError,\n CngxStepErrorContext,\n} from './step-error.directive';\nimport type {\n CngxStepRejection,\n CngxStepRejectionContext,\n} from './step-rejection.directive';\nimport type { CngxStepperEmpty } from './stepper-empty.directive';\n\n/**\n * Inputs to {@link createStepperTemplateBindings}. The organism owns\n * the `contentChild()` queries (NG8110 - must run in component\n * injection context) and the resolved {@link CngxStepperConfig}; this\n * factory absorbs the 3-stage cascade per slot key.\n *\n * @category common/stepper/slots\n */\nexport interface CngxStepperTemplateBindingsOptions {\n readonly indicatorSlot: Signal<CngxStepIndicator | undefined>;\n readonly badgeSlot: Signal<CngxStepBadge | undefined>;\n readonly busySpinnerSlot: Signal<CngxStepBusySpinner | undefined>;\n readonly rejectionSlot: Signal<CngxStepRejection | undefined>;\n /** Optional - the error slot is desktop-label-area only; absent on variants that have no label region. */\n readonly errorSlot?: Signal<CngxStepError | undefined>;\n readonly groupHeaderSlot: Signal<CngxStepGroupHeader | undefined>;\n readonly emptySlot: Signal<CngxStepperEmpty | undefined>;\n readonly config: CngxStepperConfig;\n}\n\n/**\n * Output of {@link createStepperTemplateBindings}. One resolved\n * `Signal<TemplateRef | null>` per slot - `null` falls through to the\n * organism's built-in default markup.\n *\n * @category common/stepper/slots\n */\nexport interface CngxStepperTemplateBindings {\n readonly indicator: Signal<TemplateRef<CngxStepIndicatorContext> | null>;\n readonly badge: Signal<TemplateRef<CngxStepBadgeContext> | null>;\n readonly busySpinner: Signal<TemplateRef<CngxStepBusySpinnerContext> | null>;\n readonly rejection: Signal<TemplateRef<CngxStepRejectionContext> | null>;\n readonly stepError: Signal<TemplateRef<CngxStepErrorContext> | null>;\n readonly groupHeader: Signal<TemplateRef<CngxStepGroupHeaderContext> | null>;\n readonly empty: Signal<TemplateRef<void> | null>;\n}\n\n/**\n * Wires the 3-stage template cascade for the `<cngx-stepper>` skin\n * slots: per-instance directive > `CNGX_STEPPER_CONFIG.templates.<key>`\n * > `null` (built-in default).\n *\n * Pure - no DI, no side effects. Safe to call from a field-init\n * block. Sibling of `createTabOverflowTemplateBindings` and the\n * family-wide `createTemplateRegistry`.\n *\n * Tabs has no parallel slot surface yet - see\n * `stepper-accepted-debt §3` for the planned Phase-4 closure.\n *\n * @category common/stepper/slots\n */\nexport function createStepperTemplateBindings(\n opts: CngxStepperTemplateBindingsOptions,\n): CngxStepperTemplateBindings {\n return {\n indicator: computed<TemplateRef<CngxStepIndicatorContext> | null>(\n () =>\n opts.indicatorSlot()?.templateRef ??\n opts.config.templates?.indicator ??\n null,\n ),\n badge: computed<TemplateRef<CngxStepBadgeContext> | null>(\n () =>\n opts.badgeSlot()?.templateRef ??\n opts.config.templates?.badge ??\n null,\n ),\n busySpinner: computed<TemplateRef<CngxStepBusySpinnerContext> | null>(\n () =>\n opts.busySpinnerSlot()?.templateRef ??\n opts.config.templates?.busySpinner ??\n null,\n ),\n rejection: computed<TemplateRef<CngxStepRejectionContext> | null>(\n () =>\n opts.rejectionSlot()?.templateRef ??\n opts.config.templates?.rejection ??\n null,\n ),\n stepError: computed<TemplateRef<CngxStepErrorContext> | null>(\n () =>\n opts.errorSlot?.()?.templateRef ??\n opts.config.templates?.stepError ??\n null,\n ),\n groupHeader: computed<TemplateRef<CngxStepGroupHeaderContext> | null>(\n () =>\n opts.groupHeaderSlot()?.templateRef ??\n opts.config.templates?.groupHeader ??\n null,\n ),\n empty: computed<TemplateRef<void> | null>(\n () =>\n opts.emptySlot()?.templateRef ??\n opts.config.templates?.empty ??\n null,\n ),\n };\n}\n","/**\n * Default glyphs for `<cngx-stepper>` skin slots. Used when neither a\n * per-instance slot directive nor `CNGX_STEPPER_CONFIG.templates.<key>`\n * overrides the built-in span. Sibling of `CNGX_SELECT_GLYPHS` /\n * `CNGX_TABS_GLYPHS`.\n *\n * Exported with `@internal` so the organism (and mat-twin) can share\n * the literals across the secondary-entry boundary that Sheriff\n * forbids deep-relative imports across. Consumers customise via\n * `*cngxStep*` slots or `withStep*Template` features.\n *\n * @internal\n * @category common/stepper\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/glyphs.ts\n * @since 0.1.0\n */\nexport const CNGX_STEPPER_GLYPHS = {\n /** Default visual for `*cngxStepBadge` when no override is bound. */\n errorBadge: '!',\n /** Default visual for `*cngxStepRejection` when no override is bound. */\n rejectionIcon: '!',\n} as const;\n","import {\n afterNextRender,\n computed,\n DestroyRef,\n Directive,\n effect,\n inject,\n input,\n output,\n untracked,\n} from '@angular/core';\nimport { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';\nimport { NavigationEnd, Router } from '@angular/router';\nimport { filter } from 'rxjs/operators';\n\nimport { injectStepperConfig } from './stepper-config';\nimport { CNGX_STEPPER_HOST } from './stepper-host.token';\n\n/**\n * URL deep-linking for the stepper. Bidirectional sync between\n * `activeStepId` and a URL fragment / query-param. Opt-in via\n * `[cngxStepperRouterSync]` on the presenter element.\n *\n * - `mode = 'fragment'` (default) → `#step=customer`\n * - `mode = 'queryParam'` with `paramName = 'step'` → `?step=customer`\n *\n * `Router` is optional - without `@angular/router` the directive\n * dev-warns once and becomes a no-op.\n *\n * @category common/stepper\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/router-sync.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStepperPresenter, CNGX_STEPPER_CONFIG\n * <example-url>http://localhost:4200/#/ui/stepper/stepper-router-sync/deep-linking-with-fragment-queryparam-modes</example-url>\n */\n@Directive({\n selector: '[cngxStepperRouterSync]',\n exportAs: 'cngxStepperRouterSync',\n standalone: true,\n})\nexport class CngxStepperRouterSync {\n // Default undefined so the cascade resolves through CNGX_STEPPER_CONFIG.\n readonly modeInput = input<'fragment' | 'queryParam' | undefined>(undefined, { alias: 'mode' });\n readonly paramNameInput = input<string | undefined>(undefined, {\n alias: 'paramName',\n });\n\n private readonly config = injectStepperConfig();\n\n readonly mode = computed<'fragment' | 'queryParam'>(\n () => this.modeInput() ?? this.config.routerSyncMode ?? 'fragment',\n );\n readonly paramName = computed<string>(\n () => this.paramNameInput() ?? this.config.routerSyncParam ?? 'step',\n );\n\n /** Emits when a `router.navigate` rejection is observed. */\n readonly syncError = output<unknown>();\n\n private readonly host = inject(CNGX_STEPPER_HOST, { host: true });\n private readonly router = inject(Router, { optional: true });\n\n constructor() {\n if (!this.router) {\n afterNextRender(() => {\n console.warn(\n 'CngxStepperRouterSync: no Router available - directive is a no-op. ' +\n 'Provide @angular/router via provideRouter(...) to enable deep-linking.',\n );\n });\n return;\n }\n const router = this.router;\n\n afterNextRender(() => {\n const initial =\n this.mode() === 'fragment'\n ? router.routerState.snapshot.root.fragment\n : (router.routerState.snapshot.root.queryParamMap.get(this.paramName()) ?? null);\n if (initial) {\n const value = this.mode() === 'fragment' ? this.parseFragment(initial) : initial;\n if (value) {\n this.host.selectById(value);\n }\n }\n });\n\n effect(() => {\n const id = this.host.activeStepId();\n if (!id) {\n return;\n }\n untracked(() => {\n const navigation =\n this.mode() === 'fragment'\n ? router.navigate([], {\n fragment: `${this.paramName()}=${id}`,\n queryParamsHandling: 'merge',\n replaceUrl: true,\n })\n : router.navigate([], {\n queryParams: { [this.paramName()]: id },\n queryParamsHandling: 'merge',\n replaceUrl: true,\n });\n navigation.catch?.((err: unknown) => this.syncError.emit(err));\n });\n });\n\n const navEnd = toSignal(\n router.events.pipe(\n filter((e): e is NavigationEnd => e instanceof NavigationEnd),\n takeUntilDestroyed(inject(DestroyRef)),\n ),\n { initialValue: null },\n );\n effect(() => {\n const e = navEnd();\n if (!e) {\n return;\n }\n untracked(() => {\n const next =\n this.mode() === 'fragment'\n ? this.parseFragment(router.routerState.snapshot.root.fragment ?? '')\n : (router.routerState.snapshot.root.queryParamMap.get(this.paramName()) ?? null);\n if (next && next !== this.host.activeStepId()) {\n this.host.selectById(next);\n }\n });\n });\n }\n\n private parseFragment(fragment: string): string | null {\n const param = this.paramName();\n const segments = fragment.split('&');\n for (const seg of segments) {\n const [key, val] = seg.split('=');\n if (key === param && val) {\n return val;\n }\n }\n return null;\n }\n}\n","import { inject, InjectionToken, type Provider } from '@angular/core';\n\n/**\n * Status-pill labels used by the `stripe-status-rich` skin (and any\n * future skin / variant that surfaces a per-step status pill). Sub-\n * bundle of {@link CngxStepperI18n}; consumers override partial keys\n * via {@link withStepperI18nLabels} - un-overridden keys keep their\n * English defaults.\n *\n * @category common/stepper/i18n\n */\nexport interface CngxStepperStatusLabels {\n readonly done: string;\n readonly inProgress: string;\n readonly upNext: string;\n readonly errored: string;\n}\n\n/**\n * Stepper i18n surface. Library defaults are English; locales come from\n * consumer overrides via {@link provideStepperI18n}. Sibling of\n * `CNGX_TABS_I18N` / `CNGX_CHART_I18N`.\n *\n * @category common/stepper/i18n\n */\nexport interface CngxStepperI18n {\n readonly stepperLabel: string;\n /**\n * Landmark `aria-roledescription` for compact step-indicator\n * surfaces such as the dot stepper and the mobile-dot collapse\n * fallback. Mirrors the W3C APG step-indicator pattern.\n *\n * @category common/stepper/i18n\n */\n readonly stepIndicatorRoleDescription: string;\n readonly selectedStep: (label: string, position: number, count: number) => string;\n readonly stepCompleted: string;\n readonly stepErrored: string;\n readonly stepHasErrors: (count: number) => string;\n readonly previousStep: string;\n readonly nextStep: string;\n /**\n * @deprecated Superseded by {@link commitRolledBackTo}. Retained as\n * defensive fallback in `liveAnnouncement` when the origin label is\n * unresolvable (unlabeled step, or `commitState` driven outside `select()`).\n */\n readonly commitFailedRetry: string;\n /**\n * Polite SR announcement on `idle → pending`. Pillar 2.\n */\n readonly commitInFlight: string;\n /**\n * Origin-aware rollback phrase. Read on `pending → error` when both\n * `lastFailedIndex` and `originIndexDuringCommit` resolve. Receives\n * the safe-harbour label, yields e.g. `Reverted to step \"Customer\".`.\n */\n readonly commitRolledBackTo: (originLabel: string) => string;\n /**\n * Persistent suffix on the per-step `aria-describedby` while\n * `presenter.lastFailedIndex()` matches the step. Distinct from\n * {@link commitRolledBackTo} (transient live-region phrase) - this\n * suffix is reachable when AT users navigate back to the rejected\n * step after the announcement has faded. Pillar 2.\n */\n readonly stepRolledBackSuffix: string;\n /**\n * Per-state pill labels surfaced by the `stripe-status-rich` skin\n * (and any future skin / variant that paints a state pill). English\n * defaults; consumer partial overrides via\n * {@link withStepperI18nLabels} keep un-overridden keys intact.\n */\n readonly statusLabels: CngxStepperStatusLabels;\n /**\n * Short progress format used by `CngxProgressBarStepper`'s optional\n * step-count subtext and by `CngxTextStepper`. Receives the\n * 1-based current position and total step count; default\n * `(current, total) => 'Step ${current} of ${total}'`.\n *\n * @category common/stepper/i18n\n */\n readonly textStepperFormat: (current: number, total: number) => string;\n}\n\n/**\n * Partial-override shape for {@link withStepperI18nLabels}. Behaves as\n * `Partial<CngxStepperI18n>` for top-level keys, plus a nested partial\n * for {@link CngxStepperStatusLabels} so consumers can override one\n * pill label without restating the full status-label bundle.\n *\n * @category common/stepper/i18n\n */\nexport type CngxStepperI18nOverrides = Omit<Partial<CngxStepperI18n>, 'statusLabels'> & {\n readonly statusLabels?: Partial<CngxStepperStatusLabels>;\n};\n\n/** @internal */\nconst STEPPER_I18N_DEFAULTS: CngxStepperI18n = {\n stepperLabel: 'Stepper',\n stepIndicatorRoleDescription: 'Step indicator',\n selectedStep: (label, position, count) => `Step ${position} of ${count}: ${label}`,\n stepCompleted: 'Completed',\n stepErrored: 'Has errors',\n stepHasErrors: (count) => `${count} error${count === 1 ? '' : 's'}`,\n previousStep: 'Previous step',\n nextStep: 'Next step',\n commitFailedRetry: 'Commit failed - retry?',\n commitInFlight: 'Committing step…',\n commitRolledBackTo: (originLabel) => `Reverted to step \"${originLabel}\".`,\n stepRolledBackSuffix: 'This step was rolled back.',\n statusLabels: {\n done: 'Done',\n inProgress: 'In progress',\n upNext: 'Up next',\n errored: 'Errored',\n },\n textStepperFormat: (current, total) => `Step ${current} of ${total}`,\n};\n\n/**\n * DI token for the resolved stepper i18n bundle. `providedIn: 'root'`\n * with English defaults.\n *\n * @category common/stepper/i18n\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/i18n/stepper-i18n.ts\n * @since 0.1.0\n */\nexport const CNGX_STEPPER_I18N = new InjectionToken<CngxStepperI18n>('CngxStepperI18n', {\n providedIn: 'root',\n factory: () => STEPPER_I18N_DEFAULTS,\n});\n\n/**\n * Feature shape consumed by {@link provideStepperI18n} and {@link provideCngxStepper}.\n * Hidden `_target: 'i18n'` discriminator routes through the family aggregator.\n * Sibling of `CngxTabsI18nFeature`.\n *\n * @category common/stepper/i18n\n */\nexport type CngxStepperI18nFeature = ((bundle: CngxStepperI18n) => CngxStepperI18n) & {\n readonly _target: 'i18n';\n};\n\n/**\n * Brands an i18n mutator with `_target: 'i18n'`. Every `with*` i18n\n * feature returns one of these.\n *\n * @internal\n */\nfunction defineStepperI18nFeature(\n fn: (bundle: CngxStepperI18n) => CngxStepperI18n,\n): CngxStepperI18nFeature {\n return Object.assign(fn, { _target: 'i18n' as const });\n}\n\n/**\n * Override stepper i18n labels. Partial override - unset keys keep\n * the English default. {@link CngxStepperStatusLabels} is merged\n * key-by-key so consumers can override one pill label without\n * restating the rest. Sibling of `withStepperAriaLabels` /\n * `withStepperFallbackLabels`.\n *\n * @category common/stepper/i18n\n */\nexport function withStepperI18nLabels(\n overrides: CngxStepperI18nOverrides,\n): CngxStepperI18nFeature {\n return defineStepperI18nFeature((bundle) => ({\n ...bundle,\n ...overrides,\n statusLabels: overrides.statusLabels\n ? { ...bundle.statusLabels, ...overrides.statusLabels }\n : bundle.statusLabels,\n }));\n}\n\n/** @internal */\nfunction resolveI18nFeatures(features: readonly CngxStepperI18nFeature[]): CngxStepperI18n {\n return features.reduce<CngxStepperI18n>((bundle, feat) => feat(bundle), STEPPER_I18N_DEFAULTS);\n}\n\n/**\n * Provider for the stepper i18n bundle. Compose `withStepperI18nLabels(...)`\n * (plus any future i18n `with*`) - unset keys fall back to English.\n *\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideStepperI18n(\n * withStepperI18nLabels({ stepperLabel: 'Schrittfolge', previousStep: 'Vorheriger' }),\n * ),\n * ],\n * });\n * ```\n *\n * @category common/stepper/i18n\n */\nexport function provideStepperI18n(...features: readonly CngxStepperI18nFeature[]): Provider {\n return {\n provide: CNGX_STEPPER_I18N,\n useValue: resolveI18nFeatures(features),\n };\n}\n\n/**\n * Inject the resolved stepper i18n bundle in an injection context.\n *\n * @category common/stepper/i18n\n */\nexport function injectStepperI18n(): CngxStepperI18n {\n return inject(CNGX_STEPPER_I18N);\n}\n","import type { CngxStepperI18n } from './i18n/stepper-i18n';\nimport type { CngxStepNode } from './stepper-host.token';\n\n/**\n * Resolve the status-pill label for a step node against the resolved\n * i18n bundle. Used by skins that surface a per-step status pill\n * (e.g. `stripe-status-rich`). Pure factory - no injection context,\n * no signal graph involvement.\n *\n * Resolution order:\n * 1. `success` data-state -> `statusLabels.done`\n * 2. `error` data-state -> `statusLabels.errored`\n * 3. `aria-current=\"step\"` -> `statusLabels.inProgress`\n * 4. otherwise -> `statusLabels.upNext`\n *\n * Group nodes (non-step) return an empty string.\n *\n * @category common/stepper\n */\nexport function resolveStepperStatusLabel(\n node: CngxStepNode,\n i18n: CngxStepperI18n,\n isActive: boolean,\n): string {\n if (node.kind !== 'step') {\n return '';\n }\n const labels = i18n.statusLabels;\n const state = node.state();\n return state === 'success'\n ? labels.done\n : state === 'error'\n ? labels.errored\n : isActive\n ? labels.inProgress\n : labels.upNext;\n}\n","import { computed, signal, type DestroyRef, type Signal } from '@angular/core';\n\nimport type { CngxStepperMobileCollapse } from './stepper-config';\n\n/**\n * Returns a reactive `Signal<boolean>` that reflects whether the host\n * window matches a CSS media query (e.g. `(max-width: 480px)`). Used by\n * `<cngx-stepper>` to drive its mobile auto-collapse template branch.\n *\n * In SSR / non-DOM environments the signal stays `false` and the\n * listener is never wired.\n *\n * @category common/stepper\n */\nexport function createMobileViewportSignal(\n mediaQuery: string,\n destroyRef: DestroyRef,\n): Signal<boolean> {\n const matches = signal<boolean>(false);\n if (typeof globalThis.matchMedia !== 'function') {\n return matches.asReadonly();\n }\n const mql = globalThis.matchMedia(mediaQuery);\n matches.set(mql.matches);\n const listener = (event: MediaQueryListEvent): void => matches.set(event.matches);\n mql.addEventListener('change', listener);\n destroyRef.onDestroy(() => mql.removeEventListener('change', listener));\n return matches.asReadonly();\n}\n\n/**\n * Resolves the active stepper display mode by combining a viewport\n * media-query with the configured `mobileCollapse` policy.\n * `'classic'` keeps the full strip; `'text'` / `'dots'` swap to the\n * matching compact variant.\n *\n * @category common/stepper\n */\nexport function createStepperDisplayMode(\n mediaQuery: string,\n mobileCollapse: () => CngxStepperMobileCollapse | undefined,\n destroyRef: DestroyRef,\n): Signal<'classic' | 'text' | 'dots'> {\n const viewport = createMobileViewportSignal(mediaQuery, destroyRef);\n return computed(() => {\n if (!viewport()) {\n return 'classic';\n }\n const mode = mobileCollapse() ?? 'text';\n return mode === 'off' ? 'classic' : mode;\n });\n}\n","import { computed, type Signal } from '@angular/core';\nimport type {\n CngxStepperConfig,\n CngxStepperMobileIndicatorPosition,\n CngxStepperSkin,\n} from './stepper-config';\n\n/**\n * Input bundle for {@link createStepperHostAttrs}: the three per-instance\n * inputs (each `Signal<T | undefined>`) and the resolved config (read\n * synchronously at construction). Each cascade collapses through\n * `input ?? config ?? library-default`.\n *\n * @internal\n */\nexport interface CngxStepperHostAttrsInputs {\n readonly skin: Signal<CngxStepperSkin | undefined>;\n readonly connectors: Signal<boolean | undefined>;\n readonly mobileIndicatorPosition: Signal<CngxStepperMobileIndicatorPosition | undefined>;\n readonly config: CngxStepperConfig;\n}\n\n/**\n * Three host-attribute signals for `<cngx-stepper>`. Each is read by a\n * `[attr.data-*]` host binding on the organism.\n *\n * @internal\n */\nexport interface CngxStepperHostAttrs {\n readonly resolvedSkin: Signal<CngxStepperSkin>;\n readonly resolvedConnectors: Signal<boolean>;\n readonly resolvedMobileIndicatorPosition: Signal<CngxStepperMobileIndicatorPosition>;\n}\n\n/**\n * Level-2 helper resolving the three host-attribute cascades for\n * `<cngx-stepper>` (skin / connectors / mobileIndicatorPosition). Keeps\n * the organism class under the LOC guard while making the cascade\n * pattern reusable for any future host-attr the strip surfaces.\n *\n * Each computed honors Pillar 1 (Ableitung statt Verwaltung): per-instance\n * input wins over root config wins over library default. No manual sync.\n *\n * @internal\n */\nexport function createStepperHostAttrs(\n inputs: CngxStepperHostAttrsInputs,\n): CngxStepperHostAttrs {\n return {\n resolvedSkin: computed<CngxStepperSkin>(\n () => inputs.skin() ?? inputs.config.skin ?? 'classic',\n ),\n resolvedConnectors: computed<boolean>(\n () => inputs.connectors() ?? inputs.config.connectors ?? false,\n ),\n resolvedMobileIndicatorPosition: computed<CngxStepperMobileIndicatorPosition>(\n () => inputs.mobileIndicatorPosition() ?? inputs.config.mobileIndicatorPosition ?? 'top',\n ),\n };\n}\n","import type { CngxStepperHost } from './stepper-host.token';\n\n/**\n * Options for {@link createStepperStripKeyboardNav}.\n *\n * @internal\n */\nexport interface CngxStepperStripKeyboardNavOptions {\n /** Host contract that owns the active-step state and selection methods. */\n readonly presenter: CngxStepperHost;\n /** Host element used to locate the active step button after the move. */\n readonly hostElement: HTMLElement;\n /** Returns the current flat-step count so `End` lands on the last step. */\n readonly flatStepCount: () => number;\n /**\n * Maps a CngxStepNode id to its DOM button id (e.g. `${id}-header`).\n * The strip selects by stable DOM id rather than waiting for the\n * `aria-current` attribute to flip - the id binding does not depend\n * on the active-step signal, so the lookup is correct the same tick\n * the presenter's `activeStepId` updates.\n */\n readonly stepButtonIdFor: (stepId: string) => string;\n /**\n * Optional class name guard - the handler only runs when\n * `event.target.classList.contains(stepClassName)`. Defaults to the\n * canonical strip button class so panel-content key presses pass\n * through untouched.\n */\n readonly stepClassName?: string;\n /**\n * Optional gate - when supplied and returning `false`, the handler is\n * a complete no-op. Used to switch arrow-key navigation off in the\n * `headerNavigation: 'none'` mode, where the step headers are inert\n * labels rather than focusable buttons. Omitted defaults to enabled.\n */\n readonly enabled?: () => boolean;\n}\n\n/**\n * Builds the WAI-ARIA APG arrow-key handler for a stepper strip. The\n * composed `CngxRovingTabindex` cannot reach view-template step buttons\n * (its `contentChildren` query only sees projected content), so the\n * organism wires this factory's return value to its host `(keydown)`\n * binding to honour the documented keyboard contract.\n *\n * Horizontal orientation: ArrowLeft / ArrowRight navigate. Vertical:\n * ArrowUp / ArrowDown. Home / End jump to the first / last flat step\n * regardless of orientation. The presenter's `select*` methods enforce\n * linear-mode gating so callers do not duplicate that check here.\n *\n * @internal\n */\nexport function createStepperStripKeyboardNav(\n options: CngxStepperStripKeyboardNavOptions,\n): (event: KeyboardEvent) => void {\n const stepClass = options.stepClassName ?? 'cngx-stepper__step';\n const focusActive = (): void => {\n const activeId = options.presenter.activeStepId();\n if (!activeId) {\n return;\n }\n const buttonId = options.stepButtonIdFor(activeId);\n queueMicrotask(() => {\n const el = options.hostElement.querySelector(`[id=\"${buttonId}\"]`);\n if (el instanceof HTMLElement) {\n el.focus();\n }\n });\n };\n return (event: KeyboardEvent): void => {\n if (options.enabled && !options.enabled()) {\n return;\n }\n const target = event.target as HTMLElement | null;\n if (!target?.classList.contains(stepClass)) {\n return;\n }\n const isHorizontal = options.presenter.orientation() === 'horizontal';\n const nextKey = isHorizontal ? 'ArrowRight' : 'ArrowDown';\n const prevKey = isHorizontal ? 'ArrowLeft' : 'ArrowUp';\n if (event.key === nextKey) {\n event.preventDefault();\n options.presenter.selectNext();\n focusActive();\n } else if (event.key === prevKey) {\n event.preventDefault();\n options.presenter.selectPrevious();\n focusActive();\n } else if (event.key === 'Home') {\n event.preventDefault();\n options.presenter.select(0);\n focusActive();\n } else if (event.key === 'End') {\n event.preventDefault();\n options.presenter.select(options.flatStepCount() - 1);\n focusActive();\n }\n };\n}\n","import { computed, type Signal } from '@angular/core';\n\nimport type { CngxStepperI18n } from './i18n/stepper-i18n';\nimport type { CngxStepNode, CngxStepperHost, CngxStepStatus } from './stepper-host.token';\n\n/**\n * Per-step + aggregate state derivations shared by every stepper skin.\n *\n * The classic organism historically derived \"is this step errored / busy /\n * rejected\" inline in {@link createStepperSlotContextBuilders}; the dot,\n * text, and progress-bar variants derived nothing, so a step error (per-step\n * `state`, an error aggregator, or a commit rejection) was structurally\n * invisible in those three. This view is the single source those four skins\n * read from - \"Ableitung statt Verwaltung\" - so the error contract can never\n * drift between them.\n *\n * @internal\n */\nexport interface CngxStepperStateView {\n /** Raw step status. Group nodes still report their own `state()`. */\n readonly statusOf: (node: CngxStepNode) => CngxStepStatus;\n\n /**\n * `true` while a commit is in flight AND targets this step. Mirrors the\n * classic `isStepBusy` predicate.\n */\n readonly isBusy: (node: CngxStepNode) => boolean;\n\n /**\n * `true` when this step is the one a commit just rejected\n * (`flatIndex === lastFailedIndex`). The commit-rejection arm your\n * pessimistic / optimistic flows hit.\n */\n readonly isRejected: (node: CngxStepNode) => boolean;\n\n /**\n * Badge-level error: per-step `state === 'error'` OR the bound error\n * aggregator's `shouldShow()`. Deliberately excludes commit rejection -\n * the classic skin renders rejection through its own dedicated slot, so\n * folding it in here would double-render the icon.\n */\n readonly hasErrorBadge: (node: CngxStepNode) => boolean;\n\n /**\n * Unified error predicate - the contract the minimal skins (dot / text /\n * progress-bar) read. `true` when ANY of the three error sources fires:\n * {@link hasErrorBadge} OR a commit rejection ({@link isRejected}). Those\n * skins have no separate rejection slot, so they treat every error source\n * as one \"errored\" state.\n */\n readonly hasError: (node: CngxStepNode) => boolean;\n\n /** Count of step-only nodes where {@link hasError} is `true`. */\n readonly errorCount: Signal<number>;\n\n /** Flat index of the first errored step, or `-1` when none. */\n readonly firstErrorIndex: Signal<number>;\n\n /** `true` when `errorCount() > 0`. Drives skin-level `aria-invalid`. */\n readonly hasAnyError: Signal<boolean>;\n}\n\n/**\n * Build the shared {@link CngxStepperStateView} over a presenter host and its\n * step-only projection. Pure factory - `computed()` only, no injection\n * context required, so any skin can allocate it in a field initializer.\n *\n * @category common/stepper\n * @since 0.1.0\n * @relatedTo CngxStepperHost, createStepperSlotContextBuilders\n */\nexport function createStepperStateView(inputs: {\n presenter: CngxStepperHost;\n stepsOnly: Signal<readonly CngxStepNode[]>;\n}): CngxStepperStateView {\n const { presenter, stepsOnly } = inputs;\n\n const statusOf = (node: CngxStepNode): CngxStepStatus => node.state();\n\n const isBusy = (node: CngxStepNode): boolean =>\n node.kind === 'step' &&\n presenter.commitState.status() === 'pending' &&\n presenter.intendedStepIndex() === node.flatIndex;\n\n const isRejected = (node: CngxStepNode): boolean =>\n node.kind === 'step' && node.flatIndex >= 0 && node.flatIndex === presenter.lastFailedIndex();\n\n const hasErrorBadge = (node: CngxStepNode): boolean => {\n if (node.kind !== 'step') {\n return false;\n }\n if (node.state() === 'error') {\n return true;\n }\n return !!node.errorAggregator?.()?.shouldShow?.();\n };\n\n const hasError = (node: CngxStepNode): boolean => hasErrorBadge(node) || isRejected(node);\n\n const erroredSteps = computed<readonly CngxStepNode[]>(() =>\n stepsOnly().filter((node) => hasError(node)),\n );\n\n const errorCount = computed<number>(() => erroredSteps().length);\n\n const firstErrorIndex = computed<number>(() => erroredSteps()[0]?.flatIndex ?? -1);\n\n const hasAnyError = computed<boolean>(() => errorCount() > 0);\n\n return {\n statusOf,\n isBusy,\n isRejected,\n hasErrorBadge,\n hasError,\n errorCount,\n firstErrorIndex,\n hasAnyError,\n };\n}\n\n/**\n * Aggregate error phrase shared by the minimal skins (text / progress-bar)\n * and the classic mobile-collapse text branch. A single errored step names\n * itself (`\"Payment: Errored\"`); several collapse to the i18n count phrase\n * (`\"2 errors\"`). Returns `''` when no step errored - callers gate on\n * `view.hasAnyError()` so the empty string never reaches the DOM.\n *\n * The optional `messageOf` resolver lets callers surface a per-step\n * reason (a direct `[error]` string or the first aggregator label) in the\n * single-error case instead of the generic `errored` status word. When\n * omitted - or when it returns `undefined`/`''` - the helper produces\n * byte-identical output to the no-resolver form, so existing callers\n * (the classic mobile-collapse summary) are a guaranteed no-op.\n *\n * Pure helper - reads signals at call time, intended to be wrapped in the\n * caller's `computed()`.\n *\n * @category common/stepper\n * @since 0.1.0\n */\nexport function resolveStepperErrorSummary(\n view: Pick<CngxStepperStateView, 'errorCount' | 'firstErrorIndex'>,\n stepsOnly: Signal<readonly CngxStepNode[]>,\n i18n: CngxStepperI18n,\n messageOf?: (node: CngxStepNode) => string | undefined,\n): string {\n const count = view.errorCount();\n if (count === 0) {\n return '';\n }\n if (count === 1) {\n const node = stepsOnly()[view.firstErrorIndex()];\n const custom = node ? messageOf?.(node) : undefined;\n if (custom !== undefined && custom !== '') {\n return custom;\n }\n const label = node?.label();\n return label ? `${label}: ${i18n.statusLabels.errored}` : i18n.statusLabels.errored;\n }\n return i18n.stepHasErrors(count);\n}\n","import type { Signal } from '@angular/core';\n\nimport type { CngxStepperI18n } from './i18n/stepper-i18n';\nimport type { CngxStepBadgeContext } from './slots/step-badge.directive';\nimport type { CngxStepBusySpinnerContext } from './slots/step-busy-spinner.directive';\nimport type { CngxStepErrorContext } from './slots/step-error.directive';\nimport type { CngxStepGroupHeaderContext } from './slots/step-group-header.directive';\nimport type { CngxStepIndicatorContext } from './slots/step-indicator.directive';\nimport type { CngxStepRejectionContext } from './slots/step-rejection.directive';\nimport { createStepperStateView } from './stepper-state-view';\nimport type { CngxStepContentContext, CngxStepLabelContext } from './step-panel-host.token';\nimport type { CngxStepNode, CngxStepperHost } from './stepper-host.token';\n\n/**\n * Input bundle for {@link createStepperSlotContextBuilders}: the presenter\n * surface and the step-only flat projection. Builders read both reactively\n * so the produced context objects always reflect current presenter state.\n *\n * @internal\n */\nexport interface CngxStepperSlotContextBuildersInputs {\n readonly presenter: CngxStepperHost;\n readonly stepsOnly: Signal<readonly CngxStepNode[]>;\n /** i18n bundle - supplies the `errored` status label as the message fallback. */\n readonly i18n: CngxStepperI18n;\n}\n\n/**\n * Per-step status / activity / rejection / labelling derivations shared by\n * every slot context shape. The organism reads these through the bundle\n * instead of duplicating the logic next to each `*ContextFor` builder.\n *\n * @internal\n */\nexport interface CngxStepperSlotContextBuilders {\n readonly isActive: (node: CngxStepNode) => boolean;\n readonly isStepBusy: (node: CngxStepNode) => boolean;\n readonly showRejection: (node: CngxStepNode) => boolean;\n readonly showErrorBadge: (node: CngxStepNode) => boolean;\n /** Validation-channel error gate - mirrors the error badge, independent of commit rejection. */\n readonly showStepError: (node: CngxStepNode) => boolean;\n readonly indicatorContextFor: (node: CngxStepNode) => CngxStepIndicatorContext;\n readonly badgeContextFor: (node: CngxStepNode) => CngxStepBadgeContext;\n readonly busySpinnerContextFor: (node: CngxStepNode) => CngxStepBusySpinnerContext;\n readonly rejectionContextFor: (node: CngxStepNode) => CngxStepRejectionContext;\n readonly stepErrorContextFor: (node: CngxStepNode) => CngxStepErrorContext;\n readonly groupHeaderContextFor: (node: CngxStepNode) => CngxStepGroupHeaderContext;\n readonly stepLabelContextFor: (node: CngxStepNode) => CngxStepLabelContext;\n readonly stepContentContextFor: (node: CngxStepNode) => CngxStepContentContext;\n}\n\n/**\n * Wrap a `(node) => TContext` builder so identical results return the\n * same reference. Keyed by the node object via `WeakMap`, so step-list\n * re-emits drop stale entries automatically. The structural comparison\n * is shallow because every context shape is a flat object.\n *\n * @internal\n */\nfunction memoizeByNode<TContext extends object>(\n build: (node: CngxStepNode) => TContext,\n): (node: CngxStepNode) => TContext {\n const cache = new WeakMap<CngxStepNode, TContext>();\n return (node) => {\n const next = build(node);\n const prev = cache.get(node);\n if (prev !== undefined && shallowEqual(prev, next)) {\n return prev;\n }\n cache.set(node, next);\n return next;\n };\n}\n\n/** @internal */\nfunction shallowEqual<T extends object>(a: T, b: T): boolean {\n if (a === b) {\n return true;\n }\n const keysA = Object.keys(a);\n if (keysA.length !== Object.keys(b).length) {\n return false;\n }\n const ra = a as Record<string, unknown>;\n const rb = b as Record<string, unknown>;\n for (const k of keysA) {\n if (ra[k] !== rb[k]) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Bundle the `*ContextFor` slot-context builders plus the small\n * `isActive` / `isStepBusy` / `showRejection` / `showErrorBadge` /\n * `showStepError` predicates the organism's template reads. Lives at\n * Level 2 so the `<cngx-stepper>` organism stays a thin shell.\n *\n * @internal\n */\nexport function createStepperSlotContextBuilders(\n inputs: CngxStepperSlotContextBuildersInputs,\n): CngxStepperSlotContextBuilders {\n const { presenter, stepsOnly, i18n } = inputs;\n\n // Single source for every per-step status / error / busy / rejection\n // derivation. The dot / text / progress-bar skins read the same view,\n // so the error contract stays identical across all four.\n const stateView = createStepperStateView({ presenter, stepsOnly });\n\n const isActive = (node: CngxStepNode): boolean =>\n node.kind === 'step' && node.id === presenter.activeStepId();\n\n const isStepBusy = stateView.isBusy;\n\n const showRejection = stateView.isRejected;\n\n const showErrorBadge = stateView.hasErrorBadge;\n\n // Validation-channel gate for the per-step error message. Mirrors the\n // error badge (state === 'error' via [error] / aggregator); the commit\n // rejection keeps its own `showRejection` slot, so the two channels\n // stay distinct.\n const showStepError = stateView.hasErrorBadge;\n\n // Memoize per-node so identical contexts return the same reference.\n // *ngTemplateOutlet pays an ngOnChanges shallow comparison on its\n // `context:` binding every CD pass; without this cache the outlet\n // sees a fresh literal each tick and re-pushes context to the\n // embedded view even when no source signal changed. Cache keys are\n // the node objects themselves so the WeakMap evicts naturally with\n // step-list re-emits.\n const indicatorContextFor = memoizeByNode<CngxStepIndicatorContext>((node) => {\n const position = node.flatIndex + 1;\n return {\n $implicit: position,\n position,\n node,\n active: isActive(node),\n status: node.state(),\n busy: isStepBusy(node),\n };\n });\n\n const badgeContextFor = memoizeByNode<CngxStepBadgeContext>((node) => {\n const aggregator = node.errorAggregator?.();\n const count = aggregator?.errorCount() ?? 0;\n return { count, node };\n });\n\n const busySpinnerContextFor = memoizeByNode<CngxStepBusySpinnerContext>((node) => ({ node }));\n\n const rejectionContextFor = memoizeByNode<CngxStepRejectionContext>((node) => {\n const failedIndex = node.flatIndex;\n const originIdx = presenter.originIndexDuringCommit();\n const originLabel = originIdx !== undefined ? stepsOnly()[originIdx]?.label() : undefined;\n return { failedIndex, originLabel, node };\n });\n\n const stepErrorContextFor = memoizeByNode<CngxStepErrorContext>((node) => {\n const aggregator = node.errorAggregator?.();\n const errorLabels = aggregator?.errorLabels?.() ?? [];\n const announcement = aggregator?.announcement?.() ?? '';\n // Resolution order: direct [error] string > first aggregator label >\n // i18n errored status phrase. Always non-empty so a bare\n // `{{ message }}` template renders a reason.\n const message = node.errorMessage?.() ?? errorLabels[0] ?? i18n.statusLabels.errored;\n return { node, message, errorLabels, announcement };\n });\n\n const groupHeaderContextFor = memoizeByNode<CngxStepGroupHeaderContext>((node) => ({\n group: node,\n expanded: true,\n status: node.state(),\n }));\n\n const stepLabelContextFor = memoizeByNode<CngxStepLabelContext>((node) => ({\n node,\n index: node.flatIndex + 1,\n active: isActive(node),\n busy: isStepBusy(node),\n disabled: node.disabled(),\n }));\n\n // Independent builder + independent cache: content + label contexts\n // share a shape today but the slot directives are separate contracts\n // (CngxStepContentContext vs CngxStepLabelContext) and will diverge\n // when one side gains a field. Aliasing the function would couple\n // both call sites to that future divergence.\n const stepContentContextFor = memoizeByNode<CngxStepContentContext>((node) => ({\n node,\n index: node.flatIndex + 1,\n active: isActive(node),\n busy: isStepBusy(node),\n disabled: node.disabled(),\n }));\n\n return {\n isActive,\n isStepBusy,\n showRejection,\n showErrorBadge,\n showStepError,\n indicatorContextFor,\n badgeContextFor,\n busySpinnerContextFor,\n rejectionContextFor,\n stepErrorContextFor,\n groupHeaderContextFor,\n stepLabelContextFor,\n stepContentContextFor,\n };\n}\n","import { computed, type Signal } from '@angular/core';\n\nimport type { CngxStepperI18n } from './i18n/stepper-i18n';\nimport type { CngxStepNode, CngxStepperHost } from './stepper-host.token';\n\n/**\n * Input bundle for {@link createStepperAnnouncementBuilders}. The presenter\n * surface (commit transition + failed-index signals), the step-only flat\n * projection, and the resolved i18n strings.\n *\n * @internal\n */\nexport interface CngxStepperAnnouncementBuildersInputs {\n readonly presenter: CngxStepperHost;\n readonly stepsOnly: Signal<readonly CngxStepNode[]>;\n readonly i18n: CngxStepperI18n;\n}\n\n/**\n * Reactive SR-announcement surface for the stepper organism: the\n * `aria-live` content for commit lifecycle transitions, the per-step\n * descriptor phrase including the rejected-suffix, and the group rollup\n * phrase. Bundles three small functions the organism's template binds\n * against.\n *\n * @internal\n */\nexport interface CngxStepperAnnouncementBuilders {\n /**\n * Live-region content driven by the commit transition tracker.\n * Empty string between transitions keeps the region quiet on no-op\n * CD ticks. Error-arm priority: `commitRolledBackTo(originLabel)` when\n * both `lastFailedIndex` and a resolvable origin label exist; otherwise\n * `commitFailedRetry`.\n */\n readonly liveAnnouncement: Signal<string>;\n /**\n * SR descriptor phrase. Aggregator-announced or \"Step N of M: <label>\";\n * appends `stepRolledBackSuffix` on the rejected row.\n */\n readonly statusPhrase: (node: CngxStepNode) => string;\n /** Group descriptor - rolls up children's aggregated status. */\n readonly groupStatusPhrase: (node: CngxStepNode) => string;\n}\n\n/**\n * Build the reactive SR-announcement surface for `<cngx-stepper>`.\n * Lives at Level 2 so the Level-4 organism stays a thin shell per\n * `reference_atomic_decompose`.\n *\n * @internal\n */\nexport function createStepperAnnouncementBuilders(\n inputs: CngxStepperAnnouncementBuildersInputs,\n): CngxStepperAnnouncementBuilders {\n const { presenter, stepsOnly, i18n } = inputs;\n\n const liveAnnouncement = computed<string>(() => {\n const current = presenter.commitTransition.current();\n if (current === 'pending') {\n return i18n.commitInFlight;\n }\n if (current === 'error') {\n // Sync commit-handler errors collapse pending -> error in one signal\n // flush; tracker sees `previous === 'idle'`. Guard stays loose so\n // sync-rejection (`commitAction = () => false`) still announces.\n const failedIdx = presenter.lastFailedIndex();\n const originIdx = presenter.originIndexDuringCommit();\n if (failedIdx !== undefined && originIdx !== undefined) {\n const originLabel = stepsOnly()[originIdx]?.label();\n if (originLabel) {\n return i18n.commitRolledBackTo(originLabel);\n }\n }\n return i18n.commitFailedRetry;\n }\n return '';\n });\n\n const statusPhrase = (node: CngxStepNode): string => {\n const aggregator = node.errorAggregator?.();\n let base = aggregator?.shouldShow?.() ? (aggregator.announcement?.() ?? '') : '';\n if (!base && node.kind === 'step') {\n const idx = node.flatIndex;\n if (idx >= 0) {\n base = i18n.selectedStep(node.label(), idx + 1, stepsOnly().length);\n }\n }\n if (!base) {\n return '';\n }\n return node.kind === 'step' && node.flatIndex === presenter.lastFailedIndex()\n ? `${base} ${i18n.stepRolledBackSuffix}`\n : base;\n };\n\n const groupStatusPhrase = (node: CngxStepNode): string => {\n const status = node.state();\n if (status === 'error') {\n return i18n.stepErrored;\n }\n if (status === 'success') {\n return i18n.stepCompleted;\n }\n return '';\n };\n\n return { liveAnnouncement, statusPhrase, groupStatusPhrase };\n}\n","import { computed, Directive, inject, input } from '@angular/core';\n\nimport type { SwipeDirection } from '@cngx/common/interactive';\n\nimport { injectStepperConfig } from './stepper-config';\nimport { CNGX_STEPPER_HOST } from './stepper-host.token';\n\n/**\n * Routes a `CngxSwipe` gesture into the stepper presenter so the\n * organism's mobile-collapse panels gain swipe-driven navigation\n * without duplicating pointer handling. Applied via `hostDirectives`\n * on `<cngx-stepper>`; consumer-facing input `[mobileSwipe]` is\n * forwarded through the host metadata.\n *\n * Cascade for `swipeEnabled`: per-instance `[mobileSwipe]` ->\n * `CNGX_STEPPER_CONFIG.mobileSwipe` -> library default `true`.\n *\n * Direction routing is asymmetric, matching the presenter's existing\n * navigation surface: `left` -> `selectNext()` -> `select()` (linear\n * gate + commit window apply identically to a click); `right` ->\n * `selectPrevious()` (ungated direct back-move, same path as the\n * existing strip back-nav).\n *\n * @category common/stepper\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/swipe-nav.directive.ts\n * @since 0.1.0\n */\n@Directive({\n selector: '[cngxStepperSwipeNav]',\n standalone: true,\n})\nexport class CngxStepperSwipeNav {\n /**\n * Per-instance opt-out for the built-in swipe navigation. `undefined`\n * defers to the config cascade.\n */\n readonly mobileSwipe = input<boolean | undefined>(undefined);\n\n private readonly host = inject(CNGX_STEPPER_HOST);\n private readonly config = injectStepperConfig();\n\n /** Resolved enabled flag (Input -> config -> default(true)). Boolean output, no `equal` fn required. */\n readonly swipeEnabled = computed<boolean>(\n () => this.mobileSwipe() ?? this.config.mobileSwipe ?? true,\n );\n\n /**\n * Route a swipe direction into the presenter. `left` and `right`\n * map onto `selectNext` and `selectPrevious`; vertical directions\n * are ignored.\n */\n handleSwipe(direction: SwipeDirection): void {\n if (direction === 'left') {\n this.host.selectNext();\n } else if (direction === 'right') {\n this.host.selectPrevious();\n }\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n type Signal,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { CNGX_STEPPER_HOST, type CngxStepNode } from './stepper-host.token';\nimport { injectStepperI18n } from './i18n/stepper-i18n';\n\n/**\n * Minimal contract `CngxStepperCount` reads off the host. A full\n * {@link CngxStepperHost} satisfies it, but consumers can also supply\n * a narrower stub (useful in tests, custom layouts, or non-standard\n * step containers that surface just these two signals).\n *\n * @category common/stepper\n */\nexport interface CngxStepperCountHost {\n readonly activeStepIndex: Signal<number>;\n readonly stepsOnly: Signal<readonly CngxStepNode[]>;\n}\n\n/**\n * Reusable progress-hint atom for any stepper organism. Renders the\n * resolved `CngxStepperI18n.textStepperFormat(current, total)` string\n * inside a `<span>` and pipes the value through an `aria-live` region\n * so screen readers announce step transitions.\n *\n * The text shape is fully owned by the i18n format function - drop the\n * atom inside any `<cngx-stepper>` / `<cngx-mat-stepper>` /\n * `<cngx-progress-bar-stepper>` tree and override the format upstream\n * to change every instance at once:\n *\n * ```ts\n * provideStepperI18n(withStepperI18nLabels({\n * textStepperFormat: (c, t) => `${c}/${t} complete`,\n * }));\n * ```\n *\n * Canonical shapes the atom supports without any markup changes:\n * - `Step N of M` (default)\n * - `N/M complete`\n * - `N/M`\n * - `Math.round(c/t * 100)%`\n * - any consumer-defined string the closure returns.\n *\n * `[live]=\"false\"` opts the atom out of the `aria-live` region when\n * the caption sits next to another live region (e.g. a stepper that\n * already mounts its own live announcer) to prevent double announces.\n *\n * @category common/stepper\n * @docsKind primary\n * @since 0.1.0\n * @relatedTo CngxStepperHost, CngxStepperI18n\n * <example-url>http://localhost:4200/#/ui/stepper/stepper-count/multi-instance-format-overrides</example-url>\n */\n@Component({\n selector: 'cngx-stepper-count',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n template: '<span [attr.aria-live]=\"live() ? \\'polite\\' : null\">{{ label() }}</span>',\n host: {\n class: 'cngx-stepper-count',\n },\n})\nexport class CngxStepperCount {\n /** When `true`, wraps the rendered string in an `aria-live=\"polite\"` span. */\n readonly live = input<boolean>(true);\n\n /**\n * Per-instance format override. Receives `(current, total)` where\n * `current` is the 1-based active step position and `total` is\n * `host.stepsOnly().length`. When omitted, the resolved\n * `CngxStepperI18n.textStepperFormat` is used so two siblings can\n * each show a different shape inside the same stepper tree.\n */\n readonly format = input<((current: number, total: number) => string) | undefined>(undefined);\n\n /**\n * Explicit stepper-host reference. Set this when the atom sits\n * *outside* a `<cngx-stepper>` (e.g. in a sibling layout header)\n * by exporting the stepper as a template ref:\n * `<cngx-stepper #s=\"cngxStepper\">` then `[host]=\"s.presenter\"`.\n * When unset, the atom injects the ambient `CNGX_STEPPER_HOST` from\n * its DI tree. Accepts {@link CngxStepperCountHost} so a narrow stub\n * (active index + steps signal) also fits.\n */\n readonly host = input<CngxStepperCountHost | null>(null);\n\n private readonly injectedHost = inject(CNGX_STEPPER_HOST, { optional: true });\n private readonly i18n = injectStepperI18n();\n private readonly resolvedHost = computed<CngxStepperCountHost | null>(\n () => this.host() ?? this.injectedHost,\n );\n\n /** Resolved caption - reactive on activeStepIndex / stepsOnly / format / i18n. */\n protected readonly label = computed<string>(() => {\n const host = this.resolvedHost();\n if (!host) {\n return '';\n }\n const current = host.activeStepIndex() + 1;\n const total = host.stepsOnly().length;\n const fmt = this.format() ?? this.i18n.textStepperFormat;\n return fmt(current, total);\n });\n}\n","import { computed, Directive, inject, input, isDevMode, type Signal } from '@angular/core';\n\nimport { CngxAsyncClick } from '@cngx/common/interactive';\n\nimport { CNGX_STEPPER_HOST, type CngxStepperHost } from '../stepper-host.token';\n\n/**\n * Turns any clickable element into a stepper \"Back\" control. Resolves\n * its host the same way `CngxStepperCount` does - an explicit `[host]`\n * input (for placement outside the stepper tree) falling back to the\n * ambient {@link CNGX_STEPPER_HOST}.\n *\n * `(click)` retreats via `selectPrevious()`. The control disables itself\n * when there is no earlier step (`!canGoPrevious()`) OR while a commit is\n * in flight (`busy()`): `selectPrevious()` writes `activeStepIndex`\n * directly, bypassing the commit controller, so disabling it during an\n * in-flight forward commit prevents a navigate-mid-commit race. The gate\n * is the host's `canGoPrevious` bound - never re-derived from `stepsOnly`.\n *\n * Reflects the disabled state via `aria-disabled` only - never native\n * `disabled` - so the control stays focusable and AT-reachable; the\n * `handleClick` guard blocks the action while disabled.\n *\n * ```html\n * <button cngxStepperPrevious>Back</button>\n * ```\n *\n * @category common/stepper\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/controls/stepper-previous.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStepperNext, CngxStepperComplete, CngxStepperHost\n */\n@Directive({\n selector: '[cngxStepperPrevious]',\n standalone: true,\n exportAs: 'cngxStepperPrevious',\n host: {\n '(click)': 'handleClick($event)',\n '[attr.aria-disabled]': 'disabled() || null',\n },\n})\nexport class CngxStepperPrevious {\n /**\n * Explicit stepper-host reference for placement *outside* the stepper\n * tree (`[host]=\"s.presenter\"`). When unset, the ambient\n * {@link CNGX_STEPPER_HOST} is injected.\n */\n readonly host = input<CngxStepperHost | null>(null);\n\n private readonly injectedHost = inject(CNGX_STEPPER_HOST, { optional: true });\n private readonly resolvedHost = computed<CngxStepperHost | null>(\n () => this.host() ?? this.injectedHost,\n );\n\n private readonly coPlacedAsyncClick = inject(CngxAsyncClick, { self: true, optional: true });\n\n constructor() {\n if (isDevMode() && this.coPlacedAsyncClick) {\n console.warn(\n 'CngxStepperPrevious: [cngxStepperPrevious] and [cngxAsyncClick] on the same element ' +\n 'both gate aria-disabled. Use one or the other.',\n );\n }\n }\n\n /** `true` when retreat is unavailable: no earlier step or commit busy. */\n protected readonly disabled: Signal<boolean> = computed(() => {\n const host = this.resolvedHost();\n return !host || !host.canGoPrevious() || host.busy();\n });\n\n /** @internal */\n protected handleClick(event: Event): void {\n if (this.disabled()) {\n event.preventDefault();\n return;\n }\n this.resolvedHost()?.selectPrevious();\n }\n}\n","import { computed, Directive, inject, input, isDevMode, type Signal } from '@angular/core';\n\nimport { CngxAsyncClick } from '@cngx/common/interactive';\n\nimport { CNGX_STEPPER_HOST, type CngxStepperHost } from '../stepper-host.token';\n\n/**\n * Turns any clickable element into a stepper \"Continue\" control. Same\n * host resolution as `CngxStepperCount` - explicit `[host]` input\n * falling back to the ambient {@link CNGX_STEPPER_HOST}.\n *\n * `(click)` advances via `selectNext()`. A turnkey re-entrancy guard\n * disables the control when there is no enabled next step\n * (`!canGoNext()`) OR while a commit is in flight (`busy()`) - an opt-in\n * guard a consumer forgets is a silent double-commit (Pillar 2). The\n * gate reads the host's `canGoNext` bound, which derives from the same\n * `select()` predicates, so the affordance can never drift from the\n * navigation it triggers.\n *\n * Reflects the disabled state via `aria-disabled` only - never native\n * `disabled` (which would steal focus, so AT could not reach the control\n * to learn it is at-a-bound / busy) and never `aria-busy` (that is\n * `CngxAsyncStatus`'s sole responsibility). The `handleClick` guard\n * blocks the action while disabled. Co-placing `[cngxAsyncClick]` here\n * (which also gates `aria-disabled` and adds native `disabled`) warns in\n * dev mode.\n *\n * ```html\n * <button cngxStepperNext>Continue</button>\n * ```\n *\n * @category common/stepper\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/controls/stepper-next.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStepperPrevious, CngxStepperComplete, CngxAsyncStatus, CngxStepperHost\n */\n@Directive({\n selector: '[cngxStepperNext]',\n standalone: true,\n exportAs: 'cngxStepperNext',\n host: {\n '(click)': 'handleClick($event)',\n '[attr.aria-disabled]': 'disabled() || null',\n },\n})\nexport class CngxStepperNext {\n /**\n * Explicit stepper-host reference for placement *outside* the stepper\n * tree (`[host]=\"s.presenter\"`). When unset, the ambient\n * {@link CNGX_STEPPER_HOST} is injected.\n */\n readonly host = input<CngxStepperHost | null>(null);\n\n private readonly injectedHost = inject(CNGX_STEPPER_HOST, { optional: true });\n private readonly resolvedHost = computed<CngxStepperHost | null>(\n () => this.host() ?? this.injectedHost,\n );\n\n private readonly coPlacedAsyncClick = inject(CngxAsyncClick, { self: true, optional: true });\n\n /** `true` when advancing is unavailable: no enabled next step or commit busy. */\n protected readonly disabled: Signal<boolean> = computed(() => {\n const host = this.resolvedHost();\n return !host || !host.canGoNext() || host.busy();\n });\n\n constructor() {\n if (isDevMode() && this.coPlacedAsyncClick) {\n console.warn(\n 'CngxStepperNext: [cngxStepperNext] and [cngxAsyncClick] on the same element ' +\n 'both gate aria-disabled (and cngxAsyncClick adds native [disabled]). Use one or the other.',\n );\n }\n }\n\n /** @internal */\n protected handleClick(event: Event): void {\n if (this.disabled()) {\n event.preventDefault();\n return;\n }\n this.resolvedHost()?.selectNext();\n }\n}\n","import { computed, Directive, effect, inject, input, output, type Signal } from '@angular/core';\n\nimport { CngxAsyncClick } from '@cngx/common/interactive';\nimport { createTransitionTracker } from '@cngx/core/utils';\n\nimport { CNGX_STEPPER_HOST, type CngxStepperHost } from '../stepper-host.token';\n\n/**\n * Turns any clickable element into a stepper \"Finish\" control. Unlike\n * `CngxStepperNext` (which *reflects* the commit state and advances),\n * the finish action *runs*: the directive composes `CngxAsyncClick` via\n * `hostDirectives`, so the runner owns the click lifecycle, `aria-busy`,\n * and the pending-disable exactly as it does on a standalone button. The\n * finish action is fed through the aliased `[cngxStepperComplete]` input.\n *\n * Resolves its host like the sibling controls - explicit `[host]` input\n * falling back to the ambient {@link CNGX_STEPPER_HOST}. {@link isActive}\n * exposes whether the active step is the last one, so a consumer renders\n * the finish control only on the final step. `(completed)` emits once\n * after the action resolves successfully.\n *\n * ```html\n * @if (s.presenter.isLastStep()) {\n * <button [cngxStepperComplete]=\"submit\" (completed)=\"done()\">Finish</button>\n * }\n * ```\n *\n * @category common/stepper\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/controls/stepper-complete.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStepperNext, CngxStepperPrevious, CngxAsyncClick, CngxStepperHost\n */\n@Directive({\n selector: '[cngxStepperComplete]',\n standalone: true,\n exportAs: 'cngxStepperComplete',\n hostDirectives: [\n {\n directive: CngxAsyncClick,\n inputs: [\n 'cngxAsyncClick: cngxStepperComplete',\n 'feedbackDuration',\n 'enabled',\n 'succeededAnnouncement',\n 'failedAnnouncement',\n ],\n },\n ],\n})\nexport class CngxStepperComplete {\n /**\n * Explicit stepper-host reference for placement *outside* the stepper\n * tree (`[host]=\"s.presenter\"`). When unset, the ambient\n * {@link CNGX_STEPPER_HOST} is injected.\n */\n readonly host = input<CngxStepperHost | null>(null);\n\n /**\n * Emits once per `pending → success` transition of the finish action.\n * Does NOT re-emit when the `feedbackDuration` window resets the runner\n * back to idle - the transition tracker guards on the success edge only.\n */\n readonly completed = output<void>();\n\n private readonly injectedHost = inject(CNGX_STEPPER_HOST, { optional: true });\n private readonly resolvedHost = computed<CngxStepperHost | null>(\n () => this.host() ?? this.injectedHost,\n );\n private readonly runner = inject(CngxAsyncClick, { host: true });\n\n /** `true` when the active step is the last one - the finish step. */\n readonly isActive: Signal<boolean> = computed(() => this.resolvedHost()?.isLastStep() ?? false);\n\n constructor() {\n const tracker = createTransitionTracker(() => this.runner.status());\n effect(() => {\n if (tracker.current() === 'success' && tracker.previous() !== 'success') {\n this.completed.emit();\n }\n });\n }\n}\n","import { computed } from '@angular/core';\n\nimport { buildAsyncStateView, type StatusTransition } from '@cngx/core/utils';\n\nimport type { CngxStepNode, CngxStepRegistration, CngxStepperHost } from './stepper-host.token';\n\nconst EMPTY_NODES: readonly CngxStepNode[] = Object.freeze([]);\n\n/**\n * Builds a live delegating {@link CngxStepperHost} proxy over a supplier\n * signal. Every signal member is a `computed()` reading\n * `supplier()?.<member>()`, every method forwards to\n * `supplier()?.<method>(...)`. This is the spelled-out shape for\n * re-providing an input-derived host through DI - you cannot\n * `useExisting` an `input()` value, so the footer provides this proxy\n * once and it tracks whichever host the supplier currently resolves.\n *\n * **Null-supplier neutral set (the disabled-by-default contract).** When\n * the supplier resolves `null` (a standalone footer with neither `[host]`\n * nor an ambient stepper), every navigation affordance must render\n * *inert*, never falsely enabled: `canGoPrevious` / `canGoNext` collapse\n * to `false` so Back / Next render disabled, and every method is a no-op.\n *\n * `create*` pure factory - no injection context required (`computed()`\n * only). Single consumer (the footer); the surface is load-bearing, not\n * speculative.\n *\n * @category common/stepper\n * @since 0.1.0\n * @relatedTo CngxStepperFooter, CngxStepperHost\n */\nexport function createStepperHostProxy(supplier: () => CngxStepperHost | null): CngxStepperHost {\n return {\n // Core projection / state - empty / out-of-range when null. The array\n // fallbacks return the shared frozen EMPTY_NODES reference, so no `equal`\n // fn is needed: the output is reference-stable across reads (either the\n // supplier's own structural-equal signal value, or this one constant).\n stepTree: computed(() => supplier()?.stepTree() ?? EMPTY_NODES),\n flatSteps: computed(() => supplier()?.flatSteps() ?? EMPTY_NODES),\n stepsOnly: computed(() => supplier()?.stepsOnly() ?? EMPTY_NODES),\n activeStepIndex: computed(() => supplier()?.activeStepIndex() ?? -1),\n activeStepId: computed(() => supplier()?.activeStepId() ?? null),\n linear: computed(() => supplier()?.linear() ?? false),\n orientation: computed(() => supplier()?.orientation() ?? 'horizontal'),\n intendedStepIndex: computed(() => supplier()?.intendedStepIndex()),\n lastFailedIndex: computed(() => supplier()?.lastFailedIndex()),\n originIndexDuringCommit: computed(() => supplier()?.originIndexDuringCommit()),\n\n // Bounds + labels - the safety-critical canGo* pair collapses to\n // `false` so a null host yields disabled Back / Next, never clickable.\n stepCount: computed(() => supplier()?.stepCount() ?? 0),\n isFirstStep: computed(() => supplier()?.isFirstStep() ?? true),\n isLastStep: computed(() => supplier()?.isLastStep() ?? true),\n canGoPrevious: computed(() => supplier()?.canGoPrevious() ?? false),\n canGoNext: computed(() => supplier()?.canGoNext() ?? false),\n busy: computed(() => supplier()?.busy() ?? false),\n nextStepLabel: computed(() => supplier()?.nextStepLabel()),\n previousStepLabel: computed(() => supplier()?.previousStepLabel()),\n\n // Composite members delegate their sub-signals, idle when null. The\n // proxy only forwards - the real tracker is the presenter's, so build\n // the static neutral shape rather than calling createTransitionTracker.\n commitState: buildAsyncStateView<number | undefined>({\n status: computed(() => supplier()?.commitState.status() ?? 'idle'),\n data: computed(() => supplier()?.commitState.data()),\n error: computed(() => supplier()?.commitState.error()),\n lastUpdated: computed(() => supplier()?.commitState.lastUpdated()),\n }),\n commitTransition: {\n current: computed(() => supplier()?.commitTransition.current() ?? 'idle'),\n previous: computed(() => supplier()?.commitTransition.previous() ?? 'idle'),\n } satisfies StatusTransition,\n\n // Reachability predicate - neutral `false` when null so a header\n // over a missing host is never falsely navigable.\n canNavigateTo: (index: number) => supplier()?.canNavigateTo(index) ?? false,\n\n // Methods forward; no-op when null.\n select: (index: number) => supplier()?.select(index),\n selectNext: () => supplier()?.selectNext(),\n selectPrevious: () => supplier()?.selectPrevious(),\n selectById: (id: string) => supplier()?.selectById(id),\n reset: () => supplier()?.reset(),\n clearLastFailed: () => supplier()?.clearLastFailed(),\n register: (handle: CngxStepRegistration, parentId?: string | null) =>\n supplier()?.register(handle, parentId),\n unregister: (id: string) => supplier()?.unregister(id),\n };\n}\n","import {\n type EnvironmentProviders,\n isDevMode,\n makeEnvironmentProviders,\n type Provider,\n} from '@angular/core';\n\nimport { provideStepperI18n, type CngxStepperI18nFeature } from './i18n/stepper-i18n';\nimport {\n provideStepperConfig,\n provideStepperConfigAt,\n type CngxStepperConfigFeature,\n} from './stepper-config';\n\n/**\n * Union of every feature kind {@link provideCngxStepper} accepts. Today:\n * config (`CNGX_STEPPER_CONFIG`) and i18n (`CNGX_STEPPER_I18N`). Future\n * surfaces widen this union and dispatch via the hidden `_target`\n * discriminator.\n *\n * @category common/stepper\n */\nexport type CngxStepperFeature = CngxStepperConfigFeature | CngxStepperI18nFeature;\n\n/** @internal */\ninterface PartitionedFeatures {\n readonly config: CngxStepperConfigFeature[];\n readonly i18n: CngxStepperI18nFeature[];\n}\n\n/** @internal */\nfunction partitionFeatures(features: readonly CngxStepperFeature[]): PartitionedFeatures {\n const config: CngxStepperConfigFeature[] = [];\n const i18n: CngxStepperI18nFeature[] = [];\n for (const feat of features) {\n if (feat._target === 'i18n') {\n i18n.push(feat);\n continue;\n }\n if (feat._target === 'config') {\n config.push(feat);\n continue;\n }\n // Unbranded feature - drop + dev-warn (mirrors `provideCngxTabs`).\n if (isDevMode()) {\n console.warn(\n '[provideCngxStepper] Dropped feature without a `_target` ' +\n 'discriminator. Brand config-side mutators with ' +\n '`defineStepperConfigFeature(...)` (or use a `with*` helper) ' +\n 'and i18n-side mutators with `withStepperI18nLabels(...)`.',\n );\n }\n }\n return { config, i18n };\n}\n\n/**\n * Unified aggregator for the stepper family. Filters by `_target` and\n * forwards: config features to {@link provideStepperConfig}, i18n\n * features to {@link provideStepperI18n}. Mirrors `provideCngxTabs` /\n * `provideCngxSelect`.\n *\n * Returns {@link EnvironmentProviders} for app-root use; the\n * component-scoped twin {@link provideCngxStepperAt} returns\n * `Provider[]` because `viewProviders` cannot accept opaque\n * `EnvironmentProviders`.\n *\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideCngxStepper(\n * withStepperDefaultOrientation('vertical'),\n * withStepperLinear(true),\n * withStepperAriaLabels({ stepperRegion: 'Schrittfolge' }),\n * withStepperI18nLabels({ stepperLabel: 'Schrittfolge', previousStep: 'Vorheriger' }),\n * ),\n * ],\n * });\n * ```\n *\n * @category common/stepper\n */\nexport function provideCngxStepper(\n ...features: readonly CngxStepperFeature[]\n): EnvironmentProviders {\n const { config, i18n } = partitionFeatures(features);\n // `provideStepperConfig` returns EnvironmentProviders, `provideStepperI18n`\n // returns Provider - `makeEnvironmentProviders` takes both.\n return makeEnvironmentProviders([\n provideStepperConfig(...config),\n ...(i18n.length > 0 ? [provideStepperI18n(...i18n)] : []),\n ]);\n}\n\n/**\n * Component-scoped twin of {@link provideCngxStepper}. Spread into\n * `viewProviders` or `providers`. Same dispatch semantics - only the\n * provider scope differs.\n *\n * ```ts\n * @Component({\n * viewProviders: [\n * ...provideCngxStepperAt(\n * withStepperDefaultOrientation('vertical'),\n * withStepperI18nLabels({ stepperLabel: 'Schrittfolge' }),\n * ),\n * ],\n * })\n * ```\n *\n * @category common/stepper\n */\nexport function provideCngxStepperAt(...features: readonly CngxStepperFeature[]): Provider[] {\n const { config, i18n } = partitionFeatures(features);\n return [\n ...provideStepperConfigAt(...config),\n ...(i18n.length > 0 ? [provideStepperI18n(...i18n)] : []),\n ];\n}\n","/**\n * @module @cngx/common/stepper\n *\n * Level-2 directive-only logic for stepper / wizard flows. Ships the\n * presenter brain, atom directives, host tokens, router-sync, config\n * cascade, and i18n. Zero `@Component`, zero `.html`, zero `.css` -\n * those live in `@cngx/ui/stepper` (CNGX-standard skin) and\n * `@cngx/ui/mat-stepper` (Material twin).\n */\n\nexport {\n CngxStepperPresenter,\n type CngxStepperCommitAction,\n} from './presenter.directive';\n\nexport {\n CNGX_STEPPER_HOST,\n type CngxStepperHost,\n type CngxStepNode,\n type CngxStepRegistration,\n type CngxStepStatus,\n} from './stepper-host.token';\n\nexport {\n CNGX_STEP_GROUP_HOST,\n type CngxStepGroupHost,\n} from './step-group-host.token';\n\nexport {\n CNGX_STEP_PANEL_HOST,\n type CngxStepContentContext,\n type CngxStepLabelContext,\n type CngxStepPanelHost,\n} from './step-panel-host.token';\n\nexport { flatStepsEqual } from './step-tree.util';\n\nexport { CngxStep } from './step.directive';\nexport { CngxStepGroup } from './step-group.directive';\nexport { CngxStepLabel } from './step-label.directive';\nexport { CngxStepContent } from './step-content.directive';\n\nexport {\n CngxStepIndicator,\n type CngxStepIndicatorContext,\n} from './slots/step-indicator.directive';\n\nexport {\n CngxStepBadge,\n type CngxStepBadgeContext,\n} from './slots/step-badge.directive';\n\nexport {\n CngxStepBusySpinner,\n type CngxStepBusySpinnerContext,\n} from './slots/step-busy-spinner.directive';\n\nexport {\n CngxStepRejection,\n type CngxStepRejectionContext,\n} from './slots/step-rejection.directive';\n\nexport {\n CngxStepError,\n type CngxStepErrorContext,\n} from './slots/step-error.directive';\n\nexport {\n CngxStepGroupHeader,\n type CngxStepGroupHeaderContext,\n} from './slots/step-group-header.directive';\n\nexport { CngxStepperEmpty } from './slots/stepper-empty.directive';\n\nexport {\n CngxDotStepperDot,\n type CngxDotStepperDotContext,\n} from './slots/dot-stepper-dot.directive';\n\nexport {\n createStepperTemplateBindings,\n type CngxStepperTemplateBindings,\n type CngxStepperTemplateBindingsOptions,\n} from './slots/stepper-template-cascade';\n\nexport { CNGX_STEPPER_GLYPHS } from './glyphs';\n\nexport { CngxStepperRouterSync } from './router-sync.directive';\n\nexport {\n CNGX_STEPPER_CONFIG,\n type CngxStepperAriaLabels,\n type CngxStepperConfig,\n type CngxStepperConfigFeature,\n type CngxStepperFallbackLabels,\n type CngxStepperHeaderNavigation,\n type CngxStepperMobileCollapse,\n type CngxStepperMobileIndicatorPosition,\n type CngxStepperSkin,\n type CngxStepperTemplates,\n injectStepperConfig,\n provideStepperConfig,\n provideStepperConfigAt,\n STEPPER_DEFAULT_MOBILE_BREAKPOINT,\n withStepperDefaultOrientation,\n withStepperAriaLabels,\n withStepperCommitMode,\n withStepperConnectors,\n withStepperFallbackLabels,\n withStepperHeaderNavigation,\n withStepperLinear,\n withStepperMobileBreakpoint,\n withStepperMobileCollapse,\n withStepperMobileIndicatorPosition,\n withStepperMobileSwipe,\n withStepperRouterSync,\n withStepperSkin,\n withStepIndicatorTemplate,\n withStepBadgeTemplate,\n withStepBusySpinnerTemplate,\n withStepRejectionTemplate,\n withStepErrorTemplate,\n withStepGroupHeaderTemplate,\n withStepperEmptyTemplate,\n withDotStepperDotTemplate,\n} from './stepper-config';\n\nexport {\n CNGX_STEPPER_I18N,\n type CngxStepperI18n,\n type CngxStepperI18nFeature,\n type CngxStepperI18nOverrides,\n type CngxStepperStatusLabels,\n injectStepperI18n,\n provideStepperI18n,\n withStepperI18nLabels,\n} from './i18n/stepper-i18n';\n\nexport { resolveStepperStatusLabel } from './status-label';\n\nexport {\n createMobileViewportSignal,\n createStepperDisplayMode,\n} from './mobile-viewport';\n\n// The following three blocks ship `@internal` factory helpers. They are\n// exported through `public-api.ts` so the sibling `@cngx/ui/stepper`\n// organism can consume them across the secondary-entry boundary\n// (ng-packagr has no cross-entry private surface). `disableInternal: true`\n// in `.compodocrc.json` hides them from generated docs; the LLM-md export\n// honours the same tag. Precedent: `CNGX_STEPPER_GLYPHS`, `flatStepsEqual`.\nexport {\n createStepperHostAttrs,\n type CngxStepperHostAttrs,\n type CngxStepperHostAttrsInputs,\n} from './stepper-host-attrs';\n\nexport {\n createStepperStripKeyboardNav,\n type CngxStepperStripKeyboardNavOptions,\n} from './strip-keyboard-nav';\n\nexport {\n createStepperStateView,\n resolveStepperErrorSummary,\n type CngxStepperStateView,\n} from './stepper-state-view';\n\nexport {\n createStepperSlotContextBuilders,\n type CngxStepperSlotContextBuilders,\n type CngxStepperSlotContextBuildersInputs,\n} from './slot-context-builders';\n\nexport {\n createStepperAnnouncementBuilders,\n type CngxStepperAnnouncementBuilders,\n type CngxStepperAnnouncementBuildersInputs,\n} from './announcement-builders';\n\nexport { CngxStepperSwipeNav } from './swipe-nav.directive';\n\nexport { CngxStepperCount, type CngxStepperCountHost } from './stepper-count';\n\nexport { CngxStepperPrevious } from './controls/stepper-previous.directive';\nexport { CngxStepperNext } from './controls/stepper-next.directive';\nexport { CngxStepperComplete } from './controls/stepper-complete.directive';\nexport { createStepperHostProxy } from './create-stepper-host-proxy';\n\n\nexport {\n CNGX_STEPPER_COMMIT_HANDLER_FACTORY,\n type CngxStepperCommitHandler,\n type CngxStepperCommitHandlerFactory,\n type CngxStepperCommitHandlerOptions,\n createStepperCommitHandler,\n} from './commit-handler';\n\nexport {\n provideCngxStepper,\n provideCngxStepperAt,\n type CngxStepperFeature,\n} from './provide-cngx-stepper';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;AA6CA;;;;;;AAMG;AACG,SAAU,0BAA0B,CACxC,IAAqC,EAAA;AAErC,IAAA,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI;IAC3B,OAAO;QACL,YAAY,EAAE,UAAU,CAAC,YAAY;AAErC,QAAA,eAAe,CAAC,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAA;YACnD,UAAU,CAAC,KAAK,CACd,CAAC,QAAQ,KAAK,gBAAgB,CAAC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BAAkB,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC;KAC1D;AACH;;ACtHA;;;;;;;;AAQG;;ACRH;;AAEG;;;;"}
1
+ {"version":3,"file":"cngx-common-stepper.mjs","sources":["../../../projects/common/stepper/commit-handler.ts","../../../projects/common/stepper/stepper-config.ts","../../../projects/common/stepper/stepper-host.token.ts","../../../projects/common/stepper/step-tree.util.ts","../../../projects/common/stepper/presenter.directive.ts","../../../projects/common/stepper/step-group-host.token.ts","../../../projects/common/stepper/step-panel-host.token.ts","../../../projects/common/stepper/step-content.directive.ts","../../../projects/common/stepper/step-label.directive.ts","../../../projects/common/stepper/step.directive.ts","../../../projects/common/stepper/step-group.directive.ts","../../../projects/common/stepper/slots/step-indicator.directive.ts","../../../projects/common/stepper/slots/step-badge.directive.ts","../../../projects/common/stepper/slots/step-busy-spinner.directive.ts","../../../projects/common/stepper/slots/step-rejection.directive.ts","../../../projects/common/stepper/slots/step-error.directive.ts","../../../projects/common/stepper/slots/step-group-header.directive.ts","../../../projects/common/stepper/slots/stepper-empty.directive.ts","../../../projects/common/stepper/slots/dot-stepper-dot.directive.ts","../../../projects/common/stepper/slots/stepper-template-cascade.ts","../../../projects/common/stepper/glyphs.ts","../../../projects/common/stepper/router-sync.directive.ts","../../../projects/common/stepper/i18n/stepper-i18n.ts","../../../projects/common/stepper/status-label.ts","../../../projects/common/stepper/mobile-viewport.ts","../../../projects/common/stepper/strip-density.ts","../../../projects/common/stepper/group-summary.ts","../../../projects/common/stepper/group-navigation.ts","../../../projects/common/stepper/stepper-host-attrs.ts","../../../projects/common/stepper/strip-keyboard-nav.ts","../../../projects/common/stepper/stepper-state-view.ts","../../../projects/common/stepper/slot-context-builders.ts","../../../projects/common/stepper/announcement-builders.ts","../../../projects/common/stepper/swipe-nav.directive.ts","../../../projects/common/stepper/stepper-count.ts","../../../projects/common/stepper/controls/stepper-previous.directive.ts","../../../projects/common/stepper/controls/stepper-next.directive.ts","../../../projects/common/stepper/controls/stepper-complete.directive.ts","../../../projects/common/stepper/create-stepper-host-proxy.ts","../../../projects/common/stepper/provide-cngx-stepper.ts","../../../projects/common/stepper/public-api.ts","../../../projects/common/stepper/cngx-common-stepper.ts"],"sourcesContent":["import { InjectionToken, type Signal } from '@angular/core';\nimport { isObservable, type Observable, type Subscription } from 'rxjs';\n\nimport { type CngxCommitController, type CngxCommitHandle } from '@cngx/common/data';\n\nimport type { CngxStepperCommitAction } from './presenter.directive';\n\n/**\n * Adapter between the lifted commit-controller and the stepper's\n * action shape. The presenter delegates to `beginTransition` on\n * every step change driven by `commitAction`.\n *\n * @category common/stepper\n */\nexport interface CngxStepperCommitHandler {\n /**\n * Start a transition commit. Returns synchronously; the controller's\n * `state` signal reports the in-flight status.\n *\n * @param onResolve fires `true` on accept, `false` on rejection;\n * skipped on supersede.\n */\n beginTransition(\n fromIndex: number,\n toIndex: number,\n action: CngxStepperCommitAction,\n onResolve: (accept: boolean) => void,\n ): void;\n\n /** Cancel the in-flight transition without firing callbacks. */\n cancel(): void;\n\n /** Live `pending` flag from the controller. */\n readonly isCommitting: Signal<boolean>;\n}\n\n/**\n * Options for {@link createStepperCommitHandler}.\n *\n * @category common/stepper\n */\nexport interface CngxStepperCommitHandlerOptions {\n readonly controller: CngxCommitController<number>;\n}\n\n/**\n * Build a stepper commit handler over an existing {@link CngxCommitController}.\n * Resolves `Observable<boolean>` / `Promise<boolean>` / `boolean` returns into\n * a unified `accept: boolean` outcome.\n *\n * @category common/stepper\n */\nexport function createStepperCommitHandler(\n opts: CngxStepperCommitHandlerOptions,\n): CngxStepperCommitHandler {\n const { controller } = opts;\n return {\n isCommitting: controller.isCommitting,\n\n beginTransition(fromIndex, toIndex, action, onResolve) {\n controller.begin(\n (handlers) => runStepperAction(action, fromIndex, toIndex, handlers),\n toIndex,\n fromIndex,\n {\n onSuccess: () => onResolve(true),\n onError: () => onResolve(false),\n },\n );\n },\n\n cancel() {\n controller.cancel();\n },\n };\n}\n\n/** @internal */\nfunction runStepperAction(\n action: CngxStepperCommitAction,\n fromIndex: number,\n toIndex: number,\n handlers: {\n readonly onSuccess: (committed: number | undefined) => void;\n readonly onError: (err: unknown) => void;\n },\n): CngxCommitHandle {\n let cancelled = false;\n let unsubscribe: (() => void) | null = null;\n\n const safeSuccess = (accept: boolean): void => {\n if (cancelled) {\n return;\n }\n if (accept) {\n handlers.onSuccess(toIndex);\n } else {\n handlers.onError(new Error('Stepper transition refused by commitAction'));\n }\n };\n const safeError = (err: unknown): void => {\n if (cancelled) {\n return;\n }\n handlers.onError(err);\n };\n\n let result: boolean | Promise<boolean> | Observable<boolean>;\n try {\n result = action(fromIndex, toIndex);\n } catch (err: unknown) {\n safeError(err);\n return {\n cancel: () => {\n cancelled = true;\n },\n };\n }\n\n if (isObservable(result)) {\n // Synchronous Observables (`of(true)`) emit inside `.subscribe`\n // before the assignment binds - `sub` would be in TDZ. Declare\n // the handle on a `let` first.\n let sub: Subscription | null = null;\n sub = result.subscribe({\n next: (accept) => {\n safeSuccess(accept);\n sub?.unsubscribe();\n },\n error: (err: unknown) => safeError(err),\n });\n unsubscribe = () => sub?.unsubscribe();\n } else if (result != null && typeof (result as { then?: unknown }).then === 'function') {\n (result as Promise<boolean>).then(safeSuccess, safeError);\n } else {\n safeSuccess(result as boolean);\n }\n\n return {\n cancel: () => {\n cancelled = true;\n unsubscribe?.();\n },\n };\n}\n\n/**\n * Factory signature for {@link CngxStepperCommitHandler}. Override\n * {@link CNGX_STEPPER_COMMIT_HANDLER_FACTORY} for retry-with-backoff,\n * telemetry, or offline queues.\n *\n * @category common/stepper\n */\nexport type CngxStepperCommitHandlerFactory = (\n opts: CngxStepperCommitHandlerOptions,\n) => CngxStepperCommitHandler;\n\n/**\n * DI token carrying the factory the presenter uses to allocate its commit\n * handler. Symmetric to the select family's `CNGX_ARRAY_COMMIT_HANDLER_FACTORY`.\n *\n * @category common/stepper\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/commit-handler.ts\n * @since 0.1.0\n */\nexport const CNGX_STEPPER_COMMIT_HANDLER_FACTORY =\n new InjectionToken<CngxStepperCommitHandlerFactory>('CngxStepperCommitHandlerFactory', {\n providedIn: 'root',\n factory: () => createStepperCommitHandler,\n });\n","import {\n type EnvironmentProviders,\n inject,\n InjectionToken,\n makeEnvironmentProviders,\n type Provider,\n type TemplateRef,\n} from '@angular/core';\n\nimport type { CngxDotStepperDotContext } from './slots/dot-stepper-dot.directive';\nimport type { CngxStepBadgeContext } from './slots/step-badge.directive';\nimport type { CngxStepBusySpinnerContext } from './slots/step-busy-spinner.directive';\nimport type { CngxStepErrorContext } from './slots/step-error.directive';\nimport type { CngxStepGroupHeaderContext } from './slots/step-group-header.directive';\nimport type { CngxStepIndicatorContext } from './slots/step-indicator.directive';\nimport type { CngxStepRejectionContext } from './slots/step-rejection.directive';\n\n/**\n * Aria-label overrides for the stepper landmark region. Library\n * defaults are English; locales come from consumer overrides.\n *\n * Per-step navigation labels (`previousStep`, `nextStep`) live in\n * {@link CngxStepperI18n} - SR phrasing, not landmark naming.\n * Splitting the surfaces avoids a dual-override path for the same string.\n *\n * @category common/stepper\n */\nexport interface CngxStepperAriaLabels {\n readonly stepperRegion?: string;\n}\n\n/**\n * Fallback labels for derived strings (group descriptors, badge SR\n * announcements). English defaults; consumer overrides per locale.\n *\n * @category common/stepper\n */\nexport interface CngxStepperFallbackLabels {\n readonly groupRoleDescription?: string;\n readonly stepRoleDescription?: string;\n}\n\n/**\n * Per-slot template overrides for `<cngx-stepper>`. Middle tier of\n * the 3-stage cascade: per-instance directive > this field > built-in\n * markup. Apply via the `with*Template` feature builders below.\n *\n * @category common/stepper\n */\nexport interface CngxStepperTemplates {\n readonly indicator?: TemplateRef<CngxStepIndicatorContext>;\n readonly badge?: TemplateRef<CngxStepBadgeContext>;\n readonly busySpinner?: TemplateRef<CngxStepBusySpinnerContext>;\n readonly rejection?: TemplateRef<CngxStepRejectionContext>;\n readonly stepError?: TemplateRef<CngxStepErrorContext>;\n readonly groupHeader?: TemplateRef<CngxStepGroupHeaderContext>;\n readonly empty?: TemplateRef<void>;\n readonly dotStepperDot?: TemplateRef<CngxDotStepperDotContext>;\n}\n\n/**\n * Selectable visual skin for the cngx-standard stepper. The skin is a\n * pure thematic concern - every value renders the same structure, same\n * slots, same ARIA, same keyboard behaviour, and only redirects CSS via\n * the `[data-skin]` host attribute. The Material twin\n * (`<cngx-mat-stepper>`) ignores this setting.\n *\n * @category common/stepper\n */\nexport type CngxStepperSkin =\n | 'classic'\n | 'linear-minimal'\n | 'stripe-status-rich'\n | 'path-chevron'\n | 'pill-segment'\n | 'chips'\n | 'breadcrumb';\n\n/**\n * Mobile auto-collapse target. Under a narrow viewport\n * (`max-width: 480px`), `<cngx-stepper>` falls back to one of the\n * compact variants instead of rendering the full strip. Set to\n * `'off'` to retain the classic strip on every viewport.\n *\n * @category common/stepper\n */\nexport type CngxStepperMobileCollapse = 'text' | 'dots' | 'off';\n\n/**\n * Header-navigation policy for `<cngx-stepper>`. `'none'` renders the\n * step headers as inert labels - the footer is the sole navigation\n * control. `'visited'` (default) keeps the headers as focusable\n * buttons; reachability folds into the `linear` axis (`linear=false`\n * is free click-through, `linear=true` is backward-to-visited only,\n * with linear-unreachable headers marked `aria-disabled`). There is no\n * discrete `'free'` value - `'free'` is `'visited'` + `linear=false`.\n *\n * @category common/stepper\n */\nexport type CngxStepperHeaderNavigation = 'none' | 'visited';\n\n/**\n * Focus-driven group-collapse policy for grouped `<cngx-stepper>` flows.\n * `'expand-active'` collapses every non-active `cngxStepGroup` branch to\n * its header node and expands only the group holding the active step;\n * `'off'` (default) keeps every group's children rendered in the strip -\n * the browser-native baseline. Orthogonal to the `mobileCollapse` axis;\n * the two never edit each other. The Material twin (`[cngxMatStepper]`)\n * ignores this setting.\n *\n * @category common/stepper\n */\nexport type CngxStepperGroupCollapse = 'expand-active' | 'off';\n\n/**\n * What a collapsed `cngxStepGroup` header shows next to its label under\n * `groupCollapse: 'expand-active'`. `'progress'` (default) shows\n * completed/total steps; `'count'` shows the step count; `'status'`\n * shows a status dot coloured by the group's rolled-up state; `'off'`\n * shows the bare label. Only ever rendered on a collapsed group header.\n *\n * @category common/stepper\n */\nexport type CngxStepperGroupSummary = 'progress' | 'count' | 'status' | 'off';\n\n/**\n * Space-driven density policy for the classic `<cngx-stepper>` strip.\n * `'auto'` degrades the strip on its own container width\n * (full labels -> ellipsis-truncated -> indicators-only with the active\n * label kept); `'comfortable'` (default) keeps full labels at every\n * width. Orthogonal to `mobileCollapse` and `groupCollapse`; the\n * Material twin ignores this setting.\n *\n * @category common/stepper\n */\nexport type CngxStepperDensity = 'comfortable' | 'auto';\n\n/**\n * Per-step px thresholds the `density: 'auto'` ladder reacts to.\n * `compact` is the minimum px per step that keeps full labels; below\n * `minimal` px per step the strip drops to indicators-only. `compact`\n * must exceed `minimal`.\n *\n * @category common/stepper\n */\nexport interface CngxStepperDensityBreakpoints {\n readonly compact: number;\n readonly minimal: number;\n}\n\n/**\n * Where the mobile auto-collapse indicator (text caption or dot row)\n * sits relative to the active step's panel content under narrow\n * viewports. `'top'` (default) keeps the indicator above the panel;\n * `'bottom'` flips it below so the user reads content first and the\n * navigation cue sits at the thumb zone. Ignored when the classic\n * strip is on screen (`displayMode === 'classic'`).\n *\n * @category common/stepper\n */\nexport type CngxStepperMobileIndicatorPosition = 'top' | 'bottom';\n\n/**\n * Default media query the mobile auto-collapse policy reacts to. The\n * literal lives on a single exported const so the runtime, the config\n * default, and any JSDoc cross-references stay in lockstep. Consumers\n * override the query via {@link withStepperMobileBreakpoint}.\n *\n * @category common/stepper\n */\nexport const STEPPER_DEFAULT_MOBILE_BREAKPOINT = '(max-width: 480px)';\n\n/**\n * Default per-step px thresholds for the `density: 'auto'` ladder. The\n * literal lives on a single exported const so the runtime resolver, the\n * config default, and any JSDoc cross-references stay in lockstep.\n * Consumers override via {@link withStepperDensity}'s second argument.\n *\n * @category common/stepper\n */\nexport const STEPPER_DEFAULT_DENSITY_BREAKPOINTS: CngxStepperDensityBreakpoints = {\n compact: 120,\n minimal: 64,\n};\n\n/**\n * Stepper config surface. Resolution priority: per-instance Input\n * > `provideStepperConfigAt` (viewProviders) > `provideStepperConfig`\n * (root) > library default. Canonical cngx config shape.\n *\n * @category common/stepper\n */\nexport interface CngxStepperConfig {\n readonly defaultOrientation?: 'horizontal' | 'vertical';\n readonly defaultLinear?: boolean;\n readonly defaultCommitMode?: 'optimistic' | 'pessimistic';\n readonly routerSyncMode?: 'fragment' | 'queryParam';\n readonly routerSyncParam?: string;\n readonly skin?: CngxStepperSkin;\n /**\n * Header-navigation policy. `'none'` makes the step headers inert\n * labels (footer-only navigation); `'visited'` (default) keeps them\n * focusable buttons whose reachability folds into the `linear` axis.\n * Per-instance `[headerNavigation]` Input still wins.\n */\n readonly headerNavigation?: CngxStepperHeaderNavigation;\n /**\n * Focus-driven group-collapse policy. `'expand-active'` collapses\n * non-active `cngxStepGroup` branches to their header node and expands\n * only the active group; `'off'` (default) keeps the full strip.\n * Orthogonal to `mobileCollapse`. Apply app-wide via\n * {@link withStepperGroupCollapse}.\n */\n readonly groupCollapse?: CngxStepperGroupCollapse;\n /**\n * What a collapsed `cngxStepGroup` header shows beside its label.\n * Default `'progress'` (completed/total). Only applies when\n * `groupCollapse` is `'expand-active'`. Set via\n * {@link withStepperGroupCollapseSummary}.\n */\n readonly groupCollapseSummary?: CngxStepperGroupSummary;\n /**\n * Space-driven density policy for the classic strip. `'auto'`\n * degrades labels on the strip's own container width; `'comfortable'`\n * (default) keeps full labels. Orthogonal to `mobileCollapse`. Apply\n * app-wide via {@link withStepperDensity}.\n */\n readonly density?: CngxStepperDensity;\n /**\n * Per-step px thresholds for the `density: 'auto'` ladder. Default\n * {@link STEPPER_DEFAULT_DENSITY_BREAKPOINTS}. Override via\n * {@link withStepperDensity}'s second argument.\n */\n readonly densityBreakpoints?: CngxStepperDensityBreakpoints;\n /**\n * Opt-in connector rail between adjacent step indicators on the\n * classic skin. Off by default. The rule is double-scoped on\n * `[data-skin='classic']`, so the four other skins are mechanically\n * untouched (each ships its own inter-step decoration). Per-instance\n * `[connectors]` Input still wins.\n */\n readonly connectors?: boolean;\n readonly mobileCollapse?: CngxStepperMobileCollapse;\n /**\n * Media query the mobile auto-collapse policy reacts to. Default\n * {@link STEPPER_DEFAULT_MOBILE_BREAKPOINT}. Tablet consumers can\n * re-aim the trigger via {@link withStepperMobileBreakpoint}.\n */\n readonly mobileBreakpoint?: string;\n /**\n * Where the mobile auto-collapse indicator sits relative to the\n * panel content. Default `'top'`. Override per-instance via the\n * `[mobileIndicatorPosition]` input or app-wide via\n * {@link withStepperMobileIndicatorPosition}.\n */\n readonly mobileIndicatorPosition?: CngxStepperMobileIndicatorPosition;\n /**\n * Whether horizontal swipe gestures advance/retreat the active step\n * while the stepper is in mobile-collapse mode (`'dots'` / `'text'`).\n * Default `true`. Override per-instance via the `[mobileSwipe]` input\n * or app-wide via {@link withStepperMobileSwipe}. Ignored on the\n * classic strip and on the Material twin (`<cngx-mat-stepper>`).\n */\n readonly mobileSwipe?: boolean;\n readonly ariaLabels?: CngxStepperAriaLabels;\n readonly fallbackLabels?: CngxStepperFallbackLabels;\n readonly templates?: CngxStepperTemplates;\n}\n\n/** @internal */\nconst STEPPER_CONFIG_DEFAULTS: Required<\n Omit<CngxStepperConfig, 'ariaLabels' | 'fallbackLabels' | 'templates'>\n> & {\n ariaLabels: CngxStepperAriaLabels;\n fallbackLabels: CngxStepperFallbackLabels;\n templates: CngxStepperTemplates;\n} = {\n defaultOrientation: 'horizontal',\n defaultLinear: false,\n defaultCommitMode: 'pessimistic',\n routerSyncMode: 'fragment',\n routerSyncParam: 'step',\n skin: 'classic',\n headerNavigation: 'visited',\n groupCollapse: 'off',\n groupCollapseSummary: 'progress',\n density: 'comfortable',\n densityBreakpoints: STEPPER_DEFAULT_DENSITY_BREAKPOINTS,\n connectors: false,\n mobileCollapse: 'text',\n mobileBreakpoint: STEPPER_DEFAULT_MOBILE_BREAKPOINT,\n mobileIndicatorPosition: 'top',\n mobileSwipe: true,\n ariaLabels: {\n stepperRegion: 'Stepper',\n },\n fallbackLabels: {\n groupRoleDescription: 'step group',\n stepRoleDescription: 'stepper',\n },\n templates: {},\n};\n\n/**\n * DI token for the resolved stepper config. `providedIn: 'root'` with\n * library defaults; override via {@link provideStepperConfig} (root)\n * or {@link provideStepperConfigAt} (component scope).\n *\n * @category common/stepper\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/stepper-config.ts\n * @since 0.1.0\n */\nexport const CNGX_STEPPER_CONFIG = new InjectionToken<CngxStepperConfig>('CngxStepperConfig', {\n providedIn: 'root',\n factory: () => STEPPER_CONFIG_DEFAULTS,\n});\n\n/**\n * Feature signature - each `with*` builder reduces over the config.\n * Hidden `_target: 'config'` discriminator routes through the family\n * aggregator {@link provideCngxStepper}.\n *\n * @category common/stepper\n */\nexport type CngxStepperConfigFeature = ((config: CngxStepperConfig) => CngxStepperConfig) & {\n readonly _target: 'config';\n};\n\n/**\n * Brands a config mutator with `_target: 'config'`. Every `with*`\n * config feature returns one of these.\n *\n * @internal\n */\nfunction defineStepperConfigFeature(\n fn: (config: CngxStepperConfig) => CngxStepperConfig,\n): CngxStepperConfigFeature {\n return Object.assign(fn, { _target: 'config' as const });\n}\n\n/**\n * Override the default orientation. Per-instance `[orientation]`\n * Input still wins; this only moves the cascade default.\n *\n * @category common/stepper\n */\nexport function withStepperDefaultOrientation(\n orientation: 'horizontal' | 'vertical',\n): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({\n ...cfg,\n defaultOrientation: orientation,\n }));\n}\n\n/**\n * Override the default linear-progression setting. Per-instance\n * `[linear]` Input still wins.\n *\n * @category common/stepper\n */\nexport function withStepperLinear(linear: boolean): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({ ...cfg, defaultLinear: linear }));\n}\n\n/**\n * Override the default commit mode for async step transitions.\n * `'optimistic'` advances on action dispatch and rolls back on error;\n * `'pessimistic'` waits for success. Per-instance `[commitMode]`\n * Input still wins.\n *\n * @category common/stepper\n */\nexport function withStepperCommitMode(\n mode: 'optimistic' | 'pessimistic',\n): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({\n ...cfg,\n defaultCommitMode: mode,\n }));\n}\n\n/**\n * Configure router synchronisation for the active step. `mode` chooses\n * the URL surface (URL fragment or query parameter); `param` names the\n * key (default `'step'`).\n *\n * @category common/stepper\n */\nexport function withStepperRouterSync(\n mode: 'fragment' | 'queryParam',\n param = 'step',\n): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({\n ...cfg,\n routerSyncMode: mode,\n routerSyncParam: param,\n }));\n}\n\n/**\n * Select the visual skin for the cngx-standard `<cngx-stepper>`. The\n * default is `'classic'`. Per-instance `[skin]` Input still wins; this\n * moves the cascade default. Structure, slots, ARIA, and keyboard\n * behaviour are identical across skins - only the `[data-skin]` host\n * attribute changes the CSS layer that paints the strip.\n *\n * @category common/stepper\n */\nexport function withStepperSkin(skin: CngxStepperSkin): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({ ...cfg, skin }));\n}\n\n/**\n * Opt the classic `<cngx-stepper>` skin into the connector-rail\n * presentation: a solid completed/upcoming rail between adjacent step\n * indicators, horizontal and vertical, with per-segment coloring driven\n * by the preceding step's `[data-state]`. The rule is double-scoped on\n * `[data-skin='classic']`; the four other skins each ship their own\n * inter-step decoration and ignore this flag. Per-instance\n * `[connectors]` Input still wins.\n *\n * @category common/stepper\n */\nexport function withStepperConnectors(on: boolean): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({ ...cfg, connectors: on }));\n}\n\n/**\n * Configure the mobile auto-collapse target for `<cngx-stepper>`. Under\n * a narrow viewport (`max-width: 480px`), the classic strip swaps to\n * the chosen variant - `'text'` (default) renders `<cngx-text-stepper>`,\n * `'dots'` renders `<cngx-dot-stepper>`, `'off'` keeps the classic\n * strip. The Material twin `<cngx-mat-stepper>` ignores this setting.\n *\n * @category common/stepper\n */\nexport function withStepperMobileCollapse(\n mode: CngxStepperMobileCollapse,\n): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({ ...cfg, mobileCollapse: mode }));\n}\n\n/**\n * Override the media query the mobile auto-collapse policy reacts to.\n * Default `'(max-width: 480px)'`. Useful for tablet-tier consumers\n * who want the collapse to engage at 768px or for design systems\n * aligned with `--mat-sys-breakpoint-*` tokens.\n *\n * @category common/stepper\n */\nexport function withStepperMobileBreakpoint(query: string): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({ ...cfg, mobileBreakpoint: query }));\n}\n\n/**\n * Set the app-wide default position of the mobile auto-collapse\n * indicator relative to panel content. `'top'` keeps the indicator\n * above (library default); `'bottom'` flips it below so panel content\n * reads first and the navigation cue sits at thumb height. Per-\n * instance `[mobileIndicatorPosition]` on `<cngx-stepper>` still\n * wins.\n *\n * @category common/stepper\n */\nexport function withStepperMobileIndicatorPosition(\n position: CngxStepperMobileIndicatorPosition,\n): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({ ...cfg, mobileIndicatorPosition: position }));\n}\n\n/**\n * Toggle the built-in horizontal-swipe navigation on `<cngx-stepper>`\n * in mobile-collapse mode. Default `true` - the `'dots'` and `'text'`\n * variants read as carousels, so users expect to swipe. Per-instance\n * `[mobileSwipe]` Input still wins; the classic strip is unaffected.\n *\n * @category common/stepper\n */\nexport function withStepperMobileSwipe(enabled: boolean): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({ ...cfg, mobileSwipe: enabled }));\n}\n\n/**\n * Set the app-wide default header-navigation policy for\n * `<cngx-stepper>`. `'none'` renders inert label headers (footer-only\n * navigation); `'visited'` (library default) keeps the headers as\n * focusable buttons whose reachability folds into the `linear` axis.\n * Per-instance `[headerNavigation]` Input still wins.\n *\n * @category common/stepper\n */\nexport function withStepperHeaderNavigation(\n mode: CngxStepperHeaderNavigation,\n): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({ ...cfg, headerNavigation: mode }));\n}\n\n/**\n * Set the app-wide focus-driven group-collapse policy for grouped\n * `<cngx-stepper>` flows. `'expand-active'` collapses every non-active\n * `cngxStepGroup` branch to its header node and expands only the group\n * holding the active step; `'off'` (library default) keeps the full\n * strip. Orthogonal to the `mobileCollapse` axis. The Material twin\n * ignores this setting.\n *\n * @category common/stepper\n */\nexport function withStepperGroupCollapse(\n mode: CngxStepperGroupCollapse,\n): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({ ...cfg, groupCollapse: mode }));\n}\n\n/**\n * Choose what a collapsed `cngxStepGroup` header shows beside its label\n * under `groupCollapse: 'expand-active'`. `'progress'` (library default)\n * shows completed/total steps; `'count'` the step count; `'status'` a\n * status dot coloured by the group's rolled-up state; `'off'` the bare\n * label. No effect unless `groupCollapse` is `'expand-active'`.\n *\n * @category common/stepper\n */\nexport function withStepperGroupCollapseSummary(\n mode: CngxStepperGroupSummary,\n): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({ ...cfg, groupCollapseSummary: mode }));\n}\n\n/**\n * Set the app-wide space-driven density policy for the classic\n * `<cngx-stepper>` strip. `'auto'` degrades labels on the strip's own\n * container width (full -> compact -> minimal); `'comfortable'`\n * (library default) keeps full labels at every width. The optional\n * second argument overrides the per-step px thresholds (default\n * {@link STEPPER_DEFAULT_DENSITY_BREAKPOINTS}). Orthogonal to the\n * `mobileCollapse` axis; the Material twin ignores this setting.\n *\n * @category common/stepper\n */\nexport function withStepperDensity(\n mode: CngxStepperDensity,\n breakpoints?: CngxStepperDensityBreakpoints,\n): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({\n ...cfg,\n density: mode,\n ...(breakpoints ? { densityBreakpoints: breakpoints } : {}),\n }));\n}\n\n/**\n * Merge ARIA labels into the cascade. Keys not provided keep their\n * library defaults; per-instance overrides on the stepper still win.\n *\n * @category common/stepper\n */\nexport function withStepperAriaLabels(labels: CngxStepperAriaLabels): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({\n ...cfg,\n ariaLabels: { ...cfg.ariaLabels, ...labels },\n }));\n}\n\n/**\n * Merge text fallback labels (button captions, error strings) into the\n * cascade. Used when a slot directive is not present.\n *\n * @category common/stepper\n */\nexport function withStepperFallbackLabels(\n labels: CngxStepperFallbackLabels,\n): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({\n ...cfg,\n fallbackLabels: { ...cfg.fallbackLabels, ...labels },\n }));\n}\n\n/**\n * Override the default `*cngxStepIndicator` template app-wide.\n * Per-instance directive still wins; this only moves the cascade\n * middle tier.\n *\n * @category common/stepper\n */\nexport function withStepIndicatorTemplate(\n template: TemplateRef<CngxStepIndicatorContext>,\n): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({\n ...cfg,\n templates: { ...cfg.templates, indicator: template },\n }));\n}\n\n/**\n * Override the default `*cngxStepBadge` template app-wide.\n *\n * @category common/stepper\n */\nexport function withStepBadgeTemplate(\n template: TemplateRef<CngxStepBadgeContext>,\n): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({\n ...cfg,\n templates: { ...cfg.templates, badge: template },\n }));\n}\n\n/**\n * Override the default `*cngxStepBusySpinner` template app-wide.\n *\n * @category common/stepper\n */\nexport function withStepBusySpinnerTemplate(\n template: TemplateRef<CngxStepBusySpinnerContext>,\n): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({\n ...cfg,\n templates: { ...cfg.templates, busySpinner: template },\n }));\n}\n\n/**\n * Override the default `*cngxStepRejection` template app-wide.\n * Symmetric with the upcoming tabs `cngxTabRejectionIcon` (Phase 4).\n *\n * @category common/stepper\n */\nexport function withStepRejectionTemplate(\n template: TemplateRef<CngxStepRejectionContext>,\n): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({\n ...cfg,\n templates: { ...cfg.templates, rejection: template },\n }));\n}\n\n/**\n * Override the default `*cngxStepError` template app-wide. The slot\n * renders the per-step validation reason on the skins with a label area\n * (classic / stripe-status-rich). Per-instance directive still wins;\n * this moves the cascade middle tier.\n *\n * @category common/stepper\n */\nexport function withStepErrorTemplate(\n template: TemplateRef<CngxStepErrorContext>,\n): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({\n ...cfg,\n templates: { ...cfg.templates, stepError: template },\n }));\n}\n\n/**\n * Override the default `*cngxStepGroupHeader` template app-wide.\n *\n * @category common/stepper\n */\nexport function withStepGroupHeaderTemplate(\n template: TemplateRef<CngxStepGroupHeaderContext>,\n): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({\n ...cfg,\n templates: { ...cfg.templates, groupHeader: template },\n }));\n}\n\n/**\n * Override the default `*cngxStepperEmpty` template app-wide.\n *\n * @category common/stepper\n */\nexport function withStepperEmptyTemplate(template: TemplateRef<void>): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({\n ...cfg,\n templates: { ...cfg.templates, empty: template },\n }));\n}\n\n/**\n * Override the default `*cngxDotStepperDot` template app-wide. The\n * `<cngx-dot-stepper>` variant resolves the cascade per dot:\n * per-instance directive > this feature > built-in empty body\n * (the dot fill is painted by `.cngx-dot-stepper__dot` regardless).\n *\n * @category common/stepper\n */\nexport function withDotStepperDotTemplate(\n template: TemplateRef<CngxDotStepperDotContext>,\n): CngxStepperConfigFeature {\n return defineStepperConfigFeature((cfg) => ({\n ...cfg,\n templates: { ...cfg.templates, dotStepperDot: template },\n }));\n}\n\n/** @internal */\nfunction resolveFeatures(features: readonly CngxStepperConfigFeature[]): CngxStepperConfig {\n return features.reduce<CngxStepperConfig>((cfg, feat) => feat(cfg), STEPPER_CONFIG_DEFAULTS);\n}\n\n/**\n * Root-level provider for the stepper config. Apply once in the\n * application providers array. Sibling of `provideTabsConfig` /\n * `provideSelectConfig`.\n *\n * @category common/stepper\n */\nexport function provideStepperConfig(\n ...features: readonly CngxStepperConfigFeature[]\n): EnvironmentProviders {\n return makeEnvironmentProviders([\n { provide: CNGX_STEPPER_CONFIG, useValue: resolveFeatures(features) },\n ]);\n}\n\n/**\n * Component-scoped config override. Spread the returned `Provider[]`\n * into `providers` or `viewProviders` - `viewProviders` cannot accept\n * opaque {@link EnvironmentProviders}, so the twin returns a list.\n * Sibling of `provideTabsConfigAt`.\n *\n * Resolution priority: per-instance Input > viewProviders (`At`) >\n * root provider > library default.\n *\n * ```ts\n * @Component({\n * viewProviders: [...provideStepperConfigAt(withStepperLinear(true))],\n * })\n * ```\n *\n * @category common/stepper\n */\nexport function provideStepperConfigAt(\n ...features: readonly CngxStepperConfigFeature[]\n): Provider[] {\n return [{ provide: CNGX_STEPPER_CONFIG, useValue: resolveFeatures(features) }];\n}\n\n/**\n * Inject the resolved stepper config in an injection context.\n *\n * @category common/stepper\n */\nexport function injectStepperConfig(): CngxStepperConfig {\n return inject(CNGX_STEPPER_CONFIG);\n}\n","import { InjectionToken, type Signal } from '@angular/core';\n\nimport type { CngxAsyncState, StatusTransition } from '@cngx/core/utils';\n\nimport type { CngxErrorAggregatorContract } from '@cngx/common/interactive';\n\n/**\n * Status enum for a single step. Driven by the presenter's commit-controller\n * lifecycle plus the optional `errorAggregator`.\n *\n * @category common/stepper\n */\nexport type CngxStepStatus = 'idle' | 'pending' | 'success' | 'error' | 'disabled' | 'busy';\n\n/**\n * Step-tree node. Either a terminal `step` (has its own panel) or a\n * `group` carrying nested children. Discriminated by `kind`.\n *\n * @category common/stepper\n */\nexport interface CngxStepNode {\n readonly id: string;\n readonly kind: 'step' | 'group';\n readonly label: Signal<string>;\n readonly disabled: Signal<boolean>;\n /** Live step status. Reactive to commit-controller + aggregator. */\n readonly state: Signal<CngxStepStatus>;\n /** Optional error aggregator signal for badge / SR phrasing. */\n readonly errorAggregator?: Signal<CngxErrorAggregatorContract | undefined>;\n /**\n * Message carried by a direct `[error]` string input on the step, or\n * `undefined` when `[error]` is boolean / absent. Pure data carrier\n * read by the `*cngxStepError` slot + the mini-skin aggregate line -\n * not a swap surface.\n */\n readonly errorMessage?: Signal<string | undefined>;\n /** Direct children for group nodes; empty for step nodes. */\n readonly children: readonly CngxStepNode[];\n /** DFS depth (root = 0). */\n readonly depth: number;\n /** Parent group id, or `null` for root. */\n readonly parentId: string | null;\n /** Flat-projection index inside `flatSteps()`. -1 for groups. */\n readonly flatIndex: number;\n}\n\n/**\n * Handle a `CngxStep` / `CngxStepGroup` passes to its host. The host owns\n * the registry; the atom owns its own state slot.\n *\n * @internal\n */\nexport interface CngxStepRegistration {\n readonly id: string;\n readonly kind: 'step' | 'group';\n readonly label: Signal<string>;\n readonly disabled: Signal<boolean>;\n readonly state: Signal<CngxStepStatus>;\n readonly errorAggregator?: Signal<CngxErrorAggregatorContract | undefined>;\n /**\n * Resolved message from a direct `[error]` string input, or\n * `undefined` for boolean / absent. Pure data carrier (not a swap\n * token); surfaced on {@link CngxStepNode.errorMessage}.\n */\n readonly errorMessage?: Signal<string | undefined>;\n}\n\n/**\n * Contract atoms see via {@link CNGX_STEPPER_HOST}. Mirrors the\n * directive's surface 1:1 - atoms never reach the concrete class.\n *\n * @category common/stepper\n */\nexport interface CngxStepperHost {\n readonly stepTree: Signal<readonly CngxStepNode[]>;\n readonly flatSteps: Signal<readonly CngxStepNode[]>;\n /**\n * Step-only flat projection (group nodes filtered out).\n * Structural-equal via `flatStepsEqual`; the single source for any\n * step-count / step-position lookup.\n *\n * **Contract:** variant and skin organisms MUST read this signal\n * directly. Local re-derivation (e.g. `flatSteps().filter(...)`\n * inside a variant's `computed`) is rejected at review time -\n * the projection's equality contract is the load-bearing\n * invariant, and a local re-filter breaks the shape-stable\n * short-circuit that downstream consumers rely on. Add lookup\n * helpers as methods on this contract rather than re-deriving.\n *\n * @category common/stepper\n */\n readonly stepsOnly: Signal<readonly CngxStepNode[]>;\n\n /**\n * Flat strip projection under the focus-driven group-collapse policy:\n * identical to {@link flatSteps} when `groupCollapse` is `'off'`, and\n * with every non-active root-level group's children dropped (header\n * node alone) under `'expand-active'`. The strip `@for` reads this;\n * `stepsOnly` stays the single counting / announcement source.\n *\n * **Contract:** variant and skin organisms drive the strip off this\n * projection, never re-derive it. Structural-equal via `flatStepsEqual`\n * (each retained node keeps its `flatSteps` `flatIndex`), so a\n * shape-stable re-emit short-circuits the strip render.\n *\n * @category common/stepper\n */\n readonly visibleStripNodes: Signal<readonly CngxStepNode[]>;\n readonly activeStepIndex: Signal<number>;\n readonly activeStepId: Signal<string | null>;\n\n /**\n * Root-level group whose subtree contains the active step, or `null`\n * when the active step is a root-level step (e.g. a trailing\n * `Finish`). The single focus-driven-collapse source: atoms read it\n * via this contract, never the concrete presenter. Drives\n * `CngxStepGroup.isCollapsed`, the strip `aria-expanded` binding, and\n * {@link visibleStripNodes}.\n */\n readonly activeGroupId: Signal<string | null>;\n\n /** Step-only count - the length of {@link stepsOnly}. */\n readonly stepCount: Signal<number>;\n\n /** `true` when the active step is the first one (no earlier step). */\n readonly isFirstStep: Signal<boolean>;\n\n /** `true` when the active step is the last one (no later step). */\n readonly isLastStep: Signal<boolean>;\n\n /**\n * `true` when {@link selectPrevious} would move - i.e. an enabled\n * step precedes the active one. The single gate a Back affordance\n * reads; never re-derive it from {@link stepsOnly} at the call site.\n */\n readonly canGoPrevious: Signal<boolean>;\n\n /**\n * `true` when {@link selectNext} would move - i.e. an enabled,\n * linear-unblocked step follows the active one. Derived from the same\n * predicates `select()` enforces, so a Next affordance can never\n * drift from the navigation it gates.\n */\n readonly canGoNext: Signal<boolean>;\n\n /**\n * `true` while a commit is in flight (`commitState.status() ===\n * 'pending'`). Drives the busy-disable on nav affordances. Keyed on\n * the strict `'pending'` status, consistent with the per-step busy\n * gate.\n */\n readonly busy: Signal<boolean>;\n\n /**\n * Label of the step {@link selectNext} would land on, or `undefined`\n * when none follows. Resolved through the enabled-step traversal so a\n * \"Continue to {{ label }}\" affordance announces the real target.\n */\n readonly nextStepLabel: Signal<string | undefined>;\n\n /**\n * Label of the step {@link selectPrevious} would land on, or\n * `undefined` when none precedes.\n */\n readonly previousStepLabel: Signal<string | undefined>;\n\n readonly linear: Signal<boolean>;\n readonly orientation: Signal<'horizontal' | 'vertical'>;\n readonly commitState: CngxAsyncState<number | undefined>;\n readonly intendedStepIndex: Signal<number | undefined>;\n\n /**\n * Reactive current/previous pair for the commit-state status. The\n * organism's `<span cngxLiveRegion>` reads this tracker on every\n * `pending → success / error` transition. Allocated once per\n * presenter - consumers MUST read this rather than calling\n * `createTransitionTracker` locally so the `linkedSignal` is shared.\n */\n readonly commitTransition: StatusTransition;\n\n /**\n * Index of the most recently refused commit target, or `undefined`\n * when no rejection is pending. Set by the rejection arm of\n * `select()`; cleared by a successful re-pick of the same target\n * or via {@link clearLastFailed}. Drives strip rejection decoration\n * and the `commitRolledBackTo` chain in `liveAnnouncement`.\n */\n readonly lastFailedIndex: Signal<number | undefined>;\n\n /**\n * Origin captured at commit-window open - the safe-harbour the user\n * is returned to on optimistic rollback. Resolves the origin label\n * for the `commitRolledBackTo(originLabel)` phrase. Cleared on\n * success; retained on rejection through the persistence window.\n */\n readonly originIndexDuringCommit: Signal<number | undefined>;\n\n /**\n * `true` when the header at the given step-only index may be\n * navigated to: the step is enabled and not blocked by the `linear`\n * gate. The single reachability predicate a header affordance reads -\n * the organism MUST call this rather than reaching the presenter's\n * private linear-block check. Out-of-range indices return `false`.\n */\n canNavigateTo(index: number): boolean;\n\n select(index: number): void;\n selectNext(): void;\n selectPrevious(): void;\n selectById(id: string): void;\n reset(): void;\n\n /**\n * Drop the persisted {@link lastFailedIndex} flag. Idempotent;\n * safe to wire to a Dismiss button or aggregator-cleared.\n */\n clearLastFailed(): void;\n\n register(handle: CngxStepRegistration, parentId?: string | null): void;\n unregister(id: string): void;\n}\n\n/**\n * DI token carrying the presenter's contract to atoms + organism shells.\n * Atoms inject `optional: true` and either register here or fall through\n * {@link CNGX_STEP_GROUP_HOST} when nested in a group.\n *\n * @category common/stepper\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/stepper-host.token.ts\n * @since 0.1.0\n */\nexport const CNGX_STEPPER_HOST = new InjectionToken<CngxStepperHost>('CngxStepperHost');\n","import type { CngxStepNode } from './stepper-host.token';\n\n/**\n * DFS-flatten a step tree. Group nodes emit before their children;\n * the consumer keys off `kind` to render a panel container vs. a\n * group header.\n *\n * @internal\n */\nexport function flattenStepTree(nodes: readonly CngxStepNode[]): readonly CngxStepNode[] {\n const out: CngxStepNode[] = [];\n let flatIndex = 0;\n const visit = (list: readonly CngxStepNode[]): void => {\n for (const node of list) {\n // Re-emit with the live flatIndex; registry-builder seeds -1\n // so it doesn't need to know the final ordering.\n out.push({ ...node, flatIndex: node.kind === 'step' ? flatIndex : -1 });\n if (node.kind === 'step') {\n flatIndex++;\n }\n if (node.children.length > 0) {\n visit(node.children);\n }\n }\n };\n visit(nodes);\n return out;\n}\n\n/**\n * Structural equality for the step-tree registry signal. Shape only -\n * id, kind, depth, parentId, children length. Reactive fields\n * (`label`, `disabled`, `state`, `errorAggregator`) are signals; their\n * own subscribers track identity changes.\n *\n * @internal\n */\nexport function stepTreeEqual(a: readonly CngxStepNode[], b: readonly CngxStepNode[]): boolean {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n const x = a[i];\n const y = b[i];\n if (x.id !== y.id || x.kind !== y.kind || x.depth !== y.depth || x.parentId !== y.parentId) {\n return false;\n }\n if (!stepTreeEqual(x.children, y.children)) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Structural equality for `flatSteps`. Adds `flatIndex` (shifts when\n * a sibling is inserted) on top of the {@link stepTreeEqual} fields.\n *\n * Use only on projections where every step carries a real\n * DFS-assigned `flatIndex` and `depth` - for `-1` placeholders, use\n * {@link stepNodesEqual}.\n *\n * @internal Exported from `public-api.ts` so the cngx-stepper and\n * cngx-mat-stepper organisms share the comparator across the\n * secondary-entry boundary (Sheriff forbids deep-relative imports).\n *\n * @category common/stepper\n */\nexport function flatStepsEqual(a: readonly CngxStepNode[], b: readonly CngxStepNode[]): boolean {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (\n a[i].id !== b[i].id ||\n a[i].kind !== b[i].kind ||\n a[i].depth !== b[i].depth ||\n a[i].flatIndex !== b[i].flatIndex\n ) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Structural equality for any flat node array - `id`, `kind`,\n * `parentId` only, ignoring `flatIndex` and `depth`. Use for\n * `CngxStepGroup.children` and other `-1`-placeholder projections.\n *\n * @internal\n */\nexport function stepNodesEqual(a: readonly CngxStepNode[], b: readonly CngxStepNode[]): boolean {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (a[i].id !== b[i].id || a[i].kind !== b[i].kind || a[i].parentId !== b[i].parentId) {\n return false;\n }\n }\n return true;\n}\n","import {\n afterNextRender,\n computed,\n Directive,\n inject,\n input,\n isDevMode,\n model,\n signal,\n type Signal,\n} from '@angular/core';\n\nimport { CNGX_COMMIT_CONTROLLER_FACTORY, type CngxCommitController } from '@cngx/common/data';\nimport {\n CNGX_STATEFUL,\n createTransitionTracker,\n type CngxAsyncState,\n type StatusTransition,\n} from '@cngx/core/utils';\nimport type { Observable } from 'rxjs';\n\nimport {\n CNGX_STEPPER_COMMIT_HANDLER_FACTORY,\n type CngxStepperCommitHandler,\n} from './commit-handler';\nimport { injectStepperConfig } from './stepper-config';\nimport {\n CNGX_STEPPER_HOST,\n type CngxStepperHost,\n type CngxStepNode,\n type CngxStepRegistration,\n} from './stepper-host.token';\nimport { flatStepsEqual, flattenStepTree, stepTreeEqual } from './step-tree.util';\n\n/**\n * Async-commit action for stepper transitions. Receives the origin\n * and target indices; resolves `true` to advance, `false` to refuse.\n * The `Observable | Promise | sync` union matches every cngx\n * commit-action signature.\n *\n * @category common/stepper\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/presenter.directive.ts\n * @since 0.1.0\n */\nexport type CngxStepperCommitAction = (\n fromIndex: number,\n toIndex: number,\n) => boolean | Promise<boolean> | Observable<boolean>;\n\n/**\n * Stepper presenter - the brain of every stepper / wizard flow.\n * Holds the active-step model, registry, linear policy, orientation,\n * and commit-controller lifecycle. Provides {@link CNGX_STEPPER_HOST}\n * for atom registration and {@link CNGX_STATEFUL} so transition\n * bridges (`<cngx-toast-on />`, `<cngx-banner-on />`) compose without\n * explicit `[state]` wiring.\n *\n * Sheriff: common Level 2. Pure directive - zero template, zero CSS.\n * Level-4 organisms compose this via `hostDirectives`.\n *\n * @category common/stepper\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/presenter.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStep, CngxStepGroup, CngxStepperRouterSync, CNGX_STEPPER_HOST, CNGX_STEPPER_CONFIG\n * <example-url>http://localhost:4200/#/ui/stepper/stepper-commit-action/pessimistic-optimistic-commits-with-bridge-directives</example-url>\n */\n@Directive({\n selector: '[cngxStepper]',\n exportAs: 'cngxStepper',\n standalone: true,\n providers: [\n { provide: CNGX_STEPPER_HOST, useExisting: CngxStepperPresenter },\n { provide: CNGX_STATEFUL, useExisting: CngxStepperPresenter },\n ],\n})\nexport class CngxStepperPresenter implements CngxStepperHost {\n private readonly config = injectStepperConfig();\n\n readonly activeStepIndex = model<number>(0);\n // Raw *Input slots default undefined so the cascade resolves through\n // CNGX_STEPPER_CONFIG. Must stay public - the template type-checker\n // rejects protected/private on hostDirective alias bindings.\n readonly linearInput = input<boolean | undefined>(undefined, {\n alias: 'linear',\n });\n readonly linear = computed<boolean>(\n () => this.linearInput() ?? this.config.defaultLinear ?? false,\n );\n\n readonly orientationInput = input<'horizontal' | 'vertical' | undefined>(undefined, {\n alias: 'orientation',\n });\n readonly orientation = computed<'horizontal' | 'vertical'>(\n () => this.orientationInput() ?? this.config.defaultOrientation ?? 'horizontal',\n );\n\n readonly commitAction = input<CngxStepperCommitAction | null>(null);\n readonly commitModeInput = input<'optimistic' | 'pessimistic' | undefined>(undefined, {\n alias: 'commitMode',\n });\n readonly commitMode = computed<'optimistic' | 'pessimistic'>(\n () => this.commitModeInput() ?? this.config.defaultCommitMode ?? 'pessimistic',\n );\n\n private readonly genericFactory = inject(CNGX_COMMIT_CONTROLLER_FACTORY);\n private readonly commitController: CngxCommitController<number> = this.genericFactory<number>();\n private readonly commitHandler: CngxStepperCommitHandler = inject(\n CNGX_STEPPER_COMMIT_HANDLER_FACTORY,\n )({ controller: this.commitController });\n\n /** Producer surface for the `CNGX_STATEFUL` bridge contract. */\n readonly state: CngxAsyncState<number | undefined> = this.commitController.state;\n\n /**\n * Step index the user is committing to. Tracked separately from\n * `state.data()` because the AsyncState data slot only updates on\n * success. Drives per-step `aria-busy` in the organism.\n */\n readonly intendedStepIndex: Signal<number | undefined> = this.commitController.intendedValue;\n\n /**\n * Reactive current/previous pair for the commit-state status. Skin\n * sub-components mount a `<span cngxLiveRegion>` reading this\n * tracker. Allocated once per presenter - the underlying\n * `linkedSignal` is shared across all consumers.\n */\n readonly commitTransition: StatusTransition = createTransitionTracker(() =>\n this.commitController.state.status(),\n );\n\n // Persistence-of-error surface - see CngxStepperHost.lastFailedIndex\n // / originIndexDuringCommit for the contract.\n private readonly lastFailedIndexState = signal<number | undefined>(undefined);\n private readonly originIndexDuringCommitState = signal<number | undefined>(undefined);\n /** {@inheritDoc CngxStepperHost.lastFailedIndex} */\n readonly lastFailedIndex: Signal<number | undefined> = this.lastFailedIndexState.asReadonly();\n /** {@inheritDoc CngxStepperHost.originIndexDuringCommit} */\n readonly originIndexDuringCommit: Signal<number | undefined> =\n this.originIndexDuringCommitState.asReadonly();\n\n private readonly treeState = signal<readonly CngxStepNode[]>([], {\n equal: stepTreeEqual,\n });\n readonly stepTree: Signal<readonly CngxStepNode[]> = this.treeState.asReadonly();\n\n readonly flatSteps: Signal<readonly CngxStepNode[]> = computed(\n () => flattenStepTree(this.stepTree()),\n { equal: flatStepsEqual },\n );\n\n /**\n * Step-only flat projection - terminal nodes in DFS order.\n * Structural-equal via `flatStepsEqual` so downstream computeds\n * don't cascade on shape-stable re-emits. Single source for every\n * `select*` / `clamp` / `activeStepId` lookup - never re-filter\n * `flatSteps()`.\n */\n readonly stepsOnly: Signal<readonly CngxStepNode[]> = computed(\n () => this.flatSteps().filter((n) => n.kind === 'step'),\n { equal: flatStepsEqual },\n );\n\n private readonly clampedIndex = computed(() => {\n const stepCount = this.stepsOnly().length;\n if (stepCount === 0) {\n return 0;\n }\n const i = this.activeStepIndex();\n return Math.max(0, Math.min(i, stepCount - 1));\n });\n\n readonly activeStepId: Signal<string | null> = computed(() => {\n const idx = this.clampedIndex();\n return this.stepsOnly()[idx]?.id ?? null;\n });\n\n /**\n * {@inheritDoc CngxStepperHost.activeGroupId}\n *\n * Single derivation over `activeStepId` and `stepTree` - the root-level\n * group whose subtree holds the active step, or `null` for a\n * root-level active step (e.g. a trailing `Finish`). Walked once here;\n * `CngxStepGroup.isCollapsed`, the strip `aria-expanded` binding, and\n * `visibleStripNodes` read this rather than re-walking the tree.\n */\n readonly activeGroupId: Signal<string | null> = computed(() => {\n const activeId = this.activeStepId();\n if (activeId === null) {\n return null;\n }\n const subtreeHasActive = (node: CngxStepNode): boolean =>\n node.id === activeId || node.children.some(subtreeHasActive);\n for (const root of this.stepTree()) {\n if (root.kind === 'group' && subtreeHasActive(root)) {\n return root.id;\n }\n }\n return null;\n });\n\n /**\n * {@inheritDoc CngxStepperHost.visibleStripNodes}\n *\n * Flat strip projection honouring the focus-driven group-collapse\n * policy. Under `'off'` it returns `flatSteps()` verbatim (same\n * reference, so the `equal` short-circuits). Under `'expand-active'`\n * every non-active root-level group's subtree is dropped, leaving the\n * group header node alone - the active group and all root-level steps\n * stay. Each retained node keeps its canonical `flatIndex` from\n * `flatSteps`, so per-step state/announcement lookups are unaffected.\n * Returns a fresh array, so it MUST carry `{ equal: flatStepsEqual }`\n * or every re-emit cascades the strip `@for`.\n */\n readonly visibleStripNodes: Signal<readonly CngxStepNode[]> = computed(\n () => {\n const flat = this.flatSteps();\n if (this.config.groupCollapse !== 'expand-active') {\n return flat;\n }\n const activeGroup = this.activeGroupId();\n const collapsedRootIds = new Set(\n this.stepTree()\n .filter((n) => n.kind === 'group' && n.children.length > 0 && n.id !== activeGroup)\n .map((n) => n.id),\n );\n if (collapsedRootIds.size === 0) {\n return flat;\n }\n const byId = new Map(flat.map((n) => [n.id, n] as const));\n const rootAncestorId = (node: CngxStepNode): string => {\n let cur = node;\n while (cur.parentId !== null) {\n const parent = byId.get(cur.parentId);\n if (!parent) {\n break;\n }\n cur = parent;\n }\n return cur.id;\n };\n return flat.filter(\n (node) => collapsedRootIds.has(node.id) || !collapsedRootIds.has(rootAncestorId(node)),\n );\n },\n { equal: flatStepsEqual },\n );\n\n readonly commitState = this.commitController.state;\n\n /**\n * Next enabled step-only index after the active one, skipping\n * disabled steps. Returns `stepsOnly().length` when no enabled step\n * follows. Single source for `selectNext()` and the `canGoNext`\n * bound - the traversal lives here, never re-walked at the call site.\n */\n private readonly nextEnabledIndex = computed(() => {\n const stepsOnly = this.stepsOnly();\n let next = this.activeStepIndex() + 1;\n while (next < stepsOnly.length && stepsOnly[next].disabled()) {\n next++;\n }\n return next;\n });\n\n /**\n * Previous enabled step-only index before the active one, skipping\n * disabled steps. Returns `-1` when no enabled step precedes. Single\n * source for `selectPrevious()` and the `canGoPrevious` bound.\n */\n private readonly previousEnabledIndex = computed(() => {\n const stepsOnly = this.stepsOnly();\n let prev = this.activeStepIndex() - 1;\n while (prev >= 0 && stepsOnly[prev].disabled()) {\n prev--;\n }\n return prev;\n });\n\n /** {@inheritDoc CngxStepperHost.stepCount} */\n readonly stepCount: Signal<number> = computed(() => this.stepsOnly().length);\n\n /** {@inheritDoc CngxStepperHost.isFirstStep} */\n readonly isFirstStep: Signal<boolean> = computed(() => this.clampedIndex() <= 0);\n\n /** {@inheritDoc CngxStepperHost.isLastStep} */\n readonly isLastStep: Signal<boolean> = computed(\n () => this.clampedIndex() >= this.stepCount() - 1,\n );\n\n /**\n * {@inheritDoc CngxStepperHost.canGoNext}\n *\n * Derives from the same `nextEnabledIndex` + `isLinearBlocked`\n * predicates `select()`/`selectNext()` enforce, so the affordance can\n * never drift from the navigation it gates.\n */\n readonly canGoNext: Signal<boolean> = computed(() => {\n const next = this.nextEnabledIndex();\n return next < this.stepCount() && !this.isLinearBlocked(next);\n });\n\n /** {@inheritDoc CngxStepperHost.canGoPrevious} */\n readonly canGoPrevious: Signal<boolean> = computed(() => this.previousEnabledIndex() >= 0);\n\n /** {@inheritDoc CngxStepperHost.busy} */\n readonly busy: Signal<boolean> = computed(() => this.commitState.status() === 'pending');\n\n /** {@inheritDoc CngxStepperHost.nextStepLabel} */\n readonly nextStepLabel: Signal<string | undefined> = computed(() =>\n this.stepsOnly()[this.nextEnabledIndex()]?.label(),\n );\n\n /** {@inheritDoc CngxStepperHost.previousStepLabel} */\n readonly previousStepLabel: Signal<string | undefined> = computed(() =>\n this.stepsOnly()[this.previousEnabledIndex()]?.label(),\n );\n\n constructor() {\n if (isDevMode()) {\n afterNextRender(() => {\n const stepNodes = this.flatSteps().filter((n) => n.kind === 'step');\n if (stepNodes.length > 6 && stepNodes.every((n) => n.parentId === null)) {\n console.warn(\n '[cngx-stepper] more than 6 steps at the same depth; consider wrapping logical groups in <cngx-step-group> for better UX',\n );\n }\n });\n }\n }\n\n // Flat id lookup; rebuilt into the hierarchical tree on each\n // register/unregister.\n private readonly registry = new Map<\n string,\n { reg: CngxStepRegistration; parentId: string | null; childIds: string[] }\n >();\n private readonly insertionOrder: string[] = [];\n\n register(handle: CngxStepRegistration, parentId: string | null = null): void {\n if (this.registry.has(handle.id)) {\n // Idempotent re-register - replace the handle, keep the ordering slot.\n const entry = this.registry.get(handle.id)!;\n entry.reg = handle;\n entry.parentId = parentId;\n } else {\n this.registry.set(handle.id, { reg: handle, parentId, childIds: [] });\n this.insertionOrder.push(handle.id);\n if (parentId !== null) {\n const parent = this.registry.get(parentId);\n if (parent) {\n parent.childIds.push(handle.id);\n }\n }\n }\n this.rebuildTree();\n }\n\n unregister(id: string): void {\n const entry = this.registry.get(id);\n if (!entry) {\n return;\n }\n if (entry.parentId !== null) {\n const parent = this.registry.get(entry.parentId);\n if (parent) {\n parent.childIds = parent.childIds.filter((c) => c !== id);\n }\n }\n this.registry.delete(id);\n const insertIdx = this.insertionOrder.indexOf(id);\n if (insertIdx >= 0) {\n this.insertionOrder.splice(insertIdx, 1);\n }\n this.rebuildTree();\n }\n\n private rebuildTree(): void {\n const buildNode = (id: string, depth: number): CngxStepNode => {\n const entry = this.registry.get(id)!;\n const children = entry.childIds.map((cid) => buildNode(cid, depth + 1));\n return {\n id,\n kind: entry.reg.kind,\n label: entry.reg.label,\n disabled: entry.reg.disabled,\n state: entry.reg.state,\n errorAggregator: entry.reg.errorAggregator,\n errorMessage: entry.reg.errorMessage,\n children,\n depth,\n parentId: entry.parentId,\n flatIndex: -1,\n };\n };\n const rootIds = this.insertionOrder.filter((id) => this.registry.get(id)!.parentId === null);\n this.treeState.set(rootIds.map((id) => buildNode(id, 0)));\n }\n\n /** {@inheritDoc CngxStepperHost.clearLastFailed} */\n clearLastFailed(): void {\n this.lastFailedIndexState.set(undefined);\n }\n\n /**\n * Linear-gate predicate: `true` when linear mode forbids advancing to\n * `target` because an incomplete (non-`success`, non-disabled) step\n * sits between the active index and `target`. The single home for the\n * linear slice check - `select()` and the `canGoNext` bound both\n * consume it so the gate can never drift between navigation and its\n * affordance.\n */\n private isLinearBlocked(target: number): boolean {\n if (!this.linear() || target <= this.activeStepIndex()) {\n return false;\n }\n return this.stepsOnly()\n .slice(this.activeStepIndex(), target)\n .some((n) => n.state() !== 'success' && !n.disabled());\n }\n\n /**\n * {@inheritDoc CngxStepperHost.canNavigateTo}\n *\n * Wraps the private {@link isLinearBlocked} predicate plus the\n * per-step `disabled` check. The header-reachability contract surface;\n * `isLinearBlocked` stays private so the organism reads this method,\n * never the internal gate.\n */\n canNavigateTo(index: number): boolean {\n const stepsOnly = this.stepsOnly();\n if (index < 0 || index >= stepsOnly.length) {\n return false;\n }\n if (stepsOnly[index].disabled()) {\n return false;\n }\n return !this.isLinearBlocked(index);\n }\n\n select(index: number): void {\n const stepsOnly = this.stepsOnly();\n if (stepsOnly.length === 0) {\n return;\n }\n const target = Math.max(0, Math.min(index, stepsOnly.length - 1));\n if (this.isLinearBlocked(target)) {\n return;\n }\n if (stepsOnly[target].disabled()) {\n return;\n }\n const previous = this.activeStepIndex();\n if (target === previous) {\n return;\n }\n\n const action = this.commitAction();\n if (!action) {\n // No-action fast path - sync move, no commit window opens, so\n // `originIndexDuringCommit` stays untouched. Clear the rejection\n // flag if the user re-picked a previously-failed target.\n this.activeStepIndex.set(target);\n if (this.lastFailedIndexState() === target) {\n this.lastFailedIndexState.set(undefined);\n }\n return;\n }\n\n // Commit-gated transition. Pessimistic holds at `previous` until\n // the action resolves; optimistic advances now and rolls back on\n // rejection. Supersede comes from the lifted commit-controller -\n // a rapid second select() cancels the in-flight runner.\n //\n // Capture the safe-harbour origin exactly once on commit-window\n // open. Written ONLY on this path so a stale origin never lingers\n // into a non-commit navigation.\n this.originIndexDuringCommitState.set(previous);\n const mode = this.commitMode();\n if (mode === 'optimistic') {\n this.activeStepIndex.set(target);\n }\n this.commitHandler.beginTransition(previous, target, action, (accept) => {\n if (accept) {\n // Success - origin no longer needed; clear the rejection\n // flag if the user re-picked the failed target.\n this.originIndexDuringCommitState.set(undefined);\n if (this.lastFailedIndexState() === target) {\n this.lastFailedIndexState.set(undefined);\n }\n if (mode === 'pessimistic') {\n this.activeStepIndex.set(target);\n }\n } else {\n // Reject - flag the target; RETAIN the origin so\n // `liveAnnouncement` can resolve the origin label for the\n // rich rollback phrase. Optimistic rolls back; pessimistic\n // never moved.\n this.lastFailedIndexState.set(target);\n if (mode === 'optimistic') {\n this.activeStepIndex.set(previous);\n }\n }\n });\n }\n\n selectNext(): void {\n const next = this.nextEnabledIndex();\n if (next < this.stepsOnly().length) {\n this.select(next);\n }\n }\n\n selectPrevious(): void {\n const prev = this.previousEnabledIndex();\n if (prev >= 0) {\n this.activeStepIndex.set(prev);\n }\n }\n\n selectById(id: string): void {\n const stepsOnly = this.stepsOnly();\n const idx = stepsOnly.findIndex((n) => n.id === id);\n if (idx >= 0) {\n this.select(idx);\n }\n }\n\n reset(): void {\n this.activeStepIndex.set(0);\n this.commitController.cancel();\n }\n}\n\nexport { type CngxStepStatus } from './stepper-host.token';\n","import { InjectionToken } from '@angular/core';\n\nimport type { CngxStepRegistration } from './stepper-host.token';\n\n/**\n * Contract a `CngxStep` sees when it injects a parent group via\n * {@link CNGX_STEP_GROUP_HOST}. Mirrors the presenter's `register` /\n * `unregister` so atoms stay agnostic of root vs. nested host.\n *\n * Surface is registration-only - `id` and `aggregatedStatus` are\n * concrete-class details, not part of the token contract.\n *\n * @category common/stepper\n */\nexport interface CngxStepGroupHost {\n register(handle: CngxStepRegistration): void;\n unregister(id: string): void;\n}\n\n/**\n * DI token providing a `CngxStepGroup`'s contract to nested `CngxStep` atoms.\n * Steps inject this `optional: true` and fall back to {@link CNGX_STEPPER_HOST}.\n *\n * @category common/stepper\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/step-group-host.token.ts\n * @since 0.1.0\n */\nexport const CNGX_STEP_GROUP_HOST = new InjectionToken<CngxStepGroupHost>('CngxStepGroupHost');\n","import { InjectionToken, type Signal, type TemplateRef } from '@angular/core';\n\nimport type { CngxStepNode } from './stepper-host.token';\n\n/**\n * Context delivered to `*cngxStepLabel` templates. Gives typed access\n * to live step state without reaching into the host token.\n *\n * `index` is 1-based in the step-only flat projection (groups excluded).\n * `active` reflects `presenter.activeStepId`; `busy` mirrors\n * `presenter.intendedStepIndex` matching this step; `disabled` reads\n * `node.disabled()`.\n *\n * @category common/stepper\n */\nexport interface CngxStepLabelContext {\n readonly node: CngxStepNode;\n readonly index: number;\n readonly active: boolean;\n readonly busy: boolean;\n readonly disabled: boolean;\n}\n\n/**\n * Context delivered to `*cngxStepContent` templates. Mirrors\n * {@link CngxStepLabelContext} - content templates need the same\n * derivations to gate inner controls on `disabled` / `busy`.\n *\n * @category common/stepper\n */\nexport interface CngxStepContentContext {\n readonly node: CngxStepNode;\n readonly index: number;\n readonly active: boolean;\n readonly busy: boolean;\n readonly disabled: boolean;\n}\n\n/**\n * Contract Level-4 organisms (and consumer-authored stepper skins)\n * consume to render the panel body. Narrower than the presenter's\n * full interface - just enough to project label / content templates\n * and react to active-step changes.\n *\n * @category common/stepper\n */\nexport interface CngxStepPanelHost {\n readonly flatSteps: Signal<readonly CngxStepNode[]>;\n readonly activeStepIndex: Signal<number>;\n readonly activeStepId: Signal<string | null>;\n /** Resolves a step id to its `*cngxStepLabel` template (consumer-supplied). */\n labelTemplateFor(id: string): TemplateRef<CngxStepLabelContext> | null;\n /** Resolves a step id to its `*cngxStepContent` template (consumer-supplied). */\n contentTemplateFor(id: string): TemplateRef<CngxStepContentContext> | null;\n}\n\n/**\n * DI token providing the rendering-surface contract to organism shells\n * (`<cngx-stepper>`, `<cngx-mat-stepper>`) and consumer-authored skins.\n *\n * @category common/stepper\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/step-panel-host.token.ts\n * @since 0.1.0\n */\nexport const CNGX_STEP_PANEL_HOST = new InjectionToken<CngxStepPanelHost>('CngxStepPanelHost');\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport type { CngxStepContentContext } from './step-panel-host.token';\n\n/**\n * Marker directive carrying a `CngxStep`'s content template.\n * Discovered via `contentChild(CngxStepContent)`. Typed with\n * {@link CngxStepContentContext} so `let-busy=\"busy\"` etc. gives\n * typed access to live step state.\n *\n * ```html\n * <ng-template cngxStepContent let-busy=\"busy\">\n * <input [disabled]=\"busy\">\n * </ng-template>\n * ```\n *\n * @category common/stepper\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/step-content.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStep, CngxStepLabel\n * <example-url>http://localhost:4200/#/ui/stepper/stepper-step-content/typed-lazy-panels</example-url>\n */\n@Directive({\n selector: 'ng-template[cngxStepContent]',\n standalone: true,\n})\nexport class CngxStepContent {\n readonly templateRef = inject<TemplateRef<CngxStepContentContext>>(TemplateRef);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport type { CngxStepLabelContext } from './step-panel-host.token';\n\n/**\n * Marker directive carrying a `CngxStep`'s label template.\n * Discovered via `contentChild(CngxStepLabel)`. Typed with\n * {@link CngxStepLabelContext} for typed `let-node=\"node\"` /\n * `let-active=\"active\"` access.\n *\n * ```html\n * <ng-template cngxStepLabel let-node=\"node\">\n * {{ node.label() }}\n * </ng-template>\n * ```\n *\n * @category common/stepper\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/step-label.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStep, CngxStepContent, CngxStepGroupHeader\n * <example-url>http://localhost:4200/#/ui/stepper/stepper-custom-labels/mixing-code-label-code-input-with-code-cngxsteplabel-code-slot</example-url>\n */\n@Directive({\n selector: 'ng-template[cngxStepLabel]',\n standalone: true,\n})\nexport class CngxStepLabel {\n readonly templateRef = inject<TemplateRef<CngxStepLabelContext>>(TemplateRef);\n}\n","import {\n computed,\n contentChild,\n DestroyRef,\n Directive,\n inject,\n input,\n linkedSignal,\n type Signal,\n} from '@angular/core';\n\nimport { nextUid } from '@cngx/core/utils';\n\nimport type { CngxErrorAggregatorContract } from '@cngx/common/interactive';\n\nimport { CNGX_STEP_GROUP_HOST } from './step-group-host.token';\nimport { CngxStepContent } from './step-content.directive';\nimport { CngxStepLabel } from './step-label.directive';\nimport { CNGX_STEPPER_HOST, type CngxStepStatus } from './stepper-host.token';\n\n/**\n * Single-step atom. Registers with the nearest host - either a\n * `CngxStepGroup` ({@link CNGX_STEP_GROUP_HOST}) or the root\n * `CngxStepperPresenter` ({@link CNGX_STEPPER_HOST}).\n *\n * `state` is a `linkedSignal` over `[disabled]`, `[completed]`, and\n * the optional `[errorAggregator]`'s `hasError()`.\n *\n * @category common/stepper\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/step.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStepGroup, CngxStepperPresenter, CngxStepLabel, CngxStepContent\n * <example-url>http://localhost:4200/#/ui/stepper/stepper-step-content/typed-lazy-panels</example-url>\n */\n@Directive({\n selector: '[cngxStep]',\n exportAs: 'cngxStep',\n standalone: true,\n})\nexport class CngxStep {\n readonly id = input<string>(nextUid('cngx-step'));\n readonly disabled = input<boolean>(false);\n readonly completed = input<boolean>(false);\n readonly label = input<string>('');\n readonly errorAggregator = input<CngxErrorAggregatorContract | undefined>(undefined);\n\n /**\n * Direct error flag for the common \"this step is invalid\" case - no\n * `errorAggregator` boilerplate required. `true` or a non-empty string\n * drives the error state; a string doubles as the inline message\n * (surfaced via the `*cngxStepError` slot and the mini-skin aggregate\n * line). `false` / `''` clear it. The aggregator stays the rich\n * multi-source forms path; the two channels compose (either errors).\n */\n readonly error = input<string | boolean>(false);\n\n /**\n * Resolved direct-error message: the `[error]` string when non-empty,\n * else `undefined`. Carried onto the registration / node so the error\n * slot + aggregate line can render it. `computed` over the input -\n * never written.\n */\n readonly errorMessage: Signal<string | undefined> = computed(() => {\n const value = this.error();\n return typeof value === 'string' && value !== '' ? value : undefined;\n });\n\n protected readonly labelSlot = contentChild(CngxStepLabel);\n protected readonly contentSlot = contentChild(CngxStepContent);\n\n readonly labelTemplate = this.labelSlot;\n readonly contentTemplate = this.contentSlot;\n\n /**\n * Per-step status derived from inputs + aggregator. `linkedSignal`\n * with structural equal - never written via `effect`.\n */\n readonly state: Signal<CngxStepStatus> = linkedSignal({\n source: () => {\n const directError = this.error();\n return {\n disabled: this.disabled(),\n completed: this.completed(),\n errored:\n (directError !== false && directError !== '') ||\n (this.errorAggregator()?.hasError?.() ?? false),\n };\n },\n computation: ({ disabled, completed, errored }) => {\n if (disabled) {\n return 'disabled';\n }\n if (errored) {\n return 'error';\n }\n if (completed) {\n return 'success';\n }\n return 'idle';\n },\n equal: Object.is,\n });\n\n constructor() {\n const groupHost = inject(CNGX_STEP_GROUP_HOST, { optional: true });\n const stepperHost = inject(CNGX_STEPPER_HOST, { optional: true });\n const host = groupHost ?? stepperHost;\n if (!host) {\n throw new Error(\n 'CngxStep: no enclosing CngxStepperPresenter or CngxStepGroup found. ' +\n 'Wrap the step inside an element carrying [cngxStepper] or [cngxStepGroup].',\n );\n }\n const stepId = this.id();\n host.register({\n id: stepId,\n kind: 'step',\n label: this.label,\n disabled: this.disabled,\n state: this.state,\n errorAggregator: this.errorAggregator,\n errorMessage: this.errorMessage,\n });\n inject(DestroyRef).onDestroy(() => host.unregister(stepId));\n }\n}\n","import { computed, DestroyRef, Directive, inject, input, signal, type Signal } from '@angular/core';\n\nimport { nextUid } from '@cngx/core/utils';\n\nimport { CNGX_STEP_GROUP_HOST, type CngxStepGroupHost } from './step-group-host.token';\nimport { injectStepperConfig } from './stepper-config';\nimport {\n CNGX_STEPPER_HOST,\n type CngxStepRegistration,\n type CngxStepStatus,\n} from './stepper-host.token';\n\n/**\n * Step-group atom. Registers with the root presenter as a `kind: 'group'`\n * node and provides {@link CNGX_STEP_GROUP_HOST} so nested `CngxStep`\n * atoms register with the group, not the root.\n *\n * `aggregatedStatus` rolls up child states: `error` if any errored,\n * `success` if all are success, `pending` if any is pending or busy,\n * otherwise `idle`.\n *\n * @category common/stepper\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/step-group.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStep, CngxStepperPresenter, CngxStepGroupHeader\n * <example-url>http://localhost:4200/#/ui/stepper/stepper-hierarchical/group-nested-steps-trailing-root-step</example-url>\n * <example-url>http://localhost:4200/#/ui/stepper/stepper-hierarchical/expand-active-group-collapse</example-url>\n * <example-url>http://localhost:4200/#/ui/stepper/stepper-hierarchical/group-collapse-summary-count</example-url>\n */\n@Directive({\n selector: '[cngxStepGroup]',\n exportAs: 'cngxStepGroup',\n standalone: true,\n providers: [{ provide: CNGX_STEP_GROUP_HOST, useExisting: CngxStepGroup }],\n})\nexport class CngxStepGroup implements CngxStepGroupHost {\n readonly id = input<string>(nextUid('cngx-step-group'));\n readonly disabled = input<boolean>(false);\n readonly label = input<string>('');\n\n private readonly config = injectStepperConfig();\n\n // Local child registry - only feeds `aggregatedStatus` below.\n // The presenter owns the canonical tree.\n private readonly childRegistry = signal<readonly CngxStepRegistration[]>([]);\n\n readonly aggregatedStatus: Signal<CngxStepStatus> = computed(\n () => {\n const states = this.childRegistry().map((c) => c.state());\n if (states.length === 0) {\n return 'idle';\n }\n if (states.some((s) => s === 'error')) {\n return 'error';\n }\n if (states.some((s) => s === 'pending' || s === 'busy')) {\n return 'pending';\n }\n if (states.every((s) => s === 'success')) {\n return 'success';\n }\n return 'idle';\n },\n { equal: Object.is },\n );\n\n private readonly stepperHost = inject(CNGX_STEPPER_HOST, { optional: true });\n\n /**\n * `true` when this group's children are collapsed to the header node:\n * the focus-driven policy is `'expand-active'`, this group does not\n * hold the active step, and it has at least one child. Pure\n * `computed()` over the host's `activeGroupId` + the resolved policy -\n * never toggled in an event handler (Pillar 1).\n *\n * Consumer-readable via `exportAs: 'cngxStepGroup'` (e.g.\n * `#g=\"cngxStepGroup\"` then `g.isCollapsed()`). The rendered strip\n * group header owns the reactive `aria-expanded` disclosure attribute\n * (`<cngx-stepper>` `groupAriaExpanded`); the projected `[cngxStepGroup]`\n * host element is not rendered in the strip, so it carries no ARIA.\n */\n readonly isCollapsed: Signal<boolean> = computed(() => {\n if (this.config.groupCollapse !== 'expand-active') {\n return false;\n }\n if (this.childRegistry().length === 0) {\n return false;\n }\n return this.stepperHost?.activeGroupId() !== this.id();\n });\n\n constructor() {\n if (!this.stepperHost) {\n throw new Error(\n 'CngxStepGroup: no enclosing CngxStepperPresenter found. ' +\n 'Wrap the group inside an element carrying [cngxStepper].',\n );\n }\n const groupId = this.id();\n this.stepperHost.register({\n id: groupId,\n kind: 'group',\n label: this.label,\n disabled: this.disabled,\n state: this.aggregatedStatus,\n });\n const stepperHost = this.stepperHost;\n inject(DestroyRef).onDestroy(() => stepperHost.unregister(groupId));\n }\n\n register(handle: CngxStepRegistration): void {\n this.childRegistry.update((cur) => [...cur, handle]);\n // Forward to the root with this group as parent so the tree shape is correct.\n this.stepperHost!.register(handle, this.id());\n }\n\n unregister(id: string): void {\n this.childRegistry.update((cur) => cur.filter((c) => c.id !== id));\n this.stepperHost!.unregister(id);\n }\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport type { CngxStepNode, CngxStepStatus } from '../stepper-host.token';\n\n/**\n * Context passed to the `*cngxStepIndicator` template. Drives the\n * numbered / checkmark / error glyph inside each step button. The\n * `<button>` shell - `aria-current`, `aria-controls`, click handler -\n * stays library-owned.\n *\n * `status` mirrors `node.state()`. `busy` is the presenter-derived\n * \"this step is the in-flight commit target\" flag - independent of\n * `status === 'pending'` (which is the aggregate landmark state).\n *\n * @category common/stepper/slots\n */\nexport interface CngxStepIndicatorContext {\n /** Convenience alias for `position` - usable as `let-position` shorthand. */\n readonly $implicit: number;\n /** 1-based position of this step in the flat step-only projection. */\n readonly position: number;\n /** The step node carrying id / label / disabled / state signals. */\n readonly node: CngxStepNode;\n /** `true` when this step is the current `activeStepId`. */\n readonly active: boolean;\n /** Live step status - drives the visual variant (idle / success / error / busy). */\n readonly status: CngxStepStatus;\n /** `true` when this step is the in-flight commit target. */\n readonly busy: boolean;\n}\n\n/**\n * Slot directive for the indicator-glyph template on `<cngx-stepper>`.\n * Discovered via `contentChild`; cascades through\n * `CNGX_STEPPER_CONFIG.templates.indicator` before falling back to\n * the built-in numeric span (`{{ position }}`).\n *\n * ```html\n * <cngx-stepper>\n * <ng-template cngxStepIndicator let-position let-node=\"node\" let-status=\"status\">\n * @if (status === 'success') {\n * <my-icon name=\"check\" />\n * } @else if (status === 'error') {\n * <my-icon name=\"alert\" />\n * } @else {\n * <span class=\"my-step-num\">{{ position }}</span>\n * }\n * </ng-template>\n * </cngx-stepper>\n * ```\n *\n * @category common/stepper/slots\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/slots/step-indicator.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStepBadge, CngxStepBusySpinner, CngxStepRejection, CngxStepGroupHeader\n * <example-url>http://localhost:4200/#/ui/stepper/stepper-slot-overrides/custom-indicator-glyph-via-code-cngxstepindicator-code</example-url>\n * <example-url>http://localhost:4200/#/ui/stepper/stepper-slot-overrides/cross-skin-indicator-override</example-url>\n */\n@Directive({\n selector: 'ng-template[cngxStepIndicator]',\n exportAs: 'cngxStepIndicator',\n standalone: true,\n})\nexport class CngxStepIndicator {\n readonly templateRef = inject<TemplateRef<CngxStepIndicatorContext>>(TemplateRef);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport type { CngxStepNode } from '../stepper-host.token';\n\n/**\n * Context passed to the `*cngxStepBadge` template. Drives the error\n * badge inside a step button when `errorAggregator?.shouldShow()` is\n * truthy. Consumers swap the built-in `'!'` glyph for a counter pill\n * or branded marker; the visibility gate stays library-owned.\n *\n * @category common/stepper/slots\n */\nexport interface CngxStepBadgeContext {\n /** Aggregated error count for this step (≥ 1 when shown). */\n readonly count: number;\n /** The step node carrying id / label / state signals. */\n readonly node: CngxStepNode;\n}\n\n/**\n * Slot directive for the error-badge template on `<cngx-stepper>`.\n * Discovered via `contentChild`; cascades through\n * `CNGX_STEPPER_CONFIG.templates.badge` before falling back to\n * `CNGX_STEPPER_GLYPHS.errorBadge`.\n *\n * ```html\n * <cngx-stepper>\n * <ng-template cngxStepBadge let-count=\"count\">\n * <span class=\"my-badge-pill\">{{ count }}</span>\n * </ng-template>\n * </cngx-stepper>\n * ```\n *\n * @category common/stepper/slots\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/slots/step-badge.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStepIndicator, CngxStepBusySpinner, CngxStepRejection\n * <example-url>http://localhost:4200/#/ui/stepper/stepper-slot-overrides/custom-error-badge-via-code-cngxstepbadge-code</example-url>\n * <example-url>http://localhost:4200/#/ui/stepper/stepper-error-aggregation/per-step-error-badges</example-url>\n */\n@Directive({\n selector: 'ng-template[cngxStepBadge]',\n exportAs: 'cngxStepBadge',\n standalone: true,\n})\nexport class CngxStepBadge {\n readonly templateRef = inject<TemplateRef<CngxStepBadgeContext>>(TemplateRef);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport type { CngxStepNode } from '../stepper-host.token';\n\n/**\n * Context passed to the `*cngxStepBusySpinner` template. Drives the\n * pending-commit overlay on the in-flight target step. Renders only\n * when the step matches `presenter.intendedStepIndex()` with\n * `commitState.status() === 'pending'`.\n *\n * @category common/stepper/slots\n */\nexport interface CngxStepBusySpinnerContext {\n /** The step node carrying id / label / state signals. */\n readonly node: CngxStepNode;\n}\n\n/**\n * Slot directive for the busy-spinner template on `<cngx-stepper>`.\n * Discovered via `contentChild`; cascades through\n * `CNGX_STEPPER_CONFIG.templates.busySpinner` before falling back to\n * the built-in pulse-animation span.\n *\n * ```html\n * <cngx-stepper>\n * <ng-template cngxStepBusySpinner>\n * <my-spinner size=\"sm\" />\n * </ng-template>\n * </cngx-stepper>\n * ```\n *\n * @category common/stepper/slots\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/slots/step-busy-spinner.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStepIndicator, CngxStepBadge, CngxStepRejection\n * <example-url>http://localhost:4200/#/ui/stepper/stepper-slot-overrides/custom-busy-spinner-via-code-cngxstepbusyspinner-code</example-url>\n */\n@Directive({\n selector: 'ng-template[cngxStepBusySpinner]',\n exportAs: 'cngxStepBusySpinner',\n standalone: true,\n})\nexport class CngxStepBusySpinner {\n readonly templateRef = inject<TemplateRef<CngxStepBusySpinnerContext>>(\n TemplateRef,\n );\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport type { CngxStepNode } from '../stepper-host.token';\n\n/**\n * Context passed to the `*cngxStepRejection` template. Renders on the\n * strip step the most recent commit was rolled back FROM - sibling of\n * the tabs `cngxTabRejectionIcon` slot. Renders only when\n * `presenter.lastFailedIndex()` matches the step's flat-index.\n *\n * `originLabel` is the safe-harbour step's label, derived from\n * `presenter.originIndexDuringCommit()`. May be `undefined` when the\n * origin index is out of range (synchronous-rejection edge case);\n * gate richer UI on its presence.\n *\n * @category common/stepper/slots\n */\nexport interface CngxStepRejectionContext {\n /** Flat-index of the rejected step (`presenter.lastFailedIndex()`). */\n readonly failedIndex: number;\n /** Resolved label of the safe-harbour step, when derivable. */\n readonly originLabel: string | undefined;\n /** The rejected step node carrying id / label / state signals. */\n readonly node: CngxStepNode;\n}\n\n/**\n * Slot directive for the rejection-decoration template on\n * `<cngx-stepper>`. Discovered via `contentChild`; cascades through\n * `CNGX_STEPPER_CONFIG.templates.rejection` before falling back to\n * `CNGX_STEPPER_GLYPHS.rejectionIcon`.\n *\n * Symmetric context shape with the upcoming tabs `cngxTabRejectionIcon`\n * slot so consumer templates port directly between the two families.\n *\n * ```html\n * <cngx-stepper>\n * <ng-template cngxStepRejection let-failedIndex=\"failedIndex\" let-originLabel=\"originLabel\">\n * <my-icon name=\"rollback\" />\n * @if (originLabel) {\n * <span class=\"cngx-sr-only\">Rolled back to {{ originLabel }}</span>\n * }\n * </ng-template>\n * </cngx-stepper>\n * ```\n *\n * @category common/stepper/slots\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/slots/step-rejection.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStepBadge, CngxStepIndicator, CngxStepBusySpinner\n * <example-url>http://localhost:4200/#/ui/stepper/stepper-slot-overrides/rejection-decoration-via-code-cngxsteprejection-code</example-url>\n */\n@Directive({\n selector: 'ng-template[cngxStepRejection]',\n exportAs: 'cngxStepRejection',\n standalone: true,\n})\nexport class CngxStepRejection {\n readonly templateRef = inject<TemplateRef<CngxStepRejectionContext>>(TemplateRef);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport type { CngxStepNode } from '../stepper-host.token';\n\n/**\n * Context passed to the `*cngxStepError` template. Renders the\n * validation-error reason for a step in the error state - sibling of\n * the commit-channel `*cngxStepRejection` slot. The two channels stay\n * distinct: rejection decorates the step a commit rolled back FROM;\n * this slot surfaces the per-step validation message.\n *\n * `message` resolves the direct `[error]` string > the first\n * aggregator label > the i18n `errored` status phrase, so a template\n * that renders `{{ message }}` always shows a non-empty reason.\n * `errorLabels` / `announcement` expose the richer aggregator surface\n * for consumers that want a list or the full SR phrase.\n *\n * @category common/stepper/slots\n */\nexport interface CngxStepErrorContext {\n /** The errored step node carrying id / label / state signals. */\n readonly node: CngxStepNode;\n /** Resolved error reason (direct `[error]` string > aggregator label > i18n). */\n readonly message: string;\n /** Aggregator error labels, or an empty array when none. */\n readonly errorLabels: readonly string[];\n /** Aggregator SR announcement phrase, or an empty string when none. */\n readonly announcement: string;\n}\n\n/**\n * Slot directive for the per-step error-message template on\n * `<cngx-stepper>`. Discovered via `contentChild`; cascades through\n * `CNGX_STEPPER_CONFIG.templates.stepError` before falling back to the\n * built-in `{{ message }}` text. Mirrors {@link CngxStepRejection} so\n * consumer-authored templates read the same way across both channels.\n *\n * ```html\n * <cngx-stepper>\n * <ng-template cngxStepError let-message=\"message\" let-errorLabels=\"errorLabels\">\n * <strong>{{ message }}</strong>\n * @if (errorLabels.length > 1) {\n * <ul>\n * @for (label of errorLabels; track label) {\n * <li>{{ label }}</li>\n * }\n * </ul>\n * }\n * </ng-template>\n * </cngx-stepper>\n * ```\n *\n * @category common/stepper/slots\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/slots/step-error.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStepRejection, CngxStepBadge, CngxStep\n */\n@Directive({\n selector: 'ng-template[cngxStepError]',\n exportAs: 'cngxStepError',\n standalone: true,\n})\nexport class CngxStepError {\n readonly templateRef = inject<TemplateRef<CngxStepErrorContext>>(TemplateRef);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport type { CngxStepNode, CngxStepStatus } from '../stepper-host.token';\n\n/**\n * Context passed to the `*cngxStepGroupHeader` template. Drives the\n * group-row landmark for `kind === 'group'` nodes. The `role=\"group\"`\n * + `aria-roledescription` shell stays library-owned.\n *\n * `group` carries a `CngxStepNode` with the runtime guarantee\n * `kind === 'group'` (the slot only fires for group nodes).\n * `expanded` is reserved for future collapsible groups - passed `true`\n * today; declaring it now avoids a breaking change later.\n *\n * @category common/stepper/slots\n */\nexport interface CngxStepGroupHeaderContext {\n /** The group node carrying id / label / state / children signals. */\n readonly group: CngxStepNode;\n /** Reserved - `true` while the group's children are visible. */\n readonly expanded: boolean;\n /** Aggregated group status (rolls up children - drives heading variant). */\n readonly status: CngxStepStatus;\n}\n\n/**\n * Slot directive for the group-header template on `<cngx-stepper>`.\n * Discovered via `contentChild`; cascades through\n * `CNGX_STEPPER_CONFIG.templates.groupHeader` before falling back to\n * the built-in `<span class=\"cngx-stepper__group-label\">`.\n *\n * ```html\n * <cngx-stepper>\n * <ng-template cngxStepGroupHeader let-group=\"group\" let-status=\"status\">\n * <h4 [class.is-error]=\"status === 'error'\">{{ group.label() }}</h4>\n * </ng-template>\n * </cngx-stepper>\n * ```\n *\n * @category common/stepper/slots\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/slots/step-group-header.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStepGroup, CngxStepIndicator, CngxStepLabel\n * <example-url>http://localhost:4200/#/ui/stepper/stepper-slot-overrides/custom-group-header-via-code-cngxstepgroupheader-code</example-url>\n */\n@Directive({\n selector: 'ng-template[cngxStepGroupHeader]',\n exportAs: 'cngxStepGroupHeader',\n standalone: true,\n})\nexport class CngxStepGroupHeader {\n readonly templateRef = inject<TemplateRef<CngxStepGroupHeaderContext>>(TemplateRef);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\n/**\n * Slot directive for the empty-state placeholder on `<cngx-stepper>`.\n * Rendered when `flatSteps()` is empty - async-loading or\n * server-driven step lists get a \"no steps yet\" landmark rather than\n * a collapsed strip.\n *\n * Discovered via `contentChild`; cascades through\n * `CNGX_STEPPER_CONFIG.templates.empty` before falling back to no\n * markup (Honest-Absence default).\n *\n * ```html\n * <cngx-stepper>\n * <ng-template cngxStepperEmpty>\n * <cngx-empty-state heading=\"No steps configured yet\" />\n * </ng-template>\n * </cngx-stepper>\n * ```\n *\n * @category common/stepper/slots\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/slots/stepper-empty.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStepIndicator, CngxStepGroupHeader\n * <example-url>http://localhost:4200/#/ui/stepper/stepper-slot-overrides/empty-state-placeholder-via-code-cngxstepperempty-code</example-url>\n */\n@Directive({\n selector: 'ng-template[cngxStepperEmpty]',\n exportAs: 'cngxStepperEmpty',\n standalone: true,\n})\nexport class CngxStepperEmpty {\n readonly templateRef = inject<TemplateRef<void>>(TemplateRef);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport type { CngxStepNode } from '../stepper-host.token';\n\n/**\n * Context passed to the `*cngxDotStepperDot` template. Drives the dot\n * body inside `<cngx-dot-stepper>`. The `<span class=\"cngx-dot-stepper__dot\">`\n * shell - `role=\"img\"`, `aria-current`, `aria-label`, class\n * modifiers - stays library-owned; only the dot body content becomes\n * overrideable so consumers can swap the default empty body for an\n * icon, glyph, or branded indicator.\n *\n * Smaller than {@link CngxStepIndicatorContext} on purpose - the dot\n * stepper does not surface step status/busy state visually, so the\n * context strips to the four fields a consumer actually needs.\n *\n * @category common/stepper/slots\n */\nexport interface CngxDotStepperDotContext {\n /** Convenience alias for `index` - usable as `let-index` shorthand. */\n readonly $implicit: number;\n /** 0-based position of this dot in the step-only projection. */\n readonly index: number;\n /** The step node carrying id / label / state signals. */\n readonly node: CngxStepNode;\n /** `true` when this dot represents the current active step. */\n readonly active: boolean;\n /** `true` when this dot represents a completed (already-traversed) step. */\n readonly completed: boolean;\n}\n\n/**\n * Slot directive for the dot-body template on `<cngx-dot-stepper>`.\n * Discovered via `contentChild`; cascades through\n * `CNGX_STEPPER_CONFIG.templates.dotStepperDot` before falling back to\n * the built-in empty body (the span itself paints the dot fill via CSS).\n *\n * ```html\n * <cngx-dot-stepper [(activeStepIndex)]=\"active\" aria-label=\"Carousel\">\n * <ng-template cngxDotStepperDot let-index let-active=\"active\" let-completed=\"completed\">\n * @if (active) {\n * <svg viewBox=\"0 0 10 10\" aria-hidden=\"true\"><circle cx=\"5\" cy=\"5\" r=\"3\" fill=\"currentColor\" /></svg>\n * } @else if (completed) {\n * <svg viewBox=\"0 0 10 10\" aria-hidden=\"true\"><path d=\"M2 5l2 2 4-4\" stroke=\"currentColor\" fill=\"none\" /></svg>\n * }\n * </ng-template>\n * <div cngxStep label=\"Slide 1\"></div>\n * <div cngxStep label=\"Slide 2\"></div>\n * </cngx-dot-stepper>\n * ```\n *\n * @category common/stepper/slots\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/slots/dot-stepper-dot.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStepIndicator, CngxStepBadge, CngxStepBusySpinner, CngxStepRejection\n * <example-url>http://localhost:4200/#/ui/stepper/dot-stepper/icon-dots-via-code-cngxdotstepperdot-code</example-url>\n */\n@Directive({\n selector: 'ng-template[cngxDotStepperDot]',\n exportAs: 'cngxDotStepperDot',\n standalone: true,\n})\nexport class CngxDotStepperDot {\n readonly templateRef = inject<TemplateRef<CngxDotStepperDotContext>>(TemplateRef);\n}\n","import { computed, type Signal, type TemplateRef } from '@angular/core';\n\nimport type { CngxStepperConfig } from '../stepper-config';\nimport type {\n CngxStepBadge,\n CngxStepBadgeContext,\n} from './step-badge.directive';\nimport type {\n CngxStepBusySpinner,\n CngxStepBusySpinnerContext,\n} from './step-busy-spinner.directive';\nimport type {\n CngxStepGroupHeader,\n CngxStepGroupHeaderContext,\n} from './step-group-header.directive';\nimport type {\n CngxStepIndicator,\n CngxStepIndicatorContext,\n} from './step-indicator.directive';\nimport type {\n CngxStepError,\n CngxStepErrorContext,\n} from './step-error.directive';\nimport type {\n CngxStepRejection,\n CngxStepRejectionContext,\n} from './step-rejection.directive';\nimport type { CngxStepperEmpty } from './stepper-empty.directive';\n\n/**\n * Inputs to {@link createStepperTemplateBindings}. The organism owns\n * the `contentChild()` queries (NG8110 - must run in component\n * injection context) and the resolved {@link CngxStepperConfig}; this\n * factory absorbs the 3-stage cascade per slot key.\n *\n * @category common/stepper/slots\n */\nexport interface CngxStepperTemplateBindingsOptions {\n readonly indicatorSlot: Signal<CngxStepIndicator | undefined>;\n readonly badgeSlot: Signal<CngxStepBadge | undefined>;\n readonly busySpinnerSlot: Signal<CngxStepBusySpinner | undefined>;\n readonly rejectionSlot: Signal<CngxStepRejection | undefined>;\n /** Optional - the error slot is desktop-label-area only; absent on variants that have no label region. */\n readonly errorSlot?: Signal<CngxStepError | undefined>;\n readonly groupHeaderSlot: Signal<CngxStepGroupHeader | undefined>;\n readonly emptySlot: Signal<CngxStepperEmpty | undefined>;\n readonly config: CngxStepperConfig;\n}\n\n/**\n * Output of {@link createStepperTemplateBindings}. One resolved\n * `Signal<TemplateRef | null>` per slot - `null` falls through to the\n * organism's built-in default markup.\n *\n * @category common/stepper/slots\n */\nexport interface CngxStepperTemplateBindings {\n readonly indicator: Signal<TemplateRef<CngxStepIndicatorContext> | null>;\n readonly badge: Signal<TemplateRef<CngxStepBadgeContext> | null>;\n readonly busySpinner: Signal<TemplateRef<CngxStepBusySpinnerContext> | null>;\n readonly rejection: Signal<TemplateRef<CngxStepRejectionContext> | null>;\n readonly stepError: Signal<TemplateRef<CngxStepErrorContext> | null>;\n readonly groupHeader: Signal<TemplateRef<CngxStepGroupHeaderContext> | null>;\n readonly empty: Signal<TemplateRef<void> | null>;\n}\n\n/**\n * Wires the 3-stage template cascade for the `<cngx-stepper>` skin\n * slots: per-instance directive > `CNGX_STEPPER_CONFIG.templates.<key>`\n * > `null` (built-in default).\n *\n * Pure - no DI, no side effects. Safe to call from a field-init\n * block. Sibling of `createTabOverflowTemplateBindings` and the\n * family-wide `createTemplateRegistry`.\n *\n * Tabs has no parallel slot surface yet - see\n * `stepper-accepted-debt §3` for the planned Phase-4 closure.\n *\n * @category common/stepper/slots\n */\nexport function createStepperTemplateBindings(\n opts: CngxStepperTemplateBindingsOptions,\n): CngxStepperTemplateBindings {\n return {\n indicator: computed<TemplateRef<CngxStepIndicatorContext> | null>(\n () =>\n opts.indicatorSlot()?.templateRef ??\n opts.config.templates?.indicator ??\n null,\n ),\n badge: computed<TemplateRef<CngxStepBadgeContext> | null>(\n () =>\n opts.badgeSlot()?.templateRef ??\n opts.config.templates?.badge ??\n null,\n ),\n busySpinner: computed<TemplateRef<CngxStepBusySpinnerContext> | null>(\n () =>\n opts.busySpinnerSlot()?.templateRef ??\n opts.config.templates?.busySpinner ??\n null,\n ),\n rejection: computed<TemplateRef<CngxStepRejectionContext> | null>(\n () =>\n opts.rejectionSlot()?.templateRef ??\n opts.config.templates?.rejection ??\n null,\n ),\n stepError: computed<TemplateRef<CngxStepErrorContext> | null>(\n () =>\n opts.errorSlot?.()?.templateRef ??\n opts.config.templates?.stepError ??\n null,\n ),\n groupHeader: computed<TemplateRef<CngxStepGroupHeaderContext> | null>(\n () =>\n opts.groupHeaderSlot()?.templateRef ??\n opts.config.templates?.groupHeader ??\n null,\n ),\n empty: computed<TemplateRef<void> | null>(\n () =>\n opts.emptySlot()?.templateRef ??\n opts.config.templates?.empty ??\n null,\n ),\n };\n}\n","/**\n * Default glyphs for `<cngx-stepper>` skin slots. Used when neither a\n * per-instance slot directive nor `CNGX_STEPPER_CONFIG.templates.<key>`\n * overrides the built-in span. Sibling of `CNGX_SELECT_GLYPHS` /\n * `CNGX_TABS_GLYPHS`.\n *\n * Exported with `@internal` so the organism (and mat-twin) can share\n * the literals across the secondary-entry boundary that Sheriff\n * forbids deep-relative imports across. Consumers customise via\n * `*cngxStep*` slots or `withStep*Template` features.\n *\n * @internal\n * @category common/stepper\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/glyphs.ts\n * @since 0.1.0\n */\nexport const CNGX_STEPPER_GLYPHS = {\n /** Default visual for `*cngxStepBadge` when no override is bound. */\n errorBadge: '!',\n /** Default visual for `*cngxStepRejection` when no override is bound. */\n rejectionIcon: '!',\n} as const;\n","import {\n afterNextRender,\n computed,\n DestroyRef,\n Directive,\n effect,\n inject,\n input,\n output,\n untracked,\n} from '@angular/core';\nimport { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';\nimport { NavigationEnd, Router } from '@angular/router';\nimport { filter } from 'rxjs/operators';\n\nimport { injectStepperConfig } from './stepper-config';\nimport { CNGX_STEPPER_HOST } from './stepper-host.token';\n\n/**\n * URL deep-linking for the stepper. Bidirectional sync between\n * `activeStepId` and a URL fragment / query-param. Opt-in via\n * `[cngxStepperRouterSync]` on the presenter element.\n *\n * - `mode = 'fragment'` (default) → `#step=customer`\n * - `mode = 'queryParam'` with `paramName = 'step'` → `?step=customer`\n *\n * `Router` is optional - without `@angular/router` the directive\n * dev-warns once and becomes a no-op.\n *\n * @category common/stepper\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/router-sync.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStepperPresenter, CNGX_STEPPER_CONFIG\n * <example-url>http://localhost:4200/#/ui/stepper/stepper-router-sync/deep-linking-with-fragment-queryparam-modes</example-url>\n */\n@Directive({\n selector: '[cngxStepperRouterSync]',\n exportAs: 'cngxStepperRouterSync',\n standalone: true,\n})\nexport class CngxStepperRouterSync {\n // Default undefined so the cascade resolves through CNGX_STEPPER_CONFIG.\n readonly modeInput = input<'fragment' | 'queryParam' | undefined>(undefined, { alias: 'mode' });\n readonly paramNameInput = input<string | undefined>(undefined, {\n alias: 'paramName',\n });\n\n private readonly config = injectStepperConfig();\n\n readonly mode = computed<'fragment' | 'queryParam'>(\n () => this.modeInput() ?? this.config.routerSyncMode ?? 'fragment',\n );\n readonly paramName = computed<string>(\n () => this.paramNameInput() ?? this.config.routerSyncParam ?? 'step',\n );\n\n /** Emits when a `router.navigate` rejection is observed. */\n readonly syncError = output<unknown>();\n\n private readonly host = inject(CNGX_STEPPER_HOST, { host: true });\n private readonly router = inject(Router, { optional: true });\n\n constructor() {\n if (!this.router) {\n afterNextRender(() => {\n console.warn(\n 'CngxStepperRouterSync: no Router available - directive is a no-op. ' +\n 'Provide @angular/router via provideRouter(...) to enable deep-linking.',\n );\n });\n return;\n }\n const router = this.router;\n\n afterNextRender(() => {\n const initial =\n this.mode() === 'fragment'\n ? router.routerState.snapshot.root.fragment\n : (router.routerState.snapshot.root.queryParamMap.get(this.paramName()) ?? null);\n if (initial) {\n const value = this.mode() === 'fragment' ? this.parseFragment(initial) : initial;\n if (value) {\n this.host.selectById(value);\n }\n }\n });\n\n effect(() => {\n const id = this.host.activeStepId();\n if (!id) {\n return;\n }\n untracked(() => {\n const navigation =\n this.mode() === 'fragment'\n ? router.navigate([], {\n fragment: `${this.paramName()}=${id}`,\n queryParamsHandling: 'merge',\n replaceUrl: true,\n })\n : router.navigate([], {\n queryParams: { [this.paramName()]: id },\n queryParamsHandling: 'merge',\n replaceUrl: true,\n });\n navigation.catch?.((err: unknown) => this.syncError.emit(err));\n });\n });\n\n const navEnd = toSignal(\n router.events.pipe(\n filter((e): e is NavigationEnd => e instanceof NavigationEnd),\n takeUntilDestroyed(inject(DestroyRef)),\n ),\n { initialValue: null },\n );\n effect(() => {\n const e = navEnd();\n if (!e) {\n return;\n }\n untracked(() => {\n const next =\n this.mode() === 'fragment'\n ? this.parseFragment(router.routerState.snapshot.root.fragment ?? '')\n : (router.routerState.snapshot.root.queryParamMap.get(this.paramName()) ?? null);\n if (next && next !== this.host.activeStepId()) {\n this.host.selectById(next);\n }\n });\n });\n }\n\n private parseFragment(fragment: string): string | null {\n const param = this.paramName();\n const segments = fragment.split('&');\n for (const seg of segments) {\n const [key, val] = seg.split('=');\n if (key === param && val) {\n return val;\n }\n }\n return null;\n }\n}\n","import { inject, InjectionToken, type Provider } from '@angular/core';\n\n/**\n * Status-pill labels used by the `stripe-status-rich` skin (and any\n * future skin / variant that surfaces a per-step status pill). Sub-\n * bundle of {@link CngxStepperI18n}; consumers override partial keys\n * via {@link withStepperI18nLabels} - un-overridden keys keep their\n * English defaults.\n *\n * @category common/stepper/i18n\n */\nexport interface CngxStepperStatusLabels {\n readonly done: string;\n readonly inProgress: string;\n readonly upNext: string;\n readonly errored: string;\n}\n\n/**\n * Stepper i18n surface. Library defaults are English; locales come from\n * consumer overrides via {@link provideStepperI18n}. Sibling of\n * `CNGX_TABS_I18N` / `CNGX_CHART_I18N`.\n *\n * @category common/stepper/i18n\n */\nexport interface CngxStepperI18n {\n readonly stepperLabel: string;\n /**\n * Landmark `aria-roledescription` for compact step-indicator\n * surfaces such as the dot stepper and the mobile-dot collapse\n * fallback. Mirrors the W3C APG step-indicator pattern.\n *\n * @category common/stepper/i18n\n */\n readonly stepIndicatorRoleDescription: string;\n readonly selectedStep: (label: string, position: number, count: number) => string;\n readonly stepCompleted: string;\n readonly stepErrored: string;\n readonly stepHasErrors: (count: number) => string;\n readonly previousStep: string;\n readonly nextStep: string;\n /**\n * @deprecated Superseded by {@link commitRolledBackTo}. Retained as\n * defensive fallback in `liveAnnouncement` when the origin label is\n * unresolvable (unlabeled step, or `commitState` driven outside `select()`).\n */\n readonly commitFailedRetry: string;\n /**\n * Polite SR announcement on `idle → pending`. Pillar 2.\n */\n readonly commitInFlight: string;\n /**\n * Origin-aware rollback phrase. Read on `pending → error` when both\n * `lastFailedIndex` and `originIndexDuringCommit` resolve. Receives\n * the safe-harbour label, yields e.g. `Reverted to step \"Customer\".`.\n */\n readonly commitRolledBackTo: (originLabel: string) => string;\n /**\n * Persistent suffix on the per-step `aria-describedby` while\n * `presenter.lastFailedIndex()` matches the step. Distinct from\n * {@link commitRolledBackTo} (transient live-region phrase) - this\n * suffix is reachable when AT users navigate back to the rejected\n * step after the announcement has faded. Pillar 2.\n */\n readonly stepRolledBackSuffix: string;\n /**\n * Per-state pill labels surfaced by the `stripe-status-rich` skin\n * (and any future skin / variant that paints a state pill). English\n * defaults; consumer partial overrides via\n * {@link withStepperI18nLabels} keep un-overridden keys intact.\n */\n readonly statusLabels: CngxStepperStatusLabels;\n /**\n * Short progress format used by `CngxProgressBarStepper`'s optional\n * step-count subtext and by `CngxTextStepper`. Receives the\n * 1-based current position and total step count; default\n * `(current, total) => 'Step ${current} of ${total}'`.\n *\n * @category common/stepper/i18n\n */\n readonly textStepperFormat: (current: number, total: number) => string;\n}\n\n/**\n * Partial-override shape for {@link withStepperI18nLabels}. Behaves as\n * `Partial<CngxStepperI18n>` for top-level keys, plus a nested partial\n * for {@link CngxStepperStatusLabels} so consumers can override one\n * pill label without restating the full status-label bundle.\n *\n * @category common/stepper/i18n\n */\nexport type CngxStepperI18nOverrides = Omit<Partial<CngxStepperI18n>, 'statusLabels'> & {\n readonly statusLabels?: Partial<CngxStepperStatusLabels>;\n};\n\n/** @internal */\nconst STEPPER_I18N_DEFAULTS: CngxStepperI18n = {\n stepperLabel: 'Stepper',\n stepIndicatorRoleDescription: 'Step indicator',\n selectedStep: (label, position, count) => `Step ${position} of ${count}: ${label}`,\n stepCompleted: 'Completed',\n stepErrored: 'Has errors',\n stepHasErrors: (count) => `${count} error${count === 1 ? '' : 's'}`,\n previousStep: 'Previous step',\n nextStep: 'Next step',\n commitFailedRetry: 'Commit failed - retry?',\n commitInFlight: 'Committing step…',\n commitRolledBackTo: (originLabel) => `Reverted to step \"${originLabel}\".`,\n stepRolledBackSuffix: 'This step was rolled back.',\n statusLabels: {\n done: 'Done',\n inProgress: 'In progress',\n upNext: 'Up next',\n errored: 'Errored',\n },\n textStepperFormat: (current, total) => `Step ${current} of ${total}`,\n};\n\n/**\n * DI token for the resolved stepper i18n bundle. `providedIn: 'root'`\n * with English defaults.\n *\n * @category common/stepper/i18n\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/i18n/stepper-i18n.ts\n * @since 0.1.0\n */\nexport const CNGX_STEPPER_I18N = new InjectionToken<CngxStepperI18n>('CngxStepperI18n', {\n providedIn: 'root',\n factory: () => STEPPER_I18N_DEFAULTS,\n});\n\n/**\n * Feature shape consumed by {@link provideStepperI18n} and {@link provideCngxStepper}.\n * Hidden `_target: 'i18n'` discriminator routes through the family aggregator.\n * Sibling of `CngxTabsI18nFeature`.\n *\n * @category common/stepper/i18n\n */\nexport type CngxStepperI18nFeature = ((bundle: CngxStepperI18n) => CngxStepperI18n) & {\n readonly _target: 'i18n';\n};\n\n/**\n * Brands an i18n mutator with `_target: 'i18n'`. Every `with*` i18n\n * feature returns one of these.\n *\n * @internal\n */\nfunction defineStepperI18nFeature(\n fn: (bundle: CngxStepperI18n) => CngxStepperI18n,\n): CngxStepperI18nFeature {\n return Object.assign(fn, { _target: 'i18n' as const });\n}\n\n/**\n * Override stepper i18n labels. Partial override - unset keys keep\n * the English default. {@link CngxStepperStatusLabels} is merged\n * key-by-key so consumers can override one pill label without\n * restating the rest. Sibling of `withStepperAriaLabels` /\n * `withStepperFallbackLabels`.\n *\n * @category common/stepper/i18n\n */\nexport function withStepperI18nLabels(\n overrides: CngxStepperI18nOverrides,\n): CngxStepperI18nFeature {\n return defineStepperI18nFeature((bundle) => ({\n ...bundle,\n ...overrides,\n statusLabels: overrides.statusLabels\n ? { ...bundle.statusLabels, ...overrides.statusLabels }\n : bundle.statusLabels,\n }));\n}\n\n/** @internal */\nfunction resolveI18nFeatures(features: readonly CngxStepperI18nFeature[]): CngxStepperI18n {\n return features.reduce<CngxStepperI18n>((bundle, feat) => feat(bundle), STEPPER_I18N_DEFAULTS);\n}\n\n/**\n * Provider for the stepper i18n bundle. Compose `withStepperI18nLabels(...)`\n * (plus any future i18n `with*`) - unset keys fall back to English.\n *\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideStepperI18n(\n * withStepperI18nLabels({ stepperLabel: 'Schrittfolge', previousStep: 'Vorheriger' }),\n * ),\n * ],\n * });\n * ```\n *\n * @category common/stepper/i18n\n */\nexport function provideStepperI18n(...features: readonly CngxStepperI18nFeature[]): Provider {\n return {\n provide: CNGX_STEPPER_I18N,\n useValue: resolveI18nFeatures(features),\n };\n}\n\n/**\n * Inject the resolved stepper i18n bundle in an injection context.\n *\n * @category common/stepper/i18n\n */\nexport function injectStepperI18n(): CngxStepperI18n {\n return inject(CNGX_STEPPER_I18N);\n}\n","import type { CngxStepperI18n } from './i18n/stepper-i18n';\nimport type { CngxStepNode } from './stepper-host.token';\n\n/**\n * Resolve the status-pill label for a step node against the resolved\n * i18n bundle. Used by skins that surface a per-step status pill\n * (e.g. `stripe-status-rich`). Pure factory - no injection context,\n * no signal graph involvement.\n *\n * Resolution order:\n * 1. `success` data-state -> `statusLabels.done`\n * 2. `error` data-state -> `statusLabels.errored`\n * 3. `aria-current=\"step\"` -> `statusLabels.inProgress`\n * 4. otherwise -> `statusLabels.upNext`\n *\n * Group nodes (non-step) return an empty string.\n *\n * @category common/stepper\n */\nexport function resolveStepperStatusLabel(\n node: CngxStepNode,\n i18n: CngxStepperI18n,\n isActive: boolean,\n): string {\n if (node.kind !== 'step') {\n return '';\n }\n const labels = i18n.statusLabels;\n const state = node.state();\n return state === 'success'\n ? labels.done\n : state === 'error'\n ? labels.errored\n : isActive\n ? labels.inProgress\n : labels.upNext;\n}\n","import { computed, signal, type DestroyRef, type Signal } from '@angular/core';\n\nimport type { CngxStepperMobileCollapse } from './stepper-config';\n\n/**\n * Returns a reactive `Signal<boolean>` that reflects whether the host\n * window matches a CSS media query (e.g. `(max-width: 480px)`). Used by\n * `<cngx-stepper>` to drive its mobile auto-collapse template branch.\n *\n * In SSR / non-DOM environments the signal stays `false` and the\n * listener is never wired.\n *\n * @category common/stepper\n */\nexport function createMobileViewportSignal(\n mediaQuery: string,\n destroyRef: DestroyRef,\n): Signal<boolean> {\n const matches = signal<boolean>(false);\n if (typeof globalThis.matchMedia !== 'function') {\n return matches.asReadonly();\n }\n const mql = globalThis.matchMedia(mediaQuery);\n matches.set(mql.matches);\n const listener = (event: MediaQueryListEvent): void => matches.set(event.matches);\n mql.addEventListener('change', listener);\n destroyRef.onDestroy(() => mql.removeEventListener('change', listener));\n return matches.asReadonly();\n}\n\n/**\n * Resolves the active stepper display mode by combining a viewport\n * media-query with the configured `mobileCollapse` policy.\n * `'classic'` keeps the full strip; `'text'` / `'dots'` swap to the\n * matching compact variant.\n *\n * @category common/stepper\n */\nexport function createStepperDisplayMode(\n mediaQuery: string,\n mobileCollapse: () => CngxStepperMobileCollapse | undefined,\n destroyRef: DestroyRef,\n): Signal<'classic' | 'text' | 'dots'> {\n const viewport = createMobileViewportSignal(mediaQuery, destroyRef);\n return computed(() => {\n if (!viewport()) {\n return 'classic';\n }\n const mode = mobileCollapse() ?? 'text';\n return mode === 'off' ? 'classic' : mode;\n });\n}\n","import { computed, signal, type DestroyRef, type Signal } from '@angular/core';\n\n/**\n * Resolved density rung for the classic `<cngx-stepper>` strip.\n * `'full'` shows every label; `'compact'` ellipsis-truncates labels;\n * `'minimal'` drops to indicators-only (the active step keeps its\n * label). Orthogonal to the `mobileCollapse` display-mode union.\n *\n * @category common/stepper\n */\nexport type CngxStripDensity = 'full' | 'compact' | 'minimal';\n\n/**\n * Options for {@link createStripDensity}.\n *\n * @internal\n */\nexport interface CngxStripDensityOptions {\n /** Strip container element whose width drives the density rung. */\n readonly element: HTMLElement;\n /** Current step-only count - the width budget is split across these. */\n readonly stepCount: () => number;\n /**\n * Resolved density policy. Only `'auto'` degrades; `'comfortable'`\n * (or `undefined`) short-circuits to `'full'`, preserving today's\n * behaviour.\n */\n readonly density: () => 'comfortable' | 'auto' | undefined;\n /**\n * Per-step width thresholds in px. At or above `compact` px per step\n * the strip stays `'full'`; at or above `minimal` it is `'compact'`;\n * below `minimal` it is `'minimal'`. `compact` must exceed `minimal`.\n */\n readonly breakpoints: () => { readonly compact: number; readonly minimal: number };\n readonly destroyRef: DestroyRef;\n}\n\n/**\n * Tracks an element's content-box width as a reactive signal via the\n * `ResizeObserver` API. Mirrors `createMobileViewportSignal`'s\n * `matchMedia` wrapper: the API is wrapped directly (not via the\n * `CngxResizeObserver` directive, which can only attach through\n * `hostDirectives`). In SSR / non-DOM environments the signal stays\n * `0` and no observer is wired.\n */\nfunction createElementWidthSignal(element: HTMLElement, destroyRef: DestroyRef): Signal<number> {\n const width = signal(0);\n if (typeof ResizeObserver !== 'function') {\n return width.asReadonly();\n }\n const observer = new ResizeObserver((entries) => {\n width.set(entries[0]?.contentRect.width ?? 0);\n });\n observer.observe(element);\n destroyRef.onDestroy(() => observer.disconnect());\n return width.asReadonly();\n}\n\n/**\n * Resolves the classic strip's density rung from its own container\n * width against the step count and two per-step px thresholds. Pure\n * `create*` factory, sibling to `createStepperDisplayMode` - it owns a\n * `ResizeObserver` the way the display-mode factory owns a\n * `matchMedia` listener, and returns a single derived `Signal`.\n *\n * `'comfortable'` density short-circuits to `'full'` (no measurement\n * dependency). Before the first measurement (`width === 0`) and for an\n * empty strip the rung is `'full'`, so the strip never flashes\n * `'minimal'` on mount.\n *\n * @category common/stepper\n */\nexport function createStripDensity(options: CngxStripDensityOptions): Signal<CngxStripDensity> {\n const width = createElementWidthSignal(options.element, options.destroyRef);\n return computed<CngxStripDensity>(() => {\n if ((options.density() ?? 'comfortable') !== 'auto') {\n return 'full';\n }\n const count = options.stepCount();\n const measured = width();\n if (count === 0 || measured === 0) {\n return 'full';\n }\n const perStep = measured / count;\n const { compact, minimal } = options.breakpoints();\n if (perStep >= compact) {\n return 'full';\n }\n if (perStep >= minimal) {\n return 'compact';\n }\n return 'minimal';\n });\n}\n","import { computed, type Signal } from '@angular/core';\n\nimport type { CngxStepperGroupSummary } from './stepper-config';\nimport type { CngxStepNode } from './stepper-host.token';\n\n/**\n * Collapsed-group summary view consumed by `<cngx-stepper>`. Resolves\n * the `groupCollapseSummary` mode and the per-group `progress` / `count`\n * text, the `status`-dot gate, and the SR phrase. Pure derivation over\n * the group's subtree step states; rendered only on collapsed groups.\n *\n * @category common/stepper\n */\nexport interface CngxStepperGroupSummaryView {\n /** Resolved summary mode (config cascade, default `'progress'`). */\n readonly mode: Signal<CngxStepperGroupSummary>;\n /** Visible badge text for `progress`/`count`, else `null`. */\n text(node: CngxStepNode): string | null;\n /** `true` when a status dot should render (mode `status`, group collapsed). */\n showStatus(node: CngxStepNode): boolean;\n /** Screen-reader phrase for `progress`/`count`, else `null`. */\n srText(node: CngxStepNode): string | null;\n}\n\n/**\n * Options for {@link createStepperGroupSummary}.\n *\n * @internal\n */\nexport interface CngxStepperGroupSummaryOptions {\n /** Raw `groupCollapseSummary` config value (may be undefined). */\n readonly summaryMode: () => CngxStepperGroupSummary | undefined;\n /** Whether a given group node is currently collapsed. */\n readonly isCollapsed: (node: CngxStepNode) => boolean;\n}\n\n/** Terminal-step totals for a group's subtree; reads each step `state()`. */\nfunction subtreeStats(node: CngxStepNode): { total: number; completed: number } {\n let total = 0;\n let completed = 0;\n const visit = (n: CngxStepNode): void => {\n if (n.kind === 'step') {\n total++;\n if (n.state() === 'success') {\n completed++;\n }\n }\n n.children.forEach(visit);\n };\n node.children.forEach(visit);\n return { total, completed };\n}\n\n/**\n * Builds the collapsed-group summary view. Level-2 helper so the\n * organism stays a thin renderer. `status` mode defers its SR phrasing\n * to the group's existing status-phrase span, so {@link srText} returns\n * `null` there. English defaults (locale via the i18n cascade is a\n * follow-up).\n *\n * @category common/stepper\n */\nexport function createStepperGroupSummary(\n options: CngxStepperGroupSummaryOptions,\n): CngxStepperGroupSummaryView {\n const mode = computed<CngxStepperGroupSummary>(() => options.summaryMode() ?? 'progress');\n\n const text = (node: CngxStepNode): string | null => {\n const current = mode();\n if (current === 'off' || current === 'status' || !options.isCollapsed(node)) {\n return null;\n }\n const { total, completed } = subtreeStats(node);\n return current === 'count' ? String(total) : `${completed}/${total}`;\n };\n\n const showStatus = (node: CngxStepNode): boolean =>\n mode() === 'status' && options.isCollapsed(node);\n\n const srText = (node: CngxStepNode): string | null => {\n const current = mode();\n if (current === 'off' || current === 'status' || !options.isCollapsed(node)) {\n return null;\n }\n const { total, completed } = subtreeStats(node);\n return current === 'count' ? `${total} steps` : `${completed} of ${total} steps complete`;\n };\n\n return { mode, text, showStatus, srText };\n}\n","import type { CngxStepNode, CngxStepperHost } from './stepper-host.token';\n\n/**\n * Collapsed-group pointer-navigation view consumed by `<cngx-stepper>`\n * under `groupCollapse: 'expand-active'`. A folded group header becomes a\n * click shortcut into its branch: activating it selects the group's first\n * navigable step, which then becomes the active group and expands as a\n * consequence (no in-place disclosure). Keyboard users reach the same\n * steps via the arrow-key contract, which already steps into a collapsed\n * group, so this is a supplementary pointer affordance.\n *\n * @category common/stepper\n */\nexport interface CngxStepperGroupNavigationView {\n /**\n * `true` when a collapsed group header offers a click shortcut: header\n * navigation is on, the group is folded, and at least one descendant\n * step is navigable right now. The expanded (active) group header is\n * never navigable - its steps are already on screen and clickable.\n */\n isNavigable(node: CngxStepNode): boolean;\n /**\n * Selects the group's first navigable step. No-op for an expanded\n * header, a navigation-off header, or a group with no reachable step.\n */\n select(node: CngxStepNode): void;\n /**\n * `true` when the group owns the active step (`activeGroupId`). Drives\n * the active-branch chip treatment on the header, independent of\n * `groupCollapse`, so the branch in focus reads distinctly even when\n * every group stays expanded.\n */\n isActive(node: CngxStepNode): boolean;\n}\n\n/**\n * Options for {@link createStepperGroupNavigation}.\n *\n * @internal\n */\nexport interface CngxStepperGroupNavigationOptions {\n /**\n * Host slice owning the flat projection (`flatSteps`, DFS order with\n * live `flatIndex`), the reachability predicate (`canNavigateTo`), the\n * commit-in-flight gate (`busy`), and the selection method (`select`).\n */\n readonly presenter: Pick<\n CngxStepperHost,\n 'flatSteps' | 'canNavigateTo' | 'busy' | 'select' | 'activeGroupId'\n >;\n /** Whether a given group node is currently folded. */\n readonly isCollapsed: (node: CngxStepNode) => boolean;\n /** `false` when `headerNavigation: 'none'` keeps every header inert. */\n readonly navigationEnabled: () => boolean;\n}\n\n/**\n * Builds the collapsed-group pointer-navigation view. Level-2 helper so\n * the organism stays a thin renderer.\n *\n * Indices resolve against `flatSteps` (DFS order, live `flatIndex`) rather\n * than `group.children` - the flattener spreads group nodes but leaves\n * their `children` as the tree projection where every step still carries\n * the seeded `-1`. Each candidate is gated by `canNavigateTo` + `busy`\n * (mirroring the step-header reachability), so a linear-blocked leading\n * step is skipped to the first reachable one.\n *\n * @category common/stepper\n */\nexport function createStepperGroupNavigation(\n options: CngxStepperGroupNavigationOptions,\n): CngxStepperGroupNavigationView {\n const { presenter } = options;\n const firstNavigableStepIndex = (group: CngxStepNode): number => {\n const flat = presenter.flatSteps();\n const byId = new Map(flat.map((node) => [node.id, node] as const));\n const isInGroup = (node: CngxStepNode): boolean => {\n let cur: CngxStepNode | undefined = node;\n while (cur && cur.parentId !== null) {\n if (cur.parentId === group.id) {\n return true;\n }\n cur = byId.get(cur.parentId);\n }\n return false;\n };\n for (const node of flat) {\n if (\n node.kind === 'step' &&\n isInGroup(node) &&\n presenter.canNavigateTo(node.flatIndex) &&\n !presenter.busy()\n ) {\n return node.flatIndex;\n }\n }\n return -1;\n };\n\n const isNavigable = (node: CngxStepNode): boolean =>\n options.navigationEnabled() &&\n options.isCollapsed(node) &&\n firstNavigableStepIndex(node) !== -1;\n\n const select = (node: CngxStepNode): void => {\n if (!isNavigable(node)) {\n return;\n }\n presenter.select(firstNavigableStepIndex(node));\n };\n\n const isActive = (node: CngxStepNode): boolean =>\n node.kind === 'group' && presenter.activeGroupId() === node.id;\n\n return { isNavigable, select, isActive };\n}\n","import { computed, type Signal } from '@angular/core';\nimport type {\n CngxStepperConfig,\n CngxStepperMobileIndicatorPosition,\n CngxStepperSkin,\n} from './stepper-config';\n\n/**\n * Input bundle for {@link createStepperHostAttrs}: the three per-instance\n * inputs (each `Signal<T | undefined>`) and the resolved config (read\n * synchronously at construction). Each cascade collapses through\n * `input ?? config ?? library-default`.\n *\n * @internal\n */\nexport interface CngxStepperHostAttrsInputs {\n readonly skin: Signal<CngxStepperSkin | undefined>;\n readonly connectors: Signal<boolean | undefined>;\n readonly mobileIndicatorPosition: Signal<CngxStepperMobileIndicatorPosition | undefined>;\n readonly config: CngxStepperConfig;\n}\n\n/**\n * Three host-attribute signals for `<cngx-stepper>`. Each is read by a\n * `[attr.data-*]` host binding on the organism.\n *\n * @internal\n */\nexport interface CngxStepperHostAttrs {\n readonly resolvedSkin: Signal<CngxStepperSkin>;\n readonly resolvedConnectors: Signal<boolean>;\n readonly resolvedMobileIndicatorPosition: Signal<CngxStepperMobileIndicatorPosition>;\n}\n\n/**\n * Level-2 helper resolving the three host-attribute cascades for\n * `<cngx-stepper>` (skin / connectors / mobileIndicatorPosition). Keeps\n * the organism class under the LOC guard while making the cascade\n * pattern reusable for any future host-attr the strip surfaces.\n *\n * Each computed honors Pillar 1 (Ableitung statt Verwaltung): per-instance\n * input wins over root config wins over library default. No manual sync.\n *\n * @internal\n */\nexport function createStepperHostAttrs(\n inputs: CngxStepperHostAttrsInputs,\n): CngxStepperHostAttrs {\n return {\n resolvedSkin: computed<CngxStepperSkin>(\n () => inputs.skin() ?? inputs.config.skin ?? 'classic',\n ),\n resolvedConnectors: computed<boolean>(\n () => inputs.connectors() ?? inputs.config.connectors ?? false,\n ),\n resolvedMobileIndicatorPosition: computed<CngxStepperMobileIndicatorPosition>(\n () => inputs.mobileIndicatorPosition() ?? inputs.config.mobileIndicatorPosition ?? 'top',\n ),\n };\n}\n","import { afterNextRender, type Injector } from '@angular/core';\n\nimport type { CngxStepperHost } from './stepper-host.token';\n\n/**\n * Options for {@link createStepperStripKeyboardNav}.\n *\n * @internal\n */\nexport interface CngxStepperStripKeyboardNavOptions {\n /** Host contract that owns the active-step state and selection methods. */\n readonly presenter: CngxStepperHost;\n /** Host element used to locate the active step button after the move. */\n readonly hostElement: HTMLElement;\n /** Returns the current flat-step count so `End` lands on the last step. */\n readonly flatStepCount: () => number;\n /**\n * Maps a CngxStepNode id to its DOM button id (e.g. `${id}-header`).\n * The strip selects by stable DOM id rather than waiting for the\n * `aria-current` attribute to flip - the id binding does not depend\n * on the active-step signal, so the lookup is correct the same tick\n * the presenter's `activeStepId` updates.\n */\n readonly stepButtonIdFor: (stepId: string) => string;\n /**\n * Optional class name guard - the handler only runs when\n * `event.target.classList.contains(stepClassName)`. Defaults to the\n * canonical strip button class so panel-content key presses pass\n * through untouched.\n */\n readonly stepClassName?: string;\n /**\n * Optional gate - when supplied and returning `false`, the handler is\n * a complete no-op. Used to switch arrow-key navigation off in the\n * `headerNavigation: 'none'` mode, where the step headers are inert\n * labels rather than focusable buttons. Omitted defaults to enabled.\n */\n readonly enabled?: () => boolean;\n /**\n * Injector used to defer the post-move focus to `afterNextRender`.\n * Required when the strip can re-render its node set on navigation\n * (focus-driven group collapse: crossing a group boundary removes the\n * old button and adds the target's), so the focus lands after the new\n * DOM exists. Omitted, focus falls back to a `queueMicrotask` defer -\n * correct for a static strip where every button is always present.\n */\n readonly injector?: Injector;\n}\n\n/**\n * Builds the WAI-ARIA APG arrow-key handler for a stepper strip. The\n * composed `CngxRovingTabindex` cannot reach view-template step buttons\n * (its `contentChildren` query only sees projected content), so the\n * organism wires this factory's return value to its host `(keydown)`\n * binding to honour the documented keyboard contract.\n *\n * Horizontal orientation: ArrowLeft / ArrowRight navigate. Vertical:\n * ArrowUp / ArrowDown. Home / End jump to the first / last flat step\n * regardless of orientation. The presenter's `select*` methods enforce\n * linear-mode gating so callers do not duplicate that check here.\n *\n * @internal\n */\nexport function createStepperStripKeyboardNav(\n options: CngxStepperStripKeyboardNavOptions,\n): (event: KeyboardEvent) => void {\n const stepClass = options.stepClassName ?? 'cngx-stepper__step';\n const scheduleFocus = (focus: () => void): void => {\n // After the next render when an injector is supplied (the strip may\n // re-render its node set on a group-boundary crossing); a microtask\n // otherwise. Either way the focus runs after the active-step signal\n // has settled, so the target button exists.\n if (options.injector) {\n afterNextRender(focus, { injector: options.injector });\n } else {\n queueMicrotask(focus);\n }\n };\n const focusActive = (): void => {\n const activeId = options.presenter.activeStepId();\n if (!activeId) {\n return;\n }\n const buttonId = options.stepButtonIdFor(activeId);\n scheduleFocus(() => {\n const el = options.hostElement.querySelector(`[id=\"${buttonId}\"]`);\n if (el instanceof HTMLElement) {\n el.focus();\n }\n });\n };\n return (event: KeyboardEvent): void => {\n if (options.enabled && !options.enabled()) {\n return;\n }\n const target = event.target as HTMLElement | null;\n if (!target?.classList.contains(stepClass)) {\n return;\n }\n const isHorizontal = options.presenter.orientation() === 'horizontal';\n const nextKey = isHorizontal ? 'ArrowRight' : 'ArrowDown';\n const prevKey = isHorizontal ? 'ArrowLeft' : 'ArrowUp';\n if (event.key === nextKey) {\n event.preventDefault();\n options.presenter.selectNext();\n focusActive();\n } else if (event.key === prevKey) {\n event.preventDefault();\n options.presenter.selectPrevious();\n focusActive();\n } else if (event.key === 'Home') {\n event.preventDefault();\n options.presenter.select(0);\n focusActive();\n } else if (event.key === 'End') {\n event.preventDefault();\n options.presenter.select(options.flatStepCount() - 1);\n focusActive();\n }\n };\n}\n","import { computed, type Signal } from '@angular/core';\n\nimport type { CngxStepperI18n } from './i18n/stepper-i18n';\nimport type { CngxStepNode, CngxStepperHost, CngxStepStatus } from './stepper-host.token';\n\n/**\n * Per-step + aggregate state derivations shared by every stepper skin.\n *\n * The classic organism historically derived \"is this step errored / busy /\n * rejected\" inline in {@link createStepperSlotContextBuilders}; the dot,\n * text, and progress-bar variants derived nothing, so a step error (per-step\n * `state`, an error aggregator, or a commit rejection) was structurally\n * invisible in those three. This view is the single source those four skins\n * read from - \"Ableitung statt Verwaltung\" - so the error contract can never\n * drift between them.\n *\n * @internal\n */\nexport interface CngxStepperStateView {\n /** Raw step status. Group nodes still report their own `state()`. */\n readonly statusOf: (node: CngxStepNode) => CngxStepStatus;\n\n /**\n * `true` while a commit is in flight AND targets this step. Mirrors the\n * classic `isStepBusy` predicate.\n */\n readonly isBusy: (node: CngxStepNode) => boolean;\n\n /**\n * `true` when this step is the one a commit just rejected\n * (`flatIndex === lastFailedIndex`). The commit-rejection arm your\n * pessimistic / optimistic flows hit.\n */\n readonly isRejected: (node: CngxStepNode) => boolean;\n\n /**\n * Badge-level error: per-step `state === 'error'` OR the bound error\n * aggregator's `shouldShow()`. Deliberately excludes commit rejection -\n * the classic skin renders rejection through its own dedicated slot, so\n * folding it in here would double-render the icon.\n */\n readonly hasErrorBadge: (node: CngxStepNode) => boolean;\n\n /**\n * Unified error predicate - the contract the minimal skins (dot / text /\n * progress-bar) read. `true` when ANY of the three error sources fires:\n * {@link hasErrorBadge} OR a commit rejection ({@link isRejected}). Those\n * skins have no separate rejection slot, so they treat every error source\n * as one \"errored\" state.\n */\n readonly hasError: (node: CngxStepNode) => boolean;\n\n /** Count of step-only nodes where {@link hasError} is `true`. */\n readonly errorCount: Signal<number>;\n\n /** Flat index of the first errored step, or `-1` when none. */\n readonly firstErrorIndex: Signal<number>;\n\n /** `true` when `errorCount() > 0`. Drives skin-level `aria-invalid`. */\n readonly hasAnyError: Signal<boolean>;\n}\n\n/**\n * Build the shared {@link CngxStepperStateView} over a presenter host and its\n * step-only projection. Pure factory - `computed()` only, no injection\n * context required, so any skin can allocate it in a field initializer.\n *\n * @category common/stepper\n * @since 0.1.0\n * @relatedTo CngxStepperHost, createStepperSlotContextBuilders\n */\nexport function createStepperStateView(inputs: {\n presenter: CngxStepperHost;\n stepsOnly: Signal<readonly CngxStepNode[]>;\n}): CngxStepperStateView {\n const { presenter, stepsOnly } = inputs;\n\n const statusOf = (node: CngxStepNode): CngxStepStatus => node.state();\n\n const isBusy = (node: CngxStepNode): boolean =>\n node.kind === 'step' &&\n presenter.commitState.status() === 'pending' &&\n presenter.intendedStepIndex() === node.flatIndex;\n\n const isRejected = (node: CngxStepNode): boolean =>\n node.kind === 'step' && node.flatIndex >= 0 && node.flatIndex === presenter.lastFailedIndex();\n\n const hasErrorBadge = (node: CngxStepNode): boolean => {\n if (node.kind !== 'step') {\n return false;\n }\n if (node.state() === 'error') {\n return true;\n }\n return !!node.errorAggregator?.()?.shouldShow?.();\n };\n\n const hasError = (node: CngxStepNode): boolean => hasErrorBadge(node) || isRejected(node);\n\n const erroredSteps = computed<readonly CngxStepNode[]>(() =>\n stepsOnly().filter((node) => hasError(node)),\n );\n\n const errorCount = computed<number>(() => erroredSteps().length);\n\n const firstErrorIndex = computed<number>(() => erroredSteps()[0]?.flatIndex ?? -1);\n\n const hasAnyError = computed<boolean>(() => errorCount() > 0);\n\n return {\n statusOf,\n isBusy,\n isRejected,\n hasErrorBadge,\n hasError,\n errorCount,\n firstErrorIndex,\n hasAnyError,\n };\n}\n\n/**\n * Aggregate error phrase shared by the minimal skins (text / progress-bar)\n * and the classic mobile-collapse text branch. A single errored step names\n * itself (`\"Payment: Errored\"`); several collapse to the i18n count phrase\n * (`\"2 errors\"`). Returns `''` when no step errored - callers gate on\n * `view.hasAnyError()` so the empty string never reaches the DOM.\n *\n * The optional `messageOf` resolver lets callers surface a per-step\n * reason (a direct `[error]` string or the first aggregator label) in the\n * single-error case instead of the generic `errored` status word. When\n * omitted - or when it returns `undefined`/`''` - the helper produces\n * byte-identical output to the no-resolver form, so existing callers\n * (the classic mobile-collapse summary) are a guaranteed no-op.\n *\n * Pure helper - reads signals at call time, intended to be wrapped in the\n * caller's `computed()`.\n *\n * @category common/stepper\n * @since 0.1.0\n */\nexport function resolveStepperErrorSummary(\n view: Pick<CngxStepperStateView, 'errorCount' | 'firstErrorIndex'>,\n stepsOnly: Signal<readonly CngxStepNode[]>,\n i18n: CngxStepperI18n,\n messageOf?: (node: CngxStepNode) => string | undefined,\n): string {\n const count = view.errorCount();\n if (count === 0) {\n return '';\n }\n if (count === 1) {\n const node = stepsOnly()[view.firstErrorIndex()];\n const custom = node ? messageOf?.(node) : undefined;\n if (custom !== undefined && custom !== '') {\n return custom;\n }\n const label = node?.label();\n return label ? `${label}: ${i18n.statusLabels.errored}` : i18n.statusLabels.errored;\n }\n return i18n.stepHasErrors(count);\n}\n","import type { Signal } from '@angular/core';\n\nimport type { CngxStepperI18n } from './i18n/stepper-i18n';\nimport type { CngxStepBadgeContext } from './slots/step-badge.directive';\nimport type { CngxStepBusySpinnerContext } from './slots/step-busy-spinner.directive';\nimport type { CngxStepErrorContext } from './slots/step-error.directive';\nimport type { CngxStepGroupHeaderContext } from './slots/step-group-header.directive';\nimport type { CngxStepIndicatorContext } from './slots/step-indicator.directive';\nimport type { CngxStepRejectionContext } from './slots/step-rejection.directive';\nimport { createStepperStateView } from './stepper-state-view';\nimport type { CngxStepContentContext, CngxStepLabelContext } from './step-panel-host.token';\nimport type { CngxStepNode, CngxStepperHost } from './stepper-host.token';\n\n/**\n * Input bundle for {@link createStepperSlotContextBuilders}: the presenter\n * surface and the step-only flat projection. Builders read both reactively\n * so the produced context objects always reflect current presenter state.\n *\n * @internal\n */\nexport interface CngxStepperSlotContextBuildersInputs {\n readonly presenter: CngxStepperHost;\n readonly stepsOnly: Signal<readonly CngxStepNode[]>;\n /** i18n bundle - supplies the `errored` status label as the message fallback. */\n readonly i18n: CngxStepperI18n;\n}\n\n/**\n * Per-step status / activity / rejection / labelling derivations shared by\n * every slot context shape. The organism reads these through the bundle\n * instead of duplicating the logic next to each `*ContextFor` builder.\n *\n * @internal\n */\nexport interface CngxStepperSlotContextBuilders {\n readonly isActive: (node: CngxStepNode) => boolean;\n readonly isStepBusy: (node: CngxStepNode) => boolean;\n readonly showRejection: (node: CngxStepNode) => boolean;\n readonly showErrorBadge: (node: CngxStepNode) => boolean;\n /** Validation-channel error gate - mirrors the error badge, independent of commit rejection. */\n readonly showStepError: (node: CngxStepNode) => boolean;\n readonly indicatorContextFor: (node: CngxStepNode) => CngxStepIndicatorContext;\n readonly badgeContextFor: (node: CngxStepNode) => CngxStepBadgeContext;\n readonly busySpinnerContextFor: (node: CngxStepNode) => CngxStepBusySpinnerContext;\n readonly rejectionContextFor: (node: CngxStepNode) => CngxStepRejectionContext;\n readonly stepErrorContextFor: (node: CngxStepNode) => CngxStepErrorContext;\n readonly groupHeaderContextFor: (node: CngxStepNode) => CngxStepGroupHeaderContext;\n readonly stepLabelContextFor: (node: CngxStepNode) => CngxStepLabelContext;\n readonly stepContentContextFor: (node: CngxStepNode) => CngxStepContentContext;\n}\n\n/**\n * Wrap a `(node) => TContext` builder so identical results return the\n * same reference. Keyed by the node object via `WeakMap`, so step-list\n * re-emits drop stale entries automatically. The structural comparison\n * is shallow because every context shape is a flat object.\n *\n * @internal\n */\nfunction memoizeByNode<TContext extends object>(\n build: (node: CngxStepNode) => TContext,\n): (node: CngxStepNode) => TContext {\n const cache = new WeakMap<CngxStepNode, TContext>();\n return (node) => {\n const next = build(node);\n const prev = cache.get(node);\n if (prev !== undefined && shallowEqual(prev, next)) {\n return prev;\n }\n cache.set(node, next);\n return next;\n };\n}\n\n/** @internal */\nfunction shallowEqual<T extends object>(a: T, b: T): boolean {\n if (a === b) {\n return true;\n }\n const keysA = Object.keys(a);\n if (keysA.length !== Object.keys(b).length) {\n return false;\n }\n const ra = a as Record<string, unknown>;\n const rb = b as Record<string, unknown>;\n for (const k of keysA) {\n if (ra[k] !== rb[k]) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Bundle the `*ContextFor` slot-context builders plus the small\n * `isActive` / `isStepBusy` / `showRejection` / `showErrorBadge` /\n * `showStepError` predicates the organism's template reads. Lives at\n * Level 2 so the `<cngx-stepper>` organism stays a thin shell.\n *\n * @internal\n */\nexport function createStepperSlotContextBuilders(\n inputs: CngxStepperSlotContextBuildersInputs,\n): CngxStepperSlotContextBuilders {\n const { presenter, stepsOnly, i18n } = inputs;\n\n // Single source for every per-step status / error / busy / rejection\n // derivation. The dot / text / progress-bar skins read the same view,\n // so the error contract stays identical across all four.\n const stateView = createStepperStateView({ presenter, stepsOnly });\n\n const isActive = (node: CngxStepNode): boolean =>\n node.kind === 'step' && node.id === presenter.activeStepId();\n\n const isStepBusy = stateView.isBusy;\n\n const showRejection = stateView.isRejected;\n\n const showErrorBadge = stateView.hasErrorBadge;\n\n // Validation-channel gate for the per-step error message. Mirrors the\n // error badge (state === 'error' via [error] / aggregator); the commit\n // rejection keeps its own `showRejection` slot, so the two channels\n // stay distinct.\n const showStepError = stateView.hasErrorBadge;\n\n // Memoize per-node so identical contexts return the same reference.\n // *ngTemplateOutlet pays an ngOnChanges shallow comparison on its\n // `context:` binding every CD pass; without this cache the outlet\n // sees a fresh literal each tick and re-pushes context to the\n // embedded view even when no source signal changed. Cache keys are\n // the node objects themselves so the WeakMap evicts naturally with\n // step-list re-emits.\n const indicatorContextFor = memoizeByNode<CngxStepIndicatorContext>((node) => {\n const position = node.flatIndex + 1;\n return {\n $implicit: position,\n position,\n node,\n active: isActive(node),\n status: node.state(),\n busy: isStepBusy(node),\n };\n });\n\n const badgeContextFor = memoizeByNode<CngxStepBadgeContext>((node) => {\n const aggregator = node.errorAggregator?.();\n const count = aggregator?.errorCount() ?? 0;\n return { count, node };\n });\n\n const busySpinnerContextFor = memoizeByNode<CngxStepBusySpinnerContext>((node) => ({ node }));\n\n const rejectionContextFor = memoizeByNode<CngxStepRejectionContext>((node) => {\n const failedIndex = node.flatIndex;\n const originIdx = presenter.originIndexDuringCommit();\n const originLabel = originIdx !== undefined ? stepsOnly()[originIdx]?.label() : undefined;\n return { failedIndex, originLabel, node };\n });\n\n const stepErrorContextFor = memoizeByNode<CngxStepErrorContext>((node) => {\n const aggregator = node.errorAggregator?.();\n const errorLabels = aggregator?.errorLabels?.() ?? [];\n const announcement = aggregator?.announcement?.() ?? '';\n // Resolution order: direct [error] string > first aggregator label >\n // i18n errored status phrase. Always non-empty so a bare\n // `{{ message }}` template renders a reason.\n const message = node.errorMessage?.() ?? errorLabels[0] ?? i18n.statusLabels.errored;\n return { node, message, errorLabels, announcement };\n });\n\n const groupHeaderContextFor = memoizeByNode<CngxStepGroupHeaderContext>((node) => ({\n group: node,\n expanded: true,\n status: node.state(),\n }));\n\n const stepLabelContextFor = memoizeByNode<CngxStepLabelContext>((node) => ({\n node,\n index: node.flatIndex + 1,\n active: isActive(node),\n busy: isStepBusy(node),\n disabled: node.disabled(),\n }));\n\n // Independent builder + independent cache: content + label contexts\n // share a shape today but the slot directives are separate contracts\n // (CngxStepContentContext vs CngxStepLabelContext) and will diverge\n // when one side gains a field. Aliasing the function would couple\n // both call sites to that future divergence.\n const stepContentContextFor = memoizeByNode<CngxStepContentContext>((node) => ({\n node,\n index: node.flatIndex + 1,\n active: isActive(node),\n busy: isStepBusy(node),\n disabled: node.disabled(),\n }));\n\n return {\n isActive,\n isStepBusy,\n showRejection,\n showErrorBadge,\n showStepError,\n indicatorContextFor,\n badgeContextFor,\n busySpinnerContextFor,\n rejectionContextFor,\n stepErrorContextFor,\n groupHeaderContextFor,\n stepLabelContextFor,\n stepContentContextFor,\n };\n}\n","import { computed, type Signal } from '@angular/core';\n\nimport type { CngxStepperI18n } from './i18n/stepper-i18n';\nimport type { CngxStepNode, CngxStepperHost } from './stepper-host.token';\n\n/**\n * Input bundle for {@link createStepperAnnouncementBuilders}. The presenter\n * surface (commit transition + failed-index signals), the step-only flat\n * projection, and the resolved i18n strings.\n *\n * @internal\n */\nexport interface CngxStepperAnnouncementBuildersInputs {\n readonly presenter: CngxStepperHost;\n readonly stepsOnly: Signal<readonly CngxStepNode[]>;\n readonly i18n: CngxStepperI18n;\n}\n\n/**\n * Reactive SR-announcement surface for the stepper organism: the\n * `aria-live` content for commit lifecycle transitions, the per-step\n * descriptor phrase including the rejected-suffix, and the group rollup\n * phrase. Bundles three small functions the organism's template binds\n * against.\n *\n * @internal\n */\nexport interface CngxStepperAnnouncementBuilders {\n /**\n * Live-region content driven by the commit transition tracker.\n * Empty string between transitions keeps the region quiet on no-op\n * CD ticks. Error-arm priority: `commitRolledBackTo(originLabel)` when\n * both `lastFailedIndex` and a resolvable origin label exist; otherwise\n * `commitFailedRetry`.\n */\n readonly liveAnnouncement: Signal<string>;\n /**\n * SR descriptor phrase. Aggregator-announced or \"Step N of M: <label>\";\n * appends `stepRolledBackSuffix` on the rejected row.\n */\n readonly statusPhrase: (node: CngxStepNode) => string;\n /** Group descriptor - rolls up children's aggregated status. */\n readonly groupStatusPhrase: (node: CngxStepNode) => string;\n}\n\n/**\n * Build the reactive SR-announcement surface for `<cngx-stepper>`.\n * Lives at Level 2 so the Level-4 organism stays a thin shell per\n * `reference_atomic_decompose`.\n *\n * @internal\n */\nexport function createStepperAnnouncementBuilders(\n inputs: CngxStepperAnnouncementBuildersInputs,\n): CngxStepperAnnouncementBuilders {\n const { presenter, stepsOnly, i18n } = inputs;\n\n const liveAnnouncement = computed<string>(() => {\n const current = presenter.commitTransition.current();\n if (current === 'pending') {\n return i18n.commitInFlight;\n }\n if (current === 'error') {\n // Sync commit-handler errors collapse pending -> error in one signal\n // flush; tracker sees `previous === 'idle'`. Guard stays loose so\n // sync-rejection (`commitAction = () => false`) still announces.\n const failedIdx = presenter.lastFailedIndex();\n const originIdx = presenter.originIndexDuringCommit();\n if (failedIdx !== undefined && originIdx !== undefined) {\n const originLabel = stepsOnly()[originIdx]?.label();\n if (originLabel) {\n return i18n.commitRolledBackTo(originLabel);\n }\n }\n return i18n.commitFailedRetry;\n }\n return '';\n });\n\n const statusPhrase = (node: CngxStepNode): string => {\n const aggregator = node.errorAggregator?.();\n let base = aggregator?.shouldShow?.() ? (aggregator.announcement?.() ?? '') : '';\n if (!base && node.kind === 'step') {\n const idx = node.flatIndex;\n if (idx >= 0) {\n base = i18n.selectedStep(node.label(), idx + 1, stepsOnly().length);\n }\n }\n if (!base) {\n return '';\n }\n return node.kind === 'step' && node.flatIndex === presenter.lastFailedIndex()\n ? `${base} ${i18n.stepRolledBackSuffix}`\n : base;\n };\n\n const groupStatusPhrase = (node: CngxStepNode): string => {\n const status = node.state();\n if (status === 'error') {\n return i18n.stepErrored;\n }\n if (status === 'success') {\n return i18n.stepCompleted;\n }\n return '';\n };\n\n return { liveAnnouncement, statusPhrase, groupStatusPhrase };\n}\n","import { computed, Directive, inject, input } from '@angular/core';\n\nimport type { SwipeDirection } from '@cngx/common/interactive';\n\nimport { injectStepperConfig } from './stepper-config';\nimport { CNGX_STEPPER_HOST } from './stepper-host.token';\n\n/**\n * Routes a `CngxSwipe` gesture into the stepper presenter so the\n * organism's mobile-collapse panels gain swipe-driven navigation\n * without duplicating pointer handling. Applied via `hostDirectives`\n * on `<cngx-stepper>`; consumer-facing input `[mobileSwipe]` is\n * forwarded through the host metadata.\n *\n * Cascade for `swipeEnabled`: per-instance `[mobileSwipe]` ->\n * `CNGX_STEPPER_CONFIG.mobileSwipe` -> library default `true`.\n *\n * Direction routing is asymmetric, matching the presenter's existing\n * navigation surface: `left` -> `selectNext()` -> `select()` (linear\n * gate + commit window apply identically to a click); `right` ->\n * `selectPrevious()` (ungated direct back-move, same path as the\n * existing strip back-nav).\n *\n * @category common/stepper\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/swipe-nav.directive.ts\n * @since 0.1.0\n */\n@Directive({\n selector: '[cngxStepperSwipeNav]',\n standalone: true,\n})\nexport class CngxStepperSwipeNav {\n /**\n * Per-instance opt-out for the built-in swipe navigation. `undefined`\n * defers to the config cascade.\n */\n readonly mobileSwipe = input<boolean | undefined>(undefined);\n\n private readonly host = inject(CNGX_STEPPER_HOST);\n private readonly config = injectStepperConfig();\n\n /** Resolved enabled flag (Input -> config -> default(true)). Boolean output, no `equal` fn required. */\n readonly swipeEnabled = computed<boolean>(\n () => this.mobileSwipe() ?? this.config.mobileSwipe ?? true,\n );\n\n /**\n * Route a swipe direction into the presenter. `left` and `right`\n * map onto `selectNext` and `selectPrevious`; vertical directions\n * are ignored.\n */\n handleSwipe(direction: SwipeDirection): void {\n if (direction === 'left') {\n this.host.selectNext();\n } else if (direction === 'right') {\n this.host.selectPrevious();\n }\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n type Signal,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { CNGX_STEPPER_HOST, type CngxStepNode } from './stepper-host.token';\nimport { injectStepperI18n } from './i18n/stepper-i18n';\n\n/**\n * Minimal contract `CngxStepperCount` reads off the host. A full\n * {@link CngxStepperHost} satisfies it, but consumers can also supply\n * a narrower stub (useful in tests, custom layouts, or non-standard\n * step containers that surface just these two signals).\n *\n * @category common/stepper\n */\nexport interface CngxStepperCountHost {\n readonly activeStepIndex: Signal<number>;\n readonly stepsOnly: Signal<readonly CngxStepNode[]>;\n}\n\n/**\n * Reusable progress-hint atom for any stepper organism. Renders the\n * resolved `CngxStepperI18n.textStepperFormat(current, total)` string\n * inside a `<span>` and pipes the value through an `aria-live` region\n * so screen readers announce step transitions.\n *\n * The text shape is fully owned by the i18n format function - drop the\n * atom inside any `<cngx-stepper>` / `<cngx-mat-stepper>` /\n * `<cngx-progress-bar-stepper>` tree and override the format upstream\n * to change every instance at once:\n *\n * ```ts\n * provideStepperI18n(withStepperI18nLabels({\n * textStepperFormat: (c, t) => `${c}/${t} complete`,\n * }));\n * ```\n *\n * Canonical shapes the atom supports without any markup changes:\n * - `Step N of M` (default)\n * - `N/M complete`\n * - `N/M`\n * - `Math.round(c/t * 100)%`\n * - any consumer-defined string the closure returns.\n *\n * `[live]=\"false\"` opts the atom out of the `aria-live` region when\n * the caption sits next to another live region (e.g. a stepper that\n * already mounts its own live announcer) to prevent double announces.\n *\n * @category common/stepper\n * @docsKind primary\n * @since 0.1.0\n * @relatedTo CngxStepperHost, CngxStepperI18n\n * <example-url>http://localhost:4200/#/ui/stepper/stepper-count/multi-instance-format-overrides</example-url>\n */\n@Component({\n selector: 'cngx-stepper-count',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n template: '<span [attr.aria-live]=\"live() ? \\'polite\\' : null\">{{ label() }}</span>',\n host: {\n class: 'cngx-stepper-count',\n },\n})\nexport class CngxStepperCount {\n /** When `true`, wraps the rendered string in an `aria-live=\"polite\"` span. */\n readonly live = input<boolean>(true);\n\n /**\n * Per-instance format override. Receives `(current, total)` where\n * `current` is the 1-based active step position and `total` is\n * `host.stepsOnly().length`. When omitted, the resolved\n * `CngxStepperI18n.textStepperFormat` is used so two siblings can\n * each show a different shape inside the same stepper tree.\n */\n readonly format = input<((current: number, total: number) => string) | undefined>(undefined);\n\n /**\n * Explicit stepper-host reference. Set this when the atom sits\n * *outside* a `<cngx-stepper>` (e.g. in a sibling layout header)\n * by exporting the stepper as a template ref:\n * `<cngx-stepper #s=\"cngxStepper\">` then `[host]=\"s.presenter\"`.\n * When unset, the atom injects the ambient `CNGX_STEPPER_HOST` from\n * its DI tree. Accepts {@link CngxStepperCountHost} so a narrow stub\n * (active index + steps signal) also fits.\n */\n readonly host = input<CngxStepperCountHost | null>(null);\n\n private readonly injectedHost = inject(CNGX_STEPPER_HOST, { optional: true });\n private readonly i18n = injectStepperI18n();\n private readonly resolvedHost = computed<CngxStepperCountHost | null>(\n () => this.host() ?? this.injectedHost,\n );\n\n /** Resolved caption - reactive on activeStepIndex / stepsOnly / format / i18n. */\n protected readonly label = computed<string>(() => {\n const host = this.resolvedHost();\n if (!host) {\n return '';\n }\n const current = host.activeStepIndex() + 1;\n const total = host.stepsOnly().length;\n const fmt = this.format() ?? this.i18n.textStepperFormat;\n return fmt(current, total);\n });\n}\n","import { computed, Directive, inject, input, isDevMode, type Signal } from '@angular/core';\n\nimport { CngxAsyncClick } from '@cngx/common/interactive';\n\nimport { CNGX_STEPPER_HOST, type CngxStepperHost } from '../stepper-host.token';\n\n/**\n * Turns any clickable element into a stepper \"Back\" control. Resolves\n * its host the same way `CngxStepperCount` does - an explicit `[host]`\n * input (for placement outside the stepper tree) falling back to the\n * ambient {@link CNGX_STEPPER_HOST}.\n *\n * `(click)` retreats via `selectPrevious()`. The control disables itself\n * when there is no earlier step (`!canGoPrevious()`) OR while a commit is\n * in flight (`busy()`): `selectPrevious()` writes `activeStepIndex`\n * directly, bypassing the commit controller, so disabling it during an\n * in-flight forward commit prevents a navigate-mid-commit race. The gate\n * is the host's `canGoPrevious` bound - never re-derived from `stepsOnly`.\n *\n * Reflects the disabled state via `aria-disabled` only - never native\n * `disabled` - so the control stays focusable and AT-reachable; the\n * `handleClick` guard blocks the action while disabled.\n *\n * ```html\n * <button cngxStepperPrevious>Back</button>\n * ```\n *\n * @category common/stepper\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/controls/stepper-previous.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStepperNext, CngxStepperComplete, CngxStepperHost\n */\n@Directive({\n selector: '[cngxStepperPrevious]',\n standalone: true,\n exportAs: 'cngxStepperPrevious',\n host: {\n '(click)': 'handleClick($event)',\n '[attr.aria-disabled]': 'disabled() || null',\n },\n})\nexport class CngxStepperPrevious {\n /**\n * Explicit stepper-host reference for placement *outside* the stepper\n * tree (`[host]=\"s.presenter\"`). When unset, the ambient\n * {@link CNGX_STEPPER_HOST} is injected.\n */\n readonly host = input<CngxStepperHost | null>(null);\n\n private readonly injectedHost = inject(CNGX_STEPPER_HOST, { optional: true });\n private readonly resolvedHost = computed<CngxStepperHost | null>(\n () => this.host() ?? this.injectedHost,\n );\n\n private readonly coPlacedAsyncClick = inject(CngxAsyncClick, { self: true, optional: true });\n\n constructor() {\n if (isDevMode() && this.coPlacedAsyncClick) {\n console.warn(\n 'CngxStepperPrevious: [cngxStepperPrevious] and [cngxAsyncClick] on the same element ' +\n 'both gate aria-disabled. Use one or the other.',\n );\n }\n }\n\n /** `true` when retreat is unavailable: no earlier step or commit busy. */\n protected readonly disabled: Signal<boolean> = computed(() => {\n const host = this.resolvedHost();\n return !host || !host.canGoPrevious() || host.busy();\n });\n\n /** @internal */\n protected handleClick(event: Event): void {\n if (this.disabled()) {\n event.preventDefault();\n return;\n }\n this.resolvedHost()?.selectPrevious();\n }\n}\n","import { computed, Directive, inject, input, isDevMode, type Signal } from '@angular/core';\n\nimport { CngxAsyncClick } from '@cngx/common/interactive';\n\nimport { CNGX_STEPPER_HOST, type CngxStepperHost } from '../stepper-host.token';\n\n/**\n * Turns any clickable element into a stepper \"Continue\" control. Same\n * host resolution as `CngxStepperCount` - explicit `[host]` input\n * falling back to the ambient {@link CNGX_STEPPER_HOST}.\n *\n * `(click)` advances via `selectNext()`. A turnkey re-entrancy guard\n * disables the control when there is no enabled next step\n * (`!canGoNext()`) OR while a commit is in flight (`busy()`) - an opt-in\n * guard a consumer forgets is a silent double-commit (Pillar 2). The\n * gate reads the host's `canGoNext` bound, which derives from the same\n * `select()` predicates, so the affordance can never drift from the\n * navigation it triggers.\n *\n * Reflects the disabled state via `aria-disabled` only - never native\n * `disabled` (which would steal focus, so AT could not reach the control\n * to learn it is at-a-bound / busy) and never `aria-busy` (that is\n * `CngxAsyncStatus`'s sole responsibility). The `handleClick` guard\n * blocks the action while disabled. Co-placing `[cngxAsyncClick]` here\n * (which also gates `aria-disabled` and adds native `disabled`) warns in\n * dev mode.\n *\n * ```html\n * <button cngxStepperNext>Continue</button>\n * ```\n *\n * @category common/stepper\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/controls/stepper-next.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStepperPrevious, CngxStepperComplete, CngxAsyncStatus, CngxStepperHost\n */\n@Directive({\n selector: '[cngxStepperNext]',\n standalone: true,\n exportAs: 'cngxStepperNext',\n host: {\n '(click)': 'handleClick($event)',\n '[attr.aria-disabled]': 'disabled() || null',\n },\n})\nexport class CngxStepperNext {\n /**\n * Explicit stepper-host reference for placement *outside* the stepper\n * tree (`[host]=\"s.presenter\"`). When unset, the ambient\n * {@link CNGX_STEPPER_HOST} is injected.\n */\n readonly host = input<CngxStepperHost | null>(null);\n\n private readonly injectedHost = inject(CNGX_STEPPER_HOST, { optional: true });\n private readonly resolvedHost = computed<CngxStepperHost | null>(\n () => this.host() ?? this.injectedHost,\n );\n\n private readonly coPlacedAsyncClick = inject(CngxAsyncClick, { self: true, optional: true });\n\n /** `true` when advancing is unavailable: no enabled next step or commit busy. */\n protected readonly disabled: Signal<boolean> = computed(() => {\n const host = this.resolvedHost();\n return !host || !host.canGoNext() || host.busy();\n });\n\n constructor() {\n if (isDevMode() && this.coPlacedAsyncClick) {\n console.warn(\n 'CngxStepperNext: [cngxStepperNext] and [cngxAsyncClick] on the same element ' +\n 'both gate aria-disabled (and cngxAsyncClick adds native [disabled]). Use one or the other.',\n );\n }\n }\n\n /** @internal */\n protected handleClick(event: Event): void {\n if (this.disabled()) {\n event.preventDefault();\n return;\n }\n this.resolvedHost()?.selectNext();\n }\n}\n","import { computed, Directive, effect, inject, input, output, type Signal } from '@angular/core';\n\nimport { CngxAsyncClick } from '@cngx/common/interactive';\nimport { createTransitionTracker } from '@cngx/core/utils';\n\nimport { CNGX_STEPPER_HOST, type CngxStepperHost } from '../stepper-host.token';\n\n/**\n * Turns any clickable element into a stepper \"Finish\" control. Unlike\n * `CngxStepperNext` (which *reflects* the commit state and advances),\n * the finish action *runs*: the directive composes `CngxAsyncClick` via\n * `hostDirectives`, so the runner owns the click lifecycle, `aria-busy`,\n * and the pending-disable exactly as it does on a standalone button. The\n * finish action is fed through the aliased `[cngxStepperComplete]` input.\n *\n * Resolves its host like the sibling controls - explicit `[host]` input\n * falling back to the ambient {@link CNGX_STEPPER_HOST}. {@link isActive}\n * exposes whether the active step is the last one, so a consumer renders\n * the finish control only on the final step. `(completed)` emits once\n * after the action resolves successfully.\n *\n * ```html\n * @if (s.presenter.isLastStep()) {\n * <button [cngxStepperComplete]=\"submit\" (completed)=\"done()\">Finish</button>\n * }\n * ```\n *\n * @category common/stepper\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/controls/stepper-complete.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStepperNext, CngxStepperPrevious, CngxAsyncClick, CngxStepperHost\n */\n@Directive({\n selector: '[cngxStepperComplete]',\n standalone: true,\n exportAs: 'cngxStepperComplete',\n hostDirectives: [\n {\n directive: CngxAsyncClick,\n inputs: [\n 'cngxAsyncClick: cngxStepperComplete',\n 'feedbackDuration',\n 'enabled',\n 'succeededAnnouncement',\n 'failedAnnouncement',\n ],\n },\n ],\n})\nexport class CngxStepperComplete {\n /**\n * Explicit stepper-host reference for placement *outside* the stepper\n * tree (`[host]=\"s.presenter\"`). When unset, the ambient\n * {@link CNGX_STEPPER_HOST} is injected.\n */\n readonly host = input<CngxStepperHost | null>(null);\n\n /**\n * Emits once per `pending → success` transition of the finish action.\n * Does NOT re-emit when the `feedbackDuration` window resets the runner\n * back to idle - the transition tracker guards on the success edge only.\n */\n readonly completed = output<void>();\n\n private readonly injectedHost = inject(CNGX_STEPPER_HOST, { optional: true });\n private readonly resolvedHost = computed<CngxStepperHost | null>(\n () => this.host() ?? this.injectedHost,\n );\n private readonly runner = inject(CngxAsyncClick, { host: true });\n\n /** `true` when the active step is the last one - the finish step. */\n readonly isActive: Signal<boolean> = computed(() => this.resolvedHost()?.isLastStep() ?? false);\n\n constructor() {\n const tracker = createTransitionTracker(() => this.runner.status());\n effect(() => {\n if (tracker.current() === 'success' && tracker.previous() !== 'success') {\n this.completed.emit();\n }\n });\n }\n}\n","import { computed } from '@angular/core';\n\nimport { buildAsyncStateView, type StatusTransition } from '@cngx/core/utils';\n\nimport type { CngxStepNode, CngxStepRegistration, CngxStepperHost } from './stepper-host.token';\n\nconst EMPTY_NODES: readonly CngxStepNode[] = Object.freeze([]);\n\n/**\n * Builds a live delegating {@link CngxStepperHost} proxy over a supplier\n * signal. Every signal member is a `computed()` reading\n * `supplier()?.<member>()`, every method forwards to\n * `supplier()?.<method>(...)`. This is the spelled-out shape for\n * re-providing an input-derived host through DI - you cannot\n * `useExisting` an `input()` value, so the footer provides this proxy\n * once and it tracks whichever host the supplier currently resolves.\n *\n * **Null-supplier neutral set (the disabled-by-default contract).** When\n * the supplier resolves `null` (a standalone footer with neither `[host]`\n * nor an ambient stepper), every navigation affordance must render\n * *inert*, never falsely enabled: `canGoPrevious` / `canGoNext` collapse\n * to `false` so Back / Next render disabled, and every method is a no-op.\n *\n * `create*` pure factory - no injection context required (`computed()`\n * only). Single consumer (the footer); the surface is load-bearing, not\n * speculative.\n *\n * @category common/stepper\n * @since 0.1.0\n * @relatedTo CngxStepperFooter, CngxStepperHost\n */\nexport function createStepperHostProxy(supplier: () => CngxStepperHost | null): CngxStepperHost {\n return {\n // Core projection / state - empty / out-of-range when null. The array\n // fallbacks return the shared frozen EMPTY_NODES reference, so no `equal`\n // fn is needed: the output is reference-stable across reads (either the\n // supplier's own structural-equal signal value, or this one constant).\n stepTree: computed(() => supplier()?.stepTree() ?? EMPTY_NODES),\n flatSteps: computed(() => supplier()?.flatSteps() ?? EMPTY_NODES),\n stepsOnly: computed(() => supplier()?.stepsOnly() ?? EMPTY_NODES),\n visibleStripNodes: computed(() => supplier()?.visibleStripNodes() ?? EMPTY_NODES),\n activeStepIndex: computed(() => supplier()?.activeStepIndex() ?? -1),\n activeStepId: computed(() => supplier()?.activeStepId() ?? null),\n activeGroupId: computed(() => supplier()?.activeGroupId() ?? null),\n linear: computed(() => supplier()?.linear() ?? false),\n orientation: computed(() => supplier()?.orientation() ?? 'horizontal'),\n intendedStepIndex: computed(() => supplier()?.intendedStepIndex()),\n lastFailedIndex: computed(() => supplier()?.lastFailedIndex()),\n originIndexDuringCommit: computed(() => supplier()?.originIndexDuringCommit()),\n\n // Bounds + labels - the safety-critical canGo* pair collapses to\n // `false` so a null host yields disabled Back / Next, never clickable.\n stepCount: computed(() => supplier()?.stepCount() ?? 0),\n isFirstStep: computed(() => supplier()?.isFirstStep() ?? true),\n isLastStep: computed(() => supplier()?.isLastStep() ?? true),\n canGoPrevious: computed(() => supplier()?.canGoPrevious() ?? false),\n canGoNext: computed(() => supplier()?.canGoNext() ?? false),\n busy: computed(() => supplier()?.busy() ?? false),\n nextStepLabel: computed(() => supplier()?.nextStepLabel()),\n previousStepLabel: computed(() => supplier()?.previousStepLabel()),\n\n // Composite members delegate their sub-signals, idle when null. The\n // proxy only forwards - the real tracker is the presenter's, so build\n // the static neutral shape rather than calling createTransitionTracker.\n commitState: buildAsyncStateView<number | undefined>({\n status: computed(() => supplier()?.commitState.status() ?? 'idle'),\n data: computed(() => supplier()?.commitState.data()),\n error: computed(() => supplier()?.commitState.error()),\n lastUpdated: computed(() => supplier()?.commitState.lastUpdated()),\n }),\n commitTransition: {\n current: computed(() => supplier()?.commitTransition.current() ?? 'idle'),\n previous: computed(() => supplier()?.commitTransition.previous() ?? 'idle'),\n } satisfies StatusTransition,\n\n // Reachability predicate - neutral `false` when null so a header\n // over a missing host is never falsely navigable.\n canNavigateTo: (index: number) => supplier()?.canNavigateTo(index) ?? false,\n\n // Methods forward; no-op when null.\n select: (index: number) => supplier()?.select(index),\n selectNext: () => supplier()?.selectNext(),\n selectPrevious: () => supplier()?.selectPrevious(),\n selectById: (id: string) => supplier()?.selectById(id),\n reset: () => supplier()?.reset(),\n clearLastFailed: () => supplier()?.clearLastFailed(),\n register: (handle: CngxStepRegistration, parentId?: string | null) =>\n supplier()?.register(handle, parentId),\n unregister: (id: string) => supplier()?.unregister(id),\n };\n}\n","import {\n type EnvironmentProviders,\n isDevMode,\n makeEnvironmentProviders,\n type Provider,\n} from '@angular/core';\n\nimport { provideStepperI18n, type CngxStepperI18nFeature } from './i18n/stepper-i18n';\nimport {\n provideStepperConfig,\n provideStepperConfigAt,\n type CngxStepperConfigFeature,\n} from './stepper-config';\n\n/**\n * Union of every feature kind {@link provideCngxStepper} accepts. Today:\n * config (`CNGX_STEPPER_CONFIG`) and i18n (`CNGX_STEPPER_I18N`). Future\n * surfaces widen this union and dispatch via the hidden `_target`\n * discriminator.\n *\n * @category common/stepper\n */\nexport type CngxStepperFeature = CngxStepperConfigFeature | CngxStepperI18nFeature;\n\n/** @internal */\ninterface PartitionedFeatures {\n readonly config: CngxStepperConfigFeature[];\n readonly i18n: CngxStepperI18nFeature[];\n}\n\n/** @internal */\nfunction partitionFeatures(features: readonly CngxStepperFeature[]): PartitionedFeatures {\n const config: CngxStepperConfigFeature[] = [];\n const i18n: CngxStepperI18nFeature[] = [];\n for (const feat of features) {\n if (feat._target === 'i18n') {\n i18n.push(feat);\n continue;\n }\n if (feat._target === 'config') {\n config.push(feat);\n continue;\n }\n // Unbranded feature - drop + dev-warn (mirrors `provideCngxTabs`).\n if (isDevMode()) {\n console.warn(\n '[provideCngxStepper] Dropped feature without a `_target` ' +\n 'discriminator. Brand config-side mutators with ' +\n '`defineStepperConfigFeature(...)` (or use a `with*` helper) ' +\n 'and i18n-side mutators with `withStepperI18nLabels(...)`.',\n );\n }\n }\n return { config, i18n };\n}\n\n/**\n * Unified aggregator for the stepper family. Filters by `_target` and\n * forwards: config features to {@link provideStepperConfig}, i18n\n * features to {@link provideStepperI18n}. Mirrors `provideCngxTabs` /\n * `provideCngxSelect`.\n *\n * Returns {@link EnvironmentProviders} for app-root use; the\n * component-scoped twin {@link provideCngxStepperAt} returns\n * `Provider[]` because `viewProviders` cannot accept opaque\n * `EnvironmentProviders`.\n *\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideCngxStepper(\n * withStepperDefaultOrientation('vertical'),\n * withStepperLinear(true),\n * withStepperAriaLabels({ stepperRegion: 'Schrittfolge' }),\n * withStepperI18nLabels({ stepperLabel: 'Schrittfolge', previousStep: 'Vorheriger' }),\n * ),\n * ],\n * });\n * ```\n *\n * @category common/stepper\n */\nexport function provideCngxStepper(\n ...features: readonly CngxStepperFeature[]\n): EnvironmentProviders {\n const { config, i18n } = partitionFeatures(features);\n // `provideStepperConfig` returns EnvironmentProviders, `provideStepperI18n`\n // returns Provider - `makeEnvironmentProviders` takes both.\n return makeEnvironmentProviders([\n provideStepperConfig(...config),\n ...(i18n.length > 0 ? [provideStepperI18n(...i18n)] : []),\n ]);\n}\n\n/**\n * Component-scoped twin of {@link provideCngxStepper}. Spread into\n * `viewProviders` or `providers`. Same dispatch semantics - only the\n * provider scope differs.\n *\n * ```ts\n * @Component({\n * viewProviders: [\n * ...provideCngxStepperAt(\n * withStepperDefaultOrientation('vertical'),\n * withStepperI18nLabels({ stepperLabel: 'Schrittfolge' }),\n * ),\n * ],\n * })\n * ```\n *\n * @category common/stepper\n */\nexport function provideCngxStepperAt(...features: readonly CngxStepperFeature[]): Provider[] {\n const { config, i18n } = partitionFeatures(features);\n return [\n ...provideStepperConfigAt(...config),\n ...(i18n.length > 0 ? [provideStepperI18n(...i18n)] : []),\n ];\n}\n","/**\n * @module @cngx/common/stepper\n *\n * Level-2 directive-only logic for stepper / wizard flows. Ships the\n * presenter brain, atom directives, host tokens, router-sync, config\n * cascade, and i18n. Zero `@Component`, zero `.html`, zero `.css` -\n * those live in `@cngx/ui/stepper` (CNGX-standard skin) and\n * `@cngx/ui/mat-stepper` (Material twin).\n */\n\nexport {\n CngxStepperPresenter,\n type CngxStepperCommitAction,\n} from './presenter.directive';\n\nexport {\n CNGX_STEPPER_HOST,\n type CngxStepperHost,\n type CngxStepNode,\n type CngxStepRegistration,\n type CngxStepStatus,\n} from './stepper-host.token';\n\nexport {\n CNGX_STEP_GROUP_HOST,\n type CngxStepGroupHost,\n} from './step-group-host.token';\n\nexport {\n CNGX_STEP_PANEL_HOST,\n type CngxStepContentContext,\n type CngxStepLabelContext,\n type CngxStepPanelHost,\n} from './step-panel-host.token';\n\nexport { flatStepsEqual } from './step-tree.util';\n\nexport { CngxStep } from './step.directive';\nexport { CngxStepGroup } from './step-group.directive';\nexport { CngxStepLabel } from './step-label.directive';\nexport { CngxStepContent } from './step-content.directive';\n\nexport {\n CngxStepIndicator,\n type CngxStepIndicatorContext,\n} from './slots/step-indicator.directive';\n\nexport {\n CngxStepBadge,\n type CngxStepBadgeContext,\n} from './slots/step-badge.directive';\n\nexport {\n CngxStepBusySpinner,\n type CngxStepBusySpinnerContext,\n} from './slots/step-busy-spinner.directive';\n\nexport {\n CngxStepRejection,\n type CngxStepRejectionContext,\n} from './slots/step-rejection.directive';\n\nexport {\n CngxStepError,\n type CngxStepErrorContext,\n} from './slots/step-error.directive';\n\nexport {\n CngxStepGroupHeader,\n type CngxStepGroupHeaderContext,\n} from './slots/step-group-header.directive';\n\nexport { CngxStepperEmpty } from './slots/stepper-empty.directive';\n\nexport {\n CngxDotStepperDot,\n type CngxDotStepperDotContext,\n} from './slots/dot-stepper-dot.directive';\n\nexport {\n createStepperTemplateBindings,\n type CngxStepperTemplateBindings,\n type CngxStepperTemplateBindingsOptions,\n} from './slots/stepper-template-cascade';\n\nexport { CNGX_STEPPER_GLYPHS } from './glyphs';\n\nexport { CngxStepperRouterSync } from './router-sync.directive';\n\nexport {\n CNGX_STEPPER_CONFIG,\n type CngxStepperAriaLabels,\n type CngxStepperConfig,\n type CngxStepperConfigFeature,\n type CngxStepperDensity,\n type CngxStepperDensityBreakpoints,\n type CngxStepperFallbackLabels,\n type CngxStepperGroupCollapse,\n type CngxStepperGroupSummary,\n type CngxStepperHeaderNavigation,\n type CngxStepperMobileCollapse,\n type CngxStepperMobileIndicatorPosition,\n type CngxStepperSkin,\n type CngxStepperTemplates,\n injectStepperConfig,\n provideStepperConfig,\n provideStepperConfigAt,\n STEPPER_DEFAULT_DENSITY_BREAKPOINTS,\n STEPPER_DEFAULT_MOBILE_BREAKPOINT,\n withStepperDefaultOrientation,\n withStepperDensity,\n withStepperAriaLabels,\n withStepperCommitMode,\n withStepperConnectors,\n withStepperFallbackLabels,\n withStepperGroupCollapse,\n withStepperGroupCollapseSummary,\n withStepperHeaderNavigation,\n withStepperLinear,\n withStepperMobileBreakpoint,\n withStepperMobileCollapse,\n withStepperMobileIndicatorPosition,\n withStepperMobileSwipe,\n withStepperRouterSync,\n withStepperSkin,\n withStepIndicatorTemplate,\n withStepBadgeTemplate,\n withStepBusySpinnerTemplate,\n withStepRejectionTemplate,\n withStepErrorTemplate,\n withStepGroupHeaderTemplate,\n withStepperEmptyTemplate,\n withDotStepperDotTemplate,\n} from './stepper-config';\n\nexport {\n CNGX_STEPPER_I18N,\n type CngxStepperI18n,\n type CngxStepperI18nFeature,\n type CngxStepperI18nOverrides,\n type CngxStepperStatusLabels,\n injectStepperI18n,\n provideStepperI18n,\n withStepperI18nLabels,\n} from './i18n/stepper-i18n';\n\nexport { resolveStepperStatusLabel } from './status-label';\n\nexport {\n createMobileViewportSignal,\n createStepperDisplayMode,\n} from './mobile-viewport';\n\nexport {\n createStripDensity,\n type CngxStripDensity,\n type CngxStripDensityOptions,\n} from './strip-density';\n\nexport {\n createStepperGroupSummary,\n type CngxStepperGroupSummaryView,\n type CngxStepperGroupSummaryOptions,\n} from './group-summary';\n\nexport {\n createStepperGroupNavigation,\n type CngxStepperGroupNavigationView,\n type CngxStepperGroupNavigationOptions,\n} from './group-navigation';\n\n// The following three blocks ship `@internal` factory helpers. They are\n// exported through `public-api.ts` so the sibling `@cngx/ui/stepper`\n// organism can consume them across the secondary-entry boundary\n// (ng-packagr has no cross-entry private surface). `disableInternal: true`\n// in `.compodocrc.json` hides them from generated docs; the LLM-md export\n// honours the same tag. Precedent: `CNGX_STEPPER_GLYPHS`, `flatStepsEqual`.\nexport {\n createStepperHostAttrs,\n type CngxStepperHostAttrs,\n type CngxStepperHostAttrsInputs,\n} from './stepper-host-attrs';\n\nexport {\n createStepperStripKeyboardNav,\n type CngxStepperStripKeyboardNavOptions,\n} from './strip-keyboard-nav';\n\nexport {\n createStepperStateView,\n resolveStepperErrorSummary,\n type CngxStepperStateView,\n} from './stepper-state-view';\n\nexport {\n createStepperSlotContextBuilders,\n type CngxStepperSlotContextBuilders,\n type CngxStepperSlotContextBuildersInputs,\n} from './slot-context-builders';\n\nexport {\n createStepperAnnouncementBuilders,\n type CngxStepperAnnouncementBuilders,\n type CngxStepperAnnouncementBuildersInputs,\n} from './announcement-builders';\n\nexport { CngxStepperSwipeNav } from './swipe-nav.directive';\n\nexport { CngxStepperCount, type CngxStepperCountHost } from './stepper-count';\n\nexport { CngxStepperPrevious } from './controls/stepper-previous.directive';\nexport { CngxStepperNext } from './controls/stepper-next.directive';\nexport { CngxStepperComplete } from './controls/stepper-complete.directive';\nexport { createStepperHostProxy } from './create-stepper-host-proxy';\n\n\nexport {\n CNGX_STEPPER_COMMIT_HANDLER_FACTORY,\n type CngxStepperCommitHandler,\n type CngxStepperCommitHandlerFactory,\n type CngxStepperCommitHandlerOptions,\n createStepperCommitHandler,\n} from './commit-handler';\n\nexport {\n provideCngxStepper,\n provideCngxStepperAt,\n type CngxStepperFeature,\n} from './provide-cngx-stepper';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;AA6CA;;;;;;AAMG;AACG,SAAU,0BAA0B,CACxC,IAAqC,EAAA;AAErC,IAAA,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI;IAC3B,OAAO;QACL,YAAY,EAAE,UAAU,CAAC,YAAY;AAErC,QAAA,eAAe,CAAC,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAA;YACnD,UAAU,CAAC,KAAK,CACd,CAAC,QAAQ,KAAK,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,CAAC,EACpE,OAAO,EACP,SAAS,EACT;AACE,gBAAA,SAAS,EAAE,MAAM,SAAS,CAAC,IAAI,CAAC;AAChC,gBAAA,OAAO,EAAE,MAAM,SAAS,CAAC,KAAK,CAAC;AAChC,aAAA,CACF;QACH,CAAC;QAED,MAAM,GAAA;YACJ,UAAU,CAAC,MAAM,EAAE;QACrB,CAAC;KACF;AACH;AAEA;AACA,SAAS,gBAAgB,CACvB,MAA+B,EAC/B,SAAiB,EACjB,OAAe,EACf,QAGC,EAAA;IAED,IAAI,SAAS,GAAG,KAAK;IACrB,IAAI,WAAW,GAAwB,IAAI;AAE3C,IAAA,MAAM,WAAW,GAAG,CAAC,MAAe,KAAU;QAC5C,IAAI,SAAS,EAAE;YACb;QACF;QACA,IAAI,MAAM,EAAE;AACV,YAAA,QAAQ,CAAC,SAAS,CAAC,OAAO,CAAC;QA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