@angular/animations 19.2.4 → 19.2.6

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.
@@ -0,0 +1,697 @@
1
+ /**
2
+ * @license Angular v19.2.6
3
+ * (c) 2010-2025 Google LLC. https://angular.io/
4
+ * License: MIT
5
+ */
6
+
7
+ import { AnimationGroupPlayer, NoopAnimationPlayer, AUTO_STYLE, ɵPRE_STYLE as _PRE_STYLE, AnimationMetadataType, sequence } from './private_export-CacKMzxJ.mjs';
8
+ import { ɵRuntimeError as _RuntimeError } from '@angular/core';
9
+
10
+ const LINE_START = '\n - ';
11
+ function invalidTimingValue(exp) {
12
+ return new _RuntimeError(3000 /* RuntimeErrorCode.INVALID_TIMING_VALUE */, ngDevMode && `The provided timing value "${exp}" is invalid.`);
13
+ }
14
+ function negativeStepValue() {
15
+ return new _RuntimeError(3100 /* RuntimeErrorCode.NEGATIVE_STEP_VALUE */, ngDevMode && 'Duration values below 0 are not allowed for this animation step.');
16
+ }
17
+ function negativeDelayValue() {
18
+ return new _RuntimeError(3101 /* RuntimeErrorCode.NEGATIVE_DELAY_VALUE */, ngDevMode && 'Delay values below 0 are not allowed for this animation step.');
19
+ }
20
+ function invalidStyleParams(varName) {
21
+ return new _RuntimeError(3001 /* RuntimeErrorCode.INVALID_STYLE_PARAMS */, ngDevMode &&
22
+ `Unable to resolve the local animation param ${varName} in the given list of values`);
23
+ }
24
+ function invalidParamValue(varName) {
25
+ return new _RuntimeError(3003 /* RuntimeErrorCode.INVALID_PARAM_VALUE */, ngDevMode && `Please provide a value for the animation param ${varName}`);
26
+ }
27
+ function invalidNodeType(nodeType) {
28
+ return new _RuntimeError(3004 /* RuntimeErrorCode.INVALID_NODE_TYPE */, ngDevMode && `Unable to resolve animation metadata node #${nodeType}`);
29
+ }
30
+ function invalidCssUnitValue(userProvidedProperty, value) {
31
+ return new _RuntimeError(3005 /* RuntimeErrorCode.INVALID_CSS_UNIT_VALUE */, ngDevMode && `Please provide a CSS unit value for ${userProvidedProperty}:${value}`);
32
+ }
33
+ function invalidTrigger() {
34
+ return new _RuntimeError(3006 /* RuntimeErrorCode.INVALID_TRIGGER */, ngDevMode &&
35
+ "animation triggers cannot be prefixed with an `@` sign (e.g. trigger('@foo', [...]))");
36
+ }
37
+ function invalidDefinition() {
38
+ return new _RuntimeError(3007 /* RuntimeErrorCode.INVALID_DEFINITION */, ngDevMode && 'only state() and transition() definitions can sit inside of a trigger()');
39
+ }
40
+ function invalidState(metadataName, missingSubs) {
41
+ return new _RuntimeError(3008 /* RuntimeErrorCode.INVALID_STATE */, ngDevMode &&
42
+ `state("${metadataName}", ...) must define default values for all the following style substitutions: ${missingSubs.join(', ')}`);
43
+ }
44
+ function invalidStyleValue(value) {
45
+ return new _RuntimeError(3002 /* RuntimeErrorCode.INVALID_STYLE_VALUE */, ngDevMode && `The provided style string value ${value} is not allowed.`);
46
+ }
47
+ function invalidParallelAnimation(prop, firstStart, firstEnd, secondStart, secondEnd) {
48
+ return new _RuntimeError(3010 /* RuntimeErrorCode.INVALID_PARALLEL_ANIMATION */, ngDevMode &&
49
+ `The CSS property "${prop}" that exists between the times of "${firstStart}ms" and "${firstEnd}ms" is also being animated in a parallel animation between the times of "${secondStart}ms" and "${secondEnd}ms"`);
50
+ }
51
+ function invalidKeyframes() {
52
+ return new _RuntimeError(3011 /* RuntimeErrorCode.INVALID_KEYFRAMES */, ngDevMode && `keyframes() must be placed inside of a call to animate()`);
53
+ }
54
+ function invalidOffset() {
55
+ return new _RuntimeError(3012 /* RuntimeErrorCode.INVALID_OFFSET */, ngDevMode && `Please ensure that all keyframe offsets are between 0 and 1`);
56
+ }
57
+ function keyframeOffsetsOutOfOrder() {
58
+ return new _RuntimeError(3200 /* RuntimeErrorCode.KEYFRAME_OFFSETS_OUT_OF_ORDER */, ngDevMode && `Please ensure that all keyframe offsets are in order`);
59
+ }
60
+ function keyframesMissingOffsets() {
61
+ return new _RuntimeError(3202 /* RuntimeErrorCode.KEYFRAMES_MISSING_OFFSETS */, ngDevMode && `Not all style() steps within the declared keyframes() contain offsets`);
62
+ }
63
+ function invalidStagger() {
64
+ return new _RuntimeError(3013 /* RuntimeErrorCode.INVALID_STAGGER */, ngDevMode && `stagger() can only be used inside of query()`);
65
+ }
66
+ function invalidQuery(selector) {
67
+ return new _RuntimeError(3014 /* RuntimeErrorCode.INVALID_QUERY */, ngDevMode &&
68
+ `\`query("${selector}")\` returned zero elements. (Use \`query("${selector}", { optional: true })\` if you wish to allow this.)`);
69
+ }
70
+ function invalidExpression(expr) {
71
+ return new _RuntimeError(3015 /* RuntimeErrorCode.INVALID_EXPRESSION */, ngDevMode && `The provided transition expression "${expr}" is not supported`);
72
+ }
73
+ function invalidTransitionAlias(alias) {
74
+ return new _RuntimeError(3016 /* RuntimeErrorCode.INVALID_TRANSITION_ALIAS */, ngDevMode && `The transition alias value "${alias}" is not supported`);
75
+ }
76
+ function validationFailed(errors) {
77
+ return new _RuntimeError(3500 /* RuntimeErrorCode.VALIDATION_FAILED */, ngDevMode && `animation validation failed:\n${errors.map((err) => err.message).join('\n')}`);
78
+ }
79
+ function buildingFailed(errors) {
80
+ return new _RuntimeError(3501 /* RuntimeErrorCode.BUILDING_FAILED */, ngDevMode && `animation building failed:\n${errors.map((err) => err.message).join('\n')}`);
81
+ }
82
+ function triggerBuildFailed(name, errors) {
83
+ return new _RuntimeError(3404 /* RuntimeErrorCode.TRIGGER_BUILD_FAILED */, ngDevMode &&
84
+ `The animation trigger "${name}" has failed to build due to the following errors:\n - ${errors
85
+ .map((err) => err.message)
86
+ .join('\n - ')}`);
87
+ }
88
+ function animationFailed(errors) {
89
+ return new _RuntimeError(3502 /* RuntimeErrorCode.ANIMATION_FAILED */, ngDevMode &&
90
+ `Unable to animate due to the following errors:${LINE_START}${errors
91
+ .map((err) => err.message)
92
+ .join(LINE_START)}`);
93
+ }
94
+ function registerFailed(errors) {
95
+ return new _RuntimeError(3503 /* RuntimeErrorCode.REGISTRATION_FAILED */, ngDevMode &&
96
+ `Unable to build the animation due to the following errors: ${errors
97
+ .map((err) => err.message)
98
+ .join('\n')}`);
99
+ }
100
+ function missingOrDestroyedAnimation() {
101
+ return new _RuntimeError(3300 /* RuntimeErrorCode.MISSING_OR_DESTROYED_ANIMATION */, ngDevMode && "The requested animation doesn't exist or has already been destroyed");
102
+ }
103
+ function createAnimationFailed(errors) {
104
+ return new _RuntimeError(3504 /* RuntimeErrorCode.CREATE_ANIMATION_FAILED */, ngDevMode &&
105
+ `Unable to create the animation due to the following errors:${errors
106
+ .map((err) => err.message)
107
+ .join('\n')}`);
108
+ }
109
+ function missingPlayer(id) {
110
+ return new _RuntimeError(3301 /* RuntimeErrorCode.MISSING_PLAYER */, ngDevMode && `Unable to find the timeline player referenced by ${id}`);
111
+ }
112
+ function missingTrigger(phase, name) {
113
+ return new _RuntimeError(3302 /* RuntimeErrorCode.MISSING_TRIGGER */, ngDevMode &&
114
+ `Unable to listen on the animation trigger event "${phase}" because the animation trigger "${name}" doesn\'t exist!`);
115
+ }
116
+ function missingEvent(name) {
117
+ return new _RuntimeError(3303 /* RuntimeErrorCode.MISSING_EVENT */, ngDevMode &&
118
+ `Unable to listen on the animation trigger "${name}" because the provided event is undefined!`);
119
+ }
120
+ function unsupportedTriggerEvent(phase, name) {
121
+ return new _RuntimeError(3400 /* RuntimeErrorCode.UNSUPPORTED_TRIGGER_EVENT */, ngDevMode &&
122
+ `The provided animation trigger event "${phase}" for the animation trigger "${name}" is not supported!`);
123
+ }
124
+ function unregisteredTrigger(name) {
125
+ return new _RuntimeError(3401 /* RuntimeErrorCode.UNREGISTERED_TRIGGER */, ngDevMode && `The provided animation trigger "${name}" has not been registered!`);
126
+ }
127
+ function triggerTransitionsFailed(errors) {
128
+ return new _RuntimeError(3402 /* RuntimeErrorCode.TRIGGER_TRANSITIONS_FAILED */, ngDevMode &&
129
+ `Unable to process animations due to the following failed trigger transitions\n ${errors
130
+ .map((err) => err.message)
131
+ .join('\n')}`);
132
+ }
133
+ function transitionFailed(name, errors) {
134
+ return new _RuntimeError(3505 /* RuntimeErrorCode.TRANSITION_FAILED */, ngDevMode && `@${name} has failed due to:\n ${errors.map((err) => err.message).join('\n- ')}`);
135
+ }
136
+
137
+ /**
138
+ * Set of all animatable CSS properties
139
+ *
140
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_animated_properties
141
+ */
142
+ const ANIMATABLE_PROP_SET = new Set([
143
+ '-moz-outline-radius',
144
+ '-moz-outline-radius-bottomleft',
145
+ '-moz-outline-radius-bottomright',
146
+ '-moz-outline-radius-topleft',
147
+ '-moz-outline-radius-topright',
148
+ '-ms-grid-columns',
149
+ '-ms-grid-rows',
150
+ '-webkit-line-clamp',
151
+ '-webkit-text-fill-color',
152
+ '-webkit-text-stroke',
153
+ '-webkit-text-stroke-color',
154
+ 'accent-color',
155
+ 'all',
156
+ 'backdrop-filter',
157
+ 'background',
158
+ 'background-color',
159
+ 'background-position',
160
+ 'background-size',
161
+ 'block-size',
162
+ 'border',
163
+ 'border-block-end',
164
+ 'border-block-end-color',
165
+ 'border-block-end-width',
166
+ 'border-block-start',
167
+ 'border-block-start-color',
168
+ 'border-block-start-width',
169
+ 'border-bottom',
170
+ 'border-bottom-color',
171
+ 'border-bottom-left-radius',
172
+ 'border-bottom-right-radius',
173
+ 'border-bottom-width',
174
+ 'border-color',
175
+ 'border-end-end-radius',
176
+ 'border-end-start-radius',
177
+ 'border-image-outset',
178
+ 'border-image-slice',
179
+ 'border-image-width',
180
+ 'border-inline-end',
181
+ 'border-inline-end-color',
182
+ 'border-inline-end-width',
183
+ 'border-inline-start',
184
+ 'border-inline-start-color',
185
+ 'border-inline-start-width',
186
+ 'border-left',
187
+ 'border-left-color',
188
+ 'border-left-width',
189
+ 'border-radius',
190
+ 'border-right',
191
+ 'border-right-color',
192
+ 'border-right-width',
193
+ 'border-start-end-radius',
194
+ 'border-start-start-radius',
195
+ 'border-top',
196
+ 'border-top-color',
197
+ 'border-top-left-radius',
198
+ 'border-top-right-radius',
199
+ 'border-top-width',
200
+ 'border-width',
201
+ 'bottom',
202
+ 'box-shadow',
203
+ 'caret-color',
204
+ 'clip',
205
+ 'clip-path',
206
+ 'color',
207
+ 'column-count',
208
+ 'column-gap',
209
+ 'column-rule',
210
+ 'column-rule-color',
211
+ 'column-rule-width',
212
+ 'column-width',
213
+ 'columns',
214
+ 'filter',
215
+ 'flex',
216
+ 'flex-basis',
217
+ 'flex-grow',
218
+ 'flex-shrink',
219
+ 'font',
220
+ 'font-size',
221
+ 'font-size-adjust',
222
+ 'font-stretch',
223
+ 'font-variation-settings',
224
+ 'font-weight',
225
+ 'gap',
226
+ 'grid-column-gap',
227
+ 'grid-gap',
228
+ 'grid-row-gap',
229
+ 'grid-template-columns',
230
+ 'grid-template-rows',
231
+ 'height',
232
+ 'inline-size',
233
+ 'input-security',
234
+ 'inset',
235
+ 'inset-block',
236
+ 'inset-block-end',
237
+ 'inset-block-start',
238
+ 'inset-inline',
239
+ 'inset-inline-end',
240
+ 'inset-inline-start',
241
+ 'left',
242
+ 'letter-spacing',
243
+ 'line-clamp',
244
+ 'line-height',
245
+ 'margin',
246
+ 'margin-block-end',
247
+ 'margin-block-start',
248
+ 'margin-bottom',
249
+ 'margin-inline-end',
250
+ 'margin-inline-start',
251
+ 'margin-left',
252
+ 'margin-right',
253
+ 'margin-top',
254
+ 'mask',
255
+ 'mask-border',
256
+ 'mask-position',
257
+ 'mask-size',
258
+ 'max-block-size',
259
+ 'max-height',
260
+ 'max-inline-size',
261
+ 'max-lines',
262
+ 'max-width',
263
+ 'min-block-size',
264
+ 'min-height',
265
+ 'min-inline-size',
266
+ 'min-width',
267
+ 'object-position',
268
+ 'offset',
269
+ 'offset-anchor',
270
+ 'offset-distance',
271
+ 'offset-path',
272
+ 'offset-position',
273
+ 'offset-rotate',
274
+ 'opacity',
275
+ 'order',
276
+ 'outline',
277
+ 'outline-color',
278
+ 'outline-offset',
279
+ 'outline-width',
280
+ 'padding',
281
+ 'padding-block-end',
282
+ 'padding-block-start',
283
+ 'padding-bottom',
284
+ 'padding-inline-end',
285
+ 'padding-inline-start',
286
+ 'padding-left',
287
+ 'padding-right',
288
+ 'padding-top',
289
+ 'perspective',
290
+ 'perspective-origin',
291
+ 'right',
292
+ 'rotate',
293
+ 'row-gap',
294
+ 'scale',
295
+ 'scroll-margin',
296
+ 'scroll-margin-block',
297
+ 'scroll-margin-block-end',
298
+ 'scroll-margin-block-start',
299
+ 'scroll-margin-bottom',
300
+ 'scroll-margin-inline',
301
+ 'scroll-margin-inline-end',
302
+ 'scroll-margin-inline-start',
303
+ 'scroll-margin-left',
304
+ 'scroll-margin-right',
305
+ 'scroll-margin-top',
306
+ 'scroll-padding',
307
+ 'scroll-padding-block',
308
+ 'scroll-padding-block-end',
309
+ 'scroll-padding-block-start',
310
+ 'scroll-padding-bottom',
311
+ 'scroll-padding-inline',
312
+ 'scroll-padding-inline-end',
313
+ 'scroll-padding-inline-start',
314
+ 'scroll-padding-left',
315
+ 'scroll-padding-right',
316
+ 'scroll-padding-top',
317
+ 'scroll-snap-coordinate',
318
+ 'scroll-snap-destination',
319
+ 'scrollbar-color',
320
+ 'shape-image-threshold',
321
+ 'shape-margin',
322
+ 'shape-outside',
323
+ 'tab-size',
324
+ 'text-decoration',
325
+ 'text-decoration-color',
326
+ 'text-decoration-thickness',
327
+ 'text-emphasis',
328
+ 'text-emphasis-color',
329
+ 'text-indent',
330
+ 'text-shadow',
331
+ 'text-underline-offset',
332
+ 'top',
333
+ 'transform',
334
+ 'transform-origin',
335
+ 'translate',
336
+ 'vertical-align',
337
+ 'visibility',
338
+ 'width',
339
+ 'word-spacing',
340
+ 'z-index',
341
+ 'zoom',
342
+ ]);
343
+
344
+ function optimizeGroupPlayer(players) {
345
+ switch (players.length) {
346
+ case 0:
347
+ return new NoopAnimationPlayer();
348
+ case 1:
349
+ return players[0];
350
+ default:
351
+ return new AnimationGroupPlayer(players);
352
+ }
353
+ }
354
+ function normalizeKeyframes$1(normalizer, keyframes, preStyles = new Map(), postStyles = new Map()) {
355
+ const errors = [];
356
+ const normalizedKeyframes = [];
357
+ let previousOffset = -1;
358
+ let previousKeyframe = null;
359
+ keyframes.forEach((kf) => {
360
+ const offset = kf.get('offset');
361
+ const isSameOffset = offset == previousOffset;
362
+ const normalizedKeyframe = (isSameOffset && previousKeyframe) || new Map();
363
+ kf.forEach((val, prop) => {
364
+ let normalizedProp = prop;
365
+ let normalizedValue = val;
366
+ if (prop !== 'offset') {
367
+ normalizedProp = normalizer.normalizePropertyName(normalizedProp, errors);
368
+ switch (normalizedValue) {
369
+ case _PRE_STYLE:
370
+ normalizedValue = preStyles.get(prop);
371
+ break;
372
+ case AUTO_STYLE:
373
+ normalizedValue = postStyles.get(prop);
374
+ break;
375
+ default:
376
+ normalizedValue = normalizer.normalizeStyleValue(prop, normalizedProp, normalizedValue, errors);
377
+ break;
378
+ }
379
+ }
380
+ normalizedKeyframe.set(normalizedProp, normalizedValue);
381
+ });
382
+ if (!isSameOffset) {
383
+ normalizedKeyframes.push(normalizedKeyframe);
384
+ }
385
+ previousKeyframe = normalizedKeyframe;
386
+ previousOffset = offset;
387
+ });
388
+ if (errors.length) {
389
+ throw animationFailed(errors);
390
+ }
391
+ return normalizedKeyframes;
392
+ }
393
+ function listenOnPlayer(player, eventName, event, callback) {
394
+ switch (eventName) {
395
+ case 'start':
396
+ player.onStart(() => callback(event && copyAnimationEvent(event, 'start', player)));
397
+ break;
398
+ case 'done':
399
+ player.onDone(() => callback(event && copyAnimationEvent(event, 'done', player)));
400
+ break;
401
+ case 'destroy':
402
+ player.onDestroy(() => callback(event && copyAnimationEvent(event, 'destroy', player)));
403
+ break;
404
+ }
405
+ }
406
+ function copyAnimationEvent(e, phaseName, player) {
407
+ const totalTime = player.totalTime;
408
+ const disabled = player.disabled ? true : false;
409
+ const event = makeAnimationEvent(e.element, e.triggerName, e.fromState, e.toState, phaseName || e.phaseName, totalTime == undefined ? e.totalTime : totalTime, disabled);
410
+ const data = e['_data'];
411
+ if (data != null) {
412
+ event['_data'] = data;
413
+ }
414
+ return event;
415
+ }
416
+ function makeAnimationEvent(element, triggerName, fromState, toState, phaseName = '', totalTime = 0, disabled) {
417
+ return { element, triggerName, fromState, toState, phaseName, totalTime, disabled: !!disabled };
418
+ }
419
+ function getOrSetDefaultValue(map, key, defaultValue) {
420
+ let value = map.get(key);
421
+ if (!value) {
422
+ map.set(key, (value = defaultValue));
423
+ }
424
+ return value;
425
+ }
426
+ function parseTimelineCommand(command) {
427
+ const separatorPos = command.indexOf(':');
428
+ const id = command.substring(1, separatorPos);
429
+ const action = command.slice(separatorPos + 1);
430
+ return [id, action];
431
+ }
432
+ const documentElement = /* @__PURE__ */ (() => typeof document === 'undefined' ? null : document.documentElement)();
433
+ function getParentElement(element) {
434
+ const parent = element.parentNode || element.host || null; // consider host to support shadow DOM
435
+ if (parent === documentElement) {
436
+ return null;
437
+ }
438
+ return parent;
439
+ }
440
+ function containsVendorPrefix(prop) {
441
+ // Webkit is the only real popular vendor prefix nowadays
442
+ // cc: http://shouldiprefix.com/
443
+ return prop.substring(1, 6) == 'ebkit'; // webkit or Webkit
444
+ }
445
+ let _CACHED_BODY = null;
446
+ let _IS_WEBKIT = false;
447
+ function validateStyleProperty(prop) {
448
+ if (!_CACHED_BODY) {
449
+ _CACHED_BODY = getBodyNode() || {};
450
+ _IS_WEBKIT = _CACHED_BODY.style ? 'WebkitAppearance' in _CACHED_BODY.style : false;
451
+ }
452
+ let result = true;
453
+ if (_CACHED_BODY.style && !containsVendorPrefix(prop)) {
454
+ result = prop in _CACHED_BODY.style;
455
+ if (!result && _IS_WEBKIT) {
456
+ const camelProp = 'Webkit' + prop.charAt(0).toUpperCase() + prop.slice(1);
457
+ result = camelProp in _CACHED_BODY.style;
458
+ }
459
+ }
460
+ return result;
461
+ }
462
+ function validateWebAnimatableStyleProperty(prop) {
463
+ return ANIMATABLE_PROP_SET.has(prop);
464
+ }
465
+ function getBodyNode() {
466
+ if (typeof document != 'undefined') {
467
+ return document.body;
468
+ }
469
+ return null;
470
+ }
471
+ function containsElement(elm1, elm2) {
472
+ while (elm2) {
473
+ if (elm2 === elm1) {
474
+ return true;
475
+ }
476
+ elm2 = getParentElement(elm2);
477
+ }
478
+ return false;
479
+ }
480
+ function invokeQuery(element, selector, multi) {
481
+ if (multi) {
482
+ return Array.from(element.querySelectorAll(selector));
483
+ }
484
+ const elem = element.querySelector(selector);
485
+ return elem ? [elem] : [];
486
+ }
487
+
488
+ const ONE_SECOND = 1000;
489
+ const SUBSTITUTION_EXPR_START = '{{';
490
+ const SUBSTITUTION_EXPR_END = '}}';
491
+ const ENTER_CLASSNAME = 'ng-enter';
492
+ const LEAVE_CLASSNAME = 'ng-leave';
493
+ const NG_TRIGGER_CLASSNAME = 'ng-trigger';
494
+ const NG_TRIGGER_SELECTOR = '.ng-trigger';
495
+ const NG_ANIMATING_CLASSNAME = 'ng-animating';
496
+ const NG_ANIMATING_SELECTOR = '.ng-animating';
497
+ function resolveTimingValue(value) {
498
+ if (typeof value == 'number')
499
+ return value;
500
+ const matches = value.match(/^(-?[\.\d]+)(m?s)/);
501
+ if (!matches || matches.length < 2)
502
+ return 0;
503
+ return _convertTimeValueToMS(parseFloat(matches[1]), matches[2]);
504
+ }
505
+ function _convertTimeValueToMS(value, unit) {
506
+ switch (unit) {
507
+ case 's':
508
+ return value * ONE_SECOND;
509
+ default: // ms or something else
510
+ return value;
511
+ }
512
+ }
513
+ function resolveTiming(timings, errors, allowNegativeValues) {
514
+ return timings.hasOwnProperty('duration')
515
+ ? timings
516
+ : parseTimeExpression(timings, errors, allowNegativeValues);
517
+ }
518
+ function parseTimeExpression(exp, errors, allowNegativeValues) {
519
+ const regex = /^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i;
520
+ let duration;
521
+ let delay = 0;
522
+ let easing = '';
523
+ if (typeof exp === 'string') {
524
+ const matches = exp.match(regex);
525
+ if (matches === null) {
526
+ errors.push(invalidTimingValue(exp));
527
+ return { duration: 0, delay: 0, easing: '' };
528
+ }
529
+ duration = _convertTimeValueToMS(parseFloat(matches[1]), matches[2]);
530
+ const delayMatch = matches[3];
531
+ if (delayMatch != null) {
532
+ delay = _convertTimeValueToMS(parseFloat(delayMatch), matches[4]);
533
+ }
534
+ const easingVal = matches[5];
535
+ if (easingVal) {
536
+ easing = easingVal;
537
+ }
538
+ }
539
+ else {
540
+ duration = exp;
541
+ }
542
+ if (!allowNegativeValues) {
543
+ let containsErrors = false;
544
+ let startIndex = errors.length;
545
+ if (duration < 0) {
546
+ errors.push(negativeStepValue());
547
+ containsErrors = true;
548
+ }
549
+ if (delay < 0) {
550
+ errors.push(negativeDelayValue());
551
+ containsErrors = true;
552
+ }
553
+ if (containsErrors) {
554
+ errors.splice(startIndex, 0, invalidTimingValue(exp));
555
+ }
556
+ }
557
+ return { duration, delay, easing };
558
+ }
559
+ function normalizeKeyframes(keyframes) {
560
+ if (!keyframes.length) {
561
+ return [];
562
+ }
563
+ if (keyframes[0] instanceof Map) {
564
+ return keyframes;
565
+ }
566
+ return keyframes.map((kf) => new Map(Object.entries(kf)));
567
+ }
568
+ function normalizeStyles(styles) {
569
+ return Array.isArray(styles) ? new Map(...styles) : new Map(styles);
570
+ }
571
+ function setStyles(element, styles, formerStyles) {
572
+ styles.forEach((val, prop) => {
573
+ const camelProp = dashCaseToCamelCase(prop);
574
+ if (formerStyles && !formerStyles.has(prop)) {
575
+ formerStyles.set(prop, element.style[camelProp]);
576
+ }
577
+ element.style[camelProp] = val;
578
+ });
579
+ }
580
+ function eraseStyles(element, styles) {
581
+ styles.forEach((_, prop) => {
582
+ const camelProp = dashCaseToCamelCase(prop);
583
+ element.style[camelProp] = '';
584
+ });
585
+ }
586
+ function normalizeAnimationEntry(steps) {
587
+ if (Array.isArray(steps)) {
588
+ if (steps.length == 1)
589
+ return steps[0];
590
+ return sequence(steps);
591
+ }
592
+ return steps;
593
+ }
594
+ function validateStyleParams(value, options, errors) {
595
+ const params = options.params || {};
596
+ const matches = extractStyleParams(value);
597
+ if (matches.length) {
598
+ matches.forEach((varName) => {
599
+ if (!params.hasOwnProperty(varName)) {
600
+ errors.push(invalidStyleParams(varName));
601
+ }
602
+ });
603
+ }
604
+ }
605
+ const PARAM_REGEX = /* @__PURE__ */ new RegExp(`${SUBSTITUTION_EXPR_START}\\s*(.+?)\\s*${SUBSTITUTION_EXPR_END}`, 'g');
606
+ function extractStyleParams(value) {
607
+ let params = [];
608
+ if (typeof value === 'string') {
609
+ let match;
610
+ while ((match = PARAM_REGEX.exec(value))) {
611
+ params.push(match[1]);
612
+ }
613
+ PARAM_REGEX.lastIndex = 0;
614
+ }
615
+ return params;
616
+ }
617
+ function interpolateParams(value, params, errors) {
618
+ const original = `${value}`;
619
+ const str = original.replace(PARAM_REGEX, (_, varName) => {
620
+ let localVal = params[varName];
621
+ // this means that the value was never overridden by the data passed in by the user
622
+ if (localVal == null) {
623
+ errors.push(invalidParamValue(varName));
624
+ localVal = '';
625
+ }
626
+ return localVal.toString();
627
+ });
628
+ // we do this to assert that numeric values stay as they are
629
+ return str == original ? value : str;
630
+ }
631
+ const DASH_CASE_REGEXP = /-+([a-z0-9])/g;
632
+ function dashCaseToCamelCase(input) {
633
+ return input.replace(DASH_CASE_REGEXP, (...m) => m[1].toUpperCase());
634
+ }
635
+ function camelCaseToDashCase(input) {
636
+ return input.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
637
+ }
638
+ function allowPreviousPlayerStylesMerge(duration, delay) {
639
+ return duration === 0 || delay === 0;
640
+ }
641
+ function balancePreviousStylesIntoKeyframes(element, keyframes, previousStyles) {
642
+ if (previousStyles.size && keyframes.length) {
643
+ let startingKeyframe = keyframes[0];
644
+ let missingStyleProps = [];
645
+ previousStyles.forEach((val, prop) => {
646
+ if (!startingKeyframe.has(prop)) {
647
+ missingStyleProps.push(prop);
648
+ }
649
+ startingKeyframe.set(prop, val);
650
+ });
651
+ if (missingStyleProps.length) {
652
+ for (let i = 1; i < keyframes.length; i++) {
653
+ let kf = keyframes[i];
654
+ missingStyleProps.forEach((prop) => kf.set(prop, computeStyle(element, prop)));
655
+ }
656
+ }
657
+ }
658
+ return keyframes;
659
+ }
660
+ function visitDslNode(visitor, node, context) {
661
+ switch (node.type) {
662
+ case AnimationMetadataType.Trigger:
663
+ return visitor.visitTrigger(node, context);
664
+ case AnimationMetadataType.State:
665
+ return visitor.visitState(node, context);
666
+ case AnimationMetadataType.Transition:
667
+ return visitor.visitTransition(node, context);
668
+ case AnimationMetadataType.Sequence:
669
+ return visitor.visitSequence(node, context);
670
+ case AnimationMetadataType.Group:
671
+ return visitor.visitGroup(node, context);
672
+ case AnimationMetadataType.Animate:
673
+ return visitor.visitAnimate(node, context);
674
+ case AnimationMetadataType.Keyframes:
675
+ return visitor.visitKeyframes(node, context);
676
+ case AnimationMetadataType.Style:
677
+ return visitor.visitStyle(node, context);
678
+ case AnimationMetadataType.Reference:
679
+ return visitor.visitReference(node, context);
680
+ case AnimationMetadataType.AnimateChild:
681
+ return visitor.visitAnimateChild(node, context);
682
+ case AnimationMetadataType.AnimateRef:
683
+ return visitor.visitAnimateRef(node, context);
684
+ case AnimationMetadataType.Query:
685
+ return visitor.visitQuery(node, context);
686
+ case AnimationMetadataType.Stagger:
687
+ return visitor.visitStagger(node, context);
688
+ default:
689
+ throw invalidNodeType(node.type);
690
+ }
691
+ }
692
+ function computeStyle(element, prop) {
693
+ return window.getComputedStyle(element)[prop];
694
+ }
695
+
696
+ export { ENTER_CLASSNAME, LEAVE_CLASSNAME, NG_ANIMATING_CLASSNAME, NG_ANIMATING_SELECTOR, NG_TRIGGER_CLASSNAME, NG_TRIGGER_SELECTOR, SUBSTITUTION_EXPR_START, allowPreviousPlayerStylesMerge, balancePreviousStylesIntoKeyframes, buildingFailed, camelCaseToDashCase, computeStyle, containsElement, createAnimationFailed, dashCaseToCamelCase, eraseStyles, extractStyleParams, getOrSetDefaultValue, getParentElement, interpolateParams, invalidCssUnitValue, invalidDefinition, invalidExpression, invalidKeyframes, invalidOffset, invalidParallelAnimation, invalidQuery, invalidStagger, invalidState, invalidStyleValue, invalidTransitionAlias, invalidTrigger, invokeQuery, keyframeOffsetsOutOfOrder, keyframesMissingOffsets, listenOnPlayer, makeAnimationEvent, missingEvent, missingOrDestroyedAnimation, missingPlayer, missingTrigger, normalizeAnimationEntry, normalizeKeyframes$1 as normalizeKeyframes, normalizeKeyframes as normalizeKeyframes$1, normalizeStyles, optimizeGroupPlayer, parseTimelineCommand, registerFailed, resolveTiming, resolveTimingValue, setStyles, transitionFailed, triggerBuildFailed, triggerTransitionsFailed, unregisteredTrigger, unsupportedTriggerEvent, validateStyleParams, validateStyleProperty, validateWebAnimatableStyleProperty, validationFailed, visitDslNode };
697
+ //# sourceMappingURL=util-DN3Vao_r.mjs.map