@angular/animations 11.0.0-rc.3 → 11.0.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,5 +1,5 @@
1
1
  /**
2
- * @license Angular v11.0.0-rc.3
2
+ * @license Angular v11.0.3
3
3
  * (c) 2010-2020 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -10,307 +10,13 @@
10
10
  (global = global || self, factory((global.ng = global.ng || {}, global.ng.animations = global.ng.animations || {}, global.ng.animations.browser = {}), global.ng.animations, global.ng.core));
11
11
  }(this, (function (exports, animations, core) { 'use strict';
12
12
 
13
- /*! *****************************************************************************
14
- Copyright (c) Microsoft Corporation.
15
-
16
- Permission to use, copy, modify, and/or distribute this software for any
17
- purpose with or without fee is hereby granted.
18
-
19
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
20
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
21
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
22
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
23
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
24
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
25
- PERFORMANCE OF THIS SOFTWARE.
26
- ***************************************************************************** */
27
- /* global Reflect, Promise */
28
- var extendStatics = function (d, b) {
29
- extendStatics = Object.setPrototypeOf ||
30
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
31
- function (d, b) { for (var p in b)
32
- if (b.hasOwnProperty(p))
33
- d[p] = b[p]; };
34
- return extendStatics(d, b);
35
- };
36
- function __extends(d, b) {
37
- extendStatics(d, b);
38
- function __() { this.constructor = d; }
39
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
40
- }
41
- var __assign = function () {
42
- __assign = Object.assign || function __assign(t) {
43
- for (var s, i = 1, n = arguments.length; i < n; i++) {
44
- s = arguments[i];
45
- for (var p in s)
46
- if (Object.prototype.hasOwnProperty.call(s, p))
47
- t[p] = s[p];
48
- }
49
- return t;
50
- };
51
- return __assign.apply(this, arguments);
52
- };
53
- function __rest(s, e) {
54
- var t = {};
55
- for (var p in s)
56
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
57
- t[p] = s[p];
58
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
59
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
60
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
61
- t[p[i]] = s[p[i]];
62
- }
63
- return t;
64
- }
65
- function __decorate(decorators, target, key, desc) {
66
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
67
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
68
- r = Reflect.decorate(decorators, target, key, desc);
69
- else
70
- for (var i = decorators.length - 1; i >= 0; i--)
71
- if (d = decorators[i])
72
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
73
- return c > 3 && r && Object.defineProperty(target, key, r), r;
74
- }
75
- function __param(paramIndex, decorator) {
76
- return function (target, key) { decorator(target, key, paramIndex); };
77
- }
78
- function __metadata(metadataKey, metadataValue) {
79
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
80
- return Reflect.metadata(metadataKey, metadataValue);
81
- }
82
- function __awaiter(thisArg, _arguments, P, generator) {
83
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
84
- return new (P || (P = Promise))(function (resolve, reject) {
85
- function fulfilled(value) { try {
86
- step(generator.next(value));
87
- }
88
- catch (e) {
89
- reject(e);
90
- } }
91
- function rejected(value) { try {
92
- step(generator["throw"](value));
93
- }
94
- catch (e) {
95
- reject(e);
96
- } }
97
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
98
- step((generator = generator.apply(thisArg, _arguments || [])).next());
99
- });
100
- }
101
- function __generator(thisArg, body) {
102
- var _ = { label: 0, sent: function () { if (t[0] & 1)
103
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
104
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
105
- function verb(n) { return function (v) { return step([n, v]); }; }
106
- function step(op) {
107
- if (f)
108
- throw new TypeError("Generator is already executing.");
109
- while (_)
110
- try {
111
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
112
- return t;
113
- if (y = 0, t)
114
- op = [op[0] & 2, t.value];
115
- switch (op[0]) {
116
- case 0:
117
- case 1:
118
- t = op;
119
- break;
120
- case 4:
121
- _.label++;
122
- return { value: op[1], done: false };
123
- case 5:
124
- _.label++;
125
- y = op[1];
126
- op = [0];
127
- continue;
128
- case 7:
129
- op = _.ops.pop();
130
- _.trys.pop();
131
- continue;
132
- default:
133
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
134
- _ = 0;
135
- continue;
136
- }
137
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
138
- _.label = op[1];
139
- break;
140
- }
141
- if (op[0] === 6 && _.label < t[1]) {
142
- _.label = t[1];
143
- t = op;
144
- break;
145
- }
146
- if (t && _.label < t[2]) {
147
- _.label = t[2];
148
- _.ops.push(op);
149
- break;
150
- }
151
- if (t[2])
152
- _.ops.pop();
153
- _.trys.pop();
154
- continue;
155
- }
156
- op = body.call(thisArg, _);
157
- }
158
- catch (e) {
159
- op = [6, e];
160
- y = 0;
161
- }
162
- finally {
163
- f = t = 0;
164
- }
165
- if (op[0] & 5)
166
- throw op[1];
167
- return { value: op[0] ? op[1] : void 0, done: true };
168
- }
169
- }
170
- var __createBinding = Object.create ? (function (o, m, k, k2) {
171
- if (k2 === undefined)
172
- k2 = k;
173
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
174
- }) : (function (o, m, k, k2) {
175
- if (k2 === undefined)
176
- k2 = k;
177
- o[k2] = m[k];
178
- });
179
- function __exportStar(m, exports) {
180
- for (var p in m)
181
- if (p !== "default" && !exports.hasOwnProperty(p))
182
- __createBinding(exports, m, p);
183
- }
184
- function __values(o) {
185
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
186
- if (m)
187
- return m.call(o);
188
- if (o && typeof o.length === "number")
189
- return {
190
- next: function () {
191
- if (o && i >= o.length)
192
- o = void 0;
193
- return { value: o && o[i++], done: !o };
194
- }
195
- };
196
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
197
- }
198
- function __read(o, n) {
199
- var m = typeof Symbol === "function" && o[Symbol.iterator];
200
- if (!m)
201
- return o;
202
- var i = m.call(o), r, ar = [], e;
203
- try {
204
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
205
- ar.push(r.value);
206
- }
207
- catch (error) {
208
- e = { error: error };
209
- }
210
- finally {
211
- try {
212
- if (r && !r.done && (m = i["return"]))
213
- m.call(i);
214
- }
215
- finally {
216
- if (e)
217
- throw e.error;
218
- }
219
- }
220
- return ar;
221
- }
222
- function __spread() {
223
- for (var ar = [], i = 0; i < arguments.length; i++)
224
- ar = ar.concat(__read(arguments[i]));
225
- return ar;
226
- }
227
- function __spreadArrays() {
228
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
229
- s += arguments[i].length;
230
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
231
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
232
- r[k] = a[j];
233
- return r;
234
- }
235
- ;
236
- function __await(v) {
237
- return this instanceof __await ? (this.v = v, this) : new __await(v);
238
- }
239
- function __asyncGenerator(thisArg, _arguments, generator) {
240
- if (!Symbol.asyncIterator)
241
- throw new TypeError("Symbol.asyncIterator is not defined.");
242
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
243
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
244
- function verb(n) { if (g[n])
245
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
246
- function resume(n, v) { try {
247
- step(g[n](v));
248
- }
249
- catch (e) {
250
- settle(q[0][3], e);
251
- } }
252
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
253
- function fulfill(value) { resume("next", value); }
254
- function reject(value) { resume("throw", value); }
255
- function settle(f, v) { if (f(v), q.shift(), q.length)
256
- resume(q[0][0], q[0][1]); }
257
- }
258
- function __asyncDelegator(o) {
259
- var i, p;
260
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
261
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
262
- }
263
- function __asyncValues(o) {
264
- if (!Symbol.asyncIterator)
265
- throw new TypeError("Symbol.asyncIterator is not defined.");
266
- var m = o[Symbol.asyncIterator], i;
267
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
268
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
269
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
270
- }
271
- function __makeTemplateObject(cooked, raw) {
272
- if (Object.defineProperty) {
273
- Object.defineProperty(cooked, "raw", { value: raw });
274
- }
275
- else {
276
- cooked.raw = raw;
277
- }
278
- return cooked;
279
- }
280
- ;
281
- var __setModuleDefault = Object.create ? (function (o, v) {
282
- Object.defineProperty(o, "default", { enumerable: true, value: v });
283
- }) : function (o, v) {
284
- o["default"] = v;
285
- };
286
- function __importStar(mod) {
287
- if (mod && mod.__esModule)
288
- return mod;
289
- var result = {};
290
- if (mod != null)
291
- for (var k in mod)
292
- if (Object.hasOwnProperty.call(mod, k))
293
- __createBinding(result, mod, k);
294
- __setModuleDefault(result, mod);
295
- return result;
296
- }
297
- function __importDefault(mod) {
298
- return (mod && mod.__esModule) ? mod : { default: mod };
299
- }
300
- function __classPrivateFieldGet(receiver, privateMap) {
301
- if (!privateMap.has(receiver)) {
302
- throw new TypeError("attempted to get private field on non-instance");
303
- }
304
- return privateMap.get(receiver);
305
- }
306
- function __classPrivateFieldSet(receiver, privateMap, value) {
307
- if (!privateMap.has(receiver)) {
308
- throw new TypeError("attempted to set private field on non-instance");
309
- }
310
- privateMap.set(receiver, value);
311
- return value;
312
- }
313
-
13
+ /**
14
+ * @license
15
+ * Copyright Google LLC All Rights Reserved.
16
+ *
17
+ * Use of this source code is governed by an MIT-style license that can be
18
+ * found in the LICENSE file at https://angular.io/license
19
+ */
314
20
  function isBrowser() {
315
21
  return (typeof window !== 'undefined' && typeof window.document !== 'undefined');
316
22
  }
@@ -460,7 +166,17 @@
460
166
  _query = function (element, selector, multi) {
461
167
  var results = [];
462
168
  if (multi) {
463
- results.push.apply(results, __spread(element.querySelectorAll(selector)));
169
+ // DO NOT REFACTOR TO USE SPREAD SYNTAX.
170
+ // For element queries that return sufficiently large NodeList objects,
171
+ // using spread syntax to populate the results array causes a RangeError
172
+ // due to the call stack limit being reached. `Array.from` can not be used
173
+ // as well, since NodeList is not iterable in IE 11, see
174
+ // https://developer.mozilla.org/en-US/docs/Web/API/NodeList
175
+ // More info is available in #38551.
176
+ var elems = element.querySelectorAll(selector);
177
+ for (var i = 0; i < elems.length; i++) {
178
+ results.push(elems[i]);
179
+ }
464
180
  }
465
181
  else {
466
182
  var elm = element.querySelector(selector);
@@ -468,410 +184,711 @@
468
184
  results.push(elm);
469
185
  }
470
186
  }
471
- return results;
472
- };
187
+ return results;
188
+ };
189
+ }
190
+ function containsVendorPrefix(prop) {
191
+ // Webkit is the only real popular vendor prefix nowadays
192
+ // cc: http://shouldiprefix.com/
193
+ return prop.substring(1, 6) == 'ebkit'; // webkit or Webkit
194
+ }
195
+ var _CACHED_BODY = null;
196
+ var _IS_WEBKIT = false;
197
+ function validateStyleProperty(prop) {
198
+ if (!_CACHED_BODY) {
199
+ _CACHED_BODY = getBodyNode() || {};
200
+ _IS_WEBKIT = _CACHED_BODY.style ? ('WebkitAppearance' in _CACHED_BODY.style) : false;
201
+ }
202
+ var result = true;
203
+ if (_CACHED_BODY.style && !containsVendorPrefix(prop)) {
204
+ result = prop in _CACHED_BODY.style;
205
+ if (!result && _IS_WEBKIT) {
206
+ var camelProp = 'Webkit' + prop.charAt(0).toUpperCase() + prop.substr(1);
207
+ result = camelProp in _CACHED_BODY.style;
208
+ }
209
+ }
210
+ return result;
211
+ }
212
+ function getBodyNode() {
213
+ if (typeof document != 'undefined') {
214
+ return document.body;
215
+ }
216
+ return null;
217
+ }
218
+ var matchesElement = _matches;
219
+ var containsElement = _contains;
220
+ var invokeQuery = _query;
221
+ function hypenatePropsObject(object) {
222
+ var newObj = {};
223
+ Object.keys(object).forEach(function (prop) {
224
+ var newProp = prop.replace(/([a-z])([A-Z])/g, '$1-$2');
225
+ newObj[newProp] = object[prop];
226
+ });
227
+ return newObj;
228
+ }
229
+
230
+ /**
231
+ * @license
232
+ * Copyright Google LLC All Rights Reserved.
233
+ *
234
+ * Use of this source code is governed by an MIT-style license that can be
235
+ * found in the LICENSE file at https://angular.io/license
236
+ */
237
+ /**
238
+ * @publicApi
239
+ */
240
+ var NoopAnimationDriver = /** @class */ (function () {
241
+ function NoopAnimationDriver() {
242
+ }
243
+ NoopAnimationDriver.prototype.validateStyleProperty = function (prop) {
244
+ return validateStyleProperty(prop);
245
+ };
246
+ NoopAnimationDriver.prototype.matchesElement = function (element, selector) {
247
+ return matchesElement(element, selector);
248
+ };
249
+ NoopAnimationDriver.prototype.containsElement = function (elm1, elm2) {
250
+ return containsElement(elm1, elm2);
251
+ };
252
+ NoopAnimationDriver.prototype.query = function (element, selector, multi) {
253
+ return invokeQuery(element, selector, multi);
254
+ };
255
+ NoopAnimationDriver.prototype.computeStyle = function (element, prop, defaultValue) {
256
+ return defaultValue || '';
257
+ };
258
+ NoopAnimationDriver.prototype.animate = function (element, keyframes, duration, delay, easing, previousPlayers, scrubberAccessRequested) {
259
+ if (previousPlayers === void 0) { previousPlayers = []; }
260
+ return new animations.NoopAnimationPlayer(duration, delay);
261
+ };
262
+ return NoopAnimationDriver;
263
+ }());
264
+ NoopAnimationDriver.decorators = [
265
+ { type: core.Injectable }
266
+ ];
267
+ /**
268
+ * @publicApi
269
+ */
270
+ var AnimationDriver = /** @class */ (function () {
271
+ function AnimationDriver() {
272
+ }
273
+ return AnimationDriver;
274
+ }());
275
+ AnimationDriver.NOOP = new NoopAnimationDriver();
276
+
277
+ /**
278
+ * @license
279
+ * Copyright Google LLC All Rights Reserved.
280
+ *
281
+ * Use of this source code is governed by an MIT-style license that can be
282
+ * found in the LICENSE file at https://angular.io/license
283
+ */
284
+ var ONE_SECOND = 1000;
285
+ var SUBSTITUTION_EXPR_START = '{{';
286
+ var SUBSTITUTION_EXPR_END = '}}';
287
+ var ENTER_CLASSNAME = 'ng-enter';
288
+ var LEAVE_CLASSNAME = 'ng-leave';
289
+ var ENTER_SELECTOR = '.ng-enter';
290
+ var LEAVE_SELECTOR = '.ng-leave';
291
+ var NG_TRIGGER_CLASSNAME = 'ng-trigger';
292
+ var NG_TRIGGER_SELECTOR = '.ng-trigger';
293
+ var NG_ANIMATING_CLASSNAME = 'ng-animating';
294
+ var NG_ANIMATING_SELECTOR = '.ng-animating';
295
+ function resolveTimingValue(value) {
296
+ if (typeof value == 'number')
297
+ return value;
298
+ var matches = value.match(/^(-?[\.\d]+)(m?s)/);
299
+ if (!matches || matches.length < 2)
300
+ return 0;
301
+ return _convertTimeValueToMS(parseFloat(matches[1]), matches[2]);
302
+ }
303
+ function _convertTimeValueToMS(value, unit) {
304
+ switch (unit) {
305
+ case 's':
306
+ return value * ONE_SECOND;
307
+ default: // ms or something else
308
+ return value;
309
+ }
310
+ }
311
+ function resolveTiming(timings, errors, allowNegativeValues) {
312
+ return timings.hasOwnProperty('duration') ?
313
+ timings :
314
+ parseTimeExpression(timings, errors, allowNegativeValues);
315
+ }
316
+ function parseTimeExpression(exp, errors, allowNegativeValues) {
317
+ var regex = /^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i;
318
+ var duration;
319
+ var delay = 0;
320
+ var easing = '';
321
+ if (typeof exp === 'string') {
322
+ var matches = exp.match(regex);
323
+ if (matches === null) {
324
+ errors.push("The provided timing value \"" + exp + "\" is invalid.");
325
+ return { duration: 0, delay: 0, easing: '' };
326
+ }
327
+ duration = _convertTimeValueToMS(parseFloat(matches[1]), matches[2]);
328
+ var delayMatch = matches[3];
329
+ if (delayMatch != null) {
330
+ delay = _convertTimeValueToMS(parseFloat(delayMatch), matches[4]);
331
+ }
332
+ var easingVal = matches[5];
333
+ if (easingVal) {
334
+ easing = easingVal;
335
+ }
336
+ }
337
+ else {
338
+ duration = exp;
339
+ }
340
+ if (!allowNegativeValues) {
341
+ var containsErrors = false;
342
+ var startIndex = errors.length;
343
+ if (duration < 0) {
344
+ errors.push("Duration values below 0 are not allowed for this animation step.");
345
+ containsErrors = true;
346
+ }
347
+ if (delay < 0) {
348
+ errors.push("Delay values below 0 are not allowed for this animation step.");
349
+ containsErrors = true;
350
+ }
351
+ if (containsErrors) {
352
+ errors.splice(startIndex, 0, "The provided timing value \"" + exp + "\" is invalid.");
353
+ }
354
+ }
355
+ return { duration: duration, delay: delay, easing: easing };
356
+ }
357
+ function copyObj(obj, destination) {
358
+ if (destination === void 0) { destination = {}; }
359
+ Object.keys(obj).forEach(function (prop) {
360
+ destination[prop] = obj[prop];
361
+ });
362
+ return destination;
363
+ }
364
+ function normalizeStyles(styles) {
365
+ var normalizedStyles = {};
366
+ if (Array.isArray(styles)) {
367
+ styles.forEach(function (data) { return copyStyles(data, false, normalizedStyles); });
368
+ }
369
+ else {
370
+ copyStyles(styles, false, normalizedStyles);
371
+ }
372
+ return normalizedStyles;
373
+ }
374
+ function copyStyles(styles, readPrototype, destination) {
375
+ if (destination === void 0) { destination = {}; }
376
+ if (readPrototype) {
377
+ // we make use of a for-in loop so that the
378
+ // prototypically inherited properties are
379
+ // revealed from the backFill map
380
+ for (var prop in styles) {
381
+ destination[prop] = styles[prop];
382
+ }
383
+ }
384
+ else {
385
+ copyObj(styles, destination);
386
+ }
387
+ return destination;
388
+ }
389
+ function getStyleAttributeString(element, key, value) {
390
+ // Return the key-value pair string to be added to the style attribute for the
391
+ // given CSS style key.
392
+ if (value) {
393
+ return key + ':' + value + ';';
394
+ }
395
+ else {
396
+ return '';
397
+ }
398
+ }
399
+ function writeStyleAttribute(element) {
400
+ // Read the style property of the element and manually reflect it to the
401
+ // style attribute. This is needed because Domino on platform-server doesn't
402
+ // understand the full set of allowed CSS properties and doesn't reflect some
403
+ // of them automatically.
404
+ var styleAttrValue = '';
405
+ for (var i = 0; i < element.style.length; i++) {
406
+ var key = element.style.item(i);
407
+ styleAttrValue += getStyleAttributeString(element, key, element.style.getPropertyValue(key));
408
+ }
409
+ for (var key in element.style) {
410
+ // Skip internal Domino properties that don't need to be reflected.
411
+ if (!element.style.hasOwnProperty(key) || key.startsWith('_')) {
412
+ continue;
413
+ }
414
+ var dashKey = camelCaseToDashCase(key);
415
+ styleAttrValue += getStyleAttributeString(element, dashKey, element.style[key]);
416
+ }
417
+ element.setAttribute('style', styleAttrValue);
418
+ }
419
+ function setStyles(element, styles, formerStyles) {
420
+ if (element['style']) {
421
+ Object.keys(styles).forEach(function (prop) {
422
+ var camelProp = dashCaseToCamelCase(prop);
423
+ if (formerStyles && !formerStyles.hasOwnProperty(prop)) {
424
+ formerStyles[prop] = element.style[camelProp];
425
+ }
426
+ element.style[camelProp] = styles[prop];
427
+ });
428
+ // On the server set the 'style' attribute since it's not automatically reflected.
429
+ if (isNode()) {
430
+ writeStyleAttribute(element);
431
+ }
432
+ }
433
+ }
434
+ function eraseStyles(element, styles) {
435
+ if (element['style']) {
436
+ Object.keys(styles).forEach(function (prop) {
437
+ var camelProp = dashCaseToCamelCase(prop);
438
+ element.style[camelProp] = '';
439
+ });
440
+ // On the server set the 'style' attribute since it's not automatically reflected.
441
+ if (isNode()) {
442
+ writeStyleAttribute(element);
443
+ }
444
+ }
473
445
  }
474
- function containsVendorPrefix(prop) {
475
- // Webkit is the only real popular vendor prefix nowadays
476
- // cc: http://shouldiprefix.com/
477
- return prop.substring(1, 6) == 'ebkit'; // webkit or Webkit
446
+ function normalizeAnimationEntry(steps) {
447
+ if (Array.isArray(steps)) {
448
+ if (steps.length == 1)
449
+ return steps[0];
450
+ return animations.sequence(steps);
451
+ }
452
+ return steps;
478
453
  }
479
- var _CACHED_BODY = null;
480
- var _IS_WEBKIT = false;
481
- function validateStyleProperty(prop) {
482
- if (!_CACHED_BODY) {
483
- _CACHED_BODY = getBodyNode() || {};
484
- _IS_WEBKIT = _CACHED_BODY.style ? ('WebkitAppearance' in _CACHED_BODY.style) : false;
454
+ function validateStyleParams(value, options, errors) {
455
+ var params = options.params || {};
456
+ var matches = extractStyleParams(value);
457
+ if (matches.length) {
458
+ matches.forEach(function (varName) {
459
+ if (!params.hasOwnProperty(varName)) {
460
+ errors.push("Unable to resolve the local animation param " + varName + " in the given list of values");
461
+ }
462
+ });
485
463
  }
486
- var result = true;
487
- if (_CACHED_BODY.style && !containsVendorPrefix(prop)) {
488
- result = prop in _CACHED_BODY.style;
489
- if (!result && _IS_WEBKIT) {
490
- var camelProp = 'Webkit' + prop.charAt(0).toUpperCase() + prop.substr(1);
491
- result = camelProp in _CACHED_BODY.style;
464
+ }
465
+ var PARAM_REGEX = new RegExp(SUBSTITUTION_EXPR_START + "\\s*(.+?)\\s*" + SUBSTITUTION_EXPR_END, 'g');
466
+ function extractStyleParams(value) {
467
+ var params = [];
468
+ if (typeof value === 'string') {
469
+ var match = void 0;
470
+ while (match = PARAM_REGEX.exec(value)) {
471
+ params.push(match[1]);
492
472
  }
473
+ PARAM_REGEX.lastIndex = 0;
493
474
  }
494
- return result;
475
+ return params;
495
476
  }
496
- function getBodyNode() {
497
- if (typeof document != 'undefined') {
498
- return document.body;
477
+ function interpolateParams(value, params, errors) {
478
+ var original = value.toString();
479
+ var str = original.replace(PARAM_REGEX, function (_, varName) {
480
+ var localVal = params[varName];
481
+ // this means that the value was never overridden by the data passed in by the user
482
+ if (!params.hasOwnProperty(varName)) {
483
+ errors.push("Please provide a value for the animation param " + varName);
484
+ localVal = '';
485
+ }
486
+ return localVal.toString();
487
+ });
488
+ // we do this to assert that numeric values stay as they are
489
+ return str == original ? value : str;
490
+ }
491
+ function iteratorToArray(iterator) {
492
+ var arr = [];
493
+ var item = iterator.next();
494
+ while (!item.done) {
495
+ arr.push(item.value);
496
+ item = iterator.next();
499
497
  }
500
- return null;
498
+ return arr;
501
499
  }
502
- var matchesElement = _matches;
503
- var containsElement = _contains;
504
- var invokeQuery = _query;
505
- function hypenatePropsObject(object) {
506
- var newObj = {};
507
- Object.keys(object).forEach(function (prop) {
508
- var newProp = prop.replace(/([a-z])([A-Z])/g, '$1-$2');
509
- newObj[newProp] = object[prop];
500
+ function mergeAnimationOptions(source, destination) {
501
+ if (source.params) {
502
+ var p0_1 = source.params;
503
+ if (!destination.params) {
504
+ destination.params = {};
505
+ }
506
+ var p1_1 = destination.params;
507
+ Object.keys(p0_1).forEach(function (param) {
508
+ if (!p1_1.hasOwnProperty(param)) {
509
+ p1_1[param] = p0_1[param];
510
+ }
511
+ });
512
+ }
513
+ return destination;
514
+ }
515
+ var DASH_CASE_REGEXP = /-+([a-z0-9])/g;
516
+ function dashCaseToCamelCase(input) {
517
+ return input.replace(DASH_CASE_REGEXP, function () {
518
+ var m = [];
519
+ for (var _i = 0; _i < arguments.length; _i++) {
520
+ m[_i] = arguments[_i];
521
+ }
522
+ return m[1].toUpperCase();
510
523
  });
511
- return newObj;
512
524
  }
513
-
514
- /**
515
- * @license
516
- * Copyright Google LLC All Rights Reserved.
517
- *
518
- * Use of this source code is governed by an MIT-style license that can be
519
- * found in the LICENSE file at https://angular.io/license
520
- */
521
- /**
522
- * @publicApi
523
- */
524
- var NoopAnimationDriver = /** @class */ (function () {
525
- function NoopAnimationDriver() {
526
- }
527
- NoopAnimationDriver.prototype.validateStyleProperty = function (prop) {
528
- return validateStyleProperty(prop);
529
- };
530
- NoopAnimationDriver.prototype.matchesElement = function (element, selector) {
531
- return matchesElement(element, selector);
532
- };
533
- NoopAnimationDriver.prototype.containsElement = function (elm1, elm2) {
534
- return containsElement(elm1, elm2);
535
- };
536
- NoopAnimationDriver.prototype.query = function (element, selector, multi) {
537
- return invokeQuery(element, selector, multi);
538
- };
539
- NoopAnimationDriver.prototype.computeStyle = function (element, prop, defaultValue) {
540
- return defaultValue || '';
541
- };
542
- NoopAnimationDriver.prototype.animate = function (element, keyframes, duration, delay, easing, previousPlayers, scrubberAccessRequested) {
543
- if (previousPlayers === void 0) { previousPlayers = []; }
544
- return new animations.NoopAnimationPlayer(duration, delay);
545
- };
546
- return NoopAnimationDriver;
547
- }());
548
- NoopAnimationDriver.decorators = [
549
- { type: core.Injectable }
550
- ];
551
- /**
552
- * @publicApi
553
- */
554
- var AnimationDriver = /** @class */ (function () {
555
- function AnimationDriver() {
525
+ function camelCaseToDashCase(input) {
526
+ return input.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
527
+ }
528
+ function allowPreviousPlayerStylesMerge(duration, delay) {
529
+ return duration === 0 || delay === 0;
530
+ }
531
+ function balancePreviousStylesIntoKeyframes(element, keyframes, previousStyles) {
532
+ var previousStyleProps = Object.keys(previousStyles);
533
+ if (previousStyleProps.length && keyframes.length) {
534
+ var startingKeyframe_1 = keyframes[0];
535
+ var missingStyleProps_1 = [];
536
+ previousStyleProps.forEach(function (prop) {
537
+ if (!startingKeyframe_1.hasOwnProperty(prop)) {
538
+ missingStyleProps_1.push(prop);
539
+ }
540
+ startingKeyframe_1[prop] = previousStyles[prop];
541
+ });
542
+ if (missingStyleProps_1.length) {
543
+ var _loop_1 = function () {
544
+ var kf = keyframes[i];
545
+ missingStyleProps_1.forEach(function (prop) {
546
+ kf[prop] = computeStyle(element, prop);
547
+ });
548
+ };
549
+ // tslint:disable-next-line
550
+ for (var i = 1; i < keyframes.length; i++) {
551
+ _loop_1();
552
+ }
553
+ }
556
554
  }
557
- return AnimationDriver;
558
- }());
559
- AnimationDriver.NOOP = new NoopAnimationDriver();
560
-
561
- /**
562
- * @license
563
- * Copyright Google LLC All Rights Reserved.
564
- *
565
- * Use of this source code is governed by an MIT-style license that can be
566
- * found in the LICENSE file at https://angular.io/license
567
- */
568
- var ONE_SECOND = 1000;
569
- var SUBSTITUTION_EXPR_START = '{{';
570
- var SUBSTITUTION_EXPR_END = '}}';
571
- var ENTER_CLASSNAME = 'ng-enter';
572
- var LEAVE_CLASSNAME = 'ng-leave';
573
- var ENTER_SELECTOR = '.ng-enter';
574
- var LEAVE_SELECTOR = '.ng-leave';
575
- var NG_TRIGGER_CLASSNAME = 'ng-trigger';
576
- var NG_TRIGGER_SELECTOR = '.ng-trigger';
577
- var NG_ANIMATING_CLASSNAME = 'ng-animating';
578
- var NG_ANIMATING_SELECTOR = '.ng-animating';
579
- function resolveTimingValue(value) {
580
- if (typeof value == 'number')
581
- return value;
582
- var matches = value.match(/^(-?[\.\d]+)(m?s)/);
583
- if (!matches || matches.length < 2)
584
- return 0;
585
- return _convertTimeValueToMS(parseFloat(matches[1]), matches[2]);
555
+ return keyframes;
586
556
  }
587
- function _convertTimeValueToMS(value, unit) {
588
- switch (unit) {
589
- case 's':
590
- return value * ONE_SECOND;
591
- default: // ms or something else
592
- return value;
557
+ function visitDslNode(visitor, node, context) {
558
+ switch (node.type) {
559
+ case 7 /* Trigger */:
560
+ return visitor.visitTrigger(node, context);
561
+ case 0 /* State */:
562
+ return visitor.visitState(node, context);
563
+ case 1 /* Transition */:
564
+ return visitor.visitTransition(node, context);
565
+ case 2 /* Sequence */:
566
+ return visitor.visitSequence(node, context);
567
+ case 3 /* Group */:
568
+ return visitor.visitGroup(node, context);
569
+ case 4 /* Animate */:
570
+ return visitor.visitAnimate(node, context);
571
+ case 5 /* Keyframes */:
572
+ return visitor.visitKeyframes(node, context);
573
+ case 6 /* Style */:
574
+ return visitor.visitStyle(node, context);
575
+ case 8 /* Reference */:
576
+ return visitor.visitReference(node, context);
577
+ case 9 /* AnimateChild */:
578
+ return visitor.visitAnimateChild(node, context);
579
+ case 10 /* AnimateRef */:
580
+ return visitor.visitAnimateRef(node, context);
581
+ case 11 /* Query */:
582
+ return visitor.visitQuery(node, context);
583
+ case 12 /* Stagger */:
584
+ return visitor.visitStagger(node, context);
585
+ default:
586
+ throw new Error("Unable to resolve animation metadata node #" + node.type);
593
587
  }
594
588
  }
595
- function resolveTiming(timings, errors, allowNegativeValues) {
596
- return timings.hasOwnProperty('duration') ?
597
- timings :
598
- parseTimeExpression(timings, errors, allowNegativeValues);
589
+ function computeStyle(element, prop) {
590
+ return window.getComputedStyle(element)[prop];
591
+ }
592
+
593
+ /*! *****************************************************************************
594
+ Copyright (c) Microsoft Corporation.
595
+
596
+ Permission to use, copy, modify, and/or distribute this software for any
597
+ purpose with or without fee is hereby granted.
598
+
599
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
600
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
601
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
602
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
603
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
604
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
605
+ PERFORMANCE OF THIS SOFTWARE.
606
+ ***************************************************************************** */
607
+ /* global Reflect, Promise */
608
+ var extendStatics = function (d, b) {
609
+ extendStatics = Object.setPrototypeOf ||
610
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
611
+ function (d, b) { for (var p in b)
612
+ if (b.hasOwnProperty(p))
613
+ d[p] = b[p]; };
614
+ return extendStatics(d, b);
615
+ };
616
+ function __extends(d, b) {
617
+ extendStatics(d, b);
618
+ function __() { this.constructor = d; }
619
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
599
620
  }
600
- function parseTimeExpression(exp, errors, allowNegativeValues) {
601
- var regex = /^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i;
602
- var duration;
603
- var delay = 0;
604
- var easing = '';
605
- if (typeof exp === 'string') {
606
- var matches = exp.match(regex);
607
- if (matches === null) {
608
- errors.push("The provided timing value \"" + exp + "\" is invalid.");
609
- return { duration: 0, delay: 0, easing: '' };
610
- }
611
- duration = _convertTimeValueToMS(parseFloat(matches[1]), matches[2]);
612
- var delayMatch = matches[3];
613
- if (delayMatch != null) {
614
- delay = _convertTimeValueToMS(parseFloat(delayMatch), matches[4]);
615
- }
616
- var easingVal = matches[5];
617
- if (easingVal) {
618
- easing = easingVal;
621
+ var __assign = function () {
622
+ __assign = Object.assign || function __assign(t) {
623
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
624
+ s = arguments[i];
625
+ for (var p in s)
626
+ if (Object.prototype.hasOwnProperty.call(s, p))
627
+ t[p] = s[p];
619
628
  }
620
- }
621
- else {
622
- duration = exp;
623
- }
624
- if (!allowNegativeValues) {
625
- var containsErrors = false;
626
- var startIndex = errors.length;
627
- if (duration < 0) {
628
- errors.push("Duration values below 0 are not allowed for this animation step.");
629
- containsErrors = true;
629
+ return t;
630
+ };
631
+ return __assign.apply(this, arguments);
632
+ };
633
+ function __rest(s, e) {
634
+ var t = {};
635
+ for (var p in s)
636
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
637
+ t[p] = s[p];
638
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
639
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
640
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
641
+ t[p[i]] = s[p[i]];
630
642
  }
631
- if (delay < 0) {
632
- errors.push("Delay values below 0 are not allowed for this animation step.");
633
- containsErrors = true;
643
+ return t;
644
+ }
645
+ function __decorate(decorators, target, key, desc) {
646
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
647
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
648
+ r = Reflect.decorate(decorators, target, key, desc);
649
+ else
650
+ for (var i = decorators.length - 1; i >= 0; i--)
651
+ if (d = decorators[i])
652
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
653
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
654
+ }
655
+ function __param(paramIndex, decorator) {
656
+ return function (target, key) { decorator(target, key, paramIndex); };
657
+ }
658
+ function __metadata(metadataKey, metadataValue) {
659
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
660
+ return Reflect.metadata(metadataKey, metadataValue);
661
+ }
662
+ function __awaiter(thisArg, _arguments, P, generator) {
663
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
664
+ return new (P || (P = Promise))(function (resolve, reject) {
665
+ function fulfilled(value) { try {
666
+ step(generator.next(value));
634
667
  }
635
- if (containsErrors) {
636
- errors.splice(startIndex, 0, "The provided timing value \"" + exp + "\" is invalid.");
668
+ catch (e) {
669
+ reject(e);
670
+ } }
671
+ function rejected(value) { try {
672
+ step(generator["throw"](value));
637
673
  }
638
- }
639
- return { duration: duration, delay: delay, easing: easing };
640
- }
641
- function copyObj(obj, destination) {
642
- if (destination === void 0) { destination = {}; }
643
- Object.keys(obj).forEach(function (prop) {
644
- destination[prop] = obj[prop];
674
+ catch (e) {
675
+ reject(e);
676
+ } }
677
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
678
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
645
679
  });
646
- return destination;
647
680
  }
648
- function normalizeStyles(styles) {
649
- var normalizedStyles = {};
650
- if (Array.isArray(styles)) {
651
- styles.forEach(function (data) { return copyStyles(data, false, normalizedStyles); });
652
- }
653
- else {
654
- copyStyles(styles, false, normalizedStyles);
681
+ function __generator(thisArg, body) {
682
+ var _ = { label: 0, sent: function () { if (t[0] & 1)
683
+ throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
684
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
685
+ function verb(n) { return function (v) { return step([n, v]); }; }
686
+ function step(op) {
687
+ if (f)
688
+ throw new TypeError("Generator is already executing.");
689
+ while (_)
690
+ try {
691
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
692
+ return t;
693
+ if (y = 0, t)
694
+ op = [op[0] & 2, t.value];
695
+ switch (op[0]) {
696
+ case 0:
697
+ case 1:
698
+ t = op;
699
+ break;
700
+ case 4:
701
+ _.label++;
702
+ return { value: op[1], done: false };
703
+ case 5:
704
+ _.label++;
705
+ y = op[1];
706
+ op = [0];
707
+ continue;
708
+ case 7:
709
+ op = _.ops.pop();
710
+ _.trys.pop();
711
+ continue;
712
+ default:
713
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
714
+ _ = 0;
715
+ continue;
716
+ }
717
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
718
+ _.label = op[1];
719
+ break;
720
+ }
721
+ if (op[0] === 6 && _.label < t[1]) {
722
+ _.label = t[1];
723
+ t = op;
724
+ break;
725
+ }
726
+ if (t && _.label < t[2]) {
727
+ _.label = t[2];
728
+ _.ops.push(op);
729
+ break;
730
+ }
731
+ if (t[2])
732
+ _.ops.pop();
733
+ _.trys.pop();
734
+ continue;
735
+ }
736
+ op = body.call(thisArg, _);
737
+ }
738
+ catch (e) {
739
+ op = [6, e];
740
+ y = 0;
741
+ }
742
+ finally {
743
+ f = t = 0;
744
+ }
745
+ if (op[0] & 5)
746
+ throw op[1];
747
+ return { value: op[0] ? op[1] : void 0, done: true };
655
748
  }
656
- return normalizedStyles;
657
749
  }
658
- function copyStyles(styles, readPrototype, destination) {
659
- if (destination === void 0) { destination = {}; }
660
- if (readPrototype) {
661
- // we make use of a for-in loop so that the
662
- // prototypically inherited properties are
663
- // revealed from the backFill map
664
- for (var prop in styles) {
665
- destination[prop] = styles[prop];
666
- }
667
- }
668
- else {
669
- copyObj(styles, destination);
670
- }
671
- return destination;
750
+ var __createBinding = Object.create ? (function (o, m, k, k2) {
751
+ if (k2 === undefined)
752
+ k2 = k;
753
+ Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
754
+ }) : (function (o, m, k, k2) {
755
+ if (k2 === undefined)
756
+ k2 = k;
757
+ o[k2] = m[k];
758
+ });
759
+ function __exportStar(m, exports) {
760
+ for (var p in m)
761
+ if (p !== "default" && !exports.hasOwnProperty(p))
762
+ __createBinding(exports, m, p);
672
763
  }
673
- function getStyleAttributeString(element, key, value) {
674
- // Return the key-value pair string to be added to the style attribute for the
675
- // given CSS style key.
676
- if (value) {
677
- return key + ':' + value + ';';
678
- }
679
- else {
680
- return '';
681
- }
764
+ function __values(o) {
765
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
766
+ if (m)
767
+ return m.call(o);
768
+ if (o && typeof o.length === "number")
769
+ return {
770
+ next: function () {
771
+ if (o && i >= o.length)
772
+ o = void 0;
773
+ return { value: o && o[i++], done: !o };
774
+ }
775
+ };
776
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
682
777
  }
683
- function writeStyleAttribute(element) {
684
- // Read the style property of the element and manually reflect it to the
685
- // style attribute. This is needed because Domino on platform-server doesn't
686
- // understand the full set of allowed CSS properties and doesn't reflect some
687
- // of them automatically.
688
- var styleAttrValue = '';
689
- for (var i = 0; i < element.style.length; i++) {
690
- var key = element.style.item(i);
691
- styleAttrValue += getStyleAttributeString(element, key, element.style.getPropertyValue(key));
778
+ function __read(o, n) {
779
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
780
+ if (!m)
781
+ return o;
782
+ var i = m.call(o), r, ar = [], e;
783
+ try {
784
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
785
+ ar.push(r.value);
692
786
  }
693
- for (var key in element.style) {
694
- // Skip internal Domino properties that don't need to be reflected.
695
- if (!element.style.hasOwnProperty(key) || key.startsWith('_')) {
696
- continue;
697
- }
698
- var dashKey = camelCaseToDashCase(key);
699
- styleAttrValue += getStyleAttributeString(element, dashKey, element.style[key]);
787
+ catch (error) {
788
+ e = { error: error };
700
789
  }
701
- element.setAttribute('style', styleAttrValue);
702
- }
703
- function setStyles(element, styles, formerStyles) {
704
- if (element['style']) {
705
- Object.keys(styles).forEach(function (prop) {
706
- var camelProp = dashCaseToCamelCase(prop);
707
- if (formerStyles && !formerStyles.hasOwnProperty(prop)) {
708
- formerStyles[prop] = element.style[camelProp];
709
- }
710
- element.style[camelProp] = styles[prop];
711
- });
712
- // On the server set the 'style' attribute since it's not automatically reflected.
713
- if (isNode()) {
714
- writeStyleAttribute(element);
790
+ finally {
791
+ try {
792
+ if (r && !r.done && (m = i["return"]))
793
+ m.call(i);
715
794
  }
716
- }
717
- }
718
- function eraseStyles(element, styles) {
719
- if (element['style']) {
720
- Object.keys(styles).forEach(function (prop) {
721
- var camelProp = dashCaseToCamelCase(prop);
722
- element.style[camelProp] = '';
723
- });
724
- // On the server set the 'style' attribute since it's not automatically reflected.
725
- if (isNode()) {
726
- writeStyleAttribute(element);
795
+ finally {
796
+ if (e)
797
+ throw e.error;
727
798
  }
728
799
  }
800
+ return ar;
729
801
  }
730
- function normalizeAnimationEntry(steps) {
731
- if (Array.isArray(steps)) {
732
- if (steps.length == 1)
733
- return steps[0];
734
- return animations.sequence(steps);
735
- }
736
- return steps;
802
+ function __spread() {
803
+ for (var ar = [], i = 0; i < arguments.length; i++)
804
+ ar = ar.concat(__read(arguments[i]));
805
+ return ar;
737
806
  }
738
- function validateStyleParams(value, options, errors) {
739
- var params = options.params || {};
740
- var matches = extractStyleParams(value);
741
- if (matches.length) {
742
- matches.forEach(function (varName) {
743
- if (!params.hasOwnProperty(varName)) {
744
- errors.push("Unable to resolve the local animation param " + varName + " in the given list of values");
745
- }
746
- });
747
- }
807
+ function __spreadArrays() {
808
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
809
+ s += arguments[i].length;
810
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
811
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
812
+ r[k] = a[j];
813
+ return r;
748
814
  }
749
- var PARAM_REGEX = new RegExp(SUBSTITUTION_EXPR_START + "\\s*(.+?)\\s*" + SUBSTITUTION_EXPR_END, 'g');
750
- function extractStyleParams(value) {
751
- var params = [];
752
- if (typeof value === 'string') {
753
- var match = void 0;
754
- while (match = PARAM_REGEX.exec(value)) {
755
- params.push(match[1]);
756
- }
757
- PARAM_REGEX.lastIndex = 0;
815
+ ;
816
+ function __await(v) {
817
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
818
+ }
819
+ function __asyncGenerator(thisArg, _arguments, generator) {
820
+ if (!Symbol.asyncIterator)
821
+ throw new TypeError("Symbol.asyncIterator is not defined.");
822
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
823
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
824
+ function verb(n) { if (g[n])
825
+ i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
826
+ function resume(n, v) { try {
827
+ step(g[n](v));
758
828
  }
759
- return params;
829
+ catch (e) {
830
+ settle(q[0][3], e);
831
+ } }
832
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
833
+ function fulfill(value) { resume("next", value); }
834
+ function reject(value) { resume("throw", value); }
835
+ function settle(f, v) { if (f(v), q.shift(), q.length)
836
+ resume(q[0][0], q[0][1]); }
760
837
  }
761
- function interpolateParams(value, params, errors) {
762
- var original = value.toString();
763
- var str = original.replace(PARAM_REGEX, function (_, varName) {
764
- var localVal = params[varName];
765
- // this means that the value was never overridden by the data passed in by the user
766
- if (!params.hasOwnProperty(varName)) {
767
- errors.push("Please provide a value for the animation param " + varName);
768
- localVal = '';
769
- }
770
- return localVal.toString();
771
- });
772
- // we do this to assert that numeric values stay as they are
773
- return str == original ? value : str;
838
+ function __asyncDelegator(o) {
839
+ var i, p;
840
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
841
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
774
842
  }
775
- function iteratorToArray(iterator) {
776
- var arr = [];
777
- var item = iterator.next();
778
- while (!item.done) {
779
- arr.push(item.value);
780
- item = iterator.next();
781
- }
782
- return arr;
843
+ function __asyncValues(o) {
844
+ if (!Symbol.asyncIterator)
845
+ throw new TypeError("Symbol.asyncIterator is not defined.");
846
+ var m = o[Symbol.asyncIterator], i;
847
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
848
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
849
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
783
850
  }
784
- function mergeAnimationOptions(source, destination) {
785
- if (source.params) {
786
- var p0_1 = source.params;
787
- if (!destination.params) {
788
- destination.params = {};
789
- }
790
- var p1_1 = destination.params;
791
- Object.keys(p0_1).forEach(function (param) {
792
- if (!p1_1.hasOwnProperty(param)) {
793
- p1_1[param] = p0_1[param];
794
- }
795
- });
851
+ function __makeTemplateObject(cooked, raw) {
852
+ if (Object.defineProperty) {
853
+ Object.defineProperty(cooked, "raw", { value: raw });
796
854
  }
797
- return destination;
798
- }
799
- var DASH_CASE_REGEXP = /-+([a-z0-9])/g;
800
- function dashCaseToCamelCase(input) {
801
- return input.replace(DASH_CASE_REGEXP, function () {
802
- var m = [];
803
- for (var _i = 0; _i < arguments.length; _i++) {
804
- m[_i] = arguments[_i];
805
- }
806
- return m[1].toUpperCase();
807
- });
855
+ else {
856
+ cooked.raw = raw;
857
+ }
858
+ return cooked;
808
859
  }
809
- function camelCaseToDashCase(input) {
810
- return input.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
860
+ ;
861
+ var __setModuleDefault = Object.create ? (function (o, v) {
862
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
863
+ }) : function (o, v) {
864
+ o["default"] = v;
865
+ };
866
+ function __importStar(mod) {
867
+ if (mod && mod.__esModule)
868
+ return mod;
869
+ var result = {};
870
+ if (mod != null)
871
+ for (var k in mod)
872
+ if (Object.hasOwnProperty.call(mod, k))
873
+ __createBinding(result, mod, k);
874
+ __setModuleDefault(result, mod);
875
+ return result;
811
876
  }
812
- function allowPreviousPlayerStylesMerge(duration, delay) {
813
- return duration === 0 || delay === 0;
877
+ function __importDefault(mod) {
878
+ return (mod && mod.__esModule) ? mod : { default: mod };
814
879
  }
815
- function balancePreviousStylesIntoKeyframes(element, keyframes, previousStyles) {
816
- var previousStyleProps = Object.keys(previousStyles);
817
- if (previousStyleProps.length && keyframes.length) {
818
- var startingKeyframe_1 = keyframes[0];
819
- var missingStyleProps_1 = [];
820
- previousStyleProps.forEach(function (prop) {
821
- if (!startingKeyframe_1.hasOwnProperty(prop)) {
822
- missingStyleProps_1.push(prop);
823
- }
824
- startingKeyframe_1[prop] = previousStyles[prop];
825
- });
826
- if (missingStyleProps_1.length) {
827
- var _loop_1 = function () {
828
- var kf = keyframes[i];
829
- missingStyleProps_1.forEach(function (prop) {
830
- kf[prop] = computeStyle(element, prop);
831
- });
832
- };
833
- // tslint:disable-next-line
834
- for (var i = 1; i < keyframes.length; i++) {
835
- _loop_1();
836
- }
837
- }
880
+ function __classPrivateFieldGet(receiver, privateMap) {
881
+ if (!privateMap.has(receiver)) {
882
+ throw new TypeError("attempted to get private field on non-instance");
838
883
  }
839
- return keyframes;
884
+ return privateMap.get(receiver);
840
885
  }
841
- function visitDslNode(visitor, node, context) {
842
- switch (node.type) {
843
- case 7 /* Trigger */:
844
- return visitor.visitTrigger(node, context);
845
- case 0 /* State */:
846
- return visitor.visitState(node, context);
847
- case 1 /* Transition */:
848
- return visitor.visitTransition(node, context);
849
- case 2 /* Sequence */:
850
- return visitor.visitSequence(node, context);
851
- case 3 /* Group */:
852
- return visitor.visitGroup(node, context);
853
- case 4 /* Animate */:
854
- return visitor.visitAnimate(node, context);
855
- case 5 /* Keyframes */:
856
- return visitor.visitKeyframes(node, context);
857
- case 6 /* Style */:
858
- return visitor.visitStyle(node, context);
859
- case 8 /* Reference */:
860
- return visitor.visitReference(node, context);
861
- case 9 /* AnimateChild */:
862
- return visitor.visitAnimateChild(node, context);
863
- case 10 /* AnimateRef */:
864
- return visitor.visitAnimateRef(node, context);
865
- case 11 /* Query */:
866
- return visitor.visitQuery(node, context);
867
- case 12 /* Stagger */:
868
- return visitor.visitStagger(node, context);
869
- default:
870
- throw new Error("Unable to resolve animation metadata node #" + node.type);
886
+ function __classPrivateFieldSet(receiver, privateMap, value) {
887
+ if (!privateMap.has(receiver)) {
888
+ throw new TypeError("attempted to set private field on non-instance");
871
889
  }
872
- }
873
- function computeStyle(element, prop) {
874
- return window.getComputedStyle(element)[prop];
890
+ privateMap.set(receiver, value);
891
+ return value;
875
892
  }
876
893
 
877
894
  /**
@@ -4553,7 +4570,7 @@
4553
4570
  element.style[prop] = value;
4554
4571
  }
4555
4572
  function getAnimationStyle(element, name) {
4556
- return element.style[ANIMATION_PROP + name];
4573
+ return element.style[ANIMATION_PROP + name] || '';
4557
4574
  }
4558
4575
  function countChars(value, char) {
4559
4576
  var count = 0;
@@ -4833,7 +4850,7 @@
4833
4850
  };
4834
4851
  CssKeyframesDriver.prototype._notifyFaultyScrubber = function () {
4835
4852
  if (!this._warningIssued) {
4836
- console.warn('@angular/animations: please load the web-animations.js polyfill to allow programmatic access...\n', ' visit http://bit.ly/IWukam to learn more about using the web-animation-js polyfill.');
4853
+ console.warn('@angular/animations: please load the web-animations.js polyfill to allow programmatic access...\n', ' visit https://bit.ly/IWukam to learn more about using the web-animation-js polyfill.');
4837
4854
  this._warningIssued = true;
4838
4855
  }
4839
4856
  };