@dynamic-labs/react-native-extension 2.1.0-alpha.8 → 2.1.0

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 (23) hide show
  1. package/index.cjs +3033 -0
  2. package/package.json +9 -7
  3. package/src/{lib → ReactNativeExtension}/ReactNativeExtension.d.ts +5 -1
  4. package/src/ReactNativeExtension/index.d.ts +1 -0
  5. package/src/ReactNativeExtension/setupFetchHandler/index.d.ts +1 -0
  6. package/src/ReactNativeExtension/setupFetchHandler/setupFetchHandler.d.ts +2 -0
  7. package/src/ReactNativeExtension/setupPasskeyHandler/index.d.ts +1 -0
  8. package/src/ReactNativeExtension/setupPasskeyHandler/setupPasskeyHandler.d.ts +2 -0
  9. package/src/ReactNativeExtension/setupPlatformHandler/index.d.ts +1 -0
  10. package/src/ReactNativeExtension/setupPlatformHandler/setupPlatformHandler.d.ts +2 -0
  11. package/src/components/WebView/index.d.ts +1 -0
  12. package/src/components/WebView/useMessageTransportWebViewBridge/useIsMounted/index.d.ts +1 -0
  13. package/src/components/WebView/useMessageTransportWebViewBridge/useIsMounted/useIsMounted.d.ts +1 -0
  14. package/src/components/WebView/useWebViewVisibility/index.d.ts +1 -0
  15. package/src/components/WebView/useWebViewVisibility/useWebViewVisibility.d.ts +4 -0
  16. package/src/index.d.ts +1 -1
  17. package/index.js +0 -1212
  18. package/src/lib/components/WebView/index.d.ts +0 -1
  19. /package/src/{lib/components → components}/WebView/WebView.d.ts +0 -0
  20. /package/src/{lib/components → components}/WebView/WebView.styles.d.ts +0 -0
  21. /package/src/{lib/hooks → components/WebView}/useMessageTransportWebViewBridge/index.d.ts +0 -0
  22. /package/src/{lib/hooks → components/WebView}/useMessageTransportWebViewBridge/useMessageTransportWebViewBridge.d.ts +0 -0
  23. /package/src/{lib/utils → utils}/logger.d.ts +0 -0
package/index.cjs ADDED
@@ -0,0 +1,3033 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var react = require('react');
6
+ var reactNativeWebview = require('react-native-webview');
7
+ var messageTransport = require('@dynamic-labs/message-transport');
8
+ var logger$1 = require('@dynamic-labs/logger');
9
+ var reactNative = require('react-native');
10
+ var jsxRuntime = require('react/jsx-runtime');
11
+ var expoLinking = require('expo-linking');
12
+ var reactNativePasskeyStamper = require('@turnkey/react-native-passkey-stamper');
13
+
14
+ var version$1 = "2.1.0";
15
+
16
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
17
+
18
+ var check = function (it) {
19
+ return it && it.Math == Math && it;
20
+ };
21
+
22
+ // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
23
+ var global$j =
24
+ // eslint-disable-next-line es/no-global-this -- safe
25
+ check(typeof globalThis == 'object' && globalThis) ||
26
+ check(typeof window == 'object' && window) ||
27
+ // eslint-disable-next-line no-restricted-globals -- safe
28
+ check(typeof self == 'object' && self) ||
29
+ check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
30
+ // eslint-disable-next-line no-new-func -- fallback
31
+ (function () { return this; })() || Function('return this')();
32
+
33
+ var objectGetOwnPropertyDescriptor = {};
34
+
35
+ var fails$d = function (exec) {
36
+ try {
37
+ return !!exec();
38
+ } catch (error) {
39
+ return true;
40
+ }
41
+ };
42
+
43
+ var fails$c = fails$d;
44
+
45
+ // Detect IE8's incomplete defineProperty implementation
46
+ var descriptors = !fails$c(function () {
47
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
48
+ return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
49
+ });
50
+
51
+ var fails$b = fails$d;
52
+
53
+ var functionBindNative = !fails$b(function () {
54
+ // eslint-disable-next-line es/no-function-prototype-bind -- safe
55
+ var test = (function () { /* empty */ }).bind();
56
+ // eslint-disable-next-line no-prototype-builtins -- safe
57
+ return typeof test != 'function' || test.hasOwnProperty('prototype');
58
+ });
59
+
60
+ var NATIVE_BIND$3 = functionBindNative;
61
+
62
+ var call$e = Function.prototype.call;
63
+
64
+ var functionCall = NATIVE_BIND$3 ? call$e.bind(call$e) : function () {
65
+ return call$e.apply(call$e, arguments);
66
+ };
67
+
68
+ var objectPropertyIsEnumerable = {};
69
+
70
+ var $propertyIsEnumerable = {}.propertyIsEnumerable;
71
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
72
+ var getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor;
73
+
74
+ // Nashorn ~ JDK8 bug
75
+ var NASHORN_BUG = getOwnPropertyDescriptor$2 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
76
+
77
+ // `Object.prototype.propertyIsEnumerable` method implementation
78
+ // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
79
+ objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
80
+ var descriptor = getOwnPropertyDescriptor$2(this, V);
81
+ return !!descriptor && descriptor.enumerable;
82
+ } : $propertyIsEnumerable;
83
+
84
+ var createPropertyDescriptor$4 = function (bitmap, value) {
85
+ return {
86
+ enumerable: !(bitmap & 1),
87
+ configurable: !(bitmap & 2),
88
+ writable: !(bitmap & 4),
89
+ value: value
90
+ };
91
+ };
92
+
93
+ var NATIVE_BIND$2 = functionBindNative;
94
+
95
+ var FunctionPrototype$2 = Function.prototype;
96
+ var call$d = FunctionPrototype$2.call;
97
+ var uncurryThisWithBind = NATIVE_BIND$2 && FunctionPrototype$2.bind.bind(call$d, call$d);
98
+
99
+ var functionUncurryThis = NATIVE_BIND$2 ? uncurryThisWithBind : function (fn) {
100
+ return function () {
101
+ return call$d.apply(fn, arguments);
102
+ };
103
+ };
104
+
105
+ var uncurryThis$d = functionUncurryThis;
106
+
107
+ var toString$1 = uncurryThis$d({}.toString);
108
+ var stringSlice = uncurryThis$d(''.slice);
109
+
110
+ var classofRaw$2 = function (it) {
111
+ return stringSlice(toString$1(it), 8, -1);
112
+ };
113
+
114
+ var uncurryThis$c = functionUncurryThis;
115
+ var fails$a = fails$d;
116
+ var classof$4 = classofRaw$2;
117
+
118
+ var $Object$4 = Object;
119
+ var split = uncurryThis$c(''.split);
120
+
121
+ // fallback for non-array-like ES3 and non-enumerable old V8 strings
122
+ var indexedObject = fails$a(function () {
123
+ // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
124
+ // eslint-disable-next-line no-prototype-builtins -- safe
125
+ return !$Object$4('z').propertyIsEnumerable(0);
126
+ }) ? function (it) {
127
+ return classof$4(it) == 'String' ? split(it, '') : $Object$4(it);
128
+ } : $Object$4;
129
+
130
+ // we can't use just `it == null` since of `document.all` special case
131
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
132
+ var isNullOrUndefined$4 = function (it) {
133
+ return it === null || it === undefined;
134
+ };
135
+
136
+ var isNullOrUndefined$3 = isNullOrUndefined$4;
137
+
138
+ var $TypeError$c = TypeError;
139
+
140
+ // `RequireObjectCoercible` abstract operation
141
+ // https://tc39.es/ecma262/#sec-requireobjectcoercible
142
+ var requireObjectCoercible$2 = function (it) {
143
+ if (isNullOrUndefined$3(it)) throw $TypeError$c("Can't call method on " + it);
144
+ return it;
145
+ };
146
+
147
+ // toObject with fallback for non-array-like ES3 strings
148
+ var IndexedObject$1 = indexedObject;
149
+ var requireObjectCoercible$1 = requireObjectCoercible$2;
150
+
151
+ var toIndexedObject$5 = function (it) {
152
+ return IndexedObject$1(requireObjectCoercible$1(it));
153
+ };
154
+
155
+ var documentAll$2 = typeof document == 'object' && document.all;
156
+
157
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
158
+ // eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
159
+ var IS_HTMLDDA = typeof documentAll$2 == 'undefined' && documentAll$2 !== undefined;
160
+
161
+ var documentAll_1 = {
162
+ all: documentAll$2,
163
+ IS_HTMLDDA: IS_HTMLDDA
164
+ };
165
+
166
+ var $documentAll$1 = documentAll_1;
167
+
168
+ var documentAll$1 = $documentAll$1.all;
169
+
170
+ // `IsCallable` abstract operation
171
+ // https://tc39.es/ecma262/#sec-iscallable
172
+ var isCallable$k = $documentAll$1.IS_HTMLDDA ? function (argument) {
173
+ return typeof argument == 'function' || argument === documentAll$1;
174
+ } : function (argument) {
175
+ return typeof argument == 'function';
176
+ };
177
+
178
+ var isCallable$j = isCallable$k;
179
+ var $documentAll = documentAll_1;
180
+
181
+ var documentAll = $documentAll.all;
182
+
183
+ var isObject$8 = $documentAll.IS_HTMLDDA ? function (it) {
184
+ return typeof it == 'object' ? it !== null : isCallable$j(it) || it === documentAll;
185
+ } : function (it) {
186
+ return typeof it == 'object' ? it !== null : isCallable$j(it);
187
+ };
188
+
189
+ var global$i = global$j;
190
+ var isCallable$i = isCallable$k;
191
+
192
+ var aFunction = function (argument) {
193
+ return isCallable$i(argument) ? argument : undefined;
194
+ };
195
+
196
+ var getBuiltIn$8 = function (namespace, method) {
197
+ return arguments.length < 2 ? aFunction(global$i[namespace]) : global$i[namespace] && global$i[namespace][method];
198
+ };
199
+
200
+ var uncurryThis$b = functionUncurryThis;
201
+
202
+ var objectIsPrototypeOf = uncurryThis$b({}.isPrototypeOf);
203
+
204
+ var getBuiltIn$7 = getBuiltIn$8;
205
+
206
+ var engineUserAgent = getBuiltIn$7('navigator', 'userAgent') || '';
207
+
208
+ var global$h = global$j;
209
+ var userAgent$3 = engineUserAgent;
210
+
211
+ var process$3 = global$h.process;
212
+ var Deno$1 = global$h.Deno;
213
+ var versions = process$3 && process$3.versions || Deno$1 && Deno$1.version;
214
+ var v8 = versions && versions.v8;
215
+ var match, version;
216
+
217
+ if (v8) {
218
+ match = v8.split('.');
219
+ // in old Chrome, versions of V8 isn't V8 = Chrome / 10
220
+ // but their correct versions are not interesting for us
221
+ version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
222
+ }
223
+
224
+ // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
225
+ // so check `userAgent` even if `.v8` exists, but 0
226
+ if (!version && userAgent$3) {
227
+ match = userAgent$3.match(/Edge\/(\d+)/);
228
+ if (!match || match[1] >= 74) {
229
+ match = userAgent$3.match(/Chrome\/(\d+)/);
230
+ if (match) version = +match[1];
231
+ }
232
+ }
233
+
234
+ var engineV8Version = version;
235
+
236
+ /* eslint-disable es/no-symbol -- required for testing */
237
+
238
+ var V8_VERSION$1 = engineV8Version;
239
+ var fails$9 = fails$d;
240
+
241
+ // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
242
+ var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$9(function () {
243
+ var symbol = Symbol();
244
+ // Chrome 38 Symbol has incorrect toString conversion
245
+ // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
246
+ return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
247
+ // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
248
+ !Symbol.sham && V8_VERSION$1 && V8_VERSION$1 < 41;
249
+ });
250
+
251
+ /* eslint-disable es/no-symbol -- required for testing */
252
+
253
+ var NATIVE_SYMBOL$1 = symbolConstructorDetection;
254
+
255
+ var useSymbolAsUid = NATIVE_SYMBOL$1
256
+ && !Symbol.sham
257
+ && typeof Symbol.iterator == 'symbol';
258
+
259
+ var getBuiltIn$6 = getBuiltIn$8;
260
+ var isCallable$h = isCallable$k;
261
+ var isPrototypeOf$2 = objectIsPrototypeOf;
262
+ var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
263
+
264
+ var $Object$3 = Object;
265
+
266
+ var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
267
+ return typeof it == 'symbol';
268
+ } : function (it) {
269
+ var $Symbol = getBuiltIn$6('Symbol');
270
+ return isCallable$h($Symbol) && isPrototypeOf$2($Symbol.prototype, $Object$3(it));
271
+ };
272
+
273
+ var $String$2 = String;
274
+
275
+ var tryToString$4 = function (argument) {
276
+ try {
277
+ return $String$2(argument);
278
+ } catch (error) {
279
+ return 'Object';
280
+ }
281
+ };
282
+
283
+ var isCallable$g = isCallable$k;
284
+ var tryToString$3 = tryToString$4;
285
+
286
+ var $TypeError$b = TypeError;
287
+
288
+ // `Assert: IsCallable(argument) is true`
289
+ var aCallable$7 = function (argument) {
290
+ if (isCallable$g(argument)) return argument;
291
+ throw $TypeError$b(tryToString$3(argument) + ' is not a function');
292
+ };
293
+
294
+ var aCallable$6 = aCallable$7;
295
+ var isNullOrUndefined$2 = isNullOrUndefined$4;
296
+
297
+ // `GetMethod` abstract operation
298
+ // https://tc39.es/ecma262/#sec-getmethod
299
+ var getMethod$3 = function (V, P) {
300
+ var func = V[P];
301
+ return isNullOrUndefined$2(func) ? undefined : aCallable$6(func);
302
+ };
303
+
304
+ var call$c = functionCall;
305
+ var isCallable$f = isCallable$k;
306
+ var isObject$7 = isObject$8;
307
+
308
+ var $TypeError$a = TypeError;
309
+
310
+ // `OrdinaryToPrimitive` abstract operation
311
+ // https://tc39.es/ecma262/#sec-ordinarytoprimitive
312
+ var ordinaryToPrimitive$1 = function (input, pref) {
313
+ var fn, val;
314
+ if (pref === 'string' && isCallable$f(fn = input.toString) && !isObject$7(val = call$c(fn, input))) return val;
315
+ if (isCallable$f(fn = input.valueOf) && !isObject$7(val = call$c(fn, input))) return val;
316
+ if (pref !== 'string' && isCallable$f(fn = input.toString) && !isObject$7(val = call$c(fn, input))) return val;
317
+ throw $TypeError$a("Can't convert object to primitive value");
318
+ };
319
+
320
+ var shared$3 = {exports: {}};
321
+
322
+ var global$g = global$j;
323
+
324
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
325
+ var defineProperty$5 = Object.defineProperty;
326
+
327
+ var defineGlobalProperty$3 = function (key, value) {
328
+ try {
329
+ defineProperty$5(global$g, key, { value: value, configurable: true, writable: true });
330
+ } catch (error) {
331
+ global$g[key] = value;
332
+ } return value;
333
+ };
334
+
335
+ var global$f = global$j;
336
+ var defineGlobalProperty$2 = defineGlobalProperty$3;
337
+
338
+ var SHARED = '__core-js_shared__';
339
+ var store$3 = global$f[SHARED] || defineGlobalProperty$2(SHARED, {});
340
+
341
+ var sharedStore = store$3;
342
+
343
+ var store$2 = sharedStore;
344
+
345
+ (shared$3.exports = function (key, value) {
346
+ return store$2[key] || (store$2[key] = value !== undefined ? value : {});
347
+ })('versions', []).push({
348
+ version: '3.27.0',
349
+ mode: 'global',
350
+ copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
351
+ license: 'https://github.com/zloirock/core-js/blob/v3.27.0/LICENSE',
352
+ source: 'https://github.com/zloirock/core-js'
353
+ });
354
+
355
+ var requireObjectCoercible = requireObjectCoercible$2;
356
+
357
+ var $Object$2 = Object;
358
+
359
+ // `ToObject` abstract operation
360
+ // https://tc39.es/ecma262/#sec-toobject
361
+ var toObject$3 = function (argument) {
362
+ return $Object$2(requireObjectCoercible(argument));
363
+ };
364
+
365
+ var uncurryThis$a = functionUncurryThis;
366
+ var toObject$2 = toObject$3;
367
+
368
+ var hasOwnProperty = uncurryThis$a({}.hasOwnProperty);
369
+
370
+ // `HasOwnProperty` abstract operation
371
+ // https://tc39.es/ecma262/#sec-hasownproperty
372
+ // eslint-disable-next-line es/no-object-hasown -- safe
373
+ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
374
+ return hasOwnProperty(toObject$2(it), key);
375
+ };
376
+
377
+ var uncurryThis$9 = functionUncurryThis;
378
+
379
+ var id = 0;
380
+ var postfix = Math.random();
381
+ var toString = uncurryThis$9(1.0.toString);
382
+
383
+ var uid$2 = function (key) {
384
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
385
+ };
386
+
387
+ var global$e = global$j;
388
+ var shared$2 = shared$3.exports;
389
+ var hasOwn$9 = hasOwnProperty_1;
390
+ var uid$1 = uid$2;
391
+ var NATIVE_SYMBOL = symbolConstructorDetection;
392
+ var USE_SYMBOL_AS_UID = useSymbolAsUid;
393
+
394
+ var WellKnownSymbolsStore = shared$2('wks');
395
+ var Symbol$1 = global$e.Symbol;
396
+ var symbolFor = Symbol$1 && Symbol$1['for'];
397
+ var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
398
+
399
+ var wellKnownSymbol$e = function (name) {
400
+ if (!hasOwn$9(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
401
+ var description = 'Symbol.' + name;
402
+ if (NATIVE_SYMBOL && hasOwn$9(Symbol$1, name)) {
403
+ WellKnownSymbolsStore[name] = Symbol$1[name];
404
+ } else if (USE_SYMBOL_AS_UID && symbolFor) {
405
+ WellKnownSymbolsStore[name] = symbolFor(description);
406
+ } else {
407
+ WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
408
+ }
409
+ } return WellKnownSymbolsStore[name];
410
+ };
411
+
412
+ var call$b = functionCall;
413
+ var isObject$6 = isObject$8;
414
+ var isSymbol$1 = isSymbol$2;
415
+ var getMethod$2 = getMethod$3;
416
+ var ordinaryToPrimitive = ordinaryToPrimitive$1;
417
+ var wellKnownSymbol$d = wellKnownSymbol$e;
418
+
419
+ var $TypeError$9 = TypeError;
420
+ var TO_PRIMITIVE = wellKnownSymbol$d('toPrimitive');
421
+
422
+ // `ToPrimitive` abstract operation
423
+ // https://tc39.es/ecma262/#sec-toprimitive
424
+ var toPrimitive$1 = function (input, pref) {
425
+ if (!isObject$6(input) || isSymbol$1(input)) return input;
426
+ var exoticToPrim = getMethod$2(input, TO_PRIMITIVE);
427
+ var result;
428
+ if (exoticToPrim) {
429
+ if (pref === undefined) pref = 'default';
430
+ result = call$b(exoticToPrim, input, pref);
431
+ if (!isObject$6(result) || isSymbol$1(result)) return result;
432
+ throw $TypeError$9("Can't convert object to primitive value");
433
+ }
434
+ if (pref === undefined) pref = 'number';
435
+ return ordinaryToPrimitive(input, pref);
436
+ };
437
+
438
+ var toPrimitive = toPrimitive$1;
439
+ var isSymbol = isSymbol$2;
440
+
441
+ // `ToPropertyKey` abstract operation
442
+ // https://tc39.es/ecma262/#sec-topropertykey
443
+ var toPropertyKey$3 = function (argument) {
444
+ var key = toPrimitive(argument, 'string');
445
+ return isSymbol(key) ? key : key + '';
446
+ };
447
+
448
+ var global$d = global$j;
449
+ var isObject$5 = isObject$8;
450
+
451
+ var document$3 = global$d.document;
452
+ // typeof document.createElement is 'object' in old IE
453
+ var EXISTS$1 = isObject$5(document$3) && isObject$5(document$3.createElement);
454
+
455
+ var documentCreateElement$2 = function (it) {
456
+ return EXISTS$1 ? document$3.createElement(it) : {};
457
+ };
458
+
459
+ var DESCRIPTORS$a = descriptors;
460
+ var fails$8 = fails$d;
461
+ var createElement$1 = documentCreateElement$2;
462
+
463
+ // Thanks to IE8 for its funny defineProperty
464
+ var ie8DomDefine = !DESCRIPTORS$a && !fails$8(function () {
465
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
466
+ return Object.defineProperty(createElement$1('div'), 'a', {
467
+ get: function () { return 7; }
468
+ }).a != 7;
469
+ });
470
+
471
+ var DESCRIPTORS$9 = descriptors;
472
+ var call$a = functionCall;
473
+ var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
474
+ var createPropertyDescriptor$3 = createPropertyDescriptor$4;
475
+ var toIndexedObject$4 = toIndexedObject$5;
476
+ var toPropertyKey$2 = toPropertyKey$3;
477
+ var hasOwn$8 = hasOwnProperty_1;
478
+ var IE8_DOM_DEFINE$1 = ie8DomDefine;
479
+
480
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
481
+ var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
482
+
483
+ // `Object.getOwnPropertyDescriptor` method
484
+ // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
485
+ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$9 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
486
+ O = toIndexedObject$4(O);
487
+ P = toPropertyKey$2(P);
488
+ if (IE8_DOM_DEFINE$1) try {
489
+ return $getOwnPropertyDescriptor$1(O, P);
490
+ } catch (error) { /* empty */ }
491
+ if (hasOwn$8(O, P)) return createPropertyDescriptor$3(!call$a(propertyIsEnumerableModule$1.f, O, P), O[P]);
492
+ };
493
+
494
+ var objectDefineProperty = {};
495
+
496
+ var DESCRIPTORS$8 = descriptors;
497
+ var fails$7 = fails$d;
498
+
499
+ // V8 ~ Chrome 36-
500
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3334
501
+ var v8PrototypeDefineBug = DESCRIPTORS$8 && fails$7(function () {
502
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
503
+ return Object.defineProperty(function () { /* empty */ }, 'prototype', {
504
+ value: 42,
505
+ writable: false
506
+ }).prototype != 42;
507
+ });
508
+
509
+ var isObject$4 = isObject$8;
510
+
511
+ var $String$1 = String;
512
+ var $TypeError$8 = TypeError;
513
+
514
+ // `Assert: Type(argument) is Object`
515
+ var anObject$a = function (argument) {
516
+ if (isObject$4(argument)) return argument;
517
+ throw $TypeError$8($String$1(argument) + ' is not an object');
518
+ };
519
+
520
+ var DESCRIPTORS$7 = descriptors;
521
+ var IE8_DOM_DEFINE = ie8DomDefine;
522
+ var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
523
+ var anObject$9 = anObject$a;
524
+ var toPropertyKey$1 = toPropertyKey$3;
525
+
526
+ var $TypeError$7 = TypeError;
527
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
528
+ var $defineProperty = Object.defineProperty;
529
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
530
+ var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
531
+ var ENUMERABLE = 'enumerable';
532
+ var CONFIGURABLE$1 = 'configurable';
533
+ var WRITABLE = 'writable';
534
+
535
+ // `Object.defineProperty` method
536
+ // https://tc39.es/ecma262/#sec-object.defineproperty
537
+ objectDefineProperty.f = DESCRIPTORS$7 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
538
+ anObject$9(O);
539
+ P = toPropertyKey$1(P);
540
+ anObject$9(Attributes);
541
+ if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
542
+ var current = $getOwnPropertyDescriptor(O, P);
543
+ if (current && current[WRITABLE]) {
544
+ O[P] = Attributes.value;
545
+ Attributes = {
546
+ configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
547
+ enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
548
+ writable: false
549
+ };
550
+ }
551
+ } return $defineProperty(O, P, Attributes);
552
+ } : $defineProperty : function defineProperty(O, P, Attributes) {
553
+ anObject$9(O);
554
+ P = toPropertyKey$1(P);
555
+ anObject$9(Attributes);
556
+ if (IE8_DOM_DEFINE) try {
557
+ return $defineProperty(O, P, Attributes);
558
+ } catch (error) { /* empty */ }
559
+ if ('get' in Attributes || 'set' in Attributes) throw $TypeError$7('Accessors not supported');
560
+ if ('value' in Attributes) O[P] = Attributes.value;
561
+ return O;
562
+ };
563
+
564
+ var DESCRIPTORS$6 = descriptors;
565
+ var definePropertyModule$5 = objectDefineProperty;
566
+ var createPropertyDescriptor$2 = createPropertyDescriptor$4;
567
+
568
+ var createNonEnumerableProperty$4 = DESCRIPTORS$6 ? function (object, key, value) {
569
+ return definePropertyModule$5.f(object, key, createPropertyDescriptor$2(1, value));
570
+ } : function (object, key, value) {
571
+ object[key] = value;
572
+ return object;
573
+ };
574
+
575
+ var makeBuiltIn$2 = {exports: {}};
576
+
577
+ var DESCRIPTORS$5 = descriptors;
578
+ var hasOwn$7 = hasOwnProperty_1;
579
+
580
+ var FunctionPrototype$1 = Function.prototype;
581
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
582
+ var getDescriptor = DESCRIPTORS$5 && Object.getOwnPropertyDescriptor;
583
+
584
+ var EXISTS = hasOwn$7(FunctionPrototype$1, 'name');
585
+ // additional protection from minified / mangled / dropped function names
586
+ var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
587
+ var CONFIGURABLE = EXISTS && (!DESCRIPTORS$5 || (DESCRIPTORS$5 && getDescriptor(FunctionPrototype$1, 'name').configurable));
588
+
589
+ var functionName = {
590
+ EXISTS: EXISTS,
591
+ PROPER: PROPER,
592
+ CONFIGURABLE: CONFIGURABLE
593
+ };
594
+
595
+ var uncurryThis$8 = functionUncurryThis;
596
+ var isCallable$e = isCallable$k;
597
+ var store$1 = sharedStore;
598
+
599
+ var functionToString = uncurryThis$8(Function.toString);
600
+
601
+ // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
602
+ if (!isCallable$e(store$1.inspectSource)) {
603
+ store$1.inspectSource = function (it) {
604
+ return functionToString(it);
605
+ };
606
+ }
607
+
608
+ var inspectSource$3 = store$1.inspectSource;
609
+
610
+ var global$c = global$j;
611
+ var isCallable$d = isCallable$k;
612
+
613
+ var WeakMap$1 = global$c.WeakMap;
614
+
615
+ var weakMapBasicDetection = isCallable$d(WeakMap$1) && /native code/.test(String(WeakMap$1));
616
+
617
+ var shared$1 = shared$3.exports;
618
+ var uid = uid$2;
619
+
620
+ var keys = shared$1('keys');
621
+
622
+ var sharedKey$3 = function (key) {
623
+ return keys[key] || (keys[key] = uid(key));
624
+ };
625
+
626
+ var hiddenKeys$4 = {};
627
+
628
+ var NATIVE_WEAK_MAP = weakMapBasicDetection;
629
+ var global$b = global$j;
630
+ var isObject$3 = isObject$8;
631
+ var createNonEnumerableProperty$3 = createNonEnumerableProperty$4;
632
+ var hasOwn$6 = hasOwnProperty_1;
633
+ var shared = sharedStore;
634
+ var sharedKey$2 = sharedKey$3;
635
+ var hiddenKeys$3 = hiddenKeys$4;
636
+
637
+ var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
638
+ var TypeError$2 = global$b.TypeError;
639
+ var WeakMap = global$b.WeakMap;
640
+ var set$1, get, has;
641
+
642
+ var enforce = function (it) {
643
+ return has(it) ? get(it) : set$1(it, {});
644
+ };
645
+
646
+ var getterFor = function (TYPE) {
647
+ return function (it) {
648
+ var state;
649
+ if (!isObject$3(it) || (state = get(it)).type !== TYPE) {
650
+ throw TypeError$2('Incompatible receiver, ' + TYPE + ' required');
651
+ } return state;
652
+ };
653
+ };
654
+
655
+ if (NATIVE_WEAK_MAP || shared.state) {
656
+ var store = shared.state || (shared.state = new WeakMap());
657
+ /* eslint-disable no-self-assign -- prototype methods protection */
658
+ store.get = store.get;
659
+ store.has = store.has;
660
+ store.set = store.set;
661
+ /* eslint-enable no-self-assign -- prototype methods protection */
662
+ set$1 = function (it, metadata) {
663
+ if (store.has(it)) throw TypeError$2(OBJECT_ALREADY_INITIALIZED);
664
+ metadata.facade = it;
665
+ store.set(it, metadata);
666
+ return metadata;
667
+ };
668
+ get = function (it) {
669
+ return store.get(it) || {};
670
+ };
671
+ has = function (it) {
672
+ return store.has(it);
673
+ };
674
+ } else {
675
+ var STATE = sharedKey$2('state');
676
+ hiddenKeys$3[STATE] = true;
677
+ set$1 = function (it, metadata) {
678
+ if (hasOwn$6(it, STATE)) throw TypeError$2(OBJECT_ALREADY_INITIALIZED);
679
+ metadata.facade = it;
680
+ createNonEnumerableProperty$3(it, STATE, metadata);
681
+ return metadata;
682
+ };
683
+ get = function (it) {
684
+ return hasOwn$6(it, STATE) ? it[STATE] : {};
685
+ };
686
+ has = function (it) {
687
+ return hasOwn$6(it, STATE);
688
+ };
689
+ }
690
+
691
+ var internalState = {
692
+ set: set$1,
693
+ get: get,
694
+ has: has,
695
+ enforce: enforce,
696
+ getterFor: getterFor
697
+ };
698
+
699
+ var fails$6 = fails$d;
700
+ var isCallable$c = isCallable$k;
701
+ var hasOwn$5 = hasOwnProperty_1;
702
+ var DESCRIPTORS$4 = descriptors;
703
+ var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
704
+ var inspectSource$2 = inspectSource$3;
705
+ var InternalStateModule$2 = internalState;
706
+
707
+ var enforceInternalState = InternalStateModule$2.enforce;
708
+ var getInternalState$1 = InternalStateModule$2.get;
709
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
710
+ var defineProperty$4 = Object.defineProperty;
711
+
712
+ var CONFIGURABLE_LENGTH = DESCRIPTORS$4 && !fails$6(function () {
713
+ return defineProperty$4(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
714
+ });
715
+
716
+ var TEMPLATE = String(String).split('String');
717
+
718
+ var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
719
+ if (String(name).slice(0, 7) === 'Symbol(') {
720
+ name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
721
+ }
722
+ if (options && options.getter) name = 'get ' + name;
723
+ if (options && options.setter) name = 'set ' + name;
724
+ if (!hasOwn$5(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
725
+ if (DESCRIPTORS$4) defineProperty$4(value, 'name', { value: name, configurable: true });
726
+ else value.name = name;
727
+ }
728
+ if (CONFIGURABLE_LENGTH && options && hasOwn$5(options, 'arity') && value.length !== options.arity) {
729
+ defineProperty$4(value, 'length', { value: options.arity });
730
+ }
731
+ try {
732
+ if (options && hasOwn$5(options, 'constructor') && options.constructor) {
733
+ if (DESCRIPTORS$4) defineProperty$4(value, 'prototype', { writable: false });
734
+ // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
735
+ } else if (value.prototype) value.prototype = undefined;
736
+ } catch (error) { /* empty */ }
737
+ var state = enforceInternalState(value);
738
+ if (!hasOwn$5(state, 'source')) {
739
+ state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
740
+ } return value;
741
+ };
742
+
743
+ // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
744
+ // eslint-disable-next-line no-extend-native -- required
745
+ Function.prototype.toString = makeBuiltIn$1(function toString() {
746
+ return isCallable$c(this) && getInternalState$1(this).source || inspectSource$2(this);
747
+ }, 'toString');
748
+
749
+ var isCallable$b = isCallable$k;
750
+ var definePropertyModule$4 = objectDefineProperty;
751
+ var makeBuiltIn = makeBuiltIn$2.exports;
752
+ var defineGlobalProperty$1 = defineGlobalProperty$3;
753
+
754
+ var defineBuiltIn$5 = function (O, key, value, options) {
755
+ if (!options) options = {};
756
+ var simple = options.enumerable;
757
+ var name = options.name !== undefined ? options.name : key;
758
+ if (isCallable$b(value)) makeBuiltIn(value, name, options);
759
+ if (options.global) {
760
+ if (simple) O[key] = value;
761
+ else defineGlobalProperty$1(key, value);
762
+ } else {
763
+ try {
764
+ if (!options.unsafe) delete O[key];
765
+ else if (O[key]) simple = true;
766
+ } catch (error) { /* empty */ }
767
+ if (simple) O[key] = value;
768
+ else definePropertyModule$4.f(O, key, {
769
+ value: value,
770
+ enumerable: false,
771
+ configurable: !options.nonConfigurable,
772
+ writable: !options.nonWritable
773
+ });
774
+ } return O;
775
+ };
776
+
777
+ var objectGetOwnPropertyNames = {};
778
+
779
+ var ceil = Math.ceil;
780
+ var floor = Math.floor;
781
+
782
+ // `Math.trunc` method
783
+ // https://tc39.es/ecma262/#sec-math.trunc
784
+ // eslint-disable-next-line es/no-math-trunc -- safe
785
+ var mathTrunc = Math.trunc || function trunc(x) {
786
+ var n = +x;
787
+ return (n > 0 ? floor : ceil)(n);
788
+ };
789
+
790
+ var trunc = mathTrunc;
791
+
792
+ // `ToIntegerOrInfinity` abstract operation
793
+ // https://tc39.es/ecma262/#sec-tointegerorinfinity
794
+ var toIntegerOrInfinity$2 = function (argument) {
795
+ var number = +argument;
796
+ // eslint-disable-next-line no-self-compare -- NaN check
797
+ return number !== number || number === 0 ? 0 : trunc(number);
798
+ };
799
+
800
+ var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
801
+
802
+ var max = Math.max;
803
+ var min$1 = Math.min;
804
+
805
+ // Helper for a popular repeating case of the spec:
806
+ // Let integer be ? ToInteger(index).
807
+ // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
808
+ var toAbsoluteIndex$1 = function (index, length) {
809
+ var integer = toIntegerOrInfinity$1(index);
810
+ return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
811
+ };
812
+
813
+ var toIntegerOrInfinity = toIntegerOrInfinity$2;
814
+
815
+ var min = Math.min;
816
+
817
+ // `ToLength` abstract operation
818
+ // https://tc39.es/ecma262/#sec-tolength
819
+ var toLength$1 = function (argument) {
820
+ return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
821
+ };
822
+
823
+ var toLength = toLength$1;
824
+
825
+ // `LengthOfArrayLike` abstract operation
826
+ // https://tc39.es/ecma262/#sec-lengthofarraylike
827
+ var lengthOfArrayLike$2 = function (obj) {
828
+ return toLength(obj.length);
829
+ };
830
+
831
+ var toIndexedObject$3 = toIndexedObject$5;
832
+ var toAbsoluteIndex = toAbsoluteIndex$1;
833
+ var lengthOfArrayLike$1 = lengthOfArrayLike$2;
834
+
835
+ // `Array.prototype.{ indexOf, includes }` methods implementation
836
+ var createMethod = function (IS_INCLUDES) {
837
+ return function ($this, el, fromIndex) {
838
+ var O = toIndexedObject$3($this);
839
+ var length = lengthOfArrayLike$1(O);
840
+ var index = toAbsoluteIndex(fromIndex, length);
841
+ var value;
842
+ // Array#includes uses SameValueZero equality algorithm
843
+ // eslint-disable-next-line no-self-compare -- NaN check
844
+ if (IS_INCLUDES && el != el) while (length > index) {
845
+ value = O[index++];
846
+ // eslint-disable-next-line no-self-compare -- NaN check
847
+ if (value != value) return true;
848
+ // Array#indexOf ignores holes, Array#includes - not
849
+ } else for (;length > index; index++) {
850
+ if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
851
+ } return !IS_INCLUDES && -1;
852
+ };
853
+ };
854
+
855
+ var arrayIncludes = {
856
+ // `Array.prototype.includes` method
857
+ // https://tc39.es/ecma262/#sec-array.prototype.includes
858
+ includes: createMethod(true),
859
+ // `Array.prototype.indexOf` method
860
+ // https://tc39.es/ecma262/#sec-array.prototype.indexof
861
+ indexOf: createMethod(false)
862
+ };
863
+
864
+ var uncurryThis$7 = functionUncurryThis;
865
+ var hasOwn$4 = hasOwnProperty_1;
866
+ var toIndexedObject$2 = toIndexedObject$5;
867
+ var indexOf = arrayIncludes.indexOf;
868
+ var hiddenKeys$2 = hiddenKeys$4;
869
+
870
+ var push = uncurryThis$7([].push);
871
+
872
+ var objectKeysInternal = function (object, names) {
873
+ var O = toIndexedObject$2(object);
874
+ var i = 0;
875
+ var result = [];
876
+ var key;
877
+ for (key in O) !hasOwn$4(hiddenKeys$2, key) && hasOwn$4(O, key) && push(result, key);
878
+ // Don't enum bug & hidden keys
879
+ while (names.length > i) if (hasOwn$4(O, key = names[i++])) {
880
+ ~indexOf(result, key) || push(result, key);
881
+ }
882
+ return result;
883
+ };
884
+
885
+ // IE8- don't enum bug keys
886
+ var enumBugKeys$3 = [
887
+ 'constructor',
888
+ 'hasOwnProperty',
889
+ 'isPrototypeOf',
890
+ 'propertyIsEnumerable',
891
+ 'toLocaleString',
892
+ 'toString',
893
+ 'valueOf'
894
+ ];
895
+
896
+ var internalObjectKeys$1 = objectKeysInternal;
897
+ var enumBugKeys$2 = enumBugKeys$3;
898
+
899
+ var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
900
+
901
+ // `Object.getOwnPropertyNames` method
902
+ // https://tc39.es/ecma262/#sec-object.getownpropertynames
903
+ // eslint-disable-next-line es/no-object-getownpropertynames -- safe
904
+ objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
905
+ return internalObjectKeys$1(O, hiddenKeys$1);
906
+ };
907
+
908
+ var objectGetOwnPropertySymbols = {};
909
+
910
+ // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
911
+ objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
912
+
913
+ var getBuiltIn$5 = getBuiltIn$8;
914
+ var uncurryThis$6 = functionUncurryThis;
915
+ var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
916
+ var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
917
+ var anObject$8 = anObject$a;
918
+
919
+ var concat$1 = uncurryThis$6([].concat);
920
+
921
+ // all object keys, includes non-enumerable and symbols
922
+ var ownKeys$1 = getBuiltIn$5('Reflect', 'ownKeys') || function ownKeys(it) {
923
+ var keys = getOwnPropertyNamesModule.f(anObject$8(it));
924
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
925
+ return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
926
+ };
927
+
928
+ var hasOwn$3 = hasOwnProperty_1;
929
+ var ownKeys = ownKeys$1;
930
+ var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
931
+ var definePropertyModule$3 = objectDefineProperty;
932
+
933
+ var copyConstructorProperties$1 = function (target, source, exceptions) {
934
+ var keys = ownKeys(source);
935
+ var defineProperty = definePropertyModule$3.f;
936
+ var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
937
+ for (var i = 0; i < keys.length; i++) {
938
+ var key = keys[i];
939
+ if (!hasOwn$3(target, key) && !(exceptions && hasOwn$3(exceptions, key))) {
940
+ defineProperty(target, key, getOwnPropertyDescriptor(source, key));
941
+ }
942
+ }
943
+ };
944
+
945
+ var fails$5 = fails$d;
946
+ var isCallable$a = isCallable$k;
947
+
948
+ var replacement = /#|\.prototype\./;
949
+
950
+ var isForced$2 = function (feature, detection) {
951
+ var value = data[normalize(feature)];
952
+ return value == POLYFILL ? true
953
+ : value == NATIVE ? false
954
+ : isCallable$a(detection) ? fails$5(detection)
955
+ : !!detection;
956
+ };
957
+
958
+ var normalize = isForced$2.normalize = function (string) {
959
+ return String(string).replace(replacement, '.').toLowerCase();
960
+ };
961
+
962
+ var data = isForced$2.data = {};
963
+ var NATIVE = isForced$2.NATIVE = 'N';
964
+ var POLYFILL = isForced$2.POLYFILL = 'P';
965
+
966
+ var isForced_1 = isForced$2;
967
+
968
+ var global$a = global$j;
969
+ var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
970
+ var createNonEnumerableProperty$2 = createNonEnumerableProperty$4;
971
+ var defineBuiltIn$4 = defineBuiltIn$5;
972
+ var defineGlobalProperty = defineGlobalProperty$3;
973
+ var copyConstructorProperties = copyConstructorProperties$1;
974
+ var isForced$1 = isForced_1;
975
+
976
+ /*
977
+ options.target - name of the target object
978
+ options.global - target is the global object
979
+ options.stat - export as static methods of target
980
+ options.proto - export as prototype methods of target
981
+ options.real - real prototype method for the `pure` version
982
+ options.forced - export even if the native feature is available
983
+ options.bind - bind methods to the target, required for the `pure` version
984
+ options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
985
+ options.unsafe - use the simple assignment of property instead of delete + defineProperty
986
+ options.sham - add a flag to not completely full polyfills
987
+ options.enumerable - export as enumerable property
988
+ options.dontCallGetSet - prevent calling a getter on target
989
+ options.name - the .name of the function if it does not match the key
990
+ */
991
+ var _export = function (options, source) {
992
+ var TARGET = options.target;
993
+ var GLOBAL = options.global;
994
+ var STATIC = options.stat;
995
+ var FORCED, target, key, targetProperty, sourceProperty, descriptor;
996
+ if (GLOBAL) {
997
+ target = global$a;
998
+ } else if (STATIC) {
999
+ target = global$a[TARGET] || defineGlobalProperty(TARGET, {});
1000
+ } else {
1001
+ target = (global$a[TARGET] || {}).prototype;
1002
+ }
1003
+ if (target) for (key in source) {
1004
+ sourceProperty = source[key];
1005
+ if (options.dontCallGetSet) {
1006
+ descriptor = getOwnPropertyDescriptor$1(target, key);
1007
+ targetProperty = descriptor && descriptor.value;
1008
+ } else targetProperty = target[key];
1009
+ FORCED = isForced$1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
1010
+ // contained in target
1011
+ if (!FORCED && targetProperty !== undefined) {
1012
+ if (typeof sourceProperty == typeof targetProperty) continue;
1013
+ copyConstructorProperties(sourceProperty, targetProperty);
1014
+ }
1015
+ // add a flag to not completely full polyfills
1016
+ if (options.sham || (targetProperty && targetProperty.sham)) {
1017
+ createNonEnumerableProperty$2(sourceProperty, 'sham', true);
1018
+ }
1019
+ defineBuiltIn$4(target, key, sourceProperty, options);
1020
+ }
1021
+ };
1022
+
1023
+ var internalObjectKeys = objectKeysInternal;
1024
+ var enumBugKeys$1 = enumBugKeys$3;
1025
+
1026
+ // `Object.keys` method
1027
+ // https://tc39.es/ecma262/#sec-object.keys
1028
+ // eslint-disable-next-line es/no-object-keys -- safe
1029
+ var objectKeys$2 = Object.keys || function keys(O) {
1030
+ return internalObjectKeys(O, enumBugKeys$1);
1031
+ };
1032
+
1033
+ var DESCRIPTORS$3 = descriptors;
1034
+ var uncurryThis$5 = functionUncurryThis;
1035
+ var call$9 = functionCall;
1036
+ var fails$4 = fails$d;
1037
+ var objectKeys$1 = objectKeys$2;
1038
+ var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
1039
+ var propertyIsEnumerableModule = objectPropertyIsEnumerable;
1040
+ var toObject$1 = toObject$3;
1041
+ var IndexedObject = indexedObject;
1042
+
1043
+ // eslint-disable-next-line es/no-object-assign -- safe
1044
+ var $assign = Object.assign;
1045
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
1046
+ var defineProperty$3 = Object.defineProperty;
1047
+ var concat = uncurryThis$5([].concat);
1048
+
1049
+ // `Object.assign` method
1050
+ // https://tc39.es/ecma262/#sec-object.assign
1051
+ var objectAssign = !$assign || fails$4(function () {
1052
+ // should have correct order of operations (Edge bug)
1053
+ if (DESCRIPTORS$3 && $assign({ b: 1 }, $assign(defineProperty$3({}, 'a', {
1054
+ enumerable: true,
1055
+ get: function () {
1056
+ defineProperty$3(this, 'b', {
1057
+ value: 3,
1058
+ enumerable: false
1059
+ });
1060
+ }
1061
+ }), { b: 2 })).b !== 1) return true;
1062
+ // should work with symbols and should have deterministic property order (V8 bug)
1063
+ var A = {};
1064
+ var B = {};
1065
+ // eslint-disable-next-line es/no-symbol -- safe
1066
+ var symbol = Symbol();
1067
+ var alphabet = 'abcdefghijklmnopqrst';
1068
+ A[symbol] = 7;
1069
+ alphabet.split('').forEach(function (chr) { B[chr] = chr; });
1070
+ return $assign({}, A)[symbol] != 7 || objectKeys$1($assign({}, B)).join('') != alphabet;
1071
+ }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
1072
+ var T = toObject$1(target);
1073
+ var argumentsLength = arguments.length;
1074
+ var index = 1;
1075
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
1076
+ var propertyIsEnumerable = propertyIsEnumerableModule.f;
1077
+ while (argumentsLength > index) {
1078
+ var S = IndexedObject(arguments[index++]);
1079
+ var keys = getOwnPropertySymbols ? concat(objectKeys$1(S), getOwnPropertySymbols(S)) : objectKeys$1(S);
1080
+ var length = keys.length;
1081
+ var j = 0;
1082
+ var key;
1083
+ while (length > j) {
1084
+ key = keys[j++];
1085
+ if (!DESCRIPTORS$3 || call$9(propertyIsEnumerable, S, key)) T[key] = S[key];
1086
+ }
1087
+ } return T;
1088
+ } : $assign;
1089
+
1090
+ var $$8 = _export;
1091
+ var assign = objectAssign;
1092
+
1093
+ // `Object.assign` method
1094
+ // https://tc39.es/ecma262/#sec-object.assign
1095
+ // eslint-disable-next-line es/no-object-assign -- required for testing
1096
+ $$8({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1097
+ assign: assign
1098
+ });
1099
+
1100
+ const logger = new logger$1.Logger('react-native-extension');
1101
+
1102
+ const useIsMounted = () => {
1103
+ const isMountedRef = react.useRef(true);
1104
+ react.useEffect(() => () => {
1105
+ isMountedRef.current = false;
1106
+ }, []);
1107
+ return react.useCallback(() => isMountedRef.current, [isMountedRef]);
1108
+ };
1109
+
1110
+ const useMessageTransportWebViewBridge = (core, webViewRef) => {
1111
+ const canBroadcastMessages = useIsMounted();
1112
+ /**
1113
+ * Receive a message from the webview and forward it to the client
1114
+ * message transport
1115
+ */
1116
+ const onMessageHandler = event => {
1117
+ if (!canBroadcastMessages()) return;
1118
+ let parsedData = null;
1119
+ try {
1120
+ parsedData = JSON.parse(event.nativeEvent.data);
1121
+ } catch (err) {
1122
+ logger.debug('error parsing data', err);
1123
+ return;
1124
+ }
1125
+ const message = messageTransport.parseMessageTransportData(parsedData);
1126
+ if (!message) {
1127
+ logger.debug('invalid message', message);
1128
+ return;
1129
+ }
1130
+ /**
1131
+ * Only forward messages from the created by the webview
1132
+ */
1133
+ if (message.origin === 'webview') {
1134
+ core.messageTransport.emit(message);
1135
+ }
1136
+ };
1137
+ /**
1138
+ * Send messages created by the client to the webview
1139
+ */
1140
+ react.useEffect(() => {
1141
+ const sendMessageToWebView = message => {
1142
+ if (!canBroadcastMessages()) return;
1143
+ /**
1144
+ * Only forward messages to the webview
1145
+ * that where created by the client/host
1146
+ */
1147
+ if (message.origin === 'host' && webViewRef.current) {
1148
+ webViewRef.current.postMessage(JSON.stringify(message));
1149
+ }
1150
+ };
1151
+ core.messageTransport.on(sendMessageToWebView);
1152
+ return () => {
1153
+ core.messageTransport.off(sendMessageToWebView);
1154
+ };
1155
+ }, [core.messageTransport, webViewRef, canBroadcastMessages]);
1156
+ return {
1157
+ onMessageHandler
1158
+ };
1159
+ };
1160
+
1161
+ var objectDefineProperties = {};
1162
+
1163
+ var DESCRIPTORS$2 = descriptors;
1164
+ var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1165
+ var definePropertyModule$2 = objectDefineProperty;
1166
+ var anObject$7 = anObject$a;
1167
+ var toIndexedObject$1 = toIndexedObject$5;
1168
+ var objectKeys = objectKeys$2;
1169
+
1170
+ // `Object.defineProperties` method
1171
+ // https://tc39.es/ecma262/#sec-object.defineproperties
1172
+ // eslint-disable-next-line es/no-object-defineproperties -- safe
1173
+ objectDefineProperties.f = DESCRIPTORS$2 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1174
+ anObject$7(O);
1175
+ var props = toIndexedObject$1(Properties);
1176
+ var keys = objectKeys(Properties);
1177
+ var length = keys.length;
1178
+ var index = 0;
1179
+ var key;
1180
+ while (length > index) definePropertyModule$2.f(O, key = keys[index++], props[key]);
1181
+ return O;
1182
+ };
1183
+
1184
+ var getBuiltIn$4 = getBuiltIn$8;
1185
+
1186
+ var html$2 = getBuiltIn$4('document', 'documentElement');
1187
+
1188
+ /* global ActiveXObject -- old IE, WSH */
1189
+
1190
+ var anObject$6 = anObject$a;
1191
+ var definePropertiesModule = objectDefineProperties;
1192
+ var enumBugKeys = enumBugKeys$3;
1193
+ var hiddenKeys = hiddenKeys$4;
1194
+ var html$1 = html$2;
1195
+ var documentCreateElement$1 = documentCreateElement$2;
1196
+ var sharedKey$1 = sharedKey$3;
1197
+
1198
+ var GT = '>';
1199
+ var LT = '<';
1200
+ var PROTOTYPE = 'prototype';
1201
+ var SCRIPT = 'script';
1202
+ var IE_PROTO$1 = sharedKey$1('IE_PROTO');
1203
+
1204
+ var EmptyConstructor = function () { /* empty */ };
1205
+
1206
+ var scriptTag = function (content) {
1207
+ return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
1208
+ };
1209
+
1210
+ // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
1211
+ var NullProtoObjectViaActiveX = function (activeXDocument) {
1212
+ activeXDocument.write(scriptTag(''));
1213
+ activeXDocument.close();
1214
+ var temp = activeXDocument.parentWindow.Object;
1215
+ activeXDocument = null; // avoid memory leak
1216
+ return temp;
1217
+ };
1218
+
1219
+ // Create object with fake `null` prototype: use iframe Object with cleared prototype
1220
+ var NullProtoObjectViaIFrame = function () {
1221
+ // Thrash, waste and sodomy: IE GC bug
1222
+ var iframe = documentCreateElement$1('iframe');
1223
+ var JS = 'java' + SCRIPT + ':';
1224
+ var iframeDocument;
1225
+ iframe.style.display = 'none';
1226
+ html$1.appendChild(iframe);
1227
+ // https://github.com/zloirock/core-js/issues/475
1228
+ iframe.src = String(JS);
1229
+ iframeDocument = iframe.contentWindow.document;
1230
+ iframeDocument.open();
1231
+ iframeDocument.write(scriptTag('document.F=Object'));
1232
+ iframeDocument.close();
1233
+ return iframeDocument.F;
1234
+ };
1235
+
1236
+ // Check for document.domain and active x support
1237
+ // No need to use active x approach when document.domain is not set
1238
+ // see https://github.com/es-shims/es5-shim/issues/150
1239
+ // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
1240
+ // avoid IE GC bug
1241
+ var activeXDocument;
1242
+ var NullProtoObject = function () {
1243
+ try {
1244
+ activeXDocument = new ActiveXObject('htmlfile');
1245
+ } catch (error) { /* ignore */ }
1246
+ NullProtoObject = typeof document != 'undefined'
1247
+ ? document.domain && activeXDocument
1248
+ ? NullProtoObjectViaActiveX(activeXDocument) // old IE
1249
+ : NullProtoObjectViaIFrame()
1250
+ : NullProtoObjectViaActiveX(activeXDocument); // WSH
1251
+ var length = enumBugKeys.length;
1252
+ while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
1253
+ return NullProtoObject();
1254
+ };
1255
+
1256
+ hiddenKeys[IE_PROTO$1] = true;
1257
+
1258
+ // `Object.create` method
1259
+ // https://tc39.es/ecma262/#sec-object.create
1260
+ // eslint-disable-next-line es/no-object-create -- safe
1261
+ var objectCreate = Object.create || function create(O, Properties) {
1262
+ var result;
1263
+ if (O !== null) {
1264
+ EmptyConstructor[PROTOTYPE] = anObject$6(O);
1265
+ result = new EmptyConstructor();
1266
+ EmptyConstructor[PROTOTYPE] = null;
1267
+ // add "__proto__" for Object.getPrototypeOf polyfill
1268
+ result[IE_PROTO$1] = O;
1269
+ } else result = NullProtoObject();
1270
+ return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
1271
+ };
1272
+
1273
+ var wellKnownSymbol$c = wellKnownSymbol$e;
1274
+ var create$1 = objectCreate;
1275
+ var defineProperty$2 = objectDefineProperty.f;
1276
+
1277
+ var UNSCOPABLES = wellKnownSymbol$c('unscopables');
1278
+ var ArrayPrototype$1 = Array.prototype;
1279
+
1280
+ // Array.prototype[@@unscopables]
1281
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1282
+ if (ArrayPrototype$1[UNSCOPABLES] == undefined) {
1283
+ defineProperty$2(ArrayPrototype$1, UNSCOPABLES, {
1284
+ configurable: true,
1285
+ value: create$1(null)
1286
+ });
1287
+ }
1288
+
1289
+ // add a key to Array.prototype[@@unscopables]
1290
+ var addToUnscopables$1 = function (key) {
1291
+ ArrayPrototype$1[UNSCOPABLES][key] = true;
1292
+ };
1293
+
1294
+ var iterators = {};
1295
+
1296
+ var fails$3 = fails$d;
1297
+
1298
+ var correctPrototypeGetter = !fails$3(function () {
1299
+ function F() { /* empty */ }
1300
+ F.prototype.constructor = null;
1301
+ // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
1302
+ return Object.getPrototypeOf(new F()) !== F.prototype;
1303
+ });
1304
+
1305
+ var hasOwn$2 = hasOwnProperty_1;
1306
+ var isCallable$9 = isCallable$k;
1307
+ var toObject = toObject$3;
1308
+ var sharedKey = sharedKey$3;
1309
+ var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
1310
+
1311
+ var IE_PROTO = sharedKey('IE_PROTO');
1312
+ var $Object$1 = Object;
1313
+ var ObjectPrototype = $Object$1.prototype;
1314
+
1315
+ // `Object.getPrototypeOf` method
1316
+ // https://tc39.es/ecma262/#sec-object.getprototypeof
1317
+ // eslint-disable-next-line es/no-object-getprototypeof -- safe
1318
+ var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object$1.getPrototypeOf : function (O) {
1319
+ var object = toObject(O);
1320
+ if (hasOwn$2(object, IE_PROTO)) return object[IE_PROTO];
1321
+ var constructor = object.constructor;
1322
+ if (isCallable$9(constructor) && object instanceof constructor) {
1323
+ return constructor.prototype;
1324
+ } return object instanceof $Object$1 ? ObjectPrototype : null;
1325
+ };
1326
+
1327
+ var fails$2 = fails$d;
1328
+ var isCallable$8 = isCallable$k;
1329
+ var isObject$2 = isObject$8;
1330
+ var getPrototypeOf$1 = objectGetPrototypeOf;
1331
+ var defineBuiltIn$3 = defineBuiltIn$5;
1332
+ var wellKnownSymbol$b = wellKnownSymbol$e;
1333
+
1334
+ var ITERATOR$5 = wellKnownSymbol$b('iterator');
1335
+ var BUGGY_SAFARI_ITERATORS$1 = false;
1336
+
1337
+ // `%IteratorPrototype%` object
1338
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
1339
+ var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
1340
+
1341
+ /* eslint-disable es/no-array-prototype-keys -- safe */
1342
+ if ([].keys) {
1343
+ arrayIterator = [].keys();
1344
+ // Safari 8 has buggy iterators w/o `next`
1345
+ if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
1346
+ else {
1347
+ PrototypeOfArrayIteratorPrototype = getPrototypeOf$1(getPrototypeOf$1(arrayIterator));
1348
+ if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
1349
+ }
1350
+ }
1351
+
1352
+ var NEW_ITERATOR_PROTOTYPE = !isObject$2(IteratorPrototype$2) || fails$2(function () {
1353
+ var test = {};
1354
+ // FF44- legacy iterators case
1355
+ return IteratorPrototype$2[ITERATOR$5].call(test) !== test;
1356
+ });
1357
+
1358
+ if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
1359
+
1360
+ // `%IteratorPrototype%[@@iterator]()` method
1361
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
1362
+ if (!isCallable$8(IteratorPrototype$2[ITERATOR$5])) {
1363
+ defineBuiltIn$3(IteratorPrototype$2, ITERATOR$5, function () {
1364
+ return this;
1365
+ });
1366
+ }
1367
+
1368
+ var iteratorsCore = {
1369
+ IteratorPrototype: IteratorPrototype$2,
1370
+ BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
1371
+ };
1372
+
1373
+ var defineProperty$1 = objectDefineProperty.f;
1374
+ var hasOwn$1 = hasOwnProperty_1;
1375
+ var wellKnownSymbol$a = wellKnownSymbol$e;
1376
+
1377
+ var TO_STRING_TAG$3 = wellKnownSymbol$a('toStringTag');
1378
+
1379
+ var setToStringTag$3 = function (target, TAG, STATIC) {
1380
+ if (target && !STATIC) target = target.prototype;
1381
+ if (target && !hasOwn$1(target, TO_STRING_TAG$3)) {
1382
+ defineProperty$1(target, TO_STRING_TAG$3, { configurable: true, value: TAG });
1383
+ }
1384
+ };
1385
+
1386
+ var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
1387
+ var create = objectCreate;
1388
+ var createPropertyDescriptor$1 = createPropertyDescriptor$4;
1389
+ var setToStringTag$2 = setToStringTag$3;
1390
+ var Iterators$4 = iterators;
1391
+
1392
+ var returnThis$1 = function () { return this; };
1393
+
1394
+ var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
1395
+ var TO_STRING_TAG = NAME + ' Iterator';
1396
+ IteratorConstructor.prototype = create(IteratorPrototype$1, { next: createPropertyDescriptor$1(+!ENUMERABLE_NEXT, next) });
1397
+ setToStringTag$2(IteratorConstructor, TO_STRING_TAG, false);
1398
+ Iterators$4[TO_STRING_TAG] = returnThis$1;
1399
+ return IteratorConstructor;
1400
+ };
1401
+
1402
+ var isCallable$7 = isCallable$k;
1403
+
1404
+ var $String = String;
1405
+ var $TypeError$6 = TypeError;
1406
+
1407
+ var aPossiblePrototype$1 = function (argument) {
1408
+ if (typeof argument == 'object' || isCallable$7(argument)) return argument;
1409
+ throw $TypeError$6("Can't set " + $String(argument) + ' as a prototype');
1410
+ };
1411
+
1412
+ /* eslint-disable no-proto -- safe */
1413
+
1414
+ var uncurryThis$4 = functionUncurryThis;
1415
+ var anObject$5 = anObject$a;
1416
+ var aPossiblePrototype = aPossiblePrototype$1;
1417
+
1418
+ // `Object.setPrototypeOf` method
1419
+ // https://tc39.es/ecma262/#sec-object.setprototypeof
1420
+ // Works with __proto__ only. Old v8 can't work with null proto objects.
1421
+ // eslint-disable-next-line es/no-object-setprototypeof -- safe
1422
+ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
1423
+ var CORRECT_SETTER = false;
1424
+ var test = {};
1425
+ var setter;
1426
+ try {
1427
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1428
+ setter = uncurryThis$4(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
1429
+ setter(test, []);
1430
+ CORRECT_SETTER = test instanceof Array;
1431
+ } catch (error) { /* empty */ }
1432
+ return function setPrototypeOf(O, proto) {
1433
+ anObject$5(O);
1434
+ aPossiblePrototype(proto);
1435
+ if (CORRECT_SETTER) setter(O, proto);
1436
+ else O.__proto__ = proto;
1437
+ return O;
1438
+ };
1439
+ }() : undefined);
1440
+
1441
+ var $$7 = _export;
1442
+ var call$8 = functionCall;
1443
+ var FunctionName = functionName;
1444
+ var isCallable$6 = isCallable$k;
1445
+ var createIteratorConstructor = iteratorCreateConstructor;
1446
+ var getPrototypeOf = objectGetPrototypeOf;
1447
+ var setPrototypeOf$1 = objectSetPrototypeOf;
1448
+ var setToStringTag$1 = setToStringTag$3;
1449
+ var createNonEnumerableProperty$1 = createNonEnumerableProperty$4;
1450
+ var defineBuiltIn$2 = defineBuiltIn$5;
1451
+ var wellKnownSymbol$9 = wellKnownSymbol$e;
1452
+ var Iterators$3 = iterators;
1453
+ var IteratorsCore = iteratorsCore;
1454
+
1455
+ var PROPER_FUNCTION_NAME = FunctionName.PROPER;
1456
+ var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
1457
+ var IteratorPrototype = IteratorsCore.IteratorPrototype;
1458
+ var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
1459
+ var ITERATOR$4 = wellKnownSymbol$9('iterator');
1460
+ var KEYS = 'keys';
1461
+ var VALUES = 'values';
1462
+ var ENTRIES = 'entries';
1463
+
1464
+ var returnThis = function () { return this; };
1465
+
1466
+ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
1467
+ createIteratorConstructor(IteratorConstructor, NAME, next);
1468
+
1469
+ var getIterationMethod = function (KIND) {
1470
+ if (KIND === DEFAULT && defaultIterator) return defaultIterator;
1471
+ if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
1472
+ switch (KIND) {
1473
+ case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
1474
+ case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
1475
+ case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
1476
+ } return function () { return new IteratorConstructor(this); };
1477
+ };
1478
+
1479
+ var TO_STRING_TAG = NAME + ' Iterator';
1480
+ var INCORRECT_VALUES_NAME = false;
1481
+ var IterablePrototype = Iterable.prototype;
1482
+ var nativeIterator = IterablePrototype[ITERATOR$4]
1483
+ || IterablePrototype['@@iterator']
1484
+ || DEFAULT && IterablePrototype[DEFAULT];
1485
+ var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
1486
+ var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
1487
+ var CurrentIteratorPrototype, methods, KEY;
1488
+
1489
+ // fix native
1490
+ if (anyNativeIterator) {
1491
+ CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
1492
+ if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
1493
+ if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
1494
+ if (setPrototypeOf$1) {
1495
+ setPrototypeOf$1(CurrentIteratorPrototype, IteratorPrototype);
1496
+ } else if (!isCallable$6(CurrentIteratorPrototype[ITERATOR$4])) {
1497
+ defineBuiltIn$2(CurrentIteratorPrototype, ITERATOR$4, returnThis);
1498
+ }
1499
+ }
1500
+ // Set @@toStringTag to native iterators
1501
+ setToStringTag$1(CurrentIteratorPrototype, TO_STRING_TAG, true);
1502
+ }
1503
+ }
1504
+
1505
+ // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
1506
+ if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
1507
+ if (CONFIGURABLE_FUNCTION_NAME) {
1508
+ createNonEnumerableProperty$1(IterablePrototype, 'name', VALUES);
1509
+ } else {
1510
+ INCORRECT_VALUES_NAME = true;
1511
+ defaultIterator = function values() { return call$8(nativeIterator, this); };
1512
+ }
1513
+ }
1514
+
1515
+ // export additional methods
1516
+ if (DEFAULT) {
1517
+ methods = {
1518
+ values: getIterationMethod(VALUES),
1519
+ keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
1520
+ entries: getIterationMethod(ENTRIES)
1521
+ };
1522
+ if (FORCED) for (KEY in methods) {
1523
+ if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
1524
+ defineBuiltIn$2(IterablePrototype, KEY, methods[KEY]);
1525
+ }
1526
+ } else $$7({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
1527
+ }
1528
+
1529
+ // define iterator
1530
+ if (IterablePrototype[ITERATOR$4] !== defaultIterator) {
1531
+ defineBuiltIn$2(IterablePrototype, ITERATOR$4, defaultIterator, { name: DEFAULT });
1532
+ }
1533
+ Iterators$3[NAME] = defaultIterator;
1534
+
1535
+ return methods;
1536
+ };
1537
+
1538
+ // `CreateIterResultObject` abstract operation
1539
+ // https://tc39.es/ecma262/#sec-createiterresultobject
1540
+ var createIterResultObject$1 = function (value, done) {
1541
+ return { value: value, done: done };
1542
+ };
1543
+
1544
+ var toIndexedObject = toIndexedObject$5;
1545
+ var addToUnscopables = addToUnscopables$1;
1546
+ var Iterators$2 = iterators;
1547
+ var InternalStateModule$1 = internalState;
1548
+ var defineProperty = objectDefineProperty.f;
1549
+ var defineIterator = iteratorDefine;
1550
+ var createIterResultObject = createIterResultObject$1;
1551
+ var DESCRIPTORS$1 = descriptors;
1552
+
1553
+ var ARRAY_ITERATOR = 'Array Iterator';
1554
+ var setInternalState$1 = InternalStateModule$1.set;
1555
+ var getInternalState = InternalStateModule$1.getterFor(ARRAY_ITERATOR);
1556
+
1557
+ // `Array.prototype.entries` method
1558
+ // https://tc39.es/ecma262/#sec-array.prototype.entries
1559
+ // `Array.prototype.keys` method
1560
+ // https://tc39.es/ecma262/#sec-array.prototype.keys
1561
+ // `Array.prototype.values` method
1562
+ // https://tc39.es/ecma262/#sec-array.prototype.values
1563
+ // `Array.prototype[@@iterator]` method
1564
+ // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
1565
+ // `CreateArrayIterator` internal method
1566
+ // https://tc39.es/ecma262/#sec-createarrayiterator
1567
+ var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
1568
+ setInternalState$1(this, {
1569
+ type: ARRAY_ITERATOR,
1570
+ target: toIndexedObject(iterated), // target
1571
+ index: 0, // next index
1572
+ kind: kind // kind
1573
+ });
1574
+ // `%ArrayIteratorPrototype%.next` method
1575
+ // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
1576
+ }, function () {
1577
+ var state = getInternalState(this);
1578
+ var target = state.target;
1579
+ var kind = state.kind;
1580
+ var index = state.index++;
1581
+ if (!target || index >= target.length) {
1582
+ state.target = undefined;
1583
+ return createIterResultObject(undefined, true);
1584
+ }
1585
+ if (kind == 'keys') return createIterResultObject(index, false);
1586
+ if (kind == 'values') return createIterResultObject(target[index], false);
1587
+ return createIterResultObject([index, target[index]], false);
1588
+ }, 'values');
1589
+
1590
+ // argumentsList[@@iterator] is %ArrayProto_values%
1591
+ // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
1592
+ // https://tc39.es/ecma262/#sec-createmappedargumentsobject
1593
+ var values = Iterators$2.Arguments = Iterators$2.Array;
1594
+
1595
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1596
+ addToUnscopables('keys');
1597
+ addToUnscopables('values');
1598
+ addToUnscopables('entries');
1599
+
1600
+ // V8 ~ Chrome 45- bug
1601
+ if (DESCRIPTORS$1 && values.name !== 'values') try {
1602
+ defineProperty(values, 'name', { value: 'values' });
1603
+ } catch (error) { /* empty */ }
1604
+
1605
+ // iterable DOM collections
1606
+ // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
1607
+ var domIterables = {
1608
+ CSSRuleList: 0,
1609
+ CSSStyleDeclaration: 0,
1610
+ CSSValueList: 0,
1611
+ ClientRectList: 0,
1612
+ DOMRectList: 0,
1613
+ DOMStringList: 0,
1614
+ DOMTokenList: 1,
1615
+ DataTransferItemList: 0,
1616
+ FileList: 0,
1617
+ HTMLAllCollection: 0,
1618
+ HTMLCollection: 0,
1619
+ HTMLFormElement: 0,
1620
+ HTMLSelectElement: 0,
1621
+ MediaList: 0,
1622
+ MimeTypeArray: 0,
1623
+ NamedNodeMap: 0,
1624
+ NodeList: 1,
1625
+ PaintRequestList: 0,
1626
+ Plugin: 0,
1627
+ PluginArray: 0,
1628
+ SVGLengthList: 0,
1629
+ SVGNumberList: 0,
1630
+ SVGPathSegList: 0,
1631
+ SVGPointList: 0,
1632
+ SVGStringList: 0,
1633
+ SVGTransformList: 0,
1634
+ SourceBufferList: 0,
1635
+ StyleSheetList: 0,
1636
+ TextTrackCueList: 0,
1637
+ TextTrackList: 0,
1638
+ TouchList: 0
1639
+ };
1640
+
1641
+ // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
1642
+ var documentCreateElement = documentCreateElement$2;
1643
+
1644
+ var classList = documentCreateElement('span').classList;
1645
+ var DOMTokenListPrototype$1 = classList && classList.constructor && classList.constructor.prototype;
1646
+
1647
+ var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
1648
+
1649
+ var global$9 = global$j;
1650
+ var DOMIterables = domIterables;
1651
+ var DOMTokenListPrototype = domTokenListPrototype;
1652
+ var ArrayIteratorMethods = es_array_iterator;
1653
+ var createNonEnumerableProperty = createNonEnumerableProperty$4;
1654
+ var wellKnownSymbol$8 = wellKnownSymbol$e;
1655
+
1656
+ var ITERATOR$3 = wellKnownSymbol$8('iterator');
1657
+ var TO_STRING_TAG$2 = wellKnownSymbol$8('toStringTag');
1658
+ var ArrayValues = ArrayIteratorMethods.values;
1659
+
1660
+ var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
1661
+ if (CollectionPrototype) {
1662
+ // some Chrome versions have non-configurable methods on DOMTokenList
1663
+ if (CollectionPrototype[ITERATOR$3] !== ArrayValues) try {
1664
+ createNonEnumerableProperty(CollectionPrototype, ITERATOR$3, ArrayValues);
1665
+ } catch (error) {
1666
+ CollectionPrototype[ITERATOR$3] = ArrayValues;
1667
+ }
1668
+ if (!CollectionPrototype[TO_STRING_TAG$2]) {
1669
+ createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG$2, COLLECTION_NAME);
1670
+ }
1671
+ if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
1672
+ // some Chrome versions have non-configurable methods on DOMTokenList
1673
+ if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
1674
+ createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
1675
+ } catch (error) {
1676
+ CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
1677
+ }
1678
+ }
1679
+ }
1680
+ };
1681
+
1682
+ for (var COLLECTION_NAME in DOMIterables) {
1683
+ handlePrototype(global$9[COLLECTION_NAME] && global$9[COLLECTION_NAME].prototype, COLLECTION_NAME);
1684
+ }
1685
+
1686
+ handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
1687
+
1688
+ const useWebViewVisibility = core => {
1689
+ const webViewVisibilityRequestChannelRef = react.useRef(messageTransport.createRequestChannel(core.messageTransport));
1690
+ const [visible, setVisible] = react.useState(false);
1691
+ react.useEffect(() => webViewVisibilityRequestChannelRef.current.handle('setVisibility', setVisible), [setVisible]);
1692
+ return {
1693
+ visible
1694
+ };
1695
+ };
1696
+
1697
+ const styles = reactNative.StyleSheet.create({
1698
+ container: {
1699
+ backgroundColor: 'transparent',
1700
+ bottom: 0,
1701
+ flex: 1,
1702
+ left: 0,
1703
+ position: 'absolute',
1704
+ right: 0,
1705
+ top: 0,
1706
+ width: '100%'
1707
+ },
1708
+ hide: {
1709
+ elevation: 0,
1710
+ opacity: 0,
1711
+ zIndex: -10000
1712
+ },
1713
+ show: {
1714
+ elevation: 10000,
1715
+ opacity: 1,
1716
+ zIndex: 10000
1717
+ },
1718
+ webview: {
1719
+ backgroundColor: 'transparent',
1720
+ flex: 1
1721
+ }
1722
+ });
1723
+
1724
+ const WebView = ({
1725
+ webviewUrl,
1726
+ core,
1727
+ webviewDebuggingEnabled: _webviewDebuggingEnabled = false
1728
+ }) => {
1729
+ const webViewRef = react.useRef(null);
1730
+ const {
1731
+ visible
1732
+ } = useWebViewVisibility(core);
1733
+ const {
1734
+ onMessageHandler
1735
+ } = useMessageTransportWebViewBridge(core, webViewRef);
1736
+ const containerStyles = [styles['container'], visible ? styles.show : styles.hide];
1737
+ return /*#__PURE__*/jsxRuntime.jsx(reactNativeWebview.WebView, {
1738
+ ref: webViewRef,
1739
+ source: {
1740
+ uri: webviewUrl
1741
+ },
1742
+ containerStyle: containerStyles,
1743
+ style: styles['webview'],
1744
+ onMessage: onMessageHandler,
1745
+ hideKeyboardAccessoryView: true,
1746
+ webviewDebuggingEnabled: _webviewDebuggingEnabled,
1747
+ onError: () => core.initialization.error = new Error('Could not load Dynamic WebView')
1748
+ }, 'webview');
1749
+ };
1750
+ const createWebView = props => {
1751
+ const WebViewWrapper = () => /*#__PURE__*/jsxRuntime.jsx(WebView, Object.assign({}, props));
1752
+ return WebViewWrapper;
1753
+ };
1754
+
1755
+ var classof$3 = classofRaw$2;
1756
+ var global$8 = global$j;
1757
+
1758
+ var engineIsNode = classof$3(global$8.process) == 'process';
1759
+
1760
+ var getBuiltIn$3 = getBuiltIn$8;
1761
+ var definePropertyModule$1 = objectDefineProperty;
1762
+ var wellKnownSymbol$7 = wellKnownSymbol$e;
1763
+ var DESCRIPTORS = descriptors;
1764
+
1765
+ var SPECIES$2 = wellKnownSymbol$7('species');
1766
+
1767
+ var setSpecies$1 = function (CONSTRUCTOR_NAME) {
1768
+ var Constructor = getBuiltIn$3(CONSTRUCTOR_NAME);
1769
+ var defineProperty = definePropertyModule$1.f;
1770
+
1771
+ if (DESCRIPTORS && Constructor && !Constructor[SPECIES$2]) {
1772
+ defineProperty(Constructor, SPECIES$2, {
1773
+ configurable: true,
1774
+ get: function () { return this; }
1775
+ });
1776
+ }
1777
+ };
1778
+
1779
+ var isPrototypeOf$1 = objectIsPrototypeOf;
1780
+
1781
+ var $TypeError$5 = TypeError;
1782
+
1783
+ var anInstance$1 = function (it, Prototype) {
1784
+ if (isPrototypeOf$1(Prototype, it)) return it;
1785
+ throw $TypeError$5('Incorrect invocation');
1786
+ };
1787
+
1788
+ var wellKnownSymbol$6 = wellKnownSymbol$e;
1789
+
1790
+ var TO_STRING_TAG$1 = wellKnownSymbol$6('toStringTag');
1791
+ var test = {};
1792
+
1793
+ test[TO_STRING_TAG$1] = 'z';
1794
+
1795
+ var toStringTagSupport = String(test) === '[object z]';
1796
+
1797
+ var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1798
+ var isCallable$5 = isCallable$k;
1799
+ var classofRaw$1 = classofRaw$2;
1800
+ var wellKnownSymbol$5 = wellKnownSymbol$e;
1801
+
1802
+ var TO_STRING_TAG = wellKnownSymbol$5('toStringTag');
1803
+ var $Object = Object;
1804
+
1805
+ // ES3 wrong here
1806
+ var CORRECT_ARGUMENTS = classofRaw$1(function () { return arguments; }()) == 'Arguments';
1807
+
1808
+ // fallback for IE11 Script Access Denied error
1809
+ var tryGet = function (it, key) {
1810
+ try {
1811
+ return it[key];
1812
+ } catch (error) { /* empty */ }
1813
+ };
1814
+
1815
+ // getting tag from ES6+ `Object.prototype.toString`
1816
+ var classof$2 = TO_STRING_TAG_SUPPORT ? classofRaw$1 : function (it) {
1817
+ var O, tag, result;
1818
+ return it === undefined ? 'Undefined' : it === null ? 'Null'
1819
+ // @@toStringTag case
1820
+ : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
1821
+ // builtinTag case
1822
+ : CORRECT_ARGUMENTS ? classofRaw$1(O)
1823
+ // ES3 arguments fallback
1824
+ : (result = classofRaw$1(O)) == 'Object' && isCallable$5(O.callee) ? 'Arguments' : result;
1825
+ };
1826
+
1827
+ var uncurryThis$3 = functionUncurryThis;
1828
+ var fails$1 = fails$d;
1829
+ var isCallable$4 = isCallable$k;
1830
+ var classof$1 = classof$2;
1831
+ var getBuiltIn$2 = getBuiltIn$8;
1832
+ var inspectSource$1 = inspectSource$3;
1833
+
1834
+ var noop = function () { /* empty */ };
1835
+ var empty = [];
1836
+ var construct = getBuiltIn$2('Reflect', 'construct');
1837
+ var constructorRegExp = /^\s*(?:class|function)\b/;
1838
+ var exec = uncurryThis$3(constructorRegExp.exec);
1839
+ var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
1840
+
1841
+ var isConstructorModern = function isConstructor(argument) {
1842
+ if (!isCallable$4(argument)) return false;
1843
+ try {
1844
+ construct(noop, empty, argument);
1845
+ return true;
1846
+ } catch (error) {
1847
+ return false;
1848
+ }
1849
+ };
1850
+
1851
+ var isConstructorLegacy = function isConstructor(argument) {
1852
+ if (!isCallable$4(argument)) return false;
1853
+ switch (classof$1(argument)) {
1854
+ case 'AsyncFunction':
1855
+ case 'GeneratorFunction':
1856
+ case 'AsyncGeneratorFunction': return false;
1857
+ }
1858
+ try {
1859
+ // we can't check .prototype since constructors produced by .bind haven't it
1860
+ // `Function#toString` throws on some built-it function in some legacy engines
1861
+ // (for example, `DOMQuad` and similar in FF41-)
1862
+ return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource$1(argument));
1863
+ } catch (error) {
1864
+ return true;
1865
+ }
1866
+ };
1867
+
1868
+ isConstructorLegacy.sham = true;
1869
+
1870
+ // `IsConstructor` abstract operation
1871
+ // https://tc39.es/ecma262/#sec-isconstructor
1872
+ var isConstructor$1 = !construct || fails$1(function () {
1873
+ var called;
1874
+ return isConstructorModern(isConstructorModern.call)
1875
+ || !isConstructorModern(Object)
1876
+ || !isConstructorModern(function () { called = true; })
1877
+ || called;
1878
+ }) ? isConstructorLegacy : isConstructorModern;
1879
+
1880
+ var isConstructor = isConstructor$1;
1881
+ var tryToString$2 = tryToString$4;
1882
+
1883
+ var $TypeError$4 = TypeError;
1884
+
1885
+ // `Assert: IsConstructor(argument) is true`
1886
+ var aConstructor$1 = function (argument) {
1887
+ if (isConstructor(argument)) return argument;
1888
+ throw $TypeError$4(tryToString$2(argument) + ' is not a constructor');
1889
+ };
1890
+
1891
+ var anObject$4 = anObject$a;
1892
+ var aConstructor = aConstructor$1;
1893
+ var isNullOrUndefined$1 = isNullOrUndefined$4;
1894
+ var wellKnownSymbol$4 = wellKnownSymbol$e;
1895
+
1896
+ var SPECIES$1 = wellKnownSymbol$4('species');
1897
+
1898
+ // `SpeciesConstructor` abstract operation
1899
+ // https://tc39.es/ecma262/#sec-speciesconstructor
1900
+ var speciesConstructor$1 = function (O, defaultConstructor) {
1901
+ var C = anObject$4(O).constructor;
1902
+ var S;
1903
+ return C === undefined || isNullOrUndefined$1(S = anObject$4(C)[SPECIES$1]) ? defaultConstructor : aConstructor(S);
1904
+ };
1905
+
1906
+ var NATIVE_BIND$1 = functionBindNative;
1907
+
1908
+ var FunctionPrototype = Function.prototype;
1909
+ var apply$1 = FunctionPrototype.apply;
1910
+ var call$7 = FunctionPrototype.call;
1911
+
1912
+ // eslint-disable-next-line es/no-reflect -- safe
1913
+ var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$1 ? call$7.bind(apply$1) : function () {
1914
+ return call$7.apply(apply$1, arguments);
1915
+ });
1916
+
1917
+ var classofRaw = classofRaw$2;
1918
+ var uncurryThis$2 = functionUncurryThis;
1919
+
1920
+ var functionUncurryThisClause = function (fn) {
1921
+ // Nashorn bug:
1922
+ // https://github.com/zloirock/core-js/issues/1128
1923
+ // https://github.com/zloirock/core-js/issues/1130
1924
+ if (classofRaw(fn) === 'Function') return uncurryThis$2(fn);
1925
+ };
1926
+
1927
+ var uncurryThis$1 = functionUncurryThisClause;
1928
+ var aCallable$5 = aCallable$7;
1929
+ var NATIVE_BIND = functionBindNative;
1930
+
1931
+ var bind$4 = uncurryThis$1(uncurryThis$1.bind);
1932
+
1933
+ // optional / simple context binding
1934
+ var functionBindContext = function (fn, that) {
1935
+ aCallable$5(fn);
1936
+ return that === undefined ? fn : NATIVE_BIND ? bind$4(fn, that) : function (/* ...args */) {
1937
+ return fn.apply(that, arguments);
1938
+ };
1939
+ };
1940
+
1941
+ var uncurryThis = functionUncurryThis;
1942
+
1943
+ var arraySlice$1 = uncurryThis([].slice);
1944
+
1945
+ var $TypeError$3 = TypeError;
1946
+
1947
+ var validateArgumentsLength$1 = function (passed, required) {
1948
+ if (passed < required) throw $TypeError$3('Not enough arguments');
1949
+ return passed;
1950
+ };
1951
+
1952
+ var userAgent$2 = engineUserAgent;
1953
+
1954
+ var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$2);
1955
+
1956
+ var global$7 = global$j;
1957
+ var apply = functionApply;
1958
+ var bind$3 = functionBindContext;
1959
+ var isCallable$3 = isCallable$k;
1960
+ var hasOwn = hasOwnProperty_1;
1961
+ var fails = fails$d;
1962
+ var html = html$2;
1963
+ var arraySlice = arraySlice$1;
1964
+ var createElement = documentCreateElement$2;
1965
+ var validateArgumentsLength = validateArgumentsLength$1;
1966
+ var IS_IOS$1 = engineIsIos;
1967
+ var IS_NODE$3 = engineIsNode;
1968
+
1969
+ var set = global$7.setImmediate;
1970
+ var clear = global$7.clearImmediate;
1971
+ var process$2 = global$7.process;
1972
+ var Dispatch = global$7.Dispatch;
1973
+ var Function$1 = global$7.Function;
1974
+ var MessageChannel = global$7.MessageChannel;
1975
+ var String$1 = global$7.String;
1976
+ var counter = 0;
1977
+ var queue$1 = {};
1978
+ var ONREADYSTATECHANGE = 'onreadystatechange';
1979
+ var $location, defer, channel, port;
1980
+
1981
+ try {
1982
+ // Deno throws a ReferenceError on `location` access without `--location` flag
1983
+ $location = global$7.location;
1984
+ } catch (error) { /* empty */ }
1985
+
1986
+ var run = function (id) {
1987
+ if (hasOwn(queue$1, id)) {
1988
+ var fn = queue$1[id];
1989
+ delete queue$1[id];
1990
+ fn();
1991
+ }
1992
+ };
1993
+
1994
+ var runner = function (id) {
1995
+ return function () {
1996
+ run(id);
1997
+ };
1998
+ };
1999
+
2000
+ var listener = function (event) {
2001
+ run(event.data);
2002
+ };
2003
+
2004
+ var post = function (id) {
2005
+ // old engines have not location.origin
2006
+ global$7.postMessage(String$1(id), $location.protocol + '//' + $location.host);
2007
+ };
2008
+
2009
+ // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
2010
+ if (!set || !clear) {
2011
+ set = function setImmediate(handler) {
2012
+ validateArgumentsLength(arguments.length, 1);
2013
+ var fn = isCallable$3(handler) ? handler : Function$1(handler);
2014
+ var args = arraySlice(arguments, 1);
2015
+ queue$1[++counter] = function () {
2016
+ apply(fn, undefined, args);
2017
+ };
2018
+ defer(counter);
2019
+ return counter;
2020
+ };
2021
+ clear = function clearImmediate(id) {
2022
+ delete queue$1[id];
2023
+ };
2024
+ // Node.js 0.8-
2025
+ if (IS_NODE$3) {
2026
+ defer = function (id) {
2027
+ process$2.nextTick(runner(id));
2028
+ };
2029
+ // Sphere (JS game engine) Dispatch API
2030
+ } else if (Dispatch && Dispatch.now) {
2031
+ defer = function (id) {
2032
+ Dispatch.now(runner(id));
2033
+ };
2034
+ // Browsers with MessageChannel, includes WebWorkers
2035
+ // except iOS - https://github.com/zloirock/core-js/issues/624
2036
+ } else if (MessageChannel && !IS_IOS$1) {
2037
+ channel = new MessageChannel();
2038
+ port = channel.port2;
2039
+ channel.port1.onmessage = listener;
2040
+ defer = bind$3(port.postMessage, port);
2041
+ // Browsers with postMessage, skip WebWorkers
2042
+ // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
2043
+ } else if (
2044
+ global$7.addEventListener &&
2045
+ isCallable$3(global$7.postMessage) &&
2046
+ !global$7.importScripts &&
2047
+ $location && $location.protocol !== 'file:' &&
2048
+ !fails(post)
2049
+ ) {
2050
+ defer = post;
2051
+ global$7.addEventListener('message', listener, false);
2052
+ // IE8-
2053
+ } else if (ONREADYSTATECHANGE in createElement('script')) {
2054
+ defer = function (id) {
2055
+ html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
2056
+ html.removeChild(this);
2057
+ run(id);
2058
+ };
2059
+ };
2060
+ // Rest old browsers
2061
+ } else {
2062
+ defer = function (id) {
2063
+ setTimeout(runner(id), 0);
2064
+ };
2065
+ }
2066
+ }
2067
+
2068
+ var task$1 = {
2069
+ set: set,
2070
+ clear: clear
2071
+ };
2072
+
2073
+ var userAgent$1 = engineUserAgent;
2074
+ var global$6 = global$j;
2075
+
2076
+ var engineIsIosPebble = /ipad|iphone|ipod/i.test(userAgent$1) && global$6.Pebble !== undefined;
2077
+
2078
+ var userAgent = engineUserAgent;
2079
+
2080
+ var engineIsWebosWebkit = /web0s(?!.*chrome)/i.test(userAgent);
2081
+
2082
+ var global$5 = global$j;
2083
+ var bind$2 = functionBindContext;
2084
+ var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
2085
+ var macrotask = task$1.set;
2086
+ var IS_IOS = engineIsIos;
2087
+ var IS_IOS_PEBBLE = engineIsIosPebble;
2088
+ var IS_WEBOS_WEBKIT = engineIsWebosWebkit;
2089
+ var IS_NODE$2 = engineIsNode;
2090
+
2091
+ var MutationObserver = global$5.MutationObserver || global$5.WebKitMutationObserver;
2092
+ var document$2 = global$5.document;
2093
+ var process$1 = global$5.process;
2094
+ var Promise$1 = global$5.Promise;
2095
+ // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
2096
+ var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global$5, 'queueMicrotask');
2097
+ var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
2098
+
2099
+ var flush, head, last, notify$1, toggle, node, promise, then;
2100
+
2101
+ // modern engines have queueMicrotask method
2102
+ if (!queueMicrotask) {
2103
+ flush = function () {
2104
+ var parent, fn;
2105
+ if (IS_NODE$2 && (parent = process$1.domain)) parent.exit();
2106
+ while (head) {
2107
+ fn = head.fn;
2108
+ head = head.next;
2109
+ try {
2110
+ fn();
2111
+ } catch (error) {
2112
+ if (head) notify$1();
2113
+ else last = undefined;
2114
+ throw error;
2115
+ }
2116
+ } last = undefined;
2117
+ if (parent) parent.enter();
2118
+ };
2119
+
2120
+ // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
2121
+ // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
2122
+ if (!IS_IOS && !IS_NODE$2 && !IS_WEBOS_WEBKIT && MutationObserver && document$2) {
2123
+ toggle = true;
2124
+ node = document$2.createTextNode('');
2125
+ new MutationObserver(flush).observe(node, { characterData: true });
2126
+ notify$1 = function () {
2127
+ node.data = toggle = !toggle;
2128
+ };
2129
+ // environments with maybe non-completely correct, but existent Promise
2130
+ } else if (!IS_IOS_PEBBLE && Promise$1 && Promise$1.resolve) {
2131
+ // Promise.resolve without an argument throws an error in LG WebOS 2
2132
+ promise = Promise$1.resolve(undefined);
2133
+ // workaround of WebKit ~ iOS Safari 10.1 bug
2134
+ promise.constructor = Promise$1;
2135
+ then = bind$2(promise.then, promise);
2136
+ notify$1 = function () {
2137
+ then(flush);
2138
+ };
2139
+ // Node.js without promises
2140
+ } else if (IS_NODE$2) {
2141
+ notify$1 = function () {
2142
+ process$1.nextTick(flush);
2143
+ };
2144
+ // for other environments - macrotask based on:
2145
+ // - setImmediate
2146
+ // - MessageChannel
2147
+ // - window.postMessage
2148
+ // - onreadystatechange
2149
+ // - setTimeout
2150
+ } else {
2151
+ // strange IE + webpack dev server bug - use .bind(global)
2152
+ macrotask = bind$2(macrotask, global$5);
2153
+ notify$1 = function () {
2154
+ macrotask(flush);
2155
+ };
2156
+ }
2157
+ }
2158
+
2159
+ var microtask$1 = queueMicrotask || function (fn) {
2160
+ var task = { fn: fn, next: undefined };
2161
+ if (last) last.next = task;
2162
+ if (!head) {
2163
+ head = task;
2164
+ notify$1();
2165
+ } last = task;
2166
+ };
2167
+
2168
+ var global$4 = global$j;
2169
+
2170
+ var hostReportErrors$1 = function (a, b) {
2171
+ var console = global$4.console;
2172
+ if (console && console.error) {
2173
+ arguments.length == 1 ? console.error(a) : console.error(a, b);
2174
+ }
2175
+ };
2176
+
2177
+ var perform$3 = function (exec) {
2178
+ try {
2179
+ return { error: false, value: exec() };
2180
+ } catch (error) {
2181
+ return { error: true, value: error };
2182
+ }
2183
+ };
2184
+
2185
+ var Queue$1 = function () {
2186
+ this.head = null;
2187
+ this.tail = null;
2188
+ };
2189
+
2190
+ Queue$1.prototype = {
2191
+ add: function (item) {
2192
+ var entry = { item: item, next: null };
2193
+ if (this.head) this.tail.next = entry;
2194
+ else this.head = entry;
2195
+ this.tail = entry;
2196
+ },
2197
+ get: function () {
2198
+ var entry = this.head;
2199
+ if (entry) {
2200
+ this.head = entry.next;
2201
+ if (this.tail === entry) this.tail = null;
2202
+ return entry.item;
2203
+ }
2204
+ }
2205
+ };
2206
+
2207
+ var queue = Queue$1;
2208
+
2209
+ var global$3 = global$j;
2210
+
2211
+ var promiseNativeConstructor = global$3.Promise;
2212
+
2213
+ /* global Deno -- Deno case */
2214
+
2215
+ var engineIsDeno = typeof Deno == 'object' && Deno && typeof Deno.version == 'object';
2216
+
2217
+ var IS_DENO$1 = engineIsDeno;
2218
+ var IS_NODE$1 = engineIsNode;
2219
+
2220
+ var engineIsBrowser = !IS_DENO$1 && !IS_NODE$1
2221
+ && typeof window == 'object'
2222
+ && typeof document == 'object';
2223
+
2224
+ var global$2 = global$j;
2225
+ var NativePromiseConstructor$3 = promiseNativeConstructor;
2226
+ var isCallable$2 = isCallable$k;
2227
+ var isForced = isForced_1;
2228
+ var inspectSource = inspectSource$3;
2229
+ var wellKnownSymbol$3 = wellKnownSymbol$e;
2230
+ var IS_BROWSER = engineIsBrowser;
2231
+ var IS_DENO = engineIsDeno;
2232
+ var V8_VERSION = engineV8Version;
2233
+
2234
+ NativePromiseConstructor$3 && NativePromiseConstructor$3.prototype;
2235
+ var SPECIES = wellKnownSymbol$3('species');
2236
+ var SUBCLASSING = false;
2237
+ var NATIVE_PROMISE_REJECTION_EVENT$1 = isCallable$2(global$2.PromiseRejectionEvent);
2238
+
2239
+ var FORCED_PROMISE_CONSTRUCTOR$5 = isForced('Promise', function () {
2240
+ var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor$3);
2241
+ var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor$3);
2242
+ // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
2243
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
2244
+ // We can't detect it synchronously, so just check versions
2245
+ if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
2246
+ // We can't use @@species feature detection in V8 since it causes
2247
+ // deoptimization and performance degradation
2248
+ // https://github.com/zloirock/core-js/issues/679
2249
+ if (!V8_VERSION || V8_VERSION < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) {
2250
+ // Detect correctness of subclassing with @@species support
2251
+ var promise = new NativePromiseConstructor$3(function (resolve) { resolve(1); });
2252
+ var FakePromise = function (exec) {
2253
+ exec(function () { /* empty */ }, function () { /* empty */ });
2254
+ };
2255
+ var constructor = promise.constructor = {};
2256
+ constructor[SPECIES] = FakePromise;
2257
+ SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
2258
+ if (!SUBCLASSING) return true;
2259
+ // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
2260
+ } return !GLOBAL_CORE_JS_PROMISE && (IS_BROWSER || IS_DENO) && !NATIVE_PROMISE_REJECTION_EVENT$1;
2261
+ });
2262
+
2263
+ var promiseConstructorDetection = {
2264
+ CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR$5,
2265
+ REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT$1,
2266
+ SUBCLASSING: SUBCLASSING
2267
+ };
2268
+
2269
+ var newPromiseCapability$2 = {};
2270
+
2271
+ var aCallable$4 = aCallable$7;
2272
+
2273
+ var $TypeError$2 = TypeError;
2274
+
2275
+ var PromiseCapability = function (C) {
2276
+ var resolve, reject;
2277
+ this.promise = new C(function ($$resolve, $$reject) {
2278
+ if (resolve !== undefined || reject !== undefined) throw $TypeError$2('Bad Promise constructor');
2279
+ resolve = $$resolve;
2280
+ reject = $$reject;
2281
+ });
2282
+ this.resolve = aCallable$4(resolve);
2283
+ this.reject = aCallable$4(reject);
2284
+ };
2285
+
2286
+ // `NewPromiseCapability` abstract operation
2287
+ // https://tc39.es/ecma262/#sec-newpromisecapability
2288
+ newPromiseCapability$2.f = function (C) {
2289
+ return new PromiseCapability(C);
2290
+ };
2291
+
2292
+ var $$6 = _export;
2293
+ var IS_NODE = engineIsNode;
2294
+ var global$1 = global$j;
2295
+ var call$6 = functionCall;
2296
+ var defineBuiltIn$1 = defineBuiltIn$5;
2297
+ var setPrototypeOf = objectSetPrototypeOf;
2298
+ var setToStringTag = setToStringTag$3;
2299
+ var setSpecies = setSpecies$1;
2300
+ var aCallable$3 = aCallable$7;
2301
+ var isCallable$1 = isCallable$k;
2302
+ var isObject$1 = isObject$8;
2303
+ var anInstance = anInstance$1;
2304
+ var speciesConstructor = speciesConstructor$1;
2305
+ var task = task$1.set;
2306
+ var microtask = microtask$1;
2307
+ var hostReportErrors = hostReportErrors$1;
2308
+ var perform$2 = perform$3;
2309
+ var Queue = queue;
2310
+ var InternalStateModule = internalState;
2311
+ var NativePromiseConstructor$2 = promiseNativeConstructor;
2312
+ var PromiseConstructorDetection = promiseConstructorDetection;
2313
+ var newPromiseCapabilityModule$3 = newPromiseCapability$2;
2314
+
2315
+ var PROMISE = 'Promise';
2316
+ var FORCED_PROMISE_CONSTRUCTOR$4 = PromiseConstructorDetection.CONSTRUCTOR;
2317
+ var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;
2318
+ var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;
2319
+ var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
2320
+ var setInternalState = InternalStateModule.set;
2321
+ var NativePromisePrototype$1 = NativePromiseConstructor$2 && NativePromiseConstructor$2.prototype;
2322
+ var PromiseConstructor = NativePromiseConstructor$2;
2323
+ var PromisePrototype = NativePromisePrototype$1;
2324
+ var TypeError$1 = global$1.TypeError;
2325
+ var document$1 = global$1.document;
2326
+ var process = global$1.process;
2327
+ var newPromiseCapability$1 = newPromiseCapabilityModule$3.f;
2328
+ var newGenericPromiseCapability = newPromiseCapability$1;
2329
+
2330
+ var DISPATCH_EVENT = !!(document$1 && document$1.createEvent && global$1.dispatchEvent);
2331
+ var UNHANDLED_REJECTION = 'unhandledrejection';
2332
+ var REJECTION_HANDLED = 'rejectionhandled';
2333
+ var PENDING = 0;
2334
+ var FULFILLED = 1;
2335
+ var REJECTED = 2;
2336
+ var HANDLED = 1;
2337
+ var UNHANDLED = 2;
2338
+
2339
+ var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
2340
+
2341
+ // helpers
2342
+ var isThenable = function (it) {
2343
+ var then;
2344
+ return isObject$1(it) && isCallable$1(then = it.then) ? then : false;
2345
+ };
2346
+
2347
+ var callReaction = function (reaction, state) {
2348
+ var value = state.value;
2349
+ var ok = state.state == FULFILLED;
2350
+ var handler = ok ? reaction.ok : reaction.fail;
2351
+ var resolve = reaction.resolve;
2352
+ var reject = reaction.reject;
2353
+ var domain = reaction.domain;
2354
+ var result, then, exited;
2355
+ try {
2356
+ if (handler) {
2357
+ if (!ok) {
2358
+ if (state.rejection === UNHANDLED) onHandleUnhandled(state);
2359
+ state.rejection = HANDLED;
2360
+ }
2361
+ if (handler === true) result = value;
2362
+ else {
2363
+ if (domain) domain.enter();
2364
+ result = handler(value); // can throw
2365
+ if (domain) {
2366
+ domain.exit();
2367
+ exited = true;
2368
+ }
2369
+ }
2370
+ if (result === reaction.promise) {
2371
+ reject(TypeError$1('Promise-chain cycle'));
2372
+ } else if (then = isThenable(result)) {
2373
+ call$6(then, result, resolve, reject);
2374
+ } else resolve(result);
2375
+ } else reject(value);
2376
+ } catch (error) {
2377
+ if (domain && !exited) domain.exit();
2378
+ reject(error);
2379
+ }
2380
+ };
2381
+
2382
+ var notify = function (state, isReject) {
2383
+ if (state.notified) return;
2384
+ state.notified = true;
2385
+ microtask(function () {
2386
+ var reactions = state.reactions;
2387
+ var reaction;
2388
+ while (reaction = reactions.get()) {
2389
+ callReaction(reaction, state);
2390
+ }
2391
+ state.notified = false;
2392
+ if (isReject && !state.rejection) onUnhandled(state);
2393
+ });
2394
+ };
2395
+
2396
+ var dispatchEvent = function (name, promise, reason) {
2397
+ var event, handler;
2398
+ if (DISPATCH_EVENT) {
2399
+ event = document$1.createEvent('Event');
2400
+ event.promise = promise;
2401
+ event.reason = reason;
2402
+ event.initEvent(name, false, true);
2403
+ global$1.dispatchEvent(event);
2404
+ } else event = { promise: promise, reason: reason };
2405
+ if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global$1['on' + name])) handler(event);
2406
+ else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
2407
+ };
2408
+
2409
+ var onUnhandled = function (state) {
2410
+ call$6(task, global$1, function () {
2411
+ var promise = state.facade;
2412
+ var value = state.value;
2413
+ var IS_UNHANDLED = isUnhandled(state);
2414
+ var result;
2415
+ if (IS_UNHANDLED) {
2416
+ result = perform$2(function () {
2417
+ if (IS_NODE) {
2418
+ process.emit('unhandledRejection', value, promise);
2419
+ } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
2420
+ });
2421
+ // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
2422
+ state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
2423
+ if (result.error) throw result.value;
2424
+ }
2425
+ });
2426
+ };
2427
+
2428
+ var isUnhandled = function (state) {
2429
+ return state.rejection !== HANDLED && !state.parent;
2430
+ };
2431
+
2432
+ var onHandleUnhandled = function (state) {
2433
+ call$6(task, global$1, function () {
2434
+ var promise = state.facade;
2435
+ if (IS_NODE) {
2436
+ process.emit('rejectionHandled', promise);
2437
+ } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
2438
+ });
2439
+ };
2440
+
2441
+ var bind$1 = function (fn, state, unwrap) {
2442
+ return function (value) {
2443
+ fn(state, value, unwrap);
2444
+ };
2445
+ };
2446
+
2447
+ var internalReject = function (state, value, unwrap) {
2448
+ if (state.done) return;
2449
+ state.done = true;
2450
+ if (unwrap) state = unwrap;
2451
+ state.value = value;
2452
+ state.state = REJECTED;
2453
+ notify(state, true);
2454
+ };
2455
+
2456
+ var internalResolve = function (state, value, unwrap) {
2457
+ if (state.done) return;
2458
+ state.done = true;
2459
+ if (unwrap) state = unwrap;
2460
+ try {
2461
+ if (state.facade === value) throw TypeError$1("Promise can't be resolved itself");
2462
+ var then = isThenable(value);
2463
+ if (then) {
2464
+ microtask(function () {
2465
+ var wrapper = { done: false };
2466
+ try {
2467
+ call$6(then, value,
2468
+ bind$1(internalResolve, wrapper, state),
2469
+ bind$1(internalReject, wrapper, state)
2470
+ );
2471
+ } catch (error) {
2472
+ internalReject(wrapper, error, state);
2473
+ }
2474
+ });
2475
+ } else {
2476
+ state.value = value;
2477
+ state.state = FULFILLED;
2478
+ notify(state, false);
2479
+ }
2480
+ } catch (error) {
2481
+ internalReject({ done: false }, error, state);
2482
+ }
2483
+ };
2484
+
2485
+ // constructor polyfill
2486
+ if (FORCED_PROMISE_CONSTRUCTOR$4) {
2487
+ // 25.4.3.1 Promise(executor)
2488
+ PromiseConstructor = function Promise(executor) {
2489
+ anInstance(this, PromisePrototype);
2490
+ aCallable$3(executor);
2491
+ call$6(Internal, this);
2492
+ var state = getInternalPromiseState(this);
2493
+ try {
2494
+ executor(bind$1(internalResolve, state), bind$1(internalReject, state));
2495
+ } catch (error) {
2496
+ internalReject(state, error);
2497
+ }
2498
+ };
2499
+
2500
+ PromisePrototype = PromiseConstructor.prototype;
2501
+
2502
+ // eslint-disable-next-line no-unused-vars -- required for `.length`
2503
+ Internal = function Promise(executor) {
2504
+ setInternalState(this, {
2505
+ type: PROMISE,
2506
+ done: false,
2507
+ notified: false,
2508
+ parent: false,
2509
+ reactions: new Queue(),
2510
+ rejection: false,
2511
+ state: PENDING,
2512
+ value: undefined
2513
+ });
2514
+ };
2515
+
2516
+ // `Promise.prototype.then` method
2517
+ // https://tc39.es/ecma262/#sec-promise.prototype.then
2518
+ Internal.prototype = defineBuiltIn$1(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
2519
+ var state = getInternalPromiseState(this);
2520
+ var reaction = newPromiseCapability$1(speciesConstructor(this, PromiseConstructor));
2521
+ state.parent = true;
2522
+ reaction.ok = isCallable$1(onFulfilled) ? onFulfilled : true;
2523
+ reaction.fail = isCallable$1(onRejected) && onRejected;
2524
+ reaction.domain = IS_NODE ? process.domain : undefined;
2525
+ if (state.state == PENDING) state.reactions.add(reaction);
2526
+ else microtask(function () {
2527
+ callReaction(reaction, state);
2528
+ });
2529
+ return reaction.promise;
2530
+ });
2531
+
2532
+ OwnPromiseCapability = function () {
2533
+ var promise = new Internal();
2534
+ var state = getInternalPromiseState(promise);
2535
+ this.promise = promise;
2536
+ this.resolve = bind$1(internalResolve, state);
2537
+ this.reject = bind$1(internalReject, state);
2538
+ };
2539
+
2540
+ newPromiseCapabilityModule$3.f = newPromiseCapability$1 = function (C) {
2541
+ return C === PromiseConstructor || C === PromiseWrapper
2542
+ ? new OwnPromiseCapability(C)
2543
+ : newGenericPromiseCapability(C);
2544
+ };
2545
+
2546
+ if (isCallable$1(NativePromiseConstructor$2) && NativePromisePrototype$1 !== Object.prototype) {
2547
+ nativeThen = NativePromisePrototype$1.then;
2548
+
2549
+ if (!NATIVE_PROMISE_SUBCLASSING) {
2550
+ // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
2551
+ defineBuiltIn$1(NativePromisePrototype$1, 'then', function then(onFulfilled, onRejected) {
2552
+ var that = this;
2553
+ return new PromiseConstructor(function (resolve, reject) {
2554
+ call$6(nativeThen, that, resolve, reject);
2555
+ }).then(onFulfilled, onRejected);
2556
+ // https://github.com/zloirock/core-js/issues/640
2557
+ }, { unsafe: true });
2558
+ }
2559
+
2560
+ // make `.constructor === Promise` work for native promise-based APIs
2561
+ try {
2562
+ delete NativePromisePrototype$1.constructor;
2563
+ } catch (error) { /* empty */ }
2564
+
2565
+ // make `instanceof Promise` work for native promise-based APIs
2566
+ if (setPrototypeOf) {
2567
+ setPrototypeOf(NativePromisePrototype$1, PromisePrototype);
2568
+ }
2569
+ }
2570
+ }
2571
+
2572
+ $$6({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR$4 }, {
2573
+ Promise: PromiseConstructor
2574
+ });
2575
+
2576
+ setToStringTag(PromiseConstructor, PROMISE, false);
2577
+ setSpecies(PROMISE);
2578
+
2579
+ var wellKnownSymbol$2 = wellKnownSymbol$e;
2580
+ var Iterators$1 = iterators;
2581
+
2582
+ var ITERATOR$2 = wellKnownSymbol$2('iterator');
2583
+ var ArrayPrototype = Array.prototype;
2584
+
2585
+ // check on default Array iterator
2586
+ var isArrayIteratorMethod$1 = function (it) {
2587
+ return it !== undefined && (Iterators$1.Array === it || ArrayPrototype[ITERATOR$2] === it);
2588
+ };
2589
+
2590
+ var classof = classof$2;
2591
+ var getMethod$1 = getMethod$3;
2592
+ var isNullOrUndefined = isNullOrUndefined$4;
2593
+ var Iterators = iterators;
2594
+ var wellKnownSymbol$1 = wellKnownSymbol$e;
2595
+
2596
+ var ITERATOR$1 = wellKnownSymbol$1('iterator');
2597
+
2598
+ var getIteratorMethod$2 = function (it) {
2599
+ if (!isNullOrUndefined(it)) return getMethod$1(it, ITERATOR$1)
2600
+ || getMethod$1(it, '@@iterator')
2601
+ || Iterators[classof(it)];
2602
+ };
2603
+
2604
+ var call$5 = functionCall;
2605
+ var aCallable$2 = aCallable$7;
2606
+ var anObject$3 = anObject$a;
2607
+ var tryToString$1 = tryToString$4;
2608
+ var getIteratorMethod$1 = getIteratorMethod$2;
2609
+
2610
+ var $TypeError$1 = TypeError;
2611
+
2612
+ var getIterator$1 = function (argument, usingIterator) {
2613
+ var iteratorMethod = arguments.length < 2 ? getIteratorMethod$1(argument) : usingIterator;
2614
+ if (aCallable$2(iteratorMethod)) return anObject$3(call$5(iteratorMethod, argument));
2615
+ throw $TypeError$1(tryToString$1(argument) + ' is not iterable');
2616
+ };
2617
+
2618
+ var call$4 = functionCall;
2619
+ var anObject$2 = anObject$a;
2620
+ var getMethod = getMethod$3;
2621
+
2622
+ var iteratorClose$1 = function (iterator, kind, value) {
2623
+ var innerResult, innerError;
2624
+ anObject$2(iterator);
2625
+ try {
2626
+ innerResult = getMethod(iterator, 'return');
2627
+ if (!innerResult) {
2628
+ if (kind === 'throw') throw value;
2629
+ return value;
2630
+ }
2631
+ innerResult = call$4(innerResult, iterator);
2632
+ } catch (error) {
2633
+ innerError = true;
2634
+ innerResult = error;
2635
+ }
2636
+ if (kind === 'throw') throw value;
2637
+ if (innerError) throw innerResult;
2638
+ anObject$2(innerResult);
2639
+ return value;
2640
+ };
2641
+
2642
+ var bind = functionBindContext;
2643
+ var call$3 = functionCall;
2644
+ var anObject$1 = anObject$a;
2645
+ var tryToString = tryToString$4;
2646
+ var isArrayIteratorMethod = isArrayIteratorMethod$1;
2647
+ var lengthOfArrayLike = lengthOfArrayLike$2;
2648
+ var isPrototypeOf = objectIsPrototypeOf;
2649
+ var getIterator = getIterator$1;
2650
+ var getIteratorMethod = getIteratorMethod$2;
2651
+ var iteratorClose = iteratorClose$1;
2652
+
2653
+ var $TypeError = TypeError;
2654
+
2655
+ var Result = function (stopped, result) {
2656
+ this.stopped = stopped;
2657
+ this.result = result;
2658
+ };
2659
+
2660
+ var ResultPrototype = Result.prototype;
2661
+
2662
+ var iterate$3 = function (iterable, unboundFunction, options) {
2663
+ var that = options && options.that;
2664
+ var AS_ENTRIES = !!(options && options.AS_ENTRIES);
2665
+ var IS_RECORD = !!(options && options.IS_RECORD);
2666
+ var IS_ITERATOR = !!(options && options.IS_ITERATOR);
2667
+ var INTERRUPTED = !!(options && options.INTERRUPTED);
2668
+ var fn = bind(unboundFunction, that);
2669
+ var iterator, iterFn, index, length, result, next, step;
2670
+
2671
+ var stop = function (condition) {
2672
+ if (iterator) iteratorClose(iterator, 'normal', condition);
2673
+ return new Result(true, condition);
2674
+ };
2675
+
2676
+ var callFn = function (value) {
2677
+ if (AS_ENTRIES) {
2678
+ anObject$1(value);
2679
+ return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
2680
+ } return INTERRUPTED ? fn(value, stop) : fn(value);
2681
+ };
2682
+
2683
+ if (IS_RECORD) {
2684
+ iterator = iterable.iterator;
2685
+ } else if (IS_ITERATOR) {
2686
+ iterator = iterable;
2687
+ } else {
2688
+ iterFn = getIteratorMethod(iterable);
2689
+ if (!iterFn) throw $TypeError(tryToString(iterable) + ' is not iterable');
2690
+ // optimisation for array iterators
2691
+ if (isArrayIteratorMethod(iterFn)) {
2692
+ for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
2693
+ result = callFn(iterable[index]);
2694
+ if (result && isPrototypeOf(ResultPrototype, result)) return result;
2695
+ } return new Result(false);
2696
+ }
2697
+ iterator = getIterator(iterable, iterFn);
2698
+ }
2699
+
2700
+ next = IS_RECORD ? iterable.next : iterator.next;
2701
+ while (!(step = call$3(next, iterator)).done) {
2702
+ try {
2703
+ result = callFn(step.value);
2704
+ } catch (error) {
2705
+ iteratorClose(iterator, 'throw', error);
2706
+ }
2707
+ if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
2708
+ } return new Result(false);
2709
+ };
2710
+
2711
+ var wellKnownSymbol = wellKnownSymbol$e;
2712
+
2713
+ var ITERATOR = wellKnownSymbol('iterator');
2714
+ var SAFE_CLOSING = false;
2715
+
2716
+ try {
2717
+ var called = 0;
2718
+ var iteratorWithReturn = {
2719
+ next: function () {
2720
+ return { done: !!called++ };
2721
+ },
2722
+ 'return': function () {
2723
+ SAFE_CLOSING = true;
2724
+ }
2725
+ };
2726
+ iteratorWithReturn[ITERATOR] = function () {
2727
+ return this;
2728
+ };
2729
+ // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing
2730
+ Array.from(iteratorWithReturn, function () { throw 2; });
2731
+ } catch (error) { /* empty */ }
2732
+
2733
+ var checkCorrectnessOfIteration$1 = function (exec, SKIP_CLOSING) {
2734
+ if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
2735
+ var ITERATION_SUPPORT = false;
2736
+ try {
2737
+ var object = {};
2738
+ object[ITERATOR] = function () {
2739
+ return {
2740
+ next: function () {
2741
+ return { done: ITERATION_SUPPORT = true };
2742
+ }
2743
+ };
2744
+ };
2745
+ exec(object);
2746
+ } catch (error) { /* empty */ }
2747
+ return ITERATION_SUPPORT;
2748
+ };
2749
+
2750
+ var NativePromiseConstructor$1 = promiseNativeConstructor;
2751
+ var checkCorrectnessOfIteration = checkCorrectnessOfIteration$1;
2752
+ var FORCED_PROMISE_CONSTRUCTOR$3 = promiseConstructorDetection.CONSTRUCTOR;
2753
+
2754
+ var promiseStaticsIncorrectIteration = FORCED_PROMISE_CONSTRUCTOR$3 || !checkCorrectnessOfIteration(function (iterable) {
2755
+ NativePromiseConstructor$1.all(iterable).then(undefined, function () { /* empty */ });
2756
+ });
2757
+
2758
+ var $$5 = _export;
2759
+ var call$2 = functionCall;
2760
+ var aCallable$1 = aCallable$7;
2761
+ var newPromiseCapabilityModule$2 = newPromiseCapability$2;
2762
+ var perform$1 = perform$3;
2763
+ var iterate$2 = iterate$3;
2764
+ var PROMISE_STATICS_INCORRECT_ITERATION$1 = promiseStaticsIncorrectIteration;
2765
+
2766
+ // `Promise.all` method
2767
+ // https://tc39.es/ecma262/#sec-promise.all
2768
+ $$5({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION$1 }, {
2769
+ all: function all(iterable) {
2770
+ var C = this;
2771
+ var capability = newPromiseCapabilityModule$2.f(C);
2772
+ var resolve = capability.resolve;
2773
+ var reject = capability.reject;
2774
+ var result = perform$1(function () {
2775
+ var $promiseResolve = aCallable$1(C.resolve);
2776
+ var values = [];
2777
+ var counter = 0;
2778
+ var remaining = 1;
2779
+ iterate$2(iterable, function (promise) {
2780
+ var index = counter++;
2781
+ var alreadyCalled = false;
2782
+ remaining++;
2783
+ call$2($promiseResolve, C, promise).then(function (value) {
2784
+ if (alreadyCalled) return;
2785
+ alreadyCalled = true;
2786
+ values[index] = value;
2787
+ --remaining || resolve(values);
2788
+ }, reject);
2789
+ });
2790
+ --remaining || resolve(values);
2791
+ });
2792
+ if (result.error) reject(result.value);
2793
+ return capability.promise;
2794
+ }
2795
+ });
2796
+
2797
+ var $$4 = _export;
2798
+ var FORCED_PROMISE_CONSTRUCTOR$2 = promiseConstructorDetection.CONSTRUCTOR;
2799
+ var NativePromiseConstructor = promiseNativeConstructor;
2800
+ var getBuiltIn$1 = getBuiltIn$8;
2801
+ var isCallable = isCallable$k;
2802
+ var defineBuiltIn = defineBuiltIn$5;
2803
+
2804
+ var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
2805
+
2806
+ // `Promise.prototype.catch` method
2807
+ // https://tc39.es/ecma262/#sec-promise.prototype.catch
2808
+ $$4({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR$2, real: true }, {
2809
+ 'catch': function (onRejected) {
2810
+ return this.then(undefined, onRejected);
2811
+ }
2812
+ });
2813
+
2814
+ // makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`
2815
+ if (isCallable(NativePromiseConstructor)) {
2816
+ var method = getBuiltIn$1('Promise').prototype['catch'];
2817
+ if (NativePromisePrototype['catch'] !== method) {
2818
+ defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true });
2819
+ }
2820
+ }
2821
+
2822
+ var $$3 = _export;
2823
+ var call$1 = functionCall;
2824
+ var aCallable = aCallable$7;
2825
+ var newPromiseCapabilityModule$1 = newPromiseCapability$2;
2826
+ var perform = perform$3;
2827
+ var iterate$1 = iterate$3;
2828
+ var PROMISE_STATICS_INCORRECT_ITERATION = promiseStaticsIncorrectIteration;
2829
+
2830
+ // `Promise.race` method
2831
+ // https://tc39.es/ecma262/#sec-promise.race
2832
+ $$3({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
2833
+ race: function race(iterable) {
2834
+ var C = this;
2835
+ var capability = newPromiseCapabilityModule$1.f(C);
2836
+ var reject = capability.reject;
2837
+ var result = perform(function () {
2838
+ var $promiseResolve = aCallable(C.resolve);
2839
+ iterate$1(iterable, function (promise) {
2840
+ call$1($promiseResolve, C, promise).then(capability.resolve, reject);
2841
+ });
2842
+ });
2843
+ if (result.error) reject(result.value);
2844
+ return capability.promise;
2845
+ }
2846
+ });
2847
+
2848
+ var $$2 = _export;
2849
+ var call = functionCall;
2850
+ var newPromiseCapabilityModule = newPromiseCapability$2;
2851
+ var FORCED_PROMISE_CONSTRUCTOR$1 = promiseConstructorDetection.CONSTRUCTOR;
2852
+
2853
+ // `Promise.reject` method
2854
+ // https://tc39.es/ecma262/#sec-promise.reject
2855
+ $$2({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR$1 }, {
2856
+ reject: function reject(r) {
2857
+ var capability = newPromiseCapabilityModule.f(this);
2858
+ call(capability.reject, undefined, r);
2859
+ return capability.promise;
2860
+ }
2861
+ });
2862
+
2863
+ var anObject = anObject$a;
2864
+ var isObject = isObject$8;
2865
+ var newPromiseCapability = newPromiseCapability$2;
2866
+
2867
+ var promiseResolve$1 = function (C, x) {
2868
+ anObject(C);
2869
+ if (isObject(x) && x.constructor === C) return x;
2870
+ var promiseCapability = newPromiseCapability.f(C);
2871
+ var resolve = promiseCapability.resolve;
2872
+ resolve(x);
2873
+ return promiseCapability.promise;
2874
+ };
2875
+
2876
+ var $$1 = _export;
2877
+ var getBuiltIn = getBuiltIn$8;
2878
+ var FORCED_PROMISE_CONSTRUCTOR = promiseConstructorDetection.CONSTRUCTOR;
2879
+ var promiseResolve = promiseResolve$1;
2880
+
2881
+ getBuiltIn('Promise');
2882
+
2883
+ // `Promise.resolve` method
2884
+ // https://tc39.es/ecma262/#sec-promise.resolve
2885
+ $$1({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
2886
+ resolve: function resolve(x) {
2887
+ return promiseResolve(this, x);
2888
+ }
2889
+ });
2890
+
2891
+ var toPropertyKey = toPropertyKey$3;
2892
+ var definePropertyModule = objectDefineProperty;
2893
+ var createPropertyDescriptor = createPropertyDescriptor$4;
2894
+
2895
+ var createProperty$1 = function (object, key, value) {
2896
+ var propertyKey = toPropertyKey(key);
2897
+ if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
2898
+ else object[propertyKey] = value;
2899
+ };
2900
+
2901
+ var $ = _export;
2902
+ var iterate = iterate$3;
2903
+ var createProperty = createProperty$1;
2904
+
2905
+ // `Object.fromEntries` method
2906
+ // https://github.com/tc39/proposal-object-from-entries
2907
+ $({ target: 'Object', stat: true }, {
2908
+ fromEntries: function fromEntries(iterable) {
2909
+ var obj = {};
2910
+ iterate(iterable, function (k, v) {
2911
+ createProperty(obj, k, v);
2912
+ }, { AS_ENTRIES: true });
2913
+ return obj;
2914
+ }
2915
+ });
2916
+
2917
+ /******************************************************************************
2918
+ Copyright (c) Microsoft Corporation.
2919
+
2920
+ Permission to use, copy, modify, and/or distribute this software for any
2921
+ purpose with or without fee is hereby granted.
2922
+
2923
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
2924
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
2925
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
2926
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
2927
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
2928
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
2929
+ PERFORMANCE OF THIS SOFTWARE.
2930
+ ***************************************************************************** */
2931
+
2932
+ function __awaiter(thisArg, _arguments, P, generator) {
2933
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
2934
+ return new (P || (P = Promise))(function (resolve, reject) {
2935
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
2936
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
2937
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
2938
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
2939
+ });
2940
+ }
2941
+
2942
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
2943
+ var e = new Error(message);
2944
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
2945
+ };
2946
+
2947
+ const setupFetchHandler = core => {
2948
+ const fetchRequestChannel = messageTransport.createRequestChannel(core.messageTransport);
2949
+ fetchRequestChannel.handle('fetch', (input, init) => __awaiter(void 0, void 0, void 0, function* () {
2950
+ const response = yield fetch(input, init);
2951
+ const responseBody = yield response.text();
2952
+ return {
2953
+ body: responseBody,
2954
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2955
+ headers: Object.fromEntries(response.headers.entries()),
2956
+ status: response.status,
2957
+ statusText: response.statusText
2958
+ };
2959
+ }));
2960
+ };
2961
+
2962
+ const setupPlatformHandler = core => {
2963
+ const platformChannel = messageTransport.createRequestChannel(core.messageTransport);
2964
+ core.manifest.setPlatform('react-native');
2965
+ platformChannel.handle('openURL', url => __awaiter(void 0, void 0, void 0, function* () {
2966
+ yield expoLinking.openURL(url);
2967
+ }));
2968
+ platformChannel.handle('openNewWindow', url => __awaiter(void 0, void 0, void 0, function* () {
2969
+ const error = new Error('openNewWindow message handler not implemented');
2970
+ logger.error(error);
2971
+ core.initialization.error = error;
2972
+ throw error;
2973
+ }));
2974
+ // TODO: this is temporary and should be removed once we are able to get the redirect URL from
2975
+ // dashboard as provided from the customer
2976
+ platformChannel.handle('getRedirectUrl', () => __awaiter(void 0, void 0, void 0, function* () {
2977
+ return expoLinking.createURL('');
2978
+ }));
2979
+ };
2980
+
2981
+ const setupPasskeyHandler = core => {
2982
+ const passkeysRequestChannel = messageTransport.createRequestChannel(core.messageTransport);
2983
+ passkeysRequestChannel.handle('createPasskey', _a => __awaiter(void 0, [_a], void 0, function* ({
2984
+ publicKey
2985
+ }) {
2986
+ try {
2987
+ const {
2988
+ attestation
2989
+ } = yield reactNativePasskeyStamper.createPasskey(publicKey);
2990
+ return {
2991
+ attestation
2992
+ };
2993
+ } catch (err) {
2994
+ logger.error(err);
2995
+ throw err;
2996
+ }
2997
+ }));
2998
+ passkeysRequestChannel.handle('passkeyStamp', (rpId, payload) => __awaiter(void 0, void 0, void 0, function* () {
2999
+ try {
3000
+ const stamper = new reactNativePasskeyStamper.PasskeyStamper({
3001
+ rpId
3002
+ });
3003
+ const stamped = yield stamper.stamp(payload);
3004
+ return stamped;
3005
+ } catch (err) {
3006
+ logger.error(err);
3007
+ throw err;
3008
+ }
3009
+ }));
3010
+ };
3011
+
3012
+ const defaultWebviewUrl = `https://webview.dynamicauth.com/${version$1}`;
3013
+ const ReactNativeExtension = ({
3014
+ webviewUrl: _webviewUrl = defaultWebviewUrl,
3015
+ webviewDebuggingEnabled,
3016
+ appOrigin
3017
+ } = {}) => (_, core) => {
3018
+ if (appOrigin) core.manifest.setAppOrigin(appOrigin);
3019
+ setupPasskeyHandler(core);
3020
+ setupFetchHandler(core);
3021
+ setupPlatformHandler(core);
3022
+ return {
3023
+ reactNative: {
3024
+ WebView: createWebView({
3025
+ core,
3026
+ webviewDebuggingEnabled,
3027
+ webviewUrl: _webviewUrl
3028
+ })
3029
+ }
3030
+ };
3031
+ };
3032
+
3033
+ exports.ReactNativeExtension = ReactNativeExtension;