@spartan-ng/brain 1.10.0-beta.1 → 1.10.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,250 @@
1
- import { untracked, computed, InjectionToken, forwardRef, inject, ElementRef, PLATFORM_ID, DestroyRef, signal, afterNextRender, runInInjectionContext, Injector, SimpleChange } from '@angular/core';
1
+ import { isPlatformBrowser, isPlatformServer } from '@angular/common';
2
+ import { runInInjectionContext, inject, Injector, ElementRef, PLATFORM_ID, DestroyRef, HostAttributeToken, NgZone, effect, untracked, computed, InjectionToken, forwardRef, signal, afterNextRender, SimpleChange } from '@angular/core';
2
3
  import { Observable, pipe, merge, fromEvent } from 'rxjs';
3
4
  import { map, filter, distinctUntilChanged, takeUntil, debounceTime } from 'rxjs/operators';
4
5
  import { toObservable, toSignal } from '@angular/core/rxjs-interop';
5
- import { isPlatformServer } from '@angular/common';
6
+
7
+ function cssClassesToArray(classes, defaultClass = '') {
8
+ const value = classes ?? defaultClass;
9
+ return (Array.isArray(value) ? value : [value]).flatMap((className) => className.split(/\s+/).filter(Boolean));
10
+ }
11
+
12
+ // Global map to track class managers per element
13
+ const elementClassManagers = new WeakMap();
14
+ // Global mutation observer for all elements
15
+ let globalObserver = null;
16
+ const observedElements = new Set();
17
+ let sourceCounter = 0;
18
+ /**
19
+ * This function dynamically adds and removes classes for a given element without requiring
20
+ * the a class binding (e.g. `[class]="..."`) which may interfere with other class bindings.
21
+ *
22
+ * 1. This will merge the existing classes on the element with the new classes.
23
+ * 2. It will also remove any classes that were previously added by this function but are no longer present in the new classes.
24
+ * 3. Multiple calls to this function on the same element will be merged efficiently.
25
+ *
26
+ * The classes are merged with `options.merge`, so a customized merge function (e.g. one created
27
+ * with `createCn` from `cn/config`) is respected.
28
+ */
29
+ function brnClasses(computed, options) {
30
+ runInInjectionContext(options.injector ?? inject(Injector), () => {
31
+ const elementRef = options.elementRef ?? inject(ElementRef);
32
+ const platformId = inject(PLATFORM_ID);
33
+ const destroyRef = inject(DestroyRef);
34
+ const baseClasses = inject(new HostAttributeToken('class'), { optional: true });
35
+ const element = elementRef.nativeElement;
36
+ // Create unique identifier for this source
37
+ const sourceId = sourceCounter++;
38
+ // Get or create the class manager for this element
39
+ let manager = elementClassManagers.get(element);
40
+ if (!manager) {
41
+ // Initialize base classes from variation (host attribute 'class')
42
+ const initialBaseClasses = new Set();
43
+ if (baseClasses) {
44
+ toClassList(baseClasses).forEach((cls) => initialBaseClasses.add(cls));
45
+ }
46
+ manager = {
47
+ element,
48
+ merge: options.merge,
49
+ sources: new Map(),
50
+ baseClasses: initialBaseClasses,
51
+ isUpdating: false,
52
+ nextOrder: 0,
53
+ hasInitialized: false,
54
+ restoreRafId: null,
55
+ transitionsSuppressed: false,
56
+ previousTransition: '',
57
+ previousTransitionPriority: '',
58
+ };
59
+ elementClassManagers.set(element, manager);
60
+ // Setup global observer if needed and register this element. Created outside the zone so
61
+ // class mutations don't trigger app-wide change detection (and loop if CD writes a class).
62
+ inject(NgZone).runOutsideAngular(() => setupGlobalObserver(platformId));
63
+ observedElements.add(element);
64
+ // Suppress transitions until the first effect writes correct classes and
65
+ // the browser has painted them. This prevents CSS transition animations
66
+ // during hydration when classes change from SSR state to client state.
67
+ if (isPlatformBrowser(platformId)) {
68
+ manager.previousTransition = element.style.getPropertyValue('transition');
69
+ manager.previousTransitionPriority = element.style.getPropertyPriority('transition');
70
+ element.style.setProperty('transition', 'none', 'important');
71
+ manager.transitionsSuppressed = true;
72
+ }
73
+ }
74
+ // Assign order once at registration time
75
+ const sourceOrder = manager.nextOrder++;
76
+ function updateClasses() {
77
+ // Get the new classes from the computed function, the merge function resolves arrays and objects
78
+ const value = computed();
79
+ const newClasses = toClassList(typeof value === 'string' ? value : options.merge(value));
80
+ // Update this source's classes, keeping the original order
81
+ manager.sources.set(sourceId, {
82
+ classes: new Set(newClasses),
83
+ order: sourceOrder,
84
+ });
85
+ // Update the element
86
+ updateElement(manager);
87
+ // Re-enable transitions after the first effect writes correct classes.
88
+ // Deferred to next animation frame so the browser paints the class change
89
+ // with transitions disabled first, then re-enables them.
90
+ if (manager.transitionsSuppressed) {
91
+ manager.transitionsSuppressed = false;
92
+ manager.restoreRafId = requestAnimationFrame(() => {
93
+ manager.restoreRafId = null;
94
+ restoreTransitionSuppression(manager);
95
+ });
96
+ }
97
+ }
98
+ // Register cleanup with DestroyRef
99
+ destroyRef.onDestroy(() => {
100
+ if (manager.restoreRafId !== null) {
101
+ cancelAnimationFrame(manager.restoreRafId);
102
+ manager.restoreRafId = null;
103
+ }
104
+ if (manager.transitionsSuppressed) {
105
+ manager.transitionsSuppressed = false;
106
+ restoreTransitionSuppression(manager);
107
+ }
108
+ // Remove this source from the manager
109
+ manager.sources.delete(sourceId);
110
+ // If no more sources, clean up the manager
111
+ if (manager.sources.size === 0) {
112
+ cleanupManager(element);
113
+ }
114
+ else {
115
+ // Update element without this source's classes
116
+ updateElement(manager);
117
+ }
118
+ });
119
+ /**
120
+ * We need this effect to track changes to the computed classes. Ideally, we would use
121
+ * afterRenderEffect here, but that doesn't run in SSR contexts, so we use a standard
122
+ * effect which works in both browser and SSR.
123
+ */
124
+ effect(updateClasses);
125
+ });
126
+ }
127
+ function restoreTransitionSuppression(manager) {
128
+ const prev = manager.previousTransition;
129
+ if (prev) {
130
+ manager.element.style.setProperty('transition', prev, manager.previousTransitionPriority || undefined);
131
+ }
132
+ else {
133
+ manager.element.style.removeProperty('transition');
134
+ }
135
+ }
136
+ // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types
137
+ function setupGlobalObserver(platformId) {
138
+ if (isPlatformBrowser(platformId) && !globalObserver) {
139
+ // Create single global observer that watches the entire document
140
+ globalObserver = new MutationObserver((mutations) => {
141
+ for (const mutation of mutations) {
142
+ if (mutation.type === 'attributes' && mutation.attributeName === 'class') {
143
+ const element = mutation.target;
144
+ const manager = elementClassManagers.get(element);
145
+ // Only process elements we're managing
146
+ if (manager && observedElements.has(element)) {
147
+ if (manager.isUpdating)
148
+ continue; // Ignore changes we're making
149
+ // Update base classes to include any externally added classes
150
+ const currentClasses = toClassList(element.className);
151
+ const allSourceClasses = new Set();
152
+ // Collect all classes from all sources
153
+ for (const source of manager.sources.values()) {
154
+ for (const className of source.classes) {
155
+ allSourceClasses.add(className);
156
+ }
157
+ }
158
+ // Any classes not from sources become new base classes
159
+ manager.baseClasses.clear();
160
+ for (const className of currentClasses) {
161
+ if (!allSourceClasses.has(className)) {
162
+ manager.baseClasses.add(className);
163
+ }
164
+ }
165
+ updateElement(manager);
166
+ }
167
+ }
168
+ }
169
+ });
170
+ // Start observing the entire document for class attribute changes
171
+ globalObserver.observe(document, {
172
+ attributes: true,
173
+ attributeFilter: ['class'],
174
+ subtree: true, // Watch all descendants
175
+ });
176
+ }
177
+ }
178
+ function updateElement(manager) {
179
+ if (manager.isUpdating)
180
+ return; // Prevent recursive updates
181
+ manager.isUpdating = true;
182
+ // the merge function is user-provided (e.g. createCn), never leave the manager stuck in updating mode
183
+ try {
184
+ applyClasses(manager);
185
+ }
186
+ finally {
187
+ manager.isUpdating = false;
188
+ }
189
+ }
190
+ function applyClasses(manager) {
191
+ // Handle initialization: capture base classes after first source registration
192
+ if (!manager.hasInitialized && manager.sources.size > 0) {
193
+ // Get current classes on element (may include SSR classes)
194
+ const currentClasses = toClassList(manager.element.className);
195
+ // Get all classes that will be applied by sources
196
+ const allSourceClasses = new Set();
197
+ for (const source of manager.sources.values()) {
198
+ source.classes.forEach((className) => allSourceClasses.add(className));
199
+ }
200
+ // Only consider classes as "base" if they're not produced by any source
201
+ // This prevents SSR-rendered classes from being preserved as base classes
202
+ currentClasses.forEach((className) => {
203
+ if (!allSourceClasses.has(className)) {
204
+ manager.baseClasses.add(className);
205
+ }
206
+ });
207
+ manager.hasInitialized = true;
208
+ }
209
+ // Get classes from all sources, sorted by registration order (later takes precedence)
210
+ const sortedSources = Array.from(manager.sources.entries()).sort(([, a], [, b]) => a.order - b.order);
211
+ const allSourceClasses = [];
212
+ for (const [, source] of sortedSources) {
213
+ allSourceClasses.push(...source.classes);
214
+ }
215
+ // Combine base classes with all source classes, ensuring base classes take precedence
216
+ const classesToApply = allSourceClasses.length > 0 || manager.baseClasses.size > 0
217
+ ? manager.merge([...allSourceClasses, ...manager.baseClasses])
218
+ : '';
219
+ // Apply the classes to the element
220
+ if (manager.element.className !== classesToApply) {
221
+ manager.element.className = classesToApply;
222
+ }
223
+ }
224
+ function cleanupManager(element) {
225
+ // Remove from global tracking
226
+ observedElements.delete(element);
227
+ elementClassManagers.delete(element);
228
+ // If no more elements being tracked, cleanup global observer
229
+ if (observedElements.size === 0 && globalObserver) {
230
+ globalObserver.disconnect();
231
+ globalObserver = null;
232
+ }
233
+ }
234
+ // Cache for parsed class lists to avoid repeated string operations
235
+ const classListCache = new Map();
236
+ function toClassList(className) {
237
+ // Use the cache to avoid repeated parsing
238
+ if (classListCache.has(className)) {
239
+ return classListCache.get(className);
240
+ }
241
+ const result = cssClassesToArray(className);
242
+ // Cache results, but limit cache size to prevent memory growth
243
+ if (classListCache.size < 1000) {
244
+ classListCache.set(className, result);
245
+ }
246
+ return result;
247
+ }
6
248
 
7
249
  /**
8
250
  * Returns a signal that emits the previous value of the given signal.
@@ -75,11 +317,6 @@ const createHoverObservable = (nativeElement, zone, destroyed$) => {
75
317
  fromEvent(nativeElement, 'mouseout').pipe(filter(movedOut), map((e) => ({ hover: false, relatedTarget: e.relatedTarget })))).pipe(distinctUntilChanged(), brnZoneOptimized(zone), takeUntil(destroyed$));
76
318
  };
77
319
 
78
- function cssClassesToArray(classes, defaultClass = '') {
79
- const value = classes ?? defaultClass;
80
- return (Array.isArray(value) ? value : [value]).flatMap((className) => className.split(/\s+/).filter(Boolean));
81
- }
82
-
83
320
  function createInjectionToken(description) {
84
321
  const token = new InjectionToken(description);
85
322
  const provideFn = (value) => {
@@ -395,5 +632,5 @@ function getFallbackTimeout(animations) {
395
632
  * Generated bundle index. Do not edit.
396
633
  */
397
634
 
398
- export { EXPOSES_SIDE_TOKEN, EXPOSES_STATE_TOKEN, MENU_SIDE, SET_CLASS_TO_CUSTOM_ELEMENT_TOKEN, SET_TABLE_CLASSES_TOKEN, brnDevMode, brnZoneFree, brnZoneFull, brnZoneOptimized, computedPrevious, createHoverObservable, createMenuPosition, cssClassesToArray, debouncedSignal, deriveMenuSideFromTransformOrigin, getActiveElementAnimations, injectContentDimensions, injectCustomClassSettable, injectElementSize, injectExposedSideProvider, injectExposesStateProvider, injectSkipDelay, injectTableClassesSettable, isElement, provideCustomClassSettable, provideCustomClassSettableExisting, provideExposedSideProvider, provideExposedSideProviderExisting, provideExposesStateProvider, provideExposesStateProviderExisting, provideTableClassesSettable, provideTableClassesSettableExisting, serializeValue, stringifyAsLabel, updateMenuPosition, waitForAnimations, waitForElementAnimations };
635
+ export { EXPOSES_SIDE_TOKEN, EXPOSES_STATE_TOKEN, MENU_SIDE, SET_CLASS_TO_CUSTOM_ELEMENT_TOKEN, SET_TABLE_CLASSES_TOKEN, brnClasses, brnDevMode, brnZoneFree, brnZoneFull, brnZoneOptimized, computedPrevious, createHoverObservable, createMenuPosition, cssClassesToArray, debouncedSignal, deriveMenuSideFromTransformOrigin, getActiveElementAnimations, injectContentDimensions, injectCustomClassSettable, injectElementSize, injectExposedSideProvider, injectExposesStateProvider, injectSkipDelay, injectTableClassesSettable, isElement, provideCustomClassSettable, provideCustomClassSettableExisting, provideExposedSideProvider, provideExposedSideProviderExisting, provideExposesStateProvider, provideExposesStateProviderExisting, provideTableClassesSettable, provideTableClassesSettableExisting, serializeValue, stringifyAsLabel, updateMenuPosition, waitForAnimations, waitForElementAnimations };
399
636
  //# sourceMappingURL=spartan-ng-brain-core.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"spartan-ng-brain-core.mjs","sources":["../../../../libs/brain/core/src/helpers/computed-previous.ts","../../../../libs/brain/core/src/helpers/zone-free.ts","../../../../libs/brain/core/src/helpers/create-hover-observable.ts","../../../../libs/brain/core/src/helpers/css-classes-to-array.ts","../../../../libs/brain/core/src/helpers/create-injection-token.ts","../../../../libs/brain/core/src/helpers/custom-element-class-settable.ts","../../../../libs/brain/core/src/helpers/debounced-signal.ts","../../../../libs/brain/core/src/helpers/dev-mode.ts","../../../../libs/brain/core/src/helpers/exposes-side.ts","../../../../libs/brain/core/src/helpers/exposes-state.ts","../../../../libs/brain/core/src/helpers/inject-content-dimensions.ts","../../../../libs/brain/core/src/helpers/inject-element-size.ts","../../../../libs/brain/core/src/helpers/menu-align.ts","../../../../libs/brain/core/src/helpers/resolve-value-label.ts","../../../../libs/brain/core/src/helpers/skip-delay.ts","../../../../libs/brain/core/src/helpers/table-classes-settable.ts","../../../../libs/brain/core/src/helpers/wait-for-element-animations.ts","../../../../libs/brain/core/src/spartan-ng-brain-core.ts"],"sourcesContent":["import { computed, type Signal, untracked } from '@angular/core';\n\n/**\n * Returns a signal that emits the previous value of the given signal.\n * The first time the signal is emitted, the previous value will be the same as the current value.\n *\n * @example\n * ```ts\n * const value = signal(0);\n * const previous = computedPrevious(value);\n *\n * effect(() => {\n * console.log('Current value:', value());\n * console.log('Previous value:', previous());\n * });\n *\n * Logs:\n * // Current value: 0\n * // Previous value: 0\n *\n * value.set(1);\n *\n * Logs:\n * // Current value: 1\n * // Previous value: 0\n *\n * value.set(2);\n *\n * Logs:\n * // Current value: 2\n * // Previous value: 1\n *```\n *\n * @param computation Signal to compute previous value for\n * @returns Signal that emits previous value of `s`\n */\nexport function computedPrevious<T>(computation: Signal<T>): Signal<T> {\n\tlet current = null as T;\n\tlet previous = untracked(() => computation()); // initial value is the current value\n\n\treturn computed(() => {\n\t\tcurrent = computation();\n\t\tconst result = previous;\n\t\tprevious = current;\n\t\treturn result;\n\t});\n}\n","/**\n * We are building on shoulders of giants here and use the implementation provided by the incredible TaigaUI\n * team: https://github.com/taiga-family/taiga-ui/blob/main/projects/cdk/observables/zone-free.ts#L22\n * Check them out! Give them a try! Leave a star! Their work is incredible!\n */\nimport type { NgZone } from '@angular/core';\nimport { type MonoTypeOperatorFunction, Observable, pipe } from 'rxjs';\n\nexport function brnZoneFull<T>(zone: NgZone): MonoTypeOperatorFunction<T> {\n\treturn (source) =>\n\t\tnew Observable((subscriber) =>\n\t\t\tsource.subscribe({\n\t\t\t\tnext: (value) => zone.run(() => subscriber.next(value)),\n\t\t\t\terror: (error: unknown) => zone.run(() => subscriber.error(error)),\n\t\t\t\tcomplete: () => zone.run(() => subscriber.complete()),\n\t\t\t}),\n\t\t);\n}\n\nexport function brnZoneFree<T>(zone: NgZone): MonoTypeOperatorFunction<T> {\n\treturn (source) => new Observable((subscriber) => zone.runOutsideAngular(() => source.subscribe(subscriber)));\n}\n\nexport function brnZoneOptimized<T>(zone: NgZone): MonoTypeOperatorFunction<T> {\n\treturn pipe(brnZoneFree(zone), brnZoneFull(zone));\n}\n","import type { NgZone } from '@angular/core';\nimport { type Observable, type Subject, fromEvent, merge } from 'rxjs';\nimport { distinctUntilChanged, filter, map, takeUntil } from 'rxjs/operators';\nimport { brnZoneOptimized } from './zone-free';\n\nfunction movedOut({ currentTarget, relatedTarget }: MouseEvent): boolean {\n\treturn !isElement(relatedTarget) || !isElement(currentTarget) || !currentTarget.contains(relatedTarget);\n}\n\nexport function isElement(node?: Element | EventTarget | Node | null): node is Element {\n\treturn !!node && 'nodeType' in node && node.nodeType === Node.ELEMENT_NODE;\n}\n\nexport const createHoverObservable = (\n\tnativeElement: HTMLElement,\n\tzone: NgZone,\n\tdestroyed$: Subject<void>,\n): Observable<{ hover: boolean; relatedTarget?: EventTarget | null }> => {\n\treturn merge(\n\t\tfromEvent(nativeElement, 'mouseenter').pipe(map(() => ({ hover: true }))),\n\t\tfromEvent<MouseEvent>(nativeElement, 'mouseleave').pipe(\n\t\t\tmap((e) => ({ hover: false, relatedTarget: e.relatedTarget })),\n\t\t),\n\t\t// Hello, Safari\n\t\tfromEvent<MouseEvent>(nativeElement, 'mouseout').pipe(\n\t\t\tfilter(movedOut),\n\t\t\tmap((e) => ({ hover: false, relatedTarget: e.relatedTarget })),\n\t\t),\n\t).pipe(distinctUntilChanged(), brnZoneOptimized(zone), takeUntil(destroyed$));\n};\n","export function cssClassesToArray(classes: string | string[] | null | undefined, defaultClass = ''): string[] {\n\tconst value = classes ?? defaultClass;\n\treturn (Array.isArray(value) ? value : [value]).flatMap((className) => className.split(/\\s+/).filter(Boolean));\n}\n","import { type InjectOptions, InjectionToken, type Provider, type Type, forwardRef, inject } from '@angular/core';\n\ntype InjectFn<TTokenValue> = {\n\t(): TTokenValue;\n\t(injectOptions: InjectOptions & { optional?: false }): TTokenValue;\n\t(injectOptions: InjectOptions & { optional: true }): TTokenValue | null;\n};\n\ntype ProvideFn<TTokenValue> = (value: TTokenValue) => Provider;\n\ntype ProvideExistingFn<TTokenValue> = (valueFactory: () => Type<TTokenValue>) => Provider;\n\nexport type CreateInjectionTokenReturn<TTokenValue> = [\n\tInjectFn<TTokenValue>,\n\tProvideFn<TTokenValue>,\n\tProvideExistingFn<TTokenValue>,\n\tInjectionToken<TTokenValue>,\n];\n\nexport function createInjectionToken<TTokenValue>(description: string): CreateInjectionTokenReturn<TTokenValue> {\n\tconst token = new InjectionToken<TTokenValue>(description);\n\n\tconst provideFn = (value: TTokenValue) => {\n\t\treturn { provide: token, useValue: value };\n\t};\n\n\tconst provideExistingFn = (value: () => TTokenValue) => {\n\t\treturn { provide: token, useExisting: forwardRef(value) };\n\t};\n\n\tconst injectFn = (options: InjectOptions = {}) => {\n\t\treturn inject(token, options);\n\t};\n\n\treturn [injectFn, provideFn, provideExistingFn, token] as CreateInjectionTokenReturn<TTokenValue>;\n}\n","import { createInjectionToken } from './create-injection-token';\n\nexport interface CustomElementClassSettable {\n\tsetClassToCustomElement: (newClass: string) => void;\n}\n\nexport const [\n\tinjectCustomClassSettable,\n\tprovideCustomClassSettable,\n\tprovideCustomClassSettableExisting,\n\tSET_CLASS_TO_CUSTOM_ELEMENT_TOKEN,\n] = createInjectionToken<CustomElementClassSettable>('@spartan-ng SET_CLASS_TO_CUSTOM_ELEMENT_TOKEN');\n","import type { Signal } from '@angular/core';\nimport { toObservable, toSignal } from '@angular/core/rxjs-interop';\nimport { debounceTime, distinctUntilChanged } from 'rxjs/operators';\n\n/**\n * Creates a debounced version of a source signal.\n *\n * @param source - The input signal to debounce.\n * @param delay - Debounce time in milliseconds.\n * @returns A new signal that updates only after the source has stopped changing for `delay` ms.\n */\nexport function debouncedSignal<T>(source: Signal<T>, delay: number): Signal<T> {\n\tconst source$ = toObservable(source);\n\n\tconst debounced$ = source$.pipe(debounceTime(delay), distinctUntilChanged());\n\n\treturn toSignal(debounced$, { initialValue: source() });\n}\n","declare const ngDevMode: boolean;\n/**\n * Set by Angular to true when in development mode.\n * Allows for tree-shaking code that is only used in development.\n */\nexport const brnDevMode = ngDevMode;\n","import type { Signal } from '@angular/core';\nimport { createInjectionToken } from './create-injection-token';\n\nexport interface ExposesSide {\n\tside: Signal<'top' | 'bottom' | 'left' | 'right'>;\n}\n\nexport const [\n\tinjectExposedSideProvider,\n\tprovideExposedSideProvider,\n\tprovideExposedSideProviderExisting,\n\tEXPOSES_SIDE_TOKEN,\n] = createInjectionToken<ExposesSide>('@spartan-ng EXPOSES_SIDE_TOKEN');\n","import type { Signal } from '@angular/core';\nimport { createInjectionToken } from './create-injection-token';\n\nexport interface ExposesState {\n\tstate: Signal<'open' | 'closed'>;\n}\n\nexport const [\n\tinjectExposesStateProvider,\n\tprovideExposesStateProvider,\n\tprovideExposesStateProviderExisting,\n\tEXPOSES_STATE_TOKEN,\n] = createInjectionToken<ExposesState>('@spartan-ng EXPOSES_STATE_TOKEN');\n","import { isPlatformServer } from '@angular/common';\nimport { afterNextRender, DestroyRef, ElementRef, inject, PLATFORM_ID, type Signal, signal } from '@angular/core';\n\n/** Reactive natural size of a collapsible host's projected content, or `null` before measurement. */\nexport interface ContentDimensions {\n\twidth: Signal<number | null>;\n\theight: Signal<number | null>;\n}\n\n/**\n * Measures the natural size of a collapsible host's content via `scrollHeight` so it can animate\n * between `height: 0` and a measured pixel height - the whole content is covered, regardless of how\n * it is projected. A `ResizeObserver` on the content keeps the value live. SSR-safe; the host must\n * be a block-level element for `scrollHeight` to reflect its content.\n *\n * @returns Signals with the content's width and height in px, or `null` before measurement.\n */\nexport function injectContentDimensions(): ContentDimensions {\n\tconst host = inject(ElementRef).nativeElement as HTMLElement;\n\tconst platformId = inject(PLATFORM_ID);\n\tconst destroyRef = inject(DestroyRef);\n\n\tconst width = signal<number | null>(null);\n\tconst height = signal<number | null>(null);\n\n\tif (isPlatformServer(platformId)) {\n\t\treturn { width: width.asReadonly(), height: height.asReadonly() };\n\t}\n\n\tconst measure = (): void => {\n\t\t// Drop the clamped height for the read: scrollHeight is never smaller than the element's own\n\t\t// height, so while clamped it would only ever grow. `height: auto` lets it reflect the real\n\t\t// content size (and shrink). The read is synchronous, so the swap never paints.\n\t\tconst previousHeight = host.style.height;\n\t\thost.style.height = 'auto';\n\t\twidth.set(host.scrollWidth);\n\t\theight.set(host.scrollHeight);\n\t\thost.style.height = previousHeight;\n\t};\n\n\tafterNextRender({\n\t\tread: () => {\n\t\t\tmeasure();\n\t\t\tif (typeof ResizeObserver === 'undefined') return;\n\n\t\t\t// Observe the content wrapper (not the clamped/animated host) so re-measures fire on content\n\t\t\t// changes, never on the open/close height animation. Re-measure on a fresh frame rather than\n\t\t\t// inside the callback: measure() mutates the host's inline height, and doing that during\n\t\t\t// delivery trips \"ResizeObserver loop completed with undelivered notifications\".\n\t\t\tlet frame = 0;\n\t\t\tconst observer = new ResizeObserver(() => {\n\t\t\t\tcancelAnimationFrame(frame);\n\t\t\t\tframe = requestAnimationFrame(measure);\n\t\t\t});\n\t\t\tconst content = host.firstElementChild;\n\t\t\tif (content) {\n\t\t\t\tobserver.observe(content);\n\t\t\t}\n\t\t\tdestroyRef.onDestroy(() => {\n\t\t\t\tcancelAnimationFrame(frame);\n\t\t\t\tobserver.disconnect();\n\t\t\t});\n\t\t},\n\t});\n\n\treturn { width: width.asReadonly(), height: height.asReadonly() };\n}\n","import { isPlatformServer } from '@angular/common';\nimport {\n\tafterNextRender,\n\tDestroyRef,\n\tElementRef,\n\tinject,\n\tInjector,\n\tPLATFORM_ID,\n\trunInInjectionContext,\n\ttype Signal,\n\tsignal,\n\ttype WritableSignal,\n} from '@angular/core';\n\n/**\n * Returns a reactive signal that tracks the size of a DOM element.\n *\n * This function uses a shared {@link ResizeObserver} internally to monitor multiple elements efficiently.\n * The returned signal updates whenever the element's width or height changes. It is fully SSR-safe.\n *\n * @param options Optional {@link ElementSizeOptions} configuration object.\n * @param options.elementRef The {@link ElementRef} of the element to observe. Defaults to the {@link ElementRef} injected in the current context.\n * @param options.injector Optional custom {@link Injector} to run the function in. Defaults to the current injection context.\n *\n * @returns A readonly {@link Signal} containing `{ width, height }` of the element, or `undefined` if the element has not yet been measured or on the server.\n *\n * Based on https://github.com/radix-ui/primitives/blob/main/packages/react/use-size/src/use-size.tsx\n */\nexport function injectElementSize(\n\toptions: ElementSizeOptions = {},\n): Signal<{ width: number; height: number } | undefined> {\n\treturn runInInjectionContext(options.injector ?? inject(Injector), () => {\n\t\tconst elementRef = options.elementRef ?? inject(ElementRef);\n\t\tconst platformId = inject(PLATFORM_ID);\n\t\tconst destroyRef = inject(DestroyRef);\n\n\t\tconst element = elementRef.nativeElement;\n\t\tconst size = signal<{ width: number; height: number } | undefined>(undefined);\n\n\t\tif (isPlatformServer(platformId)) {\n\t\t\treturn size;\n\t\t}\n\n\t\tafterNextRender({\n\t\t\tread: () => {\n\t\t\t\t// Initial read\n\t\t\t\tconst rect = element.getBoundingClientRect();\n\t\t\t\tsize.set({\n\t\t\t\t\twidth: rect.width || element.offsetWidth,\n\t\t\t\t\theight: rect.height || element.offsetHeight,\n\t\t\t\t});\n\n\t\t\t\t// Register element in shared observer\n\t\t\t\tobserverMap.set(element, { element, size });\n\t\t\t\tgetSharedObserver().observe(element, { box: 'border-box' });\n\n\t\t\t\tdestroyRef.onDestroy(() => {\n\t\t\t\t\tgetSharedObserver().unobserve(element);\n\t\t\t\t\tobserverMap.delete(element);\n\n\t\t\t\t\t// Disconnect global observer if no elements left\n\t\t\t\t\tif (observerMap.size === 0 && sharedObserver) {\n\t\t\t\t\t\tsharedObserver.disconnect();\n\t\t\t\t\t\tsharedObserver = undefined;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t});\n\n\t\treturn size.asReadonly();\n\t});\n}\n\nconst observerMap = new Map<HTMLElement, SizeEntry>();\nlet sharedObserver: ResizeObserver | undefined;\n\nfunction getSharedObserver() {\n\tif (!sharedObserver) {\n\t\tsharedObserver = new ResizeObserver((entries) => {\n\t\t\tfor (const entry of entries) {\n\t\t\t\tconst el = entry.target as HTMLElement;\n\t\t\t\tconst entryData = observerMap.get(el);\n\t\t\t\tif (!entryData) continue;\n\n\t\t\t\tlet width: number;\n\t\t\t\tlet height: number;\n\n\t\t\t\tif ('borderBoxSize' in entry) {\n\t\t\t\t\t// Iron out differences between browsers\n\t\t\t\t\tconst borderSize = Array.isArray(entry.borderBoxSize) ? entry.borderBoxSize[0] : entry.borderBoxSize;\n\t\t\t\t\twidth = borderSize.inlineSize;\n\t\t\t\t\theight = borderSize.blockSize;\n\t\t\t\t} else {\n\t\t\t\t\twidth = el.offsetWidth;\n\t\t\t\t\theight = el.offsetHeight;\n\t\t\t\t}\n\n\t\t\t\tentryData.size.set({ width, height });\n\t\t\t}\n\t\t});\n\t}\n\n\treturn sharedObserver;\n}\n\n/**\n * Options to configure `injectElementSize`.\n */\ninterface ElementSizeOptions {\n\t/** The ElementRef of the element to observe. Defaults to injected ElementRef in the current context. */\n\telementRef?: ElementRef<HTMLElement>;\n\t/** Optional Injector to run the function in. Defaults to the current injection context. */\n\tinjector?: Injector;\n}\n\n/**\n * Internal type used to track each observed element in the shared ResizeObserver.\n */\ninterface SizeEntry {\n\t/** The HTML element being observed. */\n\telement: HTMLElement;\n\t/** Writable signal storing the element's current width and height. */\n\tsize: WritableSignal<{ width: number; height: number } | undefined>;\n}\n","import type { CdkMenuTrigger } from '@angular/cdk/menu';\nimport type { ConnectedPosition } from '@angular/cdk/overlay';\nimport { InjectionToken, SimpleChange } from '@angular/core';\n\nexport type MenuAlign = 'start' | 'center' | 'end';\nexport type MenuSide = 'top' | 'bottom' | 'left' | 'right';\n\nconst OPPOSITE_SIDE: Record<string, MenuSide> = { top: 'bottom', bottom: 'top', left: 'right', right: 'left' };\n\n/**\n * Lets a menu trigger expose its configured `side` to the portaled content. CDK gives the content a\n * child injector whose parent is the trigger's injector, so the content can resolve this token to\n * learn which axis to read off the transform-origin.\n */\nexport interface MenuSideProvider {\n\treadonly side: () => MenuSide;\n}\n\nexport const MENU_SIDE = new InjectionToken<MenuSideProvider>('SpartanMenuSide');\n\n// derive data-side from the transform-origin CDK sets on the content. the anchored corner faces the\n// trigger, so the side is its opposite. the configured `side` tells us which axis carries the anchor\n// (top/bottom -> vertical token, left/right -> horizontal), so a CDK flip is read off the right axis.\n// CDK's origin is rtl-aware, so the derived side is too. falls back to the configured side when the\n// transform-origin is missing or centered (no flip information to apply).\nexport const deriveMenuSideFromTransformOrigin = (transformOrigin: string, side: MenuSide): MenuSide => {\n\tconst [x, y] = transformOrigin.trim().split(/\\s+/);\n\tconst anchor = side === 'top' || side === 'bottom' ? y : x;\n\treturn OPPOSITE_SIDE[anchor] ?? side;\n};\n\nexport const createMenuPosition = (align: MenuAlign, side: MenuSide): ConnectedPosition[] => {\n\tconst verticalAlign = align === 'start' ? 'top' : align === 'end' ? 'bottom' : 'center';\n\n\tconst createPositions = (\n\t\toriginX: 'start' | 'center' | 'end',\n\t\toriginY: 'top' | 'center' | 'bottom',\n\t\toverlayX: 'start' | 'center' | 'end',\n\t\toverlayY: 'top' | 'center' | 'bottom',\n\t): ConnectedPosition[] => [\n\t\t{ originX, originY, overlayX, overlayY },\n\t\t{ originX: overlayX, originY: overlayY, overlayX: originX, overlayY: originY },\n\t];\n\n\tswitch (side) {\n\t\tcase 'top':\n\t\t\treturn createPositions(align, 'top', align, 'bottom');\n\t\tcase 'bottom':\n\t\t\treturn createPositions(align, 'bottom', align, 'top');\n\t\tcase 'left':\n\t\t\treturn createPositions('start', verticalAlign, 'end', verticalAlign);\n\t\tcase 'right':\n\t\t\treturn createPositions('end', verticalAlign, 'start', verticalAlign);\n\t}\n};\n\n/**\n * Applies the given positions to a CDK menu trigger.\n *\n * CDK reads `menuPosition` only when it builds the overlay's `FlexibleConnectedPositionStrategy` (first\n * open) and when its `ngOnChanges` runs. The trigger reuses a single overlay across opens, so a bare\n * `menuPosition` assignment is silently ignored once the overlay exists - e.g. when `side`/`align`\n * change at runtime, the next open keeps the position from the first open. Assigning the property and\n * poking CDK's change handler refreshes an already-created overlay (whether open or reused) so the new\n * positions take effect. When no overlay exists yet the assignment alone is enough.\n */\nexport const updateMenuPosition = (trigger: CdkMenuTrigger, position: ConnectedPosition[]): void => {\n\ttrigger.menuPosition = position;\n\ttrigger.ngOnChanges({ menuPosition: new SimpleChange(undefined, position, false) });\n};\n","export function stringifyAsLabel(item: any, itemToStringLabel?: (item: any) => string) {\n\tif (itemToStringLabel && item !== null && item !== undefined) {\n\t\treturn itemToStringLabel(item) ?? '';\n\t}\n\tif (item && typeof item === 'object') {\n\t\tif ('label' in item && item.label !== null && item.label !== undefined) {\n\t\t\treturn String(item.label);\n\t\t}\n\t\tif ('value' in item && item.value !== null && item.value !== undefined) {\n\t\t\treturn String(item.value);\n\t\t}\n\t}\n\treturn serializeValue(item);\n}\n\nexport function serializeValue(value: unknown): string {\n\tif (value === null || value === undefined) {\n\t\treturn '';\n\t}\n\tif (typeof value === 'string') {\n\t\treturn value;\n\t}\n\ttry {\n\t\treturn JSON.stringify(value);\n\t} catch {\n\t\treturn String(value);\n\t}\n}\n","import { DestroyRef, inject, type Signal, signal } from '@angular/core';\n\n/** Skip-delay grouping: once one member opens, siblings skip their delay until the window elapses. */\nexport interface SkipDelay {\n\t/** Whether the next open should still wait for its delay (`true`) or open instantly (`false`). */\n\treadonly isOpenDelayed: Signal<boolean>;\n\t/** Report that a member opened: opens the skip window so siblings skip their delay. */\n\topen(): void;\n\t/** Report that a member closed: re-require the delay once the window elapses. */\n\tclose(): void;\n}\n\n/** Must be called in an injection context; cleans up its pending timer on destroy. */\nexport function injectSkipDelay(skipDelayDuration: () => number): SkipDelay {\n\tconst isOpenDelayed = signal(true);\n\tlet timer: ReturnType<typeof setTimeout> | undefined;\n\n\tinject(DestroyRef).onDestroy(() => clearTimeout(timer));\n\n\treturn {\n\t\tisOpenDelayed: isOpenDelayed.asReadonly(),\n\t\topen(): void {\n\t\t\tclearTimeout(timer);\n\t\t\tif (skipDelayDuration() > 0) isOpenDelayed.set(false);\n\t\t},\n\t\tclose(): void {\n\t\t\tclearTimeout(timer);\n\t\t\tconst duration = skipDelayDuration();\n\t\t\tif (duration > 0) {\n\t\t\t\ttimer = setTimeout(() => isOpenDelayed.set(true), duration);\n\t\t\t}\n\t\t},\n\t};\n}\n","import { createInjectionToken } from './create-injection-token';\n\nexport interface TableClassesSettable {\n\tsetTableClasses: (classes: Partial<{ table: string; headerRow: string; bodyRow: string }>) => void;\n}\n\nexport const [\n\tinjectTableClassesSettable,\n\tprovideTableClassesSettable,\n\tprovideTableClassesSettableExisting,\n\tSET_TABLE_CLASSES_TOKEN,\n] = createInjectionToken<TableClassesSettable>('@spartan-ng SET_TABLE_CLASSES_TOKEN');\n","const MAX_ANIMATION_WAIT_MS = 5_000;\nconst ANIMATION_WAIT_BUFFER_MS = 50;\n\nexport function getActiveElementAnimations(elements: readonly (HTMLElement | null | undefined)[]): Animation[] {\n\treturn elements\n\t\t.filter((element): element is HTMLElement => !!element)\n\t\t.flatMap((element) =>\n\t\t\ttypeof element.getAnimations === 'function'\n\t\t\t\t? element.getAnimations({ subtree: true }).filter((animation) => animation.playState !== 'finished')\n\t\t\t\t: [],\n\t\t);\n}\n\nexport async function waitForAnimations(animations: readonly Animation[]): Promise<void> {\n\tif (!animations.length) return;\n\n\tlet timeout: ReturnType<typeof setTimeout> | undefined;\n\tconst fallbackMs = getFallbackTimeout(animations);\n\n\ttry {\n\t\tawait Promise.race([\n\t\t\tPromise.allSettled(animations.map((animation) => animation.finished)),\n\t\t\tnew Promise<void>((resolve) => {\n\t\t\t\ttimeout = setTimeout(resolve, fallbackMs);\n\t\t\t}),\n\t\t]);\n\t} finally {\n\t\tif (timeout) clearTimeout(timeout);\n\t}\n}\n\n/**\n * Waits for active animations, including subtree animations, within the given element to finish.\n */\nexport async function waitForElementAnimations(element: HTMLElement): Promise<void> {\n\tawait waitForAnimations(getActiveElementAnimations([element]));\n}\n\nfunction getFallbackTimeout(animations: readonly Animation[]): number {\n\tconst longestAnimation = animations.reduce((longest, animation) => {\n\t\tconst endTime = animation.effect?.getComputedTiming().endTime;\n\t\treturn typeof endTime === 'number' && Number.isFinite(endTime) ? Math.max(longest, endTime) : longest;\n\t}, 0);\n\n\tif (!longestAnimation) return MAX_ANIMATION_WAIT_MS;\n\treturn Math.min(longestAnimation + ANIMATION_WAIT_BUFFER_MS, MAX_ANIMATION_WAIT_MS);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCG;AACG,SAAU,gBAAgB,CAAI,WAAsB,EAAA;IACzD,IAAI,OAAO,GAAG,IAAS;AACvB,IAAA,IAAI,QAAQ,GAAG,SAAS,CAAC,MAAM,WAAW,EAAE,CAAC,CAAC;IAE9C,OAAO,QAAQ,CAAC,MAAK;QACpB,OAAO,GAAG,WAAW,EAAE;QACvB,MAAM,MAAM,GAAG,QAAQ;QACvB,QAAQ,GAAG,OAAO;AAClB,QAAA,OAAO,MAAM;AACd,IAAA,CAAC,CAAC;AACH;;ACtCM,SAAU,WAAW,CAAI,IAAY,EAAA;AAC1C,IAAA,OAAO,CAAC,MAAM,KACb,IAAI,UAAU,CAAC,CAAC,UAAU,KACzB,MAAM,CAAC,SAAS,CAAC;AAChB,QAAA,IA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;AAEG;;;;"}
1
+ {"version":3,"file":"spartan-ng-brain-core.mjs","sources":["../../../../libs/brain/core/src/helpers/css-classes-to-array.ts","../../../../libs/brain/core/src/helpers/brn-classes.ts","../../../../libs/brain/core/src/helpers/computed-previous.ts","../../../../libs/brain/core/src/helpers/zone-free.ts","../../../../libs/brain/core/src/helpers/create-hover-observable.ts","../../../../libs/brain/core/src/helpers/create-injection-token.ts","../../../../libs/brain/core/src/helpers/custom-element-class-settable.ts","../../../../libs/brain/core/src/helpers/debounced-signal.ts","../../../../libs/brain/core/src/helpers/dev-mode.ts","../../../../libs/brain/core/src/helpers/exposes-side.ts","../../../../libs/brain/core/src/helpers/exposes-state.ts","../../../../libs/brain/core/src/helpers/inject-content-dimensions.ts","../../../../libs/brain/core/src/helpers/inject-element-size.ts","../../../../libs/brain/core/src/helpers/menu-align.ts","../../../../libs/brain/core/src/helpers/resolve-value-label.ts","../../../../libs/brain/core/src/helpers/skip-delay.ts","../../../../libs/brain/core/src/helpers/table-classes-settable.ts","../../../../libs/brain/core/src/helpers/wait-for-element-animations.ts","../../../../libs/brain/core/src/spartan-ng-brain-core.ts"],"sourcesContent":["export function cssClassesToArray(classes: string | string[] | null | undefined, defaultClass = ''): string[] {\n\tconst value = classes ?? defaultClass;\n\treturn (Array.isArray(value) ? value : [value]).flatMap((className) => className.split(/\\s+/).filter(Boolean));\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n\tDestroyRef,\n\teffect,\n\tElementRef,\n\tHostAttributeToken,\n\tinject,\n\tInjector,\n\tNgZone,\n\tPLATFORM_ID,\n\trunInInjectionContext,\n} from '@angular/core';\nimport type { BrnClassValue } from './brn-class-value';\nimport { cssClassesToArray } from './css-classes-to-array';\n\n/** Merges class values into a single class string, resolving Tailwind conflicts (e.g. `hlm`). */\nexport type BrnClassMerge = (...inputs: BrnClassValue[]) => string;\n\nexport interface BrnClassesOptions {\n\t/** The function used to merge the classes, typically `hlm` from `@spartan-ng/helm/utils`. */\n\tmerge: BrnClassMerge;\n\telementRef?: ElementRef<HTMLElement>;\n\tinjector?: Injector;\n}\n\n// Global map to track class managers per element\nconst elementClassManagers = new WeakMap<HTMLElement, ElementClassManager>();\n// Global mutation observer for all elements\nlet globalObserver: MutationObserver | null = null;\nconst observedElements = new Set<HTMLElement>();\n\ninterface ElementClassManager {\n\telement: HTMLElement;\n\t/** The merge function of the first source registered on this element */\n\tmerge: BrnClassMerge;\n\tsources: Map<number, { classes: Set<string>; order: number }>;\n\tbaseClasses: Set<string>;\n\tisUpdating: boolean;\n\tnextOrder: number;\n\thasInitialized: boolean;\n\trestoreRafId: number | null;\n\t/** Transitions are suppressed until the first effect writes correct classes */\n\ttransitionsSuppressed: boolean;\n\t/** Original inline transition value to restore after suppression (empty string = none was set) */\n\tpreviousTransition: string;\n\t/** Original inline transition priority to preserve !important when restoring */\n\tpreviousTransitionPriority: string;\n}\n\nlet sourceCounter = 0;\n\n/**\n * This function dynamically adds and removes classes for a given element without requiring\n * the a class binding (e.g. `[class]=\"...\"`) which may interfere with other class bindings.\n *\n * 1. This will merge the existing classes on the element with the new classes.\n * 2. It will also remove any classes that were previously added by this function but are no longer present in the new classes.\n * 3. Multiple calls to this function on the same element will be merged efficiently.\n *\n * The classes are merged with `options.merge`, so a customized merge function (e.g. one created\n * with `createCn` from `cn/config`) is respected.\n */\nexport function brnClasses(computed: () => BrnClassValue[] | string, options: BrnClassesOptions) {\n\trunInInjectionContext(options.injector ?? inject(Injector), () => {\n\t\tconst elementRef = options.elementRef ?? inject(ElementRef);\n\t\tconst platformId = inject(PLATFORM_ID);\n\t\tconst destroyRef = inject(DestroyRef);\n\t\tconst baseClasses = inject(new HostAttributeToken('class'), { optional: true });\n\n\t\tconst element = elementRef.nativeElement;\n\n\t\t// Create unique identifier for this source\n\t\tconst sourceId = sourceCounter++;\n\n\t\t// Get or create the class manager for this element\n\t\tlet manager = elementClassManagers.get(element);\n\n\t\tif (!manager) {\n\t\t\t// Initialize base classes from variation (host attribute 'class')\n\t\t\tconst initialBaseClasses = new Set<string>();\n\n\t\t\tif (baseClasses) {\n\t\t\t\ttoClassList(baseClasses).forEach((cls) => initialBaseClasses.add(cls));\n\t\t\t}\n\n\t\t\tmanager = {\n\t\t\t\telement,\n\t\t\t\tmerge: options.merge,\n\t\t\t\tsources: new Map(),\n\t\t\t\tbaseClasses: initialBaseClasses,\n\t\t\t\tisUpdating: false,\n\t\t\t\tnextOrder: 0,\n\t\t\t\thasInitialized: false,\n\t\t\t\trestoreRafId: null,\n\t\t\t\ttransitionsSuppressed: false,\n\t\t\t\tpreviousTransition: '',\n\t\t\t\tpreviousTransitionPriority: '',\n\t\t\t};\n\t\t\telementClassManagers.set(element, manager);\n\n\t\t\t// Setup global observer if needed and register this element. Created outside the zone so\n\t\t\t// class mutations don't trigger app-wide change detection (and loop if CD writes a class).\n\t\t\tinject(NgZone).runOutsideAngular(() => setupGlobalObserver(platformId));\n\t\t\tobservedElements.add(element);\n\n\t\t\t// Suppress transitions until the first effect writes correct classes and\n\t\t\t// the browser has painted them. This prevents CSS transition animations\n\t\t\t// during hydration when classes change from SSR state to client state.\n\t\t\tif (isPlatformBrowser(platformId)) {\n\t\t\t\tmanager.previousTransition = element.style.getPropertyValue('transition');\n\t\t\t\tmanager.previousTransitionPriority = element.style.getPropertyPriority('transition');\n\t\t\t\telement.style.setProperty('transition', 'none', 'important');\n\t\t\t\tmanager.transitionsSuppressed = true;\n\t\t\t}\n\t\t}\n\n\t\t// Assign order once at registration time\n\t\tconst sourceOrder = manager.nextOrder++;\n\n\t\tfunction updateClasses(): void {\n\t\t\t// Get the new classes from the computed function, the merge function resolves arrays and objects\n\t\t\tconst value = computed();\n\t\t\tconst newClasses = toClassList(typeof value === 'string' ? value : options.merge(value));\n\n\t\t\t// Update this source's classes, keeping the original order\n\t\t\tmanager!.sources.set(sourceId, {\n\t\t\t\tclasses: new Set(newClasses),\n\t\t\t\torder: sourceOrder,\n\t\t\t});\n\n\t\t\t// Update the element\n\t\t\tupdateElement(manager!);\n\n\t\t\t// Re-enable transitions after the first effect writes correct classes.\n\t\t\t// Deferred to next animation frame so the browser paints the class change\n\t\t\t// with transitions disabled first, then re-enables them.\n\t\t\tif (manager!.transitionsSuppressed) {\n\t\t\t\tmanager!.transitionsSuppressed = false;\n\t\t\t\tmanager!.restoreRafId = requestAnimationFrame(() => {\n\t\t\t\t\tmanager!.restoreRafId = null;\n\t\t\t\t\trestoreTransitionSuppression(manager!);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t// Register cleanup with DestroyRef\n\t\tdestroyRef.onDestroy(() => {\n\t\t\tif (manager!.restoreRafId !== null) {\n\t\t\t\tcancelAnimationFrame(manager!.restoreRafId);\n\t\t\t\tmanager!.restoreRafId = null;\n\t\t\t}\n\n\t\t\tif (manager!.transitionsSuppressed) {\n\t\t\t\tmanager!.transitionsSuppressed = false;\n\t\t\t\trestoreTransitionSuppression(manager!);\n\t\t\t}\n\n\t\t\t// Remove this source from the manager\n\t\t\tmanager!.sources.delete(sourceId);\n\n\t\t\t// If no more sources, clean up the manager\n\t\t\tif (manager!.sources.size === 0) {\n\t\t\t\tcleanupManager(element);\n\t\t\t} else {\n\t\t\t\t// Update element without this source's classes\n\t\t\t\tupdateElement(manager!);\n\t\t\t}\n\t\t});\n\n\t\t/**\n\t\t * We need this effect to track changes to the computed classes. Ideally, we would use\n\t\t * afterRenderEffect here, but that doesn't run in SSR contexts, so we use a standard\n\t\t * effect which works in both browser and SSR.\n\t\t */\n\t\teffect(updateClasses);\n\t});\n}\n\nfunction restoreTransitionSuppression(manager: ElementClassManager): void {\n\tconst prev = manager.previousTransition;\n\tif (prev) {\n\t\tmanager.element.style.setProperty('transition', prev, manager.previousTransitionPriority || undefined);\n\t} else {\n\t\tmanager.element.style.removeProperty('transition');\n\t}\n}\n\n// eslint-disable-next-line @typescript-eslint/no-wrapper-object-types\nfunction setupGlobalObserver(platformId: Object): void {\n\tif (isPlatformBrowser(platformId) && !globalObserver) {\n\t\t// Create single global observer that watches the entire document\n\t\tglobalObserver = new MutationObserver((mutations) => {\n\t\t\tfor (const mutation of mutations) {\n\t\t\t\tif (mutation.type === 'attributes' && mutation.attributeName === 'class') {\n\t\t\t\t\tconst element = mutation.target as HTMLElement;\n\t\t\t\t\tconst manager = elementClassManagers.get(element);\n\n\t\t\t\t\t// Only process elements we're managing\n\t\t\t\t\tif (manager && observedElements.has(element)) {\n\t\t\t\t\t\tif (manager.isUpdating) continue; // Ignore changes we're making\n\n\t\t\t\t\t\t// Update base classes to include any externally added classes\n\t\t\t\t\t\tconst currentClasses = toClassList(element.className);\n\t\t\t\t\t\tconst allSourceClasses = new Set<string>();\n\n\t\t\t\t\t\t// Collect all classes from all sources\n\t\t\t\t\t\tfor (const source of manager.sources.values()) {\n\t\t\t\t\t\t\tfor (const className of source.classes) {\n\t\t\t\t\t\t\t\tallSourceClasses.add(className);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Any classes not from sources become new base classes\n\t\t\t\t\t\tmanager.baseClasses.clear();\n\n\t\t\t\t\t\tfor (const className of currentClasses) {\n\t\t\t\t\t\t\tif (!allSourceClasses.has(className)) {\n\t\t\t\t\t\t\t\tmanager.baseClasses.add(className);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tupdateElement(manager);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t// Start observing the entire document for class attribute changes\n\t\tglobalObserver.observe(document, {\n\t\t\tattributes: true,\n\t\t\tattributeFilter: ['class'],\n\t\t\tsubtree: true, // Watch all descendants\n\t\t});\n\t}\n}\n\nfunction updateElement(manager: ElementClassManager): void {\n\tif (manager.isUpdating) return; // Prevent recursive updates\n\n\tmanager.isUpdating = true;\n\n\t// the merge function is user-provided (e.g. createCn), never leave the manager stuck in updating mode\n\ttry {\n\t\tapplyClasses(manager);\n\t} finally {\n\t\tmanager.isUpdating = false;\n\t}\n}\n\nfunction applyClasses(manager: ElementClassManager): void {\n\t// Handle initialization: capture base classes after first source registration\n\tif (!manager.hasInitialized && manager.sources.size > 0) {\n\t\t// Get current classes on element (may include SSR classes)\n\t\tconst currentClasses = toClassList(manager.element.className);\n\n\t\t// Get all classes that will be applied by sources\n\t\tconst allSourceClasses = new Set<string>();\n\t\tfor (const source of manager.sources.values()) {\n\t\t\tsource.classes.forEach((className) => allSourceClasses.add(className));\n\t\t}\n\n\t\t// Only consider classes as \"base\" if they're not produced by any source\n\t\t// This prevents SSR-rendered classes from being preserved as base classes\n\t\tcurrentClasses.forEach((className) => {\n\t\t\tif (!allSourceClasses.has(className)) {\n\t\t\t\tmanager.baseClasses.add(className);\n\t\t\t}\n\t\t});\n\n\t\tmanager.hasInitialized = true;\n\t}\n\n\t// Get classes from all sources, sorted by registration order (later takes precedence)\n\tconst sortedSources = Array.from(manager.sources.entries()).sort(([, a], [, b]) => a.order - b.order);\n\n\tconst allSourceClasses: string[] = [];\n\tfor (const [, source] of sortedSources) {\n\t\tallSourceClasses.push(...source.classes);\n\t}\n\n\t// Combine base classes with all source classes, ensuring base classes take precedence\n\tconst classesToApply =\n\t\tallSourceClasses.length > 0 || manager.baseClasses.size > 0\n\t\t\t? manager.merge([...allSourceClasses, ...manager.baseClasses])\n\t\t\t: '';\n\n\t// Apply the classes to the element\n\tif (manager.element.className !== classesToApply) {\n\t\tmanager.element.className = classesToApply;\n\t}\n}\n\nfunction cleanupManager(element: HTMLElement): void {\n\t// Remove from global tracking\n\tobservedElements.delete(element);\n\telementClassManagers.delete(element);\n\n\t// If no more elements being tracked, cleanup global observer\n\tif (observedElements.size === 0 && globalObserver) {\n\t\tglobalObserver.disconnect();\n\t\tglobalObserver = null;\n\t}\n}\n\n// Cache for parsed class lists to avoid repeated string operations\nconst classListCache = new Map<string, string[]>();\n\nfunction toClassList(className: string): string[] {\n\t// Use the cache to avoid repeated parsing\n\tif (classListCache.has(className)) {\n\t\treturn classListCache.get(className)!;\n\t}\n\n\tconst result = cssClassesToArray(className);\n\n\t// Cache results, but limit cache size to prevent memory growth\n\tif (classListCache.size < 1000) {\n\t\tclassListCache.set(className, result);\n\t}\n\n\treturn result;\n}\n","import { computed, type Signal, untracked } from '@angular/core';\n\n/**\n * Returns a signal that emits the previous value of the given signal.\n * The first time the signal is emitted, the previous value will be the same as the current value.\n *\n * @example\n * ```ts\n * const value = signal(0);\n * const previous = computedPrevious(value);\n *\n * effect(() => {\n * console.log('Current value:', value());\n * console.log('Previous value:', previous());\n * });\n *\n * Logs:\n * // Current value: 0\n * // Previous value: 0\n *\n * value.set(1);\n *\n * Logs:\n * // Current value: 1\n * // Previous value: 0\n *\n * value.set(2);\n *\n * Logs:\n * // Current value: 2\n * // Previous value: 1\n *```\n *\n * @param computation Signal to compute previous value for\n * @returns Signal that emits previous value of `s`\n */\nexport function computedPrevious<T>(computation: Signal<T>): Signal<T> {\n\tlet current = null as T;\n\tlet previous = untracked(() => computation()); // initial value is the current value\n\n\treturn computed(() => {\n\t\tcurrent = computation();\n\t\tconst result = previous;\n\t\tprevious = current;\n\t\treturn result;\n\t});\n}\n","/**\n * We are building on shoulders of giants here and use the implementation provided by the incredible TaigaUI\n * team: https://github.com/taiga-family/taiga-ui/blob/main/projects/cdk/observables/zone-free.ts#L22\n * Check them out! Give them a try! Leave a star! Their work is incredible!\n */\nimport type { NgZone } from '@angular/core';\nimport { type MonoTypeOperatorFunction, Observable, pipe } from 'rxjs';\n\nexport function brnZoneFull<T>(zone: NgZone): MonoTypeOperatorFunction<T> {\n\treturn (source) =>\n\t\tnew Observable((subscriber) =>\n\t\t\tsource.subscribe({\n\t\t\t\tnext: (value) => zone.run(() => subscriber.next(value)),\n\t\t\t\terror: (error: unknown) => zone.run(() => subscriber.error(error)),\n\t\t\t\tcomplete: () => zone.run(() => subscriber.complete()),\n\t\t\t}),\n\t\t);\n}\n\nexport function brnZoneFree<T>(zone: NgZone): MonoTypeOperatorFunction<T> {\n\treturn (source) => new Observable((subscriber) => zone.runOutsideAngular(() => source.subscribe(subscriber)));\n}\n\nexport function brnZoneOptimized<T>(zone: NgZone): MonoTypeOperatorFunction<T> {\n\treturn pipe(brnZoneFree(zone), brnZoneFull(zone));\n}\n","import type { NgZone } from '@angular/core';\nimport { type Observable, type Subject, fromEvent, merge } from 'rxjs';\nimport { distinctUntilChanged, filter, map, takeUntil } from 'rxjs/operators';\nimport { brnZoneOptimized } from './zone-free';\n\nfunction movedOut({ currentTarget, relatedTarget }: MouseEvent): boolean {\n\treturn !isElement(relatedTarget) || !isElement(currentTarget) || !currentTarget.contains(relatedTarget);\n}\n\nexport function isElement(node?: Element | EventTarget | Node | null): node is Element {\n\treturn !!node && 'nodeType' in node && node.nodeType === Node.ELEMENT_NODE;\n}\n\nexport const createHoverObservable = (\n\tnativeElement: HTMLElement,\n\tzone: NgZone,\n\tdestroyed$: Subject<void>,\n): Observable<{ hover: boolean; relatedTarget?: EventTarget | null }> => {\n\treturn merge(\n\t\tfromEvent(nativeElement, 'mouseenter').pipe(map(() => ({ hover: true }))),\n\t\tfromEvent<MouseEvent>(nativeElement, 'mouseleave').pipe(\n\t\t\tmap((e) => ({ hover: false, relatedTarget: e.relatedTarget })),\n\t\t),\n\t\t// Hello, Safari\n\t\tfromEvent<MouseEvent>(nativeElement, 'mouseout').pipe(\n\t\t\tfilter(movedOut),\n\t\t\tmap((e) => ({ hover: false, relatedTarget: e.relatedTarget })),\n\t\t),\n\t).pipe(distinctUntilChanged(), brnZoneOptimized(zone), takeUntil(destroyed$));\n};\n","import { type InjectOptions, InjectionToken, type Provider, type Type, forwardRef, inject } from '@angular/core';\n\ntype InjectFn<TTokenValue> = {\n\t(): TTokenValue;\n\t(injectOptions: InjectOptions & { optional?: false }): TTokenValue;\n\t(injectOptions: InjectOptions & { optional: true }): TTokenValue | null;\n};\n\ntype ProvideFn<TTokenValue> = (value: TTokenValue) => Provider;\n\ntype ProvideExistingFn<TTokenValue> = (valueFactory: () => Type<TTokenValue>) => Provider;\n\nexport type CreateInjectionTokenReturn<TTokenValue> = [\n\tInjectFn<TTokenValue>,\n\tProvideFn<TTokenValue>,\n\tProvideExistingFn<TTokenValue>,\n\tInjectionToken<TTokenValue>,\n];\n\nexport function createInjectionToken<TTokenValue>(description: string): CreateInjectionTokenReturn<TTokenValue> {\n\tconst token = new InjectionToken<TTokenValue>(description);\n\n\tconst provideFn = (value: TTokenValue) => {\n\t\treturn { provide: token, useValue: value };\n\t};\n\n\tconst provideExistingFn = (value: () => TTokenValue) => {\n\t\treturn { provide: token, useExisting: forwardRef(value) };\n\t};\n\n\tconst injectFn = (options: InjectOptions = {}) => {\n\t\treturn inject(token, options);\n\t};\n\n\treturn [injectFn, provideFn, provideExistingFn, token] as CreateInjectionTokenReturn<TTokenValue>;\n}\n","import { createInjectionToken } from './create-injection-token';\n\nexport interface CustomElementClassSettable {\n\tsetClassToCustomElement: (newClass: string) => void;\n}\n\nexport const [\n\tinjectCustomClassSettable,\n\tprovideCustomClassSettable,\n\tprovideCustomClassSettableExisting,\n\tSET_CLASS_TO_CUSTOM_ELEMENT_TOKEN,\n] = createInjectionToken<CustomElementClassSettable>('@spartan-ng SET_CLASS_TO_CUSTOM_ELEMENT_TOKEN');\n","import type { Signal } from '@angular/core';\nimport { toObservable, toSignal } from '@angular/core/rxjs-interop';\nimport { debounceTime, distinctUntilChanged } from 'rxjs/operators';\n\n/**\n * Creates a debounced version of a source signal.\n *\n * @param source - The input signal to debounce.\n * @param delay - Debounce time in milliseconds.\n * @returns A new signal that updates only after the source has stopped changing for `delay` ms.\n */\nexport function debouncedSignal<T>(source: Signal<T>, delay: number): Signal<T> {\n\tconst source$ = toObservable(source);\n\n\tconst debounced$ = source$.pipe(debounceTime(delay), distinctUntilChanged());\n\n\treturn toSignal(debounced$, { initialValue: source() });\n}\n","declare const ngDevMode: boolean;\n/**\n * Set by Angular to true when in development mode.\n * Allows for tree-shaking code that is only used in development.\n */\nexport const brnDevMode = ngDevMode;\n","import type { Signal } from '@angular/core';\nimport { createInjectionToken } from './create-injection-token';\n\nexport interface ExposesSide {\n\tside: Signal<'top' | 'bottom' | 'left' | 'right'>;\n}\n\nexport const [\n\tinjectExposedSideProvider,\n\tprovideExposedSideProvider,\n\tprovideExposedSideProviderExisting,\n\tEXPOSES_SIDE_TOKEN,\n] = createInjectionToken<ExposesSide>('@spartan-ng EXPOSES_SIDE_TOKEN');\n","import type { Signal } from '@angular/core';\nimport { createInjectionToken } from './create-injection-token';\n\nexport interface ExposesState {\n\tstate: Signal<'open' | 'closed'>;\n}\n\nexport const [\n\tinjectExposesStateProvider,\n\tprovideExposesStateProvider,\n\tprovideExposesStateProviderExisting,\n\tEXPOSES_STATE_TOKEN,\n] = createInjectionToken<ExposesState>('@spartan-ng EXPOSES_STATE_TOKEN');\n","import { isPlatformServer } from '@angular/common';\nimport { afterNextRender, DestroyRef, ElementRef, inject, PLATFORM_ID, type Signal, signal } from '@angular/core';\n\n/** Reactive natural size of a collapsible host's projected content, or `null` before measurement. */\nexport interface ContentDimensions {\n\twidth: Signal<number | null>;\n\theight: Signal<number | null>;\n}\n\n/**\n * Measures the natural size of a collapsible host's content via `scrollHeight` so it can animate\n * between `height: 0` and a measured pixel height - the whole content is covered, regardless of how\n * it is projected. A `ResizeObserver` on the content keeps the value live. SSR-safe; the host must\n * be a block-level element for `scrollHeight` to reflect its content.\n *\n * @returns Signals with the content's width and height in px, or `null` before measurement.\n */\nexport function injectContentDimensions(): ContentDimensions {\n\tconst host = inject(ElementRef).nativeElement as HTMLElement;\n\tconst platformId = inject(PLATFORM_ID);\n\tconst destroyRef = inject(DestroyRef);\n\n\tconst width = signal<number | null>(null);\n\tconst height = signal<number | null>(null);\n\n\tif (isPlatformServer(platformId)) {\n\t\treturn { width: width.asReadonly(), height: height.asReadonly() };\n\t}\n\n\tconst measure = (): void => {\n\t\t// Drop the clamped height for the read: scrollHeight is never smaller than the element's own\n\t\t// height, so while clamped it would only ever grow. `height: auto` lets it reflect the real\n\t\t// content size (and shrink). The read is synchronous, so the swap never paints.\n\t\tconst previousHeight = host.style.height;\n\t\thost.style.height = 'auto';\n\t\twidth.set(host.scrollWidth);\n\t\theight.set(host.scrollHeight);\n\t\thost.style.height = previousHeight;\n\t};\n\n\tafterNextRender({\n\t\tread: () => {\n\t\t\tmeasure();\n\t\t\tif (typeof ResizeObserver === 'undefined') return;\n\n\t\t\t// Observe the content wrapper (not the clamped/animated host) so re-measures fire on content\n\t\t\t// changes, never on the open/close height animation. Re-measure on a fresh frame rather than\n\t\t\t// inside the callback: measure() mutates the host's inline height, and doing that during\n\t\t\t// delivery trips \"ResizeObserver loop completed with undelivered notifications\".\n\t\t\tlet frame = 0;\n\t\t\tconst observer = new ResizeObserver(() => {\n\t\t\t\tcancelAnimationFrame(frame);\n\t\t\t\tframe = requestAnimationFrame(measure);\n\t\t\t});\n\t\t\tconst content = host.firstElementChild;\n\t\t\tif (content) {\n\t\t\t\tobserver.observe(content);\n\t\t\t}\n\t\t\tdestroyRef.onDestroy(() => {\n\t\t\t\tcancelAnimationFrame(frame);\n\t\t\t\tobserver.disconnect();\n\t\t\t});\n\t\t},\n\t});\n\n\treturn { width: width.asReadonly(), height: height.asReadonly() };\n}\n","import { isPlatformServer } from '@angular/common';\nimport {\n\tafterNextRender,\n\tDestroyRef,\n\tElementRef,\n\tinject,\n\tInjector,\n\tPLATFORM_ID,\n\trunInInjectionContext,\n\ttype Signal,\n\tsignal,\n\ttype WritableSignal,\n} from '@angular/core';\n\n/**\n * Returns a reactive signal that tracks the size of a DOM element.\n *\n * This function uses a shared {@link ResizeObserver} internally to monitor multiple elements efficiently.\n * The returned signal updates whenever the element's width or height changes. It is fully SSR-safe.\n *\n * @param options Optional {@link ElementSizeOptions} configuration object.\n * @param options.elementRef The {@link ElementRef} of the element to observe. Defaults to the {@link ElementRef} injected in the current context.\n * @param options.injector Optional custom {@link Injector} to run the function in. Defaults to the current injection context.\n *\n * @returns A readonly {@link Signal} containing `{ width, height }` of the element, or `undefined` if the element has not yet been measured or on the server.\n *\n * Based on https://github.com/radix-ui/primitives/blob/main/packages/react/use-size/src/use-size.tsx\n */\nexport function injectElementSize(\n\toptions: ElementSizeOptions = {},\n): Signal<{ width: number; height: number } | undefined> {\n\treturn runInInjectionContext(options.injector ?? inject(Injector), () => {\n\t\tconst elementRef = options.elementRef ?? inject(ElementRef);\n\t\tconst platformId = inject(PLATFORM_ID);\n\t\tconst destroyRef = inject(DestroyRef);\n\n\t\tconst element = elementRef.nativeElement;\n\t\tconst size = signal<{ width: number; height: number } | undefined>(undefined);\n\n\t\tif (isPlatformServer(platformId)) {\n\t\t\treturn size;\n\t\t}\n\n\t\tafterNextRender({\n\t\t\tread: () => {\n\t\t\t\t// Initial read\n\t\t\t\tconst rect = element.getBoundingClientRect();\n\t\t\t\tsize.set({\n\t\t\t\t\twidth: rect.width || element.offsetWidth,\n\t\t\t\t\theight: rect.height || element.offsetHeight,\n\t\t\t\t});\n\n\t\t\t\t// Register element in shared observer\n\t\t\t\tobserverMap.set(element, { element, size });\n\t\t\t\tgetSharedObserver().observe(element, { box: 'border-box' });\n\n\t\t\t\tdestroyRef.onDestroy(() => {\n\t\t\t\t\tgetSharedObserver().unobserve(element);\n\t\t\t\t\tobserverMap.delete(element);\n\n\t\t\t\t\t// Disconnect global observer if no elements left\n\t\t\t\t\tif (observerMap.size === 0 && sharedObserver) {\n\t\t\t\t\t\tsharedObserver.disconnect();\n\t\t\t\t\t\tsharedObserver = undefined;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t});\n\n\t\treturn size.asReadonly();\n\t});\n}\n\nconst observerMap = new Map<HTMLElement, SizeEntry>();\nlet sharedObserver: ResizeObserver | undefined;\n\nfunction getSharedObserver() {\n\tif (!sharedObserver) {\n\t\tsharedObserver = new ResizeObserver((entries) => {\n\t\t\tfor (const entry of entries) {\n\t\t\t\tconst el = entry.target as HTMLElement;\n\t\t\t\tconst entryData = observerMap.get(el);\n\t\t\t\tif (!entryData) continue;\n\n\t\t\t\tlet width: number;\n\t\t\t\tlet height: number;\n\n\t\t\t\tif ('borderBoxSize' in entry) {\n\t\t\t\t\t// Iron out differences between browsers\n\t\t\t\t\tconst borderSize = Array.isArray(entry.borderBoxSize) ? entry.borderBoxSize[0] : entry.borderBoxSize;\n\t\t\t\t\twidth = borderSize.inlineSize;\n\t\t\t\t\theight = borderSize.blockSize;\n\t\t\t\t} else {\n\t\t\t\t\twidth = el.offsetWidth;\n\t\t\t\t\theight = el.offsetHeight;\n\t\t\t\t}\n\n\t\t\t\tentryData.size.set({ width, height });\n\t\t\t}\n\t\t});\n\t}\n\n\treturn sharedObserver;\n}\n\n/**\n * Options to configure `injectElementSize`.\n */\ninterface ElementSizeOptions {\n\t/** The ElementRef of the element to observe. Defaults to injected ElementRef in the current context. */\n\telementRef?: ElementRef<HTMLElement>;\n\t/** Optional Injector to run the function in. Defaults to the current injection context. */\n\tinjector?: Injector;\n}\n\n/**\n * Internal type used to track each observed element in the shared ResizeObserver.\n */\ninterface SizeEntry {\n\t/** The HTML element being observed. */\n\telement: HTMLElement;\n\t/** Writable signal storing the element's current width and height. */\n\tsize: WritableSignal<{ width: number; height: number } | undefined>;\n}\n","import type { CdkMenuTrigger } from '@angular/cdk/menu';\nimport type { ConnectedPosition } from '@angular/cdk/overlay';\nimport { InjectionToken, SimpleChange } from '@angular/core';\n\nexport type MenuAlign = 'start' | 'center' | 'end';\nexport type MenuSide = 'top' | 'bottom' | 'left' | 'right';\n\nconst OPPOSITE_SIDE: Record<string, MenuSide> = { top: 'bottom', bottom: 'top', left: 'right', right: 'left' };\n\n/**\n * Lets a menu trigger expose its configured `side` to the portaled content. CDK gives the content a\n * child injector whose parent is the trigger's injector, so the content can resolve this token to\n * learn which axis to read off the transform-origin.\n */\nexport interface MenuSideProvider {\n\treadonly side: () => MenuSide;\n}\n\nexport const MENU_SIDE = new InjectionToken<MenuSideProvider>('SpartanMenuSide');\n\n// derive data-side from the transform-origin CDK sets on the content. the anchored corner faces the\n// trigger, so the side is its opposite. the configured `side` tells us which axis carries the anchor\n// (top/bottom -> vertical token, left/right -> horizontal), so a CDK flip is read off the right axis.\n// CDK's origin is rtl-aware, so the derived side is too. falls back to the configured side when the\n// transform-origin is missing or centered (no flip information to apply).\nexport const deriveMenuSideFromTransformOrigin = (transformOrigin: string, side: MenuSide): MenuSide => {\n\tconst [x, y] = transformOrigin.trim().split(/\\s+/);\n\tconst anchor = side === 'top' || side === 'bottom' ? y : x;\n\treturn OPPOSITE_SIDE[anchor] ?? side;\n};\n\nexport const createMenuPosition = (align: MenuAlign, side: MenuSide): ConnectedPosition[] => {\n\tconst verticalAlign = align === 'start' ? 'top' : align === 'end' ? 'bottom' : 'center';\n\n\tconst createPositions = (\n\t\toriginX: 'start' | 'center' | 'end',\n\t\toriginY: 'top' | 'center' | 'bottom',\n\t\toverlayX: 'start' | 'center' | 'end',\n\t\toverlayY: 'top' | 'center' | 'bottom',\n\t): ConnectedPosition[] => [\n\t\t{ originX, originY, overlayX, overlayY },\n\t\t{ originX: overlayX, originY: overlayY, overlayX: originX, overlayY: originY },\n\t];\n\n\tswitch (side) {\n\t\tcase 'top':\n\t\t\treturn createPositions(align, 'top', align, 'bottom');\n\t\tcase 'bottom':\n\t\t\treturn createPositions(align, 'bottom', align, 'top');\n\t\tcase 'left':\n\t\t\treturn createPositions('start', verticalAlign, 'end', verticalAlign);\n\t\tcase 'right':\n\t\t\treturn createPositions('end', verticalAlign, 'start', verticalAlign);\n\t}\n};\n\n/**\n * Applies the given positions to a CDK menu trigger.\n *\n * CDK reads `menuPosition` only when it builds the overlay's `FlexibleConnectedPositionStrategy` (first\n * open) and when its `ngOnChanges` runs. The trigger reuses a single overlay across opens, so a bare\n * `menuPosition` assignment is silently ignored once the overlay exists - e.g. when `side`/`align`\n * change at runtime, the next open keeps the position from the first open. Assigning the property and\n * poking CDK's change handler refreshes an already-created overlay (whether open or reused) so the new\n * positions take effect. When no overlay exists yet the assignment alone is enough.\n */\nexport const updateMenuPosition = (trigger: CdkMenuTrigger, position: ConnectedPosition[]): void => {\n\ttrigger.menuPosition = position;\n\ttrigger.ngOnChanges({ menuPosition: new SimpleChange(undefined, position, false) });\n};\n","export function stringifyAsLabel(item: any, itemToStringLabel?: (item: any) => string) {\n\tif (itemToStringLabel && item !== null && item !== undefined) {\n\t\treturn itemToStringLabel(item) ?? '';\n\t}\n\tif (item && typeof item === 'object') {\n\t\tif ('label' in item && item.label !== null && item.label !== undefined) {\n\t\t\treturn String(item.label);\n\t\t}\n\t\tif ('value' in item && item.value !== null && item.value !== undefined) {\n\t\t\treturn String(item.value);\n\t\t}\n\t}\n\treturn serializeValue(item);\n}\n\nexport function serializeValue(value: unknown): string {\n\tif (value === null || value === undefined) {\n\t\treturn '';\n\t}\n\tif (typeof value === 'string') {\n\t\treturn value;\n\t}\n\ttry {\n\t\treturn JSON.stringify(value);\n\t} catch {\n\t\treturn String(value);\n\t}\n}\n","import { DestroyRef, inject, type Signal, signal } from '@angular/core';\n\n/** Skip-delay grouping: once one member opens, siblings skip their delay until the window elapses. */\nexport interface SkipDelay {\n\t/** Whether the next open should still wait for its delay (`true`) or open instantly (`false`). */\n\treadonly isOpenDelayed: Signal<boolean>;\n\t/** Report that a member opened: opens the skip window so siblings skip their delay. */\n\topen(): void;\n\t/** Report that a member closed: re-require the delay once the window elapses. */\n\tclose(): void;\n}\n\n/** Must be called in an injection context; cleans up its pending timer on destroy. */\nexport function injectSkipDelay(skipDelayDuration: () => number): SkipDelay {\n\tconst isOpenDelayed = signal(true);\n\tlet timer: ReturnType<typeof setTimeout> | undefined;\n\n\tinject(DestroyRef).onDestroy(() => clearTimeout(timer));\n\n\treturn {\n\t\tisOpenDelayed: isOpenDelayed.asReadonly(),\n\t\topen(): void {\n\t\t\tclearTimeout(timer);\n\t\t\tif (skipDelayDuration() > 0) isOpenDelayed.set(false);\n\t\t},\n\t\tclose(): void {\n\t\t\tclearTimeout(timer);\n\t\t\tconst duration = skipDelayDuration();\n\t\t\tif (duration > 0) {\n\t\t\t\ttimer = setTimeout(() => isOpenDelayed.set(true), duration);\n\t\t\t}\n\t\t},\n\t};\n}\n","import { createInjectionToken } from './create-injection-token';\n\nexport interface TableClassesSettable {\n\tsetTableClasses: (classes: Partial<{ table: string; headerRow: string; bodyRow: string }>) => void;\n}\n\nexport const [\n\tinjectTableClassesSettable,\n\tprovideTableClassesSettable,\n\tprovideTableClassesSettableExisting,\n\tSET_TABLE_CLASSES_TOKEN,\n] = createInjectionToken<TableClassesSettable>('@spartan-ng SET_TABLE_CLASSES_TOKEN');\n","const MAX_ANIMATION_WAIT_MS = 5_000;\nconst ANIMATION_WAIT_BUFFER_MS = 50;\n\nexport function getActiveElementAnimations(elements: readonly (HTMLElement | null | undefined)[]): Animation[] {\n\treturn elements\n\t\t.filter((element): element is HTMLElement => !!element)\n\t\t.flatMap((element) =>\n\t\t\ttypeof element.getAnimations === 'function'\n\t\t\t\t? element.getAnimations({ subtree: true }).filter((animation) => animation.playState !== 'finished')\n\t\t\t\t: [],\n\t\t);\n}\n\nexport async function waitForAnimations(animations: readonly Animation[]): Promise<void> {\n\tif (!animations.length) return;\n\n\tlet timeout: ReturnType<typeof setTimeout> | undefined;\n\tconst fallbackMs = getFallbackTimeout(animations);\n\n\ttry {\n\t\tawait Promise.race([\n\t\t\tPromise.allSettled(animations.map((animation) => animation.finished)),\n\t\t\tnew Promise<void>((resolve) => {\n\t\t\t\ttimeout = setTimeout(resolve, fallbackMs);\n\t\t\t}),\n\t\t]);\n\t} finally {\n\t\tif (timeout) clearTimeout(timeout);\n\t}\n}\n\n/**\n * Waits for active animations, including subtree animations, within the given element to finish.\n */\nexport async function waitForElementAnimations(element: HTMLElement): Promise<void> {\n\tawait waitForAnimations(getActiveElementAnimations([element]));\n}\n\nfunction getFallbackTimeout(animations: readonly Animation[]): number {\n\tconst longestAnimation = animations.reduce((longest, animation) => {\n\t\tconst endTime = animation.effect?.getComputedTiming().endTime;\n\t\treturn typeof endTime === 'number' && Number.isFinite(endTime) ? Math.max(longest, endTime) : longest;\n\t}, 0);\n\n\tif (!longestAnimation) return MAX_ANIMATION_WAIT_MS;\n\treturn Math.min(longestAnimation + ANIMATION_WAIT_BUFFER_MS, MAX_ANIMATION_WAIT_MS);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;SAAgB,iBAAiB,CAAC,OAA6C,EAAE,YAAY,GAAG,EAAE,EAAA;AACjG,IAAA,MAAM,KAAK,GAAG,OAAO,IAAI,YAAY;AACrC,IAAA,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAC/G;;ACsBA;AACA,MAAM,oBAAoB,GAAG,IAAI,OAAO,EAAoC;AAC5E;AACA,IAAI,cAAc,GAA4B,IAAI;AAClD,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAe;AAoB/C,IAAI,aAAa,GAAG,CAAC;AAErB;;;;;;;;;;AAUG;AACG,SAAU,UAAU,CAAC,QAAwC,EAAE,OAA0B,EAAA;IAC9F,qBAAqB,CAAC,OAAO,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAK;QAChE,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,MAAM,CAAC,UAAU,CAAC;AAC3D,QAAA,MAAM,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;AACtC,QAAA,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AACrC,QAAA,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,kBAAkB,CAAC,OAAO,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAE/E,QAAA,MAAM,OAAO,GAAG,UAAU,CAAC,aAAa;;AAGxC,QAAA,MAAM,QAAQ,GAAG,aAAa,EAAE;;QAGhC,IAAI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AO,CAAC;IACnC;AACD;AAEA;;AAEG;AACI,eAAe,wBAAwB,CAAC,OAAoB,EAAA;IAClE,MAAM,iBAAiB,CAAC,0BAA0B,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;AAC/D;AAEA,SAAS,kBAAkB,CAAC,UAAgC,EAAA;IAC3D,MAAM,gBAAgB,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,SAAS,KAAI;QACjE,MAAM,OAAO,GAAG,SAAS,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,OAAO;QAC7D,OAAO,OAAO,OAAO,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,OAAO;IACtG,CAAC,EAAE,CAAC,CAAC;AAEL,IAAA,IAAI,CAAC,gBAAgB;AAAE,QAAA,OAAO,qBAAqB;IACnD,OAAO,IAAI,CAAC,GAAG,CAAC,gBAAgB,GAAG,wBAAwB,EAAE,qBAAqB,CAAC;AACpF;;AC9CA;;AAEG;;;;"}
@@ -2,7 +2,6 @@ import { Directionality } from '@angular/cdk/bidi';
2
2
  import { NgComponentOutlet, NgTemplateOutlet, isPlatformBrowser } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
4
  import { input, ChangeDetectionStrategy, Component, booleanAttribute, InjectionToken, inject, Pipe, signal, computed, ElementRef, linkedSignal, effect, afterRenderEffect, TemplateRef, Directive, PLATFORM_ID, DOCUMENT, numberAttribute, viewChild, contentChild, DestroyRef, afterNextRender, ViewEncapsulation } from '@angular/core';
5
- import clsx from 'clsx';
6
5
 
7
6
  class BrnSonnerIcon {
8
7
  type = input('default', ...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
@@ -359,6 +358,10 @@ const toast = Object.assign(basicToast, {
359
358
  loading: toastState.loading,
360
359
  });
361
360
 
361
+ /** Joins the (optional) class strings of a toast. */
362
+ function joinClasses(...classes) {
363
+ return classes.filter(Boolean).join(' ');
364
+ }
362
365
  class BrnSonnerToast {
363
366
  _config = injectBrnSonnerToasterConfig();
364
367
  _toasts = computed(() => toastState.toasts().filter((t) => t.position === this.position()), ...(ngDevMode ? [{ debugName: "_toasts" }] : /* istanbul ignore next */ []));
@@ -431,7 +434,7 @@ class BrnSonnerToast {
431
434
  _timeoutId;
432
435
  _remainingTime = 0;
433
436
  _isPromiseLoadingOrInfiniteDuration = computed(() => (this.toast().promise && this._toastType() === 'loading') || this.toast().duration === Number.POSITIVE_INFINITY, ...(ngDevMode ? [{ debugName: "_isPromiseLoadingOrInfiniteDuration" }] : /* istanbul ignore next */ []));
434
- _toastClasses = computed(() => clsx(this.userClass(), this._toastClass(), this._classes().toast, this.toast().classes?.toast, this._classes()[this._toastType()], this.toast().classes?.[this._toastType()]), ...(ngDevMode ? [{ debugName: "_toastClasses" }] : /* istanbul ignore next */ []));
437
+ _toastClasses = computed(() => joinClasses(this.userClass(), this._toastClass(), this._classes().toast, this.toast().classes?.toast, this._classes()[this._toastType()], this.toast().classes?.[this._toastType()]), ...(ngDevMode ? [{ debugName: "_toastClasses" }] : /* istanbul ignore next */ []));
435
438
  _toastStyle = computed(() => ({
436
439
  '--index': `${this.index()}`,
437
440
  '--toasts-before': `${this.index()}`,
@@ -440,11 +443,11 @@ class BrnSonnerToast {
440
443
  '--initial-height': this.expandByDefault() ? 'auto' : `${this._initialHeight()}px`,
441
444
  ...this.style(),
442
445
  }), ...(ngDevMode ? [{ debugName: "_toastStyle" }] : /* istanbul ignore next */ []));
443
- _actionButtonClasses = computed(() => clsx(this._classes().actionButton, this.toast().classes?.actionButton), ...(ngDevMode ? [{ debugName: "_actionButtonClasses" }] : /* istanbul ignore next */ []));
444
- _cancelButtonClasses = computed(() => clsx(this._classes().cancelButton, this.toast().classes?.cancelButton), ...(ngDevMode ? [{ debugName: "_cancelButtonClasses" }] : /* istanbul ignore next */ []));
445
- _toastDescriptionClasses = computed(() => clsx(this.descriptionClass(), this._toastDescriptionClass(), this._classes().description, this.toast().classes?.description), ...(ngDevMode ? [{ debugName: "_toastDescriptionClasses" }] : /* istanbul ignore next */ []));
446
- _titleClasses = computed(() => clsx(this._classes().title, this.toast().classes?.title), ...(ngDevMode ? [{ debugName: "_titleClasses" }] : /* istanbul ignore next */ []));
447
- _closeButtonClasses = computed(() => clsx(this._classes().closeButton, this.toast().classes?.closeButton), ...(ngDevMode ? [{ debugName: "_closeButtonClasses" }] : /* istanbul ignore next */ []));
446
+ _actionButtonClasses = computed(() => joinClasses(this._classes().actionButton, this.toast().classes?.actionButton), ...(ngDevMode ? [{ debugName: "_actionButtonClasses" }] : /* istanbul ignore next */ []));
447
+ _cancelButtonClasses = computed(() => joinClasses(this._classes().cancelButton, this.toast().classes?.cancelButton), ...(ngDevMode ? [{ debugName: "_cancelButtonClasses" }] : /* istanbul ignore next */ []));
448
+ _toastDescriptionClasses = computed(() => joinClasses(this.descriptionClass(), this._toastDescriptionClass(), this._classes().description, this.toast().classes?.description), ...(ngDevMode ? [{ debugName: "_toastDescriptionClasses" }] : /* istanbul ignore next */ []));
449
+ _titleClasses = computed(() => joinClasses(this._classes().title, this.toast().classes?.title), ...(ngDevMode ? [{ debugName: "_titleClasses" }] : /* istanbul ignore next */ []));
450
+ _closeButtonClasses = computed(() => joinClasses(this._classes().closeButton, this.toast().classes?.closeButton), ...(ngDevMode ? [{ debugName: "_closeButtonClasses" }] : /* istanbul ignore next */ []));
448
451
  constructor() {
449
452
  effect(() => {
450
453
  if (this.toast().updated) {