@koine/next 1.0.4 → 1.0.9
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.
- package/Analytics/AnalyticsGoogle.d.ts +5 -6
- package/Analytics/AnalyticsGoogle.js +37 -0
- package/Analytics/index.d.ts +1 -1
- package/Analytics/index.js +1 -0
- package/Analytics/package.json +6 -0
- package/Auth/helpers.d.ts +17 -17
- package/Auth/helpers.js +21 -0
- package/Auth/index.d.ts +4 -4
- package/Auth/index.js +4 -0
- package/Auth/package.json +6 -0
- package/Auth/useLogin.d.ts +7 -7
- package/Auth/useLogin.js +50 -0
- package/Auth/useLoginUrl.d.ts +1 -1
- package/Auth/useLoginUrl.js +11 -0
- package/Auth/useLogout.d.ts +6 -6
- package/Auth/useLogout.js +52 -0
- package/Favicon/Favicon.d.ts +3 -4
- package/Favicon/Favicon.js +4 -0
- package/Favicon/index.d.ts +1 -1
- package/Favicon/index.js +1 -0
- package/Favicon/package.json +6 -0
- package/Forms/index.d.ts +2 -2
- package/Forms/index.js +2 -0
- package/Forms/package.json +6 -0
- package/Forms/useForm.d.ts +32 -32
- package/Forms/useForm.js +37 -0
- package/Forms/useSubmit.d.ts +24 -24
- package/Forms/useSubmit.js +23 -0
- package/Head/Head.d.ts +1 -1
- package/Head/Head.js +1 -0
- package/Head/index.d.ts +1 -1
- package/Head/index.js +1 -0
- package/Head/package.json +6 -0
- package/I18n/I18n.d.ts +44 -48
- package/I18n/I18n.js +74 -0
- package/I18n/index.d.ts +1 -1
- package/I18n/index.js +1 -0
- package/I18n/package.json +6 -0
- package/Img/Img.d.ts +21 -21
- package/Img/Img.js +28 -0
- package/Img/index.d.ts +1 -1
- package/Img/index.js +1 -0
- package/Img/package.json +6 -0
- package/Link/Link.d.ts +9 -8
- package/Link/Link.js +9 -0
- package/Link/index.d.ts +1 -1
- package/Link/index.js +1 -0
- package/Link/package.json +6 -0
- package/NextProgress/NextProgress.d.ts +24 -14
- package/NextProgress/NextProgress.js +37 -0
- package/NextProgress/index.d.ts +2 -1
- package/NextProgress/index.js +1 -0
- package/NextProgress/package.json +6 -0
- package/README.md +0 -0
- package/Seo/Seo.d.ts +3 -3
- package/Seo/Seo.js +8 -0
- package/Seo/SeoDefaults.d.ts +3 -3
- package/Seo/SeoDefaults.js +12 -0
- package/Seo/helpers.d.ts +48 -48
- package/Seo/helpers.js +111 -0
- package/Seo/index.d.ts +12 -12
- package/Seo/index.js +12 -0
- package/Seo/package.json +6 -0
- package/Theme/Theme.d.ts +46 -46
- package/Theme/Theme.js +235 -0
- package/Theme/index.d.ts +1 -1
- package/Theme/index.js +1 -0
- package/Theme/package.json +6 -0
- package/app/AppHead.d.ts +2 -3
- package/app/AppHead.js +5 -0
- package/app/AppMain.d.ts +35 -34
- package/app/AppMain.js +1 -0
- package/app/css/AppMain.d.ts +8 -0
- package/app/css/AppMain.js +11 -0
- package/app/css/AppTheme.d.ts +10 -0
- package/app/css/AppTheme.js +12 -0
- package/app/css/auth/index.d.ts +9 -0
- package/app/css/auth/index.js +13 -0
- package/app/css/auth/package.json +6 -0
- package/app/css/index.d.ts +54 -0
- package/app/css/index.js +57 -0
- package/app/css/package.json +6 -0
- package/app/em/AppMain.d.ts +10 -0
- package/app/em/AppMain.js +22 -0
- package/app/{AppTheme--emotion.d.ts → em/AppTheme.d.ts} +15 -15
- package/app/em/AppTheme.js +17 -0
- package/app/em/auth/index.d.ts +9 -0
- package/app/em/auth/index.js +13 -0
- package/app/em/auth/package.json +6 -0
- package/app/em/index.d.ts +9 -0
- package/app/em/index.js +12 -0
- package/app/em/package.json +6 -0
- package/app/index.d.ts +2 -11
- package/app/index.js +2 -0
- package/app/package.json +6 -0
- package/app/sc/AppMain.d.ts +10 -0
- package/app/sc/AppMain.js +22 -0
- package/app/sc/AppTheme.d.ts +13 -0
- package/app/sc/AppTheme.js +9 -0
- package/app/sc/auth/index.d.ts +9 -0
- package/app/sc/auth/index.js +13 -0
- package/app/sc/auth/package.json +6 -0
- package/app/sc/index.d.ts +56 -0
- package/app/sc/index.js +59 -0
- package/app/sc/package.json +6 -0
- package/config/index.d.ts +71 -58
- package/config/index.js +174 -0
- package/config/package.json +6 -0
- package/document/Document.d.ts +15 -10
- package/document/Document.js +19 -0
- package/document/css/index.d.ts +22 -0
- package/document/css/index.js +30 -0
- package/document/css/package.json +6 -0
- package/document/em/index.d.ts +16 -0
- package/document/em/index.js +68 -0
- package/document/em/package.json +6 -0
- package/document/index.d.ts +2 -4
- package/document/index.js +2 -0
- package/document/package.json +6 -0
- package/document/{Document--sc.d.ts → sc/index.d.ts} +20 -11
- package/document/sc/index.js +44 -0
- package/document/sc/package.json +6 -0
- package/index.d.ts +12 -12
- package/index.js +12 -743
- package/node/Analytics/AnalyticsGoogle.js +42 -0
- package/node/Analytics/index.js +4 -0
- package/node/Auth/helpers.js +26 -0
- package/node/Auth/index.js +7 -0
- package/node/Auth/useLogin.js +54 -0
- package/node/Auth/useLoginUrl.js +15 -0
- package/node/Auth/useLogout.js +56 -0
- package/node/Favicon/Favicon.js +9 -0
- package/node/Favicon/index.js +4 -0
- package/node/Forms/index.js +5 -0
- package/node/Forms/useForm.js +41 -0
- package/node/Forms/useSubmit.js +27 -0
- package/node/Head/Head.js +8 -0
- package/node/Head/index.js +4 -0
- package/node/I18n/I18n.js +82 -0
- package/node/I18n/index.js +4 -0
- package/node/Img/Img.js +34 -0
- package/node/Img/index.js +4 -0
- package/node/Link/Link.js +13 -0
- package/node/Link/index.js +4 -0
- package/node/NextProgress/NextProgress.js +41 -0
- package/node/NextProgress/index.js +5 -0
- package/node/Seo/Seo.js +12 -0
- package/node/Seo/SeoDefaults.js +16 -0
- package/node/Seo/helpers.js +115 -0
- package/node/Seo/index.js +15 -0
- package/node/Theme/Theme.js +241 -0
- package/node/Theme/index.js +4 -0
- package/node/app/AppHead.js +10 -0
- package/node/app/AppMain.js +2 -0
- package/node/app/css/AppMain.js +16 -0
- package/node/app/css/AppTheme.js +16 -0
- package/node/app/css/auth/index.js +18 -0
- package/node/app/css/index.js +62 -0
- package/node/app/em/AppMain.js +26 -0
- package/node/app/em/AppTheme.js +22 -0
- package/node/app/em/auth/index.js +18 -0
- package/node/app/em/index.js +17 -0
- package/node/app/index.js +5 -0
- package/node/app/sc/AppMain.js +26 -0
- package/node/app/sc/AppTheme.js +13 -0
- package/node/app/sc/auth/index.js +18 -0
- package/node/app/sc/index.js +64 -0
- package/node/config/index.js +184 -0
- package/node/document/Document.js +24 -0
- package/node/document/css/index.js +35 -0
- package/node/document/em/index.js +73 -0
- package/node/document/index.js +7 -0
- package/node/document/sc/index.js +49 -0
- package/node/index.js +15 -0
- package/node/utils/api.js +38 -0
- package/node/utils/emotion-cache.js +13 -0
- package/node/utils/index.js +32 -0
- package/package.json +3 -30
- package/{types.d.ts → typings.d.ts} +10 -7
- package/utils/api.d.ts +55 -55
- package/utils/api.js +35 -0
- package/{document/emotion.d.ts → utils/emotion-cache.d.ts} +5 -5
- package/utils/emotion-cache.js +8 -0
- package/utils/index.d.ts +19 -19
- package/utils/index.js +26 -0
- package/utils/package.json +6 -0
- package/Theme.js +0 -1905
- package/_tslib.js +0 -41
- package/app/App--emotion.d.ts +0 -10
- package/app/App--sc.d.ts +0 -10
- package/app/App--vanilla.d.ts +0 -10
- package/app/AppAuth--emotion.d.ts +0 -10
- package/app/AppAuth--sc.d.ts +0 -10
- package/app/AppMain--vanilla.d.ts +0 -27
- package/app/AppTheme--sc.d.ts +0 -13
- package/app/AppTheme--vanilla.d.ts +0 -10
- package/app/motion-features.d.ts +0 -2
- package/app.js +0 -250
- package/config.js +0 -183
- package/document/Document--emotion.d.ts +0 -5
- package/document/Document--vanilla.d.ts +0 -11
- package/document.js +0 -207
- package/emotion.js +0 -1329
- package/es.object.assign.js +0 -1074
- package/es.string.replace.js +0 -785
- package/es.string.split.js +0 -201
- package/index.esm.js +0 -4600
- package/index.umd.js +0 -4638
- package/motion-features.js +0 -10
package/index.esm.js
DELETED
|
@@ -1,4600 +0,0 @@
|
|
|
1
|
-
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useState, useEffect, useMemo, useCallback, forwardRef, useRef, memo, useContext, createContext } from 'react';
|
|
3
|
-
import { useRouter } from 'next/router';
|
|
4
|
-
import Script from 'next/script';
|
|
5
|
-
import { pageview, isString, parseURL, buildUrlQueryString, isArray, isServer, normaliseUrl } from '@koine/utils';
|
|
6
|
-
import { signIn, signOut } from 'next-auth/react';
|
|
7
|
-
import format from 'date-fns/format';
|
|
8
|
-
import useTranslation from 'next-translate/useTranslation';
|
|
9
|
-
import { useDateLocale, FaviconTags, KoineLink, ProgressOverlay } from '@koine/react';
|
|
10
|
-
export { default as T } from 'next-translate/Trans';
|
|
11
|
-
import Head from 'next/head';
|
|
12
|
-
export { default as Head } from 'next/head';
|
|
13
|
-
import { useForm as useForm$1 } from 'react-hook-form';
|
|
14
|
-
import { yupResolver } from '@hookform/resolvers/yup';
|
|
15
|
-
import { useAsyncFn } from 'react-use';
|
|
16
|
-
import NextImage from 'next/image';
|
|
17
|
-
import NextLink from 'next/link';
|
|
18
|
-
|
|
19
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
20
|
-
|
|
21
|
-
var check = function (it) {
|
|
22
|
-
return it && it.Math == Math && it;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
|
26
|
-
var global$J =
|
|
27
|
-
// eslint-disable-next-line es/no-global-this -- safe
|
|
28
|
-
check(typeof globalThis == 'object' && globalThis) ||
|
|
29
|
-
check(typeof window == 'object' && window) ||
|
|
30
|
-
// eslint-disable-next-line no-restricted-globals -- safe
|
|
31
|
-
check(typeof self == 'object' && self) ||
|
|
32
|
-
check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
|
33
|
-
// eslint-disable-next-line no-new-func -- fallback
|
|
34
|
-
(function () { return this; })() || Function('return this')();
|
|
35
|
-
|
|
36
|
-
var fails$k = function (exec) {
|
|
37
|
-
try {
|
|
38
|
-
return !!exec();
|
|
39
|
-
} catch (error) {
|
|
40
|
-
return true;
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
var fails$j = fails$k;
|
|
45
|
-
|
|
46
|
-
var functionBindNative = !fails$j(function () {
|
|
47
|
-
var test = (function () { /* empty */ }).bind();
|
|
48
|
-
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
49
|
-
return typeof test != 'function' || test.hasOwnProperty('prototype');
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
var NATIVE_BIND$3 = functionBindNative;
|
|
53
|
-
|
|
54
|
-
var FunctionPrototype$2 = Function.prototype;
|
|
55
|
-
var bind$5 = FunctionPrototype$2.bind;
|
|
56
|
-
var call$h = FunctionPrototype$2.call;
|
|
57
|
-
var uncurryThis$m = NATIVE_BIND$3 && bind$5.bind(call$h, call$h);
|
|
58
|
-
|
|
59
|
-
var functionUncurryThis = NATIVE_BIND$3 ? function (fn) {
|
|
60
|
-
return fn && uncurryThis$m(fn);
|
|
61
|
-
} : function (fn) {
|
|
62
|
-
return fn && function () {
|
|
63
|
-
return call$h.apply(fn, arguments);
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
var uncurryThis$l = functionUncurryThis;
|
|
68
|
-
|
|
69
|
-
var toString$9 = uncurryThis$l({}.toString);
|
|
70
|
-
var stringSlice$6 = uncurryThis$l(''.slice);
|
|
71
|
-
|
|
72
|
-
var classofRaw$1 = function (it) {
|
|
73
|
-
return stringSlice$6(toString$9(it), 8, -1);
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
var global$I = global$J;
|
|
77
|
-
var uncurryThis$k = functionUncurryThis;
|
|
78
|
-
var fails$i = fails$k;
|
|
79
|
-
var classof$7 = classofRaw$1;
|
|
80
|
-
|
|
81
|
-
var Object$5 = global$I.Object;
|
|
82
|
-
var split = uncurryThis$k(''.split);
|
|
83
|
-
|
|
84
|
-
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
85
|
-
var indexedObject = fails$i(function () {
|
|
86
|
-
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
|
|
87
|
-
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
88
|
-
return !Object$5('z').propertyIsEnumerable(0);
|
|
89
|
-
}) ? function (it) {
|
|
90
|
-
return classof$7(it) == 'String' ? split(it, '') : Object$5(it);
|
|
91
|
-
} : Object$5;
|
|
92
|
-
|
|
93
|
-
var global$H = global$J;
|
|
94
|
-
|
|
95
|
-
var TypeError$g = global$H.TypeError;
|
|
96
|
-
|
|
97
|
-
// `RequireObjectCoercible` abstract operation
|
|
98
|
-
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
|
99
|
-
var requireObjectCoercible$7 = function (it) {
|
|
100
|
-
if (it == undefined) throw TypeError$g("Can't call method on " + it);
|
|
101
|
-
return it;
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
// toObject with fallback for non-array-like ES3 strings
|
|
105
|
-
var IndexedObject$2 = indexedObject;
|
|
106
|
-
var requireObjectCoercible$6 = requireObjectCoercible$7;
|
|
107
|
-
|
|
108
|
-
var toIndexedObject$5 = function (it) {
|
|
109
|
-
return IndexedObject$2(requireObjectCoercible$6(it));
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
var shared$4 = {exports: {}};
|
|
113
|
-
|
|
114
|
-
var global$G = global$J;
|
|
115
|
-
|
|
116
|
-
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
117
|
-
var defineProperty$4 = Object.defineProperty;
|
|
118
|
-
|
|
119
|
-
var setGlobal$3 = function (key, value) {
|
|
120
|
-
try {
|
|
121
|
-
defineProperty$4(global$G, key, { value: value, configurable: true, writable: true });
|
|
122
|
-
} catch (error) {
|
|
123
|
-
global$G[key] = value;
|
|
124
|
-
} return value;
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
var global$F = global$J;
|
|
128
|
-
var setGlobal$2 = setGlobal$3;
|
|
129
|
-
|
|
130
|
-
var SHARED = '__core-js_shared__';
|
|
131
|
-
var store$3 = global$F[SHARED] || setGlobal$2(SHARED, {});
|
|
132
|
-
|
|
133
|
-
var sharedStore = store$3;
|
|
134
|
-
|
|
135
|
-
var store$2 = sharedStore;
|
|
136
|
-
|
|
137
|
-
(shared$4.exports = function (key, value) {
|
|
138
|
-
return store$2[key] || (store$2[key] = value !== undefined ? value : {});
|
|
139
|
-
})('versions', []).push({
|
|
140
|
-
version: '3.21.1',
|
|
141
|
-
mode: 'global',
|
|
142
|
-
copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
|
|
143
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE',
|
|
144
|
-
source: 'https://github.com/zloirock/core-js'
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
var global$E = global$J;
|
|
148
|
-
var requireObjectCoercible$5 = requireObjectCoercible$7;
|
|
149
|
-
|
|
150
|
-
var Object$4 = global$E.Object;
|
|
151
|
-
|
|
152
|
-
// `ToObject` abstract operation
|
|
153
|
-
// https://tc39.es/ecma262/#sec-toobject
|
|
154
|
-
var toObject$5 = function (argument) {
|
|
155
|
-
return Object$4(requireObjectCoercible$5(argument));
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
var uncurryThis$j = functionUncurryThis;
|
|
159
|
-
var toObject$4 = toObject$5;
|
|
160
|
-
|
|
161
|
-
var hasOwnProperty = uncurryThis$j({}.hasOwnProperty);
|
|
162
|
-
|
|
163
|
-
// `HasOwnProperty` abstract operation
|
|
164
|
-
// https://tc39.es/ecma262/#sec-hasownproperty
|
|
165
|
-
var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
|
166
|
-
return hasOwnProperty(toObject$4(it), key);
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
var uncurryThis$i = functionUncurryThis;
|
|
170
|
-
|
|
171
|
-
var id = 0;
|
|
172
|
-
var postfix = Math.random();
|
|
173
|
-
var toString$8 = uncurryThis$i(1.0.toString);
|
|
174
|
-
|
|
175
|
-
var uid$2 = function (key) {
|
|
176
|
-
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$8(++id + postfix, 36);
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
// `IsCallable` abstract operation
|
|
180
|
-
// https://tc39.es/ecma262/#sec-iscallable
|
|
181
|
-
var isCallable$k = function (argument) {
|
|
182
|
-
return typeof argument == 'function';
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
var global$D = global$J;
|
|
186
|
-
var isCallable$j = isCallable$k;
|
|
187
|
-
|
|
188
|
-
var aFunction = function (argument) {
|
|
189
|
-
return isCallable$j(argument) ? argument : undefined;
|
|
190
|
-
};
|
|
191
|
-
|
|
192
|
-
var getBuiltIn$7 = function (namespace, method) {
|
|
193
|
-
return arguments.length < 2 ? aFunction(global$D[namespace]) : global$D[namespace] && global$D[namespace][method];
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
var getBuiltIn$6 = getBuiltIn$7;
|
|
197
|
-
|
|
198
|
-
var engineUserAgent = getBuiltIn$6('navigator', 'userAgent') || '';
|
|
199
|
-
|
|
200
|
-
var global$C = global$J;
|
|
201
|
-
var userAgent$3 = engineUserAgent;
|
|
202
|
-
|
|
203
|
-
var process$4 = global$C.process;
|
|
204
|
-
var Deno = global$C.Deno;
|
|
205
|
-
var versions = process$4 && process$4.versions || Deno && Deno.version;
|
|
206
|
-
var v8 = versions && versions.v8;
|
|
207
|
-
var match, version;
|
|
208
|
-
|
|
209
|
-
if (v8) {
|
|
210
|
-
match = v8.split('.');
|
|
211
|
-
// in old Chrome, versions of V8 isn't V8 = Chrome / 10
|
|
212
|
-
// but their correct versions are not interesting for us
|
|
213
|
-
version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
|
|
217
|
-
// so check `userAgent` even if `.v8` exists, but 0
|
|
218
|
-
if (!version && userAgent$3) {
|
|
219
|
-
match = userAgent$3.match(/Edge\/(\d+)/);
|
|
220
|
-
if (!match || match[1] >= 74) {
|
|
221
|
-
match = userAgent$3.match(/Chrome\/(\d+)/);
|
|
222
|
-
if (match) version = +match[1];
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
var engineV8Version = version;
|
|
227
|
-
|
|
228
|
-
/* eslint-disable es/no-symbol -- required for testing */
|
|
229
|
-
|
|
230
|
-
var V8_VERSION$1 = engineV8Version;
|
|
231
|
-
var fails$h = fails$k;
|
|
232
|
-
|
|
233
|
-
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
|
234
|
-
var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$h(function () {
|
|
235
|
-
var symbol = Symbol();
|
|
236
|
-
// Chrome 38 Symbol has incorrect toString conversion
|
|
237
|
-
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
|
238
|
-
return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
|
|
239
|
-
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
|
240
|
-
!Symbol.sham && V8_VERSION$1 && V8_VERSION$1 < 41;
|
|
241
|
-
});
|
|
242
|
-
|
|
243
|
-
/* eslint-disable es/no-symbol -- required for testing */
|
|
244
|
-
|
|
245
|
-
var NATIVE_SYMBOL$2 = nativeSymbol;
|
|
246
|
-
|
|
247
|
-
var useSymbolAsUid = NATIVE_SYMBOL$2
|
|
248
|
-
&& !Symbol.sham
|
|
249
|
-
&& typeof Symbol.iterator == 'symbol';
|
|
250
|
-
|
|
251
|
-
var global$B = global$J;
|
|
252
|
-
var shared$3 = shared$4.exports;
|
|
253
|
-
var hasOwn$a = hasOwnProperty_1;
|
|
254
|
-
var uid$1 = uid$2;
|
|
255
|
-
var NATIVE_SYMBOL$1 = nativeSymbol;
|
|
256
|
-
var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
|
|
257
|
-
|
|
258
|
-
var WellKnownSymbolsStore = shared$3('wks');
|
|
259
|
-
var Symbol$1 = global$B.Symbol;
|
|
260
|
-
var symbolFor = Symbol$1 && Symbol$1['for'];
|
|
261
|
-
var createWellKnownSymbol = USE_SYMBOL_AS_UID$1 ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
|
|
262
|
-
|
|
263
|
-
var wellKnownSymbol$h = function (name) {
|
|
264
|
-
if (!hasOwn$a(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL$1 || typeof WellKnownSymbolsStore[name] == 'string')) {
|
|
265
|
-
var description = 'Symbol.' + name;
|
|
266
|
-
if (NATIVE_SYMBOL$1 && hasOwn$a(Symbol$1, name)) {
|
|
267
|
-
WellKnownSymbolsStore[name] = Symbol$1[name];
|
|
268
|
-
} else if (USE_SYMBOL_AS_UID$1 && symbolFor) {
|
|
269
|
-
WellKnownSymbolsStore[name] = symbolFor(description);
|
|
270
|
-
} else {
|
|
271
|
-
WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
|
|
272
|
-
}
|
|
273
|
-
} return WellKnownSymbolsStore[name];
|
|
274
|
-
};
|
|
275
|
-
|
|
276
|
-
var isCallable$i = isCallable$k;
|
|
277
|
-
|
|
278
|
-
var isObject$8 = function (it) {
|
|
279
|
-
return typeof it == 'object' ? it !== null : isCallable$i(it);
|
|
280
|
-
};
|
|
281
|
-
|
|
282
|
-
var global$A = global$J;
|
|
283
|
-
var isObject$7 = isObject$8;
|
|
284
|
-
|
|
285
|
-
var String$5 = global$A.String;
|
|
286
|
-
var TypeError$f = global$A.TypeError;
|
|
287
|
-
|
|
288
|
-
// `Assert: Type(argument) is Object`
|
|
289
|
-
var anObject$h = function (argument) {
|
|
290
|
-
if (isObject$7(argument)) return argument;
|
|
291
|
-
throw TypeError$f(String$5(argument) + ' is not an object');
|
|
292
|
-
};
|
|
293
|
-
|
|
294
|
-
var objectDefineProperties = {};
|
|
295
|
-
|
|
296
|
-
var fails$g = fails$k;
|
|
297
|
-
|
|
298
|
-
// Detect IE8's incomplete defineProperty implementation
|
|
299
|
-
var descriptors = !fails$g(function () {
|
|
300
|
-
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
301
|
-
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
|
|
302
|
-
});
|
|
303
|
-
|
|
304
|
-
var DESCRIPTORS$a = descriptors;
|
|
305
|
-
var fails$f = fails$k;
|
|
306
|
-
|
|
307
|
-
// V8 ~ Chrome 36-
|
|
308
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
|
|
309
|
-
var v8PrototypeDefineBug = DESCRIPTORS$a && fails$f(function () {
|
|
310
|
-
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
311
|
-
return Object.defineProperty(function () { /* empty */ }, 'prototype', {
|
|
312
|
-
value: 42,
|
|
313
|
-
writable: false
|
|
314
|
-
}).prototype != 42;
|
|
315
|
-
});
|
|
316
|
-
|
|
317
|
-
var objectDefineProperty = {};
|
|
318
|
-
|
|
319
|
-
var global$z = global$J;
|
|
320
|
-
var isObject$6 = isObject$8;
|
|
321
|
-
|
|
322
|
-
var document$3 = global$z.document;
|
|
323
|
-
// typeof document.createElement is 'object' in old IE
|
|
324
|
-
var EXISTS$1 = isObject$6(document$3) && isObject$6(document$3.createElement);
|
|
325
|
-
|
|
326
|
-
var documentCreateElement$2 = function (it) {
|
|
327
|
-
return EXISTS$1 ? document$3.createElement(it) : {};
|
|
328
|
-
};
|
|
329
|
-
|
|
330
|
-
var DESCRIPTORS$9 = descriptors;
|
|
331
|
-
var fails$e = fails$k;
|
|
332
|
-
var createElement$1 = documentCreateElement$2;
|
|
333
|
-
|
|
334
|
-
// Thanks to IE8 for its funny defineProperty
|
|
335
|
-
var ie8DomDefine = !DESCRIPTORS$9 && !fails$e(function () {
|
|
336
|
-
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
337
|
-
return Object.defineProperty(createElement$1('div'), 'a', {
|
|
338
|
-
get: function () { return 7; }
|
|
339
|
-
}).a != 7;
|
|
340
|
-
});
|
|
341
|
-
|
|
342
|
-
var NATIVE_BIND$2 = functionBindNative;
|
|
343
|
-
|
|
344
|
-
var call$g = Function.prototype.call;
|
|
345
|
-
|
|
346
|
-
var functionCall = NATIVE_BIND$2 ? call$g.bind(call$g) : function () {
|
|
347
|
-
return call$g.apply(call$g, arguments);
|
|
348
|
-
};
|
|
349
|
-
|
|
350
|
-
var uncurryThis$h = functionUncurryThis;
|
|
351
|
-
|
|
352
|
-
var objectIsPrototypeOf = uncurryThis$h({}.isPrototypeOf);
|
|
353
|
-
|
|
354
|
-
var global$y = global$J;
|
|
355
|
-
var getBuiltIn$5 = getBuiltIn$7;
|
|
356
|
-
var isCallable$h = isCallable$k;
|
|
357
|
-
var isPrototypeOf$4 = objectIsPrototypeOf;
|
|
358
|
-
var USE_SYMBOL_AS_UID = useSymbolAsUid;
|
|
359
|
-
|
|
360
|
-
var Object$3 = global$y.Object;
|
|
361
|
-
|
|
362
|
-
var isSymbol$2 = USE_SYMBOL_AS_UID ? function (it) {
|
|
363
|
-
return typeof it == 'symbol';
|
|
364
|
-
} : function (it) {
|
|
365
|
-
var $Symbol = getBuiltIn$5('Symbol');
|
|
366
|
-
return isCallable$h($Symbol) && isPrototypeOf$4($Symbol.prototype, Object$3(it));
|
|
367
|
-
};
|
|
368
|
-
|
|
369
|
-
var global$x = global$J;
|
|
370
|
-
|
|
371
|
-
var String$4 = global$x.String;
|
|
372
|
-
|
|
373
|
-
var tryToString$4 = function (argument) {
|
|
374
|
-
try {
|
|
375
|
-
return String$4(argument);
|
|
376
|
-
} catch (error) {
|
|
377
|
-
return 'Object';
|
|
378
|
-
}
|
|
379
|
-
};
|
|
380
|
-
|
|
381
|
-
var global$w = global$J;
|
|
382
|
-
var isCallable$g = isCallable$k;
|
|
383
|
-
var tryToString$3 = tryToString$4;
|
|
384
|
-
|
|
385
|
-
var TypeError$e = global$w.TypeError;
|
|
386
|
-
|
|
387
|
-
// `Assert: IsCallable(argument) is true`
|
|
388
|
-
var aCallable$6 = function (argument) {
|
|
389
|
-
if (isCallable$g(argument)) return argument;
|
|
390
|
-
throw TypeError$e(tryToString$3(argument) + ' is not a function');
|
|
391
|
-
};
|
|
392
|
-
|
|
393
|
-
var aCallable$5 = aCallable$6;
|
|
394
|
-
|
|
395
|
-
// `GetMethod` abstract operation
|
|
396
|
-
// https://tc39.es/ecma262/#sec-getmethod
|
|
397
|
-
var getMethod$7 = function (V, P) {
|
|
398
|
-
var func = V[P];
|
|
399
|
-
return func == null ? undefined : aCallable$5(func);
|
|
400
|
-
};
|
|
401
|
-
|
|
402
|
-
var global$v = global$J;
|
|
403
|
-
var call$f = functionCall;
|
|
404
|
-
var isCallable$f = isCallable$k;
|
|
405
|
-
var isObject$5 = isObject$8;
|
|
406
|
-
|
|
407
|
-
var TypeError$d = global$v.TypeError;
|
|
408
|
-
|
|
409
|
-
// `OrdinaryToPrimitive` abstract operation
|
|
410
|
-
// https://tc39.es/ecma262/#sec-ordinarytoprimitive
|
|
411
|
-
var ordinaryToPrimitive$1 = function (input, pref) {
|
|
412
|
-
var fn, val;
|
|
413
|
-
if (pref === 'string' && isCallable$f(fn = input.toString) && !isObject$5(val = call$f(fn, input))) return val;
|
|
414
|
-
if (isCallable$f(fn = input.valueOf) && !isObject$5(val = call$f(fn, input))) return val;
|
|
415
|
-
if (pref !== 'string' && isCallable$f(fn = input.toString) && !isObject$5(val = call$f(fn, input))) return val;
|
|
416
|
-
throw TypeError$d("Can't convert object to primitive value");
|
|
417
|
-
};
|
|
418
|
-
|
|
419
|
-
var global$u = global$J;
|
|
420
|
-
var call$e = functionCall;
|
|
421
|
-
var isObject$4 = isObject$8;
|
|
422
|
-
var isSymbol$1 = isSymbol$2;
|
|
423
|
-
var getMethod$6 = getMethod$7;
|
|
424
|
-
var ordinaryToPrimitive = ordinaryToPrimitive$1;
|
|
425
|
-
var wellKnownSymbol$g = wellKnownSymbol$h;
|
|
426
|
-
|
|
427
|
-
var TypeError$c = global$u.TypeError;
|
|
428
|
-
var TO_PRIMITIVE = wellKnownSymbol$g('toPrimitive');
|
|
429
|
-
|
|
430
|
-
// `ToPrimitive` abstract operation
|
|
431
|
-
// https://tc39.es/ecma262/#sec-toprimitive
|
|
432
|
-
var toPrimitive$1 = function (input, pref) {
|
|
433
|
-
if (!isObject$4(input) || isSymbol$1(input)) return input;
|
|
434
|
-
var exoticToPrim = getMethod$6(input, TO_PRIMITIVE);
|
|
435
|
-
var result;
|
|
436
|
-
if (exoticToPrim) {
|
|
437
|
-
if (pref === undefined) pref = 'default';
|
|
438
|
-
result = call$e(exoticToPrim, input, pref);
|
|
439
|
-
if (!isObject$4(result) || isSymbol$1(result)) return result;
|
|
440
|
-
throw TypeError$c("Can't convert object to primitive value");
|
|
441
|
-
}
|
|
442
|
-
if (pref === undefined) pref = 'number';
|
|
443
|
-
return ordinaryToPrimitive(input, pref);
|
|
444
|
-
};
|
|
445
|
-
|
|
446
|
-
var toPrimitive = toPrimitive$1;
|
|
447
|
-
var isSymbol = isSymbol$2;
|
|
448
|
-
|
|
449
|
-
// `ToPropertyKey` abstract operation
|
|
450
|
-
// https://tc39.es/ecma262/#sec-topropertykey
|
|
451
|
-
var toPropertyKey$3 = function (argument) {
|
|
452
|
-
var key = toPrimitive(argument, 'string');
|
|
453
|
-
return isSymbol(key) ? key : key + '';
|
|
454
|
-
};
|
|
455
|
-
|
|
456
|
-
var global$t = global$J;
|
|
457
|
-
var DESCRIPTORS$8 = descriptors;
|
|
458
|
-
var IE8_DOM_DEFINE$1 = ie8DomDefine;
|
|
459
|
-
var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
|
|
460
|
-
var anObject$g = anObject$h;
|
|
461
|
-
var toPropertyKey$2 = toPropertyKey$3;
|
|
462
|
-
|
|
463
|
-
var TypeError$b = global$t.TypeError;
|
|
464
|
-
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
465
|
-
var $defineProperty = Object.defineProperty;
|
|
466
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
467
|
-
var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
468
|
-
var ENUMERABLE = 'enumerable';
|
|
469
|
-
var CONFIGURABLE$1 = 'configurable';
|
|
470
|
-
var WRITABLE = 'writable';
|
|
471
|
-
|
|
472
|
-
// `Object.defineProperty` method
|
|
473
|
-
// https://tc39.es/ecma262/#sec-object.defineproperty
|
|
474
|
-
objectDefineProperty.f = DESCRIPTORS$8 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
|
|
475
|
-
anObject$g(O);
|
|
476
|
-
P = toPropertyKey$2(P);
|
|
477
|
-
anObject$g(Attributes);
|
|
478
|
-
if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
|
|
479
|
-
var current = $getOwnPropertyDescriptor$1(O, P);
|
|
480
|
-
if (current && current[WRITABLE]) {
|
|
481
|
-
O[P] = Attributes.value;
|
|
482
|
-
Attributes = {
|
|
483
|
-
configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
|
|
484
|
-
enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
|
|
485
|
-
writable: false
|
|
486
|
-
};
|
|
487
|
-
}
|
|
488
|
-
} return $defineProperty(O, P, Attributes);
|
|
489
|
-
} : $defineProperty : function defineProperty(O, P, Attributes) {
|
|
490
|
-
anObject$g(O);
|
|
491
|
-
P = toPropertyKey$2(P);
|
|
492
|
-
anObject$g(Attributes);
|
|
493
|
-
if (IE8_DOM_DEFINE$1) try {
|
|
494
|
-
return $defineProperty(O, P, Attributes);
|
|
495
|
-
} catch (error) { /* empty */ }
|
|
496
|
-
if ('get' in Attributes || 'set' in Attributes) throw TypeError$b('Accessors not supported');
|
|
497
|
-
if ('value' in Attributes) O[P] = Attributes.value;
|
|
498
|
-
return O;
|
|
499
|
-
};
|
|
500
|
-
|
|
501
|
-
var ceil = Math.ceil;
|
|
502
|
-
var floor$1 = Math.floor;
|
|
503
|
-
|
|
504
|
-
// `ToIntegerOrInfinity` abstract operation
|
|
505
|
-
// https://tc39.es/ecma262/#sec-tointegerorinfinity
|
|
506
|
-
var toIntegerOrInfinity$4 = function (argument) {
|
|
507
|
-
var number = +argument;
|
|
508
|
-
// eslint-disable-next-line no-self-compare -- safe
|
|
509
|
-
return number !== number || number === 0 ? 0 : (number > 0 ? floor$1 : ceil)(number);
|
|
510
|
-
};
|
|
511
|
-
|
|
512
|
-
var toIntegerOrInfinity$3 = toIntegerOrInfinity$4;
|
|
513
|
-
|
|
514
|
-
var max$2 = Math.max;
|
|
515
|
-
var min$3 = Math.min;
|
|
516
|
-
|
|
517
|
-
// Helper for a popular repeating case of the spec:
|
|
518
|
-
// Let integer be ? ToInteger(index).
|
|
519
|
-
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
|
|
520
|
-
var toAbsoluteIndex$2 = function (index, length) {
|
|
521
|
-
var integer = toIntegerOrInfinity$3(index);
|
|
522
|
-
return integer < 0 ? max$2(integer + length, 0) : min$3(integer, length);
|
|
523
|
-
};
|
|
524
|
-
|
|
525
|
-
var toIntegerOrInfinity$2 = toIntegerOrInfinity$4;
|
|
526
|
-
|
|
527
|
-
var min$2 = Math.min;
|
|
528
|
-
|
|
529
|
-
// `ToLength` abstract operation
|
|
530
|
-
// https://tc39.es/ecma262/#sec-tolength
|
|
531
|
-
var toLength$4 = function (argument) {
|
|
532
|
-
return argument > 0 ? min$2(toIntegerOrInfinity$2(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
|
533
|
-
};
|
|
534
|
-
|
|
535
|
-
var toLength$3 = toLength$4;
|
|
536
|
-
|
|
537
|
-
// `LengthOfArrayLike` abstract operation
|
|
538
|
-
// https://tc39.es/ecma262/#sec-lengthofarraylike
|
|
539
|
-
var lengthOfArrayLike$4 = function (obj) {
|
|
540
|
-
return toLength$3(obj.length);
|
|
541
|
-
};
|
|
542
|
-
|
|
543
|
-
var toIndexedObject$4 = toIndexedObject$5;
|
|
544
|
-
var toAbsoluteIndex$1 = toAbsoluteIndex$2;
|
|
545
|
-
var lengthOfArrayLike$3 = lengthOfArrayLike$4;
|
|
546
|
-
|
|
547
|
-
// `Array.prototype.{ indexOf, includes }` methods implementation
|
|
548
|
-
var createMethod$2 = function (IS_INCLUDES) {
|
|
549
|
-
return function ($this, el, fromIndex) {
|
|
550
|
-
var O = toIndexedObject$4($this);
|
|
551
|
-
var length = lengthOfArrayLike$3(O);
|
|
552
|
-
var index = toAbsoluteIndex$1(fromIndex, length);
|
|
553
|
-
var value;
|
|
554
|
-
// Array#includes uses SameValueZero equality algorithm
|
|
555
|
-
// eslint-disable-next-line no-self-compare -- NaN check
|
|
556
|
-
if (IS_INCLUDES && el != el) while (length > index) {
|
|
557
|
-
value = O[index++];
|
|
558
|
-
// eslint-disable-next-line no-self-compare -- NaN check
|
|
559
|
-
if (value != value) return true;
|
|
560
|
-
// Array#indexOf ignores holes, Array#includes - not
|
|
561
|
-
} else for (;length > index; index++) {
|
|
562
|
-
if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
|
563
|
-
} return !IS_INCLUDES && -1;
|
|
564
|
-
};
|
|
565
|
-
};
|
|
566
|
-
|
|
567
|
-
var arrayIncludes = {
|
|
568
|
-
// `Array.prototype.includes` method
|
|
569
|
-
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
570
|
-
includes: createMethod$2(true),
|
|
571
|
-
// `Array.prototype.indexOf` method
|
|
572
|
-
// https://tc39.es/ecma262/#sec-array.prototype.indexof
|
|
573
|
-
indexOf: createMethod$2(false)
|
|
574
|
-
};
|
|
575
|
-
|
|
576
|
-
var hiddenKeys$4 = {};
|
|
577
|
-
|
|
578
|
-
var uncurryThis$g = functionUncurryThis;
|
|
579
|
-
var hasOwn$9 = hasOwnProperty_1;
|
|
580
|
-
var toIndexedObject$3 = toIndexedObject$5;
|
|
581
|
-
var indexOf$1 = arrayIncludes.indexOf;
|
|
582
|
-
var hiddenKeys$3 = hiddenKeys$4;
|
|
583
|
-
|
|
584
|
-
var push$2 = uncurryThis$g([].push);
|
|
585
|
-
|
|
586
|
-
var objectKeysInternal = function (object, names) {
|
|
587
|
-
var O = toIndexedObject$3(object);
|
|
588
|
-
var i = 0;
|
|
589
|
-
var result = [];
|
|
590
|
-
var key;
|
|
591
|
-
for (key in O) !hasOwn$9(hiddenKeys$3, key) && hasOwn$9(O, key) && push$2(result, key);
|
|
592
|
-
// Don't enum bug & hidden keys
|
|
593
|
-
while (names.length > i) if (hasOwn$9(O, key = names[i++])) {
|
|
594
|
-
~indexOf$1(result, key) || push$2(result, key);
|
|
595
|
-
}
|
|
596
|
-
return result;
|
|
597
|
-
};
|
|
598
|
-
|
|
599
|
-
// IE8- don't enum bug keys
|
|
600
|
-
var enumBugKeys$3 = [
|
|
601
|
-
'constructor',
|
|
602
|
-
'hasOwnProperty',
|
|
603
|
-
'isPrototypeOf',
|
|
604
|
-
'propertyIsEnumerable',
|
|
605
|
-
'toLocaleString',
|
|
606
|
-
'toString',
|
|
607
|
-
'valueOf'
|
|
608
|
-
];
|
|
609
|
-
|
|
610
|
-
var internalObjectKeys$1 = objectKeysInternal;
|
|
611
|
-
var enumBugKeys$2 = enumBugKeys$3;
|
|
612
|
-
|
|
613
|
-
// `Object.keys` method
|
|
614
|
-
// https://tc39.es/ecma262/#sec-object.keys
|
|
615
|
-
// eslint-disable-next-line es/no-object-keys -- safe
|
|
616
|
-
var objectKeys$2 = Object.keys || function keys(O) {
|
|
617
|
-
return internalObjectKeys$1(O, enumBugKeys$2);
|
|
618
|
-
};
|
|
619
|
-
|
|
620
|
-
var DESCRIPTORS$7 = descriptors;
|
|
621
|
-
var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
|
|
622
|
-
var definePropertyModule$5 = objectDefineProperty;
|
|
623
|
-
var anObject$f = anObject$h;
|
|
624
|
-
var toIndexedObject$2 = toIndexedObject$5;
|
|
625
|
-
var objectKeys$1 = objectKeys$2;
|
|
626
|
-
|
|
627
|
-
// `Object.defineProperties` method
|
|
628
|
-
// https://tc39.es/ecma262/#sec-object.defineproperties
|
|
629
|
-
// eslint-disable-next-line es/no-object-defineproperties -- safe
|
|
630
|
-
objectDefineProperties.f = DESCRIPTORS$7 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
631
|
-
anObject$f(O);
|
|
632
|
-
var props = toIndexedObject$2(Properties);
|
|
633
|
-
var keys = objectKeys$1(Properties);
|
|
634
|
-
var length = keys.length;
|
|
635
|
-
var index = 0;
|
|
636
|
-
var key;
|
|
637
|
-
while (length > index) definePropertyModule$5.f(O, key = keys[index++], props[key]);
|
|
638
|
-
return O;
|
|
639
|
-
};
|
|
640
|
-
|
|
641
|
-
var getBuiltIn$4 = getBuiltIn$7;
|
|
642
|
-
|
|
643
|
-
var html$2 = getBuiltIn$4('document', 'documentElement');
|
|
644
|
-
|
|
645
|
-
var shared$2 = shared$4.exports;
|
|
646
|
-
var uid = uid$2;
|
|
647
|
-
|
|
648
|
-
var keys = shared$2('keys');
|
|
649
|
-
|
|
650
|
-
var sharedKey$3 = function (key) {
|
|
651
|
-
return keys[key] || (keys[key] = uid(key));
|
|
652
|
-
};
|
|
653
|
-
|
|
654
|
-
/* global ActiveXObject -- old IE, WSH */
|
|
655
|
-
|
|
656
|
-
var anObject$e = anObject$h;
|
|
657
|
-
var definePropertiesModule = objectDefineProperties;
|
|
658
|
-
var enumBugKeys$1 = enumBugKeys$3;
|
|
659
|
-
var hiddenKeys$2 = hiddenKeys$4;
|
|
660
|
-
var html$1 = html$2;
|
|
661
|
-
var documentCreateElement$1 = documentCreateElement$2;
|
|
662
|
-
var sharedKey$2 = sharedKey$3;
|
|
663
|
-
|
|
664
|
-
var GT = '>';
|
|
665
|
-
var LT = '<';
|
|
666
|
-
var PROTOTYPE = 'prototype';
|
|
667
|
-
var SCRIPT = 'script';
|
|
668
|
-
var IE_PROTO$1 = sharedKey$2('IE_PROTO');
|
|
669
|
-
|
|
670
|
-
var EmptyConstructor = function () { /* empty */ };
|
|
671
|
-
|
|
672
|
-
var scriptTag = function (content) {
|
|
673
|
-
return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
|
|
674
|
-
};
|
|
675
|
-
|
|
676
|
-
// Create object with fake `null` prototype: use ActiveX Object with cleared prototype
|
|
677
|
-
var NullProtoObjectViaActiveX = function (activeXDocument) {
|
|
678
|
-
activeXDocument.write(scriptTag(''));
|
|
679
|
-
activeXDocument.close();
|
|
680
|
-
var temp = activeXDocument.parentWindow.Object;
|
|
681
|
-
activeXDocument = null; // avoid memory leak
|
|
682
|
-
return temp;
|
|
683
|
-
};
|
|
684
|
-
|
|
685
|
-
// Create object with fake `null` prototype: use iframe Object with cleared prototype
|
|
686
|
-
var NullProtoObjectViaIFrame = function () {
|
|
687
|
-
// Thrash, waste and sodomy: IE GC bug
|
|
688
|
-
var iframe = documentCreateElement$1('iframe');
|
|
689
|
-
var JS = 'java' + SCRIPT + ':';
|
|
690
|
-
var iframeDocument;
|
|
691
|
-
iframe.style.display = 'none';
|
|
692
|
-
html$1.appendChild(iframe);
|
|
693
|
-
// https://github.com/zloirock/core-js/issues/475
|
|
694
|
-
iframe.src = String(JS);
|
|
695
|
-
iframeDocument = iframe.contentWindow.document;
|
|
696
|
-
iframeDocument.open();
|
|
697
|
-
iframeDocument.write(scriptTag('document.F=Object'));
|
|
698
|
-
iframeDocument.close();
|
|
699
|
-
return iframeDocument.F;
|
|
700
|
-
};
|
|
701
|
-
|
|
702
|
-
// Check for document.domain and active x support
|
|
703
|
-
// No need to use active x approach when document.domain is not set
|
|
704
|
-
// see https://github.com/es-shims/es5-shim/issues/150
|
|
705
|
-
// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
|
|
706
|
-
// avoid IE GC bug
|
|
707
|
-
var activeXDocument;
|
|
708
|
-
var NullProtoObject = function () {
|
|
709
|
-
try {
|
|
710
|
-
activeXDocument = new ActiveXObject('htmlfile');
|
|
711
|
-
} catch (error) { /* ignore */ }
|
|
712
|
-
NullProtoObject = typeof document != 'undefined'
|
|
713
|
-
? document.domain && activeXDocument
|
|
714
|
-
? NullProtoObjectViaActiveX(activeXDocument) // old IE
|
|
715
|
-
: NullProtoObjectViaIFrame()
|
|
716
|
-
: NullProtoObjectViaActiveX(activeXDocument); // WSH
|
|
717
|
-
var length = enumBugKeys$1.length;
|
|
718
|
-
while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys$1[length]];
|
|
719
|
-
return NullProtoObject();
|
|
720
|
-
};
|
|
721
|
-
|
|
722
|
-
hiddenKeys$2[IE_PROTO$1] = true;
|
|
723
|
-
|
|
724
|
-
// `Object.create` method
|
|
725
|
-
// https://tc39.es/ecma262/#sec-object.create
|
|
726
|
-
var objectCreate = Object.create || function create(O, Properties) {
|
|
727
|
-
var result;
|
|
728
|
-
if (O !== null) {
|
|
729
|
-
EmptyConstructor[PROTOTYPE] = anObject$e(O);
|
|
730
|
-
result = new EmptyConstructor();
|
|
731
|
-
EmptyConstructor[PROTOTYPE] = null;
|
|
732
|
-
// add "__proto__" for Object.getPrototypeOf polyfill
|
|
733
|
-
result[IE_PROTO$1] = O;
|
|
734
|
-
} else result = NullProtoObject();
|
|
735
|
-
return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
|
|
736
|
-
};
|
|
737
|
-
|
|
738
|
-
var wellKnownSymbol$f = wellKnownSymbol$h;
|
|
739
|
-
var create$2 = objectCreate;
|
|
740
|
-
var definePropertyModule$4 = objectDefineProperty;
|
|
741
|
-
|
|
742
|
-
var UNSCOPABLES = wellKnownSymbol$f('unscopables');
|
|
743
|
-
var ArrayPrototype$1 = Array.prototype;
|
|
744
|
-
|
|
745
|
-
// Array.prototype[@@unscopables]
|
|
746
|
-
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
747
|
-
if (ArrayPrototype$1[UNSCOPABLES] == undefined) {
|
|
748
|
-
definePropertyModule$4.f(ArrayPrototype$1, UNSCOPABLES, {
|
|
749
|
-
configurable: true,
|
|
750
|
-
value: create$2(null)
|
|
751
|
-
});
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
// add a key to Array.prototype[@@unscopables]
|
|
755
|
-
var addToUnscopables$1 = function (key) {
|
|
756
|
-
ArrayPrototype$1[UNSCOPABLES][key] = true;
|
|
757
|
-
};
|
|
758
|
-
|
|
759
|
-
var iterators = {};
|
|
760
|
-
|
|
761
|
-
var uncurryThis$f = functionUncurryThis;
|
|
762
|
-
var isCallable$e = isCallable$k;
|
|
763
|
-
var store$1 = sharedStore;
|
|
764
|
-
|
|
765
|
-
var functionToString = uncurryThis$f(Function.toString);
|
|
766
|
-
|
|
767
|
-
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
|
|
768
|
-
if (!isCallable$e(store$1.inspectSource)) {
|
|
769
|
-
store$1.inspectSource = function (it) {
|
|
770
|
-
return functionToString(it);
|
|
771
|
-
};
|
|
772
|
-
}
|
|
773
|
-
|
|
774
|
-
var inspectSource$4 = store$1.inspectSource;
|
|
775
|
-
|
|
776
|
-
var global$s = global$J;
|
|
777
|
-
var isCallable$d = isCallable$k;
|
|
778
|
-
var inspectSource$3 = inspectSource$4;
|
|
779
|
-
|
|
780
|
-
var WeakMap$1 = global$s.WeakMap;
|
|
781
|
-
|
|
782
|
-
var nativeWeakMap = isCallable$d(WeakMap$1) && /native code/.test(inspectSource$3(WeakMap$1));
|
|
783
|
-
|
|
784
|
-
var createPropertyDescriptor$4 = function (bitmap, value) {
|
|
785
|
-
return {
|
|
786
|
-
enumerable: !(bitmap & 1),
|
|
787
|
-
configurable: !(bitmap & 2),
|
|
788
|
-
writable: !(bitmap & 4),
|
|
789
|
-
value: value
|
|
790
|
-
};
|
|
791
|
-
};
|
|
792
|
-
|
|
793
|
-
var DESCRIPTORS$6 = descriptors;
|
|
794
|
-
var definePropertyModule$3 = objectDefineProperty;
|
|
795
|
-
var createPropertyDescriptor$3 = createPropertyDescriptor$4;
|
|
796
|
-
|
|
797
|
-
var createNonEnumerableProperty$6 = DESCRIPTORS$6 ? function (object, key, value) {
|
|
798
|
-
return definePropertyModule$3.f(object, key, createPropertyDescriptor$3(1, value));
|
|
799
|
-
} : function (object, key, value) {
|
|
800
|
-
object[key] = value;
|
|
801
|
-
return object;
|
|
802
|
-
};
|
|
803
|
-
|
|
804
|
-
var NATIVE_WEAK_MAP = nativeWeakMap;
|
|
805
|
-
var global$r = global$J;
|
|
806
|
-
var uncurryThis$e = functionUncurryThis;
|
|
807
|
-
var isObject$3 = isObject$8;
|
|
808
|
-
var createNonEnumerableProperty$5 = createNonEnumerableProperty$6;
|
|
809
|
-
var hasOwn$8 = hasOwnProperty_1;
|
|
810
|
-
var shared$1 = sharedStore;
|
|
811
|
-
var sharedKey$1 = sharedKey$3;
|
|
812
|
-
var hiddenKeys$1 = hiddenKeys$4;
|
|
813
|
-
|
|
814
|
-
var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
|
815
|
-
var TypeError$a = global$r.TypeError;
|
|
816
|
-
var WeakMap = global$r.WeakMap;
|
|
817
|
-
var set$1, get, has;
|
|
818
|
-
|
|
819
|
-
var enforce = function (it) {
|
|
820
|
-
return has(it) ? get(it) : set$1(it, {});
|
|
821
|
-
};
|
|
822
|
-
|
|
823
|
-
var getterFor = function (TYPE) {
|
|
824
|
-
return function (it) {
|
|
825
|
-
var state;
|
|
826
|
-
if (!isObject$3(it) || (state = get(it)).type !== TYPE) {
|
|
827
|
-
throw TypeError$a('Incompatible receiver, ' + TYPE + ' required');
|
|
828
|
-
} return state;
|
|
829
|
-
};
|
|
830
|
-
};
|
|
831
|
-
|
|
832
|
-
if (NATIVE_WEAK_MAP || shared$1.state) {
|
|
833
|
-
var store = shared$1.state || (shared$1.state = new WeakMap());
|
|
834
|
-
var wmget = uncurryThis$e(store.get);
|
|
835
|
-
var wmhas = uncurryThis$e(store.has);
|
|
836
|
-
var wmset = uncurryThis$e(store.set);
|
|
837
|
-
set$1 = function (it, metadata) {
|
|
838
|
-
if (wmhas(store, it)) throw new TypeError$a(OBJECT_ALREADY_INITIALIZED);
|
|
839
|
-
metadata.facade = it;
|
|
840
|
-
wmset(store, it, metadata);
|
|
841
|
-
return metadata;
|
|
842
|
-
};
|
|
843
|
-
get = function (it) {
|
|
844
|
-
return wmget(store, it) || {};
|
|
845
|
-
};
|
|
846
|
-
has = function (it) {
|
|
847
|
-
return wmhas(store, it);
|
|
848
|
-
};
|
|
849
|
-
} else {
|
|
850
|
-
var STATE = sharedKey$1('state');
|
|
851
|
-
hiddenKeys$1[STATE] = true;
|
|
852
|
-
set$1 = function (it, metadata) {
|
|
853
|
-
if (hasOwn$8(it, STATE)) throw new TypeError$a(OBJECT_ALREADY_INITIALIZED);
|
|
854
|
-
metadata.facade = it;
|
|
855
|
-
createNonEnumerableProperty$5(it, STATE, metadata);
|
|
856
|
-
return metadata;
|
|
857
|
-
};
|
|
858
|
-
get = function (it) {
|
|
859
|
-
return hasOwn$8(it, STATE) ? it[STATE] : {};
|
|
860
|
-
};
|
|
861
|
-
has = function (it) {
|
|
862
|
-
return hasOwn$8(it, STATE);
|
|
863
|
-
};
|
|
864
|
-
}
|
|
865
|
-
|
|
866
|
-
var internalState = {
|
|
867
|
-
set: set$1,
|
|
868
|
-
get: get,
|
|
869
|
-
has: has,
|
|
870
|
-
enforce: enforce,
|
|
871
|
-
getterFor: getterFor
|
|
872
|
-
};
|
|
873
|
-
|
|
874
|
-
var objectGetOwnPropertyDescriptor = {};
|
|
875
|
-
|
|
876
|
-
var objectPropertyIsEnumerable = {};
|
|
877
|
-
|
|
878
|
-
var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
|
879
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
880
|
-
var getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor;
|
|
881
|
-
|
|
882
|
-
// Nashorn ~ JDK8 bug
|
|
883
|
-
var NASHORN_BUG = getOwnPropertyDescriptor$2 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
|
|
884
|
-
|
|
885
|
-
// `Object.prototype.propertyIsEnumerable` method implementation
|
|
886
|
-
// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
|
|
887
|
-
objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
|
888
|
-
var descriptor = getOwnPropertyDescriptor$2(this, V);
|
|
889
|
-
return !!descriptor && descriptor.enumerable;
|
|
890
|
-
} : $propertyIsEnumerable;
|
|
891
|
-
|
|
892
|
-
var DESCRIPTORS$5 = descriptors;
|
|
893
|
-
var call$d = functionCall;
|
|
894
|
-
var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
|
|
895
|
-
var createPropertyDescriptor$2 = createPropertyDescriptor$4;
|
|
896
|
-
var toIndexedObject$1 = toIndexedObject$5;
|
|
897
|
-
var toPropertyKey$1 = toPropertyKey$3;
|
|
898
|
-
var hasOwn$7 = hasOwnProperty_1;
|
|
899
|
-
var IE8_DOM_DEFINE = ie8DomDefine;
|
|
900
|
-
|
|
901
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
902
|
-
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
903
|
-
|
|
904
|
-
// `Object.getOwnPropertyDescriptor` method
|
|
905
|
-
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
|
|
906
|
-
objectGetOwnPropertyDescriptor.f = DESCRIPTORS$5 ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
|
|
907
|
-
O = toIndexedObject$1(O);
|
|
908
|
-
P = toPropertyKey$1(P);
|
|
909
|
-
if (IE8_DOM_DEFINE) try {
|
|
910
|
-
return $getOwnPropertyDescriptor(O, P);
|
|
911
|
-
} catch (error) { /* empty */ }
|
|
912
|
-
if (hasOwn$7(O, P)) return createPropertyDescriptor$2(!call$d(propertyIsEnumerableModule$1.f, O, P), O[P]);
|
|
913
|
-
};
|
|
914
|
-
|
|
915
|
-
var redefine$7 = {exports: {}};
|
|
916
|
-
|
|
917
|
-
var DESCRIPTORS$4 = descriptors;
|
|
918
|
-
var hasOwn$6 = hasOwnProperty_1;
|
|
919
|
-
|
|
920
|
-
var FunctionPrototype$1 = Function.prototype;
|
|
921
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
922
|
-
var getDescriptor = DESCRIPTORS$4 && Object.getOwnPropertyDescriptor;
|
|
923
|
-
|
|
924
|
-
var EXISTS = hasOwn$6(FunctionPrototype$1, 'name');
|
|
925
|
-
// additional protection from minified / mangled / dropped function names
|
|
926
|
-
var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
|
|
927
|
-
var CONFIGURABLE = EXISTS && (!DESCRIPTORS$4 || (DESCRIPTORS$4 && getDescriptor(FunctionPrototype$1, 'name').configurable));
|
|
928
|
-
|
|
929
|
-
var functionName = {
|
|
930
|
-
EXISTS: EXISTS,
|
|
931
|
-
PROPER: PROPER,
|
|
932
|
-
CONFIGURABLE: CONFIGURABLE
|
|
933
|
-
};
|
|
934
|
-
|
|
935
|
-
var global$q = global$J;
|
|
936
|
-
var isCallable$c = isCallable$k;
|
|
937
|
-
var hasOwn$5 = hasOwnProperty_1;
|
|
938
|
-
var createNonEnumerableProperty$4 = createNonEnumerableProperty$6;
|
|
939
|
-
var setGlobal$1 = setGlobal$3;
|
|
940
|
-
var inspectSource$2 = inspectSource$4;
|
|
941
|
-
var InternalStateModule$2 = internalState;
|
|
942
|
-
var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
|
|
943
|
-
|
|
944
|
-
var getInternalState$3 = InternalStateModule$2.get;
|
|
945
|
-
var enforceInternalState = InternalStateModule$2.enforce;
|
|
946
|
-
var TEMPLATE = String(String).split('String');
|
|
947
|
-
|
|
948
|
-
(redefine$7.exports = function (O, key, value, options) {
|
|
949
|
-
var unsafe = options ? !!options.unsafe : false;
|
|
950
|
-
var simple = options ? !!options.enumerable : false;
|
|
951
|
-
var noTargetGet = options ? !!options.noTargetGet : false;
|
|
952
|
-
var name = options && options.name !== undefined ? options.name : key;
|
|
953
|
-
var state;
|
|
954
|
-
if (isCallable$c(value)) {
|
|
955
|
-
if (String(name).slice(0, 7) === 'Symbol(') {
|
|
956
|
-
name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
|
|
957
|
-
}
|
|
958
|
-
if (!hasOwn$5(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
|
|
959
|
-
createNonEnumerableProperty$4(value, 'name', name);
|
|
960
|
-
}
|
|
961
|
-
state = enforceInternalState(value);
|
|
962
|
-
if (!state.source) {
|
|
963
|
-
state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
|
|
964
|
-
}
|
|
965
|
-
}
|
|
966
|
-
if (O === global$q) {
|
|
967
|
-
if (simple) O[key] = value;
|
|
968
|
-
else setGlobal$1(key, value);
|
|
969
|
-
return;
|
|
970
|
-
} else if (!unsafe) {
|
|
971
|
-
delete O[key];
|
|
972
|
-
} else if (!noTargetGet && O[key]) {
|
|
973
|
-
simple = true;
|
|
974
|
-
}
|
|
975
|
-
if (simple) O[key] = value;
|
|
976
|
-
else createNonEnumerableProperty$4(O, key, value);
|
|
977
|
-
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
|
|
978
|
-
})(Function.prototype, 'toString', function toString() {
|
|
979
|
-
return isCallable$c(this) && getInternalState$3(this).source || inspectSource$2(this);
|
|
980
|
-
});
|
|
981
|
-
|
|
982
|
-
var objectGetOwnPropertyNames = {};
|
|
983
|
-
|
|
984
|
-
var internalObjectKeys = objectKeysInternal;
|
|
985
|
-
var enumBugKeys = enumBugKeys$3;
|
|
986
|
-
|
|
987
|
-
var hiddenKeys = enumBugKeys.concat('length', 'prototype');
|
|
988
|
-
|
|
989
|
-
// `Object.getOwnPropertyNames` method
|
|
990
|
-
// https://tc39.es/ecma262/#sec-object.getownpropertynames
|
|
991
|
-
// eslint-disable-next-line es/no-object-getownpropertynames -- safe
|
|
992
|
-
objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
|
993
|
-
return internalObjectKeys(O, hiddenKeys);
|
|
994
|
-
};
|
|
995
|
-
|
|
996
|
-
var objectGetOwnPropertySymbols = {};
|
|
997
|
-
|
|
998
|
-
// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
|
|
999
|
-
objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
|
|
1000
|
-
|
|
1001
|
-
var getBuiltIn$3 = getBuiltIn$7;
|
|
1002
|
-
var uncurryThis$d = functionUncurryThis;
|
|
1003
|
-
var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
|
|
1004
|
-
var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
|
|
1005
|
-
var anObject$d = anObject$h;
|
|
1006
|
-
|
|
1007
|
-
var concat$2 = uncurryThis$d([].concat);
|
|
1008
|
-
|
|
1009
|
-
// all object keys, includes non-enumerable and symbols
|
|
1010
|
-
var ownKeys$1 = getBuiltIn$3('Reflect', 'ownKeys') || function ownKeys(it) {
|
|
1011
|
-
var keys = getOwnPropertyNamesModule.f(anObject$d(it));
|
|
1012
|
-
var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
|
|
1013
|
-
return getOwnPropertySymbols ? concat$2(keys, getOwnPropertySymbols(it)) : keys;
|
|
1014
|
-
};
|
|
1015
|
-
|
|
1016
|
-
var hasOwn$4 = hasOwnProperty_1;
|
|
1017
|
-
var ownKeys = ownKeys$1;
|
|
1018
|
-
var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
|
|
1019
|
-
var definePropertyModule$2 = objectDefineProperty;
|
|
1020
|
-
|
|
1021
|
-
var copyConstructorProperties$2 = function (target, source, exceptions) {
|
|
1022
|
-
var keys = ownKeys(source);
|
|
1023
|
-
var defineProperty = definePropertyModule$2.f;
|
|
1024
|
-
var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
|
1025
|
-
for (var i = 0; i < keys.length; i++) {
|
|
1026
|
-
var key = keys[i];
|
|
1027
|
-
if (!hasOwn$4(target, key) && !(exceptions && hasOwn$4(exceptions, key))) {
|
|
1028
|
-
defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
|
1029
|
-
}
|
|
1030
|
-
}
|
|
1031
|
-
};
|
|
1032
|
-
|
|
1033
|
-
var fails$d = fails$k;
|
|
1034
|
-
var isCallable$b = isCallable$k;
|
|
1035
|
-
|
|
1036
|
-
var replacement = /#|\.prototype\./;
|
|
1037
|
-
|
|
1038
|
-
var isForced$2 = function (feature, detection) {
|
|
1039
|
-
var value = data[normalize(feature)];
|
|
1040
|
-
return value == POLYFILL ? true
|
|
1041
|
-
: value == NATIVE ? false
|
|
1042
|
-
: isCallable$b(detection) ? fails$d(detection)
|
|
1043
|
-
: !!detection;
|
|
1044
|
-
};
|
|
1045
|
-
|
|
1046
|
-
var normalize = isForced$2.normalize = function (string) {
|
|
1047
|
-
return String(string).replace(replacement, '.').toLowerCase();
|
|
1048
|
-
};
|
|
1049
|
-
|
|
1050
|
-
var data = isForced$2.data = {};
|
|
1051
|
-
var NATIVE = isForced$2.NATIVE = 'N';
|
|
1052
|
-
var POLYFILL = isForced$2.POLYFILL = 'P';
|
|
1053
|
-
|
|
1054
|
-
var isForced_1 = isForced$2;
|
|
1055
|
-
|
|
1056
|
-
var global$p = global$J;
|
|
1057
|
-
var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
|
|
1058
|
-
var createNonEnumerableProperty$3 = createNonEnumerableProperty$6;
|
|
1059
|
-
var redefine$6 = redefine$7.exports;
|
|
1060
|
-
var setGlobal = setGlobal$3;
|
|
1061
|
-
var copyConstructorProperties$1 = copyConstructorProperties$2;
|
|
1062
|
-
var isForced$1 = isForced_1;
|
|
1063
|
-
|
|
1064
|
-
/*
|
|
1065
|
-
options.target - name of the target object
|
|
1066
|
-
options.global - target is the global object
|
|
1067
|
-
options.stat - export as static methods of target
|
|
1068
|
-
options.proto - export as prototype methods of target
|
|
1069
|
-
options.real - real prototype method for the `pure` version
|
|
1070
|
-
options.forced - export even if the native feature is available
|
|
1071
|
-
options.bind - bind methods to the target, required for the `pure` version
|
|
1072
|
-
options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
|
|
1073
|
-
options.unsafe - use the simple assignment of property instead of delete + defineProperty
|
|
1074
|
-
options.sham - add a flag to not completely full polyfills
|
|
1075
|
-
options.enumerable - export as enumerable property
|
|
1076
|
-
options.noTargetGet - prevent calling a getter on target
|
|
1077
|
-
options.name - the .name of the function if it does not match the key
|
|
1078
|
-
*/
|
|
1079
|
-
var _export = function (options, source) {
|
|
1080
|
-
var TARGET = options.target;
|
|
1081
|
-
var GLOBAL = options.global;
|
|
1082
|
-
var STATIC = options.stat;
|
|
1083
|
-
var FORCED, target, key, targetProperty, sourceProperty, descriptor;
|
|
1084
|
-
if (GLOBAL) {
|
|
1085
|
-
target = global$p;
|
|
1086
|
-
} else if (STATIC) {
|
|
1087
|
-
target = global$p[TARGET] || setGlobal(TARGET, {});
|
|
1088
|
-
} else {
|
|
1089
|
-
target = (global$p[TARGET] || {}).prototype;
|
|
1090
|
-
}
|
|
1091
|
-
if (target) for (key in source) {
|
|
1092
|
-
sourceProperty = source[key];
|
|
1093
|
-
if (options.noTargetGet) {
|
|
1094
|
-
descriptor = getOwnPropertyDescriptor$1(target, key);
|
|
1095
|
-
targetProperty = descriptor && descriptor.value;
|
|
1096
|
-
} else targetProperty = target[key];
|
|
1097
|
-
FORCED = isForced$1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
|
1098
|
-
// contained in target
|
|
1099
|
-
if (!FORCED && targetProperty !== undefined) {
|
|
1100
|
-
if (typeof sourceProperty == typeof targetProperty) continue;
|
|
1101
|
-
copyConstructorProperties$1(sourceProperty, targetProperty);
|
|
1102
|
-
}
|
|
1103
|
-
// add a flag to not completely full polyfills
|
|
1104
|
-
if (options.sham || (targetProperty && targetProperty.sham)) {
|
|
1105
|
-
createNonEnumerableProperty$3(sourceProperty, 'sham', true);
|
|
1106
|
-
}
|
|
1107
|
-
// extend global
|
|
1108
|
-
redefine$6(target, key, sourceProperty, options);
|
|
1109
|
-
}
|
|
1110
|
-
};
|
|
1111
|
-
|
|
1112
|
-
var fails$c = fails$k;
|
|
1113
|
-
|
|
1114
|
-
var correctPrototypeGetter = !fails$c(function () {
|
|
1115
|
-
function F() { /* empty */ }
|
|
1116
|
-
F.prototype.constructor = null;
|
|
1117
|
-
// eslint-disable-next-line es/no-object-getprototypeof -- required for testing
|
|
1118
|
-
return Object.getPrototypeOf(new F()) !== F.prototype;
|
|
1119
|
-
});
|
|
1120
|
-
|
|
1121
|
-
var global$o = global$J;
|
|
1122
|
-
var hasOwn$3 = hasOwnProperty_1;
|
|
1123
|
-
var isCallable$a = isCallable$k;
|
|
1124
|
-
var toObject$3 = toObject$5;
|
|
1125
|
-
var sharedKey = sharedKey$3;
|
|
1126
|
-
var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
|
|
1127
|
-
|
|
1128
|
-
var IE_PROTO = sharedKey('IE_PROTO');
|
|
1129
|
-
var Object$2 = global$o.Object;
|
|
1130
|
-
var ObjectPrototype = Object$2.prototype;
|
|
1131
|
-
|
|
1132
|
-
// `Object.getPrototypeOf` method
|
|
1133
|
-
// https://tc39.es/ecma262/#sec-object.getprototypeof
|
|
1134
|
-
var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? Object$2.getPrototypeOf : function (O) {
|
|
1135
|
-
var object = toObject$3(O);
|
|
1136
|
-
if (hasOwn$3(object, IE_PROTO)) return object[IE_PROTO];
|
|
1137
|
-
var constructor = object.constructor;
|
|
1138
|
-
if (isCallable$a(constructor) && object instanceof constructor) {
|
|
1139
|
-
return constructor.prototype;
|
|
1140
|
-
} return object instanceof Object$2 ? ObjectPrototype : null;
|
|
1141
|
-
};
|
|
1142
|
-
|
|
1143
|
-
var fails$b = fails$k;
|
|
1144
|
-
var isCallable$9 = isCallable$k;
|
|
1145
|
-
var getPrototypeOf$1 = objectGetPrototypeOf;
|
|
1146
|
-
var redefine$5 = redefine$7.exports;
|
|
1147
|
-
var wellKnownSymbol$e = wellKnownSymbol$h;
|
|
1148
|
-
|
|
1149
|
-
var ITERATOR$5 = wellKnownSymbol$e('iterator');
|
|
1150
|
-
var BUGGY_SAFARI_ITERATORS$1 = false;
|
|
1151
|
-
|
|
1152
|
-
// `%IteratorPrototype%` object
|
|
1153
|
-
// https://tc39.es/ecma262/#sec-%iteratorprototype%-object
|
|
1154
|
-
var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
|
|
1155
|
-
|
|
1156
|
-
/* eslint-disable es/no-array-prototype-keys -- safe */
|
|
1157
|
-
if ([].keys) {
|
|
1158
|
-
arrayIterator = [].keys();
|
|
1159
|
-
// Safari 8 has buggy iterators w/o `next`
|
|
1160
|
-
if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
|
|
1161
|
-
else {
|
|
1162
|
-
PrototypeOfArrayIteratorPrototype = getPrototypeOf$1(getPrototypeOf$1(arrayIterator));
|
|
1163
|
-
if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
|
|
1164
|
-
}
|
|
1165
|
-
}
|
|
1166
|
-
|
|
1167
|
-
var NEW_ITERATOR_PROTOTYPE = IteratorPrototype$2 == undefined || fails$b(function () {
|
|
1168
|
-
var test = {};
|
|
1169
|
-
// FF44- legacy iterators case
|
|
1170
|
-
return IteratorPrototype$2[ITERATOR$5].call(test) !== test;
|
|
1171
|
-
});
|
|
1172
|
-
|
|
1173
|
-
if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
|
|
1174
|
-
|
|
1175
|
-
// `%IteratorPrototype%[@@iterator]()` method
|
|
1176
|
-
// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
|
|
1177
|
-
if (!isCallable$9(IteratorPrototype$2[ITERATOR$5])) {
|
|
1178
|
-
redefine$5(IteratorPrototype$2, ITERATOR$5, function () {
|
|
1179
|
-
return this;
|
|
1180
|
-
});
|
|
1181
|
-
}
|
|
1182
|
-
|
|
1183
|
-
var iteratorsCore = {
|
|
1184
|
-
IteratorPrototype: IteratorPrototype$2,
|
|
1185
|
-
BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
|
|
1186
|
-
};
|
|
1187
|
-
|
|
1188
|
-
var defineProperty$3 = objectDefineProperty.f;
|
|
1189
|
-
var hasOwn$2 = hasOwnProperty_1;
|
|
1190
|
-
var wellKnownSymbol$d = wellKnownSymbol$h;
|
|
1191
|
-
|
|
1192
|
-
var TO_STRING_TAG$3 = wellKnownSymbol$d('toStringTag');
|
|
1193
|
-
|
|
1194
|
-
var setToStringTag$3 = function (target, TAG, STATIC) {
|
|
1195
|
-
if (target && !STATIC) target = target.prototype;
|
|
1196
|
-
if (target && !hasOwn$2(target, TO_STRING_TAG$3)) {
|
|
1197
|
-
defineProperty$3(target, TO_STRING_TAG$3, { configurable: true, value: TAG });
|
|
1198
|
-
}
|
|
1199
|
-
};
|
|
1200
|
-
|
|
1201
|
-
var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
|
|
1202
|
-
var create$1 = objectCreate;
|
|
1203
|
-
var createPropertyDescriptor$1 = createPropertyDescriptor$4;
|
|
1204
|
-
var setToStringTag$2 = setToStringTag$3;
|
|
1205
|
-
var Iterators$4 = iterators;
|
|
1206
|
-
|
|
1207
|
-
var returnThis$1 = function () { return this; };
|
|
1208
|
-
|
|
1209
|
-
var createIteratorConstructor$1 = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
|
|
1210
|
-
var TO_STRING_TAG = NAME + ' Iterator';
|
|
1211
|
-
IteratorConstructor.prototype = create$1(IteratorPrototype$1, { next: createPropertyDescriptor$1(+!ENUMERABLE_NEXT, next) });
|
|
1212
|
-
setToStringTag$2(IteratorConstructor, TO_STRING_TAG, false);
|
|
1213
|
-
Iterators$4[TO_STRING_TAG] = returnThis$1;
|
|
1214
|
-
return IteratorConstructor;
|
|
1215
|
-
};
|
|
1216
|
-
|
|
1217
|
-
var global$n = global$J;
|
|
1218
|
-
var isCallable$8 = isCallable$k;
|
|
1219
|
-
|
|
1220
|
-
var String$3 = global$n.String;
|
|
1221
|
-
var TypeError$9 = global$n.TypeError;
|
|
1222
|
-
|
|
1223
|
-
var aPossiblePrototype$1 = function (argument) {
|
|
1224
|
-
if (typeof argument == 'object' || isCallable$8(argument)) return argument;
|
|
1225
|
-
throw TypeError$9("Can't set " + String$3(argument) + ' as a prototype');
|
|
1226
|
-
};
|
|
1227
|
-
|
|
1228
|
-
/* eslint-disable no-proto -- safe */
|
|
1229
|
-
|
|
1230
|
-
var uncurryThis$c = functionUncurryThis;
|
|
1231
|
-
var anObject$c = anObject$h;
|
|
1232
|
-
var aPossiblePrototype = aPossiblePrototype$1;
|
|
1233
|
-
|
|
1234
|
-
// `Object.setPrototypeOf` method
|
|
1235
|
-
// https://tc39.es/ecma262/#sec-object.setprototypeof
|
|
1236
|
-
// Works with __proto__ only. Old v8 can't work with null proto objects.
|
|
1237
|
-
// eslint-disable-next-line es/no-object-setprototypeof -- safe
|
|
1238
|
-
var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
|
1239
|
-
var CORRECT_SETTER = false;
|
|
1240
|
-
var test = {};
|
|
1241
|
-
var setter;
|
|
1242
|
-
try {
|
|
1243
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
1244
|
-
setter = uncurryThis$c(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
|
|
1245
|
-
setter(test, []);
|
|
1246
|
-
CORRECT_SETTER = test instanceof Array;
|
|
1247
|
-
} catch (error) { /* empty */ }
|
|
1248
|
-
return function setPrototypeOf(O, proto) {
|
|
1249
|
-
anObject$c(O);
|
|
1250
|
-
aPossiblePrototype(proto);
|
|
1251
|
-
if (CORRECT_SETTER) setter(O, proto);
|
|
1252
|
-
else O.__proto__ = proto;
|
|
1253
|
-
return O;
|
|
1254
|
-
};
|
|
1255
|
-
}() : undefined);
|
|
1256
|
-
|
|
1257
|
-
var $$5 = _export;
|
|
1258
|
-
var call$c = functionCall;
|
|
1259
|
-
var FunctionName = functionName;
|
|
1260
|
-
var isCallable$7 = isCallable$k;
|
|
1261
|
-
var createIteratorConstructor = createIteratorConstructor$1;
|
|
1262
|
-
var getPrototypeOf = objectGetPrototypeOf;
|
|
1263
|
-
var setPrototypeOf$1 = objectSetPrototypeOf;
|
|
1264
|
-
var setToStringTag$1 = setToStringTag$3;
|
|
1265
|
-
var createNonEnumerableProperty$2 = createNonEnumerableProperty$6;
|
|
1266
|
-
var redefine$4 = redefine$7.exports;
|
|
1267
|
-
var wellKnownSymbol$c = wellKnownSymbol$h;
|
|
1268
|
-
var Iterators$3 = iterators;
|
|
1269
|
-
var IteratorsCore = iteratorsCore;
|
|
1270
|
-
|
|
1271
|
-
var PROPER_FUNCTION_NAME$1 = FunctionName.PROPER;
|
|
1272
|
-
var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
|
|
1273
|
-
var IteratorPrototype = IteratorsCore.IteratorPrototype;
|
|
1274
|
-
var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
|
|
1275
|
-
var ITERATOR$4 = wellKnownSymbol$c('iterator');
|
|
1276
|
-
var KEYS = 'keys';
|
|
1277
|
-
var VALUES = 'values';
|
|
1278
|
-
var ENTRIES = 'entries';
|
|
1279
|
-
|
|
1280
|
-
var returnThis = function () { return this; };
|
|
1281
|
-
|
|
1282
|
-
var defineIterator$1 = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
|
|
1283
|
-
createIteratorConstructor(IteratorConstructor, NAME, next);
|
|
1284
|
-
|
|
1285
|
-
var getIterationMethod = function (KIND) {
|
|
1286
|
-
if (KIND === DEFAULT && defaultIterator) return defaultIterator;
|
|
1287
|
-
if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
|
|
1288
|
-
switch (KIND) {
|
|
1289
|
-
case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
|
|
1290
|
-
case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
|
|
1291
|
-
case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
|
|
1292
|
-
} return function () { return new IteratorConstructor(this); };
|
|
1293
|
-
};
|
|
1294
|
-
|
|
1295
|
-
var TO_STRING_TAG = NAME + ' Iterator';
|
|
1296
|
-
var INCORRECT_VALUES_NAME = false;
|
|
1297
|
-
var IterablePrototype = Iterable.prototype;
|
|
1298
|
-
var nativeIterator = IterablePrototype[ITERATOR$4]
|
|
1299
|
-
|| IterablePrototype['@@iterator']
|
|
1300
|
-
|| DEFAULT && IterablePrototype[DEFAULT];
|
|
1301
|
-
var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
|
|
1302
|
-
var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
|
|
1303
|
-
var CurrentIteratorPrototype, methods, KEY;
|
|
1304
|
-
|
|
1305
|
-
// fix native
|
|
1306
|
-
if (anyNativeIterator) {
|
|
1307
|
-
CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
|
|
1308
|
-
if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
|
|
1309
|
-
if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
|
|
1310
|
-
if (setPrototypeOf$1) {
|
|
1311
|
-
setPrototypeOf$1(CurrentIteratorPrototype, IteratorPrototype);
|
|
1312
|
-
} else if (!isCallable$7(CurrentIteratorPrototype[ITERATOR$4])) {
|
|
1313
|
-
redefine$4(CurrentIteratorPrototype, ITERATOR$4, returnThis);
|
|
1314
|
-
}
|
|
1315
|
-
}
|
|
1316
|
-
// Set @@toStringTag to native iterators
|
|
1317
|
-
setToStringTag$1(CurrentIteratorPrototype, TO_STRING_TAG, true);
|
|
1318
|
-
}
|
|
1319
|
-
}
|
|
1320
|
-
|
|
1321
|
-
// fix Array.prototype.{ values, @@iterator }.name in V8 / FF
|
|
1322
|
-
if (PROPER_FUNCTION_NAME$1 && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
|
|
1323
|
-
if (CONFIGURABLE_FUNCTION_NAME) {
|
|
1324
|
-
createNonEnumerableProperty$2(IterablePrototype, 'name', VALUES);
|
|
1325
|
-
} else {
|
|
1326
|
-
INCORRECT_VALUES_NAME = true;
|
|
1327
|
-
defaultIterator = function values() { return call$c(nativeIterator, this); };
|
|
1328
|
-
}
|
|
1329
|
-
}
|
|
1330
|
-
|
|
1331
|
-
// export additional methods
|
|
1332
|
-
if (DEFAULT) {
|
|
1333
|
-
methods = {
|
|
1334
|
-
values: getIterationMethod(VALUES),
|
|
1335
|
-
keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
|
|
1336
|
-
entries: getIterationMethod(ENTRIES)
|
|
1337
|
-
};
|
|
1338
|
-
if (FORCED) for (KEY in methods) {
|
|
1339
|
-
if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
|
|
1340
|
-
redefine$4(IterablePrototype, KEY, methods[KEY]);
|
|
1341
|
-
}
|
|
1342
|
-
} else $$5({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
|
|
1343
|
-
}
|
|
1344
|
-
|
|
1345
|
-
// define iterator
|
|
1346
|
-
if (IterablePrototype[ITERATOR$4] !== defaultIterator) {
|
|
1347
|
-
redefine$4(IterablePrototype, ITERATOR$4, defaultIterator, { name: DEFAULT });
|
|
1348
|
-
}
|
|
1349
|
-
Iterators$3[NAME] = defaultIterator;
|
|
1350
|
-
|
|
1351
|
-
return methods;
|
|
1352
|
-
};
|
|
1353
|
-
|
|
1354
|
-
var toIndexedObject = toIndexedObject$5;
|
|
1355
|
-
var addToUnscopables = addToUnscopables$1;
|
|
1356
|
-
var Iterators$2 = iterators;
|
|
1357
|
-
var InternalStateModule$1 = internalState;
|
|
1358
|
-
var defineProperty$2 = objectDefineProperty.f;
|
|
1359
|
-
var defineIterator = defineIterator$1;
|
|
1360
|
-
var DESCRIPTORS$3 = descriptors;
|
|
1361
|
-
|
|
1362
|
-
var ARRAY_ITERATOR = 'Array Iterator';
|
|
1363
|
-
var setInternalState$1 = InternalStateModule$1.set;
|
|
1364
|
-
var getInternalState$2 = InternalStateModule$1.getterFor(ARRAY_ITERATOR);
|
|
1365
|
-
|
|
1366
|
-
// `Array.prototype.entries` method
|
|
1367
|
-
// https://tc39.es/ecma262/#sec-array.prototype.entries
|
|
1368
|
-
// `Array.prototype.keys` method
|
|
1369
|
-
// https://tc39.es/ecma262/#sec-array.prototype.keys
|
|
1370
|
-
// `Array.prototype.values` method
|
|
1371
|
-
// https://tc39.es/ecma262/#sec-array.prototype.values
|
|
1372
|
-
// `Array.prototype[@@iterator]` method
|
|
1373
|
-
// https://tc39.es/ecma262/#sec-array.prototype-@@iterator
|
|
1374
|
-
// `CreateArrayIterator` internal method
|
|
1375
|
-
// https://tc39.es/ecma262/#sec-createarrayiterator
|
|
1376
|
-
var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
|
|
1377
|
-
setInternalState$1(this, {
|
|
1378
|
-
type: ARRAY_ITERATOR,
|
|
1379
|
-
target: toIndexedObject(iterated), // target
|
|
1380
|
-
index: 0, // next index
|
|
1381
|
-
kind: kind // kind
|
|
1382
|
-
});
|
|
1383
|
-
// `%ArrayIteratorPrototype%.next` method
|
|
1384
|
-
// https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
|
|
1385
|
-
}, function () {
|
|
1386
|
-
var state = getInternalState$2(this);
|
|
1387
|
-
var target = state.target;
|
|
1388
|
-
var kind = state.kind;
|
|
1389
|
-
var index = state.index++;
|
|
1390
|
-
if (!target || index >= target.length) {
|
|
1391
|
-
state.target = undefined;
|
|
1392
|
-
return { value: undefined, done: true };
|
|
1393
|
-
}
|
|
1394
|
-
if (kind == 'keys') return { value: index, done: false };
|
|
1395
|
-
if (kind == 'values') return { value: target[index], done: false };
|
|
1396
|
-
return { value: [index, target[index]], done: false };
|
|
1397
|
-
}, 'values');
|
|
1398
|
-
|
|
1399
|
-
// argumentsList[@@iterator] is %ArrayProto_values%
|
|
1400
|
-
// https://tc39.es/ecma262/#sec-createunmappedargumentsobject
|
|
1401
|
-
// https://tc39.es/ecma262/#sec-createmappedargumentsobject
|
|
1402
|
-
var values = Iterators$2.Arguments = Iterators$2.Array;
|
|
1403
|
-
|
|
1404
|
-
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
1405
|
-
addToUnscopables('keys');
|
|
1406
|
-
addToUnscopables('values');
|
|
1407
|
-
addToUnscopables('entries');
|
|
1408
|
-
|
|
1409
|
-
// V8 ~ Chrome 45- bug
|
|
1410
|
-
if (DESCRIPTORS$3 && values.name !== 'values') try {
|
|
1411
|
-
defineProperty$2(values, 'name', { value: 'values' });
|
|
1412
|
-
} catch (error) { /* empty */ }
|
|
1413
|
-
|
|
1414
|
-
// iterable DOM collections
|
|
1415
|
-
// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
|
|
1416
|
-
var domIterables = {
|
|
1417
|
-
CSSRuleList: 0,
|
|
1418
|
-
CSSStyleDeclaration: 0,
|
|
1419
|
-
CSSValueList: 0,
|
|
1420
|
-
ClientRectList: 0,
|
|
1421
|
-
DOMRectList: 0,
|
|
1422
|
-
DOMStringList: 0,
|
|
1423
|
-
DOMTokenList: 1,
|
|
1424
|
-
DataTransferItemList: 0,
|
|
1425
|
-
FileList: 0,
|
|
1426
|
-
HTMLAllCollection: 0,
|
|
1427
|
-
HTMLCollection: 0,
|
|
1428
|
-
HTMLFormElement: 0,
|
|
1429
|
-
HTMLSelectElement: 0,
|
|
1430
|
-
MediaList: 0,
|
|
1431
|
-
MimeTypeArray: 0,
|
|
1432
|
-
NamedNodeMap: 0,
|
|
1433
|
-
NodeList: 1,
|
|
1434
|
-
PaintRequestList: 0,
|
|
1435
|
-
Plugin: 0,
|
|
1436
|
-
PluginArray: 0,
|
|
1437
|
-
SVGLengthList: 0,
|
|
1438
|
-
SVGNumberList: 0,
|
|
1439
|
-
SVGPathSegList: 0,
|
|
1440
|
-
SVGPointList: 0,
|
|
1441
|
-
SVGStringList: 0,
|
|
1442
|
-
SVGTransformList: 0,
|
|
1443
|
-
SourceBufferList: 0,
|
|
1444
|
-
StyleSheetList: 0,
|
|
1445
|
-
TextTrackCueList: 0,
|
|
1446
|
-
TextTrackList: 0,
|
|
1447
|
-
TouchList: 0
|
|
1448
|
-
};
|
|
1449
|
-
|
|
1450
|
-
// in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
|
|
1451
|
-
var documentCreateElement = documentCreateElement$2;
|
|
1452
|
-
|
|
1453
|
-
var classList = documentCreateElement('span').classList;
|
|
1454
|
-
var DOMTokenListPrototype$1 = classList && classList.constructor && classList.constructor.prototype;
|
|
1455
|
-
|
|
1456
|
-
var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
|
|
1457
|
-
|
|
1458
|
-
var global$m = global$J;
|
|
1459
|
-
var DOMIterables = domIterables;
|
|
1460
|
-
var DOMTokenListPrototype = domTokenListPrototype;
|
|
1461
|
-
var ArrayIteratorMethods = es_array_iterator;
|
|
1462
|
-
var createNonEnumerableProperty$1 = createNonEnumerableProperty$6;
|
|
1463
|
-
var wellKnownSymbol$b = wellKnownSymbol$h;
|
|
1464
|
-
|
|
1465
|
-
var ITERATOR$3 = wellKnownSymbol$b('iterator');
|
|
1466
|
-
var TO_STRING_TAG$2 = wellKnownSymbol$b('toStringTag');
|
|
1467
|
-
var ArrayValues = ArrayIteratorMethods.values;
|
|
1468
|
-
|
|
1469
|
-
var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
|
|
1470
|
-
if (CollectionPrototype) {
|
|
1471
|
-
// some Chrome versions have non-configurable methods on DOMTokenList
|
|
1472
|
-
if (CollectionPrototype[ITERATOR$3] !== ArrayValues) try {
|
|
1473
|
-
createNonEnumerableProperty$1(CollectionPrototype, ITERATOR$3, ArrayValues);
|
|
1474
|
-
} catch (error) {
|
|
1475
|
-
CollectionPrototype[ITERATOR$3] = ArrayValues;
|
|
1476
|
-
}
|
|
1477
|
-
if (!CollectionPrototype[TO_STRING_TAG$2]) {
|
|
1478
|
-
createNonEnumerableProperty$1(CollectionPrototype, TO_STRING_TAG$2, COLLECTION_NAME);
|
|
1479
|
-
}
|
|
1480
|
-
if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
|
|
1481
|
-
// some Chrome versions have non-configurable methods on DOMTokenList
|
|
1482
|
-
if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
|
|
1483
|
-
createNonEnumerableProperty$1(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
|
|
1484
|
-
} catch (error) {
|
|
1485
|
-
CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
|
|
1486
|
-
}
|
|
1487
|
-
}
|
|
1488
|
-
}
|
|
1489
|
-
};
|
|
1490
|
-
|
|
1491
|
-
for (var COLLECTION_NAME in DOMIterables) {
|
|
1492
|
-
handlePrototype(global$m[COLLECTION_NAME] && global$m[COLLECTION_NAME].prototype, COLLECTION_NAME);
|
|
1493
|
-
}
|
|
1494
|
-
|
|
1495
|
-
handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
|
|
1496
|
-
|
|
1497
|
-
var DESCRIPTORS$2 = descriptors;
|
|
1498
|
-
var uncurryThis$b = functionUncurryThis;
|
|
1499
|
-
var call$b = functionCall;
|
|
1500
|
-
var fails$a = fails$k;
|
|
1501
|
-
var objectKeys = objectKeys$2;
|
|
1502
|
-
var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
|
|
1503
|
-
var propertyIsEnumerableModule = objectPropertyIsEnumerable;
|
|
1504
|
-
var toObject$2 = toObject$5;
|
|
1505
|
-
var IndexedObject$1 = indexedObject;
|
|
1506
|
-
|
|
1507
|
-
// eslint-disable-next-line es/no-object-assign -- safe
|
|
1508
|
-
var $assign = Object.assign;
|
|
1509
|
-
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
1510
|
-
var defineProperty$1 = Object.defineProperty;
|
|
1511
|
-
var concat$1 = uncurryThis$b([].concat);
|
|
1512
|
-
|
|
1513
|
-
// `Object.assign` method
|
|
1514
|
-
// https://tc39.es/ecma262/#sec-object.assign
|
|
1515
|
-
var objectAssign = !$assign || fails$a(function () {
|
|
1516
|
-
// should have correct order of operations (Edge bug)
|
|
1517
|
-
if (DESCRIPTORS$2 && $assign({ b: 1 }, $assign(defineProperty$1({}, 'a', {
|
|
1518
|
-
enumerable: true,
|
|
1519
|
-
get: function () {
|
|
1520
|
-
defineProperty$1(this, 'b', {
|
|
1521
|
-
value: 3,
|
|
1522
|
-
enumerable: false
|
|
1523
|
-
});
|
|
1524
|
-
}
|
|
1525
|
-
}), { b: 2 })).b !== 1) return true;
|
|
1526
|
-
// should work with symbols and should have deterministic property order (V8 bug)
|
|
1527
|
-
var A = {};
|
|
1528
|
-
var B = {};
|
|
1529
|
-
// eslint-disable-next-line es/no-symbol -- safe
|
|
1530
|
-
var symbol = Symbol();
|
|
1531
|
-
var alphabet = 'abcdefghijklmnopqrst';
|
|
1532
|
-
A[symbol] = 7;
|
|
1533
|
-
alphabet.split('').forEach(function (chr) { B[chr] = chr; });
|
|
1534
|
-
return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;
|
|
1535
|
-
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
|
|
1536
|
-
var T = toObject$2(target);
|
|
1537
|
-
var argumentsLength = arguments.length;
|
|
1538
|
-
var index = 1;
|
|
1539
|
-
var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
|
|
1540
|
-
var propertyIsEnumerable = propertyIsEnumerableModule.f;
|
|
1541
|
-
while (argumentsLength > index) {
|
|
1542
|
-
var S = IndexedObject$1(arguments[index++]);
|
|
1543
|
-
var keys = getOwnPropertySymbols ? concat$1(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
|
|
1544
|
-
var length = keys.length;
|
|
1545
|
-
var j = 0;
|
|
1546
|
-
var key;
|
|
1547
|
-
while (length > j) {
|
|
1548
|
-
key = keys[j++];
|
|
1549
|
-
if (!DESCRIPTORS$2 || call$b(propertyIsEnumerable, S, key)) T[key] = S[key];
|
|
1550
|
-
}
|
|
1551
|
-
} return T;
|
|
1552
|
-
} : $assign;
|
|
1553
|
-
|
|
1554
|
-
var $$4 = _export;
|
|
1555
|
-
var assign = objectAssign;
|
|
1556
|
-
|
|
1557
|
-
// `Object.assign` method
|
|
1558
|
-
// https://tc39.es/ecma262/#sec-object.assign
|
|
1559
|
-
// eslint-disable-next-line es/no-object-assign -- required for testing
|
|
1560
|
-
$$4({ target: 'Object', stat: true, forced: Object.assign !== assign }, {
|
|
1561
|
-
assign: assign
|
|
1562
|
-
});
|
|
1563
|
-
|
|
1564
|
-
const AnalyticsGoogle = ({
|
|
1565
|
-
id
|
|
1566
|
-
}) => {
|
|
1567
|
-
const uid = id || process.env["NEXT_PUBLIC_GTM_ID"];
|
|
1568
|
-
const {
|
|
1569
|
-
events,
|
|
1570
|
-
asPath,
|
|
1571
|
-
query
|
|
1572
|
-
} = useRouter();
|
|
1573
|
-
const [ready, setReady] = useState(false);
|
|
1574
|
-
const [routed, setRouted] = useState(false); // const [url, setUrl] = useState("");
|
|
1575
|
-
|
|
1576
|
-
useEffect(() => {
|
|
1577
|
-
const handleRouteChange = () => {
|
|
1578
|
-
setRouted(true);
|
|
1579
|
-
};
|
|
1580
|
-
|
|
1581
|
-
events.on("routeChangeComplete", handleRouteChange);
|
|
1582
|
-
return () => {
|
|
1583
|
-
events.off("routeChangeComplete", handleRouteChange);
|
|
1584
|
-
};
|
|
1585
|
-
}, [events]);
|
|
1586
|
-
useEffect(() => {
|
|
1587
|
-
if (routed && ready && asPath) {
|
|
1588
|
-
// const search = query;
|
|
1589
|
-
pageview(asPath);
|
|
1590
|
-
}
|
|
1591
|
-
}, [asPath, query, routed, ready]);
|
|
1592
|
-
|
|
1593
|
-
if (!uid) {
|
|
1594
|
-
return null;
|
|
1595
|
-
}
|
|
1596
|
-
|
|
1597
|
-
return jsxs(Fragment, {
|
|
1598
|
-
children: [jsx(Script, {
|
|
1599
|
-
id: "google-tagmanager",
|
|
1600
|
-
src: `https://www.googletagmanager.com/gtag/js?id=${id}`,
|
|
1601
|
-
strategy: "afterInteractive",
|
|
1602
|
-
onLoad: () => setReady(true)
|
|
1603
|
-
}), jsx(Script, Object.assign({
|
|
1604
|
-
id: "google-analytics",
|
|
1605
|
-
strategy: "afterInteractive"
|
|
1606
|
-
}, {
|
|
1607
|
-
children: `
|
|
1608
|
-
window.dataLayer = window.dataLayer || [];
|
|
1609
|
-
function gtag(){window.dataLayer.push(arguments);}
|
|
1610
|
-
gtag('js', new Date());
|
|
1611
|
-
|
|
1612
|
-
gtag('config', '${id}', { 'send_page_view': false });
|
|
1613
|
-
`
|
|
1614
|
-
}))]
|
|
1615
|
-
});
|
|
1616
|
-
};
|
|
1617
|
-
|
|
1618
|
-
var global$l = global$J;
|
|
1619
|
-
var aCallable$4 = aCallable$6;
|
|
1620
|
-
var toObject$1 = toObject$5;
|
|
1621
|
-
var IndexedObject = indexedObject;
|
|
1622
|
-
var lengthOfArrayLike$2 = lengthOfArrayLike$4;
|
|
1623
|
-
|
|
1624
|
-
var TypeError$8 = global$l.TypeError;
|
|
1625
|
-
|
|
1626
|
-
// `Array.prototype.{ reduce, reduceRight }` methods implementation
|
|
1627
|
-
var createMethod$1 = function (IS_RIGHT) {
|
|
1628
|
-
return function (that, callbackfn, argumentsLength, memo) {
|
|
1629
|
-
aCallable$4(callbackfn);
|
|
1630
|
-
var O = toObject$1(that);
|
|
1631
|
-
var self = IndexedObject(O);
|
|
1632
|
-
var length = lengthOfArrayLike$2(O);
|
|
1633
|
-
var index = IS_RIGHT ? length - 1 : 0;
|
|
1634
|
-
var i = IS_RIGHT ? -1 : 1;
|
|
1635
|
-
if (argumentsLength < 2) while (true) {
|
|
1636
|
-
if (index in self) {
|
|
1637
|
-
memo = self[index];
|
|
1638
|
-
index += i;
|
|
1639
|
-
break;
|
|
1640
|
-
}
|
|
1641
|
-
index += i;
|
|
1642
|
-
if (IS_RIGHT ? index < 0 : length <= index) {
|
|
1643
|
-
throw TypeError$8('Reduce of empty array with no initial value');
|
|
1644
|
-
}
|
|
1645
|
-
}
|
|
1646
|
-
for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
|
|
1647
|
-
memo = callbackfn(memo, self[index], index, O);
|
|
1648
|
-
}
|
|
1649
|
-
return memo;
|
|
1650
|
-
};
|
|
1651
|
-
};
|
|
1652
|
-
|
|
1653
|
-
var arrayReduce = {
|
|
1654
|
-
// `Array.prototype.reduce` method
|
|
1655
|
-
// https://tc39.es/ecma262/#sec-array.prototype.reduce
|
|
1656
|
-
left: createMethod$1(false),
|
|
1657
|
-
// `Array.prototype.reduceRight` method
|
|
1658
|
-
// https://tc39.es/ecma262/#sec-array.prototype.reduceright
|
|
1659
|
-
right: createMethod$1(true)
|
|
1660
|
-
};
|
|
1661
|
-
|
|
1662
|
-
var fails$9 = fails$k;
|
|
1663
|
-
|
|
1664
|
-
var arrayMethodIsStrict$1 = function (METHOD_NAME, argument) {
|
|
1665
|
-
var method = [][METHOD_NAME];
|
|
1666
|
-
return !!method && fails$9(function () {
|
|
1667
|
-
// eslint-disable-next-line no-useless-call -- required for testing
|
|
1668
|
-
method.call(null, argument || function () { return 1; }, 1);
|
|
1669
|
-
});
|
|
1670
|
-
};
|
|
1671
|
-
|
|
1672
|
-
var classof$6 = classofRaw$1;
|
|
1673
|
-
var global$k = global$J;
|
|
1674
|
-
|
|
1675
|
-
var engineIsNode = classof$6(global$k.process) == 'process';
|
|
1676
|
-
|
|
1677
|
-
var $$3 = _export;
|
|
1678
|
-
var $reduce = arrayReduce.left;
|
|
1679
|
-
var arrayMethodIsStrict = arrayMethodIsStrict$1;
|
|
1680
|
-
var CHROME_VERSION = engineV8Version;
|
|
1681
|
-
var IS_NODE$3 = engineIsNode;
|
|
1682
|
-
|
|
1683
|
-
var STRICT_METHOD = arrayMethodIsStrict('reduce');
|
|
1684
|
-
// Chrome 80-82 has a critical bug
|
|
1685
|
-
// https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
|
|
1686
|
-
var CHROME_BUG = !IS_NODE$3 && CHROME_VERSION > 79 && CHROME_VERSION < 83;
|
|
1687
|
-
|
|
1688
|
-
// `Array.prototype.reduce` method
|
|
1689
|
-
// https://tc39.es/ecma262/#sec-array.prototype.reduce
|
|
1690
|
-
$$3({ target: 'Array', proto: true, forced: !STRICT_METHOD || CHROME_BUG }, {
|
|
1691
|
-
reduce: function reduce(callbackfn /* , initialValue */) {
|
|
1692
|
-
var length = arguments.length;
|
|
1693
|
-
return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
|
|
1694
|
-
}
|
|
1695
|
-
});
|
|
1696
|
-
|
|
1697
|
-
var wellKnownSymbol$a = wellKnownSymbol$h;
|
|
1698
|
-
|
|
1699
|
-
var TO_STRING_TAG$1 = wellKnownSymbol$a('toStringTag');
|
|
1700
|
-
var test = {};
|
|
1701
|
-
|
|
1702
|
-
test[TO_STRING_TAG$1] = 'z';
|
|
1703
|
-
|
|
1704
|
-
var toStringTagSupport = String(test) === '[object z]';
|
|
1705
|
-
|
|
1706
|
-
var global$j = global$J;
|
|
1707
|
-
var TO_STRING_TAG_SUPPORT = toStringTagSupport;
|
|
1708
|
-
var isCallable$6 = isCallable$k;
|
|
1709
|
-
var classofRaw = classofRaw$1;
|
|
1710
|
-
var wellKnownSymbol$9 = wellKnownSymbol$h;
|
|
1711
|
-
|
|
1712
|
-
var TO_STRING_TAG = wellKnownSymbol$9('toStringTag');
|
|
1713
|
-
var Object$1 = global$j.Object;
|
|
1714
|
-
|
|
1715
|
-
// ES3 wrong here
|
|
1716
|
-
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
|
|
1717
|
-
|
|
1718
|
-
// fallback for IE11 Script Access Denied error
|
|
1719
|
-
var tryGet = function (it, key) {
|
|
1720
|
-
try {
|
|
1721
|
-
return it[key];
|
|
1722
|
-
} catch (error) { /* empty */ }
|
|
1723
|
-
};
|
|
1724
|
-
|
|
1725
|
-
// getting tag from ES6+ `Object.prototype.toString`
|
|
1726
|
-
var classof$5 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
|
|
1727
|
-
var O, tag, result;
|
|
1728
|
-
return it === undefined ? 'Undefined' : it === null ? 'Null'
|
|
1729
|
-
// @@toStringTag case
|
|
1730
|
-
: typeof (tag = tryGet(O = Object$1(it), TO_STRING_TAG)) == 'string' ? tag
|
|
1731
|
-
// builtinTag case
|
|
1732
|
-
: CORRECT_ARGUMENTS ? classofRaw(O)
|
|
1733
|
-
// ES3 arguments fallback
|
|
1734
|
-
: (result = classofRaw(O)) == 'Object' && isCallable$6(O.callee) ? 'Arguments' : result;
|
|
1735
|
-
};
|
|
1736
|
-
|
|
1737
|
-
var global$i = global$J;
|
|
1738
|
-
var classof$4 = classof$5;
|
|
1739
|
-
|
|
1740
|
-
var String$2 = global$i.String;
|
|
1741
|
-
|
|
1742
|
-
var toString$7 = function (argument) {
|
|
1743
|
-
if (classof$4(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
|
|
1744
|
-
return String$2(argument);
|
|
1745
|
-
};
|
|
1746
|
-
|
|
1747
|
-
var anObject$b = anObject$h;
|
|
1748
|
-
|
|
1749
|
-
// `RegExp.prototype.flags` getter implementation
|
|
1750
|
-
// https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
|
|
1751
|
-
var regexpFlags$1 = function () {
|
|
1752
|
-
var that = anObject$b(this);
|
|
1753
|
-
var result = '';
|
|
1754
|
-
if (that.global) result += 'g';
|
|
1755
|
-
if (that.ignoreCase) result += 'i';
|
|
1756
|
-
if (that.multiline) result += 'm';
|
|
1757
|
-
if (that.dotAll) result += 's';
|
|
1758
|
-
if (that.unicode) result += 'u';
|
|
1759
|
-
if (that.sticky) result += 'y';
|
|
1760
|
-
return result;
|
|
1761
|
-
};
|
|
1762
|
-
|
|
1763
|
-
var fails$8 = fails$k;
|
|
1764
|
-
var global$h = global$J;
|
|
1765
|
-
|
|
1766
|
-
// babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
|
|
1767
|
-
var $RegExp$2 = global$h.RegExp;
|
|
1768
|
-
|
|
1769
|
-
var UNSUPPORTED_Y$2 = fails$8(function () {
|
|
1770
|
-
var re = $RegExp$2('a', 'y');
|
|
1771
|
-
re.lastIndex = 2;
|
|
1772
|
-
return re.exec('abcd') != null;
|
|
1773
|
-
});
|
|
1774
|
-
|
|
1775
|
-
// UC Browser bug
|
|
1776
|
-
// https://github.com/zloirock/core-js/issues/1008
|
|
1777
|
-
var MISSED_STICKY = UNSUPPORTED_Y$2 || fails$8(function () {
|
|
1778
|
-
return !$RegExp$2('a', 'y').sticky;
|
|
1779
|
-
});
|
|
1780
|
-
|
|
1781
|
-
var BROKEN_CARET = UNSUPPORTED_Y$2 || fails$8(function () {
|
|
1782
|
-
// https://bugzilla.mozilla.org/show_bug.cgi?id=773687
|
|
1783
|
-
var re = $RegExp$2('^r', 'gy');
|
|
1784
|
-
re.lastIndex = 2;
|
|
1785
|
-
return re.exec('str') != null;
|
|
1786
|
-
});
|
|
1787
|
-
|
|
1788
|
-
var regexpStickyHelpers = {
|
|
1789
|
-
BROKEN_CARET: BROKEN_CARET,
|
|
1790
|
-
MISSED_STICKY: MISSED_STICKY,
|
|
1791
|
-
UNSUPPORTED_Y: UNSUPPORTED_Y$2
|
|
1792
|
-
};
|
|
1793
|
-
|
|
1794
|
-
var fails$7 = fails$k;
|
|
1795
|
-
var global$g = global$J;
|
|
1796
|
-
|
|
1797
|
-
// babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
|
|
1798
|
-
var $RegExp$1 = global$g.RegExp;
|
|
1799
|
-
|
|
1800
|
-
var regexpUnsupportedDotAll = fails$7(function () {
|
|
1801
|
-
var re = $RegExp$1('.', 's');
|
|
1802
|
-
return !(re.dotAll && re.exec('\n') && re.flags === 's');
|
|
1803
|
-
});
|
|
1804
|
-
|
|
1805
|
-
var fails$6 = fails$k;
|
|
1806
|
-
var global$f = global$J;
|
|
1807
|
-
|
|
1808
|
-
// babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
|
|
1809
|
-
var $RegExp = global$f.RegExp;
|
|
1810
|
-
|
|
1811
|
-
var regexpUnsupportedNcg = fails$6(function () {
|
|
1812
|
-
var re = $RegExp('(?<a>b)', 'g');
|
|
1813
|
-
return re.exec('b').groups.a !== 'b' ||
|
|
1814
|
-
'b'.replace(re, '$<a>c') !== 'bc';
|
|
1815
|
-
});
|
|
1816
|
-
|
|
1817
|
-
/* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
|
|
1818
|
-
/* eslint-disable regexp/no-useless-quantifier -- testing */
|
|
1819
|
-
var call$a = functionCall;
|
|
1820
|
-
var uncurryThis$a = functionUncurryThis;
|
|
1821
|
-
var toString$6 = toString$7;
|
|
1822
|
-
var regexpFlags = regexpFlags$1;
|
|
1823
|
-
var stickyHelpers$1 = regexpStickyHelpers;
|
|
1824
|
-
var shared = shared$4.exports;
|
|
1825
|
-
var create = objectCreate;
|
|
1826
|
-
var getInternalState$1 = internalState.get;
|
|
1827
|
-
var UNSUPPORTED_DOT_ALL = regexpUnsupportedDotAll;
|
|
1828
|
-
var UNSUPPORTED_NCG = regexpUnsupportedNcg;
|
|
1829
|
-
|
|
1830
|
-
var nativeReplace = shared('native-string-replace', String.prototype.replace);
|
|
1831
|
-
var nativeExec = RegExp.prototype.exec;
|
|
1832
|
-
var patchedExec = nativeExec;
|
|
1833
|
-
var charAt$3 = uncurryThis$a(''.charAt);
|
|
1834
|
-
var indexOf = uncurryThis$a(''.indexOf);
|
|
1835
|
-
var replace$2 = uncurryThis$a(''.replace);
|
|
1836
|
-
var stringSlice$5 = uncurryThis$a(''.slice);
|
|
1837
|
-
|
|
1838
|
-
var UPDATES_LAST_INDEX_WRONG = (function () {
|
|
1839
|
-
var re1 = /a/;
|
|
1840
|
-
var re2 = /b*/g;
|
|
1841
|
-
call$a(nativeExec, re1, 'a');
|
|
1842
|
-
call$a(nativeExec, re2, 'a');
|
|
1843
|
-
return re1.lastIndex !== 0 || re2.lastIndex !== 0;
|
|
1844
|
-
})();
|
|
1845
|
-
|
|
1846
|
-
var UNSUPPORTED_Y$1 = stickyHelpers$1.BROKEN_CARET;
|
|
1847
|
-
|
|
1848
|
-
// nonparticipating capturing group, copied from es5-shim's String#split patch.
|
|
1849
|
-
var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
|
|
1850
|
-
|
|
1851
|
-
var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$1 || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
|
|
1852
|
-
|
|
1853
|
-
if (PATCH) {
|
|
1854
|
-
patchedExec = function exec(string) {
|
|
1855
|
-
var re = this;
|
|
1856
|
-
var state = getInternalState$1(re);
|
|
1857
|
-
var str = toString$6(string);
|
|
1858
|
-
var raw = state.raw;
|
|
1859
|
-
var result, reCopy, lastIndex, match, i, object, group;
|
|
1860
|
-
|
|
1861
|
-
if (raw) {
|
|
1862
|
-
raw.lastIndex = re.lastIndex;
|
|
1863
|
-
result = call$a(patchedExec, raw, str);
|
|
1864
|
-
re.lastIndex = raw.lastIndex;
|
|
1865
|
-
return result;
|
|
1866
|
-
}
|
|
1867
|
-
|
|
1868
|
-
var groups = state.groups;
|
|
1869
|
-
var sticky = UNSUPPORTED_Y$1 && re.sticky;
|
|
1870
|
-
var flags = call$a(regexpFlags, re);
|
|
1871
|
-
var source = re.source;
|
|
1872
|
-
var charsAdded = 0;
|
|
1873
|
-
var strCopy = str;
|
|
1874
|
-
|
|
1875
|
-
if (sticky) {
|
|
1876
|
-
flags = replace$2(flags, 'y', '');
|
|
1877
|
-
if (indexOf(flags, 'g') === -1) {
|
|
1878
|
-
flags += 'g';
|
|
1879
|
-
}
|
|
1880
|
-
|
|
1881
|
-
strCopy = stringSlice$5(str, re.lastIndex);
|
|
1882
|
-
// Support anchored sticky behavior.
|
|
1883
|
-
if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$3(str, re.lastIndex - 1) !== '\n')) {
|
|
1884
|
-
source = '(?: ' + source + ')';
|
|
1885
|
-
strCopy = ' ' + strCopy;
|
|
1886
|
-
charsAdded++;
|
|
1887
|
-
}
|
|
1888
|
-
// ^(? + rx + ) is needed, in combination with some str slicing, to
|
|
1889
|
-
// simulate the 'y' flag.
|
|
1890
|
-
reCopy = new RegExp('^(?:' + source + ')', flags);
|
|
1891
|
-
}
|
|
1892
|
-
|
|
1893
|
-
if (NPCG_INCLUDED) {
|
|
1894
|
-
reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
|
|
1895
|
-
}
|
|
1896
|
-
if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
|
|
1897
|
-
|
|
1898
|
-
match = call$a(nativeExec, sticky ? reCopy : re, strCopy);
|
|
1899
|
-
|
|
1900
|
-
if (sticky) {
|
|
1901
|
-
if (match) {
|
|
1902
|
-
match.input = stringSlice$5(match.input, charsAdded);
|
|
1903
|
-
match[0] = stringSlice$5(match[0], charsAdded);
|
|
1904
|
-
match.index = re.lastIndex;
|
|
1905
|
-
re.lastIndex += match[0].length;
|
|
1906
|
-
} else re.lastIndex = 0;
|
|
1907
|
-
} else if (UPDATES_LAST_INDEX_WRONG && match) {
|
|
1908
|
-
re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
|
|
1909
|
-
}
|
|
1910
|
-
if (NPCG_INCLUDED && match && match.length > 1) {
|
|
1911
|
-
// Fix browsers whose `exec` methods don't consistently return `undefined`
|
|
1912
|
-
// for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
|
|
1913
|
-
call$a(nativeReplace, match[0], reCopy, function () {
|
|
1914
|
-
for (i = 1; i < arguments.length - 2; i++) {
|
|
1915
|
-
if (arguments[i] === undefined) match[i] = undefined;
|
|
1916
|
-
}
|
|
1917
|
-
});
|
|
1918
|
-
}
|
|
1919
|
-
|
|
1920
|
-
if (match && groups) {
|
|
1921
|
-
match.groups = object = create(null);
|
|
1922
|
-
for (i = 0; i < groups.length; i++) {
|
|
1923
|
-
group = groups[i];
|
|
1924
|
-
object[group[0]] = match[group[1]];
|
|
1925
|
-
}
|
|
1926
|
-
}
|
|
1927
|
-
|
|
1928
|
-
return match;
|
|
1929
|
-
};
|
|
1930
|
-
}
|
|
1931
|
-
|
|
1932
|
-
var regexpExec$3 = patchedExec;
|
|
1933
|
-
|
|
1934
|
-
var $$2 = _export;
|
|
1935
|
-
var exec$2 = regexpExec$3;
|
|
1936
|
-
|
|
1937
|
-
// `RegExp.prototype.exec` method
|
|
1938
|
-
// https://tc39.es/ecma262/#sec-regexp.prototype.exec
|
|
1939
|
-
$$2({ target: 'RegExp', proto: true, forced: /./.exec !== exec$2 }, {
|
|
1940
|
-
exec: exec$2
|
|
1941
|
-
});
|
|
1942
|
-
|
|
1943
|
-
var NATIVE_BIND$1 = functionBindNative;
|
|
1944
|
-
|
|
1945
|
-
var FunctionPrototype = Function.prototype;
|
|
1946
|
-
var apply$3 = FunctionPrototype.apply;
|
|
1947
|
-
var call$9 = FunctionPrototype.call;
|
|
1948
|
-
|
|
1949
|
-
// eslint-disable-next-line es/no-reflect -- safe
|
|
1950
|
-
var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$1 ? call$9.bind(apply$3) : function () {
|
|
1951
|
-
return call$9.apply(apply$3, arguments);
|
|
1952
|
-
});
|
|
1953
|
-
|
|
1954
|
-
// TODO: Remove from `core-js@4` since it's moved to entry points
|
|
1955
|
-
|
|
1956
|
-
var uncurryThis$9 = functionUncurryThis;
|
|
1957
|
-
var redefine$3 = redefine$7.exports;
|
|
1958
|
-
var regexpExec$2 = regexpExec$3;
|
|
1959
|
-
var fails$5 = fails$k;
|
|
1960
|
-
var wellKnownSymbol$8 = wellKnownSymbol$h;
|
|
1961
|
-
var createNonEnumerableProperty = createNonEnumerableProperty$6;
|
|
1962
|
-
|
|
1963
|
-
var SPECIES$3 = wellKnownSymbol$8('species');
|
|
1964
|
-
var RegExpPrototype$1 = RegExp.prototype;
|
|
1965
|
-
|
|
1966
|
-
var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
|
|
1967
|
-
var SYMBOL = wellKnownSymbol$8(KEY);
|
|
1968
|
-
|
|
1969
|
-
var DELEGATES_TO_SYMBOL = !fails$5(function () {
|
|
1970
|
-
// String methods call symbol-named RegEp methods
|
|
1971
|
-
var O = {};
|
|
1972
|
-
O[SYMBOL] = function () { return 7; };
|
|
1973
|
-
return ''[KEY](O) != 7;
|
|
1974
|
-
});
|
|
1975
|
-
|
|
1976
|
-
var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails$5(function () {
|
|
1977
|
-
// Symbol-named RegExp methods call .exec
|
|
1978
|
-
var execCalled = false;
|
|
1979
|
-
var re = /a/;
|
|
1980
|
-
|
|
1981
|
-
if (KEY === 'split') {
|
|
1982
|
-
// We can't use real regex here since it causes deoptimization
|
|
1983
|
-
// and serious performance degradation in V8
|
|
1984
|
-
// https://github.com/zloirock/core-js/issues/306
|
|
1985
|
-
re = {};
|
|
1986
|
-
// RegExp[@@split] doesn't call the regex's exec method, but first creates
|
|
1987
|
-
// a new one. We need to return the patched regex when creating the new one.
|
|
1988
|
-
re.constructor = {};
|
|
1989
|
-
re.constructor[SPECIES$3] = function () { return re; };
|
|
1990
|
-
re.flags = '';
|
|
1991
|
-
re[SYMBOL] = /./[SYMBOL];
|
|
1992
|
-
}
|
|
1993
|
-
|
|
1994
|
-
re.exec = function () { execCalled = true; return null; };
|
|
1995
|
-
|
|
1996
|
-
re[SYMBOL]('');
|
|
1997
|
-
return !execCalled;
|
|
1998
|
-
});
|
|
1999
|
-
|
|
2000
|
-
if (
|
|
2001
|
-
!DELEGATES_TO_SYMBOL ||
|
|
2002
|
-
!DELEGATES_TO_EXEC ||
|
|
2003
|
-
FORCED
|
|
2004
|
-
) {
|
|
2005
|
-
var uncurriedNativeRegExpMethod = uncurryThis$9(/./[SYMBOL]);
|
|
2006
|
-
var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
|
|
2007
|
-
var uncurriedNativeMethod = uncurryThis$9(nativeMethod);
|
|
2008
|
-
var $exec = regexp.exec;
|
|
2009
|
-
if ($exec === regexpExec$2 || $exec === RegExpPrototype$1.exec) {
|
|
2010
|
-
if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
|
|
2011
|
-
// The native String method already delegates to @@method (this
|
|
2012
|
-
// polyfilled function), leasing to infinite recursion.
|
|
2013
|
-
// We avoid it by directly calling the native @@method method.
|
|
2014
|
-
return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
|
|
2015
|
-
}
|
|
2016
|
-
return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
|
|
2017
|
-
}
|
|
2018
|
-
return { done: false };
|
|
2019
|
-
});
|
|
2020
|
-
|
|
2021
|
-
redefine$3(String.prototype, KEY, methods[0]);
|
|
2022
|
-
redefine$3(RegExpPrototype$1, SYMBOL, methods[1]);
|
|
2023
|
-
}
|
|
2024
|
-
|
|
2025
|
-
if (SHAM) createNonEnumerableProperty(RegExpPrototype$1[SYMBOL], 'sham', true);
|
|
2026
|
-
};
|
|
2027
|
-
|
|
2028
|
-
var isObject$2 = isObject$8;
|
|
2029
|
-
var classof$3 = classofRaw$1;
|
|
2030
|
-
var wellKnownSymbol$7 = wellKnownSymbol$h;
|
|
2031
|
-
|
|
2032
|
-
var MATCH = wellKnownSymbol$7('match');
|
|
2033
|
-
|
|
2034
|
-
// `IsRegExp` abstract operation
|
|
2035
|
-
// https://tc39.es/ecma262/#sec-isregexp
|
|
2036
|
-
var isRegexp = function (it) {
|
|
2037
|
-
var isRegExp;
|
|
2038
|
-
return isObject$2(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof$3(it) == 'RegExp');
|
|
2039
|
-
};
|
|
2040
|
-
|
|
2041
|
-
var uncurryThis$8 = functionUncurryThis;
|
|
2042
|
-
var fails$4 = fails$k;
|
|
2043
|
-
var isCallable$5 = isCallable$k;
|
|
2044
|
-
var classof$2 = classof$5;
|
|
2045
|
-
var getBuiltIn$2 = getBuiltIn$7;
|
|
2046
|
-
var inspectSource$1 = inspectSource$4;
|
|
2047
|
-
|
|
2048
|
-
var noop = function () { /* empty */ };
|
|
2049
|
-
var empty = [];
|
|
2050
|
-
var construct = getBuiltIn$2('Reflect', 'construct');
|
|
2051
|
-
var constructorRegExp = /^\s*(?:class|function)\b/;
|
|
2052
|
-
var exec$1 = uncurryThis$8(constructorRegExp.exec);
|
|
2053
|
-
var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
|
|
2054
|
-
|
|
2055
|
-
var isConstructorModern = function isConstructor(argument) {
|
|
2056
|
-
if (!isCallable$5(argument)) return false;
|
|
2057
|
-
try {
|
|
2058
|
-
construct(noop, empty, argument);
|
|
2059
|
-
return true;
|
|
2060
|
-
} catch (error) {
|
|
2061
|
-
return false;
|
|
2062
|
-
}
|
|
2063
|
-
};
|
|
2064
|
-
|
|
2065
|
-
var isConstructorLegacy = function isConstructor(argument) {
|
|
2066
|
-
if (!isCallable$5(argument)) return false;
|
|
2067
|
-
switch (classof$2(argument)) {
|
|
2068
|
-
case 'AsyncFunction':
|
|
2069
|
-
case 'GeneratorFunction':
|
|
2070
|
-
case 'AsyncGeneratorFunction': return false;
|
|
2071
|
-
}
|
|
2072
|
-
try {
|
|
2073
|
-
// we can't check .prototype since constructors produced by .bind haven't it
|
|
2074
|
-
// `Function#toString` throws on some built-it function in some legacy engines
|
|
2075
|
-
// (for example, `DOMQuad` and similar in FF41-)
|
|
2076
|
-
return INCORRECT_TO_STRING || !!exec$1(constructorRegExp, inspectSource$1(argument));
|
|
2077
|
-
} catch (error) {
|
|
2078
|
-
return true;
|
|
2079
|
-
}
|
|
2080
|
-
};
|
|
2081
|
-
|
|
2082
|
-
isConstructorLegacy.sham = true;
|
|
2083
|
-
|
|
2084
|
-
// `IsConstructor` abstract operation
|
|
2085
|
-
// https://tc39.es/ecma262/#sec-isconstructor
|
|
2086
|
-
var isConstructor$1 = !construct || fails$4(function () {
|
|
2087
|
-
var called;
|
|
2088
|
-
return isConstructorModern(isConstructorModern.call)
|
|
2089
|
-
|| !isConstructorModern(Object)
|
|
2090
|
-
|| !isConstructorModern(function () { called = true; })
|
|
2091
|
-
|| called;
|
|
2092
|
-
}) ? isConstructorLegacy : isConstructorModern;
|
|
2093
|
-
|
|
2094
|
-
var global$e = global$J;
|
|
2095
|
-
var isConstructor = isConstructor$1;
|
|
2096
|
-
var tryToString$2 = tryToString$4;
|
|
2097
|
-
|
|
2098
|
-
var TypeError$7 = global$e.TypeError;
|
|
2099
|
-
|
|
2100
|
-
// `Assert: IsConstructor(argument) is true`
|
|
2101
|
-
var aConstructor$1 = function (argument) {
|
|
2102
|
-
if (isConstructor(argument)) return argument;
|
|
2103
|
-
throw TypeError$7(tryToString$2(argument) + ' is not a constructor');
|
|
2104
|
-
};
|
|
2105
|
-
|
|
2106
|
-
var anObject$a = anObject$h;
|
|
2107
|
-
var aConstructor = aConstructor$1;
|
|
2108
|
-
var wellKnownSymbol$6 = wellKnownSymbol$h;
|
|
2109
|
-
|
|
2110
|
-
var SPECIES$2 = wellKnownSymbol$6('species');
|
|
2111
|
-
|
|
2112
|
-
// `SpeciesConstructor` abstract operation
|
|
2113
|
-
// https://tc39.es/ecma262/#sec-speciesconstructor
|
|
2114
|
-
var speciesConstructor$2 = function (O, defaultConstructor) {
|
|
2115
|
-
var C = anObject$a(O).constructor;
|
|
2116
|
-
var S;
|
|
2117
|
-
return C === undefined || (S = anObject$a(C)[SPECIES$2]) == undefined ? defaultConstructor : aConstructor(S);
|
|
2118
|
-
};
|
|
2119
|
-
|
|
2120
|
-
var uncurryThis$7 = functionUncurryThis;
|
|
2121
|
-
var toIntegerOrInfinity$1 = toIntegerOrInfinity$4;
|
|
2122
|
-
var toString$5 = toString$7;
|
|
2123
|
-
var requireObjectCoercible$4 = requireObjectCoercible$7;
|
|
2124
|
-
|
|
2125
|
-
var charAt$2 = uncurryThis$7(''.charAt);
|
|
2126
|
-
var charCodeAt = uncurryThis$7(''.charCodeAt);
|
|
2127
|
-
var stringSlice$4 = uncurryThis$7(''.slice);
|
|
2128
|
-
|
|
2129
|
-
var createMethod = function (CONVERT_TO_STRING) {
|
|
2130
|
-
return function ($this, pos) {
|
|
2131
|
-
var S = toString$5(requireObjectCoercible$4($this));
|
|
2132
|
-
var position = toIntegerOrInfinity$1(pos);
|
|
2133
|
-
var size = S.length;
|
|
2134
|
-
var first, second;
|
|
2135
|
-
if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
|
|
2136
|
-
first = charCodeAt(S, position);
|
|
2137
|
-
return first < 0xD800 || first > 0xDBFF || position + 1 === size
|
|
2138
|
-
|| (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
|
|
2139
|
-
? CONVERT_TO_STRING
|
|
2140
|
-
? charAt$2(S, position)
|
|
2141
|
-
: first
|
|
2142
|
-
: CONVERT_TO_STRING
|
|
2143
|
-
? stringSlice$4(S, position, position + 2)
|
|
2144
|
-
: (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
|
|
2145
|
-
};
|
|
2146
|
-
};
|
|
2147
|
-
|
|
2148
|
-
var stringMultibyte = {
|
|
2149
|
-
// `String.prototype.codePointAt` method
|
|
2150
|
-
// https://tc39.es/ecma262/#sec-string.prototype.codepointat
|
|
2151
|
-
codeAt: createMethod(false),
|
|
2152
|
-
// `String.prototype.at` method
|
|
2153
|
-
// https://github.com/mathiasbynens/String.prototype.at
|
|
2154
|
-
charAt: createMethod(true)
|
|
2155
|
-
};
|
|
2156
|
-
|
|
2157
|
-
var charAt$1 = stringMultibyte.charAt;
|
|
2158
|
-
|
|
2159
|
-
// `AdvanceStringIndex` abstract operation
|
|
2160
|
-
// https://tc39.es/ecma262/#sec-advancestringindex
|
|
2161
|
-
var advanceStringIndex$3 = function (S, index, unicode) {
|
|
2162
|
-
return index + (unicode ? charAt$1(S, index).length : 1);
|
|
2163
|
-
};
|
|
2164
|
-
|
|
2165
|
-
var toPropertyKey = toPropertyKey$3;
|
|
2166
|
-
var definePropertyModule$1 = objectDefineProperty;
|
|
2167
|
-
var createPropertyDescriptor = createPropertyDescriptor$4;
|
|
2168
|
-
|
|
2169
|
-
var createProperty$1 = function (object, key, value) {
|
|
2170
|
-
var propertyKey = toPropertyKey(key);
|
|
2171
|
-
if (propertyKey in object) definePropertyModule$1.f(object, propertyKey, createPropertyDescriptor(0, value));
|
|
2172
|
-
else object[propertyKey] = value;
|
|
2173
|
-
};
|
|
2174
|
-
|
|
2175
|
-
var global$d = global$J;
|
|
2176
|
-
var toAbsoluteIndex = toAbsoluteIndex$2;
|
|
2177
|
-
var lengthOfArrayLike$1 = lengthOfArrayLike$4;
|
|
2178
|
-
var createProperty = createProperty$1;
|
|
2179
|
-
|
|
2180
|
-
var Array$1 = global$d.Array;
|
|
2181
|
-
var max$1 = Math.max;
|
|
2182
|
-
|
|
2183
|
-
var arraySliceSimple = function (O, start, end) {
|
|
2184
|
-
var length = lengthOfArrayLike$1(O);
|
|
2185
|
-
var k = toAbsoluteIndex(start, length);
|
|
2186
|
-
var fin = toAbsoluteIndex(end === undefined ? length : end, length);
|
|
2187
|
-
var result = Array$1(max$1(fin - k, 0));
|
|
2188
|
-
for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);
|
|
2189
|
-
result.length = n;
|
|
2190
|
-
return result;
|
|
2191
|
-
};
|
|
2192
|
-
|
|
2193
|
-
var global$c = global$J;
|
|
2194
|
-
var call$8 = functionCall;
|
|
2195
|
-
var anObject$9 = anObject$h;
|
|
2196
|
-
var isCallable$4 = isCallable$k;
|
|
2197
|
-
var classof$1 = classofRaw$1;
|
|
2198
|
-
var regexpExec$1 = regexpExec$3;
|
|
2199
|
-
|
|
2200
|
-
var TypeError$6 = global$c.TypeError;
|
|
2201
|
-
|
|
2202
|
-
// `RegExpExec` abstract operation
|
|
2203
|
-
// https://tc39.es/ecma262/#sec-regexpexec
|
|
2204
|
-
var regexpExecAbstract = function (R, S) {
|
|
2205
|
-
var exec = R.exec;
|
|
2206
|
-
if (isCallable$4(exec)) {
|
|
2207
|
-
var result = call$8(exec, R, S);
|
|
2208
|
-
if (result !== null) anObject$9(result);
|
|
2209
|
-
return result;
|
|
2210
|
-
}
|
|
2211
|
-
if (classof$1(R) === 'RegExp') return call$8(regexpExec$1, R, S);
|
|
2212
|
-
throw TypeError$6('RegExp#exec called on incompatible receiver');
|
|
2213
|
-
};
|
|
2214
|
-
|
|
2215
|
-
var apply$2 = functionApply;
|
|
2216
|
-
var call$7 = functionCall;
|
|
2217
|
-
var uncurryThis$6 = functionUncurryThis;
|
|
2218
|
-
var fixRegExpWellKnownSymbolLogic$3 = fixRegexpWellKnownSymbolLogic;
|
|
2219
|
-
var isRegExp = isRegexp;
|
|
2220
|
-
var anObject$8 = anObject$h;
|
|
2221
|
-
var requireObjectCoercible$3 = requireObjectCoercible$7;
|
|
2222
|
-
var speciesConstructor$1 = speciesConstructor$2;
|
|
2223
|
-
var advanceStringIndex$2 = advanceStringIndex$3;
|
|
2224
|
-
var toLength$2 = toLength$4;
|
|
2225
|
-
var toString$4 = toString$7;
|
|
2226
|
-
var getMethod$5 = getMethod$7;
|
|
2227
|
-
var arraySlice$2 = arraySliceSimple;
|
|
2228
|
-
var callRegExpExec = regexpExecAbstract;
|
|
2229
|
-
var regexpExec = regexpExec$3;
|
|
2230
|
-
var stickyHelpers = regexpStickyHelpers;
|
|
2231
|
-
var fails$3 = fails$k;
|
|
2232
|
-
|
|
2233
|
-
var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
|
|
2234
|
-
var MAX_UINT32 = 0xFFFFFFFF;
|
|
2235
|
-
var min$1 = Math.min;
|
|
2236
|
-
var $push = [].push;
|
|
2237
|
-
var exec = uncurryThis$6(/./.exec);
|
|
2238
|
-
var push$1 = uncurryThis$6($push);
|
|
2239
|
-
var stringSlice$3 = uncurryThis$6(''.slice);
|
|
2240
|
-
|
|
2241
|
-
// Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
|
|
2242
|
-
// Weex JS has frozen built-in prototypes, so use try / catch wrapper
|
|
2243
|
-
var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails$3(function () {
|
|
2244
|
-
// eslint-disable-next-line regexp/no-empty-group -- required for testing
|
|
2245
|
-
var re = /(?:)/;
|
|
2246
|
-
var originalExec = re.exec;
|
|
2247
|
-
re.exec = function () { return originalExec.apply(this, arguments); };
|
|
2248
|
-
var result = 'ab'.split(re);
|
|
2249
|
-
return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
|
|
2250
|
-
});
|
|
2251
|
-
|
|
2252
|
-
// @@split logic
|
|
2253
|
-
fixRegExpWellKnownSymbolLogic$3('split', function (SPLIT, nativeSplit, maybeCallNative) {
|
|
2254
|
-
var internalSplit;
|
|
2255
|
-
if (
|
|
2256
|
-
'abbc'.split(/(b)*/)[1] == 'c' ||
|
|
2257
|
-
// eslint-disable-next-line regexp/no-empty-group -- required for testing
|
|
2258
|
-
'test'.split(/(?:)/, -1).length != 4 ||
|
|
2259
|
-
'ab'.split(/(?:ab)*/).length != 2 ||
|
|
2260
|
-
'.'.split(/(.?)(.?)/).length != 4 ||
|
|
2261
|
-
// eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing
|
|
2262
|
-
'.'.split(/()()/).length > 1 ||
|
|
2263
|
-
''.split(/.?/).length
|
|
2264
|
-
) {
|
|
2265
|
-
// based on es5-shim implementation, need to rework it
|
|
2266
|
-
internalSplit = function (separator, limit) {
|
|
2267
|
-
var string = toString$4(requireObjectCoercible$3(this));
|
|
2268
|
-
var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
|
|
2269
|
-
if (lim === 0) return [];
|
|
2270
|
-
if (separator === undefined) return [string];
|
|
2271
|
-
// If `separator` is not a regex, use native split
|
|
2272
|
-
if (!isRegExp(separator)) {
|
|
2273
|
-
return call$7(nativeSplit, string, separator, lim);
|
|
2274
|
-
}
|
|
2275
|
-
var output = [];
|
|
2276
|
-
var flags = (separator.ignoreCase ? 'i' : '') +
|
|
2277
|
-
(separator.multiline ? 'm' : '') +
|
|
2278
|
-
(separator.unicode ? 'u' : '') +
|
|
2279
|
-
(separator.sticky ? 'y' : '');
|
|
2280
|
-
var lastLastIndex = 0;
|
|
2281
|
-
// Make `global` and avoid `lastIndex` issues by working with a copy
|
|
2282
|
-
var separatorCopy = new RegExp(separator.source, flags + 'g');
|
|
2283
|
-
var match, lastIndex, lastLength;
|
|
2284
|
-
while (match = call$7(regexpExec, separatorCopy, string)) {
|
|
2285
|
-
lastIndex = separatorCopy.lastIndex;
|
|
2286
|
-
if (lastIndex > lastLastIndex) {
|
|
2287
|
-
push$1(output, stringSlice$3(string, lastLastIndex, match.index));
|
|
2288
|
-
if (match.length > 1 && match.index < string.length) apply$2($push, output, arraySlice$2(match, 1));
|
|
2289
|
-
lastLength = match[0].length;
|
|
2290
|
-
lastLastIndex = lastIndex;
|
|
2291
|
-
if (output.length >= lim) break;
|
|
2292
|
-
}
|
|
2293
|
-
if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
|
|
2294
|
-
}
|
|
2295
|
-
if (lastLastIndex === string.length) {
|
|
2296
|
-
if (lastLength || !exec(separatorCopy, '')) push$1(output, '');
|
|
2297
|
-
} else push$1(output, stringSlice$3(string, lastLastIndex));
|
|
2298
|
-
return output.length > lim ? arraySlice$2(output, 0, lim) : output;
|
|
2299
|
-
};
|
|
2300
|
-
// Chakra, V8
|
|
2301
|
-
} else if ('0'.split(undefined, 0).length) {
|
|
2302
|
-
internalSplit = function (separator, limit) {
|
|
2303
|
-
return separator === undefined && limit === 0 ? [] : call$7(nativeSplit, this, separator, limit);
|
|
2304
|
-
};
|
|
2305
|
-
} else internalSplit = nativeSplit;
|
|
2306
|
-
|
|
2307
|
-
return [
|
|
2308
|
-
// `String.prototype.split` method
|
|
2309
|
-
// https://tc39.es/ecma262/#sec-string.prototype.split
|
|
2310
|
-
function split(separator, limit) {
|
|
2311
|
-
var O = requireObjectCoercible$3(this);
|
|
2312
|
-
var splitter = separator == undefined ? undefined : getMethod$5(separator, SPLIT);
|
|
2313
|
-
return splitter
|
|
2314
|
-
? call$7(splitter, separator, O, limit)
|
|
2315
|
-
: call$7(internalSplit, toString$4(O), separator, limit);
|
|
2316
|
-
},
|
|
2317
|
-
// `RegExp.prototype[@@split]` method
|
|
2318
|
-
// https://tc39.es/ecma262/#sec-regexp.prototype-@@split
|
|
2319
|
-
//
|
|
2320
|
-
// NOTE: This cannot be properly polyfilled in engines that don't support
|
|
2321
|
-
// the 'y' flag.
|
|
2322
|
-
function (string, limit) {
|
|
2323
|
-
var rx = anObject$8(this);
|
|
2324
|
-
var S = toString$4(string);
|
|
2325
|
-
var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);
|
|
2326
|
-
|
|
2327
|
-
if (res.done) return res.value;
|
|
2328
|
-
|
|
2329
|
-
var C = speciesConstructor$1(rx, RegExp);
|
|
2330
|
-
|
|
2331
|
-
var unicodeMatching = rx.unicode;
|
|
2332
|
-
var flags = (rx.ignoreCase ? 'i' : '') +
|
|
2333
|
-
(rx.multiline ? 'm' : '') +
|
|
2334
|
-
(rx.unicode ? 'u' : '') +
|
|
2335
|
-
(UNSUPPORTED_Y ? 'g' : 'y');
|
|
2336
|
-
|
|
2337
|
-
// ^(? + rx + ) is needed, in combination with some S slicing, to
|
|
2338
|
-
// simulate the 'y' flag.
|
|
2339
|
-
var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags);
|
|
2340
|
-
var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
|
|
2341
|
-
if (lim === 0) return [];
|
|
2342
|
-
if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];
|
|
2343
|
-
var p = 0;
|
|
2344
|
-
var q = 0;
|
|
2345
|
-
var A = [];
|
|
2346
|
-
while (q < S.length) {
|
|
2347
|
-
splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;
|
|
2348
|
-
var z = callRegExpExec(splitter, UNSUPPORTED_Y ? stringSlice$3(S, q) : S);
|
|
2349
|
-
var e;
|
|
2350
|
-
if (
|
|
2351
|
-
z === null ||
|
|
2352
|
-
(e = min$1(toLength$2(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p
|
|
2353
|
-
) {
|
|
2354
|
-
q = advanceStringIndex$2(S, q, unicodeMatching);
|
|
2355
|
-
} else {
|
|
2356
|
-
push$1(A, stringSlice$3(S, p, q));
|
|
2357
|
-
if (A.length === lim) return A;
|
|
2358
|
-
for (var i = 1; i <= z.length - 1; i++) {
|
|
2359
|
-
push$1(A, z[i]);
|
|
2360
|
-
if (A.length === lim) return A;
|
|
2361
|
-
}
|
|
2362
|
-
q = p = e;
|
|
2363
|
-
}
|
|
2364
|
-
}
|
|
2365
|
-
push$1(A, stringSlice$3(S, p));
|
|
2366
|
-
return A;
|
|
2367
|
-
}
|
|
2368
|
-
];
|
|
2369
|
-
}, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);
|
|
2370
|
-
|
|
2371
|
-
const AUTH_ROUTES = {
|
|
2372
|
-
login: process.env["AUTH_ROUTE_LOGIN"],
|
|
2373
|
-
profile: process.env["AUTH_ROUTE_PROFILE"],
|
|
2374
|
-
register: process.env["AUTH_ROUTE_REGISTER"],
|
|
2375
|
-
secured: JSON.parse(process.env["AUTH_ROUTES_SECURED"] || "[]")
|
|
2376
|
-
};
|
|
2377
|
-
function getAuthRoutes(t) {
|
|
2378
|
-
return Object.keys(AUTH_ROUTES).reduce((map, name) => {
|
|
2379
|
-
const routePage = AUTH_ROUTES[name]; // @ts-expect-error cannot remember
|
|
2380
|
-
|
|
2381
|
-
map[name] = isString(routePage) ? t(`~:${AUTH_ROUTES[name]}`) : routePage;
|
|
2382
|
-
return map;
|
|
2383
|
-
}, {});
|
|
2384
|
-
}
|
|
2385
|
-
/**
|
|
2386
|
-
* @param url e.g. "http://localhost:3000/signin?callbackUrl=http://localhost:3000/profile"
|
|
2387
|
-
*/
|
|
2388
|
-
|
|
2389
|
-
function getCallbackUrl(url = window.location.href) {
|
|
2390
|
-
return url.split("callbackUrl=")[1] || "";
|
|
2391
|
-
}
|
|
2392
|
-
|
|
2393
|
-
// `SameValue` abstract operation
|
|
2394
|
-
// https://tc39.es/ecma262/#sec-samevalue
|
|
2395
|
-
// eslint-disable-next-line es/no-object-is -- safe
|
|
2396
|
-
var sameValue$1 = Object.is || function is(x, y) {
|
|
2397
|
-
// eslint-disable-next-line no-self-compare -- NaN check
|
|
2398
|
-
return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
|
|
2399
|
-
};
|
|
2400
|
-
|
|
2401
|
-
var call$6 = functionCall;
|
|
2402
|
-
var fixRegExpWellKnownSymbolLogic$2 = fixRegexpWellKnownSymbolLogic;
|
|
2403
|
-
var anObject$7 = anObject$h;
|
|
2404
|
-
var requireObjectCoercible$2 = requireObjectCoercible$7;
|
|
2405
|
-
var sameValue = sameValue$1;
|
|
2406
|
-
var toString$3 = toString$7;
|
|
2407
|
-
var getMethod$4 = getMethod$7;
|
|
2408
|
-
var regExpExec$2 = regexpExecAbstract;
|
|
2409
|
-
|
|
2410
|
-
// @@search logic
|
|
2411
|
-
fixRegExpWellKnownSymbolLogic$2('search', function (SEARCH, nativeSearch, maybeCallNative) {
|
|
2412
|
-
return [
|
|
2413
|
-
// `String.prototype.search` method
|
|
2414
|
-
// https://tc39.es/ecma262/#sec-string.prototype.search
|
|
2415
|
-
function search(regexp) {
|
|
2416
|
-
var O = requireObjectCoercible$2(this);
|
|
2417
|
-
var searcher = regexp == undefined ? undefined : getMethod$4(regexp, SEARCH);
|
|
2418
|
-
return searcher ? call$6(searcher, regexp, O) : new RegExp(regexp)[SEARCH](toString$3(O));
|
|
2419
|
-
},
|
|
2420
|
-
// `RegExp.prototype[@@search]` method
|
|
2421
|
-
// https://tc39.es/ecma262/#sec-regexp.prototype-@@search
|
|
2422
|
-
function (string) {
|
|
2423
|
-
var rx = anObject$7(this);
|
|
2424
|
-
var S = toString$3(string);
|
|
2425
|
-
var res = maybeCallNative(nativeSearch, rx, S);
|
|
2426
|
-
|
|
2427
|
-
if (res.done) return res.value;
|
|
2428
|
-
|
|
2429
|
-
var previousLastIndex = rx.lastIndex;
|
|
2430
|
-
if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
|
|
2431
|
-
var result = regExpExec$2(rx, S);
|
|
2432
|
-
if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
|
|
2433
|
-
return result === null ? -1 : result.index;
|
|
2434
|
-
}
|
|
2435
|
-
];
|
|
2436
|
-
});
|
|
2437
|
-
|
|
2438
|
-
/**
|
|
2439
|
-
* FIXME: the use of `useMemo` is a hopefully-temporary solution to fix the FOUC
|
|
2440
|
-
* problem of untranslated text during page transitions
|
|
2441
|
-
*
|
|
2442
|
-
* @see https://github.com/vinissimus/next-translate/issues/513#issuecomment-779826418
|
|
2443
|
-
*/
|
|
2444
|
-
|
|
2445
|
-
function useT(namespace) {
|
|
2446
|
-
const t = useTranslation().t; // const typedT = <
|
|
2447
|
-
// // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-constraint
|
|
2448
|
-
// R extends unknown = string,
|
|
2449
|
-
// // Q extends TranslationQuery = TranslationQuery
|
|
2450
|
-
// // O extends TranslationOptions = TranslationOptions
|
|
2451
|
-
// >(
|
|
2452
|
-
// s: N extends TranslateNamespace
|
|
2453
|
-
// ? Paths<Koine.NextTranslations[N]> | AllPaths
|
|
2454
|
-
// : AllPaths,
|
|
2455
|
-
// q?: TranslationQuery,
|
|
2456
|
-
// o?: TranslationOptions
|
|
2457
|
-
// ) =>
|
|
2458
|
-
// // eslint-disable-next-line
|
|
2459
|
-
// t.call(
|
|
2460
|
-
// null,
|
|
2461
|
-
// namespace ? `${namespace}:${s}` : s,
|
|
2462
|
-
// q === "obj" ? null : q,
|
|
2463
|
-
// q === "obj" || o === "obj" ? { returnObjects: true } : o
|
|
2464
|
-
// // ) as R extends (undefined | never | unknown) ? TranslateReturn<TranslationQuery, TranslationOptions> : R;
|
|
2465
|
-
// ) as R;
|
|
2466
|
-
// return typedT;
|
|
2467
|
-
|
|
2468
|
-
const tMemoized = useMemo(() => (s, q, o) => t(namespace ? `${namespace}:${s}` : s, q === "obj" ? null : q, q === "obj" || o === "obj" ? {
|
|
2469
|
-
returnObjects: true
|
|
2470
|
-
} : o // ) as R extends (undefined | never | unknown) ? TranslateReturn<TranslationQuery, TranslationOptions> : R;
|
|
2471
|
-
), [t, namespace]); // return tMemoized as Translate<N>;
|
|
2472
|
-
|
|
2473
|
-
return tMemoized;
|
|
2474
|
-
}
|
|
2475
|
-
/**
|
|
2476
|
-
* @deprecated Not sure whether this will ever be useful
|
|
2477
|
-
*/
|
|
2478
|
-
|
|
2479
|
-
function useLooseT(namespace) {
|
|
2480
|
-
const {
|
|
2481
|
-
t
|
|
2482
|
-
} = useTranslation(namespace); // return t;
|
|
2483
|
-
|
|
2484
|
-
const tMemoized = useMemo(() => t, [t]);
|
|
2485
|
-
return tMemoized;
|
|
2486
|
-
}
|
|
2487
|
-
function translationAsOptions(t, i18nKey) {
|
|
2488
|
-
const dictionary = t(i18nKey, undefined, {
|
|
2489
|
-
returnObjects: true
|
|
2490
|
-
});
|
|
2491
|
-
return Object.keys(dictionary).map(key => ({
|
|
2492
|
-
value: key,
|
|
2493
|
-
label: dictionary[key]
|
|
2494
|
-
}));
|
|
2495
|
-
}
|
|
2496
|
-
/**
|
|
2497
|
-
* Automatically returns the `date-fns/format` function with the right locale
|
|
2498
|
-
* passed as option (grabbed from next router value).
|
|
2499
|
-
*/
|
|
2500
|
-
|
|
2501
|
-
const useDateFormat = () => {
|
|
2502
|
-
const [formatter, setFormatter] = useState(() => (...args) => format(...args));
|
|
2503
|
-
const router = useRouter();
|
|
2504
|
-
const locale = useDateLocale(router.locale);
|
|
2505
|
-
useEffect(() => {
|
|
2506
|
-
if (locale) {
|
|
2507
|
-
const newFormatter = (date, _format, options) => format(date, _format, Object.assign(Object.assign({}, options || {}), {
|
|
2508
|
-
locale
|
|
2509
|
-
}));
|
|
2510
|
-
|
|
2511
|
-
setFormatter(() => (...args) => newFormatter(...args));
|
|
2512
|
-
}
|
|
2513
|
-
}, [locale]);
|
|
2514
|
-
return formatter;
|
|
2515
|
-
};
|
|
2516
|
-
|
|
2517
|
-
function useLogin() {
|
|
2518
|
-
const t = useT();
|
|
2519
|
-
const {
|
|
2520
|
-
push
|
|
2521
|
-
} = useRouter();
|
|
2522
|
-
const [loading, setLoading] = useState(false);
|
|
2523
|
-
const [ok, setOk] = useState(false);
|
|
2524
|
-
const [fail, setFail] = useState(false);
|
|
2525
|
-
const submit = useCallback(data => {
|
|
2526
|
-
setLoading(true);
|
|
2527
|
-
signIn("credentials", Object.assign(Object.assign({}, data), {
|
|
2528
|
-
redirect: false
|
|
2529
|
-
})) // @ts-expect-error FIXME: at some point...
|
|
2530
|
-
.then(({
|
|
2531
|
-
ok
|
|
2532
|
-
}) => {
|
|
2533
|
-
setLoading(false);
|
|
2534
|
-
setOk(ok);
|
|
2535
|
-
setFail(!ok);
|
|
2536
|
-
|
|
2537
|
-
if (ok) {
|
|
2538
|
-
const redirectUrl = parseURL(getCallbackUrl());
|
|
2539
|
-
const {
|
|
2540
|
-
login,
|
|
2541
|
-
register,
|
|
2542
|
-
profile
|
|
2543
|
-
} = getAuthRoutes(t);
|
|
2544
|
-
|
|
2545
|
-
if (redirectUrl) {
|
|
2546
|
-
const redirectPath = redirectUrl.pathname;
|
|
2547
|
-
|
|
2548
|
-
if (profile && (redirectPath === login || redirectPath === register)) {
|
|
2549
|
-
push(profile);
|
|
2550
|
-
} else {
|
|
2551
|
-
push(redirectPath + redirectUrl.search);
|
|
2552
|
-
}
|
|
2553
|
-
} else if (profile) {
|
|
2554
|
-
push(profile);
|
|
2555
|
-
}
|
|
2556
|
-
}
|
|
2557
|
-
});
|
|
2558
|
-
}, [t, push]); // TODO: useMemo ?
|
|
2559
|
-
|
|
2560
|
-
return {
|
|
2561
|
-
submit,
|
|
2562
|
-
loading,
|
|
2563
|
-
ok,
|
|
2564
|
-
fail
|
|
2565
|
-
};
|
|
2566
|
-
}
|
|
2567
|
-
|
|
2568
|
-
function useLoginUrl() {
|
|
2569
|
-
const [currentUrl, setCurrentUrl] = useState("");
|
|
2570
|
-
const t = useT();
|
|
2571
|
-
useEffect(() => {
|
|
2572
|
-
setCurrentUrl(`?callbackUrl=${window.location.href}`);
|
|
2573
|
-
}, []);
|
|
2574
|
-
return `${getAuthRoutes(t).login}${currentUrl}`;
|
|
2575
|
-
}
|
|
2576
|
-
|
|
2577
|
-
var call$5 = functionCall;
|
|
2578
|
-
var fixRegExpWellKnownSymbolLogic$1 = fixRegexpWellKnownSymbolLogic;
|
|
2579
|
-
var anObject$6 = anObject$h;
|
|
2580
|
-
var toLength$1 = toLength$4;
|
|
2581
|
-
var toString$2 = toString$7;
|
|
2582
|
-
var requireObjectCoercible$1 = requireObjectCoercible$7;
|
|
2583
|
-
var getMethod$3 = getMethod$7;
|
|
2584
|
-
var advanceStringIndex$1 = advanceStringIndex$3;
|
|
2585
|
-
var regExpExec$1 = regexpExecAbstract;
|
|
2586
|
-
|
|
2587
|
-
// @@match logic
|
|
2588
|
-
fixRegExpWellKnownSymbolLogic$1('match', function (MATCH, nativeMatch, maybeCallNative) {
|
|
2589
|
-
return [
|
|
2590
|
-
// `String.prototype.match` method
|
|
2591
|
-
// https://tc39.es/ecma262/#sec-string.prototype.match
|
|
2592
|
-
function match(regexp) {
|
|
2593
|
-
var O = requireObjectCoercible$1(this);
|
|
2594
|
-
var matcher = regexp == undefined ? undefined : getMethod$3(regexp, MATCH);
|
|
2595
|
-
return matcher ? call$5(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString$2(O));
|
|
2596
|
-
},
|
|
2597
|
-
// `RegExp.prototype[@@match]` method
|
|
2598
|
-
// https://tc39.es/ecma262/#sec-regexp.prototype-@@match
|
|
2599
|
-
function (string) {
|
|
2600
|
-
var rx = anObject$6(this);
|
|
2601
|
-
var S = toString$2(string);
|
|
2602
|
-
var res = maybeCallNative(nativeMatch, rx, S);
|
|
2603
|
-
|
|
2604
|
-
if (res.done) return res.value;
|
|
2605
|
-
|
|
2606
|
-
if (!rx.global) return regExpExec$1(rx, S);
|
|
2607
|
-
|
|
2608
|
-
var fullUnicode = rx.unicode;
|
|
2609
|
-
rx.lastIndex = 0;
|
|
2610
|
-
var A = [];
|
|
2611
|
-
var n = 0;
|
|
2612
|
-
var result;
|
|
2613
|
-
while ((result = regExpExec$1(rx, S)) !== null) {
|
|
2614
|
-
var matchStr = toString$2(result[0]);
|
|
2615
|
-
A[n] = matchStr;
|
|
2616
|
-
if (matchStr === '') rx.lastIndex = advanceStringIndex$1(S, toLength$1(rx.lastIndex), fullUnicode);
|
|
2617
|
-
n++;
|
|
2618
|
-
}
|
|
2619
|
-
return n === 0 ? null : A;
|
|
2620
|
-
}
|
|
2621
|
-
];
|
|
2622
|
-
});
|
|
2623
|
-
|
|
2624
|
-
function useLogout() {
|
|
2625
|
-
const t = useT();
|
|
2626
|
-
const {
|
|
2627
|
-
push
|
|
2628
|
-
} = useRouter();
|
|
2629
|
-
const [loading, setLoading] = useState(false);
|
|
2630
|
-
const [ok, setOk] = useState(false);
|
|
2631
|
-
const [fail] = useState(false);
|
|
2632
|
-
const submit = useCallback(event => {
|
|
2633
|
-
event.preventDefault();
|
|
2634
|
-
event.stopPropagation();
|
|
2635
|
-
setLoading(true);
|
|
2636
|
-
signOut({
|
|
2637
|
-
redirect: false
|
|
2638
|
-
}).then(() => {
|
|
2639
|
-
setLoading(false);
|
|
2640
|
-
setOk(true);
|
|
2641
|
-
const redirectUrl = parseURL(getCallbackUrl());
|
|
2642
|
-
const currentUrl = parseURL(window.location.href);
|
|
2643
|
-
const {
|
|
2644
|
-
secured
|
|
2645
|
-
} = getAuthRoutes(t);
|
|
2646
|
-
const signin = t("~:/signin");
|
|
2647
|
-
const profile = t("~:/profile");
|
|
2648
|
-
const targetUrl = redirectUrl || currentUrl;
|
|
2649
|
-
let redirect = "";
|
|
2650
|
-
|
|
2651
|
-
if (targetUrl) {
|
|
2652
|
-
if (targetUrl.pathname === profile) {
|
|
2653
|
-
redirect = signin;
|
|
2654
|
-
} else if (secured) {
|
|
2655
|
-
for (let i = 0; i < secured.length; i++) {
|
|
2656
|
-
if (targetUrl.pathname.match(secured[i])) {
|
|
2657
|
-
redirect = signin;
|
|
2658
|
-
break;
|
|
2659
|
-
}
|
|
2660
|
-
}
|
|
2661
|
-
}
|
|
2662
|
-
}
|
|
2663
|
-
|
|
2664
|
-
if (redirect) {
|
|
2665
|
-
push(redirect);
|
|
2666
|
-
}
|
|
2667
|
-
});
|
|
2668
|
-
}, [t, push]); // TODO: useMemo ?
|
|
2669
|
-
|
|
2670
|
-
return {
|
|
2671
|
-
submit,
|
|
2672
|
-
loading,
|
|
2673
|
-
ok,
|
|
2674
|
-
fail
|
|
2675
|
-
};
|
|
2676
|
-
}
|
|
2677
|
-
|
|
2678
|
-
const Favicon = props => jsx(Head, {
|
|
2679
|
-
children: jsx(FaviconTags, Object.assign({}, props))
|
|
2680
|
-
});
|
|
2681
|
-
|
|
2682
|
-
function useForm( // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2683
|
-
schema, i18nNamespace, formProps = {}, debug) {
|
|
2684
|
-
const t = useT(i18nNamespace); // const form = _useForm<InferType<ObjectSchema<T, object>>>({
|
|
2685
|
-
|
|
2686
|
-
const form = useForm$1(Object.assign({
|
|
2687
|
-
// @ts-expect-error FIXME:
|
|
2688
|
-
resolver: yupResolver(schema)
|
|
2689
|
-
}, formProps)); // const { control, register, setValue } = form;
|
|
2690
|
-
// const field = { control, register, setValue, t };
|
|
2691
|
-
// if ("production" !== process.env["NODE_ENV"]) {
|
|
2692
|
-
// if (debug) {
|
|
2693
|
-
// console.log(
|
|
2694
|
-
// `Form ${i18nNamespace} data`,
|
|
2695
|
-
// form.watch(),
|
|
2696
|
-
// `errors: `,
|
|
2697
|
-
// form.formState.errors
|
|
2698
|
-
// );
|
|
2699
|
-
// }
|
|
2700
|
-
// }
|
|
2701
|
-
// if (formProps.mode === "onChange") {
|
|
2702
|
-
// return { field, ...form };
|
|
2703
|
-
// }
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
return useMemo(() => {
|
|
2707
|
-
const {
|
|
2708
|
-
control,
|
|
2709
|
-
register,
|
|
2710
|
-
setValue
|
|
2711
|
-
} = form;
|
|
2712
|
-
const field = {
|
|
2713
|
-
control,
|
|
2714
|
-
register,
|
|
2715
|
-
setValue,
|
|
2716
|
-
t
|
|
2717
|
-
};
|
|
2718
|
-
return Object.assign({
|
|
2719
|
-
field
|
|
2720
|
-
}, form);
|
|
2721
|
-
}, [t, form]);
|
|
2722
|
-
}
|
|
2723
|
-
|
|
2724
|
-
/*! *****************************************************************************
|
|
2725
|
-
Copyright (c) Microsoft Corporation.
|
|
2726
|
-
|
|
2727
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
2728
|
-
purpose with or without fee is hereby granted.
|
|
2729
|
-
|
|
2730
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
2731
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
2732
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
2733
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
2734
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
2735
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
2736
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
2737
|
-
***************************************************************************** */
|
|
2738
|
-
|
|
2739
|
-
function __rest(s, e) {
|
|
2740
|
-
var t = {};
|
|
2741
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2742
|
-
t[p] = s[p];
|
|
2743
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
2744
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
2745
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
2746
|
-
t[p[i]] = s[p[i]];
|
|
2747
|
-
}
|
|
2748
|
-
return t;
|
|
2749
|
-
}
|
|
2750
|
-
|
|
2751
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
2752
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
2753
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
2754
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
2755
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
2756
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
2757
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
2758
|
-
});
|
|
2759
|
-
}
|
|
2760
|
-
|
|
2761
|
-
var uncurryThis$5 = functionUncurryThis;
|
|
2762
|
-
var toObject = toObject$5;
|
|
2763
|
-
|
|
2764
|
-
var floor = Math.floor;
|
|
2765
|
-
var charAt = uncurryThis$5(''.charAt);
|
|
2766
|
-
var replace$1 = uncurryThis$5(''.replace);
|
|
2767
|
-
var stringSlice$2 = uncurryThis$5(''.slice);
|
|
2768
|
-
var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
|
|
2769
|
-
var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
|
|
2770
|
-
|
|
2771
|
-
// `GetSubstitution` abstract operation
|
|
2772
|
-
// https://tc39.es/ecma262/#sec-getsubstitution
|
|
2773
|
-
var getSubstitution$1 = function (matched, str, position, captures, namedCaptures, replacement) {
|
|
2774
|
-
var tailPos = position + matched.length;
|
|
2775
|
-
var m = captures.length;
|
|
2776
|
-
var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
|
|
2777
|
-
if (namedCaptures !== undefined) {
|
|
2778
|
-
namedCaptures = toObject(namedCaptures);
|
|
2779
|
-
symbols = SUBSTITUTION_SYMBOLS;
|
|
2780
|
-
}
|
|
2781
|
-
return replace$1(replacement, symbols, function (match, ch) {
|
|
2782
|
-
var capture;
|
|
2783
|
-
switch (charAt(ch, 0)) {
|
|
2784
|
-
case '$': return '$';
|
|
2785
|
-
case '&': return matched;
|
|
2786
|
-
case '`': return stringSlice$2(str, 0, position);
|
|
2787
|
-
case "'": return stringSlice$2(str, tailPos);
|
|
2788
|
-
case '<':
|
|
2789
|
-
capture = namedCaptures[stringSlice$2(ch, 1, -1)];
|
|
2790
|
-
break;
|
|
2791
|
-
default: // \d\d?
|
|
2792
|
-
var n = +ch;
|
|
2793
|
-
if (n === 0) return match;
|
|
2794
|
-
if (n > m) {
|
|
2795
|
-
var f = floor(n / 10);
|
|
2796
|
-
if (f === 0) return match;
|
|
2797
|
-
if (f <= m) return captures[f - 1] === undefined ? charAt(ch, 1) : captures[f - 1] + charAt(ch, 1);
|
|
2798
|
-
return match;
|
|
2799
|
-
}
|
|
2800
|
-
capture = captures[n - 1];
|
|
2801
|
-
}
|
|
2802
|
-
return capture === undefined ? '' : capture;
|
|
2803
|
-
});
|
|
2804
|
-
};
|
|
2805
|
-
|
|
2806
|
-
var apply$1 = functionApply;
|
|
2807
|
-
var call$4 = functionCall;
|
|
2808
|
-
var uncurryThis$4 = functionUncurryThis;
|
|
2809
|
-
var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
|
|
2810
|
-
var fails$2 = fails$k;
|
|
2811
|
-
var anObject$5 = anObject$h;
|
|
2812
|
-
var isCallable$3 = isCallable$k;
|
|
2813
|
-
var toIntegerOrInfinity = toIntegerOrInfinity$4;
|
|
2814
|
-
var toLength = toLength$4;
|
|
2815
|
-
var toString$1 = toString$7;
|
|
2816
|
-
var requireObjectCoercible = requireObjectCoercible$7;
|
|
2817
|
-
var advanceStringIndex = advanceStringIndex$3;
|
|
2818
|
-
var getMethod$2 = getMethod$7;
|
|
2819
|
-
var getSubstitution = getSubstitution$1;
|
|
2820
|
-
var regExpExec = regexpExecAbstract;
|
|
2821
|
-
var wellKnownSymbol$5 = wellKnownSymbol$h;
|
|
2822
|
-
|
|
2823
|
-
var REPLACE = wellKnownSymbol$5('replace');
|
|
2824
|
-
var max = Math.max;
|
|
2825
|
-
var min = Math.min;
|
|
2826
|
-
var concat = uncurryThis$4([].concat);
|
|
2827
|
-
var push = uncurryThis$4([].push);
|
|
2828
|
-
var stringIndexOf = uncurryThis$4(''.indexOf);
|
|
2829
|
-
var stringSlice$1 = uncurryThis$4(''.slice);
|
|
2830
|
-
|
|
2831
|
-
var maybeToString = function (it) {
|
|
2832
|
-
return it === undefined ? it : String(it);
|
|
2833
|
-
};
|
|
2834
|
-
|
|
2835
|
-
// IE <= 11 replaces $0 with the whole match, as if it was $&
|
|
2836
|
-
// https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
|
|
2837
|
-
var REPLACE_KEEPS_$0 = (function () {
|
|
2838
|
-
// eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
|
|
2839
|
-
return 'a'.replace(/./, '$0') === '$0';
|
|
2840
|
-
})();
|
|
2841
|
-
|
|
2842
|
-
// Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
|
|
2843
|
-
var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
|
|
2844
|
-
if (/./[REPLACE]) {
|
|
2845
|
-
return /./[REPLACE]('a', '$0') === '';
|
|
2846
|
-
}
|
|
2847
|
-
return false;
|
|
2848
|
-
})();
|
|
2849
|
-
|
|
2850
|
-
var REPLACE_SUPPORTS_NAMED_GROUPS = !fails$2(function () {
|
|
2851
|
-
var re = /./;
|
|
2852
|
-
re.exec = function () {
|
|
2853
|
-
var result = [];
|
|
2854
|
-
result.groups = { a: '7' };
|
|
2855
|
-
return result;
|
|
2856
|
-
};
|
|
2857
|
-
// eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive
|
|
2858
|
-
return ''.replace(re, '$<a>') !== '7';
|
|
2859
|
-
});
|
|
2860
|
-
|
|
2861
|
-
// @@replace logic
|
|
2862
|
-
fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) {
|
|
2863
|
-
var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
|
|
2864
|
-
|
|
2865
|
-
return [
|
|
2866
|
-
// `String.prototype.replace` method
|
|
2867
|
-
// https://tc39.es/ecma262/#sec-string.prototype.replace
|
|
2868
|
-
function replace(searchValue, replaceValue) {
|
|
2869
|
-
var O = requireObjectCoercible(this);
|
|
2870
|
-
var replacer = searchValue == undefined ? undefined : getMethod$2(searchValue, REPLACE);
|
|
2871
|
-
return replacer
|
|
2872
|
-
? call$4(replacer, searchValue, O, replaceValue)
|
|
2873
|
-
: call$4(nativeReplace, toString$1(O), searchValue, replaceValue);
|
|
2874
|
-
},
|
|
2875
|
-
// `RegExp.prototype[@@replace]` method
|
|
2876
|
-
// https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
|
|
2877
|
-
function (string, replaceValue) {
|
|
2878
|
-
var rx = anObject$5(this);
|
|
2879
|
-
var S = toString$1(string);
|
|
2880
|
-
|
|
2881
|
-
if (
|
|
2882
|
-
typeof replaceValue == 'string' &&
|
|
2883
|
-
stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
|
|
2884
|
-
stringIndexOf(replaceValue, '$<') === -1
|
|
2885
|
-
) {
|
|
2886
|
-
var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
|
|
2887
|
-
if (res.done) return res.value;
|
|
2888
|
-
}
|
|
2889
|
-
|
|
2890
|
-
var functionalReplace = isCallable$3(replaceValue);
|
|
2891
|
-
if (!functionalReplace) replaceValue = toString$1(replaceValue);
|
|
2892
|
-
|
|
2893
|
-
var global = rx.global;
|
|
2894
|
-
if (global) {
|
|
2895
|
-
var fullUnicode = rx.unicode;
|
|
2896
|
-
rx.lastIndex = 0;
|
|
2897
|
-
}
|
|
2898
|
-
var results = [];
|
|
2899
|
-
while (true) {
|
|
2900
|
-
var result = regExpExec(rx, S);
|
|
2901
|
-
if (result === null) break;
|
|
2902
|
-
|
|
2903
|
-
push(results, result);
|
|
2904
|
-
if (!global) break;
|
|
2905
|
-
|
|
2906
|
-
var matchStr = toString$1(result[0]);
|
|
2907
|
-
if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
|
|
2908
|
-
}
|
|
2909
|
-
|
|
2910
|
-
var accumulatedResult = '';
|
|
2911
|
-
var nextSourcePosition = 0;
|
|
2912
|
-
for (var i = 0; i < results.length; i++) {
|
|
2913
|
-
result = results[i];
|
|
2914
|
-
|
|
2915
|
-
var matched = toString$1(result[0]);
|
|
2916
|
-
var position = max(min(toIntegerOrInfinity(result.index), S.length), 0);
|
|
2917
|
-
var captures = [];
|
|
2918
|
-
// NOTE: This is equivalent to
|
|
2919
|
-
// captures = result.slice(1).map(maybeToString)
|
|
2920
|
-
// but for some reason `nativeSlice.call(result, 1, result.length)` (called in
|
|
2921
|
-
// the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
|
|
2922
|
-
// causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
|
|
2923
|
-
for (var j = 1; j < result.length; j++) push(captures, maybeToString(result[j]));
|
|
2924
|
-
var namedCaptures = result.groups;
|
|
2925
|
-
if (functionalReplace) {
|
|
2926
|
-
var replacerArgs = concat([matched], captures, position, S);
|
|
2927
|
-
if (namedCaptures !== undefined) push(replacerArgs, namedCaptures);
|
|
2928
|
-
var replacement = toString$1(apply$1(replaceValue, undefined, replacerArgs));
|
|
2929
|
-
} else {
|
|
2930
|
-
replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
|
|
2931
|
-
}
|
|
2932
|
-
if (position >= nextSourcePosition) {
|
|
2933
|
-
accumulatedResult += stringSlice$1(S, nextSourcePosition, position) + replacement;
|
|
2934
|
-
nextSourcePosition = position + matched.length;
|
|
2935
|
-
}
|
|
2936
|
-
}
|
|
2937
|
-
return accumulatedResult + stringSlice$1(S, nextSourcePosition);
|
|
2938
|
-
}
|
|
2939
|
-
];
|
|
2940
|
-
}, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
|
|
2941
|
-
|
|
2942
|
-
var global$b = global$J;
|
|
2943
|
-
|
|
2944
|
-
var nativePromiseConstructor = global$b.Promise;
|
|
2945
|
-
|
|
2946
|
-
var redefine$2 = redefine$7.exports;
|
|
2947
|
-
|
|
2948
|
-
var redefineAll$1 = function (target, src, options) {
|
|
2949
|
-
for (var key in src) redefine$2(target, key, src[key], options);
|
|
2950
|
-
return target;
|
|
2951
|
-
};
|
|
2952
|
-
|
|
2953
|
-
var getBuiltIn$1 = getBuiltIn$7;
|
|
2954
|
-
var definePropertyModule = objectDefineProperty;
|
|
2955
|
-
var wellKnownSymbol$4 = wellKnownSymbol$h;
|
|
2956
|
-
var DESCRIPTORS$1 = descriptors;
|
|
2957
|
-
|
|
2958
|
-
var SPECIES$1 = wellKnownSymbol$4('species');
|
|
2959
|
-
|
|
2960
|
-
var setSpecies$1 = function (CONSTRUCTOR_NAME) {
|
|
2961
|
-
var Constructor = getBuiltIn$1(CONSTRUCTOR_NAME);
|
|
2962
|
-
var defineProperty = definePropertyModule.f;
|
|
2963
|
-
|
|
2964
|
-
if (DESCRIPTORS$1 && Constructor && !Constructor[SPECIES$1]) {
|
|
2965
|
-
defineProperty(Constructor, SPECIES$1, {
|
|
2966
|
-
configurable: true,
|
|
2967
|
-
get: function () { return this; }
|
|
2968
|
-
});
|
|
2969
|
-
}
|
|
2970
|
-
};
|
|
2971
|
-
|
|
2972
|
-
var global$a = global$J;
|
|
2973
|
-
var isPrototypeOf$3 = objectIsPrototypeOf;
|
|
2974
|
-
|
|
2975
|
-
var TypeError$5 = global$a.TypeError;
|
|
2976
|
-
|
|
2977
|
-
var anInstance$1 = function (it, Prototype) {
|
|
2978
|
-
if (isPrototypeOf$3(Prototype, it)) return it;
|
|
2979
|
-
throw TypeError$5('Incorrect invocation');
|
|
2980
|
-
};
|
|
2981
|
-
|
|
2982
|
-
var uncurryThis$3 = functionUncurryThis;
|
|
2983
|
-
var aCallable$3 = aCallable$6;
|
|
2984
|
-
var NATIVE_BIND = functionBindNative;
|
|
2985
|
-
|
|
2986
|
-
var bind$4 = uncurryThis$3(uncurryThis$3.bind);
|
|
2987
|
-
|
|
2988
|
-
// optional / simple context binding
|
|
2989
|
-
var functionBindContext = function (fn, that) {
|
|
2990
|
-
aCallable$3(fn);
|
|
2991
|
-
return that === undefined ? fn : NATIVE_BIND ? bind$4(fn, that) : function (/* ...args */) {
|
|
2992
|
-
return fn.apply(that, arguments);
|
|
2993
|
-
};
|
|
2994
|
-
};
|
|
2995
|
-
|
|
2996
|
-
var wellKnownSymbol$3 = wellKnownSymbol$h;
|
|
2997
|
-
var Iterators$1 = iterators;
|
|
2998
|
-
|
|
2999
|
-
var ITERATOR$2 = wellKnownSymbol$3('iterator');
|
|
3000
|
-
var ArrayPrototype = Array.prototype;
|
|
3001
|
-
|
|
3002
|
-
// check on default Array iterator
|
|
3003
|
-
var isArrayIteratorMethod$1 = function (it) {
|
|
3004
|
-
return it !== undefined && (Iterators$1.Array === it || ArrayPrototype[ITERATOR$2] === it);
|
|
3005
|
-
};
|
|
3006
|
-
|
|
3007
|
-
var classof = classof$5;
|
|
3008
|
-
var getMethod$1 = getMethod$7;
|
|
3009
|
-
var Iterators = iterators;
|
|
3010
|
-
var wellKnownSymbol$2 = wellKnownSymbol$h;
|
|
3011
|
-
|
|
3012
|
-
var ITERATOR$1 = wellKnownSymbol$2('iterator');
|
|
3013
|
-
|
|
3014
|
-
var getIteratorMethod$2 = function (it) {
|
|
3015
|
-
if (it != undefined) return getMethod$1(it, ITERATOR$1)
|
|
3016
|
-
|| getMethod$1(it, '@@iterator')
|
|
3017
|
-
|| Iterators[classof(it)];
|
|
3018
|
-
};
|
|
3019
|
-
|
|
3020
|
-
var global$9 = global$J;
|
|
3021
|
-
var call$3 = functionCall;
|
|
3022
|
-
var aCallable$2 = aCallable$6;
|
|
3023
|
-
var anObject$4 = anObject$h;
|
|
3024
|
-
var tryToString$1 = tryToString$4;
|
|
3025
|
-
var getIteratorMethod$1 = getIteratorMethod$2;
|
|
3026
|
-
|
|
3027
|
-
var TypeError$4 = global$9.TypeError;
|
|
3028
|
-
|
|
3029
|
-
var getIterator$1 = function (argument, usingIterator) {
|
|
3030
|
-
var iteratorMethod = arguments.length < 2 ? getIteratorMethod$1(argument) : usingIterator;
|
|
3031
|
-
if (aCallable$2(iteratorMethod)) return anObject$4(call$3(iteratorMethod, argument));
|
|
3032
|
-
throw TypeError$4(tryToString$1(argument) + ' is not iterable');
|
|
3033
|
-
};
|
|
3034
|
-
|
|
3035
|
-
var call$2 = functionCall;
|
|
3036
|
-
var anObject$3 = anObject$h;
|
|
3037
|
-
var getMethod = getMethod$7;
|
|
3038
|
-
|
|
3039
|
-
var iteratorClose$1 = function (iterator, kind, value) {
|
|
3040
|
-
var innerResult, innerError;
|
|
3041
|
-
anObject$3(iterator);
|
|
3042
|
-
try {
|
|
3043
|
-
innerResult = getMethod(iterator, 'return');
|
|
3044
|
-
if (!innerResult) {
|
|
3045
|
-
if (kind === 'throw') throw value;
|
|
3046
|
-
return value;
|
|
3047
|
-
}
|
|
3048
|
-
innerResult = call$2(innerResult, iterator);
|
|
3049
|
-
} catch (error) {
|
|
3050
|
-
innerError = true;
|
|
3051
|
-
innerResult = error;
|
|
3052
|
-
}
|
|
3053
|
-
if (kind === 'throw') throw value;
|
|
3054
|
-
if (innerError) throw innerResult;
|
|
3055
|
-
anObject$3(innerResult);
|
|
3056
|
-
return value;
|
|
3057
|
-
};
|
|
3058
|
-
|
|
3059
|
-
var global$8 = global$J;
|
|
3060
|
-
var bind$3 = functionBindContext;
|
|
3061
|
-
var call$1 = functionCall;
|
|
3062
|
-
var anObject$2 = anObject$h;
|
|
3063
|
-
var tryToString = tryToString$4;
|
|
3064
|
-
var isArrayIteratorMethod = isArrayIteratorMethod$1;
|
|
3065
|
-
var lengthOfArrayLike = lengthOfArrayLike$4;
|
|
3066
|
-
var isPrototypeOf$2 = objectIsPrototypeOf;
|
|
3067
|
-
var getIterator = getIterator$1;
|
|
3068
|
-
var getIteratorMethod = getIteratorMethod$2;
|
|
3069
|
-
var iteratorClose = iteratorClose$1;
|
|
3070
|
-
|
|
3071
|
-
var TypeError$3 = global$8.TypeError;
|
|
3072
|
-
|
|
3073
|
-
var Result = function (stopped, result) {
|
|
3074
|
-
this.stopped = stopped;
|
|
3075
|
-
this.result = result;
|
|
3076
|
-
};
|
|
3077
|
-
|
|
3078
|
-
var ResultPrototype = Result.prototype;
|
|
3079
|
-
|
|
3080
|
-
var iterate$1 = function (iterable, unboundFunction, options) {
|
|
3081
|
-
var that = options && options.that;
|
|
3082
|
-
var AS_ENTRIES = !!(options && options.AS_ENTRIES);
|
|
3083
|
-
var IS_ITERATOR = !!(options && options.IS_ITERATOR);
|
|
3084
|
-
var INTERRUPTED = !!(options && options.INTERRUPTED);
|
|
3085
|
-
var fn = bind$3(unboundFunction, that);
|
|
3086
|
-
var iterator, iterFn, index, length, result, next, step;
|
|
3087
|
-
|
|
3088
|
-
var stop = function (condition) {
|
|
3089
|
-
if (iterator) iteratorClose(iterator, 'normal', condition);
|
|
3090
|
-
return new Result(true, condition);
|
|
3091
|
-
};
|
|
3092
|
-
|
|
3093
|
-
var callFn = function (value) {
|
|
3094
|
-
if (AS_ENTRIES) {
|
|
3095
|
-
anObject$2(value);
|
|
3096
|
-
return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
|
|
3097
|
-
} return INTERRUPTED ? fn(value, stop) : fn(value);
|
|
3098
|
-
};
|
|
3099
|
-
|
|
3100
|
-
if (IS_ITERATOR) {
|
|
3101
|
-
iterator = iterable;
|
|
3102
|
-
} else {
|
|
3103
|
-
iterFn = getIteratorMethod(iterable);
|
|
3104
|
-
if (!iterFn) throw TypeError$3(tryToString(iterable) + ' is not iterable');
|
|
3105
|
-
// optimisation for array iterators
|
|
3106
|
-
if (isArrayIteratorMethod(iterFn)) {
|
|
3107
|
-
for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
|
|
3108
|
-
result = callFn(iterable[index]);
|
|
3109
|
-
if (result && isPrototypeOf$2(ResultPrototype, result)) return result;
|
|
3110
|
-
} return new Result(false);
|
|
3111
|
-
}
|
|
3112
|
-
iterator = getIterator(iterable, iterFn);
|
|
3113
|
-
}
|
|
3114
|
-
|
|
3115
|
-
next = iterator.next;
|
|
3116
|
-
while (!(step = call$1(next, iterator)).done) {
|
|
3117
|
-
try {
|
|
3118
|
-
result = callFn(step.value);
|
|
3119
|
-
} catch (error) {
|
|
3120
|
-
iteratorClose(iterator, 'throw', error);
|
|
3121
|
-
}
|
|
3122
|
-
if (typeof result == 'object' && result && isPrototypeOf$2(ResultPrototype, result)) return result;
|
|
3123
|
-
} return new Result(false);
|
|
3124
|
-
};
|
|
3125
|
-
|
|
3126
|
-
var wellKnownSymbol$1 = wellKnownSymbol$h;
|
|
3127
|
-
|
|
3128
|
-
var ITERATOR = wellKnownSymbol$1('iterator');
|
|
3129
|
-
var SAFE_CLOSING = false;
|
|
3130
|
-
|
|
3131
|
-
try {
|
|
3132
|
-
var called = 0;
|
|
3133
|
-
var iteratorWithReturn = {
|
|
3134
|
-
next: function () {
|
|
3135
|
-
return { done: !!called++ };
|
|
3136
|
-
},
|
|
3137
|
-
'return': function () {
|
|
3138
|
-
SAFE_CLOSING = true;
|
|
3139
|
-
}
|
|
3140
|
-
};
|
|
3141
|
-
iteratorWithReturn[ITERATOR] = function () {
|
|
3142
|
-
return this;
|
|
3143
|
-
};
|
|
3144
|
-
// eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing
|
|
3145
|
-
Array.from(iteratorWithReturn, function () { throw 2; });
|
|
3146
|
-
} catch (error) { /* empty */ }
|
|
3147
|
-
|
|
3148
|
-
var checkCorrectnessOfIteration$1 = function (exec, SKIP_CLOSING) {
|
|
3149
|
-
if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
|
|
3150
|
-
var ITERATION_SUPPORT = false;
|
|
3151
|
-
try {
|
|
3152
|
-
var object = {};
|
|
3153
|
-
object[ITERATOR] = function () {
|
|
3154
|
-
return {
|
|
3155
|
-
next: function () {
|
|
3156
|
-
return { done: ITERATION_SUPPORT = true };
|
|
3157
|
-
}
|
|
3158
|
-
};
|
|
3159
|
-
};
|
|
3160
|
-
exec(object);
|
|
3161
|
-
} catch (error) { /* empty */ }
|
|
3162
|
-
return ITERATION_SUPPORT;
|
|
3163
|
-
};
|
|
3164
|
-
|
|
3165
|
-
var uncurryThis$2 = functionUncurryThis;
|
|
3166
|
-
|
|
3167
|
-
var arraySlice$1 = uncurryThis$2([].slice);
|
|
3168
|
-
|
|
3169
|
-
var global$7 = global$J;
|
|
3170
|
-
|
|
3171
|
-
var TypeError$2 = global$7.TypeError;
|
|
3172
|
-
|
|
3173
|
-
var validateArgumentsLength$1 = function (passed, required) {
|
|
3174
|
-
if (passed < required) throw TypeError$2('Not enough arguments');
|
|
3175
|
-
return passed;
|
|
3176
|
-
};
|
|
3177
|
-
|
|
3178
|
-
var userAgent$2 = engineUserAgent;
|
|
3179
|
-
|
|
3180
|
-
var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$2);
|
|
3181
|
-
|
|
3182
|
-
var global$6 = global$J;
|
|
3183
|
-
var apply = functionApply;
|
|
3184
|
-
var bind$2 = functionBindContext;
|
|
3185
|
-
var isCallable$2 = isCallable$k;
|
|
3186
|
-
var hasOwn$1 = hasOwnProperty_1;
|
|
3187
|
-
var fails$1 = fails$k;
|
|
3188
|
-
var html = html$2;
|
|
3189
|
-
var arraySlice = arraySlice$1;
|
|
3190
|
-
var createElement = documentCreateElement$2;
|
|
3191
|
-
var validateArgumentsLength = validateArgumentsLength$1;
|
|
3192
|
-
var IS_IOS$1 = engineIsIos;
|
|
3193
|
-
var IS_NODE$2 = engineIsNode;
|
|
3194
|
-
|
|
3195
|
-
var set = global$6.setImmediate;
|
|
3196
|
-
var clear = global$6.clearImmediate;
|
|
3197
|
-
var process$3 = global$6.process;
|
|
3198
|
-
var Dispatch = global$6.Dispatch;
|
|
3199
|
-
var Function$1 = global$6.Function;
|
|
3200
|
-
var MessageChannel = global$6.MessageChannel;
|
|
3201
|
-
var String$1 = global$6.String;
|
|
3202
|
-
var counter = 0;
|
|
3203
|
-
var queue$1 = {};
|
|
3204
|
-
var ONREADYSTATECHANGE = 'onreadystatechange';
|
|
3205
|
-
var location, defer, channel, port;
|
|
3206
|
-
|
|
3207
|
-
try {
|
|
3208
|
-
// Deno throws a ReferenceError on `location` access without `--location` flag
|
|
3209
|
-
location = global$6.location;
|
|
3210
|
-
} catch (error) { /* empty */ }
|
|
3211
|
-
|
|
3212
|
-
var run = function (id) {
|
|
3213
|
-
if (hasOwn$1(queue$1, id)) {
|
|
3214
|
-
var fn = queue$1[id];
|
|
3215
|
-
delete queue$1[id];
|
|
3216
|
-
fn();
|
|
3217
|
-
}
|
|
3218
|
-
};
|
|
3219
|
-
|
|
3220
|
-
var runner = function (id) {
|
|
3221
|
-
return function () {
|
|
3222
|
-
run(id);
|
|
3223
|
-
};
|
|
3224
|
-
};
|
|
3225
|
-
|
|
3226
|
-
var listener = function (event) {
|
|
3227
|
-
run(event.data);
|
|
3228
|
-
};
|
|
3229
|
-
|
|
3230
|
-
var post = function (id) {
|
|
3231
|
-
// old engines have not location.origin
|
|
3232
|
-
global$6.postMessage(String$1(id), location.protocol + '//' + location.host);
|
|
3233
|
-
};
|
|
3234
|
-
|
|
3235
|
-
// Node.js 0.9+ & IE10+ has setImmediate, otherwise:
|
|
3236
|
-
if (!set || !clear) {
|
|
3237
|
-
set = function setImmediate(handler) {
|
|
3238
|
-
validateArgumentsLength(arguments.length, 1);
|
|
3239
|
-
var fn = isCallable$2(handler) ? handler : Function$1(handler);
|
|
3240
|
-
var args = arraySlice(arguments, 1);
|
|
3241
|
-
queue$1[++counter] = function () {
|
|
3242
|
-
apply(fn, undefined, args);
|
|
3243
|
-
};
|
|
3244
|
-
defer(counter);
|
|
3245
|
-
return counter;
|
|
3246
|
-
};
|
|
3247
|
-
clear = function clearImmediate(id) {
|
|
3248
|
-
delete queue$1[id];
|
|
3249
|
-
};
|
|
3250
|
-
// Node.js 0.8-
|
|
3251
|
-
if (IS_NODE$2) {
|
|
3252
|
-
defer = function (id) {
|
|
3253
|
-
process$3.nextTick(runner(id));
|
|
3254
|
-
};
|
|
3255
|
-
// Sphere (JS game engine) Dispatch API
|
|
3256
|
-
} else if (Dispatch && Dispatch.now) {
|
|
3257
|
-
defer = function (id) {
|
|
3258
|
-
Dispatch.now(runner(id));
|
|
3259
|
-
};
|
|
3260
|
-
// Browsers with MessageChannel, includes WebWorkers
|
|
3261
|
-
// except iOS - https://github.com/zloirock/core-js/issues/624
|
|
3262
|
-
} else if (MessageChannel && !IS_IOS$1) {
|
|
3263
|
-
channel = new MessageChannel();
|
|
3264
|
-
port = channel.port2;
|
|
3265
|
-
channel.port1.onmessage = listener;
|
|
3266
|
-
defer = bind$2(port.postMessage, port);
|
|
3267
|
-
// Browsers with postMessage, skip WebWorkers
|
|
3268
|
-
// IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
|
|
3269
|
-
} else if (
|
|
3270
|
-
global$6.addEventListener &&
|
|
3271
|
-
isCallable$2(global$6.postMessage) &&
|
|
3272
|
-
!global$6.importScripts &&
|
|
3273
|
-
location && location.protocol !== 'file:' &&
|
|
3274
|
-
!fails$1(post)
|
|
3275
|
-
) {
|
|
3276
|
-
defer = post;
|
|
3277
|
-
global$6.addEventListener('message', listener, false);
|
|
3278
|
-
// IE8-
|
|
3279
|
-
} else if (ONREADYSTATECHANGE in createElement('script')) {
|
|
3280
|
-
defer = function (id) {
|
|
3281
|
-
html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
|
|
3282
|
-
html.removeChild(this);
|
|
3283
|
-
run(id);
|
|
3284
|
-
};
|
|
3285
|
-
};
|
|
3286
|
-
// Rest old browsers
|
|
3287
|
-
} else {
|
|
3288
|
-
defer = function (id) {
|
|
3289
|
-
setTimeout(runner(id), 0);
|
|
3290
|
-
};
|
|
3291
|
-
}
|
|
3292
|
-
}
|
|
3293
|
-
|
|
3294
|
-
var task$1 = {
|
|
3295
|
-
set: set,
|
|
3296
|
-
clear: clear
|
|
3297
|
-
};
|
|
3298
|
-
|
|
3299
|
-
var userAgent$1 = engineUserAgent;
|
|
3300
|
-
var global$5 = global$J;
|
|
3301
|
-
|
|
3302
|
-
var engineIsIosPebble = /ipad|iphone|ipod/i.test(userAgent$1) && global$5.Pebble !== undefined;
|
|
3303
|
-
|
|
3304
|
-
var userAgent = engineUserAgent;
|
|
3305
|
-
|
|
3306
|
-
var engineIsWebosWebkit = /web0s(?!.*chrome)/i.test(userAgent);
|
|
3307
|
-
|
|
3308
|
-
var global$4 = global$J;
|
|
3309
|
-
var bind$1 = functionBindContext;
|
|
3310
|
-
var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
|
3311
|
-
var macrotask = task$1.set;
|
|
3312
|
-
var IS_IOS = engineIsIos;
|
|
3313
|
-
var IS_IOS_PEBBLE = engineIsIosPebble;
|
|
3314
|
-
var IS_WEBOS_WEBKIT = engineIsWebosWebkit;
|
|
3315
|
-
var IS_NODE$1 = engineIsNode;
|
|
3316
|
-
|
|
3317
|
-
var MutationObserver = global$4.MutationObserver || global$4.WebKitMutationObserver;
|
|
3318
|
-
var document$2 = global$4.document;
|
|
3319
|
-
var process$2 = global$4.process;
|
|
3320
|
-
var Promise$1 = global$4.Promise;
|
|
3321
|
-
// Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
|
|
3322
|
-
var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global$4, 'queueMicrotask');
|
|
3323
|
-
var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
|
|
3324
|
-
|
|
3325
|
-
var flush, head, last, notify$1, toggle, node, promise, then;
|
|
3326
|
-
|
|
3327
|
-
// modern engines have queueMicrotask method
|
|
3328
|
-
if (!queueMicrotask) {
|
|
3329
|
-
flush = function () {
|
|
3330
|
-
var parent, fn;
|
|
3331
|
-
if (IS_NODE$1 && (parent = process$2.domain)) parent.exit();
|
|
3332
|
-
while (head) {
|
|
3333
|
-
fn = head.fn;
|
|
3334
|
-
head = head.next;
|
|
3335
|
-
try {
|
|
3336
|
-
fn();
|
|
3337
|
-
} catch (error) {
|
|
3338
|
-
if (head) notify$1();
|
|
3339
|
-
else last = undefined;
|
|
3340
|
-
throw error;
|
|
3341
|
-
}
|
|
3342
|
-
} last = undefined;
|
|
3343
|
-
if (parent) parent.enter();
|
|
3344
|
-
};
|
|
3345
|
-
|
|
3346
|
-
// browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
|
|
3347
|
-
// also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
|
|
3348
|
-
if (!IS_IOS && !IS_NODE$1 && !IS_WEBOS_WEBKIT && MutationObserver && document$2) {
|
|
3349
|
-
toggle = true;
|
|
3350
|
-
node = document$2.createTextNode('');
|
|
3351
|
-
new MutationObserver(flush).observe(node, { characterData: true });
|
|
3352
|
-
notify$1 = function () {
|
|
3353
|
-
node.data = toggle = !toggle;
|
|
3354
|
-
};
|
|
3355
|
-
// environments with maybe non-completely correct, but existent Promise
|
|
3356
|
-
} else if (!IS_IOS_PEBBLE && Promise$1 && Promise$1.resolve) {
|
|
3357
|
-
// Promise.resolve without an argument throws an error in LG WebOS 2
|
|
3358
|
-
promise = Promise$1.resolve(undefined);
|
|
3359
|
-
// workaround of WebKit ~ iOS Safari 10.1 bug
|
|
3360
|
-
promise.constructor = Promise$1;
|
|
3361
|
-
then = bind$1(promise.then, promise);
|
|
3362
|
-
notify$1 = function () {
|
|
3363
|
-
then(flush);
|
|
3364
|
-
};
|
|
3365
|
-
// Node.js without promises
|
|
3366
|
-
} else if (IS_NODE$1) {
|
|
3367
|
-
notify$1 = function () {
|
|
3368
|
-
process$2.nextTick(flush);
|
|
3369
|
-
};
|
|
3370
|
-
// for other environments - macrotask based on:
|
|
3371
|
-
// - setImmediate
|
|
3372
|
-
// - MessageChannel
|
|
3373
|
-
// - window.postMessag
|
|
3374
|
-
// - onreadystatechange
|
|
3375
|
-
// - setTimeout
|
|
3376
|
-
} else {
|
|
3377
|
-
// strange IE + webpack dev server bug - use .bind(global)
|
|
3378
|
-
macrotask = bind$1(macrotask, global$4);
|
|
3379
|
-
notify$1 = function () {
|
|
3380
|
-
macrotask(flush);
|
|
3381
|
-
};
|
|
3382
|
-
}
|
|
3383
|
-
}
|
|
3384
|
-
|
|
3385
|
-
var microtask$1 = queueMicrotask || function (fn) {
|
|
3386
|
-
var task = { fn: fn, next: undefined };
|
|
3387
|
-
if (last) last.next = task;
|
|
3388
|
-
if (!head) {
|
|
3389
|
-
head = task;
|
|
3390
|
-
notify$1();
|
|
3391
|
-
} last = task;
|
|
3392
|
-
};
|
|
3393
|
-
|
|
3394
|
-
var newPromiseCapability$2 = {};
|
|
3395
|
-
|
|
3396
|
-
var aCallable$1 = aCallable$6;
|
|
3397
|
-
|
|
3398
|
-
var PromiseCapability = function (C) {
|
|
3399
|
-
var resolve, reject;
|
|
3400
|
-
this.promise = new C(function ($$resolve, $$reject) {
|
|
3401
|
-
if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
|
|
3402
|
-
resolve = $$resolve;
|
|
3403
|
-
reject = $$reject;
|
|
3404
|
-
});
|
|
3405
|
-
this.resolve = aCallable$1(resolve);
|
|
3406
|
-
this.reject = aCallable$1(reject);
|
|
3407
|
-
};
|
|
3408
|
-
|
|
3409
|
-
// `NewPromiseCapability` abstract operation
|
|
3410
|
-
// https://tc39.es/ecma262/#sec-newpromisecapability
|
|
3411
|
-
newPromiseCapability$2.f = function (C) {
|
|
3412
|
-
return new PromiseCapability(C);
|
|
3413
|
-
};
|
|
3414
|
-
|
|
3415
|
-
var anObject$1 = anObject$h;
|
|
3416
|
-
var isObject$1 = isObject$8;
|
|
3417
|
-
var newPromiseCapability$1 = newPromiseCapability$2;
|
|
3418
|
-
|
|
3419
|
-
var promiseResolve$1 = function (C, x) {
|
|
3420
|
-
anObject$1(C);
|
|
3421
|
-
if (isObject$1(x) && x.constructor === C) return x;
|
|
3422
|
-
var promiseCapability = newPromiseCapability$1.f(C);
|
|
3423
|
-
var resolve = promiseCapability.resolve;
|
|
3424
|
-
resolve(x);
|
|
3425
|
-
return promiseCapability.promise;
|
|
3426
|
-
};
|
|
3427
|
-
|
|
3428
|
-
var global$3 = global$J;
|
|
3429
|
-
|
|
3430
|
-
var hostReportErrors$1 = function (a, b) {
|
|
3431
|
-
var console = global$3.console;
|
|
3432
|
-
if (console && console.error) {
|
|
3433
|
-
arguments.length == 1 ? console.error(a) : console.error(a, b);
|
|
3434
|
-
}
|
|
3435
|
-
};
|
|
3436
|
-
|
|
3437
|
-
var perform$1 = function (exec) {
|
|
3438
|
-
try {
|
|
3439
|
-
return { error: false, value: exec() };
|
|
3440
|
-
} catch (error) {
|
|
3441
|
-
return { error: true, value: error };
|
|
3442
|
-
}
|
|
3443
|
-
};
|
|
3444
|
-
|
|
3445
|
-
var Queue$1 = function () {
|
|
3446
|
-
this.head = null;
|
|
3447
|
-
this.tail = null;
|
|
3448
|
-
};
|
|
3449
|
-
|
|
3450
|
-
Queue$1.prototype = {
|
|
3451
|
-
add: function (item) {
|
|
3452
|
-
var entry = { item: item, next: null };
|
|
3453
|
-
if (this.head) this.tail.next = entry;
|
|
3454
|
-
else this.head = entry;
|
|
3455
|
-
this.tail = entry;
|
|
3456
|
-
},
|
|
3457
|
-
get: function () {
|
|
3458
|
-
var entry = this.head;
|
|
3459
|
-
if (entry) {
|
|
3460
|
-
this.head = entry.next;
|
|
3461
|
-
if (this.tail === entry) this.tail = null;
|
|
3462
|
-
return entry.item;
|
|
3463
|
-
}
|
|
3464
|
-
}
|
|
3465
|
-
};
|
|
3466
|
-
|
|
3467
|
-
var queue = Queue$1;
|
|
3468
|
-
|
|
3469
|
-
var engineIsBrowser = typeof window == 'object';
|
|
3470
|
-
|
|
3471
|
-
var $$1 = _export;
|
|
3472
|
-
var global$2 = global$J;
|
|
3473
|
-
var getBuiltIn = getBuiltIn$7;
|
|
3474
|
-
var call = functionCall;
|
|
3475
|
-
var NativePromise = nativePromiseConstructor;
|
|
3476
|
-
var redefine$1 = redefine$7.exports;
|
|
3477
|
-
var redefineAll = redefineAll$1;
|
|
3478
|
-
var setPrototypeOf = objectSetPrototypeOf;
|
|
3479
|
-
var setToStringTag = setToStringTag$3;
|
|
3480
|
-
var setSpecies = setSpecies$1;
|
|
3481
|
-
var aCallable = aCallable$6;
|
|
3482
|
-
var isCallable$1 = isCallable$k;
|
|
3483
|
-
var isObject = isObject$8;
|
|
3484
|
-
var anInstance = anInstance$1;
|
|
3485
|
-
var inspectSource = inspectSource$4;
|
|
3486
|
-
var iterate = iterate$1;
|
|
3487
|
-
var checkCorrectnessOfIteration = checkCorrectnessOfIteration$1;
|
|
3488
|
-
var speciesConstructor = speciesConstructor$2;
|
|
3489
|
-
var task = task$1.set;
|
|
3490
|
-
var microtask = microtask$1;
|
|
3491
|
-
var promiseResolve = promiseResolve$1;
|
|
3492
|
-
var hostReportErrors = hostReportErrors$1;
|
|
3493
|
-
var newPromiseCapabilityModule = newPromiseCapability$2;
|
|
3494
|
-
var perform = perform$1;
|
|
3495
|
-
var Queue = queue;
|
|
3496
|
-
var InternalStateModule = internalState;
|
|
3497
|
-
var isForced = isForced_1;
|
|
3498
|
-
var wellKnownSymbol = wellKnownSymbol$h;
|
|
3499
|
-
var IS_BROWSER = engineIsBrowser;
|
|
3500
|
-
var IS_NODE = engineIsNode;
|
|
3501
|
-
var V8_VERSION = engineV8Version;
|
|
3502
|
-
|
|
3503
|
-
var SPECIES = wellKnownSymbol('species');
|
|
3504
|
-
var PROMISE = 'Promise';
|
|
3505
|
-
|
|
3506
|
-
var getInternalState = InternalStateModule.getterFor(PROMISE);
|
|
3507
|
-
var setInternalState = InternalStateModule.set;
|
|
3508
|
-
var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
|
|
3509
|
-
var NativePromisePrototype = NativePromise && NativePromise.prototype;
|
|
3510
|
-
var PromiseConstructor = NativePromise;
|
|
3511
|
-
var PromisePrototype = NativePromisePrototype;
|
|
3512
|
-
var TypeError$1 = global$2.TypeError;
|
|
3513
|
-
var document$1 = global$2.document;
|
|
3514
|
-
var process$1 = global$2.process;
|
|
3515
|
-
var newPromiseCapability = newPromiseCapabilityModule.f;
|
|
3516
|
-
var newGenericPromiseCapability = newPromiseCapability;
|
|
3517
|
-
|
|
3518
|
-
var DISPATCH_EVENT = !!(document$1 && document$1.createEvent && global$2.dispatchEvent);
|
|
3519
|
-
var NATIVE_REJECTION_EVENT = isCallable$1(global$2.PromiseRejectionEvent);
|
|
3520
|
-
var UNHANDLED_REJECTION = 'unhandledrejection';
|
|
3521
|
-
var REJECTION_HANDLED = 'rejectionhandled';
|
|
3522
|
-
var PENDING = 0;
|
|
3523
|
-
var FULFILLED = 1;
|
|
3524
|
-
var REJECTED = 2;
|
|
3525
|
-
var HANDLED = 1;
|
|
3526
|
-
var UNHANDLED = 2;
|
|
3527
|
-
var SUBCLASSING = false;
|
|
3528
|
-
|
|
3529
|
-
var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
|
|
3530
|
-
|
|
3531
|
-
var FORCED = isForced(PROMISE, function () {
|
|
3532
|
-
var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(PromiseConstructor);
|
|
3533
|
-
var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(PromiseConstructor);
|
|
3534
|
-
// V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
|
|
3535
|
-
// https://bugs.chromium.org/p/chromium/issues/detail?id=830565
|
|
3536
|
-
// We can't detect it synchronously, so just check versions
|
|
3537
|
-
if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
|
|
3538
|
-
// We can't use @@species feature detection in V8 since it causes
|
|
3539
|
-
// deoptimization and performance degradation
|
|
3540
|
-
// https://github.com/zloirock/core-js/issues/679
|
|
3541
|
-
if (V8_VERSION >= 51 && /native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) return false;
|
|
3542
|
-
// Detect correctness of subclassing with @@species support
|
|
3543
|
-
var promise = new PromiseConstructor(function (resolve) { resolve(1); });
|
|
3544
|
-
var FakePromise = function (exec) {
|
|
3545
|
-
exec(function () { /* empty */ }, function () { /* empty */ });
|
|
3546
|
-
};
|
|
3547
|
-
var constructor = promise.constructor = {};
|
|
3548
|
-
constructor[SPECIES] = FakePromise;
|
|
3549
|
-
SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
|
|
3550
|
-
if (!SUBCLASSING) return true;
|
|
3551
|
-
// Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
|
|
3552
|
-
return !GLOBAL_CORE_JS_PROMISE && IS_BROWSER && !NATIVE_REJECTION_EVENT;
|
|
3553
|
-
});
|
|
3554
|
-
|
|
3555
|
-
var INCORRECT_ITERATION = FORCED || !checkCorrectnessOfIteration(function (iterable) {
|
|
3556
|
-
PromiseConstructor.all(iterable)['catch'](function () { /* empty */ });
|
|
3557
|
-
});
|
|
3558
|
-
|
|
3559
|
-
// helpers
|
|
3560
|
-
var isThenable = function (it) {
|
|
3561
|
-
var then;
|
|
3562
|
-
return isObject(it) && isCallable$1(then = it.then) ? then : false;
|
|
3563
|
-
};
|
|
3564
|
-
|
|
3565
|
-
var callReaction = function (reaction, state) {
|
|
3566
|
-
var value = state.value;
|
|
3567
|
-
var ok = state.state == FULFILLED;
|
|
3568
|
-
var handler = ok ? reaction.ok : reaction.fail;
|
|
3569
|
-
var resolve = reaction.resolve;
|
|
3570
|
-
var reject = reaction.reject;
|
|
3571
|
-
var domain = reaction.domain;
|
|
3572
|
-
var result, then, exited;
|
|
3573
|
-
try {
|
|
3574
|
-
if (handler) {
|
|
3575
|
-
if (!ok) {
|
|
3576
|
-
if (state.rejection === UNHANDLED) onHandleUnhandled(state);
|
|
3577
|
-
state.rejection = HANDLED;
|
|
3578
|
-
}
|
|
3579
|
-
if (handler === true) result = value;
|
|
3580
|
-
else {
|
|
3581
|
-
if (domain) domain.enter();
|
|
3582
|
-
result = handler(value); // can throw
|
|
3583
|
-
if (domain) {
|
|
3584
|
-
domain.exit();
|
|
3585
|
-
exited = true;
|
|
3586
|
-
}
|
|
3587
|
-
}
|
|
3588
|
-
if (result === reaction.promise) {
|
|
3589
|
-
reject(TypeError$1('Promise-chain cycle'));
|
|
3590
|
-
} else if (then = isThenable(result)) {
|
|
3591
|
-
call(then, result, resolve, reject);
|
|
3592
|
-
} else resolve(result);
|
|
3593
|
-
} else reject(value);
|
|
3594
|
-
} catch (error) {
|
|
3595
|
-
if (domain && !exited) domain.exit();
|
|
3596
|
-
reject(error);
|
|
3597
|
-
}
|
|
3598
|
-
};
|
|
3599
|
-
|
|
3600
|
-
var notify = function (state, isReject) {
|
|
3601
|
-
if (state.notified) return;
|
|
3602
|
-
state.notified = true;
|
|
3603
|
-
microtask(function () {
|
|
3604
|
-
var reactions = state.reactions;
|
|
3605
|
-
var reaction;
|
|
3606
|
-
while (reaction = reactions.get()) {
|
|
3607
|
-
callReaction(reaction, state);
|
|
3608
|
-
}
|
|
3609
|
-
state.notified = false;
|
|
3610
|
-
if (isReject && !state.rejection) onUnhandled(state);
|
|
3611
|
-
});
|
|
3612
|
-
};
|
|
3613
|
-
|
|
3614
|
-
var dispatchEvent = function (name, promise, reason) {
|
|
3615
|
-
var event, handler;
|
|
3616
|
-
if (DISPATCH_EVENT) {
|
|
3617
|
-
event = document$1.createEvent('Event');
|
|
3618
|
-
event.promise = promise;
|
|
3619
|
-
event.reason = reason;
|
|
3620
|
-
event.initEvent(name, false, true);
|
|
3621
|
-
global$2.dispatchEvent(event);
|
|
3622
|
-
} else event = { promise: promise, reason: reason };
|
|
3623
|
-
if (!NATIVE_REJECTION_EVENT && (handler = global$2['on' + name])) handler(event);
|
|
3624
|
-
else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
|
|
3625
|
-
};
|
|
3626
|
-
|
|
3627
|
-
var onUnhandled = function (state) {
|
|
3628
|
-
call(task, global$2, function () {
|
|
3629
|
-
var promise = state.facade;
|
|
3630
|
-
var value = state.value;
|
|
3631
|
-
var IS_UNHANDLED = isUnhandled(state);
|
|
3632
|
-
var result;
|
|
3633
|
-
if (IS_UNHANDLED) {
|
|
3634
|
-
result = perform(function () {
|
|
3635
|
-
if (IS_NODE) {
|
|
3636
|
-
process$1.emit('unhandledRejection', value, promise);
|
|
3637
|
-
} else dispatchEvent(UNHANDLED_REJECTION, promise, value);
|
|
3638
|
-
});
|
|
3639
|
-
// Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
|
|
3640
|
-
state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
|
|
3641
|
-
if (result.error) throw result.value;
|
|
3642
|
-
}
|
|
3643
|
-
});
|
|
3644
|
-
};
|
|
3645
|
-
|
|
3646
|
-
var isUnhandled = function (state) {
|
|
3647
|
-
return state.rejection !== HANDLED && !state.parent;
|
|
3648
|
-
};
|
|
3649
|
-
|
|
3650
|
-
var onHandleUnhandled = function (state) {
|
|
3651
|
-
call(task, global$2, function () {
|
|
3652
|
-
var promise = state.facade;
|
|
3653
|
-
if (IS_NODE) {
|
|
3654
|
-
process$1.emit('rejectionHandled', promise);
|
|
3655
|
-
} else dispatchEvent(REJECTION_HANDLED, promise, state.value);
|
|
3656
|
-
});
|
|
3657
|
-
};
|
|
3658
|
-
|
|
3659
|
-
var bind = function (fn, state, unwrap) {
|
|
3660
|
-
return function (value) {
|
|
3661
|
-
fn(state, value, unwrap);
|
|
3662
|
-
};
|
|
3663
|
-
};
|
|
3664
|
-
|
|
3665
|
-
var internalReject = function (state, value, unwrap) {
|
|
3666
|
-
if (state.done) return;
|
|
3667
|
-
state.done = true;
|
|
3668
|
-
if (unwrap) state = unwrap;
|
|
3669
|
-
state.value = value;
|
|
3670
|
-
state.state = REJECTED;
|
|
3671
|
-
notify(state, true);
|
|
3672
|
-
};
|
|
3673
|
-
|
|
3674
|
-
var internalResolve = function (state, value, unwrap) {
|
|
3675
|
-
if (state.done) return;
|
|
3676
|
-
state.done = true;
|
|
3677
|
-
if (unwrap) state = unwrap;
|
|
3678
|
-
try {
|
|
3679
|
-
if (state.facade === value) throw TypeError$1("Promise can't be resolved itself");
|
|
3680
|
-
var then = isThenable(value);
|
|
3681
|
-
if (then) {
|
|
3682
|
-
microtask(function () {
|
|
3683
|
-
var wrapper = { done: false };
|
|
3684
|
-
try {
|
|
3685
|
-
call(then, value,
|
|
3686
|
-
bind(internalResolve, wrapper, state),
|
|
3687
|
-
bind(internalReject, wrapper, state)
|
|
3688
|
-
);
|
|
3689
|
-
} catch (error) {
|
|
3690
|
-
internalReject(wrapper, error, state);
|
|
3691
|
-
}
|
|
3692
|
-
});
|
|
3693
|
-
} else {
|
|
3694
|
-
state.value = value;
|
|
3695
|
-
state.state = FULFILLED;
|
|
3696
|
-
notify(state, false);
|
|
3697
|
-
}
|
|
3698
|
-
} catch (error) {
|
|
3699
|
-
internalReject({ done: false }, error, state);
|
|
3700
|
-
}
|
|
3701
|
-
};
|
|
3702
|
-
|
|
3703
|
-
// constructor polyfill
|
|
3704
|
-
if (FORCED) {
|
|
3705
|
-
// 25.4.3.1 Promise(executor)
|
|
3706
|
-
PromiseConstructor = function Promise(executor) {
|
|
3707
|
-
anInstance(this, PromisePrototype);
|
|
3708
|
-
aCallable(executor);
|
|
3709
|
-
call(Internal, this);
|
|
3710
|
-
var state = getInternalState(this);
|
|
3711
|
-
try {
|
|
3712
|
-
executor(bind(internalResolve, state), bind(internalReject, state));
|
|
3713
|
-
} catch (error) {
|
|
3714
|
-
internalReject(state, error);
|
|
3715
|
-
}
|
|
3716
|
-
};
|
|
3717
|
-
PromisePrototype = PromiseConstructor.prototype;
|
|
3718
|
-
// eslint-disable-next-line no-unused-vars -- required for `.length`
|
|
3719
|
-
Internal = function Promise(executor) {
|
|
3720
|
-
setInternalState(this, {
|
|
3721
|
-
type: PROMISE,
|
|
3722
|
-
done: false,
|
|
3723
|
-
notified: false,
|
|
3724
|
-
parent: false,
|
|
3725
|
-
reactions: new Queue(),
|
|
3726
|
-
rejection: false,
|
|
3727
|
-
state: PENDING,
|
|
3728
|
-
value: undefined
|
|
3729
|
-
});
|
|
3730
|
-
};
|
|
3731
|
-
Internal.prototype = redefineAll(PromisePrototype, {
|
|
3732
|
-
// `Promise.prototype.then` method
|
|
3733
|
-
// https://tc39.es/ecma262/#sec-promise.prototype.then
|
|
3734
|
-
// eslint-disable-next-line unicorn/no-thenable -- safe
|
|
3735
|
-
then: function then(onFulfilled, onRejected) {
|
|
3736
|
-
var state = getInternalPromiseState(this);
|
|
3737
|
-
var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
|
|
3738
|
-
state.parent = true;
|
|
3739
|
-
reaction.ok = isCallable$1(onFulfilled) ? onFulfilled : true;
|
|
3740
|
-
reaction.fail = isCallable$1(onRejected) && onRejected;
|
|
3741
|
-
reaction.domain = IS_NODE ? process$1.domain : undefined;
|
|
3742
|
-
if (state.state == PENDING) state.reactions.add(reaction);
|
|
3743
|
-
else microtask(function () {
|
|
3744
|
-
callReaction(reaction, state);
|
|
3745
|
-
});
|
|
3746
|
-
return reaction.promise;
|
|
3747
|
-
},
|
|
3748
|
-
// `Promise.prototype.catch` method
|
|
3749
|
-
// https://tc39.es/ecma262/#sec-promise.prototype.catch
|
|
3750
|
-
'catch': function (onRejected) {
|
|
3751
|
-
return this.then(undefined, onRejected);
|
|
3752
|
-
}
|
|
3753
|
-
});
|
|
3754
|
-
OwnPromiseCapability = function () {
|
|
3755
|
-
var promise = new Internal();
|
|
3756
|
-
var state = getInternalState(promise);
|
|
3757
|
-
this.promise = promise;
|
|
3758
|
-
this.resolve = bind(internalResolve, state);
|
|
3759
|
-
this.reject = bind(internalReject, state);
|
|
3760
|
-
};
|
|
3761
|
-
newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
|
|
3762
|
-
return C === PromiseConstructor || C === PromiseWrapper
|
|
3763
|
-
? new OwnPromiseCapability(C)
|
|
3764
|
-
: newGenericPromiseCapability(C);
|
|
3765
|
-
};
|
|
3766
|
-
|
|
3767
|
-
if (isCallable$1(NativePromise) && NativePromisePrototype !== Object.prototype) {
|
|
3768
|
-
nativeThen = NativePromisePrototype.then;
|
|
3769
|
-
|
|
3770
|
-
if (!SUBCLASSING) {
|
|
3771
|
-
// make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
|
|
3772
|
-
redefine$1(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) {
|
|
3773
|
-
var that = this;
|
|
3774
|
-
return new PromiseConstructor(function (resolve, reject) {
|
|
3775
|
-
call(nativeThen, that, resolve, reject);
|
|
3776
|
-
}).then(onFulfilled, onRejected);
|
|
3777
|
-
// https://github.com/zloirock/core-js/issues/640
|
|
3778
|
-
}, { unsafe: true });
|
|
3779
|
-
|
|
3780
|
-
// makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`
|
|
3781
|
-
redefine$1(NativePromisePrototype, 'catch', PromisePrototype['catch'], { unsafe: true });
|
|
3782
|
-
}
|
|
3783
|
-
|
|
3784
|
-
// make `.constructor === Promise` work for native promise-based APIs
|
|
3785
|
-
try {
|
|
3786
|
-
delete NativePromisePrototype.constructor;
|
|
3787
|
-
} catch (error) { /* empty */ }
|
|
3788
|
-
|
|
3789
|
-
// make `instanceof Promise` work for native promise-based APIs
|
|
3790
|
-
if (setPrototypeOf) {
|
|
3791
|
-
setPrototypeOf(NativePromisePrototype, PromisePrototype);
|
|
3792
|
-
}
|
|
3793
|
-
}
|
|
3794
|
-
}
|
|
3795
|
-
|
|
3796
|
-
$$1({ global: true, wrap: true, forced: FORCED }, {
|
|
3797
|
-
Promise: PromiseConstructor
|
|
3798
|
-
});
|
|
3799
|
-
|
|
3800
|
-
setToStringTag(PromiseConstructor, PROMISE, false);
|
|
3801
|
-
setSpecies(PROMISE);
|
|
3802
|
-
|
|
3803
|
-
PromiseWrapper = getBuiltIn(PROMISE);
|
|
3804
|
-
|
|
3805
|
-
// statics
|
|
3806
|
-
$$1({ target: PROMISE, stat: true, forced: FORCED }, {
|
|
3807
|
-
// `Promise.reject` method
|
|
3808
|
-
// https://tc39.es/ecma262/#sec-promise.reject
|
|
3809
|
-
reject: function reject(r) {
|
|
3810
|
-
var capability = newPromiseCapability(this);
|
|
3811
|
-
call(capability.reject, undefined, r);
|
|
3812
|
-
return capability.promise;
|
|
3813
|
-
}
|
|
3814
|
-
});
|
|
3815
|
-
|
|
3816
|
-
$$1({ target: PROMISE, stat: true, forced: FORCED }, {
|
|
3817
|
-
// `Promise.resolve` method
|
|
3818
|
-
// https://tc39.es/ecma262/#sec-promise.resolve
|
|
3819
|
-
resolve: function resolve(x) {
|
|
3820
|
-
return promiseResolve(this, x);
|
|
3821
|
-
}
|
|
3822
|
-
});
|
|
3823
|
-
|
|
3824
|
-
$$1({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION }, {
|
|
3825
|
-
// `Promise.all` method
|
|
3826
|
-
// https://tc39.es/ecma262/#sec-promise.all
|
|
3827
|
-
all: function all(iterable) {
|
|
3828
|
-
var C = this;
|
|
3829
|
-
var capability = newPromiseCapability(C);
|
|
3830
|
-
var resolve = capability.resolve;
|
|
3831
|
-
var reject = capability.reject;
|
|
3832
|
-
var result = perform(function () {
|
|
3833
|
-
var $promiseResolve = aCallable(C.resolve);
|
|
3834
|
-
var values = [];
|
|
3835
|
-
var counter = 0;
|
|
3836
|
-
var remaining = 1;
|
|
3837
|
-
iterate(iterable, function (promise) {
|
|
3838
|
-
var index = counter++;
|
|
3839
|
-
var alreadyCalled = false;
|
|
3840
|
-
remaining++;
|
|
3841
|
-
call($promiseResolve, C, promise).then(function (value) {
|
|
3842
|
-
if (alreadyCalled) return;
|
|
3843
|
-
alreadyCalled = true;
|
|
3844
|
-
values[index] = value;
|
|
3845
|
-
--remaining || resolve(values);
|
|
3846
|
-
}, reject);
|
|
3847
|
-
});
|
|
3848
|
-
--remaining || resolve(values);
|
|
3849
|
-
});
|
|
3850
|
-
if (result.error) reject(result.value);
|
|
3851
|
-
return capability.promise;
|
|
3852
|
-
},
|
|
3853
|
-
// `Promise.race` method
|
|
3854
|
-
// https://tc39.es/ecma262/#sec-promise.race
|
|
3855
|
-
race: function race(iterable) {
|
|
3856
|
-
var C = this;
|
|
3857
|
-
var capability = newPromiseCapability(C);
|
|
3858
|
-
var reject = capability.reject;
|
|
3859
|
-
var result = perform(function () {
|
|
3860
|
-
var $promiseResolve = aCallable(C.resolve);
|
|
3861
|
-
iterate(iterable, function (promise) {
|
|
3862
|
-
call($promiseResolve, C, promise).then(capability.resolve, reject);
|
|
3863
|
-
});
|
|
3864
|
-
});
|
|
3865
|
-
if (result.error) reject(result.value);
|
|
3866
|
-
return capability.promise;
|
|
3867
|
-
}
|
|
3868
|
-
});
|
|
3869
|
-
|
|
3870
|
-
const api = ["get", "post", "put", "patch", "delete"].reduce((api, method) => {
|
|
3871
|
-
api[method] = (endpoint, options = {}) => __awaiter(void 0, void 0, void 0, function* () {
|
|
3872
|
-
const {
|
|
3873
|
-
json = {},
|
|
3874
|
-
params,
|
|
3875
|
-
headers = {},
|
|
3876
|
-
timeout = 10000
|
|
3877
|
-
} = options;
|
|
3878
|
-
const requestInit = {
|
|
3879
|
-
method: method.toUpperCase(),
|
|
3880
|
-
headers: Object.assign({
|
|
3881
|
-
"content-type": "application/json"
|
|
3882
|
-
}, headers)
|
|
3883
|
-
};
|
|
3884
|
-
const timeoutNumber = Number(timeout);
|
|
3885
|
-
let controller;
|
|
3886
|
-
let timeoutId;
|
|
3887
|
-
let url = `/api/${endpoint.replace(/^\/*/, "")}`;
|
|
3888
|
-
|
|
3889
|
-
if (method !== "get") {
|
|
3890
|
-
requestInit.body = JSON.stringify(json);
|
|
3891
|
-
}
|
|
3892
|
-
|
|
3893
|
-
if (timeoutNumber > 0) {
|
|
3894
|
-
controller = new AbortController();
|
|
3895
|
-
timeoutId = setTimeout(() => controller.abort(), timeoutNumber);
|
|
3896
|
-
requestInit.signal = controller.signal;
|
|
3897
|
-
}
|
|
3898
|
-
|
|
3899
|
-
if (params) {
|
|
3900
|
-
url += buildUrlQueryString(params);
|
|
3901
|
-
}
|
|
3902
|
-
|
|
3903
|
-
const response = yield fetch(url, requestInit);
|
|
3904
|
-
|
|
3905
|
-
if (timeoutId) {
|
|
3906
|
-
clearTimeout(timeoutId);
|
|
3907
|
-
}
|
|
3908
|
-
|
|
3909
|
-
const result = yield response.json();
|
|
3910
|
-
return result;
|
|
3911
|
-
});
|
|
3912
|
-
|
|
3913
|
-
return api;
|
|
3914
|
-
}, {});
|
|
3915
|
-
|
|
3916
|
-
function useSubmit(url, transformData) {
|
|
3917
|
-
const [state, submit] = useAsyncFn(json => __awaiter(this, void 0, void 0, function* () {
|
|
3918
|
-
if (transformData) json = transformData(json);
|
|
3919
|
-
const response = yield api.post(url, {
|
|
3920
|
-
json
|
|
3921
|
-
});
|
|
3922
|
-
|
|
3923
|
-
if ("production" !== process.env["NODE_ENV"]) {
|
|
3924
|
-
console.log("[@koine/next] useSubmit response", response);
|
|
3925
|
-
}
|
|
3926
|
-
|
|
3927
|
-
return response;
|
|
3928
|
-
}), [url, transformData]);
|
|
3929
|
-
const {
|
|
3930
|
-
loading,
|
|
3931
|
-
error,
|
|
3932
|
-
value
|
|
3933
|
-
} = state;
|
|
3934
|
-
const fail = !loading && (!!error || (value === null || value === void 0 ? void 0 : value.fail));
|
|
3935
|
-
return Object.assign(Object.assign({
|
|
3936
|
-
submit,
|
|
3937
|
-
loading
|
|
3938
|
-
}, value || {}), {
|
|
3939
|
-
fail
|
|
3940
|
-
});
|
|
3941
|
-
}
|
|
3942
|
-
|
|
3943
|
-
const NextImg = NextImage;
|
|
3944
|
-
const NextImgSmart = props => {
|
|
3945
|
-
const [$loaded, setLoaded] = useState(false);
|
|
3946
|
-
const [$error, setError] = useState(false);
|
|
3947
|
-
const {
|
|
3948
|
-
nextImgProps,
|
|
3949
|
-
restProps
|
|
3950
|
-
} = getNextImgProps(props);
|
|
3951
|
-
const {
|
|
3952
|
-
Wrap
|
|
3953
|
-
} = restProps;
|
|
3954
|
-
return nextImgProps.priority ? jsx(NextImage, Object.assign({}, nextImgProps)) : jsx(Wrap, Object.assign({}, restProps, {
|
|
3955
|
-
"$loaded": $loaded,
|
|
3956
|
-
"$error": $error
|
|
3957
|
-
}, {
|
|
3958
|
-
children: jsx(NextImage, Object.assign({}, nextImgProps, {
|
|
3959
|
-
onLoadingComplete: () => setLoaded(true),
|
|
3960
|
-
onError: () => setError(true)
|
|
3961
|
-
}))
|
|
3962
|
-
}));
|
|
3963
|
-
};
|
|
3964
|
-
function getNextImgProps(_a) {
|
|
3965
|
-
var {
|
|
3966
|
-
src,
|
|
3967
|
-
alt,
|
|
3968
|
-
layout,
|
|
3969
|
-
blurDataURL,
|
|
3970
|
-
width,
|
|
3971
|
-
height,
|
|
3972
|
-
priority,
|
|
3973
|
-
objectFit,
|
|
3974
|
-
objectPosition
|
|
3975
|
-
} = _a,
|
|
3976
|
-
restProps = __rest(_a, ["src", "alt", "layout", "blurDataURL", "width", "height", "priority", "objectFit", "objectPosition"]);
|
|
3977
|
-
|
|
3978
|
-
const nextImgProps = {
|
|
3979
|
-
src,
|
|
3980
|
-
alt,
|
|
3981
|
-
layout,
|
|
3982
|
-
blurDataURL,
|
|
3983
|
-
width,
|
|
3984
|
-
height,
|
|
3985
|
-
priority,
|
|
3986
|
-
objectFit,
|
|
3987
|
-
objectPosition
|
|
3988
|
-
};
|
|
3989
|
-
return {
|
|
3990
|
-
nextImgProps,
|
|
3991
|
-
restProps
|
|
3992
|
-
};
|
|
3993
|
-
}
|
|
3994
|
-
|
|
3995
|
-
/**
|
|
3996
|
-
* @see https://next.js.org/docs/api-reference/next/link
|
|
3997
|
-
*/
|
|
3998
|
-
|
|
3999
|
-
const Link = /*#__PURE__*/forwardRef(function Link(_a, ref) {
|
|
4000
|
-
var {
|
|
4001
|
-
href,
|
|
4002
|
-
prefetch,
|
|
4003
|
-
replace,
|
|
4004
|
-
scroll,
|
|
4005
|
-
shallow,
|
|
4006
|
-
locale
|
|
4007
|
-
} = _a,
|
|
4008
|
-
props = __rest(_a, ["href", "prefetch", "replace", "scroll", "shallow", "locale"]);
|
|
4009
|
-
|
|
4010
|
-
return jsx(NextLink, Object.assign({
|
|
4011
|
-
href: href,
|
|
4012
|
-
replace: replace,
|
|
4013
|
-
scroll: scroll,
|
|
4014
|
-
shallow: shallow,
|
|
4015
|
-
locale: locale,
|
|
4016
|
-
passHref: true
|
|
4017
|
-
}, {
|
|
4018
|
-
children: jsx(KoineLink, Object.assign({
|
|
4019
|
-
ref: ref
|
|
4020
|
-
}, props))
|
|
4021
|
-
}));
|
|
4022
|
-
});
|
|
4023
|
-
|
|
4024
|
-
const NextProgress = ({
|
|
4025
|
-
startAt: _startAt = 0.3,
|
|
4026
|
-
showOnShallow: _showOnShallow = true,
|
|
4027
|
-
stopDelayMs: _stopDelayMs = 200
|
|
4028
|
-
}) => {
|
|
4029
|
-
const {
|
|
4030
|
-
events
|
|
4031
|
-
} = useRouter(); // const [progress, setProgress] = useState(0);
|
|
4032
|
-
|
|
4033
|
-
const [running, setRunning] = useState(false);
|
|
4034
|
-
const timer = useRef(null);
|
|
4035
|
-
const routeChangeStart = useCallback((_, {
|
|
4036
|
-
shallow
|
|
4037
|
-
}) => {
|
|
4038
|
-
if (!shallow || _showOnShallow) {
|
|
4039
|
-
// setProgress(startAt);
|
|
4040
|
-
setRunning(true);
|
|
4041
|
-
}
|
|
4042
|
-
}, [_showOnShallow]);
|
|
4043
|
-
const routeChangeEnd = useCallback((_, {
|
|
4044
|
-
shallow
|
|
4045
|
-
}) => {
|
|
4046
|
-
if (!shallow || _showOnShallow) {
|
|
4047
|
-
if (timer.current) {
|
|
4048
|
-
clearTimeout(timer.current);
|
|
4049
|
-
}
|
|
4050
|
-
|
|
4051
|
-
timer.current = setTimeout(() => {
|
|
4052
|
-
// setProgress(100);
|
|
4053
|
-
setRunning(false);
|
|
4054
|
-
}, _stopDelayMs);
|
|
4055
|
-
}
|
|
4056
|
-
}, [_showOnShallow, _stopDelayMs, timer]);
|
|
4057
|
-
useEffect(() => {
|
|
4058
|
-
events.on("routeChangeStart", routeChangeStart);
|
|
4059
|
-
events.on("routeChangeComplete", routeChangeEnd);
|
|
4060
|
-
events.on("routeChangeError", routeChangeEnd);
|
|
4061
|
-
return () => {
|
|
4062
|
-
events.off("routeChangeStart", routeChangeStart);
|
|
4063
|
-
events.off("routeChangeComplete", routeChangeEnd);
|
|
4064
|
-
events.off("routeChangeError", routeChangeEnd);
|
|
4065
|
-
};
|
|
4066
|
-
}, [events, routeChangeStart, routeChangeEnd]);
|
|
4067
|
-
return jsx(ProgressOverlay, {
|
|
4068
|
-
running: running
|
|
4069
|
-
});
|
|
4070
|
-
};
|
|
4071
|
-
|
|
4072
|
-
var $ = _export;
|
|
4073
|
-
var DESCRIPTORS = descriptors;
|
|
4074
|
-
var global$1 = global$J;
|
|
4075
|
-
var uncurryThis$1 = functionUncurryThis;
|
|
4076
|
-
var hasOwn = hasOwnProperty_1;
|
|
4077
|
-
var isCallable = isCallable$k;
|
|
4078
|
-
var isPrototypeOf$1 = objectIsPrototypeOf;
|
|
4079
|
-
var toString = toString$7;
|
|
4080
|
-
var defineProperty = objectDefineProperty.f;
|
|
4081
|
-
var copyConstructorProperties = copyConstructorProperties$2;
|
|
4082
|
-
|
|
4083
|
-
var NativeSymbol = global$1.Symbol;
|
|
4084
|
-
var SymbolPrototype = NativeSymbol && NativeSymbol.prototype;
|
|
4085
|
-
|
|
4086
|
-
if (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototype) ||
|
|
4087
|
-
// Safari 12 bug
|
|
4088
|
-
NativeSymbol().description !== undefined
|
|
4089
|
-
)) {
|
|
4090
|
-
var EmptyStringDescriptionStore = {};
|
|
4091
|
-
// wrap Symbol constructor for correct work with undefined description
|
|
4092
|
-
var SymbolWrapper = function Symbol() {
|
|
4093
|
-
var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString(arguments[0]);
|
|
4094
|
-
var result = isPrototypeOf$1(SymbolPrototype, this)
|
|
4095
|
-
? new NativeSymbol(description)
|
|
4096
|
-
// in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
|
|
4097
|
-
: description === undefined ? NativeSymbol() : NativeSymbol(description);
|
|
4098
|
-
if (description === '') EmptyStringDescriptionStore[result] = true;
|
|
4099
|
-
return result;
|
|
4100
|
-
};
|
|
4101
|
-
|
|
4102
|
-
copyConstructorProperties(SymbolWrapper, NativeSymbol);
|
|
4103
|
-
SymbolWrapper.prototype = SymbolPrototype;
|
|
4104
|
-
SymbolPrototype.constructor = SymbolWrapper;
|
|
4105
|
-
|
|
4106
|
-
var NATIVE_SYMBOL = String(NativeSymbol('test')) == 'Symbol(test)';
|
|
4107
|
-
var symbolToString = uncurryThis$1(SymbolPrototype.toString);
|
|
4108
|
-
var symbolValueOf = uncurryThis$1(SymbolPrototype.valueOf);
|
|
4109
|
-
var regexp = /^Symbol\((.*)\)[^)]+$/;
|
|
4110
|
-
var replace = uncurryThis$1(''.replace);
|
|
4111
|
-
var stringSlice = uncurryThis$1(''.slice);
|
|
4112
|
-
|
|
4113
|
-
defineProperty(SymbolPrototype, 'description', {
|
|
4114
|
-
configurable: true,
|
|
4115
|
-
get: function description() {
|
|
4116
|
-
var symbol = symbolValueOf(this);
|
|
4117
|
-
var string = symbolToString(symbol);
|
|
4118
|
-
if (hasOwn(EmptyStringDescriptionStore, symbol)) return '';
|
|
4119
|
-
var desc = NATIVE_SYMBOL ? stringSlice(string, 7, -1) : replace(string, regexp, '$1');
|
|
4120
|
-
return desc === '' ? undefined : desc;
|
|
4121
|
-
}
|
|
4122
|
-
});
|
|
4123
|
-
|
|
4124
|
-
$({ global: true, forced: true }, {
|
|
4125
|
-
Symbol: SymbolWrapper
|
|
4126
|
-
});
|
|
4127
|
-
}
|
|
4128
|
-
|
|
4129
|
-
const defaults = {
|
|
4130
|
-
tplTitle: ""
|
|
4131
|
-
};
|
|
4132
|
-
/**
|
|
4133
|
-
* We do a couple of things in addition while many other are removed.
|
|
4134
|
-
*
|
|
4135
|
-
* - Add `seo` meta object coming from a CMS probably
|
|
4136
|
-
* - Add `ogimage` and `openGraph.image` as single image source
|
|
4137
|
-
* - Add `og` alias to define `openGraph`
|
|
4138
|
-
* - Add check for `title` equale to `templateTitle` to avoid meta titles like
|
|
4139
|
-
* "My site | My site" often happening in homepages
|
|
4140
|
-
* - Remove the open graph videos and images
|
|
4141
|
-
*
|
|
4142
|
-
* - Shorter code
|
|
4143
|
-
*
|
|
4144
|
-
* @returns
|
|
4145
|
-
*/
|
|
4146
|
-
|
|
4147
|
-
const buildTags = ({
|
|
4148
|
-
seo,
|
|
4149
|
-
hidden,
|
|
4150
|
-
keywords,
|
|
4151
|
-
title: _title = "",
|
|
4152
|
-
titleTemplate,
|
|
4153
|
-
defaultTitle,
|
|
4154
|
-
noindex,
|
|
4155
|
-
nofollow,
|
|
4156
|
-
description,
|
|
4157
|
-
languageAlternates: _languageAlternates = [],
|
|
4158
|
-
twitter,
|
|
4159
|
-
facebook,
|
|
4160
|
-
openGraph,
|
|
4161
|
-
og: ogAlias,
|
|
4162
|
-
canonical,
|
|
4163
|
-
metaTags,
|
|
4164
|
-
linkTags
|
|
4165
|
-
} = {}) => {
|
|
4166
|
-
const render = [];
|
|
4167
|
-
const $names = {};
|
|
4168
|
-
const $properties = {};
|
|
4169
|
-
|
|
4170
|
-
if (titleTemplate) {
|
|
4171
|
-
defaults.tplTitle = titleTemplate;
|
|
4172
|
-
}
|
|
4173
|
-
|
|
4174
|
-
_title = _title || (seo === null || seo === void 0 ? void 0 : seo.title) || "";
|
|
4175
|
-
|
|
4176
|
-
if (_title) {
|
|
4177
|
-
if (defaults.tplTitle && defaults.tplTitle !== _title) {
|
|
4178
|
-
_title = defaults.tplTitle.replace(/%s/g, _title);
|
|
4179
|
-
}
|
|
4180
|
-
} else if (defaultTitle) {
|
|
4181
|
-
_title = defaultTitle;
|
|
4182
|
-
}
|
|
4183
|
-
|
|
4184
|
-
if (_title) {
|
|
4185
|
-
render.push(jsx("title", {
|
|
4186
|
-
children: _title
|
|
4187
|
-
}, "title"));
|
|
4188
|
-
$properties["og:title"] = _title; // overridden later...
|
|
4189
|
-
}
|
|
4190
|
-
|
|
4191
|
-
$names["robots"] = `${noindex || hidden ? "noindex" : "index"},${nofollow || hidden ? "nofollow" : "follow"}`;
|
|
4192
|
-
description = description || (seo === null || seo === void 0 ? void 0 : seo.description);
|
|
4193
|
-
|
|
4194
|
-
if (description) {
|
|
4195
|
-
$names["description"] = description;
|
|
4196
|
-
$properties["og:description"] = description; // overridden later...
|
|
4197
|
-
}
|
|
4198
|
-
|
|
4199
|
-
keywords = keywords || (seo === null || seo === void 0 ? void 0 : seo.keywords);
|
|
4200
|
-
|
|
4201
|
-
if (keywords) {
|
|
4202
|
-
$names["keywords"] = isArray(keywords) ? keywords.join(", ") : keywords;
|
|
4203
|
-
}
|
|
4204
|
-
|
|
4205
|
-
if ((_languageAlternates === null || _languageAlternates === void 0 ? void 0 : _languageAlternates.length) > 0) {
|
|
4206
|
-
_languageAlternates.forEach(languageAlternate => {
|
|
4207
|
-
render.push(jsx("link", {
|
|
4208
|
-
rel: "alternate",
|
|
4209
|
-
hrefLang: languageAlternate.hrefLang,
|
|
4210
|
-
href: languageAlternate.href
|
|
4211
|
-
}, `languageAlternate-${languageAlternate.hrefLang}`));
|
|
4212
|
-
});
|
|
4213
|
-
}
|
|
4214
|
-
|
|
4215
|
-
if (canonical) {
|
|
4216
|
-
render.push(jsx("link", {
|
|
4217
|
-
rel: "canonical",
|
|
4218
|
-
href: canonical
|
|
4219
|
-
}, "canonical"));
|
|
4220
|
-
$properties["og:url"] = canonical;
|
|
4221
|
-
}
|
|
4222
|
-
|
|
4223
|
-
if (facebook === null || facebook === void 0 ? void 0 : facebook.appId) $properties["fb:app_id"] = facebook.appId;
|
|
4224
|
-
|
|
4225
|
-
if (twitter) {
|
|
4226
|
-
if (twitter.cardType) $names["twitter:card"] = twitter.cardType;
|
|
4227
|
-
if (twitter.site) $names["twitter:site"] = twitter.site;
|
|
4228
|
-
if (twitter.handle) $names["twitter:creator"] = twitter.handle;
|
|
4229
|
-
}
|
|
4230
|
-
|
|
4231
|
-
const og = ogAlias || openGraph;
|
|
4232
|
-
if (og === null || og === void 0 ? void 0 : og.title) $properties["og:title"] = og === null || og === void 0 ? void 0 : og.title;
|
|
4233
|
-
if (og === null || og === void 0 ? void 0 : og.description) $properties["og:description"] = og === null || og === void 0 ? void 0 : og.description;
|
|
4234
|
-
if (og === null || og === void 0 ? void 0 : og.url) $properties["og:url"] = og.url;
|
|
4235
|
-
if (og === null || og === void 0 ? void 0 : og.type) $properties["og:type"] = og.type.toLowerCase();
|
|
4236
|
-
if (og === null || og === void 0 ? void 0 : og.locale) $properties["og:locale"] = og.locale;
|
|
4237
|
-
if (og === null || og === void 0 ? void 0 : og.site_name) $properties["og:site_name"] = og.site_name;
|
|
4238
|
-
const ogimage = (og === null || og === void 0 ? void 0 : og.image) || (seo === null || seo === void 0 ? void 0 : seo.ogimage);
|
|
4239
|
-
if (ogimage) $properties["og:image"] = ogimage;
|
|
4240
|
-
Object.keys($names).forEach(key => {
|
|
4241
|
-
render.push(jsx("meta", {
|
|
4242
|
-
name: key,
|
|
4243
|
-
content: $names[key]
|
|
4244
|
-
}, key));
|
|
4245
|
-
});
|
|
4246
|
-
Object.keys($properties).forEach(key => {
|
|
4247
|
-
render.push(jsx("meta", {
|
|
4248
|
-
property: key,
|
|
4249
|
-
content: $properties[key]
|
|
4250
|
-
}, key));
|
|
4251
|
-
});
|
|
4252
|
-
|
|
4253
|
-
if (metaTags && metaTags.length > 0) {
|
|
4254
|
-
metaTags.forEach(tag => {
|
|
4255
|
-
var _a, _b, _c;
|
|
4256
|
-
|
|
4257
|
-
render.push(jsx("meta", Object.assign({}, tag), `meta:${(_c = (_b = (_a = tag.keyOverride) !== null && _a !== void 0 ? _a : tag.name) !== null && _b !== void 0 ? _b : tag.property) !== null && _c !== void 0 ? _c : tag.httpEquiv}`));
|
|
4258
|
-
});
|
|
4259
|
-
}
|
|
4260
|
-
|
|
4261
|
-
if (linkTags === null || linkTags === void 0 ? void 0 : linkTags.length) {
|
|
4262
|
-
linkTags.forEach(tag => {
|
|
4263
|
-
var _a;
|
|
4264
|
-
|
|
4265
|
-
render.push(jsx("link", Object.assign({}, tag), `link${(_a = tag.keyOverride) !== null && _a !== void 0 ? _a : tag.href}${tag.rel}`));
|
|
4266
|
-
});
|
|
4267
|
-
} // TODO: alternates and canonical
|
|
4268
|
-
// canonical = 'https://www.domain.com/';
|
|
4269
|
-
// languageAlternates={[{
|
|
4270
|
-
// hrefLang: 'en',
|
|
4271
|
-
// href: 'https://www.domain.com/en',
|
|
4272
|
-
// }]}
|
|
4273
|
-
// <link rel="alternate" hreflang="x-default" href="https://www.domain.com/nl/">
|
|
4274
|
-
// <link rel="alternate" hreflang="nl" href="https://www.domain.com/nl/">
|
|
4275
|
-
// <link rel="alternate" hreflang="en" href="https://www.domain.com/en/">
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
return render;
|
|
4279
|
-
};
|
|
4280
|
-
|
|
4281
|
-
const _Seo = props => {
|
|
4282
|
-
return jsx(Head, {
|
|
4283
|
-
children: buildTags(props)
|
|
4284
|
-
});
|
|
4285
|
-
};
|
|
4286
|
-
|
|
4287
|
-
const Seo = /*#__PURE__*/memo(_Seo);
|
|
4288
|
-
|
|
4289
|
-
const _SeoDefaults = props => {
|
|
4290
|
-
// const router = useRouter();
|
|
4291
|
-
// props.openGraph.url = getSiteUrl(router.asPath);
|
|
4292
|
-
return jsx(Head, {
|
|
4293
|
-
children: buildTags(props)
|
|
4294
|
-
});
|
|
4295
|
-
};
|
|
4296
|
-
|
|
4297
|
-
const SeoDefaults = /*#__PURE__*/memo(_SeoDefaults);
|
|
4298
|
-
|
|
4299
|
-
var uncurryThis = functionUncurryThis;
|
|
4300
|
-
var PROPER_FUNCTION_NAME = functionName.PROPER;
|
|
4301
|
-
var redefine = redefine$7.exports;
|
|
4302
|
-
var anObject = anObject$h;
|
|
4303
|
-
var isPrototypeOf = objectIsPrototypeOf;
|
|
4304
|
-
var $toString = toString$7;
|
|
4305
|
-
var fails = fails$k;
|
|
4306
|
-
var regExpFlags = regexpFlags$1;
|
|
4307
|
-
|
|
4308
|
-
var TO_STRING = 'toString';
|
|
4309
|
-
var RegExpPrototype = RegExp.prototype;
|
|
4310
|
-
var n$ToString = RegExpPrototype[TO_STRING];
|
|
4311
|
-
var getFlags = uncurryThis(regExpFlags);
|
|
4312
|
-
|
|
4313
|
-
var NOT_GENERIC = fails(function () { return n$ToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
|
|
4314
|
-
// FF44- RegExp#toString has a wrong name
|
|
4315
|
-
var INCORRECT_NAME = PROPER_FUNCTION_NAME && n$ToString.name != TO_STRING;
|
|
4316
|
-
|
|
4317
|
-
// `RegExp.prototype.toString` method
|
|
4318
|
-
// https://tc39.es/ecma262/#sec-regexp.prototype.tostring
|
|
4319
|
-
if (NOT_GENERIC || INCORRECT_NAME) {
|
|
4320
|
-
redefine(RegExp.prototype, TO_STRING, function toString() {
|
|
4321
|
-
var R = anObject(this);
|
|
4322
|
-
var p = $toString(R.source);
|
|
4323
|
-
var rf = R.flags;
|
|
4324
|
-
var f = $toString(rf === undefined && isPrototypeOf(RegExpPrototype, R) && !('flags' in RegExpPrototype) ? getFlags(R) : rf);
|
|
4325
|
-
return '/' + p + '/' + f;
|
|
4326
|
-
}, { unsafe: true });
|
|
4327
|
-
}
|
|
4328
|
-
|
|
4329
|
-
const THEME_STORAGE_KEY = "theme";
|
|
4330
|
-
const colorSchemes = ["light", "dark"];
|
|
4331
|
-
const MEDIA = "(prefers-color-scheme: dark)";
|
|
4332
|
-
const ThemeContext = /*#__PURE__*/createContext({
|
|
4333
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
4334
|
-
setTheme: _ => {},
|
|
4335
|
-
themes: []
|
|
4336
|
-
});
|
|
4337
|
-
const useTheme = () => useContext(ThemeContext);
|
|
4338
|
-
const ThemeProvider = ({
|
|
4339
|
-
forcedTheme,
|
|
4340
|
-
disableTransitionOnChange: _disableTransitionOnChange = false,
|
|
4341
|
-
enableSystem: _enableSystem = true,
|
|
4342
|
-
enableColorScheme: _enableColorScheme = true,
|
|
4343
|
-
themes: _themes = ["light", "dark"],
|
|
4344
|
-
defaultTheme: _defaultTheme = _enableSystem ? "system" : "light",
|
|
4345
|
-
attribute: _attribute = "data-theme",
|
|
4346
|
-
value,
|
|
4347
|
-
children,
|
|
4348
|
-
nonce
|
|
4349
|
-
}) => {
|
|
4350
|
-
const [theme, setThemeState] = useState(() => getTheme(THEME_STORAGE_KEY, _defaultTheme));
|
|
4351
|
-
const [resolvedTheme, setResolvedTheme] = useState(() => getTheme(THEME_STORAGE_KEY));
|
|
4352
|
-
const attrs = !value ? _themes : Object.values(value);
|
|
4353
|
-
const applyTheme = useCallback(theme => {
|
|
4354
|
-
let resolved = theme;
|
|
4355
|
-
if (isServer) return; // If theme is system, resolve it before setting theme
|
|
4356
|
-
|
|
4357
|
-
if (theme === "system" && _enableSystem) {
|
|
4358
|
-
resolved = getSystemTheme();
|
|
4359
|
-
}
|
|
4360
|
-
|
|
4361
|
-
const name = value ? value[resolved] : resolved;
|
|
4362
|
-
const enable = _disableTransitionOnChange ? disableAnimation() : null;
|
|
4363
|
-
const d = document.documentElement;
|
|
4364
|
-
|
|
4365
|
-
if (_attribute === "class") {
|
|
4366
|
-
d.classList.remove(...attrs);
|
|
4367
|
-
if (name) d.classList.add(name);
|
|
4368
|
-
} else {
|
|
4369
|
-
if (name) {
|
|
4370
|
-
d.setAttribute(_attribute, name);
|
|
4371
|
-
} else {
|
|
4372
|
-
d.removeAttribute(_attribute);
|
|
4373
|
-
}
|
|
4374
|
-
}
|
|
4375
|
-
|
|
4376
|
-
if (_enableColorScheme) {
|
|
4377
|
-
const fallback = colorSchemes.includes(_defaultTheme) ? _defaultTheme : null;
|
|
4378
|
-
const colorScheme = colorSchemes.includes(resolved) ? resolved : fallback;
|
|
4379
|
-
d.style.colorScheme = colorScheme;
|
|
4380
|
-
}
|
|
4381
|
-
|
|
4382
|
-
enable === null || enable === void 0 ? void 0 : enable();
|
|
4383
|
-
}, [_attribute, attrs, _defaultTheme, _disableTransitionOnChange, _enableColorScheme, _enableSystem, value]);
|
|
4384
|
-
const setTheme = useCallback(theme => {
|
|
4385
|
-
setThemeState(theme); // Save to storage
|
|
4386
|
-
|
|
4387
|
-
try {
|
|
4388
|
-
localStorage.setItem(THEME_STORAGE_KEY, theme);
|
|
4389
|
-
} catch (e) {// Unsupported
|
|
4390
|
-
}
|
|
4391
|
-
}, []);
|
|
4392
|
-
const handleMediaQuery = useCallback(e => {
|
|
4393
|
-
const resolved = getSystemTheme(e);
|
|
4394
|
-
setResolvedTheme(resolved);
|
|
4395
|
-
|
|
4396
|
-
if (theme === "system" && _enableSystem && !forcedTheme) {
|
|
4397
|
-
applyTheme("system");
|
|
4398
|
-
}
|
|
4399
|
-
}, [theme, _enableSystem, forcedTheme, applyTheme]); // Always listen to System preference
|
|
4400
|
-
|
|
4401
|
-
useEffect(() => {
|
|
4402
|
-
const media = window.matchMedia(MEDIA); // Intentionally use deprecated listener methods to support iOS & old browsers
|
|
4403
|
-
|
|
4404
|
-
media.addListener(handleMediaQuery);
|
|
4405
|
-
handleMediaQuery(media);
|
|
4406
|
-
return () => media.removeListener(handleMediaQuery);
|
|
4407
|
-
}, [handleMediaQuery]); // localStorage event handling
|
|
4408
|
-
|
|
4409
|
-
useEffect(() => {
|
|
4410
|
-
const handleStorage = e => {
|
|
4411
|
-
if (e.key !== THEME_STORAGE_KEY) {
|
|
4412
|
-
return;
|
|
4413
|
-
} // If default theme set, use it if localstorage === null (happens on local storage manual deletion)
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
const theme = e.newValue || _defaultTheme;
|
|
4417
|
-
setTheme(theme);
|
|
4418
|
-
};
|
|
4419
|
-
|
|
4420
|
-
window.addEventListener("storage", handleStorage);
|
|
4421
|
-
return () => window.removeEventListener("storage", handleStorage);
|
|
4422
|
-
}, [_defaultTheme, setTheme]); // Whenever theme or forcedTheme changes, apply it
|
|
4423
|
-
|
|
4424
|
-
useEffect(() => {
|
|
4425
|
-
applyTheme(forcedTheme !== null && forcedTheme !== void 0 ? forcedTheme : theme);
|
|
4426
|
-
}, [applyTheme, forcedTheme, theme]);
|
|
4427
|
-
return jsxs(ThemeContext.Provider, Object.assign({
|
|
4428
|
-
value: {
|
|
4429
|
-
theme,
|
|
4430
|
-
setTheme,
|
|
4431
|
-
forcedTheme,
|
|
4432
|
-
resolvedTheme: theme === "system" ? resolvedTheme : theme,
|
|
4433
|
-
themes: _enableSystem ? [..._themes, "system"] : _themes,
|
|
4434
|
-
systemTheme: _enableSystem ? resolvedTheme : undefined
|
|
4435
|
-
}
|
|
4436
|
-
}, {
|
|
4437
|
-
children: [jsx(ThemeScript, Object.assign({}, {
|
|
4438
|
-
forcedTheme,
|
|
4439
|
-
disableTransitionOnChange: _disableTransitionOnChange,
|
|
4440
|
-
enableSystem: _enableSystem,
|
|
4441
|
-
enableColorScheme: _enableColorScheme,
|
|
4442
|
-
themes: _themes,
|
|
4443
|
-
defaultTheme: _defaultTheme,
|
|
4444
|
-
attribute: _attribute,
|
|
4445
|
-
value,
|
|
4446
|
-
children,
|
|
4447
|
-
attrs,
|
|
4448
|
-
nonce
|
|
4449
|
-
})), children]
|
|
4450
|
-
}));
|
|
4451
|
-
};
|
|
4452
|
-
const ThemeScript = /*#__PURE__*/memo(({
|
|
4453
|
-
forcedTheme,
|
|
4454
|
-
attribute,
|
|
4455
|
-
enableSystem,
|
|
4456
|
-
enableColorScheme,
|
|
4457
|
-
defaultTheme,
|
|
4458
|
-
value,
|
|
4459
|
-
attrs,
|
|
4460
|
-
nonce
|
|
4461
|
-
}) => {
|
|
4462
|
-
const defaultSystem = defaultTheme === "system"; // Code-golfing the amount of characters in the script
|
|
4463
|
-
|
|
4464
|
-
const optimization = (() => {
|
|
4465
|
-
const removeClasses = `d.remove(${attrs.map(t => `'${t}'`).join(",")})`;
|
|
4466
|
-
return `var d=document.documentElement.classList;${removeClasses};`;
|
|
4467
|
-
})();
|
|
4468
|
-
|
|
4469
|
-
const fallbackColorScheme = (() => {
|
|
4470
|
-
if (!enableColorScheme) {
|
|
4471
|
-
return "";
|
|
4472
|
-
}
|
|
4473
|
-
|
|
4474
|
-
const fallback = colorSchemes.includes(defaultTheme) ? defaultTheme : null;
|
|
4475
|
-
|
|
4476
|
-
if (fallback) {
|
|
4477
|
-
return `if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${defaultTheme}'`;
|
|
4478
|
-
} else {
|
|
4479
|
-
return `if(e==='light'||e==='dark')d.style.colorScheme=e`;
|
|
4480
|
-
}
|
|
4481
|
-
})();
|
|
4482
|
-
|
|
4483
|
-
const updateDOM = (name, literal = false, setColorScheme = true) => {
|
|
4484
|
-
const resolvedName = value ? value[name] : name;
|
|
4485
|
-
const val = literal ? name + `|| ''` : `'${resolvedName}'`;
|
|
4486
|
-
let text = ""; // MUCH faster to set colorScheme alongside HTML attribute/class
|
|
4487
|
-
// as it only incurs 1 style recalculation rather than 2
|
|
4488
|
-
// This can save over 250ms of work for pages with big DOM
|
|
4489
|
-
|
|
4490
|
-
if (enableColorScheme && setColorScheme && !literal && colorSchemes.includes(name)) {
|
|
4491
|
-
text += `d.style.colorScheme = '${name}';`;
|
|
4492
|
-
}
|
|
4493
|
-
|
|
4494
|
-
if (attribute === "class") {
|
|
4495
|
-
if (literal || resolvedName) {
|
|
4496
|
-
text += `d.add(${val})`;
|
|
4497
|
-
} else {
|
|
4498
|
-
text += `null`;
|
|
4499
|
-
}
|
|
4500
|
-
} else {
|
|
4501
|
-
if (resolvedName) {
|
|
4502
|
-
text += `d[s](n, ${val})`;
|
|
4503
|
-
}
|
|
4504
|
-
}
|
|
4505
|
-
|
|
4506
|
-
return text;
|
|
4507
|
-
};
|
|
4508
|
-
|
|
4509
|
-
const scriptSrc = (() => {
|
|
4510
|
-
if (forcedTheme) {
|
|
4511
|
-
return `!function(){${optimization}${updateDOM(forcedTheme)}}()`;
|
|
4512
|
-
}
|
|
4513
|
-
|
|
4514
|
-
if (enableSystem) {
|
|
4515
|
-
return `!function(){try {${optimization}var e=localStorage.getItem('${THEME_STORAGE_KEY}');if("system"===e||(!e&&${defaultSystem})){var t="${MEDIA}",m=window.matchMedia(t);if(m.media!==t||m.matches){${updateDOM("dark")}}else{${updateDOM("light")}}}else if(e){${value ? `var x=${JSON.stringify(value)};` : ""}${updateDOM(value ? `x[e]` : "e", true)}}${!defaultSystem ? `else{` + updateDOM(defaultTheme, false, false) + "}" : ""}${fallbackColorScheme}}catch(e){}}()`;
|
|
4516
|
-
}
|
|
4517
|
-
|
|
4518
|
-
return `!function(){try{${optimization}var e=localStorage.getItem("${THEME_STORAGE_KEY}");if(e){${value ? `var x=${JSON.stringify(value)};` : ""}${updateDOM(value ? `x[e]` : "e", true)}}else{${updateDOM(defaultTheme, false, false)};}${fallbackColorScheme}}catch(t){}}();`;
|
|
4519
|
-
})(); // We MUST use next/script's `beforeInteractive` strategy to avoid flashing on load.
|
|
4520
|
-
// However, it only accepts the `src` prop, not `dangerouslySetInnerHTML` or `children`
|
|
4521
|
-
// But our script cannot be external because it changes at runtime based on React props
|
|
4522
|
-
// so we trick next/script by passing `src` as a base64 JS script
|
|
4523
|
-
|
|
4524
|
-
|
|
4525
|
-
const encodedScript = `data:text/javascript;base64,${encodeBase64(scriptSrc)}`;
|
|
4526
|
-
return jsx(Script, {
|
|
4527
|
-
id: "next-theme-script",
|
|
4528
|
-
strategy: "beforeInteractive",
|
|
4529
|
-
src: encodedScript,
|
|
4530
|
-
nonce: nonce
|
|
4531
|
-
});
|
|
4532
|
-
}, // Never re-render this component
|
|
4533
|
-
() => true); // Helpers
|
|
4534
|
-
|
|
4535
|
-
const getTheme = (key, fallback) => {
|
|
4536
|
-
if (isServer) return undefined;
|
|
4537
|
-
let theme;
|
|
4538
|
-
|
|
4539
|
-
try {
|
|
4540
|
-
theme = localStorage.getItem(key) || undefined;
|
|
4541
|
-
} catch (e) {// Unsupported
|
|
4542
|
-
}
|
|
4543
|
-
|
|
4544
|
-
return theme || fallback;
|
|
4545
|
-
};
|
|
4546
|
-
|
|
4547
|
-
const disableAnimation = () => {
|
|
4548
|
-
const css = document.createElement("style");
|
|
4549
|
-
css.appendChild(document.createTextNode(`*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}`));
|
|
4550
|
-
document.head.appendChild(css);
|
|
4551
|
-
return () => {
|
|
4552
|
-
// Force restyle
|
|
4553
|
-
(() => window.getComputedStyle(document.body))(); // Wait for next tick before removing
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
setTimeout(() => {
|
|
4557
|
-
document.head.removeChild(css);
|
|
4558
|
-
}, 1);
|
|
4559
|
-
};
|
|
4560
|
-
};
|
|
4561
|
-
|
|
4562
|
-
const getSystemTheme = e => {
|
|
4563
|
-
if (!e) e = window.matchMedia(MEDIA);
|
|
4564
|
-
const isDark = e.matches;
|
|
4565
|
-
const systemTheme = isDark ? "dark" : "light";
|
|
4566
|
-
return systemTheme;
|
|
4567
|
-
};
|
|
4568
|
-
|
|
4569
|
-
const encodeBase64 = str => {
|
|
4570
|
-
return isServer ? Buffer.from(str).toString("base64") : btoa(str);
|
|
4571
|
-
};
|
|
4572
|
-
|
|
4573
|
-
const ONE_HOUR = 3600;
|
|
4574
|
-
const ONE_DAY = 84000;
|
|
4575
|
-
/**
|
|
4576
|
-
* Get site absolute url with the given path
|
|
4577
|
-
*
|
|
4578
|
-
* - It uses the `NEXT_PUBLIC_APP_URL` env variable
|
|
4579
|
-
* - It removes the trailing slashes
|
|
4580
|
-
*/
|
|
4581
|
-
|
|
4582
|
-
function getSiteUrl(path = "") {
|
|
4583
|
-
return normaliseUrl(`${process.env["NEXT_PUBLIC_APP_URL"]}/${path}`);
|
|
4584
|
-
}
|
|
4585
|
-
/**
|
|
4586
|
-
* Utility to load a component with an optional pre-determined delay.
|
|
4587
|
-
*
|
|
4588
|
-
* This was designed to improve anti spam wit async form loading.
|
|
4589
|
-
*
|
|
4590
|
-
* @see https://github.com/vercel/next.js/blob/main/packages/next/next-server/lib/dynamic.tsx
|
|
4591
|
-
* @see https://github.com/vercel/next.js/blob/canary/examples/with-dynamic-import/pages/index.js
|
|
4592
|
-
*/
|
|
4593
|
-
|
|
4594
|
-
function load(component, milliseconds) {
|
|
4595
|
-
return new Promise(resolve => {
|
|
4596
|
-
setTimeout(() => resolve(component), milliseconds);
|
|
4597
|
-
});
|
|
4598
|
-
}
|
|
4599
|
-
|
|
4600
|
-
export { AUTH_ROUTES, AnalyticsGoogle, Favicon, Link, NextImg, NextImgSmart, NextProgress, ONE_DAY, ONE_HOUR, Seo, SeoDefaults, ThemeProvider, api, buildTags, getAuthRoutes, getCallbackUrl, getNextImgProps, getSiteUrl, load, translationAsOptions, useDateFormat, useForm, useLogin, useLoginUrl, useLogout, useLooseT, useSubmit, useT, useTheme };
|