@cngx/ui 0.1.0-rc.7 → 0.1.0-rc.9

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.
Files changed (101) hide show
  1. package/README.md +0 -1
  2. package/a11y/README.md +11 -5
  3. package/accordion/README.md +4 -2
  4. package/breadcrumb/README.md +262 -0
  5. package/collection/README.md +6 -0
  6. package/command-palette/README.md +227 -0
  7. package/data-grid-accordion/README.md +76 -2
  8. package/feedback/README.md +40 -0
  9. package/fesm2022/cngx-ui-a11y.mjs +189 -57
  10. package/fesm2022/cngx-ui-a11y.mjs.map +1 -1
  11. package/fesm2022/cngx-ui-accordion.mjs +120 -36
  12. package/fesm2022/cngx-ui-accordion.mjs.map +1 -1
  13. package/fesm2022/cngx-ui-action-button.mjs +121 -56
  14. package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
  15. package/fesm2022/cngx-ui-breadcrumb.mjs +228 -108
  16. package/fesm2022/cngx-ui-breadcrumb.mjs.map +1 -1
  17. package/fesm2022/cngx-ui-chart-panel.mjs +180 -23
  18. package/fesm2022/cngx-ui-chart-panel.mjs.map +1 -1
  19. package/fesm2022/cngx-ui-collection.mjs +204 -62
  20. package/fesm2022/cngx-ui-collection.mjs.map +1 -1
  21. package/fesm2022/cngx-ui-command-palette.mjs +395 -119
  22. package/fesm2022/cngx-ui-command-palette.mjs.map +1 -1
  23. package/fesm2022/cngx-ui-context-menu.mjs +209 -40
  24. package/fesm2022/cngx-ui-context-menu.mjs.map +1 -1
  25. package/fesm2022/cngx-ui-data-grid-accordion.mjs +498 -101
  26. package/fesm2022/cngx-ui-data-grid-accordion.mjs.map +1 -1
  27. package/fesm2022/cngx-ui-empty-state.mjs +16 -6
  28. package/fesm2022/cngx-ui-empty-state.mjs.map +1 -1
  29. package/fesm2022/cngx-ui-feedback.mjs +1074 -460
  30. package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
  31. package/fesm2022/cngx-ui-mat-accordion.mjs +76 -7
  32. package/fesm2022/cngx-ui-mat-accordion.mjs.map +1 -1
  33. package/fesm2022/cngx-ui-mat-paginator.mjs +67 -24
  34. package/fesm2022/cngx-ui-mat-paginator.mjs.map +1 -1
  35. package/fesm2022/cngx-ui-mat-stepper.mjs +72 -47
  36. package/fesm2022/cngx-ui-mat-stepper.mjs.map +1 -1
  37. package/fesm2022/cngx-ui-mat-tabs.mjs +555 -204
  38. package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -1
  39. package/fesm2022/cngx-ui-overlay.mjs +69 -13
  40. package/fesm2022/cngx-ui-overlay.mjs.map +1 -1
  41. package/fesm2022/cngx-ui-paginator.mjs +553 -198
  42. package/fesm2022/cngx-ui-paginator.mjs.map +1 -1
  43. package/fesm2022/cngx-ui-sidenav.mjs +344 -109
  44. package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
  45. package/fesm2022/cngx-ui-skeleton.mjs +4 -16
  46. package/fesm2022/cngx-ui-skeleton.mjs.map +1 -1
  47. package/fesm2022/cngx-ui-speak.mjs +107 -8
  48. package/fesm2022/cngx-ui-speak.mjs.map +1 -1
  49. package/fesm2022/cngx-ui-stat-card.mjs +146 -46
  50. package/fesm2022/cngx-ui-stat-card.mjs.map +1 -1
  51. package/fesm2022/cngx-ui-stepper.mjs +234 -99
  52. package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
  53. package/fesm2022/cngx-ui-tabs.mjs +88 -25
  54. package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
  55. package/fesm2022/cngx-ui-timeline.mjs +98 -23
  56. package/fesm2022/cngx-ui-timeline.mjs.map +1 -1
  57. package/fesm2022/cngx-ui-toc.mjs +101 -33
  58. package/fesm2022/cngx-ui-toc.mjs.map +1 -1
  59. package/fesm2022/cngx-ui.mjs +15 -20
  60. package/fesm2022/cngx-ui.mjs.map +1 -1
  61. package/mat-paginator/README.md +9 -2
  62. package/mat-tabs/README.md +30 -6
  63. package/mat-tabs/styles/mat-tabs.css +188 -42
  64. package/overlay/README.md +9 -4
  65. package/package.json +31 -7
  66. package/paginator/README.md +8 -4
  67. package/schematics/collection.json +9 -0
  68. package/schematics/ng-add/index.js +9 -0
  69. package/schematics/ng-add/schema.json +91 -0
  70. package/schematics/package.json +3 -0
  71. package/sidenav/README.md +33 -11
  72. package/speak/README.md +3 -2
  73. package/stepper/README.md +14 -2
  74. package/timeline/README.md +1 -1
  75. package/toc/README.md +4 -1
  76. package/types/cngx-ui-a11y.d.ts +121 -30
  77. package/types/cngx-ui-accordion.d.ts +100 -28
  78. package/types/cngx-ui-action-button.d.ts +44 -3
  79. package/types/cngx-ui-breadcrumb.d.ts +167 -60
  80. package/types/cngx-ui-chart-panel.d.ts +122 -18
  81. package/types/cngx-ui-collection.d.ts +157 -55
  82. package/types/cngx-ui-command-palette.d.ts +297 -183
  83. package/types/cngx-ui-context-menu.d.ts +140 -10
  84. package/types/cngx-ui-data-grid-accordion.d.ts +278 -39
  85. package/types/cngx-ui-empty-state.d.ts +9 -2
  86. package/types/cngx-ui-feedback.d.ts +605 -59
  87. package/types/cngx-ui-mat-accordion.d.ts +30 -1
  88. package/types/cngx-ui-mat-paginator.d.ts +37 -8
  89. package/types/cngx-ui-mat-stepper.d.ts +23 -11
  90. package/types/cngx-ui-mat-tabs.d.ts +250 -34
  91. package/types/cngx-ui-overlay.d.ts +56 -10
  92. package/types/cngx-ui-paginator.d.ts +425 -136
  93. package/types/cngx-ui-sidenav.d.ts +248 -74
  94. package/types/cngx-ui-skeleton.d.ts +6 -7
  95. package/types/cngx-ui-speak.d.ts +118 -5
  96. package/types/cngx-ui-stat-card.d.ts +117 -33
  97. package/types/cngx-ui-stepper.d.ts +88 -49
  98. package/types/cngx-ui-tabs.d.ts +6 -4
  99. package/types/cngx-ui-timeline.d.ts +35 -11
  100. package/types/cngx-ui-toc.d.ts +93 -16
  101. package/types/cngx-ui.d.ts +7 -4
@@ -1 +1 @@
1
- {"version":3,"file":"cngx-ui-mat-tabs.mjs","sources":["../../../projects/ui/mat-tabs/material-bridge/private-surfaces.ts","../../../projects/ui/mat-tabs/decorations/decoration-projectors.ts","../../../projects/ui/mat-tabs/decorations/aggregated-error-tabs.ts","../../../projects/ui/mat-tabs/decorations/half-wired-slot-sink.ts","../../../projects/ui/mat-tabs/mat-tabs-config.ts","../../../projects/ui/mat-tabs/decorations/mat-tab-aggregator-content.directive.ts","../../../projects/ui/mat-tabs/decorations/mat-tab-rejection-content.directive.ts","../../../projects/ui/mat-tabs/decorations/live-region.ts","../../../projects/ui/mat-tabs/decorations/rejection-state.ts","../../../projects/ui/mat-tabs/material-bridge/handle.ts","../../../projects/ui/mat-tabs/mat-tabs-registry.directive.ts","../../../projects/ui/mat-tabs/overflow/mat-tab-overflow-dom-adapter.ts","../../../projects/ui/mat-tabs/mat-tabs.directive.ts","../../../projects/ui/mat-tabs/mat-tab-nav.directive.ts","../../../projects/ui/mat-tabs/mat-tab-link.directive.ts","../../../projects/ui/mat-tabs/mat-tab-error.directive.ts","../../../projects/ui/mat-tabs/mat-tab-error-flag.directive.ts","../../../projects/ui/mat-tabs/public-api.ts","../../../projects/ui/mat-tabs/cngx-ui-mat-tabs.ts"],"sourcesContent":["/**\n * Centralised type façade and selector constants for every Angular\n * Material internal surface cngx Material-bridge code couples to.\n * Replaces the per-call-site `as unknown as { _foo? }` casts and\n * the scattered `'.mat-mdc-tab*'` string literals with a single\n * grep target.\n *\n * Every leading-underscore field cngx reaches into and every\n * Material-internal CSS selector cngx queries against has its\n * declaration here. A Material-version upgrade audit only needs to\n * grep this file. The grep value is the consumer-facing benefit, so\n * this namespace is part of the published surface of\n * `@cngx/ui/mat-tabs` (re-exported from the package barrel) rather\n * than a private implementation detail.\n *\n * The grouping uses a TypeScript `namespace` so a single\n * `MaterialPrivateSurfaces.<member>` access path covers both the\n * type façades and the selector constants. The TS namespace also\n * lets cross-package consumers (`@cngx/ui/mat-stepper`) read the\n * grouped name through ESLint's `@typescript-eslint` type resolver\n * - a flat `export * as` re-export from `public-api.ts` does not\n * resolve nested members through the path-alias.\n *\n * @category ui/mat-tabs\n */\n\nimport type { TemplateRef, WritableSignal } from '@angular/core';\nimport type { MatStepperIconContext } from '@angular/material/stepper';\nimport type { Subject } from 'rxjs';\n\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace MaterialPrivateSurfaces {\n /**\n * Subset of Material's `MatTab` carrying the `_stateChanges`\n * Subject. The leading underscore signals\n * Material-internal-by-convention, even though the field is\n * `readonly` on the public class surface. The Subject emits\n * `void` whenever a `MatTab` input (`textLabel`, `disabled`, …)\n * changes; cngx bridges it into the Signal graph via\n * `toSignal(matTab._stateChanges)` because Material exposes no\n * public reactive surface for input changes.\n */\n export interface StateChangeSource {\n readonly _stateChanges: Subject<void>;\n }\n\n /**\n * Subset of Material's `MatStepper` carrying the `_iconOverrides`\n * map. `<cngx-mat-stepper>` patches this map inside\n * `afterNextRender` to forward consumer-projected\n * `<ng-template matStepperIcon>` declarations through the wrapper\n * into Material's per-header indicator bindings (the only\n * deterministic forwarding path - `<ng-content>` projection\n * inside `<mat-stepper>` does not reach\n * `@ContentChildren(MatStepperIcon)` due to content-init\n * lifecycle ordering).\n */\n export interface IconOverrideHost {\n _iconOverrides?: Record<string, TemplateRef<MatStepperIconContext>>;\n }\n\n /**\n * Subset of CDK's `CdkStep` carrying the `_completedOverride`\n * `WritableSignal`. `MatStep.completed`'s getter reads this\n * signal, so cngx's per-step `state` computed transitively tracks\n * it through the getter and re-fires whenever Material flips\n * completion. Documented limitation: `hasError` writes that are\n * not paired with a `completed` change do not retrigger the\n * computed - sharper note lives on `createMatStepHandle`'s JSDoc.\n */\n export interface CompletedOverrideSource {\n readonly _completedOverride: WritableSignal<boolean | null>;\n }\n\n /**\n * `.mat-mdc-tab` - the class Material applies to the rendered\n * tab `<button>` elements inside `MatTabHeader`. cngx\n * index-correlates `presenter.tabs()` registration order against\n * `host.querySelectorAll('.mat-mdc-tab')` because `MatTab` is a\n * portal - the rendered buttons live inside `MatTabHeader`'s\n * template, not on the `<mat-tab>` declaration site, and Material\n * exposes no public per-tab element accessor.\n */\n export const MAT_MDC_TAB_SELECTOR = '.mat-mdc-tab';\n\n /**\n * `.mat-mdc-tab-header` - the strip element rendered by\n * `MatTabHeader`. `[cngxMatTabs]` walks\n * `host.querySelector('.mat-mdc-tab-header')` to locate the mount\n * anchor for the cngx overflow molecule (so the More button pins\n * inside Material's strip rather than as a sibling of\n * `<mat-tab-group>`).\n */\n export const MAT_MDC_TAB_HEADER_SELECTOR = '.mat-mdc-tab-header';\n\n /**\n * `.mat-mdc-tab-label-container` - Material's IO-friendly scroll\n * viewport ancestor of the rendered tab buttons. The Material-\n * twin overflow adapter walks `host → header → any tab → closest\n * label-container` to attach the molecule's\n * `IntersectionObserver` against the same element Material\n * itself scrolls.\n */\n export const MAT_MDC_TAB_LABEL_CONTAINER_SELECTOR =\n '.mat-mdc-tab-label-container';\n}\n","import {\n afterNextRender,\n type DestroyRef,\n effect,\n type EmbeddedViewRef,\n type Injector,\n isDevMode,\n type Renderer2,\n runInInjectionContext,\n type Signal,\n type TemplateRef,\n untracked,\n type ViewContainerRef,\n} from '@angular/core';\n\nimport type { CngxMatTabAggregatorContentContext } from './mat-tab-aggregator-content.directive';\nimport type { CngxMatTabRejectionContentContext } from './mat-tab-rejection-content.directive';\nimport { MaterialPrivateSurfaces } from '../material-bridge/private-surfaces';\n\n/**\n * Package-private DOM-mutation projectors for `[cngxMatTabs]`.\n *\n * - {@link createMatTabRejectionDecoration} - mirrors\n * `presenter.lastFailedIndex` onto the matching `.mat-mdc-tab` as a\n * class flag plus a hidden `cngx-sr-only` descriptor span linked via\n * `aria-describedby`. `aria-invalid` is intentionally absent: ARIA\n * 1.2 scopes it to form-field vocabulary, not `role=\"tab\"`.\n * - {@link createMatTabAggregatorDecoration} - projects each handle's\n * `shouldShow()` flag onto the matching button as a class +\n * descriptor span pair, same `aria-describedby` token-append pattern.\n *\n * Distinct descriptor-id suffixes (`-rejected` vs `-errors`) let both\n * projectors stack on the same target without collision; the shared\n * token-list append preserves consumer-supplied tokens.\n *\n * @internal package-private - consumers bind `[cngxMatTabError]` on\n * each `<mat-tab>`; the directive owns the projection mechanics.\n */\n\n/**\n * Diff-restore the `aria-describedby` token list after a decoration's\n * descriptor span detaches - drops the decoration's own id token from\n * the live attribute, leaving any third-party tokens written between\n * apply and clear (tooltip refs, Material's own runtime additions)\n * intact. Treats the attribute as a token-set per the cngx ARIA-by-value\n * rule, not as a single-owner string.\n *\n * Empty-result + originally-absent attribute removes the attribute\n * entirely - a dangling `aria-describedby=\"\"` would be a malformed\n * reference in some AT readers.\n *\n * @internal\n */\nfunction restoreAriaDescribedbyExceptToken(\n el: HTMLElement,\n tokenToRemove: string,\n renderer: Renderer2,\n priorAriaDescribedby: string | null,\n): void {\n const current = el.getAttribute('aria-describedby');\n const tokens = current ? current.split(/\\s+/).filter(Boolean) : [];\n const remaining = tokens.filter((t) => t !== tokenToRemove);\n if (remaining.length === 0) {\n if (priorAriaDescribedby === null) {\n renderer.removeAttribute(el, 'aria-describedby');\n } else {\n renderer.setAttribute(el, 'aria-describedby', priorAriaDescribedby);\n }\n return;\n }\n renderer.setAttribute(el, 'aria-describedby', remaining.join(' '));\n}\n\n/**\n * Options for {@link createMatTabRejectionDecoration}.\n */\nexport interface CngxMatTabRejectionDecorationOptions {\n /** Host element whose subtree contains the `.mat-mdc-tab` buttons. */\n readonly hostEl: HTMLElement;\n /**\n * Stable id of the currently-failed target, or `null` when no\n * rejection is pinned. Sole effect-trigger; the descriptor span's\n * DOM id is `${failedHandleId}-rejected`.\n */\n readonly failedHandleId: Signal<string | null>;\n /**\n * Index of the currently-failed target - `undefined` when no\n * rejection is pinned. Read inside `untracked()` after\n * `failedHandleId` fires.\n */\n readonly failedIndex: Signal<number | undefined>;\n /**\n * Reactive descriptor phrase for the SR-only span. Typical\n * resolution at the caller: i18n `commitRolledBackTo(originLabel)`\n * when origin resolves, `commitFailedRetry` otherwise. A separate\n * effect tracks this signal so late label resolution mutates the\n * span in place rather than rebuilding it. Empty string keeps the\n * span mounted - `aria-describedby` must never dangle.\n */\n readonly descriptorText: Signal<string>;\n readonly renderer: Renderer2;\n readonly injector: Injector;\n readonly destroyRef: DestroyRef;\n /** Default: `.mat-mdc-tab`. Override only for testing. */\n readonly buttonSelector?: string;\n /** Default: `cngx-mat-tab--error`. */\n readonly className?: string;\n /** Default: `cngx-sr-only`. */\n readonly srOnlyClassName?: string;\n /**\n * Suffix appended to `failedHandleId` for the descriptor span's\n * DOM id. Default `'rejected'` - distinct from the aggregator\n * projector's `'errors'` so both can stack on the same target.\n */\n readonly descriptorIdSuffix?: string;\n /**\n * Optional `*cngxMatTabRejectionContent` slot template. When\n * non-null AND `viewContainerRef` is supplied, the projector\n * renders an embedded view into the SR span; otherwise it falls\n * back to the imperative `textContent` path.\n */\n readonly contentTemplate?: Signal<\n TemplateRef<CngxMatTabRejectionContentContext> | null\n >;\n /**\n * Required half of the slot path. Without it, the projector\n * silently degrades to the imperative descriptor path. Mirrors\n * the aggregator projector's same-name opt.\n */\n readonly viewContainerRef?: ViewContainerRef;\n /**\n * Reactive origin label feeding the slot context's `originLabel`.\n * Read inside `untracked()` during apply; the `descriptorText`\n * re-fire effect destroys + remounts the embedded view, so the\n * value is always read at fire time.\n */\n readonly originLabel?: Signal<string | undefined>;\n}\n\n/**\n * Mounts the sticky-rejection decoration projector. Class +\n * descriptor span follow `failedHandleId` reactively; cleared on\n * directive destroy. Single-target by contract (matches the\n * presenter's single-slot `lastFailedIndex`).\n *\n * Two effects split the work: one tracks `failedHandleId` and\n * mounts/unmounts the span; the other tracks `descriptorText` and\n * mutates `textContent` in place. The split keeps late label\n * resolution O(1) - no DOM rebuild when the origin label arrives\n * via a downstream `tabs()` re-emission.\n *\n * @internal\n */\nexport function createMatTabRejectionDecoration(\n opts: CngxMatTabRejectionDecorationOptions,\n): void {\n const buttonSelector =\n opts.buttonSelector ?? MaterialPrivateSurfaces.MAT_MDC_TAB_SELECTOR;\n const className = opts.className ?? 'cngx-mat-tab--error';\n const srOnlyClassName = opts.srOnlyClassName ?? 'cngx-sr-only';\n const descriptorIdSuffix = opts.descriptorIdSuffix ?? 'rejected';\n // Slot path needs both halves; either alone degrades to imperative\n // textContent. No diagnostic - single in-package consumer always\n // passes both.\n const slotEnabled = !!opts.contentTemplate && !!opts.viewContainerRef;\n let decoratedEl: HTMLElement | null = null;\n // Cached across the projector's lifetime - reusing the same node\n // keeps AT-reader / observer references live across A→B→A flips.\n let cachedSpan: HTMLElement | null = null;\n let priorAriaDescribedby: string | null = null;\n // Pillar 1 - short-circuits structurally-identical re-emissions of\n // `failedHandleId` so a `tabs()` re-eval doesn't clobber the AT\n // descriptor mid-flight.\n let lastAppliedId: string | null = null;\n let embeddedView:\n | EmbeddedViewRef<CngxMatTabRejectionContentContext>\n | undefined;\n\n const destroyEmbeddedView = (): void => {\n if (!embeddedView) {\n return;\n }\n embeddedView.destroy();\n embeddedView = undefined;\n if (cachedSpan) {\n while (cachedSpan.firstChild) {\n opts.renderer.removeChild(cachedSpan, cachedSpan.firstChild);\n }\n }\n };\n\n const writeDescriptorContent = (\n span: HTMLElement,\n handleId: string,\n text: string,\n ): void => {\n const tplSignal = opts.contentTemplate;\n const vcr = opts.viewContainerRef;\n const tpl = tplSignal && vcr ? tplSignal() : null;\n if (tpl && vcr) {\n destroyEmbeddedView();\n const context: CngxMatTabRejectionContentContext = {\n failedHandleId: handleId,\n originLabel: opts.originLabel?.(),\n fallbackText: text,\n };\n const view = vcr.createEmbeddedView(tpl, context, {\n injector: opts.injector,\n });\n // Force CD before moving rootNodes out of the embedded view's\n // logical parent - zoneless + OnPush would otherwise leave the\n // first SR read stale.\n view.detectChanges();\n for (const node of view.rootNodes) {\n opts.renderer.appendChild(span, node);\n }\n embeddedView = view;\n return;\n }\n // Imperative fallback - also covers the path where a slot was\n // previously bound and is now removed (destroy any prior view).\n destroyEmbeddedView();\n opts.renderer.setProperty(span, 'textContent', text);\n };\n\n const clearDecoration = (): void => {\n if (!decoratedEl || !cachedSpan) {\n return;\n }\n const ownTokenId = cachedSpan.id;\n destroyEmbeddedView();\n opts.renderer.removeClass(decoratedEl, className);\n opts.renderer.removeChild(decoratedEl, cachedSpan);\n // `cachedSpan` deliberately retained - reused on the next apply.\n restoreAriaDescribedbyExceptToken(\n decoratedEl,\n ownTokenId,\n opts.renderer,\n priorAriaDescribedby,\n );\n decoratedEl = null;\n priorAriaDescribedby = null;\n };\n\n const applyDecorationAt = (failedIdx: number, handleId: string): void => {\n clearDecoration();\n const buttons = opts.hostEl.querySelectorAll<HTMLElement>(buttonSelector);\n const targetEl = buttons.item(failedIdx);\n if (!targetEl) {\n return;\n }\n opts.renderer.addClass(targetEl, className);\n\n const spanId = `${handleId}-${descriptorIdSuffix}`;\n let span = cachedSpan;\n if (!span) {\n span = opts.renderer.createElement('span') as HTMLElement;\n opts.renderer.addClass(span, srOnlyClassName);\n cachedSpan = span;\n }\n // Always rewrite id + textContent - the cached span carries stale\n // values from the prior mount. The live-text effect below picks\n // up subsequent `descriptorText` changes in place.\n opts.renderer.setAttribute(span, 'id', spanId);\n opts.renderer.appendChild(targetEl, span);\n writeDescriptorContent(span, handleId, opts.descriptorText());\n\n // Renderer2 has no `getAttribute` counterpart - read off the\n // native element. Browser-only; SSR would need a platform adapter.\n const prior = targetEl.getAttribute('aria-describedby');\n const tokens = prior ? prior.split(/\\s+/).filter(Boolean) : [];\n if (!tokens.includes(spanId)) {\n tokens.push(spanId);\n }\n opts.renderer.setAttribute(targetEl, 'aria-describedby', tokens.join(' '));\n\n decoratedEl = targetEl;\n priorAriaDescribedby = prior;\n };\n\n runInInjectionContext(opts.injector, () => {\n effect(() => {\n const id = opts.failedHandleId();\n untracked(() => {\n if (id === lastAppliedId) {\n return;\n }\n if (id === null) {\n clearDecoration();\n lastAppliedId = null;\n return;\n }\n const idx = opts.failedIndex();\n if (idx === undefined) {\n clearDecoration();\n lastAppliedId = null;\n return;\n }\n applyDecorationAt(idx, id);\n lastAppliedId = id;\n });\n });\n\n // Live-text effect - tracks `descriptorText` plus the slot\n // template (when wired) so a late-mounted template re-renders\n // into the existing span. Mount-state checks live in untracked.\n effect(() => {\n const text = opts.descriptorText();\n const tplSignal = opts.contentTemplate;\n if (slotEnabled && tplSignal) {\n tplSignal();\n }\n untracked(() => {\n if (decoratedEl === null || cachedSpan === null) {\n return;\n }\n const id = opts.failedHandleId();\n if (id === null) {\n return;\n }\n writeDescriptorContent(cachedSpan, id, text);\n });\n });\n });\n\n opts.destroyRef.onDestroy(clearDecoration);\n}\n\n/**\n * One per-tab error-aggregator decoration entry. Caller pre-filters\n * to handles whose `shouldShow() === true`.\n *\n * `count` / `label` feed the optional `*cngxMatTabAggregatorContent`\n * slot context ({@link CngxMatTabAggregatorContentContext}); the\n * imperative-fallback path uses `announcement` only and ignores the\n * two extra fields. They stay on the shape so the contract is\n * uniform across render paths.\n */\nexport interface CngxMatTabAggregatorErrorEntry {\n readonly idx: number;\n readonly id: string;\n readonly announcement: string;\n /** Aggregated error count - feeds the slot context's `count` field. */\n readonly count: number;\n /** Resolved tab label - feeds the slot context's `label` field. */\n readonly label: string;\n}\n\n/**\n * Options for {@link createMatTabAggregatorDecoration}.\n */\nexport interface CngxMatTabAggregatorDecorationOptions {\n readonly hostEl: HTMLElement;\n /**\n * Reactive list of tabs whose bound aggregator wants reveal -\n * caller pre-filters; sole effect-trigger.\n */\n readonly errorTabs: Signal<readonly CngxMatTabAggregatorErrorEntry[]>;\n readonly renderer: Renderer2;\n readonly injector: Injector;\n readonly destroyRef: DestroyRef;\n /** Default: `.mat-mdc-tab`. Override only for testing. */\n readonly buttonSelector?: string;\n /** Default: `cngx-mat-tab--has-errors`. */\n readonly className?: string;\n /** Default: `cngx-sr-only`. */\n readonly srOnlyClassName?: string;\n /** Default: `5`. Cap on `afterNextRender` retry recursion. */\n readonly maxRetryAttempts?: number;\n /**\n * Optional dev-mode sink invoked when the retry ceiling is hit.\n * Defaults to a `console.warn` gated on `ngDevMode`.\n */\n readonly onMaxRetriesReached?: () => void;\n /**\n * Optional `*cngxMatTabAggregatorContent` template. When non-null\n * AND `viewContainerRef` is supplied, the projector renders an\n * embedded view per entry; otherwise it falls back to the\n * imperative `textContent` path.\n */\n readonly contentTemplate?: Signal<\n TemplateRef<CngxMatTabAggregatorContentContext> | null\n >;\n /**\n * Required half of the slot path. Without it, the projector\n * silently degrades to the imperative descriptor path.\n */\n readonly viewContainerRef?: ViewContainerRef;\n /**\n * Sink fired when exactly one of `contentTemplate` /\n * `viewContainerRef` is supplied - the projector is mode-agnostic\n * so the dev-vs-prod gate lives in whichever sink the caller\n * passes. `[cngxMatTabs]` resolves this from\n * `provideMatTabsConfig(withHalfWiredSlotSink(fn))`; the default\n * is a dev-mode `console.warn`.\n */\n readonly onHalfWiredSlot?: (\n missing: 'contentTemplate' | 'viewContainerRef',\n ) => void;\n}\n\n/**\n * Mounts the per-tab aggregator decoration projector. Class +\n * descriptor span + `aria-describedby` token follow `errorTabs`\n * reactively; pruned on entry drop and on directive destroy.\n *\n * Race recovery - when the effect fires before MatTabHeader has\n * rendered the matching buttons (initial-render race), schedules a\n * single `afterNextRender` retry, bounded by `maxRetryAttempts`.\n *\n * @internal\n */\nexport function createMatTabAggregatorDecoration(\n opts: CngxMatTabAggregatorDecorationOptions,\n): void {\n const buttonSelector =\n opts.buttonSelector ?? MaterialPrivateSurfaces.MAT_MDC_TAB_SELECTOR;\n const className = opts.className ?? 'cngx-mat-tab--has-errors';\n const srOnlyClassName = opts.srOnlyClassName ?? 'cngx-sr-only';\n const maxRetryAttempts = opts.maxRetryAttempts ?? 5;\n // Slot path needs both halves; either alone degrades to imperative\n // textContent. Re-evaluated per fire so a lazy-mounted template\n // (`*ngIf` / `@defer`) picks up on first materialisation.\n const isFullyWired = (): boolean =>\n !!opts.contentTemplate && !!opts.viewContainerRef;\n // Half-wired diagnostic - graceful degradation hides the mistake\n // at runtime, so the signal has to come from a deliberate sink.\n if (!isFullyWired() && (opts.contentTemplate || opts.viewContainerRef)) {\n const missing: 'contentTemplate' | 'viewContainerRef' =\n opts.contentTemplate ? 'viewContainerRef' : 'contentTemplate';\n const sink = opts.onHalfWiredSlot ?? defaultHalfWiredSlotWarn;\n sink(missing);\n }\n\n const decorated = new Map<\n string,\n {\n el: HTMLElement;\n descriptorSpan: HTMLElement;\n priorAriaDescribedby: string | null;\n /**\n * Embedded view rendered from `contentTemplate` when bound.\n * Owned by the entry so re-decorations can destroy the prior\n * view before mounting a fresh one (every signal-driven\n * context update goes through destroy + remount; embedded\n * views do not expose a context-mutation API in the\n * standalone-component world that doesn't risk stale\n * `let-` bindings).\n */\n embeddedView?: EmbeddedViewRef<CngxMatTabAggregatorContentContext>;\n }\n >();\n let pendingRetry = false;\n let retryAttempts = 0;\n\n const destroyEmbeddedView = (entry: {\n descriptorSpan: HTMLElement;\n embeddedView?: EmbeddedViewRef<CngxMatTabAggregatorContentContext>;\n }): void => {\n if (!entry.embeddedView) {\n return;\n }\n entry.embeddedView.destroy();\n entry.embeddedView = undefined;\n // The rendered nodes live under the descriptor span via appendChild;\n // EmbeddedViewRef.destroy() does not detach them, so clear manually.\n while (entry.descriptorSpan.firstChild) {\n opts.renderer.removeChild(\n entry.descriptorSpan,\n entry.descriptorSpan.firstChild,\n );\n }\n };\n\n const writeDescriptorContent = (\n entry: {\n descriptorSpan: HTMLElement;\n embeddedView?: EmbeddedViewRef<CngxMatTabAggregatorContentContext>;\n },\n announcement: string,\n context: CngxMatTabAggregatorContentContext,\n ): void => {\n const tplSignal = opts.contentTemplate;\n const vcr = opts.viewContainerRef;\n const tpl = tplSignal && vcr ? tplSignal() : null;\n if (tpl && vcr) {\n destroyEmbeddedView(entry);\n const view = vcr.createEmbeddedView(tpl, context, {\n injector: opts.injector,\n });\n // See the rejection projector's identical call site for the\n // detached-view CD rationale (rootNodes move out of the\n // embedded view's logical parent into an SR-only span).\n view.detectChanges();\n for (const node of view.rootNodes) {\n opts.renderer.appendChild(entry.descriptorSpan, node);\n }\n entry.embeddedView = view;\n return;\n }\n // Imperative fallback - also covers the path where a slot was\n // previously bound and is now removed (destroy any prior view).\n destroyEmbeddedView(entry);\n opts.renderer.setProperty(\n entry.descriptorSpan,\n 'textContent',\n announcement,\n );\n };\n\n const removeDecoration = (id: string): void => {\n const entry = decorated.get(id);\n if (!entry) {\n return;\n }\n const ownTokenId = entry.descriptorSpan.id;\n destroyEmbeddedView(entry);\n opts.renderer.removeClass(entry.el, className);\n opts.renderer.removeChild(entry.el, entry.descriptorSpan);\n restoreAriaDescribedbyExceptToken(\n entry.el,\n ownTokenId,\n opts.renderer,\n entry.priorAriaDescribedby,\n );\n decorated.delete(id);\n };\n\n const applyDecoration = (\n targetEl: HTMLElement,\n entry: CngxMatTabAggregatorErrorEntry,\n ): void => {\n opts.renderer.addClass(targetEl, className);\n\n const spanId = `${entry.id}-errors`;\n const descriptorSpan = opts.renderer.createElement('span') as HTMLElement;\n opts.renderer.addClass(descriptorSpan, srOnlyClassName);\n opts.renderer.setAttribute(descriptorSpan, 'id', spanId);\n opts.renderer.appendChild(targetEl, descriptorSpan);\n\n // See the read-via-nativeElement note in `applyDecorationAt` above -\n // Renderer2 has no `getAttribute` counterpart, so attribute reads\n // go through the native element directly.\n const priorAriaDescribedby = targetEl.getAttribute('aria-describedby');\n const tokens = priorAriaDescribedby\n ? priorAriaDescribedby.split(/\\s+/).filter(Boolean)\n : [];\n if (!tokens.includes(spanId)) {\n tokens.push(spanId);\n }\n opts.renderer.setAttribute(targetEl, 'aria-describedby', tokens.join(' '));\n\n const decoratedEntry: {\n el: HTMLElement;\n descriptorSpan: HTMLElement;\n priorAriaDescribedby: string | null;\n embeddedView?: EmbeddedViewRef<CngxMatTabAggregatorContentContext>;\n } = { el: targetEl, descriptorSpan, priorAriaDescribedby };\n writeDescriptorContent(decoratedEntry, entry.announcement, {\n count: entry.count,\n label: entry.label,\n announcement: entry.announcement,\n });\n decorated.set(entry.id, decoratedEntry);\n };\n\n const sync = (\n errorTabs: readonly CngxMatTabAggregatorErrorEntry[],\n ): void => {\n const liveIds = new Set<string>();\n for (const t of errorTabs) {\n liveIds.add(t.id);\n }\n for (const id of Array.from(decorated.keys())) {\n if (!liveIds.has(id)) {\n removeDecoration(id);\n }\n }\n const buttons = opts.hostEl.querySelectorAll<HTMLElement>(buttonSelector);\n let needsRetry = false;\n for (const entry of errorTabs) {\n const targetEl = buttons.item(entry.idx);\n if (!targetEl) {\n needsRetry = true;\n continue;\n }\n const existing = decorated.get(entry.id);\n if (existing?.el === targetEl) {\n // Same target element: refresh content (slot path destroys +\n // remounts the embedded view; imperative path overwrites the\n // textContent property idempotently).\n writeDescriptorContent(existing, entry.announcement, {\n count: entry.count,\n label: entry.label,\n announcement: entry.announcement,\n });\n continue;\n }\n if (existing) {\n removeDecoration(entry.id);\n }\n applyDecoration(targetEl, entry);\n }\n\n if (!needsRetry) {\n retryAttempts = 0;\n return;\n }\n if (pendingRetry) {\n return;\n }\n if (retryAttempts >= maxRetryAttempts) {\n retryAttempts = 0;\n const sink =\n opts.onMaxRetriesReached ?? defaultRetryCeilingWarn(maxRetryAttempts);\n sink();\n return;\n }\n pendingRetry = true;\n retryAttempts++;\n afterNextRender(\n () => {\n pendingRetry = false;\n sync(opts.errorTabs());\n },\n { injector: opts.injector },\n );\n };\n\n runInInjectionContext(opts.injector, () => {\n effect(() => {\n // Track the slot template alongside `errorTabs` so a runtime\n // project/remove of `*cngxMatTabAggregatorContent` switches\n // every decorated entry between render paths.\n const errorTabs = opts.errorTabs();\n if (isFullyWired() && opts.contentTemplate) {\n opts.contentTemplate();\n }\n untracked(() => sync(errorTabs));\n });\n });\n\n opts.destroyRef.onDestroy(() => {\n for (const id of Array.from(decorated.keys())) {\n removeDecoration(id);\n }\n });\n}\n\nfunction defaultHalfWiredSlotWarn(\n missing: 'contentTemplate' | 'viewContainerRef',\n): void {\n if (!isDevMode()) {\n return;\n }\n console.warn(\n '[cngxMatTabs] aggregator-content slot half-wired - ' +\n `\\`${missing}\\` is missing while the other half is supplied. ` +\n 'The decoration projector will silently fall back to the ' +\n 'imperative `textContent` path, and the consumer-projected ' +\n '`*cngxMatTabAggregatorContent` template will never render. ' +\n 'Wire both halves on the [cngxMatTabs] directive (or neither).',\n );\n}\n\nfunction defaultRetryCeilingWarn(max: number): () => void {\n return () => {\n if (!isDevMode()) {\n return;\n }\n console.warn(\n '[cngxMatTabs] aggregator decoration retry ceiling reached ' +\n `(${max} attempts) - MatTabHeader did not render ` +\n '`.mat-mdc-tab` buttons within the expected window. Likely ' +\n 'cause: Material upgrade broke the `.mat-mdc-tab` selector ' +\n 'contract or a consumer-side render stall. ' +\n 'Bound aggregators may remain visually undecorated ' +\n 'until the next state change.',\n );\n };\n}\n","import { computed, type Signal } from '@angular/core';\n\nimport type { CngxTabGroupHost } from '@cngx/common/tabs';\n\nimport type { CngxMatTabAggregatorErrorEntry } from './decoration-projectors';\n\n/**\n * Builds the reactive list of tabs whose bound error-aggregator wants\n * reveal, in registration (DOM) order. Feeds\n * {@link createMatTabAggregatorDecoration} for both the\n * `[cngxMatTabs]` (`<mat-tab-group>`) and `[cngxMatTabNav]`\n * (`<nav mat-tab-nav-bar>`) bridges - one body, two hosts (Pillar 3).\n *\n * Structural `equal` drops re-runs whose entry list is shape-identical\n * so the projector does not churn on no-op aggregator re-emissions.\n *\n * @internal\n */\nexport function createAggregatedErrorTabs(\n presenter: CngxTabGroupHost,\n): Signal<readonly CngxMatTabAggregatorErrorEntry[]> {\n return computed<readonly CngxMatTabAggregatorErrorEntry[]>(\n () => {\n const tabs = presenter.tabs();\n const acc: CngxMatTabAggregatorErrorEntry[] = [];\n for (let i = 0; i < tabs.length; i++) {\n const handle = tabs[i];\n const aggregator = handle.errorAggregator();\n if (aggregator?.shouldShow()) {\n acc.push({\n idx: i,\n id: handle.id,\n announcement: aggregator.announcement(),\n count: aggregator.errorCount(),\n label: handle.label() ?? '',\n });\n }\n }\n return acc;\n },\n {\n equal: (a, b) => {\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (\n a[i].idx !== b[i].idx ||\n a[i].id !== b[i].id ||\n a[i].announcement !== b[i].announcement ||\n a[i].count !== b[i].count ||\n a[i].label !== b[i].label\n ) {\n return false;\n }\n }\n return true;\n },\n },\n );\n}\n","import { isDevMode } from '@angular/core';\n\n/**\n * Sink callback invoked by `[cngxMatTabs]`'s aggregator-decoration\n * projector when a consumer wires exactly one of\n * `*cngxMatTabAggregatorContent` (the slot template) or\n * `ViewContainerRef` (the embedded-view host) - the half-wired-slot\n * misconfiguration. The projector silently falls back to the\n * imperative `textContent` path when this happens; the sink is the\n * only deliberate signal that the consumer's slot template will not\n * render.\n *\n * Override via `provideMatTabsConfig(withHalfWiredSlotSink(fn))` to\n * wire production telemetry (Sentry breadcrumbs, custom logger, CI\n * fail-fast). The library default is a dev-mode `console.warn`; the\n * exported {@link CNGX_DEFAULT_HALF_WIRED_SLOT_SINK} value lets test\n * doubles compose against a stable reference.\n *\n * @category ui/mat-tabs\n */\nexport type CngxMatTabHalfWiredSlotSink = (\n missing: 'contentTemplate' | 'viewContainerRef',\n) => void;\n\n/**\n * Default sink - gated on dev-mode. Production callers see no\n * output; production telemetry lands only when a consumer overrides\n * via `withHalfWiredSlotSink(fn)`.\n *\n * @internal - exported only for {@link CngxMatTabsConfig.halfWiredSlotSink}'s\n * library default. Consumers should override via the config feature\n * rather than reach for this reference directly.\n */\nexport const CNGX_DEFAULT_HALF_WIRED_SLOT_SINK: CngxMatTabHalfWiredSlotSink = (\n missing,\n) => {\n if (!isDevMode()) {\n return;\n }\n console.warn(\n '[cngxMatTabs] aggregator-content slot half-wired - ' +\n `\\`${missing}\\` is missing while the other half is supplied. ` +\n 'The decoration projector will silently fall back to the ' +\n 'imperative `textContent` path, and the consumer-projected ' +\n '`*cngxMatTabAggregatorContent` template will never render. ' +\n 'Wire both halves on the [cngxMatTabs] directive (or neither).',\n );\n};\n","import {\n type EnvironmentProviders,\n inject,\n InjectionToken,\n makeEnvironmentProviders,\n type Provider,\n} from '@angular/core';\n\nimport {\n type CngxMatTabHalfWiredSlotSink,\n CNGX_DEFAULT_HALF_WIRED_SLOT_SINK,\n} from './decorations/half-wired-slot-sink';\n\n/**\n * Behaviour knobs for `[cngxMatTabs]`. Single canonical surface\n * symmetric to `provideSelectConfig` in the select family - every\n * tunable is a `with*` feature on the same aggregator instead of\n * a standalone DI token, so consumers configure the directive\n * through one entry point and the API surface stays small.\n *\n * Per-instance Inputs win over `provideMatTabsConfigAt(...)`\n * (component scope), which wins over `provideMatTabsConfig(...)`\n * (root), which wins over the library defaults captured by\n * {@link CNGX_MAT_TABS_CONFIG_DEFAULTS}.\n *\n * @category ui/mat-tabs\n */\nexport interface CngxMatTabsConfig {\n /**\n * Cap on the `[cngxMatTabs]` overflow-anchor retry loop. The\n * directive runs `createDomAnchorRetry` on every `afterNextRender`\n * until `.mat-mdc-tab-header` materialises in the host subtree;\n * the cap exists so a never-rendered host (e.g. `<mat-tab-group>`\n * gated behind a never-true `*ngIf` / `@defer`) does not re-arm\n * forever.\n *\n * Default: `5` - well above normal Material render lag (a single\n * `afterNextRender` is enough on every supported version), low\n * enough to surface a dev-mode `console.warn` promptly when the\n * consumer DOM never appears.\n *\n * Note: `<cngx-tab-overflow>`'s own attach loop uses `60` rAF\n * frames, not `5` - different scheduler, different budget. The\n * two caps are intentionally independent because the underlying\n * timing primitives differ; a shared \"anchor max attempts\" knob\n * would conflate one frame of `afterNextRender` with one rAF\n * frame, which they are not.\n */\n readonly anchorMaxAttempts?: number;\n\n /**\n * Diagnostic sink invoked when a consumer wires exactly one of\n * `*cngxMatTabAggregatorContent` or its `ViewContainerRef`.\n * Default is a dev-mode `console.warn`; override via\n * {@link withHalfWiredSlotSink} to wire production telemetry\n * (Sentry breadcrumbs, custom logger, CI fail-fast).\n */\n readonly halfWiredSlotSink?: CngxMatTabHalfWiredSlotSink;\n}\n\n/**\n * Library defaults for `[cngxMatTabs]`. Source of truth for every\n * key on {@link CngxMatTabsConfig}. Consumed by\n * {@link injectMatTabsConfig} as the final fallback.\n *\n * @internal\n */\nexport const CNGX_MAT_TABS_CONFIG_DEFAULTS = {\n anchorMaxAttempts: 5,\n halfWiredSlotSink: CNGX_DEFAULT_HALF_WIRED_SLOT_SINK,\n} as const satisfies Required<CngxMatTabsConfig>;\n\n/**\n * DI token holding a partial {@link CngxMatTabsConfig}. Set via\n * {@link provideMatTabsConfig} (app-wide) or\n * {@link provideMatTabsConfigAt} (component scope). Read via\n * {@link injectMatTabsConfig}, which merges with the library\n * defaults so callers never see `undefined`.\n *\n * @category ui/mat-tabs\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/mat-tabs-config.ts\n * @since 0.1.0\n */\nexport const CNGX_MAT_TABS_CONFIG = new InjectionToken<CngxMatTabsConfig>('CngxMatTabsConfig');\n\n/**\n * Feature object returned by `with*` mat-tabs functions and consumed\n * by {@link provideMatTabsConfig} / {@link provideMatTabsConfigAt}.\n * The optional `_target` discriminator is reserved for a future\n * cross-family aggregator (`provideCngxMatTabs`) that dispatches\n * features to the right provider - analogous to `_target: 'select'`\n * in the select family.\n *\n * @category ui/mat-tabs\n */\nexport interface CngxMatTabsConfigFeature {\n readonly config: Partial<CngxMatTabsConfig>;\n /** @internal */\n readonly _target?: 'mat-tabs';\n}\n\nfunction feature(config: Partial<CngxMatTabsConfig>): CngxMatTabsConfigFeature {\n return { config, _target: 'mat-tabs' };\n}\n\n/**\n * Cap on the `[cngxMatTabs]` overflow-anchor retry loop.\n * See {@link CngxMatTabsConfig.anchorMaxAttempts} for default + rationale.\n *\n * @category ui/mat-tabs\n */\nexport function withAnchorRetryAttempts(n: number): CngxMatTabsConfigFeature {\n return feature({ anchorMaxAttempts: n });\n}\n\n/**\n * Override the half-wired-slot diagnostic sink.\n * See {@link CngxMatTabsConfig.halfWiredSlotSink}.\n *\n * @category ui/mat-tabs\n */\nexport function withHalfWiredSlotSink(sink: CngxMatTabHalfWiredSlotSink): CngxMatTabsConfigFeature {\n return feature({ halfWiredSlotSink: sink });\n}\n\nfunction mergeFeatures(features: readonly CngxMatTabsConfigFeature[]): Partial<CngxMatTabsConfig> {\n const merged: {\n -readonly [K in keyof CngxMatTabsConfig]?: CngxMatTabsConfig[K];\n } = {};\n for (const f of features) {\n Object.assign(merged, f.config);\n }\n return merged;\n}\n\n/**\n * App-wide `[cngxMatTabs]` configuration. Returns\n * `EnvironmentProviders` for use inside `bootstrapApplication`'s\n * `providers` array.\n *\n * ```ts\n * bootstrapApplication(App, {\n * providers: [\n * provideMatTabsConfig(\n * withAnchorRetryAttempts(10),\n * withHalfWiredSlotSink((missing) => Sentry.captureMessage(`half-wired ${missing}`)),\n * ),\n * ],\n * });\n * ```\n *\n * @category ui/mat-tabs\n */\nexport function provideMatTabsConfig(\n ...features: CngxMatTabsConfigFeature[]\n): EnvironmentProviders {\n return makeEnvironmentProviders([\n { provide: CNGX_MAT_TABS_CONFIG, useValue: mergeFeatures(features) },\n ]);\n}\n\n/**\n * Component-scope `[cngxMatTabs]` configuration. Returns a\n * `Provider[]` so the result can be spread into a component's\n * `providers` or `viewProviders` (which cannot accept opaque\n * environment providers).\n *\n * ```ts\n * @Component({\n * selector: 'app-tabs-page',\n * viewProviders: [\n * ...provideMatTabsConfigAt(withAnchorRetryAttempts(20)),\n * ],\n * ...\n * })\n * ```\n *\n * @category ui/mat-tabs\n */\nexport function provideMatTabsConfigAt(...features: CngxMatTabsConfigFeature[]): Provider[] {\n return [{ provide: CNGX_MAT_TABS_CONFIG, useValue: mergeFeatures(features) }];\n}\n\n/**\n * Resolve the effective `[cngxMatTabs]` configuration for the current\n * injector. Always returns a fully populated, non-`undefined` object\n * so call sites do not need null-coalescing.\n *\n * Resolution order per key:\n * 1. `CNGX_MAT_TABS_CONFIG` value (set via\n * {@link provideMatTabsConfig} / {@link provideMatTabsConfigAt}).\n * 2. {@link CNGX_MAT_TABS_CONFIG_DEFAULTS} (library default).\n *\n * @category ui/mat-tabs\n */\nexport function injectMatTabsConfig(): Required<CngxMatTabsConfig> {\n const user = inject(CNGX_MAT_TABS_CONFIG, { optional: true }) ?? {};\n return {\n anchorMaxAttempts: user.anchorMaxAttempts ?? CNGX_MAT_TABS_CONFIG_DEFAULTS.anchorMaxAttempts,\n halfWiredSlotSink: user.halfWiredSlotSink ?? CNGX_MAT_TABS_CONFIG_DEFAULTS.halfWiredSlotSink,\n };\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\n/**\n * Context passed to the `*cngxMatTabAggregatorContent` template.\n * Drives the SR-descriptor content rendered inside the\n * `<span class=\"cngx-sr-only\">` decoration that `[cngxMatTabs]`\n * appends to a Material tab button when its bound aggregator wants\n * reveal. The surrounding span (with its `cngx-sr-only` class, its\n * stable id, and the `aria-describedby` wiring on the button)\n * stays library-owned - the slot only customises the descriptor\n * text or markup so consumers can swap the announcement phrasing\n * (counter pills, localised templates, branded prefixes) without\n * fighting the AT contract.\n *\n * `count` mirrors the bound aggregator's `errorCount()` at the\n * moment the decoration was applied; `label` is the human-readable\n * label of the tab (the Material `MatTab.textLabel`);\n * `announcement` is the resolved AT phrase (the same string the\n * imperative `textContent` fallback would write). All three are\n * snapshotted into the decorated entry - re-emissions of the\n * underlying signals re-fire the projector's effect, which\n * re-applies the decoration with the fresh context.\n *\n * @category ui/mat-tabs\n */\nexport interface CngxMatTabAggregatorContentContext {\n /** Aggregated error count for this tab (≥ 1 when shown). */\n readonly count: number;\n /** Resolved tab label (Material `textLabel`). */\n readonly label: string;\n /**\n * Resolved AT announcement phrase the imperative fallback path\n * would write verbatim - the bound aggregator's `announcement()`\n * value at the moment the decoration was applied. Use this when\n * the consumer template wants to render the canonical phrase\n * alongside its own decoration (counter pill, branded prefix)\n * without re-injecting the aggregator.\n */\n readonly announcement: string;\n}\n\n/**\n * Structural slot directive marking the aggregator-descriptor\n * template for `[cngxMatTabs]`. Discovered via `contentChild` on the\n * directive; when bound, the projector renders an embedded view of\n * this template into the SR-only descriptor span instead of writing\n * the aggregator's `announcement()` string verbatim.\n *\n * Pure marker - zero logic. Holds only a typed\n * {@link TemplateRef} reference. Mirrors the family-standard slot\n * pattern (`CngxStepBadge`, `CngxTabErrorBadge`, `CngxTabOverflowItem`).\n *\n * Material owns the tab-button chrome; the cngx descriptor span is\n * the only consumer-visible decoration seam, so this slot directive\n * lands with one in-package consumer (the package-private\n * aggregator-decoration projector).\n *\n * ```html\n * <mat-tab-group cngxMatTabs>\n * <ng-template\n * cngxMatTabAggregatorContent\n * let-count=\"count\"\n * let-label=\"label\"\n * >\n * {{ label }}: {{ count }} validation issue(s)\n * </ng-template>\n * <mat-tab label=\"Profile\" cngxMatTabError=\"profile\">…</mat-tab>\n * </mat-tab-group>\n * ```\n *\n * @category ui/mat-tabs\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/decorations/mat-tab-aggregator-content.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMatTabs, CngxMatTabError, CngxMatTabRejectionContent\n */\n@Directive({\n selector: 'ng-template[cngxMatTabAggregatorContent]',\n exportAs: 'cngxMatTabAggregatorContent',\n standalone: true,\n})\nexport class CngxMatTabAggregatorContent {\n readonly templateRef = inject<TemplateRef<CngxMatTabAggregatorContentContext>>(TemplateRef);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\n/**\n * Context passed to the `*cngxMatTabRejectionContent` template. Drives\n * the SR-descriptor content rendered inside the\n * `<span class=\"cngx-sr-only\">` decoration that `[cngxMatTabs]`\n * appends to a Material tab button when its bound `commitAction`\n * rejects a tab change. The surrounding span (with its\n * `cngx-sr-only` class, its stable id, and the `aria-describedby`\n * wiring on the button) stays library-owned - the slot only\n * customises the descriptor text or markup so consumers can swap\n * the rejection phrasing (branded prefixes, retry CTAs, localised\n * templates) without fighting the AT contract.\n *\n * `failedHandleId` is the stable id of the rejected handle (the\n * same id the descriptor span uses as its `${id}-rejected` DOM id);\n * `originLabel` is the label the rollback returned to (when the\n * presenter exposes an `originIndexDuringCommit` and that index\n * resolves to a handle with a non-empty label) - `undefined` when\n * no labelled rollback origin is resolvable; `fallbackText` is the\n * built-in i18n phrase the imperative fallback path would write\n * verbatim (typically `commitRolledBackTo(originLabel)` when the\n * origin is resolvable, `commitFailedRetry` otherwise).\n *\n * **Re-instantiation warning.** The decoration projector destroys\n * the embedded view and creates a fresh one on every `descriptorText`\n * re-emission - typical when the rollback origin label resolves\n * later than the failed-handle id (e.g. `presenter.tabs()` re-emits\n * mid-rejection and the origin label flows in on the second tick).\n * The slot template runs to the end of its lifecycle each time;\n * consumers wiring expensive subtrees (e.g. an embedded chart, a\n * complex form) should treat this as a destroy + remount cycle and\n * lift heavy state into a sibling `*ngTemplateOutlet`-friendly\n * structure outside the slot. Cheap text + simple markup (the\n * intended use) sees no observable difference.\n *\n * @category ui/mat-tabs\n */\nexport interface CngxMatTabRejectionContentContext {\n /** Stable id of the rejected `CngxTabHandle`. */\n readonly failedHandleId: string;\n /**\n * Label of the rollback origin (only set when the presenter's\n * `originIndexDuringCommit` resolves to a handle with a non-empty\n * label).\n */\n readonly originLabel: string | undefined;\n /**\n * Library-default i18n phrase the imperative fallback path would\n * write verbatim. Use this if the consumer template wants to\n * render the canonical phrase as a base alongside its own\n * decoration (icon, branded prefix, retry CTA).\n */\n readonly fallbackText: string;\n}\n\n/**\n * Structural slot directive marking the rejection-descriptor\n * template for `[cngxMatTabs]`. Discovered via `contentChild` on the\n * directive; when bound, the projector renders an embedded view of\n * this template into the SR-only descriptor span instead of writing\n * the resolved fallback string verbatim.\n *\n * Pure marker - zero logic. Holds only a typed\n * {@link TemplateRef} reference. Mirrors the family-standard slot\n * pattern (`CngxMatTabAggregatorContent`, `CngxStepBadge`,\n * `CngxTabErrorBadge`).\n *\n * Cascade resolution:\n * 1. Per-instance `*cngxMatTabRejectionContent` template wins\n * via `contentChild(CngxMatTabRejectionContent)`.\n * 2. Library default - imperative `Renderer2.createElement('span')`\n * with `textContent = fallbackText` (the resolved\n * `commitRolledBackTo(originLabel)` / `commitFailedRetry`\n * phrase from `injectTabsI18n()`).\n *\n * ```html\n * <mat-tab-group cngxMatTabs [commitAction]=\"save\">\n * <ng-template\n * cngxMatTabRejectionContent\n * let-failedHandleId=\"failedHandleId\"\n * let-originLabel=\"originLabel\"\n * let-fallbackText=\"fallbackText\"\n * >\n * <span class=\"brand-icon\" aria-hidden=\"true\"></span>\n * {{ fallbackText }}\n * @if (originLabel) {\n * <button (click)=\"retry(failedHandleId)\">Retry</button>\n * }\n * </ng-template>\n * <mat-tab label=\"Profile\">…</mat-tab>\n * </mat-tab-group>\n * ```\n *\n * @category ui/mat-tabs\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/decorations/mat-tab-rejection-content.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMatTabs, CngxMatTabAggregatorContent, CngxMatTabError\n */\n@Directive({\n selector: 'ng-template[cngxMatTabRejectionContent]',\n exportAs: 'cngxMatTabRejectionContent',\n standalone: true,\n})\nexport class CngxMatTabRejectionContent {\n readonly templateRef = inject<TemplateRef<CngxMatTabRejectionContentContext>>(TemplateRef);\n}\n","import {\n effect,\n inject,\n type Injector,\n runInInjectionContext,\n type Signal,\n untracked,\n} from '@angular/core';\n\nimport { CngxLiveAnnouncer } from '@cngx/common/a11y';\n\n/**\n * Options for {@link mountLiveRegionAnnouncer}.\n *\n * @internal\n */\nexport interface CngxMatTabLiveRegionOptions {\n /** Reactive announcement text. Empty string keeps the region quiet. */\n readonly announcement: Signal<string>;\n readonly injector: Injector;\n /** Default: `'polite'`. */\n readonly politeness?: 'polite' | 'assertive';\n}\n\n/**\n * Keep the shared {@link CngxLiveAnnouncer} in sync with the supplied\n * `announcement` signal: an `effect` reads the reactive text and\n * forwards every non-empty value to the root announcer at the\n * configured politeness (default `'polite'`). An empty string between\n * transitions keeps the region quiet on no-op CD ticks.\n *\n * Delegates to {@link CngxLiveAnnouncer} instead of mounting its own\n * body span, so the announcer owns the persistent polite/assertive\n * region pair, the clear-then-set re-announce, and teardown. The\n * delegated region carries `aria-live` + `aria-atomic=\"true\"` and no\n * explicit `role`; `aria-atomic` re-reads full content and `aria-live`\n * carries the politeness, so a tab-change status utterance still reads.\n *\n * The `effect` is created in `opts.injector`'s context, so it is torn\n * down with the host directive; the service call is wrapped in\n * `untracked` - the announcer owns its own clear-then-set timer, so it\n * stays out of the effect's dependency graph.\n *\n * @internal - package-private helper for `[cngxMatTabs]`. Not\n * exported from `public-api.ts`.\n */\nexport function mountLiveRegionAnnouncer(\n opts: CngxMatTabLiveRegionOptions,\n): void {\n const politeness = opts.politeness ?? 'polite';\n\n runInInjectionContext(opts.injector, () => {\n const announcer = inject(CngxLiveAnnouncer);\n effect(() => {\n const text = opts.announcement();\n if (!text) {\n return;\n }\n untracked(() => announcer.announce(text, politeness));\n });\n });\n}\n","import { computed, type Signal } from '@angular/core';\n\nimport type { CngxTabGroupHost, injectTabsI18n } from '@cngx/common/tabs';\n\n/**\n * Reactive rejection-state derivation shared by the descriptor-text\n * pipeline and the `*cngxMatTabRejectionContent` slot context.\n *\n * Both consumers need the same source resolution (failed index →\n * origin index → origin tab label), so a single factory deduplicates\n * the lookup and keeps `[cngxMatTabs]` thin enough to pass the\n * organism-LOC guard.\n *\n * @internal - package-private helper for `[cngxMatTabs]`. Not\n * exported from `public-api.ts`.\n */\nexport interface CngxMatTabRejectionState {\n /**\n * Reactive label of the rollback origin - `undefined` when no\n * rejection is pinned, when the origin index is unresolved, or\n * when the origin tab carries no label.\n */\n readonly originLabel: Signal<string | undefined>;\n /**\n * Reactive descriptor phrase - the `commitRolledBackTo(originLabel)`\n * variant when an origin label resolves, falling back to\n * `commitFailedRetry` otherwise. Empty string between rejections\n * (the projector clears the decoration entirely on\n * `failedHandleId === null`, so consumers only consult this while\n * a rejection is pinned).\n */\n readonly descriptorText: Signal<string>;\n /**\n * SR-friendly text rendered inside the polite live-region span.\n * Mirrors `tab-group.component.ts`'s `liveAnnouncement` rejection\n * arm so AT users on Material `<mat-tab-group>` get the same\n * commit-transition narrative as cngx-native:\n *\n * 1. `'pending'` → `i18n.commitInFlight`\n * 2. `'error'` → `commitRolledBackTo(originLabel)` when an\n * origin label resolves, `commitFailedRetry` otherwise\n * 3. anything else → empty string (region stays quiet on no-op\n * CD ticks; mat-tabs does not announce success transitions\n * because Material's own ARIA already narrates the\n * activeIndex change - duplicating would make AT readers\n * hear two utterances per nav)\n */\n readonly liveAnnouncement: Signal<string>;\n}\n\n/**\n * Build the {@link CngxMatTabRejectionState} bundle for a given\n * presenter + i18n pair. Two computeds share one source-walk\n * (`lastFailedIndex` → `originIndexDuringCommit` → `tabs[idx].label()`)\n * via Angular's signal memoisation - the second computed re-uses\n * the first's cached `originLabel` value, so the `tabs()` traversal\n * happens at most once per state change.\n *\n * @internal\n */\nexport function createRejectionState(\n presenter: CngxTabGroupHost,\n i18n: ReturnType<typeof injectTabsI18n>,\n): CngxMatTabRejectionState {\n const originLabel: Signal<string | undefined> = computed(() => {\n const failedIdx = presenter.lastFailedIndex();\n if (failedIdx === undefined) {\n return undefined;\n }\n const originIdx = presenter.originIndexDuringCommit();\n if (originIdx === undefined) {\n return undefined;\n }\n return presenter.tabs()[originIdx]?.label() ?? undefined;\n });\n\n const descriptorText: Signal<string> = computed(() => {\n if (presenter.lastFailedIndex() === undefined) {\n return '';\n }\n const label = originLabel();\n return label ? i18n.commitRolledBackTo(label) : i18n.commitFailedRetry;\n });\n\n const liveAnnouncement: Signal<string> = computed(() => {\n const current = presenter.commitTransition.current();\n if (current === 'pending') {\n return i18n.commitInFlight;\n }\n if (current === 'error') {\n const label = originLabel();\n return label ? i18n.commitRolledBackTo(label) : i18n.commitFailedRetry;\n }\n return '';\n });\n\n return { originLabel, descriptorText, liveAnnouncement };\n}\n","import {\n computed,\n InjectionToken,\n type Injector,\n signal,\n type Signal,\n type WritableSignal,\n} from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport type { MatTab } from '@angular/material/tabs';\n\nimport type { CngxErrorAggregatorContract } from '@cngx/common/interactive';\nimport type { CngxTabHandle } from '@cngx/common/tabs';\n\nimport type { MaterialPrivateSurfaces } from './private-surfaces';\n\n/**\n * Wiring bundle returned from {@link createMatTabHandle}. The\n * directive owns the writable `errorAggregator` slot so the\n * `[cngxMatTabError]` per-tab directive can pump aggregators into\n * it; `label` and `disabled` track Material's current state via a\n * `toSignal(matTab._stateChanges)` trigger.\n */\nexport interface CngxMatTabHandleSetup {\n readonly handle: CngxTabHandle;\n /** Convenience mirror of `handle.label`. */\n readonly label: Signal<string | undefined>;\n /** Convenience mirror of `handle.disabled`. */\n readonly disabled: Signal<boolean>;\n readonly errorAggregator: WritableSignal<CngxErrorAggregatorContract | undefined>;\n /**\n * Direct invalid flag the `[cngxMatTabErrorFlag]` directive writes -\n * `string | boolean`, mirroring `CngxTab.error`. Folds into the\n * handle's `hasError` / `errorMessage` alongside the aggregator.\n */\n readonly directError: WritableSignal<string | boolean>;\n}\n\n/**\n * Translates a Material `MatTab` into a cngx {@link CngxTabHandle}\n * plus a writable `errorAggregator` slot the `[cngxMatTabError]`\n * directive binds.\n *\n * - `id` - fresh `idSeed()` value; a label-keyed id would collide\n * when two tabs share a label.\n * - `label` / `disabled` - `computed` signals retriggered by\n * `toSignal(matTab._stateChanges)`. Bridge lifetime is tied to\n * the supplied `injector` (typically a per-tab child\n * `EnvironmentInjector`). `_stateChanges` is a Material-internal\n * surface.\n * - `errorAggregator` - writable seeded at `undefined`;\n * `[cngxMatTabError]` writes its bound aggregator in and resets\n * on teardown. The handle exposes `.asReadonly()` to preserve the\n * `CngxTabHandle` contract.\n * - `directError` - writable seeded at `false`;\n * `[cngxMatTabErrorFlag]` writes its `string | boolean` value in\n * and resets on teardown. Folds into `hasError` / `errorMessage`.\n *\n * @category ui/mat-tabs\n */\nexport function createMatTabHandle(\n matTab: MatTab,\n idSeed: () => string,\n injector: Injector,\n): CngxMatTabHandleSetup {\n // Typed local - anchors `MaterialPrivateSurfaces.StateChangeSource`\n // at the consumer site so an upgrade-watch grep lands here too.\n // Documentation-only at runtime; MatTab's public typing already\n // exposes `_stateChanges`.\n const stateChangeSource: MaterialPrivateSurfaces.StateChangeSource = matTab;\n // `equal: () => false` is load-bearing - `_stateChanges` is a\n // `Subject<void>`, so `Object.is(undefined, undefined)` would dedup\n // every emission and the dependent computeds would never recompute.\n const stateChangeTrigger = toSignal(stateChangeSource._stateChanges, {\n injector,\n initialValue: undefined,\n equal: () => false,\n });\n const label = computed<string | undefined>(() => {\n stateChangeTrigger();\n return matTab.textLabel;\n });\n const disabled = computed<boolean>(() => {\n stateChangeTrigger();\n return matTab.disabled;\n });\n const errorAggregator = signal<CngxErrorAggregatorContract | undefined>(undefined);\n // Direct invalid flag written by `[cngxMatTabErrorFlag]` - the\n // Material-side author surface mirroring `CngxTab.error`.\n const directError = signal<string | boolean>(false);\n // Folded error state for the widened `CngxTabHandle` contract. Direct\n // flag OR the aggregator's reveal-gated `shouldShow()` (so deferred-\n // reveal validation stays silent until revealed).\n const hasError = computed<boolean>(\n () => {\n const direct = directError();\n return (direct !== false && direct !== '') || (errorAggregator()?.shouldShow?.() ?? false);\n },\n { equal: Object.is },\n );\n // Resolved direct-error message: the flag string when non-empty, else\n // `undefined`. The aggregator carries its own announcement separately.\n const errorMessage = computed<string | undefined>(() => {\n const direct = directError();\n return typeof direct === 'string' && direct !== '' ? direct : undefined;\n });\n // Material owns its own tab lifecycle - the cngx dismissable/addable\n // affordances are native-only by design, so the Material handle pins\n // `closable` to `undefined` (group-default, never a close button).\n const closable = signal<boolean | undefined>(undefined);\n // Material owns its tab-button chrome (no DOM seam for a stacked\n // second line), so the bridge pins `subLabel` to `undefined` - same\n // native-only staging as `closable`.\n const subLabel = signal<string | undefined>(undefined);\n // `nextUid` is process-wide monotonic, so `${id}-errors` descriptor\n // ids stay unique across coexisting `[cngxMatTabs]` instances.\n const id = idSeed();\n return {\n handle: {\n id,\n label,\n subLabel: subLabel.asReadonly(),\n disabled,\n errorAggregator: errorAggregator.asReadonly(),\n hasError,\n errorMessage,\n closable: closable.asReadonly(),\n },\n label,\n disabled,\n errorAggregator,\n directError,\n };\n}\n\n/**\n * Factory signature for {@link createMatTabHandle}. The DI token\n * {@link CNGX_MAT_TAB_HANDLE_FACTORY} resolves to a function with\n * this exact shape - overrides match it identically.\n *\n * @category ui/mat-tabs\n */\nexport type CngxMatTabHandleFactory = typeof createMatTabHandle;\n\n/**\n * DI token fronting the per-tab handle factory used by\n * `[cngxMatTabs]`. Default is {@link createMatTabHandle}. Symmetric\n * with `CNGX_MAT_STEP_HANDLE_FACTORY` and\n * `CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY`.\n *\n * The seam separates handle shape (factory body) from id keying\n * (the supplied `idSeed` closure). Overrides may call, ignore, or\n * replace `idSeed` - server-synced ids, deterministic test ids,\n * consumer-domain ids - without touching the factory body.\n *\n * ```ts\n * providers: [\n * {\n * provide: CNGX_MAT_TAB_HANDLE_FACTORY,\n * useValue: ((tab, idSeed, injector) => {\n * const setup = createMatTabHandle(tab, idSeed, injector);\n * reportTabRegistered(setup.handle.id);\n * return setup;\n * }) satisfies CngxMatTabHandleFactory,\n * },\n * ]\n * ```\n *\n * @category ui/mat-tabs\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/material-bridge/handle.ts\n * @since 0.1.0\n */\nexport const CNGX_MAT_TAB_HANDLE_FACTORY = new InjectionToken<CngxMatTabHandleFactory>(\n 'CNGX_MAT_TAB_HANDLE_FACTORY',\n {\n providedIn: 'root',\n factory: () => createMatTabHandle,\n },\n);\n","import {\n contentChildren,\n createEnvironmentInjector,\n DestroyRef,\n Directive,\n effect,\n EnvironmentInjector,\n inject,\n InjectionToken,\n untracked,\n} from '@angular/core';\nimport { MatTab } from '@angular/material/tabs';\n\nimport { CNGX_TAB_GROUP_HOST, type CngxTabGroupHost } from '@cngx/common/tabs';\nimport { nextUid } from '@cngx/core/utils';\n\nimport { CNGX_MAT_TAB_HANDLE_FACTORY, type CngxMatTabHandleSetup } from './material-bridge/handle';\n\n/**\n * Per-MatTab registry entry. The child `EnvironmentInjector` scopes\n * the per-tab `_stateChanges` bridge - destroying it fires\n * `takeUntilDestroyed` so the subscription unsubscribes\n * deterministically.\n *\n * @internal\n */\ninterface CngxMatTabsRegistryEntry {\n readonly setup: CngxMatTabHandleSetup;\n readonly childInjector: EnvironmentInjector;\n}\n\n/**\n * Read-mostly contract for the per-tab handle-setup registry.\n * `[cngxMatTabError]` and any future `[cngxMatTab*]` decoration\n * directive injects this with `{ host: true }` to reach the\n * per-handle `errorAggregator` slot without walking the concrete\n * registry class.\n *\n * Return type narrows to `Pick<..., 'errorAggregator'>` so the\n * access path exposes only the per-handle aggregator slot; the\n * rest of the setup stays internal bookkeeping.\n *\n * @category ui/mat-tabs\n */\nexport interface CngxMatTabsRegistryHost {\n /**\n * Returns the per-handle writable slots (`errorAggregator`,\n * `directError`), or `undefined` before the tab is registered. The\n * `contentChildren(MatTab)` query lands during content-init, so a\n * same-microtask injection from an attribute directive can race;\n * consumers recover by tracking `presenter.tabs()` and re-attempting\n * on the next sync tick.\n */\n getHandleSetup(\n matTab: MatTab,\n ): Pick<CngxMatTabHandleSetup, 'errorAggregator' | 'directError'> | undefined;\n}\n\n/**\n * DI token the {@link CngxMatTabsRegistry} directive provides via\n * `useExisting`. Sibling per-tab directives inject this with\n * `{ host: true }` to reach per-handle slots without walking the\n * concrete registry class.\n *\n * @category ui/mat-tabs\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/mat-tabs-registry.directive.ts\n * @since 0.1.0\n */\nexport const CNGX_MAT_TABS_REGISTRY_HOST = new InjectionToken<CngxMatTabsRegistryHost>(\n 'CngxMatTabsRegistryHost',\n);\n\n/**\n * Sibling host-directive that owns the per-MatTab handle registry\n * for `[cngxMatTabs]`. Keeps the parent under the level-4 organism\n * LOC guard and lets per-tab decoration directives reach the\n * registry through a typed token.\n *\n * Owns: `contentChildren(MatTab)` query, the `setupsByTab` map\n * (per-tab cngx setup paired with a child `EnvironmentInjector`\n * scoping the `_stateChanges` bridge), an `effect()` that diffs the\n * MatTab list and (un)registers handles with `CNGX_TAB_GROUP_HOST`,\n * and a `DestroyRef` cleanup that destroys every child injector.\n *\n * Composition: `[cngxMatTabs]` declares this in `hostDirectives`;\n * both share the parent's `CngxTabGroupPresenter` and the same\n * `<mat-tab-group>` content-children scope.\n *\n * @category ui/mat-tabs\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/mat-tabs-registry.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMatTabs, CngxMatTabError, CNGX_MAT_TABS_REGISTRY_HOST\n */\n@Directive({\n selector: '[cngxMatTabsRegistry]',\n exportAs: 'cngxMatTabsRegistry',\n standalone: true,\n providers: [\n {\n provide: CNGX_MAT_TABS_REGISTRY_HOST,\n useExisting: CngxMatTabsRegistry,\n },\n ],\n})\nexport class CngxMatTabsRegistry implements CngxMatTabsRegistryHost {\n private readonly presenter = inject<CngxTabGroupHost>(CNGX_TAB_GROUP_HOST);\n private readonly destroyRef = inject(DestroyRef);\n private readonly envInjector = inject(EnvironmentInjector);\n private readonly createHandle = inject(CNGX_MAT_TAB_HANDLE_FACTORY);\n\n private readonly matTabs = contentChildren(MatTab, { descendants: true });\n // Map (not WeakMap) so the diff loop in `syncHandles` can iterate\n // to find removed tabs without a parallel `Set<MatTab>`. Entries\n // are explicitly deleted when the matching MatTab leaves the\n // children set, AND the map goes away on directive destroy.\n private readonly setupsByTab = new Map<MatTab, CngxMatTabsRegistryEntry>();\n\n constructor() {\n effect(() => {\n const tabs = this.matTabs();\n untracked(() => this.syncHandles(tabs));\n });\n\n this.destroyRef.onDestroy(() => {\n for (const entry of this.setupsByTab.values()) {\n // Disposes the per-tab `toSignal(_stateChanges)` bridge.\n entry.childInjector.destroy();\n }\n this.setupsByTab.clear();\n });\n }\n\n getHandleSetup(\n matTab: MatTab,\n ): Pick<CngxMatTabHandleSetup, 'errorAggregator' | 'directError'> | undefined {\n return this.setupsByTab.get(matTab)?.setup;\n }\n\n private syncHandles(tabs: readonly MatTab[]): void {\n const liveTabs = new Set<MatTab>(tabs);\n for (const tab of tabs) {\n if (this.setupsByTab.has(tab)) {\n continue;\n }\n // Per-tab child injector scopes the `toSignal(_stateChanges)`\n // bridge inside createMatTabHandle - destroying it on tab\n // removal fires `takeUntilDestroyed`.\n const childInjector = createEnvironmentInjector([], this.envInjector);\n const idSeed = () => nextUid('cngx-mat-tab-');\n const setup = this.createHandle(tab, idSeed, childInjector);\n this.setupsByTab.set(tab, { setup, childInjector });\n this.presenter.register(setup.handle);\n }\n // Snapshot entries before the loop so multi-key deletes inside\n // the body never collide with iterator state.\n for (const [tab, entry] of Array.from(this.setupsByTab.entries())) {\n if (liveTabs.has(tab)) {\n continue;\n }\n entry.childInjector.destroy();\n this.setupsByTab.delete(tab);\n this.presenter.unregister(entry.setup.handle.id);\n }\n }\n}\n","import type { CngxTabOverflowDomAdapter } from '@cngx/common/tabs';\n\nimport { MaterialPrivateSurfaces } from '../material-bridge/private-surfaces';\n\n/**\n * Material variant of {@link CngxTabOverflowDomAdapter}.\n *\n * `resolveStripRoot` walks from host up to `<mat-tab-header>` and\n * locates `.mat-mdc-tab-label-container` via any rendered\n * `.mat-mdc-tab` descendant - Material's IO-friendly scroll\n * container.\n *\n * `resolveTabButton` indexes positionally; Material owns the DOM\n * and cngx handle ids never reach the button elements. Index\n * correlates against `presenter.tabs()` registration order.\n *\n * Wire it via the directive's\n * `CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY` provider:\n *\n * ```ts\n * providers: [\n * { provide: CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY,\n * useValue: createCngxMatTabOverflowDomAdapter }\n * ]\n * ```\n *\n * @category ui/mat-tabs\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/overflow/mat-tab-overflow-dom-adapter.ts\n * @since 0.1.0\n * @relatedTo CngxTabOverflow, CngxMatTabs, CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY\n */\nexport function createCngxMatTabOverflowDomAdapter(): CngxTabOverflowDomAdapter {\n return {\n resolveStripRoot(_panelHost, host) {\n // Returning null is a retry signal - the rAF loop polls again\n // on the next frame, succeeds once MatTabHeader has committed.\n const header = host.closest<HTMLElement>(\n MaterialPrivateSurfaces.MAT_MDC_TAB_HEADER_SELECTOR,\n );\n const anyTab = header?.querySelector<HTMLElement>(\n MaterialPrivateSurfaces.MAT_MDC_TAB_SELECTOR,\n );\n return (\n anyTab?.closest<HTMLElement>(\n MaterialPrivateSurfaces.MAT_MDC_TAB_LABEL_CONTAINER_SELECTOR,\n ) ?? null\n );\n },\n resolveTabButton(_handle, root, idx) {\n return (\n root\n .querySelectorAll<HTMLElement>(\n MaterialPrivateSurfaces.MAT_MDC_TAB_SELECTOR,\n )\n .item(idx) ?? null\n );\n },\n };\n}\n","import {\n afterNextRender,\n computed,\n contentChild,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n Injectable,\n inject,\n Injector,\n isDevMode,\n Renderer2,\n type Signal,\n type TemplateRef,\n untracked,\n ViewContainerRef,\n type ComponentRef,\n} from '@angular/core';\nimport { MatTabGroup } from '@angular/material/tabs';\n\nimport { createMaterialBidirectionalSync } from '@cngx/common/data';\nimport {\n CNGX_DOM_ANCHOR_RETRY_FACTORY,\n CNGX_TAB_GROUP_HOST,\n CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY,\n CNGX_TAB_PANEL_HOST,\n CngxTabGroupPresenter,\n injectTabsI18n,\n type CngxTabGroupHost,\n type CngxTabPanelHost,\n} from '@cngx/common/tabs';\nimport { CngxTabOverflow } from '@cngx/ui/tabs';\n\nimport {\n createMatTabAggregatorDecoration,\n createMatTabRejectionDecoration,\n} from './decorations/decoration-projectors';\nimport { createAggregatedErrorTabs } from './decorations/aggregated-error-tabs';\nimport { injectMatTabsConfig } from './mat-tabs-config';\nimport {\n CngxMatTabAggregatorContent,\n type CngxMatTabAggregatorContentContext,\n} from './decorations/mat-tab-aggregator-content.directive';\nimport {\n CngxMatTabRejectionContent,\n type CngxMatTabRejectionContentContext,\n} from './decorations/mat-tab-rejection-content.directive';\nimport { mountLiveRegionAnnouncer } from './decorations/live-region';\nimport { createRejectionState } from './decorations/rejection-state';\nimport { CngxMatTabsRegistry } from './mat-tabs-registry.directive';\nimport { MaterialPrivateSurfaces } from './material-bridge/private-surfaces';\n\nimport { createCngxMatTabOverflowDomAdapter } from './overflow/mat-tab-overflow-dom-adapter';\n\n/**\n * Implements {@link CngxTabPanelHost} for the programmatically\n * mounted overflow popover. Delegates to the directive's\n * `CNGX_TAB_GROUP_HOST` presenter; both template lookups return\n * `null` because Material renders labels through `<mat-tab>` and\n * projected `<mat-tab-content>`.\n *\n * Class instead of factory-returned literal so a telemetry or\n * branded variant can subclass + swap via `useClass`. The directive\n * registers it once and binds `CNGX_TAB_PANEL_HOST` with\n * `useExisting`.\n *\n * @internal\n */\n@Injectable()\nexport class CngxMatTabsPanelHostAdapter implements CngxTabPanelHost {\n private readonly presenter = inject<CngxTabGroupHost>(CNGX_TAB_GROUP_HOST);\n\n readonly tabs = this.presenter.tabs;\n readonly activeId = this.presenter.activeId;\n readonly orientation = this.presenter.orientation;\n\n selectById(id: string): void {\n this.presenter.selectById(id);\n }\n\n labelTemplateFor(_id: string): TemplateRef<unknown> | null {\n return null;\n }\n\n contentTemplateFor(_id: string): TemplateRef<unknown> | null {\n return null;\n }\n}\n\n/**\n * Attaches to an existing `<mat-tab-group>` and wires it to a\n * {@link CngxTabGroupPresenter} - consumers get the commit-action\n * lifecycle, `CNGX_STATEFUL` (so `<cngx-toast-on />` and\n * `<cngx-banner-on />` compose as children), and the tab-handle\n * registry from one attribute.\n *\n * Topology inverts `<cngx-mat-stepper>`: Material is the host, cngx\n * is the instrumentation layer. `inject(MatTabGroup, { self: true })`\n * resolves on the consumer's own element - no content projection\n * blocker applies here.\n *\n * Rejection (`--error`) and aggregator (`--has-errors`) visuals\n * live in the package-private projector factories under\n * `./decorations/`; this directive supplies their reactive triggers\n * and the delegators consumer templates call.\n *\n * @playground Form error aggregation ./examples/form-errors/form-errors.component.ts\n *\n * @category ui/mat-tabs\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/mat-tabs.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMatTabsRegistry, CngxMatTabError, CngxMatStepper\n * @slot cngxMatTabAggregatorContent Replaces the aggregated error summary projected into a Material tab.\n * @slot cngxMatTabRejectionContent Replaces the rejection notice on a rolled-back Material tab.\n */\n@Directive({\n selector: '[cngxMatTabs]',\n exportAs: 'cngxMatTabs',\n standalone: true,\n hostDirectives: [\n {\n directive: CngxTabGroupPresenter,\n inputs: ['activeIndex', 'orientation', 'loop', 'commitAction', 'commitMode'],\n outputs: ['activeIndexChange'],\n },\n // Provides `CNGX_MAT_TABS_REGISTRY_HOST` so per-tab decoration\n // directives reach the registry through a typed token rather\n // than injecting this concrete class.\n CngxMatTabsRegistry,\n ],\n providers: [\n // Material variant of the overflow molecule's DOM-resolution\n // strategy. Swaps `.cngx-tabs__strip-wrapper` walks for the Material\n // `.mat-mdc-tab-header` → `.mat-mdc-tab-label-container` walk and\n // index-based `.mat-mdc-tab` resolution.\n {\n provide: CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY,\n useValue: createCngxMatTabOverflowDomAdapter,\n },\n // Panel-host adapter for the programmatically mounted overflow\n // molecule. `useExisting` binding below ensures every injection\n // resolves to the single per-host instance. The cngx-native\n // `<cngx-tab-group>` path keeps its own `useExisting:\n // CngxTabGroup` provider - sits one injector layer closer.\n CngxMatTabsPanelHostAdapter,\n {\n provide: CNGX_TAB_PANEL_HOST,\n useExisting: CngxMatTabsPanelHostAdapter,\n },\n ],\n})\nexport class CngxMatTabs {\n private readonly matTabGroup = inject(MatTabGroup, { self: true });\n private readonly presenter = inject(CNGX_TAB_GROUP_HOST);\n private readonly destroyRef = inject(DestroyRef);\n private readonly injector = inject(Injector);\n private readonly renderer = inject(Renderer2);\n private readonly hostEl = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n\n // Field order matters - `overflowRef` reads `viewContainerRef` at\n // class-init time. The VCR also feeds the aggregator-decoration\n // slot path further down.\n private readonly viewContainerRef = inject(ViewContainerRef);\n\n // Programmatic mount of the cngx overflow molecule.\n // `injector: this.injector` is load-bearing - without it,\n // `vcr.createComponent` walks the host-template's parent VCR for\n // DI resolution, missing this directive's `CNGX_TAB_PANEL_HOST`\n // and `CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY` providers, and the\n // molecule NG0201s on `inject(CNGX_TAB_PANEL_HOST)`. The molecule\n // initially lands as a sibling of `<mat-tab-group>`; the\n // `afterNextRender` block below moves it into\n // `.mat-mdc-tab-header`.\n private readonly overflowRef: ComponentRef<CngxTabOverflow> =\n this.viewContainerRef.createComponent(CngxTabOverflow, {\n injector: this.injector,\n });\n\n private readonly aggregatorContentSlot = contentChild(CngxMatTabAggregatorContent);\n private readonly aggregatorContentTemplate: Signal<TemplateRef<CngxMatTabAggregatorContentContext> | null> =\n computed(() => this.aggregatorContentSlot()?.templateRef ?? null);\n private readonly rejectionContentSlot = contentChild(CngxMatTabRejectionContent);\n private readonly rejectionContentTemplate: Signal<TemplateRef<CngxMatTabRejectionContentContext> | null> =\n computed(() => this.rejectionContentSlot()?.templateRef ?? null);\n private readonly i18n = injectTabsI18n();\n\n // Identity equal on `string | null` - collapses `tabs()` re-emits\n // that don't change the failed-target id.\n private readonly failedHandleId = computed<string | null>(() => {\n const idx = this.presenter.lastFailedIndex();\n if (idx === undefined) {\n return null;\n }\n return this.presenter.tabs()[idx]?.id ?? null;\n });\n\n // Bundle shares one source-walk across descriptorText / originLabel\n // / liveAnnouncement - pillar-2 phrasing parity with cngx-native.\n private readonly rejectionState = createRejectionState(this.presenter, this.i18n);\n\n // Shared with `[cngxMatTabNav]` - one body, two hosts (Pillar 3).\n // Structural equal lives in the factory so the projector doesn't\n // churn on no-op aggregator re-emissions.\n private readonly aggregatedErrorTabs = createAggregatedErrorTabs(this.presenter);\n\n constructor() {\n const matTabsConfig = injectMatTabsConfig();\n\n // Polite live region - attribute directive owns no template, so\n // the helper attaches the span at document.body (CDK\n // LiveAnnouncer convention) and mirrors `CngxLiveRegion`'s host\n // bindings imperatively.\n mountLiveRegionAnnouncer({\n announcement: this.rejectionState.liveAnnouncement,\n injector: this.injector,\n });\n\n // Decoration projectors own DOM-mutation state plus `effect()`\n // registration; the directive only supplies reactive triggers.\n createMatTabRejectionDecoration({\n hostEl: this.hostEl,\n failedHandleId: this.failedHandleId,\n failedIndex: this.presenter.lastFailedIndex,\n descriptorText: this.rejectionState.descriptorText,\n renderer: this.renderer,\n injector: this.injector,\n destroyRef: this.destroyRef,\n contentTemplate: this.rejectionContentTemplate,\n viewContainerRef: this.viewContainerRef,\n originLabel: this.rejectionState.originLabel,\n });\n\n createMatTabAggregatorDecoration({\n hostEl: this.hostEl,\n errorTabs: this.aggregatedErrorTabs,\n renderer: this.renderer,\n injector: this.injector,\n destroyRef: this.destroyRef,\n contentTemplate: this.aggregatorContentTemplate,\n viewContainerRef: this.viewContainerRef,\n onHalfWiredSlot: matTabsConfig.halfWiredSlotSink,\n });\n\n this.destroyRef.onDestroy(() => this.overflowRef.destroy());\n\n // Anchor the overflow molecule inside `.mat-mdc-tab-header` so\n // the More button pins to the strip's trailing edge. Bounded\n // `createDomAnchorRetry` covers the deferred-host case\n // (`<mat-tab-group>` gated behind `*ngIf` / `@defer`); the cap\n // dev-warns when consumer DOM never materialises. The\n // flex-layout skin in `mat-tabs.css` handles positioning - no\n // imperative layout work needed.\n const anchorMaxAttempts = matTabsConfig.anchorMaxAttempts;\n const anchorRetry = inject(CNGX_DOM_ANCHOR_RETRY_FACTORY)({\n attempt: () => {\n const headerEl = this.hostEl.querySelector<HTMLElement>(\n MaterialPrivateSurfaces.MAT_MDC_TAB_HEADER_SELECTOR,\n );\n if (!headerEl) {\n return null;\n }\n const overflowEl = this.overflowRef.location.nativeElement as HTMLElement;\n this.renderer.addClass(overflowEl, 'cngx-mat-tabs-more');\n this.renderer.appendChild(headerEl, overflowEl);\n return true;\n },\n maxAttempts: anchorMaxAttempts,\n schedule: (cb) => {\n afterNextRender(cb, { injector: this.injector });\n return () => undefined;\n },\n onGiveUp: () => {\n if (isDevMode()) {\n console.warn(\n `[CngxMatTabs] Could not anchor <cngx-tab-overflow> after ${anchorMaxAttempts} ` +\n 'attempts - .mat-mdc-tab-header was not found inside the ' +\n 'host. The More popover will fall back to a sibling-of-' +\n '<mat-tab-group> position; verify Material rendered the ' +\n 'strip (e.g. consumer is not gating <mat-tab-group> behind ' +\n 'a never-true *ngIf / @defer).',\n );\n }\n },\n });\n afterNextRender(() => anchorRetry.start());\n this.destroyRef.onDestroy(() => anchorRetry.cancel());\n\n const sync = createMaterialBidirectionalSync({\n presenterIndex: this.presenter.activeIndex,\n readSelectedIndex: () => this.matTabGroup.selectedIndex ?? 0,\n writeSelectedIndex: (i) => {\n this.matTabGroup.selectedIndex = i;\n },\n selectionChange$: this.matTabGroup.selectedIndexChange.asObservable(),\n onMaterialSelection: (i) => this.presenter.select(i),\n injector: this.injector,\n destroyRef: this.destroyRef,\n });\n\n // Routed (pessimistic) gate: a rejected switch holds `activeIndex` at\n // origin, so the presenter to Material mirror never fires and Material\n // stays eager-advanced on the refused tab. Snap it back when the\n // commit settles into an error. `status()` always transitions through\n // `pending` first, so the `error` edge is observed even when the\n // router cancels a microtask after `navigate()`.\n effect(() => {\n const status = this.presenter.commitState.status();\n untracked(() => {\n if (status === 'error') {\n sync.reconcile();\n }\n });\n });\n }\n\n /**\n * Clears `presenter.lastFailedIndex`, dismissing the rejection\n * decoration. Mirrors `CngxTabGroup.clearLastFailed()` so a\n * template ref (`#mt=\"cngxMatTabs\"`) is enough - no host-token\n * injection needed.\n */\n clearLastFailed(): void {\n this.presenter.clearLastFailed();\n }\n}\n","import {\n computed,\n DestroyRef,\n Directive,\n ElementRef,\n inject,\n Injector,\n Renderer2,\n type Signal,\n} from '@angular/core';\n\nimport {\n CNGX_TAB_GROUP_HOST,\n CNGX_TAB_NAV_HOST,\n CngxTabGroupPresenter,\n injectTabsI18n,\n type CngxTabGroupHost,\n} from '@cngx/common/tabs';\n\nimport {\n createMatTabAggregatorDecoration,\n createMatTabRejectionDecoration,\n} from './decorations/decoration-projectors';\nimport { createAggregatedErrorTabs } from './decorations/aggregated-error-tabs';\nimport { mountLiveRegionAnnouncer } from './decorations/live-region';\nimport { createRejectionState } from './decorations/rejection-state';\n\n/**\n * Layers the cngx error / rejection / announcement layer onto\n * Material's native router tabs (`<nav mat-tab-nav-bar>` /\n * `<a mat-tab-link>` / `<mat-tab-nav-panel>`). The parallel bridge to\n * {@link CngxMatTabs}: `MatTabNav` has no `MatTab` and no\n * `selectedIndex`, so handles register per `<a mat-tab-link>` via\n * {@link CngxMatTabLink}, and the decoration projectors target\n * `.mat-mdc-tab-link` instead of `.mat-mdc-tab`.\n *\n * Gating is **native**: each link is a `routerLink`, so the router runs\n * `CanDeactivate` directly and this directive installs no\n * commit-action. The active index follows the route - add\n * `[cngxTabsRouteSync]` to the same `<nav>` and give each\n * `[cngxMatTabLink]` an `id` matching its route segment; route-sync\n * reflects `NavigationEnd` onto `activeIndex` (its commit-action stays\n * dormant because link clicks navigate natively, never through\n * `presenter.select`). Ableitung statt Verwaltung - the route-active\n * link is the single source of the active index.\n *\n * Composes {@link CngxTabGroupPresenter} via `hostDirectives` so the\n * `CNGX_STATEFUL` producer, the `lastFailedIndex` rejection slot, and\n * the live-region announcer come for free, identical to the cngx\n * organism (Pillar 2 - same communication across skins).\n *\n * Decoration content-template slots (`*cngxMatTabRejectionContent` /\n * `*cngxMatTabAggregatorContent`) are not forwarded on this bridge yet -\n * the projectors render their built-in `cngx-sr-only` spans. The slot\n * inputs that `[cngxMatTabs]` exposes are a deferred follow-up.\n *\n * @playground Native router tabs with a CanDeactivate guard ./examples/router-nav/router-nav.component.ts\n *\n * @category ui/mat-tabs\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/mat-tab-nav.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMatTabLink, CngxMatTabs, CngxTabsRouteSync\n */\n@Directive({\n selector: '[cngxMatTabNav]',\n exportAs: 'cngxMatTabNav',\n standalone: true,\n // Presence-only marker: it tells a stacked [cngxTabsRouteSync] that its\n // links own subtrees, so the URL match is prefix rather than suffix.\n providers: [{ provide: CNGX_TAB_NAV_HOST, useValue: true }],\n hostDirectives: [CngxTabGroupPresenter],\n})\nexport class CngxMatTabNav {\n private readonly presenter = inject<CngxTabGroupHost>(CNGX_TAB_GROUP_HOST);\n private readonly destroyRef = inject(DestroyRef);\n private readonly injector = inject(Injector);\n private readonly renderer = inject(Renderer2);\n private readonly hostEl = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n private readonly i18n = injectTabsI18n();\n\n // Stable id of the rejected link, or null. Identity equal collapses\n // tabs() re-emits that don't change the failed-target id.\n private readonly failedHandleId: Signal<string | null> = computed<string | null>(() => {\n const idx = this.presenter.lastFailedIndex();\n if (idx === undefined) {\n return null;\n }\n return this.presenter.tabs()[idx]?.id ?? null;\n });\n\n private readonly rejectionState = createRejectionState(this.presenter, this.i18n);\n private readonly aggregatedErrorTabs = createAggregatedErrorTabs(this.presenter);\n\n constructor() {\n mountLiveRegionAnnouncer({\n announcement: this.rejectionState.liveAnnouncement,\n injector: this.injector,\n });\n\n // Same projector bodies as `[cngxMatTabs]`; only the per-tab element\n // selector differs (`.mat-mdc-tab-link` vs `.mat-mdc-tab`).\n createMatTabRejectionDecoration({\n hostEl: this.hostEl,\n failedHandleId: this.failedHandleId,\n failedIndex: this.presenter.lastFailedIndex,\n descriptorText: this.rejectionState.descriptorText,\n renderer: this.renderer,\n injector: this.injector,\n destroyRef: this.destroyRef,\n originLabel: this.rejectionState.originLabel,\n buttonSelector: '.mat-mdc-tab-link',\n });\n\n createMatTabAggregatorDecoration({\n hostEl: this.hostEl,\n errorTabs: this.aggregatedErrorTabs,\n renderer: this.renderer,\n injector: this.injector,\n destroyRef: this.destroyRef,\n buttonSelector: '.mat-mdc-tab-link',\n });\n }\n\n /**\n * Clears `presenter.lastFailedIndex`, dismissing the rejection\n * decoration. Mirrors {@link CngxMatTabs.clearLastFailed} so a\n * template ref (`#nav=\"cngxMatTabNav\"`) is enough.\n */\n clearLastFailed(): void {\n this.presenter.clearLastFailed();\n }\n}\n","import {\n computed,\n DestroyRef,\n Directive,\n inject,\n input,\n type OnInit,\n type Signal,\n signal,\n} from '@angular/core';\nimport { MatTabLink } from '@angular/material/tabs';\n\nimport { CNGX_TAB_GROUP_HOST, type CngxTabGroupHost, type CngxTabHandle } from '@cngx/common/tabs';\nimport { nextUid } from '@cngx/core/utils';\nimport type { CngxErrorAggregatorContract } from '@cngx/common/interactive';\n\n/**\n * Registers an `<a mat-tab-link>` anchor as a {@link CngxTabHandle}\n * with the enclosing {@link CngxMatTabNav} presenter. `mat-tab-nav-bar`\n * has no `MatTab` to hang a handle on (the links are the tabs), so this\n * per-link directive is the registration seam - symmetric with how\n * `CngxTab` registers in the cngx-native path and how\n * {@link CngxMatTabsRegistry} registers each `<mat-tab>`.\n *\n * Registration order follows DOM order (Angular instantiates content\n * directives top-to-bottom), so the presenter's `tabs()` index aligns\n * with `nav.querySelectorAll('.mat-mdc-tab-link')` - the index the\n * decoration projectors correlate against.\n *\n * Gating is native: the link's `routerLink` runs `CanDeactivate`\n * directly, so this directive installs no commit-action. The active\n * index follows the route through `[cngxTabsRouteSync]` on the nav,\n * which matches each handle's `id` (set to the route segment) against\n * the URL.\n *\n * @category ui/mat-tabs\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/mat-tab-link.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMatTabNav, CngxMatTabs, CngxTab\n */\n@Directive({\n selector: '[cngxMatTabLink]',\n exportAs: 'cngxMatTabLink',\n standalone: true,\n})\nexport class CngxMatTabLink implements OnInit {\n private readonly matLink = inject(MatTabLink, { self: true });\n private readonly host = inject<CngxTabGroupHost>(CNGX_TAB_GROUP_HOST);\n private readonly destroyRef = inject(DestroyRef);\n\n /**\n * Handle id. Set it to the link's route segment so the nav's\n * `[cngxTabsRouteSync]` reflects the active route onto this tab via\n * the default `(h) => [h.id]` mapping. Defaults to a fresh uid when\n * route-sync is not used.\n */\n readonly id = input<string>(nextUid('cngx-mat-tab-link-'));\n /** Accessible label fed to the live-region announcer. */\n readonly label = input<string | undefined>(undefined);\n /**\n * Direct error flag for the link - `true` or a non-empty string marks\n * it invalid (the string doubles as the message). Mirrors\n * `CngxTab.error` and `[cngxMatTabErrorFlag]`.\n */\n readonly error = input<string | boolean>(false);\n /** Optional rich error aggregator for the link. */\n readonly errorAggregator = input<CngxErrorAggregatorContract | undefined>(undefined);\n\n private readonly errorMessage: Signal<string | undefined> = computed(() => {\n const value = this.error();\n return typeof value === 'string' && value !== '' ? value : undefined;\n });\n\n private readonly hasError: Signal<boolean> = computed(\n () => {\n const direct = this.error();\n return (\n (direct !== false && direct !== '') ||\n (this.errorAggregator()?.shouldShow?.() ?? false)\n );\n },\n { equal: Object.is },\n );\n\n // Material's MatTabLink.disabled is a plain property, not a signal;\n // nav links rarely toggle disabled at runtime, so snapshot it onto a\n // signal at registration. A live binding would need a Material\n // reactive surface MatTabLink does not expose.\n private readonly disabledState = signal<boolean>(false);\n\n ngOnInit(): void {\n this.disabledState.set(this.matLink.disabled);\n const handle: CngxTabHandle = {\n id: this.id(),\n label: this.label,\n subLabel: signal(undefined),\n disabled: this.disabledState.asReadonly(),\n errorAggregator: this.errorAggregator,\n hasError: this.hasError,\n errorMessage: this.errorMessage,\n closable: signal(undefined),\n };\n this.host.register(handle);\n this.destroyRef.onDestroy(() => this.host.unregister(handle.id));\n }\n}\n","import { DestroyRef, Directive, effect, inject, input, untracked } from '@angular/core';\nimport { MatTab } from '@angular/material/tabs';\n\nimport { CNGX_TAB_GROUP_HOST } from '@cngx/common/tabs';\nimport type { CngxErrorAggregatorContract } from '@cngx/common/interactive';\n\nimport { CNGX_MAT_TABS_REGISTRY_HOST } from './mat-tabs-registry.directive';\n\n/**\n * Per-tab error-aggregator binding for `[cngxMatTabs]`. Attach to a\n * `<mat-tab>`; the bound aggregator's `shouldShow()` projects onto\n * the matching Material tab button (badge + descriptor span) via\n * the Renderer2 effect inside {@link CngxMatTabs}.\n *\n * Material owns `<mat-tab>` declarations - `[cngxTab]` cannot host\n * here - so a sibling attribute directive carries the input.\n * Empty-string transform handles the bare-attribute case per\n * `feedback_bridge_input_not_required` (a developer typing\n * `cngxMatTabError` without `[]` brackets must not poison the\n * slot).\n *\n * Locates its target via {@link CNGX_MAT_TABS_REGISTRY_HOST} -\n * the registry provides the token with `useExisting`, so sibling\n * directives reach per-handle slots through a typed contract\n * instead of the concrete class. Tracks `presenter.tabs()` to\n * recover from a same-microtask race where the directive injects\n * before the registry's sync runs. `destroyRef.onDestroy` clears\n * the slot so an `*ngIf`-toggled binding returns to the\n * no-aggregator default.\n *\n * @category ui/mat-tabs\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/mat-tab-error.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMatTabs, CngxMatTabsRegistry, CngxMatTabRejectionContent\n */\n@Directive({\n selector: '[cngxMatTabError]',\n exportAs: 'cngxMatTabError',\n standalone: true,\n})\nexport class CngxMatTabError {\n private readonly matTab = inject(MatTab, { self: true });\n private readonly registry = inject(CNGX_MAT_TABS_REGISTRY_HOST, {\n host: true,\n });\n private readonly presenter = inject(CNGX_TAB_GROUP_HOST);\n private readonly destroyRef = inject(DestroyRef);\n\n readonly aggregator = input<\n CngxErrorAggregatorContract | undefined,\n CngxErrorAggregatorContract | '' | undefined\n >(undefined, {\n alias: 'cngxMatTabError',\n transform: (value) => (typeof value === 'string' ? undefined : value),\n });\n\n constructor() {\n effect(() => {\n // Race window - registry's `contentChildren(MatTab)` query and\n // our injection land in the same microtask, so the first lookup\n // can miss our handle. Tracking `presenter.tabs()` re-fires the\n // effect on the next sync tick. `untracked` around the write\n // pre-empts a future regression where `getHandleSetup` reads a\n // signal and self-triggers the aggregator pump.\n const aggregator = this.aggregator();\n // Race-recovery dependency - tracks `setupsByTab` population so\n // the effect re-fires once our `MatTab` is registered. The bare\n // read is intentional; full rationale lives in the effect's\n // opening comment above. Do NOT tag as dead code.\n this.presenter.tabs();\n\n untracked(() => {\n const setup = this.registry.getHandleSetup(this.matTab);\n setup?.errorAggregator.set(aggregator);\n });\n });\n\n this.destroyRef.onDestroy(() => {\n const setup = this.registry.getHandleSetup(this.matTab);\n setup?.errorAggregator.set(undefined);\n });\n }\n}\n","import { DestroyRef, Directive, effect, inject, input, untracked } from '@angular/core';\nimport { MatTab } from '@angular/material/tabs';\n\nimport { CNGX_TAB_GROUP_HOST } from '@cngx/common/tabs';\n\nimport { CNGX_MAT_TABS_REGISTRY_HOST } from './mat-tabs-registry.directive';\n\n/**\n * Per-tab direct invalid flag for `[cngxMatTabs]` - the simple-case\n * sibling to `[cngxMatTabError]`. Attach to a `<mat-tab>`; the bound\n * `string | boolean` writes the per-handle `directError` slot, which\n * folds into the handle's `hasError` / `errorMessage`. A non-empty\n * string doubles as the SR descriptor message; `true` marks the tab\n * invalid with no message; `false` / `''` clear it.\n *\n * Symmetric with `[cngxMatTabError]` (one directive, one\n * responsibility - Pillar 3): the aggregator stays the rich\n * multi-source path, this is the \"this tab is invalid\" marker that\n * needs no aggregator boilerplate. A bare `cngxMatTabErrorFlag`\n * attribute (no brackets) binds the empty string and is coerced to\n * `true` so presence alone marks the tab invalid.\n *\n * Locates its target via {@link CNGX_MAT_TABS_REGISTRY_HOST}, tracks\n * `presenter.tabs()` to recover from the content-init race, and\n * clears the slot on destroy - exactly as {@link CngxMatTabError}.\n *\n * @category ui/mat-tabs\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/mat-tab-error-flag.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMatTabs, CngxMatTabError, CngxMatTabsRegistry\n */\n@Directive({\n selector: '[cngxMatTabErrorFlag]',\n exportAs: 'cngxMatTabErrorFlag',\n standalone: true,\n})\nexport class CngxMatTabErrorFlag {\n private readonly matTab = inject(MatTab, { self: true });\n private readonly registry = inject(CNGX_MAT_TABS_REGISTRY_HOST, {\n host: true,\n });\n private readonly presenter = inject(CNGX_TAB_GROUP_HOST);\n private readonly destroyRef = inject(DestroyRef);\n\n readonly error = input<string | boolean, string | boolean>(false, {\n alias: 'cngxMatTabErrorFlag',\n transform: (value) => (value === '' ? true : value),\n });\n\n constructor() {\n effect(() => {\n // Same content-init race as `[cngxMatTabError]` - the registry's\n // `contentChildren(MatTab)` query and our injection land in the\n // same microtask, so tracking `presenter.tabs()` re-fires the\n // effect once our handle is registered. `untracked` around the\n // write keeps the slot pump out of the reactive graph.\n const error = this.error();\n this.presenter.tabs();\n\n untracked(() => {\n const setup = this.registry.getHandleSetup(this.matTab);\n setup?.directError.set(error);\n });\n });\n\n this.destroyRef.onDestroy(() => {\n const setup = this.registry.getHandleSetup(this.matTab);\n setup?.directError.set(false);\n });\n }\n}\n","/**\n * @module @cngx/ui/mat-tabs\n *\n * Material instrumentation directive for `<mat-tab-group>`.\n */\nexport { CngxMatTabs } from './mat-tabs.directive';\nexport { CngxMatTabNav } from './mat-tab-nav.directive';\nexport { CngxMatTabLink } from './mat-tab-link.directive';\nexport { CngxMatTabError } from './mat-tab-error.directive';\nexport { CngxMatTabErrorFlag } from './mat-tab-error-flag.directive';\nexport {\n CNGX_MAT_TABS_REGISTRY_HOST,\n CngxMatTabsRegistry,\n type CngxMatTabsRegistryHost,\n} from './mat-tabs-registry.directive';\nexport {\n CngxMatTabAggregatorContent,\n type CngxMatTabAggregatorContentContext,\n} from './decorations/mat-tab-aggregator-content.directive';\nexport {\n CngxMatTabRejectionContent,\n type CngxMatTabRejectionContentContext,\n} from './decorations/mat-tab-rejection-content.directive';\nexport type { CngxMatTabHalfWiredSlotSink } from './decorations/half-wired-slot-sink';\nexport {\n CNGX_MAT_TABS_CONFIG,\n type CngxMatTabsConfig,\n type CngxMatTabsConfigFeature,\n injectMatTabsConfig,\n provideMatTabsConfig,\n provideMatTabsConfigAt,\n withAnchorRetryAttempts,\n withHalfWiredSlotSink,\n} from './mat-tabs-config';\nexport {\n CNGX_MAT_TAB_HANDLE_FACTORY,\n createMatTabHandle,\n type CngxMatTabHandleFactory,\n} from './material-bridge/handle';\nexport { MaterialPrivateSurfaces } from './material-bridge/private-surfaces';\nexport { createCngxMatTabOverflowDomAdapter } from './overflow/mat-tab-overflow-dom-adapter';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i2.CngxMatTabsRegistry"],"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;AAMH;AACM,IAAW;AAAjB,CAAA,UAAiB,uBAAuB,EAAA;AA2CtC;;;;;;;;AAQG;IACU,uBAAA,CAAA,oBAAoB,GAAG,cAAc;AAElD;;;;;;;AAOG;IACU,uBAAA,CAAA,2BAA2B,GAAG,qBAAqB;AAEhE;;;;;;;AAOG;IACU,uBAAA,CAAA,oCAAoC,GAC/C,8BAA8B;AAClC,CAAC,EA1EgB,uBAAuB,KAAvB,uBAAuB,GAAA,EAAA,CAAA,CAAA;;ACZxC;;;;;;;;;;;;;;;;;;AAkBG;AAEH;;;;;;;;;;;;;AAaG;AACH,SAAS,iCAAiC,CACxC,EAAe,EACf,aAAqB,EACrB,QAAmB,EACnB,oBAAmC,EAAA;IAEnC,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,kBAAkB,CAAC;IACnD,MAAM,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE;AAClE,IAAA,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,C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,QAAA,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,MAAK;AAC7B,YAAA,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC;AACvD,YAAA,KAAK,EAAE,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC;AAC/B,QAAA,CAAC,CAAC;IACJ;uGAjCW,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAnB,mBAAmB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,MAAA,EAAA,EAAA,KAAA,EAAA,EAAA,iBAAA,EAAA,OAAA,EAAA,UAAA,EAAA,qBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAL/B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,uBAAuB;AACjC,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACpCD;;;;AAIG;;ACJH;;AAEG;;;;"}
1
+ {"version":3,"file":"cngx-ui-mat-tabs.mjs","sources":["../../../projects/ui/mat-tabs/decorations/half-wired-slot-sink.ts","../../../projects/ui/mat-tabs/material-bridge/private-surfaces.ts","../../../projects/ui/mat-tabs/decorations/decoration-projectors.ts","../../../projects/ui/mat-tabs/decorations/aggregated-error-tabs.ts","../../../projects/ui/mat-tabs/mat-tabs-config.ts","../../../projects/ui/mat-tabs/decorations/decoration-templates.ts","../../../projects/ui/mat-tabs/decorations/mat-tab-aggregator-content.directive.ts","../../../projects/ui/mat-tabs/decorations/mat-tab-rejection-content.directive.ts","../../../projects/ui/mat-tabs/material-bridge/live-region.ts","../../../projects/ui/mat-tabs/decorations/rejection-state.ts","../../../projects/ui/mat-tabs/material-bridge/ordered-registration.ts","../../../projects/ui/mat-tabs/material-bridge/handle.ts","../../../projects/ui/mat-tabs/mat-tabs-registry.directive.ts","../../../projects/ui/mat-tabs/overflow/mat-tab-overflow-dom-adapter.ts","../../../projects/ui/mat-tabs/mat-tabs.directive.ts","../../../projects/ui/mat-tabs/mat-tab-nav.directive.ts","../../../projects/ui/mat-tabs/mat-tab-link.directive.ts","../../../projects/ui/mat-tabs/mat-tab-error-target.ts","../../../projects/ui/mat-tabs/mat-tab-error.directive.ts","../../../projects/ui/mat-tabs/mat-tab-error-flag.directive.ts","../../../projects/ui/mat-tabs/public-api.ts","../../../projects/ui/mat-tabs/cngx-ui-mat-tabs.ts"],"sourcesContent":["import { cngxDevWarn } from '@cngx/utils';\n\n/**\n * Sink callback invoked by `[cngxMatTabs]`'s aggregator-decoration\n * projector when a consumer wires exactly one of\n * `*cngxMatTabAggregatorContent` (the slot template) or\n * `ViewContainerRef` (the embedded-view host) - the half-wired-slot\n * misconfiguration. The projector silently falls back to the\n * imperative `textContent` path when this happens; the sink is the\n * only deliberate signal that the consumer's slot template will not\n * render.\n *\n * Override via `provideMatTabsConfig(withHalfWiredSlotSink(fn))` to\n * wire production telemetry (Sentry breadcrumbs, custom logger, CI\n * fail-fast). The library default is a dev-mode `console.warn`; the\n * exported {@link CNGX_DEFAULT_HALF_WIRED_SLOT_SINK} value lets test\n * doubles compose against a stable reference.\n *\n * @category ui/mat-tabs\n */\nexport type CngxMatTabHalfWiredSlotSink = (\n missing: 'contentTemplate' | 'viewContainerRef',\n) => void;\n\n/**\n * Default sink - gated on dev-mode. Production callers see no\n * output; production telemetry lands only when a consumer overrides\n * via `withHalfWiredSlotSink(fn)`.\n *\n * @internal - exported only for {@link CngxMatTabsConfig.halfWiredSlotSink}'s\n * library default. Consumers should override via the config feature\n * rather than reach for this reference directly.\n */\nexport const CNGX_DEFAULT_HALF_WIRED_SLOT_SINK: CngxMatTabHalfWiredSlotSink = (\n missing,\n) => {\n if (!(typeof ngDevMode !== 'undefined' && ngDevMode)) {\n return;\n }\n cngxDevWarn(\n 'CNGX3006',\n '[cngxMatTabs] aggregator-content slot half-wired - ' +\n `\\`${missing}\\` is missing while the other half is supplied. ` +\n 'The decoration projector will silently fall back to the ' +\n 'imperative `textContent` path, and the consumer-projected ' +\n '`*cngxMatTabAggregatorContent` template will never render. ' +\n 'Wire both halves on the [cngxMatTabs] directive (or neither).',\n );\n};\n","/**\n * Centralised type façade and selector constants for every Angular\n * Material internal surface cngx Material-bridge code couples to.\n * Replaces the per-call-site `as unknown as { _foo? }` casts and\n * the scattered `'.mat-mdc-tab*'` string literals with a single\n * grep target.\n *\n * Every leading-underscore field cngx reaches into and every\n * Material-internal CSS selector cngx queries against has its\n * declaration here. A Material-version upgrade audit only needs to\n * grep this file. The grep value is the consumer-facing benefit, so\n * this namespace is part of the published surface of\n * `@cngx/ui/mat-tabs` (re-exported from the package barrel) rather\n * than a private implementation detail.\n *\n * The grouping uses a TypeScript `namespace` so a single\n * `MaterialPrivateSurfaces.<member>` access path covers both the\n * type façades and the selector constants. The TS namespace also\n * lets cross-package consumers (`@cngx/ui/mat-stepper`) read the\n * grouped name through ESLint's `@typescript-eslint` type resolver\n * - a flat `export * as` re-export from `public-api.ts` does not\n * resolve nested members through the path-alias.\n *\n * @category ui/mat-tabs\n */\n\nimport type { TemplateRef, WritableSignal } from '@angular/core';\nimport type { MatStepperIconContext } from '@angular/material/stepper';\nimport type { Subject } from 'rxjs';\n\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace MaterialPrivateSurfaces {\n /**\n * Subset of Material's `MatTab` carrying the `_stateChanges`\n * Subject. The leading underscore signals\n * Material-internal-by-convention, even though the field is\n * `readonly` on the public class surface. The Subject emits\n * `void` whenever a `MatTab` input (`textLabel`, `disabled`, …)\n * changes; cngx bridges it into the Signal graph via\n * `toSignal(matTab._stateChanges)` because Material exposes no\n * public reactive surface for input changes.\n */\n export interface StateChangeSource {\n readonly _stateChanges: Subject<void>;\n }\n\n /**\n * Subset of Material's `MatTab` carrying the `_closestTabGroup`\n * back-reference (the owning `MatTabGroup`, resolved via DI at\n * construction). Material's own `_allTabs` filter compares against\n * it for exactly the reason cngx does: a `descendants: true` query\n * also surfaces tabs of a nested `<mat-tab-group>`, and only the\n * ownership comparison separates them. Typed `unknown` because the\n * upstream declaration is `any` - cngx only ever identity-compares.\n */\n export interface ClosestTabGroupSource {\n readonly _closestTabGroup: unknown;\n }\n\n /**\n * Subset of Material's `MatStepper` carrying the `_iconOverrides`\n * map. `<cngx-mat-stepper>` patches this map inside\n * `afterNextRender` to forward consumer-projected\n * `<ng-template matStepperIcon>` declarations through the wrapper\n * into Material's per-header indicator bindings (the only\n * deterministic forwarding path - `<ng-content>` projection\n * inside `<mat-stepper>` does not reach\n * `@ContentChildren(MatStepperIcon)` due to content-init\n * lifecycle ordering).\n */\n export interface IconOverrideHost {\n _iconOverrides?: Record<string, TemplateRef<MatStepperIconContext>>;\n }\n\n /**\n * Subset of CDK's `CdkStep` carrying the `_completedOverride`\n * `WritableSignal`. `MatStep.completed`'s getter reads this\n * signal, so cngx's per-step `state` computed transitively tracks\n * it through the getter and re-fires whenever Material flips\n * completion. Documented limitation: `hasError` writes that are\n * not paired with a `completed` change do not retrigger the\n * computed - sharper note lives on `createMatStepHandle`'s JSDoc.\n */\n export interface CompletedOverrideSource {\n readonly _completedOverride: WritableSignal<boolean | null>;\n }\n\n /**\n * `.mat-mdc-tab` - the class Material applies to the rendered\n * tab `<button>` elements inside `MatTabHeader`. cngx\n * index-correlates `presenter.tabs()` registration order against\n * `host.querySelectorAll('.mat-mdc-tab')` because `MatTab` is a\n * portal - the rendered buttons live inside `MatTabHeader`'s\n * template, not on the `<mat-tab>` declaration site, and Material\n * exposes no public per-tab element accessor.\n */\n export const MAT_MDC_TAB_SELECTOR = '.mat-mdc-tab';\n\n /**\n * `.mat-mdc-tab-header` - the strip element rendered by\n * `MatTabHeader`. `[cngxMatTabs]` walks\n * `host.querySelector('.mat-mdc-tab-header')` to locate the mount\n * anchor for the cngx overflow molecule (so the More button pins\n * inside Material's strip rather than as a sibling of\n * `<mat-tab-group>`).\n */\n export const MAT_MDC_TAB_HEADER_SELECTOR = '.mat-mdc-tab-header';\n\n /**\n * `.mat-mdc-tab-label-container` - Material's IO-friendly scroll\n * viewport ancestor of the rendered tab buttons. The Material-\n * twin overflow adapter walks `host → header → any tab → closest\n * label-container` to attach the molecule's\n * `IntersectionObserver` against the same element Material\n * itself scrolls.\n */\n export const MAT_MDC_TAB_LABEL_CONTAINER_SELECTOR =\n '.mat-mdc-tab-label-container';\n}\n","import {\n afterNextRender,\n type DestroyRef,\n effect,\n type EmbeddedViewRef,\n type Injector,\n type Renderer2,\n runInInjectionContext,\n type Signal,\n type TemplateRef,\n untracked,\n type ViewContainerRef,\n} from '@angular/core';\nimport { CNGX_TABS_GLYPHS } from '@cngx/common/tabs';\nimport { cngxDevWarn } from '@cngx/utils';\n\nimport { CNGX_DEFAULT_HALF_WIRED_SLOT_SINK } from './half-wired-slot-sink';\nimport type { CngxMatTabAggregatorContentContext } from './mat-tab-aggregator-content.directive';\nimport type { CngxMatTabRejectionContentContext } from './mat-tab-rejection-content.directive';\nimport { MaterialPrivateSurfaces } from '../material-bridge/private-surfaces';\n\n/**\n * Package-private DOM-mutation projectors for `[cngxMatTabs]`.\n *\n * - {@link createMatTabRejectionDecoration} - mirrors\n * `presenter.lastFailedIndex` onto the matching `.mat-mdc-tab` as a\n * class flag, a `data-reason` attribute, an `aria-hidden` glyph span\n * and a hidden `cngx-sr-only` descriptor span linked via\n * `aria-describedby`. `aria-invalid` is intentionally absent: ARIA\n * 1.2 scopes it to form-field vocabulary, not `role=\"tab\"`.\n * - {@link createMatTabAggregatorDecoration} - projects each handle's\n * `shouldShow()` flag onto the matching button as a class +\n * descriptor span pair, same `aria-describedby` token-append pattern.\n *\n * Distinct descriptor-id suffixes (`-rejected` vs `-errors`) let both\n * projectors stack on the same target without collision; the shared\n * token-list append preserves consumer-supplied tokens.\n *\n * @internal package-private - consumers bind `[cngxMatTabError]` on\n * each `<mat-tab>`; the directive owns the projection mechanics.\n */\n\n/**\n * Diff-restore the `aria-describedby` token list after a decoration's\n * descriptor span detaches - drops the decoration's own id token from\n * the live attribute, leaving any third-party tokens written between\n * apply and clear (tooltip refs, Material's own runtime additions)\n * intact. Treats the attribute as a token-set per the cngx ARIA-by-value\n * rule, not as a single-owner string.\n *\n * Empty-result + originally-absent attribute removes the attribute\n * entirely - a dangling `aria-describedby=\"\"` would be a malformed\n * reference in some AT readers.\n *\n * @internal\n */\nfunction restoreAriaDescribedbyExceptToken(\n el: HTMLElement,\n tokenToRemove: string,\n renderer: Renderer2,\n priorAriaDescribedby: string | null,\n): void {\n const current = el.getAttribute('aria-describedby');\n const tokens = current ? current.split(/\\s+/).filter(Boolean) : [];\n const remaining = tokens.filter((t) => t !== tokenToRemove);\n if (remaining.length === 0) {\n if (priorAriaDescribedby === null) {\n renderer.removeAttribute(el, 'aria-describedby');\n } else {\n renderer.setAttribute(el, 'aria-describedby', priorAriaDescribedby);\n }\n return;\n }\n renderer.setAttribute(el, 'aria-describedby', remaining.join(' '));\n}\n\n/**\n * Options for {@link createMatTabRejectionDecoration}.\n */\nexport interface CngxMatTabRejectionDecorationOptions {\n /** Host element whose subtree contains the `.mat-mdc-tab` buttons. */\n readonly hostEl: HTMLElement;\n /**\n * Stable id of the currently-failed target, or `null` when no\n * rejection is pinned. Sole effect-trigger; the descriptor span's\n * DOM id is `${failedHandleId}-rejected`.\n */\n readonly failedHandleId: Signal<string | null>;\n /**\n * Index of the currently-failed target - `undefined` when no\n * rejection is pinned. Read inside `untracked()` after\n * `failedHandleId` fires.\n */\n readonly failedIndex: Signal<number | undefined>;\n /**\n * Reactive descriptor phrase for the SR-only span. Typical\n * resolution at the caller: i18n `commitRolledBackTo(originLabel)`\n * when origin resolves, `commitFailedRetry` otherwise. A separate\n * effect tracks this signal so late label resolution mutates the\n * span in place rather than rebuilding it. Empty string keeps the\n * span mounted - `aria-describedby` must never dangle.\n */\n readonly descriptorText: Signal<string>;\n readonly renderer: Renderer2;\n readonly injector: Injector;\n readonly destroyRef: DestroyRef;\n /** Default: `.mat-mdc-tab`. Override only for testing. */\n readonly buttonSelector?: string;\n /** Default: `cngx-mat-tab--error`. */\n readonly className?: string;\n /** Default: `cngx-sr-only`. */\n readonly srOnlyClassName?: string;\n /** Default: `cngx-mat-tab__rejection-icon`. */\n readonly glyphClassName?: string;\n /**\n * Suffix appended to `failedHandleId` for the descriptor span's\n * DOM id. Default `'rejected'` - distinct from the aggregator\n * projector's `'errors'` so both can stack on the same target.\n */\n readonly descriptorIdSuffix?: string;\n /** Default: `5`. Cap on `afterNextRender` retry recursion. */\n readonly maxRetryAttempts?: number;\n /**\n * Optional dev-mode sink invoked when the retry ceiling is hit.\n * Defaults to a `console.warn` gated on `ngDevMode`. Mirrors the\n * aggregator projector's same-name opt.\n */\n readonly onMaxRetriesReached?: () => void;\n /**\n * Optional `*cngxMatTabRejectionContent` slot template. When\n * non-null AND `viewContainerRef` is supplied, the projector\n * renders an embedded view into the SR span; otherwise it falls\n * back to the imperative `textContent` path.\n */\n readonly contentTemplate?: Signal<\n TemplateRef<CngxMatTabRejectionContentContext> | null\n >;\n /**\n * Required half of the slot path. Without it, the projector\n * silently degrades to the imperative descriptor path. Mirrors\n * the aggregator projector's same-name opt.\n */\n readonly viewContainerRef?: ViewContainerRef;\n /**\n * Reactive origin label feeding the slot context's `originLabel`.\n * Read inside `untracked()` during apply; the `descriptorText`\n * re-fire effect destroys + remounts the embedded view, so the\n * value is always read at fire time.\n */\n readonly originLabel?: Signal<string | undefined>;\n /**\n * Reactive outcome kind feeding the slot context's `reason`. Read at\n * fire time like {@link originLabel}; a kind change also changes\n * `descriptorText`, so the view remounts with the new value. Also\n * drives `data-reason` on the decorated tab and its glyph span, and\n * the glyph itself (`refusedIcon` or `rejectionIcon`), updated in place\n * when the kind changes on the same tab. Omitted, every consumer reads\n * `'failed'`.\n */\n readonly reason?: Signal<'refused' | 'failed' | undefined>;\n}\n\n/**\n * Mounts the sticky-rejection decoration projector. Class +\n * descriptor span follow `failedHandleId` reactively; cleared on\n * directive destroy. Single-target by contract (matches the\n * presenter's single-slot `lastFailedIndex`).\n *\n * Two effects split the work: one tracks `failedHandleId` and\n * mounts/unmounts the span; the other tracks `descriptorText` and\n * mutates `textContent` in place. The split keeps late label\n * resolution O(1) - no DOM rebuild when the origin label arrives\n * via a downstream `tabs()` re-emission.\n *\n * Race recovery - when the effect fires before MatTabHeader has\n * rendered the matching button (initial-render race), the failed id\n * is NOT latched (a latched id would suppress every later attempt\n * for the same failure) and a single `afterNextRender` retry is\n * scheduled, bounded by `maxRetryAttempts` - same recovery shape as\n * the aggregator projector.\n *\n * @internal\n */\nexport function createMatTabRejectionDecoration(\n opts: CngxMatTabRejectionDecorationOptions,\n): void {\n const buttonSelector =\n opts.buttonSelector ?? MaterialPrivateSurfaces.MAT_MDC_TAB_SELECTOR;\n const className = opts.className ?? 'cngx-mat-tab--error';\n const srOnlyClassName = opts.srOnlyClassName ?? 'cngx-sr-only';\n const glyphClassName = opts.glyphClassName ?? 'cngx-mat-tab__rejection-icon';\n const descriptorIdSuffix = opts.descriptorIdSuffix ?? 'rejected';\n const maxRetryAttempts = opts.maxRetryAttempts ?? 5;\n let pendingRetry = false;\n let retryAttempts = 0;\n // Slot path needs both halves; either alone degrades to imperative\n // textContent. No diagnostic - single in-package consumer always\n // passes both.\n const slotEnabled = !!opts.contentTemplate && !!opts.viewContainerRef;\n let decoratedEl: HTMLElement | null = null;\n // Cached across the projector's lifetime - reusing the same node\n // keeps AT-reader / observer references live across A→B→A flips.\n let cachedSpan: HTMLElement | null = null;\n // The visible glyph rides its own `aria-hidden` span: `::before` is\n // Material's focus indicator, `::after` the has-errors badge.\n let cachedGlyph: HTMLElement | null = null;\n let priorAriaDescribedby: string | null = null;\n // Pillar 1 - short-circuits structurally-identical re-emissions of\n // `failedHandleId` so a `tabs()` re-eval doesn't clobber the AT\n // descriptor mid-flight.\n let lastAppliedId: string | null = null;\n let embeddedView:\n | EmbeddedViewRef<CngxMatTabRejectionContentContext>\n | undefined;\n\n const destroyEmbeddedView = (): void => {\n if (!embeddedView) {\n return;\n }\n embeddedView.destroy();\n embeddedView = undefined;\n if (cachedSpan) {\n while (cachedSpan.firstChild) {\n opts.renderer.removeChild(cachedSpan, cachedSpan.firstChild);\n }\n }\n };\n\n const writeDescriptorContent = (\n span: HTMLElement,\n handleId: string,\n text: string,\n ): void => {\n const tplSignal = opts.contentTemplate;\n const vcr = opts.viewContainerRef;\n const tpl = tplSignal && vcr ? tplSignal() : null;\n if (tpl && vcr) {\n destroyEmbeddedView();\n const context: CngxMatTabRejectionContentContext = {\n failedHandleId: handleId,\n originLabel: opts.originLabel?.(),\n fallbackText: text,\n reason: opts.reason?.() ?? 'failed',\n };\n const view = vcr.createEmbeddedView(tpl, context, {\n injector: opts.injector,\n });\n // Force CD before moving rootNodes out of the embedded view's\n // logical parent - zoneless + OnPush would otherwise leave the\n // first SR read stale.\n view.detectChanges();\n for (const node of view.rootNodes) {\n opts.renderer.appendChild(span, node);\n }\n embeddedView = view;\n return;\n }\n // Imperative fallback - also covers the path where a slot was\n // previously bound and is now removed (destroy any prior view).\n destroyEmbeddedView();\n opts.renderer.setProperty(span, 'textContent', text);\n };\n\n const currentReason = (): 'refused' | 'failed' => opts.reason?.() ?? 'failed';\n\n const writeReason = (target: HTMLElement, glyph: HTMLElement): void => {\n const reason = currentReason();\n opts.renderer.setAttribute(target, 'data-reason', reason);\n opts.renderer.setAttribute(glyph, 'data-reason', reason);\n opts.renderer.setProperty(\n glyph,\n 'textContent',\n reason === 'refused' ? CNGX_TABS_GLYPHS.refusedIcon : CNGX_TABS_GLYPHS.rejectionIcon,\n );\n };\n\n const clearDecoration = (): void => {\n if (!decoratedEl || !cachedSpan) {\n return;\n }\n const ownTokenId = cachedSpan.id;\n destroyEmbeddedView();\n opts.renderer.removeClass(decoratedEl, className);\n opts.renderer.removeAttribute(decoratedEl, 'data-reason');\n if (cachedGlyph?.parentNode) {\n opts.renderer.removeChild(cachedGlyph.parentNode, cachedGlyph);\n }\n opts.renderer.removeChild(decoratedEl, cachedSpan);\n // `cachedSpan` deliberately retained - reused on the next apply.\n restoreAriaDescribedbyExceptToken(\n decoratedEl,\n ownTokenId,\n opts.renderer,\n priorAriaDescribedby,\n );\n decoratedEl = null;\n priorAriaDescribedby = null;\n };\n\n const applyDecorationAt = (failedIdx: number, handleId: string): boolean => {\n clearDecoration();\n const buttons = opts.hostEl.querySelectorAll<HTMLElement>(buttonSelector);\n const targetEl = buttons.item(failedIdx);\n if (!targetEl) {\n return false;\n }\n opts.renderer.addClass(targetEl, className);\n\n let glyph = cachedGlyph;\n if (!glyph) {\n glyph = opts.renderer.createElement('span') as HTMLElement;\n opts.renderer.addClass(glyph, glyphClassName);\n opts.renderer.setAttribute(glyph, 'aria-hidden', 'true');\n cachedGlyph = glyph;\n }\n writeReason(targetEl, glyph);\n // On the tab itself: the disc is absolutely positioned at the tab's\n // corner, and `.mdc-tab__content` is a positioning context of its own.\n opts.renderer.appendChild(targetEl, glyph);\n\n const spanId = `${handleId}-${descriptorIdSuffix}`;\n let span = cachedSpan;\n if (!span) {\n span = opts.renderer.createElement('span') as HTMLElement;\n opts.renderer.addClass(span, srOnlyClassName);\n cachedSpan = span;\n }\n // Always rewrite id + textContent - the cached span carries stale\n // values from the prior mount. The live-text effect below picks\n // up subsequent `descriptorText` changes in place.\n opts.renderer.setAttribute(span, 'id', spanId);\n opts.renderer.appendChild(targetEl, span);\n writeDescriptorContent(span, handleId, opts.descriptorText());\n\n // Renderer2 has no `getAttribute` counterpart - read off the\n // native element. Browser-only; SSR would need a platform adapter.\n const prior = targetEl.getAttribute('aria-describedby');\n const tokens = prior ? prior.split(/\\s+/).filter(Boolean) : [];\n if (!tokens.includes(spanId)) {\n tokens.push(spanId);\n }\n opts.renderer.setAttribute(targetEl, 'aria-describedby', tokens.join(' '));\n\n decoratedEl = targetEl;\n priorAriaDescribedby = prior;\n return true;\n };\n\n const applyOrScheduleRetry = (id: string): void => {\n const idx = opts.failedIndex();\n if (idx === undefined) {\n clearDecoration();\n lastAppliedId = null;\n return;\n }\n if (applyDecorationAt(idx, id)) {\n lastAppliedId = id;\n retryAttempts = 0;\n return;\n }\n // Initial-render race - the matching button is not stamped yet.\n // The id is deliberately NOT latched (a latched id would\n // short-circuit every later run for the same failure); retry\n // once per render, bounded like the aggregator projector.\n if (pendingRetry) {\n return;\n }\n if (retryAttempts >= maxRetryAttempts) {\n retryAttempts = 0;\n const sink =\n opts.onMaxRetriesReached ??\n (typeof ngDevMode !== 'undefined' && ngDevMode\n ? defaultRetryCeilingWarn(maxRetryAttempts, 'rejection')\n : noop);\n sink();\n return;\n }\n pendingRetry = true;\n retryAttempts++;\n afterNextRender(\n () => {\n pendingRetry = false;\n const current = opts.failedHandleId();\n if (current === null || current === lastAppliedId) {\n return;\n }\n applyOrScheduleRetry(current);\n },\n { injector: opts.injector },\n );\n };\n\n runInInjectionContext(opts.injector, () => {\n effect(() => {\n const id = opts.failedHandleId();\n untracked(() => {\n if (id === lastAppliedId) {\n return;\n }\n if (id === null) {\n clearDecoration();\n lastAppliedId = null;\n return;\n }\n applyOrScheduleRetry(id);\n });\n });\n\n // Reason effect - a refusal and a failure can follow each other on\n // the same tab (same handle id, so the mount effect short-circuits);\n // the attribute and the glyph follow the kind in place.\n effect(() => {\n currentReason();\n untracked(() => {\n if (decoratedEl === null || cachedGlyph === null) {\n return;\n }\n writeReason(decoratedEl, cachedGlyph);\n });\n });\n\n // Live-text effect - tracks `descriptorText` plus the slot\n // template (when wired) so a late-mounted template re-renders\n // into the existing span. Mount-state checks live in untracked.\n effect(() => {\n const text = opts.descriptorText();\n const tplSignal = opts.contentTemplate;\n if (slotEnabled && tplSignal) {\n tplSignal();\n }\n untracked(() => {\n if (decoratedEl === null || cachedSpan === null) {\n return;\n }\n const id = opts.failedHandleId();\n if (id === null) {\n return;\n }\n writeDescriptorContent(cachedSpan, id, text);\n });\n });\n });\n\n opts.destroyRef.onDestroy(clearDecoration);\n}\n\n/**\n * One per-tab error decoration entry. Caller pre-filters to handles\n * whose folded `hasError()` is `true` (direct flag or a revealed\n * aggregator).\n *\n * `count` / `label` feed the optional `*cngxMatTabAggregatorContent`\n * slot context ({@link CngxMatTabAggregatorContentContext}); the\n * imperative-fallback path uses `announcement` only and ignores the\n * two extra fields. They stay on the shape so the contract is\n * uniform across render paths.\n */\nexport interface CngxMatTabAggregatorErrorEntry {\n readonly idx: number;\n readonly id: string;\n readonly announcement: string;\n /** Aggregated error count - feeds the slot context's `count` field. */\n readonly count: number;\n /** Resolved tab label - feeds the slot context's `label` field. */\n readonly label: string;\n}\n\n/**\n * Options for {@link createMatTabAggregatorDecoration}.\n */\nexport interface CngxMatTabAggregatorDecorationOptions {\n readonly hostEl: HTMLElement;\n /**\n * Reactive list of tabs in error (folded `hasError()`) -\n * caller pre-filters; sole effect-trigger.\n */\n readonly errorTabs: Signal<readonly CngxMatTabAggregatorErrorEntry[]>;\n readonly renderer: Renderer2;\n readonly injector: Injector;\n readonly destroyRef: DestroyRef;\n /** Default: `.mat-mdc-tab`. Override only for testing. */\n readonly buttonSelector?: string;\n /** Default: `cngx-mat-tab--has-errors`. */\n readonly className?: string;\n /** Default: `cngx-sr-only`. */\n readonly srOnlyClassName?: string;\n /** Default: `5`. Cap on `afterNextRender` retry recursion. */\n readonly maxRetryAttempts?: number;\n /**\n * Optional dev-mode sink invoked when the retry ceiling is hit.\n * Defaults to a `console.warn` gated on `ngDevMode`.\n */\n readonly onMaxRetriesReached?: () => void;\n /**\n * Optional `*cngxMatTabAggregatorContent` template. When non-null\n * AND `viewContainerRef` is supplied, the projector renders an\n * embedded view per entry; otherwise it falls back to the\n * imperative `textContent` path.\n */\n readonly contentTemplate?: Signal<\n TemplateRef<CngxMatTabAggregatorContentContext> | null\n >;\n /**\n * Required half of the slot path. Without it, the projector\n * silently degrades to the imperative descriptor path.\n */\n readonly viewContainerRef?: ViewContainerRef;\n /**\n * Sink fired when exactly one of `contentTemplate` /\n * `viewContainerRef` is supplied - the projector is mode-agnostic\n * so the dev-vs-prod gate lives in whichever sink the caller\n * passes. `[cngxMatTabs]` resolves this from\n * `provideMatTabsConfig(withHalfWiredSlotSink(fn))`; the default\n * is a dev-mode `console.warn`.\n */\n readonly onHalfWiredSlot?: (\n missing: 'contentTemplate' | 'viewContainerRef',\n ) => void;\n}\n\n/**\n * Mounts the per-tab aggregator decoration projector. Class +\n * descriptor span + `aria-describedby` token follow `errorTabs`\n * reactively; pruned on entry drop and on directive destroy.\n *\n * Race recovery - when the effect fires before MatTabHeader has\n * rendered the matching buttons (initial-render race), schedules a\n * single `afterNextRender` retry, bounded by `maxRetryAttempts`.\n *\n * @internal\n */\nexport function createMatTabAggregatorDecoration(\n opts: CngxMatTabAggregatorDecorationOptions,\n): void {\n const buttonSelector =\n opts.buttonSelector ?? MaterialPrivateSurfaces.MAT_MDC_TAB_SELECTOR;\n const className = opts.className ?? 'cngx-mat-tab--has-errors';\n const srOnlyClassName = opts.srOnlyClassName ?? 'cngx-sr-only';\n const maxRetryAttempts = opts.maxRetryAttempts ?? 5;\n // Slot path needs both halves; either alone degrades to imperative\n // textContent. Re-evaluated per fire so a lazy-mounted template\n // (`*ngIf` / `@defer`) picks up on first materialisation.\n const isFullyWired = (): boolean =>\n !!opts.contentTemplate && !!opts.viewContainerRef;\n // Half-wired diagnostic - graceful degradation hides the mistake\n // at runtime, so the signal has to come from a deliberate sink.\n if (!isFullyWired() && (opts.contentTemplate || opts.viewContainerRef)) {\n const missing: 'contentTemplate' | 'viewContainerRef' =\n opts.contentTemplate ? 'viewContainerRef' : 'contentTemplate';\n const sink =\n opts.onHalfWiredSlot ??\n (typeof ngDevMode !== 'undefined' && ngDevMode\n ? CNGX_DEFAULT_HALF_WIRED_SLOT_SINK\n : undefined);\n sink?.(missing);\n }\n\n const decorated = new Map<\n string,\n {\n el: HTMLElement;\n descriptorSpan: HTMLElement;\n priorAriaDescribedby: string | null;\n /**\n * Embedded view rendered from `contentTemplate` when bound.\n * Owned by the entry so re-decorations can destroy the prior\n * view before mounting a fresh one (every signal-driven\n * context update goes through destroy + remount; embedded\n * views do not expose a context-mutation API in the\n * standalone-component world that doesn't risk stale\n * `let-` bindings).\n */\n embeddedView?: EmbeddedViewRef<CngxMatTabAggregatorContentContext>;\n }\n >();\n let pendingRetry = false;\n let retryAttempts = 0;\n\n const destroyEmbeddedView = (entry: {\n descriptorSpan: HTMLElement;\n embeddedView?: EmbeddedViewRef<CngxMatTabAggregatorContentContext>;\n }): void => {\n if (!entry.embeddedView) {\n return;\n }\n entry.embeddedView.destroy();\n entry.embeddedView = undefined;\n // The rendered nodes live under the descriptor span via appendChild;\n // EmbeddedViewRef.destroy() does not detach them, so clear manually.\n while (entry.descriptorSpan.firstChild) {\n opts.renderer.removeChild(\n entry.descriptorSpan,\n entry.descriptorSpan.firstChild,\n );\n }\n };\n\n const writeDescriptorContent = (\n entry: {\n descriptorSpan: HTMLElement;\n embeddedView?: EmbeddedViewRef<CngxMatTabAggregatorContentContext>;\n },\n announcement: string,\n context: CngxMatTabAggregatorContentContext,\n ): void => {\n const tplSignal = opts.contentTemplate;\n const vcr = opts.viewContainerRef;\n const tpl = tplSignal && vcr ? tplSignal() : null;\n if (tpl && vcr) {\n destroyEmbeddedView(entry);\n const view = vcr.createEmbeddedView(tpl, context, {\n injector: opts.injector,\n });\n // See the rejection projector's identical call site for the\n // detached-view CD rationale (rootNodes move out of the\n // embedded view's logical parent into an SR-only span).\n view.detectChanges();\n for (const node of view.rootNodes) {\n opts.renderer.appendChild(entry.descriptorSpan, node);\n }\n entry.embeddedView = view;\n return;\n }\n // Imperative fallback - also covers the path where a slot was\n // previously bound and is now removed (destroy any prior view).\n destroyEmbeddedView(entry);\n opts.renderer.setProperty(\n entry.descriptorSpan,\n 'textContent',\n announcement,\n );\n };\n\n const removeDecoration = (id: string): void => {\n const entry = decorated.get(id);\n if (!entry) {\n return;\n }\n const ownTokenId = entry.descriptorSpan.id;\n destroyEmbeddedView(entry);\n opts.renderer.removeClass(entry.el, className);\n opts.renderer.removeChild(entry.el, entry.descriptorSpan);\n restoreAriaDescribedbyExceptToken(\n entry.el,\n ownTokenId,\n opts.renderer,\n entry.priorAriaDescribedby,\n );\n decorated.delete(id);\n };\n\n const applyDecoration = (\n targetEl: HTMLElement,\n entry: CngxMatTabAggregatorErrorEntry,\n ): void => {\n opts.renderer.addClass(targetEl, className);\n\n const spanId = `${entry.id}-errors`;\n const descriptorSpan = opts.renderer.createElement('span') as HTMLElement;\n opts.renderer.addClass(descriptorSpan, srOnlyClassName);\n opts.renderer.setAttribute(descriptorSpan, 'id', spanId);\n opts.renderer.appendChild(targetEl, descriptorSpan);\n\n // See the read-via-nativeElement note in `applyDecorationAt` above -\n // Renderer2 has no `getAttribute` counterpart, so attribute reads\n // go through the native element directly.\n const priorAriaDescribedby = targetEl.getAttribute('aria-describedby');\n const tokens = priorAriaDescribedby\n ? priorAriaDescribedby.split(/\\s+/).filter(Boolean)\n : [];\n if (!tokens.includes(spanId)) {\n tokens.push(spanId);\n }\n opts.renderer.setAttribute(targetEl, 'aria-describedby', tokens.join(' '));\n\n const decoratedEntry: {\n el: HTMLElement;\n descriptorSpan: HTMLElement;\n priorAriaDescribedby: string | null;\n embeddedView?: EmbeddedViewRef<CngxMatTabAggregatorContentContext>;\n } = { el: targetEl, descriptorSpan, priorAriaDescribedby };\n writeDescriptorContent(decoratedEntry, entry.announcement, {\n count: entry.count,\n label: entry.label,\n announcement: entry.announcement,\n });\n decorated.set(entry.id, decoratedEntry);\n };\n\n const sync = (\n errorTabs: readonly CngxMatTabAggregatorErrorEntry[],\n ): void => {\n const liveIds = new Set<string>();\n for (const t of errorTabs) {\n liveIds.add(t.id);\n }\n for (const id of Array.from(decorated.keys())) {\n if (!liveIds.has(id)) {\n removeDecoration(id);\n }\n }\n const buttons = opts.hostEl.querySelectorAll<HTMLElement>(buttonSelector);\n let needsRetry = false;\n for (const entry of errorTabs) {\n const targetEl = buttons.item(entry.idx);\n if (!targetEl) {\n needsRetry = true;\n continue;\n }\n const existing = decorated.get(entry.id);\n if (existing?.el === targetEl) {\n // Same target element: refresh content (slot path destroys +\n // remounts the embedded view; imperative path overwrites the\n // textContent property idempotently).\n writeDescriptorContent(existing, entry.announcement, {\n count: entry.count,\n label: entry.label,\n announcement: entry.announcement,\n });\n continue;\n }\n if (existing) {\n removeDecoration(entry.id);\n }\n applyDecoration(targetEl, entry);\n }\n\n if (!needsRetry) {\n retryAttempts = 0;\n return;\n }\n if (pendingRetry) {\n return;\n }\n if (retryAttempts >= maxRetryAttempts) {\n retryAttempts = 0;\n const sink =\n opts.onMaxRetriesReached ??\n (typeof ngDevMode !== 'undefined' && ngDevMode\n ? defaultRetryCeilingWarn(maxRetryAttempts, 'aggregator')\n : noop);\n sink();\n return;\n }\n pendingRetry = true;\n retryAttempts++;\n afterNextRender(\n () => {\n pendingRetry = false;\n sync(opts.errorTabs());\n },\n { injector: opts.injector },\n );\n };\n\n runInInjectionContext(opts.injector, () => {\n effect(() => {\n // Track the slot template alongside `errorTabs` so a runtime\n // project/remove of `*cngxMatTabAggregatorContent` switches\n // every decorated entry between render paths.\n const errorTabs = opts.errorTabs();\n if (isFullyWired() && opts.contentTemplate) {\n opts.contentTemplate();\n }\n untracked(() => sync(errorTabs));\n });\n });\n\n opts.destroyRef.onDestroy(() => {\n for (const id of Array.from(decorated.keys())) {\n removeDecoration(id);\n }\n });\n}\n\nconst noop = (): void => undefined;\n\nfunction defaultRetryCeilingWarn(\n max: number,\n decoration: 'aggregator' | 'rejection',\n): () => void {\n if (!(typeof ngDevMode !== 'undefined' && ngDevMode)) {\n return noop;\n }\n return () => {\n cngxDevWarn(\n 'CNGX3005',\n `[cngxMatTabs] ${decoration} decoration retry ceiling reached ` +\n `(${max} attempts) - MatTabHeader did not render ` +\n '`.mat-mdc-tab` buttons within the expected window. Likely ' +\n 'cause: Material upgrade broke the `.mat-mdc-tab` selector ' +\n 'contract or a consumer-side render stall. ' +\n 'The decoration may remain visually missing ' +\n 'until the next state change.',\n );\n };\n}\n","import { computed, type Signal } from '@angular/core';\n\nimport type { CngxTabGroupHost, CngxTabHandle, injectTabsI18n } from '@cngx/common/tabs';\n\nimport type { CngxMatTabAggregatorErrorEntry } from './decoration-projectors';\n\n/**\n * Builds the reactive list of tabs in error, in registration (DOM)\n * order. Gates on the handle's folded `hasError()` - the direct\n * `[cngxMatTabErrorFlag]` / `[error]` flag OR the bound aggregator's\n * reveal-gated `shouldShow()` - exactly as `<cngx-tab-group>` gates its\n * badge, so a deferred-reveal aggregator stays silent until revealed.\n * The descriptor phrase mirrors the native `statusPhrase` cascade:\n * aggregator announcement, then the direct-error message, then\n * `i18n.tabHasErrors(count)`. Feeds\n * {@link createMatTabAggregatorDecoration} for both the\n * `[cngxMatTabs]` (`<mat-tab-group>`) and `[cngxMatTabNav]`\n * (`<nav mat-tab-nav-bar>`) bridges - one body, two hosts (Pillar 3).\n *\n * Structural `equal` drops re-runs whose entry list is shape-identical\n * so the projector does not churn on no-op aggregator re-emissions.\n *\n * @internal\n */\nexport function createAggregatedErrorTabs(\n presenter: CngxTabGroupHost,\n i18n: ReturnType<typeof injectTabsI18n>,\n): Signal<readonly CngxMatTabAggregatorErrorEntry[]> {\n // Same cascade as the native `statusPhrase`: an empty announcement or\n // message falls through, so a bare `true` flag still reads a phrase.\n const descriptorPhrase = (handle: CngxTabHandle, count: number): string => {\n const announcement = handle.errorAggregator()?.announcement();\n if (announcement) {\n return announcement;\n }\n const message = handle.errorMessage();\n if (message) {\n return message;\n }\n return i18n().tabHasErrors(count);\n };\n\n return computed<readonly CngxMatTabAggregatorErrorEntry[]>(\n () => {\n const tabs = presenter.tabs();\n const acc: CngxMatTabAggregatorErrorEntry[] = [];\n for (let i = 0; i < tabs.length; i++) {\n const handle = tabs[i];\n if (!handle.hasError()) {\n continue;\n }\n const count = handle.errorAggregator()?.errorCount() ?? 1;\n acc.push({\n idx: i,\n id: handle.id,\n announcement: descriptorPhrase(handle, count),\n count,\n label: handle.label() ?? '',\n });\n }\n return acc;\n },\n {\n equal: (a, b) => {\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (\n a[i].idx !== b[i].idx ||\n a[i].id !== b[i].id ||\n a[i].announcement !== b[i].announcement ||\n a[i].count !== b[i].count ||\n a[i].label !== b[i].label\n ) {\n return false;\n }\n }\n return true;\n },\n },\n );\n}\n","import {\n type EnvironmentProviders,\n inject,\n InjectionToken,\n makeEnvironmentProviders,\n type Provider,\n type TemplateRef,\n} from '@angular/core';\n\nimport {\n type CngxMatTabHalfWiredSlotSink,\n CNGX_DEFAULT_HALF_WIRED_SLOT_SINK,\n} from './decorations/half-wired-slot-sink';\nimport type { CngxMatTabRejectionContentContext } from './decorations/mat-tab-rejection-content.directive';\n\n/**\n * App-wide template defaults for the `[cngxMatTabs]` decorations -\n * the middle cascade tier between a per-instance structural slot and\n * the built-in fallback. Sibling of `CngxTabsTemplates` /\n * `CngxStepperTemplates` so consumer templates port across families.\n *\n * @category ui/mat-tabs\n */\nexport interface CngxMatTabsTemplates {\n /**\n * Default for the rejection SR-descriptor content\n * (`*cngxMatTabRejectionContent`). Per-instance slot still wins;\n * without either tier the imperative fallback writes the resolved\n * i18n phrase verbatim.\n */\n readonly rejection?: TemplateRef<CngxMatTabRejectionContentContext>;\n}\n\n/**\n * Behaviour knobs for `[cngxMatTabs]`. Single canonical surface\n * symmetric to `provideSelectConfig` in the select family - every\n * tunable is a `with*` feature on the same aggregator instead of\n * a standalone DI token, so consumers configure the directive\n * through one entry point and the API surface stays small.\n *\n * Per-instance Inputs win over `provideMatTabsConfigAt(...)`\n * (component scope), which wins over `provideMatTabsConfig(...)`\n * (root), which wins over the library defaults captured by\n * {@link CNGX_MAT_TABS_CONFIG_DEFAULTS}.\n *\n * @category ui/mat-tabs\n */\nexport interface CngxMatTabsConfig {\n /**\n * Cap on the `[cngxMatTabs]` overflow-anchor retry loop. The\n * directive runs `createDomAnchorRetry` on every `afterNextRender`\n * until `.mat-mdc-tab-header` materialises in the host subtree;\n * the cap exists so a never-rendered host (e.g. `<mat-tab-group>`\n * gated behind a never-true `*ngIf` / `@defer`) does not re-arm\n * forever.\n *\n * Default: `5` - well above normal Material render lag (a single\n * `afterNextRender` is enough on every supported version), low\n * enough to surface a dev-mode `console.warn` promptly when the\n * consumer DOM never appears.\n *\n * Note: `<cngx-tab-overflow>`'s own attach loop uses `60` rAF\n * frames, not `5` - different scheduler, different budget. The\n * two caps are intentionally independent because the underlying\n * timing primitives differ; a shared \"anchor max attempts\" knob\n * would conflate one frame of `afterNextRender` with one rAF\n * frame, which they are not.\n */\n readonly anchorMaxAttempts?: number;\n\n /**\n * Diagnostic sink invoked when a consumer wires exactly one of\n * `*cngxMatTabAggregatorContent` or its `ViewContainerRef`.\n * Default is a dev-mode `console.warn`; override via\n * {@link withHalfWiredSlotSink} to wire production telemetry\n * (Sentry breadcrumbs, custom logger, CI fail-fast).\n */\n readonly halfWiredSlotSink?: CngxMatTabHalfWiredSlotSink;\n\n /**\n * App-wide decoration template defaults - the middle cascade tier.\n * Per-instance structural slots still win; see\n * {@link CngxMatTabsTemplates}.\n */\n readonly templates?: CngxMatTabsTemplates;\n}\n\n/** Production default for `halfWiredSlotSink`: one reference, so reads stay identical. */\nconst SILENT_HALF_WIRED_SLOT_SINK: CngxMatTabHalfWiredSlotSink = () => undefined;\n\n/**\n * Library defaults for `[cngxMatTabs]`. Source of truth for every\n * key on {@link CngxMatTabsConfig}. Consumed by\n * {@link injectMatTabsConfig} as the final fallback.\n *\n * @internal\n */\nexport const CNGX_MAT_TABS_CONFIG_DEFAULTS = {\n anchorMaxAttempts: 5,\n // A getter, so the guard is read when the config resolves, after Angular set\n // `ngDevMode`; production folds it and drops the dev sink from the bundle.\n get halfWiredSlotSink(): CngxMatTabHalfWiredSlotSink {\n return typeof ngDevMode !== 'undefined' && ngDevMode\n ? CNGX_DEFAULT_HALF_WIRED_SLOT_SINK\n : SILENT_HALF_WIRED_SLOT_SINK;\n },\n templates: {},\n} as const satisfies Required<CngxMatTabsConfig>;\n\n/**\n * DI token holding a partial {@link CngxMatTabsConfig}. Set via\n * {@link provideMatTabsConfig} (app-wide) or\n * {@link provideMatTabsConfigAt} (component scope). Read via\n * {@link injectMatTabsConfig}, which merges with the library\n * defaults so callers never see `undefined`.\n *\n * @category ui/mat-tabs\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/mat-tabs-config.ts\n * @since 0.1.0\n */\nexport const CNGX_MAT_TABS_CONFIG = new InjectionToken<CngxMatTabsConfig>('CngxMatTabsConfig');\n\n/**\n * Feature object returned by `with*` mat-tabs functions and consumed\n * by {@link provideMatTabsConfig} / {@link provideMatTabsConfigAt}.\n * The optional `_target` discriminator is reserved for a future\n * cross-family aggregator (`provideCngxMatTabs`) that dispatches\n * features to the right provider - analogous to `_target: 'select'`\n * in the select family.\n *\n * @category ui/mat-tabs\n */\nexport interface CngxMatTabsConfigFeature {\n readonly config: Partial<CngxMatTabsConfig>;\n /** @internal */\n readonly _target?: 'mat-tabs';\n}\n\nfunction feature(config: Partial<CngxMatTabsConfig>): CngxMatTabsConfigFeature {\n return { config, _target: 'mat-tabs' };\n}\n\n/**\n * Cap on the `[cngxMatTabs]` overflow-anchor retry loop.\n * See {@link CngxMatTabsConfig.anchorMaxAttempts} for default + rationale.\n *\n * @category ui/mat-tabs\n */\nexport function withAnchorRetryAttempts(n: number): CngxMatTabsConfigFeature {\n return feature({ anchorMaxAttempts: n });\n}\n\n/**\n * Override the half-wired-slot diagnostic sink.\n * See {@link CngxMatTabsConfig.halfWiredSlotSink}.\n *\n * @category ui/mat-tabs\n */\nexport function withHalfWiredSlotSink(sink: CngxMatTabHalfWiredSlotSink): CngxMatTabsConfigFeature {\n return feature({ halfWiredSlotSink: sink });\n}\n\n/**\n * App-wide override for the rejection SR-descriptor content. Middle\n * tier; per-instance `*cngxMatTabRejectionContent` still wins.\n * Sibling of {@link withTabRejectionIconTemplate} in the cngx-native\n * family.\n *\n * @category ui/mat-tabs\n */\nexport function withMatTabRejectionTemplate(\n template: TemplateRef<CngxMatTabRejectionContentContext>,\n): CngxMatTabsConfigFeature {\n return feature({ templates: { rejection: template } });\n}\n\nfunction mergeFeatures(features: readonly CngxMatTabsConfigFeature[]): Partial<CngxMatTabsConfig> {\n const merged: {\n -readonly [K in keyof CngxMatTabsConfig]?: CngxMatTabsConfig[K];\n } = {};\n for (const f of features) {\n const { templates, ...rest } = f.config;\n Object.assign(merged, rest);\n if (templates) {\n // Nested-merge so several template features compose instead of the\n // last one overwriting the whole templates object.\n merged.templates = { ...merged.templates, ...templates };\n }\n }\n return merged;\n}\n\n/**\n * App-wide `[cngxMatTabs]` configuration. Returns\n * `EnvironmentProviders` for use inside `bootstrapApplication`'s\n * `providers` array.\n *\n * ```ts\n * bootstrapApplication(App, {\n * providers: [\n * provideMatTabsConfig(\n * withAnchorRetryAttempts(10),\n * withHalfWiredSlotSink((missing) => Sentry.captureMessage(`half-wired ${missing}`)),\n * ),\n * ],\n * });\n * ```\n *\n * @category ui/mat-tabs\n */\nexport function provideMatTabsConfig(\n ...features: CngxMatTabsConfigFeature[]\n): EnvironmentProviders {\n return makeEnvironmentProviders([\n { provide: CNGX_MAT_TABS_CONFIG, useValue: mergeFeatures(features) },\n ]);\n}\n\n/**\n * Component-scope `[cngxMatTabs]` configuration. Returns a\n * `Provider[]` so the result can be spread into a component's\n * `providers` or `viewProviders` (which cannot accept opaque\n * environment providers).\n *\n * Merges over the outer config (via `skipSelf`), so a component-scope\n * call refines the root {@link provideMatTabsConfig} instead of\n * reverting its untouched keys to library defaults - only the keys\n * the local features set are overridden for the subtree.\n *\n * ```ts\n * @Component({\n * selector: 'app-tabs-page',\n * viewProviders: [\n * ...provideMatTabsConfigAt(withAnchorRetryAttempts(20)),\n * ],\n * ...\n * })\n * ```\n *\n * @category ui/mat-tabs\n */\nexport function provideMatTabsConfigAt(...features: CngxMatTabsConfigFeature[]): Provider[] {\n return [\n {\n provide: CNGX_MAT_TABS_CONFIG,\n useFactory: (): Partial<CngxMatTabsConfig> => {\n const outer = inject(CNGX_MAT_TABS_CONFIG, { optional: true, skipSelf: true }) ?? {};\n const local = mergeFeatures(features);\n return {\n ...outer,\n ...local,\n // Nested-merge so a local template feature refines the outer\n // template set instead of replacing it wholesale.\n templates: { ...outer.templates, ...local.templates },\n };\n },\n },\n ];\n}\n\n/**\n * Resolve the effective `[cngxMatTabs]` configuration for the current\n * injector. Always returns a fully populated, non-`undefined` object\n * so call sites do not need null-coalescing.\n *\n * Resolution order per key:\n * 1. `CNGX_MAT_TABS_CONFIG` value (set via\n * {@link provideMatTabsConfig} / {@link provideMatTabsConfigAt}).\n * 2. {@link CNGX_MAT_TABS_CONFIG_DEFAULTS} (library default).\n *\n * @category ui/mat-tabs\n */\nexport function injectMatTabsConfig(): Required<CngxMatTabsConfig> {\n const user = inject(CNGX_MAT_TABS_CONFIG, { optional: true }) ?? {};\n return {\n anchorMaxAttempts: user.anchorMaxAttempts ?? CNGX_MAT_TABS_CONFIG_DEFAULTS.anchorMaxAttempts,\n halfWiredSlotSink: user.halfWiredSlotSink ?? CNGX_MAT_TABS_CONFIG_DEFAULTS.halfWiredSlotSink,\n templates: { ...CNGX_MAT_TABS_CONFIG_DEFAULTS.templates, ...user.templates },\n };\n}\n","import { computed, type Signal, type TemplateRef } from '@angular/core';\n\nimport type { CngxMatTabsConfig } from '../mat-tabs-config';\nimport type {\n CngxMatTabAggregatorContent,\n CngxMatTabAggregatorContentContext,\n} from './mat-tab-aggregator-content.directive';\nimport type {\n CngxMatTabRejectionContent,\n CngxMatTabRejectionContentContext,\n} from './mat-tab-rejection-content.directive';\n\n/**\n * Content templates of the two Material decorations, resolved once for\n * `[cngxMatTabs]` and `[cngxMatTabNav]`.\n *\n * @internal\n */\nexport interface CngxMatTabDecorationTemplates {\n /** The projected `*cngxMatTabAggregatorContent`, else `null`. */\n readonly aggregator: Signal<TemplateRef<CngxMatTabAggregatorContentContext> | null>;\n /**\n * The projected `*cngxMatTabRejectionContent`, else the\n * `CNGX_MAT_TABS_CONFIG.templates.rejection` default, else `null`.\n */\n readonly rejection: Signal<TemplateRef<CngxMatTabRejectionContentContext> | null>;\n}\n\n/**\n * Resolve the decoration content slots of a Material tab bridge. The\n * `contentChild` queries stay on each host (signal queries must be class\n * fields); the resolution order is shared so both hosts agree.\n *\n * @internal\n */\nexport function createDecorationTemplates(\n aggregatorSlot: Signal<CngxMatTabAggregatorContent | undefined>,\n rejectionSlot: Signal<CngxMatTabRejectionContent | undefined>,\n config: CngxMatTabsConfig,\n): CngxMatTabDecorationTemplates {\n return {\n aggregator: computed(() => aggregatorSlot()?.templateRef ?? null),\n rejection: computed(\n () => rejectionSlot()?.templateRef ?? config.templates?.rejection ?? null,\n ),\n };\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\n/**\n * Context passed to the `*cngxMatTabAggregatorContent` template.\n * Drives the SR-descriptor content rendered inside the\n * `<span class=\"cngx-sr-only\">` decoration that `[cngxMatTabs]`\n * appends to a Material tab button when its bound aggregator wants\n * reveal. The surrounding span (with its `cngx-sr-only` class, its\n * stable id, and the `aria-describedby` wiring on the button)\n * stays library-owned - the slot only customises the descriptor\n * text or markup so consumers can swap the announcement phrasing\n * (counter pills, localised templates, branded prefixes) without\n * fighting the AT contract.\n *\n * `count` mirrors the bound aggregator's `errorCount()` at the\n * moment the decoration was applied; `label` is the human-readable\n * label of the tab (the Material `MatTab.textLabel`);\n * `announcement` is the resolved AT phrase (the same string the\n * imperative `textContent` fallback would write). All three are\n * snapshotted into the decorated entry - re-emissions of the\n * underlying signals re-fire the projector's effect, which\n * re-applies the decoration with the fresh context.\n *\n * @category ui/mat-tabs\n */\nexport interface CngxMatTabAggregatorContentContext {\n /** Aggregated error count for this tab (≥ 1 when shown). */\n readonly count: number;\n /** Resolved tab label (Material `textLabel`). */\n readonly label: string;\n /**\n * Resolved AT announcement phrase the imperative fallback path\n * would write verbatim - the bound aggregator's `announcement()`\n * value at the moment the decoration was applied. Use this when\n * the consumer template wants to render the canonical phrase\n * alongside its own decoration (counter pill, branded prefix)\n * without re-injecting the aggregator.\n */\n readonly announcement: string;\n}\n\n/**\n * Structural slot directive marking the aggregator-descriptor\n * template for `[cngxMatTabs]`. Discovered via `contentChild` on the\n * directive; when bound, the projector renders an embedded view of\n * this template into the SR-only descriptor span instead of writing\n * the aggregator's `announcement()` string verbatim.\n *\n * Pure marker - zero logic. Holds only a typed\n * {@link TemplateRef} reference. Mirrors the family-standard slot\n * pattern (`CngxStepBadge`, `CngxTabErrorBadge`, `CngxTabOverflowItem`).\n *\n * Material owns the tab-button chrome; the cngx descriptor span is\n * the only consumer-visible decoration seam, so this slot directive\n * lands with one in-package consumer (the package-private\n * aggregator-decoration projector).\n *\n * ```html\n * <mat-tab-group cngxMatTabs>\n * <ng-template\n * cngxMatTabAggregatorContent\n * let-count=\"count\"\n * let-label=\"label\"\n * >\n * {{ label }}: {{ count }} validation issue(s)\n * </ng-template>\n * <mat-tab label=\"Profile\" cngxMatTabError=\"profile\">…</mat-tab>\n * </mat-tab-group>\n * ```\n *\n * @category ui/mat-tabs\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/decorations/mat-tab-aggregator-content.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMatTabs, CngxMatTabError, CngxMatTabRejectionContent\n */\n@Directive({\n selector: 'ng-template[cngxMatTabAggregatorContent]',\n exportAs: 'cngxMatTabAggregatorContent',\n standalone: true,\n})\nexport class CngxMatTabAggregatorContent {\n readonly templateRef = inject<TemplateRef<CngxMatTabAggregatorContentContext>>(TemplateRef);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\n/**\n * Context passed to the `*cngxMatTabRejectionContent` template. Drives\n * the SR-descriptor content rendered inside the\n * `<span class=\"cngx-sr-only\">` decoration that `[cngxMatTabs]`\n * appends to a Material tab button when its bound `commitAction`\n * rejects a tab change. The surrounding span (with its\n * `cngx-sr-only` class, its stable id, and the `aria-describedby`\n * wiring on the button) stays library-owned - the slot only\n * customises the descriptor text or markup so consumers can swap\n * the rejection phrasing (branded prefixes, retry CTAs, localised\n * templates) without fighting the AT contract.\n *\n * `failedHandleId` is the stable id of the rejected handle (the\n * same id the descriptor span uses as its `${id}-rejected` DOM id);\n * `originLabel` is the label the rollback returned to (when the\n * presenter exposes an `originIndexDuringCommit` and that index\n * resolves to a handle with a non-empty label) - `undefined` when\n * no labelled rollback origin is resolvable; `fallbackText` is the\n * built-in i18n phrase the imperative fallback path would write\n * verbatim (for a failure typically `commitRolledBackTo(origin)`\n * when the origin is resolvable, `commitFailedRetry` otherwise; for a\n * refusal `commitRefused(origin)` or `commitRefusedGeneric`; a\n * label-less origin is named `unlabeledTab(position)`);\n * `reason` is the kind of the outcome.\n *\n * **Re-instantiation warning.** The decoration projector destroys\n * the embedded view and creates a fresh one on every `descriptorText`\n * re-emission - typical when the rollback origin label resolves\n * later than the failed-handle id (e.g. `presenter.tabs()` re-emits\n * mid-rejection and the origin label flows in on the second tick).\n * The slot template runs to the end of its lifecycle each time;\n * consumers wiring expensive subtrees (e.g. an embedded chart, a\n * complex form) should treat this as a destroy + remount cycle and\n * lift heavy state into a sibling `*ngTemplateOutlet`-friendly\n * structure outside the slot. Cheap text + simple markup (the\n * intended use) sees no observable difference.\n *\n * @category ui/mat-tabs\n */\nexport interface CngxMatTabRejectionContentContext {\n /** Stable id of the rejected `CngxTabHandle`. */\n readonly failedHandleId: string;\n /**\n * Label of the rollback origin (only set when the presenter's\n * `originIndexDuringCommit` resolves to a handle with a non-empty\n * label).\n */\n readonly originLabel: string | undefined;\n /**\n * Library-default i18n phrase the imperative fallback path would\n * write verbatim. Use this if the consumer template wants to\n * render the canonical phrase as a base alongside its own\n * decoration (icon, branded prefix, retry CTA).\n */\n readonly fallbackText: string;\n /**\n * Why the commit did not land: `'refused'` when the commit action\n * answered `false`, `'failed'` when it threw, rejected or errored.\n * Pick copy or an icon per reason; `fallbackText` already follows it.\n */\n readonly reason: 'refused' | 'failed';\n}\n\n/**\n * Structural slot directive marking the rejection-descriptor\n * template for `[cngxMatTabs]`. Discovered via `contentChild` on the\n * directive; when bound, the projector renders an embedded view of\n * this template into the SR-only descriptor span instead of writing\n * the resolved fallback string verbatim.\n *\n * Pure marker - zero logic. Holds only a typed\n * {@link TemplateRef} reference. Mirrors the family-standard slot\n * pattern (`CngxMatTabAggregatorContent`, `CngxStepBadge`,\n * `CngxTabErrorBadge`).\n *\n * Cascade resolution:\n * 1. Per-instance `*cngxMatTabRejectionContent` template wins\n * via `contentChild(CngxMatTabRejectionContent)`.\n * 2. `CNGX_MAT_TABS_CONFIG.templates.rejection` (app-wide middle\n * tier, set via `withMatTabRejectionTemplate`).\n * 3. Library default - imperative `Renderer2.createElement('span')`\n * with `textContent = fallbackText` (the resolved\n * `commitRolledBackTo(originLabel)` / `commitFailedRetry`\n * phrase from `injectTabsI18n()`).\n *\n * ```html\n * <mat-tab-group cngxMatTabs [commitAction]=\"save\">\n * <ng-template\n * cngxMatTabRejectionContent\n * let-failedHandleId=\"failedHandleId\"\n * let-originLabel=\"originLabel\"\n * let-fallbackText=\"fallbackText\"\n * >\n * <span class=\"brand-icon\" aria-hidden=\"true\"></span>\n * {{ fallbackText }}\n * @if (originLabel) {\n * <button (click)=\"retry(failedHandleId)\">Retry</button>\n * }\n * </ng-template>\n * <mat-tab label=\"Profile\">…</mat-tab>\n * </mat-tab-group>\n * ```\n *\n * @category ui/mat-tabs\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/decorations/mat-tab-rejection-content.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMatTabs, CngxMatTabAggregatorContent, CngxMatTabError\n */\n@Directive({\n selector: 'ng-template[cngxMatTabRejectionContent]',\n exportAs: 'cngxMatTabRejectionContent',\n standalone: true,\n})\nexport class CngxMatTabRejectionContent {\n readonly templateRef = inject<TemplateRef<CngxMatTabRejectionContentContext>>(TemplateRef);\n}\n","import {\n effect,\n inject,\n type Injector,\n runInInjectionContext,\n type Signal,\n untracked,\n} from '@angular/core';\n\nimport { CngxLiveAnnouncer } from '@cngx/common/a11y';\n\n/**\n * Options for {@link mountLiveRegionAnnouncer}.\n *\n * @internal\n */\nexport interface CngxMatBridgeLiveRegionOptions {\n /** Reactive announcement text. Empty string keeps the region quiet. */\n readonly announcement: Signal<string>;\n readonly injector: Injector;\n /** Default: `'polite'`. */\n readonly politeness?: 'polite' | 'assertive';\n}\n\n/**\n * Keep the shared {@link CngxLiveAnnouncer} in sync with the supplied\n * `announcement` signal: an `effect` reads the reactive text and\n * forwards every non-empty value to the root announcer at the\n * configured politeness (default `'polite'`). An empty string between\n * transitions keeps the region quiet on no-op CD ticks.\n *\n * Delegates to {@link CngxLiveAnnouncer} instead of mounting its own\n * body span, so the announcer owns the persistent polite/assertive\n * region pair, the clear-then-set re-announce, and teardown. The\n * delegated region carries `aria-live` + `aria-atomic=\"true\"` and no\n * explicit `role`; `aria-atomic` re-reads full content and `aria-live`\n * carries the politeness, so a tab-change status utterance still reads.\n *\n * The `effect` is created in `opts.injector`'s context, so it is torn\n * down with the host directive; the service call is wrapped in\n * `untracked` - the announcer owns its own clear-then-set timer, so it\n * stays out of the effect's dependency graph.\n *\n * @internal - helper shared by the Material bridge directives\n * (`[cngxMatTabs]`, `[cngxMatTabNav]`, `[cngxMatStepper]`). Exported\n * `@internal` from the mat-tabs barrel for cross-entry consumption\n * (the `MaterialPrivateSurfaces` pattern) - ng-packagr rejects\n * relative-import file sharing between entry points.\n */\nexport function mountLiveRegionAnnouncer(\n opts: CngxMatBridgeLiveRegionOptions,\n): void {\n const politeness = opts.politeness ?? 'polite';\n\n runInInjectionContext(opts.injector, () => {\n const announcer = inject(CngxLiveAnnouncer);\n effect(() => {\n const text = opts.announcement();\n if (!text) {\n return;\n }\n untracked(() => announcer.announce(text, politeness));\n });\n });\n}\n","import { computed, untracked, type Signal } from '@angular/core';\n\nimport { createRefusedPhrase } from '@cngx/common/data';\nimport type { CngxTabGroupHost, injectTabsI18n } from '@cngx/common/tabs';\n\n/**\n * Reactive rejection-state derivation shared by the descriptor-text\n * pipeline and the `*cngxMatTabRejectionContent` slot context.\n *\n * Both consumers need the same source resolution (failed index →\n * origin index → origin tab label), so a single factory deduplicates\n * the lookup and keeps `[cngxMatTabs]` thin enough to pass the\n * organism-LOC guard.\n *\n * @internal - package-private helper for `[cngxMatTabs]`. Not\n * exported from `public-api.ts`.\n */\nexport interface CngxMatTabRejectionState {\n /**\n * Stable id of the currently-failed tab handle, or `null` when no\n * rejection is pinned. Identity equal via the id lookup collapses\n * `tabs()` re-emissions that do not change the failed target - the\n * rejection projector keys its effect on exactly this signal.\n */\n readonly failedHandleId: Signal<string | null>;\n /**\n * Reactive label of the rollback origin - `undefined` when no\n * rejection is pinned, when the origin index is unresolved, or\n * when the origin tab carries no label.\n */\n readonly originLabel: Signal<string | undefined>;\n /**\n * Kind of the outcome behind the pinned marker - `'refused'` when the\n * commit action answered `false`, `'failed'` when it threw, rejected or\n * errored; `undefined` when no rejection is pinned. Feeds the\n * `*cngxMatTabRejectionContent` slot context.\n */\n readonly reason: Signal<'refused' | 'failed' | undefined>;\n /**\n * Reactive descriptor phrase. A failed tab reads\n * `commitRolledBackTo(origin)` when an origin index resolves,\n * `commitFailedRetry` otherwise; a refused tab reads\n * `commitRefused(origin)` or `commitRefusedGeneric`, never the\n * failure copy. The origin is its label, or `unlabeledTab(position)`\n * for a label-less origin tab; the generic copy when the origin tab was\n * removed meanwhile. Empty string between rejections\n * (the projector clears the decoration entirely on\n * `failedHandleId === null`, so consumers only consult this while\n * a rejection is pinned).\n */\n readonly descriptorText: Signal<string>;\n /**\n * SR-friendly text rendered inside the polite live-region span.\n * Mirrors `tab-group.component.ts`'s `liveAnnouncement` rejection\n * arm so AT users on Material `<mat-tab-group>` get the same\n * commit-transition narrative as cngx-native:\n *\n * 0. a new refusal → `commitRefused(origin)` (or\n * `commitRefusedGeneric` without an origin index) once,\n * until the next commit, an active-index move or a cleared\n * outcome\n * 1. `'pending'` → `i18n.commitInFlight`\n * 2. `'error'` → `commitRolledBackTo(origin)` when an\n * origin index resolves, `commitFailedRetry` otherwise\n * 3. anything else → empty string (region stays quiet on no-op\n * CD ticks; mat-tabs does not announce success transitions\n * because Material's own ARIA already narrates the\n * activeIndex change - duplicating would make AT readers\n * hear two utterances per nav)\n */\n readonly liveAnnouncement: Signal<string>;\n}\n\n/**\n * Build the {@link CngxMatTabRejectionState} bundle for a given\n * presenter + i18n pair. `descriptorText` re-uses the cached\n * `originLabel` walk (`lastFailedIndex` → `originIndexDuringCommit` →\n * `tabs[idx].label()`). The live announcement walks the indices itself so\n * they stay tracked while the label, which a consumer may translate, is\n * read untracked.\n *\n * @internal\n */\nexport function createRejectionState(\n presenter: CngxTabGroupHost,\n i18n: ReturnType<typeof injectTabsI18n>,\n): CngxMatTabRejectionState {\n // A label-less origin is named by its position, as on <cngx-tab-group>;\n // undefined when no origin tab resolves - no origin index, or one past the\n // end because the origin tab was removed meanwhile (the generic copy).\n function originName(\n originIdx: number | undefined,\n copy: ReturnType<typeof i18n>,\n ): string | undefined {\n const origin = originIdx === undefined ? undefined : presenter.tabs()[originIdx];\n if (!origin || originIdx === undefined) {\n return undefined;\n }\n const label = origin.label();\n if (label) {\n return label;\n }\n return copy.unlabeledTab(originIdx + 1);\n }\n\n const failedHandleId: Signal<string | null> = computed(() => {\n const idx = presenter.lastFailedIndex();\n if (idx === undefined) {\n return null;\n }\n return presenter.tabs()[idx]?.id ?? null;\n });\n\n const originLabel: Signal<string | undefined> = computed(() => {\n const failedIdx = presenter.lastFailedIndex();\n if (failedIdx === undefined) {\n return undefined;\n }\n const originIdx = presenter.originIndexDuringCommit();\n if (originIdx === undefined) {\n return undefined;\n }\n return presenter.tabs()[originIdx]?.label() ?? undefined;\n });\n\n const reason: Signal<'refused' | 'failed' | undefined> = computed(() => {\n if (presenter.lastFailedIndex() === undefined) {\n return undefined;\n }\n return presenter.lastOutcome()?.kind === 'refused' ? 'refused' : 'failed';\n });\n\n const descriptorText: Signal<string> = computed(() => {\n const kind = reason();\n if (kind === undefined) {\n return '';\n }\n const copy = i18n();\n const name = originName(presenter.originIndexDuringCommit(), copy);\n if (kind === 'refused') {\n return name ? copy.commitRefused(name) : copy.commitRefusedGeneric;\n }\n return name ? copy.commitRolledBackTo(name) : copy.commitFailedRetry;\n });\n\n // A refusal leaves the commit status at 'idle', so no status edge can\n // voice it. Same lifecycle as the `<cngx-tab-group>` phrase: armed by a\n // new refused sequence, spent by the next commit activity, an\n // active-index move or a cleared outcome.\n const refusedPhrase = createRefusedPhrase({\n outcome: () => presenter.lastOutcome(),\n status: () => presenter.commitTransition.current(),\n activeIndex: () => presenter.activeIndex(),\n copy: refusedCopy,\n });\n\n function refusedCopy(): string {\n const copy = i18n();\n const name = originName(presenter.originIndexDuringCommit(), copy);\n return name ? copy.commitRefused(name) : copy.commitRefusedGeneric;\n }\n\n // Feeds the live announcer: copy and the origin tab label (which a\n // consumer may translate) are read untracked so a language switch does\n // not re-announce; the next transition speaks the new language.\n const liveAnnouncement: Signal<string> = computed(() => {\n // Read the refused phrase EAGERLY: linkedSignal only observes the\n // snapshots it is read under, so a read behind the pending arm would\n // miss the status change that spends it.\n const refused = refusedPhrase();\n if (refused) {\n return refused;\n }\n const current = presenter.commitTransition.current();\n if (current === 'pending') {\n return untracked(() => i18n().commitInFlight);\n }\n if (current === 'error') {\n const failedIdx = presenter.lastFailedIndex();\n const originIdx = failedIdx === undefined ? undefined : presenter.originIndexDuringCommit();\n // The indices and the tab list stay tracked; the label is read untracked.\n const hasOrigin = originIdx !== undefined && presenter.tabs()[originIdx] !== undefined;\n return untracked(() => {\n const copy = i18n();\n const name = hasOrigin ? originName(originIdx, copy) : undefined;\n return name ? copy.commitRolledBackTo(name) : copy.commitFailedRetry;\n });\n }\n return '';\n });\n\n return { failedHandleId, originLabel, reason, descriptorText, liveAnnouncement };\n}\n","/**\n * Shared order-aware registration seam for the Material\n * instrumentation directives (`[cngxMatTabs]`, `[cngxMatStepper]`).\n *\n * Both bridges diff a `contentChildren(Mat*)` query into a presenter\n * registry via `register`/`unregister`. The presenters keep pure\n * insertion order and append every new registration at the end, so a\n * mid-list `<mat-tab>` / `<mat-step>` insert would register at the\n * tail while Material renders it at its DOM position - index-based\n * selection, announcements and decorations would then target the\n * wrong item. This seam mirrors the query order into the presenter on\n * every emission: surviving prefix entries stay untouched, the\n * diverging suffix is unregistered and re-registered in query order\n * with the SAME handle instances (per-entry resources such as child\n * injectors are never re-created for surviving items).\n *\n * Pure TypeScript, no Angular imports. Lives in the mat-tabs entry\n * and is exported `@internal` from its barrel for cross-entry\n * consumption by `@cngx/ui/mat-stepper` - ng-packagr rejects source\n * files shared between entry points by relative import, so the\n * export-plus-internal-tag route (the `MaterialPrivateSurfaces`\n * pattern) is the supported sharing path.\n *\n * @internal\n */\nexport interface CngxOrderedRegistrationSeamOptions<TItem, TEntry> {\n /** Build the per-item entry (handle setup + resources). Called once per item lifetime. */\n create(item: TItem): TEntry;\n /** Register the entry's handle with the presenter. */\n register(entry: TEntry): void;\n /** Remove the entry's handle from the presenter (resources stay alive). */\n unregister(entry: TEntry): void;\n /** Release per-entry resources (child injector etc.). Called once, after the final unregister. */\n dispose(entry: TEntry): void;\n}\n\n/**\n * Stateful diff surface returned by {@link createOrderedRegistrationSeam}.\n *\n * @internal\n */\nexport interface CngxOrderedRegistrationSeam<TItem, TEntry> {\n /**\n * Mirror `items` (the current `contentChildren` emission, in query\n * order) into the presenter registry. Removed items are\n * unregistered and disposed; new items are created and registered;\n * surviving items keep their entry, and any item whose position\n * diverged from the registered order is re-registered so the\n * presenter's order matches `items` exactly.\n */\n sync(items: readonly TItem[]): void;\n /** Entry lookup for per-item decoration hooks. */\n get(item: TItem): TEntry | undefined;\n /** Unregister and dispose every entry (directive destroy). */\n clear(): void;\n}\n\n/**\n * Create the order-aware registration seam. See the module JSDoc for\n * the contract.\n *\n * @internal\n */\nexport function createOrderedRegistrationSeam<TItem, TEntry>(\n options: CngxOrderedRegistrationSeamOptions<TItem, TEntry>,\n): CngxOrderedRegistrationSeam<TItem, TEntry> {\n const entries = new Map<TItem, TEntry>();\n // Presenter-side registration order - the seam issued every\n // register() call, so this array IS the presenter's order.\n let registeredOrder: TItem[] = [];\n\n const sync = (items: readonly TItem[]): void => {\n const live = new Set<TItem>(items);\n\n // Drop stale entries first so the order diff below only compares\n // survivors. Snapshot before iterating - deletes inside the body\n // must not collide with iterator state.\n for (const [item, entry] of Array.from(entries.entries())) {\n if (live.has(item)) {\n continue;\n }\n options.unregister(entry);\n options.dispose(entry);\n entries.delete(item);\n }\n registeredOrder = registeredOrder.filter((item) => entries.has(item));\n\n // Longest shared prefix stays registered as-is; everything after\n // it re-registers in query order. Append-only emissions keep\n // prefix === registeredOrder.length and cause zero churn.\n let prefix = 0;\n while (\n prefix < registeredOrder.length &&\n prefix < items.length &&\n registeredOrder[prefix] === items[prefix]\n ) {\n prefix += 1;\n }\n\n for (let i = registeredOrder.length - 1; i >= prefix; i -= 1) {\n const entry = entries.get(registeredOrder[i]);\n if (entry !== undefined) {\n options.unregister(entry);\n }\n }\n registeredOrder.length = prefix;\n\n for (let i = prefix; i < items.length; i += 1) {\n const item = items[i];\n let entry = entries.get(item);\n if (entry === undefined) {\n entry = options.create(item);\n entries.set(item, entry);\n }\n options.register(entry);\n registeredOrder.push(item);\n }\n };\n\n const clear = (): void => {\n for (const entry of entries.values()) {\n options.unregister(entry);\n options.dispose(entry);\n }\n entries.clear();\n registeredOrder = [];\n };\n\n return {\n sync,\n get: (item: TItem): TEntry | undefined => entries.get(item),\n clear,\n };\n}\n","import {\n computed,\n InjectionToken,\n type Injector,\n signal,\n type Signal,\n type WritableSignal,\n} from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport type { MatTab } from '@angular/material/tabs';\n\nimport type { CngxErrorAggregatorContract } from '@cngx/common/interactive';\nimport type { CngxTabHandle } from '@cngx/common/tabs';\n\nimport type { MaterialPrivateSurfaces } from './private-surfaces';\n\n/**\n * Wiring bundle returned from {@link createMatTabHandle}. The\n * directive owns the writable `errorAggregator` slot so the\n * `[cngxMatTabError]` per-tab directive can pump aggregators into\n * it; `label` and `disabled` track Material's current state via a\n * `toSignal(matTab._stateChanges)` trigger.\n */\nexport interface CngxMatTabHandleSetup {\n readonly handle: CngxTabHandle;\n /** Convenience mirror of `handle.label`. */\n readonly label: Signal<string | undefined>;\n /** Convenience mirror of `handle.disabled`. */\n readonly disabled: Signal<boolean>;\n readonly errorAggregator: WritableSignal<CngxErrorAggregatorContract | undefined>;\n /**\n * Direct invalid flag the `[cngxMatTabErrorFlag]` directive writes -\n * `string | boolean`, mirroring `CngxTab.error`. Folds into the\n * handle's `hasError` / `errorMessage` alongside the aggregator.\n */\n readonly directError: WritableSignal<string | boolean>;\n}\n\n/**\n * Translates a Material `MatTab` into a cngx {@link CngxTabHandle}\n * plus a writable `errorAggregator` slot the `[cngxMatTabError]`\n * directive binds.\n *\n * - `id` - fresh `idSeed()` value; a label-keyed id would collide\n * when two tabs share a label.\n * - `label` / `disabled` - `computed` signals retriggered by\n * `toSignal(matTab._stateChanges)`. Bridge lifetime is tied to\n * the supplied `injector` (typically a per-tab child\n * `EnvironmentInjector`). `_stateChanges` is a Material-internal\n * surface.\n * - `errorAggregator` - writable seeded at `undefined`;\n * `[cngxMatTabError]` writes its bound aggregator in and resets\n * on teardown. The handle exposes `.asReadonly()` to preserve the\n * `CngxTabHandle` contract.\n * - `directError` - writable seeded at `false`;\n * `[cngxMatTabErrorFlag]` writes its `string | boolean` value in\n * and resets on teardown. Folds into `hasError` / `errorMessage`.\n *\n * @category ui/mat-tabs\n */\nexport function createMatTabHandle(\n matTab: MatTab,\n idSeed: () => string,\n injector: Injector,\n): CngxMatTabHandleSetup {\n // Typed local - anchors `MaterialPrivateSurfaces.StateChangeSource`\n // at the consumer site so an upgrade-watch grep lands here too.\n // Documentation-only at runtime; MatTab's public typing already\n // exposes `_stateChanges`.\n const stateChangeSource: MaterialPrivateSurfaces.StateChangeSource = matTab;\n // `equal: () => false` is load-bearing - `_stateChanges` is a\n // `Subject<void>`, so `Object.is(undefined, undefined)` would dedup\n // every emission and the dependent computeds would never recompute.\n const stateChangeTrigger = toSignal(stateChangeSource._stateChanges, {\n injector,\n initialValue: undefined,\n equal: () => false,\n });\n const label = computed<string | undefined>(() => {\n stateChangeTrigger();\n return matTab.textLabel;\n });\n const disabled = computed<boolean>(() => {\n stateChangeTrigger();\n return matTab.disabled;\n });\n const errorAggregator = signal<CngxErrorAggregatorContract | undefined>(undefined);\n // Direct invalid flag written by `[cngxMatTabErrorFlag]` - the\n // Material-side author surface mirroring `CngxTab.error`.\n const directError = signal<string | boolean>(false);\n // Folded error state for the widened `CngxTabHandle` contract. Direct\n // flag OR the aggregator's reveal-gated `shouldShow()` (so deferred-\n // reveal validation stays silent until revealed).\n const hasError = computed<boolean>(\n () => {\n const direct = directError();\n return (direct !== false && direct !== '') || (errorAggregator()?.shouldShow?.() ?? false);\n },\n { equal: Object.is },\n );\n // Resolved direct-error message: the flag string when non-empty, else\n // `undefined`. The aggregator carries its own announcement separately.\n const errorMessage = computed<string | undefined>(() => {\n const direct = directError();\n return typeof direct === 'string' && direct !== '' ? direct : undefined;\n });\n // Material owns its own tab lifecycle - the cngx dismissable/addable\n // affordances are native-only by design, so the Material handle pins\n // `closable` to `undefined` (group-default, never a close button).\n const closable = signal<boolean | undefined>(undefined);\n // Material owns its tab-button chrome (no DOM seam for a stacked\n // second line), so the bridge pins `subLabel` to `undefined` - same\n // native-only staging as `closable`.\n const subLabel = signal<string | undefined>(undefined);\n // `nextUid` is process-wide monotonic, so `${id}-errors` descriptor\n // ids stay unique across coexisting `[cngxMatTabs]` instances.\n const id = idSeed();\n return {\n handle: {\n id,\n label,\n subLabel: subLabel.asReadonly(),\n disabled,\n errorAggregator: errorAggregator.asReadonly(),\n hasError,\n errorMessage,\n closable: closable.asReadonly(),\n },\n label,\n disabled,\n errorAggregator,\n directError,\n };\n}\n\n/**\n * Factory signature for {@link createMatTabHandle}. The DI token\n * {@link CNGX_MAT_TAB_HANDLE_FACTORY} resolves to a function with\n * this exact shape - overrides match it identically.\n *\n * @category ui/mat-tabs\n */\nexport type CngxMatTabHandleFactory = typeof createMatTabHandle;\n\n/**\n * DI token fronting the per-tab handle factory used by\n * `[cngxMatTabs]`. Default is {@link createMatTabHandle}. Symmetric\n * with `CNGX_MAT_STEP_HANDLE_FACTORY` and\n * `CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY`.\n *\n * The seam separates handle shape (factory body) from id keying\n * (the supplied `idSeed` closure). Overrides may call, ignore, or\n * replace `idSeed` - server-synced ids, deterministic test ids,\n * consumer-domain ids - without touching the factory body.\n *\n * ```ts\n * providers: [\n * {\n * provide: CNGX_MAT_TAB_HANDLE_FACTORY,\n * useValue: ((tab, idSeed, injector) => {\n * const setup = createMatTabHandle(tab, idSeed, injector);\n * reportTabRegistered(setup.handle.id);\n * return setup;\n * }) satisfies CngxMatTabHandleFactory,\n * },\n * ]\n * ```\n *\n * @category ui/mat-tabs\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/material-bridge/handle.ts\n * @since 0.1.0\n */\nexport const CNGX_MAT_TAB_HANDLE_FACTORY = new InjectionToken<CngxMatTabHandleFactory>(\n 'CNGX_MAT_TAB_HANDLE_FACTORY',\n {\n providedIn: 'root',\n factory: () => createMatTabHandle,\n },\n);\n","import {\n contentChildren,\n createEnvironmentInjector,\n DestroyRef,\n Directive,\n effect,\n EnvironmentInjector,\n inject,\n InjectionToken,\n untracked,\n} from '@angular/core';\nimport { MatTab, MatTabGroup } from '@angular/material/tabs';\n\nimport { CNGX_TAB_GROUP_HOST, type CngxTabGroupHost } from '@cngx/common/tabs';\nimport { nextUid } from '@cngx/core/utils';\n\nimport { createOrderedRegistrationSeam } from './material-bridge/ordered-registration';\nimport { CNGX_MAT_TAB_HANDLE_FACTORY, type CngxMatTabHandleSetup } from './material-bridge/handle';\nimport type { MaterialPrivateSurfaces } from './material-bridge/private-surfaces';\n\n/**\n * Per-MatTab registry entry. The child `EnvironmentInjector` scopes\n * the per-tab `_stateChanges` bridge - destroying it fires\n * `takeUntilDestroyed` so the subscription unsubscribes\n * deterministically.\n *\n * @internal\n */\ninterface CngxMatTabsRegistryEntry {\n readonly setup: CngxMatTabHandleSetup;\n readonly childInjector: EnvironmentInjector;\n}\n\n/**\n * Read-mostly contract for the per-tab handle-setup registry.\n * `[cngxMatTabError]` and any future `[cngxMatTab*]` decoration\n * directive injects this with `{ host: true }` to reach the\n * per-handle `errorAggregator` slot without walking the concrete\n * registry class.\n *\n * Return type narrows to `Pick<..., 'errorAggregator'>` so the\n * access path exposes only the per-handle aggregator slot; the\n * rest of the setup stays internal bookkeeping.\n *\n * @category ui/mat-tabs\n */\nexport interface CngxMatTabsRegistryHost {\n /**\n * Returns the per-handle writable slots (`errorAggregator`,\n * `directError`), or `undefined` before the tab is registered. The\n * `contentChildren(MatTab)` query lands during content-init, so a\n * same-microtask injection from an attribute directive can race;\n * consumers recover by tracking `presenter.tabs()` and re-attempting\n * on the next sync tick.\n */\n getHandleSetup(\n matTab: MatTab,\n ): Pick<CngxMatTabHandleSetup, 'errorAggregator' | 'directError'> | undefined;\n}\n\n/**\n * DI token the {@link CngxMatTabsRegistry} directive provides via\n * `useExisting`. Sibling per-tab directives inject this with\n * `{ host: true }` to reach per-handle slots without walking the\n * concrete registry class.\n *\n * @category ui/mat-tabs\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/mat-tabs-registry.directive.ts\n * @since 0.1.0\n */\nexport const CNGX_MAT_TABS_REGISTRY_HOST = new InjectionToken<CngxMatTabsRegistryHost>(\n 'CngxMatTabsRegistryHost',\n);\n\n/**\n * Sibling host-directive that owns the per-MatTab handle registry\n * for `[cngxMatTabs]`. Keeps the parent under the level-4 organism\n * LOC guard and lets per-tab decoration directives reach the\n * registry through a typed token.\n *\n * Owns: `contentChildren(MatTab)` query, the order-aware\n * registration seam (per-tab cngx setup paired with a child\n * `EnvironmentInjector` scoping the `_stateChanges` bridge), an\n * `effect()` that mirrors the MatTab query order into\n * `CNGX_TAB_GROUP_HOST` on every emission, and a `DestroyRef`\n * cleanup that unregisters and destroys every entry.\n *\n * Order matters: the presenter registry appends new registrations,\n * but Material renders tabs at their DOM position - a mid-list\n * `<mat-tab>` insert must land at its query index, not at the tail,\n * or index-based selection, announcements and decorations target the\n * wrong tab. The shared seam re-registers the diverging suffix in\n * query order while keeping surviving handle instances (and their\n * child injectors) alive.\n *\n * Composition: `[cngxMatTabs]` declares this in `hostDirectives`;\n * both share the parent's `CngxTabGroupPresenter` and the same\n * `<mat-tab-group>` content-children scope.\n *\n * @category ui/mat-tabs\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/mat-tabs-registry.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMatTabs, CngxMatTabError, CNGX_MAT_TABS_REGISTRY_HOST\n */\n@Directive({\n selector: '[cngxMatTabsRegistry]',\n exportAs: 'cngxMatTabsRegistry',\n standalone: true,\n providers: [\n {\n provide: CNGX_MAT_TABS_REGISTRY_HOST,\n useExisting: CngxMatTabsRegistry,\n },\n ],\n})\nexport class CngxMatTabsRegistry implements CngxMatTabsRegistryHost {\n private readonly presenter = inject<CngxTabGroupHost>(CNGX_TAB_GROUP_HOST);\n private readonly destroyRef = inject(DestroyRef);\n private readonly envInjector = inject(EnvironmentInjector);\n private readonly createHandle = inject(CNGX_MAT_TAB_HANDLE_FACTORY);\n private readonly matTabGroup = inject(MatTabGroup, { self: true });\n\n private readonly matTabs = contentChildren(MatTab, { descendants: true });\n\n private readonly seam = createOrderedRegistrationSeam<MatTab, CngxMatTabsRegistryEntry>({\n create: (tab) => {\n // Per-tab child injector scopes the `toSignal(_stateChanges)`\n // bridge inside createMatTabHandle - destroying it on tab\n // removal fires `takeUntilDestroyed`.\n const childInjector = createEnvironmentInjector([], this.envInjector);\n const idSeed = () => nextUid('cngx-mat-tab-');\n const setup = this.createHandle(tab, idSeed, childInjector);\n return { setup, childInjector };\n },\n register: (entry) => this.presenter.register(entry.setup.handle),\n unregister: (entry) => this.presenter.unregister(entry.setup.handle.id, entry.setup.handle),\n dispose: (entry) => entry.childInjector.destroy(),\n });\n\n constructor() {\n effect(() => {\n // Ownership filter: `descendants: true` also surfaces MatTabs of\n // a tab-group nested inside one of OUR tabs' content. Each MatTab\n // carries its owning `_closestTabGroup` (see\n // MaterialPrivateSurfaces.ClosestTabGroupSource), so foreign tabs\n // are dropped before they can register with this presenter -\n // mirrors the mat-stepper/mat-accordion sibling filters.\n const tabs = this.matTabs().filter(\n (tab) =>\n (tab as unknown as MaterialPrivateSurfaces.ClosestTabGroupSource)._closestTabGroup ===\n this.matTabGroup,\n );\n untracked(() => this.seam.sync(tabs));\n });\n\n this.destroyRef.onDestroy(() => this.seam.clear());\n }\n\n getHandleSetup(\n matTab: MatTab,\n ): Pick<CngxMatTabHandleSetup, 'errorAggregator' | 'directError'> | undefined {\n return this.seam.get(matTab)?.setup;\n }\n}\n","import type { CngxTabOverflowDomAdapter } from '@cngx/common/tabs';\n\nimport { MaterialPrivateSurfaces } from '../material-bridge/private-surfaces';\n\n/**\n * Material variant of {@link CngxTabOverflowDomAdapter}.\n *\n * `resolveStripRoot` walks from host up to `<mat-tab-header>` and\n * locates `.mat-mdc-tab-label-container` via any rendered\n * `.mat-mdc-tab` descendant - Material's IO-friendly scroll\n * container.\n *\n * `resolveTabButton` indexes positionally; Material owns the DOM\n * and cngx handle ids never reach the button elements. Index\n * correlates against `presenter.tabs()` registration order.\n *\n * Wire it via the directive's\n * `CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY` provider:\n *\n * ```ts\n * providers: [\n * { provide: CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY,\n * useValue: createCngxMatTabOverflowDomAdapter }\n * ]\n * ```\n *\n * @category ui/mat-tabs\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/overflow/mat-tab-overflow-dom-adapter.ts\n * @since 0.1.0\n * @relatedTo CngxTabOverflow, CngxMatTabs, CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY\n */\nexport function createCngxMatTabOverflowDomAdapter(): CngxTabOverflowDomAdapter {\n return {\n resolveStripRoot(_panelHost, host) {\n // Returning null is a retry signal - the rAF loop polls again\n // on the next frame, succeeds once MatTabHeader has committed.\n const header = host.closest<HTMLElement>(\n MaterialPrivateSurfaces.MAT_MDC_TAB_HEADER_SELECTOR,\n );\n const anyTab = header?.querySelector<HTMLElement>(\n MaterialPrivateSurfaces.MAT_MDC_TAB_SELECTOR,\n );\n return (\n anyTab?.closest<HTMLElement>(\n MaterialPrivateSurfaces.MAT_MDC_TAB_LABEL_CONTAINER_SELECTOR,\n ) ?? null\n );\n },\n resolveTabButton(_handle, root, idx) {\n return (\n root\n .querySelectorAll<HTMLElement>(\n MaterialPrivateSurfaces.MAT_MDC_TAB_SELECTOR,\n )\n .item(idx) ?? null\n );\n },\n };\n}\n","import {\n afterNextRender,\n computed,\n contentChild,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n Injectable,\n inject,\n Injector,\n Renderer2,\n type TemplateRef,\n untracked,\n ViewContainerRef,\n type ComponentRef,\n} from '@angular/core';\nimport { MatTabGroup } from '@angular/material/tabs';\n\nimport { createMaterialBidirectionalSync } from '@cngx/common/data';\nimport {\n CNGX_DOM_ANCHOR_RETRY_FACTORY,\n CNGX_TAB_GROUP_HOST,\n CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY,\n CNGX_TAB_PANEL_HOST,\n CngxTabGroupPresenter,\n injectTabsI18n,\n type CngxTabGroupHost,\n type CngxTabPanelHost,\n} from '@cngx/common/tabs';\nimport { CngxTabOverflow } from '@cngx/ui/tabs';\nimport { cngxDevWarn } from '@cngx/utils';\n\nimport {\n createMatTabAggregatorDecoration,\n createMatTabRejectionDecoration,\n} from './decorations/decoration-projectors';\nimport { createAggregatedErrorTabs } from './decorations/aggregated-error-tabs';\nimport { injectMatTabsConfig } from './mat-tabs-config';\nimport { createDecorationTemplates } from './decorations/decoration-templates';\nimport { CngxMatTabAggregatorContent } from './decorations/mat-tab-aggregator-content.directive';\nimport { CngxMatTabRejectionContent } from './decorations/mat-tab-rejection-content.directive';\nimport { mountLiveRegionAnnouncer } from './material-bridge/live-region';\nimport { createRejectionState } from './decorations/rejection-state';\nimport { CngxMatTabsRegistry } from './mat-tabs-registry.directive';\nimport { MaterialPrivateSurfaces } from './material-bridge/private-surfaces';\n\nimport { createCngxMatTabOverflowDomAdapter } from './overflow/mat-tab-overflow-dom-adapter';\n\n/**\n * Implements {@link CngxTabPanelHost} for the programmatically\n * mounted overflow popover. Delegates to the directive's\n * `CNGX_TAB_GROUP_HOST` presenter; both template lookups return\n * `null` because Material renders labels through `<mat-tab>` and\n * projected `<mat-tab-content>`.\n *\n * Class instead of factory-returned literal so a telemetry or\n * branded variant can subclass + swap via `useClass`. The directive\n * registers it once and binds `CNGX_TAB_PANEL_HOST` with\n * `useExisting`.\n *\n * @internal\n */\n@Injectable()\nexport class CngxMatTabsPanelHostAdapter implements CngxTabPanelHost {\n private readonly presenter = inject<CngxTabGroupHost>(CNGX_TAB_GROUP_HOST);\n\n readonly tabs = this.presenter.tabs;\n readonly activeId = this.presenter.activeId;\n readonly orientation = this.presenter.orientation;\n\n selectById(id: string): void {\n this.presenter.selectById(id);\n }\n\n labelTemplateFor(_id: string): TemplateRef<unknown> | null {\n return null;\n }\n\n contentTemplateFor(_id: string): TemplateRef<unknown> | null {\n return null;\n }\n}\n\n/**\n * Attaches to an existing `<mat-tab-group>` and wires it to a\n * {@link CngxTabGroupPresenter} - consumers get the commit-action\n * lifecycle, `CNGX_STATEFUL` (so `<cngx-toast-on />` and\n * `<cngx-banner-on />` compose as children), and the tab-handle\n * registry from one attribute.\n *\n * Topology inverts `<cngx-mat-stepper>`: Material is the host, cngx\n * is the instrumentation layer. `inject(MatTabGroup, { self: true })`\n * resolves on the consumer's own element - no content projection\n * blocker applies here.\n *\n * Rejection (`--error`) and aggregator (`--has-errors`) visuals\n * live in the package-private projector factories under\n * `./decorations/`; this directive supplies their reactive triggers\n * and the delegators consumer templates call.\n *\n * **Inert on this bridge: `loop` and `orientation`.** Both are\n * forwarded so templates stay portable between `<cngx-tab-group>` and\n * the instrumented `<mat-tab-group>`, but Material owns the keyboard\n * interaction and the strip layout here - `loop` never changes\n * Material's Home/End/arrow behaviour, and `orientation` never\n * rotates the Material strip (use `<mat-tab-group headerPosition>` /\n * Material's own APIs for that). `orientation` still reaches the\n * cngx side through the overflow panel-host adapter; `loop` feeds\n * nothing Material does not already own. Deliberately kept in the\n * forwarded input set for template portability - removing them would\n * break `<cngx-tab-group>`-authored templates on paste.\n *\n * @playground Form error aggregation ./examples/form-errors/form-errors.component.ts\n *\n * @category ui/mat-tabs\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/mat-tabs.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMatTabsRegistry, CngxMatTabError, CngxMatStepper\n * @slot cngxMatTabAggregatorContent Replaces the aggregated error summary projected into a Material tab.\n * @slot cngxMatTabRejectionContent Replaces the rejection notice on a rolled-back Material tab.\n */\n@Directive({\n selector: '[cngxMatTabs]',\n exportAs: 'cngxMatTabs',\n standalone: true,\n hostDirectives: [\n {\n directive: CngxTabGroupPresenter,\n inputs: ['activeIndex', 'orientation', 'loop', 'commitAction', 'commitMode'],\n outputs: ['activeIndexChange'],\n },\n // Provides `CNGX_MAT_TABS_REGISTRY_HOST` so per-tab decoration\n // directives reach the registry through a typed token rather\n // than injecting this concrete class.\n CngxMatTabsRegistry,\n ],\n providers: [\n // Material variant of the overflow molecule's DOM-resolution\n // strategy. Swaps `.cngx-tabs__strip-wrapper` walks for the Material\n // `.mat-mdc-tab-header` → `.mat-mdc-tab-label-container` walk and\n // index-based `.mat-mdc-tab` resolution.\n {\n provide: CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY,\n useValue: createCngxMatTabOverflowDomAdapter,\n },\n // Panel-host adapter for the programmatically mounted overflow\n // molecule. `useExisting` binding below ensures every injection\n // resolves to the single per-host instance. The cngx-native\n // `<cngx-tab-group>` path keeps its own `useExisting:\n // CngxTabGroup` provider - sits one injector layer closer.\n CngxMatTabsPanelHostAdapter,\n {\n provide: CNGX_TAB_PANEL_HOST,\n useExisting: CngxMatTabsPanelHostAdapter,\n },\n ],\n})\nexport class CngxMatTabs {\n private readonly matTabGroup = inject(MatTabGroup, { self: true });\n private readonly presenter = inject(CNGX_TAB_GROUP_HOST);\n private readonly destroyRef = inject(DestroyRef);\n private readonly injector = inject(Injector);\n private readonly renderer = inject(Renderer2);\n private readonly hostEl = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n\n // Field order matters - `overflowRef` reads `viewContainerRef` at\n // class-init time. The VCR also feeds the aggregator-decoration\n // slot path further down.\n private readonly viewContainerRef = inject(ViewContainerRef);\n\n // Programmatic mount of the cngx overflow molecule.\n // `injector: this.injector` is load-bearing - without it,\n // `vcr.createComponent` walks the host-template's parent VCR for\n // DI resolution, missing this directive's `CNGX_TAB_PANEL_HOST`\n // and `CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY` providers, and the\n // molecule NG0201s on `inject(CNGX_TAB_PANEL_HOST)`. The molecule\n // initially lands as a sibling of `<mat-tab-group>`; the\n // `afterNextRender` block below moves it into\n // `.mat-mdc-tab-header`.\n private readonly overflowRef: ComponentRef<CngxTabOverflow> =\n this.viewContainerRef.createComponent(CngxTabOverflow, {\n injector: this.injector,\n });\n\n private readonly aggregatorContentSlot = contentChild(CngxMatTabAggregatorContent);\n private readonly matTabsConfig = injectMatTabsConfig();\n private readonly rejectionContentSlot = contentChild(CngxMatTabRejectionContent);\n // Shared with `[cngxMatTabNav]`: one slot resolution order for both hosts.\n private readonly decorationTemplates = createDecorationTemplates(\n this.aggregatorContentSlot,\n this.rejectionContentSlot,\n this.matTabsConfig,\n );\n private readonly i18n = injectTabsI18n();\n\n // Bundle shares one source-walk across failedHandleId /\n // descriptorText / originLabel / liveAnnouncement - pillar-2\n // phrasing parity with cngx-native.\n private readonly rejectionState = createRejectionState(this.presenter, this.i18n);\n\n // Shared with `[cngxMatTabNav]` - one body, two hosts (Pillar 3).\n // Structural equal lives in the factory so the projector doesn't\n // churn on no-op aggregator re-emissions.\n private readonly aggregatedErrorTabs = createAggregatedErrorTabs(this.presenter, this.i18n);\n\n constructor() {\n const matTabsConfig = this.matTabsConfig;\n\n // Polite live region - attribute directive owns no template, so\n // the helper forwards every non-empty announcement to the shared\n // root CngxLiveAnnouncer, which owns the persistent region pair.\n mountLiveRegionAnnouncer({\n announcement: this.rejectionState.liveAnnouncement,\n injector: this.injector,\n });\n\n // Decoration projectors own DOM-mutation state plus `effect()`\n // registration; the directive only supplies reactive triggers.\n createMatTabRejectionDecoration({\n hostEl: this.hostEl,\n failedHandleId: this.rejectionState.failedHandleId,\n failedIndex: this.presenter.lastFailedIndex,\n descriptorText: this.rejectionState.descriptorText,\n renderer: this.renderer,\n injector: this.injector,\n destroyRef: this.destroyRef,\n contentTemplate: this.decorationTemplates.rejection,\n viewContainerRef: this.viewContainerRef,\n originLabel: this.rejectionState.originLabel,\n reason: this.rejectionState.reason,\n });\n\n createMatTabAggregatorDecoration({\n hostEl: this.hostEl,\n errorTabs: this.aggregatedErrorTabs,\n renderer: this.renderer,\n injector: this.injector,\n destroyRef: this.destroyRef,\n contentTemplate: this.decorationTemplates.aggregator,\n viewContainerRef: this.viewContainerRef,\n onHalfWiredSlot: matTabsConfig.halfWiredSlotSink,\n });\n\n this.destroyRef.onDestroy(() => this.overflowRef.destroy());\n\n // Anchor the overflow molecule inside `.mat-mdc-tab-header` so\n // the More button pins to the strip's trailing edge. Bounded\n // `createDomAnchorRetry` covers the deferred-host case\n // (`<mat-tab-group>` gated behind `*ngIf` / `@defer`); the cap\n // dev-warns when consumer DOM never materialises. The\n // flex-layout skin in `mat-tabs.css` handles positioning - no\n // imperative layout work needed.\n const anchorMaxAttempts = matTabsConfig.anchorMaxAttempts;\n const anchorRetry = inject(CNGX_DOM_ANCHOR_RETRY_FACTORY)({\n attempt: () => {\n const headerEl = this.hostEl.querySelector<HTMLElement>(\n MaterialPrivateSurfaces.MAT_MDC_TAB_HEADER_SELECTOR,\n );\n if (!headerEl) {\n return null;\n }\n const overflowEl = this.overflowRef.location.nativeElement as HTMLElement;\n this.renderer.addClass(overflowEl, 'cngx-mat-tabs-more');\n this.renderer.appendChild(headerEl, overflowEl);\n return true;\n },\n maxAttempts: anchorMaxAttempts,\n schedule: (cb) => {\n afterNextRender(cb, { injector: this.injector });\n return () => undefined;\n },\n onGiveUp: () => {\n if (typeof ngDevMode !== 'undefined' && ngDevMode) {\n cngxDevWarn(\n 'CNGX3007',\n `[cngxMatTabs] could not anchor <cngx-tab-overflow> after ${anchorMaxAttempts} ` +\n 'attempts - .mat-mdc-tab-header was not found inside the ' +\n 'host. The More popover will fall back to a sibling-of-' +\n '<mat-tab-group> position; verify Material rendered the ' +\n 'strip (e.g. consumer is not gating <mat-tab-group> behind ' +\n 'a never-true *ngIf / @defer).',\n );\n }\n },\n });\n afterNextRender(() => anchorRetry.start());\n this.destroyRef.onDestroy(() => anchorRetry.cancel());\n\n const sync = createMaterialBidirectionalSync({\n presenterIndex: this.presenter.activeIndex,\n readSelectedIndex: () => this.matTabGroup.selectedIndex ?? 0,\n writeSelectedIndex: (i) => {\n this.matTabGroup.selectedIndex = i;\n },\n selectionChange$: this.matTabGroup.selectedIndexChange.asObservable(),\n onMaterialSelection: (i) => this.presenter.select(i),\n injector: this.injector,\n destroyRef: this.destroyRef,\n });\n\n // Routed (pessimistic) gate: a rejected switch holds `activeIndex` at\n // origin, so the presenter to Material mirror never fires and Material\n // stays eager-advanced on the rejected tab. Snap it back when the\n // commit settles as refused or failed. Keyed on the outcome sequence,\n // not the status: a refusal settles to 'idle' and never reaches\n // 'error', while every failure through `select()` records a failed\n // outcome with a fresh sequence in the same flush as the 'error'\n // status, so the sequence edge covers both. One reconcile per settle:\n // a second write of the same index leaves a self-echo that Material\n // never emits and that would swallow the user's next pick of that\n // tab. A number compares with `Object.is`, so the close shift (index\n // moved, sequence copied) never re-runs it; `undefined` is ignored.\n const outcomeSequence = computed(() => this.presenter.lastOutcome()?.sequence);\n effect(() => {\n const sequence = outcomeSequence();\n untracked(() => {\n if (sequence !== undefined) {\n sync.reconcile();\n }\n });\n });\n }\n\n /**\n * Clears `presenter.lastFailedIndex`, dismissing the rejection\n * decoration. Mirrors `CngxTabGroup.clearLastFailed()` so a\n * template ref (`#mt=\"cngxMatTabs\"`) is enough - no host-token\n * injection needed.\n */\n clearLastFailed(): void {\n this.presenter.clearLastFailed();\n }\n}\n","import {\n contentChild,\n DestroyRef,\n Directive,\n ElementRef,\n inject,\n Injector,\n Renderer2,\n ViewContainerRef,\n} from '@angular/core';\n\nimport {\n CNGX_TAB_GROUP_HOST,\n CNGX_TAB_NAV_HOST,\n CngxTabGroupPresenter,\n createTabNavAnnouncement,\n injectTabsI18n,\n type CngxTabGroupHost,\n} from '@cngx/common/tabs';\n\nimport {\n createMatTabAggregatorDecoration,\n createMatTabRejectionDecoration,\n} from './decorations/decoration-projectors';\nimport { createAggregatedErrorTabs } from './decorations/aggregated-error-tabs';\nimport { createDecorationTemplates } from './decorations/decoration-templates';\nimport { CngxMatTabAggregatorContent } from './decorations/mat-tab-aggregator-content.directive';\nimport { CngxMatTabRejectionContent } from './decorations/mat-tab-rejection-content.directive';\nimport { injectMatTabsConfig } from './mat-tabs-config';\nimport { mountLiveRegionAnnouncer } from './material-bridge/live-region';\nimport { createRejectionState } from './decorations/rejection-state';\n\n/**\n * Layers the cngx error / rejection / announcement layer onto\n * Material's native router tabs (`<nav mat-tab-nav-bar>` /\n * `<a mat-tab-link>` / `<mat-tab-nav-panel>`). The parallel bridge to\n * {@link CngxMatTabs}: `MatTabNav` has no `MatTab` and no\n * `selectedIndex`, so handles register per `<a mat-tab-link>` via\n * {@link CngxMatTabLink}, and the decoration projectors target\n * `.mat-mdc-tab-link` instead of `.mat-mdc-tab`.\n *\n * Gating is **native**: each link is a `routerLink`, so the router runs\n * `CanDeactivate` directly and this directive installs no\n * commit-action. The active index follows the route - add\n * `[cngxTabsRouteSync]` to the same `<nav>` and give each\n * `[cngxMatTabLink]` an `id` matching its route segment; route-sync\n * reflects `NavigationEnd` onto `activeIndex` (its commit-action stays\n * dormant because link clicks navigate natively, never through\n * `presenter.select`). Ableitung statt Verwaltung - the route-active\n * link is the single source of the active index. `activeIndex` /\n * `activeIndexChange` are forwarded from the presenter hostDirective,\n * so a consumer without route-sync can two-way bind the active link\n * the same way `[cngxMatTabs]` consumers do.\n *\n * Active-link changes speak: the shared nav announcement bundle\n * ({@link createTabNavAnnouncement}) feeds the landing link's label to\n * the shared live announcer - silent through the mount window, so a\n * deep link's initial active state is not announced as a change.\n *\n * Composes {@link CngxTabGroupPresenter} via `hostDirectives` so the\n * `CNGX_STATEFUL` producer, the `lastFailedIndex` rejection slot, and\n * the live-region announcer come for free, identical to the cngx\n * organism (Pillar 2 - same communication across skins).\n *\n * Decoration content-template slots resolve as on `[cngxMatTabs]`:\n * a projected `*cngxMatTabRejectionContent` wins over\n * `provideMatTabsConfig(withMatTabRejectionTemplate(...))`, and a\n * projected `*cngxMatTabAggregatorContent` replaces the aggregated error\n * summary; without either, the projectors render their built-in\n * `cngx-sr-only` text.\n *\n * @playground Native router tabs with a CanDeactivate guard ./examples/router-nav/router-nav.component.ts\n *\n * @category ui/mat-tabs\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/mat-tab-nav.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMatTabLink, CngxMatTabs, CngxTabsRouteSync\n * @slot cngxMatTabAggregatorContent Replaces the aggregated error summary projected into a Material tab.\n * @slot cngxMatTabRejectionContent Replaces the rejection notice on a rolled-back Material tab.\n */\n@Directive({\n selector: '[cngxMatTabNav]',\n exportAs: 'cngxMatTabNav',\n standalone: true,\n // Presence-only marker: it tells a stacked [cngxTabsRouteSync] that its\n // links own subtrees, so the URL match is prefix rather than suffix.\n providers: [{ provide: CNGX_TAB_NAV_HOST, useValue: true }],\n hostDirectives: [\n {\n directive: CngxTabGroupPresenter,\n inputs: ['activeIndex'],\n outputs: ['activeIndexChange'],\n },\n ],\n})\nexport class CngxMatTabNav {\n private readonly presenter = inject<CngxTabGroupHost>(CNGX_TAB_GROUP_HOST);\n private readonly destroyRef = inject(DestroyRef);\n private readonly injector = inject(Injector);\n private readonly renderer = inject(Renderer2);\n private readonly hostEl = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n private readonly viewContainerRef = inject(ViewContainerRef);\n private readonly matTabsConfig = injectMatTabsConfig();\n private readonly i18n = injectTabsI18n();\n\n private readonly aggregatorContentSlot = contentChild(CngxMatTabAggregatorContent);\n private readonly rejectionContentSlot = contentChild(CngxMatTabRejectionContent);\n private readonly decorationTemplates = createDecorationTemplates(\n this.aggregatorContentSlot,\n this.rejectionContentSlot,\n this.matTabsConfig,\n );\n\n private readonly rejectionState = createRejectionState(this.presenter, this.i18n);\n private readonly aggregatedErrorTabs = createAggregatedErrorTabs(this.presenter, this.i18n);\n\n constructor() {\n mountLiveRegionAnnouncer({\n announcement: this.rejectionState.liveAnnouncement,\n injector: this.injector,\n });\n\n // Active-link landing announcement - same bundle as the cngx-native\n // <cngx-tab-nav>; the shared announcer coalesces both feeds into\n // one polite region.\n mountLiveRegionAnnouncer({\n announcement: createTabNavAnnouncement({\n presenter: this.presenter,\n injector: this.injector,\n }).liveAnnouncement,\n injector: this.injector,\n });\n\n // Same projector bodies as `[cngxMatTabs]`; only the per-tab element\n // selector differs (`.mat-mdc-tab-link` vs `.mat-mdc-tab`).\n createMatTabRejectionDecoration({\n hostEl: this.hostEl,\n failedHandleId: this.rejectionState.failedHandleId,\n failedIndex: this.presenter.lastFailedIndex,\n descriptorText: this.rejectionState.descriptorText,\n renderer: this.renderer,\n injector: this.injector,\n destroyRef: this.destroyRef,\n contentTemplate: this.decorationTemplates.rejection,\n viewContainerRef: this.viewContainerRef,\n originLabel: this.rejectionState.originLabel,\n reason: this.rejectionState.reason,\n buttonSelector: '.mat-mdc-tab-link',\n });\n\n createMatTabAggregatorDecoration({\n hostEl: this.hostEl,\n errorTabs: this.aggregatedErrorTabs,\n renderer: this.renderer,\n injector: this.injector,\n destroyRef: this.destroyRef,\n contentTemplate: this.decorationTemplates.aggregator,\n viewContainerRef: this.viewContainerRef,\n onHalfWiredSlot: this.matTabsConfig.halfWiredSlotSink,\n buttonSelector: '.mat-mdc-tab-link',\n });\n }\n\n /**\n * Clears `presenter.lastFailedIndex`, dismissing the rejection\n * decoration. Mirrors {@link CngxMatTabs.clearLastFailed} so a\n * template ref (`#nav=\"cngxMatTabNav\"`) is enough.\n */\n clearLastFailed(): void {\n this.presenter.clearLastFailed();\n }\n}\n","import {\n booleanAttribute,\n computed,\n DestroyRef,\n Directive,\n inject,\n input,\n type OnInit,\n type Signal,\n signal,\n} from '@angular/core';\nimport { CNGX_TAB_GROUP_HOST, type CngxTabGroupHost, type CngxTabHandle } from '@cngx/common/tabs';\nimport { nextUid } from '@cngx/core/utils';\nimport type { CngxErrorAggregatorContract } from '@cngx/common/interactive';\n\n/**\n * Registers an `<a mat-tab-link>` anchor as a {@link CngxTabHandle}\n * with the enclosing {@link CngxMatTabNav} presenter. `mat-tab-nav-bar`\n * has no `MatTab` to hang a handle on (the links are the tabs), so this\n * per-link directive is the registration seam - symmetric with how\n * `CngxTab` registers in the cngx-native path and how\n * {@link CngxMatTabsRegistry} registers each `<mat-tab>`.\n *\n * Registration order follows DOM order (Angular instantiates content\n * directives top-to-bottom), so the presenter's `tabs()` index aligns\n * with `nav.querySelectorAll('.mat-mdc-tab-link')` - the index the\n * decoration projectors correlate against.\n *\n * Gating is native: the link's `routerLink` runs `CanDeactivate`\n * directly, so this directive installs no commit-action. The active\n * index follows the route through `[cngxTabsRouteSync]` on the nav,\n * which matches each handle's `id` (set to the route segment) against\n * the URL.\n *\n * @category ui/mat-tabs\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/mat-tab-link.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMatTabNav, CngxMatTabs, CngxTab\n */\n@Directive({\n selector: '[cngxMatTabLink]',\n exportAs: 'cngxMatTabLink',\n standalone: true,\n})\nexport class CngxMatTabLink implements OnInit {\n private readonly host = inject<CngxTabGroupHost>(CNGX_TAB_GROUP_HOST);\n private readonly destroyRef = inject(DestroyRef);\n\n /**\n * Handle id. Set it to the link's route segment so the nav's\n * `[cngxTabsRouteSync]` reflects the active route onto this tab via\n * the default `(h) => [h.id]` mapping. Defaults to a fresh uid when\n * route-sync is not used.\n */\n readonly id = input<string>(nextUid('cngx-mat-tab-link-'));\n /** Accessible label fed to the live-region announcer. */\n readonly label = input<string | undefined>(undefined);\n /**\n * Direct error flag for the link - `true` or a non-empty string marks\n * it invalid (the string doubles as the message). Mirrors\n * `CngxTab.error` and `[cngxMatTabErrorFlag]`.\n */\n readonly error = input<string | boolean>(false);\n /** Optional rich error aggregator for the link. */\n readonly errorAggregator = input<CngxErrorAggregatorContract | undefined>(undefined);\n /**\n * Disabled state of the link. Angular binds `[disabled]` to every\n * directive on the element that declares the input, so `MatTabLink`\n * and this directive read one template binding and the handle tracks\n * it live. An imperative write to the `MatTabLink` instance is not\n * seen; the template binding is the contract.\n */\n readonly disabled = input(false, { transform: booleanAttribute });\n\n private readonly errorMessage: Signal<string | undefined> = computed(() => {\n const value = this.error();\n return typeof value === 'string' && value !== '' ? value : undefined;\n });\n\n private readonly hasError: Signal<boolean> = computed(\n () => {\n const direct = this.error();\n return (\n (direct !== false && direct !== '') ||\n (this.errorAggregator()?.shouldShow?.() ?? false)\n );\n },\n { equal: Object.is },\n );\n\n ngOnInit(): void {\n const handle: CngxTabHandle = {\n id: this.id(),\n label: this.label,\n subLabel: signal(undefined),\n disabled: this.disabled,\n errorAggregator: this.errorAggregator,\n hasError: this.hasError,\n errorMessage: this.errorMessage,\n closable: signal(undefined),\n };\n this.host.register(handle);\n this.destroyRef.onDestroy(() => this.host.unregister(handle.id, handle));\n }\n}\n","import { inject } from '@angular/core';\nimport { MatTab } from '@angular/material/tabs';\n\nimport { CNGX_TAB_GROUP_HOST, type CngxTabGroupHost } from '@cngx/common/tabs';\nimport { CngxRuntimeError } from '@cngx/utils';\n\nimport {\n CNGX_MAT_TABS_REGISTRY_HOST,\n type CngxMatTabsRegistryHost,\n} from './mat-tabs-registry.directive';\n\n/** What a per-tab error directive writes through: its tab and the group's registry. */\nexport interface CngxMatTabErrorTarget {\n readonly matTab: MatTab;\n readonly registry: CngxMatTabsRegistryHost;\n readonly presenter: CngxTabGroupHost;\n}\n\n/**\n * Inject the `<mat-tab>` a per-tab error directive sits on, plus the registry\n * and presenter of the surrounding `<mat-tab-group cngxMatTabs>`. Throws a\n * `CngxRuntimeError` with code `CNGX3020` when either prerequisite is\n * missing, in development and production alike. `selector` names the\n * directive in the development message.\n *\n * @internal\n */\nexport function injectMatTabErrorTarget(selector: string): CngxMatTabErrorTarget {\n const matTab = inject(MatTab, { self: true, optional: true });\n const registry = inject(CNGX_MAT_TABS_REGISTRY_HOST, { host: true, optional: true });\n const presenter = inject(CNGX_TAB_GROUP_HOST, { optional: true });\n if (!matTab || !registry || !presenter) {\n throw new CngxRuntimeError(\n 'CNGX3020',\n typeof ngDevMode !== 'undefined' &&\n ngDevMode &&\n `[${selector}] must be placed on a <mat-tab> inside <mat-tab-group cngxMatTabs>.`,\n );\n }\n return { matTab, registry, presenter };\n}\n","import { DestroyRef, Directive, effect, inject, input, untracked } from '@angular/core';\n\nimport type { CngxErrorAggregatorContract } from '@cngx/common/interactive';\n\nimport { injectMatTabErrorTarget } from './mat-tab-error-target';\n\n/**\n * Per-tab error-aggregator binding for `[cngxMatTabs]`. Attach to a\n * `<mat-tab>`; the bound aggregator's `shouldShow()` projects onto\n * the matching Material tab button (badge + descriptor span) via\n * the Renderer2 effect inside {@link CngxMatTabs}.\n *\n * Material owns `<mat-tab>` declarations - `[cngxTab]` cannot host\n * here - so a sibling attribute directive carries the input.\n * Empty-string transform handles the bare-attribute case per\n * `feedback_bridge_input_not_required` (a developer typing\n * `cngxMatTabError` without `[]` brackets must not poison the\n * slot).\n *\n * Locates its target via {@link CNGX_MAT_TABS_REGISTRY_HOST} -\n * the registry provides the token with `useExisting`, so sibling\n * directives reach per-handle slots through a typed contract\n * instead of the concrete class. Tracks `presenter.tabs()` to\n * recover from a same-microtask race where the directive injects\n * before the registry's sync runs. `destroyRef.onDestroy` clears\n * the slot so an `*ngIf`-toggled binding returns to the\n * no-aggregator default.\n *\n * @category ui/mat-tabs\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/mat-tab-error.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMatTabs, CngxMatTabsRegistry, CngxMatTabRejectionContent\n */\n@Directive({\n selector: '[cngxMatTabError]',\n exportAs: 'cngxMatTabError',\n standalone: true,\n})\nexport class CngxMatTabError {\n private readonly target = injectMatTabErrorTarget('cngxMatTabError');\n private readonly destroyRef = inject(DestroyRef);\n\n readonly aggregator = input<\n CngxErrorAggregatorContract | undefined,\n CngxErrorAggregatorContract | '' | undefined\n >(undefined, {\n alias: 'cngxMatTabError',\n transform: (value) => (typeof value === 'string' ? undefined : value),\n });\n\n constructor() {\n effect(() => {\n // Race window - registry's `contentChildren(MatTab)` query and\n // our injection land in the same microtask, so the first lookup\n // can miss our handle. Tracking `presenter.tabs()` re-fires the\n // effect on the next sync tick. `untracked` around the write\n // pre-empts a future regression where `getHandleSetup` reads a\n // signal and self-triggers the aggregator pump.\n const aggregator = this.aggregator();\n // Race-recovery dependency - tracks `setupsByTab` population so\n // the effect re-fires once our `MatTab` is registered. The bare\n // read is intentional; full rationale lives in the effect's\n // opening comment above. Do NOT tag as dead code.\n this.target.presenter.tabs();\n\n untracked(() => {\n const setup = this.target.registry.getHandleSetup(this.target.matTab);\n setup?.errorAggregator.set(aggregator);\n });\n });\n\n this.destroyRef.onDestroy(() => {\n const setup = this.target.registry.getHandleSetup(this.target.matTab);\n setup?.errorAggregator.set(undefined);\n });\n }\n}\n","import { DestroyRef, Directive, effect, inject, input, untracked } from '@angular/core';\n\nimport { injectMatTabErrorTarget } from './mat-tab-error-target';\n\n/**\n * Per-tab direct invalid flag for `[cngxMatTabs]` - the simple-case\n * sibling to `[cngxMatTabError]`. Attach to a `<mat-tab>`; the bound\n * `string | boolean` writes the per-handle `directError` slot, which\n * folds into the handle's `hasError` / `errorMessage`. A non-empty\n * string doubles as the SR descriptor message; `true` marks the tab\n * invalid with no message; `false` / `''` clear it. The folded state\n * drives the same header decoration as the aggregator: the\n * `cngx-mat-tab--has-errors` badge plus an SR-only descriptor span\n * referenced through `aria-describedby` (message, else the\n * `tabHasErrors` i18n phrase), removed again when the flag clears.\n *\n * Symmetric with `[cngxMatTabError]` (one directive, one\n * responsibility - Pillar 3): the aggregator stays the rich\n * multi-source path, this is the \"this tab is invalid\" marker that\n * needs no aggregator boilerplate. A bare `cngxMatTabErrorFlag`\n * attribute (no brackets) binds the empty string and is coerced to\n * `true` so presence alone marks the tab invalid.\n *\n * Locates its target via {@link CNGX_MAT_TABS_REGISTRY_HOST}, tracks\n * `presenter.tabs()` to recover from the content-init race, and\n * clears the slot on destroy - exactly as {@link CngxMatTabError}.\n *\n * @category ui/mat-tabs\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/mat-tab-error-flag.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMatTabs, CngxMatTabError, CngxMatTabsRegistry\n */\n@Directive({\n selector: '[cngxMatTabErrorFlag]',\n exportAs: 'cngxMatTabErrorFlag',\n standalone: true,\n})\nexport class CngxMatTabErrorFlag {\n private readonly target = injectMatTabErrorTarget('cngxMatTabErrorFlag');\n private readonly destroyRef = inject(DestroyRef);\n\n readonly error = input<string | boolean, string | boolean>(false, {\n alias: 'cngxMatTabErrorFlag',\n transform: (value) => (value === '' ? true : value),\n });\n\n constructor() {\n effect(() => {\n // Same content-init race as `[cngxMatTabError]` - the registry's\n // `contentChildren(MatTab)` query and our injection land in the\n // same microtask, so tracking `presenter.tabs()` re-fires the\n // effect once our handle is registered. `untracked` around the\n // write keeps the slot pump out of the reactive graph.\n const error = this.error();\n this.target.presenter.tabs();\n\n untracked(() => {\n const setup = this.target.registry.getHandleSetup(this.target.matTab);\n setup?.directError.set(error);\n });\n });\n\n this.destroyRef.onDestroy(() => {\n const setup = this.target.registry.getHandleSetup(this.target.matTab);\n setup?.directError.set(false);\n });\n }\n}\n","/**\n * @module @cngx/ui/mat-tabs\n *\n * Material instrumentation directive for `<mat-tab-group>`.\n */\nexport { CngxMatTabs } from './mat-tabs.directive';\nexport { CngxMatTabNav } from './mat-tab-nav.directive';\nexport { CngxMatTabLink } from './mat-tab-link.directive';\nexport { CngxMatTabError } from './mat-tab-error.directive';\nexport { CngxMatTabErrorFlag } from './mat-tab-error-flag.directive';\nexport {\n CNGX_MAT_TABS_REGISTRY_HOST,\n CngxMatTabsRegistry,\n type CngxMatTabsRegistryHost,\n} from './mat-tabs-registry.directive';\nexport {\n CngxMatTabAggregatorContent,\n type CngxMatTabAggregatorContentContext,\n} from './decorations/mat-tab-aggregator-content.directive';\nexport {\n CngxMatTabRejectionContent,\n type CngxMatTabRejectionContentContext,\n} from './decorations/mat-tab-rejection-content.directive';\nexport type { CngxMatTabHalfWiredSlotSink } from './decorations/half-wired-slot-sink';\nexport {\n CNGX_MAT_TABS_CONFIG,\n type CngxMatTabsConfig,\n type CngxMatTabsConfigFeature,\n type CngxMatTabsTemplates,\n CNGX_MAT_TABS_CONFIG_DEFAULTS,\n injectMatTabsConfig,\n provideMatTabsConfig,\n provideMatTabsConfigAt,\n withAnchorRetryAttempts,\n withHalfWiredSlotSink,\n withMatTabRejectionTemplate,\n} from './mat-tabs-config';\nexport {\n CNGX_MAT_TAB_HANDLE_FACTORY,\n createMatTabHandle,\n type CngxMatTabHandleFactory,\n type CngxMatTabHandleSetup,\n} from './material-bridge/handle';\nexport { MaterialPrivateSurfaces } from './material-bridge/private-surfaces';\n// Cross-entry internal surface: consumed by @cngx/ui/mat-stepper, same\n// pattern as MaterialPrivateSurfaces above. All @internal-tagged.\nexport {\n createOrderedRegistrationSeam,\n type CngxOrderedRegistrationSeam,\n type CngxOrderedRegistrationSeamOptions,\n} from './material-bridge/ordered-registration';\nexport {\n mountLiveRegionAnnouncer,\n type CngxMatBridgeLiveRegionOptions,\n} from './material-bridge/live-region';\nexport { createCngxMatTabOverflowDomAdapter } from './overflow/mat-tab-overflow-dom-adapter';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i2.CngxMatTabsRegistry"],"mappings":";;;;;;;;;;;;AAwBA;;;;;;;;AAQG;AACI,MAAM,iCAAiC,GAAgC,CAC5E,OAAO,KACL;IACF,IAAI,EAAE,OAAO,SAAS,KAAK,WAAW,IAAI,SAAS,CAAC,EAAE;QACpD;IACF;IACA,WAAW,CACT,UAAU,EACV,qDAAqD;AACnD,QAAA,CAAA,EAAA,EAAK,OAAO,CAAA,gDAAA,CAAkD;QAC9D,0DAA0D;QAC1D,4DAA4D;QAC5D,6DAA6D;AAC7D,QAAA,+DAA+D,CAClE;AACH,CAAC;;AChDD;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;AAMH;AACM,IAAW;AAAjB,CAAA,UAAiB,uBAAuB,EAAA;AAwDtC;;;;;;;;AAQG;IACU,uBAAA,CAAA,oBAAoB,GAAG,cAAc;AAElD;;;;;;;AAOG;IACU,uBA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