@vonage/vivid 3.0.0-next.3 → 3.0.0-next.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/README.md +49 -4
  2. package/accordion/index.js +61 -0
  3. package/accordion-item/index.js +133 -0
  4. package/action-group/index.js +49 -0
  5. package/badge/index.js +27 -22
  6. package/banner/index.js +148 -0
  7. package/breadcrumb/index.js +41 -150
  8. package/breadcrumb-item/index.js +18 -8
  9. package/button/index.js +40 -663
  10. package/calendar/index.js +1550 -0
  11. package/calendar-event/index.js +117 -0
  12. package/card/index.js +134 -0
  13. package/checkbox/index.js +176 -0
  14. package/elevation/index.js +4 -38
  15. package/fab/index.js +101 -0
  16. package/focus/index.js +20 -3
  17. package/header/index.js +68 -0
  18. package/icon/index.js +40 -5
  19. package/index.d.ts +1 -0
  20. package/index.js +50 -14
  21. package/layout/index.js +5 -5
  22. package/lib/accordion/accordion.d.ts +9 -0
  23. package/lib/accordion/accordion.template.d.ts +4 -0
  24. package/lib/accordion/index.d.ts +2 -0
  25. package/lib/accordion-item/accordion-item.d.ts +13 -0
  26. package/lib/accordion-item/accordion-item.template.d.ts +4 -0
  27. package/lib/accordion-item/index.d.ts +4 -0
  28. package/lib/action-group/action-group.d.ts +10 -0
  29. package/lib/action-group/action-group.template.d.ts +4 -0
  30. package/lib/action-group/index.d.ts +2 -0
  31. package/lib/badge/badge.d.ts +8 -8
  32. package/lib/badge/index.d.ts +1 -1
  33. package/lib/banner/banner.d.ts +20 -0
  34. package/lib/banner/banner.template.d.ts +4 -0
  35. package/lib/banner/index.d.ts +3 -0
  36. package/lib/breadcrumb/breadcrumb.template.d.ts +4 -0
  37. package/lib/breadcrumb-item/breadcrumb-item.d.ts +1 -1
  38. package/lib/breadcrumb-item/breadcrumb-item.template.d.ts +0 -1
  39. package/lib/breadcrumb-item/index.d.ts +2 -0
  40. package/lib/button/button.d.ts +9 -8
  41. package/lib/button/index.d.ts +2 -19
  42. package/lib/calendar/calendar.d.ts +13 -0
  43. package/lib/calendar/calendar.template.d.ts +4 -0
  44. package/lib/calendar/helpers/calendar.date-functions.d.ts +2 -0
  45. package/lib/calendar/helpers/calendar.event-context.d.ts +6 -0
  46. package/lib/calendar/helpers/calendar.keyboard-interactions.d.ts +9 -0
  47. package/lib/calendar/index.d.ts +2 -0
  48. package/lib/calendar-event/calendar-event.d.ts +14 -0
  49. package/lib/calendar-event/calendar-event.template.d.ts +4 -0
  50. package/lib/calendar-event/index.d.ts +2 -0
  51. package/lib/card/card.d.ts +10 -0
  52. package/lib/card/card.template.d.ts +4 -0
  53. package/lib/card/index.d.ts +4 -0
  54. package/lib/checkbox/checkbox.d.ts +5 -0
  55. package/lib/checkbox/checkbox.template.d.ts +4 -0
  56. package/lib/checkbox/index.d.ts +4 -0
  57. package/lib/components.d.ts +23 -5
  58. package/lib/elevation/elevation.d.ts +2 -1
  59. package/lib/elevation/index.d.ts +1 -1
  60. package/lib/enums.d.ts +14 -7
  61. package/lib/fab/fab.d.ts +13 -0
  62. package/lib/fab/fab.template.d.ts +4 -0
  63. package/lib/fab/index.d.ts +4 -0
  64. package/lib/focus/index.d.ts +1 -1
  65. package/lib/header/header.d.ts +5 -0
  66. package/lib/header/header.template.d.ts +4 -0
  67. package/lib/header/index.d.ts +3 -0
  68. package/lib/icon/icon.d.ts +4 -5
  69. package/lib/layout/index.d.ts +1 -1
  70. package/lib/layout/layout.d.ts +3 -3
  71. package/lib/note/index.d.ts +2 -0
  72. package/lib/note/note.d.ts +10 -0
  73. package/lib/note/note.template.d.ts +5 -0
  74. package/lib/popup/index.d.ts +4 -0
  75. package/lib/popup/popup.d.ts +17 -0
  76. package/lib/popup/popup.template.d.ts +4 -0
  77. package/lib/progress/index.d.ts +2 -0
  78. package/lib/progress/progress.d.ts +9 -0
  79. package/lib/progress/progress.template.d.ts +5 -0
  80. package/lib/progress-ring/index.d.ts +2 -0
  81. package/lib/progress-ring/progress-ring.d.ts +7 -0
  82. package/lib/progress-ring/progress-ring.template.d.ts +4 -0
  83. package/lib/side-drawer/index.d.ts +2 -0
  84. package/lib/side-drawer/side-drawer.d.ts +7 -0
  85. package/lib/side-drawer/side-drawer.template.d.ts +4 -0
  86. package/lib/sidenav/index.d.ts +2 -0
  87. package/lib/sidenav/sidenav.d.ts +3 -0
  88. package/lib/sidenav/sidenav.template.d.ts +4 -0
  89. package/lib/sidenav-item/index.d.ts +1 -0
  90. package/lib/sidenav-item/sidenav-item.d.ts +4 -5
  91. package/lib/text/index.d.ts +2 -0
  92. package/lib/text/text.d.ts +10 -0
  93. package/lib/text/text.template.d.ts +4 -0
  94. package/lib/text-anchor/text-anchor.d.ts +4 -1
  95. package/lib/text-field/index.d.ts +4 -0
  96. package/lib/text-field/text-field.d.ts +23 -0
  97. package/lib/text-field/text-field.template.d.ts +5 -0
  98. package/lib/tooltip/index.d.ts +3 -0
  99. package/lib/tooltip/tooltip.d.ts +8 -0
  100. package/lib/tooltip/tooltip.template.d.ts +4 -0
  101. package/note/index.js +68 -0
  102. package/package.json +36 -6
  103. package/popup/index.js +2110 -0
  104. package/progress/index.js +107 -0
  105. package/progress-ring/index.js +82 -0
  106. package/shared/_has.js +58 -0
  107. package/shared/affix.js +10 -25
  108. package/shared/anchor.js +10 -3
  109. package/shared/aria-global.js +20 -20
  110. package/shared/base-progress.js +70 -0
  111. package/shared/breadcrumb-item.js +2 -2
  112. package/shared/button.js +195 -0
  113. package/shared/calendar-event.js +26 -0
  114. package/shared/enums.js +79 -0
  115. package/shared/es.object.assign.js +69 -0
  116. package/shared/export.js +972 -0
  117. package/shared/focus.js +5 -0
  118. package/shared/focus2.js +11 -0
  119. package/shared/form-associated.js +547 -0
  120. package/shared/icon.js +1389 -0
  121. package/shared/index.js +4940 -1426
  122. package/shared/index2.js +27 -4901
  123. package/shared/iterators.js +61 -0
  124. package/shared/object-keys.js +13 -0
  125. package/shared/patterns/affix.d.ts +3 -4
  126. package/shared/patterns/focus.d.ts +3 -0
  127. package/shared/patterns/index.d.ts +1 -0
  128. package/shared/slotted.js +119 -0
  129. package/shared/text-anchor.js +12 -0
  130. package/shared/text-anchor.template.js +16 -6
  131. package/shared/to-string.js +51 -0
  132. package/shared/web.dom-collections.iterator.js +46 -1059
  133. package/shared/when.js +15 -0
  134. package/side-drawer/index.js +82 -0
  135. package/sidenav/index.js +17 -0
  136. package/sidenav-item/index.js +24 -61
  137. package/styles/themes/dark.css +16 -4
  138. package/styles/themes/light.css +16 -4
  139. package/text/index.js +48 -0
  140. package/text-anchor/index.js +13 -13
  141. package/text-field/index.js +411 -0
  142. package/tooltip/index.js +70 -0
  143. package/shared/index3.js +0 -21
package/shared/icon.js ADDED
@@ -0,0 +1,1389 @@
1
+ import { c as classofRaw, g as global$8, w as wellKnownSymbol$6, a as getBuiltIn$5, o as objectDefineProperty, d as descriptors, b as objectIsPrototypeOf, f as functionUncurryThis, e as fails$4, i as isCallable$6, h as inspectSource$2, t as tryToString$3, j as anObject$5, k as functionBindNative, l as aCallable$6, m as engineUserAgent, n as documentCreateElement, p as hasOwnProperty_1, q as objectGetOwnPropertyDescriptor, r as isForced_1, s as engineV8Version, _ as _export, u as defineBuiltIn$3, v as functionCall, x as isObject$2, y as internalState, z as getMethod$2, A as lengthOfArrayLike$1, B as requireObjectCoercible$1, C as functionName } from './export.js';
2
+ import { h as html$1, o as objectSetPrototypeOf, s as setToStringTag$1, i as iterators } from './iterators.js';
3
+ import { c as classof$3, t as toString$1 } from './to-string.js';
4
+ import { F as FoundationElement, _ as __decorate, a as attr, b as __metadata, o as observable } from './index.js';
5
+ import { _ as _curry1, a as _curry2, b as _has } from './_has.js';
6
+
7
+ var classof$2 = classofRaw;
8
+ var global$7 = global$8;
9
+
10
+ var engineIsNode = classof$2(global$7.process) == 'process';
11
+
12
+ var getBuiltIn$4 = getBuiltIn$5;
13
+ var definePropertyModule = objectDefineProperty;
14
+ var wellKnownSymbol$5 = wellKnownSymbol$6;
15
+ var DESCRIPTORS = descriptors;
16
+
17
+ var SPECIES$2 = wellKnownSymbol$5('species');
18
+
19
+ var setSpecies$1 = function (CONSTRUCTOR_NAME) {
20
+ var Constructor = getBuiltIn$4(CONSTRUCTOR_NAME);
21
+ var defineProperty = definePropertyModule.f;
22
+
23
+ if (DESCRIPTORS && Constructor && !Constructor[SPECIES$2]) {
24
+ defineProperty(Constructor, SPECIES$2, {
25
+ configurable: true,
26
+ get: function () { return this; }
27
+ });
28
+ }
29
+ };
30
+
31
+ var isPrototypeOf$1 = objectIsPrototypeOf;
32
+
33
+ var $TypeError$4 = TypeError;
34
+
35
+ var anInstance$1 = function (it, Prototype) {
36
+ if (isPrototypeOf$1(Prototype, it)) return it;
37
+ throw $TypeError$4('Incorrect invocation');
38
+ };
39
+
40
+ var uncurryThis$3 = functionUncurryThis;
41
+ var fails$3 = fails$4;
42
+ var isCallable$5 = isCallable$6;
43
+ var classof$1 = classof$3;
44
+ var getBuiltIn$3 = getBuiltIn$5;
45
+ var inspectSource$1 = inspectSource$2;
46
+
47
+ var noop = function () { /* empty */ };
48
+ var empty = [];
49
+ var construct = getBuiltIn$3('Reflect', 'construct');
50
+ var constructorRegExp = /^\s*(?:class|function)\b/;
51
+ var exec = uncurryThis$3(constructorRegExp.exec);
52
+ var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
53
+
54
+ var isConstructorModern = function isConstructor(argument) {
55
+ if (!isCallable$5(argument)) return false;
56
+ try {
57
+ construct(noop, empty, argument);
58
+ return true;
59
+ } catch (error) {
60
+ return false;
61
+ }
62
+ };
63
+
64
+ var isConstructorLegacy = function isConstructor(argument) {
65
+ if (!isCallable$5(argument)) return false;
66
+ switch (classof$1(argument)) {
67
+ case 'AsyncFunction':
68
+ case 'GeneratorFunction':
69
+ case 'AsyncGeneratorFunction': return false;
70
+ }
71
+ try {
72
+ // we can't check .prototype since constructors produced by .bind haven't it
73
+ // `Function#toString` throws on some built-it function in some legacy engines
74
+ // (for example, `DOMQuad` and similar in FF41-)
75
+ return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource$1(argument));
76
+ } catch (error) {
77
+ return true;
78
+ }
79
+ };
80
+
81
+ isConstructorLegacy.sham = true;
82
+
83
+ // `IsConstructor` abstract operation
84
+ // https://tc39.es/ecma262/#sec-isconstructor
85
+ var isConstructor$1 = !construct || fails$3(function () {
86
+ var called;
87
+ return isConstructorModern(isConstructorModern.call)
88
+ || !isConstructorModern(Object)
89
+ || !isConstructorModern(function () { called = true; })
90
+ || called;
91
+ }) ? isConstructorLegacy : isConstructorModern;
92
+
93
+ var isConstructor = isConstructor$1;
94
+ var tryToString$2 = tryToString$3;
95
+
96
+ var $TypeError$3 = TypeError;
97
+
98
+ // `Assert: IsConstructor(argument) is true`
99
+ var aConstructor$1 = function (argument) {
100
+ if (isConstructor(argument)) return argument;
101
+ throw $TypeError$3(tryToString$2(argument) + ' is not a constructor');
102
+ };
103
+
104
+ var anObject$4 = anObject$5;
105
+ var aConstructor = aConstructor$1;
106
+ var wellKnownSymbol$4 = wellKnownSymbol$6;
107
+
108
+ var SPECIES$1 = wellKnownSymbol$4('species');
109
+
110
+ // `SpeciesConstructor` abstract operation
111
+ // https://tc39.es/ecma262/#sec-speciesconstructor
112
+ var speciesConstructor$2 = function (O, defaultConstructor) {
113
+ var C = anObject$4(O).constructor;
114
+ var S;
115
+ return C === undefined || (S = anObject$4(C)[SPECIES$1]) == undefined ? defaultConstructor : aConstructor(S);
116
+ };
117
+
118
+ var NATIVE_BIND$1 = functionBindNative;
119
+
120
+ var FunctionPrototype = Function.prototype;
121
+ var apply$1 = FunctionPrototype.apply;
122
+ var call$7 = FunctionPrototype.call;
123
+
124
+ // eslint-disable-next-line es-x/no-reflect -- safe
125
+ var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$1 ? call$7.bind(apply$1) : function () {
126
+ return call$7.apply(apply$1, arguments);
127
+ });
128
+
129
+ var uncurryThis$2 = functionUncurryThis;
130
+ var aCallable$5 = aCallable$6;
131
+ var NATIVE_BIND = functionBindNative;
132
+
133
+ var bind$4 = uncurryThis$2(uncurryThis$2.bind);
134
+
135
+ // optional / simple context binding
136
+ var functionBindContext = function (fn, that) {
137
+ aCallable$5(fn);
138
+ return that === undefined ? fn : NATIVE_BIND ? bind$4(fn, that) : function (/* ...args */) {
139
+ return fn.apply(that, arguments);
140
+ };
141
+ };
142
+
143
+ var uncurryThis$1 = functionUncurryThis;
144
+
145
+ var arraySlice$1 = uncurryThis$1([].slice);
146
+
147
+ var $TypeError$2 = TypeError;
148
+
149
+ var validateArgumentsLength$1 = function (passed, required) {
150
+ if (passed < required) throw $TypeError$2('Not enough arguments');
151
+ return passed;
152
+ };
153
+
154
+ var userAgent$2 = engineUserAgent;
155
+
156
+ var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$2);
157
+
158
+ var global$6 = global$8;
159
+ var apply = functionApply;
160
+ var bind$3 = functionBindContext;
161
+ var isCallable$4 = isCallable$6;
162
+ var hasOwn = hasOwnProperty_1;
163
+ var fails$2 = fails$4;
164
+ var html = html$1;
165
+ var arraySlice = arraySlice$1;
166
+ var createElement = documentCreateElement;
167
+ var validateArgumentsLength = validateArgumentsLength$1;
168
+ var IS_IOS$1 = engineIsIos;
169
+ var IS_NODE$2 = engineIsNode;
170
+
171
+ var set = global$6.setImmediate;
172
+ var clear = global$6.clearImmediate;
173
+ var process$2 = global$6.process;
174
+ var Dispatch = global$6.Dispatch;
175
+ var Function$1 = global$6.Function;
176
+ var MessageChannel = global$6.MessageChannel;
177
+ var String$1 = global$6.String;
178
+ var counter = 0;
179
+ var queue$1 = {};
180
+ var ONREADYSTATECHANGE = 'onreadystatechange';
181
+ var location, defer, channel, port;
182
+
183
+ try {
184
+ // Deno throws a ReferenceError on `location` access without `--location` flag
185
+ location = global$6.location;
186
+ } catch (error) { /* empty */ }
187
+
188
+ var run = function (id) {
189
+ if (hasOwn(queue$1, id)) {
190
+ var fn = queue$1[id];
191
+ delete queue$1[id];
192
+ fn();
193
+ }
194
+ };
195
+
196
+ var runner = function (id) {
197
+ return function () {
198
+ run(id);
199
+ };
200
+ };
201
+
202
+ var listener = function (event) {
203
+ run(event.data);
204
+ };
205
+
206
+ var post = function (id) {
207
+ // old engines have not location.origin
208
+ global$6.postMessage(String$1(id), location.protocol + '//' + location.host);
209
+ };
210
+
211
+ // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
212
+ if (!set || !clear) {
213
+ set = function setImmediate(handler) {
214
+ validateArgumentsLength(arguments.length, 1);
215
+ var fn = isCallable$4(handler) ? handler : Function$1(handler);
216
+ var args = arraySlice(arguments, 1);
217
+ queue$1[++counter] = function () {
218
+ apply(fn, undefined, args);
219
+ };
220
+ defer(counter);
221
+ return counter;
222
+ };
223
+ clear = function clearImmediate(id) {
224
+ delete queue$1[id];
225
+ };
226
+ // Node.js 0.8-
227
+ if (IS_NODE$2) {
228
+ defer = function (id) {
229
+ process$2.nextTick(runner(id));
230
+ };
231
+ // Sphere (JS game engine) Dispatch API
232
+ } else if (Dispatch && Dispatch.now) {
233
+ defer = function (id) {
234
+ Dispatch.now(runner(id));
235
+ };
236
+ // Browsers with MessageChannel, includes WebWorkers
237
+ // except iOS - https://github.com/zloirock/core-js/issues/624
238
+ } else if (MessageChannel && !IS_IOS$1) {
239
+ channel = new MessageChannel();
240
+ port = channel.port2;
241
+ channel.port1.onmessage = listener;
242
+ defer = bind$3(port.postMessage, port);
243
+ // Browsers with postMessage, skip WebWorkers
244
+ // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
245
+ } else if (
246
+ global$6.addEventListener &&
247
+ isCallable$4(global$6.postMessage) &&
248
+ !global$6.importScripts &&
249
+ location && location.protocol !== 'file:' &&
250
+ !fails$2(post)
251
+ ) {
252
+ defer = post;
253
+ global$6.addEventListener('message', listener, false);
254
+ // IE8-
255
+ } else if (ONREADYSTATECHANGE in createElement('script')) {
256
+ defer = function (id) {
257
+ html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
258
+ html.removeChild(this);
259
+ run(id);
260
+ };
261
+ };
262
+ // Rest old browsers
263
+ } else {
264
+ defer = function (id) {
265
+ setTimeout(runner(id), 0);
266
+ };
267
+ }
268
+ }
269
+
270
+ var task$1 = {
271
+ set: set,
272
+ clear: clear
273
+ };
274
+
275
+ var userAgent$1 = engineUserAgent;
276
+ var global$5 = global$8;
277
+
278
+ var engineIsIosPebble = /ipad|iphone|ipod/i.test(userAgent$1) && global$5.Pebble !== undefined;
279
+
280
+ var userAgent = engineUserAgent;
281
+
282
+ var engineIsWebosWebkit = /web0s(?!.*chrome)/i.test(userAgent);
283
+
284
+ var global$4 = global$8;
285
+ var bind$2 = functionBindContext;
286
+ var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
287
+ var macrotask = task$1.set;
288
+ var IS_IOS = engineIsIos;
289
+ var IS_IOS_PEBBLE = engineIsIosPebble;
290
+ var IS_WEBOS_WEBKIT = engineIsWebosWebkit;
291
+ var IS_NODE$1 = engineIsNode;
292
+
293
+ var MutationObserver = global$4.MutationObserver || global$4.WebKitMutationObserver;
294
+ var document$1 = global$4.document;
295
+ var process$1 = global$4.process;
296
+ var Promise$1 = global$4.Promise;
297
+ // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
298
+ var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global$4, 'queueMicrotask');
299
+ var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
300
+
301
+ var flush, head, last, notify$1, toggle, node, promise, then;
302
+
303
+ // modern engines have queueMicrotask method
304
+ if (!queueMicrotask) {
305
+ flush = function () {
306
+ var parent, fn;
307
+ if (IS_NODE$1 && (parent = process$1.domain)) parent.exit();
308
+ while (head) {
309
+ fn = head.fn;
310
+ head = head.next;
311
+ try {
312
+ fn();
313
+ } catch (error) {
314
+ if (head) notify$1();
315
+ else last = undefined;
316
+ throw error;
317
+ }
318
+ } last = undefined;
319
+ if (parent) parent.enter();
320
+ };
321
+
322
+ // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
323
+ // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
324
+ if (!IS_IOS && !IS_NODE$1 && !IS_WEBOS_WEBKIT && MutationObserver && document$1) {
325
+ toggle = true;
326
+ node = document$1.createTextNode('');
327
+ new MutationObserver(flush).observe(node, { characterData: true });
328
+ notify$1 = function () {
329
+ node.data = toggle = !toggle;
330
+ };
331
+ // environments with maybe non-completely correct, but existent Promise
332
+ } else if (!IS_IOS_PEBBLE && Promise$1 && Promise$1.resolve) {
333
+ // Promise.resolve without an argument throws an error in LG WebOS 2
334
+ promise = Promise$1.resolve(undefined);
335
+ // workaround of WebKit ~ iOS Safari 10.1 bug
336
+ promise.constructor = Promise$1;
337
+ then = bind$2(promise.then, promise);
338
+ notify$1 = function () {
339
+ then(flush);
340
+ };
341
+ // Node.js without promises
342
+ } else if (IS_NODE$1) {
343
+ notify$1 = function () {
344
+ process$1.nextTick(flush);
345
+ };
346
+ // for other environments - macrotask based on:
347
+ // - setImmediate
348
+ // - MessageChannel
349
+ // - window.postMessage
350
+ // - onreadystatechange
351
+ // - setTimeout
352
+ } else {
353
+ // strange IE + webpack dev server bug - use .bind(global)
354
+ macrotask = bind$2(macrotask, global$4);
355
+ notify$1 = function () {
356
+ macrotask(flush);
357
+ };
358
+ }
359
+ }
360
+
361
+ var microtask$1 = queueMicrotask || function (fn) {
362
+ var task = { fn: fn, next: undefined };
363
+ if (last) last.next = task;
364
+ if (!head) {
365
+ head = task;
366
+ notify$1();
367
+ } last = task;
368
+ };
369
+
370
+ var global$3 = global$8;
371
+
372
+ var hostReportErrors$1 = function (a, b) {
373
+ var console = global$3.console;
374
+ if (console && console.error) {
375
+ arguments.length == 1 ? console.error(a) : console.error(a, b);
376
+ }
377
+ };
378
+
379
+ var perform$3 = function (exec) {
380
+ try {
381
+ return { error: false, value: exec() };
382
+ } catch (error) {
383
+ return { error: true, value: error };
384
+ }
385
+ };
386
+
387
+ var Queue$1 = function () {
388
+ this.head = null;
389
+ this.tail = null;
390
+ };
391
+
392
+ Queue$1.prototype = {
393
+ add: function (item) {
394
+ var entry = { item: item, next: null };
395
+ if (this.head) this.tail.next = entry;
396
+ else this.head = entry;
397
+ this.tail = entry;
398
+ },
399
+ get: function () {
400
+ var entry = this.head;
401
+ if (entry) {
402
+ this.head = entry.next;
403
+ if (this.tail === entry) this.tail = null;
404
+ return entry.item;
405
+ }
406
+ }
407
+ };
408
+
409
+ var queue = Queue$1;
410
+
411
+ var global$2 = global$8;
412
+
413
+ var promiseNativeConstructor = global$2.Promise;
414
+
415
+ var engineIsBrowser = typeof window == 'object' && typeof Deno != 'object';
416
+
417
+ var global$1 = global$8;
418
+ var NativePromiseConstructor$4 = promiseNativeConstructor;
419
+ var isCallable$3 = isCallable$6;
420
+ var isForced = isForced_1;
421
+ var inspectSource = inspectSource$2;
422
+ var wellKnownSymbol$3 = wellKnownSymbol$6;
423
+ var IS_BROWSER = engineIsBrowser;
424
+ var V8_VERSION = engineV8Version;
425
+
426
+ NativePromiseConstructor$4 && NativePromiseConstructor$4.prototype;
427
+ var SPECIES = wellKnownSymbol$3('species');
428
+ var SUBCLASSING = false;
429
+ var NATIVE_PROMISE_REJECTION_EVENT$1 = isCallable$3(global$1.PromiseRejectionEvent);
430
+
431
+ var FORCED_PROMISE_CONSTRUCTOR$5 = isForced('Promise', function () {
432
+ var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor$4);
433
+ var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor$4);
434
+ // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
435
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
436
+ // We can't detect it synchronously, so just check versions
437
+ if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
438
+ // We can't use @@species feature detection in V8 since it causes
439
+ // deoptimization and performance degradation
440
+ // https://github.com/zloirock/core-js/issues/679
441
+ if (V8_VERSION >= 51 && /native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) return false;
442
+ // Detect correctness of subclassing with @@species support
443
+ var promise = new NativePromiseConstructor$4(function (resolve) { resolve(1); });
444
+ var FakePromise = function (exec) {
445
+ exec(function () { /* empty */ }, function () { /* empty */ });
446
+ };
447
+ var constructor = promise.constructor = {};
448
+ constructor[SPECIES] = FakePromise;
449
+ SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
450
+ if (!SUBCLASSING) return true;
451
+ // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
452
+ return !GLOBAL_CORE_JS_PROMISE && IS_BROWSER && !NATIVE_PROMISE_REJECTION_EVENT$1;
453
+ });
454
+
455
+ var promiseConstructorDetection = {
456
+ CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR$5,
457
+ REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT$1,
458
+ SUBCLASSING: SUBCLASSING
459
+ };
460
+
461
+ var newPromiseCapability$2 = {};
462
+
463
+ var aCallable$4 = aCallable$6;
464
+
465
+ var PromiseCapability = function (C) {
466
+ var resolve, reject;
467
+ this.promise = new C(function ($$resolve, $$reject) {
468
+ if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
469
+ resolve = $$resolve;
470
+ reject = $$reject;
471
+ });
472
+ this.resolve = aCallable$4(resolve);
473
+ this.reject = aCallable$4(reject);
474
+ };
475
+
476
+ // `NewPromiseCapability` abstract operation
477
+ // https://tc39.es/ecma262/#sec-newpromisecapability
478
+ newPromiseCapability$2.f = function (C) {
479
+ return new PromiseCapability(C);
480
+ };
481
+
482
+ var $$7 = _export;
483
+ var IS_NODE = engineIsNode;
484
+ var global = global$8;
485
+ var call$6 = functionCall;
486
+ var defineBuiltIn$2 = defineBuiltIn$3;
487
+ var setPrototypeOf = objectSetPrototypeOf;
488
+ var setToStringTag = setToStringTag$1;
489
+ var setSpecies = setSpecies$1;
490
+ var aCallable$3 = aCallable$6;
491
+ var isCallable$2 = isCallable$6;
492
+ var isObject$1 = isObject$2;
493
+ var anInstance = anInstance$1;
494
+ var speciesConstructor$1 = speciesConstructor$2;
495
+ var task = task$1.set;
496
+ var microtask = microtask$1;
497
+ var hostReportErrors = hostReportErrors$1;
498
+ var perform$2 = perform$3;
499
+ var Queue = queue;
500
+ var InternalStateModule = internalState;
501
+ var NativePromiseConstructor$3 = promiseNativeConstructor;
502
+ var PromiseConstructorDetection = promiseConstructorDetection;
503
+ var newPromiseCapabilityModule$3 = newPromiseCapability$2;
504
+
505
+ var PROMISE = 'Promise';
506
+ var FORCED_PROMISE_CONSTRUCTOR$4 = PromiseConstructorDetection.CONSTRUCTOR;
507
+ var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;
508
+ var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;
509
+ var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
510
+ var setInternalState = InternalStateModule.set;
511
+ var NativePromisePrototype$2 = NativePromiseConstructor$3 && NativePromiseConstructor$3.prototype;
512
+ var PromiseConstructor = NativePromiseConstructor$3;
513
+ var PromisePrototype = NativePromisePrototype$2;
514
+ var TypeError$1 = global.TypeError;
515
+ var document = global.document;
516
+ var process = global.process;
517
+ var newPromiseCapability$1 = newPromiseCapabilityModule$3.f;
518
+ var newGenericPromiseCapability = newPromiseCapability$1;
519
+
520
+ var DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent);
521
+ var UNHANDLED_REJECTION = 'unhandledrejection';
522
+ var REJECTION_HANDLED = 'rejectionhandled';
523
+ var PENDING = 0;
524
+ var FULFILLED = 1;
525
+ var REJECTED = 2;
526
+ var HANDLED = 1;
527
+ var UNHANDLED = 2;
528
+
529
+ var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
530
+
531
+ // helpers
532
+ var isThenable = function (it) {
533
+ var then;
534
+ return isObject$1(it) && isCallable$2(then = it.then) ? then : false;
535
+ };
536
+
537
+ var callReaction = function (reaction, state) {
538
+ var value = state.value;
539
+ var ok = state.state == FULFILLED;
540
+ var handler = ok ? reaction.ok : reaction.fail;
541
+ var resolve = reaction.resolve;
542
+ var reject = reaction.reject;
543
+ var domain = reaction.domain;
544
+ var result, then, exited;
545
+ try {
546
+ if (handler) {
547
+ if (!ok) {
548
+ if (state.rejection === UNHANDLED) onHandleUnhandled(state);
549
+ state.rejection = HANDLED;
550
+ }
551
+ if (handler === true) result = value;
552
+ else {
553
+ if (domain) domain.enter();
554
+ result = handler(value); // can throw
555
+ if (domain) {
556
+ domain.exit();
557
+ exited = true;
558
+ }
559
+ }
560
+ if (result === reaction.promise) {
561
+ reject(TypeError$1('Promise-chain cycle'));
562
+ } else if (then = isThenable(result)) {
563
+ call$6(then, result, resolve, reject);
564
+ } else resolve(result);
565
+ } else reject(value);
566
+ } catch (error) {
567
+ if (domain && !exited) domain.exit();
568
+ reject(error);
569
+ }
570
+ };
571
+
572
+ var notify = function (state, isReject) {
573
+ if (state.notified) return;
574
+ state.notified = true;
575
+ microtask(function () {
576
+ var reactions = state.reactions;
577
+ var reaction;
578
+ while (reaction = reactions.get()) {
579
+ callReaction(reaction, state);
580
+ }
581
+ state.notified = false;
582
+ if (isReject && !state.rejection) onUnhandled(state);
583
+ });
584
+ };
585
+
586
+ var dispatchEvent = function (name, promise, reason) {
587
+ var event, handler;
588
+ if (DISPATCH_EVENT) {
589
+ event = document.createEvent('Event');
590
+ event.promise = promise;
591
+ event.reason = reason;
592
+ event.initEvent(name, false, true);
593
+ global.dispatchEvent(event);
594
+ } else event = { promise: promise, reason: reason };
595
+ if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global['on' + name])) handler(event);
596
+ else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
597
+ };
598
+
599
+ var onUnhandled = function (state) {
600
+ call$6(task, global, function () {
601
+ var promise = state.facade;
602
+ var value = state.value;
603
+ var IS_UNHANDLED = isUnhandled(state);
604
+ var result;
605
+ if (IS_UNHANDLED) {
606
+ result = perform$2(function () {
607
+ if (IS_NODE) {
608
+ process.emit('unhandledRejection', value, promise);
609
+ } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
610
+ });
611
+ // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
612
+ state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
613
+ if (result.error) throw result.value;
614
+ }
615
+ });
616
+ };
617
+
618
+ var isUnhandled = function (state) {
619
+ return state.rejection !== HANDLED && !state.parent;
620
+ };
621
+
622
+ var onHandleUnhandled = function (state) {
623
+ call$6(task, global, function () {
624
+ var promise = state.facade;
625
+ if (IS_NODE) {
626
+ process.emit('rejectionHandled', promise);
627
+ } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
628
+ });
629
+ };
630
+
631
+ var bind$1 = function (fn, state, unwrap) {
632
+ return function (value) {
633
+ fn(state, value, unwrap);
634
+ };
635
+ };
636
+
637
+ var internalReject = function (state, value, unwrap) {
638
+ if (state.done) return;
639
+ state.done = true;
640
+ if (unwrap) state = unwrap;
641
+ state.value = value;
642
+ state.state = REJECTED;
643
+ notify(state, true);
644
+ };
645
+
646
+ var internalResolve = function (state, value, unwrap) {
647
+ if (state.done) return;
648
+ state.done = true;
649
+ if (unwrap) state = unwrap;
650
+ try {
651
+ if (state.facade === value) throw TypeError$1("Promise can't be resolved itself");
652
+ var then = isThenable(value);
653
+ if (then) {
654
+ microtask(function () {
655
+ var wrapper = { done: false };
656
+ try {
657
+ call$6(then, value,
658
+ bind$1(internalResolve, wrapper, state),
659
+ bind$1(internalReject, wrapper, state)
660
+ );
661
+ } catch (error) {
662
+ internalReject(wrapper, error, state);
663
+ }
664
+ });
665
+ } else {
666
+ state.value = value;
667
+ state.state = FULFILLED;
668
+ notify(state, false);
669
+ }
670
+ } catch (error) {
671
+ internalReject({ done: false }, error, state);
672
+ }
673
+ };
674
+
675
+ // constructor polyfill
676
+ if (FORCED_PROMISE_CONSTRUCTOR$4) {
677
+ // 25.4.3.1 Promise(executor)
678
+ PromiseConstructor = function Promise(executor) {
679
+ anInstance(this, PromisePrototype);
680
+ aCallable$3(executor);
681
+ call$6(Internal, this);
682
+ var state = getInternalPromiseState(this);
683
+ try {
684
+ executor(bind$1(internalResolve, state), bind$1(internalReject, state));
685
+ } catch (error) {
686
+ internalReject(state, error);
687
+ }
688
+ };
689
+
690
+ PromisePrototype = PromiseConstructor.prototype;
691
+
692
+ // eslint-disable-next-line no-unused-vars -- required for `.length`
693
+ Internal = function Promise(executor) {
694
+ setInternalState(this, {
695
+ type: PROMISE,
696
+ done: false,
697
+ notified: false,
698
+ parent: false,
699
+ reactions: new Queue(),
700
+ rejection: false,
701
+ state: PENDING,
702
+ value: undefined
703
+ });
704
+ };
705
+
706
+ // `Promise.prototype.then` method
707
+ // https://tc39.es/ecma262/#sec-promise.prototype.then
708
+ Internal.prototype = defineBuiltIn$2(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
709
+ var state = getInternalPromiseState(this);
710
+ var reaction = newPromiseCapability$1(speciesConstructor$1(this, PromiseConstructor));
711
+ state.parent = true;
712
+ reaction.ok = isCallable$2(onFulfilled) ? onFulfilled : true;
713
+ reaction.fail = isCallable$2(onRejected) && onRejected;
714
+ reaction.domain = IS_NODE ? process.domain : undefined;
715
+ if (state.state == PENDING) state.reactions.add(reaction);
716
+ else microtask(function () {
717
+ callReaction(reaction, state);
718
+ });
719
+ return reaction.promise;
720
+ });
721
+
722
+ OwnPromiseCapability = function () {
723
+ var promise = new Internal();
724
+ var state = getInternalPromiseState(promise);
725
+ this.promise = promise;
726
+ this.resolve = bind$1(internalResolve, state);
727
+ this.reject = bind$1(internalReject, state);
728
+ };
729
+
730
+ newPromiseCapabilityModule$3.f = newPromiseCapability$1 = function (C) {
731
+ return C === PromiseConstructor || C === PromiseWrapper
732
+ ? new OwnPromiseCapability(C)
733
+ : newGenericPromiseCapability(C);
734
+ };
735
+
736
+ if (isCallable$2(NativePromiseConstructor$3) && NativePromisePrototype$2 !== Object.prototype) {
737
+ nativeThen = NativePromisePrototype$2.then;
738
+
739
+ if (!NATIVE_PROMISE_SUBCLASSING) {
740
+ // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
741
+ defineBuiltIn$2(NativePromisePrototype$2, 'then', function then(onFulfilled, onRejected) {
742
+ var that = this;
743
+ return new PromiseConstructor(function (resolve, reject) {
744
+ call$6(nativeThen, that, resolve, reject);
745
+ }).then(onFulfilled, onRejected);
746
+ // https://github.com/zloirock/core-js/issues/640
747
+ }, { unsafe: true });
748
+ }
749
+
750
+ // make `.constructor === Promise` work for native promise-based APIs
751
+ try {
752
+ delete NativePromisePrototype$2.constructor;
753
+ } catch (error) { /* empty */ }
754
+
755
+ // make `instanceof Promise` work for native promise-based APIs
756
+ if (setPrototypeOf) {
757
+ setPrototypeOf(NativePromisePrototype$2, PromisePrototype);
758
+ }
759
+ }
760
+ }
761
+
762
+ $$7({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR$4 }, {
763
+ Promise: PromiseConstructor
764
+ });
765
+
766
+ setToStringTag(PromiseConstructor, PROMISE, false);
767
+ setSpecies(PROMISE);
768
+
769
+ var wellKnownSymbol$2 = wellKnownSymbol$6;
770
+ var Iterators$1 = iterators;
771
+
772
+ var ITERATOR$2 = wellKnownSymbol$2('iterator');
773
+ var ArrayPrototype = Array.prototype;
774
+
775
+ // check on default Array iterator
776
+ var isArrayIteratorMethod$1 = function (it) {
777
+ return it !== undefined && (Iterators$1.Array === it || ArrayPrototype[ITERATOR$2] === it);
778
+ };
779
+
780
+ var classof = classof$3;
781
+ var getMethod$1 = getMethod$2;
782
+ var Iterators = iterators;
783
+ var wellKnownSymbol$1 = wellKnownSymbol$6;
784
+
785
+ var ITERATOR$1 = wellKnownSymbol$1('iterator');
786
+
787
+ var getIteratorMethod$2 = function (it) {
788
+ if (it != undefined) return getMethod$1(it, ITERATOR$1)
789
+ || getMethod$1(it, '@@iterator')
790
+ || Iterators[classof(it)];
791
+ };
792
+
793
+ var call$5 = functionCall;
794
+ var aCallable$2 = aCallable$6;
795
+ var anObject$3 = anObject$5;
796
+ var tryToString$1 = tryToString$3;
797
+ var getIteratorMethod$1 = getIteratorMethod$2;
798
+
799
+ var $TypeError$1 = TypeError;
800
+
801
+ var getIterator$1 = function (argument, usingIterator) {
802
+ var iteratorMethod = arguments.length < 2 ? getIteratorMethod$1(argument) : usingIterator;
803
+ if (aCallable$2(iteratorMethod)) return anObject$3(call$5(iteratorMethod, argument));
804
+ throw $TypeError$1(tryToString$1(argument) + ' is not iterable');
805
+ };
806
+
807
+ var call$4 = functionCall;
808
+ var anObject$2 = anObject$5;
809
+ var getMethod = getMethod$2;
810
+
811
+ var iteratorClose$1 = function (iterator, kind, value) {
812
+ var innerResult, innerError;
813
+ anObject$2(iterator);
814
+ try {
815
+ innerResult = getMethod(iterator, 'return');
816
+ if (!innerResult) {
817
+ if (kind === 'throw') throw value;
818
+ return value;
819
+ }
820
+ innerResult = call$4(innerResult, iterator);
821
+ } catch (error) {
822
+ innerError = true;
823
+ innerResult = error;
824
+ }
825
+ if (kind === 'throw') throw value;
826
+ if (innerError) throw innerResult;
827
+ anObject$2(innerResult);
828
+ return value;
829
+ };
830
+
831
+ var bind = functionBindContext;
832
+ var call$3 = functionCall;
833
+ var anObject$1 = anObject$5;
834
+ var tryToString = tryToString$3;
835
+ var isArrayIteratorMethod = isArrayIteratorMethod$1;
836
+ var lengthOfArrayLike = lengthOfArrayLike$1;
837
+ var isPrototypeOf = objectIsPrototypeOf;
838
+ var getIterator = getIterator$1;
839
+ var getIteratorMethod = getIteratorMethod$2;
840
+ var iteratorClose = iteratorClose$1;
841
+
842
+ var $TypeError = TypeError;
843
+
844
+ var Result = function (stopped, result) {
845
+ this.stopped = stopped;
846
+ this.result = result;
847
+ };
848
+
849
+ var ResultPrototype = Result.prototype;
850
+
851
+ var iterate$2 = function (iterable, unboundFunction, options) {
852
+ var that = options && options.that;
853
+ var AS_ENTRIES = !!(options && options.AS_ENTRIES);
854
+ var IS_ITERATOR = !!(options && options.IS_ITERATOR);
855
+ var INTERRUPTED = !!(options && options.INTERRUPTED);
856
+ var fn = bind(unboundFunction, that);
857
+ var iterator, iterFn, index, length, result, next, step;
858
+
859
+ var stop = function (condition) {
860
+ if (iterator) iteratorClose(iterator, 'normal', condition);
861
+ return new Result(true, condition);
862
+ };
863
+
864
+ var callFn = function (value) {
865
+ if (AS_ENTRIES) {
866
+ anObject$1(value);
867
+ return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
868
+ } return INTERRUPTED ? fn(value, stop) : fn(value);
869
+ };
870
+
871
+ if (IS_ITERATOR) {
872
+ iterator = iterable;
873
+ } else {
874
+ iterFn = getIteratorMethod(iterable);
875
+ if (!iterFn) throw $TypeError(tryToString(iterable) + ' is not iterable');
876
+ // optimisation for array iterators
877
+ if (isArrayIteratorMethod(iterFn)) {
878
+ for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
879
+ result = callFn(iterable[index]);
880
+ if (result && isPrototypeOf(ResultPrototype, result)) return result;
881
+ } return new Result(false);
882
+ }
883
+ iterator = getIterator(iterable, iterFn);
884
+ }
885
+
886
+ next = iterator.next;
887
+ while (!(step = call$3(next, iterator)).done) {
888
+ try {
889
+ result = callFn(step.value);
890
+ } catch (error) {
891
+ iteratorClose(iterator, 'throw', error);
892
+ }
893
+ if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
894
+ } return new Result(false);
895
+ };
896
+
897
+ var wellKnownSymbol = wellKnownSymbol$6;
898
+
899
+ var ITERATOR = wellKnownSymbol('iterator');
900
+ var SAFE_CLOSING = false;
901
+
902
+ try {
903
+ var called = 0;
904
+ var iteratorWithReturn = {
905
+ next: function () {
906
+ return { done: !!called++ };
907
+ },
908
+ 'return': function () {
909
+ SAFE_CLOSING = true;
910
+ }
911
+ };
912
+ iteratorWithReturn[ITERATOR] = function () {
913
+ return this;
914
+ };
915
+ // eslint-disable-next-line es-x/no-array-from, no-throw-literal -- required for testing
916
+ Array.from(iteratorWithReturn, function () { throw 2; });
917
+ } catch (error) { /* empty */ }
918
+
919
+ var checkCorrectnessOfIteration$1 = function (exec, SKIP_CLOSING) {
920
+ if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
921
+ var ITERATION_SUPPORT = false;
922
+ try {
923
+ var object = {};
924
+ object[ITERATOR] = function () {
925
+ return {
926
+ next: function () {
927
+ return { done: ITERATION_SUPPORT = true };
928
+ }
929
+ };
930
+ };
931
+ exec(object);
932
+ } catch (error) { /* empty */ }
933
+ return ITERATION_SUPPORT;
934
+ };
935
+
936
+ var NativePromiseConstructor$2 = promiseNativeConstructor;
937
+ var checkCorrectnessOfIteration = checkCorrectnessOfIteration$1;
938
+ var FORCED_PROMISE_CONSTRUCTOR$3 = promiseConstructorDetection.CONSTRUCTOR;
939
+
940
+ var promiseStaticsIncorrectIteration = FORCED_PROMISE_CONSTRUCTOR$3 || !checkCorrectnessOfIteration(function (iterable) {
941
+ NativePromiseConstructor$2.all(iterable).then(undefined, function () { /* empty */ });
942
+ });
943
+
944
+ var $$6 = _export;
945
+ var call$2 = functionCall;
946
+ var aCallable$1 = aCallable$6;
947
+ var newPromiseCapabilityModule$2 = newPromiseCapability$2;
948
+ var perform$1 = perform$3;
949
+ var iterate$1 = iterate$2;
950
+ var PROMISE_STATICS_INCORRECT_ITERATION$1 = promiseStaticsIncorrectIteration;
951
+
952
+ // `Promise.all` method
953
+ // https://tc39.es/ecma262/#sec-promise.all
954
+ $$6({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION$1 }, {
955
+ all: function all(iterable) {
956
+ var C = this;
957
+ var capability = newPromiseCapabilityModule$2.f(C);
958
+ var resolve = capability.resolve;
959
+ var reject = capability.reject;
960
+ var result = perform$1(function () {
961
+ var $promiseResolve = aCallable$1(C.resolve);
962
+ var values = [];
963
+ var counter = 0;
964
+ var remaining = 1;
965
+ iterate$1(iterable, function (promise) {
966
+ var index = counter++;
967
+ var alreadyCalled = false;
968
+ remaining++;
969
+ call$2($promiseResolve, C, promise).then(function (value) {
970
+ if (alreadyCalled) return;
971
+ alreadyCalled = true;
972
+ values[index] = value;
973
+ --remaining || resolve(values);
974
+ }, reject);
975
+ });
976
+ --remaining || resolve(values);
977
+ });
978
+ if (result.error) reject(result.value);
979
+ return capability.promise;
980
+ }
981
+ });
982
+
983
+ var $$5 = _export;
984
+ var FORCED_PROMISE_CONSTRUCTOR$2 = promiseConstructorDetection.CONSTRUCTOR;
985
+ var NativePromiseConstructor$1 = promiseNativeConstructor;
986
+ var getBuiltIn$2 = getBuiltIn$5;
987
+ var isCallable$1 = isCallable$6;
988
+ var defineBuiltIn$1 = defineBuiltIn$3;
989
+
990
+ var NativePromisePrototype$1 = NativePromiseConstructor$1 && NativePromiseConstructor$1.prototype;
991
+
992
+ // `Promise.prototype.catch` method
993
+ // https://tc39.es/ecma262/#sec-promise.prototype.catch
994
+ $$5({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR$2, real: true }, {
995
+ 'catch': function (onRejected) {
996
+ return this.then(undefined, onRejected);
997
+ }
998
+ });
999
+
1000
+ // makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`
1001
+ if (isCallable$1(NativePromiseConstructor$1)) {
1002
+ var method$1 = getBuiltIn$2('Promise').prototype['catch'];
1003
+ if (NativePromisePrototype$1['catch'] !== method$1) {
1004
+ defineBuiltIn$1(NativePromisePrototype$1, 'catch', method$1, { unsafe: true });
1005
+ }
1006
+ }
1007
+
1008
+ var $$4 = _export;
1009
+ var call$1 = functionCall;
1010
+ var aCallable = aCallable$6;
1011
+ var newPromiseCapabilityModule$1 = newPromiseCapability$2;
1012
+ var perform = perform$3;
1013
+ var iterate = iterate$2;
1014
+ var PROMISE_STATICS_INCORRECT_ITERATION = promiseStaticsIncorrectIteration;
1015
+
1016
+ // `Promise.race` method
1017
+ // https://tc39.es/ecma262/#sec-promise.race
1018
+ $$4({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
1019
+ race: function race(iterable) {
1020
+ var C = this;
1021
+ var capability = newPromiseCapabilityModule$1.f(C);
1022
+ var reject = capability.reject;
1023
+ var result = perform(function () {
1024
+ var $promiseResolve = aCallable(C.resolve);
1025
+ iterate(iterable, function (promise) {
1026
+ call$1($promiseResolve, C, promise).then(capability.resolve, reject);
1027
+ });
1028
+ });
1029
+ if (result.error) reject(result.value);
1030
+ return capability.promise;
1031
+ }
1032
+ });
1033
+
1034
+ var $$3 = _export;
1035
+ var call = functionCall;
1036
+ var newPromiseCapabilityModule = newPromiseCapability$2;
1037
+ var FORCED_PROMISE_CONSTRUCTOR$1 = promiseConstructorDetection.CONSTRUCTOR;
1038
+
1039
+ // `Promise.reject` method
1040
+ // https://tc39.es/ecma262/#sec-promise.reject
1041
+ $$3({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR$1 }, {
1042
+ reject: function reject(r) {
1043
+ var capability = newPromiseCapabilityModule.f(this);
1044
+ call(capability.reject, undefined, r);
1045
+ return capability.promise;
1046
+ }
1047
+ });
1048
+
1049
+ var anObject = anObject$5;
1050
+ var isObject = isObject$2;
1051
+ var newPromiseCapability = newPromiseCapability$2;
1052
+
1053
+ var promiseResolve$2 = function (C, x) {
1054
+ anObject(C);
1055
+ if (isObject(x) && x.constructor === C) return x;
1056
+ var promiseCapability = newPromiseCapability.f(C);
1057
+ var resolve = promiseCapability.resolve;
1058
+ resolve(x);
1059
+ return promiseCapability.promise;
1060
+ };
1061
+
1062
+ var $$2 = _export;
1063
+ var getBuiltIn$1 = getBuiltIn$5;
1064
+ var FORCED_PROMISE_CONSTRUCTOR = promiseConstructorDetection.CONSTRUCTOR;
1065
+ var promiseResolve$1 = promiseResolve$2;
1066
+
1067
+ getBuiltIn$1('Promise');
1068
+
1069
+ // `Promise.resolve` method
1070
+ // https://tc39.es/ecma262/#sec-promise.resolve
1071
+ $$2({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
1072
+ resolve: function resolve(x) {
1073
+ return promiseResolve$1(this, x);
1074
+ }
1075
+ });
1076
+
1077
+ // a string of all valid unicode whitespaces
1078
+ var whitespaces$2 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
1079
+ '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
1080
+
1081
+ var uncurryThis = functionUncurryThis;
1082
+ var requireObjectCoercible = requireObjectCoercible$1;
1083
+ var toString = toString$1;
1084
+ var whitespaces$1 = whitespaces$2;
1085
+
1086
+ var replace = uncurryThis(''.replace);
1087
+ var whitespace = '[' + whitespaces$1 + ']';
1088
+ var ltrim = RegExp('^' + whitespace + whitespace + '*');
1089
+ var rtrim = RegExp(whitespace + whitespace + '*$');
1090
+
1091
+ // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
1092
+ var createMethod = function (TYPE) {
1093
+ return function ($this) {
1094
+ var string = toString(requireObjectCoercible($this));
1095
+ if (TYPE & 1) string = replace(string, ltrim, '');
1096
+ if (TYPE & 2) string = replace(string, rtrim, '');
1097
+ return string;
1098
+ };
1099
+ };
1100
+
1101
+ var stringTrim = {
1102
+ // `String.prototype.{ trimLeft, trimStart }` methods
1103
+ // https://tc39.es/ecma262/#sec-string.prototype.trimstart
1104
+ start: createMethod(1),
1105
+ // `String.prototype.{ trimRight, trimEnd }` methods
1106
+ // https://tc39.es/ecma262/#sec-string.prototype.trimend
1107
+ end: createMethod(2),
1108
+ // `String.prototype.trim` method
1109
+ // https://tc39.es/ecma262/#sec-string.prototype.trim
1110
+ trim: createMethod(3)
1111
+ };
1112
+
1113
+ var PROPER_FUNCTION_NAME = functionName.PROPER;
1114
+ var fails$1 = fails$4;
1115
+ var whitespaces = whitespaces$2;
1116
+
1117
+ var non = '\u200B\u0085\u180E';
1118
+
1119
+ // check that a method works with the correct list
1120
+ // of whitespaces and has a correct name
1121
+ var stringTrimForced = function (METHOD_NAME) {
1122
+ return fails$1(function () {
1123
+ return !!whitespaces[METHOD_NAME]()
1124
+ || non[METHOD_NAME]() !== non
1125
+ || (PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME);
1126
+ });
1127
+ };
1128
+
1129
+ var $$1 = _export;
1130
+ var $trim = stringTrim.trim;
1131
+ var forcedStringTrimMethod = stringTrimForced;
1132
+
1133
+ // `String.prototype.trim` method
1134
+ // https://tc39.es/ecma262/#sec-string.prototype.trim
1135
+ $$1({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
1136
+ trim: function trim() {
1137
+ return $trim(this);
1138
+ }
1139
+ });
1140
+
1141
+ var $ = _export;
1142
+ var NativePromiseConstructor = promiseNativeConstructor;
1143
+ var fails = fails$4;
1144
+ var getBuiltIn = getBuiltIn$5;
1145
+ var isCallable = isCallable$6;
1146
+ var speciesConstructor = speciesConstructor$2;
1147
+ var promiseResolve = promiseResolve$2;
1148
+ var defineBuiltIn = defineBuiltIn$3;
1149
+
1150
+ var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
1151
+
1152
+ // Safari bug https://bugs.webkit.org/show_bug.cgi?id=200829
1153
+ var NON_GENERIC = !!NativePromiseConstructor && fails(function () {
1154
+ // eslint-disable-next-line unicorn/no-thenable -- required for testing
1155
+ NativePromisePrototype['finally'].call({ then: function () { /* empty */ } }, function () { /* empty */ });
1156
+ });
1157
+
1158
+ // `Promise.prototype.finally` method
1159
+ // https://tc39.es/ecma262/#sec-promise.prototype.finally
1160
+ $({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, {
1161
+ 'finally': function (onFinally) {
1162
+ var C = speciesConstructor(this, getBuiltIn('Promise'));
1163
+ var isFunction = isCallable(onFinally);
1164
+ return this.then(
1165
+ isFunction ? function (x) {
1166
+ return promiseResolve(C, onFinally()).then(function () { return x; });
1167
+ } : onFinally,
1168
+ isFunction ? function (e) {
1169
+ return promiseResolve(C, onFinally()).then(function () { throw e; });
1170
+ } : onFinally
1171
+ );
1172
+ }
1173
+ });
1174
+
1175
+ // makes sure that native promise-based APIs `Promise#finally` properly works with patched `Promise#then`
1176
+ if (isCallable(NativePromiseConstructor)) {
1177
+ var method = getBuiltIn('Promise').prototype['finally'];
1178
+ if (NativePromisePrototype['finally'] !== method) {
1179
+ defineBuiltIn(NativePromisePrototype, 'finally', method, { unsafe: true });
1180
+ }
1181
+ }
1182
+
1183
+ function _arity(n, fn) {
1184
+ /* eslint-disable no-unused-vars */
1185
+ switch (n) {
1186
+ case 0:
1187
+ return function () {
1188
+ return fn.apply(this, arguments);
1189
+ };
1190
+
1191
+ case 1:
1192
+ return function (a0) {
1193
+ return fn.apply(this, arguments);
1194
+ };
1195
+
1196
+ case 2:
1197
+ return function (a0, a1) {
1198
+ return fn.apply(this, arguments);
1199
+ };
1200
+
1201
+ case 3:
1202
+ return function (a0, a1, a2) {
1203
+ return fn.apply(this, arguments);
1204
+ };
1205
+
1206
+ case 4:
1207
+ return function (a0, a1, a2, a3) {
1208
+ return fn.apply(this, arguments);
1209
+ };
1210
+
1211
+ case 5:
1212
+ return function (a0, a1, a2, a3, a4) {
1213
+ return fn.apply(this, arguments);
1214
+ };
1215
+
1216
+ case 6:
1217
+ return function (a0, a1, a2, a3, a4, a5) {
1218
+ return fn.apply(this, arguments);
1219
+ };
1220
+
1221
+ case 7:
1222
+ return function (a0, a1, a2, a3, a4, a5, a6) {
1223
+ return fn.apply(this, arguments);
1224
+ };
1225
+
1226
+ case 8:
1227
+ return function (a0, a1, a2, a3, a4, a5, a6, a7) {
1228
+ return fn.apply(this, arguments);
1229
+ };
1230
+
1231
+ case 9:
1232
+ return function (a0, a1, a2, a3, a4, a5, a6, a7, a8) {
1233
+ return fn.apply(this, arguments);
1234
+ };
1235
+
1236
+ case 10:
1237
+ return function (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) {
1238
+ return fn.apply(this, arguments);
1239
+ };
1240
+
1241
+ default:
1242
+ throw new Error('First argument to _arity must be a non-negative integer no greater than ten');
1243
+ }
1244
+ }
1245
+
1246
+ function _identity(x) {
1247
+ return x;
1248
+ }
1249
+
1250
+ /**
1251
+ * A function that does nothing but return the parameter supplied to it. Good
1252
+ * as a default or placeholder function.
1253
+ *
1254
+ * @func
1255
+ * @memberOf R
1256
+ * @since v0.1.0
1257
+ * @category Function
1258
+ * @sig a -> a
1259
+ * @param {*} x The value to return.
1260
+ * @return {*} The input value, `x`.
1261
+ * @example
1262
+ *
1263
+ * R.identity(1); //=> 1
1264
+ *
1265
+ * const obj = {};
1266
+ * R.identity(obj) === obj; //=> true
1267
+ * @symb R.identity(a) = a
1268
+ */
1269
+
1270
+ var identity =
1271
+ /*#__PURE__*/
1272
+ _curry1(_identity);
1273
+
1274
+ var identity$1 = identity;
1275
+
1276
+ /**
1277
+ * Creates a new function that, when invoked, caches the result of calling `fn`
1278
+ * for a given argument set and returns the result. Subsequent calls to the
1279
+ * memoized `fn` with the same argument set will not result in an additional
1280
+ * call to `fn`; instead, the cached result for that set of arguments will be
1281
+ * returned.
1282
+ *
1283
+ *
1284
+ * @func
1285
+ * @memberOf R
1286
+ * @since v0.24.0
1287
+ * @category Function
1288
+ * @sig (*... -> String) -> (*... -> a) -> (*... -> a)
1289
+ * @param {Function} fn The function to generate the cache key.
1290
+ * @param {Function} fn The function to memoize.
1291
+ * @return {Function} Memoized version of `fn`.
1292
+ * @example
1293
+ *
1294
+ * let count = 0;
1295
+ * const factorial = R.memoizeWith(R.identity, n => {
1296
+ * count += 1;
1297
+ * return R.product(R.range(1, n + 1));
1298
+ * });
1299
+ * factorial(5); //=> 120
1300
+ * factorial(5); //=> 120
1301
+ * factorial(5); //=> 120
1302
+ * count; //=> 1
1303
+ */
1304
+
1305
+ var memoizeWith =
1306
+ /*#__PURE__*/
1307
+ _curry2(function memoizeWith(mFn, fn) {
1308
+ var cache = {};
1309
+ return _arity(fn.length, function () {
1310
+ var key = mFn.apply(this, arguments);
1311
+
1312
+ if (!_has(key, cache)) {
1313
+ cache[key] = fn.apply(this, arguments);
1314
+ }
1315
+
1316
+ return cache[key];
1317
+ });
1318
+ });
1319
+
1320
+ var memoizeWith$1 = memoizeWith;
1321
+
1322
+ const PLACEHOLDER_ICON = `<svg width="80%" height="80%" viewBox="0 0 64 64">
1323
+ <g>
1324
+ <g stroke-width="6" stroke-linecap="round" fill="none">
1325
+ <path stroke="currentColor" d="M4,32 c0,15,12,28,28,28c8,0,16-4,21-9">
1326
+ </path>
1327
+ <path d="M60,32 C60,16,47.464,4,32,4S4,16,4,32">
1328
+ </path>
1329
+ <animateTransform values="0,32,32;360,32,32" attributeName="transform" type="rotate" repeatCount="indefinite" dur="750ms">
1330
+ </animateTransform>
1331
+ </g>
1332
+ </g>
1333
+ </svg>`;
1334
+
1335
+ const BASE_URL = 'https://icon.resources.vonage.com';
1336
+ const ICON_SET_VERSION = '4.0.28';
1337
+ const PLACEHOLDER_DELAY = 500;
1338
+ const PLACEHOLDER_TIMEOUT = 2000;
1339
+
1340
+ const baseUrlTemplate = (resource, version) => [BASE_URL, `v${version}`, resource].join('/');
1341
+
1342
+ const assertIsValidResponse = ({
1343
+ ok,
1344
+ headers
1345
+ }) => {
1346
+ if (!ok || headers.get('content-type') !== 'image/svg+xml') {
1347
+ throw new Error('Something went wrong');
1348
+ }
1349
+ };
1350
+
1351
+ const extractSvg = response => {
1352
+ assertIsValidResponse(response);
1353
+ return response.text();
1354
+ };
1355
+
1356
+ const loadSvg = iconId => fetch(baseUrlTemplate([iconId, 'svg'].join('.'), ICON_SET_VERSION)).then(extractSvg);
1357
+
1358
+ const resolveIcon = memoizeWith$1(identity$1, (iconId = '') => iconId.trim() ? loadSvg(iconId) : Promise.resolve(''));
1359
+ class Icon extends FoundationElement {
1360
+ async typeChanged() {
1361
+ this.svg = undefined;
1362
+ let timeout = setTimeout(() => {
1363
+ this.svg = PLACEHOLDER_ICON;
1364
+ timeout = setTimeout(() => {
1365
+ if (this.svg === PLACEHOLDER_ICON) {
1366
+ this.svg = undefined;
1367
+ }
1368
+ }, PLACEHOLDER_TIMEOUT);
1369
+ }, PLACEHOLDER_DELAY);
1370
+ await resolveIcon(this.type).then(svg => {
1371
+ this.svg = svg;
1372
+ }).catch(() => {
1373
+ this.svg = undefined;
1374
+ }).finally(() => {
1375
+ clearTimeout(timeout);
1376
+ });
1377
+ }
1378
+
1379
+ }
1380
+
1381
+ __decorate([attr, __metadata("design:type", String)], Icon.prototype, "connotation", void 0);
1382
+
1383
+ __decorate([attr, __metadata("design:type", String)], Icon.prototype, "size", void 0);
1384
+
1385
+ __decorate([observable, __metadata("design:type", String)], Icon.prototype, "svg", void 0);
1386
+
1387
+ __decorate([attr, __metadata("design:type", String)], Icon.prototype, "type", void 0);
1388
+
1389
+ export { Icon as I, functionApply as f, speciesConstructor$2 as s };