Full Site Editing - Version 3.35311

Version Description

Download this release

Release Info

Developer fullofcaffeine
Plugin Icon wp plugin Full Site Editing
Version 3.35311
Comparing to
See all releases

Code changes from version 3.35292 to 3.35311

block-inserter-modifications/dist/contextual-tips.js ADDED
@@ -0,0 +1,412 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******/ (function() { // webpackBootstrap
2
+ /******/ "use strict";
3
+ /******/ var __webpack_modules__ = ({
4
+
5
+ /***/ 675:
6
+ /***/ (function() {
7
+
8
+ // extracted by mini-css-extract-plugin
9
+
10
+
11
+ /***/ }),
12
+
13
+ /***/ 298:
14
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
15
+
16
+ /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(307);
17
+ /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
18
+ /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(609);
19
+ /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
20
+ /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(333);
21
+ /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__);
22
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(818);
23
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__);
24
+ /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(819);
25
+ /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_4__);
26
+ /* harmony import */ var _list__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(36);
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+ function ContextualTip(_ref) {
35
+ let {
36
+ searchTerm,
37
+ random = false,
38
+ canUserCreate
39
+ } = _ref;
40
+
41
+ if (!searchTerm) {
42
+ return null;
43
+ }
44
+
45
+ if (!_list__WEBPACK_IMPORTED_MODULE_5__/* ["default"].length */ .Z.length) {
46
+ return null;
47
+ }
48
+
49
+ const normalizedSearchTerm = (0,lodash__WEBPACK_IMPORTED_MODULE_4__.deburr)((0,lodash__WEBPACK_IMPORTED_MODULE_4__.lowerCase)(searchTerm)).replace(/^\//, '');
50
+ const foundTips = (0,lodash__WEBPACK_IMPORTED_MODULE_4__.filter)(_list__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, _ref2 => {
51
+ let {
52
+ keywords,
53
+ permission
54
+ } = _ref2;
55
+ return canUserCreate(permission) && (0,lodash__WEBPACK_IMPORTED_MODULE_4__.filter)([...new Set(keywords)], keyword => (0,lodash__WEBPACK_IMPORTED_MODULE_4__.includes)(normalizedSearchTerm, keyword)).length;
56
+ });
57
+
58
+ if (!foundTips.length) {
59
+ return null;
60
+ }
61
+
62
+ const index = random ? Math.floor(Math.random() * foundTips.length) : 0;
63
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
64
+ className: "contextual-tip"
65
+ }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Tip, null, (0,lodash__WEBPACK_IMPORTED_MODULE_4__.get)(foundTips, [index, 'description'])));
66
+ }
67
+
68
+ /* harmony default export */ __webpack_exports__["Z"] = ((0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__.compose)((0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.withSelect)(select => {
69
+ return {
70
+ canUserCreate: type => select('core').canUser('create', type)
71
+ };
72
+ }))(ContextualTip));
73
+
74
+ /***/ }),
75
+
76
+ /***/ 36:
77
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
78
+
79
+ /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(307);
80
+ /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
81
+ /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(736);
82
+ /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
83
+ /* harmony import */ var _tip_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(334);
84
+
85
+
86
+
87
+ const __ = _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__;
88
+
89
+
90
+ function getTipDescription(text, conversion, textFallback) {
91
+ if (typeof _wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createInterpolateElement !== 'undefined') {
92
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createInterpolateElement)(text, conversion);
93
+ }
94
+
95
+ return textFallback;
96
+ }
97
+
98
+ const tips = [{
99
+ context: 'theme',
100
+ keywords: ['theme', __('theme', 'full-site-editing')],
101
+ description: getTipDescription(__('You can visit the <a>theme directory</a> to select a different design for your site.', 'full-site-editing'), {
102
+ a: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_tip_link__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
103
+ section: "themes"
104
+ })
105
+ }, __('You can visit the theme directory to select a different design for your site.', 'full-site-editing')),
106
+ permission: 'settings'
107
+ }, {
108
+ context: 'css',
109
+ keywords: ['css', __('css', 'full-site-editing'), 'style', __('style', 'full-site-editing')],
110
+ description: getTipDescription(__('You can visit the the <a>Customizer</a> to edit the CSS on your site.', 'full-site-editing'), {
111
+ a: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_tip_link__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
112
+ section: "customizer",
113
+ subsection: "custom_css"
114
+ })
115
+ }, __('You can visit the the Customizer to edit the CSS on your site.', 'full-site-editing')),
116
+ permission: 'settings'
117
+ }, {
118
+ context: 'plugin',
119
+ keywords: ['plugin', __('plugin', 'full-site-editing')],
120
+ description: getTipDescription(__('You can visit the <a>plugin directory</a> to get started with installing new plugins.', 'full-site-editing'), {
121
+ a: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_tip_link__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
122
+ section: "plugins"
123
+ })
124
+ }, __('You can visit the plugin directory to get started with installing new plugins.', 'full-site-editing')),
125
+ permission: 'settings'
126
+ }, {
127
+ context: 'header',
128
+ keywords: ['header', __('header', 'full-site-editing')],
129
+ description: getTipDescription(__('You can visit the the <a>Customizer</a> to edit your logo and site title.', 'full-site-editing'), {
130
+ a: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_tip_link__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
131
+ section: "customizer",
132
+ subsection: "title_tagline"
133
+ })
134
+ }, __('You can visit the the Customizer to edit your logo and site title.', 'full-site-editing')),
135
+ permission: 'settings'
136
+ }, {
137
+ context: 'color',
138
+ keywords: ['color', __('color', 'full-site-editing')],
139
+ description: getTipDescription(__('You can visit the the <a>Customizer</a> to edit the colors on your site.', 'full-site-editing'), {
140
+ a: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_tip_link__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
141
+ section: "customizer",
142
+ subsection: "colors"
143
+ })
144
+ }, __('You can visit the the Customizer to edit the colors on your site.', 'full-site-editing')),
145
+ permission: 'settings'
146
+ }];
147
+ /* harmony default export */ __webpack_exports__["Z"] = (tips);
148
+
149
+ /***/ }),
150
+
151
+ /***/ 334:
152
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
153
+
154
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
155
+ /* harmony export */ "Z": function() { return /* export default binding */ __WEBPACK_DEFAULT_EXPORT__; }
156
+ /* harmony export */ });
157
+ /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(307);
158
+ /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
159
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(818);
160
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__);
161
+ /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(365);
162
+
163
+
164
+
165
+ const isEditorIFramed = (0,_utils__WEBPACK_IMPORTED_MODULE_2__/* .inIframe */ .y)();
166
+ /* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(_ref) {
167
+ let {
168
+ section,
169
+ children,
170
+ subsection
171
+ } = _ref;
172
+ const {
173
+ hostname
174
+ } = window.location;
175
+ const editorSelector = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.select)('core/editor');
176
+ const postId = editorSelector.getCurrentPostId();
177
+ const postType = editorSelector.getCurrentPostType();
178
+ const returnLink = isEditorIFramed && !_utils__WEBPACK_IMPORTED_MODULE_2__/* .isSimpleSite */ .W ? '&' + encodeURIComponent(`return=https://wordpress.com/${postType}/${hostname}/${postId}`) : '';
179
+ const autofocus = `autofocus[section]=${subsection}`;
180
+ let href = '#';
181
+
182
+ switch (section) {
183
+ case 'themes':
184
+ href = isEditorIFramed ? `https://wordpress.com/themes/${hostname}` : './themes.php';
185
+ break;
186
+
187
+ case 'plugins':
188
+ href = isEditorIFramed || _utils__WEBPACK_IMPORTED_MODULE_2__/* .isSimpleSite */ .W ? `https://wordpress.com/plugins/${hostname}` : './plugin-install.php';
189
+ break;
190
+
191
+ case 'customizer':
192
+ href = isEditorIFramed && _utils__WEBPACK_IMPORTED_MODULE_2__/* .isSimpleSite */ .W ? `https://wordpress.com/customize/${hostname}?${autofocus}` : `./customize.php?${autofocus}${returnLink}`;
193
+ break;
194
+ }
195
+
196
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("a", {
197
+ href: href,
198
+ target: "_blank",
199
+ rel: "noreferrer noopener"
200
+ }, children);
201
+ }
202
+
203
+ /***/ }),
204
+
205
+ /***/ 365:
206
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
207
+
208
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
209
+ /* harmony export */ "y": function() { return /* binding */ inIframe; },
210
+ /* harmony export */ "W": function() { return /* binding */ isSimpleSite; }
211
+ /* harmony export */ });
212
+ /**
213
+ * Detect if the editor is already iFramed.
214
+ *
215
+ * @returns {boolean} `True` is the editor is iFramed. Otherwise, `False`.
216
+ */
217
+ const inIframe = () => {
218
+ try {
219
+ return window.self !== window.top;
220
+ } catch (e) {
221
+ return true;
222
+ }
223
+ };
224
+ const isSimpleSite = !!(window && window._currentSiteType && window._currentSiteType === 'simple');
225
+
226
+ /***/ }),
227
+
228
+ /***/ 819:
229
+ /***/ (function(module) {
230
+
231
+ module.exports = window["lodash"];
232
+
233
+ /***/ }),
234
+
235
+ /***/ 175:
236
+ /***/ (function(module) {
237
+
238
+ module.exports = window["wp"]["blockEditor"];
239
+
240
+ /***/ }),
241
+
242
+ /***/ 609:
243
+ /***/ (function(module) {
244
+
245
+ module.exports = window["wp"]["components"];
246
+
247
+ /***/ }),
248
+
249
+ /***/ 333:
250
+ /***/ (function(module) {
251
+
252
+ module.exports = window["wp"]["compose"];
253
+
254
+ /***/ }),
255
+
256
+ /***/ 818:
257
+ /***/ (function(module) {
258
+
259
+ module.exports = window["wp"]["data"];
260
+
261
+ /***/ }),
262
+
263
+ /***/ 307:
264
+ /***/ (function(module) {
265
+
266
+ module.exports = window["wp"]["element"];
267
+
268
+ /***/ }),
269
+
270
+ /***/ 736:
271
+ /***/ (function(module) {
272
+
273
+ module.exports = window["wp"]["i18n"];
274
+
275
+ /***/ }),
276
+
277
+ /***/ 817:
278
+ /***/ (function(module) {
279
+
280
+ module.exports = window["wp"]["plugins"];
281
+
282
+ /***/ })
283
+
284
+ /******/ });
285
+ /************************************************************************/
286
+ /******/ // The module cache
287
+ /******/ var __webpack_module_cache__ = {};
288
+ /******/
289
+ /******/ // The require function
290
+ /******/ function __webpack_require__(moduleId) {
291
+ /******/ // Check if module is in cache
292
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
293
+ /******/ if (cachedModule !== undefined) {
294
+ /******/ return cachedModule.exports;
295
+ /******/ }
296
+ /******/ // Create a new module (and put it into the cache)
297
+ /******/ var module = __webpack_module_cache__[moduleId] = {
298
+ /******/ // no module.id needed
299
+ /******/ // no module.loaded needed
300
+ /******/ exports: {}
301
+ /******/ };
302
+ /******/
303
+ /******/ // Execute the module function
304
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
305
+ /******/
306
+ /******/ // Return the exports of the module
307
+ /******/ return module.exports;
308
+ /******/ }
309
+ /******/
310
+ /************************************************************************/
311
+ /******/ /* webpack/runtime/compat get default export */
312
+ /******/ !function() {
313
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
314
+ /******/ __webpack_require__.n = function(module) {
315
+ /******/ var getter = module && module.__esModule ?
316
+ /******/ function() { return module['default']; } :
317
+ /******/ function() { return module; };
318
+ /******/ __webpack_require__.d(getter, { a: getter });
319
+ /******/ return getter;
320
+ /******/ };
321
+ /******/ }();
322
+ /******/
323
+ /******/ /* webpack/runtime/define property getters */
324
+ /******/ !function() {
325
+ /******/ // define getter functions for harmony exports
326
+ /******/ __webpack_require__.d = function(exports, definition) {
327
+ /******/ for(var key in definition) {
328
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
329
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
330
+ /******/ }
331
+ /******/ }
332
+ /******/ };
333
+ /******/ }();
334
+ /******/
335
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
336
+ /******/ !function() {
337
+ /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
338
+ /******/ }();
339
+ /******/
340
+ /******/ /* webpack/runtime/make namespace object */
341
+ /******/ !function() {
342
+ /******/ // define __esModule on exports
343
+ /******/ __webpack_require__.r = function(exports) {
344
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
345
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
346
+ /******/ }
347
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
348
+ /******/ };
349
+ /******/ }();
350
+ /******/
351
+ /************************************************************************/
352
+ var __webpack_exports__ = {};
353
+ // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
354
+ !function() {
355
+ __webpack_require__.r(__webpack_exports__);
356
+ /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(307);
357
+ /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
358
+ /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(175);
359
+ /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
360
+ /* harmony import */ var _wordpress_plugins__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(817);
361
+ /* harmony import */ var _wordpress_plugins__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_plugins__WEBPACK_IMPORTED_MODULE_2__);
362
+ /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(819);
363
+ /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__);
364
+ /* harmony import */ var _contextual_tips_contextual_tip__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(298);
365
+ /* harmony import */ var _contextual_tips_style_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(675);
366
+
367
+
368
+
369
+
370
+
371
+
372
+ // InserterMenuExtension has been made unstable in this PR: https://github.com/WordPress/gutenberg/pull/31417 / Gutenberg v10.7.0-rc.1.
373
+ // We need to support both symbols until we're sure Gutenberg < v10.7.x is not used anymore in WPCOM.
374
+
375
+ const InserterMenuExtension = typeof _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.__unstableInserterMenuExtension !== 'undefined' ? _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.__unstableInserterMenuExtension : _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.__experimentalInserterMenuExtension;
376
+
377
+ const ContextualTips = function () {
378
+ const [debouncedFilterValue, setFilterValue] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)('');
379
+ const debouncedSetFilterValue = (0,lodash__WEBPACK_IMPORTED_MODULE_3__.debounce)(setFilterValue, 400);
380
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(InserterMenuExtension, null, _ref => {
381
+ let {
382
+ filterValue,
383
+ hasItems
384
+ } = _ref;
385
+
386
+ if (hasItems || !filterValue) {
387
+ return null;
388
+ }
389
+
390
+ if (debouncedFilterValue !== filterValue) {
391
+ debouncedSetFilterValue(filterValue);
392
+ }
393
+
394
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_contextual_tips_contextual_tip__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
395
+ searchTerm: filterValue
396
+ });
397
+ });
398
+ }; // Check if the experimental slot is available before to register plugin.
399
+
400
+
401
+ if (typeof InserterMenuExtension !== 'undefined') {
402
+ (0,_wordpress_plugins__WEBPACK_IMPORTED_MODULE_2__.registerPlugin)('block-inserter-contextual-tips', {
403
+ render() {
404
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(ContextualTips, null);
405
+ }
406
+
407
+ });
408
+ }
409
+ }();
410
+ window.EditingToolkit = __webpack_exports__;
411
+ /******/ })()
412
+ ;
build_meta.txt CHANGED
@@ -1,3 +1,3 @@
1
- commit_hash=0079d37c4c3432f707b9014eba737db67452e102
2
- commit_url=https://github.com/Automattic/wp-calypso/commit/0079d37c4c3432f707b9014eba737db67452e102
3
- build_number=3.35292
1
+ commit_hash=bc4594355c8d5563382b1a4e4e69af35e6679530
2
+ commit_url=https://github.com/Automattic/wp-calypso/commit/bc4594355c8d5563382b1a4e4e69af35e6679530
3
+ build_number=3.35311
common/dist/common.js ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******/ (function() { // webpackBootstrap
2
+ /******/ "use strict";
3
+ /******/ var __webpack_modules__ = ({
4
+
5
+ /***/ 9675:
6
+ /***/ (function() {
7
+
8
+ // extracted by mini-css-extract-plugin
9
+
10
+
11
+ /***/ })
12
+
13
+ /******/ });
14
+ /************************************************************************/
15
+ /******/ // The module cache
16
+ /******/ var __webpack_module_cache__ = {};
17
+ /******/
18
+ /******/ // The require function
19
+ /******/ function __webpack_require__(moduleId) {
20
+ /******/ // Check if module is in cache
21
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
22
+ /******/ if (cachedModule !== undefined) {
23
+ /******/ return cachedModule.exports;
24
+ /******/ }
25
+ /******/ // Create a new module (and put it into the cache)
26
+ /******/ var module = __webpack_module_cache__[moduleId] = {
27
+ /******/ // no module.id needed
28
+ /******/ // no module.loaded needed
29
+ /******/ exports: {}
30
+ /******/ };
31
+ /******/
32
+ /******/ // Execute the module function
33
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
34
+ /******/
35
+ /******/ // Return the exports of the module
36
+ /******/ return module.exports;
37
+ /******/ }
38
+ /******/
39
+ /************************************************************************/
40
+ /******/ /* webpack/runtime/make namespace object */
41
+ /******/ !function() {
42
+ /******/ // define __esModule on exports
43
+ /******/ __webpack_require__.r = function(exports) {
44
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
45
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
46
+ /******/ }
47
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
48
+ /******/ };
49
+ /******/ }();
50
+ /******/
51
+ /************************************************************************/
52
+ var __webpack_exports__ = {};
53
+ // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
54
+ !function() {
55
+ __webpack_require__.r(__webpack_exports__);
56
+ /* harmony import */ var _index_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9675);
57
+
58
+ }();
59
+ window.EditingToolkit = __webpack_exports__;
60
+ /******/ })()
61
+ ;
common/dist/data-stores.js ADDED
@@ -0,0 +1,17600 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******/ (function() { // webpackBootstrap
2
+ /******/ var __webpack_modules__ = ({
3
+
4
+ /***/ 7266:
5
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6
+
7
+ "use strict";
8
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9
+ /* harmony export */ "Z": function() { return /* binding */ compile; }
10
+ /* harmony export */ });
11
+ /* harmony import */ var _tannin_postfix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5854);
12
+ /* harmony import */ var _tannin_evaluate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(730);
13
+
14
+
15
+
16
+ /**
17
+ * Given a C expression, returns a function which can be called to evaluate its
18
+ * result.
19
+ *
20
+ * @example
21
+ *
22
+ * ```js
23
+ * import compile from '@tannin/compile';
24
+ *
25
+ * const evaluate = compile( 'n > 1' );
26
+ *
27
+ * evaluate( { n: 2 } );
28
+ * // ⇒ true
29
+ * ```
30
+ *
31
+ * @param {string} expression C expression.
32
+ *
33
+ * @return {(variables?:{[variable:string]:*})=>*} Compiled evaluator.
34
+ */
35
+ function compile( expression ) {
36
+ var terms = (0,_tannin_postfix__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)( expression );
37
+
38
+ return function( variables ) {
39
+ return (0,_tannin_evaluate__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)( terms, variables );
40
+ };
41
+ }
42
+
43
+
44
+ /***/ }),
45
+
46
+ /***/ 730:
47
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
48
+
49
+ "use strict";
50
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
51
+ /* harmony export */ "Z": function() { return /* binding */ evaluate; }
52
+ /* harmony export */ });
53
+ /**
54
+ * Operator callback functions.
55
+ *
56
+ * @type {Object}
57
+ */
58
+ var OPERATORS = {
59
+ '!': function( a ) {
60
+ return ! a;
61
+ },
62
+ '*': function( a, b ) {
63
+ return a * b;
64
+ },
65
+ '/': function( a, b ) {
66
+ return a / b;
67
+ },
68
+ '%': function( a, b ) {
69
+ return a % b;
70
+ },
71
+ '+': function( a, b ) {
72
+ return a + b;
73
+ },
74
+ '-': function( a, b ) {
75
+ return a - b;
76
+ },
77
+ '<': function( a, b ) {
78
+ return a < b;
79
+ },
80
+ '<=': function( a, b ) {
81
+ return a <= b;
82
+ },
83
+ '>': function( a, b ) {
84
+ return a > b;
85
+ },
86
+ '>=': function( a, b ) {
87
+ return a >= b;
88
+ },
89
+ '==': function( a, b ) {
90
+ return a === b;
91
+ },
92
+ '!=': function( a, b ) {
93
+ return a !== b;
94
+ },
95
+ '&&': function( a, b ) {
96
+ return a && b;
97
+ },
98
+ '||': function( a, b ) {
99
+ return a || b;
100
+ },
101
+ '?:': function( a, b, c ) {
102
+ if ( a ) {
103
+ throw b;
104
+ }
105
+
106
+ return c;
107
+ },
108
+ };
109
+
110
+ /**
111
+ * Given an array of postfix terms and operand variables, returns the result of
112
+ * the postfix evaluation.
113
+ *
114
+ * @example
115
+ *
116
+ * ```js
117
+ * import evaluate from '@tannin/evaluate';
118
+ *
119
+ * // 3 + 4 * 5 / 6 ⇒ '3 4 5 * 6 / +'
120
+ * const terms = [ '3', '4', '5', '*', '6', '/', '+' ];
121
+ *
122
+ * evaluate( terms, {} );
123
+ * // ⇒ 6.333333333333334
124
+ * ```
125
+ *
126
+ * @param {string[]} postfix Postfix terms.
127
+ * @param {Object} variables Operand variables.
128
+ *
129
+ * @return {*} Result of evaluation.
130
+ */
131
+ function evaluate( postfix, variables ) {
132
+ var stack = [],
133
+ i, j, args, getOperatorResult, term, value;
134
+
135
+ for ( i = 0; i < postfix.length; i++ ) {
136
+ term = postfix[ i ];
137
+
138
+ getOperatorResult = OPERATORS[ term ];
139
+ if ( getOperatorResult ) {
140
+ // Pop from stack by number of function arguments.
141
+ j = getOperatorResult.length;
142
+ args = Array( j );
143
+ while ( j-- ) {
144
+ args[ j ] = stack.pop();
145
+ }
146
+
147
+ try {
148
+ value = getOperatorResult.apply( null, args );
149
+ } catch ( earlyReturn ) {
150
+ return earlyReturn;
151
+ }
152
+ } else if ( variables.hasOwnProperty( term ) ) {
153
+ value = variables[ term ];
154
+ } else {
155
+ value = +term;
156
+ }
157
+
158
+ stack.push( value );
159
+ }
160
+
161
+ return stack[ 0 ];
162
+ }
163
+
164
+
165
+ /***/ }),
166
+
167
+ /***/ 1184:
168
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
169
+
170
+ "use strict";
171
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
172
+ /* harmony export */ "Z": function() { return /* binding */ pluralForms; }
173
+ /* harmony export */ });
174
+ /* harmony import */ var _tannin_compile__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7266);
175
+
176
+
177
+ /**
178
+ * Given a C expression, returns a function which, when called with a value,
179
+ * evaluates the result with the value assumed to be the "n" variable of the
180
+ * expression. The result will be coerced to its numeric equivalent.
181
+ *
182
+ * @param {string} expression C expression.
183
+ *
184
+ * @return {Function} Evaluator function.
185
+ */
186
+ function pluralForms( expression ) {
187
+ var evaluate = (0,_tannin_compile__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)( expression );
188
+
189
+ return function( n ) {
190
+ return +evaluate( { n: n } );
191
+ };
192
+ }
193
+
194
+
195
+ /***/ }),
196
+
197
+ /***/ 5854:
198
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
199
+
200
+ "use strict";
201
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
202
+ /* harmony export */ "Z": function() { return /* binding */ postfix; }
203
+ /* harmony export */ });
204
+ var PRECEDENCE, OPENERS, TERMINATORS, PATTERN;
205
+
206
+ /**
207
+ * Operator precedence mapping.
208
+ *
209
+ * @type {Object}
210
+ */
211
+ PRECEDENCE = {
212
+ '(': 9,
213
+ '!': 8,
214
+ '*': 7,
215
+ '/': 7,
216
+ '%': 7,
217
+ '+': 6,
218
+ '-': 6,
219
+ '<': 5,
220
+ '<=': 5,
221
+ '>': 5,
222
+ '>=': 5,
223
+ '==': 4,
224
+ '!=': 4,
225
+ '&&': 3,
226
+ '||': 2,
227
+ '?': 1,
228
+ '?:': 1,
229
+ };
230
+
231
+ /**
232
+ * Characters which signal pair opening, to be terminated by terminators.
233
+ *
234
+ * @type {string[]}
235
+ */
236
+ OPENERS = [ '(', '?' ];
237
+
238
+ /**
239
+ * Characters which signal pair termination, the value an array with the
240
+ * opener as its first member. The second member is an optional operator
241
+ * replacement to push to the stack.
242
+ *
243
+ * @type {string[]}
244
+ */
245
+ TERMINATORS = {
246
+ ')': [ '(' ],
247
+ ':': [ '?', '?:' ],
248
+ };
249
+
250
+ /**
251
+ * Pattern matching operators and openers.
252
+ *
253
+ * @type {RegExp}
254
+ */
255
+ PATTERN = /<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;
256
+
257
+ /**
258
+ * Given a C expression, returns the equivalent postfix (Reverse Polish)
259
+ * notation terms as an array.
260
+ *
261
+ * If a postfix string is desired, simply `.join( ' ' )` the result.
262
+ *
263
+ * @example
264
+ *
265
+ * ```js
266
+ * import postfix from '@tannin/postfix';
267
+ *
268
+ * postfix( 'n > 1' );
269
+ * // ⇒ [ 'n', '1', '>' ]
270
+ * ```
271
+ *
272
+ * @param {string} expression C expression.
273
+ *
274
+ * @return {string[]} Postfix terms.
275
+ */
276
+ function postfix( expression ) {
277
+ var terms = [],
278
+ stack = [],
279
+ match, operator, term, element;
280
+
281
+ while ( ( match = expression.match( PATTERN ) ) ) {
282
+ operator = match[ 0 ];
283
+
284
+ // Term is the string preceding the operator match. It may contain
285
+ // whitespace, and may be empty (if operator is at beginning).
286
+ term = expression.substr( 0, match.index ).trim();
287
+ if ( term ) {
288
+ terms.push( term );
289
+ }
290
+
291
+ while ( ( element = stack.pop() ) ) {
292
+ if ( TERMINATORS[ operator ] ) {
293
+ if ( TERMINATORS[ operator ][ 0 ] === element ) {
294
+ // Substitution works here under assumption that because
295
+ // the assigned operator will no longer be a terminator, it
296
+ // will be pushed to the stack during the condition below.
297
+ operator = TERMINATORS[ operator ][ 1 ] || operator;
298
+ break;
299
+ }
300
+ } else if ( OPENERS.indexOf( element ) >= 0 || PRECEDENCE[ element ] < PRECEDENCE[ operator ] ) {
301
+ // Push to stack if either an opener or when pop reveals an
302
+ // element of lower precedence.
303
+ stack.push( element );
304
+ break;
305
+ }
306
+
307
+ // For each popped from stack, push to terms.
308
+ terms.push( element );
309
+ }
310
+
311
+ if ( ! TERMINATORS[ operator ] ) {
312
+ stack.push( operator );
313
+ }
314
+
315
+ // Slice matched fragment from expression to continue match.
316
+ expression = expression.substr( match.index + operator.length );
317
+ }
318
+
319
+ // Push remainder of operand, if exists, to terms.
320
+ expression = expression.trim();
321
+ if ( expression ) {
322
+ terms.push( expression );
323
+ }
324
+
325
+ // Pop remaining items from stack into terms.
326
+ return terms.concat( stack.reverse() );
327
+ }
328
+
329
+
330
+ /***/ }),
331
+
332
+ /***/ 6668:
333
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
334
+
335
+ "use strict";
336
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
337
+ /* harmony export */ "Z": function() { return /* binding */ sprintf; }
338
+ /* harmony export */ });
339
+ /**
340
+ * Regular expression matching format placeholder syntax.
341
+ *
342
+ * The pattern for matching named arguments is a naive and incomplete matcher
343
+ * against valid JavaScript identifier names.
344
+ *
345
+ * via Mathias Bynens:
346
+ *
347
+ * >An identifier must start with $, _, or any character in the Unicode
348
+ * >categories “Uppercase letter (Lu)”, “Lowercase letter (Ll)”, “Titlecase
349
+ * >letter (Lt)”, “Modifier letter (Lm)”, “Other letter (Lo)”, or “Letter
350
+ * >number (Nl)”.
351
+ * >
352
+ * >The rest of the string can contain the same characters, plus any U+200C zero
353
+ * >width non-joiner characters, U+200D zero width joiner characters, and
354
+ * >characters in the Unicode categories “Non-spacing mark (Mn)”, “Spacing
355
+ * >combining mark (Mc)”, “Decimal digit number (Nd)”, or “Connector
356
+ * >punctuation (Pc)”.
357
+ *
358
+ * If browser support is constrained to those supporting ES2015, this could be
359
+ * made more accurate using the `u` flag:
360
+ *
361
+ * ```
362
+ * /^[$_\p{L}\p{Nl}][$_\p{L}\p{Nl}\u200C\u200D\p{Mn}\p{Mc}\p{Nd}\p{Pc}]*$/u;
363
+ * ```
364
+ *
365
+ * @see http://www.pixelbeat.org/programming/gcc/format_specs.html
366
+ * @see https://mathiasbynens.be/notes/javascript-identifiers#valid-identifier-names
367
+ *
368
+ * @type {RegExp}
369
+ */
370
+ var PATTERN = /%(((\d+)\$)|(\(([$_a-zA-Z][$_a-zA-Z0-9]*)\)))?[ +0#-]*\d*(\.(\d+|\*))?(ll|[lhqL])?([cduxXefgsp%])/g;
371
+ // ▲ ▲ ▲ ▲ ▲ ▲ ▲ type
372
+ // │ │ │ │ │ └ Length (unsupported)
373
+ // │ │ │ │ └ Precision / max width
374
+ // │ │ │ └ Min width (unsupported)
375
+ // │ │ └ Flags (unsupported)
376
+ // └ Index └ Name (for named arguments)
377
+
378
+ /**
379
+ * Given a format string, returns string with arguments interpolatation.
380
+ * Arguments can either be provided directly via function arguments spread, or
381
+ * with an array as the second argument.
382
+ *
383
+ * @see https://en.wikipedia.org/wiki/Printf_format_string
384
+ *
385
+ * @example
386
+ *
387
+ * ```js
388
+ * import sprintf from '@tannin/sprintf';
389
+ *
390
+ * sprintf( 'Hello %s!', 'world' );
391
+ * // ⇒ 'Hello world!'
392
+ * ```
393
+ *
394
+ * @param {string} string printf format string
395
+ * @param {Array} [args] String arguments.
396
+ *
397
+ * @return {string} Formatted string.
398
+ */
399
+ function sprintf( string, args ) {
400
+ var i;
401
+
402
+ if ( ! Array.isArray( args ) ) {
403
+ // Construct a copy of arguments from index one, used for replace
404
+ // function placeholder substitution.
405
+ args = new Array( arguments.length - 1 );
406
+ for ( i = 1; i < arguments.length; i++ ) {
407
+ args[ i - 1 ] = arguments[ i ];
408
+ }
409
+ }
410
+
411
+ i = 1;
412
+
413
+ return string.replace( PATTERN, function() {
414
+ var index, name, precision, type, value;
415
+
416
+ index = arguments[ 3 ];
417
+ name = arguments[ 5 ];
418
+ precision = arguments[ 7 ];
419
+ type = arguments[ 9 ];
420
+
421
+ // There's no placeholder substitution in the explicit "%", meaning it
422
+ // is not necessary to increment argument index.
423
+ if ( type === '%' ) {
424
+ return '%';
425
+ }
426
+
427
+ // Asterisk precision determined by peeking / shifting next argument.
428
+ if ( precision === '*' ) {
429
+ precision = args[ i - 1 ];
430
+ i++;
431
+ }
432
+
433
+ if ( name !== undefined ) {
434
+ // If it's a named argument, use name.
435
+ if ( args[ 0 ] && typeof args[ 0 ] === 'object' &&
436
+ args[ 0 ].hasOwnProperty( name ) ) {
437
+ value = args[ 0 ][ name ];
438
+ }
439
+ } else {
440
+ // If not a positional argument, use counter value.
441
+ if ( index === undefined ) {
442
+ index = i;
443
+ }
444
+
445
+ i++;
446
+
447
+ // Positional argument.
448
+ value = args[ index - 1 ];
449
+ }
450
+
451
+ // Parse as type.
452
+ if ( type === 'f' ) {
453
+ value = parseFloat( value ) || 0;
454
+ } else if ( type === 'd' ) {
455
+ value = parseInt( value ) || 0;
456
+ }
457
+
458
+ // Apply precision.
459
+ if ( precision !== undefined ) {
460
+ if ( type === 'f' ) {
461
+ value = value.toFixed( precision );
462
+ } else if ( type === 's' ) {
463
+ value = value.substr( 0, precision );
464
+ }
465
+ }
466
+
467
+ // To avoid "undefined" concatenation, return empty string if no
468
+ // placeholder substitution can be performed.
469
+ return value !== undefined && value !== null ? value : '';
470
+ } );
471
+ }
472
+
473
+
474
+ /***/ }),
475
+
476
+ /***/ 6744:
477
+ /***/ (function(module) {
478
+
479
+ module.exports = {
480
+ "100": "Continue",
481
+ "101": "Switching Protocols",
482
+ "102": "Processing",
483
+ "200": "OK",
484
+ "201": "Created",
485
+ "202": "Accepted",
486
+ "203": "Non-Authoritative Information",
487
+ "204": "No Content",
488
+ "205": "Reset Content",
489
+ "206": "Partial Content",
490
+ "207": "Multi-Status",
491
+ "208": "Already Reported",
492
+ "226": "IM Used",
493
+ "300": "Multiple Choices",
494
+ "301": "Moved Permanently",
495
+ "302": "Found",
496
+ "303": "See Other",
497
+ "304": "Not Modified",
498
+ "305": "Use Proxy",
499
+ "307": "Temporary Redirect",
500
+ "308": "Permanent Redirect",
501
+ "400": "Bad Request",
502
+ "401": "Unauthorized",
503
+ "402": "Payment Required",
504
+ "403": "Forbidden",
505
+ "404": "Not Found",
506
+ "405": "Method Not Allowed",
507
+ "406": "Not Acceptable",
508
+ "407": "Proxy Authentication Required",
509
+ "408": "Request Timeout",
510
+ "409": "Conflict",
511
+ "410": "Gone",
512
+ "411": "Length Required",
513
+ "412": "Precondition Failed",
514
+ "413": "Payload Too Large",
515
+ "414": "URI Too Long",
516
+ "415": "Unsupported Media Type",
517
+ "416": "Range Not Satisfiable",
518
+ "417": "Expectation Failed",
519
+ "418": "I'm a teapot",
520
+ "421": "Misdirected Request",
521
+ "422": "Unprocessable Entity",
522
+ "423": "Locked",
523
+ "424": "Failed Dependency",
524
+ "425": "Unordered Collection",
525
+ "426": "Upgrade Required",
526
+ "428": "Precondition Required",
527
+ "429": "Too Many Requests",
528
+ "431": "Request Header Fields Too Large",
529
+ "500": "Internal Server Error",
530
+ "501": "Not Implemented",
531
+ "502": "Bad Gateway",
532
+ "503": "Service Unavailable",
533
+ "504": "Gateway Timeout",
534
+ "505": "HTTP Version Not Supported",
535
+ "506": "Variant Also Negotiates",
536
+ "507": "Insufficient Storage",
537
+ "508": "Loop Detected",
538
+ "509": "Bandwidth Limit Exceeded",
539
+ "510": "Not Extended",
540
+ "511": "Network Authentication Required"
541
+ }
542
+
543
+
544
+ /***/ }),
545
+
546
+ /***/ 2680:
547
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
548
+
549
+ "use strict";
550
+
551
+
552
+ var GetIntrinsic = __webpack_require__(7286);
553
+
554
+ var callBind = __webpack_require__(9429);
555
+
556
+ var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));
557
+
558
+ module.exports = function callBoundIntrinsic(name, allowMissing) {
559
+ var intrinsic = GetIntrinsic(name, !!allowMissing);
560
+ if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
561
+ return callBind(intrinsic);
562
+ }
563
+ return intrinsic;
564
+ };
565
+
566
+
567
+ /***/ }),
568
+
569
+ /***/ 9429:
570
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
571
+
572
+ "use strict";
573
+
574
+
575
+ var bind = __webpack_require__(4090);
576
+ var GetIntrinsic = __webpack_require__(7286);
577
+
578
+ var $apply = GetIntrinsic('%Function.prototype.apply%');
579
+ var $call = GetIntrinsic('%Function.prototype.call%');
580
+ var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
581
+
582
+ var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
583
+ var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
584
+ var $max = GetIntrinsic('%Math.max%');
585
+
586
+ if ($defineProperty) {
587
+ try {
588
+ $defineProperty({}, 'a', { value: 1 });
589
+ } catch (e) {
590
+ // IE 8 has a broken defineProperty
591
+ $defineProperty = null;
592
+ }
593
+ }
594
+
595
+ module.exports = function callBind(originalFunction) {
596
+ var func = $reflectApply(bind, $call, arguments);
597
+ if ($gOPD && $defineProperty) {
598
+ var desc = $gOPD(func, 'length');
599
+ if (desc.configurable) {
600
+ // original length, plus the receiver, minus any additional arguments (after the receiver)
601
+ $defineProperty(
602
+ func,
603
+ 'length',
604
+ { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
605
+ );
606
+ }
607
+ }
608
+ return func;
609
+ };
610
+
611
+ var applyBind = function applyBind() {
612
+ return $reflectApply(bind, $apply, arguments);
613
+ };
614
+
615
+ if ($defineProperty) {
616
+ $defineProperty(module.exports, 'apply', { value: applyBind });
617
+ } else {
618
+ module.exports.apply = applyBind;
619
+ }
620
+
621
+
622
+ /***/ }),
623
+
624
+ /***/ 5881:
625
+ /***/ (function(module) {
626
+
627
+ /**
628
+ * Helpers.
629
+ */
630
+
631
+ var s = 1000;
632
+ var m = s * 60;
633
+ var h = m * 60;
634
+ var d = h * 24;
635
+ var w = d * 7;
636
+ var y = d * 365.25;
637
+
638
+ /**
639
+ * Parse or format the given `val`.
640
+ *
641
+ * Options:
642
+ *
643
+ * - `long` verbose formatting [false]
644
+ *
645
+ * @param {String|Number} val
646
+ * @param {Object} [options]
647
+ * @throws {Error} throw an error if val is not a non-empty string or a number
648
+ * @return {String|Number}
649
+ * @api public
650
+ */
651
+
652
+ module.exports = function(val, options) {
653
+ options = options || {};
654
+ var type = typeof val;
655
+ if (type === 'string' && val.length > 0) {
656
+ return parse(val);
657
+ } else if (type === 'number' && isFinite(val)) {
658
+ return options.long ? fmtLong(val) : fmtShort(val);
659
+ }
660
+ throw new Error(
661
+ 'val is not a non-empty string or a valid number. val=' +
662
+ JSON.stringify(val)
663
+ );
664
+ };
665
+
666
+ /**
667
+ * Parse the given `str` and return milliseconds.
668
+ *
669
+ * @param {String} str
670
+ * @return {Number}
671
+ * @api private
672
+ */
673
+
674
+ function parse(str) {
675
+ str = String(str);
676
+ if (str.length > 100) {
677
+ return;
678
+ }
679
+ var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
680
+ str
681
+ );
682
+ if (!match) {
683
+ return;
684
+ }
685
+ var n = parseFloat(match[1]);
686
+ var type = (match[2] || 'ms').toLowerCase();
687
+ switch (type) {
688
+ case 'years':
689
+ case 'year':
690
+ case 'yrs':
691
+ case 'yr':
692
+ case 'y':
693
+ return n * y;
694
+ case 'weeks':
695
+ case 'week':
696
+ case 'w':
697
+ return n * w;
698
+ case 'days':
699
+ case 'day':
700
+ case 'd':
701
+ return n * d;
702
+ case 'hours':
703
+ case 'hour':
704
+ case 'hrs':
705
+ case 'hr':
706
+ case 'h':
707
+ return n * h;
708
+ case 'minutes':
709
+ case 'minute':
710
+ case 'mins':
711
+ case 'min':
712
+ case 'm':
713
+ return n * m;
714
+ case 'seconds':
715
+ case 'second':
716
+ case 'secs':
717
+ case 'sec':
718
+ case 's':
719
+ return n * s;
720
+ case 'milliseconds':
721
+ case 'millisecond':
722
+ case 'msecs':
723
+ case 'msec':
724
+ case 'ms':
725
+ return n;
726
+ default:
727
+ return undefined;
728
+ }
729
+ }
730
+
731
+ /**
732
+ * Short format for `ms`.
733
+ *
734
+ * @param {Number} ms
735
+ * @return {String}
736
+ * @api private
737
+ */
738
+
739
+ function fmtShort(ms) {
740
+ var msAbs = Math.abs(ms);
741
+ if (msAbs >= d) {
742
+ return Math.round(ms / d) + 'd';
743
+ }
744
+ if (msAbs >= h) {
745
+ return Math.round(ms / h) + 'h';
746
+ }
747
+ if (msAbs >= m) {
748
+ return Math.round(ms / m) + 'm';
749
+ }
750
+ if (msAbs >= s) {
751
+ return Math.round(ms / s) + 's';
752
+ }
753
+ return ms + 'ms';
754
+ }
755
+
756
+ /**
757
+ * Long format for `ms`.
758
+ *
759
+ * @param {Number} ms
760
+ * @return {String}
761
+ * @api private
762
+ */
763
+
764
+ function fmtLong(ms) {
765
+ var msAbs = Math.abs(ms);
766
+ if (msAbs >= d) {
767
+ return plural(ms, msAbs, d, 'day');
768
+ }
769
+ if (msAbs >= h) {
770
+ return plural(ms, msAbs, h, 'hour');
771
+ }
772
+ if (msAbs >= m) {
773
+ return plural(ms, msAbs, m, 'minute');
774
+ }
775
+ if (msAbs >= s) {
776
+ return plural(ms, msAbs, s, 'second');
777
+ }
778
+ return ms + ' ms';
779
+ }
780
+
781
+ /**
782
+ * Pluralization helper.
783
+ */
784
+
785
+ function plural(ms, msAbs, n, name) {
786
+ var isPlural = msAbs >= n * 1.5;
787
+ return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
788
+ }
789
+
790
+
791
+ /***/ }),
792
+
793
+ /***/ 2699:
794
+ /***/ (function(module) {
795
+
796
+ "use strict";
797
+ // Copyright Joyent, Inc. and other Node contributors.
798
+ //
799
+ // Permission is hereby granted, free of charge, to any person obtaining a
800
+ // copy of this software and associated documentation files (the
801
+ // "Software"), to deal in the Software without restriction, including
802
+ // without limitation the rights to use, copy, modify, merge, publish,
803
+ // distribute, sublicense, and/or sell copies of the Software, and to permit
804
+ // persons to whom the Software is furnished to do so, subject to the
805
+ // following conditions:
806
+ //
807
+ // The above copyright notice and this permission notice shall be included
808
+ // in all copies or substantial portions of the Software.
809
+ //
810
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
811
+ // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
812
+ // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
813
+ // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
814
+ // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
815
+ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
816
+ // USE OR OTHER DEALINGS IN THE SOFTWARE.
817
+
818
+
819
+
820
+ var R = typeof Reflect === 'object' ? Reflect : null
821
+ var ReflectApply = R && typeof R.apply === 'function'
822
+ ? R.apply
823
+ : function ReflectApply(target, receiver, args) {
824
+ return Function.prototype.apply.call(target, receiver, args);
825
+ }
826
+
827
+ var ReflectOwnKeys
828
+ if (R && typeof R.ownKeys === 'function') {
829
+ ReflectOwnKeys = R.ownKeys
830
+ } else if (Object.getOwnPropertySymbols) {
831
+ ReflectOwnKeys = function ReflectOwnKeys(target) {
832
+ return Object.getOwnPropertyNames(target)
833
+ .concat(Object.getOwnPropertySymbols(target));
834
+ };
835
+ } else {
836
+ ReflectOwnKeys = function ReflectOwnKeys(target) {
837
+ return Object.getOwnPropertyNames(target);
838
+ };
839
+ }
840
+
841
+ function ProcessEmitWarning(warning) {
842
+ if (console && console.warn) console.warn(warning);
843
+ }
844
+
845
+ var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {
846
+ return value !== value;
847
+ }
848
+
849
+ function EventEmitter() {
850
+ EventEmitter.init.call(this);
851
+ }
852
+ module.exports = EventEmitter;
853
+ module.exports.once = once;
854
+
855
+ // Backwards-compat with node 0.10.x
856
+ EventEmitter.EventEmitter = EventEmitter;
857
+
858
+ EventEmitter.prototype._events = undefined;
859
+ EventEmitter.prototype._eventsCount = 0;
860
+ EventEmitter.prototype._maxListeners = undefined;
861
+
862
+ // By default EventEmitters will print a warning if more than 10 listeners are
863
+ // added to it. This is a useful default which helps finding memory leaks.
864
+ var defaultMaxListeners = 10;
865
+
866
+ function checkListener(listener) {
867
+ if (typeof listener !== 'function') {
868
+ throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
869
+ }
870
+ }
871
+
872
+ Object.defineProperty(EventEmitter, 'defaultMaxListeners', {
873
+ enumerable: true,
874
+ get: function() {
875
+ return defaultMaxListeners;
876
+ },
877
+ set: function(arg) {
878
+ if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {
879
+ throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.');
880
+ }
881
+ defaultMaxListeners = arg;
882
+ }
883
+ });
884
+
885
+ EventEmitter.init = function() {
886
+
887
+ if (this._events === undefined ||
888
+ this._events === Object.getPrototypeOf(this)._events) {
889
+ this._events = Object.create(null);
890
+ this._eventsCount = 0;
891
+ }
892
+
893
+ this._maxListeners = this._maxListeners || undefined;
894
+ };
895
+
896
+ // Obviously not all Emitters should be limited to 10. This function allows
897
+ // that to be increased. Set to zero for unlimited.
898
+ EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
899
+ if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {
900
+ throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.');
901
+ }
902
+ this._maxListeners = n;
903
+ return this;
904
+ };
905
+
906
+ function _getMaxListeners(that) {
907
+ if (that._maxListeners === undefined)
908
+ return EventEmitter.defaultMaxListeners;
909
+ return that._maxListeners;
910
+ }
911
+
912
+ EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
913
+ return _getMaxListeners(this);
914
+ };
915
+
916
+ EventEmitter.prototype.emit = function emit(type) {
917
+ var args = [];
918
+ for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
919
+ var doError = (type === 'error');
920
+
921
+ var events = this._events;
922
+ if (events !== undefined)
923
+ doError = (doError && events.error === undefined);
924
+ else if (!doError)
925
+ return false;
926
+
927
+ // If there is no 'error' event listener then throw.
928
+ if (doError) {
929
+ var er;
930
+ if (args.length > 0)
931
+ er = args[0];
932
+ if (er instanceof Error) {
933
+ // Note: The comments on the `throw` lines are intentional, they show
934
+ // up in Node's output if this results in an unhandled exception.
935
+ throw er; // Unhandled 'error' event
936
+ }
937
+ // At least give some kind of context to the user
938
+ var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));
939
+ err.context = er;
940
+ throw err; // Unhandled 'error' event
941
+ }
942
+
943
+ var handler = events[type];
944
+
945
+ if (handler === undefined)
946
+ return false;
947
+
948
+ if (typeof handler === 'function') {
949
+ ReflectApply(handler, this, args);
950
+ } else {
951
+ var len = handler.length;
952
+ var listeners = arrayClone(handler, len);
953
+ for (var i = 0; i < len; ++i)
954
+ ReflectApply(listeners[i], this, args);
955
+ }
956
+
957
+ return true;
958
+ };
959
+
960
+ function _addListener(target, type, listener, prepend) {
961
+ var m;
962
+ var events;
963
+ var existing;
964
+
965
+ checkListener(listener);
966
+
967
+ events = target._events;
968
+ if (events === undefined) {
969
+ events = target._events = Object.create(null);
970
+ target._eventsCount = 0;
971
+ } else {
972
+ // To avoid recursion in the case that type === "newListener"! Before
973
+ // adding it to the listeners, first emit "newListener".
974
+ if (events.newListener !== undefined) {
975
+ target.emit('newListener', type,
976
+ listener.listener ? listener.listener : listener);
977
+
978
+ // Re-assign `events` because a newListener handler could have caused the
979
+ // this._events to be assigned to a new object
980
+ events = target._events;
981
+ }
982
+ existing = events[type];
983
+ }
984
+
985
+ if (existing === undefined) {
986
+ // Optimize the case of one listener. Don't need the extra array object.
987
+ existing = events[type] = listener;
988
+ ++target._eventsCount;
989
+ } else {
990
+ if (typeof existing === 'function') {
991
+ // Adding the second element, need to change to array.
992
+ existing = events[type] =
993
+ prepend ? [listener, existing] : [existing, listener];
994
+ // If we've already got an array, just append.
995
+ } else if (prepend) {
996
+ existing.unshift(listener);
997
+ } else {
998
+ existing.push(listener);
999
+ }
1000
+
1001
+ // Check for listener leak
1002
+ m = _getMaxListeners(target);
1003
+ if (m > 0 && existing.length > m && !existing.warned) {
1004
+ existing.warned = true;
1005
+ // No error code for this since it is a Warning
1006
+ // eslint-disable-next-line no-restricted-syntax
1007
+ var w = new Error('Possible EventEmitter memory leak detected. ' +
1008
+ existing.length + ' ' + String(type) + ' listeners ' +
1009
+ 'added. Use emitter.setMaxListeners() to ' +
1010
+ 'increase limit');
1011
+ w.name = 'MaxListenersExceededWarning';
1012
+ w.emitter = target;
1013
+ w.type = type;
1014
+ w.count = existing.length;
1015
+ ProcessEmitWarning(w);
1016
+ }
1017
+ }
1018
+
1019
+ return target;
1020
+ }
1021
+
1022
+ EventEmitter.prototype.addListener = function addListener(type, listener) {
1023
+ return _addListener(this, type, listener, false);
1024
+ };
1025
+
1026
+ EventEmitter.prototype.on = EventEmitter.prototype.addListener;
1027
+
1028
+ EventEmitter.prototype.prependListener =
1029
+ function prependListener(type, listener) {
1030
+ return _addListener(this, type, listener, true);
1031
+ };
1032
+
1033
+ function onceWrapper() {
1034
+ if (!this.fired) {
1035
+ this.target.removeListener(this.type, this.wrapFn);
1036
+ this.fired = true;
1037
+ if (arguments.length === 0)
1038
+ return this.listener.call(this.target);
1039
+ return this.listener.apply(this.target, arguments);
1040
+ }
1041
+ }
1042
+
1043
+ function _onceWrap(target, type, listener) {
1044
+ var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
1045
+ var wrapped = onceWrapper.bind(state);
1046
+ wrapped.listener = listener;
1047
+ state.wrapFn = wrapped;
1048
+ return wrapped;
1049
+ }
1050
+
1051
+ EventEmitter.prototype.once = function once(type, listener) {
1052
+ checkListener(listener);
1053
+ this.on(type, _onceWrap(this, type, listener));
1054
+ return this;
1055
+ };
1056
+
1057
+ EventEmitter.prototype.prependOnceListener =
1058
+ function prependOnceListener(type, listener) {
1059
+ checkListener(listener);
1060
+ this.prependListener(type, _onceWrap(this, type, listener));
1061
+ return this;
1062
+ };
1063
+
1064
+ // Emits a 'removeListener' event if and only if the listener was removed.
1065
+ EventEmitter.prototype.removeListener =
1066
+ function removeListener(type, listener) {
1067
+ var list, events, position, i, originalListener;
1068
+
1069
+ checkListener(listener);
1070
+
1071
+ events = this._events;
1072
+ if (events === undefined)
1073
+ return this;
1074
+
1075
+ list = events[type];
1076
+ if (list === undefined)
1077
+ return this;
1078
+
1079
+ if (list === listener || list.listener === listener) {
1080
+ if (--this._eventsCount === 0)
1081
+ this._events = Object.create(null);
1082
+ else {
1083
+ delete events[type];
1084
+ if (events.removeListener)
1085
+ this.emit('removeListener', type, list.listener || listener);
1086
+ }
1087
+ } else if (typeof list !== 'function') {
1088
+ position = -1;
1089
+
1090
+ for (i = list.length - 1; i >= 0; i--) {
1091
+ if (list[i] === listener || list[i].listener === listener) {
1092
+ originalListener = list[i].listener;
1093
+ position = i;
1094
+ break;
1095
+ }
1096
+ }
1097
+
1098
+ if (position < 0)
1099
+ return this;
1100
+
1101
+ if (position === 0)
1102
+ list.shift();
1103
+ else {
1104
+ spliceOne(list, position);
1105
+ }
1106
+
1107
+ if (list.length === 1)
1108
+ events[type] = list[0];
1109
+
1110
+ if (events.removeListener !== undefined)
1111
+ this.emit('removeListener', type, originalListener || listener);
1112
+ }
1113
+
1114
+ return this;
1115
+ };
1116
+
1117
+ EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
1118
+
1119
+ EventEmitter.prototype.removeAllListeners =
1120
+ function removeAllListeners(type) {
1121
+ var listeners, events, i;
1122
+
1123
+ events = this._events;
1124
+ if (events === undefined)
1125
+ return this;
1126
+
1127
+ // not listening for removeListener, no need to emit
1128
+ if (events.removeListener === undefined) {
1129
+ if (arguments.length === 0) {
1130
+ this._events = Object.create(null);
1131
+ this._eventsCount = 0;
1132
+ } else if (events[type] !== undefined) {
1133
+ if (--this._eventsCount === 0)
1134
+ this._events = Object.create(null);
1135
+ else
1136
+ delete events[type];
1137
+ }
1138
+ return this;
1139
+ }
1140
+
1141
+ // emit removeListener for all listeners on all events
1142
+ if (arguments.length === 0) {
1143
+ var keys = Object.keys(events);
1144
+ var key;
1145
+ for (i = 0; i < keys.length; ++i) {
1146
+ key = keys[i];
1147
+ if (key === 'removeListener') continue;
1148
+ this.removeAllListeners(key);
1149
+ }
1150
+ this.removeAllListeners('removeListener');
1151
+ this._events = Object.create(null);
1152
+ this._eventsCount = 0;
1153
+ return this;
1154
+ }
1155
+
1156
+ listeners = events[type];
1157
+
1158
+ if (typeof listeners === 'function') {
1159
+ this.removeListener(type, listeners);
1160
+ } else if (listeners !== undefined) {
1161
+ // LIFO order
1162
+ for (i = listeners.length - 1; i >= 0; i--) {
1163
+ this.removeListener(type, listeners[i]);
1164
+ }
1165
+ }
1166
+
1167
+ return this;
1168
+ };
1169
+
1170
+ function _listeners(target, type, unwrap) {
1171
+ var events = target._events;
1172
+
1173
+ if (events === undefined)
1174
+ return [];
1175
+
1176
+ var evlistener = events[type];
1177
+ if (evlistener === undefined)
1178
+ return [];
1179
+
1180
+ if (typeof evlistener === 'function')
1181
+ return unwrap ? [evlistener.listener || evlistener] : [evlistener];
1182
+
1183
+ return unwrap ?
1184
+ unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
1185
+ }
1186
+
1187
+ EventEmitter.prototype.listeners = function listeners(type) {
1188
+ return _listeners(this, type, true);
1189
+ };
1190
+
1191
+ EventEmitter.prototype.rawListeners = function rawListeners(type) {
1192
+ return _listeners(this, type, false);
1193
+ };
1194
+
1195
+ EventEmitter.listenerCount = function(emitter, type) {
1196
+ if (typeof emitter.listenerCount === 'function') {
1197
+ return emitter.listenerCount(type);
1198
+ } else {
1199
+ return listenerCount.call(emitter, type);
1200
+ }
1201
+ };
1202
+
1203
+ EventEmitter.prototype.listenerCount = listenerCount;
1204
+ function listenerCount(type) {
1205
+ var events = this._events;
1206
+
1207
+ if (events !== undefined) {
1208
+ var evlistener = events[type];
1209
+
1210
+ if (typeof evlistener === 'function') {
1211
+ return 1;
1212
+ } else if (evlistener !== undefined) {
1213
+ return evlistener.length;
1214
+ }
1215
+ }
1216
+
1217
+ return 0;
1218
+ }
1219
+
1220
+ EventEmitter.prototype.eventNames = function eventNames() {
1221
+ return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
1222
+ };
1223
+
1224
+ function arrayClone(arr, n) {
1225
+ var copy = new Array(n);
1226
+ for (var i = 0; i < n; ++i)
1227
+ copy[i] = arr[i];
1228
+ return copy;
1229
+ }
1230
+
1231
+ function spliceOne(list, index) {
1232
+ for (; index + 1 < list.length; index++)
1233
+ list[index] = list[index + 1];
1234
+ list.pop();
1235
+ }
1236
+
1237
+ function unwrapListeners(arr) {
1238
+ var ret = new Array(arr.length);
1239
+ for (var i = 0; i < ret.length; ++i) {
1240
+ ret[i] = arr[i].listener || arr[i];
1241
+ }
1242
+ return ret;
1243
+ }
1244
+
1245
+ function once(emitter, name) {
1246
+ return new Promise(function (resolve, reject) {
1247
+ function errorListener(err) {
1248
+ emitter.removeListener(name, resolver);
1249
+ reject(err);
1250
+ }
1251
+
1252
+ function resolver() {
1253
+ if (typeof emitter.removeListener === 'function') {
1254
+ emitter.removeListener('error', errorListener);
1255
+ }
1256
+ resolve([].slice.call(arguments));
1257
+ };
1258
+
1259
+ eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
1260
+ if (name !== 'error') {
1261
+ addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
1262
+ }
1263
+ });
1264
+ }
1265
+
1266
+ function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
1267
+ if (typeof emitter.on === 'function') {
1268
+ eventTargetAgnosticAddListener(emitter, 'error', handler, flags);
1269
+ }
1270
+ }
1271
+
1272
+ function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
1273
+ if (typeof emitter.on === 'function') {
1274
+ if (flags.once) {
1275
+ emitter.once(name, listener);
1276
+ } else {
1277
+ emitter.on(name, listener);
1278
+ }
1279
+ } else if (typeof emitter.addEventListener === 'function') {
1280
+ // EventTarget does not have `error` event semantics like Node
1281
+ // EventEmitters, we do not listen for `error` events here.
1282
+ emitter.addEventListener(name, function wrapListener(arg) {
1283
+ // IE does not have builtin `{ once: true }` support so we
1284
+ // have to do it manually.
1285
+ if (flags.once) {
1286
+ emitter.removeEventListener(name, wrapListener);
1287
+ }
1288
+ listener(arg);
1289
+ });
1290
+ } else {
1291
+ throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
1292
+ }
1293
+ }
1294
+
1295
+
1296
+ /***/ }),
1297
+
1298
+ /***/ 5695:
1299
+ /***/ (function(module) {
1300
+
1301
+ "use strict";
1302
+
1303
+
1304
+ module.exports = function (data, opts) {
1305
+ if (!opts) opts = {};
1306
+ if (typeof opts === 'function') opts = { cmp: opts };
1307
+ var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false;
1308
+
1309
+ var cmp = opts.cmp && (function (f) {
1310
+ return function (node) {
1311
+ return function (a, b) {
1312
+ var aobj = { key: a, value: node[a] };
1313
+ var bobj = { key: b, value: node[b] };
1314
+ return f(aobj, bobj);
1315
+ };
1316
+ };
1317
+ })(opts.cmp);
1318
+
1319
+ var seen = [];
1320
+ return (function stringify (node) {
1321
+ if (node && node.toJSON && typeof node.toJSON === 'function') {
1322
+ node = node.toJSON();
1323
+ }
1324
+
1325
+ if (node === undefined) return;
1326
+ if (typeof node == 'number') return isFinite(node) ? '' + node : 'null';
1327
+ if (typeof node !== 'object') return JSON.stringify(node);
1328
+
1329
+ var i, out;
1330
+ if (Array.isArray(node)) {
1331
+ out = '[';
1332
+ for (i = 0; i < node.length; i++) {
1333
+ if (i) out += ',';
1334
+ out += stringify(node[i]) || 'null';
1335
+ }
1336
+ return out + ']';
1337
+ }
1338
+
1339
+ if (node === null) return 'null';
1340
+
1341
+ if (seen.indexOf(node) !== -1) {
1342
+ if (cycles) return JSON.stringify('__cycle__');
1343
+ throw new TypeError('Converting circular structure to JSON');
1344
+ }
1345
+
1346
+ var seenIndex = seen.push(node) - 1;
1347
+ var keys = Object.keys(node).sort(cmp && cmp(node));
1348
+ out = '';
1349
+ for (i = 0; i < keys.length; i++) {
1350
+ var key = keys[i];
1351
+ var value = stringify(node[key]);
1352
+
1353
+ if (!value) continue;
1354
+ if (out) out += ',';
1355
+ out += JSON.stringify(key) + ':' + value;
1356
+ }
1357
+ seen.splice(seenIndex, 1);
1358
+ return '{' + out + '}';
1359
+ })(data);
1360
+ };
1361
+
1362
+
1363
+ /***/ }),
1364
+
1365
+ /***/ 7795:
1366
+ /***/ (function(module) {
1367
+
1368
+ "use strict";
1369
+
1370
+
1371
+ /* eslint no-invalid-this: 1 */
1372
+
1373
+ var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
1374
+ var slice = Array.prototype.slice;
1375
+ var toStr = Object.prototype.toString;
1376
+ var funcType = '[object Function]';
1377
+
1378
+ module.exports = function bind(that) {
1379
+ var target = this;
1380
+ if (typeof target !== 'function' || toStr.call(target) !== funcType) {
1381
+ throw new TypeError(ERROR_MESSAGE + target);
1382
+ }
1383
+ var args = slice.call(arguments, 1);
1384
+
1385
+ var bound;
1386
+ var binder = function () {
1387
+ if (this instanceof bound) {
1388
+ var result = target.apply(
1389
+ this,
1390
+ args.concat(slice.call(arguments))
1391
+ );
1392
+ if (Object(result) === result) {
1393
+ return result;
1394
+ }
1395
+ return this;
1396
+ } else {
1397
+ return target.apply(
1398
+ that,
1399
+ args.concat(slice.call(arguments))
1400
+ );
1401
+ }
1402
+ };
1403
+
1404
+ var boundLength = Math.max(0, target.length - args.length);
1405
+ var boundArgs = [];
1406
+ for (var i = 0; i < boundLength; i++) {
1407
+ boundArgs.push('$' + i);
1408
+ }
1409
+
1410
+ bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
1411
+
1412
+ if (target.prototype) {
1413
+ var Empty = function Empty() {};
1414
+ Empty.prototype = target.prototype;
1415
+ bound.prototype = new Empty();
1416
+ Empty.prototype = null;
1417
+ }
1418
+
1419
+ return bound;
1420
+ };
1421
+
1422
+
1423
+ /***/ }),
1424
+
1425
+ /***/ 4090:
1426
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
1427
+
1428
+ "use strict";
1429
+
1430
+
1431
+ var implementation = __webpack_require__(7795);
1432
+
1433
+ module.exports = Function.prototype.bind || implementation;
1434
+
1435
+
1436
+ /***/ }),
1437
+
1438
+ /***/ 7286:
1439
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
1440
+
1441
+ "use strict";
1442
+
1443
+
1444
+ var undefined;
1445
+
1446
+ var $SyntaxError = SyntaxError;
1447
+ var $Function = Function;
1448
+ var $TypeError = TypeError;
1449
+
1450
+ // eslint-disable-next-line consistent-return
1451
+ var getEvalledConstructor = function (expressionSyntax) {
1452
+ try {
1453
+ return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
1454
+ } catch (e) {}
1455
+ };
1456
+
1457
+ var $gOPD = Object.getOwnPropertyDescriptor;
1458
+ if ($gOPD) {
1459
+ try {
1460
+ $gOPD({}, '');
1461
+ } catch (e) {
1462
+ $gOPD = null; // this is IE 8, which has a broken gOPD
1463
+ }
1464
+ }
1465
+
1466
+ var throwTypeError = function () {
1467
+ throw new $TypeError();
1468
+ };
1469
+ var ThrowTypeError = $gOPD
1470
+ ? (function () {
1471
+ try {
1472
+ // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
1473
+ arguments.callee; // IE 8 does not throw here
1474
+ return throwTypeError;
1475
+ } catch (calleeThrows) {
1476
+ try {
1477
+ // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
1478
+ return $gOPD(arguments, 'callee').get;
1479
+ } catch (gOPDthrows) {
1480
+ return throwTypeError;
1481
+ }
1482
+ }
1483
+ }())
1484
+ : throwTypeError;
1485
+
1486
+ var hasSymbols = __webpack_require__(2636)();
1487
+
1488
+ var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
1489
+
1490
+ var needsEval = {};
1491
+
1492
+ var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);
1493
+
1494
+ var INTRINSICS = {
1495
+ '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,
1496
+ '%Array%': Array,
1497
+ '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
1498
+ '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,
1499
+ '%AsyncFromSyncIteratorPrototype%': undefined,
1500
+ '%AsyncFunction%': needsEval,
1501
+ '%AsyncGenerator%': needsEval,
1502
+ '%AsyncGeneratorFunction%': needsEval,
1503
+ '%AsyncIteratorPrototype%': needsEval,
1504
+ '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
1505
+ '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,
1506
+ '%Boolean%': Boolean,
1507
+ '%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
1508
+ '%Date%': Date,
1509
+ '%decodeURI%': decodeURI,
1510
+ '%decodeURIComponent%': decodeURIComponent,
1511
+ '%encodeURI%': encodeURI,
1512
+ '%encodeURIComponent%': encodeURIComponent,
1513
+ '%Error%': Error,
1514
+ '%eval%': eval, // eslint-disable-line no-eval
1515
+ '%EvalError%': EvalError,
1516
+ '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
1517
+ '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
1518
+ '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,
1519
+ '%Function%': $Function,
1520
+ '%GeneratorFunction%': needsEval,
1521
+ '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,
1522
+ '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,
1523
+ '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
1524
+ '%isFinite%': isFinite,
1525
+ '%isNaN%': isNaN,
1526
+ '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,
1527
+ '%JSON%': typeof JSON === 'object' ? JSON : undefined,
1528
+ '%Map%': typeof Map === 'undefined' ? undefined : Map,
1529
+ '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),
1530
+ '%Math%': Math,
1531
+ '%Number%': Number,
1532
+ '%Object%': Object,
1533
+ '%parseFloat%': parseFloat,
1534
+ '%parseInt%': parseInt,
1535
+ '%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
1536
+ '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
1537
+ '%RangeError%': RangeError,
1538
+ '%ReferenceError%': ReferenceError,
1539
+ '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
1540
+ '%RegExp%': RegExp,
1541
+ '%Set%': typeof Set === 'undefined' ? undefined : Set,
1542
+ '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),
1543
+ '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
1544
+ '%String%': String,
1545
+ '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,
1546
+ '%Symbol%': hasSymbols ? Symbol : undefined,
1547
+ '%SyntaxError%': $SyntaxError,
1548
+ '%ThrowTypeError%': ThrowTypeError,
1549
+ '%TypedArray%': TypedArray,
1550
+ '%TypeError%': $TypeError,
1551
+ '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,
1552
+ '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
1553
+ '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
1554
+ '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
1555
+ '%URIError%': URIError,
1556
+ '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
1557
+ '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,
1558
+ '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet
1559
+ };
1560
+
1561
+ var doEval = function doEval(name) {
1562
+ var value;
1563
+ if (name === '%AsyncFunction%') {
1564
+ value = getEvalledConstructor('async function () {}');
1565
+ } else if (name === '%GeneratorFunction%') {
1566
+ value = getEvalledConstructor('function* () {}');
1567
+ } else if (name === '%AsyncGeneratorFunction%') {
1568
+ value = getEvalledConstructor('async function* () {}');
1569
+ } else if (name === '%AsyncGenerator%') {
1570
+ var fn = doEval('%AsyncGeneratorFunction%');
1571
+ if (fn) {
1572
+ value = fn.prototype;
1573
+ }
1574
+ } else if (name === '%AsyncIteratorPrototype%') {
1575
+ var gen = doEval('%AsyncGenerator%');
1576
+ if (gen) {
1577
+ value = getProto(gen.prototype);
1578
+ }
1579
+ }
1580
+
1581
+ INTRINSICS[name] = value;
1582
+
1583
+ return value;
1584
+ };
1585
+
1586
+ var LEGACY_ALIASES = {
1587
+ '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
1588
+ '%ArrayPrototype%': ['Array', 'prototype'],
1589
+ '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
1590
+ '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
1591
+ '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
1592
+ '%ArrayProto_values%': ['Array', 'prototype', 'values'],
1593
+ '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
1594
+ '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
1595
+ '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
1596
+ '%BooleanPrototype%': ['Boolean', 'prototype'],
1597
+ '%DataViewPrototype%': ['DataView', 'prototype'],
1598
+ '%DatePrototype%': ['Date', 'prototype'],
1599
+ '%ErrorPrototype%': ['Error', 'prototype'],
1600
+ '%EvalErrorPrototype%': ['EvalError', 'prototype'],
1601
+ '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
1602
+ '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
1603
+ '%FunctionPrototype%': ['Function', 'prototype'],
1604
+ '%Generator%': ['GeneratorFunction', 'prototype'],
1605
+ '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
1606
+ '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
1607
+ '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
1608
+ '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
1609
+ '%JSONParse%': ['JSON', 'parse'],
1610
+ '%JSONStringify%': ['JSON', 'stringify'],
1611
+ '%MapPrototype%': ['Map', 'prototype'],
1612
+ '%NumberPrototype%': ['Number', 'prototype'],
1613
+ '%ObjectPrototype%': ['Object', 'prototype'],
1614
+ '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
1615
+ '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
1616
+ '%PromisePrototype%': ['Promise', 'prototype'],
1617
+ '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
1618
+ '%Promise_all%': ['Promise', 'all'],
1619
+ '%Promise_reject%': ['Promise', 'reject'],
1620
+ '%Promise_resolve%': ['Promise', 'resolve'],
1621
+ '%RangeErrorPrototype%': ['RangeError', 'prototype'],
1622
+ '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
1623
+ '%RegExpPrototype%': ['RegExp', 'prototype'],
1624
+ '%SetPrototype%': ['Set', 'prototype'],
1625
+ '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
1626
+ '%StringPrototype%': ['String', 'prototype'],
1627
+ '%SymbolPrototype%': ['Symbol', 'prototype'],
1628
+ '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
1629
+ '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
1630
+ '%TypeErrorPrototype%': ['TypeError', 'prototype'],
1631
+ '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
1632
+ '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
1633
+ '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
1634
+ '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
1635
+ '%URIErrorPrototype%': ['URIError', 'prototype'],
1636
+ '%WeakMapPrototype%': ['WeakMap', 'prototype'],
1637
+ '%WeakSetPrototype%': ['WeakSet', 'prototype']
1638
+ };
1639
+
1640
+ var bind = __webpack_require__(4090);
1641
+ var hasOwn = __webpack_require__(3198);
1642
+ var $concat = bind.call(Function.call, Array.prototype.concat);
1643
+ var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
1644
+ var $replace = bind.call(Function.call, String.prototype.replace);
1645
+ var $strSlice = bind.call(Function.call, String.prototype.slice);
1646
+
1647
+ /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
1648
+ var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
1649
+ var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
1650
+ var stringToPath = function stringToPath(string) {
1651
+ var first = $strSlice(string, 0, 1);
1652
+ var last = $strSlice(string, -1);
1653
+ if (first === '%' && last !== '%') {
1654
+ throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
1655
+ } else if (last === '%' && first !== '%') {
1656
+ throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
1657
+ }
1658
+ var result = [];
1659
+ $replace(string, rePropName, function (match, number, quote, subString) {
1660
+ result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
1661
+ });
1662
+ return result;
1663
+ };
1664
+ /* end adaptation */
1665
+
1666
+ var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
1667
+ var intrinsicName = name;
1668
+ var alias;
1669
+ if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
1670
+ alias = LEGACY_ALIASES[intrinsicName];
1671
+ intrinsicName = '%' + alias[0] + '%';
1672
+ }
1673
+
1674
+ if (hasOwn(INTRINSICS, intrinsicName)) {
1675
+ var value = INTRINSICS[intrinsicName];
1676
+ if (value === needsEval) {
1677
+ value = doEval(intrinsicName);
1678
+ }
1679
+ if (typeof value === 'undefined' && !allowMissing) {
1680
+ throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
1681
+ }
1682
+
1683
+ return {
1684
+ alias: alias,
1685
+ name: intrinsicName,
1686
+ value: value
1687
+ };
1688
+ }
1689
+
1690
+ throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
1691
+ };
1692
+
1693
+ module.exports = function GetIntrinsic(name, allowMissing) {
1694
+ if (typeof name !== 'string' || name.length === 0) {
1695
+ throw new $TypeError('intrinsic name must be a non-empty string');
1696
+ }
1697
+ if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
1698
+ throw new $TypeError('"allowMissing" argument must be a boolean');
1699
+ }
1700
+
1701
+ var parts = stringToPath(name);
1702
+ var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
1703
+
1704
+ var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
1705
+ var intrinsicRealName = intrinsic.name;
1706
+ var value = intrinsic.value;
1707
+ var skipFurtherCaching = false;
1708
+
1709
+ var alias = intrinsic.alias;
1710
+ if (alias) {
1711
+ intrinsicBaseName = alias[0];
1712
+ $spliceApply(parts, $concat([0, 1], alias));
1713
+ }
1714
+
1715
+ for (var i = 1, isOwn = true; i < parts.length; i += 1) {
1716
+ var part = parts[i];
1717
+ var first = $strSlice(part, 0, 1);
1718
+ var last = $strSlice(part, -1);
1719
+ if (
1720
+ (
1721
+ (first === '"' || first === "'" || first === '`')
1722
+ || (last === '"' || last === "'" || last === '`')
1723
+ )
1724
+ && first !== last
1725
+ ) {
1726
+ throw new $SyntaxError('property names with quotes must have matching quotes');
1727
+ }
1728
+ if (part === 'constructor' || !isOwn) {
1729
+ skipFurtherCaching = true;
1730
+ }
1731
+
1732
+ intrinsicBaseName += '.' + part;
1733
+ intrinsicRealName = '%' + intrinsicBaseName + '%';
1734
+
1735
+ if (hasOwn(INTRINSICS, intrinsicRealName)) {
1736
+ value = INTRINSICS[intrinsicRealName];
1737
+ } else if (value != null) {
1738
+ if (!(part in value)) {
1739
+ if (!allowMissing) {
1740
+ throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
1741
+ }
1742
+ return void undefined;
1743
+ }
1744
+ if ($gOPD && (i + 1) >= parts.length) {
1745
+ var desc = $gOPD(value, part);
1746
+ isOwn = !!desc;
1747
+
1748
+ // By convention, when a data property is converted to an accessor
1749
+ // property to emulate a data property that does not suffer from
1750
+ // the override mistake, that accessor's getter is marked with
1751
+ // an `originalValue` property. Here, when we detect this, we
1752
+ // uphold the illusion by pretending to see that original data
1753
+ // property, i.e., returning the value rather than the getter
1754
+ // itself.
1755
+ if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
1756
+ value = desc.get;
1757
+ } else {
1758
+ value = value[part];
1759
+ }
1760
+ } else {
1761
+ isOwn = hasOwn(value, part);
1762
+ value = value[part];
1763
+ }
1764
+
1765
+ if (isOwn && !skipFurtherCaching) {
1766
+ INTRINSICS[intrinsicRealName] = value;
1767
+ }
1768
+ }
1769
+ }
1770
+ return value;
1771
+ };
1772
+
1773
+
1774
+ /***/ }),
1775
+
1776
+ /***/ 2636:
1777
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
1778
+
1779
+ "use strict";
1780
+
1781
+
1782
+ var origSymbol = typeof Symbol !== 'undefined' && Symbol;
1783
+ var hasSymbolSham = __webpack_require__(6679);
1784
+
1785
+ module.exports = function hasNativeSymbols() {
1786
+ if (typeof origSymbol !== 'function') { return false; }
1787
+ if (typeof Symbol !== 'function') { return false; }
1788
+ if (typeof origSymbol('foo') !== 'symbol') { return false; }
1789
+ if (typeof Symbol('bar') !== 'symbol') { return false; }
1790
+
1791
+ return hasSymbolSham();
1792
+ };
1793
+
1794
+
1795
+ /***/ }),
1796
+
1797
+ /***/ 6679:
1798
+ /***/ (function(module) {
1799
+
1800
+ "use strict";
1801
+
1802
+
1803
+ /* eslint complexity: [2, 18], max-statements: [2, 33] */
1804
+ module.exports = function hasSymbols() {
1805
+ if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
1806
+ if (typeof Symbol.iterator === 'symbol') { return true; }
1807
+
1808
+ var obj = {};
1809
+ var sym = Symbol('test');
1810
+ var symObj = Object(sym);
1811
+ if (typeof sym === 'string') { return false; }
1812
+
1813
+ if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
1814
+ if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
1815
+
1816
+ // temp disabled per https://github.com/ljharb/object.assign/issues/17
1817
+ // if (sym instanceof Symbol) { return false; }
1818
+ // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
1819
+ // if (!(symObj instanceof Symbol)) { return false; }
1820
+
1821
+ // if (typeof Symbol.prototype.toString !== 'function') { return false; }
1822
+ // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
1823
+
1824
+ var symVal = 42;
1825
+ obj[sym] = symVal;
1826
+ for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
1827
+ if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
1828
+
1829
+ if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
1830
+
1831
+ var syms = Object.getOwnPropertySymbols(obj);
1832
+ if (syms.length !== 1 || syms[0] !== sym) { return false; }
1833
+
1834
+ if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
1835
+
1836
+ if (typeof Object.getOwnPropertyDescriptor === 'function') {
1837
+ var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
1838
+ if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
1839
+ }
1840
+
1841
+ return true;
1842
+ };
1843
+
1844
+
1845
+ /***/ }),
1846
+
1847
+ /***/ 3198:
1848
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
1849
+
1850
+ "use strict";
1851
+
1852
+
1853
+ var bind = __webpack_require__(4090);
1854
+
1855
+ module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);
1856
+
1857
+
1858
+ /***/ }),
1859
+
1860
+ /***/ 4495:
1861
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1862
+
1863
+ "use strict";
1864
+
1865
+
1866
+ var utils = __webpack_require__(212);
1867
+ var assert = __webpack_require__(9561);
1868
+
1869
+ function BlockHash() {
1870
+ this.pending = null;
1871
+ this.pendingTotal = 0;
1872
+ this.blockSize = this.constructor.blockSize;
1873
+ this.outSize = this.constructor.outSize;
1874
+ this.hmacStrength = this.constructor.hmacStrength;
1875
+ this.padLength = this.constructor.padLength / 8;
1876
+ this.endian = 'big';
1877
+
1878
+ this._delta8 = this.blockSize / 8;
1879
+ this._delta32 = this.blockSize / 32;
1880
+ }
1881
+ exports.BlockHash = BlockHash;
1882
+
1883
+ BlockHash.prototype.update = function update(msg, enc) {
1884
+ // Convert message to array, pad it, and join into 32bit blocks
1885
+ msg = utils.toArray(msg, enc);
1886
+ if (!this.pending)
1887
+ this.pending = msg;
1888
+ else
1889
+ this.pending = this.pending.concat(msg);
1890
+ this.pendingTotal += msg.length;
1891
+
1892
+ // Enough data, try updating
1893
+ if (this.pending.length >= this._delta8) {
1894
+ msg = this.pending;
1895
+
1896
+ // Process pending data in blocks
1897
+ var r = msg.length % this._delta8;
1898
+ this.pending = msg.slice(msg.length - r, msg.length);
1899
+ if (this.pending.length === 0)
1900
+ this.pending = null;
1901
+
1902
+ msg = utils.join32(msg, 0, msg.length - r, this.endian);
1903
+ for (var i = 0; i < msg.length; i += this._delta32)
1904
+ this._update(msg, i, i + this._delta32);
1905
+ }
1906
+
1907
+ return this;
1908
+ };
1909
+
1910
+ BlockHash.prototype.digest = function digest(enc) {
1911
+ this.update(this._pad());
1912
+ assert(this.pending === null);
1913
+
1914
+ return this._digest(enc);
1915
+ };
1916
+
1917
+ BlockHash.prototype._pad = function pad() {
1918
+ var len = this.pendingTotal;
1919
+ var bytes = this._delta8;
1920
+ var k = bytes - ((len + this.padLength) % bytes);
1921
+ var res = new Array(k + this.padLength);
1922
+ res[0] = 0x80;
1923
+ for (var i = 1; i < k; i++)
1924
+ res[i] = 0;
1925
+
1926
+ // Append length
1927
+ len <<= 3;
1928
+ if (this.endian === 'big') {
1929
+ for (var t = 8; t < this.padLength; t++)
1930
+ res[i++] = 0;
1931
+
1932
+ res[i++] = 0;
1933
+ res[i++] = 0;
1934
+ res[i++] = 0;
1935
+ res[i++] = 0;
1936
+ res[i++] = (len >>> 24) & 0xff;
1937
+ res[i++] = (len >>> 16) & 0xff;
1938
+ res[i++] = (len >>> 8) & 0xff;
1939
+ res[i++] = len & 0xff;
1940
+ } else {
1941
+ res[i++] = len & 0xff;
1942
+ res[i++] = (len >>> 8) & 0xff;
1943
+ res[i++] = (len >>> 16) & 0xff;
1944
+ res[i++] = (len >>> 24) & 0xff;
1945
+ res[i++] = 0;
1946
+ res[i++] = 0;
1947
+ res[i++] = 0;
1948
+ res[i++] = 0;
1949
+
1950
+ for (t = 8; t < this.padLength; t++)
1951
+ res[i++] = 0;
1952
+ }
1953
+
1954
+ return res;
1955
+ };
1956
+
1957
+
1958
+ /***/ }),
1959
+
1960
+ /***/ 5079:
1961
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
1962
+
1963
+ "use strict";
1964
+
1965
+
1966
+ var utils = __webpack_require__(212);
1967
+ var common = __webpack_require__(4495);
1968
+ var shaCommon = __webpack_require__(713);
1969
+
1970
+ var rotl32 = utils.rotl32;
1971
+ var sum32 = utils.sum32;
1972
+ var sum32_5 = utils.sum32_5;
1973
+ var ft_1 = shaCommon.ft_1;
1974
+ var BlockHash = common.BlockHash;
1975
+
1976
+ var sha1_K = [
1977
+ 0x5A827999, 0x6ED9EBA1,
1978
+ 0x8F1BBCDC, 0xCA62C1D6
1979
+ ];
1980
+
1981
+ function SHA1() {
1982
+ if (!(this instanceof SHA1))
1983
+ return new SHA1();
1984
+
1985
+ BlockHash.call(this);
1986
+ this.h = [
1987
+ 0x67452301, 0xefcdab89, 0x98badcfe,
1988
+ 0x10325476, 0xc3d2e1f0 ];
1989
+ this.W = new Array(80);
1990
+ }
1991
+
1992
+ utils.inherits(SHA1, BlockHash);
1993
+ module.exports = SHA1;
1994
+
1995
+ SHA1.blockSize = 512;
1996
+ SHA1.outSize = 160;
1997
+ SHA1.hmacStrength = 80;
1998
+ SHA1.padLength = 64;
1999
+
2000
+ SHA1.prototype._update = function _update(msg, start) {
2001
+ var W = this.W;
2002
+
2003
+ for (var i = 0; i < 16; i++)
2004
+ W[i] = msg[start + i];
2005
+
2006
+ for(; i < W.length; i++)
2007
+ W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);
2008
+
2009
+ var a = this.h[0];
2010
+ var b = this.h[1];
2011
+ var c = this.h[2];
2012
+ var d = this.h[3];
2013
+ var e = this.h[4];
2014
+
2015
+ for (i = 0; i < W.length; i++) {
2016
+ var s = ~~(i / 20);
2017
+ var t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]);
2018
+ e = d;
2019
+ d = c;
2020
+ c = rotl32(b, 30);
2021
+ b = a;
2022
+ a = t;
2023
+ }
2024
+
2025
+ this.h[0] = sum32(this.h[0], a);
2026
+ this.h[1] = sum32(this.h[1], b);
2027
+ this.h[2] = sum32(this.h[2], c);
2028
+ this.h[3] = sum32(this.h[3], d);
2029
+ this.h[4] = sum32(this.h[4], e);
2030
+ };
2031
+
2032
+ SHA1.prototype._digest = function digest(enc) {
2033
+ if (enc === 'hex')
2034
+ return utils.toHex32(this.h, 'big');
2035
+ else
2036
+ return utils.split32(this.h, 'big');
2037
+ };
2038
+
2039
+
2040
+ /***/ }),
2041
+
2042
+ /***/ 713:
2043
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
2044
+
2045
+ "use strict";
2046
+
2047
+
2048
+ var utils = __webpack_require__(212);
2049
+ var rotr32 = utils.rotr32;
2050
+
2051
+ function ft_1(s, x, y, z) {
2052
+ if (s === 0)
2053
+ return ch32(x, y, z);
2054
+ if (s === 1 || s === 3)
2055
+ return p32(x, y, z);
2056
+ if (s === 2)
2057
+ return maj32(x, y, z);
2058
+ }
2059
+ exports.ft_1 = ft_1;
2060
+
2061
+ function ch32(x, y, z) {
2062
+ return (x & y) ^ ((~x) & z);
2063
+ }
2064
+ exports.ch32 = ch32;
2065
+
2066
+ function maj32(x, y, z) {
2067
+ return (x & y) ^ (x & z) ^ (y & z);
2068
+ }
2069
+ exports.maj32 = maj32;
2070
+
2071
+ function p32(x, y, z) {
2072
+ return x ^ y ^ z;
2073
+ }
2074
+ exports.p32 = p32;
2075
+
2076
+ function s0_256(x) {
2077
+ return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);
2078
+ }
2079
+ exports.s0_256 = s0_256;
2080
+
2081
+ function s1_256(x) {
2082
+ return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);
2083
+ }
2084
+ exports.s1_256 = s1_256;
2085
+
2086
+ function g0_256(x) {
2087
+ return rotr32(x, 7) ^ rotr32(x, 18) ^ (x >>> 3);
2088
+ }
2089
+ exports.g0_256 = g0_256;
2090
+
2091
+ function g1_256(x) {
2092
+ return rotr32(x, 17) ^ rotr32(x, 19) ^ (x >>> 10);
2093
+ }
2094
+ exports.g1_256 = g1_256;
2095
+
2096
+
2097
+ /***/ }),
2098
+
2099
+ /***/ 212:
2100
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
2101
+
2102
+ "use strict";
2103
+
2104
+
2105
+ var assert = __webpack_require__(9561);
2106
+ var inherits = __webpack_require__(1285);
2107
+
2108
+ exports.inherits = inherits;
2109
+
2110
+ function isSurrogatePair(msg, i) {
2111
+ if ((msg.charCodeAt(i) & 0xFC00) !== 0xD800) {
2112
+ return false;
2113
+ }
2114
+ if (i < 0 || i + 1 >= msg.length) {
2115
+ return false;
2116
+ }
2117
+ return (msg.charCodeAt(i + 1) & 0xFC00) === 0xDC00;
2118
+ }
2119
+
2120
+ function toArray(msg, enc) {
2121
+ if (Array.isArray(msg))
2122
+ return msg.slice();
2123
+ if (!msg)
2124
+ return [];
2125
+ var res = [];
2126
+ if (typeof msg === 'string') {
2127
+ if (!enc) {
2128
+ // Inspired by stringToUtf8ByteArray() in closure-library by Google
2129
+ // https://github.com/google/closure-library/blob/8598d87242af59aac233270742c8984e2b2bdbe0/closure/goog/crypt/crypt.js#L117-L143
2130
+ // Apache License 2.0
2131
+ // https://github.com/google/closure-library/blob/master/LICENSE
2132
+ var p = 0;
2133
+ for (var i = 0; i < msg.length; i++) {
2134
+ var c = msg.charCodeAt(i);
2135
+ if (c < 128) {
2136
+ res[p++] = c;
2137
+ } else if (c < 2048) {
2138
+ res[p++] = (c >> 6) | 192;
2139
+ res[p++] = (c & 63) | 128;
2140
+ } else if (isSurrogatePair(msg, i)) {
2141
+ c = 0x10000 + ((c & 0x03FF) << 10) + (msg.charCodeAt(++i) & 0x03FF);
2142
+ res[p++] = (c >> 18) | 240;
2143
+ res[p++] = ((c >> 12) & 63) | 128;
2144
+ res[p++] = ((c >> 6) & 63) | 128;
2145
+ res[p++] = (c & 63) | 128;
2146
+ } else {
2147
+ res[p++] = (c >> 12) | 224;
2148
+ res[p++] = ((c >> 6) & 63) | 128;
2149
+ res[p++] = (c & 63) | 128;
2150
+ }
2151
+ }
2152
+ } else if (enc === 'hex') {
2153
+ msg = msg.replace(/[^a-z0-9]+/ig, '');
2154
+ if (msg.length % 2 !== 0)
2155
+ msg = '0' + msg;
2156
+ for (i = 0; i < msg.length; i += 2)
2157
+ res.push(parseInt(msg[i] + msg[i + 1], 16));
2158
+ }
2159
+ } else {
2160
+ for (i = 0; i < msg.length; i++)
2161
+ res[i] = msg[i] | 0;
2162
+ }
2163
+ return res;
2164
+ }
2165
+ exports.toArray = toArray;
2166
+
2167
+ function toHex(msg) {
2168
+ var res = '';
2169
+ for (var i = 0; i < msg.length; i++)
2170
+ res += zero2(msg[i].toString(16));
2171
+ return res;
2172
+ }
2173
+ exports.toHex = toHex;
2174
+
2175
+ function htonl(w) {
2176
+ var res = (w >>> 24) |
2177
+ ((w >>> 8) & 0xff00) |
2178
+ ((w << 8) & 0xff0000) |
2179
+ ((w & 0xff) << 24);
2180
+ return res >>> 0;
2181
+ }
2182
+ exports.htonl = htonl;
2183
+
2184
+ function toHex32(msg, endian) {
2185
+ var res = '';
2186
+ for (var i = 0; i < msg.length; i++) {
2187
+ var w = msg[i];
2188
+ if (endian === 'little')
2189
+ w = htonl(w);
2190
+ res += zero8(w.toString(16));
2191
+ }
2192
+ return res;
2193
+ }
2194
+ exports.toHex32 = toHex32;
2195
+
2196
+ function zero2(word) {
2197
+ if (word.length === 1)
2198
+ return '0' + word;
2199
+ else
2200
+ return word;
2201
+ }
2202
+ exports.zero2 = zero2;
2203
+
2204
+ function zero8(word) {
2205
+ if (word.length === 7)
2206
+ return '0' + word;
2207
+ else if (word.length === 6)
2208
+ return '00' + word;
2209
+ else if (word.length === 5)
2210
+ return '000' + word;
2211
+ else if (word.length === 4)
2212
+ return '0000' + word;
2213
+ else if (word.length === 3)
2214
+ return '00000' + word;
2215
+ else if (word.length === 2)
2216
+ return '000000' + word;
2217
+ else if (word.length === 1)
2218
+ return '0000000' + word;
2219
+ else
2220
+ return word;
2221
+ }
2222
+ exports.zero8 = zero8;
2223
+
2224
+ function join32(msg, start, end, endian) {
2225
+ var len = end - start;
2226
+ assert(len % 4 === 0);
2227
+ var res = new Array(len / 4);
2228
+ for (var i = 0, k = start; i < res.length; i++, k += 4) {
2229
+ var w;
2230
+ if (endian === 'big')
2231
+ w = (msg[k] << 24) | (msg[k + 1] << 16) | (msg[k + 2] << 8) | msg[k + 3];
2232
+ else
2233
+ w = (msg[k + 3] << 24) | (msg[k + 2] << 16) | (msg[k + 1] << 8) | msg[k];
2234
+ res[i] = w >>> 0;
2235
+ }
2236
+ return res;
2237
+ }
2238
+ exports.join32 = join32;
2239
+
2240
+ function split32(msg, endian) {
2241
+ var res = new Array(msg.length * 4);
2242
+ for (var i = 0, k = 0; i < msg.length; i++, k += 4) {
2243
+ var m = msg[i];
2244
+ if (endian === 'big') {
2245
+ res[k] = m >>> 24;
2246
+ res[k + 1] = (m >>> 16) & 0xff;
2247
+ res[k + 2] = (m >>> 8) & 0xff;
2248
+ res[k + 3] = m & 0xff;
2249
+ } else {
2250
+ res[k + 3] = m >>> 24;
2251
+ res[k + 2] = (m >>> 16) & 0xff;
2252
+ res[k + 1] = (m >>> 8) & 0xff;
2253
+ res[k] = m & 0xff;
2254
+ }
2255
+ }
2256
+ return res;
2257
+ }
2258
+ exports.split32 = split32;
2259
+
2260
+ function rotr32(w, b) {
2261
+ return (w >>> b) | (w << (32 - b));
2262
+ }
2263
+ exports.rotr32 = rotr32;
2264
+
2265
+ function rotl32(w, b) {
2266
+ return (w << b) | (w >>> (32 - b));
2267
+ }
2268
+ exports.rotl32 = rotl32;
2269
+
2270
+ function sum32(a, b) {
2271
+ return (a + b) >>> 0;
2272
+ }
2273
+ exports.sum32 = sum32;
2274
+
2275
+ function sum32_3(a, b, c) {
2276
+ return (a + b + c) >>> 0;
2277
+ }
2278
+ exports.sum32_3 = sum32_3;
2279
+
2280
+ function sum32_4(a, b, c, d) {
2281
+ return (a + b + c + d) >>> 0;
2282
+ }
2283
+ exports.sum32_4 = sum32_4;
2284
+
2285
+ function sum32_5(a, b, c, d, e) {
2286
+ return (a + b + c + d + e) >>> 0;
2287
+ }
2288
+ exports.sum32_5 = sum32_5;
2289
+
2290
+ function sum64(buf, pos, ah, al) {
2291
+ var bh = buf[pos];
2292
+ var bl = buf[pos + 1];
2293
+
2294
+ var lo = (al + bl) >>> 0;
2295
+ var hi = (lo < al ? 1 : 0) + ah + bh;
2296
+ buf[pos] = hi >>> 0;
2297
+ buf[pos + 1] = lo;
2298
+ }
2299
+ exports.sum64 = sum64;
2300
+
2301
+ function sum64_hi(ah, al, bh, bl) {
2302
+ var lo = (al + bl) >>> 0;
2303
+ var hi = (lo < al ? 1 : 0) + ah + bh;
2304
+ return hi >>> 0;
2305
+ }
2306
+ exports.sum64_hi = sum64_hi;
2307
+
2308
+ function sum64_lo(ah, al, bh, bl) {
2309
+ var lo = al + bl;
2310
+ return lo >>> 0;
2311
+ }
2312
+ exports.sum64_lo = sum64_lo;
2313
+
2314
+ function sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {
2315
+ var carry = 0;
2316
+ var lo = al;
2317
+ lo = (lo + bl) >>> 0;
2318
+ carry += lo < al ? 1 : 0;
2319
+ lo = (lo + cl) >>> 0;
2320
+ carry += lo < cl ? 1 : 0;
2321
+ lo = (lo + dl) >>> 0;
2322
+ carry += lo < dl ? 1 : 0;
2323
+
2324
+ var hi = ah + bh + ch + dh + carry;
2325
+ return hi >>> 0;
2326
+ }
2327
+ exports.sum64_4_hi = sum64_4_hi;
2328
+
2329
+ function sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {
2330
+ var lo = al + bl + cl + dl;
2331
+ return lo >>> 0;
2332
+ }
2333
+ exports.sum64_4_lo = sum64_4_lo;
2334
+
2335
+ function sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {
2336
+ var carry = 0;
2337
+ var lo = al;
2338
+ lo = (lo + bl) >>> 0;
2339
+ carry += lo < al ? 1 : 0;
2340
+ lo = (lo + cl) >>> 0;
2341
+ carry += lo < cl ? 1 : 0;
2342
+ lo = (lo + dl) >>> 0;
2343
+ carry += lo < dl ? 1 : 0;
2344
+ lo = (lo + el) >>> 0;
2345
+ carry += lo < el ? 1 : 0;
2346
+
2347
+ var hi = ah + bh + ch + dh + eh + carry;
2348
+ return hi >>> 0;
2349
+ }
2350
+ exports.sum64_5_hi = sum64_5_hi;
2351
+
2352
+ function sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {
2353
+ var lo = al + bl + cl + dl + el;
2354
+
2355
+ return lo >>> 0;
2356
+ }
2357
+ exports.sum64_5_lo = sum64_5_lo;
2358
+
2359
+ function rotr64_hi(ah, al, num) {
2360
+ var r = (al << (32 - num)) | (ah >>> num);
2361
+ return r >>> 0;
2362
+ }
2363
+ exports.rotr64_hi = rotr64_hi;
2364
+
2365
+ function rotr64_lo(ah, al, num) {
2366
+ var r = (ah << (32 - num)) | (al >>> num);
2367
+ return r >>> 0;
2368
+ }
2369
+ exports.rotr64_lo = rotr64_lo;
2370
+
2371
+ function shr64_hi(ah, al, num) {
2372
+ return ah >>> num;
2373
+ }
2374
+ exports.shr64_hi = shr64_hi;
2375
+
2376
+ function shr64_lo(ah, al, num) {
2377
+ var r = (ah << (32 - num)) | (al >>> num);
2378
+ return r >>> 0;
2379
+ }
2380
+ exports.shr64_lo = shr64_lo;
2381
+
2382
+
2383
+ /***/ }),
2384
+
2385
+ /***/ 1285:
2386
+ /***/ (function(module) {
2387
+
2388
+ if (typeof Object.create === 'function') {
2389
+ // implementation from standard node.js 'util' module
2390
+ module.exports = function inherits(ctor, superCtor) {
2391
+ if (superCtor) {
2392
+ ctor.super_ = superCtor
2393
+ ctor.prototype = Object.create(superCtor.prototype, {
2394
+ constructor: {
2395
+ value: ctor,
2396
+ enumerable: false,
2397
+ writable: true,
2398
+ configurable: true
2399
+ }
2400
+ })
2401
+ }
2402
+ };
2403
+ } else {
2404
+ // old school shim for old browsers
2405
+ module.exports = function inherits(ctor, superCtor) {
2406
+ if (superCtor) {
2407
+ ctor.super_ = superCtor
2408
+ var TempCtor = function () {}
2409
+ TempCtor.prototype = superCtor.prototype
2410
+ ctor.prototype = new TempCtor()
2411
+ ctor.prototype.constructor = ctor
2412
+ }
2413
+ }
2414
+ }
2415
+
2416
+
2417
+ /***/ }),
2418
+
2419
+ /***/ 7839:
2420
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
2421
+
2422
+ var events = __webpack_require__(2699)
2423
+ var inherits = __webpack_require__(1285)
2424
+
2425
+ module.exports = LRU
2426
+
2427
+ function LRU (opts) {
2428
+ if (!(this instanceof LRU)) return new LRU(opts)
2429
+ if (typeof opts === 'number') opts = {max: opts}
2430
+ if (!opts) opts = {}
2431
+ events.EventEmitter.call(this)
2432
+ this.cache = {}
2433
+ this.head = this.tail = null
2434
+ this.length = 0
2435
+ this.max = opts.max || 1000
2436
+ this.maxAge = opts.maxAge || 0
2437
+ }
2438
+
2439
+ inherits(LRU, events.EventEmitter)
2440
+
2441
+ Object.defineProperty(LRU.prototype, 'keys', {
2442
+ get: function () { return Object.keys(this.cache) }
2443
+ })
2444
+
2445
+ LRU.prototype.clear = function () {
2446
+ this.cache = {}
2447
+ this.head = this.tail = null
2448
+ this.length = 0
2449
+ }
2450
+
2451
+ LRU.prototype.remove = function (key) {
2452
+ if (typeof key !== 'string') key = '' + key
2453
+ if (!this.cache.hasOwnProperty(key)) return
2454
+
2455
+ var element = this.cache[key]
2456
+ delete this.cache[key]
2457
+ this._unlink(key, element.prev, element.next)
2458
+ return element.value
2459
+ }
2460
+
2461
+ LRU.prototype._unlink = function (key, prev, next) {
2462
+ this.length--
2463
+
2464
+ if (this.length === 0) {
2465
+ this.head = this.tail = null
2466
+ } else {
2467
+ if (this.head === key) {
2468
+ this.head = prev
2469
+ this.cache[this.head].next = null
2470
+ } else if (this.tail === key) {
2471
+ this.tail = next
2472
+ this.cache[this.tail].prev = null
2473
+ } else {
2474
+ this.cache[prev].next = next
2475
+ this.cache[next].prev = prev
2476
+ }
2477
+ }
2478
+ }
2479
+
2480
+ LRU.prototype.peek = function (key) {
2481
+ if (!this.cache.hasOwnProperty(key)) return
2482
+
2483
+ var element = this.cache[key]
2484
+
2485
+ if (!this._checkAge(key, element)) return
2486
+ return element.value
2487
+ }
2488
+
2489
+ LRU.prototype.set = function (key, value) {
2490
+ if (typeof key !== 'string') key = '' + key
2491
+
2492
+ var element
2493
+
2494
+ if (this.cache.hasOwnProperty(key)) {
2495
+ element = this.cache[key]
2496
+ element.value = value
2497
+ if (this.maxAge) element.modified = Date.now()
2498
+
2499
+ // If it's already the head, there's nothing more to do:
2500
+ if (key === this.head) return value
2501
+ this._unlink(key, element.prev, element.next)
2502
+ } else {
2503
+ element = {value: value, modified: 0, next: null, prev: null}
2504
+ if (this.maxAge) element.modified = Date.now()
2505
+ this.cache[key] = element
2506
+
2507
+ // Eviction is only possible if the key didn't already exist:
2508
+ if (this.length === this.max) this.evict()
2509
+ }
2510
+
2511
+ this.length++
2512
+ element.next = null
2513
+ element.prev = this.head
2514
+
2515
+ if (this.head) this.cache[this.head].next = key
2516
+ this.head = key
2517
+
2518
+ if (!this.tail) this.tail = key
2519
+ return value
2520
+ }
2521
+
2522
+ LRU.prototype._checkAge = function (key, element) {
2523
+ if (this.maxAge && (Date.now() - element.modified) > this.maxAge) {
2524
+ this.remove(key)
2525
+ this.emit('evict', {key: key, value: element.value})
2526
+ return false
2527
+ }
2528
+ return true
2529
+ }
2530
+
2531
+ LRU.prototype.get = function (key) {
2532
+ if (typeof key !== 'string') key = '' + key
2533
+ if (!this.cache.hasOwnProperty(key)) return
2534
+
2535
+ var element = this.cache[key]
2536
+
2537
+ if (!this._checkAge(key, element)) return
2538
+
2539
+ if (this.head !== key) {
2540
+ if (key === this.tail) {
2541
+ this.tail = element.next
2542
+ this.cache[this.tail].prev = null
2543
+ } else {
2544
+ // Set prev.next -> element.next:
2545
+ this.cache[element.prev].next = element.next
2546
+ }
2547
+
2548
+ // Set element.next.prev -> element.prev:
2549
+ this.cache[element.next].prev = element.prev
2550
+
2551
+ // Element is the new head
2552
+ this.cache[this.head].next = key
2553
+ element.prev = this.head
2554
+ element.next = null
2555
+ this.head = key
2556
+ }
2557
+
2558
+ return element.value
2559
+ }
2560
+
2561
+ LRU.prototype.evict = function () {
2562
+ if (!this.tail) return
2563
+ var key = this.tail
2564
+ var value = this.remove(this.tail)
2565
+ this.emit('evict', {key: key, value: value})
2566
+ }
2567
+
2568
+
2569
+ /***/ }),
2570
+
2571
+ /***/ 9561:
2572
+ /***/ (function(module) {
2573
+
2574
+ module.exports = assert;
2575
+
2576
+ function assert(val, msg) {
2577
+ if (!val)
2578
+ throw new Error(msg || 'Assertion failed');
2579
+ }
2580
+
2581
+ assert.equal = function assertEqual(l, r, msg) {
2582
+ if (l != r)
2583
+ throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r));
2584
+ };
2585
+
2586
+
2587
+ /***/ }),
2588
+
2589
+ /***/ 9500:
2590
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
2591
+
2592
+ var hasMap = typeof Map === 'function' && Map.prototype;
2593
+ var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
2594
+ var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
2595
+ var mapForEach = hasMap && Map.prototype.forEach;
2596
+ var hasSet = typeof Set === 'function' && Set.prototype;
2597
+ var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;
2598
+ var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;
2599
+ var setForEach = hasSet && Set.prototype.forEach;
2600
+ var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;
2601
+ var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
2602
+ var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;
2603
+ var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
2604
+ var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;
2605
+ var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
2606
+ var booleanValueOf = Boolean.prototype.valueOf;
2607
+ var objectToString = Object.prototype.toString;
2608
+ var functionToString = Function.prototype.toString;
2609
+ var match = String.prototype.match;
2610
+ var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
2611
+ var gOPS = Object.getOwnPropertySymbols;
2612
+ var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
2613
+ var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
2614
+ var isEnumerable = Object.prototype.propertyIsEnumerable;
2615
+
2616
+ var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (
2617
+ [].__proto__ === Array.prototype // eslint-disable-line no-proto
2618
+ ? function (O) {
2619
+ return O.__proto__; // eslint-disable-line no-proto
2620
+ }
2621
+ : null
2622
+ );
2623
+
2624
+ var inspectCustom = (__webpack_require__(3260).custom);
2625
+ var inspectSymbol = inspectCustom && isSymbol(inspectCustom) ? inspectCustom : null;
2626
+ var toStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag !== 'undefined' ? Symbol.toStringTag : null;
2627
+
2628
+ module.exports = function inspect_(obj, options, depth, seen) {
2629
+ var opts = options || {};
2630
+
2631
+ if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {
2632
+ throw new TypeError('option "quoteStyle" must be "single" or "double"');
2633
+ }
2634
+ if (
2635
+ has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'
2636
+ ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity
2637
+ : opts.maxStringLength !== null
2638
+ )
2639
+ ) {
2640
+ throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
2641
+ }
2642
+ var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;
2643
+ if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {
2644
+ throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');
2645
+ }
2646
+
2647
+ if (
2648
+ has(opts, 'indent')
2649
+ && opts.indent !== null
2650
+ && opts.indent !== '\t'
2651
+ && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)
2652
+ ) {
2653
+ throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`');
2654
+ }
2655
+
2656
+ if (typeof obj === 'undefined') {
2657
+ return 'undefined';
2658
+ }
2659
+ if (obj === null) {
2660
+ return 'null';
2661
+ }
2662
+ if (typeof obj === 'boolean') {
2663
+ return obj ? 'true' : 'false';
2664
+ }
2665
+
2666
+ if (typeof obj === 'string') {
2667
+ return inspectString(obj, opts);
2668
+ }
2669
+ if (typeof obj === 'number') {
2670
+ if (obj === 0) {
2671
+ return Infinity / obj > 0 ? '0' : '-0';
2672
+ }
2673
+ return String(obj);
2674
+ }
2675
+ if (typeof obj === 'bigint') {
2676
+ return String(obj) + 'n';
2677
+ }
2678
+
2679
+ var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
2680
+ if (typeof depth === 'undefined') { depth = 0; }
2681
+ if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {
2682
+ return isArray(obj) ? '[Array]' : '[Object]';
2683
+ }
2684
+
2685
+ var indent = getIndent(opts, depth);
2686
+
2687
+ if (typeof seen === 'undefined') {
2688
+ seen = [];
2689
+ } else if (indexOf(seen, obj) >= 0) {
2690
+ return '[Circular]';
2691
+ }
2692
+
2693
+ function inspect(value, from, noIndent) {
2694
+ if (from) {
2695
+ seen = seen.slice();
2696
+ seen.push(from);
2697
+ }
2698
+ if (noIndent) {
2699
+ var newOpts = {
2700
+ depth: opts.depth
2701
+ };
2702
+ if (has(opts, 'quoteStyle')) {
2703
+ newOpts.quoteStyle = opts.quoteStyle;
2704
+ }
2705
+ return inspect_(value, newOpts, depth + 1, seen);
2706
+ }
2707
+ return inspect_(value, opts, depth + 1, seen);
2708
+ }
2709
+
2710
+ if (typeof obj === 'function') {
2711
+ var name = nameOf(obj);
2712
+ var keys = arrObjKeys(obj, inspect);
2713
+ return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + keys.join(', ') + ' }' : '');
2714
+ }
2715
+ if (isSymbol(obj)) {
2716
+ var symString = hasShammedSymbols ? String(obj).replace(/^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
2717
+ return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
2718
+ }
2719
+ if (isElement(obj)) {
2720
+ var s = '<' + String(obj.nodeName).toLowerCase();
2721
+ var attrs = obj.attributes || [];
2722
+ for (var i = 0; i < attrs.length; i++) {
2723
+ s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);
2724
+ }
2725
+ s += '>';
2726
+ if (obj.childNodes && obj.childNodes.length) { s += '...'; }
2727
+ s += '</' + String(obj.nodeName).toLowerCase() + '>';
2728
+ return s;
2729
+ }
2730
+ if (isArray(obj)) {
2731
+ if (obj.length === 0) { return '[]'; }
2732
+ var xs = arrObjKeys(obj, inspect);
2733
+ if (indent && !singleLineValues(xs)) {
2734
+ return '[' + indentedJoin(xs, indent) + ']';
2735
+ }
2736
+ return '[ ' + xs.join(', ') + ' ]';
2737
+ }
2738
+ if (isError(obj)) {
2739
+ var parts = arrObjKeys(obj, inspect);
2740
+ if (parts.length === 0) { return '[' + String(obj) + ']'; }
2741
+ return '{ [' + String(obj) + '] ' + parts.join(', ') + ' }';
2742
+ }
2743
+ if (typeof obj === 'object' && customInspect) {
2744
+ if (inspectSymbol && typeof obj[inspectSymbol] === 'function') {
2745
+ return obj[inspectSymbol]();
2746
+ } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
2747
+ return obj.inspect();
2748
+ }
2749
+ }
2750
+ if (isMap(obj)) {
2751
+ var mapParts = [];
2752
+ mapForEach.call(obj, function (value, key) {
2753
+ mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));
2754
+ });
2755
+ return collectionOf('Map', mapSize.call(obj), mapParts, indent);
2756
+ }
2757
+ if (isSet(obj)) {
2758
+ var setParts = [];
2759
+ setForEach.call(obj, function (value) {
2760
+ setParts.push(inspect(value, obj));
2761
+ });
2762
+ return collectionOf('Set', setSize.call(obj), setParts, indent);
2763
+ }
2764
+ if (isWeakMap(obj)) {
2765
+ return weakCollectionOf('WeakMap');
2766
+ }
2767
+ if (isWeakSet(obj)) {
2768
+ return weakCollectionOf('WeakSet');
2769
+ }
2770
+ if (isWeakRef(obj)) {
2771
+ return weakCollectionOf('WeakRef');
2772
+ }
2773
+ if (isNumber(obj)) {
2774
+ return markBoxed(inspect(Number(obj)));
2775
+ }
2776
+ if (isBigInt(obj)) {
2777
+ return markBoxed(inspect(bigIntValueOf.call(obj)));
2778
+ }
2779
+ if (isBoolean(obj)) {
2780
+ return markBoxed(booleanValueOf.call(obj));
2781
+ }
2782
+ if (isString(obj)) {
2783
+ return markBoxed(inspect(String(obj)));
2784
+ }
2785
+ if (!isDate(obj) && !isRegExp(obj)) {
2786
+ var ys = arrObjKeys(obj, inspect);
2787
+ var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
2788
+ var protoTag = obj instanceof Object ? '' : 'null prototype';
2789
+ var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? toStr(obj).slice(8, -1) : protoTag ? 'Object' : '';
2790
+ var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';
2791
+ var tag = constructorTag + (stringTag || protoTag ? '[' + [].concat(stringTag || [], protoTag || []).join(': ') + '] ' : '');
2792
+ if (ys.length === 0) { return tag + '{}'; }
2793
+ if (indent) {
2794
+ return tag + '{' + indentedJoin(ys, indent) + '}';
2795
+ }
2796
+ return tag + '{ ' + ys.join(', ') + ' }';
2797
+ }
2798
+ return String(obj);
2799
+ };
2800
+
2801
+ function wrapQuotes(s, defaultStyle, opts) {
2802
+ var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'";
2803
+ return quoteChar + s + quoteChar;
2804
+ }
2805
+
2806
+ function quote(s) {
2807
+ return String(s).replace(/"/g, '&quot;');
2808
+ }
2809
+
2810
+ function isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
2811
+ function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
2812
+ function isRegExp(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
2813
+ function isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
2814
+ function isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
2815
+ function isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
2816
+ function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
2817
+
2818
+ // Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
2819
+ function isSymbol(obj) {
2820
+ if (hasShammedSymbols) {
2821
+ return obj && typeof obj === 'object' && obj instanceof Symbol;
2822
+ }
2823
+ if (typeof obj === 'symbol') {
2824
+ return true;
2825
+ }
2826
+ if (!obj || typeof obj !== 'object' || !symToString) {
2827
+ return false;
2828
+ }
2829
+ try {
2830
+ symToString.call(obj);
2831
+ return true;
2832
+ } catch (e) {}
2833
+ return false;
2834
+ }
2835
+
2836
+ function isBigInt(obj) {
2837
+ if (!obj || typeof obj !== 'object' || !bigIntValueOf) {
2838
+ return false;
2839
+ }
2840
+ try {
2841
+ bigIntValueOf.call(obj);
2842
+ return true;
2843
+ } catch (e) {}
2844
+ return false;
2845
+ }
2846
+
2847
+ var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };
2848
+ function has(obj, key) {
2849
+ return hasOwn.call(obj, key);
2850
+ }
2851
+
2852
+ function toStr(obj) {
2853
+ return objectToString.call(obj);
2854
+ }
2855
+
2856
+ function nameOf(f) {
2857
+ if (f.name) { return f.name; }
2858
+ var m = match.call(functionToString.call(f), /^function\s*([\w$]+)/);
2859
+ if (m) { return m[1]; }
2860
+ return null;
2861
+ }
2862
+
2863
+ function indexOf(xs, x) {
2864
+ if (xs.indexOf) { return xs.indexOf(x); }
2865
+ for (var i = 0, l = xs.length; i < l; i++) {
2866
+ if (xs[i] === x) { return i; }
2867
+ }
2868
+ return -1;
2869
+ }
2870
+
2871
+ function isMap(x) {
2872
+ if (!mapSize || !x || typeof x !== 'object') {
2873
+ return false;
2874
+ }
2875
+ try {
2876
+ mapSize.call(x);
2877
+ try {
2878
+ setSize.call(x);
2879
+ } catch (s) {
2880
+ return true;
2881
+ }
2882
+ return x instanceof Map; // core-js workaround, pre-v2.5.0
2883
+ } catch (e) {}
2884
+ return false;
2885
+ }
2886
+
2887
+ function isWeakMap(x) {
2888
+ if (!weakMapHas || !x || typeof x !== 'object') {
2889
+ return false;
2890
+ }
2891
+ try {
2892
+ weakMapHas.call(x, weakMapHas);
2893
+ try {
2894
+ weakSetHas.call(x, weakSetHas);
2895
+ } catch (s) {
2896
+ return true;
2897
+ }
2898
+ return x instanceof WeakMap; // core-js workaround, pre-v2.5.0
2899
+ } catch (e) {}
2900
+ return false;
2901
+ }
2902
+
2903
+ function isWeakRef(x) {
2904
+ if (!weakRefDeref || !x || typeof x !== 'object') {
2905
+ return false;
2906
+ }
2907
+ try {
2908
+ weakRefDeref.call(x);
2909
+ return true;
2910
+ } catch (e) {}
2911
+ return false;
2912
+ }
2913
+
2914
+ function isSet(x) {
2915
+ if (!setSize || !x || typeof x !== 'object') {
2916
+ return false;
2917
+ }
2918
+ try {
2919
+ setSize.call(x);
2920
+ try {
2921
+ mapSize.call(x);
2922
+ } catch (m) {
2923
+ return true;
2924
+ }
2925
+ return x instanceof Set; // core-js workaround, pre-v2.5.0
2926
+ } catch (e) {}
2927
+ return false;
2928
+ }
2929
+
2930
+ function isWeakSet(x) {
2931
+ if (!weakSetHas || !x || typeof x !== 'object') {
2932
+ return false;
2933
+ }
2934
+ try {
2935
+ weakSetHas.call(x, weakSetHas);
2936
+ try {
2937
+ weakMapHas.call(x, weakMapHas);
2938
+ } catch (s) {
2939
+ return true;
2940
+ }
2941
+ return x instanceof WeakSet; // core-js workaround, pre-v2.5.0
2942
+ } catch (e) {}
2943
+ return false;
2944
+ }
2945
+
2946
+ function isElement(x) {
2947
+ if (!x || typeof x !== 'object') { return false; }
2948
+ if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {
2949
+ return true;
2950
+ }
2951
+ return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';
2952
+ }
2953
+
2954
+ function inspectString(str, opts) {
2955
+ if (str.length > opts.maxStringLength) {
2956
+ var remaining = str.length - opts.maxStringLength;
2957
+ var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
2958
+ return inspectString(str.slice(0, opts.maxStringLength), opts) + trailer;
2959
+ }
2960
+ // eslint-disable-next-line no-control-regex
2961
+ var s = str.replace(/(['\\])/g, '\\$1').replace(/[\x00-\x1f]/g, lowbyte);
2962
+ return wrapQuotes(s, 'single', opts);
2963
+ }
2964
+
2965
+ function lowbyte(c) {
2966
+ var n = c.charCodeAt(0);
2967
+ var x = {
2968
+ 8: 'b',
2969
+ 9: 't',
2970
+ 10: 'n',
2971
+ 12: 'f',
2972
+ 13: 'r'
2973
+ }[n];
2974
+ if (x) { return '\\' + x; }
2975
+ return '\\x' + (n < 0x10 ? '0' : '') + n.toString(16).toUpperCase();
2976
+ }
2977
+
2978
+ function markBoxed(str) {
2979
+ return 'Object(' + str + ')';
2980
+ }
2981
+
2982
+ function weakCollectionOf(type) {
2983
+ return type + ' { ? }';
2984
+ }
2985
+
2986
+ function collectionOf(type, size, entries, indent) {
2987
+ var joinedEntries = indent ? indentedJoin(entries, indent) : entries.join(', ');
2988
+ return type + ' (' + size + ') {' + joinedEntries + '}';
2989
+ }
2990
+
2991
+ function singleLineValues(xs) {
2992
+ for (var i = 0; i < xs.length; i++) {
2993
+ if (indexOf(xs[i], '\n') >= 0) {
2994
+ return false;
2995
+ }
2996
+ }
2997
+ return true;
2998
+ }
2999
+
3000
+ function getIndent(opts, depth) {
3001
+ var baseIndent;
3002
+ if (opts.indent === '\t') {
3003
+ baseIndent = '\t';
3004
+ } else if (typeof opts.indent === 'number' && opts.indent > 0) {
3005
+ baseIndent = Array(opts.indent + 1).join(' ');
3006
+ } else {
3007
+ return null;
3008
+ }
3009
+ return {
3010
+ base: baseIndent,
3011
+ prev: Array(depth + 1).join(baseIndent)
3012
+ };
3013
+ }
3014
+
3015
+ function indentedJoin(xs, indent) {
3016
+ if (xs.length === 0) { return ''; }
3017
+ var lineJoiner = '\n' + indent.prev + indent.base;
3018
+ return lineJoiner + xs.join(',' + lineJoiner) + '\n' + indent.prev;
3019
+ }
3020
+
3021
+ function arrObjKeys(obj, inspect) {
3022
+ var isArr = isArray(obj);
3023
+ var xs = [];
3024
+ if (isArr) {
3025
+ xs.length = obj.length;
3026
+ for (var i = 0; i < obj.length; i++) {
3027
+ xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';
3028
+ }
3029
+ }
3030
+ var syms = typeof gOPS === 'function' ? gOPS(obj) : [];
3031
+ var symMap;
3032
+ if (hasShammedSymbols) {
3033
+ symMap = {};
3034
+ for (var k = 0; k < syms.length; k++) {
3035
+ symMap['$' + syms[k]] = syms[k];
3036
+ }
3037
+ }
3038
+
3039
+ for (var key in obj) { // eslint-disable-line no-restricted-syntax
3040
+ if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
3041
+ if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
3042
+ if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
3043
+ // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
3044
+ continue; // eslint-disable-line no-restricted-syntax, no-continue
3045
+ } else if ((/[^\w$]/).test(key)) {
3046
+ xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
3047
+ } else {
3048
+ xs.push(key + ': ' + inspect(obj[key], obj));
3049
+ }
3050
+ }
3051
+ if (typeof gOPS === 'function') {
3052
+ for (var j = 0; j < syms.length; j++) {
3053
+ if (isEnumerable.call(obj, syms[j])) {
3054
+ xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));
3055
+ }
3056
+ }
3057
+ }
3058
+ return xs;
3059
+ }
3060
+
3061
+
3062
+ /***/ }),
3063
+
3064
+ /***/ 8650:
3065
+ /***/ (function(module) {
3066
+
3067
+
3068
+ var NativeProgressEvent = window.ProgressEvent;
3069
+ var useNative = !!NativeProgressEvent;
3070
+
3071
+ try {
3072
+ (function () {
3073
+ var p = new NativeProgressEvent('loaded');
3074
+ useNative = 'loaded' === p.type;
3075
+ p = null;
3076
+ })();
3077
+ } catch (e) {
3078
+ useNative = false;
3079
+ }
3080
+
3081
+ /**
3082
+ * Cross-browser `ProgressEvent` constructor.
3083
+ *
3084
+ * https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent.ProgressEvent
3085
+ *
3086
+ * @public
3087
+ */
3088
+
3089
+ module.exports = useNative ? NativeProgressEvent :
3090
+
3091
+ // IE >= 9
3092
+ 'function' === typeof document.createEvent ? function ProgressEvent (type, props) {
3093
+ var e = document.createEvent('Event');
3094
+ e.initEvent(type, false, false);
3095
+ if (props) {
3096
+ e.lengthComputable = Boolean(props.lengthComputable);
3097
+ e.loaded = Number(props.loaded) || 0;
3098
+ e.total = Number(props.total) || 0;
3099
+ } else {
3100
+ e.lengthComputable = false;
3101
+ e.loaded = e.total = 0;
3102
+ }
3103
+ return e;
3104
+ } :
3105
+
3106
+ // IE <= 8
3107
+ function ProgressEvent (type, props) {
3108
+ var e = document.createEventObject();
3109
+ e.type = type;
3110
+ if (props) {
3111
+ e.lengthComputable = Boolean(props.lengthComputable);
3112
+ e.loaded = Number(props.loaded) || 0;
3113
+ e.total = Number(props.total) || 0;
3114
+ } else {
3115
+ e.lengthComputable = false;
3116
+ e.loaded = e.total = 0;
3117
+ }
3118
+ return e;
3119
+ }
3120
+
3121
+
3122
+ /***/ }),
3123
+
3124
+ /***/ 5527:
3125
+ /***/ (function(module) {
3126
+
3127
+ "use strict";
3128
+
3129
+
3130
+ var replace = String.prototype.replace;
3131
+ var percentTwenties = /%20/g;
3132
+
3133
+ var Format = {
3134
+ RFC1738: 'RFC1738',
3135
+ RFC3986: 'RFC3986'
3136
+ };
3137
+
3138
+ module.exports = {
3139
+ 'default': Format.RFC3986,
3140
+ formatters: {
3141
+ RFC1738: function (value) {
3142
+ return replace.call(value, percentTwenties, '+');
3143
+ },
3144
+ RFC3986: function (value) {
3145
+ return String(value);
3146
+ }
3147
+ },
3148
+ RFC1738: Format.RFC1738,
3149
+ RFC3986: Format.RFC3986
3150
+ };
3151
+
3152
+
3153
+ /***/ }),
3154
+
3155
+ /***/ 9126:
3156
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
3157
+
3158
+ "use strict";
3159
+
3160
+
3161
+ var stringify = __webpack_require__(6845);
3162
+ var parse = __webpack_require__(9166);
3163
+ var formats = __webpack_require__(5527);
3164
+
3165
+ module.exports = {
3166
+ formats: formats,
3167
+ parse: parse,
3168
+ stringify: stringify
3169
+ };
3170
+
3171
+
3172
+ /***/ }),
3173
+
3174
+ /***/ 9166:
3175
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
3176
+
3177
+ "use strict";
3178
+
3179
+
3180
+ var utils = __webpack_require__(2493);
3181
+
3182
+ var has = Object.prototype.hasOwnProperty;
3183
+ var isArray = Array.isArray;
3184
+
3185
+ var defaults = {
3186
+ allowDots: false,
3187
+ allowPrototypes: false,
3188
+ allowSparse: false,
3189
+ arrayLimit: 20,
3190
+ charset: 'utf-8',
3191
+ charsetSentinel: false,
3192
+ comma: false,
3193
+ decoder: utils.decode,
3194
+ delimiter: '&',
3195
+ depth: 5,
3196
+ ignoreQueryPrefix: false,
3197
+ interpretNumericEntities: false,
3198
+ parameterLimit: 1000,
3199
+ parseArrays: true,
3200
+ plainObjects: false,
3201
+ strictNullHandling: false
3202
+ };
3203
+
3204
+ var interpretNumericEntities = function (str) {
3205
+ return str.replace(/&#(\d+);/g, function ($0, numberStr) {
3206
+ return String.fromCharCode(parseInt(numberStr, 10));
3207
+ });
3208
+ };
3209
+
3210
+ var parseArrayValue = function (val, options) {
3211
+ if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
3212
+ return val.split(',');
3213
+ }
3214
+
3215
+ return val;
3216
+ };
3217
+
3218
+ // This is what browsers will submit when the ✓ character occurs in an
3219
+ // application/x-www-form-urlencoded body and the encoding of the page containing
3220
+ // the form is iso-8859-1, or when the submitted form has an accept-charset
3221
+ // attribute of iso-8859-1. Presumably also with other charsets that do not contain
3222
+ // the ✓ character, such as us-ascii.
3223
+ var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('&#10003;')
3224
+
3225
+ // These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
3226
+ var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
3227
+
3228
+ var parseValues = function parseQueryStringValues(str, options) {
3229
+ var obj = {};
3230
+ var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
3231
+ var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
3232
+ var parts = cleanStr.split(options.delimiter, limit);
3233
+ var skipIndex = -1; // Keep track of where the utf8 sentinel was found
3234
+ var i;
3235
+
3236
+ var charset = options.charset;
3237
+ if (options.charsetSentinel) {
3238
+ for (i = 0; i < parts.length; ++i) {
3239
+ if (parts[i].indexOf('utf8=') === 0) {
3240
+ if (parts[i] === charsetSentinel) {
3241
+ charset = 'utf-8';
3242
+ } else if (parts[i] === isoSentinel) {
3243
+ charset = 'iso-8859-1';
3244
+ }
3245
+ skipIndex = i;
3246
+ i = parts.length; // The eslint settings do not allow break;
3247
+ }
3248
+ }
3249
+ }
3250
+
3251
+ for (i = 0; i < parts.length; ++i) {
3252
+ if (i === skipIndex) {
3253
+ continue;
3254
+ }
3255
+ var part = parts[i];
3256
+
3257
+ var bracketEqualsPos = part.indexOf(']=');
3258
+ var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
3259
+
3260
+ var key, val;
3261
+ if (pos === -1) {
3262
+ key = options.decoder(part, defaults.decoder, charset, 'key');
3263
+ val = options.strictNullHandling ? null : '';
3264
+ } else {
3265
+ key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
3266
+ val = utils.maybeMap(
3267
+ parseArrayValue(part.slice(pos + 1), options),
3268
+ function (encodedVal) {
3269
+ return options.decoder(encodedVal, defaults.decoder, charset, 'value');
3270
+ }
3271
+ );
3272
+ }
3273
+
3274
+ if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
3275
+ val = interpretNumericEntities(val);
3276
+ }
3277
+
3278
+ if (part.indexOf('[]=') > -1) {
3279
+ val = isArray(val) ? [val] : val;
3280
+ }
3281
+
3282
+ if (has.call(obj, key)) {
3283
+ obj[key] = utils.combine(obj[key], val);
3284
+ } else {
3285
+ obj[key] = val;
3286
+ }
3287
+ }
3288
+
3289
+ return obj;
3290
+ };
3291
+
3292
+ var parseObject = function (chain, val, options, valuesParsed) {
3293
+ var leaf = valuesParsed ? val : parseArrayValue(val, options);
3294
+
3295
+ for (var i = chain.length - 1; i >= 0; --i) {
3296
+ var obj;
3297
+ var root = chain[i];
3298
+
3299
+ if (root === '[]' && options.parseArrays) {
3300
+ obj = [].concat(leaf);
3301
+ } else {
3302
+ obj = options.plainObjects ? Object.create(null) : {};
3303
+ var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
3304
+ var index = parseInt(cleanRoot, 10);
3305
+ if (!options.parseArrays && cleanRoot === '') {
3306
+ obj = { 0: leaf };
3307
+ } else if (
3308
+ !isNaN(index)
3309
+ && root !== cleanRoot
3310
+ && String(index) === cleanRoot
3311
+ && index >= 0
3312
+ && (options.parseArrays && index <= options.arrayLimit)
3313
+ ) {
3314
+ obj = [];
3315
+ obj[index] = leaf;
3316
+ } else if (cleanRoot !== '__proto__') {
3317
+ obj[cleanRoot] = leaf;
3318
+ }
3319
+ }
3320
+
3321
+ leaf = obj;
3322
+ }
3323
+
3324
+ return leaf;
3325
+ };
3326
+
3327
+ var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
3328
+ if (!givenKey) {
3329
+ return;
3330
+ }
3331
+
3332
+ // Transform dot notation to bracket notation
3333
+ var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
3334
+
3335
+ // The regex chunks
3336
+
3337
+ var brackets = /(\[[^[\]]*])/;
3338
+ var child = /(\[[^[\]]*])/g;
3339
+
3340
+ // Get the parent
3341
+
3342
+ var segment = options.depth > 0 && brackets.exec(key);
3343
+ var parent = segment ? key.slice(0, segment.index) : key;
3344
+
3345
+ // Stash the parent if it exists
3346
+
3347
+ var keys = [];
3348
+ if (parent) {
3349
+ // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
3350
+ if (!options.plainObjects && has.call(Object.prototype, parent)) {
3351
+ if (!options.allowPrototypes) {
3352
+ return;
3353
+ }
3354
+ }
3355
+
3356
+ keys.push(parent);
3357
+ }
3358
+
3359
+ // Loop through children appending to the array until we hit depth
3360
+
3361
+ var i = 0;
3362
+ while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
3363
+ i += 1;
3364
+ if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
3365
+ if (!options.allowPrototypes) {
3366
+ return;
3367
+ }
3368
+ }
3369
+ keys.push(segment[1]);
3370
+ }
3371
+
3372
+ // If there's a remainder, just add whatever is left
3373
+
3374
+ if (segment) {
3375
+ keys.push('[' + key.slice(segment.index) + ']');
3376
+ }
3377
+
3378
+ return parseObject(keys, val, options, valuesParsed);
3379
+ };
3380
+
3381
+ var normalizeParseOptions = function normalizeParseOptions(opts) {
3382
+ if (!opts) {
3383
+ return defaults;
3384
+ }
3385
+
3386
+ if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
3387
+ throw new TypeError('Decoder has to be a function.');
3388
+ }
3389
+
3390
+ if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
3391
+ throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
3392
+ }
3393
+ var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
3394
+
3395
+ return {
3396
+ allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
3397
+ allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
3398
+ allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,
3399
+ arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
3400
+ charset: charset,
3401
+ charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
3402
+ comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
3403
+ decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
3404
+ delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
3405
+ // eslint-disable-next-line no-implicit-coercion, no-extra-parens
3406
+ depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
3407
+ ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
3408
+ interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
3409
+ parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
3410
+ parseArrays: opts.parseArrays !== false,
3411
+ plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
3412
+ strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
3413
+ };
3414
+ };
3415
+
3416
+ module.exports = function (str, opts) {
3417
+ var options = normalizeParseOptions(opts);
3418
+
3419
+ if (str === '' || str === null || typeof str === 'undefined') {
3420
+ return options.plainObjects ? Object.create(null) : {};
3421
+ }
3422
+
3423
+ var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
3424
+ var obj = options.plainObjects ? Object.create(null) : {};
3425
+
3426
+ // Iterate over the keys and setup the new object
3427
+
3428
+ var keys = Object.keys(tempObj);
3429
+ for (var i = 0; i < keys.length; ++i) {
3430
+ var key = keys[i];
3431
+ var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
3432
+ obj = utils.merge(obj, newObj, options);
3433
+ }
3434
+
3435
+ if (options.allowSparse === true) {
3436
+ return obj;
3437
+ }
3438
+
3439
+ return utils.compact(obj);
3440
+ };
3441
+
3442
+
3443
+ /***/ }),
3444
+
3445
+ /***/ 6845:
3446
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
3447
+
3448
+ "use strict";
3449
+
3450
+
3451
+ var getSideChannel = __webpack_require__(4294);
3452
+ var utils = __webpack_require__(2493);
3453
+ var formats = __webpack_require__(5527);
3454
+ var has = Object.prototype.hasOwnProperty;
3455
+
3456
+ var arrayPrefixGenerators = {
3457
+ brackets: function brackets(prefix) {
3458
+ return prefix + '[]';
3459
+ },
3460
+ comma: 'comma',
3461
+ indices: function indices(prefix, key) {
3462
+ return prefix + '[' + key + ']';
3463
+ },
3464
+ repeat: function repeat(prefix) {
3465
+ return prefix;
3466
+ }
3467
+ };
3468
+
3469
+ var isArray = Array.isArray;
3470
+ var split = String.prototype.split;
3471
+ var push = Array.prototype.push;
3472
+ var pushToArray = function (arr, valueOrArray) {
3473
+ push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);
3474
+ };
3475
+
3476
+ var toISO = Date.prototype.toISOString;
3477
+
3478
+ var defaultFormat = formats['default'];
3479
+ var defaults = {
3480
+ addQueryPrefix: false,
3481
+ allowDots: false,
3482
+ charset: 'utf-8',
3483
+ charsetSentinel: false,
3484
+ delimiter: '&',
3485
+ encode: true,
3486
+ encoder: utils.encode,
3487
+ encodeValuesOnly: false,
3488
+ format: defaultFormat,
3489
+ formatter: formats.formatters[defaultFormat],
3490
+ // deprecated
3491
+ indices: false,
3492
+ serializeDate: function serializeDate(date) {
3493
+ return toISO.call(date);
3494
+ },
3495
+ skipNulls: false,
3496
+ strictNullHandling: false
3497
+ };
3498
+
3499
+ var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
3500
+ return typeof v === 'string'
3501
+ || typeof v === 'number'
3502
+ || typeof v === 'boolean'
3503
+ || typeof v === 'symbol'
3504
+ || typeof v === 'bigint';
3505
+ };
3506
+
3507
+ var sentinel = {};
3508
+
3509
+ var stringify = function stringify(
3510
+ object,
3511
+ prefix,
3512
+ generateArrayPrefix,
3513
+ strictNullHandling,
3514
+ skipNulls,
3515
+ encoder,
3516
+ filter,
3517
+ sort,
3518
+ allowDots,
3519
+ serializeDate,
3520
+ format,
3521
+ formatter,
3522
+ encodeValuesOnly,
3523
+ charset,
3524
+ sideChannel
3525
+ ) {
3526
+ var obj = object;
3527
+
3528
+ var tmpSc = sideChannel;
3529
+ var step = 0;
3530
+ var findFlag = false;
3531
+ while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {
3532
+ // Where object last appeared in the ref tree
3533
+ var pos = tmpSc.get(object);
3534
+ step += 1;
3535
+ if (typeof pos !== 'undefined') {
3536
+ if (pos === step) {
3537
+ throw new RangeError('Cyclic object value');
3538
+ } else {
3539
+ findFlag = true; // Break while
3540
+ }
3541
+ }
3542
+ if (typeof tmpSc.get(sentinel) === 'undefined') {
3543
+ step = 0;
3544
+ }
3545
+ }
3546
+
3547
+ if (typeof filter === 'function') {
3548
+ obj = filter(prefix, obj);
3549
+ } else if (obj instanceof Date) {
3550
+ obj = serializeDate(obj);
3551
+ } else if (generateArrayPrefix === 'comma' && isArray(obj)) {
3552
+ obj = utils.maybeMap(obj, function (value) {
3553
+ if (value instanceof Date) {
3554
+ return serializeDate(value);
3555
+ }
3556
+ return value;
3557
+ });
3558
+ }
3559
+
3560
+ if (obj === null) {
3561
+ if (strictNullHandling) {
3562
+ return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix;
3563
+ }
3564
+
3565
+ obj = '';
3566
+ }
3567
+
3568
+ if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
3569
+ if (encoder) {
3570
+ var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format);
3571
+ if (generateArrayPrefix === 'comma' && encodeValuesOnly) {
3572
+ var valuesArray = split.call(String(obj), ',');
3573
+ var valuesJoined = '';
3574
+ for (var i = 0; i < valuesArray.length; ++i) {
3575
+ valuesJoined += (i === 0 ? '' : ',') + formatter(encoder(valuesArray[i], defaults.encoder, charset, 'value', format));
3576
+ }
3577
+ return [formatter(keyValue) + '=' + valuesJoined];
3578
+ }
3579
+ return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];
3580
+ }
3581
+ return [formatter(prefix) + '=' + formatter(String(obj))];
3582
+ }
3583
+
3584
+ var values = [];
3585
+
3586
+ if (typeof obj === 'undefined') {
3587
+ return values;
3588
+ }
3589
+
3590
+ var objKeys;
3591
+ if (generateArrayPrefix === 'comma' && isArray(obj)) {
3592
+ // we need to join elements in
3593
+ objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
3594
+ } else if (isArray(filter)) {
3595
+ objKeys = filter;
3596
+ } else {
3597
+ var keys = Object.keys(obj);
3598
+ objKeys = sort ? keys.sort(sort) : keys;
3599
+ }
3600
+
3601
+ for (var j = 0; j < objKeys.length; ++j) {
3602
+ var key = objKeys[j];
3603
+ var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
3604
+
3605
+ if (skipNulls && value === null) {
3606
+ continue;
3607
+ }
3608
+
3609
+ var keyPrefix = isArray(obj)
3610
+ ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix
3611
+ : prefix + (allowDots ? '.' + key : '[' + key + ']');
3612
+
3613
+ sideChannel.set(object, step);
3614
+ var valueSideChannel = getSideChannel();
3615
+ valueSideChannel.set(sentinel, sideChannel);
3616
+ pushToArray(values, stringify(
3617
+ value,
3618
+ keyPrefix,
3619
+ generateArrayPrefix,
3620
+ strictNullHandling,
3621
+ skipNulls,
3622
+ encoder,
3623
+ filter,
3624
+ sort,
3625
+ allowDots,
3626
+ serializeDate,
3627
+ format,
3628
+ formatter,
3629
+ encodeValuesOnly,
3630
+ charset,
3631
+ valueSideChannel
3632
+ ));
3633
+ }
3634
+
3635
+ return values;
3636
+ };
3637
+
3638
+ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
3639
+ if (!opts) {
3640
+ return defaults;
3641
+ }
3642
+
3643
+ if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
3644
+ throw new TypeError('Encoder has to be a function.');
3645
+ }
3646
+
3647
+ var charset = opts.charset || defaults.charset;
3648
+ if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
3649
+ throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
3650
+ }
3651
+
3652
+ var format = formats['default'];
3653
+ if (typeof opts.format !== 'undefined') {
3654
+ if (!has.call(formats.formatters, opts.format)) {
3655
+ throw new TypeError('Unknown format option provided.');
3656
+ }
3657
+ format = opts.format;
3658
+ }
3659
+ var formatter = formats.formatters[format];
3660
+
3661
+ var filter = defaults.filter;
3662
+ if (typeof opts.filter === 'function' || isArray(opts.filter)) {
3663
+ filter = opts.filter;
3664
+ }
3665
+
3666
+ return {
3667
+ addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,
3668
+ allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
3669
+ charset: charset,
3670
+ charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
3671
+ delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,
3672
+ encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,
3673
+ encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,
3674
+ encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,
3675
+ filter: filter,
3676
+ format: format,
3677
+ formatter: formatter,
3678
+ serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,
3679
+ skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,
3680
+ sort: typeof opts.sort === 'function' ? opts.sort : null,
3681
+ strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
3682
+ };
3683
+ };
3684
+
3685
+ module.exports = function (object, opts) {
3686
+ var obj = object;
3687
+ var options = normalizeStringifyOptions(opts);
3688
+
3689
+ var objKeys;
3690
+ var filter;
3691
+
3692
+ if (typeof options.filter === 'function') {
3693
+ filter = options.filter;
3694
+ obj = filter('', obj);
3695
+ } else if (isArray(options.filter)) {
3696
+ filter = options.filter;
3697
+ objKeys = filter;
3698
+ }
3699
+
3700
+ var keys = [];
3701
+
3702
+ if (typeof obj !== 'object' || obj === null) {
3703
+ return '';
3704
+ }
3705
+
3706
+ var arrayFormat;
3707
+ if (opts && opts.arrayFormat in arrayPrefixGenerators) {
3708
+ arrayFormat = opts.arrayFormat;
3709
+ } else if (opts && 'indices' in opts) {
3710
+ arrayFormat = opts.indices ? 'indices' : 'repeat';
3711
+ } else {
3712
+ arrayFormat = 'indices';
3713
+ }
3714
+
3715
+ var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
3716
+
3717
+ if (!objKeys) {
3718
+ objKeys = Object.keys(obj);
3719
+ }
3720
+
3721
+ if (options.sort) {
3722
+ objKeys.sort(options.sort);
3723
+ }
3724
+
3725
+ var sideChannel = getSideChannel();
3726
+ for (var i = 0; i < objKeys.length; ++i) {
3727
+ var key = objKeys[i];
3728
+
3729
+ if (options.skipNulls && obj[key] === null) {
3730
+ continue;
3731
+ }
3732
+ pushToArray(keys, stringify(
3733
+ obj[key],
3734
+ key,
3735
+ generateArrayPrefix,
3736
+ options.strictNullHandling,
3737
+ options.skipNulls,
3738
+ options.encode ? options.encoder : null,
3739
+ options.filter,
3740
+ options.sort,
3741
+ options.allowDots,
3742
+ options.serializeDate,
3743
+ options.format,
3744
+ options.formatter,
3745
+ options.encodeValuesOnly,
3746
+ options.charset,
3747
+ sideChannel
3748
+ ));
3749
+ }
3750
+
3751
+ var joined = keys.join(options.delimiter);
3752
+ var prefix = options.addQueryPrefix === true ? '?' : '';
3753
+
3754
+ if (options.charsetSentinel) {
3755
+ if (options.charset === 'iso-8859-1') {
3756
+ // encodeURIComponent('&#10003;'), the "numeric entity" representation of a checkmark
3757
+ prefix += 'utf8=%26%2310003%3B&';
3758
+ } else {
3759
+ // encodeURIComponent('✓')
3760
+ prefix += 'utf8=%E2%9C%93&';
3761
+ }
3762
+ }
3763
+
3764
+ return joined.length > 0 ? prefix + joined : '';
3765
+ };
3766
+
3767
+
3768
+ /***/ }),
3769
+
3770
+ /***/ 2493:
3771
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
3772
+
3773
+ "use strict";
3774
+
3775
+
3776
+ var formats = __webpack_require__(5527);
3777
+
3778
+ var has = Object.prototype.hasOwnProperty;
3779
+ var isArray = Array.isArray;
3780
+
3781
+ var hexTable = (function () {
3782
+ var array = [];
3783
+ for (var i = 0; i < 256; ++i) {
3784
+ array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
3785
+ }
3786
+
3787
+ return array;
3788
+ }());
3789
+
3790
+ var compactQueue = function compactQueue(queue) {
3791
+ while (queue.length > 1) {
3792
+ var item = queue.pop();
3793
+ var obj = item.obj[item.prop];
3794
+
3795
+ if (isArray(obj)) {
3796
+ var compacted = [];
3797
+
3798
+ for (var j = 0; j < obj.length; ++j) {
3799
+ if (typeof obj[j] !== 'undefined') {
3800
+ compacted.push(obj[j]);
3801
+ }
3802
+ }
3803
+
3804
+ item.obj[item.prop] = compacted;
3805
+ }
3806
+ }
3807
+ };
3808
+
3809
+ var arrayToObject = function arrayToObject(source, options) {
3810
+ var obj = options && options.plainObjects ? Object.create(null) : {};
3811
+ for (var i = 0; i < source.length; ++i) {
3812
+ if (typeof source[i] !== 'undefined') {
3813
+ obj[i] = source[i];
3814
+ }
3815
+ }
3816
+
3817
+ return obj;
3818
+ };
3819
+
3820
+ var merge = function merge(target, source, options) {
3821
+ /* eslint no-param-reassign: 0 */
3822
+ if (!source) {
3823
+ return target;
3824
+ }
3825
+
3826
+ if (typeof source !== 'object') {
3827
+ if (isArray(target)) {
3828
+ target.push(source);
3829
+ } else if (target && typeof target === 'object') {
3830
+ if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) {
3831
+ target[source] = true;
3832
+ }
3833
+ } else {
3834
+ return [target, source];
3835
+ }
3836
+
3837
+ return target;
3838
+ }
3839
+
3840
+ if (!target || typeof target !== 'object') {
3841
+ return [target].concat(source);
3842
+ }
3843
+
3844
+ var mergeTarget = target;
3845
+ if (isArray(target) && !isArray(source)) {
3846
+ mergeTarget = arrayToObject(target, options);
3847
+ }
3848
+
3849
+ if (isArray(target) && isArray(source)) {
3850
+ source.forEach(function (item, i) {
3851
+ if (has.call(target, i)) {
3852
+ var targetItem = target[i];
3853
+ if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
3854
+ target[i] = merge(targetItem, item, options);
3855
+ } else {
3856
+ target.push(item);
3857
+ }
3858
+ } else {
3859
+ target[i] = item;
3860
+ }
3861
+ });
3862
+ return target;
3863
+ }
3864
+
3865
+ return Object.keys(source).reduce(function (acc, key) {
3866
+ var value = source[key];
3867
+
3868
+ if (has.call(acc, key)) {
3869
+ acc[key] = merge(acc[key], value, options);
3870
+ } else {
3871
+ acc[key] = value;
3872
+ }
3873
+ return acc;
3874
+ }, mergeTarget);
3875
+ };
3876
+
3877
+ var assign = function assignSingleSource(target, source) {
3878
+ return Object.keys(source).reduce(function (acc, key) {
3879
+ acc[key] = source[key];
3880
+ return acc;
3881
+ }, target);
3882
+ };
3883
+
3884
+ var decode = function (str, decoder, charset) {
3885
+ var strWithoutPlus = str.replace(/\+/g, ' ');
3886
+ if (charset === 'iso-8859-1') {
3887
+ // unescape never throws, no try...catch needed:
3888
+ return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
3889
+ }
3890
+ // utf-8
3891
+ try {
3892
+ return decodeURIComponent(strWithoutPlus);
3893
+ } catch (e) {
3894
+ return strWithoutPlus;
3895
+ }
3896
+ };
3897
+
3898
+ var encode = function encode(str, defaultEncoder, charset, kind, format) {
3899
+ // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
3900
+ // It has been adapted here for stricter adherence to RFC 3986
3901
+ if (str.length === 0) {
3902
+ return str;
3903
+ }
3904
+
3905
+ var string = str;
3906
+ if (typeof str === 'symbol') {
3907
+ string = Symbol.prototype.toString.call(str);
3908
+ } else if (typeof str !== 'string') {
3909
+ string = String(str);
3910
+ }
3911
+
3912
+ if (charset === 'iso-8859-1') {
3913
+ return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
3914
+ return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
3915
+ });
3916
+ }
3917
+
3918
+ var out = '';
3919
+ for (var i = 0; i < string.length; ++i) {
3920
+ var c = string.charCodeAt(i);
3921
+
3922
+ if (
3923
+ c === 0x2D // -
3924
+ || c === 0x2E // .
3925
+ || c === 0x5F // _
3926
+ || c === 0x7E // ~
3927
+ || (c >= 0x30 && c <= 0x39) // 0-9
3928
+ || (c >= 0x41 && c <= 0x5A) // a-z
3929
+ || (c >= 0x61 && c <= 0x7A) // A-Z
3930
+ || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( )
3931
+ ) {
3932
+ out += string.charAt(i);
3933
+ continue;
3934
+ }
3935
+
3936
+ if (c < 0x80) {
3937
+ out = out + hexTable[c];
3938
+ continue;
3939
+ }
3940
+
3941
+ if (c < 0x800) {
3942
+ out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
3943
+ continue;
3944
+ }
3945
+
3946
+ if (c < 0xD800 || c >= 0xE000) {
3947
+ out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
3948
+ continue;
3949
+ }
3950
+
3951
+ i += 1;
3952
+ c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
3953
+ /* eslint operator-linebreak: [2, "before"] */
3954
+ out += hexTable[0xF0 | (c >> 18)]
3955
+ + hexTable[0x80 | ((c >> 12) & 0x3F)]
3956
+ + hexTable[0x80 | ((c >> 6) & 0x3F)]
3957
+ + hexTable[0x80 | (c & 0x3F)];
3958
+ }
3959
+
3960
+ return out;
3961
+ };
3962
+
3963
+ var compact = function compact(value) {
3964
+ var queue = [{ obj: { o: value }, prop: 'o' }];
3965
+ var refs = [];
3966
+
3967
+ for (var i = 0; i < queue.length; ++i) {
3968
+ var item = queue[i];
3969
+ var obj = item.obj[item.prop];
3970
+
3971
+ var keys = Object.keys(obj);
3972
+ for (var j = 0; j < keys.length; ++j) {
3973
+ var key = keys[j];
3974
+ var val = obj[key];
3975
+ if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
3976
+ queue.push({ obj: obj, prop: key });
3977
+ refs.push(val);
3978
+ }
3979
+ }
3980
+ }
3981
+
3982
+ compactQueue(queue);
3983
+
3984
+ return value;
3985
+ };
3986
+
3987
+ var isRegExp = function isRegExp(obj) {
3988
+ return Object.prototype.toString.call(obj) === '[object RegExp]';
3989
+ };
3990
+
3991
+ var isBuffer = function isBuffer(obj) {
3992
+ if (!obj || typeof obj !== 'object') {
3993
+ return false;
3994
+ }
3995
+
3996
+ return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
3997
+ };
3998
+
3999
+ var combine = function combine(a, b) {
4000
+ return [].concat(a, b);
4001
+ };
4002
+
4003
+ var maybeMap = function maybeMap(val, fn) {
4004
+ if (isArray(val)) {
4005
+ var mapped = [];
4006
+ for (var i = 0; i < val.length; i += 1) {
4007
+ mapped.push(fn(val[i]));
4008
+ }
4009
+ return mapped;
4010
+ }
4011
+ return fn(val);
4012
+ };
4013
+
4014
+ module.exports = {
4015
+ arrayToObject: arrayToObject,
4016
+ assign: assign,
4017
+ combine: combine,
4018
+ compact: compact,
4019
+ decode: decode,
4020
+ encode: encode,
4021
+ isBuffer: isBuffer,
4022
+ isRegExp: isRegExp,
4023
+ maybeMap: maybeMap,
4024
+ merge: merge
4025
+ };
4026
+
4027
+
4028
+ /***/ }),
4029
+
4030
+ /***/ 4294:
4031
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
4032
+
4033
+ "use strict";
4034
+
4035
+
4036
+ var GetIntrinsic = __webpack_require__(7286);
4037
+ var callBound = __webpack_require__(2680);
4038
+ var inspect = __webpack_require__(9500);
4039
+
4040
+ var $TypeError = GetIntrinsic('%TypeError%');
4041
+ var $WeakMap = GetIntrinsic('%WeakMap%', true);
4042
+ var $Map = GetIntrinsic('%Map%', true);
4043
+
4044
+ var $weakMapGet = callBound('WeakMap.prototype.get', true);
4045
+ var $weakMapSet = callBound('WeakMap.prototype.set', true);
4046
+ var $weakMapHas = callBound('WeakMap.prototype.has', true);
4047
+ var $mapGet = callBound('Map.prototype.get', true);
4048
+ var $mapSet = callBound('Map.prototype.set', true);
4049
+ var $mapHas = callBound('Map.prototype.has', true);
4050
+
4051
+ /*
4052
+ * This function traverses the list returning the node corresponding to the
4053
+ * given key.
4054
+ *
4055
+ * That node is also moved to the head of the list, so that if it's accessed
4056
+ * again we don't need to traverse the whole list. By doing so, all the recently
4057
+ * used nodes can be accessed relatively quickly.
4058
+ */
4059
+ var listGetNode = function (list, key) { // eslint-disable-line consistent-return
4060
+ for (var prev = list, curr; (curr = prev.next) !== null; prev = curr) {
4061
+ if (curr.key === key) {
4062
+ prev.next = curr.next;
4063
+ curr.next = list.next;
4064
+ list.next = curr; // eslint-disable-line no-param-reassign
4065
+ return curr;
4066
+ }
4067
+ }
4068
+ };
4069
+
4070
+ var listGet = function (objects, key) {
4071
+ var node = listGetNode(objects, key);
4072
+ return node && node.value;
4073
+ };
4074
+ var listSet = function (objects, key, value) {
4075
+ var node = listGetNode(objects, key);
4076
+ if (node) {
4077
+ node.value = value;
4078
+ } else {
4079
+ // Prepend the new node to the beginning of the list
4080
+ objects.next = { // eslint-disable-line no-param-reassign
4081
+ key: key,
4082
+ next: objects.next,
4083
+ value: value
4084
+ };
4085
+ }
4086
+ };
4087
+ var listHas = function (objects, key) {
4088
+ return !!listGetNode(objects, key);
4089
+ };
4090
+
4091
+ module.exports = function getSideChannel() {
4092
+ var $wm;
4093
+ var $m;
4094
+ var $o;
4095
+ var channel = {
4096
+ assert: function (key) {
4097
+ if (!channel.has(key)) {
4098
+ throw new $TypeError('Side channel does not contain ' + inspect(key));
4099
+ }
4100
+ },
4101
+ get: function (key) { // eslint-disable-line consistent-return
4102
+ if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
4103
+ if ($wm) {
4104
+ return $weakMapGet($wm, key);
4105
+ }
4106
+ } else if ($Map) {
4107
+ if ($m) {
4108
+ return $mapGet($m, key);
4109
+ }
4110
+ } else {
4111
+ if ($o) { // eslint-disable-line no-lonely-if
4112
+ return listGet($o, key);
4113
+ }
4114
+ }
4115
+ },
4116
+ has: function (key) {
4117
+ if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
4118
+ if ($wm) {
4119
+ return $weakMapHas($wm, key);
4120
+ }
4121
+ } else if ($Map) {
4122
+ if ($m) {
4123
+ return $mapHas($m, key);
4124
+ }
4125
+ } else {
4126
+ if ($o) { // eslint-disable-line no-lonely-if
4127
+ return listHas($o, key);
4128
+ }
4129
+ }
4130
+ return false;
4131
+ },
4132
+ set: function (key, value) {
4133
+ if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
4134
+ if (!$wm) {
4135
+ $wm = new $WeakMap();
4136
+ }
4137
+ $weakMapSet($wm, key, value);
4138
+ } else if ($Map) {
4139
+ if (!$m) {
4140
+ $m = new $Map();
4141
+ }
4142
+ $mapSet($m, key, value);
4143
+ } else {
4144
+ if (!$o) {
4145
+ /*
4146
+ * Initialize the linked list as an empty node, so that we don't have
4147
+ * to special-case handling of the first node: we can always refer to
4148
+ * it as (previous node).next, instead of something like (list).head
4149
+ */
4150
+ $o = { key: {}, next: null };
4151
+ }
4152
+ listSet($o, key, value);
4153
+ }
4154
+ }
4155
+ };
4156
+ return channel;
4157
+ };
4158
+
4159
+
4160
+ /***/ }),
4161
+
4162
+ /***/ 9830:
4163
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
4164
+
4165
+ "use strict";
4166
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4167
+ /* harmony export */ "Z": function() { return /* binding */ Tannin; }
4168
+ /* harmony export */ });
4169
+ /* harmony import */ var _tannin_plural_forms__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1184);
4170
+
4171
+
4172
+ /**
4173
+ * Tannin constructor options.
4174
+ *
4175
+ * @typedef {Object} TanninOptions
4176
+ *
4177
+ * @property {string} [contextDelimiter] Joiner in string lookup with context.
4178
+ * @property {Function} [onMissingKey] Callback to invoke when key missing.
4179
+ */
4180
+
4181
+ /**
4182
+ * Domain metadata.
4183
+ *
4184
+ * @typedef {Object} TanninDomainMetadata
4185
+ *
4186
+ * @property {string} [domain] Domain name.
4187
+ * @property {string} [lang] Language code.
4188
+ * @property {(string|Function)} [plural_forms] Plural forms expression or
4189
+ * function evaluator.
4190
+ */
4191
+
4192
+ /**
4193
+ * Domain translation pair respectively representing the singular and plural
4194
+ * translation.
4195
+ *
4196
+ * @typedef {[string,string]} TanninTranslation
4197
+ */
4198
+
4199
+ /**
4200
+ * Locale data domain. The key is used as reference for lookup, the value an
4201
+ * array of two string entries respectively representing the singular and plural
4202
+ * translation.
4203
+ *
4204
+ * @typedef {{[key:string]:TanninDomainMetadata|TanninTranslation,'':TanninDomainMetadata|TanninTranslation}} TanninLocaleDomain
4205
+ */
4206
+
4207
+ /**
4208
+ * Jed-formatted locale data.
4209
+ *
4210
+ * @see http://messageformat.github.io/Jed/
4211
+ *
4212
+ * @typedef {{[domain:string]:TanninLocaleDomain}} TanninLocaleData
4213
+ */
4214
+
4215
+ /**
4216
+ * Default Tannin constructor options.
4217
+ *
4218
+ * @type {TanninOptions}
4219
+ */
4220
+ var DEFAULT_OPTIONS = {
4221
+ contextDelimiter: '\u0004',
4222
+ onMissingKey: null,
4223
+ };
4224
+
4225
+ /**
4226
+ * Given a specific locale data's config `plural_forms` value, returns the
4227
+ * expression.
4228
+ *
4229
+ * @example
4230
+ *
4231
+ * ```
4232
+ * getPluralExpression( 'nplurals=2; plural=(n != 1);' ) === '(n != 1)'
4233
+ * ```
4234
+ *
4235
+ * @param {string} pf Locale data plural forms.
4236
+ *
4237
+ * @return {string} Plural forms expression.
4238
+ */
4239
+ function getPluralExpression( pf ) {
4240
+ var parts, i, part;
4241
+
4242
+ parts = pf.split( ';' );
4243
+
4244
+ for ( i = 0; i < parts.length; i++ ) {
4245
+ part = parts[ i ].trim();
4246
+ if ( part.indexOf( 'plural=' ) === 0 ) {
4247
+ return part.substr( 7 );
4248
+ }
4249
+ }
4250
+ }
4251
+
4252
+ /**
4253
+ * Tannin constructor.
4254
+ *
4255
+ * @class
4256
+ *
4257
+ * @param {TanninLocaleData} data Jed-formatted locale data.
4258
+ * @param {TanninOptions} [options] Tannin options.
4259
+ */
4260
+ function Tannin( data, options ) {
4261
+ var key;
4262
+
4263
+ /**
4264
+ * Jed-formatted locale data.
4265
+ *
4266
+ * @name Tannin#data
4267
+ * @type {TanninLocaleData}
4268
+ */
4269
+ this.data = data;
4270
+
4271
+ /**
4272
+ * Plural forms function cache, keyed by plural forms string.
4273
+ *
4274
+ * @name Tannin#pluralForms
4275
+ * @type {Object<string,Function>}
4276
+ */
4277
+ this.pluralForms = {};
4278
+
4279
+ /**
4280
+ * Effective options for instance, including defaults.
4281
+ *
4282
+ * @name Tannin#options
4283
+ * @type {TanninOptions}
4284
+ */
4285
+ this.options = {};
4286
+
4287
+ for ( key in DEFAULT_OPTIONS ) {
4288
+ this.options[ key ] = options !== undefined && key in options
4289
+ ? options[ key ]
4290
+ : DEFAULT_OPTIONS[ key ];
4291
+ }
4292
+ }
4293
+
4294
+ /**
4295
+ * Returns the plural form index for the given domain and value.
4296
+ *
4297
+ * @param {string} domain Domain on which to calculate plural form.
4298
+ * @param {number} n Value for which plural form is to be calculated.
4299
+ *
4300
+ * @return {number} Plural form index.
4301
+ */
4302
+ Tannin.prototype.getPluralForm = function( domain, n ) {
4303
+ var getPluralForm = this.pluralForms[ domain ],
4304
+ config, plural, pf;
4305
+
4306
+ if ( ! getPluralForm ) {
4307
+ config = this.data[ domain ][ '' ];
4308
+
4309
+ pf = (
4310
+ config[ 'Plural-Forms' ] ||
4311
+ config[ 'plural-forms' ] ||
4312
+ // Ignore reason: As known, there's no way to document the empty
4313
+ // string property on a key to guarantee this as metadata.
4314
+ // @ts-ignore
4315
+ config.plural_forms
4316
+ );
4317
+
4318
+ if ( typeof pf !== 'function' ) {
4319
+ plural = getPluralExpression(
4320
+ config[ 'Plural-Forms' ] ||
4321
+ config[ 'plural-forms' ] ||
4322
+ // Ignore reason: As known, there's no way to document the empty
4323
+ // string property on a key to guarantee this as metadata.
4324
+ // @ts-ignore
4325
+ config.plural_forms
4326
+ );
4327
+
4328
+ pf = (0,_tannin_plural_forms__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)( plural );
4329
+ }
4330
+
4331
+ getPluralForm = this.pluralForms[ domain ] = pf;
4332
+ }
4333
+
4334
+ return getPluralForm( n );
4335
+ };
4336
+
4337
+ /**
4338
+ * Translate a string.
4339
+ *
4340
+ * @param {string} domain Translation domain.
4341
+ * @param {string|void} context Context distinguishing terms of the same name.
4342
+ * @param {string} singular Primary key for translation lookup.
4343
+ * @param {string=} plural Fallback value used for non-zero plural
4344
+ * form index.
4345
+ * @param {number=} n Value to use in calculating plural form.
4346
+ *
4347
+ * @return {string} Translated string.
4348
+ */
4349
+ Tannin.prototype.dcnpgettext = function( domain, context, singular, plural, n ) {
4350
+ var index, key, entry;
4351
+
4352
+ if ( n === undefined ) {
4353
+ // Default to singular.
4354
+ index = 0;
4355
+ } else {
4356
+ // Find index by evaluating plural form for value.
4357
+ index = this.getPluralForm( domain, n );
4358
+ }
4359
+
4360
+ key = singular;
4361
+
4362
+ // If provided, context is prepended to key with delimiter.
4363
+ if ( context ) {
4364
+ key = context + this.options.contextDelimiter + singular;
4365
+ }
4366
+
4367
+ entry = this.data[ domain ][ key ];
4368
+
4369
+ // Verify not only that entry exists, but that the intended index is within
4370
+ // range and non-empty.
4371
+ if ( entry && entry[ index ] ) {
4372
+ return entry[ index ];
4373
+ }
4374
+
4375
+ if ( this.options.onMissingKey ) {
4376
+ this.options.onMissingKey( singular, domain );
4377
+ }
4378
+
4379
+ // If entry not found, fall back to singular vs. plural with zero index
4380
+ // representing the singular value.
4381
+ return index === 0 ? singular : plural;
4382
+ };
4383
+
4384
+
4385
+ /***/ }),
4386
+
4387
+ /***/ 6274:
4388
+ /***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
4389
+
4390
+ "use strict";
4391
+ /* harmony import */ var _automattic_data_stores__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8077);
4392
+
4393
+ _automattic_data_stores__WEBPACK_IMPORTED_MODULE_0__/* .register */ .z2();
4394
+
4395
+ /***/ }),
4396
+
4397
+ /***/ 5608:
4398
+ /***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
4399
+
4400
+ "use strict";
4401
+ /* harmony import */ var _automattic_data_stores__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1635);
4402
+
4403
+ _automattic_data_stores__WEBPACK_IMPORTED_MODULE_0__/* .register */ .z();
4404
+
4405
+ /***/ }),
4406
+
4407
+ /***/ 3857:
4408
+ /***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
4409
+
4410
+ "use strict";
4411
+ /* harmony import */ var _automattic_data_stores__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9734);
4412
+
4413
+ _automattic_data_stores__WEBPACK_IMPORTED_MODULE_0__.register();
4414
+
4415
+ /***/ }),
4416
+
4417
+ /***/ 561:
4418
+ /***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
4419
+
4420
+ "use strict";
4421
+ /* harmony import */ var _automattic_data_stores__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2369);
4422
+
4423
+ _automattic_data_stores__WEBPACK_IMPORTED_MODULE_0__/* .register */ .z2({
4424
+ client_id: '',
4425
+ client_secret: ''
4426
+ });
4427
+
4428
+ /***/ }),
4429
+
4430
+ /***/ 9512:
4431
+ /***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
4432
+
4433
+ "use strict";
4434
+ /* harmony import */ var _automattic_data_stores__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(182);
4435
+
4436
+ _automattic_data_stores__WEBPACK_IMPORTED_MODULE_0__/* .register */ .z();
4437
+
4438
+ /***/ }),
4439
+
4440
+ /***/ 3600:
4441
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
4442
+
4443
+ "use strict";
4444
+ __webpack_require__.r(__webpack_exports__);
4445
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4446
+ /* harmony export */ "receiveCategories": function() { return /* binding */ receiveCategories; },
4447
+ /* harmony export */ "fetchDomainSuggestions": function() { return /* binding */ fetchDomainSuggestions; },
4448
+ /* harmony export */ "receiveDomainAvailability": function() { return /* binding */ receiveDomainAvailability; },
4449
+ /* harmony export */ "receiveDomainSuggestionsSuccess": function() { return /* binding */ receiveDomainSuggestionsSuccess; },
4450
+ /* harmony export */ "receiveDomainSuggestionsError": function() { return /* binding */ receiveDomainSuggestionsError; }
4451
+ /* harmony export */ });
4452
+ const receiveCategories = categories => ({
4453
+ type: 'RECEIVE_CATEGORIES',
4454
+ categories
4455
+ });
4456
+ const fetchDomainSuggestions = () => ({
4457
+ type: 'FETCH_DOMAIN_SUGGESTIONS',
4458
+ timeStamp: Date.now()
4459
+ });
4460
+ const receiveDomainAvailability = (domainName, availability) => ({
4461
+ type: 'RECEIVE_DOMAIN_AVAILABILITY',
4462
+ domainName,
4463
+ availability
4464
+ });
4465
+ const receiveDomainSuggestionsSuccess = (queryObject, suggestions) => ({
4466
+ type: 'RECEIVE_DOMAIN_SUGGESTIONS_SUCCESS',
4467
+ queryObject,
4468
+ suggestions,
4469
+ timeStamp: Date.now()
4470
+ });
4471
+ const receiveDomainSuggestionsError = errorMessage => ({
4472
+ type: 'RECEIVE_DOMAIN_SUGGESTIONS_ERROR',
4473
+ errorMessage,
4474
+ timeStamp: Date.now()
4475
+ });
4476
+
4477
+ /***/ }),
4478
+
4479
+ /***/ 584:
4480
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
4481
+
4482
+ "use strict";
4483
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4484
+ /* harmony export */ "L": function() { return /* binding */ STORE_KEY; },
4485
+ /* harmony export */ "r": function() { return /* binding */ DataStatus; }
4486
+ /* harmony export */ });
4487
+ const STORE_KEY = 'automattic/domains/suggestions';
4488
+ let DataStatus;
4489
+
4490
+ (function (DataStatus) {
4491
+ DataStatus["Failure"] = "failure";
4492
+ DataStatus["Pending"] = "pending";
4493
+ DataStatus["Success"] = "success";
4494
+ DataStatus["Uninitialized"] = "uninitialized";
4495
+ })(DataStatus || (DataStatus = {}));
4496
+
4497
+ /***/ }),
4498
+
4499
+ /***/ 8077:
4500
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
4501
+
4502
+ "use strict";
4503
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4504
+ /* harmony export */ "z2": function() { return /* binding */ register; }
4505
+ /* harmony export */ });
4506
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9818);
4507
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
4508
+ /* harmony import */ var _wpcom_request_controls__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3661);
4509
+ /* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3600);
4510
+ /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(584);
4511
+ /* harmony import */ var _reducer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3717);
4512
+ /* harmony import */ var _resolvers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2269);
4513
+ /* harmony import */ var _selectors__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(267);
4514
+
4515
+
4516
+
4517
+
4518
+
4519
+
4520
+
4521
+
4522
+
4523
+
4524
+ let isRegistered = false;
4525
+ function register() {
4526
+ if (!isRegistered) {
4527
+ isRegistered = true;
4528
+ (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.registerStore)(_constants__WEBPACK_IMPORTED_MODULE_1__/* .STORE_KEY */ .L, {
4529
+ actions: _actions__WEBPACK_IMPORTED_MODULE_2__,
4530
+ controls: _wpcom_request_controls__WEBPACK_IMPORTED_MODULE_3__/* .controls */ .ai,
4531
+ reducer: _reducer__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z,
4532
+ resolvers: _resolvers__WEBPACK_IMPORTED_MODULE_5__,
4533
+ selectors: _selectors__WEBPACK_IMPORTED_MODULE_6__
4534
+ });
4535
+ }
4536
+
4537
+ return _constants__WEBPACK_IMPORTED_MODULE_1__/* .STORE_KEY */ .L;
4538
+ }
4539
+
4540
+ /***/ }),
4541
+
4542
+ /***/ 3717:
4543
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
4544
+
4545
+ "use strict";
4546
+ /* unused harmony export domainSuggestions */
4547
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9818);
4548
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
4549
+ /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(584);
4550
+ /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4211);
4551
+
4552
+
4553
+
4554
+ const initialDomainSuggestionState = {
4555
+ state: _constants__WEBPACK_IMPORTED_MODULE_1__/* .DataStatus.Uninitialized */ .r.Uninitialized,
4556
+ data: {},
4557
+ errorMessage: null,
4558
+ lastUpdated: -Infinity,
4559
+ pendingSince: undefined
4560
+ };
4561
+ const domainSuggestions = function () {
4562
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialDomainSuggestionState;
4563
+ let action = arguments.length > 1 ? arguments[1] : undefined;
4564
+
4565
+ if (action.type === 'FETCH_DOMAIN_SUGGESTIONS') {
4566
+ return { ...state,
4567
+ state: _constants__WEBPACK_IMPORTED_MODULE_1__/* .DataStatus.Pending */ .r.Pending,
4568
+ errorMessage: null,
4569
+ pendingSince: action.timeStamp
4570
+ };
4571
+ }
4572
+
4573
+ if (action.type === 'RECEIVE_DOMAIN_SUGGESTIONS_SUCCESS') {
4574
+ return { ...state,
4575
+ state: _constants__WEBPACK_IMPORTED_MODULE_1__/* .DataStatus.Success */ .r.Success,
4576
+ data: { ...state.data,
4577
+ [(0,_utils__WEBPACK_IMPORTED_MODULE_2__/* .stringifyDomainQueryObject */ .Le)(action.queryObject)]: action.suggestions
4578
+ },
4579
+ errorMessage: null,
4580
+ lastUpdated: action.timeStamp,
4581
+ pendingSince: undefined
4582
+ };
4583
+ }
4584
+
4585
+ if (action.type === 'RECEIVE_DOMAIN_SUGGESTIONS_ERROR') {
4586
+ return { ...state,
4587
+ state: _constants__WEBPACK_IMPORTED_MODULE_1__/* .DataStatus.Failure */ .r.Failure,
4588
+ errorMessage: action.errorMessage,
4589
+ lastUpdated: action.timeStamp,
4590
+ pendingSince: undefined
4591
+ };
4592
+ }
4593
+
4594
+ return state;
4595
+ };
4596
+
4597
+ const categories = function () {
4598
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
4599
+ let action = arguments.length > 1 ? arguments[1] : undefined;
4600
+
4601
+ if (action.type === 'RECEIVE_CATEGORIES') {
4602
+ return action.categories;
4603
+ }
4604
+
4605
+ return state;
4606
+ };
4607
+
4608
+ const availability = function () {
4609
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
4610
+ let action = arguments.length > 1 ? arguments[1] : undefined;
4611
+
4612
+ if (action.type === 'RECEIVE_DOMAIN_AVAILABILITY') {
4613
+ return { ...state,
4614
+ [action.domainName]: action.availability
4615
+ };
4616
+ }
4617
+
4618
+ return state;
4619
+ };
4620
+
4621
+ const reducer = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.combineReducers)({
4622
+ categories,
4623
+ domainSuggestions,
4624
+ availability
4625
+ });
4626
+ /* harmony default export */ __webpack_exports__["Z"] = (reducer);
4627
+
4628
+ /***/ }),
4629
+
4630
+ /***/ 2269:
4631
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
4632
+
4633
+ "use strict";
4634
+ __webpack_require__.r(__webpack_exports__);
4635
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4636
+ /* harmony export */ "isAvailable": function() { return /* binding */ isAvailable; },
4637
+ /* harmony export */ "getCategories": function() { return /* binding */ getCategories; },
4638
+ /* harmony export */ "__internalGetDomainSuggestions": function() { return /* binding */ __internalGetDomainSuggestions; }
4639
+ /* harmony export */ });
4640
+ /* harmony import */ var i18n_calypso__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1481);
4641
+ /* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9126);
4642
+ /* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(qs__WEBPACK_IMPORTED_MODULE_0__);
4643
+ /* harmony import */ var validator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6468);
4644
+ /* harmony import */ var validator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(validator__WEBPACK_IMPORTED_MODULE_1__);
4645
+ /* harmony import */ var _wpcom_request_controls__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3661);
4646
+ /* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3600);
4647
+ /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(4211);
4648
+
4649
+
4650
+
4651
+
4652
+
4653
+
4654
+
4655
+ function getAvailabilityURL(domainName) {
4656
+ return `https://public-api.wordpress.com/rest/v1.3/domains/${encodeURIComponent(domainName)}/is-available?is_cart_pre_check=true`;
4657
+ }
4658
+
4659
+ function suggestionsLackThisFQDN(suggestions, domainName) {
4660
+ return validator__WEBPACK_IMPORTED_MODULE_1___default().isFQDN(domainName) && !suggestions.some(s => s.domain_name.toLowerCase() === domainName);
4661
+ }
4662
+
4663
+ const isAvailable = function* isAvailable(domainName) {
4664
+ const url = getAvailabilityURL(domainName);
4665
+
4666
+ try {
4667
+ const {
4668
+ body
4669
+ } = yield (0,_wpcom_request_controls__WEBPACK_IMPORTED_MODULE_2__/* .fetchAndParse */ .An)(url);
4670
+ return (0,_actions__WEBPACK_IMPORTED_MODULE_3__.receiveDomainAvailability)(domainName, body);
4671
+ } catch {
4672
+ // the API returns a status of 'unknown' if it can not accurately determine
4673
+ // availability, we will return the same status if the API request fails.
4674
+ return (0,_actions__WEBPACK_IMPORTED_MODULE_3__.receiveDomainAvailability)(domainName, {
4675
+ domain_name: domainName,
4676
+ mappable: 'unknown',
4677
+ status: 'unknown',
4678
+ supports_privacy: false
4679
+ });
4680
+ }
4681
+ };
4682
+ function* getCategories() {
4683
+ const {
4684
+ body
4685
+ } = yield (0,_wpcom_request_controls__WEBPACK_IMPORTED_MODULE_2__/* .fetchAndParse */ .An)('https://public-api.wordpress.com/wpcom/v2/onboarding/domains/categories');
4686
+ return (0,_actions__WEBPACK_IMPORTED_MODULE_3__.receiveCategories)(body);
4687
+ }
4688
+ function* __internalGetDomainSuggestions(queryObject) {
4689
+ // If normalized search string (`query`) contains no alphanumerics, endpoint 404s
4690
+ if (!queryObject.query) {
4691
+ return (0,_actions__WEBPACK_IMPORTED_MODULE_3__.receiveDomainSuggestionsError)('Empty query');
4692
+ }
4693
+
4694
+ yield (0,_actions__WEBPACK_IMPORTED_MODULE_3__.fetchDomainSuggestions)();
4695
+
4696
+ try {
4697
+ const suggestions = yield (0,_wpcom_request_controls__WEBPACK_IMPORTED_MODULE_2__/* .wpcomRequest */ ._9)({
4698
+ apiVersion: '1.1',
4699
+ path: '/domains/suggestions',
4700
+ query: (0,qs__WEBPACK_IMPORTED_MODULE_0__.stringify)(queryObject)
4701
+ });
4702
+
4703
+ if (!Array.isArray(suggestions)) {
4704
+ // Other internal server errors
4705
+ return (0,_actions__WEBPACK_IMPORTED_MODULE_3__.receiveDomainSuggestionsError)((0,i18n_calypso__WEBPACK_IMPORTED_MODULE_4__/* .translate */ .Iu)('Invalid response from the server'));
4706
+ } // if the query is a FQDN and the results don't have it,
4707
+ // this implies that the user is searching for an unavailable domain name
4708
+ // TODO: query the availability endpoint to find the exact reason why it's unavailable
4709
+ // all the possible responses can be found here https://github.com/Automattic/wp-calypso/blob/trunk/client/lib/domains/registration/availability-messages.js#L40-L390
4710
+
4711
+
4712
+ if (suggestionsLackThisFQDN(suggestions, queryObject.query)) {
4713
+ const unavailableSuggestion = {
4714
+ domain_name: queryObject.query,
4715
+ unavailable: true,
4716
+ cost: '',
4717
+ raw_price: 0,
4718
+ currency_code: ''
4719
+ };
4720
+ suggestions.unshift(unavailableSuggestion);
4721
+ }
4722
+
4723
+ const processedSuggestions = suggestions.map(suggestion => {
4724
+ if (suggestion.unavailable) {
4725
+ return suggestion;
4726
+ }
4727
+
4728
+ return { ...suggestion,
4729
+ ...(suggestion.raw_price && suggestion.currency_code && {
4730
+ cost: (0,_utils__WEBPACK_IMPORTED_MODULE_5__/* .getFormattedPrice */ ._B)(suggestion.raw_price, suggestion.currency_code)
4731
+ })
4732
+ };
4733
+ });
4734
+ return (0,_actions__WEBPACK_IMPORTED_MODULE_3__.receiveDomainSuggestionsSuccess)(queryObject, processedSuggestions);
4735
+ } catch (e) {
4736
+ // e.g. no connection, or JSON parsing error
4737
+ return (0,_actions__WEBPACK_IMPORTED_MODULE_3__.receiveDomainSuggestionsError)(e.message || (0,i18n_calypso__WEBPACK_IMPORTED_MODULE_4__/* .translate */ .Iu)('Error while fetching server response'));
4738
+ }
4739
+ }
4740
+
4741
+ /***/ }),
4742
+
4743
+ /***/ 267:
4744
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
4745
+
4746
+ "use strict";
4747
+ __webpack_require__.r(__webpack_exports__);
4748
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4749
+ /* harmony export */ "getCategories": function() { return /* binding */ getCategories; },
4750
+ /* harmony export */ "getDomainSuggestions": function() { return /* binding */ getDomainSuggestions; },
4751
+ /* harmony export */ "getDomainState": function() { return /* binding */ getDomainState; },
4752
+ /* harmony export */ "getDomainErrorMessage": function() { return /* binding */ getDomainErrorMessage; },
4753
+ /* harmony export */ "isLoadingDomainSuggestions": function() { return /* binding */ isLoadingDomainSuggestions; },
4754
+ /* harmony export */ "__internalGetDomainSuggestions": function() { return /* binding */ __internalGetDomainSuggestions; },
4755
+ /* harmony export */ "isAvailable": function() { return /* binding */ isAvailable; },
4756
+ /* harmony export */ "getDomainAvailabilities": function() { return /* binding */ getDomainAvailabilities; }
4757
+ /* harmony export */ });
4758
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9818);
4759
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
4760
+ /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(584);
4761
+ /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4211);
4762
+
4763
+
4764
+
4765
+ const getCategories = state => {
4766
+ // Sort domain categories by tier, then by title.
4767
+ return [...state.categories.filter(_ref => {
4768
+ let {
4769
+ tier
4770
+ } = _ref;
4771
+ return tier !== null;
4772
+ }).sort((a, b) => a > b ? 1 : -1), ...state.categories.filter(_ref2 => {
4773
+ let {
4774
+ tier
4775
+ } = _ref2;
4776
+ return tier === null;
4777
+ }).sort((a, b) => a.title.localeCompare(b.title))];
4778
+ };
4779
+ const getDomainSuggestions = function (_state, search) {
4780
+ let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
4781
+ const normalizedQuery = (0,_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalizeDomainSuggestionQuery */ .o0)(search, options); // We need to go through the `select` store to get the resolver action
4782
+
4783
+ return (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)(_constants__WEBPACK_IMPORTED_MODULE_2__/* .STORE_KEY */ .L).__internalGetDomainSuggestions(normalizedQuery);
4784
+ };
4785
+ const getDomainState = state => {
4786
+ return state.domainSuggestions.state;
4787
+ };
4788
+ const getDomainErrorMessage = state => {
4789
+ return state.domainSuggestions.errorMessage;
4790
+ }; // TODO: reconcile this function with "Pending" status?
4791
+ // It doesn't seem to be used
4792
+
4793
+ const isLoadingDomainSuggestions = function (_state, search) {
4794
+ let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
4795
+ const normalizedQuery = (0,_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalizeDomainSuggestionQuery */ .o0)(search, options);
4796
+ return (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)('core/data').isResolving(_constants__WEBPACK_IMPORTED_MODULE_2__/* .STORE_KEY */ .L, '__internalGetDomainSuggestions', [normalizedQuery]);
4797
+ };
4798
+ /**
4799
+ * Do not use this selector. It is for internal use.
4800
+ *
4801
+ * @param state Store state
4802
+ * @param queryObject Normalized object representing the query
4803
+ * @returns suggestions
4804
+ */
4805
+
4806
+ const __internalGetDomainSuggestions = (state, queryObject) => {
4807
+ return state.domainSuggestions.data[(0,_utils__WEBPACK_IMPORTED_MODULE_1__/* .stringifyDomainQueryObject */ .Le)(queryObject)];
4808
+ };
4809
+ const isAvailable = (state, domainName) => {
4810
+ return state.availability[domainName];
4811
+ };
4812
+ const getDomainAvailabilities = state => {
4813
+ return state.availability;
4814
+ };
4815
+
4816
+ /***/ }),
4817
+
4818
+ /***/ 4211:
4819
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
4820
+
4821
+ "use strict";
4822
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4823
+ /* harmony export */ "Le": function() { return /* binding */ stringifyDomainQueryObject; },
4824
+ /* harmony export */ "_B": function() { return /* binding */ getFormattedPrice; },
4825
+ /* harmony export */ "o0": function() { return /* binding */ normalizeDomainSuggestionQuery; }
4826
+ /* harmony export */ });
4827
+ /* harmony import */ var _automattic_format_currency__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2645);
4828
+ /* harmony import */ var fast_json_stable_stringify__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5695);
4829
+ /* harmony import */ var fast_json_stable_stringify__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fast_json_stable_stringify__WEBPACK_IMPORTED_MODULE_0__);
4830
+
4831
+
4832
+
4833
+ /**
4834
+ * Stable transform to an object key for storage and access.
4835
+ *
4836
+ * @see client/state/domains/suggestions/utils.js
4837
+ */
4838
+ const stringifyDomainQueryObject = (fast_json_stable_stringify__WEBPACK_IMPORTED_MODULE_0___default());
4839
+ /**
4840
+ * Formats the domain suggestion price according to 'format-currency' package rules
4841
+ * We use this for consistency in prices formats across plans and domains
4842
+ *
4843
+ * @param price the domain suggestion raw price
4844
+ * @param currencyCode the currency code to be used when formatting price
4845
+ */
4846
+
4847
+ function getFormattedPrice(price, currencyCode) {
4848
+ return (0,_automattic_format_currency__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP)(price, currencyCode, {
4849
+ stripZeros: true
4850
+ });
4851
+ }
4852
+ /**
4853
+ * Normalize domain query
4854
+ *
4855
+ * It's important to have a consistent, reproduceable representation of a domains query so that the result can be
4856
+ * stored and retrieved.
4857
+ *
4858
+ * @see client/state/domains/suggestions/utils.js
4859
+ * @see client/components/data/query-domains-suggestions/index.jsx
4860
+ *
4861
+ * @param search Domain search string
4862
+ * @param queryOptions Optional paramaters for the query
4863
+ * @returns Normalized query object
4864
+ */
4865
+
4866
+ function normalizeDomainSuggestionQuery(search, queryOptions) {
4867
+ return {
4868
+ // Defaults
4869
+ include_wordpressdotcom: queryOptions.only_wordpressdotcom || false,
4870
+ include_dotblogsubdomain: false,
4871
+ only_wordpressdotcom: false,
4872
+ quantity: 5,
4873
+ vendor: 'variation2_front',
4874
+ // Merge options
4875
+ ...queryOptions,
4876
+ // Add the search query
4877
+ query: search.trim().toLocaleLowerCase()
4878
+ };
4879
+ }
4880
+
4881
+ /***/ }),
4882
+
4883
+ /***/ 6108:
4884
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
4885
+
4886
+ "use strict";
4887
+ __webpack_require__.r(__webpack_exports__);
4888
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4889
+ /* harmony export */ "setSidebarFullscreen": function() { return /* binding */ setSidebarFullscreen; },
4890
+ /* harmony export */ "unsetSidebarFullscreen": function() { return /* binding */ unsetSidebarFullscreen; },
4891
+ /* harmony export */ "setStep": function() { return /* binding */ setStep; },
4892
+ /* harmony export */ "setSiteTitle": function() { return /* binding */ setSiteTitle; },
4893
+ /* harmony export */ "setDomain": function() { return /* binding */ setDomain; },
4894
+ /* harmony export */ "unsetDomain": function() { return /* binding */ unsetDomain; },
4895
+ /* harmony export */ "confirmDomainSelection": function() { return /* binding */ confirmDomainSelection; },
4896
+ /* harmony export */ "setDomainSearch": function() { return /* binding */ setDomainSearch; },
4897
+ /* harmony export */ "setPlanProductId": function() { return /* binding */ setPlanProductId; },
4898
+ /* harmony export */ "unsetPlanProductId": function() { return /* binding */ unsetPlanProductId; },
4899
+ /* harmony export */ "updatePlan": function() { return /* binding */ updatePlan; },
4900
+ /* harmony export */ "openSidebar": function() { return /* binding */ openSidebar; },
4901
+ /* harmony export */ "closeSidebar": function() { return /* binding */ closeSidebar; },
4902
+ /* harmony export */ "openFocusedLaunch": function() { return /* binding */ openFocusedLaunch; },
4903
+ /* harmony export */ "closeFocusedLaunch": function() { return /* binding */ closeFocusedLaunch; },
4904
+ /* harmony export */ "enableAnchorFm": function() { return /* binding */ enableAnchorFm; },
4905
+ /* harmony export */ "showSiteTitleStep": function() { return /* binding */ showSiteTitleStep; },
4906
+ /* harmony export */ "setModalDismissible": function() { return /* binding */ setModalDismissible; },
4907
+ /* harmony export */ "unsetModalDismissible": function() { return /* binding */ unsetModalDismissible; },
4908
+ /* harmony export */ "showModalTitle": function() { return /* binding */ showModalTitle; },
4909
+ /* harmony export */ "hideModalTitle": function() { return /* binding */ hideModalTitle; },
4910
+ /* harmony export */ "enablePersistentSuccessView": function() { return /* binding */ enablePersistentSuccessView; },
4911
+ /* harmony export */ "disablePersistentSuccessView": function() { return /* binding */ disablePersistentSuccessView; }
4912
+ /* harmony export */ });
4913
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9818);
4914
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
4915
+ /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9149);
4916
+
4917
+
4918
+ const setSidebarFullscreen = () => ({
4919
+ type: 'SET_SIDEBAR_FULLSCREEN'
4920
+ });
4921
+ const unsetSidebarFullscreen = () => ({
4922
+ type: 'UNSET_SIDEBAR_FULLSCREEN'
4923
+ });
4924
+ const setStep = step => ({
4925
+ type: 'SET_STEP',
4926
+ step
4927
+ });
4928
+ const setSiteTitle = title => ({
4929
+ type: 'SET_SITE_TITLE',
4930
+ title
4931
+ });
4932
+ const setDomain = domain => ({
4933
+ type: 'SET_DOMAIN',
4934
+ domain
4935
+ });
4936
+ const unsetDomain = () => ({
4937
+ type: 'UNSET_DOMAIN'
4938
+ });
4939
+ const confirmDomainSelection = () => ({
4940
+ type: 'CONFIRM_DOMAIN_SELECTION'
4941
+ });
4942
+ const setDomainSearch = domainSearch => ({
4943
+ type: 'SET_DOMAIN_SEARCH',
4944
+ domainSearch
4945
+ });
4946
+ /**
4947
+ * It's not recommended to export this function. We need the billing period
4948
+ * to be a side-effect of the plan. Please don't export this action creator as you might
4949
+ * create a discrepancy between the selected plan and the selected billing period
4950
+ *
4951
+ * @param billingPeriod the period
4952
+ */
4953
+
4954
+ const __internalSetBillingPeriod = billingPeriod => ({
4955
+ type: 'SET_PLAN_BILLING_PERIOD',
4956
+ billingPeriod
4957
+ });
4958
+
4959
+ const setPlanProductId = function* (planProductId) {
4960
+ const isFree = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)(_constants__WEBPACK_IMPORTED_MODULE_1__/* .PLANS_STORE */ .Fs).isPlanProductFree(planProductId);
4961
+
4962
+ if (!isFree) {
4963
+ const planProduct = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)(_constants__WEBPACK_IMPORTED_MODULE_1__/* .PLANS_STORE */ .Fs).getPlanProductById(planProductId);
4964
+ const billingPeriod = (planProduct === null || planProduct === void 0 ? void 0 : planProduct.billingPeriod) ?? 'ANNUALLY';
4965
+ yield __internalSetBillingPeriod(billingPeriod);
4966
+ }
4967
+
4968
+ return {
4969
+ type: 'SET_PLAN_PRODUCT_ID',
4970
+ planProductId
4971
+ };
4972
+ };
4973
+ const unsetPlanProductId = () => ({
4974
+ type: 'UNSET_PLAN_PRODUCT_ID'
4975
+ });
4976
+ function updatePlan(planProductId) {
4977
+ // keep updatePlan for backwards compat
4978
+ return setPlanProductId(planProductId);
4979
+ }
4980
+ const openSidebar = () => ({
4981
+ type: 'OPEN_SIDEBAR'
4982
+ });
4983
+ const closeSidebar = () => ({
4984
+ type: 'CLOSE_SIDEBAR'
4985
+ });
4986
+ const openFocusedLaunch = () => ({
4987
+ type: 'OPEN_FOCUSED_LAUNCH'
4988
+ });
4989
+ const closeFocusedLaunch = () => ({
4990
+ type: 'CLOSE_FOCUSED_LAUNCH'
4991
+ });
4992
+ const enableAnchorFm = () => ({
4993
+ type: 'ENABLE_ANCHOR_FM'
4994
+ });
4995
+ const showSiteTitleStep = () => ({
4996
+ type: 'SHOW_SITE_TITLE_STEP'
4997
+ });
4998
+ const setModalDismissible = () => ({
4999
+ type: 'SET_MODAL_DISMISSIBLE'
5000
+ });
5001
+ const unsetModalDismissible = () => ({
5002
+ type: 'UNSET_MODAL_DISMISSIBLE'
5003
+ });
5004
+ const showModalTitle = () => ({
5005
+ type: 'SHOW_MODAL_TITLE'
5006
+ });
5007
+ const hideModalTitle = () => ({
5008
+ type: 'HIDE_MODAL_TITLE'
5009
+ });
5010
+ const enablePersistentSuccessView = () => ({
5011
+ type: 'ENABLE_SUCCESS_VIEW'
5012
+ });
5013
+ const disablePersistentSuccessView = () => ({
5014
+ type: 'DISABLE_SUCCESS_VIEW'
5015
+ });
5016
+
5017
+ /***/ }),
5018
+
5019
+ /***/ 9149:
5020
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
5021
+
5022
+ "use strict";
5023
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5024
+ /* harmony export */ "Ls": function() { return /* binding */ STORE_KEY; },
5025
+ /* harmony export */ "Fs": function() { return /* binding */ PLANS_STORE; }
5026
+ /* harmony export */ });
5027
+ /* unused harmony export SITE_STORE */
5028
+ const STORE_KEY = 'automattic/launch';
5029
+ const SITE_STORE = 'automattic/site';
5030
+ const PLANS_STORE = 'automattic/onboard/plans';
5031
+
5032
+ /***/ }),
5033
+
5034
+ /***/ 3610:
5035
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
5036
+
5037
+ "use strict";
5038
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5039
+ /* harmony export */ "y": function() { return /* binding */ LaunchStep; },
5040
+ /* harmony export */ "M": function() { return /* binding */ LaunchSequence; }
5041
+ /* harmony export */ });
5042
+ const LaunchStep = {
5043
+ Name: 'name',
5044
+ Domain: 'domain',
5045
+ Plan: 'plan',
5046
+ Final: 'final'
5047
+ };
5048
+ const LaunchSequence = [LaunchStep.Name, LaunchStep.Domain, LaunchStep.Plan, LaunchStep.Final];
5049
+
5050
+ /***/ }),
5051
+
5052
+ /***/ 1635:
5053
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
5054
+
5055
+ "use strict";
5056
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5057
+ /* harmony export */ "z": function() { return /* binding */ register; }
5058
+ /* harmony export */ });
5059
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9818);
5060
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
5061
+ /* harmony import */ var _wordpress_data_controls__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3418);
5062
+ /* harmony import */ var _wordpress_data_controls__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data_controls__WEBPACK_IMPORTED_MODULE_1__);
5063
+ /* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6108);
5064
+ /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9149);
5065
+ /* harmony import */ var _persist__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(594);
5066
+ /* harmony import */ var _reducer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(4648);
5067
+ /* harmony import */ var _selectors__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7092);
5068
+
5069
+
5070
+
5071
+
5072
+
5073
+
5074
+
5075
+
5076
+ (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.use)(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.plugins.persistence, _persist__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z);
5077
+ let isRegistered = false;
5078
+ function register() {
5079
+ if (!isRegistered) {
5080
+ isRegistered = true;
5081
+ (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.registerStore)(_constants__WEBPACK_IMPORTED_MODULE_3__/* .STORE_KEY */ .Ls, {
5082
+ actions: _actions__WEBPACK_IMPORTED_MODULE_4__,
5083
+ controls: _wordpress_data_controls__WEBPACK_IMPORTED_MODULE_1__.controls,
5084
+ reducer: _reducer__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z,
5085
+ selectors: _selectors__WEBPACK_IMPORTED_MODULE_6__,
5086
+ persist: ['domain', 'domainSearch', 'planProductId', 'planBillingPeriod', 'confirmedDomainSelection', 'isAnchorFm', 'isSiteTitleStepVisible', 'siteTitle']
5087
+ });
5088
+ }
5089
+
5090
+ return _constants__WEBPACK_IMPORTED_MODULE_3__/* .STORE_KEY */ .Ls;
5091
+ }
5092
+
5093
+ /***/ }),
5094
+
5095
+ /***/ 594:
5096
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
5097
+
5098
+ "use strict";
5099
+ /* harmony import */ var _persistence_config_factory__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(492);
5100
+
5101
+ /* harmony default export */ __webpack_exports__["Z"] = ((0,_persistence_config_factory__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)('WP_LAUNCH'));
5102
+
5103
+ /***/ }),
5104
+
5105
+ /***/ 4648:
5106
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
5107
+
5108
+ "use strict";
5109
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9818);
5110
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
5111
+ /* harmony import */ var _data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3610);
5112
+
5113
+
5114
+
5115
+ const step = function () {
5116
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _data__WEBPACK_IMPORTED_MODULE_1__/* .LaunchStep.Name */ .y.Name;
5117
+ let action = arguments.length > 1 ? arguments[1] : undefined;
5118
+
5119
+ if (action.type === 'SET_STEP') {
5120
+ return action.step;
5121
+ }
5122
+
5123
+ return state;
5124
+ };
5125
+
5126
+ const siteTitle = function () {
5127
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
5128
+ let action = arguments.length > 1 ? arguments[1] : undefined;
5129
+
5130
+ if (action.type === 'SET_SITE_TITLE') {
5131
+ return action.title;
5132
+ }
5133
+
5134
+ return state;
5135
+ };
5136
+
5137
+ const domain = (state, action) => {
5138
+ if (action.type === 'SET_DOMAIN') {
5139
+ return action.domain;
5140
+ }
5141
+
5142
+ if (action.type === 'UNSET_DOMAIN') {
5143
+ return undefined;
5144
+ }
5145
+
5146
+ return state;
5147
+ };
5148
+
5149
+ const domainSearch = function () {
5150
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
5151
+ let action = arguments.length > 1 ? arguments[1] : undefined;
5152
+
5153
+ if (action.type === 'SET_DOMAIN_SEARCH') {
5154
+ return action.domainSearch;
5155
+ }
5156
+
5157
+ return state;
5158
+ };
5159
+
5160
+ const confirmedDomainSelection = function () {
5161
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
5162
+ let action = arguments.length > 1 ? arguments[1] : undefined;
5163
+
5164
+ if (action.type === 'CONFIRM_DOMAIN_SELECTION') {
5165
+ return true;
5166
+ }
5167
+
5168
+ return state;
5169
+ };
5170
+
5171
+ const planProductId = (state, action) => {
5172
+ if (action.type === 'SET_PLAN_PRODUCT_ID') {
5173
+ return action.planProductId;
5174
+ }
5175
+
5176
+ if (action.type === 'UNSET_PLAN_PRODUCT_ID') {
5177
+ return undefined;
5178
+ }
5179
+
5180
+ return state;
5181
+ };
5182
+
5183
+ const planBillingPeriod = function () {
5184
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'ANNUALLY';
5185
+ let action = arguments.length > 1 ? arguments[1] : undefined;
5186
+
5187
+ if (action.type === 'SET_PLAN_BILLING_PERIOD') {
5188
+ return action.billingPeriod;
5189
+ }
5190
+
5191
+ return state;
5192
+ }; // Check if focused launch modal is open
5193
+
5194
+
5195
+ const isFocusedLaunchOpen = function () {
5196
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
5197
+ let action = arguments.length > 1 ? arguments[1] : undefined;
5198
+
5199
+ if (action.type === 'OPEN_FOCUSED_LAUNCH') {
5200
+ return true;
5201
+ }
5202
+
5203
+ if (action.type === 'CLOSE_FOCUSED_LAUNCH') {
5204
+ return false;
5205
+ }
5206
+
5207
+ return state;
5208
+ }; // Check if step-by-step launch modal is open
5209
+
5210
+
5211
+ const isSidebarOpen = function () {
5212
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
5213
+ let action = arguments.length > 1 ? arguments[1] : undefined;
5214
+
5215
+ if (action.type === 'OPEN_SIDEBAR') {
5216
+ return true;
5217
+ }
5218
+
5219
+ if (action.type === 'CLOSE_SIDEBAR') {
5220
+ return false;
5221
+ }
5222
+
5223
+ return state;
5224
+ }; // Check if step-by-step launch modal is full screen
5225
+
5226
+
5227
+ const isSidebarFullscreen = function () {
5228
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
5229
+ let action = arguments.length > 1 ? arguments[1] : undefined;
5230
+
5231
+ if (action.type === 'SET_SIDEBAR_FULLSCREEN') {
5232
+ return true;
5233
+ }
5234
+
5235
+ if (action.type === 'UNSET_SIDEBAR_FULLSCREEN') {
5236
+ return false;
5237
+ }
5238
+
5239
+ return state;
5240
+ };
5241
+
5242
+ const isAnchorFm = function () {
5243
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
5244
+ let action = arguments.length > 1 ? arguments[1] : undefined;
5245
+
5246
+ if (action.type === 'ENABLE_ANCHOR_FM') {
5247
+ return true;
5248
+ }
5249
+
5250
+ return state;
5251
+ }; // Check if site title step should be displayed
5252
+
5253
+
5254
+ const isSiteTitleStepVisible = function () {
5255
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
5256
+ let action = arguments.length > 1 ? arguments[1] : undefined;
5257
+
5258
+ if (action.type === 'SHOW_SITE_TITLE_STEP') {
5259
+ return true;
5260
+ }
5261
+
5262
+ return state;
5263
+ }; // Check if launch modal can be dismissed
5264
+
5265
+
5266
+ const isModalDismissible = function () {
5267
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
5268
+ let action = arguments.length > 1 ? arguments[1] : undefined;
5269
+
5270
+ if (action.type === 'SET_MODAL_DISMISSIBLE') {
5271
+ return true;
5272
+ }
5273
+
5274
+ if (action.type === 'UNSET_MODAL_DISMISSIBLE') {
5275
+ return false;
5276
+ }
5277
+
5278
+ return state;
5279
+ }; // Check if launch modal title should be visible
5280
+
5281
+
5282
+ const isModalTitleVisible = function () {
5283
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
5284
+ let action = arguments.length > 1 ? arguments[1] : undefined;
5285
+
5286
+ if (action.type === 'SHOW_MODAL_TITLE') {
5287
+ return true;
5288
+ }
5289
+
5290
+ if (action.type === 'HIDE_MODAL_TITLE') {
5291
+ return false;
5292
+ }
5293
+
5294
+ return state;
5295
+ };
5296
+
5297
+ const reducer = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.combineReducers)({
5298
+ step,
5299
+ siteTitle,
5300
+ domain,
5301
+ confirmedDomainSelection,
5302
+ domainSearch,
5303
+ planBillingPeriod,
5304
+ planProductId,
5305
+ isSidebarOpen,
5306
+ isSidebarFullscreen,
5307
+ isAnchorFm,
5308
+ isFocusedLaunchOpen,
5309
+ isSiteTitleStepVisible,
5310
+ isModalDismissible,
5311
+ isModalTitleVisible
5312
+ });
5313
+ /* harmony default export */ __webpack_exports__["Z"] = (reducer);
5314
+
5315
+ /***/ }),
5316
+
5317
+ /***/ 7092:
5318
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
5319
+
5320
+ "use strict";
5321
+ __webpack_require__.r(__webpack_exports__);
5322
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5323
+ /* harmony export */ "getLaunchSequence": function() { return /* binding */ getLaunchSequence; },
5324
+ /* harmony export */ "getLaunchStep": function() { return /* binding */ getLaunchStep; },
5325
+ /* harmony export */ "getState": function() { return /* binding */ getState; },
5326
+ /* harmony export */ "hasPaidDomain": function() { return /* binding */ hasPaidDomain; },
5327
+ /* harmony export */ "getSelectedDomain": function() { return /* binding */ getSelectedDomain; },
5328
+ /* harmony export */ "getSelectedPlanProductId": function() { return /* binding */ getSelectedPlanProductId; },
5329
+ /* harmony export */ "getLastPlanBillingPeriod": function() { return /* binding */ getLastPlanBillingPeriod; },
5330
+ /* harmony export */ "isSelectedPlanPaid": function() { return /* binding */ isSelectedPlanPaid; },
5331
+ /* harmony export */ "hasSelectedDomainOrSubdomain": function() { return /* binding */ hasSelectedDomainOrSubdomain; },
5332
+ /* harmony export */ "isStepCompleted": function() { return /* binding */ isStepCompleted; },
5333
+ /* harmony export */ "isFlowCompleted": function() { return /* binding */ isFlowCompleted; },
5334
+ /* harmony export */ "isFlowStarted": function() { return /* binding */ isFlowStarted; },
5335
+ /* harmony export */ "getFirstIncompleteStep": function() { return /* binding */ getFirstIncompleteStep; },
5336
+ /* harmony export */ "getSiteTitle": function() { return /* binding */ getSiteTitle; },
5337
+ /* harmony export */ "getCurrentStep": function() { return /* binding */ getCurrentStep; },
5338
+ /* harmony export */ "getDomainSearch": function() { return /* binding */ getDomainSearch; }
5339
+ /* harmony export */ });
5340
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9818);
5341
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
5342
+ /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9149);
5343
+ /* harmony import */ var _data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3610);
5344
+
5345
+
5346
+
5347
+ const getLaunchSequence = () => _data__WEBPACK_IMPORTED_MODULE_1__/* .LaunchSequence */ .M;
5348
+ const getLaunchStep = () => _data__WEBPACK_IMPORTED_MODULE_1__/* .LaunchStep */ .y;
5349
+ const getState = state => state;
5350
+ const hasPaidDomain = state => {
5351
+ if (!state.domain) {
5352
+ return false;
5353
+ }
5354
+
5355
+ return !state.domain.is_free; // @TODO: check if we are ever storing a paid domain
5356
+ };
5357
+ const getSelectedDomain = state => state.domain;
5358
+ const getSelectedPlanProductId = state => state.planProductId;
5359
+ /**
5360
+ * This returns the readonly value of the billing period.
5361
+ * This value is automatically inferred from the selected paid plan.
5362
+ * If the user picks a free plan, this value will remain unchanged and
5363
+ * will return the billing period of the previously selected paid plan.
5364
+ *
5365
+ * @param state the state
5366
+ */
5367
+
5368
+ const getLastPlanBillingPeriod = state => state.planBillingPeriod;
5369
+ const isSelectedPlanPaid = state => typeof state.planProductId !== 'undefined' && !(0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)(_constants__WEBPACK_IMPORTED_MODULE_2__/* .PLANS_STORE */ .Fs).isPlanProductFree(state.planProductId); // Check if a domain has been explicitly selected (including free subdomain)
5370
+
5371
+ /**
5372
+ * Check if the user has selected a domain, including explicitly selecting the subdomain
5373
+ * This is useful for step/flow completion in the context of highlighting steps or enabling Launch button
5374
+ *
5375
+ * @param state State
5376
+ */
5377
+
5378
+ const hasSelectedDomainOrSubdomain = state => !!getSelectedDomain(state) || state.confirmedDomainSelection; // Completion status of steps is derived from the state of the launch flow
5379
+ // Warning: because it's using getEntityRecord it works only inside the editor
5380
+
5381
+ const isStepCompleted = (state, step) => {
5382
+ if (step === _data__WEBPACK_IMPORTED_MODULE_1__/* .LaunchStep.Plan */ .y.Plan) {
5383
+ return !!getSelectedPlanProductId(state);
5384
+ }
5385
+
5386
+ if (step === _data__WEBPACK_IMPORTED_MODULE_1__/* .LaunchStep.Name */ .y.Name) {
5387
+ const site = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)('core').getEntityRecord('root', 'site', undefined);
5388
+ return !!(site !== null && site !== void 0 && site.title);
5389
+ }
5390
+
5391
+ if (step === _data__WEBPACK_IMPORTED_MODULE_1__/* .LaunchStep.Domain */ .y.Domain) {
5392
+ return (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)(_constants__WEBPACK_IMPORTED_MODULE_2__/* .STORE_KEY */ .Ls).hasSelectedDomainOrSubdomain();
5393
+ }
5394
+
5395
+ return false;
5396
+ }; // Check if all steps are completed except the last one
5397
+
5398
+ const isFlowCompleted = state => _data__WEBPACK_IMPORTED_MODULE_1__/* .LaunchSequence.slice */ .M.slice(0, _data__WEBPACK_IMPORTED_MODULE_1__/* .LaunchSequence.length */ .M.length - 1).every(step => isStepCompleted(state, step)); // Check if at least one step is completed
5399
+
5400
+ const isFlowStarted = state => _data__WEBPACK_IMPORTED_MODULE_1__/* .LaunchSequence.some */ .M.some(step => isStepCompleted(state, step)); // Get first incomplete step
5401
+
5402
+ const getFirstIncompleteStep = state => _data__WEBPACK_IMPORTED_MODULE_1__/* .LaunchSequence.find */ .M.find(step => !isStepCompleted(state, step));
5403
+ const getSiteTitle = state => state === null || state === void 0 ? void 0 : state.siteTitle;
5404
+ const getCurrentStep = state => state.step;
5405
+ const getDomainSearch = state => state.domainSearch;
5406
+
5407
+ /***/ }),
5408
+
5409
+ /***/ 492:
5410
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
5411
+
5412
+ "use strict";
5413
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5414
+ /* harmony export */ "Z": function() { return /* binding */ createPersistenceConfig; }
5415
+ /* harmony export */ });
5416
+ /*
5417
+ Defines the options used for the @wp/data persistence plugin,
5418
+ which include a persistent storage implementation to add data expiration handling.
5419
+ */
5420
+
5421
+ /**
5422
+ * Creates a storage config for state persistence
5423
+ *
5424
+ * @param storageKey Unique key to the storage
5425
+ */
5426
+ function createPersistenceConfig(storageKey) {
5427
+ const PERSISTENCE_INTERVAL = 7 * 24 * 3600000; // days * hours in days * ms in hour
5428
+
5429
+ const STORAGE_KEY = storageKey;
5430
+ const STORAGE_TS_KEY = storageKey + '_TS'; // A plain object fallback if localStorage is not available
5431
+
5432
+ const objStore = {};
5433
+ const objStorage = {
5434
+ getItem(key) {
5435
+ if (objStore.hasOwnProperty(key)) {
5436
+ return objStore[key];
5437
+ }
5438
+
5439
+ return null;
5440
+ },
5441
+
5442
+ setItem(key, value) {
5443
+ objStore[key] = String(value);
5444
+ },
5445
+
5446
+ removeItem(key) {
5447
+ delete objStore[key];
5448
+ }
5449
+
5450
+ }; // Make sure localStorage support exists
5451
+
5452
+ const localStorageSupport = () => {
5453
+ try {
5454
+ window.localStorage.setItem('WP_ONBOARD_TEST', '1');
5455
+ window.localStorage.removeItem('WP_ONBOARD_TEST');
5456
+ return true;
5457
+ } catch (e) {
5458
+ return false;
5459
+ }
5460
+ }; // Choose the right storage implementation
5461
+
5462
+
5463
+ const storageHandler = localStorageSupport() ? window.localStorage : objStorage; // Persisted data expires after seven days
5464
+
5465
+ const isNotExpired = timestampStr => {
5466
+ const timestamp = Number(timestampStr);
5467
+ return Boolean(timestamp) && timestamp + PERSISTENCE_INTERVAL > Date.now();
5468
+ }; // Check for "fresh" query param
5469
+
5470
+
5471
+ const hasFreshParam = () => {
5472
+ return new URLSearchParams(window.location.search).has('fresh');
5473
+ }; // Handle data expiration by providing a storage object override to the @wp/data persistence plugin.
5474
+
5475
+
5476
+ const storage = {
5477
+ getItem(key) {
5478
+ const timestamp = storageHandler.getItem(STORAGE_TS_KEY);
5479
+
5480
+ if (timestamp && isNotExpired(timestamp) && !hasFreshParam()) {
5481
+ return storageHandler.getItem(key);
5482
+ }
5483
+
5484
+ storageHandler.removeItem(STORAGE_KEY);
5485
+ storageHandler.removeItem(STORAGE_TS_KEY);
5486
+ return null;
5487
+ },
5488
+
5489
+ setItem(key, value) {
5490
+ storageHandler.setItem(STORAGE_TS_KEY, JSON.stringify(Date.now()));
5491
+ storageHandler.setItem(key, value);
5492
+ }
5493
+
5494
+ };
5495
+ const persistOptions = {
5496
+ storageKey: STORAGE_KEY,
5497
+ storage
5498
+ };
5499
+ return persistOptions;
5500
+ }
5501
+
5502
+ /***/ }),
5503
+
5504
+ /***/ 9068:
5505
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
5506
+
5507
+ "use strict";
5508
+ __webpack_require__.r(__webpack_exports__);
5509
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5510
+ /* harmony export */ "setFeatures": function() { return /* binding */ setFeatures; },
5511
+ /* harmony export */ "setFeaturesByType": function() { return /* binding */ setFeaturesByType; },
5512
+ /* harmony export */ "setPlans": function() { return /* binding */ setPlans; },
5513
+ /* harmony export */ "setPlanProducts": function() { return /* binding */ setPlanProducts; },
5514
+ /* harmony export */ "resetPlan": function() { return /* binding */ resetPlan; }
5515
+ /* harmony export */ });
5516
+ const setFeatures = (features, locale) => ({
5517
+ type: 'SET_FEATURES',
5518
+ features,
5519
+ locale
5520
+ });
5521
+ const setFeaturesByType = (featuresByType, locale) => ({
5522
+ type: 'SET_FEATURES_BY_TYPE',
5523
+ featuresByType,
5524
+ locale
5525
+ });
5526
+ const setPlans = (plans, locale) => ({
5527
+ type: 'SET_PLANS',
5528
+ plans,
5529
+ locale
5530
+ });
5531
+ const setPlanProducts = products => ({
5532
+ type: 'SET_PLAN_PRODUCTS',
5533
+ products
5534
+ });
5535
+ const resetPlan = () => ({
5536
+ type: 'RESET_PLAN'
5537
+ });
5538
+
5539
+ /***/ }),
5540
+
5541
+ /***/ 4703:
5542
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
5543
+
5544
+ "use strict";
5545
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5546
+ /* harmony export */ "Ls": function() { return /* binding */ STORE_KEY; },
5547
+ /* harmony export */ "Ho": function() { return /* binding */ FREE_PLAN_PRODUCT_ID; },
5548
+ /* harmony export */ "TO": function() { return /* binding */ TIMELESS_PLAN_FREE; },
5549
+ /* harmony export */ "YS": function() { return /* binding */ TIMELESS_PLAN_PERSONAL; },
5550
+ /* harmony export */ "Gz": function() { return /* binding */ TIMELESS_PLAN_PREMIUM; },
5551
+ /* harmony export */ "hx": function() { return /* binding */ TIMELESS_PLAN_BUSINESS; },
5552
+ /* harmony export */ "iL": function() { return /* binding */ TIMELESS_PLAN_ECOMMERCE; },
5553
+ /* harmony export */ "B6": function() { return /* binding */ plansSlugs; },
5554
+ /* harmony export */ "xT": function() { return /* binding */ plansOrder; },
5555
+ /* harmony export */ "AX": function() { return /* binding */ DEFAULT_PAID_PLAN; },
5556
+ /* harmony export */ "bS": function() { return /* binding */ annualSlugs; },
5557
+ /* harmony export */ "UB": function() { return /* binding */ monthlySlugs; },
5558
+ /* harmony export */ "BV": function() { return /* binding */ plansProductSlugs; },
5559
+ /* harmony export */ "nN": function() { return /* binding */ FEATURE_IDS_THAT_REQUIRE_ANNUALLY_BILLED_PLAN; }
5560
+ /* harmony export */ });
5561
+ /* unused harmony exports PLAN_FREE, PLAN_PERSONAL, PLAN_PREMIUM, PLAN_BUSINESS, PLAN_ECOMMERCE, PLAN_PERSONAL_MONTHLY, PLAN_PREMIUM_MONTHLY, PLAN_BUSINESS_MONTHLY, PLAN_ECOMMERCE_MONTHLY */
5562
+ const STORE_KEY = 'automattic/onboard/plans';
5563
+ const FREE_PLAN_PRODUCT_ID = 1; // plans constants
5564
+
5565
+ const TIMELESS_PLAN_FREE = 'free';
5566
+ const TIMELESS_PLAN_PERSONAL = 'personal';
5567
+ const TIMELESS_PLAN_PREMIUM = 'premium';
5568
+ const TIMELESS_PLAN_BUSINESS = 'business';
5569
+ const TIMELESS_PLAN_ECOMMERCE = 'ecommerce';
5570
+ const plansSlugs = [TIMELESS_PLAN_FREE, TIMELESS_PLAN_PERSONAL, TIMELESS_PLAN_PREMIUM, TIMELESS_PLAN_BUSINESS, TIMELESS_PLAN_ECOMMERCE]; // order of the plans used to determine recommended plan based on features
5571
+
5572
+ const plansOrder = plansSlugs;
5573
+ const DEFAULT_PAID_PLAN = TIMELESS_PLAN_PREMIUM; // plan products constants
5574
+
5575
+ const PLAN_FREE = 'free_plan';
5576
+ const PLAN_PERSONAL = 'personal-bundle';
5577
+ const PLAN_PREMIUM = 'value_bundle';
5578
+ const PLAN_BUSINESS = 'business-bundle';
5579
+ const PLAN_ECOMMERCE = 'ecommerce-bundle';
5580
+ const PLAN_PERSONAL_MONTHLY = 'personal-bundle-monthly';
5581
+ const PLAN_PREMIUM_MONTHLY = 'value_bundle_monthly';
5582
+ const PLAN_BUSINESS_MONTHLY = 'business-bundle-monthly';
5583
+ const PLAN_ECOMMERCE_MONTHLY = 'ecommerce-bundle-monthly';
5584
+ const annualSlugs = [PLAN_PERSONAL, PLAN_PREMIUM, PLAN_BUSINESS, PLAN_ECOMMERCE];
5585
+ const monthlySlugs = [PLAN_PERSONAL_MONTHLY, PLAN_PREMIUM_MONTHLY, PLAN_BUSINESS_MONTHLY, PLAN_ECOMMERCE_MONTHLY];
5586
+ const plansProductSlugs = [PLAN_FREE, ...annualSlugs, ...monthlySlugs];
5587
+ const FEATURE_IDS_THAT_REQUIRE_ANNUALLY_BILLED_PLAN = ['custom-domain', 'support-live', 'priority-support'];
5588
+
5589
+ /***/ }),
5590
+
5591
+ /***/ 9734:
5592
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
5593
+
5594
+ "use strict";
5595
+ __webpack_require__.r(__webpack_exports__);
5596
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5597
+ /* harmony export */ "plansSlugs": function() { return /* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_1__.B6; },
5598
+ /* harmony export */ "plansProductSlugs": function() { return /* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_1__.BV; },
5599
+ /* harmony export */ "TIMELESS_PLAN_FREE": function() { return /* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_1__.TO; },
5600
+ /* harmony export */ "TIMELESS_PLAN_PERSONAL": function() { return /* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_1__.YS; },
5601
+ /* harmony export */ "TIMELESS_PLAN_PREMIUM": function() { return /* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_1__.Gz; },
5602
+ /* harmony export */ "TIMELESS_PLAN_BUSINESS": function() { return /* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_1__.hx; },
5603
+ /* harmony export */ "TIMELESS_PLAN_ECOMMERCE": function() { return /* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_1__.iL; },
5604
+ /* harmony export */ "FREE_PLAN_PRODUCT_ID": function() { return /* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_1__.Ho; },
5605
+ /* harmony export */ "register": function() { return /* binding */ register; }
5606
+ /* harmony export */ });
5607
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9818);
5608
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
5609
+ /* harmony import */ var _wpcom_request_controls__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3661);
5610
+ /* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9068);
5611
+ /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4703);
5612
+ /* harmony import */ var _reducer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9438);
5613
+ /* harmony import */ var _resolvers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5261);
5614
+ /* harmony import */ var _selectors__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7738);
5615
+
5616
+
5617
+
5618
+
5619
+
5620
+
5621
+
5622
+ // plansSlugs is a list with the identifiers for each plan and they are agnostic of billing period; eg: 'free', 'personal'
5623
+ // plansSlugs is also used to construct the route that accepts plan slugs like '/free', '/personal', '/business'
5624
+ // plansProductSlugs is a list with the identifiers for each plan product (including the billing period); eg: 'personal-bundle', 'personal-bundle-monthly'
5625
+ // TIMELESS_* is the slug for each plan
5626
+
5627
+ let isRegistered = false;
5628
+ function register() {
5629
+ if (!isRegistered) {
5630
+ isRegistered = true;
5631
+ (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.registerStore)(_constants__WEBPACK_IMPORTED_MODULE_1__/* .STORE_KEY */ .Ls, {
5632
+ resolvers: _resolvers__WEBPACK_IMPORTED_MODULE_2__,
5633
+ actions: _actions__WEBPACK_IMPORTED_MODULE_3__,
5634
+ controls: _wpcom_request_controls__WEBPACK_IMPORTED_MODULE_4__/* .controls */ .ai,
5635
+ reducer: _reducer__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .ZP,
5636
+ selectors: _selectors__WEBPACK_IMPORTED_MODULE_6__
5637
+ });
5638
+ }
5639
+
5640
+ return _constants__WEBPACK_IMPORTED_MODULE_1__/* .STORE_KEY */ .Ls;
5641
+ }
5642
+
5643
+ /***/ }),
5644
+
5645
+ /***/ 9438:
5646
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
5647
+
5648
+ "use strict";
5649
+ /* unused harmony exports features, featuresByType, plans, planProducts */
5650
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9818);
5651
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
5652
+
5653
+ const features = function () {
5654
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5655
+ let action = arguments.length > 1 ? arguments[1] : undefined;
5656
+
5657
+ switch (action.type) {
5658
+ case 'SET_FEATURES':
5659
+ return { ...state,
5660
+ [action.locale]: action.features
5661
+ };
5662
+
5663
+ default:
5664
+ return state;
5665
+ }
5666
+ };
5667
+ const featuresByType = function () {
5668
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5669
+ let action = arguments.length > 1 ? arguments[1] : undefined;
5670
+
5671
+ switch (action.type) {
5672
+ case 'SET_FEATURES_BY_TYPE':
5673
+ return { ...state,
5674
+ [action.locale]: action.featuresByType
5675
+ };
5676
+
5677
+ default:
5678
+ return state;
5679
+ }
5680
+ };
5681
+ const plans = function () {
5682
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5683
+ let action = arguments.length > 1 ? arguments[1] : undefined;
5684
+
5685
+ switch (action.type) {
5686
+ case 'SET_PLANS':
5687
+ return { ...state,
5688
+ [action.locale]: action.plans
5689
+ };
5690
+
5691
+ default:
5692
+ return state;
5693
+ }
5694
+ };
5695
+ const planProducts = function () {
5696
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
5697
+ let action = arguments.length > 1 ? arguments[1] : undefined;
5698
+
5699
+ switch (action.type) {
5700
+ case 'SET_PLAN_PRODUCTS':
5701
+ return action.products;
5702
+
5703
+ default:
5704
+ return state;
5705
+ }
5706
+ };
5707
+ const reducer = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.combineReducers)({
5708
+ features,
5709
+ featuresByType,
5710
+ planProducts,
5711
+ plans
5712
+ });
5713
+ /* harmony default export */ __webpack_exports__["ZP"] = (reducer);
5714
+
5715
+ /***/ }),
5716
+
5717
+ /***/ 5261:
5718
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
5719
+
5720
+ "use strict";
5721
+ __webpack_require__.r(__webpack_exports__);
5722
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5723
+ /* harmony export */ "getSupportedPlans": function() { return /* binding */ getSupportedPlans; }
5724
+ /* harmony export */ });
5725
+ /* harmony import */ var _automattic_format_currency__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2645);
5726
+ /* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9126);
5727
+ /* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(qs__WEBPACK_IMPORTED_MODULE_0__);
5728
+ /* harmony import */ var _wpcom_request_controls__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3661);
5729
+ /* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9068);
5730
+ /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4703);
5731
+
5732
+
5733
+
5734
+
5735
+
5736
+ const MONTHLY_PLAN_BILLING_PERIOD = 31;
5737
+ /**
5738
+ * Calculates the monthly price of a plan
5739
+ * Annual plans are only priced yearly
5740
+ *
5741
+ * @param plan the plan object
5742
+ */
5743
+
5744
+ function getMonthlyPrice(plan) {
5745
+ return (0,_automattic_format_currency__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP)(plan.raw_price / 12, plan.currency_code, {
5746
+ stripZeros: true
5747
+ });
5748
+ }
5749
+ /**
5750
+ * Calculates the yearly price of a monthly plan
5751
+ *
5752
+ * @param plan the plan object
5753
+ */
5754
+
5755
+
5756
+ function getAnnualPrice(plan) {
5757
+ return (0,_automattic_format_currency__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP)(plan.raw_price * 12, plan.currency_code, {
5758
+ stripZeros: true
5759
+ });
5760
+ }
5761
+ /**
5762
+ * Formats the plan price according to 'format-currency' package rules
5763
+ * We use this for consistency in prices formats across monthly and annual plans
5764
+ *
5765
+ * @param plan the plan object
5766
+ */
5767
+
5768
+
5769
+ function getFormattedPrice(plan) {
5770
+ return (0,_automattic_format_currency__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP)(plan.raw_price, plan.currency_code, {
5771
+ stripZeros: true
5772
+ });
5773
+ }
5774
+
5775
+ function calculateDiscounts(planProducts) {
5776
+ // calculate discounts
5777
+ for (let i = 0; i < _constants__WEBPACK_IMPORTED_MODULE_2__/* .annualSlugs.length */ .bS.length; i++) {
5778
+ const annualPlan = planProducts.find(plan => plan.storeSlug === _constants__WEBPACK_IMPORTED_MODULE_2__/* .annualSlugs */ .bS[i]);
5779
+ const monthlyPlan = planProducts.find(plan => plan.storeSlug === _constants__WEBPACK_IMPORTED_MODULE_2__/* .monthlySlugs */ .UB[i]);
5780
+
5781
+ if (annualPlan && monthlyPlan) {
5782
+ const annualCostIfPaidMonthly = monthlyPlan.rawPrice * 12;
5783
+ const annualCostIfPaidAnnually = annualPlan.rawPrice;
5784
+ const discount = Math.round(100 * (1 - annualCostIfPaidAnnually / annualCostIfPaidMonthly));
5785
+ annualPlan.annualDiscount = discount;
5786
+ monthlyPlan.annualDiscount = discount;
5787
+ }
5788
+ }
5789
+ }
5790
+
5791
+ function processFeatures(features) {
5792
+ return features.reduce((features, feature) => {
5793
+ features[feature.id] = {
5794
+ id: feature.id,
5795
+ name: feature.name,
5796
+ description: feature.description,
5797
+ type: 'checkbox',
5798
+ requiresAnnuallyBilledPlan: _constants__WEBPACK_IMPORTED_MODULE_2__/* .FEATURE_IDS_THAT_REQUIRE_ANNUALLY_BILLED_PLAN.indexOf */ .nN.indexOf(feature.id) > -1
5799
+ };
5800
+ return features;
5801
+ }, {});
5802
+ }
5803
+
5804
+ function featureRequiresAnnual(featureName, allFeaturesData) {
5805
+ const matchedFeatureId = Object.keys(allFeaturesData).find(featureId => allFeaturesData[featureId].name === featureName);
5806
+
5807
+ if (matchedFeatureId) {
5808
+ return allFeaturesData[matchedFeatureId].requiresAnnuallyBilledPlan;
5809
+ }
5810
+
5811
+ return false;
5812
+ }
5813
+
5814
+ function processPlanFeatures(planData, allFeaturesData) {
5815
+ const features = planData.highlighted_features.map(featureName => ({
5816
+ name: featureName,
5817
+ requiresAnnuallyBilledPlan: featureRequiresAnnual(featureName, allFeaturesData)
5818
+ })); // Features requiring an annually billed plan should be first in the array.
5819
+
5820
+ features.sort((a, b) => Number(b.requiresAnnuallyBilledPlan) - Number(a.requiresAnnuallyBilledPlan));
5821
+ return features;
5822
+ }
5823
+
5824
+ function normalizePlanProducts(pricedPlans, periodAgnosticPlans) {
5825
+ const plansProducts = _constants__WEBPACK_IMPORTED_MODULE_2__/* .plansProductSlugs.reduce */ .BV.reduce((plans, slug) => {
5826
+ const planProduct = pricedPlans.find(pricedPlan => pricedPlan.product_slug === slug);
5827
+
5828
+ if (!planProduct) {
5829
+ return plans;
5830
+ }
5831
+
5832
+ const periodAgnosticPlan = periodAgnosticPlans.find(plan => plan.productIds.indexOf(planProduct.product_id) > -1);
5833
+ plans.push({
5834
+ productId: planProduct.product_id,
5835
+ // This means that free plan is considered "annually billed"
5836
+ billingPeriod: planProduct.bill_period === MONTHLY_PLAN_BILLING_PERIOD ? 'MONTHLY' : 'ANNUALLY',
5837
+ periodAgnosticSlug: periodAgnosticPlan.periodAgnosticSlug,
5838
+ storeSlug: planProduct.product_slug,
5839
+ rawPrice: planProduct.raw_price,
5840
+ // Not all plans returned from /plans have a `path_slug` (e.g. monthly plans don't have)
5841
+ pathSlug: planProduct.path_slug,
5842
+ price: (planProduct === null || planProduct === void 0 ? void 0 : planProduct.bill_period) === MONTHLY_PLAN_BILLING_PERIOD || planProduct.raw_price === 0 ? getFormattedPrice(planProduct) : getMonthlyPrice(planProduct),
5843
+ annualPrice: (planProduct === null || planProduct === void 0 ? void 0 : planProduct.bill_period) === MONTHLY_PLAN_BILLING_PERIOD ? getAnnualPrice(planProduct) : getFormattedPrice(planProduct)
5844
+ });
5845
+ return plans;
5846
+ }, []);
5847
+ calculateDiscounts(plansProducts);
5848
+ return plansProducts;
5849
+ }
5850
+
5851
+ function* getSupportedPlans() {
5852
+ let locale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'en';
5853
+ const pricedPlans = yield (0,_wpcom_request_controls__WEBPACK_IMPORTED_MODULE_3__/* .wpcomRequest */ ._9)({
5854
+ path: '/plans',
5855
+ query: (0,qs__WEBPACK_IMPORTED_MODULE_0__.stringify)({
5856
+ locale
5857
+ }),
5858
+ apiVersion: '1.5'
5859
+ });
5860
+ const {
5861
+ body: plansFeatures
5862
+ } = yield (0,_wpcom_request_controls__WEBPACK_IMPORTED_MODULE_3__/* .fetchAndParse */ .An)(`https://public-api.wordpress.com/wpcom/v2/plans/details?locale=${encodeURIComponent(locale)}`, {
5863
+ mode: 'cors',
5864
+ credentials: 'omit'
5865
+ });
5866
+ const features = processFeatures(plansFeatures.features);
5867
+ const periodAgnosticPlans = plansFeatures.plans.map(plan => {
5868
+ var _plan$nonlocalized_sh;
5869
+
5870
+ const planSlug = (_plan$nonlocalized_sh = plan.nonlocalized_short_name) === null || _plan$nonlocalized_sh === void 0 ? void 0 : _plan$nonlocalized_sh.toLowerCase();
5871
+ return {
5872
+ description: plan.tagline,
5873
+ features: processPlanFeatures(plan, features),
5874
+ storage: plan.storage,
5875
+ title: plan.short_name,
5876
+ featuresSlugs: plan.features.reduce((slugs, slug) => {
5877
+ slugs[slug] = true;
5878
+ return slugs;
5879
+ }, {}),
5880
+ isFree: planSlug === _constants__WEBPACK_IMPORTED_MODULE_2__/* .TIMELESS_PLAN_FREE */ .TO,
5881
+ isPopular: planSlug === _constants__WEBPACK_IMPORTED_MODULE_2__/* .TIMELESS_PLAN_PREMIUM */ .Gz,
5882
+ periodAgnosticSlug: planSlug,
5883
+ productIds: plan.products.map(_ref => {
5884
+ let {
5885
+ plan_id
5886
+ } = _ref;
5887
+ return plan_id;
5888
+ })
5889
+ };
5890
+ });
5891
+ const planProducts = normalizePlanProducts(pricedPlans, periodAgnosticPlans);
5892
+ yield (0,_actions__WEBPACK_IMPORTED_MODULE_4__.setPlans)(periodAgnosticPlans, locale);
5893
+ yield (0,_actions__WEBPACK_IMPORTED_MODULE_4__.setPlanProducts)(planProducts);
5894
+ yield (0,_actions__WEBPACK_IMPORTED_MODULE_4__.setFeatures)(features, locale);
5895
+ yield (0,_actions__WEBPACK_IMPORTED_MODULE_4__.setFeaturesByType)(plansFeatures.features_by_type, locale);
5896
+ }
5897
+
5898
+ /***/ }),
5899
+
5900
+ /***/ 7738:
5901
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
5902
+
5903
+ "use strict";
5904
+ __webpack_require__.r(__webpack_exports__);
5905
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5906
+ /* harmony export */ "getFeatures": function() { return /* binding */ getFeatures; },
5907
+ /* harmony export */ "getFeaturesByType": function() { return /* binding */ getFeaturesByType; },
5908
+ /* harmony export */ "getPlanByProductId": function() { return /* binding */ getPlanByProductId; },
5909
+ /* harmony export */ "getPlanProductById": function() { return /* binding */ getPlanProductById; },
5910
+ /* harmony export */ "getPlanByPeriodAgnosticSlug": function() { return /* binding */ getPlanByPeriodAgnosticSlug; },
5911
+ /* harmony export */ "getDefaultPaidPlan": function() { return /* binding */ getDefaultPaidPlan; },
5912
+ /* harmony export */ "getDefaultFreePlan": function() { return /* binding */ getDefaultFreePlan; },
5913
+ /* harmony export */ "getSupportedPlans": function() { return /* binding */ getSupportedPlans; },
5914
+ /* harmony export */ "getPlansProducts": function() { return /* binding */ getPlansProducts; },
5915
+ /* harmony export */ "getPrices": function() { return /* binding */ getPrices; },
5916
+ /* harmony export */ "getPlanByPath": function() { return /* binding */ getPlanByPath; },
5917
+ /* harmony export */ "getPlanProduct": function() { return /* binding */ getPlanProduct; },
5918
+ /* harmony export */ "isPlanEcommerce": function() { return /* binding */ isPlanEcommerce; },
5919
+ /* harmony export */ "isPlanFree": function() { return /* binding */ isPlanFree; },
5920
+ /* harmony export */ "isPlanProductFree": function() { return /* binding */ isPlanProductFree; }
5921
+ /* harmony export */ });
5922
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9818);
5923
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
5924
+ /* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7180);
5925
+ /* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_deprecated__WEBPACK_IMPORTED_MODULE_1__);
5926
+ /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4703);
5927
+
5928
+
5929
+
5930
+ // Some of these selectors require unused parameters because those
5931
+ // params are used by the associated resolver.
5932
+
5933
+ /* eslint-disable @typescript-eslint/no-unused-vars */
5934
+ const getFeatures = (state, locale) => state.features[locale] ?? {};
5935
+ const getFeaturesByType = (state, locale) => state.featuresByType[locale] ?? [];
5936
+ const getPlanByProductId = (_state, productId, locale) => {
5937
+ if (!productId) {
5938
+ return undefined;
5939
+ }
5940
+
5941
+ return (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)(_constants__WEBPACK_IMPORTED_MODULE_2__/* .STORE_KEY */ .Ls).getSupportedPlans(locale).find(plan => plan.productIds.indexOf(productId) > -1);
5942
+ };
5943
+ const getPlanProductById = (_state, productId) => {
5944
+ if (!productId) {
5945
+ return undefined;
5946
+ }
5947
+
5948
+ return (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)(_constants__WEBPACK_IMPORTED_MODULE_2__/* .STORE_KEY */ .Ls).getPlansProducts().find(product => product.productId === productId);
5949
+ };
5950
+ const getPlanByPeriodAgnosticSlug = (_state, slug, locale) => {
5951
+ if (!slug) {
5952
+ return undefined;
5953
+ }
5954
+
5955
+ return (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)(_constants__WEBPACK_IMPORTED_MODULE_2__/* .STORE_KEY */ .Ls).getSupportedPlans(locale).find(plan => plan.periodAgnosticSlug === slug);
5956
+ };
5957
+ const getDefaultPaidPlan = (_, locale) => {
5958
+ return (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)(_constants__WEBPACK_IMPORTED_MODULE_2__/* .STORE_KEY */ .Ls).getSupportedPlans(locale).find(plan => plan.periodAgnosticSlug === _constants__WEBPACK_IMPORTED_MODULE_2__/* .DEFAULT_PAID_PLAN */ .AX);
5959
+ };
5960
+ const getDefaultFreePlan = (_, locale) => {
5961
+ return (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)(_constants__WEBPACK_IMPORTED_MODULE_2__/* .STORE_KEY */ .Ls).getSupportedPlans(locale).find(plan => plan.periodAgnosticSlug === _constants__WEBPACK_IMPORTED_MODULE_2__/* .TIMELESS_PLAN_FREE */ .TO);
5962
+ };
5963
+ const getSupportedPlans = (state, _locale) => {
5964
+ return state.plans[_locale] ?? [];
5965
+ };
5966
+ const getPlansProducts = state => {
5967
+ return state.planProducts;
5968
+ };
5969
+ /**
5970
+ * @deprecated getPrices is deprecated, please use plan.price directly
5971
+ *
5972
+ * @param _state the state
5973
+ * @param _locale the locale
5974
+ */
5975
+
5976
+ const getPrices = (_state, _locale) => {
5977
+ _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_1___default()('getPrices', {
5978
+ alternative: 'getPlanProduct().price'
5979
+ });
5980
+ return (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)(_constants__WEBPACK_IMPORTED_MODULE_2__/* .STORE_KEY */ .Ls).getPlansProducts().reduce((prices, plan) => {
5981
+ prices[plan.storeSlug] = plan.price;
5982
+ return prices;
5983
+ }, {});
5984
+ };
5985
+ const getPlanByPath = (_state, path, locale) => {
5986
+ if (!path) {
5987
+ return undefined;
5988
+ }
5989
+
5990
+ const planProduct = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)(_constants__WEBPACK_IMPORTED_MODULE_2__/* .STORE_KEY */ .Ls).getPlansProducts().find(product => product.pathSlug === path);
5991
+
5992
+ if (!planProduct) {
5993
+ return undefined;
5994
+ }
5995
+
5996
+ return (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)(_constants__WEBPACK_IMPORTED_MODULE_2__/* .STORE_KEY */ .Ls).getSupportedPlans(locale).find(plan => plan.periodAgnosticSlug === planProduct.periodAgnosticSlug);
5997
+ };
5998
+ const getPlanProduct = (_state, periodAgnosticSlug, billingPeriod) => {
5999
+ if (!periodAgnosticSlug || !billingPeriod) {
6000
+ return undefined;
6001
+ }
6002
+
6003
+ return (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)(_constants__WEBPACK_IMPORTED_MODULE_2__/* .STORE_KEY */ .Ls).getPlansProducts().find(product => {
6004
+ const matchesSlug = product.periodAgnosticSlug === periodAgnosticSlug; // The billing period doesn't matter when dealing with free plan
6005
+
6006
+ const matchesBillingPeriod = periodAgnosticSlug === _constants__WEBPACK_IMPORTED_MODULE_2__/* .TIMELESS_PLAN_FREE */ .TO || product.billingPeriod === billingPeriod;
6007
+ return matchesSlug && matchesBillingPeriod;
6008
+ });
6009
+ };
6010
+ const isPlanEcommerce = (_, planSlug) => {
6011
+ return planSlug === _constants__WEBPACK_IMPORTED_MODULE_2__/* .TIMELESS_PLAN_ECOMMERCE */ .iL;
6012
+ };
6013
+ const isPlanFree = (_, planSlug) => {
6014
+ return planSlug === _constants__WEBPACK_IMPORTED_MODULE_2__/* .TIMELESS_PLAN_FREE */ .TO;
6015
+ };
6016
+ const isPlanProductFree = (_, planProductId) => planProductId === _constants__WEBPACK_IMPORTED_MODULE_2__/* .FREE_PLAN_PRODUCT_ID */ .Ho;
6017
+
6018
+ /***/ }),
6019
+
6020
+ /***/ 8459:
6021
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6022
+
6023
+ "use strict";
6024
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6025
+ /* harmony export */ "d": function() { return /* binding */ createActions; }
6026
+ /* harmony export */ });
6027
+ /* harmony import */ var _wpcom_request_controls__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3661);
6028
+ /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9639);
6029
+
6030
+
6031
+ function createActions(clientCreds) {
6032
+ const fetchSite = () => ({
6033
+ type: 'FETCH_SITE'
6034
+ });
6035
+
6036
+ const fetchNewSite = () => ({
6037
+ type: 'FETCH_NEW_SITE'
6038
+ });
6039
+
6040
+ const receiveNewSite = response => ({
6041
+ type: 'RECEIVE_NEW_SITE',
6042
+ response
6043
+ });
6044
+
6045
+ const receiveNewSiteFailed = error => ({
6046
+ type: 'RECEIVE_NEW_SITE_FAILED',
6047
+ error
6048
+ });
6049
+
6050
+ function* createSite(params) {
6051
+ yield fetchNewSite();
6052
+
6053
+ try {
6054
+ const {
6055
+ authToken,
6056
+ ...providedParams
6057
+ } = params;
6058
+ const defaultParams = {
6059
+ client_id: clientCreds.client_id,
6060
+ client_secret: clientCreds.client_secret,
6061
+ // will find an available `*.wordpress.com` url based on the `blog_name`
6062
+ find_available_url: true,
6063
+ // Private site is default, but overridable, setting
6064
+ public: -1
6065
+ };
6066
+ const mergedParams = { ...defaultParams,
6067
+ ...providedParams,
6068
+ // Set to false because site validation should be a separate action
6069
+ validate: false
6070
+ };
6071
+ const newSite = yield (0,_wpcom_request_controls__WEBPACK_IMPORTED_MODULE_0__/* .wpcomRequest */ ._9)({
6072
+ path: '/sites/new',
6073
+ apiVersion: '1.1',
6074
+ method: 'post',
6075
+ body: mergedParams,
6076
+ token: authToken
6077
+ });
6078
+ yield receiveNewSite(newSite);
6079
+ return true;
6080
+ } catch (err) {
6081
+ yield receiveNewSiteFailed(err);
6082
+ return false;
6083
+ }
6084
+ }
6085
+
6086
+ const receiveSite = (siteId, response) => ({
6087
+ type: 'RECEIVE_SITE',
6088
+ siteId,
6089
+ response
6090
+ });
6091
+
6092
+ const receiveSiteTitle = (siteId, name) => ({
6093
+ type: 'RECEIVE_SITE_TITLE',
6094
+ siteId,
6095
+ name
6096
+ });
6097
+
6098
+ const receiveSiteTagline = (siteId, tagline) => ({
6099
+ type: 'RECEIVE_SITE_TAGLINE',
6100
+ siteId,
6101
+ tagline
6102
+ });
6103
+
6104
+ const receiveSiteVerticalId = (siteId, verticalId) => ({
6105
+ type: 'RECEIVE_SITE_VERTICAL_ID',
6106
+ siteId,
6107
+ verticalId
6108
+ });
6109
+
6110
+ const receiveSiteFailed = (siteId, response) => ({
6111
+ type: 'RECEIVE_SITE_FAILED',
6112
+ siteId,
6113
+ response
6114
+ });
6115
+
6116
+ const reset = () => ({
6117
+ type: 'RESET_SITE_STORE'
6118
+ });
6119
+
6120
+ const resetNewSiteFailed = () => ({
6121
+ type: 'RESET_RECEIVE_NEW_SITE_FAILED'
6122
+ });
6123
+
6124
+ const launchSiteStart = siteId => ({
6125
+ type: 'LAUNCH_SITE_START',
6126
+ siteId
6127
+ });
6128
+
6129
+ const launchSiteSuccess = siteId => ({
6130
+ type: 'LAUNCH_SITE_SUCCESS',
6131
+ siteId
6132
+ });
6133
+
6134
+ const launchSiteFailure = (siteId, error) => ({
6135
+ type: 'LAUNCH_SITE_FAILURE',
6136
+ siteId,
6137
+ error
6138
+ });
6139
+
6140
+ function* launchSite(siteId) {
6141
+ yield launchSiteStart(siteId);
6142
+
6143
+ try {
6144
+ yield (0,_wpcom_request_controls__WEBPACK_IMPORTED_MODULE_0__/* .wpcomRequest */ ._9)({
6145
+ path: `/sites/${siteId}/launch`,
6146
+ apiVersion: '1.1',
6147
+ method: 'post'
6148
+ });
6149
+ yield launchSiteSuccess(siteId);
6150
+ } catch (_) {
6151
+ yield launchSiteFailure(siteId, _types__WEBPACK_IMPORTED_MODULE_1__/* .SiteLaunchError.INTERNAL */ .Hc.INTERNAL);
6152
+ }
6153
+ } // TODO: move getCart and setCart to a 'cart' data-store
6154
+
6155
+
6156
+ function* getCart(siteId) {
6157
+ const success = yield (0,_wpcom_request_controls__WEBPACK_IMPORTED_MODULE_0__/* .wpcomRequest */ ._9)({
6158
+ path: '/me/shopping-cart/' + siteId,
6159
+ apiVersion: '1.1',
6160
+ method: 'GET'
6161
+ });
6162
+ return success;
6163
+ }
6164
+
6165
+ const receiveSiteDomains = (siteId, domains) => ({
6166
+ type: 'RECEIVE_SITE_DOMAINS',
6167
+ siteId,
6168
+ domains
6169
+ });
6170
+
6171
+ const receiveSiteSettings = (siteId, settings) => ({
6172
+ type: 'RECEIVE_SITE_SETTINGS',
6173
+ siteId,
6174
+ settings
6175
+ });
6176
+
6177
+ const updateSiteSettings = (siteId, settings) => ({
6178
+ type: 'UPDATE_SITE_SETTINGS',
6179
+ siteId,
6180
+ settings
6181
+ });
6182
+
6183
+ function* setCart(siteId, cartData) {
6184
+ const success = yield (0,_wpcom_request_controls__WEBPACK_IMPORTED_MODULE_0__/* .wpcomRequest */ ._9)({
6185
+ path: '/me/shopping-cart/' + siteId,
6186
+ apiVersion: '1.1',
6187
+ method: 'POST',
6188
+ body: cartData
6189
+ });
6190
+ return success;
6191
+ }
6192
+
6193
+ function* saveSiteSettings(siteId, settings) {
6194
+ try {
6195
+ // extract this into its own function as a generic settings setter
6196
+ yield (0,_wpcom_request_controls__WEBPACK_IMPORTED_MODULE_0__/* .wpcomRequest */ ._9)({
6197
+ path: `/sites/${encodeURIComponent(siteId)}/settings`,
6198
+ apiVersion: '1.4',
6199
+ body: settings,
6200
+ method: 'POST'
6201
+ });
6202
+
6203
+ if ('blogname' in settings) {
6204
+ yield receiveSiteTitle(siteId, settings.blogname);
6205
+ }
6206
+
6207
+ if ('blogdescription' in settings) {
6208
+ yield receiveSiteTagline(siteId, settings.blogdescription);
6209
+ }
6210
+
6211
+ if ('site_vertical_id' in settings) {
6212
+ yield receiveSiteVerticalId(siteId, settings.site_vertical_id);
6213
+ }
6214
+
6215
+ yield updateSiteSettings(siteId, settings);
6216
+ } catch (e) {}
6217
+ }
6218
+
6219
+ function* setIntentOnSite(siteSlug, intent) {
6220
+ try {
6221
+ yield (0,_wpcom_request_controls__WEBPACK_IMPORTED_MODULE_0__/* .wpcomRequest */ ._9)({
6222
+ path: `/sites/${encodeURIComponent(siteSlug)}/site-intent`,
6223
+ apiNamespace: 'wpcom/v2',
6224
+ body: {
6225
+ site_intent: intent
6226
+ },
6227
+ method: 'POST'
6228
+ });
6229
+ } catch (e) {}
6230
+ }
6231
+
6232
+ function* saveSiteTitle(siteId, blogname) {
6233
+ yield saveSiteSettings(siteId, {
6234
+ blogname
6235
+ });
6236
+ }
6237
+
6238
+ function* saveSiteTagline(siteId, blogdescription) {
6239
+ yield saveSiteSettings(siteId, {
6240
+ blogdescription
6241
+ });
6242
+ }
6243
+
6244
+ function* setDesignOnSite(siteSlug, selectedDesign, siteVerticalId) {
6245
+ var _recipe$stylesheet;
6246
+
6247
+ const {
6248
+ theme,
6249
+ recipe
6250
+ } = selectedDesign;
6251
+ yield (0,_wpcom_request_controls__WEBPACK_IMPORTED_MODULE_0__/* .wpcomRequest */ ._9)({
6252
+ path: `/sites/${siteSlug}/themes/mine`,
6253
+ apiVersion: '1.1',
6254
+ body: {
6255
+ theme: (recipe === null || recipe === void 0 ? void 0 : (_recipe$stylesheet = recipe.stylesheet) === null || _recipe$stylesheet === void 0 ? void 0 : _recipe$stylesheet.split('/')[1]) || theme,
6256
+ dont_change_homepage: true
6257
+ },
6258
+ method: 'POST'
6259
+ });
6260
+ /*
6261
+ * Anchor themes are set up directly via Headstart on the server side
6262
+ * so exclude them from theme setup.
6263
+ */
6264
+
6265
+ const anchorDesigns = ['hannah', 'gilbert', 'riley'];
6266
+
6267
+ if (anchorDesigns.indexOf(selectedDesign.template) < 0) {
6268
+ yield (0,_wpcom_request_controls__WEBPACK_IMPORTED_MODULE_0__/* .wpcomRequest */ ._9)({
6269
+ path: `/sites/${encodeURIComponent(siteSlug)}/theme-setup`,
6270
+ apiNamespace: 'wpcom/v2',
6271
+ body: {
6272
+ trim_content: true,
6273
+ pattern_ids: recipe === null || recipe === void 0 ? void 0 : recipe.pattern_ids,
6274
+ vertical_id: siteVerticalId || undefined
6275
+ },
6276
+ method: 'POST'
6277
+ });
6278
+ }
6279
+
6280
+ const data = yield (0,_wpcom_request_controls__WEBPACK_IMPORTED_MODULE_0__/* .wpcomRequest */ ._9)({
6281
+ path: `/sites/${siteSlug}/block-editor`,
6282
+ apiNamespace: 'wpcom/v2',
6283
+ method: 'GET'
6284
+ });
6285
+ return (data === null || data === void 0 ? void 0 : data.is_fse_active) ?? false;
6286
+ }
6287
+
6288
+ const setSiteSetupError = (error, message) => ({
6289
+ type: 'SET_SITE_SETUP_ERROR',
6290
+ error,
6291
+ message
6292
+ });
6293
+
6294
+ const clearSiteSetupError = siteId => ({
6295
+ type: 'CLEAR_SITE_SETUP_ERROR',
6296
+ siteId
6297
+ });
6298
+
6299
+ const atomicTransferStart = (siteId, softwareSet) => ({
6300
+ type: 'ATOMIC_TRANSFER_START',
6301
+ siteId,
6302
+ softwareSet
6303
+ });
6304
+
6305
+ const atomicTransferSuccess = (siteId, softwareSet) => ({
6306
+ type: 'ATOMIC_TRANSFER_SUCCESS',
6307
+ siteId,
6308
+ softwareSet
6309
+ });
6310
+
6311
+ const atomicTransferFailure = (siteId, softwareSet, error) => ({
6312
+ type: 'ATOMIC_TRANSFER_FAILURE',
6313
+ siteId,
6314
+ softwareSet,
6315
+ error
6316
+ });
6317
+
6318
+ function* initiateAtomicTransfer(siteId, softwareSet) {
6319
+ yield atomicTransferStart(siteId, softwareSet);
6320
+
6321
+ try {
6322
+ yield (0,_wpcom_request_controls__WEBPACK_IMPORTED_MODULE_0__/* .wpcomRequest */ ._9)({
6323
+ path: `/sites/${encodeURIComponent(siteId)}/atomic/transfers`,
6324
+ apiNamespace: 'wpcom/v2',
6325
+ method: 'POST',
6326
+ ...(softwareSet ? {
6327
+ body: {
6328
+ software_set: encodeURIComponent(softwareSet)
6329
+ }
6330
+ } : {})
6331
+ });
6332
+ yield atomicTransferSuccess(siteId, softwareSet);
6333
+ } catch (_) {
6334
+ yield atomicTransferFailure(siteId, softwareSet, _types__WEBPACK_IMPORTED_MODULE_1__/* .AtomicTransferError.INTERNAL */ .Hf.INTERNAL);
6335
+ }
6336
+ }
6337
+
6338
+ const latestAtomicTransferStart = siteId => ({
6339
+ type: 'LATEST_ATOMIC_TRANSFER_START',
6340
+ siteId
6341
+ });
6342
+
6343
+ const latestAtomicTransferSuccess = (siteId, transfer) => ({
6344
+ type: 'LATEST_ATOMIC_TRANSFER_SUCCESS',
6345
+ siteId,
6346
+ transfer
6347
+ });
6348
+
6349
+ const latestAtomicTransferFailure = (siteId, error) => ({
6350
+ type: 'LATEST_ATOMIC_TRANSFER_FAILURE',
6351
+ siteId,
6352
+ error
6353
+ });
6354
+
6355
+ function* requestLatestAtomicTransfer(siteId) {
6356
+ yield latestAtomicTransferStart(siteId);
6357
+
6358
+ try {
6359
+ const transfer = yield (0,_wpcom_request_controls__WEBPACK_IMPORTED_MODULE_0__/* .wpcomRequest */ ._9)({
6360
+ path: `/sites/${encodeURIComponent(siteId)}/atomic/transfers/latest`,
6361
+ apiNamespace: 'wpcom/v2',
6362
+ method: 'GET'
6363
+ });
6364
+ yield latestAtomicTransferSuccess(siteId, transfer);
6365
+ } catch (err) {
6366
+ yield latestAtomicTransferFailure(siteId, err);
6367
+ }
6368
+ }
6369
+
6370
+ const atomicSoftwareStatusStart = (siteId, softwareSet) => ({
6371
+ type: 'ATOMIC_SOFTWARE_STATUS_START',
6372
+ siteId,
6373
+ softwareSet
6374
+ });
6375
+
6376
+ const atomicSoftwareStatusSuccess = (siteId, softwareSet, status) => ({
6377
+ type: 'ATOMIC_SOFTWARE_STATUS_SUCCESS',
6378
+ siteId,
6379
+ softwareSet,
6380
+ status
6381
+ });
6382
+
6383
+ const atomicSoftwareStatusFailure = (siteId, softwareSet, error) => ({
6384
+ type: 'ATOMIC_SOFTWARE_STATUS_FAILURE',
6385
+ siteId,
6386
+ softwareSet,
6387
+ error
6388
+ });
6389
+
6390
+ function* requestAtomicSoftwareStatus(siteId, softwareSet) {
6391
+ yield atomicSoftwareStatusStart(siteId, softwareSet);
6392
+
6393
+ try {
6394
+ const status = yield (0,_wpcom_request_controls__WEBPACK_IMPORTED_MODULE_0__/* .wpcomRequest */ ._9)({
6395
+ path: `/sites/${encodeURIComponent(siteId)}/atomic/software/${encodeURIComponent(softwareSet)}`,
6396
+ apiNamespace: 'wpcom/v2',
6397
+ method: 'GET'
6398
+ });
6399
+ yield atomicSoftwareStatusSuccess(siteId, softwareSet, status);
6400
+ } catch (err) {
6401
+ yield atomicSoftwareStatusFailure(siteId, softwareSet, err);
6402
+ }
6403
+ }
6404
+
6405
+ const atomicSoftwareInstallStart = (siteId, softwareSet) => ({
6406
+ type: 'ATOMIC_SOFTWARE_INSTALL_START',
6407
+ siteId,
6408
+ softwareSet
6409
+ });
6410
+
6411
+ const atomicSoftwareInstallSuccess = (siteId, softwareSet) => ({
6412
+ type: 'ATOMIC_SOFTWARE_INSTALL_SUCCESS',
6413
+ siteId,
6414
+ softwareSet
6415
+ });
6416
+
6417
+ const atomicSoftwareInstallFailure = (siteId, softwareSet, error) => ({
6418
+ type: 'ATOMIC_SOFTWARE_INSTALL_FAILURE',
6419
+ siteId,
6420
+ softwareSet,
6421
+ error
6422
+ });
6423
+
6424
+ function* initiateSoftwareInstall(siteId, softwareSet) {
6425
+ yield atomicSoftwareInstallStart(siteId, softwareSet);
6426
+
6427
+ try {
6428
+ yield (0,_wpcom_request_controls__WEBPACK_IMPORTED_MODULE_0__/* .wpcomRequest */ ._9)({
6429
+ path: `/sites/${encodeURIComponent(siteId)}/atomic/software/${encodeURIComponent(softwareSet)}`,
6430
+ apiNamespace: 'wpcom/v2',
6431
+ method: 'POST',
6432
+ body: {}
6433
+ });
6434
+ yield atomicSoftwareInstallSuccess(siteId, softwareSet);
6435
+ } catch (err) {
6436
+ yield atomicSoftwareInstallFailure(siteId, softwareSet, err);
6437
+ }
6438
+ }
6439
+
6440
+ return {
6441
+ receiveSiteDomains,
6442
+ receiveSiteSettings,
6443
+ saveSiteTitle,
6444
+ saveSiteSettings,
6445
+ setIntentOnSite,
6446
+ receiveSiteTitle,
6447
+ fetchNewSite,
6448
+ fetchSite,
6449
+ receiveNewSite,
6450
+ receiveNewSiteFailed,
6451
+ resetNewSiteFailed,
6452
+ setDesignOnSite,
6453
+ createSite,
6454
+ receiveSite,
6455
+ receiveSiteFailed,
6456
+ receiveSiteTagline,
6457
+ receiveSiteVerticalId,
6458
+ updateSiteSettings,
6459
+ saveSiteTagline,
6460
+ reset,
6461
+ launchSite,
6462
+ launchSiteStart,
6463
+ launchSiteSuccess,
6464
+ launchSiteFailure,
6465
+ getCart,
6466
+ setCart,
6467
+ setSiteSetupError,
6468
+ clearSiteSetupError,
6469
+ initiateAtomicTransfer,
6470
+ atomicTransferStart,
6471
+ atomicTransferSuccess,
6472
+ atomicTransferFailure,
6473
+ latestAtomicTransferStart,
6474
+ latestAtomicTransferSuccess,
6475
+ latestAtomicTransferFailure,
6476
+ requestLatestAtomicTransfer,
6477
+ atomicSoftwareStatusStart,
6478
+ atomicSoftwareStatusSuccess,
6479
+ atomicSoftwareStatusFailure,
6480
+ requestAtomicSoftwareStatus,
6481
+ initiateSoftwareInstall,
6482
+ atomicSoftwareInstallStart,
6483
+ atomicSoftwareInstallSuccess,
6484
+ atomicSoftwareInstallFailure
6485
+ };
6486
+ }
6487
+
6488
+ /***/ }),
6489
+
6490
+ /***/ 2005:
6491
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6492
+
6493
+ "use strict";
6494
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6495
+ /* harmony export */ "L": function() { return /* binding */ STORE_KEY; }
6496
+ /* harmony export */ });
6497
+ const STORE_KEY = 'automattic/site';
6498
+
6499
+ /***/ }),
6500
+
6501
+ /***/ 2369:
6502
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6503
+
6504
+ "use strict";
6505
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6506
+ /* harmony export */ "z2": function() { return /* binding */ register; }
6507
+ /* harmony export */ });
6508
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9818);
6509
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
6510
+ /* harmony import */ var _wpcom_request_controls__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3661);
6511
+ /* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8459);
6512
+ /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2005);
6513
+ /* harmony import */ var _reducer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2701);
6514
+ /* harmony import */ var _resolvers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7862);
6515
+ /* harmony import */ var _selectors__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(4309);
6516
+
6517
+
6518
+
6519
+
6520
+
6521
+
6522
+
6523
+
6524
+
6525
+ let isRegistered = false;
6526
+ function register(clientCreds) {
6527
+ if (!isRegistered) {
6528
+ isRegistered = true;
6529
+ (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.registerStore)(_constants__WEBPACK_IMPORTED_MODULE_1__/* .STORE_KEY */ .L, {
6530
+ actions: (0,_actions__WEBPACK_IMPORTED_MODULE_2__/* .createActions */ .d)(clientCreds),
6531
+ controls: _wpcom_request_controls__WEBPACK_IMPORTED_MODULE_3__/* .controls */ .ai,
6532
+ reducer: _reducer__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .ZP,
6533
+ resolvers: _resolvers__WEBPACK_IMPORTED_MODULE_5__,
6534
+ selectors: _selectors__WEBPACK_IMPORTED_MODULE_6__
6535
+ });
6536
+ }
6537
+
6538
+ return _constants__WEBPACK_IMPORTED_MODULE_1__/* .STORE_KEY */ .L;
6539
+ }
6540
+
6541
+ /***/ }),
6542
+
6543
+ /***/ 2701:
6544
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6545
+
6546
+ "use strict";
6547
+ /* unused harmony exports newSiteData, newSiteError, isFetchingSite, fetchingSiteError, isFetchingSiteDetails, sites, sitesDomains, sitesSettings, launchStatus, siteSetupErrors, atomicTransferStatus, latestAtomicTransferStatus, atomicSoftwareStatus, atomicSoftwareInstallStatus */
6548
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9818);
6549
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
6550
+ /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9639);
6551
+
6552
+
6553
+
6554
+ const newSiteData = (state, action) => {
6555
+ if (action.type === 'RECEIVE_NEW_SITE') {
6556
+ const {
6557
+ response
6558
+ } = action;
6559
+ return response.blog_details;
6560
+ } else if (action.type === 'RECEIVE_NEW_SITE_FAILED') {
6561
+ return undefined;
6562
+ } else if (action.type === 'RESET_SITE_STORE') {
6563
+ return undefined;
6564
+ }
6565
+
6566
+ return state;
6567
+ };
6568
+ const newSiteError = (state, action) => {
6569
+ switch (action.type) {
6570
+ case 'FETCH_NEW_SITE':
6571
+ case 'RECEIVE_NEW_SITE':
6572
+ case 'RESET_SITE_STORE':
6573
+ case 'RESET_RECEIVE_NEW_SITE_FAILED':
6574
+ return undefined;
6575
+
6576
+ case 'RECEIVE_NEW_SITE_FAILED':
6577
+ return {
6578
+ error: action.error.error,
6579
+ status: action.error.status,
6580
+ statusCode: action.error.statusCode,
6581
+ name: action.error.name,
6582
+ message: action.error.message
6583
+ };
6584
+ }
6585
+
6586
+ return state;
6587
+ };
6588
+ const isFetchingSite = function () {
6589
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
6590
+ let action = arguments.length > 1 ? arguments[1] : undefined;
6591
+
6592
+ switch (action.type) {
6593
+ case 'FETCH_NEW_SITE':
6594
+ return true;
6595
+
6596
+ case 'RECEIVE_NEW_SITE':
6597
+ case 'RECEIVE_NEW_SITE_FAILED':
6598
+ case 'RESET_SITE_STORE':
6599
+ case 'RESET_RECEIVE_NEW_SITE_FAILED':
6600
+ return false;
6601
+ }
6602
+
6603
+ return state;
6604
+ };
6605
+ const fetchingSiteError = (state, action) => {
6606
+ switch (action.type) {
6607
+ case 'RECEIVE_SITE_FAILED':
6608
+ return {
6609
+ error: action.response.error,
6610
+ message: action.response.message
6611
+ };
6612
+ }
6613
+
6614
+ return state;
6615
+ };
6616
+ const isFetchingSiteDetails = function () {
6617
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
6618
+ let action = arguments.length > 1 ? arguments[1] : undefined;
6619
+
6620
+ switch (action.type) {
6621
+ case 'FETCH_SITE':
6622
+ return true;
6623
+
6624
+ case 'RECEIVE_SITE':
6625
+ case 'RECEIVE_SITE_FAILED':
6626
+ return false;
6627
+ }
6628
+
6629
+ return state;
6630
+ };
6631
+ const sites = function () {
6632
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6633
+ let action = arguments.length > 1 ? arguments[1] : undefined;
6634
+
6635
+ if (action.type === 'RECEIVE_SITE') {
6636
+ if (action.response) {
6637
+ return { ...state,
6638
+ [action.response.ID]: action.response
6639
+ };
6640
+ }
6641
+
6642
+ return state;
6643
+ } else if (action.type === 'RECEIVE_SITE_FAILED') {
6644
+ const {
6645
+ [action.siteId]: idToBeRemoved,
6646
+ ...remainingState
6647
+ } = state;
6648
+ return { ...remainingState
6649
+ };
6650
+ } else if (action.type === 'RESET_SITE_STORE') {
6651
+ return {};
6652
+ } else if (action.type === 'RECEIVE_SITE_TITLE') {
6653
+ return { ...state,
6654
+ [action.siteId]: { ...state[action.siteId],
6655
+ name: action.name
6656
+ }
6657
+ };
6658
+ } else if (action.type === 'RECEIVE_SITE_TAGLINE') {
6659
+ return { ...state,
6660
+ [action.siteId]: { ...state[action.siteId],
6661
+ description: action.tagline ?? ''
6662
+ }
6663
+ };
6664
+ } else if (action.type === 'RECEIVE_SITE_VERTICAL_ID') {
6665
+ var _state$action$siteId;
6666
+
6667
+ return { ...state,
6668
+ [action.siteId]: { ...state[action.siteId],
6669
+ options: { ...((_state$action$siteId = state[action.siteId]) === null || _state$action$siteId === void 0 ? void 0 : _state$action$siteId.options),
6670
+ site_vertical_id: action.verticalId
6671
+ }
6672
+ }
6673
+ };
6674
+ }
6675
+
6676
+ return state;
6677
+ };
6678
+ const sitesDomains = function () {
6679
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6680
+ let action = arguments.length > 1 ? arguments[1] : undefined;
6681
+
6682
+ if (action.type === 'RECEIVE_SITE_DOMAINS') {
6683
+ return { ...state,
6684
+ [action.siteId]: action.domains
6685
+ };
6686
+ }
6687
+
6688
+ return state;
6689
+ };
6690
+ const sitesSettings = function () {
6691
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6692
+ let action = arguments.length > 1 ? arguments[1] : undefined;
6693
+
6694
+ if (action.type === 'RECEIVE_SITE_SETTINGS') {
6695
+ return { ...state,
6696
+ [action.siteId]: action.settings
6697
+ };
6698
+ }
6699
+
6700
+ if (action.type === 'UPDATE_SITE_SETTINGS') {
6701
+ return { ...state,
6702
+ [action.siteId]: { ...(state === null || state === void 0 ? void 0 : state[action.siteId]),
6703
+ ...action.settings
6704
+ }
6705
+ };
6706
+ }
6707
+
6708
+ return state;
6709
+ };
6710
+ const launchStatus = function () {
6711
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6712
+ let action = arguments.length > 1 ? arguments[1] : undefined;
6713
+
6714
+ if (action.type === 'LAUNCH_SITE_START') {
6715
+ return { ...state,
6716
+ [action.siteId]: {
6717
+ status: _types__WEBPACK_IMPORTED_MODULE_1__/* .SiteLaunchStatus.IN_PROGRESS */ .uS.IN_PROGRESS,
6718
+ errorCode: undefined
6719
+ }
6720
+ };
6721
+ }
6722
+
6723
+ if (action.type === 'LAUNCH_SITE_SUCCESS') {
6724
+ return { ...state,
6725
+ [action.siteId]: {
6726
+ status: _types__WEBPACK_IMPORTED_MODULE_1__/* .SiteLaunchStatus.SUCCESS */ .uS.SUCCESS,
6727
+ errorCode: undefined
6728
+ }
6729
+ };
6730
+ }
6731
+
6732
+ if (action.type === 'LAUNCH_SITE_FAILURE') {
6733
+ return { ...state,
6734
+ [action.siteId]: {
6735
+ status: _types__WEBPACK_IMPORTED_MODULE_1__/* .SiteLaunchStatus.FAILURE */ .uS.FAILURE,
6736
+ errorCode: action.error
6737
+ }
6738
+ };
6739
+ }
6740
+
6741
+ return state;
6742
+ };
6743
+ const siteSetupErrors = function () {
6744
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6745
+ let action = arguments.length > 1 ? arguments[1] : undefined;
6746
+
6747
+ if (action.type === 'SET_SITE_SETUP_ERROR') {
6748
+ const {
6749
+ error,
6750
+ message
6751
+ } = action;
6752
+ return {
6753
+ error,
6754
+ message
6755
+ };
6756
+ }
6757
+
6758
+ if (action.type === 'CLEAR_SITE_SETUP_ERROR') {
6759
+ return {};
6760
+ }
6761
+
6762
+ return state;
6763
+ };
6764
+ const atomicTransferStatus = function () {
6765
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6766
+ let action = arguments.length > 1 ? arguments[1] : undefined;
6767
+
6768
+ if (action.type === 'ATOMIC_TRANSFER_START') {
6769
+ return { ...state,
6770
+ [action.siteId]: {
6771
+ status: _types__WEBPACK_IMPORTED_MODULE_1__/* .AtomicTransferStatus.IN_PROGRESS */ .bc.IN_PROGRESS,
6772
+ softwareSet: action.softwareSet,
6773
+ errorCode: undefined
6774
+ }
6775
+ };
6776
+ }
6777
+
6778
+ if (action.type === 'ATOMIC_TRANSFER_SUCCESS') {
6779
+ return { ...state,
6780
+ [action.siteId]: {
6781
+ status: _types__WEBPACK_IMPORTED_MODULE_1__/* .AtomicTransferStatus.SUCCESS */ .bc.SUCCESS,
6782
+ softwareSet: action.softwareSet,
6783
+ errorCode: undefined
6784
+ }
6785
+ };
6786
+ }
6787
+
6788
+ if (action.type === 'ATOMIC_TRANSFER_FAILURE') {
6789
+ return { ...state,
6790
+ [action.siteId]: {
6791
+ status: _types__WEBPACK_IMPORTED_MODULE_1__/* .AtomicTransferStatus.FAILURE */ .bc.FAILURE,
6792
+ softwareSet: action.softwareSet,
6793
+ errorCode: action.error
6794
+ }
6795
+ };
6796
+ }
6797
+
6798
+ return state;
6799
+ };
6800
+ const latestAtomicTransferStatus = function () {
6801
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6802
+ let action = arguments.length > 1 ? arguments[1] : undefined;
6803
+
6804
+ if (action.type === 'LATEST_ATOMIC_TRANSFER_START') {
6805
+ return { ...state,
6806
+ [action.siteId]: {
6807
+ status: _types__WEBPACK_IMPORTED_MODULE_1__/* .LatestAtomicTransferStatus.IN_PROGRESS */ .O.IN_PROGRESS,
6808
+ transfer: undefined,
6809
+ errorCode: undefined
6810
+ }
6811
+ };
6812
+ }
6813
+
6814
+ if (action.type === 'LATEST_ATOMIC_TRANSFER_SUCCESS') {
6815
+ return { ...state,
6816
+ [action.siteId]: {
6817
+ status: _types__WEBPACK_IMPORTED_MODULE_1__/* .LatestAtomicTransferStatus.SUCCESS */ .O.SUCCESS,
6818
+ transfer: action.transfer,
6819
+ errorCode: undefined
6820
+ }
6821
+ };
6822
+ }
6823
+
6824
+ if (action.type === 'LATEST_ATOMIC_TRANSFER_FAILURE') {
6825
+ return { ...state,
6826
+ [action.siteId]: {
6827
+ status: _types__WEBPACK_IMPORTED_MODULE_1__/* .LatestAtomicTransferStatus.FAILURE */ .O.FAILURE,
6828
+ transfer: undefined,
6829
+ errorCode: action.error
6830
+ }
6831
+ };
6832
+ }
6833
+
6834
+ return state;
6835
+ };
6836
+ const atomicSoftwareStatus = function () {
6837
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6838
+ let action = arguments.length > 1 ? arguments[1] : undefined;
6839
+
6840
+ if (action.type === 'ATOMIC_SOFTWARE_STATUS_START') {
6841
+ return { ...state,
6842
+ [action.siteId]: {
6843
+ [action.softwareSet]: {
6844
+ status: undefined,
6845
+ error: undefined
6846
+ }
6847
+ }
6848
+ };
6849
+ }
6850
+
6851
+ if (action.type === 'ATOMIC_SOFTWARE_STATUS_SUCCESS') {
6852
+ return { ...state,
6853
+ [action.siteId]: {
6854
+ [action.softwareSet]: {
6855
+ status: action.status,
6856
+ error: undefined
6857
+ }
6858
+ }
6859
+ };
6860
+ }
6861
+
6862
+ if (action.type === 'ATOMIC_SOFTWARE_STATUS_FAILURE') {
6863
+ return { ...state,
6864
+ [action.siteId]: {
6865
+ [action.softwareSet]: {
6866
+ status: undefined,
6867
+ error: action.error
6868
+ }
6869
+ }
6870
+ };
6871
+ }
6872
+
6873
+ return state;
6874
+ };
6875
+ const atomicSoftwareInstallStatus = function () {
6876
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6877
+ let action = arguments.length > 1 ? arguments[1] : undefined;
6878
+
6879
+ if (action.type === 'ATOMIC_SOFTWARE_INSTALL_START') {
6880
+ return { ...state,
6881
+ [action.siteId]: {
6882
+ [action.softwareSet]: {
6883
+ status: _types__WEBPACK_IMPORTED_MODULE_1__/* .AtomicSoftwareInstallStatus.IN_PROGRESS */ .sw.IN_PROGRESS,
6884
+ error: undefined
6885
+ }
6886
+ }
6887
+ };
6888
+ }
6889
+
6890
+ if (action.type === 'ATOMIC_SOFTWARE_INSTALL_SUCCESS') {
6891
+ return { ...state,
6892
+ [action.siteId]: {
6893
+ [action.softwareSet]: {
6894
+ status: _types__WEBPACK_IMPORTED_MODULE_1__/* .AtomicSoftwareInstallStatus.SUCCESS */ .sw.SUCCESS,
6895
+ error: undefined
6896
+ }
6897
+ }
6898
+ };
6899
+ }
6900
+
6901
+ if (action.type === 'ATOMIC_SOFTWARE_INSTALL_FAILURE') {
6902
+ return { ...state,
6903
+ [action.siteId]: {
6904
+ [action.softwareSet]: {
6905
+ status: _types__WEBPACK_IMPORTED_MODULE_1__/* .AtomicSoftwareInstallStatus.FAILURE */ .sw.FAILURE,
6906
+ error: action.error
6907
+ }
6908
+ }
6909
+ };
6910
+ }
6911
+
6912
+ return state;
6913
+ };
6914
+ const newSite = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.combineReducers)({
6915
+ data: newSiteData,
6916
+ error: newSiteError,
6917
+ isFetching: isFetchingSite
6918
+ });
6919
+ const reducer = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.combineReducers)({
6920
+ isFetchingSiteDetails,
6921
+ newSite,
6922
+ fetchingSiteError,
6923
+ sites,
6924
+ launchStatus,
6925
+ sitesDomains,
6926
+ sitesSettings,
6927
+ siteSetupErrors,
6928
+ atomicTransferStatus,
6929
+ latestAtomicTransferStatus,
6930
+ atomicSoftwareStatus,
6931
+ atomicSoftwareInstallStatus
6932
+ });
6933
+ /* harmony default export */ __webpack_exports__["ZP"] = (reducer);
6934
+
6935
+ /***/ }),
6936
+
6937
+ /***/ 7862:
6938
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6939
+
6940
+ "use strict";
6941
+ __webpack_require__.r(__webpack_exports__);
6942
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6943
+ /* harmony export */ "getSite": function() { return /* binding */ getSite; },
6944
+ /* harmony export */ "getSiteDomains": function() { return /* binding */ getSiteDomains; },
6945
+ /* harmony export */ "getSiteSettings": function() { return /* binding */ getSiteSettings; }
6946
+ /* harmony export */ });
6947
+ /* harmony import */ var wpcom_proxy_request__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8552);
6948
+ // wpcomRequest is a temporary rename while we're working on migrating generators to thunks
6949
+
6950
+
6951
+ /**
6952
+ * Attempt to find a site based on its id, and if not return undefined.
6953
+ * We are currently ignoring error messages and silently failing if we can't find a
6954
+ * site. This could be extended in the future by retrieving the `error` and
6955
+ * `message` strings returned by the API.
6956
+ *
6957
+ * @param siteId {number} The site to look up
6958
+ */
6959
+ const getSite = siteId => async _ref => {
6960
+ let {
6961
+ dispatch
6962
+ } = _ref;
6963
+ dispatch.fetchSite();
6964
+
6965
+ try {
6966
+ const existingSite = await (0,wpcom_proxy_request__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP)({
6967
+ path: '/sites/' + encodeURIComponent(siteId),
6968
+ apiVersion: '1.1'
6969
+ });
6970
+ dispatch.receiveSite(siteId, existingSite);
6971
+ } catch (err) {
6972
+ dispatch.receiveSiteFailed(siteId, err);
6973
+ }
6974
+ };
6975
+ /**
6976
+ * Get all site domains
6977
+ *
6978
+ * @param siteId {number} The site id
6979
+ */
6980
+
6981
+ const getSiteDomains = siteId => async _ref2 => {
6982
+ let {
6983
+ dispatch
6984
+ } = _ref2;
6985
+ const result = await (0,wpcom_proxy_request__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP)({
6986
+ path: '/sites/' + encodeURIComponent(siteId) + '/domains',
6987
+ apiVersion: '1.2'
6988
+ });
6989
+ dispatch.receiveSiteDomains(siteId, result === null || result === void 0 ? void 0 : result.domains);
6990
+ };
6991
+ /**
6992
+ * Get all site settings
6993
+ *
6994
+ * @param siteId {number} The site id
6995
+ */
6996
+
6997
+ const getSiteSettings = siteId => async _ref3 => {
6998
+ let {
6999
+ dispatch
7000
+ } = _ref3;
7001
+ const result = await (0,wpcom_proxy_request__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP)({
7002
+ path: '/sites/' + encodeURIComponent(siteId) + '/settings',
7003
+ apiVersion: '1.4'
7004
+ });
7005
+ dispatch.receiveSiteSettings(siteId, result === null || result === void 0 ? void 0 : result.settings);
7006
+ };
7007
+
7008
+ /***/ }),
7009
+
7010
+ /***/ 4309:
7011
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
7012
+
7013
+ "use strict";
7014
+ __webpack_require__.r(__webpack_exports__);
7015
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7016
+ /* harmony export */ "getState": function() { return /* binding */ getState; },
7017
+ /* harmony export */ "getNewSite": function() { return /* binding */ getNewSite; },
7018
+ /* harmony export */ "getNewSiteError": function() { return /* binding */ getNewSiteError; },
7019
+ /* harmony export */ "isFetchingSite": function() { return /* binding */ isFetchingSite; },
7020
+ /* harmony export */ "getFetchingSiteError": function() { return /* binding */ getFetchingSiteError; },
7021
+ /* harmony export */ "isFetchingSiteDetails": function() { return /* binding */ isFetchingSiteDetails; },
7022
+ /* harmony export */ "isNewSite": function() { return /* binding */ isNewSite; },
7023
+ /* harmony export */ "getSite": function() { return /* binding */ getSite; },
7024
+ /* harmony export */ "getSiteIdBySlug": function() { return /* binding */ getSiteIdBySlug; },
7025
+ /* harmony export */ "getSiteTitle": function() { return /* binding */ getSiteTitle; },
7026
+ /* harmony export */ "getSiteVerticalId": function() { return /* binding */ getSiteVerticalId; },
7027
+ /* harmony export */ "isSiteLaunched": function() { return /* binding */ isSiteLaunched; },
7028
+ /* harmony export */ "isSiteLaunching": function() { return /* binding */ isSiteLaunching; },
7029
+ /* harmony export */ "isSiteAtomic": function() { return /* binding */ isSiteAtomic; },
7030
+ /* harmony export */ "isSiteWPForTeams": function() { return /* binding */ isSiteWPForTeams; },
7031
+ /* harmony export */ "getSiteDomains": function() { return /* binding */ getSiteDomains; },
7032
+ /* harmony export */ "getSiteSettings": function() { return /* binding */ getSiteSettings; },
7033
+ /* harmony export */ "getSiteSetupError": function() { return /* binding */ getSiteSetupError; },
7034
+ /* harmony export */ "getSiteOptions": function() { return /* binding */ getSiteOptions; },
7035
+ /* harmony export */ "getSiteOption": function() { return /* binding */ getSiteOption; },
7036
+ /* harmony export */ "getPrimarySiteDomain": function() { return /* binding */ getPrimarySiteDomain; },
7037
+ /* harmony export */ "getSiteSubdomain": function() { return /* binding */ getSiteSubdomain; },
7038
+ /* harmony export */ "getSiteLatestAtomicTransfer": function() { return /* binding */ getSiteLatestAtomicTransfer; },
7039
+ /* harmony export */ "getSiteLatestAtomicTransferError": function() { return /* binding */ getSiteLatestAtomicTransferError; },
7040
+ /* harmony export */ "getAtomicSoftwareStatus": function() { return /* binding */ getAtomicSoftwareStatus; },
7041
+ /* harmony export */ "getAtomicSoftwareError": function() { return /* binding */ getAtomicSoftwareError; },
7042
+ /* harmony export */ "getAtomicSoftwareInstallError": function() { return /* binding */ getAtomicSoftwareInstallError; },
7043
+ /* harmony export */ "siteHasFeature": function() { return /* binding */ siteHasFeature; },
7044
+ /* harmony export */ "requiresUpgrade": function() { return /* binding */ requiresUpgrade; },
7045
+ /* harmony export */ "isJetpackSite": function() { return /* binding */ isJetpackSite; },
7046
+ /* harmony export */ "isEligibleForProPlan": function() { return /* binding */ isEligibleForProPlan; }
7047
+ /* harmony export */ });
7048
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9818);
7049
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
7050
+ /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2005);
7051
+ /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9639);
7052
+
7053
+
7054
+
7055
+ const getState = state => state;
7056
+ const getNewSite = state => state.newSite.data;
7057
+ const getNewSiteError = state => state.newSite.error;
7058
+ const isFetchingSite = state => state.newSite.isFetching;
7059
+ const getFetchingSiteError = state => state.fetchingSiteError;
7060
+ const isFetchingSiteDetails = state => state.isFetchingSiteDetails;
7061
+ const isNewSite = state => !!state.newSite.data;
7062
+ /**
7063
+ * Get a site matched by id. This selector has a matching
7064
+ * resolver that uses the `siteId` parameter to fetch an existing site. If the
7065
+ * site cannot be found, invalidate the resolution cache.
7066
+ *
7067
+ * @param state {State} state object
7068
+ * @param siteId {number} id of the site to look up
7069
+ */
7070
+
7071
+ const getSite = (state, siteId) => {
7072
+ return state.sites[siteId] || Object.values(state.sites).find(site => site && new URL(site.URL).host === siteId);
7073
+ };
7074
+ const getSiteIdBySlug = (_, slug) => {
7075
+ var _select$getSite;
7076
+
7077
+ return (_select$getSite = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)(_constants__WEBPACK_IMPORTED_MODULE_1__/* .STORE_KEY */ .L).getSite(slug)) === null || _select$getSite === void 0 ? void 0 : _select$getSite.ID;
7078
+ };
7079
+ const getSiteTitle = (_, siteId) => {
7080
+ var _select$getSite2;
7081
+
7082
+ return (_select$getSite2 = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)(_constants__WEBPACK_IMPORTED_MODULE_1__/* .STORE_KEY */ .L).getSite(siteId)) === null || _select$getSite2 === void 0 ? void 0 : _select$getSite2.name;
7083
+ };
7084
+ const getSiteVerticalId = (_, siteId) => {
7085
+ var _select$getSite3, _select$getSite3$opti;
7086
+
7087
+ return (_select$getSite3 = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)(_constants__WEBPACK_IMPORTED_MODULE_1__/* .STORE_KEY */ .L).getSite(siteId)) === null || _select$getSite3 === void 0 ? void 0 : (_select$getSite3$opti = _select$getSite3.options) === null || _select$getSite3$opti === void 0 ? void 0 : _select$getSite3$opti.site_vertical_id;
7088
+ }; // @TODO: Return LaunchStatus instead of a boolean
7089
+
7090
+ const isSiteLaunched = (state, siteId) => {
7091
+ var _state$launchStatus$s;
7092
+
7093
+ return ((_state$launchStatus$s = state.launchStatus[siteId]) === null || _state$launchStatus$s === void 0 ? void 0 : _state$launchStatus$s.status) === _types__WEBPACK_IMPORTED_MODULE_2__/* .SiteLaunchStatus.SUCCESS */ .uS.SUCCESS;
7094
+ }; // @TODO: Return LaunchStatus instead of a boolean
7095
+
7096
+ const isSiteLaunching = (state, siteId) => {
7097
+ var _state$launchStatus$s2;
7098
+
7099
+ return ((_state$launchStatus$s2 = state.launchStatus[siteId]) === null || _state$launchStatus$s2 === void 0 ? void 0 : _state$launchStatus$s2.status) === _types__WEBPACK_IMPORTED_MODULE_2__/* .SiteLaunchStatus.IN_PROGRESS */ .uS.IN_PROGRESS;
7100
+ };
7101
+ const isSiteAtomic = (state, siteId) => {
7102
+ var _select$getSite4, _select$getSite4$opti;
7103
+
7104
+ return ((_select$getSite4 = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)(_constants__WEBPACK_IMPORTED_MODULE_1__/* .STORE_KEY */ .L).getSite(siteId)) === null || _select$getSite4 === void 0 ? void 0 : (_select$getSite4$opti = _select$getSite4.options) === null || _select$getSite4$opti === void 0 ? void 0 : _select$getSite4$opti.is_wpcom_atomic) === true;
7105
+ };
7106
+ const isSiteWPForTeams = (state, siteId) => {
7107
+ var _select$getSite5, _select$getSite5$opti;
7108
+
7109
+ return ((_select$getSite5 = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)(_constants__WEBPACK_IMPORTED_MODULE_1__/* .STORE_KEY */ .L).getSite(siteId)) === null || _select$getSite5 === void 0 ? void 0 : (_select$getSite5$opti = _select$getSite5.options) === null || _select$getSite5$opti === void 0 ? void 0 : _select$getSite5$opti.is_wpforteams_site) === true;
7110
+ };
7111
+ const getSiteDomains = (state, siteId) => {
7112
+ return state.sitesDomains[siteId];
7113
+ };
7114
+ const getSiteSettings = (state, siteId) => {
7115
+ return state.sitesSettings[siteId];
7116
+ };
7117
+ const getSiteSetupError = state => {
7118
+ return state.siteSetupErrors;
7119
+ };
7120
+ const getSiteOptions = (state, siteId) => {
7121
+ var _state$sites$siteId;
7122
+
7123
+ return (_state$sites$siteId = state.sites[siteId]) === null || _state$sites$siteId === void 0 ? void 0 : _state$sites$siteId.options;
7124
+ };
7125
+ const getSiteOption = (state, siteId, optionName) => {
7126
+ var _state$sites$siteId2, _state$sites$siteId2$;
7127
+
7128
+ return (_state$sites$siteId2 = state.sites[siteId]) === null || _state$sites$siteId2 === void 0 ? void 0 : (_state$sites$siteId2$ = _state$sites$siteId2.options) === null || _state$sites$siteId2$ === void 0 ? void 0 : _state$sites$siteId2$[optionName];
7129
+ };
7130
+ const getPrimarySiteDomain = (_, siteId) => {
7131
+ var _select$getSiteDomain;
7132
+
7133
+ return (_select$getSiteDomain = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)(_constants__WEBPACK_IMPORTED_MODULE_1__/* .STORE_KEY */ .L).getSiteDomains(siteId)) === null || _select$getSiteDomain === void 0 ? void 0 : _select$getSiteDomain.find(domain => domain.primary_domain);
7134
+ };
7135
+ const getSiteSubdomain = (_, siteId) => {
7136
+ var _select$getSiteDomain2;
7137
+
7138
+ return (_select$getSiteDomain2 = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)(_constants__WEBPACK_IMPORTED_MODULE_1__/* .STORE_KEY */ .L).getSiteDomains(siteId)) === null || _select$getSiteDomain2 === void 0 ? void 0 : _select$getSiteDomain2.find(domain => domain.is_subdomain);
7139
+ };
7140
+ const getSiteLatestAtomicTransfer = (state, siteId) => {
7141
+ var _state$latestAtomicTr;
7142
+
7143
+ return (_state$latestAtomicTr = state.latestAtomicTransferStatus[siteId]) === null || _state$latestAtomicTr === void 0 ? void 0 : _state$latestAtomicTr.transfer;
7144
+ };
7145
+ const getSiteLatestAtomicTransferError = (state, siteId) => {
7146
+ var _state$latestAtomicTr2;
7147
+
7148
+ return (_state$latestAtomicTr2 = state.latestAtomicTransferStatus[siteId]) === null || _state$latestAtomicTr2 === void 0 ? void 0 : _state$latestAtomicTr2.errorCode;
7149
+ };
7150
+ const getAtomicSoftwareStatus = (state, siteId, softwareSet) => {
7151
+ var _state$atomicSoftware, _state$atomicSoftware2;
7152
+
7153
+ return (_state$atomicSoftware = state.atomicSoftwareStatus[siteId]) === null || _state$atomicSoftware === void 0 ? void 0 : (_state$atomicSoftware2 = _state$atomicSoftware[softwareSet]) === null || _state$atomicSoftware2 === void 0 ? void 0 : _state$atomicSoftware2.status;
7154
+ };
7155
+ const getAtomicSoftwareError = (state, siteId, softwareSet) => {
7156
+ var _state$atomicSoftware3, _state$atomicSoftware4;
7157
+
7158
+ return (_state$atomicSoftware3 = state.atomicSoftwareStatus[siteId]) === null || _state$atomicSoftware3 === void 0 ? void 0 : (_state$atomicSoftware4 = _state$atomicSoftware3[softwareSet]) === null || _state$atomicSoftware4 === void 0 ? void 0 : _state$atomicSoftware4.error;
7159
+ };
7160
+ const getAtomicSoftwareInstallError = (state, siteId, softwareSet) => {
7161
+ var _state$atomicSoftware5, _state$atomicSoftware6;
7162
+
7163
+ return (_state$atomicSoftware5 = state.atomicSoftwareInstallStatus[siteId]) === null || _state$atomicSoftware5 === void 0 ? void 0 : (_state$atomicSoftware6 = _state$atomicSoftware5[softwareSet]) === null || _state$atomicSoftware6 === void 0 ? void 0 : _state$atomicSoftware6.error;
7164
+ };
7165
+ const siteHasFeature = (_, siteId, featureKey) => {
7166
+ var _select$getSite6, _select$getSite6$plan;
7167
+
7168
+ return Boolean(siteId && ((_select$getSite6 = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)(_constants__WEBPACK_IMPORTED_MODULE_1__/* .STORE_KEY */ .L).getSite(siteId)) === null || _select$getSite6 === void 0 ? void 0 : (_select$getSite6$plan = _select$getSite6.plan) === null || _select$getSite6$plan === void 0 ? void 0 : _select$getSite6$plan.features.active.includes(featureKey)));
7169
+ };
7170
+ const requiresUpgrade = (state, siteId) => {
7171
+ return siteId && !(0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)(_constants__WEBPACK_IMPORTED_MODULE_1__/* .STORE_KEY */ .L).siteHasFeature(siteId, 'woop');
7172
+ };
7173
+ function isJetpackSite(state, siteId) {
7174
+ var _select$getSite7;
7175
+
7176
+ return Boolean(siteId && ((_select$getSite7 = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)(_constants__WEBPACK_IMPORTED_MODULE_1__/* .STORE_KEY */ .L).getSite(siteId)) === null || _select$getSite7 === void 0 ? void 0 : _select$getSite7.jetpack));
7177
+ }
7178
+ function isEligibleForProPlan(state, siteId) {
7179
+ if (!siteId) {
7180
+ return false;
7181
+ }
7182
+
7183
+ if (isJetpackSite(state, siteId) && !isSiteAtomic(state, siteId) || isSiteWPForTeams(state, siteId)) {
7184
+ return false;
7185
+ }
7186
+
7187
+ return true;
7188
+ }
7189
+
7190
+ /***/ }),
7191
+
7192
+ /***/ 9639:
7193
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
7194
+
7195
+ "use strict";
7196
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7197
+ /* harmony export */ "Hc": function() { return /* binding */ SiteLaunchError; },
7198
+ /* harmony export */ "uS": function() { return /* binding */ SiteLaunchStatus; },
7199
+ /* harmony export */ "bc": function() { return /* binding */ AtomicTransferStatus; },
7200
+ /* harmony export */ "Hf": function() { return /* binding */ AtomicTransferError; },
7201
+ /* harmony export */ "O": function() { return /* binding */ LatestAtomicTransferStatus; },
7202
+ /* harmony export */ "sw": function() { return /* binding */ AtomicSoftwareInstallStatus; }
7203
+ /* harmony export */ });
7204
+ /* unused harmony export Visibility */
7205
+ let Visibility;
7206
+
7207
+ (function (Visibility) {
7208
+ Visibility[Visibility["PublicIndexed"] = 1] = "PublicIndexed";
7209
+ Visibility[Visibility["PublicNotIndexed"] = 0] = "PublicNotIndexed";
7210
+ Visibility[Visibility["Private"] = -1] = "Private";
7211
+ })(Visibility || (Visibility = {}));
7212
+
7213
+ let SiteLaunchError;
7214
+
7215
+ (function (SiteLaunchError) {
7216
+ SiteLaunchError["INTERNAL"] = "internal";
7217
+ })(SiteLaunchError || (SiteLaunchError = {}));
7218
+
7219
+ let SiteLaunchStatus;
7220
+
7221
+ (function (SiteLaunchStatus) {
7222
+ SiteLaunchStatus["UNINITIALIZED"] = "unintialized";
7223
+ SiteLaunchStatus["IN_PROGRESS"] = "in_progress";
7224
+ SiteLaunchStatus["SUCCESS"] = "success";
7225
+ SiteLaunchStatus["FAILURE"] = "failure";
7226
+ })(SiteLaunchStatus || (SiteLaunchStatus = {}));
7227
+
7228
+ let AtomicTransferStatus;
7229
+
7230
+ (function (AtomicTransferStatus) {
7231
+ AtomicTransferStatus["UNINITIALIZED"] = "unintialized";
7232
+ AtomicTransferStatus["IN_PROGRESS"] = "in_progress";
7233
+ AtomicTransferStatus["SUCCESS"] = "success";
7234
+ AtomicTransferStatus["FAILURE"] = "failure";
7235
+ })(AtomicTransferStatus || (AtomicTransferStatus = {}));
7236
+
7237
+ let AtomicTransferError;
7238
+
7239
+ (function (AtomicTransferError) {
7240
+ AtomicTransferError["INTERNAL"] = "internal";
7241
+ })(AtomicTransferError || (AtomicTransferError = {}));
7242
+
7243
+ let LatestAtomicTransferStatus;
7244
+
7245
+ (function (LatestAtomicTransferStatus) {
7246
+ LatestAtomicTransferStatus["UNINITIALIZED"] = "unintialized";
7247
+ LatestAtomicTransferStatus["IN_PROGRESS"] = "in_progress";
7248
+ LatestAtomicTransferStatus["SUCCESS"] = "success";
7249
+ LatestAtomicTransferStatus["FAILURE"] = "failure";
7250
+ })(LatestAtomicTransferStatus || (LatestAtomicTransferStatus = {}));
7251
+
7252
+ let AtomicSoftwareInstallStatus;
7253
+
7254
+ (function (AtomicSoftwareInstallStatus) {
7255
+ AtomicSoftwareInstallStatus["UNINITIALIZED"] = "unintialized";
7256
+ AtomicSoftwareInstallStatus["IN_PROGRESS"] = "in_progress";
7257
+ AtomicSoftwareInstallStatus["SUCCESS"] = "success";
7258
+ AtomicSoftwareInstallStatus["FAILURE"] = "failure";
7259
+ })(AtomicSoftwareInstallStatus || (AtomicSoftwareInstallStatus = {}));
7260
+
7261
+ /***/ }),
7262
+
7263
+ /***/ 4366:
7264
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
7265
+
7266
+ "use strict";
7267
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7268
+ /* harmony export */ "L": function() { return /* binding */ STORE_KEY; }
7269
+ /* harmony export */ });
7270
+ const STORE_KEY = 'automattic/wpcom-features';
7271
+
7272
+ /***/ }),
7273
+
7274
+ /***/ 2613:
7275
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
7276
+
7277
+ "use strict";
7278
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7279
+ /* harmony export */ "$": function() { return /* binding */ featuresList; }
7280
+ /* harmony export */ });
7281
+ /* harmony import */ var _plans__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9734);
7282
+
7283
+ const {
7284
+ TIMELESS_PLAN_PERSONAL,
7285
+ TIMELESS_PLAN_PREMIUM,
7286
+ TIMELESS_PLAN_BUSINESS,
7287
+ TIMELESS_PLAN_ECOMMERCE
7288
+ } = _plans__WEBPACK_IMPORTED_MODULE_0__;
7289
+ const featuresList = {
7290
+ domain: {
7291
+ id: 'domain',
7292
+ minSupportedPlan: TIMELESS_PLAN_PERSONAL
7293
+ },
7294
+ store: {
7295
+ id: 'store',
7296
+ minSupportedPlan: TIMELESS_PLAN_ECOMMERCE
7297
+ },
7298
+ seo: {
7299
+ id: 'seo',
7300
+ minSupportedPlan: TIMELESS_PLAN_BUSINESS
7301
+ },
7302
+ plugins: {
7303
+ id: 'plugins',
7304
+ minSupportedPlan: TIMELESS_PLAN_BUSINESS
7305
+ },
7306
+ 'ad-free': {
7307
+ id: 'ad-free',
7308
+ minSupportedPlan: TIMELESS_PLAN_PERSONAL
7309
+ },
7310
+ 'image-storage': {
7311
+ id: 'image-storage',
7312
+ minSupportedPlan: TIMELESS_PLAN_PREMIUM
7313
+ },
7314
+ 'video-storage': {
7315
+ id: 'video-storage',
7316
+ minSupportedPlan: TIMELESS_PLAN_PREMIUM
7317
+ },
7318
+ support: {
7319
+ id: 'support',
7320
+ minSupportedPlan: TIMELESS_PLAN_BUSINESS
7321
+ }
7322
+ };
7323
+
7324
+ /***/ }),
7325
+
7326
+ /***/ 182:
7327
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
7328
+
7329
+ "use strict";
7330
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7331
+ /* harmony export */ "z": function() { return /* binding */ register; }
7332
+ /* harmony export */ });
7333
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9818);
7334
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
7335
+ /* harmony import */ var _wordpress_data_controls__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3418);
7336
+ /* harmony import */ var _wordpress_data_controls__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data_controls__WEBPACK_IMPORTED_MODULE_1__);
7337
+ /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4366);
7338
+ /* harmony import */ var _reducer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8638);
7339
+ /* harmony import */ var _selectors__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(335);
7340
+
7341
+
7342
+
7343
+
7344
+
7345
+
7346
+ let isRegistered = false;
7347
+ function register() {
7348
+ if (!isRegistered) {
7349
+ isRegistered = true;
7350
+ (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.registerStore)(_constants__WEBPACK_IMPORTED_MODULE_2__/* .STORE_KEY */ .L, {
7351
+ controls: _wordpress_data_controls__WEBPACK_IMPORTED_MODULE_1__.controls,
7352
+ reducer: _reducer__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z,
7353
+ selectors: _selectors__WEBPACK_IMPORTED_MODULE_4__
7354
+ });
7355
+ }
7356
+
7357
+ return _constants__WEBPACK_IMPORTED_MODULE_2__/* .STORE_KEY */ .L;
7358
+ }
7359
+
7360
+ /***/ }),
7361
+
7362
+ /***/ 8638:
7363
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
7364
+
7365
+ "use strict";
7366
+ /* harmony import */ var _features_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2613);
7367
+
7368
+
7369
+ const reducer = function () {
7370
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _features_data__WEBPACK_IMPORTED_MODULE_0__/* .featuresList */ .$;
7371
+ return state;
7372
+ };
7373
+
7374
+ /* harmony default export */ __webpack_exports__["Z"] = (reducer);
7375
+
7376
+ /***/ }),
7377
+
7378
+ /***/ 335:
7379
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
7380
+
7381
+ "use strict";
7382
+ __webpack_require__.r(__webpack_exports__);
7383
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7384
+ /* harmony export */ "getAllFeatures": function() { return /* binding */ getAllFeatures; },
7385
+ /* harmony export */ "getRecommendedPlanSlug": function() { return /* binding */ getRecommendedPlanSlug; }
7386
+ /* harmony export */ });
7387
+ /* harmony import */ var _plans_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4703);
7388
+
7389
+ const getAllFeatures = state => state;
7390
+ const getRecommendedPlanSlug = (state, selectedFeatures) => {
7391
+ const allFeatures = getAllFeatures(state);
7392
+ if (!selectedFeatures.length) return undefined;
7393
+ return selectedFeatures.reduce((currentMinSupportedPlan, featureId) => {
7394
+ const featureMinSupportedPlan = allFeatures[featureId].minSupportedPlan;
7395
+ return _plans_constants__WEBPACK_IMPORTED_MODULE_0__/* .plansOrder.indexOf */ .xT.indexOf(featureMinSupportedPlan) > _plans_constants__WEBPACK_IMPORTED_MODULE_0__/* .plansOrder.indexOf */ .xT.indexOf(currentMinSupportedPlan) ? featureMinSupportedPlan : currentMinSupportedPlan;
7396
+ }, allFeatures[selectedFeatures[0]].minSupportedPlan);
7397
+ };
7398
+
7399
+ /***/ }),
7400
+
7401
+ /***/ 3661:
7402
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
7403
+
7404
+ "use strict";
7405
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7406
+ /* harmony export */ "_9": function() { return /* binding */ wpcomRequest; },
7407
+ /* harmony export */ "An": function() { return /* binding */ fetchAndParse; },
7408
+ /* harmony export */ "ai": function() { return /* binding */ controls; }
7409
+ /* harmony export */ });
7410
+ /* unused harmony exports reloadProxy, requestAllBlogsAccess, wait */
7411
+ /* harmony import */ var wpcom_proxy_request__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8552);
7412
+
7413
+ const wpcomRequest = request => ({
7414
+ type: 'WPCOM_REQUEST',
7415
+ request
7416
+ });
7417
+ /**
7418
+ * Action for performing a fetching using `window.fetch()` and parsing the response body.
7419
+ * It's different from `apiFetch()` from
7420
+ * `@wordpress/data-controls` in that it doesn't use any middleware to add extra parameters.
7421
+ *
7422
+ * @param resource the resource you wish to fetch
7423
+ * @param options request options
7424
+ */
7425
+
7426
+ const fetchAndParse = (resource, options) => ({
7427
+ type: 'FETCH_AND_PARSE',
7428
+ resource,
7429
+ options
7430
+ });
7431
+ const reloadProxy = () => ({
7432
+ type: 'RELOAD_PROXY'
7433
+ });
7434
+ const requestAllBlogsAccess = () => ({
7435
+ type: 'REQUEST_ALL_BLOGS_ACCESS'
7436
+ });
7437
+ const wait = ms => ({
7438
+ type: 'WAIT',
7439
+ ms
7440
+ });
7441
+ const controls = {
7442
+ WPCOM_REQUEST: _ref => {
7443
+ let {
7444
+ request
7445
+ } = _ref;
7446
+ return (0,wpcom_proxy_request__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP)(request);
7447
+ },
7448
+ FETCH_AND_PARSE: async _ref2 => {
7449
+ let {
7450
+ resource,
7451
+ options
7452
+ } = _ref2;
7453
+ const response = await window.fetch(resource, options);
7454
+ return {
7455
+ ok: response.ok,
7456
+ body: await response.json()
7457
+ };
7458
+ },
7459
+ RELOAD_PROXY: () => {
7460
+ (0,wpcom_proxy_request__WEBPACK_IMPORTED_MODULE_0__/* .reloadProxy */ .sS)();
7461
+ },
7462
+ REQUEST_ALL_BLOGS_ACCESS: () => (0,wpcom_proxy_request__WEBPACK_IMPORTED_MODULE_0__/* .requestAllBlogsAccess */ .Vw)(),
7463
+ WAIT: _ref3 => {
7464
+ let {
7465
+ ms
7466
+ } = _ref3;
7467
+ return new Promise(resolve => setTimeout(resolve, ms));
7468
+ }
7469
+ };
7470
+
7471
+ /***/ }),
7472
+
7473
+ /***/ 7066:
7474
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
7475
+
7476
+ "use strict";
7477
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7478
+ /* harmony export */ "X": function() { return /* binding */ getCurrencyDefaults; }
7479
+ /* harmony export */ });
7480
+ /* unused harmony export CURRENCIES */
7481
+ const CURRENCIES = {
7482
+ AED: {
7483
+ symbol: 'د.إ.‏',
7484
+ grouping: ',',
7485
+ decimal: '.',
7486
+ precision: 2
7487
+ },
7488
+ AFN: {
7489
+ symbol: '؋',
7490
+ grouping: ',',
7491
+ decimal: '.',
7492
+ precision: 2
7493
+ },
7494
+ ALL: {
7495
+ symbol: 'Lek',
7496
+ grouping: '.',
7497
+ decimal: ',',
7498
+ precision: 2
7499
+ },
7500
+ AMD: {
7501
+ symbol: '֏',
7502
+ grouping: ',',
7503
+ decimal: '.',
7504
+ precision: 2
7505
+ },
7506
+ ANG: {
7507
+ symbol: 'ƒ',
7508
+ grouping: ',',
7509
+ decimal: '.',
7510
+ precision: 2
7511
+ },
7512
+ AOA: {
7513
+ symbol: 'Kz',
7514
+ grouping: ',',
7515
+ decimal: '.',
7516
+ precision: 2
7517
+ },
7518
+ ARS: {
7519
+ symbol: '$',
7520
+ grouping: '.',
7521
+ decimal: ',',
7522
+ precision: 2
7523
+ },
7524
+ AUD: {
7525
+ symbol: 'A$',
7526
+ grouping: ',',
7527
+ decimal: '.',
7528
+ precision: 2
7529
+ },
7530
+ AWG: {
7531
+ symbol: 'ƒ',
7532
+ grouping: ',',
7533
+ decimal: '.',
7534
+ precision: 2
7535
+ },
7536
+ AZN: {
7537
+ symbol: '₼',
7538
+ grouping: ' ',
7539
+ decimal: ',',
7540
+ precision: 2
7541
+ },
7542
+ BAM: {
7543
+ symbol: 'КМ',
7544
+ grouping: '.',
7545
+ decimal: ',',
7546
+ precision: 2
7547
+ },
7548
+ BBD: {
7549
+ symbol: 'Bds$',
7550
+ grouping: ',',
7551
+ decimal: '.',
7552
+ precision: 2
7553
+ },
7554
+ BDT: {
7555
+ symbol: '৳',
7556
+ grouping: ',',
7557
+ decimal: '.',
7558
+ precision: 0
7559
+ },
7560
+ BGN: {
7561
+ symbol: 'лв.',
7562
+ grouping: ' ',
7563
+ decimal: ',',
7564
+ precision: 2
7565
+ },
7566
+ BHD: {
7567
+ symbol: 'د.ب.‏',
7568
+ grouping: ',',
7569
+ decimal: '.',
7570
+ precision: 3
7571
+ },
7572
+ BIF: {
7573
+ symbol: 'FBu',
7574
+ grouping: ',',
7575
+ decimal: '.',
7576
+ precision: 0
7577
+ },
7578
+ BMD: {
7579
+ symbol: '$',
7580
+ grouping: ',',
7581
+ decimal: '.',
7582
+ precision: 2
7583
+ },
7584
+ BND: {
7585
+ symbol: '$',
7586
+ grouping: '.',
7587
+ decimal: ',',
7588
+ precision: 0
7589
+ },
7590
+ BOB: {
7591
+ symbol: 'Bs',
7592
+ grouping: '.',
7593
+ decimal: ',',
7594
+ precision: 2
7595
+ },
7596
+ BRL: {
7597
+ symbol: 'R$',
7598
+ grouping: '.',
7599
+ decimal: ',',
7600
+ precision: 2
7601
+ },
7602
+ BSD: {
7603
+ symbol: '$',
7604
+ grouping: ',',
7605
+ decimal: '.',
7606
+ precision: 2
7607
+ },
7608
+ BTC: {
7609
+ symbol: 'Ƀ',
7610
+ grouping: ',',
7611
+ decimal: '.',
7612
+ precision: 2
7613
+ },
7614
+ BTN: {
7615
+ symbol: 'Nu.',
7616
+ grouping: ',',
7617
+ decimal: '.',
7618
+ precision: 1
7619
+ },
7620
+ BWP: {
7621
+ symbol: 'P',
7622
+ grouping: ',',
7623
+ decimal: '.',
7624
+ precision: 2
7625
+ },
7626
+ BYR: {
7627
+ symbol: 'р.',
7628
+ grouping: ' ',
7629
+ decimal: ',',
7630
+ precision: 2
7631
+ },
7632
+ BZD: {
7633
+ symbol: 'BZ$',
7634
+ grouping: ',',
7635
+ decimal: '.',
7636
+ precision: 2
7637
+ },
7638
+ CAD: {
7639
+ symbol: 'C$',
7640
+ grouping: ',',
7641
+ decimal: '.',
7642
+ precision: 2
7643
+ },
7644
+ CDF: {
7645
+ symbol: 'FC',
7646
+ grouping: ',',
7647
+ decimal: '.',
7648
+ precision: 2
7649
+ },
7650
+ CHF: {
7651
+ symbol: 'CHF',
7652
+ grouping: "'",
7653
+ decimal: '.',
7654
+ precision: 2
7655
+ },
7656
+ CLP: {
7657
+ symbol: '$',
7658
+ grouping: '.',
7659
+ decimal: ',',
7660
+ precision: 2
7661
+ },
7662
+ CNY: {
7663
+ symbol: '¥',
7664
+ grouping: ',',
7665
+ decimal: '.',
7666
+ precision: 2
7667
+ },
7668
+ COP: {
7669
+ symbol: '$',
7670
+ grouping: '.',
7671
+ decimal: ',',
7672
+ precision: 2
7673
+ },
7674
+ CRC: {
7675
+ symbol: '₡',
7676
+ grouping: '.',
7677
+ decimal: ',',
7678
+ precision: 2
7679
+ },
7680
+ CUC: {
7681
+ symbol: 'CUC',
7682
+ grouping: ',',
7683
+ decimal: '.',
7684
+ precision: 2
7685
+ },
7686
+ CUP: {
7687
+ symbol: '$MN',
7688
+ grouping: ',',
7689
+ decimal: '.',
7690
+ precision: 2
7691
+ },
7692
+ CVE: {
7693
+ symbol: '$',
7694
+ grouping: ',',
7695
+ decimal: '.',
7696
+ precision: 2
7697
+ },
7698
+ CZK: {
7699
+ symbol: 'Kč',
7700
+ grouping: ' ',
7701
+ decimal: ',',
7702
+ precision: 2
7703
+ },
7704
+ DJF: {
7705
+ symbol: 'Fdj',
7706
+ grouping: ',',
7707
+ decimal: '.',
7708
+ precision: 0
7709
+ },
7710
+ DKK: {
7711
+ symbol: 'kr.',
7712
+ grouping: '',
7713
+ decimal: ',',
7714
+ precision: 2
7715
+ },
7716
+ DOP: {
7717
+ symbol: 'RD$',
7718
+ grouping: ',',
7719
+ decimal: '.',
7720
+ precision: 2
7721
+ },
7722
+ DZD: {
7723
+ symbol: 'د.ج.‏',
7724
+ grouping: ',',
7725
+ decimal: '.',
7726
+ precision: 2
7727
+ },
7728
+ EGP: {
7729
+ symbol: 'ج.م.‏',
7730
+ grouping: ',',
7731
+ decimal: '.',
7732
+ precision: 2
7733
+ },
7734
+ ERN: {
7735
+ symbol: 'Nfk',
7736
+ grouping: ',',
7737
+ decimal: '.',
7738
+ precision: 2
7739
+ },
7740
+ ETB: {
7741
+ symbol: 'ETB',
7742
+ grouping: ',',
7743
+ decimal: '.',
7744
+ precision: 2
7745
+ },
7746
+ EUR: {
7747
+ symbol: '€',
7748
+ grouping: '.',
7749
+ decimal: ',',
7750
+ precision: 2
7751
+ },
7752
+ FJD: {
7753
+ symbol: 'FJ$',
7754
+ grouping: ',',
7755
+ decimal: '.',
7756
+ precision: 2
7757
+ },
7758
+ FKP: {
7759
+ symbol: '£',
7760
+ grouping: ',',
7761
+ decimal: '.',
7762
+ precision: 2
7763
+ },
7764
+ GBP: {
7765
+ symbol: '£',
7766
+ grouping: ',',
7767
+ decimal: '.',
7768
+ precision: 2
7769
+ },
7770
+ GEL: {
7771
+ symbol: 'Lari',
7772
+ grouping: ' ',
7773
+ decimal: ',',
7774
+ precision: 2
7775
+ },
7776
+ GHS: {
7777
+ symbol: '₵',
7778
+ grouping: ',',
7779
+ decimal: '.',
7780
+ precision: 2
7781
+ },
7782
+ GIP: {
7783
+ symbol: '£',
7784
+ grouping: ',',
7785
+ decimal: '.',
7786
+ precision: 2
7787
+ },
7788
+ GMD: {
7789
+ symbol: 'D',
7790
+ grouping: ',',
7791
+ decimal: '.',
7792
+ precision: 2
7793
+ },
7794
+ GNF: {
7795
+ symbol: 'FG',
7796
+ grouping: ',',
7797
+ decimal: '.',
7798
+ precision: 0
7799
+ },
7800
+ GTQ: {
7801
+ symbol: 'Q',
7802
+ grouping: ',',
7803
+ decimal: '.',
7804
+ precision: 2
7805
+ },
7806
+ GYD: {
7807
+ symbol: 'G$',
7808
+ grouping: ',',
7809
+ decimal: '.',
7810
+ precision: 2
7811
+ },
7812
+ HKD: {
7813
+ symbol: 'HK$',
7814
+ grouping: ',',
7815
+ decimal: '.',
7816
+ precision: 2
7817
+ },
7818
+ HNL: {
7819
+ symbol: 'L.',
7820
+ grouping: ',',
7821
+ decimal: '.',
7822
+ precision: 2
7823
+ },
7824
+ HRK: {
7825
+ symbol: 'kn',
7826
+ grouping: '.',
7827
+ decimal: ',',
7828
+ precision: 2
7829
+ },
7830
+ HTG: {
7831
+ symbol: 'G',
7832
+ grouping: ',',
7833
+ decimal: '.',
7834
+ precision: 2
7835
+ },
7836
+ HUF: {
7837
+ symbol: 'Ft',
7838
+ grouping: '.',
7839
+ decimal: ',',
7840
+ precision: 0
7841
+ },
7842
+ IDR: {
7843
+ symbol: 'Rp',
7844
+ grouping: '.',
7845
+ decimal: ',',
7846
+ precision: 0
7847
+ },
7848
+ ILS: {
7849
+ symbol: '₪',
7850
+ grouping: ',',
7851
+ decimal: '.',
7852
+ precision: 2
7853
+ },
7854
+ INR: {
7855
+ symbol: '₹',
7856
+ grouping: ',',
7857
+ decimal: '.',
7858
+ precision: 2
7859
+ },
7860
+ IQD: {
7861
+ symbol: 'د.ع.‏',
7862
+ grouping: ',',
7863
+ decimal: '.',
7864
+ precision: 2
7865
+ },
7866
+ IRR: {
7867
+ symbol: '﷼',
7868
+ grouping: ',',
7869
+ decimal: '/',
7870
+ precision: 2
7871
+ },
7872
+ ISK: {
7873
+ symbol: 'kr.',
7874
+ grouping: '.',
7875
+ decimal: ',',
7876
+ precision: 0
7877
+ },
7878
+ JMD: {
7879
+ symbol: 'J$',
7880
+ grouping: ',',
7881
+ decimal: '.',
7882
+ precision: 2
7883
+ },
7884
+ JOD: {
7885
+ symbol: 'د.ا.‏',
7886
+ grouping: ',',
7887
+ decimal: '.',
7888
+ precision: 3
7889
+ },
7890
+ JPY: {
7891
+ symbol: '¥',
7892
+ grouping: ',',
7893
+ decimal: '.',
7894
+ precision: 0
7895
+ },
7896
+ KES: {
7897
+ symbol: 'S',
7898
+ grouping: ',',
7899
+ decimal: '.',
7900
+ precision: 2
7901
+ },
7902
+ KGS: {
7903
+ symbol: 'сом',
7904
+ grouping: ' ',
7905
+ decimal: '-',
7906
+ precision: 2
7907
+ },
7908
+ KHR: {
7909
+ symbol: '៛',
7910
+ grouping: ',',
7911
+ decimal: '.',
7912
+ precision: 0
7913
+ },
7914
+ KMF: {
7915
+ symbol: 'CF',
7916
+ grouping: ',',
7917
+ decimal: '.',
7918
+ precision: 2
7919
+ },
7920
+ KPW: {
7921
+ symbol: '₩',
7922
+ grouping: ',',
7923
+ decimal: '.',
7924
+ precision: 0
7925
+ },
7926
+ KRW: {
7927
+ symbol: '₩',
7928
+ grouping: ',',
7929
+ decimal: '.',
7930
+ precision: 0
7931
+ },
7932
+ KWD: {
7933
+ symbol: 'د.ك.‏',
7934
+ grouping: ',',
7935
+ decimal: '.',
7936
+ precision: 3
7937
+ },
7938
+ KYD: {
7939
+ symbol: '$',
7940
+ grouping: ',',
7941
+ decimal: '.',
7942
+ precision: 2
7943
+ },
7944
+ KZT: {
7945
+ symbol: '₸',
7946
+ grouping: ' ',
7947
+ decimal: '-',
7948
+ precision: 2
7949
+ },
7950
+ LAK: {
7951
+ symbol: '₭',
7952
+ grouping: ',',
7953
+ decimal: '.',
7954
+ precision: 0
7955
+ },
7956
+ LBP: {
7957
+ symbol: 'ل.ل.‏',
7958
+ grouping: ',',
7959
+ decimal: '.',
7960
+ precision: 2
7961
+ },
7962
+ LKR: {
7963
+ symbol: '₨',
7964
+ grouping: ',',
7965
+ decimal: '.',
7966
+ precision: 0
7967
+ },
7968
+ LRD: {
7969
+ symbol: 'L$',
7970
+ grouping: ',',
7971
+ decimal: '.',
7972
+ precision: 2
7973
+ },
7974
+ LSL: {
7975
+ symbol: 'M',
7976
+ grouping: ',',
7977
+ decimal: '.',
7978
+ precision: 2
7979
+ },
7980
+ LYD: {
7981
+ symbol: 'د.ل.‏',
7982
+ grouping: ',',
7983
+ decimal: '.',
7984
+ precision: 3
7985
+ },
7986
+ MAD: {
7987
+ symbol: 'د.م.‏',
7988
+ grouping: ',',
7989
+ decimal: '.',
7990
+ precision: 2
7991
+ },
7992
+ MDL: {
7993
+ symbol: 'lei',
7994
+ grouping: ',',
7995
+ decimal: '.',
7996
+ precision: 2
7997
+ },
7998
+ MGA: {
7999
+ symbol: 'Ar',
8000
+ grouping: ',',
8001
+ decimal: '.',
8002
+ precision: 0
8003
+ },
8004
+ MKD: {
8005
+ symbol: 'ден.',
8006
+ grouping: '.',
8007
+ decimal: ',',
8008
+ precision: 2
8009
+ },
8010
+ MMK: {
8011
+ symbol: 'K',
8012
+ grouping: ',',
8013
+ decimal: '.',
8014
+ precision: 2
8015
+ },
8016
+ MNT: {
8017
+ symbol: '₮',
8018
+ grouping: ' ',
8019
+ decimal: ',',
8020
+ precision: 2
8021
+ },
8022
+ MOP: {
8023
+ symbol: 'MOP$',
8024
+ grouping: ',',
8025
+ decimal: '.',
8026
+ precision: 2
8027
+ },
8028
+ MRO: {
8029
+ symbol: 'UM',
8030
+ grouping: ',',
8031
+ decimal: '.',
8032
+ precision: 2
8033
+ },
8034
+ MTL: {
8035
+ symbol: '₤',
8036
+ grouping: ',',
8037
+ decimal: '.',
8038
+ precision: 2
8039
+ },
8040
+ MUR: {
8041
+ symbol: '₨',
8042
+ grouping: ',',
8043
+ decimal: '.',
8044
+ precision: 2
8045
+ },
8046
+ MVR: {
8047
+ symbol: 'MVR',
8048
+ grouping: ',',
8049
+ decimal: '.',
8050
+ precision: 1
8051
+ },
8052
+ MWK: {
8053
+ symbol: 'MK',
8054
+ grouping: ',',
8055
+ decimal: '.',
8056
+ precision: 2
8057
+ },
8058
+ MXN: {
8059
+ symbol: 'MX$',
8060
+ grouping: ',',
8061
+ decimal: '.',
8062
+ precision: 2
8063
+ },
8064
+ MYR: {
8065
+ symbol: 'RM',
8066
+ grouping: ',',
8067
+ decimal: '.',
8068
+ precision: 2
8069
+ },
8070
+ MZN: {
8071
+ symbol: 'MT',
8072
+ grouping: ',',
8073
+ decimal: '.',
8074
+ precision: 0
8075
+ },
8076
+ NAD: {
8077
+ symbol: 'N$',
8078
+ grouping: ',',
8079
+ decimal: '.',
8080
+ precision: 2
8081
+ },
8082
+ NGN: {
8083
+ symbol: '₦',
8084
+ grouping: ',',
8085
+ decimal: '.',
8086
+ precision: 2
8087
+ },
8088
+ NIO: {
8089
+ symbol: 'C$',
8090
+ grouping: ',',
8091
+ decimal: '.',
8092
+ precision: 2
8093
+ },
8094
+ NOK: {
8095
+ symbol: 'kr',
8096
+ grouping: ' ',
8097
+ decimal: ',',
8098
+ precision: 2
8099
+ },
8100
+ NPR: {
8101
+ symbol: '₨',
8102
+ grouping: ',',
8103
+ decimal: '.',
8104
+ precision: 2
8105
+ },
8106
+ NZD: {
8107
+ symbol: 'NZ$',
8108
+ grouping: ',',
8109
+ decimal: '.',
8110
+ precision: 2
8111
+ },
8112
+ OMR: {
8113
+ symbol: '﷼',
8114
+ grouping: ',',
8115
+ decimal: '.',
8116
+ precision: 3
8117
+ },
8118
+ PAB: {
8119
+ symbol: 'B/.',
8120
+ grouping: ',',
8121
+ decimal: '.',
8122
+ precision: 2
8123
+ },
8124
+ PEN: {
8125
+ symbol: 'S/.',
8126
+ grouping: ',',
8127
+ decimal: '.',
8128
+ precision: 2
8129
+ },
8130
+ PGK: {
8131
+ symbol: 'K',
8132
+ grouping: ',',
8133
+ decimal: '.',
8134
+ precision: 2
8135
+ },
8136
+ PHP: {
8137
+ symbol: '₱',
8138
+ grouping: ',',
8139
+ decimal: '.',
8140
+ precision: 2
8141
+ },
8142
+ PKR: {
8143
+ symbol: '₨',
8144
+ grouping: ',',
8145
+ decimal: '.',
8146
+ precision: 2
8147
+ },
8148
+ PLN: {
8149
+ symbol: 'zł',
8150
+ grouping: ' ',
8151
+ decimal: ',',
8152
+ precision: 2
8153
+ },
8154
+ PYG: {
8155
+ symbol: '₲',
8156
+ grouping: '.',
8157
+ decimal: ',',
8158
+ precision: 2
8159
+ },
8160
+ QAR: {
8161
+ symbol: '﷼',
8162
+ grouping: ',',
8163
+ decimal: '.',
8164
+ precision: 2
8165
+ },
8166
+ RON: {
8167
+ symbol: 'lei',
8168
+ grouping: '.',
8169
+ decimal: ',',
8170
+ precision: 2
8171
+ },
8172
+ RSD: {
8173
+ symbol: 'Дин.',
8174
+ grouping: '.',
8175
+ decimal: ',',
8176
+ precision: 2
8177
+ },
8178
+ RUB: {
8179
+ symbol: '₽',
8180
+ grouping: ' ',
8181
+ decimal: ',',
8182
+ precision: 2
8183
+ },
8184
+ RWF: {
8185
+ symbol: 'RWF',
8186
+ grouping: ' ',
8187
+ decimal: ',',
8188
+ precision: 2
8189
+ },
8190
+ SAR: {
8191
+ symbol: '﷼',
8192
+ grouping: ',',
8193
+ decimal: '.',
8194
+ precision: 2
8195
+ },
8196
+ SBD: {
8197
+ symbol: 'S$',
8198
+ grouping: ',',
8199
+ decimal: '.',
8200
+ precision: 2
8201
+ },
8202
+ SCR: {
8203
+ symbol: '₨',
8204
+ grouping: ',',
8205
+ decimal: '.',
8206
+ precision: 2
8207
+ },
8208
+ SDD: {
8209
+ symbol: 'LSd',
8210
+ grouping: ',',
8211
+ decimal: '.',
8212
+ precision: 2
8213
+ },
8214
+ SDG: {
8215
+ symbol: '£‏',
8216
+ grouping: ',',
8217
+ decimal: '.',
8218
+ precision: 2
8219
+ },
8220
+ SEK: {
8221
+ symbol: 'kr',
8222
+ grouping: ',',
8223
+ decimal: '.',
8224
+ precision: 2
8225
+ },
8226
+ SGD: {
8227
+ symbol: 'S$',
8228
+ grouping: ',',
8229
+ decimal: '.',
8230
+ precision: 2
8231
+ },
8232
+ SHP: {
8233
+ symbol: '£',
8234
+ grouping: ',',
8235
+ decimal: '.',
8236
+ precision: 2
8237
+ },
8238
+ SLL: {
8239
+ symbol: 'Le',
8240
+ grouping: ',',
8241
+ decimal: '.',
8242
+ precision: 2
8243
+ },
8244
+ SOS: {
8245
+ symbol: 'S',
8246
+ grouping: ',',
8247
+ decimal: '.',
8248
+ precision: 2
8249
+ },
8250
+ SRD: {
8251
+ symbol: '$',
8252
+ grouping: ',',
8253
+ decimal: '.',
8254
+ precision: 2
8255
+ },
8256
+ STD: {
8257
+ symbol: 'Db',
8258
+ grouping: ',',
8259
+ decimal: '.',
8260
+ precision: 2
8261
+ },
8262
+ SVC: {
8263
+ symbol: '₡',
8264
+ grouping: ',',
8265
+ decimal: '.',
8266
+ precision: 2
8267
+ },
8268
+ SYP: {
8269
+ symbol: '£',
8270
+ grouping: ',',
8271
+ decimal: '.',
8272
+ precision: 2
8273
+ },
8274
+ SZL: {
8275
+ symbol: 'E',
8276
+ grouping: ',',
8277
+ decimal: '.',
8278
+ precision: 2
8279
+ },
8280
+ THB: {
8281
+ symbol: '฿',
8282
+ grouping: ',',
8283
+ decimal: '.',
8284
+ precision: 2
8285
+ },
8286
+ TJS: {
8287
+ symbol: 'TJS',
8288
+ grouping: ' ',
8289
+ decimal: ';',
8290
+ precision: 2
8291
+ },
8292
+ TMT: {
8293
+ symbol: 'm',
8294
+ grouping: ' ',
8295
+ decimal: ',',
8296
+ precision: 0
8297
+ },
8298
+ TND: {
8299
+ symbol: 'د.ت.‏',
8300
+ grouping: ',',
8301
+ decimal: '.',
8302
+ precision: 3
8303
+ },
8304
+ TOP: {
8305
+ symbol: 'T$',
8306
+ grouping: ',',
8307
+ decimal: '.',
8308
+ precision: 2
8309
+ },
8310
+ TRY: {
8311
+ symbol: 'TL',
8312
+ grouping: '.',
8313
+ decimal: ',',
8314
+ precision: 2
8315
+ },
8316
+ TTD: {
8317
+ symbol: 'TT$',
8318
+ grouping: ',',
8319
+ decimal: '.',
8320
+ precision: 2
8321
+ },
8322
+ TVD: {
8323
+ symbol: '$T',
8324
+ grouping: ',',
8325
+ decimal: '.',
8326
+ precision: 2
8327
+ },
8328
+ TWD: {
8329
+ symbol: 'NT$',
8330
+ grouping: ',',
8331
+ decimal: '.',
8332
+ precision: 2
8333
+ },
8334
+ TZS: {
8335
+ symbol: 'TSh',
8336
+ grouping: ',',
8337
+ decimal: '.',
8338
+ precision: 2
8339
+ },
8340
+ UAH: {
8341
+ symbol: '₴',
8342
+ grouping: ' ',
8343
+ decimal: ',',
8344
+ precision: 2
8345
+ },
8346
+ UGX: {
8347
+ symbol: 'USh',
8348
+ grouping: ',',
8349
+ decimal: '.',
8350
+ precision: 2
8351
+ },
8352
+ USD: {
8353
+ symbol: '$',
8354
+ grouping: ',',
8355
+ decimal: '.',
8356
+ precision: 2
8357
+ },
8358
+ UYU: {
8359
+ symbol: '$U',
8360
+ grouping: '.',
8361
+ decimal: ',',
8362
+ precision: 2
8363
+ },
8364
+ UZS: {
8365
+ symbol: 'сўм',
8366
+ grouping: ' ',
8367
+ decimal: ',',
8368
+ precision: 2
8369
+ },
8370
+ VEB: {
8371
+ symbol: 'Bs.',
8372
+ grouping: ',',
8373
+ decimal: '.',
8374
+ precision: 2
8375
+ },
8376
+ VEF: {
8377
+ symbol: 'Bs. F.',
8378
+ grouping: '.',
8379
+ decimal: ',',
8380
+ precision: 2
8381
+ },
8382
+ VND: {
8383
+ symbol: '₫',
8384
+ grouping: '.',
8385
+ decimal: ',',
8386
+ precision: 1
8387
+ },
8388
+ VUV: {
8389
+ symbol: 'VT',
8390
+ grouping: ',',
8391
+ decimal: '.',
8392
+ precision: 0
8393
+ },
8394
+ WST: {
8395
+ symbol: 'WS$',
8396
+ grouping: ',',
8397
+ decimal: '.',
8398
+ precision: 2
8399
+ },
8400
+ XAF: {
8401
+ symbol: 'F',
8402
+ grouping: ',',
8403
+ decimal: '.',
8404
+ precision: 2
8405
+ },
8406
+ XCD: {
8407
+ symbol: '$',
8408
+ grouping: ',',
8409
+ decimal: '.',
8410
+ precision: 2
8411
+ },
8412
+ XOF: {
8413
+ symbol: 'F',
8414
+ grouping: ' ',
8415
+ decimal: ',',
8416
+ precision: 2
8417
+ },
8418
+ XPF: {
8419
+ symbol: 'F',
8420
+ grouping: ',',
8421
+ decimal: '.',
8422
+ precision: 2
8423
+ },
8424
+ YER: {
8425
+ symbol: '﷼',
8426
+ grouping: ',',
8427
+ decimal: '.',
8428
+ precision: 2
8429
+ },
8430
+ ZAR: {
8431
+ symbol: 'R',
8432
+ grouping: ' ',
8433
+ decimal: ',',
8434
+ precision: 2
8435
+ },
8436
+ ZMW: {
8437
+ symbol: 'ZK',
8438
+ grouping: ',',
8439
+ decimal: '.',
8440
+ precision: 2
8441
+ },
8442
+ WON: {
8443
+ symbol: '₩',
8444
+ grouping: ',',
8445
+ decimal: '.',
8446
+ precision: 2
8447
+ }
8448
+ };
8449
+ /**
8450
+ * Returns currency defaults.
8451
+ *
8452
+ * @param {string} code currency code
8453
+ * @returns {?object} currency defaults
8454
+ */
8455
+
8456
+ function getCurrencyDefaults(code) {
8457
+ const defaultCurrency = {
8458
+ symbol: '$',
8459
+ grouping: ',',
8460
+ decimal: '.',
8461
+ precision: 2
8462
+ };
8463
+ return CURRENCIES[code] || defaultCurrency;
8464
+ }
8465
+
8466
+ /***/ }),
8467
+
8468
+ /***/ 2645:
8469
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
8470
+
8471
+ "use strict";
8472
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8473
+ /* harmony export */ "ZP": function() { return /* binding */ formatCurrency; }
8474
+ /* harmony export */ });
8475
+ /* unused harmony export getCurrencyObject */
8476
+ /* harmony import */ var _currencies__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7066);
8477
+ /* harmony import */ var _number_format__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51);
8478
+
8479
+
8480
+
8481
+
8482
+ /**
8483
+ * Formats money with a given currency code
8484
+ *
8485
+ * @param {number} number number to format
8486
+ * @param {string} code currency code e.g. 'USD'
8487
+ * @param {object} options options object
8488
+ * @param {string} options.decimal decimal symbol e.g. ','
8489
+ * @param {string} options.grouping thousands separator
8490
+ * @param {number} options.precision decimal digits
8491
+ * @param {string} options.symbol currency symbol e.g. 'A$'
8492
+ * @param {boolean} options.stripZeros whether to remove trailing zero cents
8493
+ * @returns {?string} A formatted string.
8494
+ */
8495
+
8496
+ function formatCurrency(number, code) {
8497
+ let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
8498
+ const currencyDefaults = (0,_currencies__WEBPACK_IMPORTED_MODULE_0__/* .getCurrencyDefaults */ .X)(code);
8499
+
8500
+ if (!currencyDefaults || isNaN(number)) {
8501
+ return null;
8502
+ }
8503
+
8504
+ const {
8505
+ decimal,
8506
+ grouping,
8507
+ precision,
8508
+ symbol
8509
+ } = { ...currencyDefaults,
8510
+ ...options
8511
+ };
8512
+ const sign = number < 0 ? '-' : '';
8513
+ let value = (0,_number_format__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(Math.abs(number), precision, decimal, grouping);
8514
+
8515
+ if (options.stripZeros) {
8516
+ value = stripZeros(value, decimal);
8517
+ }
8518
+
8519
+ return `${sign}${symbol}${value}`;
8520
+ }
8521
+ /**
8522
+ * Returns a formatted price object.
8523
+ *
8524
+ * @param {number} number number to format
8525
+ * @param {string} code currency code e.g. 'USD'
8526
+ * @param {object} options options object
8527
+ * @param {string} options.decimal decimal symbol e.g. ','
8528
+ * @param {string} options.grouping thousands separator
8529
+ * @param {number} options.precision decimal digits
8530
+ * @param {string} options.symbol currency symbol e.g. 'A$'
8531
+ * @returns {?CurrencyObject} A formatted string e.g. { symbol:'$', integer: '$99', fraction: '.99', sign: '-' }
8532
+ */
8533
+
8534
+ function getCurrencyObject(number, code) {
8535
+ let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
8536
+ const currencyDefaults = getCurrencyDefaults(code);
8537
+
8538
+ if (!currencyDefaults || isNaN(number)) {
8539
+ return null;
8540
+ }
8541
+
8542
+ const {
8543
+ decimal,
8544
+ grouping,
8545
+ precision,
8546
+ symbol
8547
+ } = { ...currencyDefaults,
8548
+ ...options
8549
+ };
8550
+ const sign = number < 0 ? '-' : '';
8551
+ const absNumber = Math.abs(number);
8552
+ const rawInteger = Math.floor(absNumber);
8553
+ const integer = numberFormat(absNumber, precision, decimal, grouping).split(decimal)[0];
8554
+ const fraction = precision > 0 ? numberFormat(absNumber - rawInteger, precision, decimal, grouping).slice(1) : '';
8555
+ return {
8556
+ sign,
8557
+ symbol,
8558
+ integer,
8559
+ fraction
8560
+ };
8561
+ }
8562
+ /**
8563
+ * Remove trailing zero cents
8564
+ *
8565
+ * @param {string} number formatted number
8566
+ * @param {string} decimal decimal symbol
8567
+ * @returns {string}
8568
+ */
8569
+
8570
+ function stripZeros(number, decimal) {
8571
+ const regex = new RegExp(`\\${decimal}0+$`);
8572
+ return number.replace(regex, '');
8573
+ }
8574
+
8575
+ /***/ }),
8576
+
8577
+ /***/ 51:
8578
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
8579
+
8580
+ "use strict";
8581
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8582
+ /* harmony export */ "Z": function() { return /* binding */ number_format; }
8583
+ /* harmony export */ });
8584
+ /*
8585
+ * Exposes number format capability
8586
+ *
8587
+ * @copyright Copyright (c) 2013 Kevin van Zonneveld (http://kvz.io) and Contributors (http://phpjs.org/authors).
8588
+ * @license See CREDITS.md
8589
+ * @see https://github.com/kvz/phpjs/blob/ffe1356af23a6f2512c84c954dd4e828e92579fa/functions/strings/number_format.js
8590
+ */
8591
+ function toFixedFix(n, prec) {
8592
+ const k = Math.pow(10, prec);
8593
+ return '' + (Math.round(n * k) / k).toFixed(prec);
8594
+ }
8595
+
8596
+ function number_format(_number) {
8597
+ let decimals = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
8598
+ let dec_point = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '.';
8599
+ let thousands_sep = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ',';
8600
+
8601
+ const number = (_number + '').replace(/[^0-9+\-Ee.]/g, '');
8602
+
8603
+ const n = !isFinite(+number) ? 0 : +number;
8604
+ const prec = !isFinite(+decimals) ? 0 : Math.abs(decimals); // Fix for IE parseFloat(0.55).toFixed(0) = 0;
8605
+
8606
+ const s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.');
8607
+
8608
+ if (s[0].length > 3) {
8609
+ s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, thousands_sep);
8610
+ }
8611
+
8612
+ if ((s[1] || '').length < prec) {
8613
+ s[1] = s[1] || '';
8614
+ s[1] += new Array(prec - s[1].length + 1).join('0');
8615
+ }
8616
+
8617
+ return s.join(dec_point);
8618
+ }
8619
+
8620
+ /***/ }),
8621
+
8622
+ /***/ 4724:
8623
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
8624
+
8625
+ "use strict";
8626
+ /* harmony import */ var _i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(914);
8627
+
8628
+ /* harmony default export */ __webpack_exports__["Z"] = (new _i18n__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z());
8629
+
8630
+ /***/ }),
8631
+
8632
+ /***/ 914:
8633
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
8634
+
8635
+ "use strict";
8636
+ /* harmony import */ var events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2699);
8637
+ /* harmony import */ var events__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(events__WEBPACK_IMPORTED_MODULE_0__);
8638
+ /* harmony import */ var _automattic_interpolate_components__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2594);
8639
+ /* harmony import */ var _tannin_sprintf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(6668);
8640
+ /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8049);
8641
+ /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_1__);
8642
+ /* harmony import */ var hash_js_lib_hash_sha_1__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5079);
8643
+ /* harmony import */ var hash_js_lib_hash_sha_1__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(hash_js_lib_hash_sha_1__WEBPACK_IMPORTED_MODULE_2__);
8644
+ /* harmony import */ var lru__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7839);
8645
+ /* harmony import */ var lru__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lru__WEBPACK_IMPORTED_MODULE_3__);
8646
+ /* harmony import */ var tannin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9830);
8647
+ /* harmony import */ var _number_format__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(3);
8648
+
8649
+
8650
+
8651
+
8652
+
8653
+
8654
+
8655
+
8656
+ /**
8657
+ * Module variables
8658
+ */
8659
+
8660
+ const debug = debug__WEBPACK_IMPORTED_MODULE_1___default()('i18n-calypso');
8661
+ /**
8662
+ * Constants
8663
+ */
8664
+
8665
+ const decimal_point_translation_key = 'number_format_decimals';
8666
+ const thousands_sep_translation_key = 'number_format_thousands_sep';
8667
+ const domain_key = 'messages';
8668
+ const translationLookup = [// By default don't modify the options when looking up translations.
8669
+ function (options) {
8670
+ return options;
8671
+ }];
8672
+ const hashCache = {}; // raise a console warning
8673
+
8674
+ function warn() {
8675
+ if (!I18N.throwErrors) {
8676
+ return;
8677
+ }
8678
+
8679
+ if ('undefined' !== typeof window && window.console && window.console.warn) {
8680
+ window.console.warn.apply(window.console, arguments);
8681
+ }
8682
+ } // turns Function.arguments into an array
8683
+
8684
+
8685
+ function simpleArguments(args) {
8686
+ return Array.prototype.slice.call(args);
8687
+ }
8688
+ /**
8689
+ * Coerce the possible arguments and normalize to a single object.
8690
+ *
8691
+ * @param {any} args - arguments passed in from `translate()`
8692
+ * @returns {object} - a single object describing translation needs
8693
+ */
8694
+
8695
+
8696
+ function normalizeTranslateArguments(args) {
8697
+ const original = args[0]; // warn about older deprecated syntax
8698
+
8699
+ if (typeof original !== 'string' || args.length > 3 || args.length > 2 && typeof args[1] === 'object' && typeof args[2] === 'object') {
8700
+ warn('Deprecated Invocation: `translate()` accepts ( string, [string], [object] ). These arguments passed:', simpleArguments(args), '. See https://github.com/Automattic/i18n-calypso#translate-method');
8701
+ }
8702
+
8703
+ if (args.length === 2 && typeof original === 'string' && typeof args[1] === 'string') {
8704
+ warn('Invalid Invocation: `translate()` requires an options object for plural translations, but passed:', simpleArguments(args));
8705
+ } // options could be in position 0, 1, or 2
8706
+ // sending options as the first object is deprecated and will raise a warning
8707
+
8708
+
8709
+ let options = {};
8710
+
8711
+ for (let i = 0; i < args.length; i++) {
8712
+ if (typeof args[i] === 'object') {
8713
+ options = args[i];
8714
+ }
8715
+ } // `original` can be passed as first parameter or as part of the options object
8716
+ // though passing original as part of the options is a deprecated approach and will be removed
8717
+
8718
+
8719
+ if (typeof original === 'string') {
8720
+ options.original = original;
8721
+ } else if (typeof options.original === 'object') {
8722
+ options.plural = options.original.plural;
8723
+ options.count = options.original.count;
8724
+ options.original = options.original.single;
8725
+ }
8726
+
8727
+ if (typeof args[1] === 'string') {
8728
+ options.plural = args[1];
8729
+ }
8730
+
8731
+ if (typeof options.original === 'undefined') {
8732
+ throw new Error('Translate called without a `string` value as first argument.');
8733
+ }
8734
+
8735
+ return options;
8736
+ }
8737
+ /**
8738
+ * Takes translate options object and coerces to a Tannin request to retrieve translation.
8739
+ *
8740
+ * @param {object} tannin - tannin data object
8741
+ * @param {object} options - object describing translation
8742
+ * @returns {string} - the returned translation from Tannin
8743
+ */
8744
+
8745
+
8746
+ function getTranslationFromTannin(tannin, options) {
8747
+ return tannin.dcnpgettext(domain_key, options.context, options.original, options.plural, options.count);
8748
+ }
8749
+
8750
+ function getTranslation(i18n, options) {
8751
+ for (let i = translationLookup.length - 1; i >= 0; i--) {
8752
+ const lookup = translationLookup[i](Object.assign({}, options));
8753
+ const key = lookup.context ? lookup.context + '\u0004' + lookup.original : lookup.original; // Only get the translation from tannin if it exists.
8754
+
8755
+ if (i18n.state.locale[key]) {
8756
+ return getTranslationFromTannin(i18n.state.tannin, lookup);
8757
+ }
8758
+ }
8759
+
8760
+ return null;
8761
+ }
8762
+
8763
+ function I18N() {
8764
+ if (!(this instanceof I18N)) {
8765
+ return new I18N();
8766
+ }
8767
+
8768
+ this.defaultLocaleSlug = 'en'; // Tannin always needs a plural form definition, or it fails when dealing with plurals.
8769
+
8770
+ this.defaultPluralForms = n => n === 1 ? 0 : 1;
8771
+
8772
+ this.state = {
8773
+ numberFormatSettings: {},
8774
+ tannin: undefined,
8775
+ locale: undefined,
8776
+ localeSlug: undefined,
8777
+ localeVariant: undefined,
8778
+ textDirection: undefined,
8779
+ translations: lru__WEBPACK_IMPORTED_MODULE_3___default()({
8780
+ max: 100
8781
+ })
8782
+ };
8783
+ this.componentUpdateHooks = [];
8784
+ this.translateHooks = [];
8785
+ this.stateObserver = new events__WEBPACK_IMPORTED_MODULE_0__.EventEmitter(); // Because the higher-order component can wrap a ton of React components,
8786
+ // we need to bump the number of listeners to infinity and beyond
8787
+ // FIXME: still valid?
8788
+
8789
+ this.stateObserver.setMaxListeners(0); // default configuration
8790
+
8791
+ this.configure();
8792
+ }
8793
+
8794
+ I18N.throwErrors = false;
8795
+
8796
+ I18N.prototype.on = function () {
8797
+ this.stateObserver.on(...arguments);
8798
+ };
8799
+
8800
+ I18N.prototype.off = function () {
8801
+ this.stateObserver.off(...arguments);
8802
+ };
8803
+
8804
+ I18N.prototype.emit = function () {
8805
+ this.stateObserver.emit(...arguments);
8806
+ };
8807
+ /**
8808
+ * Formats numbers using locale settings and/or passed options.
8809
+ *
8810
+ * @param {string|number} number to format (required)
8811
+ * @param {number|object} options Number of decimal places or options object (optional)
8812
+ * @returns {string} Formatted number as string
8813
+ */
8814
+
8815
+
8816
+ I18N.prototype.numberFormat = function (number) {
8817
+ let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
8818
+ const decimals = typeof options === 'number' ? options : options.decimals || 0;
8819
+ const decPoint = options.decPoint || this.state.numberFormatSettings.decimal_point || '.';
8820
+ const thousandsSep = options.thousandsSep || this.state.numberFormatSettings.thousands_sep || ',';
8821
+ return (0,_number_format__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z)(number, decimals, decPoint, thousandsSep);
8822
+ };
8823
+
8824
+ I18N.prototype.configure = function (options) {
8825
+ Object.assign(this, options || {});
8826
+ this.setLocale();
8827
+ };
8828
+
8829
+ I18N.prototype.setLocale = function (localeData) {
8830
+ var _this$state$locale$te, _this$state$locale$, _this$state$locale$$m;
8831
+
8832
+ if (localeData && localeData[''] && localeData['']['key-hash']) {
8833
+ const keyHash = localeData['']['key-hash'];
8834
+
8835
+ const transform = function (string, hashLength) {
8836
+ const lookupPrefix = hashLength === false ? '' : String(hashLength);
8837
+
8838
+ if (typeof hashCache[lookupPrefix + string] !== 'undefined') {
8839
+ return hashCache[lookupPrefix + string];
8840
+ }
8841
+
8842
+ const hash = hash_js_lib_hash_sha_1__WEBPACK_IMPORTED_MODULE_2___default()().update(string).digest('hex');
8843
+
8844
+ if (hashLength) {
8845
+ return hashCache[lookupPrefix + string] = hash.substr(0, hashLength);
8846
+ }
8847
+
8848
+ return hashCache[lookupPrefix + string] = hash;
8849
+ };
8850
+
8851
+ const generateLookup = function (hashLength) {
8852
+ return function (options) {
8853
+ if (options.context) {
8854
+ options.original = transform(options.context + String.fromCharCode(4) + options.original, hashLength);
8855
+ delete options.context;
8856
+ } else {
8857
+ options.original = transform(options.original, hashLength);
8858
+ }
8859
+
8860
+ return options;
8861
+ };
8862
+ };
8863
+
8864
+ if (keyHash.substr(0, 4) === 'sha1') {
8865
+ if (keyHash.length === 4) {
8866
+ translationLookup.push(generateLookup(false));
8867
+ } else {
8868
+ const variableHashLengthPos = keyHash.substr(5).indexOf('-');
8869
+
8870
+ if (variableHashLengthPos < 0) {
8871
+ const hashLength = Number(keyHash.substr(5));
8872
+ translationLookup.push(generateLookup(hashLength));
8873
+ } else {
8874
+ const minHashLength = Number(keyHash.substr(5, variableHashLengthPos));
8875
+ const maxHashLength = Number(keyHash.substr(6 + variableHashLengthPos));
8876
+
8877
+ for (let hashLength = minHashLength; hashLength <= maxHashLength; hashLength++) {
8878
+ translationLookup.push(generateLookup(hashLength));
8879
+ }
8880
+ }
8881
+ }
8882
+ }
8883
+ } // if localeData is not given, assumes default locale and reset
8884
+
8885
+
8886
+ if (!localeData || !localeData[''].localeSlug) {
8887
+ this.state.locale = {
8888
+ '': {
8889
+ localeSlug: this.defaultLocaleSlug,
8890
+ plural_forms: this.defaultPluralForms
8891
+ }
8892
+ };
8893
+ } else if (localeData[''].localeSlug === this.state.localeSlug) {
8894
+ // Exit if same data as current (comparing references only)
8895
+ if (localeData === this.state.locale) {
8896
+ return;
8897
+ } // merge new data into existing one
8898
+
8899
+
8900
+ Object.assign(this.state.locale, localeData);
8901
+ } else {
8902
+ this.state.locale = Object.assign({}, localeData);
8903
+ }
8904
+
8905
+ this.state.localeSlug = this.state.locale[''].localeSlug;
8906
+ this.state.localeVariant = this.state.locale[''].localeVariant; // extract the `textDirection` info (LTR or RTL) from either:
8907
+ // - the translation for the special string "ltr" (standard in Core, not present in Calypso)
8908
+ // - or the `momentjs_locale.textDirection` property present in Calypso translation files
8909
+
8910
+ this.state.textDirection = ((_this$state$locale$te = this.state.locale['text direction\u0004ltr']) === null || _this$state$locale$te === void 0 ? void 0 : _this$state$locale$te[0]) || ((_this$state$locale$ = this.state.locale['']) === null || _this$state$locale$ === void 0 ? void 0 : (_this$state$locale$$m = _this$state$locale$.momentjs_locale) === null || _this$state$locale$$m === void 0 ? void 0 : _this$state$locale$$m.textDirection);
8911
+ this.state.tannin = new tannin__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z({
8912
+ [domain_key]: this.state.locale
8913
+ }); // Updates numberFormat preferences with settings from translations
8914
+
8915
+ this.state.numberFormatSettings.decimal_point = getTranslationFromTannin(this.state.tannin, normalizeTranslateArguments([decimal_point_translation_key]));
8916
+ this.state.numberFormatSettings.thousands_sep = getTranslationFromTannin(this.state.tannin, normalizeTranslateArguments([thousands_sep_translation_key])); // If translation isn't set, define defaults.
8917
+
8918
+ if (this.state.numberFormatSettings.decimal_point === decimal_point_translation_key) {
8919
+ this.state.numberFormatSettings.decimal_point = '.';
8920
+ }
8921
+
8922
+ if (this.state.numberFormatSettings.thousands_sep === thousands_sep_translation_key) {
8923
+ this.state.numberFormatSettings.thousands_sep = ',';
8924
+ }
8925
+
8926
+ this.stateObserver.emit('change');
8927
+ };
8928
+
8929
+ I18N.prototype.getLocale = function () {
8930
+ return this.state.locale;
8931
+ };
8932
+ /**
8933
+ * Get the current locale slug.
8934
+ *
8935
+ * @returns {string} The string representing the currently loaded locale
8936
+ */
8937
+
8938
+
8939
+ I18N.prototype.getLocaleSlug = function () {
8940
+ return this.state.localeSlug;
8941
+ };
8942
+ /**
8943
+ * Get the current locale variant. That's set for some special locales that don't have a
8944
+ * standard ISO code, like `de_formal` or `sr_latin`.
8945
+ *
8946
+ * @returns {string|undefined} The string representing the currently loaded locale's variant
8947
+ */
8948
+
8949
+
8950
+ I18N.prototype.getLocaleVariant = function () {
8951
+ return this.state.localeVariant;
8952
+ };
8953
+ /**
8954
+ * Get the current text direction, left-to-right (LTR) or right-to-left (RTL).
8955
+ *
8956
+ * @returns {boolean} `true` in case the current locale has RTL text direction
8957
+ */
8958
+
8959
+
8960
+ I18N.prototype.isRtl = function () {
8961
+ return this.state.textDirection === 'rtl';
8962
+ };
8963
+ /**
8964
+ * Adds new translations to the locale data, overwriting any existing translations with a matching key.
8965
+ *
8966
+ * @param {object} localeData Locale data
8967
+ */
8968
+
8969
+
8970
+ I18N.prototype.addTranslations = function (localeData) {
8971
+ for (const prop in localeData) {
8972
+ if (prop !== '') {
8973
+ this.state.tannin.data.messages[prop] = localeData[prop];
8974
+ }
8975
+ }
8976
+
8977
+ this.stateObserver.emit('change');
8978
+ };
8979
+ /**
8980
+ * Checks whether the given original has a translation.
8981
+ *
8982
+ * @returns {boolean} whether a translation exists
8983
+ */
8984
+
8985
+
8986
+ I18N.prototype.hasTranslation = function () {
8987
+ return !!getTranslation(this, normalizeTranslateArguments(arguments));
8988
+ };
8989
+ /**
8990
+ * Exposes single translation method.
8991
+ * See sibling README
8992
+ *
8993
+ * @returns {string|object} translated text or an object containing React children that can be inserted into a parent component
8994
+ */
8995
+
8996
+
8997
+ I18N.prototype.translate = function () {
8998
+ const options = normalizeTranslateArguments(arguments);
8999
+ let translation = getTranslation(this, options);
9000
+
9001
+ if (!translation) {
9002
+ // This purposefully calls tannin for a case where there is no translation,
9003
+ // so that tannin gives us the expected object with English text.
9004
+ translation = getTranslationFromTannin(this.state.tannin, options);
9005
+ } // handle any string substitution
9006
+
9007
+
9008
+ if (options.args) {
9009
+ const sprintfArgs = Array.isArray(options.args) ? options.args.slice(0) : [options.args];
9010
+ sprintfArgs.unshift(translation);
9011
+
9012
+ try {
9013
+ translation = (0,_tannin_sprintf__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z)(...sprintfArgs);
9014
+ } catch (error) {
9015
+ if (!window || !window.console) {
9016
+ return;
9017
+ }
9018
+
9019
+ const errorMethod = this.throwErrors ? 'error' : 'warn';
9020
+
9021
+ if (typeof error !== 'string') {
9022
+ window.console[errorMethod](error);
9023
+ } else {
9024
+ window.console[errorMethod]('i18n sprintf error:', sprintfArgs);
9025
+ }
9026
+ }
9027
+ } // interpolate any components
9028
+
9029
+
9030
+ if (options.components) {
9031
+ translation = (0,_automattic_interpolate_components__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z)({
9032
+ mixedString: translation,
9033
+ components: options.components,
9034
+ throwErrors: this.throwErrors
9035
+ });
9036
+ } // run any necessary hooks
9037
+
9038
+
9039
+ this.translateHooks.forEach(function (hook) {
9040
+ translation = hook(translation, options);
9041
+ });
9042
+ return translation;
9043
+ };
9044
+ /**
9045
+ * Causes i18n to re-render all translations.
9046
+ *
9047
+ * This can be necessary if an extension makes changes that i18n is unaware of
9048
+ * and needs those changes manifested immediately (e.g. adding an important
9049
+ * translation hook, or modifying the behaviour of an existing hook).
9050
+ *
9051
+ * If at all possible, react components should try to use the more local
9052
+ * updateTranslation() function inherited from the mixin.
9053
+ */
9054
+
9055
+
9056
+ I18N.prototype.reRenderTranslations = function () {
9057
+ debug('Re-rendering all translations due to external request');
9058
+ this.stateObserver.emit('change');
9059
+ };
9060
+
9061
+ I18N.prototype.registerComponentUpdateHook = function (callback) {
9062
+ this.componentUpdateHooks.push(callback);
9063
+ };
9064
+
9065
+ I18N.prototype.registerTranslateHook = function (callback) {
9066
+ this.translateHooks.push(callback);
9067
+ };
9068
+
9069
+ /* harmony default export */ __webpack_exports__["Z"] = (I18N);
9070
+
9071
+ /***/ }),
9072
+
9073
+ /***/ 1481:
9074
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
9075
+
9076
+ "use strict";
9077
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9078
+ /* harmony export */ "Iu": function() { return /* binding */ translate; }
9079
+ /* harmony export */ });
9080
+ /* unused harmony exports numberFormat, configure, setLocale, getLocale, getLocaleSlug, getLocaleVariant, isRtl, addTranslations, reRenderTranslations, registerComponentUpdateHook, registerTranslateHook, state, stateObserver, on, off, emit */
9081
+ /* harmony import */ var _default_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4724);
9082
+
9083
+
9084
+
9085
+
9086
+
9087
+
9088
+
9089
+ /* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ((/* unused pure expression or super */ null && (i18n))); // Export the default instance's properties and bound methods for convenience
9090
+ // These should be deprecated eventually, exposing only the default `i18n` instance
9091
+
9092
+ const numberFormat = _default_i18n__WEBPACK_IMPORTED_MODULE_0__/* ["default"].numberFormat.bind */ .Z.numberFormat.bind(_default_i18n__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z);
9093
+ const translate = _default_i18n__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translate.bind */ .Z.translate.bind(_default_i18n__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z);
9094
+ const configure = _default_i18n__WEBPACK_IMPORTED_MODULE_0__/* ["default"].configure.bind */ .Z.configure.bind(_default_i18n__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z);
9095
+ const setLocale = _default_i18n__WEBPACK_IMPORTED_MODULE_0__/* ["default"].setLocale.bind */ .Z.setLocale.bind(_default_i18n__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z);
9096
+ const getLocale = _default_i18n__WEBPACK_IMPORTED_MODULE_0__/* ["default"].getLocale.bind */ .Z.getLocale.bind(_default_i18n__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z);
9097
+ const getLocaleSlug = _default_i18n__WEBPACK_IMPORTED_MODULE_0__/* ["default"].getLocaleSlug.bind */ .Z.getLocaleSlug.bind(_default_i18n__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z);
9098
+ const getLocaleVariant = _default_i18n__WEBPACK_IMPORTED_MODULE_0__/* ["default"].getLocaleVariant.bind */ .Z.getLocaleVariant.bind(_default_i18n__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z);
9099
+ const isRtl = _default_i18n__WEBPACK_IMPORTED_MODULE_0__/* ["default"].isRtl.bind */ .Z.isRtl.bind(_default_i18n__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z);
9100
+ const addTranslations = _default_i18n__WEBPACK_IMPORTED_MODULE_0__/* ["default"].addTranslations.bind */ .Z.addTranslations.bind(_default_i18n__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z);
9101
+ const reRenderTranslations = _default_i18n__WEBPACK_IMPORTED_MODULE_0__/* ["default"].reRenderTranslations.bind */ .Z.reRenderTranslations.bind(_default_i18n__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z);
9102
+ const registerComponentUpdateHook = _default_i18n__WEBPACK_IMPORTED_MODULE_0__/* ["default"].registerComponentUpdateHook.bind */ .Z.registerComponentUpdateHook.bind(_default_i18n__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z);
9103
+ const registerTranslateHook = _default_i18n__WEBPACK_IMPORTED_MODULE_0__/* ["default"].registerTranslateHook.bind */ .Z.registerTranslateHook.bind(_default_i18n__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z);
9104
+ const state = _default_i18n__WEBPACK_IMPORTED_MODULE_0__/* ["default"].state */ .Z.state;
9105
+ const stateObserver = _default_i18n__WEBPACK_IMPORTED_MODULE_0__/* ["default"].stateObserver */ .Z.stateObserver;
9106
+ const on = _default_i18n__WEBPACK_IMPORTED_MODULE_0__/* ["default"].on.bind */ .Z.on.bind(_default_i18n__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z);
9107
+ const off = _default_i18n__WEBPACK_IMPORTED_MODULE_0__/* ["default"].off.bind */ .Z.off.bind(_default_i18n__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z);
9108
+ const emit = _default_i18n__WEBPACK_IMPORTED_MODULE_0__/* ["default"].emit.bind */ .Z.emit.bind(_default_i18n__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z);
9109
+
9110
+ /***/ }),
9111
+
9112
+ /***/ 3:
9113
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
9114
+
9115
+ "use strict";
9116
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9117
+ /* harmony export */ "Z": function() { return /* binding */ number_format; }
9118
+ /* harmony export */ });
9119
+ /*
9120
+ * Exposes number format capability
9121
+ *
9122
+ * @copyright Copyright (c) 2013 Kevin van Zonneveld (http://kvz.io) and Contributors (http://phpjs.org/authors).
9123
+ * @license See CREDITS.md
9124
+ * @see https://github.com/kvz/phpjs/blob/ffe1356af23a6f2512c84c954dd4e828e92579fa/functions/strings/number_format.js
9125
+ */
9126
+ function toFixedFix(n, prec) {
9127
+ const k = Math.pow(10, prec);
9128
+ return '' + (Math.round(n * k) / k).toFixed(prec);
9129
+ }
9130
+
9131
+ function number_format(number, decimals, dec_point, thousands_sep) {
9132
+ number = (number + '').replace(/[^0-9+\-Ee.]/g, '');
9133
+ const n = !isFinite(+number) ? 0 : +number;
9134
+ const prec = !isFinite(+decimals) ? 0 : Math.abs(decimals);
9135
+ const sep = typeof thousands_sep === 'undefined' ? ',' : thousands_sep;
9136
+ const dec = typeof dec_point === 'undefined' ? '.' : dec_point;
9137
+ let s = ''; // Fix for IE parseFloat(0.55).toFixed(0) = 0;
9138
+
9139
+ s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.');
9140
+
9141
+ if (s[0].length > 3) {
9142
+ s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep);
9143
+ }
9144
+
9145
+ if ((s[1] || '').length < prec) {
9146
+ s[1] = s[1] || '';
9147
+ s[1] += new Array(prec - s[1].length + 1).join('0');
9148
+ }
9149
+
9150
+ return s.join(dec);
9151
+ }
9152
+
9153
+ /***/ }),
9154
+
9155
+ /***/ 2594:
9156
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
9157
+
9158
+ "use strict";
9159
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9160
+ /* harmony export */ "Z": function() { return /* binding */ interpolate; }
9161
+ /* harmony export */ });
9162
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9196);
9163
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
9164
+ /* harmony import */ var _tokenize__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1310);
9165
+
9166
+
9167
+
9168
+ function getCloseIndex(openIndex, tokens) {
9169
+ const openToken = tokens[openIndex];
9170
+ let nestLevel = 0;
9171
+
9172
+ for (let i = openIndex + 1; i < tokens.length; i++) {
9173
+ const token = tokens[i];
9174
+
9175
+ if (token.value === openToken.value) {
9176
+ if (token.type === 'componentOpen') {
9177
+ nestLevel++;
9178
+ continue;
9179
+ }
9180
+
9181
+ if (token.type === 'componentClose') {
9182
+ if (nestLevel === 0) {
9183
+ return i;
9184
+ }
9185
+
9186
+ nestLevel--;
9187
+ }
9188
+ }
9189
+ } // if we get this far, there was no matching close token
9190
+
9191
+
9192
+ throw new Error('Missing closing component token `' + openToken.value + '`');
9193
+ }
9194
+
9195
+ function buildChildren(tokens, components) {
9196
+ let children = [];
9197
+ let openComponent;
9198
+ let openIndex;
9199
+
9200
+ for (let i = 0; i < tokens.length; i++) {
9201
+ const token = tokens[i];
9202
+
9203
+ if (token.type === 'string') {
9204
+ children.push(token.value);
9205
+ continue;
9206
+ } // component node should at least be set
9207
+
9208
+
9209
+ if (components[token.value] === undefined) {
9210
+ throw new Error(`Invalid interpolation, missing component node: \`${token.value}\``);
9211
+ } // should be either ReactElement or null (both type "object"), all other types deprecated
9212
+
9213
+
9214
+ if (typeof components[token.value] !== 'object') {
9215
+ throw new Error(`Invalid interpolation, component node must be a ReactElement or null: \`${token.value}\``);
9216
+ } // we should never see a componentClose token in this loop
9217
+
9218
+
9219
+ if (token.type === 'componentClose') {
9220
+ throw new Error(`Missing opening component token: \`${token.value}\``);
9221
+ }
9222
+
9223
+ if (token.type === 'componentOpen') {
9224
+ openComponent = components[token.value];
9225
+ openIndex = i;
9226
+ break;
9227
+ } // componentSelfClosing token
9228
+
9229
+
9230
+ children.push(components[token.value]);
9231
+ continue;
9232
+ }
9233
+
9234
+ if (openComponent) {
9235
+ const closeIndex = getCloseIndex(openIndex, tokens);
9236
+ const grandChildTokens = tokens.slice(openIndex + 1, closeIndex);
9237
+ const grandChildren = buildChildren(grandChildTokens, components);
9238
+ const clonedOpenComponent = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.cloneElement)(openComponent, {}, grandChildren);
9239
+ children.push(clonedOpenComponent);
9240
+
9241
+ if (closeIndex < tokens.length - 1) {
9242
+ const siblingTokens = tokens.slice(closeIndex + 1);
9243
+ const siblings = buildChildren(siblingTokens, components);
9244
+ children = children.concat(siblings);
9245
+ }
9246
+ }
9247
+
9248
+ children = children.filter(Boolean);
9249
+
9250
+ if (children.length === 0) {
9251
+ return null;
9252
+ }
9253
+
9254
+ if (children.length === 1) {
9255
+ return children[0];
9256
+ }
9257
+
9258
+ return /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, ...children);
9259
+ }
9260
+
9261
+ function interpolate(options) {
9262
+ const {
9263
+ mixedString,
9264
+ components,
9265
+ throwErrors
9266
+ } = options;
9267
+
9268
+ if (!components) {
9269
+ return mixedString;
9270
+ }
9271
+
9272
+ if (typeof components !== 'object') {
9273
+ if (throwErrors) {
9274
+ throw new Error(`Interpolation Error: unable to process \`${mixedString}\` because components is not an object`);
9275
+ }
9276
+
9277
+ return mixedString;
9278
+ }
9279
+
9280
+ const tokens = (0,_tokenize__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(mixedString);
9281
+
9282
+ try {
9283
+ return buildChildren(tokens, components);
9284
+ } catch (error) {
9285
+ if (throwErrors) {
9286
+ throw new Error(`Interpolation Error: unable to process \`${mixedString}\` because of error \`${error.message}\``);
9287
+ }
9288
+
9289
+ return mixedString;
9290
+ }
9291
+ }
9292
+
9293
+ /***/ }),
9294
+
9295
+ /***/ 1310:
9296
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
9297
+
9298
+ "use strict";
9299
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9300
+ /* harmony export */ "Z": function() { return /* binding */ tokenize; }
9301
+ /* harmony export */ });
9302
+ function identifyToken(item) {
9303
+ // {{/example}}
9304
+ if (item.startsWith('{{/')) {
9305
+ return {
9306
+ type: 'componentClose',
9307
+ value: item.replace(/\W/g, '')
9308
+ };
9309
+ } // {{example /}}
9310
+
9311
+
9312
+ if (item.endsWith('/}}')) {
9313
+ return {
9314
+ type: 'componentSelfClosing',
9315
+ value: item.replace(/\W/g, '')
9316
+ };
9317
+ } // {{example}}
9318
+
9319
+
9320
+ if (item.startsWith('{{')) {
9321
+ return {
9322
+ type: 'componentOpen',
9323
+ value: item.replace(/\W/g, '')
9324
+ };
9325
+ }
9326
+
9327
+ return {
9328
+ type: 'string',
9329
+ value: item
9330
+ };
9331
+ }
9332
+
9333
+ function tokenize(mixedString) {
9334
+ const tokenStrings = mixedString.split(/(\{\{\/?\s*\w+\s*\/?\}\})/g); // split to components and strings
9335
+
9336
+ return tokenStrings.map(identifyToken);
9337
+ }
9338
+
9339
+ /***/ }),
9340
+
9341
+ /***/ 8552:
9342
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
9343
+
9344
+ "use strict";
9345
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9346
+ /* harmony export */ "Vw": function() { return /* binding */ requestAllBlogsAccess; },
9347
+ /* harmony export */ "sS": function() { return /* binding */ reloadProxy; }
9348
+ /* harmony export */ });
9349
+ /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8049);
9350
+ /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_0__);
9351
+ /* harmony import */ var progress_event__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8650);
9352
+ /* harmony import */ var progress_event__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(progress_event__WEBPACK_IMPORTED_MODULE_1__);
9353
+ /* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8767);
9354
+ /* harmony import */ var wp_error__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2884);
9355
+ /* harmony import */ var wp_error__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(wp_error__WEBPACK_IMPORTED_MODULE_2__);
9356
+
9357
+
9358
+
9359
+
9360
+ /**
9361
+ * debug instance
9362
+ */
9363
+
9364
+ const debug = debug__WEBPACK_IMPORTED_MODULE_0___default()('wpcom-proxy-request');
9365
+ /**
9366
+ * WordPress.com REST API base endpoint.
9367
+ */
9368
+
9369
+ const proxyOrigin = 'https://public-api.wordpress.com';
9370
+ /**
9371
+ * "Origin" of the current HTML page.
9372
+ */
9373
+
9374
+ const origin = window.location.protocol + '//' + window.location.host;
9375
+ let onStreamRecord = null;
9376
+ /**
9377
+ * Detecting support for the structured clone algorithm. IE8 and 9, and Firefox
9378
+ * 6.0 and below only support strings as postMessage's message. This browsers
9379
+ * will try to use the toString method.
9380
+ *
9381
+ * https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
9382
+ * https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/The_structured_clone_algorithm
9383
+ * https://github.com/Modernizr/Modernizr/issues/388#issuecomment-31127462
9384
+ */
9385
+
9386
+ const postStrings = (() => {
9387
+ let r = false;
9388
+
9389
+ try {
9390
+ window.postMessage({
9391
+ toString: function () {
9392
+ r = true;
9393
+ }
9394
+ }, '*');
9395
+ } catch (e) {
9396
+ /* empty */
9397
+ }
9398
+
9399
+ return r;
9400
+ })();
9401
+ /**
9402
+ * Test if the browser supports constructing a new `File` object. Not present on Edge and IE.
9403
+ */
9404
+
9405
+
9406
+ const supportsFileConstructor = (() => {
9407
+ try {
9408
+ // eslint-disable-next-line no-new
9409
+ new window.File(['a'], 'test.jpg', {
9410
+ type: 'image/jpeg'
9411
+ });
9412
+ return true;
9413
+ } catch (e) {
9414
+ return false;
9415
+ }
9416
+ })();
9417
+ /**
9418
+ * Reference to the <iframe> DOM element.
9419
+ * Gets set in the install() function.
9420
+ */
9421
+
9422
+
9423
+ let iframe = null;
9424
+ /**
9425
+ * Set to `true` upon the iframe's "load" event.
9426
+ */
9427
+
9428
+ let loaded = false;
9429
+ /**
9430
+ * Array of buffered API requests. Added to when API requests are done before the
9431
+ * proxy <iframe> is "loaded", and fulfilled once the "load" DOM event on the
9432
+ * iframe occurs.
9433
+ */
9434
+
9435
+ let buffered;
9436
+ /**
9437
+ * In-flight API request XMLHttpRequest dummy "proxy" instances.
9438
+ */
9439
+
9440
+ const requests = {};
9441
+ /**
9442
+ * Are HTML5 XMLHttpRequest2 "progress" events supported?
9443
+ * See: http://goo.gl/xxYf6D
9444
+ */
9445
+
9446
+ const supportsProgress = !!window.ProgressEvent && !!window.FormData;
9447
+ debug('using "origin": %o', origin);
9448
+ /**
9449
+ * Performs a "proxied REST API request". This happens by calling
9450
+ * `iframe.postMessage()` on the proxy iframe instance, which from there
9451
+ * takes care of WordPress.com user authentication (via the currently
9452
+ * logged-in user's cookies).
9453
+ *
9454
+ * @param {object} originalParams - request parameters
9455
+ * @param {Function} [fn] - callback response
9456
+ * @returns {window.XMLHttpRequest} XMLHttpRequest instance
9457
+ */
9458
+
9459
+ const makeRequest = (originalParams, fn) => {
9460
+ const params = Object.assign({}, originalParams);
9461
+ debug('request(%o)', params); // inject the <iframe> upon the first proxied API request
9462
+
9463
+ if (!iframe) {
9464
+ install();
9465
+ } // generate a uuid for this API request
9466
+
9467
+
9468
+ const id = (0,uuid__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z)();
9469
+ params.callback = id;
9470
+ params.supports_args = true; // supports receiving variable amount of arguments
9471
+
9472
+ params.supports_error_obj = true; // better Error object info
9473
+
9474
+ params.supports_progress = supportsProgress; // supports receiving XHR "progress" events
9475
+ // force uppercase "method" since that's what the <iframe> is expecting
9476
+
9477
+ params.method = String(params.method || 'GET').toUpperCase();
9478
+ debug('params object: %o', params);
9479
+ const xhr = new window.XMLHttpRequest();
9480
+ xhr.params = params; // store the `XMLHttpRequest` instance so that "onmessage" can access it again
9481
+
9482
+ requests[id] = xhr;
9483
+
9484
+ if ('function' === typeof fn) {
9485
+ // a callback function was provided
9486
+ let called = false;
9487
+
9488
+ const xhrOnLoad = e => {
9489
+ if (called) {
9490
+ return;
9491
+ }
9492
+
9493
+ called = true;
9494
+ const body = e.response || xhr.response;
9495
+ debug('body: ', body);
9496
+ debug('headers: ', e.headers);
9497
+ fn(null, body, e.headers);
9498
+ };
9499
+
9500
+ const xhrOnError = e => {
9501
+ if (called) {
9502
+ return;
9503
+ }
9504
+
9505
+ called = true;
9506
+ const error = e.error || e.err || e;
9507
+ debug('error: ', error);
9508
+ debug('headers: ', e.headers);
9509
+ fn(error, null, e.headers);
9510
+ };
9511
+
9512
+ xhr.addEventListener('load', xhrOnLoad);
9513
+ xhr.addEventListener('abort', xhrOnError);
9514
+ xhr.addEventListener('error', xhrOnError);
9515
+ }
9516
+
9517
+ if ('function' === typeof params.onStreamRecord) {
9518
+ // remove onStreamRecord param, which can’t be cloned
9519
+ onStreamRecord = params.onStreamRecord;
9520
+ delete params.onStreamRecord; // FIXME @azabani implement stream mode processing
9521
+ // Hint: port the algorithm from wpcom-xhr-request@1.2.0 to /public.api/rest-proxy/provider-
9522
+ // v2.0.js in rWP, then plumb stream records from onmessage below to onStreamRecord (or add
9523
+ // the XMLHttpRequest#response to ondownloadprogress there, then parse the chunks here).
9524
+ }
9525
+
9526
+ if (loaded) {
9527
+ submitRequest(params);
9528
+ } else {
9529
+ debug('buffering API request since proxying <iframe> is not yet loaded');
9530
+ buffered.push(params);
9531
+ }
9532
+
9533
+ return xhr;
9534
+ };
9535
+ /**
9536
+ * Performs a "proxied REST API request". This happens by calling
9537
+ * `iframe.postMessage()` on the proxy iframe instance, which from there
9538
+ * takes care of WordPress.com user authentication (via the currently
9539
+ * logged-in user's cookies).
9540
+ *
9541
+ * If no function is specified as second parameter, a promise is returned.
9542
+ *
9543
+ * @param {object} originalParams - request parameters
9544
+ * @param {Function} [fn] - callback response
9545
+ * @returns {window.XMLHttpRequest|Promise} XMLHttpRequest instance or Promise
9546
+ */
9547
+
9548
+
9549
+ const request = (originalParams, fn) => {
9550
+ // if callback is provided, behave traditionally
9551
+ if ('function' === typeof fn) {
9552
+ // request method
9553
+ return makeRequest(originalParams, fn);
9554
+ } // but if not, return a Promise
9555
+
9556
+
9557
+ return new Promise((res, rej) => {
9558
+ makeRequest(originalParams, (err, response) => {
9559
+ err ? rej(err) : res(response);
9560
+ });
9561
+ });
9562
+ };
9563
+ /**
9564
+ * Set proxy to "access all users' blogs" mode.
9565
+ */
9566
+
9567
+
9568
+ function requestAllBlogsAccess() {
9569
+ return request({
9570
+ metaAPI: {
9571
+ accessAllUsersBlogs: true
9572
+ }
9573
+ });
9574
+ }
9575
+ /**
9576
+ * Calls the `postMessage()` function on the <iframe>.
9577
+ *
9578
+ * @param {object} params
9579
+ */
9580
+
9581
+ function submitRequest(params) {
9582
+ debug('sending API request to proxy <iframe> %o', params); // `formData` needs to be patched if it contains `File` objects to work around
9583
+ // a Chrome bug. See `patchFileObjects` description for more details.
9584
+
9585
+ if (params.formData) {
9586
+ patchFileObjects(params.formData);
9587
+ }
9588
+
9589
+ iframe.contentWindow.postMessage(postStrings ? JSON.stringify(params) : params, proxyOrigin);
9590
+ }
9591
+ /**
9592
+ * Returns `true` if `v` is a DOM File instance, `false` otherwise.
9593
+ *
9594
+ * @param {any} v - instance to analyze
9595
+ * @returns {boolean} `true` if `v` is a DOM File instance
9596
+ */
9597
+
9598
+
9599
+ function isFile(v) {
9600
+ return v && Object.prototype.toString.call(v) === '[object File]';
9601
+ }
9602
+ /*
9603
+ * Find a `File` object in a form data value. It can be either the value itself, or
9604
+ * in a `fileContents` property of the value.
9605
+ */
9606
+
9607
+
9608
+ function getFileValue(v) {
9609
+ if (isFile(v)) {
9610
+ return v;
9611
+ }
9612
+
9613
+ if (typeof v === 'object' && isFile(v.fileContents)) {
9614
+ return v.fileContents;
9615
+ }
9616
+
9617
+ return null;
9618
+ }
9619
+ /**
9620
+ * Finds all `File` instances in `formData` and creates a new `File` instance whose storage is
9621
+ * forced to be a `Blob` instead of being backed by a file on disk. That works around a bug in
9622
+ * Chrome where `File` instances with `has_backing_file` flag cannot be sent over a process
9623
+ * boundary when site isolation is on.
9624
+ *
9625
+ * @see https://bugs.chromium.org/p/chromium/issues/detail?id=866805
9626
+ * @see https://bugs.chromium.org/p/chromium/issues/detail?id=631877
9627
+ * @param {Array} formData Form data to patch
9628
+ */
9629
+
9630
+
9631
+ function patchFileObjects(formData) {
9632
+ // There are several landmines to avoid when making file uploads work on all browsers:
9633
+ // - the `new File()` constructor trick breaks file uploads on Safari 10 in a way that's
9634
+ // impossible to detect: it will send empty files in the multipart/form-data body.
9635
+ // Therefore we need to detect Chrome.
9636
+ // - IE11 and Edge don't support the `new File()` constructor at all. It will throw exception,
9637
+ // so it's detectable by the `supportsFileConstructor` code.
9638
+ // - `window.chrome` exists also on Edge (!), `window.chrome.webstore` is only in Chrome and
9639
+ // not in other Chromium based browsers (which have the site isolation bug, too).
9640
+ if (!window.chrome || !supportsFileConstructor) {
9641
+ return;
9642
+ }
9643
+
9644
+ for (let i = 0; i < formData.length; i++) {
9645
+ const val = getFileValue(formData[i][1]);
9646
+
9647
+ if (val) {
9648
+ formData[i][1] = new window.File([val], val.name, {
9649
+ type: val.type
9650
+ });
9651
+ }
9652
+ }
9653
+ }
9654
+ /**
9655
+ * Injects the proxy <iframe> instance in the <body> of the current
9656
+ * HTML page.
9657
+ */
9658
+
9659
+
9660
+ function install() {
9661
+ debug('install()');
9662
+
9663
+ if (iframe) {
9664
+ uninstall();
9665
+ }
9666
+
9667
+ buffered = []; // listen to messages sent to `window`
9668
+
9669
+ window.addEventListener('message', onmessage); // create the <iframe>
9670
+
9671
+ iframe = document.createElement('iframe'); // set `src` and hide the iframe
9672
+
9673
+ iframe.src = proxyOrigin + '/wp-admin/rest-proxy/?v=2.0#' + origin;
9674
+ iframe.style.display = 'none'; // inject the <iframe> into the <body>
9675
+
9676
+ document.body.appendChild(iframe);
9677
+ }
9678
+ /**
9679
+ * Reloads the proxy iframe.
9680
+ */
9681
+
9682
+
9683
+ const reloadProxy = () => {
9684
+ install();
9685
+ };
9686
+ /**
9687
+ * Removes the <iframe> proxy instance from the <body> of the page.
9688
+ */
9689
+
9690
+
9691
+ function uninstall() {
9692
+ debug('uninstall()');
9693
+ window.removeEventListener('message', onmessage);
9694
+ document.body.removeChild(iframe);
9695
+ loaded = false;
9696
+ iframe = null;
9697
+ }
9698
+ /**
9699
+ * The proxy <iframe> instance's "load" event callback function.
9700
+ */
9701
+
9702
+
9703
+ function onload() {
9704
+ debug('proxy <iframe> "load" event');
9705
+ loaded = true; // flush any buffered API calls
9706
+
9707
+ if (buffered) {
9708
+ for (let i = 0; i < buffered.length; i++) {
9709
+ submitRequest(buffered[i]);
9710
+ }
9711
+
9712
+ buffered = null;
9713
+ }
9714
+ }
9715
+ /**
9716
+ * The main `window` object's "message" event callback function.
9717
+ *
9718
+ * @param {window.Event} e
9719
+ */
9720
+
9721
+
9722
+ function onmessage(e) {
9723
+ debug('onmessage'); // Filter out messages from different origins
9724
+
9725
+ if (e.origin !== proxyOrigin) {
9726
+ debug('ignoring message... %o !== %o', e.origin, proxyOrigin);
9727
+ return;
9728
+ } // Filter out messages from different iframes
9729
+
9730
+
9731
+ if (e.source !== iframe.contentWindow) {
9732
+ debug('ignoring message... iframe elements do not match');
9733
+ return;
9734
+ }
9735
+
9736
+ let {
9737
+ data
9738
+ } = e;
9739
+
9740
+ if (!data) {
9741
+ return debug('no `data`, bailing');
9742
+ } // Once the iframe is loaded, we can start using it.
9743
+
9744
+
9745
+ if (data === 'ready') {
9746
+ onload();
9747
+ return;
9748
+ }
9749
+
9750
+ if (postStrings && 'string' === typeof data) {
9751
+ data = JSON.parse(data);
9752
+ } // check if we're receiving a "progress" event
9753
+
9754
+
9755
+ if (data.upload || data.download) {
9756
+ return onprogress(data);
9757
+ }
9758
+
9759
+ if (!data.length) {
9760
+ return debug("`e.data` doesn't appear to be an Array, bailing...");
9761
+ } // first get the `xhr` instance that we're interested in
9762
+
9763
+
9764
+ const id = data[data.length - 1];
9765
+
9766
+ if (!(id in requests)) {
9767
+ return debug('bailing, no matching request with callback: %o', id);
9768
+ }
9769
+
9770
+ const xhr = requests[id]; // Build `error` and `body` object from the `data` object
9771
+
9772
+ const {
9773
+ params
9774
+ } = xhr;
9775
+ const body = data[0];
9776
+ let statusCode = data[1];
9777
+ const headers = data[2]; // We don't want to delete requests while we're processing stream messages
9778
+
9779
+ if (statusCode === 207) {// 207 is a signal from rest-proxy. It means, "this isn't the final
9780
+ // response to the query." The proxy supports WebSocket connections
9781
+ // by invoking the original success callback for each message received.
9782
+ } else {
9783
+ // this is the final response to this query
9784
+ delete requests[id];
9785
+ }
9786
+
9787
+ if (!params.metaAPI) {
9788
+ debug('got %o status code for URL: %o', statusCode, params.path);
9789
+ } else {
9790
+ statusCode = body === 'metaAPIupdated' ? 200 : 500;
9791
+ }
9792
+
9793
+ if (typeof headers === 'object') {
9794
+ // add statusCode into headers object
9795
+ headers.status = statusCode;
9796
+
9797
+ if (shouldProcessInStreamMode(headers['Content-Type'])) {
9798
+ if (statusCode === 207) {
9799
+ onStreamRecord(body);
9800
+ return;
9801
+ }
9802
+ }
9803
+ }
9804
+
9805
+ if (statusCode && 2 === Math.floor(statusCode / 100)) {
9806
+ // 2xx status code, success
9807
+ resolve(xhr, body, headers);
9808
+ } else {
9809
+ // any other status code is a failure
9810
+ const wpe = wp_error__WEBPACK_IMPORTED_MODULE_2___default()(params, statusCode, body);
9811
+ reject(xhr, wpe, headers);
9812
+ }
9813
+ }
9814
+ /**
9815
+ * Returns true iff stream mode processing is required (see wpcom-xhr-request@1.2.0).
9816
+ *
9817
+ * @param {string} contentType response Content-Type header value
9818
+ */
9819
+
9820
+
9821
+ function shouldProcessInStreamMode(contentType) {
9822
+ return /^application[/]x-ndjson($|;)/.test(contentType);
9823
+ }
9824
+ /**
9825
+ * Handles a "progress" event being proxied back from the iframe page.
9826
+ *
9827
+ * @param {object} data
9828
+ */
9829
+
9830
+
9831
+ function onprogress(data) {
9832
+ debug('got "progress" event: %o', data);
9833
+ const xhr = requests[data.callbackId];
9834
+
9835
+ if (xhr) {
9836
+ const prog = new (progress_event__WEBPACK_IMPORTED_MODULE_1___default())('progress', data);
9837
+ const target = data.upload ? xhr.upload : xhr;
9838
+ target.dispatchEvent(prog);
9839
+ }
9840
+ }
9841
+ /**
9842
+ * Emits the "load" event on the `xhr`.
9843
+ *
9844
+ * @param {window.XMLHttpRequest} xhr
9845
+ * @param {object} body
9846
+ */
9847
+
9848
+
9849
+ function resolve(xhr, body, headers) {
9850
+ const e = new (progress_event__WEBPACK_IMPORTED_MODULE_1___default())('load');
9851
+ e.data = e.body = e.response = body;
9852
+ e.headers = headers;
9853
+ xhr.dispatchEvent(e);
9854
+ }
9855
+ /**
9856
+ * Emits the "error" event on the `xhr`.
9857
+ *
9858
+ * @param {window.XMLHttpRequest} xhr
9859
+ * @param {Error} err
9860
+ */
9861
+
9862
+
9863
+ function reject(xhr, err, headers) {
9864
+ const e = new (progress_event__WEBPACK_IMPORTED_MODULE_1___default())('error');
9865
+ e.error = e.err = err;
9866
+ e.headers = headers;
9867
+ xhr.dispatchEvent(e);
9868
+ }
9869
+ /**
9870
+ * Export `request` function.
9871
+ */
9872
+
9873
+
9874
+ /* harmony default export */ __webpack_exports__["ZP"] = (request);
9875
+
9876
+
9877
+ /***/ }),
9878
+
9879
+ /***/ 8049:
9880
+ /***/ (function(module, exports, __webpack_require__) {
9881
+
9882
+ /* eslint-env browser */
9883
+
9884
+ /**
9885
+ * This is the web browser implementation of `debug()`.
9886
+ */
9887
+ exports.formatArgs = formatArgs;
9888
+ exports.save = save;
9889
+ exports.load = load;
9890
+ exports.useColors = useColors;
9891
+ exports.storage = localstorage();
9892
+
9893
+ exports.destroy = (() => {
9894
+ let warned = false;
9895
+ return () => {
9896
+ if (!warned) {
9897
+ warned = true;
9898
+ console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
9899
+ }
9900
+ };
9901
+ })();
9902
+ /**
9903
+ * Colors.
9904
+ */
9905
+
9906
+
9907
+ exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'];
9908
+ /**
9909
+ * Currently only WebKit-based Web Inspectors, Firefox >= v31,
9910
+ * and the Firebug extension (any Firefox version) are known
9911
+ * to support "%c" CSS customizations.
9912
+ *
9913
+ * TODO: add a `localStorage` variable to explicitly enable/disable colors
9914
+ */
9915
+ // eslint-disable-next-line complexity
9916
+
9917
+ function useColors() {
9918
+ // NB: In an Electron preload script, document will be defined but not fully
9919
+ // initialized. Since we know we're in Chrome, we'll just detect this case
9920
+ // explicitly
9921
+ if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
9922
+ return true;
9923
+ } // Internet Explorer and Edge do not support colors.
9924
+
9925
+
9926
+ if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
9927
+ return false;
9928
+ } // Is webkit? http://stackoverflow.com/a/16459606/376773
9929
+ // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
9930
+
9931
+
9932
+ return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
9933
+ typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
9934
+ // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
9935
+ typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
9936
+ typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
9937
+ }
9938
+ /**
9939
+ * Colorize log arguments if enabled.
9940
+ *
9941
+ * @api public
9942
+ */
9943
+
9944
+
9945
+ function formatArgs(args) {
9946
+ args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);
9947
+
9948
+ if (!this.useColors) {
9949
+ return;
9950
+ }
9951
+
9952
+ const c = 'color: ' + this.color;
9953
+ args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other
9954
+ // arguments passed either before or after the %c, so we need to
9955
+ // figure out the correct index to insert the CSS into
9956
+
9957
+ let index = 0;
9958
+ let lastC = 0;
9959
+ args[0].replace(/%[a-zA-Z%]/g, match => {
9960
+ if (match === '%%') {
9961
+ return;
9962
+ }
9963
+
9964
+ index++;
9965
+
9966
+ if (match === '%c') {
9967
+ // We only are interested in the *last* %c
9968
+ // (the user may have provided their own)
9969
+ lastC = index;
9970
+ }
9971
+ });
9972
+ args.splice(lastC, 0, c);
9973
+ }
9974
+ /**
9975
+ * Invokes `console.debug()` when available.
9976
+ * No-op when `console.debug` is not a "function".
9977
+ * If `console.debug` is not available, falls back
9978
+ * to `console.log`.
9979
+ *
9980
+ * @api public
9981
+ */
9982
+
9983
+
9984
+ exports.log = console.debug || console.log || (() => {});
9985
+ /**
9986
+ * Save `namespaces`.
9987
+ *
9988
+ * @param {String} namespaces
9989
+ * @api private
9990
+ */
9991
+
9992
+
9993
+ function save(namespaces) {
9994
+ try {
9995
+ if (namespaces) {
9996
+ exports.storage.setItem('debug', namespaces);
9997
+ } else {
9998
+ exports.storage.removeItem('debug');
9999
+ }
10000
+ } catch (error) {// Swallow
10001
+ // XXX (@Qix-) should we be logging these?
10002
+ }
10003
+ }
10004
+ /**
10005
+ * Load `namespaces`.
10006
+ *
10007
+ * @return {String} returns the previously persisted debug modes
10008
+ * @api private
10009
+ */
10010
+
10011
+
10012
+ function load() {
10013
+ let r;
10014
+
10015
+ try {
10016
+ r = exports.storage.getItem('debug');
10017
+ } catch (error) {// Swallow
10018
+ // XXX (@Qix-) should we be logging these?
10019
+ } // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
10020
+
10021
+
10022
+ if (!r && typeof process !== 'undefined' && 'env' in process) {
10023
+ r = process.env.DEBUG;
10024
+ }
10025
+
10026
+ return r;
10027
+ }
10028
+ /**
10029
+ * Localstorage attempts to return the localstorage.
10030
+ *
10031
+ * This is necessary because safari throws
10032
+ * when a user disables cookies/localstorage
10033
+ * and you attempt to access it.
10034
+ *
10035
+ * @return {LocalStorage}
10036
+ * @api private
10037
+ */
10038
+
10039
+
10040
+ function localstorage() {
10041
+ try {
10042
+ // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
10043
+ // The Browser also has localStorage in the global context.
10044
+ return localStorage;
10045
+ } catch (error) {// Swallow
10046
+ // XXX (@Qix-) should we be logging these?
10047
+ }
10048
+ }
10049
+
10050
+ module.exports = __webpack_require__(2632)(exports);
10051
+ const {
10052
+ formatters
10053
+ } = module.exports;
10054
+ /**
10055
+ * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
10056
+ */
10057
+
10058
+ formatters.j = function (v) {
10059
+ try {
10060
+ return JSON.stringify(v);
10061
+ } catch (error) {
10062
+ return '[UnexpectedJSONParseError]: ' + error.message;
10063
+ }
10064
+ };
10065
+
10066
+ /***/ }),
10067
+
10068
+ /***/ 2632:
10069
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
10070
+
10071
+ /**
10072
+ * This is the common logic for both the Node.js and web browser
10073
+ * implementations of `debug()`.
10074
+ */
10075
+ function setup(env) {
10076
+ createDebug.debug = createDebug;
10077
+ createDebug.default = createDebug;
10078
+ createDebug.coerce = coerce;
10079
+ createDebug.disable = disable;
10080
+ createDebug.enable = enable;
10081
+ createDebug.enabled = enabled;
10082
+ createDebug.humanize = __webpack_require__(5881);
10083
+ createDebug.destroy = destroy;
10084
+ Object.keys(env).forEach(key => {
10085
+ createDebug[key] = env[key];
10086
+ });
10087
+ /**
10088
+ * The currently active debug mode names, and names to skip.
10089
+ */
10090
+
10091
+ createDebug.names = [];
10092
+ createDebug.skips = [];
10093
+ /**
10094
+ * Map of special "%n" handling functions, for the debug "format" argument.
10095
+ *
10096
+ * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
10097
+ */
10098
+
10099
+ createDebug.formatters = {};
10100
+ /**
10101
+ * Selects a color for a debug namespace
10102
+ * @param {String} namespace The namespace string for the debug instance to be colored
10103
+ * @return {Number|String} An ANSI color code for the given namespace
10104
+ * @api private
10105
+ */
10106
+
10107
+ function selectColor(namespace) {
10108
+ let hash = 0;
10109
+
10110
+ for (let i = 0; i < namespace.length; i++) {
10111
+ hash = (hash << 5) - hash + namespace.charCodeAt(i);
10112
+ hash |= 0; // Convert to 32bit integer
10113
+ }
10114
+
10115
+ return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
10116
+ }
10117
+
10118
+ createDebug.selectColor = selectColor;
10119
+ /**
10120
+ * Create a debugger with the given `namespace`.
10121
+ *
10122
+ * @param {String} namespace
10123
+ * @return {Function}
10124
+ * @api public
10125
+ */
10126
+
10127
+ function createDebug(namespace) {
10128
+ let prevTime;
10129
+ let enableOverride = null;
10130
+ let namespacesCache;
10131
+ let enabledCache;
10132
+
10133
+ function debug() {
10134
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
10135
+ args[_key] = arguments[_key];
10136
+ }
10137
+
10138
+ // Disabled?
10139
+ if (!debug.enabled) {
10140
+ return;
10141
+ }
10142
+
10143
+ const self = debug; // Set `diff` timestamp
10144
+
10145
+ const curr = Number(new Date());
10146
+ const ms = curr - (prevTime || curr);
10147
+ self.diff = ms;
10148
+ self.prev = prevTime;
10149
+ self.curr = curr;
10150
+ prevTime = curr;
10151
+ args[0] = createDebug.coerce(args[0]);
10152
+
10153
+ if (typeof args[0] !== 'string') {
10154
+ // Anything else let's inspect with %O
10155
+ args.unshift('%O');
10156
+ } // Apply any `formatters` transformations
10157
+
10158
+
10159
+ let index = 0;
10160
+ args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
10161
+ // If we encounter an escaped % then don't increase the array index
10162
+ if (match === '%%') {
10163
+ return '%';
10164
+ }
10165
+
10166
+ index++;
10167
+ const formatter = createDebug.formatters[format];
10168
+
10169
+ if (typeof formatter === 'function') {
10170
+ const val = args[index];
10171
+ match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format`
10172
+
10173
+ args.splice(index, 1);
10174
+ index--;
10175
+ }
10176
+
10177
+ return match;
10178
+ }); // Apply env-specific formatting (colors, etc.)
10179
+
10180
+ createDebug.formatArgs.call(self, args);
10181
+ const logFn = self.log || createDebug.log;
10182
+ logFn.apply(self, args);
10183
+ }
10184
+
10185
+ debug.namespace = namespace;
10186
+ debug.useColors = createDebug.useColors();
10187
+ debug.color = createDebug.selectColor(namespace);
10188
+ debug.extend = extend;
10189
+ debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
10190
+
10191
+ Object.defineProperty(debug, 'enabled', {
10192
+ enumerable: true,
10193
+ configurable: false,
10194
+ get: () => {
10195
+ if (enableOverride !== null) {
10196
+ return enableOverride;
10197
+ }
10198
+
10199
+ if (namespacesCache !== createDebug.namespaces) {
10200
+ namespacesCache = createDebug.namespaces;
10201
+ enabledCache = createDebug.enabled(namespace);
10202
+ }
10203
+
10204
+ return enabledCache;
10205
+ },
10206
+ set: v => {
10207
+ enableOverride = v;
10208
+ }
10209
+ }); // Env-specific initialization logic for debug instances
10210
+
10211
+ if (typeof createDebug.init === 'function') {
10212
+ createDebug.init(debug);
10213
+ }
10214
+
10215
+ return debug;
10216
+ }
10217
+
10218
+ function extend(namespace, delimiter) {
10219
+ const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
10220
+ newDebug.log = this.log;
10221
+ return newDebug;
10222
+ }
10223
+ /**
10224
+ * Enables a debug mode by namespaces. This can include modes
10225
+ * separated by a colon and wildcards.
10226
+ *
10227
+ * @param {String} namespaces
10228
+ * @api public
10229
+ */
10230
+
10231
+
10232
+ function enable(namespaces) {
10233
+ createDebug.save(namespaces);
10234
+ createDebug.namespaces = namespaces;
10235
+ createDebug.names = [];
10236
+ createDebug.skips = [];
10237
+ let i;
10238
+ const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
10239
+ const len = split.length;
10240
+
10241
+ for (i = 0; i < len; i++) {
10242
+ if (!split[i]) {
10243
+ // ignore empty strings
10244
+ continue;
10245
+ }
10246
+
10247
+ namespaces = split[i].replace(/\*/g, '.*?');
10248
+
10249
+ if (namespaces[0] === '-') {
10250
+ createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
10251
+ } else {
10252
+ createDebug.names.push(new RegExp('^' + namespaces + '$'));
10253
+ }
10254
+ }
10255
+ }
10256
+ /**
10257
+ * Disable debug output.
10258
+ *
10259
+ * @return {String} namespaces
10260
+ * @api public
10261
+ */
10262
+
10263
+
10264
+ function disable() {
10265
+ const namespaces = [...createDebug.names.map(toNamespace), ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)].join(',');
10266
+ createDebug.enable('');
10267
+ return namespaces;
10268
+ }
10269
+ /**
10270
+ * Returns true if the given mode name is enabled, false otherwise.
10271
+ *
10272
+ * @param {String} name
10273
+ * @return {Boolean}
10274
+ * @api public
10275
+ */
10276
+
10277
+
10278
+ function enabled(name) {
10279
+ if (name[name.length - 1] === '*') {
10280
+ return true;
10281
+ }
10282
+
10283
+ let i;
10284
+ let len;
10285
+
10286
+ for (i = 0, len = createDebug.skips.length; i < len; i++) {
10287
+ if (createDebug.skips[i].test(name)) {
10288
+ return false;
10289
+ }
10290
+ }
10291
+
10292
+ for (i = 0, len = createDebug.names.length; i < len; i++) {
10293
+ if (createDebug.names[i].test(name)) {
10294
+ return true;
10295
+ }
10296
+ }
10297
+
10298
+ return false;
10299
+ }
10300
+ /**
10301
+ * Convert regexp to namespace
10302
+ *
10303
+ * @param {RegExp} regxep
10304
+ * @return {String} namespace
10305
+ * @api private
10306
+ */
10307
+
10308
+
10309
+ function toNamespace(regexp) {
10310
+ return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, '*');
10311
+ }
10312
+ /**
10313
+ * Coerce `val`.
10314
+ *
10315
+ * @param {Mixed} val
10316
+ * @return {Mixed}
10317
+ * @api private
10318
+ */
10319
+
10320
+
10321
+ function coerce(val) {
10322
+ if (val instanceof Error) {
10323
+ return val.stack || val.message;
10324
+ }
10325
+
10326
+ return val;
10327
+ }
10328
+ /**
10329
+ * XXX DO NOT USE. This is a temporary stub function.
10330
+ * XXX It WILL be removed in the next major release.
10331
+ */
10332
+
10333
+
10334
+ function destroy() {
10335
+ console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
10336
+ }
10337
+
10338
+ createDebug.enable(createDebug.load());
10339
+ return createDebug;
10340
+ }
10341
+
10342
+ module.exports = setup;
10343
+
10344
+ /***/ }),
10345
+
10346
+ /***/ 3830:
10347
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
10348
+
10349
+ "use strict";
10350
+
10351
+ var camelCase = __webpack_require__(956);
10352
+
10353
+ module.exports = function () {
10354
+ var cased = camelCase.apply(camelCase, arguments);
10355
+ return cased.charAt(0).toUpperCase() + cased.slice(1);
10356
+ };
10357
+
10358
+
10359
+ /***/ }),
10360
+
10361
+ /***/ 956:
10362
+ /***/ (function(module) {
10363
+
10364
+ "use strict";
10365
+
10366
+ module.exports = function () {
10367
+ var str = [].map.call(arguments, function (str) {
10368
+ return str.trim();
10369
+ }).filter(function (str) {
10370
+ return str.length;
10371
+ }).join('-');
10372
+
10373
+ if (!str.length) {
10374
+ return '';
10375
+ }
10376
+
10377
+ if (str.length === 1 || !(/[_.\- ]+/).test(str) ) {
10378
+ if (str[0] === str[0].toLowerCase() && str.slice(1) !== str.slice(1).toLowerCase()) {
10379
+ return str;
10380
+ }
10381
+
10382
+ return str.toLowerCase();
10383
+ }
10384
+
10385
+ return str
10386
+ .replace(/^[_.\- ]+/, '')
10387
+ .toLowerCase()
10388
+ .replace(/[_.\- ]+(\w|$)/g, function (m, p1) {
10389
+ return p1.toUpperCase();
10390
+ });
10391
+ };
10392
+
10393
+
10394
+ /***/ }),
10395
+
10396
+ /***/ 2686:
10397
+ /***/ (function(__unused_webpack_module, __webpack_exports__) {
10398
+
10399
+ "use strict";
10400
+ /* harmony default export */ __webpack_exports__["Z"] = (/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i);
10401
+
10402
+ /***/ }),
10403
+
10404
+ /***/ 5302:
10405
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
10406
+
10407
+ "use strict";
10408
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10409
+ /* harmony export */ "Z": function() { return /* binding */ rng; }
10410
+ /* harmony export */ });
10411
+ // Unique ID creation requires a high quality random # generator. In the browser we therefore
10412
+ // require the crypto API and do not support built-in fallback to lower quality random number
10413
+ // generators (like Math.random()).
10414
+ var getRandomValues;
10415
+ var rnds8 = new Uint8Array(16);
10416
+ function rng() {
10417
+ // lazy load so that environments that need to polyfill have a chance to do so
10418
+ if (!getRandomValues) {
10419
+ // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
10420
+ // find the complete implementation of crypto (msCrypto) on IE11.
10421
+ getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);
10422
+
10423
+ if (!getRandomValues) {
10424
+ throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
10425
+ }
10426
+ }
10427
+
10428
+ return getRandomValues(rnds8);
10429
+ }
10430
+
10431
+ /***/ }),
10432
+
10433
+ /***/ 708:
10434
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
10435
+
10436
+ "use strict";
10437
+ /* harmony import */ var _validate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6525);
10438
+
10439
+ /**
10440
+ * Convert array of 16 byte values to UUID string format of the form:
10441
+ * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
10442
+ */
10443
+
10444
+ var byteToHex = [];
10445
+
10446
+ for (var i = 0; i < 256; ++i) {
10447
+ byteToHex.push((i + 0x100).toString(16).substr(1));
10448
+ }
10449
+
10450
+ function stringify(arr) {
10451
+ var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
10452
+ // Note: Be careful editing this code! It's been tuned for performance
10453
+ // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
10454
+ var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one
10455
+ // of the following:
10456
+ // - One or more input array values don't map to a hex octet (leading to
10457
+ // "undefined" in the uuid)
10458
+ // - Invalid input values for the RFC `version` or `variant` fields
10459
+
10460
+ if (!(0,_validate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(uuid)) {
10461
+ throw TypeError('Stringified UUID is invalid');
10462
+ }
10463
+
10464
+ return uuid;
10465
+ }
10466
+
10467
+ /* harmony default export */ __webpack_exports__["Z"] = (stringify);
10468
+
10469
+ /***/ }),
10470
+
10471
+ /***/ 8767:
10472
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
10473
+
10474
+ "use strict";
10475
+ /* harmony import */ var _rng_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5302);
10476
+ /* harmony import */ var _stringify_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(708);
10477
+
10478
+
10479
+
10480
+ function v4(options, buf, offset) {
10481
+ options = options || {};
10482
+ var rnds = options.random || (options.rng || _rng_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
10483
+
10484
+ rnds[6] = rnds[6] & 0x0f | 0x40;
10485
+ rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
10486
+
10487
+ if (buf) {
10488
+ offset = offset || 0;
10489
+
10490
+ for (var i = 0; i < 16; ++i) {
10491
+ buf[offset + i] = rnds[i];
10492
+ }
10493
+
10494
+ return buf;
10495
+ }
10496
+
10497
+ return (0,_stringify_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(rnds);
10498
+ }
10499
+
10500
+ /* harmony default export */ __webpack_exports__["Z"] = (v4);
10501
+
10502
+ /***/ }),
10503
+
10504
+ /***/ 6525:
10505
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
10506
+
10507
+ "use strict";
10508
+ /* harmony import */ var _regex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2686);
10509
+
10510
+
10511
+ function validate(uuid) {
10512
+ return typeof uuid === 'string' && _regex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].test */ .Z.test(uuid);
10513
+ }
10514
+
10515
+ /* harmony default export */ __webpack_exports__["Z"] = (validate);
10516
+
10517
+ /***/ }),
10518
+
10519
+ /***/ 6468:
10520
+ /***/ (function(module, exports, __webpack_require__) {
10521
+
10522
+ "use strict";
10523
+
10524
+
10525
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
10526
+
10527
+ Object.defineProperty(exports, "__esModule", ({
10528
+ value: true
10529
+ }));
10530
+ exports["default"] = void 0;
10531
+
10532
+ var _toDate = _interopRequireDefault(__webpack_require__(7499));
10533
+
10534
+ var _toFloat = _interopRequireDefault(__webpack_require__(6840));
10535
+
10536
+ var _toInt = _interopRequireDefault(__webpack_require__(7155));
10537
+
10538
+ var _toBoolean = _interopRequireDefault(__webpack_require__(8676));
10539
+
10540
+ var _equals = _interopRequireDefault(__webpack_require__(7133));
10541
+
10542
+ var _contains = _interopRequireDefault(__webpack_require__(4228));
10543
+
10544
+ var _matches = _interopRequireDefault(__webpack_require__(401));
10545
+
10546
+ var _isEmail = _interopRequireDefault(__webpack_require__(4525));
10547
+
10548
+ var _isURL = _interopRequireDefault(__webpack_require__(4922));
10549
+
10550
+ var _isMACAddress = _interopRequireDefault(__webpack_require__(5504));
10551
+
10552
+ var _isIP = _interopRequireDefault(__webpack_require__(7962));
10553
+
10554
+ var _isIPRange = _interopRequireDefault(__webpack_require__(5482));
10555
+
10556
+ var _isFQDN = _interopRequireDefault(__webpack_require__(8139));
10557
+
10558
+ var _isDate = _interopRequireDefault(__webpack_require__(7869));
10559
+
10560
+ var _isBoolean = _interopRequireDefault(__webpack_require__(5982));
10561
+
10562
+ var _isLocale = _interopRequireDefault(__webpack_require__(4452));
10563
+
10564
+ var _isAlpha = _interopRequireWildcard(__webpack_require__(7780));
10565
+
10566
+ var _isAlphanumeric = _interopRequireWildcard(__webpack_require__(7014));
10567
+
10568
+ var _isNumeric = _interopRequireDefault(__webpack_require__(3024));
10569
+
10570
+ var _isPassportNumber = _interopRequireDefault(__webpack_require__(2249));
10571
+
10572
+ var _isPort = _interopRequireDefault(__webpack_require__(7616));
10573
+
10574
+ var _isLowercase = _interopRequireDefault(__webpack_require__(8816));
10575
+
10576
+ var _isUppercase = _interopRequireDefault(__webpack_require__(1776));
10577
+
10578
+ var _isIMEI = _interopRequireDefault(__webpack_require__(1893));
10579
+
10580
+ var _isAscii = _interopRequireDefault(__webpack_require__(5670));
10581
+
10582
+ var _isFullWidth = _interopRequireDefault(__webpack_require__(749));
10583
+
10584
+ var _isHalfWidth = _interopRequireDefault(__webpack_require__(8408));
10585
+
10586
+ var _isVariableWidth = _interopRequireDefault(__webpack_require__(8831));
10587
+
10588
+ var _isMultibyte = _interopRequireDefault(__webpack_require__(3639));
10589
+
10590
+ var _isSemVer = _interopRequireDefault(__webpack_require__(2868));
10591
+
10592
+ var _isSurrogatePair = _interopRequireDefault(__webpack_require__(8868));
10593
+
10594
+ var _isInt = _interopRequireDefault(__webpack_require__(4503));
10595
+
10596
+ var _isFloat = _interopRequireWildcard(__webpack_require__(3612));
10597
+
10598
+ var _isDecimal = _interopRequireDefault(__webpack_require__(8250));
10599
+
10600
+ var _isHexadecimal = _interopRequireDefault(__webpack_require__(9985));
10601
+
10602
+ var _isOctal = _interopRequireDefault(__webpack_require__(6590));
10603
+
10604
+ var _isDivisibleBy = _interopRequireDefault(__webpack_require__(102));
10605
+
10606
+ var _isHexColor = _interopRequireDefault(__webpack_require__(6941));
10607
+
10608
+ var _isRgbColor = _interopRequireDefault(__webpack_require__(8270));
10609
+
10610
+ var _isHSL = _interopRequireDefault(__webpack_require__(841));
10611
+
10612
+ var _isISRC = _interopRequireDefault(__webpack_require__(6557));
10613
+
10614
+ var _isIBAN = _interopRequireDefault(__webpack_require__(7937));
10615
+
10616
+ var _isBIC = _interopRequireDefault(__webpack_require__(2740));
10617
+
10618
+ var _isMD = _interopRequireDefault(__webpack_require__(6362));
10619
+
10620
+ var _isHash = _interopRequireDefault(__webpack_require__(9749));
10621
+
10622
+ var _isJWT = _interopRequireDefault(__webpack_require__(1624));
10623
+
10624
+ var _isJSON = _interopRequireDefault(__webpack_require__(5067));
10625
+
10626
+ var _isEmpty = _interopRequireDefault(__webpack_require__(1964));
10627
+
10628
+ var _isLength = _interopRequireDefault(__webpack_require__(6500));
10629
+
10630
+ var _isByteLength = _interopRequireDefault(__webpack_require__(2775));
10631
+
10632
+ var _isUUID = _interopRequireDefault(__webpack_require__(6368));
10633
+
10634
+ var _isMongoId = _interopRequireDefault(__webpack_require__(4246));
10635
+
10636
+ var _isAfter = _interopRequireDefault(__webpack_require__(6623));
10637
+
10638
+ var _isBefore = _interopRequireDefault(__webpack_require__(5442));
10639
+
10640
+ var _isIn = _interopRequireDefault(__webpack_require__(2093));
10641
+
10642
+ var _isCreditCard = _interopRequireDefault(__webpack_require__(4235));
10643
+
10644
+ var _isIdentityCard = _interopRequireDefault(__webpack_require__(2250));
10645
+
10646
+ var _isEAN = _interopRequireDefault(__webpack_require__(9653));
10647
+
10648
+ var _isISIN = _interopRequireDefault(__webpack_require__(2390));
10649
+
10650
+ var _isISBN = _interopRequireDefault(__webpack_require__(6328));
10651
+
10652
+ var _isISSN = _interopRequireDefault(__webpack_require__(2985));
10653
+
10654
+ var _isTaxID = _interopRequireDefault(__webpack_require__(6693));
10655
+
10656
+ var _isMobilePhone = _interopRequireWildcard(__webpack_require__(5119));
10657
+
10658
+ var _isEthereumAddress = _interopRequireDefault(__webpack_require__(3821));
10659
+
10660
+ var _isCurrency = _interopRequireDefault(__webpack_require__(7610));
10661
+
10662
+ var _isBtcAddress = _interopRequireDefault(__webpack_require__(8369));
10663
+
10664
+ var _isISO = _interopRequireDefault(__webpack_require__(8932));
10665
+
10666
+ var _isRFC = _interopRequireDefault(__webpack_require__(593));
10667
+
10668
+ var _isISO31661Alpha = _interopRequireDefault(__webpack_require__(928));
10669
+
10670
+ var _isISO31661Alpha2 = _interopRequireDefault(__webpack_require__(2038));
10671
+
10672
+ var _isBase = _interopRequireDefault(__webpack_require__(6533));
10673
+
10674
+ var _isBase2 = _interopRequireDefault(__webpack_require__(4039));
10675
+
10676
+ var _isBase3 = _interopRequireDefault(__webpack_require__(438));
10677
+
10678
+ var _isDataURI = _interopRequireDefault(__webpack_require__(8305));
10679
+
10680
+ var _isMagnetURI = _interopRequireDefault(__webpack_require__(2896));
10681
+
10682
+ var _isMimeType = _interopRequireDefault(__webpack_require__(7620));
10683
+
10684
+ var _isLatLong = _interopRequireDefault(__webpack_require__(2863));
10685
+
10686
+ var _isPostalCode = _interopRequireWildcard(__webpack_require__(2456));
10687
+
10688
+ var _ltrim = _interopRequireDefault(__webpack_require__(5904));
10689
+
10690
+ var _rtrim = _interopRequireDefault(__webpack_require__(1733));
10691
+
10692
+ var _trim = _interopRequireDefault(__webpack_require__(3465));
10693
+
10694
+ var _escape = _interopRequireDefault(__webpack_require__(7879));
10695
+
10696
+ var _unescape = _interopRequireDefault(__webpack_require__(3991));
10697
+
10698
+ var _stripLow = _interopRequireDefault(__webpack_require__(4559));
10699
+
10700
+ var _whitelist = _interopRequireDefault(__webpack_require__(7224));
10701
+
10702
+ var _blacklist = _interopRequireDefault(__webpack_require__(7902));
10703
+
10704
+ var _isWhitelisted = _interopRequireDefault(__webpack_require__(9293));
10705
+
10706
+ var _normalizeEmail = _interopRequireDefault(__webpack_require__(3517));
10707
+
10708
+ var _isSlug = _interopRequireDefault(__webpack_require__(4189));
10709
+
10710
+ var _isStrongPassword = _interopRequireDefault(__webpack_require__(2487));
10711
+
10712
+ var _isVAT = _interopRequireDefault(__webpack_require__(1809));
10713
+
10714
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
10715
+
10716
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
10717
+
10718
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10719
+
10720
+ var version = '13.5.2';
10721
+ var validator = {
10722
+ version: version,
10723
+ toDate: _toDate.default,
10724
+ toFloat: _toFloat.default,
10725
+ toInt: _toInt.default,
10726
+ toBoolean: _toBoolean.default,
10727
+ equals: _equals.default,
10728
+ contains: _contains.default,
10729
+ matches: _matches.default,
10730
+ isEmail: _isEmail.default,
10731
+ isURL: _isURL.default,
10732
+ isMACAddress: _isMACAddress.default,
10733
+ isIP: _isIP.default,
10734
+ isIPRange: _isIPRange.default,
10735
+ isFQDN: _isFQDN.default,
10736
+ isBoolean: _isBoolean.default,
10737
+ isIBAN: _isIBAN.default,
10738
+ isBIC: _isBIC.default,
10739
+ isAlpha: _isAlpha.default,
10740
+ isAlphaLocales: _isAlpha.locales,
10741
+ isAlphanumeric: _isAlphanumeric.default,
10742
+ isAlphanumericLocales: _isAlphanumeric.locales,
10743
+ isNumeric: _isNumeric.default,
10744
+ isPassportNumber: _isPassportNumber.default,
10745
+ isPort: _isPort.default,
10746
+ isLowercase: _isLowercase.default,
10747
+ isUppercase: _isUppercase.default,
10748
+ isAscii: _isAscii.default,
10749
+ isFullWidth: _isFullWidth.default,
10750
+ isHalfWidth: _isHalfWidth.default,
10751
+ isVariableWidth: _isVariableWidth.default,
10752
+ isMultibyte: _isMultibyte.default,
10753
+ isSemVer: _isSemVer.default,
10754
+ isSurrogatePair: _isSurrogatePair.default,
10755
+ isInt: _isInt.default,
10756
+ isIMEI: _isIMEI.default,
10757
+ isFloat: _isFloat.default,
10758
+ isFloatLocales: _isFloat.locales,
10759
+ isDecimal: _isDecimal.default,
10760
+ isHexadecimal: _isHexadecimal.default,
10761
+ isOctal: _isOctal.default,
10762
+ isDivisibleBy: _isDivisibleBy.default,
10763
+ isHexColor: _isHexColor.default,
10764
+ isRgbColor: _isRgbColor.default,
10765
+ isHSL: _isHSL.default,
10766
+ isISRC: _isISRC.default,
10767
+ isMD5: _isMD.default,
10768
+ isHash: _isHash.default,
10769
+ isJWT: _isJWT.default,
10770
+ isJSON: _isJSON.default,
10771
+ isEmpty: _isEmpty.default,
10772
+ isLength: _isLength.default,
10773
+ isLocale: _isLocale.default,
10774
+ isByteLength: _isByteLength.default,
10775
+ isUUID: _isUUID.default,
10776
+ isMongoId: _isMongoId.default,
10777
+ isAfter: _isAfter.default,
10778
+ isBefore: _isBefore.default,
10779
+ isIn: _isIn.default,
10780
+ isCreditCard: _isCreditCard.default,
10781
+ isIdentityCard: _isIdentityCard.default,
10782
+ isEAN: _isEAN.default,
10783
+ isISIN: _isISIN.default,
10784
+ isISBN: _isISBN.default,
10785
+ isISSN: _isISSN.default,
10786
+ isMobilePhone: _isMobilePhone.default,
10787
+ isMobilePhoneLocales: _isMobilePhone.locales,
10788
+ isPostalCode: _isPostalCode.default,
10789
+ isPostalCodeLocales: _isPostalCode.locales,
10790
+ isEthereumAddress: _isEthereumAddress.default,
10791
+ isCurrency: _isCurrency.default,
10792
+ isBtcAddress: _isBtcAddress.default,
10793
+ isISO8601: _isISO.default,
10794
+ isRFC3339: _isRFC.default,
10795
+ isISO31661Alpha2: _isISO31661Alpha.default,
10796
+ isISO31661Alpha3: _isISO31661Alpha2.default,
10797
+ isBase32: _isBase.default,
10798
+ isBase58: _isBase2.default,
10799
+ isBase64: _isBase3.default,
10800
+ isDataURI: _isDataURI.default,
10801
+ isMagnetURI: _isMagnetURI.default,
10802
+ isMimeType: _isMimeType.default,
10803
+ isLatLong: _isLatLong.default,
10804
+ ltrim: _ltrim.default,
10805
+ rtrim: _rtrim.default,
10806
+ trim: _trim.default,
10807
+ escape: _escape.default,
10808
+ unescape: _unescape.default,
10809
+ stripLow: _stripLow.default,
10810
+ whitelist: _whitelist.default,
10811
+ blacklist: _blacklist.default,
10812
+ isWhitelisted: _isWhitelisted.default,
10813
+ normalizeEmail: _normalizeEmail.default,
10814
+ toString: toString,
10815
+ isSlug: _isSlug.default,
10816
+ isStrongPassword: _isStrongPassword.default,
10817
+ isTaxID: _isTaxID.default,
10818
+ isDate: _isDate.default,
10819
+ isVAT: _isVAT.default
10820
+ };
10821
+ var _default = validator;
10822
+ exports["default"] = _default;
10823
+ module.exports = exports.default;
10824
+ module.exports["default"] = exports.default;
10825
+
10826
+ /***/ }),
10827
+
10828
+ /***/ 5475:
10829
+ /***/ (function(__unused_webpack_module, exports) {
10830
+
10831
+ "use strict";
10832
+
10833
+
10834
+ Object.defineProperty(exports, "__esModule", ({
10835
+ value: true
10836
+ }));
10837
+ exports.commaDecimal = exports.dotDecimal = exports.farsiLocales = exports.arabicLocales = exports.englishLocales = exports.decimal = exports.alphanumeric = exports.alpha = void 0;
10838
+ var alpha = {
10839
+ 'en-US': /^[A-Z]+$/i,
10840
+ 'az-AZ': /^[A-VXYZÇƏĞİıÖŞÜ]+$/i,
10841
+ 'bg-BG': /^[А-Я]+$/i,
10842
+ 'cs-CZ': /^[A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,
10843
+ 'da-DK': /^[A-ZÆØÅ]+$/i,
10844
+ 'de-DE': /^[A-ZÄÖÜß]+$/i,
10845
+ 'el-GR': /^[Α-ώ]+$/i,
10846
+ 'es-ES': /^[A-ZÁÉÍÑÓÚÜ]+$/i,
10847
+ 'fa-IR': /^[ابپتثجچحخدذرزژسشصضطظعغفقکگلمنوهی]+$/i,
10848
+ 'fr-FR': /^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,
10849
+ 'it-IT': /^[A-ZÀÉÈÌÎÓÒÙ]+$/i,
10850
+ 'nb-NO': /^[A-ZÆØÅ]+$/i,
10851
+ 'nl-NL': /^[A-ZÁÉËÏÓÖÜÚ]+$/i,
10852
+ 'nn-NO': /^[A-ZÆØÅ]+$/i,
10853
+ 'hu-HU': /^[A-ZÁÉÍÓÖŐÚÜŰ]+$/i,
10854
+ 'pl-PL': /^[A-ZĄĆĘŚŁŃÓŻŹ]+$/i,
10855
+ 'pt-PT': /^[A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i,
10856
+ 'ru-RU': /^[А-ЯЁ]+$/i,
10857
+ 'sl-SI': /^[A-ZČĆĐŠŽ]+$/i,
10858
+ 'sk-SK': /^[A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,
10859
+ 'sr-RS@latin': /^[A-ZČĆŽŠĐ]+$/i,
10860
+ 'sr-RS': /^[А-ЯЂЈЉЊЋЏ]+$/i,
10861
+ 'sv-SE': /^[A-ZÅÄÖ]+$/i,
10862
+ 'th-TH': /^[ก-๐\s]+$/i,
10863
+ 'tr-TR': /^[A-ZÇĞİıÖŞÜ]+$/i,
10864
+ 'uk-UA': /^[А-ЩЬЮЯЄIЇҐі]+$/i,
10865
+ 'vi-VN': /^[A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i,
10866
+ 'ku-IQ': /^[ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,
10867
+ ar: /^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/,
10868
+ he: /^[א-ת]+$/,
10869
+ fa: /^['آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی']+$/i
10870
+ };
10871
+ exports.alpha = alpha;
10872
+ var alphanumeric = {
10873
+ 'en-US': /^[0-9A-Z]+$/i,
10874
+ 'az-AZ': /^[0-9A-VXYZÇƏĞİıÖŞÜ]+$/i,
10875
+ 'bg-BG': /^[0-9А-Я]+$/i,
10876
+ 'cs-CZ': /^[0-9A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,
10877
+ 'da-DK': /^[0-9A-ZÆØÅ]+$/i,
10878
+ 'de-DE': /^[0-9A-ZÄÖÜß]+$/i,
10879
+ 'el-GR': /^[0-9Α-ω]+$/i,
10880
+ 'es-ES': /^[0-9A-ZÁÉÍÑÓÚÜ]+$/i,
10881
+ 'fr-FR': /^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,
10882
+ 'it-IT': /^[0-9A-ZÀÉÈÌÎÓÒÙ]+$/i,
10883
+ 'hu-HU': /^[0-9A-ZÁÉÍÓÖŐÚÜŰ]+$/i,
10884
+ 'nb-NO': /^[0-9A-ZÆØÅ]+$/i,
10885
+ 'nl-NL': /^[0-9A-ZÁÉËÏÓÖÜÚ]+$/i,
10886
+ 'nn-NO': /^[0-9A-ZÆØÅ]+$/i,
10887
+ 'pl-PL': /^[0-9A-ZĄĆĘŚŁŃÓŻŹ]+$/i,
10888
+ 'pt-PT': /^[0-9A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i,
10889
+ 'ru-RU': /^[0-9А-ЯЁ]+$/i,
10890
+ 'sl-SI': /^[0-9A-ZČĆĐŠŽ]+$/i,
10891
+ 'sk-SK': /^[0-9A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,
10892
+ 'sr-RS@latin': /^[0-9A-ZČĆŽŠĐ]+$/i,
10893
+ 'sr-RS': /^[0-9А-ЯЂЈЉЊЋЏ]+$/i,
10894
+ 'sv-SE': /^[0-9A-ZÅÄÖ]+$/i,
10895
+ 'th-TH': /^[ก-๙\s]+$/i,
10896
+ 'tr-TR': /^[0-9A-ZÇĞİıÖŞÜ]+$/i,
10897
+ 'uk-UA': /^[0-9А-ЩЬЮЯЄIЇҐі]+$/i,
10898
+ 'ku-IQ': /^[٠١٢٣٤٥٦٧٨٩0-9ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,
10899
+ 'vi-VN': /^[0-9A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i,
10900
+ ar: /^[٠١٢٣٤٥٦٧٨٩0-9ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/,
10901
+ he: /^[0-9א-ת]+$/,
10902
+ fa: /^['0-9آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی۱۲۳۴۵۶۷۸۹۰']+$/i
10903
+ };
10904
+ exports.alphanumeric = alphanumeric;
10905
+ var decimal = {
10906
+ 'en-US': '.',
10907
+ ar: '٫'
10908
+ };
10909
+ exports.decimal = decimal;
10910
+ var englishLocales = ['AU', 'GB', 'HK', 'IN', 'NZ', 'ZA', 'ZM'];
10911
+ exports.englishLocales = englishLocales;
10912
+
10913
+ for (var locale, i = 0; i < englishLocales.length; i++) {
10914
+ locale = "en-".concat(englishLocales[i]);
10915
+ alpha[locale] = alpha['en-US'];
10916
+ alphanumeric[locale] = alphanumeric['en-US'];
10917
+ decimal[locale] = decimal['en-US'];
10918
+ } // Source: http://www.localeplanet.com/java/
10919
+
10920
+
10921
+ var arabicLocales = ['AE', 'BH', 'DZ', 'EG', 'IQ', 'JO', 'KW', 'LB', 'LY', 'MA', 'QM', 'QA', 'SA', 'SD', 'SY', 'TN', 'YE'];
10922
+ exports.arabicLocales = arabicLocales;
10923
+
10924
+ for (var _locale, _i = 0; _i < arabicLocales.length; _i++) {
10925
+ _locale = "ar-".concat(arabicLocales[_i]);
10926
+ alpha[_locale] = alpha.ar;
10927
+ alphanumeric[_locale] = alphanumeric.ar;
10928
+ decimal[_locale] = decimal.ar;
10929
+ }
10930
+
10931
+ var farsiLocales = ['IR', 'AF'];
10932
+ exports.farsiLocales = farsiLocales;
10933
+
10934
+ for (var _locale2, _i2 = 0; _i2 < farsiLocales.length; _i2++) {
10935
+ _locale2 = "fa-".concat(farsiLocales[_i2]);
10936
+ alphanumeric[_locale2] = alphanumeric.fa;
10937
+ decimal[_locale2] = decimal.ar;
10938
+ } // Source: https://en.wikipedia.org/wiki/Decimal_mark
10939
+
10940
+
10941
+ var dotDecimal = ['ar-EG', 'ar-LB', 'ar-LY'];
10942
+ exports.dotDecimal = dotDecimal;
10943
+ var commaDecimal = ['bg-BG', 'cs-CZ', 'da-DK', 'de-DE', 'el-GR', 'en-ZM', 'es-ES', 'fr-CA', 'fr-FR', 'id-ID', 'it-IT', 'ku-IQ', 'hu-HU', 'nb-NO', 'nn-NO', 'nl-NL', 'pl-PL', 'pt-PT', 'ru-RU', 'sl-SI', 'sr-RS@latin', 'sr-RS', 'sv-SE', 'tr-TR', 'uk-UA', 'vi-VN'];
10944
+ exports.commaDecimal = commaDecimal;
10945
+
10946
+ for (var _i3 = 0; _i3 < dotDecimal.length; _i3++) {
10947
+ decimal[dotDecimal[_i3]] = decimal['en-US'];
10948
+ }
10949
+
10950
+ for (var _i4 = 0; _i4 < commaDecimal.length; _i4++) {
10951
+ decimal[commaDecimal[_i4]] = ',';
10952
+ }
10953
+
10954
+ alpha['fr-CA'] = alpha['fr-FR'];
10955
+ alphanumeric['fr-CA'] = alphanumeric['fr-FR'];
10956
+ alpha['pt-BR'] = alpha['pt-PT'];
10957
+ alphanumeric['pt-BR'] = alphanumeric['pt-PT'];
10958
+ decimal['pt-BR'] = decimal['pt-PT']; // see #862
10959
+
10960
+ alpha['pl-Pl'] = alpha['pl-PL'];
10961
+ alphanumeric['pl-Pl'] = alphanumeric['pl-PL'];
10962
+ decimal['pl-Pl'] = decimal['pl-PL']; // see #1455
10963
+
10964
+ alpha['fa-AF'] = alpha.fa;
10965
+
10966
+ /***/ }),
10967
+
10968
+ /***/ 7902:
10969
+ /***/ (function(module, exports, __webpack_require__) {
10970
+
10971
+ "use strict";
10972
+
10973
+
10974
+ Object.defineProperty(exports, "__esModule", ({
10975
+ value: true
10976
+ }));
10977
+ exports["default"] = blacklist;
10978
+
10979
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
10980
+
10981
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10982
+
10983
+ function blacklist(str, chars) {
10984
+ (0, _assertString.default)(str);
10985
+ return str.replace(new RegExp("[".concat(chars, "]+"), 'g'), '');
10986
+ }
10987
+
10988
+ module.exports = exports.default;
10989
+ module.exports["default"] = exports.default;
10990
+
10991
+ /***/ }),
10992
+
10993
+ /***/ 4228:
10994
+ /***/ (function(module, exports, __webpack_require__) {
10995
+
10996
+ "use strict";
10997
+
10998
+
10999
+ Object.defineProperty(exports, "__esModule", ({
11000
+ value: true
11001
+ }));
11002
+ exports["default"] = contains;
11003
+
11004
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
11005
+
11006
+ var _toString = _interopRequireDefault(__webpack_require__(1589));
11007
+
11008
+ var _merge = _interopRequireDefault(__webpack_require__(1778));
11009
+
11010
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11011
+
11012
+ var defaulContainsOptions = {
11013
+ ignoreCase: false
11014
+ };
11015
+
11016
+ function contains(str, elem, options) {
11017
+ (0, _assertString.default)(str);
11018
+ options = (0, _merge.default)(options, defaulContainsOptions);
11019
+ return options.ignoreCase ? str.toLowerCase().indexOf((0, _toString.default)(elem).toLowerCase()) >= 0 : str.indexOf((0, _toString.default)(elem)) >= 0;
11020
+ }
11021
+
11022
+ module.exports = exports.default;
11023
+ module.exports["default"] = exports.default;
11024
+
11025
+ /***/ }),
11026
+
11027
+ /***/ 7133:
11028
+ /***/ (function(module, exports, __webpack_require__) {
11029
+
11030
+ "use strict";
11031
+
11032
+
11033
+ Object.defineProperty(exports, "__esModule", ({
11034
+ value: true
11035
+ }));
11036
+ exports["default"] = equals;
11037
+
11038
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
11039
+
11040
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11041
+
11042
+ function equals(str, comparison) {
11043
+ (0, _assertString.default)(str);
11044
+ return str === comparison;
11045
+ }
11046
+
11047
+ module.exports = exports.default;
11048
+ module.exports["default"] = exports.default;
11049
+
11050
+ /***/ }),
11051
+
11052
+ /***/ 7879:
11053
+ /***/ (function(module, exports, __webpack_require__) {
11054
+
11055
+ "use strict";
11056
+
11057
+
11058
+ Object.defineProperty(exports, "__esModule", ({
11059
+ value: true
11060
+ }));
11061
+ exports["default"] = escape;
11062
+
11063
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
11064
+
11065
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11066
+
11067
+ function escape(str) {
11068
+ (0, _assertString.default)(str);
11069
+ return str.replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/'/g, '&#x27;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\//g, '&#x2F;').replace(/\\/g, '&#x5C;').replace(/`/g, '&#96;');
11070
+ }
11071
+
11072
+ module.exports = exports.default;
11073
+ module.exports["default"] = exports.default;
11074
+
11075
+ /***/ }),
11076
+
11077
+ /***/ 6623:
11078
+ /***/ (function(module, exports, __webpack_require__) {
11079
+
11080
+ "use strict";
11081
+
11082
+
11083
+ Object.defineProperty(exports, "__esModule", ({
11084
+ value: true
11085
+ }));
11086
+ exports["default"] = isAfter;
11087
+
11088
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
11089
+
11090
+ var _toDate = _interopRequireDefault(__webpack_require__(7499));
11091
+
11092
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11093
+
11094
+ function isAfter(str) {
11095
+ var date = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : String(new Date());
11096
+ (0, _assertString.default)(str);
11097
+ var comparison = (0, _toDate.default)(date);
11098
+ var original = (0, _toDate.default)(str);
11099
+ return !!(original && comparison && original > comparison);
11100
+ }
11101
+
11102
+ module.exports = exports.default;
11103
+ module.exports["default"] = exports.default;
11104
+
11105
+ /***/ }),
11106
+
11107
+ /***/ 7780:
11108
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
11109
+
11110
+ "use strict";
11111
+
11112
+
11113
+ Object.defineProperty(exports, "__esModule", ({
11114
+ value: true
11115
+ }));
11116
+ exports["default"] = isAlpha;
11117
+ exports.locales = void 0;
11118
+
11119
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
11120
+
11121
+ var _alpha = __webpack_require__(5475);
11122
+
11123
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11124
+
11125
+ function isAlpha(_str) {
11126
+ var locale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'en-US';
11127
+ var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
11128
+ (0, _assertString.default)(_str);
11129
+ var str = _str;
11130
+ var ignore = options.ignore;
11131
+
11132
+ if (ignore) {
11133
+ if (ignore instanceof RegExp) {
11134
+ str = str.replace(ignore, '');
11135
+ } else if (typeof ignore === 'string') {
11136
+ str = str.replace(new RegExp("[".concat(ignore.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g, '\\$&'), "]"), 'g'), ''); // escape regex for ignore
11137
+ } else {
11138
+ throw new Error('ignore should be instance of a String or RegExp');
11139
+ }
11140
+ }
11141
+
11142
+ if (locale in _alpha.alpha) {
11143
+ return _alpha.alpha[locale].test(str);
11144
+ }
11145
+
11146
+ throw new Error("Invalid locale '".concat(locale, "'"));
11147
+ }
11148
+
11149
+ var locales = Object.keys(_alpha.alpha);
11150
+ exports.locales = locales;
11151
+
11152
+ /***/ }),
11153
+
11154
+ /***/ 7014:
11155
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
11156
+
11157
+ "use strict";
11158
+
11159
+
11160
+ Object.defineProperty(exports, "__esModule", ({
11161
+ value: true
11162
+ }));
11163
+ exports["default"] = isAlphanumeric;
11164
+ exports.locales = void 0;
11165
+
11166
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
11167
+
11168
+ var _alpha = __webpack_require__(5475);
11169
+
11170
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11171
+
11172
+ function isAlphanumeric(str) {
11173
+ var locale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'en-US';
11174
+ (0, _assertString.default)(str);
11175
+
11176
+ if (locale in _alpha.alphanumeric) {
11177
+ return _alpha.alphanumeric[locale].test(str);
11178
+ }
11179
+
11180
+ throw new Error("Invalid locale '".concat(locale, "'"));
11181
+ }
11182
+
11183
+ var locales = Object.keys(_alpha.alphanumeric);
11184
+ exports.locales = locales;
11185
+
11186
+ /***/ }),
11187
+
11188
+ /***/ 5670:
11189
+ /***/ (function(module, exports, __webpack_require__) {
11190
+
11191
+ "use strict";
11192
+
11193
+
11194
+ Object.defineProperty(exports, "__esModule", ({
11195
+ value: true
11196
+ }));
11197
+ exports["default"] = isAscii;
11198
+
11199
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
11200
+
11201
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11202
+
11203
+ /* eslint-disable no-control-regex */
11204
+ var ascii = /^[\x00-\x7F]+$/;
11205
+ /* eslint-enable no-control-regex */
11206
+
11207
+ function isAscii(str) {
11208
+ (0, _assertString.default)(str);
11209
+ return ascii.test(str);
11210
+ }
11211
+
11212
+ module.exports = exports.default;
11213
+ module.exports["default"] = exports.default;
11214
+
11215
+ /***/ }),
11216
+
11217
+ /***/ 2740:
11218
+ /***/ (function(module, exports, __webpack_require__) {
11219
+
11220
+ "use strict";
11221
+
11222
+
11223
+ Object.defineProperty(exports, "__esModule", ({
11224
+ value: true
11225
+ }));
11226
+ exports["default"] = isBIC;
11227
+
11228
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
11229
+
11230
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11231
+
11232
+ var isBICReg = /^[A-z]{4}[A-z]{2}\w{2}(\w{3})?$/;
11233
+
11234
+ function isBIC(str) {
11235
+ (0, _assertString.default)(str);
11236
+ return isBICReg.test(str);
11237
+ }
11238
+
11239
+ module.exports = exports.default;
11240
+ module.exports["default"] = exports.default;
11241
+
11242
+ /***/ }),
11243
+
11244
+ /***/ 6533:
11245
+ /***/ (function(module, exports, __webpack_require__) {
11246
+
11247
+ "use strict";
11248
+
11249
+
11250
+ Object.defineProperty(exports, "__esModule", ({
11251
+ value: true
11252
+ }));
11253
+ exports["default"] = isBase32;
11254
+
11255
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
11256
+
11257
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11258
+
11259
+ var base32 = /^[A-Z2-7]+=*$/;
11260
+
11261
+ function isBase32(str) {
11262
+ (0, _assertString.default)(str);
11263
+ var len = str.length;
11264
+
11265
+ if (len % 8 === 0 && base32.test(str)) {
11266
+ return true;
11267
+ }
11268
+
11269
+ return false;
11270
+ }
11271
+
11272
+ module.exports = exports.default;
11273
+ module.exports["default"] = exports.default;
11274
+
11275
+ /***/ }),
11276
+
11277
+ /***/ 4039:
11278
+ /***/ (function(module, exports, __webpack_require__) {
11279
+
11280
+ "use strict";
11281
+
11282
+
11283
+ Object.defineProperty(exports, "__esModule", ({
11284
+ value: true
11285
+ }));
11286
+ exports["default"] = isBase58;
11287
+
11288
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
11289
+
11290
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11291
+
11292
+ // Accepted chars - 123456789ABCDEFGH JKLMN PQRSTUVWXYZabcdefghijk mnopqrstuvwxyz
11293
+ var base58Reg = /^[A-HJ-NP-Za-km-z1-9]*$/;
11294
+
11295
+ function isBase58(str) {
11296
+ (0, _assertString.default)(str);
11297
+
11298
+ if (base58Reg.test(str)) {
11299
+ return true;
11300
+ }
11301
+
11302
+ return false;
11303
+ }
11304
+
11305
+ module.exports = exports.default;
11306
+ module.exports["default"] = exports.default;
11307
+
11308
+ /***/ }),
11309
+
11310
+ /***/ 438:
11311
+ /***/ (function(module, exports, __webpack_require__) {
11312
+
11313
+ "use strict";
11314
+
11315
+
11316
+ Object.defineProperty(exports, "__esModule", ({
11317
+ value: true
11318
+ }));
11319
+ exports["default"] = isBase64;
11320
+
11321
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
11322
+
11323
+ var _merge = _interopRequireDefault(__webpack_require__(1778));
11324
+
11325
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11326
+
11327
+ var notBase64 = /[^A-Z0-9+\/=]/i;
11328
+ var urlSafeBase64 = /^[A-Z0-9_\-]*$/i;
11329
+ var defaultBase64Options = {
11330
+ urlSafe: false
11331
+ };
11332
+
11333
+ function isBase64(str, options) {
11334
+ (0, _assertString.default)(str);
11335
+ options = (0, _merge.default)(options, defaultBase64Options);
11336
+ var len = str.length;
11337
+
11338
+ if (options.urlSafe) {
11339
+ return urlSafeBase64.test(str);
11340
+ }
11341
+
11342
+ if (len % 4 !== 0 || notBase64.test(str)) {
11343
+ return false;
11344
+ }
11345
+
11346
+ var firstPaddingChar = str.indexOf('=');
11347
+ return firstPaddingChar === -1 || firstPaddingChar === len - 1 || firstPaddingChar === len - 2 && str[len - 1] === '=';
11348
+ }
11349
+
11350
+ module.exports = exports.default;
11351
+ module.exports["default"] = exports.default;
11352
+
11353
+ /***/ }),
11354
+
11355
+ /***/ 5442:
11356
+ /***/ (function(module, exports, __webpack_require__) {
11357
+
11358
+ "use strict";
11359
+
11360
+
11361
+ Object.defineProperty(exports, "__esModule", ({
11362
+ value: true
11363
+ }));
11364
+ exports["default"] = isBefore;
11365
+
11366
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
11367
+
11368
+ var _toDate = _interopRequireDefault(__webpack_require__(7499));
11369
+
11370
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11371
+
11372
+ function isBefore(str) {
11373
+ var date = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : String(new Date());
11374
+ (0, _assertString.default)(str);
11375
+ var comparison = (0, _toDate.default)(date);
11376
+ var original = (0, _toDate.default)(str);
11377
+ return !!(original && comparison && original < comparison);
11378
+ }
11379
+
11380
+ module.exports = exports.default;
11381
+ module.exports["default"] = exports.default;
11382
+
11383
+ /***/ }),
11384
+
11385
+ /***/ 5982:
11386
+ /***/ (function(module, exports, __webpack_require__) {
11387
+
11388
+ "use strict";
11389
+
11390
+
11391
+ Object.defineProperty(exports, "__esModule", ({
11392
+ value: true
11393
+ }));
11394
+ exports["default"] = isBoolean;
11395
+
11396
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
11397
+
11398
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11399
+
11400
+ function isBoolean(str) {
11401
+ (0, _assertString.default)(str);
11402
+ return ['true', 'false', '1', '0'].indexOf(str) >= 0;
11403
+ }
11404
+
11405
+ module.exports = exports.default;
11406
+ module.exports["default"] = exports.default;
11407
+
11408
+ /***/ }),
11409
+
11410
+ /***/ 8369:
11411
+ /***/ (function(module, exports, __webpack_require__) {
11412
+
11413
+ "use strict";
11414
+
11415
+
11416
+ Object.defineProperty(exports, "__esModule", ({
11417
+ value: true
11418
+ }));
11419
+ exports["default"] = isBtcAddress;
11420
+
11421
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
11422
+
11423
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11424
+
11425
+ // supports Bech32 addresses
11426
+ var btc = /^(bc1|[13])[a-zA-HJ-NP-Z0-9]{25,39}$/;
11427
+
11428
+ function isBtcAddress(str) {
11429
+ (0, _assertString.default)(str);
11430
+ return btc.test(str);
11431
+ }
11432
+
11433
+ module.exports = exports.default;
11434
+ module.exports["default"] = exports.default;
11435
+
11436
+ /***/ }),
11437
+
11438
+ /***/ 2775:
11439
+ /***/ (function(module, exports, __webpack_require__) {
11440
+
11441
+ "use strict";
11442
+
11443
+
11444
+ Object.defineProperty(exports, "__esModule", ({
11445
+ value: true
11446
+ }));
11447
+ exports["default"] = isByteLength;
11448
+
11449
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
11450
+
11451
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11452
+
11453
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
11454
+
11455
+ /* eslint-disable prefer-rest-params */
11456
+ function isByteLength(str, options) {
11457
+ (0, _assertString.default)(str);
11458
+ var min;
11459
+ var max;
11460
+
11461
+ if (_typeof(options) === 'object') {
11462
+ min = options.min || 0;
11463
+ max = options.max;
11464
+ } else {
11465
+ // backwards compatibility: isByteLength(str, min [, max])
11466
+ min = arguments[1];
11467
+ max = arguments[2];
11468
+ }
11469
+
11470
+ var len = encodeURI(str).split(/%..|./).length - 1;
11471
+ return len >= min && (typeof max === 'undefined' || len <= max);
11472
+ }
11473
+
11474
+ module.exports = exports.default;
11475
+ module.exports["default"] = exports.default;
11476
+
11477
+ /***/ }),
11478
+
11479
+ /***/ 4235:
11480
+ /***/ (function(module, exports, __webpack_require__) {
11481
+
11482
+ "use strict";
11483
+
11484
+
11485
+ Object.defineProperty(exports, "__esModule", ({
11486
+ value: true
11487
+ }));
11488
+ exports["default"] = isCreditCard;
11489
+
11490
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
11491
+
11492
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11493
+
11494
+ /* eslint-disable max-len */
11495
+ var creditCard = /^(?:4[0-9]{12}(?:[0-9]{3,6})?|5[1-5][0-9]{14}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12,15}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11}|6[27][0-9]{14})$/;
11496
+ /* eslint-enable max-len */
11497
+
11498
+ function isCreditCard(str) {
11499
+ (0, _assertString.default)(str);
11500
+ var sanitized = str.replace(/[- ]+/g, '');
11501
+
11502
+ if (!creditCard.test(sanitized)) {
11503
+ return false;
11504
+ }
11505
+
11506
+ var sum = 0;
11507
+ var digit;
11508
+ var tmpNum;
11509
+ var shouldDouble;
11510
+
11511
+ for (var i = sanitized.length - 1; i >= 0; i--) {
11512
+ digit = sanitized.substring(i, i + 1);
11513
+ tmpNum = parseInt(digit, 10);
11514
+
11515
+ if (shouldDouble) {
11516
+ tmpNum *= 2;
11517
+
11518
+ if (tmpNum >= 10) {
11519
+ sum += tmpNum % 10 + 1;
11520
+ } else {
11521
+ sum += tmpNum;
11522
+ }
11523
+ } else {
11524
+ sum += tmpNum;
11525
+ }
11526
+
11527
+ shouldDouble = !shouldDouble;
11528
+ }
11529
+
11530
+ return !!(sum % 10 === 0 ? sanitized : false);
11531
+ }
11532
+
11533
+ module.exports = exports.default;
11534
+ module.exports["default"] = exports.default;
11535
+
11536
+ /***/ }),
11537
+
11538
+ /***/ 7610:
11539
+ /***/ (function(module, exports, __webpack_require__) {
11540
+
11541
+ "use strict";
11542
+
11543
+
11544
+ Object.defineProperty(exports, "__esModule", ({
11545
+ value: true
11546
+ }));
11547
+ exports["default"] = isCurrency;
11548
+
11549
+ var _merge = _interopRequireDefault(__webpack_require__(1778));
11550
+
11551
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
11552
+
11553
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11554
+
11555
+ function currencyRegex(options) {
11556
+ var decimal_digits = "\\d{".concat(options.digits_after_decimal[0], "}");
11557
+ options.digits_after_decimal.forEach(function (digit, index) {
11558
+ if (index !== 0) decimal_digits = "".concat(decimal_digits, "|\\d{").concat(digit, "}");
11559
+ });
11560
+ var symbol = "(".concat(options.symbol.replace(/\W/, function (m) {
11561
+ return "\\".concat(m);
11562
+ }), ")").concat(options.require_symbol ? '' : '?'),
11563
+ negative = '-?',
11564
+ whole_dollar_amount_without_sep = '[1-9]\\d*',
11565
+ whole_dollar_amount_with_sep = "[1-9]\\d{0,2}(\\".concat(options.thousands_separator, "\\d{3})*"),
11566
+ valid_whole_dollar_amounts = ['0', whole_dollar_amount_without_sep, whole_dollar_amount_with_sep],
11567
+ whole_dollar_amount = "(".concat(valid_whole_dollar_amounts.join('|'), ")?"),
11568
+ decimal_amount = "(\\".concat(options.decimal_separator, "(").concat(decimal_digits, "))").concat(options.require_decimal ? '' : '?');
11569
+ var pattern = whole_dollar_amount + (options.allow_decimal || options.require_decimal ? decimal_amount : ''); // default is negative sign before symbol, but there are two other options (besides parens)
11570
+
11571
+ if (options.allow_negatives && !options.parens_for_negatives) {
11572
+ if (options.negative_sign_after_digits) {
11573
+ pattern += negative;
11574
+ } else if (options.negative_sign_before_digits) {
11575
+ pattern = negative + pattern;
11576
+ }
11577
+ } // South African Rand, for example, uses R 123 (space) and R-123 (no space)
11578
+
11579
+
11580
+ if (options.allow_negative_sign_placeholder) {
11581
+ pattern = "( (?!\\-))?".concat(pattern);
11582
+ } else if (options.allow_space_after_symbol) {
11583
+ pattern = " ?".concat(pattern);
11584
+ } else if (options.allow_space_after_digits) {
11585
+ pattern += '( (?!$))?';
11586
+ }
11587
+
11588
+ if (options.symbol_after_digits) {
11589
+ pattern += symbol;
11590
+ } else {
11591
+ pattern = symbol + pattern;
11592
+ }
11593
+
11594
+ if (options.allow_negatives) {
11595
+ if (options.parens_for_negatives) {
11596
+ pattern = "(\\(".concat(pattern, "\\)|").concat(pattern, ")");
11597
+ } else if (!(options.negative_sign_before_digits || options.negative_sign_after_digits)) {
11598
+ pattern = negative + pattern;
11599
+ }
11600
+ } // ensure there's a dollar and/or decimal amount, and that
11601
+ // it doesn't start with a space or a negative sign followed by a space
11602
+
11603
+
11604
+ return new RegExp("^(?!-? )(?=.*\\d)".concat(pattern, "$"));
11605
+ }
11606
+
11607
+ var default_currency_options = {
11608
+ symbol: '$',
11609
+ require_symbol: false,
11610
+ allow_space_after_symbol: false,
11611
+ symbol_after_digits: false,
11612
+ allow_negatives: true,
11613
+ parens_for_negatives: false,
11614
+ negative_sign_before_digits: false,
11615
+ negative_sign_after_digits: false,
11616
+ allow_negative_sign_placeholder: false,
11617
+ thousands_separator: ',',
11618
+ decimal_separator: '.',
11619
+ allow_decimal: true,
11620
+ require_decimal: false,
11621
+ digits_after_decimal: [2],
11622
+ allow_space_after_digits: false
11623
+ };
11624
+
11625
+ function isCurrency(str, options) {
11626
+ (0, _assertString.default)(str);
11627
+ options = (0, _merge.default)(options, default_currency_options);
11628
+ return currencyRegex(options).test(str);
11629
+ }
11630
+
11631
+ module.exports = exports.default;
11632
+ module.exports["default"] = exports.default;
11633
+
11634
+ /***/ }),
11635
+
11636
+ /***/ 8305:
11637
+ /***/ (function(module, exports, __webpack_require__) {
11638
+
11639
+ "use strict";
11640
+
11641
+
11642
+ Object.defineProperty(exports, "__esModule", ({
11643
+ value: true
11644
+ }));
11645
+ exports["default"] = isDataURI;
11646
+
11647
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
11648
+
11649
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11650
+
11651
+ var validMediaType = /^[a-z]+\/[a-z0-9\-\+]+$/i;
11652
+ var validAttribute = /^[a-z\-]+=[a-z0-9\-]+$/i;
11653
+ var validData = /^[a-z0-9!\$&'\(\)\*\+,;=\-\._~:@\/\?%\s]*$/i;
11654
+
11655
+ function isDataURI(str) {
11656
+ (0, _assertString.default)(str);
11657
+ var data = str.split(',');
11658
+
11659
+ if (data.length < 2) {
11660
+ return false;
11661
+ }
11662
+
11663
+ var attributes = data.shift().trim().split(';');
11664
+ var schemeAndMediaType = attributes.shift();
11665
+
11666
+ if (schemeAndMediaType.substr(0, 5) !== 'data:') {
11667
+ return false;
11668
+ }
11669
+
11670
+ var mediaType = schemeAndMediaType.substr(5);
11671
+
11672
+ if (mediaType !== '' && !validMediaType.test(mediaType)) {
11673
+ return false;
11674
+ }
11675
+
11676
+ for (var i = 0; i < attributes.length; i++) {
11677
+ if (i === attributes.length - 1 && attributes[i].toLowerCase() === 'base64') {// ok
11678
+ } else if (!validAttribute.test(attributes[i])) {
11679
+ return false;
11680
+ }
11681
+ }
11682
+
11683
+ for (var _i = 0; _i < data.length; _i++) {
11684
+ if (!validData.test(data[_i])) {
11685
+ return false;
11686
+ }
11687
+ }
11688
+
11689
+ return true;
11690
+ }
11691
+
11692
+ module.exports = exports.default;
11693
+ module.exports["default"] = exports.default;
11694
+
11695
+ /***/ }),
11696
+
11697
+ /***/ 7869:
11698
+ /***/ (function(module, exports, __webpack_require__) {
11699
+
11700
+ "use strict";
11701
+
11702
+
11703
+ Object.defineProperty(exports, "__esModule", ({
11704
+ value: true
11705
+ }));
11706
+ exports["default"] = isDate;
11707
+
11708
+ var _merge = _interopRequireDefault(__webpack_require__(1778));
11709
+
11710
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11711
+
11712
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
11713
+
11714
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
11715
+
11716
+ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
11717
+
11718
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11719
+
11720
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
11721
+
11722
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
11723
+
11724
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
11725
+
11726
+ var default_date_options = {
11727
+ format: 'YYYY/MM/DD',
11728
+ delimiters: ['/', '-'],
11729
+ strictMode: false
11730
+ };
11731
+
11732
+ function isValidFormat(format) {
11733
+ return /(^(y{4}|y{2})[\/-](m{1,2})[\/-](d{1,2})$)|(^(m{1,2})[\/-](d{1,2})[\/-]((y{4}|y{2})$))|(^(d{1,2})[\/-](m{1,2})[\/-]((y{4}|y{2})$))/gi.test(format);
11734
+ }
11735
+
11736
+ function zip(date, format) {
11737
+ var zippedArr = [],
11738
+ len = Math.min(date.length, format.length);
11739
+
11740
+ for (var i = 0; i < len; i++) {
11741
+ zippedArr.push([date[i], format[i]]);
11742
+ }
11743
+
11744
+ return zippedArr;
11745
+ }
11746
+
11747
+ function isDate(input, options) {
11748
+ if (typeof options === 'string') {
11749
+ // Allow backward compatbility for old format isDate(input [, format])
11750
+ options = (0, _merge.default)({
11751
+ format: options
11752
+ }, default_date_options);
11753
+ } else {
11754
+ options = (0, _merge.default)(options, default_date_options);
11755
+ }
11756
+
11757
+ if (typeof input === 'string' && isValidFormat(options.format)) {
11758
+ var formatDelimiter = options.delimiters.find(function (delimiter) {
11759
+ return options.format.indexOf(delimiter) !== -1;
11760
+ });
11761
+ var dateDelimiter = options.strictMode ? formatDelimiter : options.delimiters.find(function (delimiter) {
11762
+ return input.indexOf(delimiter) !== -1;
11763
+ });
11764
+ var dateAndFormat = zip(input.split(dateDelimiter), options.format.toLowerCase().split(formatDelimiter));
11765
+ var dateObj = {};
11766
+
11767
+ var _iterator = _createForOfIteratorHelper(dateAndFormat),
11768
+ _step;
11769
+
11770
+ try {
11771
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
11772
+ var _step$value = _slicedToArray(_step.value, 2),
11773
+ dateWord = _step$value[0],
11774
+ formatWord = _step$value[1];
11775
+
11776
+ if (dateWord.length !== formatWord.length) {
11777
+ return false;
11778
+ }
11779
+
11780
+ dateObj[formatWord.charAt(0)] = dateWord;
11781
+ }
11782
+ } catch (err) {
11783
+ _iterator.e(err);
11784
+ } finally {
11785
+ _iterator.f();
11786
+ }
11787
+
11788
+ return new Date("".concat(dateObj.m, "/").concat(dateObj.d, "/").concat(dateObj.y)).getDate() === +dateObj.d;
11789
+ }
11790
+
11791
+ if (!options.strictMode) {
11792
+ return Object.prototype.toString.call(input) === '[object Date]' && isFinite(input);
11793
+ }
11794
+
11795
+ return false;
11796
+ }
11797
+
11798
+ module.exports = exports.default;
11799
+ module.exports["default"] = exports.default;
11800
+
11801
+ /***/ }),
11802
+
11803
+ /***/ 8250:
11804
+ /***/ (function(module, exports, __webpack_require__) {
11805
+
11806
+ "use strict";
11807
+
11808
+
11809
+ Object.defineProperty(exports, "__esModule", ({
11810
+ value: true
11811
+ }));
11812
+ exports["default"] = isDecimal;
11813
+
11814
+ var _merge = _interopRequireDefault(__webpack_require__(1778));
11815
+
11816
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
11817
+
11818
+ var _includes = _interopRequireDefault(__webpack_require__(2900));
11819
+
11820
+ var _alpha = __webpack_require__(5475);
11821
+
11822
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11823
+
11824
+ function decimalRegExp(options) {
11825
+ var regExp = new RegExp("^[-+]?([0-9]+)?(\\".concat(_alpha.decimal[options.locale], "[0-9]{").concat(options.decimal_digits, "})").concat(options.force_decimal ? '' : '?', "$"));
11826
+ return regExp;
11827
+ }
11828
+
11829
+ var default_decimal_options = {
11830
+ force_decimal: false,
11831
+ decimal_digits: '1,',
11832
+ locale: 'en-US'
11833
+ };
11834
+ var blacklist = ['', '-', '+'];
11835
+
11836
+ function isDecimal(str, options) {
11837
+ (0, _assertString.default)(str);
11838
+ options = (0, _merge.default)(options, default_decimal_options);
11839
+
11840
+ if (options.locale in _alpha.decimal) {
11841
+ return !(0, _includes.default)(blacklist, str.replace(/ /g, '')) && decimalRegExp(options).test(str);
11842
+ }
11843
+
11844
+ throw new Error("Invalid locale '".concat(options.locale, "'"));
11845
+ }
11846
+
11847
+ module.exports = exports.default;
11848
+ module.exports["default"] = exports.default;
11849
+
11850
+ /***/ }),
11851
+
11852
+ /***/ 102:
11853
+ /***/ (function(module, exports, __webpack_require__) {
11854
+
11855
+ "use strict";
11856
+
11857
+
11858
+ Object.defineProperty(exports, "__esModule", ({
11859
+ value: true
11860
+ }));
11861
+ exports["default"] = isDivisibleBy;
11862
+
11863
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
11864
+
11865
+ var _toFloat = _interopRequireDefault(__webpack_require__(6840));
11866
+
11867
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11868
+
11869
+ function isDivisibleBy(str, num) {
11870
+ (0, _assertString.default)(str);
11871
+ return (0, _toFloat.default)(str) % parseInt(num, 10) === 0;
11872
+ }
11873
+
11874
+ module.exports = exports.default;
11875
+ module.exports["default"] = exports.default;
11876
+
11877
+ /***/ }),
11878
+
11879
+ /***/ 9653:
11880
+ /***/ (function(module, exports, __webpack_require__) {
11881
+
11882
+ "use strict";
11883
+
11884
+
11885
+ Object.defineProperty(exports, "__esModule", ({
11886
+ value: true
11887
+ }));
11888
+ exports["default"] = isEAN;
11889
+
11890
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
11891
+
11892
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11893
+
11894
+ /**
11895
+ * The most commonly used EAN standard is
11896
+ * the thirteen-digit EAN-13, while the
11897
+ * less commonly used 8-digit EAN-8 barcode was
11898
+ * introduced for use on small packages.
11899
+ * EAN consists of:
11900
+ * GS1 prefix, manufacturer code, product code and check digit
11901
+ * Reference: https://en.wikipedia.org/wiki/International_Article_Number
11902
+ */
11903
+
11904
+ /**
11905
+ * Define EAN Lenghts; 8 for EAN-8; 13 for EAN-13
11906
+ * and Regular Expression for valid EANs (EAN-8, EAN-13),
11907
+ * with exact numberic matching of 8 or 13 digits [0-9]
11908
+ */
11909
+ var LENGTH_EAN_8 = 8;
11910
+ var validEanRegex = /^(\d{8}|\d{13})$/;
11911
+ /**
11912
+ * Get position weight given:
11913
+ * EAN length and digit index/position
11914
+ *
11915
+ * @param {number} length
11916
+ * @param {number} index
11917
+ * @return {number}
11918
+ */
11919
+
11920
+ function getPositionWeightThroughLengthAndIndex(length, index) {
11921
+ if (length === LENGTH_EAN_8) {
11922
+ return index % 2 === 0 ? 3 : 1;
11923
+ }
11924
+
11925
+ return index % 2 === 0 ? 1 : 3;
11926
+ }
11927
+ /**
11928
+ * Calculate EAN Check Digit
11929
+ * Reference: https://en.wikipedia.org/wiki/International_Article_Number#Calculation_of_checksum_digit
11930
+ *
11931
+ * @param {string} ean
11932
+ * @return {number}
11933
+ */
11934
+
11935
+
11936
+ function calculateCheckDigit(ean) {
11937
+ var checksum = ean.slice(0, -1).split('').map(function (char, index) {
11938
+ return Number(char) * getPositionWeightThroughLengthAndIndex(ean.length, index);
11939
+ }).reduce(function (acc, partialSum) {
11940
+ return acc + partialSum;
11941
+ }, 0);
11942
+ var remainder = 10 - checksum % 10;
11943
+ return remainder < 10 ? remainder : 0;
11944
+ }
11945
+ /**
11946
+ * Check if string is valid EAN:
11947
+ * Matches EAN-8/EAN-13 regex
11948
+ * Has valid check digit.
11949
+ *
11950
+ * @param {string} str
11951
+ * @return {boolean}
11952
+ */
11953
+
11954
+
11955
+ function isEAN(str) {
11956
+ (0, _assertString.default)(str);
11957
+ var actualCheckDigit = Number(str.slice(-1));
11958
+ return validEanRegex.test(str) && actualCheckDigit === calculateCheckDigit(str);
11959
+ }
11960
+
11961
+ module.exports = exports.default;
11962
+ module.exports["default"] = exports.default;
11963
+
11964
+ /***/ }),
11965
+
11966
+ /***/ 4525:
11967
+ /***/ (function(module, exports, __webpack_require__) {
11968
+
11969
+ "use strict";
11970
+
11971
+
11972
+ Object.defineProperty(exports, "__esModule", ({
11973
+ value: true
11974
+ }));
11975
+ exports["default"] = isEmail;
11976
+
11977
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
11978
+
11979
+ var _merge = _interopRequireDefault(__webpack_require__(1778));
11980
+
11981
+ var _isByteLength = _interopRequireDefault(__webpack_require__(2775));
11982
+
11983
+ var _isFQDN = _interopRequireDefault(__webpack_require__(8139));
11984
+
11985
+ var _isIP = _interopRequireDefault(__webpack_require__(7962));
11986
+
11987
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11988
+
11989
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
11990
+
11991
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
11992
+
11993
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
11994
+
11995
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
11996
+
11997
+ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
11998
+
11999
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12000
+
12001
+ var default_email_options = {
12002
+ allow_display_name: false,
12003
+ require_display_name: false,
12004
+ allow_utf8_local_part: true,
12005
+ require_tld: true,
12006
+ blacklisted_chars: '',
12007
+ ignore_max_length: false
12008
+ };
12009
+ /* eslint-disable max-len */
12010
+
12011
+ /* eslint-disable no-control-regex */
12012
+
12013
+ var splitNameAddress = /^([^\x00-\x1F\x7F-\x9F\cX]+)<(.+)>$/i;
12014
+ var emailUserPart = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i;
12015
+ var gmailUserPart = /^[a-z\d]+$/;
12016
+ var quotedEmailUser = /^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i;
12017
+ var emailUserUtf8Part = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i;
12018
+ var quotedEmailUserUtf8 = /^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i;
12019
+ var defaultMaxEmailLength = 254;
12020
+ /* eslint-enable max-len */
12021
+
12022
+ /* eslint-enable no-control-regex */
12023
+
12024
+ /**
12025
+ * Validate display name according to the RFC2822: https://tools.ietf.org/html/rfc2822#appendix-A.1.2
12026
+ * @param {String} display_name
12027
+ */
12028
+
12029
+ function validateDisplayName(display_name) {
12030
+ var trim_quotes = display_name.match(/^"(.+)"$/i);
12031
+ var display_name_without_quotes = trim_quotes ? trim_quotes[1] : display_name; // display name with only spaces is not valid
12032
+
12033
+ if (!display_name_without_quotes.trim()) {
12034
+ return false;
12035
+ } // check whether display name contains illegal character
12036
+
12037
+
12038
+ var contains_illegal = /[\.";<>]/.test(display_name_without_quotes);
12039
+
12040
+ if (contains_illegal) {
12041
+ // if contains illegal characters,
12042
+ // must to be enclosed in double-quotes, otherwise it's not a valid display name
12043
+ if (!trim_quotes) {
12044
+ return false;
12045
+ } // the quotes in display name must start with character symbol \
12046
+
12047
+
12048
+ var all_start_with_back_slash = display_name_without_quotes.split('"').length === display_name_without_quotes.split('\\"').length;
12049
+
12050
+ if (!all_start_with_back_slash) {
12051
+ return false;
12052
+ }
12053
+ }
12054
+
12055
+ return true;
12056
+ }
12057
+
12058
+ function isEmail(str, options) {
12059
+ (0, _assertString.default)(str);
12060
+ options = (0, _merge.default)(options, default_email_options);
12061
+
12062
+ if (options.require_display_name || options.allow_display_name) {
12063
+ var display_email = str.match(splitNameAddress);
12064
+
12065
+ if (display_email) {
12066
+ var display_name;
12067
+
12068
+ var _display_email = _slicedToArray(display_email, 3);
12069
+
12070
+ display_name = _display_email[1];
12071
+ str = _display_email[2];
12072
+
12073
+ // sometimes need to trim the last space to get the display name
12074
+ // because there may be a space between display name and email address
12075
+ // eg. myname <address@gmail.com>
12076
+ // the display name is `myname` instead of `myname `, so need to trim the last space
12077
+ if (display_name.endsWith(' ')) {
12078
+ display_name = display_name.substr(0, display_name.length - 1);
12079
+ }
12080
+
12081
+ if (!validateDisplayName(display_name)) {
12082
+ return false;
12083
+ }
12084
+ } else if (options.require_display_name) {
12085
+ return false;
12086
+ }
12087
+ }
12088
+
12089
+ if (!options.ignore_max_length && str.length > defaultMaxEmailLength) {
12090
+ return false;
12091
+ }
12092
+
12093
+ var parts = str.split('@');
12094
+ var domain = parts.pop();
12095
+ var user = parts.join('@');
12096
+ var lower_domain = domain.toLowerCase();
12097
+
12098
+ if (options.domain_specific_validation && (lower_domain === 'gmail.com' || lower_domain === 'googlemail.com')) {
12099
+ /*
12100
+ Previously we removed dots for gmail addresses before validating.
12101
+ This was removed because it allows `multiple..dots@gmail.com`
12102
+ to be reported as valid, but it is not.
12103
+ Gmail only normalizes single dots, removing them from here is pointless,
12104
+ should be done in normalizeEmail
12105
+ */
12106
+ user = user.toLowerCase(); // Removing sub-address from username before gmail validation
12107
+
12108
+ var username = user.split('+')[0]; // Dots are not included in gmail length restriction
12109
+
12110
+ if (!(0, _isByteLength.default)(username.replace('.', ''), {
12111
+ min: 6,
12112
+ max: 30
12113
+ })) {
12114
+ return false;
12115
+ }
12116
+
12117
+ var _user_parts = username.split('.');
12118
+
12119
+ for (var i = 0; i < _user_parts.length; i++) {
12120
+ if (!gmailUserPart.test(_user_parts[i])) {
12121
+ return false;
12122
+ }
12123
+ }
12124
+ }
12125
+
12126
+ if (options.ignore_max_length === false && (!(0, _isByteLength.default)(user, {
12127
+ max: 64
12128
+ }) || !(0, _isByteLength.default)(domain, {
12129
+ max: 254
12130
+ }))) {
12131
+ return false;
12132
+ }
12133
+
12134
+ if (!(0, _isFQDN.default)(domain, {
12135
+ require_tld: options.require_tld
12136
+ })) {
12137
+ if (!options.allow_ip_domain) {
12138
+ return false;
12139
+ }
12140
+
12141
+ if (!(0, _isIP.default)(domain)) {
12142
+ if (!domain.startsWith('[') || !domain.endsWith(']')) {
12143
+ return false;
12144
+ }
12145
+
12146
+ var noBracketdomain = domain.substr(1, domain.length - 2);
12147
+
12148
+ if (noBracketdomain.length === 0 || !(0, _isIP.default)(noBracketdomain)) {
12149
+ return false;
12150
+ }
12151
+ }
12152
+ }
12153
+
12154
+ if (user[0] === '"') {
12155
+ user = user.slice(1, user.length - 1);
12156
+ return options.allow_utf8_local_part ? quotedEmailUserUtf8.test(user) : quotedEmailUser.test(user);
12157
+ }
12158
+
12159
+ var pattern = options.allow_utf8_local_part ? emailUserUtf8Part : emailUserPart;
12160
+ var user_parts = user.split('.');
12161
+
12162
+ for (var _i2 = 0; _i2 < user_parts.length; _i2++) {
12163
+ if (!pattern.test(user_parts[_i2])) {
12164
+ return false;
12165
+ }
12166
+ }
12167
+
12168
+ if (options.blacklisted_chars) {
12169
+ if (user.search(new RegExp("[".concat(options.blacklisted_chars, "]+"), 'g')) !== -1) return false;
12170
+ }
12171
+
12172
+ return true;
12173
+ }
12174
+
12175
+ module.exports = exports.default;
12176
+ module.exports["default"] = exports.default;
12177
+
12178
+ /***/ }),
12179
+
12180
+ /***/ 1964:
12181
+ /***/ (function(module, exports, __webpack_require__) {
12182
+
12183
+ "use strict";
12184
+
12185
+
12186
+ Object.defineProperty(exports, "__esModule", ({
12187
+ value: true
12188
+ }));
12189
+ exports["default"] = isEmpty;
12190
+
12191
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
12192
+
12193
+ var _merge = _interopRequireDefault(__webpack_require__(1778));
12194
+
12195
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12196
+
12197
+ var default_is_empty_options = {
12198
+ ignore_whitespace: false
12199
+ };
12200
+
12201
+ function isEmpty(str, options) {
12202
+ (0, _assertString.default)(str);
12203
+ options = (0, _merge.default)(options, default_is_empty_options);
12204
+ return (options.ignore_whitespace ? str.trim().length : str.length) === 0;
12205
+ }
12206
+
12207
+ module.exports = exports.default;
12208
+ module.exports["default"] = exports.default;
12209
+
12210
+ /***/ }),
12211
+
12212
+ /***/ 3821:
12213
+ /***/ (function(module, exports, __webpack_require__) {
12214
+
12215
+ "use strict";
12216
+
12217
+
12218
+ Object.defineProperty(exports, "__esModule", ({
12219
+ value: true
12220
+ }));
12221
+ exports["default"] = isEthereumAddress;
12222
+
12223
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
12224
+
12225
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12226
+
12227
+ var eth = /^(0x)[0-9a-f]{40}$/i;
12228
+
12229
+ function isEthereumAddress(str) {
12230
+ (0, _assertString.default)(str);
12231
+ return eth.test(str);
12232
+ }
12233
+
12234
+ module.exports = exports.default;
12235
+ module.exports["default"] = exports.default;
12236
+
12237
+ /***/ }),
12238
+
12239
+ /***/ 8139:
12240
+ /***/ (function(module, exports, __webpack_require__) {
12241
+
12242
+ "use strict";
12243
+
12244
+
12245
+ Object.defineProperty(exports, "__esModule", ({
12246
+ value: true
12247
+ }));
12248
+ exports["default"] = isFQDN;
12249
+
12250
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
12251
+
12252
+ var _merge = _interopRequireDefault(__webpack_require__(1778));
12253
+
12254
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12255
+
12256
+ var default_fqdn_options = {
12257
+ require_tld: true,
12258
+ allow_underscores: false,
12259
+ allow_trailing_dot: false,
12260
+ allow_numeric_tld: false
12261
+ };
12262
+
12263
+ function isFQDN(str, options) {
12264
+ (0, _assertString.default)(str);
12265
+ options = (0, _merge.default)(options, default_fqdn_options);
12266
+ /* Remove the optional trailing dot before checking validity */
12267
+
12268
+ if (options.allow_trailing_dot && str[str.length - 1] === '.') {
12269
+ str = str.substring(0, str.length - 1);
12270
+ }
12271
+
12272
+ var parts = str.split('.');
12273
+ var tld = parts[parts.length - 1];
12274
+
12275
+ if (options.require_tld) {
12276
+ // disallow fqdns without tld
12277
+ if (parts.length < 2) {
12278
+ return false;
12279
+ }
12280
+
12281
+ if (!/^([a-z\u00a1-\uffff]{2,}|xn[a-z0-9-]{2,})$/i.test(tld)) {
12282
+ return false;
12283
+ } // disallow spaces && special characers
12284
+
12285
+
12286
+ if (/[\s\u2002-\u200B\u202F\u205F\u3000\uFEFF\uDB40\uDC20\u00A9\uFFFD]/.test(tld)) {
12287
+ return false;
12288
+ }
12289
+ } // reject numeric TLDs
12290
+
12291
+
12292
+ if (!options.allow_numeric_tld && /^\d+$/.test(tld)) {
12293
+ return false;
12294
+ }
12295
+
12296
+ return parts.every(function (part) {
12297
+ if (part.length > 63) {
12298
+ return false;
12299
+ }
12300
+
12301
+ if (!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(part)) {
12302
+ return false;
12303
+ } // disallow full-width chars
12304
+
12305
+
12306
+ if (/[\uff01-\uff5e]/.test(part)) {
12307
+ return false;
12308
+ } // disallow parts starting or ending with hyphen
12309
+
12310
+
12311
+ if (/^-|-$/.test(part)) {
12312
+ return false;
12313
+ }
12314
+
12315
+ if (!options.allow_underscores && /_/.test(part)) {
12316
+ return false;
12317
+ }
12318
+
12319
+ return true;
12320
+ });
12321
+ }
12322
+
12323
+ module.exports = exports.default;
12324
+ module.exports["default"] = exports.default;
12325
+
12326
+ /***/ }),
12327
+
12328
+ /***/ 3612:
12329
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
12330
+
12331
+ "use strict";
12332
+
12333
+
12334
+ Object.defineProperty(exports, "__esModule", ({
12335
+ value: true
12336
+ }));
12337
+ exports["default"] = isFloat;
12338
+ exports.locales = void 0;
12339
+
12340
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
12341
+
12342
+ var _alpha = __webpack_require__(5475);
12343
+
12344
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12345
+
12346
+ function isFloat(str, options) {
12347
+ (0, _assertString.default)(str);
12348
+ options = options || {};
12349
+ var float = new RegExp("^(?:[-+])?(?:[0-9]+)?(?:\\".concat(options.locale ? _alpha.decimal[options.locale] : '.', "[0-9]*)?(?:[eE][\\+\\-]?(?:[0-9]+))?$"));
12350
+
12351
+ if (str === '' || str === '.' || str === '-' || str === '+') {
12352
+ return false;
12353
+ }
12354
+
12355
+ var value = parseFloat(str.replace(',', '.'));
12356
+ return float.test(str) && (!options.hasOwnProperty('min') || value >= options.min) && (!options.hasOwnProperty('max') || value <= options.max) && (!options.hasOwnProperty('lt') || value < options.lt) && (!options.hasOwnProperty('gt') || value > options.gt);
12357
+ }
12358
+
12359
+ var locales = Object.keys(_alpha.decimal);
12360
+ exports.locales = locales;
12361
+
12362
+ /***/ }),
12363
+
12364
+ /***/ 749:
12365
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
12366
+
12367
+ "use strict";
12368
+
12369
+
12370
+ Object.defineProperty(exports, "__esModule", ({
12371
+ value: true
12372
+ }));
12373
+ exports["default"] = isFullWidth;
12374
+ exports.fullWidth = void 0;
12375
+
12376
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
12377
+
12378
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12379
+
12380
+ var fullWidth = /[^\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;
12381
+ exports.fullWidth = fullWidth;
12382
+
12383
+ function isFullWidth(str) {
12384
+ (0, _assertString.default)(str);
12385
+ return fullWidth.test(str);
12386
+ }
12387
+
12388
+ /***/ }),
12389
+
12390
+ /***/ 841:
12391
+ /***/ (function(module, exports, __webpack_require__) {
12392
+
12393
+ "use strict";
12394
+
12395
+
12396
+ Object.defineProperty(exports, "__esModule", ({
12397
+ value: true
12398
+ }));
12399
+ exports["default"] = isHSL;
12400
+
12401
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
12402
+
12403
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12404
+
12405
+ var hslcomma = /^(hsl)a?\(\s*((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?))(deg|grad|rad|turn|\s*)(\s*,\s*(\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%){2}\s*(,\s*((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%?)\s*)?\)$/i;
12406
+ var hslspace = /^(hsl)a?\(\s*((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?))(deg|grad|rad|turn|\s)(\s*(\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%){2}\s*(\/\s*((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%?)\s*)?\)$/i;
12407
+
12408
+ function isHSL(str) {
12409
+ (0, _assertString.default)(str);
12410
+ return hslcomma.test(str) || hslspace.test(str);
12411
+ }
12412
+
12413
+ module.exports = exports.default;
12414
+ module.exports["default"] = exports.default;
12415
+
12416
+ /***/ }),
12417
+
12418
+ /***/ 8408:
12419
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
12420
+
12421
+ "use strict";
12422
+
12423
+
12424
+ Object.defineProperty(exports, "__esModule", ({
12425
+ value: true
12426
+ }));
12427
+ exports["default"] = isHalfWidth;
12428
+ exports.halfWidth = void 0;
12429
+
12430
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
12431
+
12432
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12433
+
12434
+ var halfWidth = /[\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;
12435
+ exports.halfWidth = halfWidth;
12436
+
12437
+ function isHalfWidth(str) {
12438
+ (0, _assertString.default)(str);
12439
+ return halfWidth.test(str);
12440
+ }
12441
+
12442
+ /***/ }),
12443
+
12444
+ /***/ 9749:
12445
+ /***/ (function(module, exports, __webpack_require__) {
12446
+
12447
+ "use strict";
12448
+
12449
+
12450
+ Object.defineProperty(exports, "__esModule", ({
12451
+ value: true
12452
+ }));
12453
+ exports["default"] = isHash;
12454
+
12455
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
12456
+
12457
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12458
+
12459
+ var lengths = {
12460
+ md5: 32,
12461
+ md4: 32,
12462
+ sha1: 40,
12463
+ sha256: 64,
12464
+ sha384: 96,
12465
+ sha512: 128,
12466
+ ripemd128: 32,
12467
+ ripemd160: 40,
12468
+ tiger128: 32,
12469
+ tiger160: 40,
12470
+ tiger192: 48,
12471
+ crc32: 8,
12472
+ crc32b: 8
12473
+ };
12474
+
12475
+ function isHash(str, algorithm) {
12476
+ (0, _assertString.default)(str);
12477
+ var hash = new RegExp("^[a-fA-F0-9]{".concat(lengths[algorithm], "}$"));
12478
+ return hash.test(str);
12479
+ }
12480
+
12481
+ module.exports = exports.default;
12482
+ module.exports["default"] = exports.default;
12483
+
12484
+ /***/ }),
12485
+
12486
+ /***/ 6941:
12487
+ /***/ (function(module, exports, __webpack_require__) {
12488
+
12489
+ "use strict";
12490
+
12491
+
12492
+ Object.defineProperty(exports, "__esModule", ({
12493
+ value: true
12494
+ }));
12495
+ exports["default"] = isHexColor;
12496
+
12497
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
12498
+
12499
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12500
+
12501
+ var hexcolor = /^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i;
12502
+
12503
+ function isHexColor(str) {
12504
+ (0, _assertString.default)(str);
12505
+ return hexcolor.test(str);
12506
+ }
12507
+
12508
+ module.exports = exports.default;
12509
+ module.exports["default"] = exports.default;
12510
+
12511
+ /***/ }),
12512
+
12513
+ /***/ 9985:
12514
+ /***/ (function(module, exports, __webpack_require__) {
12515
+
12516
+ "use strict";
12517
+
12518
+
12519
+ Object.defineProperty(exports, "__esModule", ({
12520
+ value: true
12521
+ }));
12522
+ exports["default"] = isHexadecimal;
12523
+
12524
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
12525
+
12526
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12527
+
12528
+ var hexadecimal = /^(0x|0h)?[0-9A-F]+$/i;
12529
+
12530
+ function isHexadecimal(str) {
12531
+ (0, _assertString.default)(str);
12532
+ return hexadecimal.test(str);
12533
+ }
12534
+
12535
+ module.exports = exports.default;
12536
+ module.exports["default"] = exports.default;
12537
+
12538
+ /***/ }),
12539
+
12540
+ /***/ 7937:
12541
+ /***/ (function(module, exports, __webpack_require__) {
12542
+
12543
+ "use strict";
12544
+
12545
+
12546
+ Object.defineProperty(exports, "__esModule", ({
12547
+ value: true
12548
+ }));
12549
+ exports["default"] = isIBAN;
12550
+
12551
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
12552
+
12553
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12554
+
12555
+ /**
12556
+ * List of country codes with
12557
+ * corresponding IBAN regular expression
12558
+ * Reference: https://en.wikipedia.org/wiki/International_Bank_Account_Number
12559
+ */
12560
+ var ibanRegexThroughCountryCode = {
12561
+ AD: /^(AD[0-9]{2})\d{8}[A-Z0-9]{12}$/,
12562
+ AE: /^(AE[0-9]{2})\d{3}\d{16}$/,
12563
+ AL: /^(AL[0-9]{2})\d{8}[A-Z0-9]{16}$/,
12564
+ AT: /^(AT[0-9]{2})\d{16}$/,
12565
+ AZ: /^(AZ[0-9]{2})[A-Z0-9]{4}\d{20}$/,
12566
+ BA: /^(BA[0-9]{2})\d{16}$/,
12567
+ BE: /^(BE[0-9]{2})\d{12}$/,
12568
+ BG: /^(BG[0-9]{2})[A-Z]{4}\d{6}[A-Z0-9]{8}$/,
12569
+ BH: /^(BH[0-9]{2})[A-Z]{4}[A-Z0-9]{14}$/,
12570
+ BR: /^(BR[0-9]{2})\d{23}[A-Z]{1}[A-Z0-9]{1}$/,
12571
+ BY: /^(BY[0-9]{2})[A-Z0-9]{4}\d{20}$/,
12572
+ CH: /^(CH[0-9]{2})\d{5}[A-Z0-9]{12}$/,
12573
+ CR: /^(CR[0-9]{2})\d{18}$/,
12574
+ CY: /^(CY[0-9]{2})\d{8}[A-Z0-9]{16}$/,
12575
+ CZ: /^(CZ[0-9]{2})\d{20}$/,
12576
+ DE: /^(DE[0-9]{2})\d{18}$/,
12577
+ DK: /^(DK[0-9]{2})\d{14}$/,
12578
+ DO: /^(DO[0-9]{2})[A-Z]{4}\d{20}$/,
12579
+ EE: /^(EE[0-9]{2})\d{16}$/,
12580
+ EG: /^(EG[0-9]{2})\d{25}$/,
12581
+ ES: /^(ES[0-9]{2})\d{20}$/,
12582
+ FI: /^(FI[0-9]{2})\d{14}$/,
12583
+ FO: /^(FO[0-9]{2})\d{14}$/,
12584
+ FR: /^(FR[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/,
12585
+ GB: /^(GB[0-9]{2})[A-Z]{4}\d{14}$/,
12586
+ GE: /^(GE[0-9]{2})[A-Z0-9]{2}\d{16}$/,
12587
+ GI: /^(GI[0-9]{2})[A-Z]{4}[A-Z0-9]{15}$/,
12588
+ GL: /^(GL[0-9]{2})\d{14}$/,
12589
+ GR: /^(GR[0-9]{2})\d{7}[A-Z0-9]{16}$/,
12590
+ GT: /^(GT[0-9]{2})[A-Z0-9]{4}[A-Z0-9]{20}$/,
12591
+ HR: /^(HR[0-9]{2})\d{17}$/,
12592
+ HU: /^(HU[0-9]{2})\d{24}$/,
12593
+ IE: /^(IE[0-9]{2})[A-Z0-9]{4}\d{14}$/,
12594
+ IL: /^(IL[0-9]{2})\d{19}$/,
12595
+ IQ: /^(IQ[0-9]{2})[A-Z]{4}\d{15}$/,
12596
+ IR: /^(IR[0-9]{2})0\d{2}0\d{18}$/,
12597
+ IS: /^(IS[0-9]{2})\d{22}$/,
12598
+ IT: /^(IT[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/,
12599
+ JO: /^(JO[0-9]{2})[A-Z]{4}\d{22}$/,
12600
+ KW: /^(KW[0-9]{2})[A-Z]{4}[A-Z0-9]{22}$/,
12601
+ KZ: /^(KZ[0-9]{2})\d{3}[A-Z0-9]{13}$/,
12602
+ LB: /^(LB[0-9]{2})\d{4}[A-Z0-9]{20}$/,
12603
+ LC: /^(LC[0-9]{2})[A-Z]{4}[A-Z0-9]{24}$/,
12604
+ LI: /^(LI[0-9]{2})\d{5}[A-Z0-9]{12}$/,
12605
+ LT: /^(LT[0-9]{2})\d{16}$/,
12606
+ LU: /^(LU[0-9]{2})\d{3}[A-Z0-9]{13}$/,
12607
+ LV: /^(LV[0-9]{2})[A-Z]{4}[A-Z0-9]{13}$/,
12608
+ MC: /^(MC[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/,
12609
+ MD: /^(MD[0-9]{2})[A-Z0-9]{20}$/,
12610
+ ME: /^(ME[0-9]{2})\d{18}$/,
12611
+ MK: /^(MK[0-9]{2})\d{3}[A-Z0-9]{10}\d{2}$/,
12612
+ MR: /^(MR[0-9]{2})\d{23}$/,
12613
+ MT: /^(MT[0-9]{2})[A-Z]{4}\d{5}[A-Z0-9]{18}$/,
12614
+ MU: /^(MU[0-9]{2})[A-Z]{4}\d{19}[A-Z]{3}$/,
12615
+ NL: /^(NL[0-9]{2})[A-Z]{4}\d{10}$/,
12616
+ NO: /^(NO[0-9]{2})\d{11}$/,
12617
+ PK: /^(PK[0-9]{2})[A-Z0-9]{4}\d{16}$/,
12618
+ PL: /^(PL[0-9]{2})\d{24}$/,
12619
+ PS: /^(PS[0-9]{2})[A-Z0-9]{4}\d{21}$/,
12620
+ PT: /^(PT[0-9]{2})\d{21}$/,
12621
+ QA: /^(QA[0-9]{2})[A-Z]{4}[A-Z0-9]{21}$/,
12622
+ RO: /^(RO[0-9]{2})[A-Z]{4}[A-Z0-9]{16}$/,
12623
+ RS: /^(RS[0-9]{2})\d{18}$/,
12624
+ SA: /^(SA[0-9]{2})\d{2}[A-Z0-9]{18}$/,
12625
+ SC: /^(SC[0-9]{2})[A-Z]{4}\d{20}[A-Z]{3}$/,
12626
+ SE: /^(SE[0-9]{2})\d{20}$/,
12627
+ SI: /^(SI[0-9]{2})\d{15}$/,
12628
+ SK: /^(SK[0-9]{2})\d{20}$/,
12629
+ SM: /^(SM[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/,
12630
+ SV: /^(SV[0-9]{2})[A-Z0-9]{4}\d{20}$/,
12631
+ TL: /^(TL[0-9]{2})\d{19}$/,
12632
+ TN: /^(TN[0-9]{2})\d{20}$/,
12633
+ TR: /^(TR[0-9]{2})\d{5}[A-Z0-9]{17}$/,
12634
+ UA: /^(UA[0-9]{2})\d{6}[A-Z0-9]{19}$/,
12635
+ VA: /^(VA[0-9]{2})\d{18}$/,
12636
+ VG: /^(VG[0-9]{2})[A-Z0-9]{4}\d{16}$/,
12637
+ XK: /^(XK[0-9]{2})\d{16}$/
12638
+ };
12639
+ /**
12640
+ * Check whether string has correct universal IBAN format
12641
+ * The IBAN consists of up to 34 alphanumeric characters, as follows:
12642
+ * Country Code using ISO 3166-1 alpha-2, two letters
12643
+ * check digits, two digits and
12644
+ * Basic Bank Account Number (BBAN), up to 30 alphanumeric characters.
12645
+ * NOTE: Permitted IBAN characters are: digits [0-9] and the 26 latin alphabetic [A-Z]
12646
+ *
12647
+ * @param {string} str - string under validation
12648
+ * @return {boolean}
12649
+ */
12650
+
12651
+ function hasValidIbanFormat(str) {
12652
+ // Strip white spaces and hyphens
12653
+ var strippedStr = str.replace(/[\s\-]+/gi, '').toUpperCase();
12654
+ var isoCountryCode = strippedStr.slice(0, 2).toUpperCase();
12655
+ return isoCountryCode in ibanRegexThroughCountryCode && ibanRegexThroughCountryCode[isoCountryCode].test(strippedStr);
12656
+ }
12657
+ /**
12658
+ * Check whether string has valid IBAN Checksum
12659
+ * by performing basic mod-97 operation and
12660
+ * the remainder should equal 1
12661
+ * -- Start by rearranging the IBAN by moving the four initial characters to the end of the string
12662
+ * -- Replace each letter in the string with two digits, A -> 10, B = 11, Z = 35
12663
+ * -- Interpret the string as a decimal integer and
12664
+ * -- compute the remainder on division by 97 (mod 97)
12665
+ * Reference: https://en.wikipedia.org/wiki/International_Bank_Account_Number
12666
+ *
12667
+ * @param {string} str
12668
+ * @return {boolean}
12669
+ */
12670
+
12671
+
12672
+ function hasValidIbanChecksum(str) {
12673
+ var strippedStr = str.replace(/[^A-Z0-9]+/gi, '').toUpperCase(); // Keep only digits and A-Z latin alphabetic
12674
+
12675
+ var rearranged = strippedStr.slice(4) + strippedStr.slice(0, 4);
12676
+ var alphaCapsReplacedWithDigits = rearranged.replace(/[A-Z]/g, function (char) {
12677
+ return char.charCodeAt(0) - 55;
12678
+ });
12679
+ var remainder = alphaCapsReplacedWithDigits.match(/\d{1,7}/g).reduce(function (acc, value) {
12680
+ return Number(acc + value) % 97;
12681
+ }, '');
12682
+ return remainder === 1;
12683
+ }
12684
+
12685
+ function isIBAN(str) {
12686
+ (0, _assertString.default)(str);
12687
+ return hasValidIbanFormat(str) && hasValidIbanChecksum(str);
12688
+ }
12689
+
12690
+ module.exports = exports.default;
12691
+ module.exports["default"] = exports.default;
12692
+
12693
+ /***/ }),
12694
+
12695
+ /***/ 1893:
12696
+ /***/ (function(module, exports, __webpack_require__) {
12697
+
12698
+ "use strict";
12699
+
12700
+
12701
+ Object.defineProperty(exports, "__esModule", ({
12702
+ value: true
12703
+ }));
12704
+ exports["default"] = isIMEI;
12705
+
12706
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
12707
+
12708
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12709
+
12710
+ var imeiRegexWithoutHypens = /^[0-9]{15}$/;
12711
+ var imeiRegexWithHypens = /^\d{2}-\d{6}-\d{6}-\d{1}$/;
12712
+
12713
+ function isIMEI(str, options) {
12714
+ (0, _assertString.default)(str);
12715
+ options = options || {}; // default regex for checking imei is the one without hyphens
12716
+
12717
+ var imeiRegex = imeiRegexWithoutHypens;
12718
+
12719
+ if (options.allow_hyphens) {
12720
+ imeiRegex = imeiRegexWithHypens;
12721
+ }
12722
+
12723
+ if (!imeiRegex.test(str)) {
12724
+ return false;
12725
+ }
12726
+
12727
+ str = str.replace(/-/g, '');
12728
+ var sum = 0,
12729
+ mul = 2,
12730
+ l = 14;
12731
+
12732
+ for (var i = 0; i < l; i++) {
12733
+ var digit = str.substring(l - i - 1, l - i);
12734
+ var tp = parseInt(digit, 10) * mul;
12735
+
12736
+ if (tp >= 10) {
12737
+ sum += tp % 10 + 1;
12738
+ } else {
12739
+ sum += tp;
12740
+ }
12741
+
12742
+ if (mul === 1) {
12743
+ mul += 1;
12744
+ } else {
12745
+ mul -= 1;
12746
+ }
12747
+ }
12748
+
12749
+ var chk = (10 - sum % 10) % 10;
12750
+
12751
+ if (chk !== parseInt(str.substring(14, 15), 10)) {
12752
+ return false;
12753
+ }
12754
+
12755
+ return true;
12756
+ }
12757
+
12758
+ module.exports = exports.default;
12759
+ module.exports["default"] = exports.default;
12760
+
12761
+ /***/ }),
12762
+
12763
+ /***/ 7962:
12764
+ /***/ (function(module, exports, __webpack_require__) {
12765
+
12766
+ "use strict";
12767
+
12768
+
12769
+ Object.defineProperty(exports, "__esModule", ({
12770
+ value: true
12771
+ }));
12772
+ exports["default"] = isIP;
12773
+
12774
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
12775
+
12776
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12777
+
12778
+ /**
12779
+ 11.3. Examples
12780
+
12781
+ The following addresses
12782
+
12783
+ fe80::1234 (on the 1st link of the node)
12784
+ ff02::5678 (on the 5th link of the node)
12785
+ ff08::9abc (on the 10th organization of the node)
12786
+
12787
+ would be represented as follows:
12788
+
12789
+ fe80::1234%1
12790
+ ff02::5678%5
12791
+ ff08::9abc%10
12792
+
12793
+ (Here we assume a natural translation from a zone index to the
12794
+ <zone_id> part, where the Nth zone of any scope is translated into
12795
+ "N".)
12796
+
12797
+ If we use interface names as <zone_id>, those addresses could also be
12798
+ represented as follows:
12799
+
12800
+ fe80::1234%ne0
12801
+ ff02::5678%pvc1.3
12802
+ ff08::9abc%interface10
12803
+
12804
+ where the interface "ne0" belongs to the 1st link, "pvc1.3" belongs
12805
+ to the 5th link, and "interface10" belongs to the 10th organization.
12806
+ * * */
12807
+ var ipv4Maybe = /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/;
12808
+ var ipv6Block = /^[0-9A-F]{1,4}$/i;
12809
+
12810
+ function isIP(str) {
12811
+ var version = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
12812
+ (0, _assertString.default)(str);
12813
+ version = String(version);
12814
+
12815
+ if (!version) {
12816
+ return isIP(str, 4) || isIP(str, 6);
12817
+ } else if (version === '4') {
12818
+ if (!ipv4Maybe.test(str)) {
12819
+ return false;
12820
+ }
12821
+
12822
+ var parts = str.split('.').sort(function (a, b) {
12823
+ return a - b;
12824
+ });
12825
+ return parts[3] <= 255;
12826
+ } else if (version === '6') {
12827
+ var addressAndZone = [str]; // ipv6 addresses could have scoped architecture
12828
+ // according to https://tools.ietf.org/html/rfc4007#section-11
12829
+
12830
+ if (str.includes('%')) {
12831
+ addressAndZone = str.split('%');
12832
+
12833
+ if (addressAndZone.length !== 2) {
12834
+ // it must be just two parts
12835
+ return false;
12836
+ }
12837
+
12838
+ if (!addressAndZone[0].includes(':')) {
12839
+ // the first part must be the address
12840
+ return false;
12841
+ }
12842
+
12843
+ if (addressAndZone[1] === '') {
12844
+ // the second part must not be empty
12845
+ return false;
12846
+ }
12847
+ }
12848
+
12849
+ var blocks = addressAndZone[0].split(':');
12850
+ var foundOmissionBlock = false; // marker to indicate ::
12851
+ // At least some OS accept the last 32 bits of an IPv6 address
12852
+ // (i.e. 2 of the blocks) in IPv4 notation, and RFC 3493 says
12853
+ // that '::ffff:a.b.c.d' is valid for IPv4-mapped IPv6 addresses,
12854
+ // and '::a.b.c.d' is deprecated, but also valid.
12855
+
12856
+ var foundIPv4TransitionBlock = isIP(blocks[blocks.length - 1], 4);
12857
+ var expectedNumberOfBlocks = foundIPv4TransitionBlock ? 7 : 8;
12858
+
12859
+ if (blocks.length > expectedNumberOfBlocks) {
12860
+ return false;
12861
+ } // initial or final ::
12862
+
12863
+
12864
+ if (str === '::') {
12865
+ return true;
12866
+ } else if (str.substr(0, 2) === '::') {
12867
+ blocks.shift();
12868
+ blocks.shift();
12869
+ foundOmissionBlock = true;
12870
+ } else if (str.substr(str.length - 2) === '::') {
12871
+ blocks.pop();
12872
+ blocks.pop();
12873
+ foundOmissionBlock = true;
12874
+ }
12875
+
12876
+ for (var i = 0; i < blocks.length; ++i) {
12877
+ // test for a :: which can not be at the string start/end
12878
+ // since those cases have been handled above
12879
+ if (blocks[i] === '' && i > 0 && i < blocks.length - 1) {
12880
+ if (foundOmissionBlock) {
12881
+ return false; // multiple :: in address
12882
+ }
12883
+
12884
+ foundOmissionBlock = true;
12885
+ } else if (foundIPv4TransitionBlock && i === blocks.length - 1) {// it has been checked before that the last
12886
+ // block is a valid IPv4 address
12887
+ } else if (!ipv6Block.test(blocks[i])) {
12888
+ return false;
12889
+ }
12890
+ }
12891
+
12892
+ if (foundOmissionBlock) {
12893
+ return blocks.length >= 1;
12894
+ }
12895
+
12896
+ return blocks.length === expectedNumberOfBlocks;
12897
+ }
12898
+
12899
+ return false;
12900
+ }
12901
+
12902
+ module.exports = exports.default;
12903
+ module.exports["default"] = exports.default;
12904
+
12905
+ /***/ }),
12906
+
12907
+ /***/ 5482:
12908
+ /***/ (function(module, exports, __webpack_require__) {
12909
+
12910
+ "use strict";
12911
+
12912
+
12913
+ Object.defineProperty(exports, "__esModule", ({
12914
+ value: true
12915
+ }));
12916
+ exports["default"] = isIPRange;
12917
+
12918
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
12919
+
12920
+ var _isIP = _interopRequireDefault(__webpack_require__(7962));
12921
+
12922
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12923
+
12924
+ var subnetMaybe = /^\d{1,2}$/;
12925
+
12926
+ function isIPRange(str) {
12927
+ (0, _assertString.default)(str);
12928
+ var parts = str.split('/'); // parts[0] -> ip, parts[1] -> subnet
12929
+
12930
+ if (parts.length !== 2) {
12931
+ return false;
12932
+ }
12933
+
12934
+ if (!subnetMaybe.test(parts[1])) {
12935
+ return false;
12936
+ } // Disallow preceding 0 i.e. 01, 02, ...
12937
+
12938
+
12939
+ if (parts[1].length > 1 && parts[1].startsWith('0')) {
12940
+ return false;
12941
+ }
12942
+
12943
+ return (0, _isIP.default)(parts[0], 4) && parts[1] <= 32 && parts[1] >= 0;
12944
+ }
12945
+
12946
+ module.exports = exports.default;
12947
+ module.exports["default"] = exports.default;
12948
+
12949
+ /***/ }),
12950
+
12951
+ /***/ 6328:
12952
+ /***/ (function(module, exports, __webpack_require__) {
12953
+
12954
+ "use strict";
12955
+
12956
+
12957
+ Object.defineProperty(exports, "__esModule", ({
12958
+ value: true
12959
+ }));
12960
+ exports["default"] = isISBN;
12961
+
12962
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
12963
+
12964
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12965
+
12966
+ var isbn10Maybe = /^(?:[0-9]{9}X|[0-9]{10})$/;
12967
+ var isbn13Maybe = /^(?:[0-9]{13})$/;
12968
+ var factor = [1, 3];
12969
+
12970
+ function isISBN(str) {
12971
+ var version = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
12972
+ (0, _assertString.default)(str);
12973
+ version = String(version);
12974
+
12975
+ if (!version) {
12976
+ return isISBN(str, 10) || isISBN(str, 13);
12977
+ }
12978
+
12979
+ var sanitized = str.replace(/[\s-]+/g, '');
12980
+ var checksum = 0;
12981
+ var i;
12982
+
12983
+ if (version === '10') {
12984
+ if (!isbn10Maybe.test(sanitized)) {
12985
+ return false;
12986
+ }
12987
+
12988
+ for (i = 0; i < 9; i++) {
12989
+ checksum += (i + 1) * sanitized.charAt(i);
12990
+ }
12991
+
12992
+ if (sanitized.charAt(9) === 'X') {
12993
+ checksum += 10 * 10;
12994
+ } else {
12995
+ checksum += 10 * sanitized.charAt(9);
12996
+ }
12997
+
12998
+ if (checksum % 11 === 0) {
12999
+ return !!sanitized;
13000
+ }
13001
+ } else if (version === '13') {
13002
+ if (!isbn13Maybe.test(sanitized)) {
13003
+ return false;
13004
+ }
13005
+
13006
+ for (i = 0; i < 12; i++) {
13007
+ checksum += factor[i % 2] * sanitized.charAt(i);
13008
+ }
13009
+
13010
+ if (sanitized.charAt(12) - (10 - checksum % 10) % 10 === 0) {
13011
+ return !!sanitized;
13012
+ }
13013
+ }
13014
+
13015
+ return false;
13016
+ }
13017
+
13018
+ module.exports = exports.default;
13019
+ module.exports["default"] = exports.default;
13020
+
13021
+ /***/ }),
13022
+
13023
+ /***/ 2390:
13024
+ /***/ (function(module, exports, __webpack_require__) {
13025
+
13026
+ "use strict";
13027
+
13028
+
13029
+ Object.defineProperty(exports, "__esModule", ({
13030
+ value: true
13031
+ }));
13032
+ exports["default"] = isISIN;
13033
+
13034
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
13035
+
13036
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13037
+
13038
+ var isin = /^[A-Z]{2}[0-9A-Z]{9}[0-9]$/;
13039
+
13040
+ function isISIN(str) {
13041
+ (0, _assertString.default)(str);
13042
+
13043
+ if (!isin.test(str)) {
13044
+ return false;
13045
+ }
13046
+
13047
+ var checksumStr = str.replace(/[A-Z]/g, function (character) {
13048
+ return parseInt(character, 36);
13049
+ });
13050
+ var sum = 0;
13051
+ var digit;
13052
+ var tmpNum;
13053
+ var shouldDouble = true;
13054
+
13055
+ for (var i = checksumStr.length - 2; i >= 0; i--) {
13056
+ digit = checksumStr.substring(i, i + 1);
13057
+ tmpNum = parseInt(digit, 10);
13058
+
13059
+ if (shouldDouble) {
13060
+ tmpNum *= 2;
13061
+
13062
+ if (tmpNum >= 10) {
13063
+ sum += tmpNum + 1;
13064
+ } else {
13065
+ sum += tmpNum;
13066
+ }
13067
+ } else {
13068
+ sum += tmpNum;
13069
+ }
13070
+
13071
+ shouldDouble = !shouldDouble;
13072
+ }
13073
+
13074
+ return parseInt(str.substr(str.length - 1), 10) === (10000 - sum) % 10;
13075
+ }
13076
+
13077
+ module.exports = exports.default;
13078
+ module.exports["default"] = exports.default;
13079
+
13080
+ /***/ }),
13081
+
13082
+ /***/ 928:
13083
+ /***/ (function(module, exports, __webpack_require__) {
13084
+
13085
+ "use strict";
13086
+
13087
+
13088
+ Object.defineProperty(exports, "__esModule", ({
13089
+ value: true
13090
+ }));
13091
+ exports["default"] = isISO31661Alpha2;
13092
+
13093
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
13094
+
13095
+ var _includes = _interopRequireDefault(__webpack_require__(2900));
13096
+
13097
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13098
+
13099
+ // from https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
13100
+ var validISO31661Alpha2CountriesCodes = ['AD', 'AE', 'AF', 'AG', 'AI', 'AL', 'AM', 'AO', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AW', 'AX', 'AZ', 'BA', 'BB', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI', 'BJ', 'BL', 'BM', 'BN', 'BO', 'BQ', 'BR', 'BS', 'BT', 'BV', 'BW', 'BY', 'BZ', 'CA', 'CC', 'CD', 'CF', 'CG', 'CH', 'CI', 'CK', 'CL', 'CM', 'CN', 'CO', 'CR', 'CU', 'CV', 'CW', 'CX', 'CY', 'CZ', 'DE', 'DJ', 'DK', 'DM', 'DO', 'DZ', 'EC', 'EE', 'EG', 'EH', 'ER', 'ES', 'ET', 'FI', 'FJ', 'FK', 'FM', 'FO', 'FR', 'GA', 'GB', 'GD', 'GE', 'GF', 'GG', 'GH', 'GI', 'GL', 'GM', 'GN', 'GP', 'GQ', 'GR', 'GS', 'GT', 'GU', 'GW', 'GY', 'HK', 'HM', 'HN', 'HR', 'HT', 'HU', 'ID', 'IE', 'IL', 'IM', 'IN', 'IO', 'IQ', 'IR', 'IS', 'IT', 'JE', 'JM', 'JO', 'JP', 'KE', 'KG', 'KH', 'KI', 'KM', 'KN', 'KP', 'KR', 'KW', 'KY', 'KZ', 'LA', 'LB', 'LC', 'LI', 'LK', 'LR', 'LS', 'LT', 'LU', 'LV', 'LY', 'MA', 'MC', 'MD', 'ME', 'MF', 'MG', 'MH', 'MK', 'ML', 'MM', 'MN', 'MO', 'MP', 'MQ', 'MR', 'MS', 'MT', 'MU', 'MV', 'MW', 'MX', 'MY', 'MZ', 'NA', 'NC', 'NE', 'NF', 'NG', 'NI', 'NL', 'NO', 'NP', 'NR', 'NU', 'NZ', 'OM', 'PA', 'PE', 'PF', 'PG', 'PH', 'PK', 'PL', 'PM', 'PN', 'PR', 'PS', 'PT', 'PW', 'PY', 'QA', 'RE', 'RO', 'RS', 'RU', 'RW', 'SA', 'SB', 'SC', 'SD', 'SE', 'SG', 'SH', 'SI', 'SJ', 'SK', 'SL', 'SM', 'SN', 'SO', 'SR', 'SS', 'ST', 'SV', 'SX', 'SY', 'SZ', 'TC', 'TD', 'TF', 'TG', 'TH', 'TJ', 'TK', 'TL', 'TM', 'TN', 'TO', 'TR', 'TT', 'TV', 'TW', 'TZ', 'UA', 'UG', 'UM', 'US', 'UY', 'UZ', 'VA', 'VC', 'VE', 'VG', 'VI', 'VN', 'VU', 'WF', 'WS', 'YE', 'YT', 'ZA', 'ZM', 'ZW'];
13101
+
13102
+ function isISO31661Alpha2(str) {
13103
+ (0, _assertString.default)(str);
13104
+ return (0, _includes.default)(validISO31661Alpha2CountriesCodes, str.toUpperCase());
13105
+ }
13106
+
13107
+ module.exports = exports.default;
13108
+ module.exports["default"] = exports.default;
13109
+
13110
+ /***/ }),
13111
+
13112
+ /***/ 2038:
13113
+ /***/ (function(module, exports, __webpack_require__) {
13114
+
13115
+ "use strict";
13116
+
13117
+
13118
+ Object.defineProperty(exports, "__esModule", ({
13119
+ value: true
13120
+ }));
13121
+ exports["default"] = isISO31661Alpha3;
13122
+
13123
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
13124
+
13125
+ var _includes = _interopRequireDefault(__webpack_require__(2900));
13126
+
13127
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13128
+
13129
+ // from https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3
13130
+ var validISO31661Alpha3CountriesCodes = ['AFG', 'ALA', 'ALB', 'DZA', 'ASM', 'AND', 'AGO', 'AIA', 'ATA', 'ATG', 'ARG', 'ARM', 'ABW', 'AUS', 'AUT', 'AZE', 'BHS', 'BHR', 'BGD', 'BRB', 'BLR', 'BEL', 'BLZ', 'BEN', 'BMU', 'BTN', 'BOL', 'BES', 'BIH', 'BWA', 'BVT', 'BRA', 'IOT', 'BRN', 'BGR', 'BFA', 'BDI', 'KHM', 'CMR', 'CAN', 'CPV', 'CYM', 'CAF', 'TCD', 'CHL', 'CHN', 'CXR', 'CCK', 'COL', 'COM', 'COG', 'COD', 'COK', 'CRI', 'CIV', 'HRV', 'CUB', 'CUW', 'CYP', 'CZE', 'DNK', 'DJI', 'DMA', 'DOM', 'ECU', 'EGY', 'SLV', 'GNQ', 'ERI', 'EST', 'ETH', 'FLK', 'FRO', 'FJI', 'FIN', 'FRA', 'GUF', 'PYF', 'ATF', 'GAB', 'GMB', 'GEO', 'DEU', 'GHA', 'GIB', 'GRC', 'GRL', 'GRD', 'GLP', 'GUM', 'GTM', 'GGY', 'GIN', 'GNB', 'GUY', 'HTI', 'HMD', 'VAT', 'HND', 'HKG', 'HUN', 'ISL', 'IND', 'IDN', 'IRN', 'IRQ', 'IRL', 'IMN', 'ISR', 'ITA', 'JAM', 'JPN', 'JEY', 'JOR', 'KAZ', 'KEN', 'KIR', 'PRK', 'KOR', 'KWT', 'KGZ', 'LAO', 'LVA', 'LBN', 'LSO', 'LBR', 'LBY', 'LIE', 'LTU', 'LUX', 'MAC', 'MKD', 'MDG', 'MWI', 'MYS', 'MDV', 'MLI', 'MLT', 'MHL', 'MTQ', 'MRT', 'MUS', 'MYT', 'MEX', 'FSM', 'MDA', 'MCO', 'MNG', 'MNE', 'MSR', 'MAR', 'MOZ', 'MMR', 'NAM', 'NRU', 'NPL', 'NLD', 'NCL', 'NZL', 'NIC', 'NER', 'NGA', 'NIU', 'NFK', 'MNP', 'NOR', 'OMN', 'PAK', 'PLW', 'PSE', 'PAN', 'PNG', 'PRY', 'PER', 'PHL', 'PCN', 'POL', 'PRT', 'PRI', 'QAT', 'REU', 'ROU', 'RUS', 'RWA', 'BLM', 'SHN', 'KNA', 'LCA', 'MAF', 'SPM', 'VCT', 'WSM', 'SMR', 'STP', 'SAU', 'SEN', 'SRB', 'SYC', 'SLE', 'SGP', 'SXM', 'SVK', 'SVN', 'SLB', 'SOM', 'ZAF', 'SGS', 'SSD', 'ESP', 'LKA', 'SDN', 'SUR', 'SJM', 'SWZ', 'SWE', 'CHE', 'SYR', 'TWN', 'TJK', 'TZA', 'THA', 'TLS', 'TGO', 'TKL', 'TON', 'TTO', 'TUN', 'TUR', 'TKM', 'TCA', 'TUV', 'UGA', 'UKR', 'ARE', 'GBR', 'USA', 'UMI', 'URY', 'UZB', 'VUT', 'VEN', 'VNM', 'VGB', 'VIR', 'WLF', 'ESH', 'YEM', 'ZMB', 'ZWE'];
13131
+
13132
+ function isISO31661Alpha3(str) {
13133
+ (0, _assertString.default)(str);
13134
+ return (0, _includes.default)(validISO31661Alpha3CountriesCodes, str.toUpperCase());
13135
+ }
13136
+
13137
+ module.exports = exports.default;
13138
+ module.exports["default"] = exports.default;
13139
+
13140
+ /***/ }),
13141
+
13142
+ /***/ 8932:
13143
+ /***/ (function(module, exports, __webpack_require__) {
13144
+
13145
+ "use strict";
13146
+
13147
+
13148
+ Object.defineProperty(exports, "__esModule", ({
13149
+ value: true
13150
+ }));
13151
+ exports["default"] = isISO8601;
13152
+
13153
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
13154
+
13155
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13156
+
13157
+ /* eslint-disable max-len */
13158
+ // from http://goo.gl/0ejHHW
13159
+ var iso8601 = /^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/; // same as above, except with a strict 'T' separator between date and time
13160
+
13161
+ var iso8601StrictSeparator = /^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;
13162
+ /* eslint-enable max-len */
13163
+
13164
+ var isValidDate = function isValidDate(str) {
13165
+ // str must have passed the ISO8601 check
13166
+ // this check is meant to catch invalid dates
13167
+ // like 2009-02-31
13168
+ // first check for ordinal dates
13169
+ var ordinalMatch = str.match(/^(\d{4})-?(\d{3})([ T]{1}\.*|$)/);
13170
+
13171
+ if (ordinalMatch) {
13172
+ var oYear = Number(ordinalMatch[1]);
13173
+ var oDay = Number(ordinalMatch[2]); // if is leap year
13174
+
13175
+ if (oYear % 4 === 0 && oYear % 100 !== 0 || oYear % 400 === 0) return oDay <= 366;
13176
+ return oDay <= 365;
13177
+ }
13178
+
13179
+ var match = str.match(/(\d{4})-?(\d{0,2})-?(\d*)/).map(Number);
13180
+ var year = match[1];
13181
+ var month = match[2];
13182
+ var day = match[3];
13183
+ var monthString = month ? "0".concat(month).slice(-2) : month;
13184
+ var dayString = day ? "0".concat(day).slice(-2) : day; // create a date object and compare
13185
+
13186
+ var d = new Date("".concat(year, "-").concat(monthString || '01', "-").concat(dayString || '01'));
13187
+
13188
+ if (month && day) {
13189
+ return d.getUTCFullYear() === year && d.getUTCMonth() + 1 === month && d.getUTCDate() === day;
13190
+ }
13191
+
13192
+ return true;
13193
+ };
13194
+
13195
+ function isISO8601(str) {
13196
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
13197
+ (0, _assertString.default)(str);
13198
+ var check = options.strictSeparator ? iso8601StrictSeparator.test(str) : iso8601.test(str);
13199
+ if (check && options.strict) return isValidDate(str);
13200
+ return check;
13201
+ }
13202
+
13203
+ module.exports = exports.default;
13204
+ module.exports["default"] = exports.default;
13205
+
13206
+ /***/ }),
13207
+
13208
+ /***/ 6557:
13209
+ /***/ (function(module, exports, __webpack_require__) {
13210
+
13211
+ "use strict";
13212
+
13213
+
13214
+ Object.defineProperty(exports, "__esModule", ({
13215
+ value: true
13216
+ }));
13217
+ exports["default"] = isISRC;
13218
+
13219
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
13220
+
13221
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13222
+
13223
+ // see http://isrc.ifpi.org/en/isrc-standard/code-syntax
13224
+ var isrc = /^[A-Z]{2}[0-9A-Z]{3}\d{2}\d{5}$/;
13225
+
13226
+ function isISRC(str) {
13227
+ (0, _assertString.default)(str);
13228
+ return isrc.test(str);
13229
+ }
13230
+
13231
+ module.exports = exports.default;
13232
+ module.exports["default"] = exports.default;
13233
+
13234
+ /***/ }),
13235
+
13236
+ /***/ 2985:
13237
+ /***/ (function(module, exports, __webpack_require__) {
13238
+
13239
+ "use strict";
13240
+
13241
+
13242
+ Object.defineProperty(exports, "__esModule", ({
13243
+ value: true
13244
+ }));
13245
+ exports["default"] = isISSN;
13246
+
13247
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
13248
+
13249
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13250
+
13251
+ var issn = '^\\d{4}-?\\d{3}[\\dX]$';
13252
+
13253
+ function isISSN(str) {
13254
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
13255
+ (0, _assertString.default)(str);
13256
+ var testIssn = issn;
13257
+ testIssn = options.require_hyphen ? testIssn.replace('?', '') : testIssn;
13258
+ testIssn = options.case_sensitive ? new RegExp(testIssn) : new RegExp(testIssn, 'i');
13259
+
13260
+ if (!testIssn.test(str)) {
13261
+ return false;
13262
+ }
13263
+
13264
+ var digits = str.replace('-', '').toUpperCase();
13265
+ var checksum = 0;
13266
+
13267
+ for (var i = 0; i < digits.length; i++) {
13268
+ var digit = digits[i];
13269
+ checksum += (digit === 'X' ? 10 : +digit) * (8 - i);
13270
+ }
13271
+
13272
+ return checksum % 11 === 0;
13273
+ }
13274
+
13275
+ module.exports = exports.default;
13276
+ module.exports["default"] = exports.default;
13277
+
13278
+ /***/ }),
13279
+
13280
+ /***/ 2250:
13281
+ /***/ (function(module, exports, __webpack_require__) {
13282
+
13283
+ "use strict";
13284
+
13285
+
13286
+ Object.defineProperty(exports, "__esModule", ({
13287
+ value: true
13288
+ }));
13289
+ exports["default"] = isIdentityCard;
13290
+
13291
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
13292
+
13293
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13294
+
13295
+ var validators = {
13296
+ ES: function ES(str) {
13297
+ (0, _assertString.default)(str);
13298
+ var DNI = /^[0-9X-Z][0-9]{7}[TRWAGMYFPDXBNJZSQVHLCKE]$/;
13299
+ var charsValue = {
13300
+ X: 0,
13301
+ Y: 1,
13302
+ Z: 2
13303
+ };
13304
+ var controlDigits = ['T', 'R', 'W', 'A', 'G', 'M', 'Y', 'F', 'P', 'D', 'X', 'B', 'N', 'J', 'Z', 'S', 'Q', 'V', 'H', 'L', 'C', 'K', 'E']; // sanitize user input
13305
+
13306
+ var sanitized = str.trim().toUpperCase(); // validate the data structure
13307
+
13308
+ if (!DNI.test(sanitized)) {
13309
+ return false;
13310
+ } // validate the control digit
13311
+
13312
+
13313
+ var number = sanitized.slice(0, -1).replace(/[X,Y,Z]/g, function (char) {
13314
+ return charsValue[char];
13315
+ });
13316
+ return sanitized.endsWith(controlDigits[number % 23]);
13317
+ },
13318
+ IN: function IN(str) {
13319
+ var DNI = /^[1-9]\d{3}\s?\d{4}\s?\d{4}$/; // multiplication table
13320
+
13321
+ var d = [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [1, 2, 3, 4, 0, 6, 7, 8, 9, 5], [2, 3, 4, 0, 1, 7, 8, 9, 5, 6], [3, 4, 0, 1, 2, 8, 9, 5, 6, 7], [4, 0, 1, 2, 3, 9, 5, 6, 7, 8], [5, 9, 8, 7, 6, 0, 4, 3, 2, 1], [6, 5, 9, 8, 7, 1, 0, 4, 3, 2], [7, 6, 5, 9, 8, 2, 1, 0, 4, 3], [8, 7, 6, 5, 9, 3, 2, 1, 0, 4], [9, 8, 7, 6, 5, 4, 3, 2, 1, 0]]; // permutation table
13322
+
13323
+ var p = [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [1, 5, 7, 6, 2, 8, 3, 0, 9, 4], [5, 8, 0, 3, 7, 9, 6, 1, 4, 2], [8, 9, 1, 6, 0, 4, 3, 5, 2, 7], [9, 4, 5, 3, 1, 2, 6, 8, 7, 0], [4, 2, 8, 6, 5, 7, 3, 9, 0, 1], [2, 7, 9, 3, 8, 0, 6, 4, 1, 5], [7, 0, 4, 6, 9, 1, 3, 2, 5, 8]]; // sanitize user input
13324
+
13325
+ var sanitized = str.trim(); // validate the data structure
13326
+
13327
+ if (!DNI.test(sanitized)) {
13328
+ return false;
13329
+ }
13330
+
13331
+ var c = 0;
13332
+ var invertedArray = sanitized.replace(/\s/g, '').split('').map(Number).reverse();
13333
+ invertedArray.forEach(function (val, i) {
13334
+ c = d[c][p[i % 8][val]];
13335
+ });
13336
+ return c === 0;
13337
+ },
13338
+ IT: function IT(str) {
13339
+ if (str.length !== 9) return false;
13340
+ if (str === 'CA00000AA') return false; // https://it.wikipedia.org/wiki/Carta_d%27identit%C3%A0_elettronica_italiana
13341
+
13342
+ return str.search(/C[A-Z][0-9]{5}[A-Z]{2}/i) > -1;
13343
+ },
13344
+ NO: function NO(str) {
13345
+ var sanitized = str.trim();
13346
+ if (isNaN(Number(sanitized))) return false;
13347
+ if (sanitized.length !== 11) return false;
13348
+ if (sanitized === '00000000000') return false; // https://no.wikipedia.org/wiki/F%C3%B8dselsnummer
13349
+
13350
+ var f = sanitized.split('').map(Number);
13351
+ var k1 = (11 - (3 * f[0] + 7 * f[1] + 6 * f[2] + 1 * f[3] + 8 * f[4] + 9 * f[5] + 4 * f[6] + 5 * f[7] + 2 * f[8]) % 11) % 11;
13352
+ var k2 = (11 - (5 * f[0] + 4 * f[1] + 3 * f[2] + 2 * f[3] + 7 * f[4] + 6 * f[5] + 5 * f[6] + 4 * f[7] + 3 * f[8] + 2 * k1) % 11) % 11;
13353
+ if (k1 !== f[9] || k2 !== f[10]) return false;
13354
+ return true;
13355
+ },
13356
+ 'he-IL': function heIL(str) {
13357
+ var DNI = /^\d{9}$/; // sanitize user input
13358
+
13359
+ var sanitized = str.trim(); // validate the data structure
13360
+
13361
+ if (!DNI.test(sanitized)) {
13362
+ return false;
13363
+ }
13364
+
13365
+ var id = sanitized;
13366
+ var sum = 0,
13367
+ incNum;
13368
+
13369
+ for (var i = 0; i < id.length; i++) {
13370
+ incNum = Number(id[i]) * (i % 2 + 1); // Multiply number by 1 or 2
13371
+
13372
+ sum += incNum > 9 ? incNum - 9 : incNum; // Sum the digits up and add to total
13373
+ }
13374
+
13375
+ return sum % 10 === 0;
13376
+ },
13377
+ 'ar-TN': function arTN(str) {
13378
+ var DNI = /^\d{8}$/; // sanitize user input
13379
+
13380
+ var sanitized = str.trim(); // validate the data structure
13381
+
13382
+ if (!DNI.test(sanitized)) {
13383
+ return false;
13384
+ }
13385
+
13386
+ return true;
13387
+ },
13388
+ 'zh-CN': function zhCN(str) {
13389
+ var provincesAndCities = ['11', // 北京
13390
+ '12', // 天津
13391
+ '13', // 河北
13392
+ '14', // 山西
13393
+ '15', // 内蒙古
13394
+ '21', // 辽宁
13395
+ '22', // 吉林
13396
+ '23', // 黑龙江
13397
+ '31', // 上海
13398
+ '32', // 江苏
13399
+ '33', // 浙江
13400
+ '34', // 安徽
13401
+ '35', // 福建
13402
+ '36', // 江西
13403
+ '37', // 山东
13404
+ '41', // 河南
13405
+ '42', // 湖北
13406
+ '43', // 湖南
13407
+ '44', // 广东
13408
+ '45', // 广西
13409
+ '46', // 海南
13410
+ '50', // 重庆
13411
+ '51', // 四川
13412
+ '52', // 贵州
13413
+ '53', // 云南
13414
+ '54', // 西藏
13415
+ '61', // 陕西
13416
+ '62', // 甘肃
13417
+ '63', // 青海
13418
+ '64', // 宁夏
13419
+ '65', // 新疆
13420
+ '71', // 台湾
13421
+ '81', // 香港
13422
+ '82', // 澳门
13423
+ '91' // 国外
13424
+ ];
13425
+ var powers = ['7', '9', '10', '5', '8', '4', '2', '1', '6', '3', '7', '9', '10', '5', '8', '4', '2'];
13426
+ var parityBit = ['1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'];
13427
+
13428
+ var checkAddressCode = function checkAddressCode(addressCode) {
13429
+ return provincesAndCities.includes(addressCode);
13430
+ };
13431
+
13432
+ var checkBirthDayCode = function checkBirthDayCode(birDayCode) {
13433
+ var yyyy = parseInt(birDayCode.substring(0, 4), 10);
13434
+ var mm = parseInt(birDayCode.substring(4, 6), 10);
13435
+ var dd = parseInt(birDayCode.substring(6), 10);
13436
+ var xdata = new Date(yyyy, mm - 1, dd);
13437
+
13438
+ if (xdata > new Date()) {
13439
+ return false; // eslint-disable-next-line max-len
13440
+ } else if (xdata.getFullYear() === yyyy && xdata.getMonth() === mm - 1 && xdata.getDate() === dd) {
13441
+ return true;
13442
+ }
13443
+
13444
+ return false;
13445
+ };
13446
+
13447
+ var getParityBit = function getParityBit(idCardNo) {
13448
+ var id17 = idCardNo.substring(0, 17);
13449
+ var power = 0;
13450
+
13451
+ for (var i = 0; i < 17; i++) {
13452
+ power += parseInt(id17.charAt(i), 10) * parseInt(powers[i], 10);
13453
+ }
13454
+
13455
+ var mod = power % 11;
13456
+ return parityBit[mod];
13457
+ };
13458
+
13459
+ var checkParityBit = function checkParityBit(idCardNo) {
13460
+ return getParityBit(idCardNo) === idCardNo.charAt(17).toUpperCase();
13461
+ };
13462
+
13463
+ var check15IdCardNo = function check15IdCardNo(idCardNo) {
13464
+ var check = /^[1-9]\d{7}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}$/.test(idCardNo);
13465
+ if (!check) return false;
13466
+ var addressCode = idCardNo.substring(0, 2);
13467
+ check = checkAddressCode(addressCode);
13468
+ if (!check) return false;
13469
+ var birDayCode = "19".concat(idCardNo.substring(6, 12));
13470
+ check = checkBirthDayCode(birDayCode);
13471
+ if (!check) return false;
13472
+ return true;
13473
+ };
13474
+
13475
+ var check18IdCardNo = function check18IdCardNo(idCardNo) {
13476
+ var check = /^[1-9]\d{5}[1-9]\d{3}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}(\d|x|X)$/.test(idCardNo);
13477
+ if (!check) return false;
13478
+ var addressCode = idCardNo.substring(0, 2);
13479
+ check = checkAddressCode(addressCode);
13480
+ if (!check) return false;
13481
+ var birDayCode = idCardNo.substring(6, 14);
13482
+ check = checkBirthDayCode(birDayCode);
13483
+ if (!check) return false;
13484
+ return checkParityBit(idCardNo);
13485
+ };
13486
+
13487
+ var checkIdCardNo = function checkIdCardNo(idCardNo) {
13488
+ var check = /^\d{15}|(\d{17}(\d|x|X))$/.test(idCardNo);
13489
+ if (!check) return false;
13490
+
13491
+ if (idCardNo.length === 15) {
13492
+ return check15IdCardNo(idCardNo);
13493
+ }
13494
+
13495
+ return check18IdCardNo(idCardNo);
13496
+ };
13497
+
13498
+ return checkIdCardNo(str);
13499
+ },
13500
+ 'zh-TW': function zhTW(str) {
13501
+ var ALPHABET_CODES = {
13502
+ A: 10,
13503
+ B: 11,
13504
+ C: 12,
13505
+ D: 13,
13506
+ E: 14,
13507
+ F: 15,
13508
+ G: 16,
13509
+ H: 17,
13510
+ I: 34,
13511
+ J: 18,
13512
+ K: 19,
13513
+ L: 20,
13514
+ M: 21,
13515
+ N: 22,
13516
+ O: 35,
13517
+ P: 23,
13518
+ Q: 24,
13519
+ R: 25,
13520
+ S: 26,
13521
+ T: 27,
13522
+ U: 28,
13523
+ V: 29,
13524
+ W: 32,
13525
+ X: 30,
13526
+ Y: 31,
13527
+ Z: 33
13528
+ };
13529
+ var sanitized = str.trim().toUpperCase();
13530
+ if (!/^[A-Z][0-9]{9}$/.test(sanitized)) return false;
13531
+ return Array.from(sanitized).reduce(function (sum, number, index) {
13532
+ if (index === 0) {
13533
+ var code = ALPHABET_CODES[number];
13534
+ return code % 10 * 9 + Math.floor(code / 10);
13535
+ }
13536
+
13537
+ if (index === 9) {
13538
+ return (10 - sum % 10 - Number(number)) % 10 === 0;
13539
+ }
13540
+
13541
+ return sum + Number(number) * (9 - index);
13542
+ }, 0);
13543
+ }
13544
+ };
13545
+
13546
+ function isIdentityCard(str, locale) {
13547
+ (0, _assertString.default)(str);
13548
+
13549
+ if (locale in validators) {
13550
+ return validators[locale](str);
13551
+ } else if (locale === 'any') {
13552
+ for (var key in validators) {
13553
+ // https://github.com/gotwarlost/istanbul/blob/master/ignoring-code-for-coverage.md#ignoring-code-for-coverage-purposes
13554
+ // istanbul ignore else
13555
+ if (validators.hasOwnProperty(key)) {
13556
+ var validator = validators[key];
13557
+
13558
+ if (validator(str)) {
13559
+ return true;
13560
+ }
13561
+ }
13562
+ }
13563
+
13564
+ return false;
13565
+ }
13566
+
13567
+ throw new Error("Invalid locale '".concat(locale, "'"));
13568
+ }
13569
+
13570
+ module.exports = exports.default;
13571
+ module.exports["default"] = exports.default;
13572
+
13573
+ /***/ }),
13574
+
13575
+ /***/ 2093:
13576
+ /***/ (function(module, exports, __webpack_require__) {
13577
+
13578
+ "use strict";
13579
+
13580
+
13581
+ Object.defineProperty(exports, "__esModule", ({
13582
+ value: true
13583
+ }));
13584
+ exports["default"] = isIn;
13585
+
13586
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
13587
+
13588
+ var _toString = _interopRequireDefault(__webpack_require__(1589));
13589
+
13590
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13591
+
13592
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
13593
+
13594
+ function isIn(str, options) {
13595
+ (0, _assertString.default)(str);
13596
+ var i;
13597
+
13598
+ if (Object.prototype.toString.call(options) === '[object Array]') {
13599
+ var array = [];
13600
+
13601
+ for (i in options) {
13602
+ // https://github.com/gotwarlost/istanbul/blob/master/ignoring-code-for-coverage.md#ignoring-code-for-coverage-purposes
13603
+ // istanbul ignore else
13604
+ if ({}.hasOwnProperty.call(options, i)) {
13605
+ array[i] = (0, _toString.default)(options[i]);
13606
+ }
13607
+ }
13608
+
13609
+ return array.indexOf(str) >= 0;
13610
+ } else if (_typeof(options) === 'object') {
13611
+ return options.hasOwnProperty(str);
13612
+ } else if (options && typeof options.indexOf === 'function') {
13613
+ return options.indexOf(str) >= 0;
13614
+ }
13615
+
13616
+ return false;
13617
+ }
13618
+
13619
+ module.exports = exports.default;
13620
+ module.exports["default"] = exports.default;
13621
+
13622
+ /***/ }),
13623
+
13624
+ /***/ 4503:
13625
+ /***/ (function(module, exports, __webpack_require__) {
13626
+
13627
+ "use strict";
13628
+
13629
+
13630
+ Object.defineProperty(exports, "__esModule", ({
13631
+ value: true
13632
+ }));
13633
+ exports["default"] = isInt;
13634
+
13635
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
13636
+
13637
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13638
+
13639
+ var int = /^(?:[-+]?(?:0|[1-9][0-9]*))$/;
13640
+ var intLeadingZeroes = /^[-+]?[0-9]+$/;
13641
+
13642
+ function isInt(str, options) {
13643
+ (0, _assertString.default)(str);
13644
+ options = options || {}; // Get the regex to use for testing, based on whether
13645
+ // leading zeroes are allowed or not.
13646
+
13647
+ var regex = options.hasOwnProperty('allow_leading_zeroes') && !options.allow_leading_zeroes ? int : intLeadingZeroes; // Check min/max/lt/gt
13648
+
13649
+ var minCheckPassed = !options.hasOwnProperty('min') || str >= options.min;
13650
+ var maxCheckPassed = !options.hasOwnProperty('max') || str <= options.max;
13651
+ var ltCheckPassed = !options.hasOwnProperty('lt') || str < options.lt;
13652
+ var gtCheckPassed = !options.hasOwnProperty('gt') || str > options.gt;
13653
+ return regex.test(str) && minCheckPassed && maxCheckPassed && ltCheckPassed && gtCheckPassed;
13654
+ }
13655
+
13656
+ module.exports = exports.default;
13657
+ module.exports["default"] = exports.default;
13658
+
13659
+ /***/ }),
13660
+
13661
+ /***/ 5067:
13662
+ /***/ (function(module, exports, __webpack_require__) {
13663
+
13664
+ "use strict";
13665
+
13666
+
13667
+ Object.defineProperty(exports, "__esModule", ({
13668
+ value: true
13669
+ }));
13670
+ exports["default"] = isJSON;
13671
+
13672
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
13673
+
13674
+ var _merge = _interopRequireDefault(__webpack_require__(1778));
13675
+
13676
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13677
+
13678
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
13679
+
13680
+ var default_json_options = {
13681
+ allow_primitives: false
13682
+ };
13683
+
13684
+ function isJSON(str, options) {
13685
+ (0, _assertString.default)(str);
13686
+
13687
+ try {
13688
+ options = (0, _merge.default)(options, default_json_options);
13689
+ var primitives = [];
13690
+
13691
+ if (options.allow_primitives) {
13692
+ primitives = [null, false, true];
13693
+ }
13694
+
13695
+ var obj = JSON.parse(str);
13696
+ return primitives.includes(obj) || !!obj && _typeof(obj) === 'object';
13697
+ } catch (e) {
13698
+ /* ignore */
13699
+ }
13700
+
13701
+ return false;
13702
+ }
13703
+
13704
+ module.exports = exports.default;
13705
+ module.exports["default"] = exports.default;
13706
+
13707
+ /***/ }),
13708
+
13709
+ /***/ 1624:
13710
+ /***/ (function(module, exports, __webpack_require__) {
13711
+
13712
+ "use strict";
13713
+
13714
+
13715
+ Object.defineProperty(exports, "__esModule", ({
13716
+ value: true
13717
+ }));
13718
+ exports["default"] = isJWT;
13719
+
13720
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
13721
+
13722
+ var _isBase = _interopRequireDefault(__webpack_require__(438));
13723
+
13724
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13725
+
13726
+ function isJWT(str) {
13727
+ (0, _assertString.default)(str);
13728
+ var dotSplit = str.split('.');
13729
+ var len = dotSplit.length;
13730
+
13731
+ if (len > 3 || len < 2) {
13732
+ return false;
13733
+ }
13734
+
13735
+ return dotSplit.reduce(function (acc, currElem) {
13736
+ return acc && (0, _isBase.default)(currElem, {
13737
+ urlSafe: true
13738
+ });
13739
+ }, true);
13740
+ }
13741
+
13742
+ module.exports = exports.default;
13743
+ module.exports["default"] = exports.default;
13744
+
13745
+ /***/ }),
13746
+
13747
+ /***/ 2863:
13748
+ /***/ (function(module, exports, __webpack_require__) {
13749
+
13750
+ "use strict";
13751
+
13752
+
13753
+ Object.defineProperty(exports, "__esModule", ({
13754
+ value: true
13755
+ }));
13756
+ exports["default"] = isLatLong;
13757
+
13758
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
13759
+
13760
+ var _merge = _interopRequireDefault(__webpack_require__(1778));
13761
+
13762
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13763
+
13764
+ var lat = /^\(?[+-]?(90(\.0+)?|[1-8]?\d(\.\d+)?)$/;
13765
+ var long = /^\s?[+-]?(180(\.0+)?|1[0-7]\d(\.\d+)?|\d{1,2}(\.\d+)?)\)?$/;
13766
+ var latDMS = /^(([1-8]?\d)\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|90\D+0\D+0)\D+[NSns]?$/i;
13767
+ var longDMS = /^\s*([1-7]?\d{1,2}\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|180\D+0\D+0)\D+[EWew]?$/i;
13768
+ var defaultLatLongOptions = {
13769
+ checkDMS: false
13770
+ };
13771
+
13772
+ function isLatLong(str, options) {
13773
+ (0, _assertString.default)(str);
13774
+ options = (0, _merge.default)(options, defaultLatLongOptions);
13775
+ if (!str.includes(',')) return false;
13776
+ var pair = str.split(',');
13777
+ if (pair[0].startsWith('(') && !pair[1].endsWith(')') || pair[1].endsWith(')') && !pair[0].startsWith('(')) return false;
13778
+
13779
+ if (options.checkDMS) {
13780
+ return latDMS.test(pair[0]) && longDMS.test(pair[1]);
13781
+ }
13782
+
13783
+ return lat.test(pair[0]) && long.test(pair[1]);
13784
+ }
13785
+
13786
+ module.exports = exports.default;
13787
+ module.exports["default"] = exports.default;
13788
+
13789
+ /***/ }),
13790
+
13791
+ /***/ 6500:
13792
+ /***/ (function(module, exports, __webpack_require__) {
13793
+
13794
+ "use strict";
13795
+
13796
+
13797
+ Object.defineProperty(exports, "__esModule", ({
13798
+ value: true
13799
+ }));
13800
+ exports["default"] = isLength;
13801
+
13802
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
13803
+
13804
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13805
+
13806
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
13807
+
13808
+ /* eslint-disable prefer-rest-params */
13809
+ function isLength(str, options) {
13810
+ (0, _assertString.default)(str);
13811
+ var min;
13812
+ var max;
13813
+
13814
+ if (_typeof(options) === 'object') {
13815
+ min = options.min || 0;
13816
+ max = options.max;
13817
+ } else {
13818
+ // backwards compatibility: isLength(str, min [, max])
13819
+ min = arguments[1] || 0;
13820
+ max = arguments[2];
13821
+ }
13822
+
13823
+ var surrogatePairs = str.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g) || [];
13824
+ var len = str.length - surrogatePairs.length;
13825
+ return len >= min && (typeof max === 'undefined' || len <= max);
13826
+ }
13827
+
13828
+ module.exports = exports.default;
13829
+ module.exports["default"] = exports.default;
13830
+
13831
+ /***/ }),
13832
+
13833
+ /***/ 4452:
13834
+ /***/ (function(module, exports, __webpack_require__) {
13835
+
13836
+ "use strict";
13837
+
13838
+
13839
+ Object.defineProperty(exports, "__esModule", ({
13840
+ value: true
13841
+ }));
13842
+ exports["default"] = isLocale;
13843
+
13844
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
13845
+
13846
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13847
+
13848
+ var localeReg = /^[A-z]{2,4}([_-]([A-z]{4}|[\d]{3}))?([_-]([A-z]{2}|[\d]{3}))?$/;
13849
+
13850
+ function isLocale(str) {
13851
+ (0, _assertString.default)(str);
13852
+
13853
+ if (str === 'en_US_POSIX' || str === 'ca_ES_VALENCIA') {
13854
+ return true;
13855
+ }
13856
+
13857
+ return localeReg.test(str);
13858
+ }
13859
+
13860
+ module.exports = exports.default;
13861
+ module.exports["default"] = exports.default;
13862
+
13863
+ /***/ }),
13864
+
13865
+ /***/ 8816:
13866
+ /***/ (function(module, exports, __webpack_require__) {
13867
+
13868
+ "use strict";
13869
+
13870
+
13871
+ Object.defineProperty(exports, "__esModule", ({
13872
+ value: true
13873
+ }));
13874
+ exports["default"] = isLowercase;
13875
+
13876
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
13877
+
13878
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13879
+
13880
+ function isLowercase(str) {
13881
+ (0, _assertString.default)(str);
13882
+ return str === str.toLowerCase();
13883
+ }
13884
+
13885
+ module.exports = exports.default;
13886
+ module.exports["default"] = exports.default;
13887
+
13888
+ /***/ }),
13889
+
13890
+ /***/ 5504:
13891
+ /***/ (function(module, exports, __webpack_require__) {
13892
+
13893
+ "use strict";
13894
+
13895
+
13896
+ Object.defineProperty(exports, "__esModule", ({
13897
+ value: true
13898
+ }));
13899
+ exports["default"] = isMACAddress;
13900
+
13901
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
13902
+
13903
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13904
+
13905
+ var macAddress = /^([0-9a-fA-F][0-9a-fA-F]:){5}([0-9a-fA-F][0-9a-fA-F])$/;
13906
+ var macAddressNoColons = /^([0-9a-fA-F]){12}$/;
13907
+ var macAddressWithHyphen = /^([0-9a-fA-F][0-9a-fA-F]-){5}([0-9a-fA-F][0-9a-fA-F])$/;
13908
+ var macAddressWithSpaces = /^([0-9a-fA-F][0-9a-fA-F]\s){5}([0-9a-fA-F][0-9a-fA-F])$/;
13909
+ var macAddressWithDots = /^([0-9a-fA-F]{4}).([0-9a-fA-F]{4}).([0-9a-fA-F]{4})$/;
13910
+
13911
+ function isMACAddress(str, options) {
13912
+ (0, _assertString.default)(str);
13913
+
13914
+ if (options && options.no_colons) {
13915
+ return macAddressNoColons.test(str);
13916
+ }
13917
+
13918
+ return macAddress.test(str) || macAddressWithHyphen.test(str) || macAddressWithSpaces.test(str) || macAddressWithDots.test(str);
13919
+ }
13920
+
13921
+ module.exports = exports.default;
13922
+ module.exports["default"] = exports.default;
13923
+
13924
+ /***/ }),
13925
+
13926
+ /***/ 6362:
13927
+ /***/ (function(module, exports, __webpack_require__) {
13928
+
13929
+ "use strict";
13930
+
13931
+
13932
+ Object.defineProperty(exports, "__esModule", ({
13933
+ value: true
13934
+ }));
13935
+ exports["default"] = isMD5;
13936
+
13937
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
13938
+
13939
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13940
+
13941
+ var md5 = /^[a-f0-9]{32}$/;
13942
+
13943
+ function isMD5(str) {
13944
+ (0, _assertString.default)(str);
13945
+ return md5.test(str);
13946
+ }
13947
+
13948
+ module.exports = exports.default;
13949
+ module.exports["default"] = exports.default;
13950
+
13951
+ /***/ }),
13952
+
13953
+ /***/ 2896:
13954
+ /***/ (function(module, exports, __webpack_require__) {
13955
+
13956
+ "use strict";
13957
+
13958
+
13959
+ Object.defineProperty(exports, "__esModule", ({
13960
+ value: true
13961
+ }));
13962
+ exports["default"] = isMagnetURI;
13963
+
13964
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
13965
+
13966
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13967
+
13968
+ var magnetURI = /^magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32,40}&dn=.+&tr=.+$/i;
13969
+
13970
+ function isMagnetURI(url) {
13971
+ (0, _assertString.default)(url);
13972
+ return magnetURI.test(url.trim());
13973
+ }
13974
+
13975
+ module.exports = exports.default;
13976
+ module.exports["default"] = exports.default;
13977
+
13978
+ /***/ }),
13979
+
13980
+ /***/ 7620:
13981
+ /***/ (function(module, exports, __webpack_require__) {
13982
+
13983
+ "use strict";
13984
+
13985
+
13986
+ Object.defineProperty(exports, "__esModule", ({
13987
+ value: true
13988
+ }));
13989
+ exports["default"] = isMimeType;
13990
+
13991
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
13992
+
13993
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13994
+
13995
+ /*
13996
+ Checks if the provided string matches to a correct Media type format (MIME type)
13997
+
13998
+ This function only checks is the string format follows the
13999
+ etablished rules by the according RFC specifications.
14000
+ This function supports 'charset' in textual media types
14001
+ (https://tools.ietf.org/html/rfc6657).
14002
+
14003
+ This function does not check against all the media types listed
14004
+ by the IANA (https://www.iana.org/assignments/media-types/media-types.xhtml)
14005
+ because of lightness purposes : it would require to include
14006
+ all these MIME types in this librairy, which would weigh it
14007
+ significantly. This kind of effort maybe is not worth for the use that
14008
+ this function has in this entire librairy.
14009
+
14010
+ More informations in the RFC specifications :
14011
+ - https://tools.ietf.org/html/rfc2045
14012
+ - https://tools.ietf.org/html/rfc2046
14013
+ - https://tools.ietf.org/html/rfc7231#section-3.1.1.1
14014
+ - https://tools.ietf.org/html/rfc7231#section-3.1.1.5
14015
+ */
14016
+ // Match simple MIME types
14017
+ // NB :
14018
+ // Subtype length must not exceed 100 characters.
14019
+ // This rule does not comply to the RFC specs (what is the max length ?).
14020
+ var mimeTypeSimple = /^(application|audio|font|image|message|model|multipart|text|video)\/[a-zA-Z0-9\.\-\+]{1,100}$/i; // eslint-disable-line max-len
14021
+ // Handle "charset" in "text/*"
14022
+
14023
+ var mimeTypeText = /^text\/[a-zA-Z0-9\.\-\+]{1,100};\s?charset=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?$/i; // eslint-disable-line max-len
14024
+ // Handle "boundary" in "multipart/*"
14025
+
14026
+ var mimeTypeMultipart = /^multipart\/[a-zA-Z0-9\.\-\+]{1,100}(;\s?(boundary|charset)=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?){0,2}$/i; // eslint-disable-line max-len
14027
+
14028
+ function isMimeType(str) {
14029
+ (0, _assertString.default)(str);
14030
+ return mimeTypeSimple.test(str) || mimeTypeText.test(str) || mimeTypeMultipart.test(str);
14031
+ }
14032
+
14033
+ module.exports = exports.default;
14034
+ module.exports["default"] = exports.default;
14035
+
14036
+ /***/ }),
14037
+
14038
+ /***/ 5119:
14039
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
14040
+
14041
+ "use strict";
14042
+
14043
+
14044
+ Object.defineProperty(exports, "__esModule", ({
14045
+ value: true
14046
+ }));
14047
+ exports["default"] = isMobilePhone;
14048
+ exports.locales = void 0;
14049
+
14050
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
14051
+
14052
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14053
+
14054
+ /* eslint-disable max-len */
14055
+ var phones = {
14056
+ 'am-AM': /^(\+?374|0)((10|[9|7][0-9])\d{6}$|[2-4]\d{7}$)/,
14057
+ 'ar-AE': /^((\+?971)|0)?5[024568]\d{7}$/,
14058
+ 'ar-BH': /^(\+?973)?(3|6)\d{7}$/,
14059
+ 'ar-DZ': /^(\+?213|0)(5|6|7)\d{8}$/,
14060
+ 'ar-LB': /^(\+?961)?((3|81)\d{6}|7\d{7})$/,
14061
+ 'ar-EG': /^((\+?20)|0)?1[0125]\d{8}$/,
14062
+ 'ar-IQ': /^(\+?964|0)?7[0-9]\d{8}$/,
14063
+ 'ar-JO': /^(\+?962|0)?7[789]\d{7}$/,
14064
+ 'ar-KW': /^(\+?965)[569]\d{7}$/,
14065
+ 'ar-LY': /^((\+?218)|0)?(9[1-6]\d{7}|[1-8]\d{7,9})$/,
14066
+ 'ar-MA': /^(?:(?:\+|00)212|0)[5-7]\d{8}$/,
14067
+ 'ar-SA': /^(!?(\+?966)|0)?5\d{8}$/,
14068
+ 'ar-SY': /^(!?(\+?963)|0)?9\d{8}$/,
14069
+ 'ar-TN': /^(\+?216)?[2459]\d{7}$/,
14070
+ 'az-AZ': /^(\+994|0)(5[015]|7[07]|99)\d{7}$/,
14071
+ 'bs-BA': /^((((\+|00)3876)|06))((([0-3]|[5-6])\d{6})|(4\d{7}))$/,
14072
+ 'be-BY': /^(\+?375)?(24|25|29|33|44)\d{7}$/,
14073
+ 'bg-BG': /^(\+?359|0)?8[789]\d{7}$/,
14074
+ 'bn-BD': /^(\+?880|0)1[13456789][0-9]{8}$/,
14075
+ 'ca-AD': /^(\+376)?[346]\d{5}$/,
14076
+ 'cs-CZ': /^(\+?420)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,
14077
+ 'da-DK': /^(\+?45)?\s?\d{2}\s?\d{2}\s?\d{2}\s?\d{2}$/,
14078
+ 'de-DE': /^(\+49)?0?[1|3]([0|5][0-45-9]\d|6([23]|0\d?)|7([0-57-9]|6\d))\d{7}$/,
14079
+ 'de-AT': /^(\+43|0)\d{1,4}\d{3,12}$/,
14080
+ 'de-CH': /^(\+41|0)(7[5-9])\d{1,7}$/,
14081
+ 'de-LU': /^(\+352)?((6\d1)\d{6})$/,
14082
+ 'el-GR': /^(\+?30|0)?(69\d{8})$/,
14083
+ 'en-AU': /^(\+?61|0)4\d{8}$/,
14084
+ 'en-GB': /^(\+?44|0)7\d{9}$/,
14085
+ 'en-GG': /^(\+?44|0)1481\d{6}$/,
14086
+ 'en-GH': /^(\+233|0)(20|50|24|54|27|57|26|56|23|28)\d{7}$/,
14087
+ 'en-HK': /^(\+?852[-\s]?)?[456789]\d{3}[-\s]?\d{4}$/,
14088
+ 'en-MO': /^(\+?853[-\s]?)?[6]\d{3}[-\s]?\d{4}$/,
14089
+ 'en-IE': /^(\+?353|0)8[356789]\d{7}$/,
14090
+ 'en-IN': /^(\+?91|0)?[6789]\d{9}$/,
14091
+ 'en-KE': /^(\+?254|0)(7|1)\d{8}$/,
14092
+ 'en-MT': /^(\+?356|0)?(99|79|77|21|27|22|25)[0-9]{6}$/,
14093
+ 'en-MU': /^(\+?230|0)?\d{8}$/,
14094
+ 'en-NG': /^(\+?234|0)?[789]\d{9}$/,
14095
+ 'en-NZ': /^(\+?64|0)[28]\d{7,9}$/,
14096
+ 'en-PK': /^((\+92)|(0092))-{0,1}\d{3}-{0,1}\d{7}$|^\d{11}$|^\d{4}-\d{7}$/,
14097
+ 'en-PH': /^(09|\+639)\d{9}$/,
14098
+ 'en-RW': /^(\+?250|0)?[7]\d{8}$/,
14099
+ 'en-SG': /^(\+65)?[689]\d{7}$/,
14100
+ 'en-SL': /^(?:0|94|\+94)?(7(0|1|2|5|6|7|8)( |-)?\d)\d{6}$/,
14101
+ 'en-TZ': /^(\+?255|0)?[67]\d{8}$/,
14102
+ 'en-UG': /^(\+?256|0)?[7]\d{8}$/,
14103
+ 'en-US': /^((\+1|1)?( |-)?)?(\([2-9][0-9]{2}\)|[2-9][0-9]{2})( |-)?([2-9][0-9]{2}( |-)?[0-9]{4})$/,
14104
+ 'en-ZA': /^(\+?27|0)\d{9}$/,
14105
+ 'en-ZM': /^(\+?26)?09[567]\d{7}$/,
14106
+ 'en-ZW': /^(\+263)[0-9]{9}$/,
14107
+ 'es-AR': /^\+?549(11|[2368]\d)\d{8}$/,
14108
+ 'es-BO': /^(\+?591)?(6|7)\d{7}$/,
14109
+ 'es-CO': /^(\+?57)?([1-8]{1}|3[0-9]{2})?[2-9]{1}\d{6}$/,
14110
+ 'es-CL': /^(\+?56|0)[2-9]\d{1}\d{7}$/,
14111
+ 'es-CR': /^(\+506)?[2-8]\d{7}$/,
14112
+ 'es-DO': /^(\+?1)?8[024]9\d{7}$/,
14113
+ 'es-HN': /^(\+?504)?[9|8]\d{7}$/,
14114
+ 'es-EC': /^(\+?593|0)([2-7]|9[2-9])\d{7}$/,
14115
+ 'es-ES': /^(\+?34)?[6|7]\d{8}$/,
14116
+ 'es-PE': /^(\+?51)?9\d{8}$/,
14117
+ 'es-MX': /^(\+?52)?(1|01)?\d{10,11}$/,
14118
+ 'es-PA': /^(\+?507)\d{7,8}$/,
14119
+ 'es-PY': /^(\+?595|0)9[9876]\d{7}$/,
14120
+ 'es-UY': /^(\+598|0)9[1-9][\d]{6}$/,
14121
+ 'et-EE': /^(\+?372)?\s?(5|8[1-4])\s?([0-9]\s?){6,7}$/,
14122
+ 'fa-IR': /^(\+?98[\-\s]?|0)9[0-39]\d[\-\s]?\d{3}[\-\s]?\d{4}$/,
14123
+ 'fi-FI': /^(\+?358|0)\s?(4(0|1|2|4|5|6)?|50)\s?(\d\s?){4,8}\d$/,
14124
+ 'fj-FJ': /^(\+?679)?\s?\d{3}\s?\d{4}$/,
14125
+ 'fo-FO': /^(\+?298)?\s?\d{2}\s?\d{2}\s?\d{2}$/,
14126
+ 'fr-FR': /^(\+?33|0)[67]\d{8}$/,
14127
+ 'fr-GF': /^(\+?594|0|00594)[67]\d{8}$/,
14128
+ 'fr-GP': /^(\+?590|0|00590)[67]\d{8}$/,
14129
+ 'fr-MQ': /^(\+?596|0|00596)[67]\d{8}$/,
14130
+ 'fr-RE': /^(\+?262|0|00262)[67]\d{8}$/,
14131
+ 'he-IL': /^(\+972|0)([23489]|5[012345689]|77)[1-9]\d{6}$/,
14132
+ 'hu-HU': /^(\+?36)(20|30|70)\d{7}$/,
14133
+ 'id-ID': /^(\+?62|0)8(1[123456789]|2[1238]|3[1238]|5[12356789]|7[78]|9[56789]|8[123456789])([\s?|\d]{5,11})$/,
14134
+ 'it-IT': /^(\+?39)?\s?3\d{2} ?\d{6,7}$/,
14135
+ 'it-SM': /^((\+378)|(0549)|(\+390549)|(\+3780549))?6\d{5,9}$/,
14136
+ 'ja-JP': /^(\+81[ \-]?(\(0\))?|0)[6789]0[ \-]?\d{4}[ \-]?\d{4}$/,
14137
+ 'ka-GE': /^(\+?995)?(5|79)\d{7}$/,
14138
+ 'kk-KZ': /^(\+?7|8)?7\d{9}$/,
14139
+ 'kl-GL': /^(\+?299)?\s?\d{2}\s?\d{2}\s?\d{2}$/,
14140
+ 'ko-KR': /^((\+?82)[ \-]?)?0?1([0|1|6|7|8|9]{1})[ \-]?\d{3,4}[ \-]?\d{4}$/,
14141
+ 'lt-LT': /^(\+370|8)\d{8}$/,
14142
+ 'ms-MY': /^(\+?6?01){1}(([0145]{1}(\-|\s)?\d{7,8})|([236789]{1}(\s|\-)?\d{7}))$/,
14143
+ 'nb-NO': /^(\+?47)?[49]\d{7}$/,
14144
+ 'ne-NP': /^(\+?977)?9[78]\d{8}$/,
14145
+ 'nl-BE': /^(\+?32|0)4?\d{8}$/,
14146
+ 'nl-NL': /^(((\+|00)?31\(0\))|((\+|00)?31)|0)6{1}\d{8}$/,
14147
+ 'nn-NO': /^(\+?47)?[49]\d{7}$/,
14148
+ 'pl-PL': /^(\+?48)? ?[5-8]\d ?\d{3} ?\d{2} ?\d{2}$/,
14149
+ 'pt-BR': /^((\+?55\ ?[1-9]{2}\ ?)|(\+?55\ ?\([1-9]{2}\)\ ?)|(0[1-9]{2}\ ?)|(\([1-9]{2}\)\ ?)|([1-9]{2}\ ?))((\d{4}\-?\d{4})|(9[2-9]{1}\d{3}\-?\d{4}))$/,
14150
+ 'pt-PT': /^(\+?351)?9[1236]\d{7}$/,
14151
+ 'ro-RO': /^(\+?4?0)\s?7\d{2}(\/|\s|\.|\-)?\d{3}(\s|\.|\-)?\d{3}$/,
14152
+ 'ru-RU': /^(\+?7|8)?9\d{9}$/,
14153
+ 'sl-SI': /^(\+386\s?|0)(\d{1}\s?\d{3}\s?\d{2}\s?\d{2}|\d{2}\s?\d{3}\s?\d{3})$/,
14154
+ 'sk-SK': /^(\+?421)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,
14155
+ 'sq-AL': /^(\+355|0)6[789]\d{6}$/,
14156
+ 'sr-RS': /^(\+3816|06)[- \d]{5,9}$/,
14157
+ 'sv-SE': /^(\+?46|0)[\s\-]?7[\s\-]?[02369]([\s\-]?\d){7}$/,
14158
+ 'th-TH': /^(\+66|66|0)\d{9}$/,
14159
+ 'tr-TR': /^(\+?90|0)?5\d{9}$/,
14160
+ 'uk-UA': /^(\+?38|8)?0\d{9}$/,
14161
+ 'uz-UZ': /^(\+?998)?(6[125-79]|7[1-69]|88|9\d)\d{7}$/,
14162
+ 'vi-VN': /^(\+?84|0)((3([2-9]))|(5([2689]))|(7([0|6-9]))|(8([1-6|89]))|(9([0-9])))([0-9]{7})$/,
14163
+ 'zh-CN': /^((\+|00)86)?1([3568][0-9]|4[579]|6[67]|7[01235678]|9[012356789])[0-9]{8}$/,
14164
+ 'zh-TW': /^(\+?886\-?|0)?9\d{8}$/
14165
+ };
14166
+ /* eslint-enable max-len */
14167
+ // aliases
14168
+
14169
+ phones['en-CA'] = phones['en-US'];
14170
+ phones['fr-CA'] = phones['en-CA'];
14171
+ phones['fr-BE'] = phones['nl-BE'];
14172
+ phones['zh-HK'] = phones['en-HK'];
14173
+ phones['zh-MO'] = phones['en-MO'];
14174
+ phones['ga-IE'] = phones['en-IE'];
14175
+
14176
+ function isMobilePhone(str, locale, options) {
14177
+ (0, _assertString.default)(str);
14178
+
14179
+ if (options && options.strictMode && !str.startsWith('+')) {
14180
+ return false;
14181
+ }
14182
+
14183
+ if (Array.isArray(locale)) {
14184
+ return locale.some(function (key) {
14185
+ // https://github.com/gotwarlost/istanbul/blob/master/ignoring-code-for-coverage.md#ignoring-code-for-coverage-purposes
14186
+ // istanbul ignore else
14187
+ if (phones.hasOwnProperty(key)) {
14188
+ var phone = phones[key];
14189
+
14190
+ if (phone.test(str)) {
14191
+ return true;
14192
+ }
14193
+ }
14194
+
14195
+ return false;
14196
+ });
14197
+ } else if (locale in phones) {
14198
+ return phones[locale].test(str); // alias falsey locale as 'any'
14199
+ } else if (!locale || locale === 'any') {
14200
+ for (var key in phones) {
14201
+ // istanbul ignore else
14202
+ if (phones.hasOwnProperty(key)) {
14203
+ var phone = phones[key];
14204
+
14205
+ if (phone.test(str)) {
14206
+ return true;
14207
+ }
14208
+ }
14209
+ }
14210
+
14211
+ return false;
14212
+ }
14213
+
14214
+ throw new Error("Invalid locale '".concat(locale, "'"));
14215
+ }
14216
+
14217
+ var locales = Object.keys(phones);
14218
+ exports.locales = locales;
14219
+
14220
+ /***/ }),
14221
+
14222
+ /***/ 4246:
14223
+ /***/ (function(module, exports, __webpack_require__) {
14224
+
14225
+ "use strict";
14226
+
14227
+
14228
+ Object.defineProperty(exports, "__esModule", ({
14229
+ value: true
14230
+ }));
14231
+ exports["default"] = isMongoId;
14232
+
14233
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
14234
+
14235
+ var _isHexadecimal = _interopRequireDefault(__webpack_require__(9985));
14236
+
14237
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14238
+
14239
+ function isMongoId(str) {
14240
+ (0, _assertString.default)(str);
14241
+ return (0, _isHexadecimal.default)(str) && str.length === 24;
14242
+ }
14243
+
14244
+ module.exports = exports.default;
14245
+ module.exports["default"] = exports.default;
14246
+
14247
+ /***/ }),
14248
+
14249
+ /***/ 3639:
14250
+ /***/ (function(module, exports, __webpack_require__) {
14251
+
14252
+ "use strict";
14253
+
14254
+
14255
+ Object.defineProperty(exports, "__esModule", ({
14256
+ value: true
14257
+ }));
14258
+ exports["default"] = isMultibyte;
14259
+
14260
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
14261
+
14262
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14263
+
14264
+ /* eslint-disable no-control-regex */
14265
+ var multibyte = /[^\x00-\x7F]/;
14266
+ /* eslint-enable no-control-regex */
14267
+
14268
+ function isMultibyte(str) {
14269
+ (0, _assertString.default)(str);
14270
+ return multibyte.test(str);
14271
+ }
14272
+
14273
+ module.exports = exports.default;
14274
+ module.exports["default"] = exports.default;
14275
+
14276
+ /***/ }),
14277
+
14278
+ /***/ 3024:
14279
+ /***/ (function(module, exports, __webpack_require__) {
14280
+
14281
+ "use strict";
14282
+
14283
+
14284
+ Object.defineProperty(exports, "__esModule", ({
14285
+ value: true
14286
+ }));
14287
+ exports["default"] = isNumeric;
14288
+
14289
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
14290
+
14291
+ var _alpha = __webpack_require__(5475);
14292
+
14293
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14294
+
14295
+ var numericNoSymbols = /^[0-9]+$/;
14296
+
14297
+ function isNumeric(str, options) {
14298
+ (0, _assertString.default)(str);
14299
+
14300
+ if (options && options.no_symbols) {
14301
+ return numericNoSymbols.test(str);
14302
+ }
14303
+
14304
+ return new RegExp("^[+-]?([0-9]*[".concat((options || {}).locale ? _alpha.decimal[options.locale] : '.', "])?[0-9]+$")).test(str);
14305
+ }
14306
+
14307
+ module.exports = exports.default;
14308
+ module.exports["default"] = exports.default;
14309
+
14310
+ /***/ }),
14311
+
14312
+ /***/ 6590:
14313
+ /***/ (function(module, exports, __webpack_require__) {
14314
+
14315
+ "use strict";
14316
+
14317
+
14318
+ Object.defineProperty(exports, "__esModule", ({
14319
+ value: true
14320
+ }));
14321
+ exports["default"] = isOctal;
14322
+
14323
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
14324
+
14325
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14326
+
14327
+ var octal = /^(0o)?[0-7]+$/i;
14328
+
14329
+ function isOctal(str) {
14330
+ (0, _assertString.default)(str);
14331
+ return octal.test(str);
14332
+ }
14333
+
14334
+ module.exports = exports.default;
14335
+ module.exports["default"] = exports.default;
14336
+
14337
+ /***/ }),
14338
+
14339
+ /***/ 2249:
14340
+ /***/ (function(module, exports, __webpack_require__) {
14341
+
14342
+ "use strict";
14343
+
14344
+
14345
+ Object.defineProperty(exports, "__esModule", ({
14346
+ value: true
14347
+ }));
14348
+ exports["default"] = isPassportNumber;
14349
+
14350
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
14351
+
14352
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14353
+
14354
+ /**
14355
+ * Reference:
14356
+ * https://en.wikipedia.org/ -- Wikipedia
14357
+ * https://docs.microsoft.com/en-us/microsoft-365/compliance/eu-passport-number -- EU Passport Number
14358
+ * https://countrycode.org/ -- Country Codes
14359
+ */
14360
+ var passportRegexByCountryCode = {
14361
+ AM: /^[A-Z]{2}\d{7}$/,
14362
+ // ARMENIA
14363
+ AR: /^[A-Z]{3}\d{6}$/,
14364
+ // ARGENTINA
14365
+ AT: /^[A-Z]\d{7}$/,
14366
+ // AUSTRIA
14367
+ AU: /^[A-Z]\d{7}$/,
14368
+ // AUSTRALIA
14369
+ BE: /^[A-Z]{2}\d{6}$/,
14370
+ // BELGIUM
14371
+ BG: /^\d{9}$/,
14372
+ // BULGARIA
14373
+ BY: /^[A-Z]{2}\d{7}$/,
14374
+ // BELARUS
14375
+ CA: /^[A-Z]{2}\d{6}$/,
14376
+ // CANADA
14377
+ CH: /^[A-Z]\d{7}$/,
14378
+ // SWITZERLAND
14379
+ CN: /^[GE]\d{8}$/,
14380
+ // CHINA [G=Ordinary, E=Electronic] followed by 8-digits
14381
+ CY: /^[A-Z](\d{6}|\d{8})$/,
14382
+ // CYPRUS
14383
+ CZ: /^\d{8}$/,
14384
+ // CZECH REPUBLIC
14385
+ DE: /^[CFGHJKLMNPRTVWXYZ0-9]{9}$/,
14386
+ // GERMANY
14387
+ DK: /^\d{9}$/,
14388
+ // DENMARK
14389
+ DZ: /^\d{9}$/,
14390
+ // ALGERIA
14391
+ EE: /^([A-Z]\d{7}|[A-Z]{2}\d{7})$/,
14392
+ // ESTONIA (K followed by 7-digits), e-passports have 2 UPPERCASE followed by 7 digits
14393
+ ES: /^[A-Z0-9]{2}([A-Z0-9]?)\d{6}$/,
14394
+ // SPAIN
14395
+ FI: /^[A-Z]{2}\d{7}$/,
14396
+ // FINLAND
14397
+ FR: /^\d{2}[A-Z]{2}\d{5}$/,
14398
+ // FRANCE
14399
+ GB: /^\d{9}$/,
14400
+ // UNITED KINGDOM
14401
+ GR: /^[A-Z]{2}\d{7}$/,
14402
+ // GREECE
14403
+ HR: /^\d{9}$/,
14404
+ // CROATIA
14405
+ HU: /^[A-Z]{2}(\d{6}|\d{7})$/,
14406
+ // HUNGARY
14407
+ IE: /^[A-Z0-9]{2}\d{7}$/,
14408
+ // IRELAND
14409
+ IN: /^[A-Z]{1}-?\d{7}$/,
14410
+ // INDIA
14411
+ IS: /^(A)\d{7}$/,
14412
+ // ICELAND
14413
+ IT: /^[A-Z0-9]{2}\d{7}$/,
14414
+ // ITALY
14415
+ JP: /^[A-Z]{2}\d{7}$/,
14416
+ // JAPAN
14417
+ KR: /^[MS]\d{8}$/,
14418
+ // SOUTH KOREA, REPUBLIC OF KOREA, [S=PS Passports, M=PM Passports]
14419
+ LT: /^[A-Z0-9]{8}$/,
14420
+ // LITHUANIA
14421
+ LU: /^[A-Z0-9]{8}$/,
14422
+ // LUXEMBURG
14423
+ LV: /^[A-Z0-9]{2}\d{7}$/,
14424
+ // LATVIA
14425
+ MT: /^\d{7}$/,
14426
+ // MALTA
14427
+ NL: /^[A-Z]{2}[A-Z0-9]{6}\d$/,
14428
+ // NETHERLANDS
14429
+ PO: /^[A-Z]{2}\d{7}$/,
14430
+ // POLAND
14431
+ PT: /^[A-Z]\d{6}$/,
14432
+ // PORTUGAL
14433
+ RO: /^\d{8,9}$/,
14434
+ // ROMANIA
14435
+ RU: /^\d{2}\d{2}\d{6}$/,
14436
+ // RUSSIAN FEDERATION
14437
+ SE: /^\d{8}$/,
14438
+ // SWEDEN
14439
+ SL: /^(P)[A-Z]\d{7}$/,
14440
+ // SLOVANIA
14441
+ SK: /^[0-9A-Z]\d{7}$/,
14442
+ // SLOVAKIA
14443
+ TR: /^[A-Z]\d{8}$/,
14444
+ // TURKEY
14445
+ UA: /^[A-Z]{2}\d{6}$/,
14446
+ // UKRAINE
14447
+ US: /^\d{9}$/ // UNITED STATES
14448
+
14449
+ };
14450
+ /**
14451
+ * Check if str is a valid passport number
14452
+ * relative to provided ISO Country Code.
14453
+ *
14454
+ * @param {string} str
14455
+ * @param {string} countryCode
14456
+ * @return {boolean}
14457
+ */
14458
+
14459
+ function isPassportNumber(str, countryCode) {
14460
+ (0, _assertString.default)(str);
14461
+ /** Remove All Whitespaces, Convert to UPPERCASE */
14462
+
14463
+ var normalizedStr = str.replace(/\s/g, '').toUpperCase();
14464
+ return countryCode.toUpperCase() in passportRegexByCountryCode && passportRegexByCountryCode[countryCode].test(normalizedStr);
14465
+ }
14466
+
14467
+ module.exports = exports.default;
14468
+ module.exports["default"] = exports.default;
14469
+
14470
+ /***/ }),
14471
+
14472
+ /***/ 7616:
14473
+ /***/ (function(module, exports, __webpack_require__) {
14474
+
14475
+ "use strict";
14476
+
14477
+
14478
+ Object.defineProperty(exports, "__esModule", ({
14479
+ value: true
14480
+ }));
14481
+ exports["default"] = isPort;
14482
+
14483
+ var _isInt = _interopRequireDefault(__webpack_require__(4503));
14484
+
14485
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14486
+
14487
+ function isPort(str) {
14488
+ return (0, _isInt.default)(str, {
14489
+ min: 0,
14490
+ max: 65535
14491
+ });
14492
+ }
14493
+
14494
+ module.exports = exports.default;
14495
+ module.exports["default"] = exports.default;
14496
+
14497
+ /***/ }),
14498
+
14499
+ /***/ 2456:
14500
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
14501
+
14502
+ "use strict";
14503
+
14504
+
14505
+ Object.defineProperty(exports, "__esModule", ({
14506
+ value: true
14507
+ }));
14508
+ exports["default"] = isPostalCode;
14509
+ exports.locales = void 0;
14510
+
14511
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
14512
+
14513
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14514
+
14515
+ // common patterns
14516
+ var threeDigit = /^\d{3}$/;
14517
+ var fourDigit = /^\d{4}$/;
14518
+ var fiveDigit = /^\d{5}$/;
14519
+ var sixDigit = /^\d{6}$/;
14520
+ var patterns = {
14521
+ AD: /^AD\d{3}$/,
14522
+ AT: fourDigit,
14523
+ AU: fourDigit,
14524
+ AZ: /^AZ\d{4}$/,
14525
+ BE: fourDigit,
14526
+ BG: fourDigit,
14527
+ BR: /^\d{5}-\d{3}$/,
14528
+ BY: /2[1-4]{1}\d{4}$/,
14529
+ CA: /^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][\s\-]?\d[ABCEGHJ-NPRSTV-Z]\d$/i,
14530
+ CH: fourDigit,
14531
+ CN: /^(0[1-7]|1[012356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[1-5]|8[1345]|9[09])\d{4}$/,
14532
+ CZ: /^\d{3}\s?\d{2}$/,
14533
+ DE: fiveDigit,
14534
+ DK: fourDigit,
14535
+ DO: fiveDigit,
14536
+ DZ: fiveDigit,
14537
+ EE: fiveDigit,
14538
+ ES: /^(5[0-2]{1}|[0-4]{1}\d{1})\d{3}$/,
14539
+ FI: fiveDigit,
14540
+ FR: /^\d{2}\s?\d{3}$/,
14541
+ GB: /^(gir\s?0aa|[a-z]{1,2}\d[\da-z]?\s?(\d[a-z]{2})?)$/i,
14542
+ GR: /^\d{3}\s?\d{2}$/,
14543
+ HR: /^([1-5]\d{4}$)/,
14544
+ HT: /^HT\d{4}$/,
14545
+ HU: fourDigit,
14546
+ ID: fiveDigit,
14547
+ IE: /^(?!.*(?:o))[A-z]\d[\dw]\s\w{4}$/i,
14548
+ IL: /^(\d{5}|\d{7})$/,
14549
+ IN: /^((?!10|29|35|54|55|65|66|86|87|88|89)[1-9][0-9]{5})$/,
14550
+ IR: /\b(?!(\d)\1{3})[13-9]{4}[1346-9][013-9]{5}\b/,
14551
+ IS: threeDigit,
14552
+ IT: fiveDigit,
14553
+ JP: /^\d{3}\-\d{4}$/,
14554
+ KE: fiveDigit,
14555
+ LI: /^(948[5-9]|949[0-7])$/,
14556
+ LT: /^LT\-\d{5}$/,
14557
+ LU: fourDigit,
14558
+ LV: /^LV\-\d{4}$/,
14559
+ MX: fiveDigit,
14560
+ MT: /^[A-Za-z]{3}\s{0,1}\d{4}$/,
14561
+ MY: fiveDigit,
14562
+ NL: /^\d{4}\s?[a-z]{2}$/i,
14563
+ NO: fourDigit,
14564
+ NP: /^(10|21|22|32|33|34|44|45|56|57)\d{3}$|^(977)$/i,
14565
+ NZ: fourDigit,
14566
+ PL: /^\d{2}\-\d{3}$/,
14567
+ PR: /^00[679]\d{2}([ -]\d{4})?$/,
14568
+ PT: /^\d{4}\-\d{3}?$/,
14569
+ RO: sixDigit,
14570
+ RU: sixDigit,
14571
+ SA: fiveDigit,
14572
+ SE: /^[1-9]\d{2}\s?\d{2}$/,
14573
+ SG: sixDigit,
14574
+ SI: fourDigit,
14575
+ SK: /^\d{3}\s?\d{2}$/,
14576
+ TH: fiveDigit,
14577
+ TN: fourDigit,
14578
+ TW: /^\d{3}(\d{2})?$/,
14579
+ UA: fiveDigit,
14580
+ US: /^\d{5}(-\d{4})?$/,
14581
+ ZA: fourDigit,
14582
+ ZM: fiveDigit
14583
+ };
14584
+ var locales = Object.keys(patterns);
14585
+ exports.locales = locales;
14586
+
14587
+ function isPostalCode(str, locale) {
14588
+ (0, _assertString.default)(str);
14589
+
14590
+ if (locale in patterns) {
14591
+ return patterns[locale].test(str);
14592
+ } else if (locale === 'any') {
14593
+ for (var key in patterns) {
14594
+ // https://github.com/gotwarlost/istanbul/blob/master/ignoring-code-for-coverage.md#ignoring-code-for-coverage-purposes
14595
+ // istanbul ignore else
14596
+ if (patterns.hasOwnProperty(key)) {
14597
+ var pattern = patterns[key];
14598
+
14599
+ if (pattern.test(str)) {
14600
+ return true;
14601
+ }
14602
+ }
14603
+ }
14604
+
14605
+ return false;
14606
+ }
14607
+
14608
+ throw new Error("Invalid locale '".concat(locale, "'"));
14609
+ }
14610
+
14611
+ /***/ }),
14612
+
14613
+ /***/ 593:
14614
+ /***/ (function(module, exports, __webpack_require__) {
14615
+
14616
+ "use strict";
14617
+
14618
+
14619
+ Object.defineProperty(exports, "__esModule", ({
14620
+ value: true
14621
+ }));
14622
+ exports["default"] = isRFC3339;
14623
+
14624
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
14625
+
14626
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14627
+
14628
+ /* Based on https://tools.ietf.org/html/rfc3339#section-5.6 */
14629
+ var dateFullYear = /[0-9]{4}/;
14630
+ var dateMonth = /(0[1-9]|1[0-2])/;
14631
+ var dateMDay = /([12]\d|0[1-9]|3[01])/;
14632
+ var timeHour = /([01][0-9]|2[0-3])/;
14633
+ var timeMinute = /[0-5][0-9]/;
14634
+ var timeSecond = /([0-5][0-9]|60)/;
14635
+ var timeSecFrac = /(\.[0-9]+)?/;
14636
+ var timeNumOffset = new RegExp("[-+]".concat(timeHour.source, ":").concat(timeMinute.source));
14637
+ var timeOffset = new RegExp("([zZ]|".concat(timeNumOffset.source, ")"));
14638
+ var partialTime = new RegExp("".concat(timeHour.source, ":").concat(timeMinute.source, ":").concat(timeSecond.source).concat(timeSecFrac.source));
14639
+ var fullDate = new RegExp("".concat(dateFullYear.source, "-").concat(dateMonth.source, "-").concat(dateMDay.source));
14640
+ var fullTime = new RegExp("".concat(partialTime.source).concat(timeOffset.source));
14641
+ var rfc3339 = new RegExp("".concat(fullDate.source, "[ tT]").concat(fullTime.source));
14642
+
14643
+ function isRFC3339(str) {
14644
+ (0, _assertString.default)(str);
14645
+ return rfc3339.test(str);
14646
+ }
14647
+
14648
+ module.exports = exports.default;
14649
+ module.exports["default"] = exports.default;
14650
+
14651
+ /***/ }),
14652
+
14653
+ /***/ 8270:
14654
+ /***/ (function(module, exports, __webpack_require__) {
14655
+
14656
+ "use strict";
14657
+
14658
+
14659
+ Object.defineProperty(exports, "__esModule", ({
14660
+ value: true
14661
+ }));
14662
+ exports["default"] = isRgbColor;
14663
+
14664
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
14665
+
14666
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14667
+
14668
+ var rgbColor = /^rgb\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){2}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\)$/;
14669
+ var rgbaColor = /^rgba\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){3}(0?\.\d|1(\.0)?|0(\.0)?)\)$/;
14670
+ var rgbColorPercent = /^rgb\((([0-9]%|[1-9][0-9]%|100%),){2}([0-9]%|[1-9][0-9]%|100%)\)/;
14671
+ var rgbaColorPercent = /^rgba\((([0-9]%|[1-9][0-9]%|100%),){3}(0?\.\d|1(\.0)?|0(\.0)?)\)/;
14672
+
14673
+ function isRgbColor(str) {
14674
+ var includePercentValues = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
14675
+ (0, _assertString.default)(str);
14676
+
14677
+ if (!includePercentValues) {
14678
+ return rgbColor.test(str) || rgbaColor.test(str);
14679
+ }
14680
+
14681
+ return rgbColor.test(str) || rgbaColor.test(str) || rgbColorPercent.test(str) || rgbaColorPercent.test(str);
14682
+ }
14683
+
14684
+ module.exports = exports.default;
14685
+ module.exports["default"] = exports.default;
14686
+
14687
+ /***/ }),
14688
+
14689
+ /***/ 2868:
14690
+ /***/ (function(module, exports, __webpack_require__) {
14691
+
14692
+ "use strict";
14693
+
14694
+
14695
+ Object.defineProperty(exports, "__esModule", ({
14696
+ value: true
14697
+ }));
14698
+ exports["default"] = isSemVer;
14699
+
14700
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
14701
+
14702
+ var _multilineRegex = _interopRequireDefault(__webpack_require__(8041));
14703
+
14704
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14705
+
14706
+ /**
14707
+ * Regular Expression to match
14708
+ * semantic versioning (SemVer)
14709
+ * built from multi-line, multi-parts regexp
14710
+ * Reference: https://semver.org/
14711
+ */
14712
+ var semanticVersioningRegex = (0, _multilineRegex.default)(['^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)', '(?:-((?:0|[1-9]\\d*|\\d*[a-z-][0-9a-z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-z-][0-9a-z-]*))*))', '?(?:\\+([0-9a-z-]+(?:\\.[0-9a-z-]+)*))?$'], 'i');
14713
+
14714
+ function isSemVer(str) {
14715
+ (0, _assertString.default)(str);
14716
+ return semanticVersioningRegex.test(str);
14717
+ }
14718
+
14719
+ module.exports = exports.default;
14720
+ module.exports["default"] = exports.default;
14721
+
14722
+ /***/ }),
14723
+
14724
+ /***/ 4189:
14725
+ /***/ (function(module, exports, __webpack_require__) {
14726
+
14727
+ "use strict";
14728
+
14729
+
14730
+ Object.defineProperty(exports, "__esModule", ({
14731
+ value: true
14732
+ }));
14733
+ exports["default"] = isSlug;
14734
+
14735
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
14736
+
14737
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14738
+
14739
+ var charsetRegex = /^[^\s-_](?!.*?[-_]{2,})([a-z0-9-\\]{1,})[^\s]*[^-_\s]$/;
14740
+
14741
+ function isSlug(str) {
14742
+ (0, _assertString.default)(str);
14743
+ return charsetRegex.test(str);
14744
+ }
14745
+
14746
+ module.exports = exports.default;
14747
+ module.exports["default"] = exports.default;
14748
+
14749
+ /***/ }),
14750
+
14751
+ /***/ 2487:
14752
+ /***/ (function(module, exports, __webpack_require__) {
14753
+
14754
+ "use strict";
14755
+
14756
+
14757
+ Object.defineProperty(exports, "__esModule", ({
14758
+ value: true
14759
+ }));
14760
+ exports["default"] = isStrongPassword;
14761
+
14762
+ var _merge = _interopRequireDefault(__webpack_require__(1778));
14763
+
14764
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
14765
+
14766
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14767
+
14768
+ var upperCaseRegex = /^[A-Z]$/;
14769
+ var lowerCaseRegex = /^[a-z]$/;
14770
+ var numberRegex = /^[0-9]$/;
14771
+ var symbolRegex = /^[-#!$%^&*()_+|~=`{}\[\]:";'<>?,.\/ ]$/;
14772
+ var defaultOptions = {
14773
+ minLength: 8,
14774
+ minLowercase: 1,
14775
+ minUppercase: 1,
14776
+ minNumbers: 1,
14777
+ minSymbols: 1,
14778
+ returnScore: false,
14779
+ pointsPerUnique: 1,
14780
+ pointsPerRepeat: 0.5,
14781
+ pointsForContainingLower: 10,
14782
+ pointsForContainingUpper: 10,
14783
+ pointsForContainingNumber: 10,
14784
+ pointsForContainingSymbol: 10
14785
+ };
14786
+ /* Counts number of occurrences of each char in a string
14787
+ * could be moved to util/ ?
14788
+ */
14789
+
14790
+ function countChars(str) {
14791
+ var result = {};
14792
+ Array.from(str).forEach(function (char) {
14793
+ var curVal = result[char];
14794
+
14795
+ if (curVal) {
14796
+ result[char] += 1;
14797
+ } else {
14798
+ result[char] = 1;
14799
+ }
14800
+ });
14801
+ return result;
14802
+ }
14803
+ /* Return information about a password */
14804
+
14805
+
14806
+ function analyzePassword(password) {
14807
+ var charMap = countChars(password);
14808
+ var analysis = {
14809
+ length: password.length,
14810
+ uniqueChars: Object.keys(charMap).length,
14811
+ uppercaseCount: 0,
14812
+ lowercaseCount: 0,
14813
+ numberCount: 0,
14814
+ symbolCount: 0
14815
+ };
14816
+ Object.keys(charMap).forEach(function (char) {
14817
+ if (upperCaseRegex.test(char)) {
14818
+ analysis.uppercaseCount += charMap[char];
14819
+ } else if (lowerCaseRegex.test(char)) {
14820
+ analysis.lowercaseCount += charMap[char];
14821
+ } else if (numberRegex.test(char)) {
14822
+ analysis.numberCount += charMap[char];
14823
+ } else if (symbolRegex.test(char)) {
14824
+ analysis.symbolCount += charMap[char];
14825
+ }
14826
+ });
14827
+ return analysis;
14828
+ }
14829
+
14830
+ function scorePassword(analysis, scoringOptions) {
14831
+ var points = 0;
14832
+ points += analysis.uniqueChars * scoringOptions.pointsPerUnique;
14833
+ points += (analysis.length - analysis.uniqueChars) * scoringOptions.pointsPerRepeat;
14834
+
14835
+ if (analysis.lowercaseCount > 0) {
14836
+ points += scoringOptions.pointsForContainingLower;
14837
+ }
14838
+
14839
+ if (analysis.uppercaseCount > 0) {
14840
+ points += scoringOptions.pointsForContainingUpper;
14841
+ }
14842
+
14843
+ if (analysis.numberCount > 0) {
14844
+ points += scoringOptions.pointsForContainingNumber;
14845
+ }
14846
+
14847
+ if (analysis.symbolCount > 0) {
14848
+ points += scoringOptions.pointsForContainingSymbol;
14849
+ }
14850
+
14851
+ return points;
14852
+ }
14853
+
14854
+ function isStrongPassword(str) {
14855
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
14856
+ (0, _assertString.default)(str);
14857
+ var analysis = analyzePassword(str);
14858
+ options = (0, _merge.default)(options || {}, defaultOptions);
14859
+
14860
+ if (options.returnScore) {
14861
+ return scorePassword(analysis, options);
14862
+ }
14863
+
14864
+ return analysis.length >= options.minLength && analysis.lowercaseCount >= options.minLowercase && analysis.uppercaseCount >= options.minUppercase && analysis.numberCount >= options.minNumbers && analysis.symbolCount >= options.minSymbols;
14865
+ }
14866
+
14867
+ module.exports = exports.default;
14868
+ module.exports["default"] = exports.default;
14869
+
14870
+ /***/ }),
14871
+
14872
+ /***/ 8868:
14873
+ /***/ (function(module, exports, __webpack_require__) {
14874
+
14875
+ "use strict";
14876
+
14877
+
14878
+ Object.defineProperty(exports, "__esModule", ({
14879
+ value: true
14880
+ }));
14881
+ exports["default"] = isSurrogatePair;
14882
+
14883
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
14884
+
14885
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14886
+
14887
+ var surrogatePair = /[\uD800-\uDBFF][\uDC00-\uDFFF]/;
14888
+
14889
+ function isSurrogatePair(str) {
14890
+ (0, _assertString.default)(str);
14891
+ return surrogatePair.test(str);
14892
+ }
14893
+
14894
+ module.exports = exports.default;
14895
+ module.exports["default"] = exports.default;
14896
+
14897
+ /***/ }),
14898
+
14899
+ /***/ 6693:
14900
+ /***/ (function(module, exports, __webpack_require__) {
14901
+
14902
+ "use strict";
14903
+
14904
+
14905
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
14906
+
14907
+ Object.defineProperty(exports, "__esModule", ({
14908
+ value: true
14909
+ }));
14910
+ exports["default"] = isTaxID;
14911
+
14912
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
14913
+
14914
+ var algorithms = _interopRequireWildcard(__webpack_require__(257));
14915
+
14916
+ var _isDate = _interopRequireDefault(__webpack_require__(7869));
14917
+
14918
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
14919
+
14920
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
14921
+
14922
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14923
+
14924
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
14925
+
14926
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
14927
+
14928
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
14929
+
14930
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
14931
+
14932
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
14933
+
14934
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
14935
+
14936
+ /**
14937
+ * TIN Validation
14938
+ * Validates Tax Identification Numbers (TINs) from the US, EU member states and the United Kingdom.
14939
+ *
14940
+ * EU-UK:
14941
+ * National TIN validity is calculated using public algorithms as made available by DG TAXUD.
14942
+ *
14943
+ * See `https://ec.europa.eu/taxation_customs/tin/specs/FS-TIN%20Algorithms-Public.docx` for more information.
14944
+ *
14945
+ * US:
14946
+ * An Employer Identification Number (EIN), also known as a Federal Tax Identification Number,
14947
+ * is used to identify a business entity.
14948
+ *
14949
+ * NOTES:
14950
+ * - Prefix 47 is being reserved for future use
14951
+ * - Prefixes 26, 27, 45, 46 and 47 were previously assigned by the Philadelphia campus.
14952
+ *
14953
+ * See `http://www.irs.gov/Businesses/Small-Businesses-&-Self-Employed/How-EINs-are-Assigned-and-Valid-EIN-Prefixes`
14954
+ * for more information.
14955
+ */
14956
+ // Locale functions
14957
+
14958
+ /*
14959
+ * bg-BG validation function
14960
+ * (Edinen graždanski nomer (EGN/ЕГН), persons only)
14961
+ * Checks if birth date (first six digits) is valid and calculates check (last) digit
14962
+ */
14963
+ function bgBgCheck(tin) {
14964
+ // Extract full year, normalize month and check birth date validity
14965
+ var century_year = tin.slice(0, 2);
14966
+ var month = parseInt(tin.slice(2, 4), 10);
14967
+
14968
+ if (month > 40) {
14969
+ month -= 40;
14970
+ century_year = "20".concat(century_year);
14971
+ } else if (month > 20) {
14972
+ month -= 20;
14973
+ century_year = "18".concat(century_year);
14974
+ } else {
14975
+ century_year = "19".concat(century_year);
14976
+ }
14977
+
14978
+ if (month < 10) {
14979
+ month = "0".concat(month);
14980
+ }
14981
+
14982
+ var date = "".concat(century_year, "/").concat(month, "/").concat(tin.slice(4, 6));
14983
+
14984
+ if (!(0, _isDate.default)(date, 'YYYY/MM/DD')) {
14985
+ return false;
14986
+ } // split digits into an array for further processing
14987
+
14988
+
14989
+ var digits = tin.split('').map(function (a) {
14990
+ return parseInt(a, 10);
14991
+ }); // Calculate checksum by multiplying digits with fixed values
14992
+
14993
+ var multip_lookup = [2, 4, 8, 5, 10, 9, 7, 3, 6];
14994
+ var checksum = 0;
14995
+
14996
+ for (var i = 0; i < multip_lookup.length; i++) {
14997
+ checksum += digits[i] * multip_lookup[i];
14998
+ }
14999
+
15000
+ checksum = checksum % 11 === 10 ? 0 : checksum % 11;
15001
+ return checksum === digits[9];
15002
+ }
15003
+ /*
15004
+ * cs-CZ validation function
15005
+ * (Rodné číslo (RČ), persons only)
15006
+ * Checks if birth date (first six digits) is valid and divisibility by 11
15007
+ * Material not in DG TAXUD document sourced from:
15008
+ * -`https://lorenc.info/3MA381/overeni-spravnosti-rodneho-cisla.htm`
15009
+ * -`https://www.mvcr.cz/clanek/rady-a-sluzby-dokumenty-rodne-cislo.aspx`
15010
+ */
15011
+
15012
+
15013
+ function csCzCheck(tin) {
15014
+ tin = tin.replace(/\W/, ''); // Extract full year from TIN length
15015
+
15016
+ var full_year = parseInt(tin.slice(0, 2), 10);
15017
+
15018
+ if (tin.length === 10) {
15019
+ if (full_year < 54) {
15020
+ full_year = "20".concat(full_year);
15021
+ } else {
15022
+ full_year = "19".concat(full_year);
15023
+ }
15024
+ } else {
15025
+ if (tin.slice(6) === '000') {
15026
+ return false;
15027
+ } // Three-zero serial not assigned before 1954
15028
+
15029
+
15030
+ if (full_year < 54) {
15031
+ full_year = "19".concat(full_year);
15032
+ } else {
15033
+ return false; // No 18XX years seen in any of the resources
15034
+ }
15035
+ } // Add missing zero if needed
15036
+
15037
+
15038
+ if (full_year.length === 3) {
15039
+ full_year = [full_year.slice(0, 2), '0', full_year.slice(2)].join('');
15040
+ } // Extract month from TIN and normalize
15041
+
15042
+
15043
+ var month = parseInt(tin.slice(2, 4), 10);
15044
+
15045
+ if (month > 50) {
15046
+ month -= 50;
15047
+ }
15048
+
15049
+ if (month > 20) {
15050
+ // Month-plus-twenty was only introduced in 2004
15051
+ if (parseInt(full_year, 10) < 2004) {
15052
+ return false;
15053
+ }
15054
+
15055
+ month -= 20;
15056
+ }
15057
+
15058
+ if (month < 10) {
15059
+ month = "0".concat(month);
15060
+ } // Check date validity
15061
+
15062
+
15063
+ var date = "".concat(full_year, "/").concat(month, "/").concat(tin.slice(4, 6));
15064
+
15065
+ if (!(0, _isDate.default)(date, 'YYYY/MM/DD')) {
15066
+ return false;
15067
+ } // Verify divisibility by 11
15068
+
15069
+
15070
+ if (tin.length === 10) {
15071
+ if (parseInt(tin, 10) % 11 !== 0) {
15072
+ // Some numbers up to and including 1985 are still valid if
15073
+ // check (last) digit equals 0 and modulo of first 9 digits equals 10
15074
+ var checkdigit = parseInt(tin.slice(0, 9), 10) % 11;
15075
+
15076
+ if (parseInt(full_year, 10) < 1986 && checkdigit === 10) {
15077
+ if (parseInt(tin.slice(9), 10) !== 0) {
15078
+ return false;
15079
+ }
15080
+ } else {
15081
+ return false;
15082
+ }
15083
+ }
15084
+ }
15085
+
15086
+ return true;
15087
+ }
15088
+ /*
15089
+ * de-AT validation function
15090
+ * (Abgabenkontonummer, persons/entities)
15091
+ * Verify TIN validity by calling luhnCheck()
15092
+ */
15093
+
15094
+
15095
+ function deAtCheck(tin) {
15096
+ return algorithms.luhnCheck(tin);
15097
+ }
15098
+ /*
15099
+ * de-DE validation function
15100
+ * (Steueridentifikationsnummer (Steuer-IdNr.), persons only)
15101
+ * Tests for single duplicate/triplicate value, then calculates ISO 7064 check (last) digit
15102
+ * Partial implementation of spec (same result with both algorithms always)
15103
+ */
15104
+
15105
+
15106
+ function deDeCheck(tin) {
15107
+ // Split digits into an array for further processing
15108
+ var digits = tin.split('').map(function (a) {
15109
+ return parseInt(a, 10);
15110
+ }); // Fill array with strings of number positions
15111
+
15112
+ var occurences = [];
15113
+
15114
+ for (var i = 0; i < digits.length - 1; i++) {
15115
+ occurences.push('');
15116
+
15117
+ for (var j = 0; j < digits.length - 1; j++) {
15118
+ if (digits[i] === digits[j]) {
15119
+ occurences[i] += j;
15120
+ }
15121
+ }
15122
+ } // Remove digits with one occurence and test for only one duplicate/triplicate
15123
+
15124
+
15125
+ occurences = occurences.filter(function (a) {
15126
+ return a.length > 1;
15127
+ });
15128
+
15129
+ if (occurences.length !== 2 && occurences.length !== 3) {
15130
+ return false;
15131
+ } // In case of triplicate value only two digits are allowed next to each other
15132
+
15133
+
15134
+ if (occurences[0].length === 3) {
15135
+ var trip_locations = occurences[0].split('').map(function (a) {
15136
+ return parseInt(a, 10);
15137
+ });
15138
+ var recurrent = 0; // Amount of neighbour occurences
15139
+
15140
+ for (var _i = 0; _i < trip_locations.length - 1; _i++) {
15141
+ if (trip_locations[_i] + 1 === trip_locations[_i + 1]) {
15142
+ recurrent += 1;
15143
+ }
15144
+ }
15145
+
15146
+ if (recurrent === 2) {
15147
+ return false;
15148
+ }
15149
+ }
15150
+
15151
+ return algorithms.iso7064Check(tin);
15152
+ }
15153
+ /*
15154
+ * dk-DK validation function
15155
+ * (CPR-nummer (personnummer), persons only)
15156
+ * Checks if birth date (first six digits) is valid and assigned to century (seventh) digit,
15157
+ * and calculates check (last) digit
15158
+ */
15159
+
15160
+
15161
+ function dkDkCheck(tin) {
15162
+ tin = tin.replace(/\W/, ''); // Extract year, check if valid for given century digit and add century
15163
+
15164
+ var year = parseInt(tin.slice(4, 6), 10);
15165
+ var century_digit = tin.slice(6, 7);
15166
+
15167
+ switch (century_digit) {
15168
+ case '0':
15169
+ case '1':
15170
+ case '2':
15171
+ case '3':
15172
+ year = "19".concat(year);
15173
+ break;
15174
+
15175
+ case '4':
15176
+ case '9':
15177
+ if (year < 37) {
15178
+ year = "20".concat(year);
15179
+ } else {
15180
+ year = "19".concat(year);
15181
+ }
15182
+
15183
+ break;
15184
+
15185
+ default:
15186
+ if (year < 37) {
15187
+ year = "20".concat(year);
15188
+ } else if (year > 58) {
15189
+ year = "18".concat(year);
15190
+ } else {
15191
+ return false;
15192
+ }
15193
+
15194
+ break;
15195
+ } // Add missing zero if needed
15196
+
15197
+
15198
+ if (year.length === 3) {
15199
+ year = [year.slice(0, 2), '0', year.slice(2)].join('');
15200
+ } // Check date validity
15201
+
15202
+
15203
+ var date = "".concat(year, "/").concat(tin.slice(2, 4), "/").concat(tin.slice(0, 2));
15204
+
15205
+ if (!(0, _isDate.default)(date, 'YYYY/MM/DD')) {
15206
+ return false;
15207
+ } // Split digits into an array for further processing
15208
+
15209
+
15210
+ var digits = tin.split('').map(function (a) {
15211
+ return parseInt(a, 10);
15212
+ });
15213
+ var checksum = 0;
15214
+ var weight = 4; // Multiply by weight and add to checksum
15215
+
15216
+ for (var i = 0; i < 9; i++) {
15217
+ checksum += digits[i] * weight;
15218
+ weight -= 1;
15219
+
15220
+ if (weight === 1) {
15221
+ weight = 7;
15222
+ }
15223
+ }
15224
+
15225
+ checksum %= 11;
15226
+
15227
+ if (checksum === 1) {
15228
+ return false;
15229
+ }
15230
+
15231
+ return checksum === 0 ? digits[9] === 0 : digits[9] === 11 - checksum;
15232
+ }
15233
+ /*
15234
+ * el-CY validation function
15235
+ * (Arithmos Forologikou Mitroou (AFM/ΑΦΜ), persons only)
15236
+ * Verify TIN validity by calculating ASCII value of check (last) character
15237
+ */
15238
+
15239
+
15240
+ function elCyCheck(tin) {
15241
+ // split digits into an array for further processing
15242
+ var digits = tin.slice(0, 8).split('').map(function (a) {
15243
+ return parseInt(a, 10);
15244
+ });
15245
+ var checksum = 0; // add digits in even places
15246
+
15247
+ for (var i = 1; i < digits.length; i += 2) {
15248
+ checksum += digits[i];
15249
+ } // add digits in odd places
15250
+
15251
+
15252
+ for (var _i2 = 0; _i2 < digits.length; _i2 += 2) {
15253
+ if (digits[_i2] < 2) {
15254
+ checksum += 1 - digits[_i2];
15255
+ } else {
15256
+ checksum += 2 * (digits[_i2] - 2) + 5;
15257
+
15258
+ if (digits[_i2] > 4) {
15259
+ checksum += 2;
15260
+ }
15261
+ }
15262
+ }
15263
+
15264
+ return String.fromCharCode(checksum % 26 + 65) === tin.charAt(8);
15265
+ }
15266
+ /*
15267
+ * el-GR validation function
15268
+ * (Arithmos Forologikou Mitroou (AFM/ΑΦΜ), persons/entities)
15269
+ * Verify TIN validity by calculating check (last) digit
15270
+ * Algorithm not in DG TAXUD document- sourced from:
15271
+ * - `http://epixeirisi.gr/%CE%9A%CE%A1%CE%99%CE%A3%CE%99%CE%9C%CE%91-%CE%98%CE%95%CE%9C%CE%91%CE%A4%CE%91-%CE%A6%CE%9F%CE%A1%CE%9F%CE%9B%CE%9F%CE%93%CE%99%CE%91%CE%A3-%CE%9A%CE%91%CE%99-%CE%9B%CE%9F%CE%93%CE%99%CE%A3%CE%A4%CE%99%CE%9A%CE%97%CE%A3/23791/%CE%91%CF%81%CE%B9%CE%B8%CE%BC%CF%8C%CF%82-%CE%A6%CE%BF%CF%81%CE%BF%CE%BB%CE%BF%CE%B3%CE%B9%CE%BA%CE%BF%CF%8D-%CE%9C%CE%B7%CF%84%CF%81%CF%8E%CE%BF%CF%85`
15272
+ */
15273
+
15274
+
15275
+ function elGrCheck(tin) {
15276
+ // split digits into an array for further processing
15277
+ var digits = tin.split('').map(function (a) {
15278
+ return parseInt(a, 10);
15279
+ });
15280
+ var checksum = 0;
15281
+
15282
+ for (var i = 0; i < 8; i++) {
15283
+ checksum += digits[i] * Math.pow(2, 8 - i);
15284
+ }
15285
+
15286
+ return checksum % 11 === digits[8];
15287
+ }
15288
+ /*
15289
+ * en-GB validation function (should go here if needed)
15290
+ * (National Insurance Number (NINO) or Unique Taxpayer Reference (UTR),
15291
+ * persons/entities respectively)
15292
+ */
15293
+
15294
+ /*
15295
+ * en-IE validation function
15296
+ * (Personal Public Service Number (PPS No), persons only)
15297
+ * Verify TIN validity by calculating check (second to last) character
15298
+ */
15299
+
15300
+
15301
+ function enIeCheck(tin) {
15302
+ var checksum = algorithms.reverseMultiplyAndSum(tin.split('').slice(0, 7).map(function (a) {
15303
+ return parseInt(a, 10);
15304
+ }), 8);
15305
+
15306
+ if (tin.length === 9 && tin[8] !== 'W') {
15307
+ checksum += (tin[8].charCodeAt(0) - 64) * 9;
15308
+ }
15309
+
15310
+ checksum %= 23;
15311
+
15312
+ if (checksum === 0) {
15313
+ return tin[7].toUpperCase() === 'W';
15314
+ }
15315
+
15316
+ return tin[7].toUpperCase() === String.fromCharCode(64 + checksum);
15317
+ } // Valid US IRS campus prefixes
15318
+
15319
+
15320
+ var enUsCampusPrefix = {
15321
+ andover: ['10', '12'],
15322
+ atlanta: ['60', '67'],
15323
+ austin: ['50', '53'],
15324
+ brookhaven: ['01', '02', '03', '04', '05', '06', '11', '13', '14', '16', '21', '22', '23', '25', '34', '51', '52', '54', '55', '56', '57', '58', '59', '65'],
15325
+ cincinnati: ['30', '32', '35', '36', '37', '38', '61'],
15326
+ fresno: ['15', '24'],
15327
+ internet: ['20', '26', '27', '45', '46', '47'],
15328
+ kansas: ['40', '44'],
15329
+ memphis: ['94', '95'],
15330
+ ogden: ['80', '90'],
15331
+ philadelphia: ['33', '39', '41', '42', '43', '46', '48', '62', '63', '64', '66', '68', '71', '72', '73', '74', '75', '76', '77', '81', '82', '83', '84', '85', '86', '87', '88', '91', '92', '93', '98', '99'],
15332
+ sba: ['31']
15333
+ }; // Return an array of all US IRS campus prefixes
15334
+
15335
+ function enUsGetPrefixes() {
15336
+ var prefixes = [];
15337
+
15338
+ for (var location in enUsCampusPrefix) {
15339
+ // https://github.com/gotwarlost/istanbul/blob/master/ignoring-code-for-coverage.md#ignoring-code-for-coverage-purposes
15340
+ // istanbul ignore else
15341
+ if (enUsCampusPrefix.hasOwnProperty(location)) {
15342
+ prefixes.push.apply(prefixes, _toConsumableArray(enUsCampusPrefix[location]));
15343
+ }
15344
+ }
15345
+
15346
+ return prefixes;
15347
+ }
15348
+ /*
15349
+ * en-US validation function
15350
+ * Verify that the TIN starts with a valid IRS campus prefix
15351
+ */
15352
+
15353
+
15354
+ function enUsCheck(tin) {
15355
+ return enUsGetPrefixes().indexOf(tin.substr(0, 2)) !== -1;
15356
+ }
15357
+ /*
15358
+ * es-ES validation function
15359
+ * (Documento Nacional de Identidad (DNI)
15360
+ * or Número de Identificación de Extranjero (NIE), persons only)
15361
+ * Verify TIN validity by calculating check (last) character
15362
+ */
15363
+
15364
+
15365
+ function esEsCheck(tin) {
15366
+ // Split characters into an array for further processing
15367
+ var chars = tin.toUpperCase().split(''); // Replace initial letter if needed
15368
+
15369
+ if (isNaN(parseInt(chars[0], 10)) && chars.length > 1) {
15370
+ var lead_replace = 0;
15371
+
15372
+ switch (chars[0]) {
15373
+ case 'Y':
15374
+ lead_replace = 1;
15375
+ break;
15376
+
15377
+ case 'Z':
15378
+ lead_replace = 2;
15379
+ break;
15380
+
15381
+ default:
15382
+ }
15383
+
15384
+ chars.splice(0, 1, lead_replace); // Fill with zeros if smaller than proper
15385
+ } else {
15386
+ while (chars.length < 9) {
15387
+ chars.unshift(0);
15388
+ }
15389
+ } // Calculate checksum and check according to lookup
15390
+
15391
+
15392
+ var lookup = ['T', 'R', 'W', 'A', 'G', 'M', 'Y', 'F', 'P', 'D', 'X', 'B', 'N', 'J', 'Z', 'S', 'Q', 'V', 'H', 'L', 'C', 'K', 'E'];
15393
+ chars = chars.join('');
15394
+ var checksum = parseInt(chars.slice(0, 8), 10) % 23;
15395
+ return chars[8] === lookup[checksum];
15396
+ }
15397
+ /*
15398
+ * et-EE validation function
15399
+ * (Isikukood (IK), persons only)
15400
+ * Checks if birth date (century digit and six following) is valid and calculates check (last) digit
15401
+ * Material not in DG TAXUD document sourced from:
15402
+ * - `https://www.oecd.org/tax/automatic-exchange/crs-implementation-and-assistance/tax-identification-numbers/Estonia-TIN.pdf`
15403
+ */
15404
+
15405
+
15406
+ function etEeCheck(tin) {
15407
+ // Extract year and add century
15408
+ var full_year = tin.slice(1, 3);
15409
+ var century_digit = tin.slice(0, 1);
15410
+
15411
+ switch (century_digit) {
15412
+ case '1':
15413
+ case '2':
15414
+ full_year = "18".concat(full_year);
15415
+ break;
15416
+
15417
+ case '3':
15418
+ case '4':
15419
+ full_year = "19".concat(full_year);
15420
+ break;
15421
+
15422
+ default:
15423
+ full_year = "20".concat(full_year);
15424
+ break;
15425
+ } // Check date validity
15426
+
15427
+
15428
+ var date = "".concat(full_year, "/").concat(tin.slice(3, 5), "/").concat(tin.slice(5, 7));
15429
+
15430
+ if (!(0, _isDate.default)(date, 'YYYY/MM/DD')) {
15431
+ return false;
15432
+ } // Split digits into an array for further processing
15433
+
15434
+
15435
+ var digits = tin.split('').map(function (a) {
15436
+ return parseInt(a, 10);
15437
+ });
15438
+ var checksum = 0;
15439
+ var weight = 1; // Multiply by weight and add to checksum
15440
+
15441
+ for (var i = 0; i < 10; i++) {
15442
+ checksum += digits[i] * weight;
15443
+ weight += 1;
15444
+
15445
+ if (weight === 10) {
15446
+ weight = 1;
15447
+ }
15448
+ } // Do again if modulo 11 of checksum is 10
15449
+
15450
+
15451
+ if (checksum % 11 === 10) {
15452
+ checksum = 0;
15453
+ weight = 3;
15454
+
15455
+ for (var _i3 = 0; _i3 < 10; _i3++) {
15456
+ checksum += digits[_i3] * weight;
15457
+ weight += 1;
15458
+
15459
+ if (weight === 10) {
15460
+ weight = 1;
15461
+ }
15462
+ }
15463
+
15464
+ if (checksum % 11 === 10) {
15465
+ return digits[10] === 0;
15466
+ }
15467
+ }
15468
+
15469
+ return checksum % 11 === digits[10];
15470
+ }
15471
+ /*
15472
+ * fi-FI validation function
15473
+ * (Henkilötunnus (HETU), persons only)
15474
+ * Checks if birth date (first six digits plus century symbol) is valid
15475
+ * and calculates check (last) digit
15476
+ */
15477
+
15478
+
15479
+ function fiFiCheck(tin) {
15480
+ // Extract year and add century
15481
+ var full_year = tin.slice(4, 6);
15482
+ var century_symbol = tin.slice(6, 7);
15483
+
15484
+ switch (century_symbol) {
15485
+ case '+':
15486
+ full_year = "18".concat(full_year);
15487
+ break;
15488
+
15489
+ case '-':
15490
+ full_year = "19".concat(full_year);
15491
+ break;
15492
+
15493
+ default:
15494
+ full_year = "20".concat(full_year);
15495
+ break;
15496
+ } // Check date validity
15497
+
15498
+
15499
+ var date = "".concat(full_year, "/").concat(tin.slice(2, 4), "/").concat(tin.slice(0, 2));
15500
+
15501
+ if (!(0, _isDate.default)(date, 'YYYY/MM/DD')) {
15502
+ return false;
15503
+ } // Calculate check character
15504
+
15505
+
15506
+ var checksum = parseInt(tin.slice(0, 6) + tin.slice(7, 10), 10) % 31;
15507
+
15508
+ if (checksum < 10) {
15509
+ return checksum === parseInt(tin.slice(10), 10);
15510
+ }
15511
+
15512
+ checksum -= 10;
15513
+ var letters_lookup = ['A', 'B', 'C', 'D', 'E', 'F', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y'];
15514
+ return letters_lookup[checksum] === tin.slice(10);
15515
+ }
15516
+ /*
15517
+ * fr/nl-BE validation function
15518
+ * (Numéro national (N.N.), persons only)
15519
+ * Checks if birth date (first six digits) is valid and calculates check (last two) digits
15520
+ */
15521
+
15522
+
15523
+ function frBeCheck(tin) {
15524
+ // Zero month/day value is acceptable
15525
+ if (tin.slice(2, 4) !== '00' || tin.slice(4, 6) !== '00') {
15526
+ // Extract date from first six digits of TIN
15527
+ var date = "".concat(tin.slice(0, 2), "/").concat(tin.slice(2, 4), "/").concat(tin.slice(4, 6));
15528
+
15529
+ if (!(0, _isDate.default)(date, 'YY/MM/DD')) {
15530
+ return false;
15531
+ }
15532
+ }
15533
+
15534
+ var checksum = 97 - parseInt(tin.slice(0, 9), 10) % 97;
15535
+ var checkdigits = parseInt(tin.slice(9, 11), 10);
15536
+
15537
+ if (checksum !== checkdigits) {
15538
+ checksum = 97 - parseInt("2".concat(tin.slice(0, 9)), 10) % 97;
15539
+
15540
+ if (checksum !== checkdigits) {
15541
+ return false;
15542
+ }
15543
+ }
15544
+
15545
+ return true;
15546
+ }
15547
+ /*
15548
+ * fr-FR validation function
15549
+ * (Numéro fiscal de référence (numéro SPI), persons only)
15550
+ * Verify TIN validity by calculating check (last three) digits
15551
+ */
15552
+
15553
+
15554
+ function frFrCheck(tin) {
15555
+ tin = tin.replace(/\s/g, '');
15556
+ var checksum = parseInt(tin.slice(0, 10), 10) % 511;
15557
+ var checkdigits = parseInt(tin.slice(10, 13), 10);
15558
+ return checksum === checkdigits;
15559
+ }
15560
+ /*
15561
+ * fr/lb-LU validation function
15562
+ * (numéro d’identification personnelle, persons only)
15563
+ * Verify birth date validity and run Luhn and Verhoeff checks
15564
+ */
15565
+
15566
+
15567
+ function frLuCheck(tin) {
15568
+ // Extract date and check validity
15569
+ var date = "".concat(tin.slice(0, 4), "/").concat(tin.slice(4, 6), "/").concat(tin.slice(6, 8));
15570
+
15571
+ if (!(0, _isDate.default)(date, 'YYYY/MM/DD')) {
15572
+ return false;
15573
+ } // Run Luhn check
15574
+
15575
+
15576
+ if (!algorithms.luhnCheck(tin.slice(0, 12))) {
15577
+ return false;
15578
+ } // Remove Luhn check digit and run Verhoeff check
15579
+
15580
+
15581
+ return algorithms.verhoeffCheck("".concat(tin.slice(0, 11)).concat(tin[12]));
15582
+ }
15583
+ /*
15584
+ * hr-HR validation function
15585
+ * (Osobni identifikacijski broj (OIB), persons/entities)
15586
+ * Verify TIN validity by calling iso7064Check(digits)
15587
+ */
15588
+
15589
+
15590
+ function hrHrCheck(tin) {
15591
+ return algorithms.iso7064Check(tin);
15592
+ }
15593
+ /*
15594
+ * hu-HU validation function
15595
+ * (Adóazonosító jel, persons only)
15596
+ * Verify TIN validity by calculating check (last) digit
15597
+ */
15598
+
15599
+
15600
+ function huHuCheck(tin) {
15601
+ // split digits into an array for further processing
15602
+ var digits = tin.split('').map(function (a) {
15603
+ return parseInt(a, 10);
15604
+ });
15605
+ var checksum = 8;
15606
+
15607
+ for (var i = 1; i < 9; i++) {
15608
+ checksum += digits[i] * (i + 1);
15609
+ }
15610
+
15611
+ return checksum % 11 === digits[9];
15612
+ }
15613
+ /*
15614
+ * lt-LT validation function (should go here if needed)
15615
+ * (Asmens kodas, persons/entities respectively)
15616
+ * Current validation check is alias of etEeCheck- same format applies
15617
+ */
15618
+
15619
+ /*
15620
+ * it-IT first/last name validity check
15621
+ * Accepts it-IT TIN-encoded names as a three-element character array and checks their validity
15622
+ * Due to lack of clarity between resources ("Are only Italian consonants used?
15623
+ * What happens if a person has X in their name?" etc.) only two test conditions
15624
+ * have been implemented:
15625
+ * Vowels may only be followed by other vowels or an X character
15626
+ * and X characters after vowels may only be followed by other X characters.
15627
+ */
15628
+
15629
+
15630
+ function itItNameCheck(name) {
15631
+ // true at the first occurence of a vowel
15632
+ var vowelflag = false; // true at the first occurence of an X AFTER vowel
15633
+ // (to properly handle last names with X as consonant)
15634
+
15635
+ var xflag = false;
15636
+
15637
+ for (var i = 0; i < 3; i++) {
15638
+ if (!vowelflag && /[AEIOU]/.test(name[i])) {
15639
+ vowelflag = true;
15640
+ } else if (!xflag && vowelflag && name[i] === 'X') {
15641
+ xflag = true;
15642
+ } else if (i > 0) {
15643
+ if (vowelflag && !xflag) {
15644
+ if (!/[AEIOU]/.test(name[i])) {
15645
+ return false;
15646
+ }
15647
+ }
15648
+
15649
+ if (xflag) {
15650
+ if (!/X/.test(name[i])) {
15651
+ return false;
15652
+ }
15653
+ }
15654
+ }
15655
+ }
15656
+
15657
+ return true;
15658
+ }
15659
+ /*
15660
+ * it-IT validation function
15661
+ * (Codice fiscale (TIN-IT), persons only)
15662
+ * Verify name, birth date and codice catastale validity
15663
+ * and calculate check character.
15664
+ * Material not in DG-TAXUD document sourced from:
15665
+ * `https://en.wikipedia.org/wiki/Italian_fiscal_code`
15666
+ */
15667
+
15668
+
15669
+ function itItCheck(tin) {
15670
+ // Capitalize and split characters into an array for further processing
15671
+ var chars = tin.toUpperCase().split(''); // Check first and last name validity calling itItNameCheck()
15672
+
15673
+ if (!itItNameCheck(chars.slice(0, 3))) {
15674
+ return false;
15675
+ }
15676
+
15677
+ if (!itItNameCheck(chars.slice(3, 6))) {
15678
+ return false;
15679
+ } // Convert letters in number spaces back to numbers if any
15680
+
15681
+
15682
+ var number_locations = [6, 7, 9, 10, 12, 13, 14];
15683
+ var number_replace = {
15684
+ L: '0',
15685
+ M: '1',
15686
+ N: '2',
15687
+ P: '3',
15688
+ Q: '4',
15689
+ R: '5',
15690
+ S: '6',
15691
+ T: '7',
15692
+ U: '8',
15693
+ V: '9'
15694
+ };
15695
+
15696
+ for (var _i4 = 0, _number_locations = number_locations; _i4 < _number_locations.length; _i4++) {
15697
+ var i = _number_locations[_i4];
15698
+
15699
+ if (chars[i] in number_replace) {
15700
+ chars.splice(i, 1, number_replace[chars[i]]);
15701
+ }
15702
+ } // Extract month and day, and check date validity
15703
+
15704
+
15705
+ var month_replace = {
15706
+ A: '01',
15707
+ B: '02',
15708
+ C: '03',
15709
+ D: '04',
15710
+ E: '05',
15711
+ H: '06',
15712
+ L: '07',
15713
+ M: '08',
15714
+ P: '09',
15715
+ R: '10',
15716
+ S: '11',
15717
+ T: '12'
15718
+ };
15719
+ var month = month_replace[chars[8]];
15720
+ var day = parseInt(chars[9] + chars[10], 10);
15721
+
15722
+ if (day > 40) {
15723
+ day -= 40;
15724
+ }
15725
+
15726
+ if (day < 10) {
15727
+ day = "0".concat(day);
15728
+ }
15729
+
15730
+ var date = "".concat(chars[6]).concat(chars[7], "/").concat(month, "/").concat(day);
15731
+
15732
+ if (!(0, _isDate.default)(date, 'YY/MM/DD')) {
15733
+ return false;
15734
+ } // Calculate check character by adding up even and odd characters as numbers
15735
+
15736
+
15737
+ var checksum = 0;
15738
+
15739
+ for (var _i5 = 1; _i5 < chars.length - 1; _i5 += 2) {
15740
+ var char_to_int = parseInt(chars[_i5], 10);
15741
+
15742
+ if (isNaN(char_to_int)) {
15743
+ char_to_int = chars[_i5].charCodeAt(0) - 65;
15744
+ }
15745
+
15746
+ checksum += char_to_int;
15747
+ }
15748
+
15749
+ var odd_convert = {
15750
+ // Maps of characters at odd places
15751
+ A: 1,
15752
+ B: 0,
15753
+ C: 5,
15754
+ D: 7,
15755
+ E: 9,
15756
+ F: 13,
15757
+ G: 15,
15758
+ H: 17,
15759
+ I: 19,
15760
+ J: 21,
15761
+ K: 2,
15762
+ L: 4,
15763
+ M: 18,
15764
+ N: 20,
15765
+ O: 11,
15766
+ P: 3,
15767
+ Q: 6,
15768
+ R: 8,
15769
+ S: 12,
15770
+ T: 14,
15771
+ U: 16,
15772
+ V: 10,
15773
+ W: 22,
15774
+ X: 25,
15775
+ Y: 24,
15776
+ Z: 23,
15777
+ 0: 1,
15778
+ 1: 0
15779
+ };
15780
+
15781
+ for (var _i6 = 0; _i6 < chars.length - 1; _i6 += 2) {
15782
+ var _char_to_int = 0;
15783
+
15784
+ if (chars[_i6] in odd_convert) {
15785
+ _char_to_int = odd_convert[chars[_i6]];
15786
+ } else {
15787
+ var multiplier = parseInt(chars[_i6], 10);
15788
+ _char_to_int = 2 * multiplier + 1;
15789
+
15790
+ if (multiplier > 4) {
15791
+ _char_to_int += 2;
15792
+ }
15793
+ }
15794
+
15795
+ checksum += _char_to_int;
15796
+ }
15797
+
15798
+ if (String.fromCharCode(65 + checksum % 26) !== chars[15]) {
15799
+ return false;
15800
+ }
15801
+
15802
+ return true;
15803
+ }
15804
+ /*
15805
+ * lv-LV validation function
15806
+ * (Personas kods (PK), persons only)
15807
+ * Check validity of birth date and calculate check (last) digit
15808
+ * Support only for old format numbers (not starting with '32', issued before 2017/07/01)
15809
+ * Material not in DG TAXUD document sourced from:
15810
+ * `https://boot.ritakafija.lv/forums/index.php?/topic/88314-personas-koda-algoritms-%C4%8Deksumma/`
15811
+ */
15812
+
15813
+
15814
+ function lvLvCheck(tin) {
15815
+ tin = tin.replace(/\W/, ''); // Extract date from TIN
15816
+
15817
+ var day = tin.slice(0, 2);
15818
+
15819
+ if (day !== '32') {
15820
+ // No date/checksum check if new format
15821
+ var month = tin.slice(2, 4);
15822
+
15823
+ if (month !== '00') {
15824
+ // No date check if unknown month
15825
+ var full_year = tin.slice(4, 6);
15826
+
15827
+ switch (tin[6]) {
15828
+ case '0':
15829
+ full_year = "18".concat(full_year);
15830
+ break;
15831
+
15832
+ case '1':
15833
+ full_year = "19".concat(full_year);
15834
+ break;
15835
+
15836
+ default:
15837
+ full_year = "20".concat(full_year);
15838
+ break;
15839
+ } // Check date validity
15840
+
15841
+
15842
+ var date = "".concat(full_year, "/").concat(tin.slice(2, 4), "/").concat(day);
15843
+
15844
+ if (!(0, _isDate.default)(date, 'YYYY/MM/DD')) {
15845
+ return false;
15846
+ }
15847
+ } // Calculate check digit
15848
+
15849
+
15850
+ var checksum = 1101;
15851
+ var multip_lookup = [1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
15852
+
15853
+ for (var i = 0; i < tin.length - 1; i++) {
15854
+ checksum -= parseInt(tin[i], 10) * multip_lookup[i];
15855
+ }
15856
+
15857
+ return parseInt(tin[10], 10) === checksum % 11;
15858
+ }
15859
+
15860
+ return true;
15861
+ }
15862
+ /*
15863
+ * mt-MT validation function
15864
+ * (Identity Card Number or Unique Taxpayer Reference, persons/entities)
15865
+ * Verify Identity Card Number structure (no other tests found)
15866
+ */
15867
+
15868
+
15869
+ function mtMtCheck(tin) {
15870
+ if (tin.length !== 9) {
15871
+ // No tests for UTR
15872
+ var chars = tin.toUpperCase().split(''); // Fill with zeros if smaller than proper
15873
+
15874
+ while (chars.length < 8) {
15875
+ chars.unshift(0);
15876
+ } // Validate format according to last character
15877
+
15878
+
15879
+ switch (tin[7]) {
15880
+ case 'A':
15881
+ case 'P':
15882
+ if (parseInt(chars[6], 10) === 0) {
15883
+ return false;
15884
+ }
15885
+
15886
+ break;
15887
+
15888
+ default:
15889
+ {
15890
+ var first_part = parseInt(chars.join('').slice(0, 5), 10);
15891
+
15892
+ if (first_part > 32000) {
15893
+ return false;
15894
+ }
15895
+
15896
+ var second_part = parseInt(chars.join('').slice(5, 7), 10);
15897
+
15898
+ if (first_part === second_part) {
15899
+ return false;
15900
+ }
15901
+ }
15902
+ }
15903
+ }
15904
+
15905
+ return true;
15906
+ }
15907
+ /*
15908
+ * nl-NL validation function
15909
+ * (Burgerservicenummer (BSN) or Rechtspersonen Samenwerkingsverbanden Informatie Nummer (RSIN),
15910
+ * persons/entities respectively)
15911
+ * Verify TIN validity by calculating check (last) digit (variant of MOD 11)
15912
+ */
15913
+
15914
+
15915
+ function nlNlCheck(tin) {
15916
+ return algorithms.reverseMultiplyAndSum(tin.split('').slice(0, 8).map(function (a) {
15917
+ return parseInt(a, 10);
15918
+ }), 9) % 11 === parseInt(tin[8], 10);
15919
+ }
15920
+ /*
15921
+ * pl-PL validation function
15922
+ * (Powszechny Elektroniczny System Ewidencji Ludności (PESEL)
15923
+ * or Numer identyfikacji podatkowej (NIP), persons/entities)
15924
+ * Verify TIN validity by validating birth date (PESEL) and calculating check (last) digit
15925
+ */
15926
+
15927
+
15928
+ function plPlCheck(tin) {
15929
+ // NIP
15930
+ if (tin.length === 10) {
15931
+ // Calculate last digit by multiplying with lookup
15932
+ var lookup = [6, 5, 7, 2, 3, 4, 5, 6, 7];
15933
+ var _checksum = 0;
15934
+
15935
+ for (var i = 0; i < lookup.length; i++) {
15936
+ _checksum += parseInt(tin[i], 10) * lookup[i];
15937
+ }
15938
+
15939
+ _checksum %= 11;
15940
+
15941
+ if (_checksum === 10) {
15942
+ return false;
15943
+ }
15944
+
15945
+ return _checksum === parseInt(tin[9], 10);
15946
+ } // PESEL
15947
+ // Extract full year using month
15948
+
15949
+
15950
+ var full_year = tin.slice(0, 2);
15951
+ var month = parseInt(tin.slice(2, 4), 10);
15952
+
15953
+ if (month > 80) {
15954
+ full_year = "18".concat(full_year);
15955
+ month -= 80;
15956
+ } else if (month > 60) {
15957
+ full_year = "22".concat(full_year);
15958
+ month -= 60;
15959
+ } else if (month > 40) {
15960
+ full_year = "21".concat(full_year);
15961
+ month -= 40;
15962
+ } else if (month > 20) {
15963
+ full_year = "20".concat(full_year);
15964
+ month -= 20;
15965
+ } else {
15966
+ full_year = "19".concat(full_year);
15967
+ } // Add leading zero to month if needed
15968
+
15969
+
15970
+ if (month < 10) {
15971
+ month = "0".concat(month);
15972
+ } // Check date validity
15973
+
15974
+
15975
+ var date = "".concat(full_year, "/").concat(month, "/").concat(tin.slice(4, 6));
15976
+
15977
+ if (!(0, _isDate.default)(date, 'YYYY/MM/DD')) {
15978
+ return false;
15979
+ } // Calculate last digit by mulitplying with odd one-digit numbers except 5
15980
+
15981
+
15982
+ var checksum = 0;
15983
+ var multiplier = 1;
15984
+
15985
+ for (var _i7 = 0; _i7 < tin.length - 1; _i7++) {
15986
+ checksum += parseInt(tin[_i7], 10) * multiplier % 10;
15987
+ multiplier += 2;
15988
+
15989
+ if (multiplier > 10) {
15990
+ multiplier = 1;
15991
+ } else if (multiplier === 5) {
15992
+ multiplier += 2;
15993
+ }
15994
+ }
15995
+
15996
+ checksum = 10 - checksum % 10;
15997
+ return checksum === parseInt(tin[10], 10);
15998
+ }
15999
+ /*
16000
+ * pt-PT validation function
16001
+ * (Número de identificação fiscal (NIF), persons/entities)
16002
+ * Verify TIN validity by calculating check (last) digit (variant of MOD 11)
16003
+ */
16004
+
16005
+
16006
+ function ptPtCheck(tin) {
16007
+ var checksum = 11 - algorithms.reverseMultiplyAndSum(tin.split('').slice(0, 8).map(function (a) {
16008
+ return parseInt(a, 10);
16009
+ }), 9) % 11;
16010
+
16011
+ if (checksum > 9) {
16012
+ return parseInt(tin[8], 10) === 0;
16013
+ }
16014
+
16015
+ return checksum === parseInt(tin[8], 10);
16016
+ }
16017
+ /*
16018
+ * ro-RO validation function
16019
+ * (Cod Numeric Personal (CNP) or Cod de înregistrare fiscală (CIF),
16020
+ * persons only)
16021
+ * Verify CNP validity by calculating check (last) digit (test not found for CIF)
16022
+ * Material not in DG TAXUD document sourced from:
16023
+ * `https://en.wikipedia.org/wiki/National_identification_number#Romania`
16024
+ */
16025
+
16026
+
16027
+ function roRoCheck(tin) {
16028
+ if (tin.slice(0, 4) !== '9000') {
16029
+ // No test found for this format
16030
+ // Extract full year using century digit if possible
16031
+ var full_year = tin.slice(1, 3);
16032
+
16033
+ switch (tin[0]) {
16034
+ case '1':
16035
+ case '2':
16036
+ full_year = "19".concat(full_year);
16037
+ break;
16038
+
16039
+ case '3':
16040
+ case '4':
16041
+ full_year = "18".concat(full_year);
16042
+ break;
16043
+
16044
+ case '5':
16045
+ case '6':
16046
+ full_year = "20".concat(full_year);
16047
+ break;
16048
+
16049
+ default:
16050
+ } // Check date validity
16051
+
16052
+
16053
+ var date = "".concat(full_year, "/").concat(tin.slice(3, 5), "/").concat(tin.slice(5, 7));
16054
+
16055
+ if (date.length === 8) {
16056
+ if (!(0, _isDate.default)(date, 'YY/MM/DD')) {
16057
+ return false;
16058
+ }
16059
+ } else if (!(0, _isDate.default)(date, 'YYYY/MM/DD')) {
16060
+ return false;
16061
+ } // Calculate check digit
16062
+
16063
+
16064
+ var digits = tin.split('').map(function (a) {
16065
+ return parseInt(a, 10);
16066
+ });
16067
+ var multipliers = [2, 7, 9, 1, 4, 6, 3, 5, 8, 2, 7, 9];
16068
+ var checksum = 0;
16069
+
16070
+ for (var i = 0; i < multipliers.length; i++) {
16071
+ checksum += digits[i] * multipliers[i];
16072
+ }
16073
+
16074
+ if (checksum % 11 === 10) {
16075
+ return digits[12] === 1;
16076
+ }
16077
+
16078
+ return digits[12] === checksum % 11;
16079
+ }
16080
+
16081
+ return true;
16082
+ }
16083
+ /*
16084
+ * sk-SK validation function
16085
+ * (Rodné číslo (RČ) or bezvýznamové identifikačné číslo (BIČ), persons only)
16086
+ * Checks validity of pre-1954 birth numbers (rodné číslo) only
16087
+ * Due to the introduction of the pseudo-random BIČ it is not possible to test
16088
+ * post-1954 birth numbers without knowing whether they are BIČ or RČ beforehand
16089
+ */
16090
+
16091
+
16092
+ function skSkCheck(tin) {
16093
+ if (tin.length === 9) {
16094
+ tin = tin.replace(/\W/, '');
16095
+
16096
+ if (tin.slice(6) === '000') {
16097
+ return false;
16098
+ } // Three-zero serial not assigned before 1954
16099
+ // Extract full year from TIN length
16100
+
16101
+
16102
+ var full_year = parseInt(tin.slice(0, 2), 10);
16103
+
16104
+ if (full_year > 53) {
16105
+ return false;
16106
+ }
16107
+
16108
+ if (full_year < 10) {
16109
+ full_year = "190".concat(full_year);
16110
+ } else {
16111
+ full_year = "19".concat(full_year);
16112
+ } // Extract month from TIN and normalize
16113
+
16114
+
16115
+ var month = parseInt(tin.slice(2, 4), 10);
16116
+
16117
+ if (month > 50) {
16118
+ month -= 50;
16119
+ }
16120
+
16121
+ if (month < 10) {
16122
+ month = "0".concat(month);
16123
+ } // Check date validity
16124
+
16125
+
16126
+ var date = "".concat(full_year, "/").concat(month, "/").concat(tin.slice(4, 6));
16127
+
16128
+ if (!(0, _isDate.default)(date, 'YYYY/MM/DD')) {
16129
+ return false;
16130
+ }
16131
+ }
16132
+
16133
+ return true;
16134
+ }
16135
+ /*
16136
+ * sl-SI validation function
16137
+ * (Davčna številka, persons/entities)
16138
+ * Verify TIN validity by calculating check (last) digit (variant of MOD 11)
16139
+ */
16140
+
16141
+
16142
+ function slSiCheck(tin) {
16143
+ var checksum = 11 - algorithms.reverseMultiplyAndSum(tin.split('').slice(0, 7).map(function (a) {
16144
+ return parseInt(a, 10);
16145
+ }), 8) % 11;
16146
+
16147
+ if (checksum === 10) {
16148
+ return parseInt(tin[7], 10) === 0;
16149
+ }
16150
+
16151
+ return checksum === parseInt(tin[7], 10);
16152
+ }
16153
+ /*
16154
+ * sv-SE validation function
16155
+ * (Personnummer or samordningsnummer, persons only)
16156
+ * Checks validity of birth date and calls luhnCheck() to validate check (last) digit
16157
+ */
16158
+
16159
+
16160
+ function svSeCheck(tin) {
16161
+ // Make copy of TIN and normalize to two-digit year form
16162
+ var tin_copy = tin.slice(0);
16163
+
16164
+ if (tin.length > 11) {
16165
+ tin_copy = tin_copy.slice(2);
16166
+ } // Extract date of birth
16167
+
16168
+
16169
+ var full_year = '';
16170
+ var month = tin_copy.slice(2, 4);
16171
+ var day = parseInt(tin_copy.slice(4, 6), 10);
16172
+
16173
+ if (tin.length > 11) {
16174
+ full_year = tin.slice(0, 4);
16175
+ } else {
16176
+ full_year = tin.slice(0, 2);
16177
+
16178
+ if (tin.length === 11 && day < 60) {
16179
+ // Extract full year from centenarian symbol
16180
+ // Should work just fine until year 10000 or so
16181
+ var current_year = new Date().getFullYear().toString();
16182
+ var current_century = parseInt(current_year.slice(0, 2), 10);
16183
+ current_year = parseInt(current_year, 10);
16184
+
16185
+ if (tin[6] === '-') {
16186
+ if (parseInt("".concat(current_century).concat(full_year), 10) > current_year) {
16187
+ full_year = "".concat(current_century - 1).concat(full_year);
16188
+ } else {
16189
+ full_year = "".concat(current_century).concat(full_year);
16190
+ }
16191
+ } else {
16192
+ full_year = "".concat(current_century - 1).concat(full_year);
16193
+
16194
+ if (current_year - parseInt(full_year, 10) < 100) {
16195
+ return false;
16196
+ }
16197
+ }
16198
+ }
16199
+ } // Normalize day and check date validity
16200
+
16201
+
16202
+ if (day > 60) {
16203
+ day -= 60;
16204
+ }
16205
+
16206
+ if (day < 10) {
16207
+ day = "0".concat(day);
16208
+ }
16209
+
16210
+ var date = "".concat(full_year, "/").concat(month, "/").concat(day);
16211
+
16212
+ if (date.length === 8) {
16213
+ if (!(0, _isDate.default)(date, 'YY/MM/DD')) {
16214
+ return false;
16215
+ }
16216
+ } else if (!(0, _isDate.default)(date, 'YYYY/MM/DD')) {
16217
+ return false;
16218
+ }
16219
+
16220
+ return algorithms.luhnCheck(tin.replace(/\W/, ''));
16221
+ } // Locale lookup objects
16222
+
16223
+ /*
16224
+ * Tax id regex formats for various locales
16225
+ *
16226
+ * Where not explicitly specified in DG-TAXUD document both
16227
+ * uppercase and lowercase letters are acceptable.
16228
+ */
16229
+
16230
+
16231
+ var taxIdFormat = {
16232
+ 'bg-BG': /^\d{10}$/,
16233
+ 'cs-CZ': /^\d{6}\/{0,1}\d{3,4}$/,
16234
+ 'de-AT': /^\d{9}$/,
16235
+ 'de-DE': /^[1-9]\d{10}$/,
16236
+ 'dk-DK': /^\d{6}-{0,1}\d{4}$/,
16237
+ 'el-CY': /^[09]\d{7}[A-Z]$/,
16238
+ 'el-GR': /^([0-4]|[7-9])\d{8}$/,
16239
+ 'en-GB': /^\d{10}$|^(?!GB|NK|TN|ZZ)(?![DFIQUV])[A-Z](?![DFIQUVO])[A-Z]\d{6}[ABCD ]$/i,
16240
+ 'en-IE': /^\d{7}[A-W][A-IW]{0,1}$/i,
16241
+ 'en-US': /^\d{2}[- ]{0,1}\d{7}$/,
16242
+ 'es-ES': /^(\d{0,8}|[XYZKLM]\d{7})[A-HJ-NP-TV-Z]$/i,
16243
+ 'et-EE': /^[1-6]\d{6}(00[1-9]|0[1-9][0-9]|[1-6][0-9]{2}|70[0-9]|710)\d$/,
16244
+ 'fi-FI': /^\d{6}[-+A]\d{3}[0-9A-FHJ-NPR-Y]$/i,
16245
+ 'fr-BE': /^\d{11}$/,
16246
+ 'fr-FR': /^[0-3]\d{12}$|^[0-3]\d\s\d{2}(\s\d{3}){3}$/,
16247
+ // Conforms both to official spec and provided example
16248
+ 'fr-LU': /^\d{13}$/,
16249
+ 'hr-HR': /^\d{11}$/,
16250
+ 'hu-HU': /^8\d{9}$/,
16251
+ 'it-IT': /^[A-Z]{6}[L-NP-V0-9]{2}[A-EHLMPRST][L-NP-V0-9]{2}[A-ILMZ][L-NP-V0-9]{3}[A-Z]$/i,
16252
+ 'lv-LV': /^\d{6}-{0,1}\d{5}$/,
16253
+ // Conforms both to DG TAXUD spec and original research
16254
+ 'mt-MT': /^\d{3,7}[APMGLHBZ]$|^([1-8])\1\d{7}$/i,
16255
+ 'nl-NL': /^\d{9}$/,
16256
+ 'pl-PL': /^\d{10,11}$/,
16257
+ 'pt-PT': /^\d{9}$/,
16258
+ 'ro-RO': /^\d{13}$/,
16259
+ 'sk-SK': /^\d{6}\/{0,1}\d{3,4}$/,
16260
+ 'sl-SI': /^[1-9]\d{7}$/,
16261
+ 'sv-SE': /^(\d{6}[-+]{0,1}\d{4}|(18|19|20)\d{6}[-+]{0,1}\d{4})$/
16262
+ }; // taxIdFormat locale aliases
16263
+
16264
+ taxIdFormat['lb-LU'] = taxIdFormat['fr-LU'];
16265
+ taxIdFormat['lt-LT'] = taxIdFormat['et-EE'];
16266
+ taxIdFormat['nl-BE'] = taxIdFormat['fr-BE']; // Algorithmic tax id check functions for various locales
16267
+
16268
+ var taxIdCheck = {
16269
+ 'bg-BG': bgBgCheck,
16270
+ 'cs-CZ': csCzCheck,
16271
+ 'de-AT': deAtCheck,
16272
+ 'de-DE': deDeCheck,
16273
+ 'dk-DK': dkDkCheck,
16274
+ 'el-CY': elCyCheck,
16275
+ 'el-GR': elGrCheck,
16276
+ 'en-IE': enIeCheck,
16277
+ 'en-US': enUsCheck,
16278
+ 'es-ES': esEsCheck,
16279
+ 'et-EE': etEeCheck,
16280
+ 'fi-FI': fiFiCheck,
16281
+ 'fr-BE': frBeCheck,
16282
+ 'fr-FR': frFrCheck,
16283
+ 'fr-LU': frLuCheck,
16284
+ 'hr-HR': hrHrCheck,
16285
+ 'hu-HU': huHuCheck,
16286
+ 'it-IT': itItCheck,
16287
+ 'lv-LV': lvLvCheck,
16288
+ 'mt-MT': mtMtCheck,
16289
+ 'nl-NL': nlNlCheck,
16290
+ 'pl-PL': plPlCheck,
16291
+ 'pt-PT': ptPtCheck,
16292
+ 'ro-RO': roRoCheck,
16293
+ 'sk-SK': skSkCheck,
16294
+ 'sl-SI': slSiCheck,
16295
+ 'sv-SE': svSeCheck
16296
+ }; // taxIdCheck locale aliases
16297
+
16298
+ taxIdCheck['lb-LU'] = taxIdCheck['fr-LU'];
16299
+ taxIdCheck['lt-LT'] = taxIdCheck['et-EE'];
16300
+ taxIdCheck['nl-BE'] = taxIdCheck['fr-BE']; // Regexes for locales where characters should be omitted before checking format
16301
+
16302
+ var allsymbols = /[-\\\/!@#$%\^&\*\(\)\+\=\[\]]+/g;
16303
+ var sanitizeRegexes = {
16304
+ 'de-AT': allsymbols,
16305
+ 'de-DE': /[\/\\]/g,
16306
+ 'fr-BE': allsymbols
16307
+ }; // sanitizeRegexes locale aliases
16308
+
16309
+ sanitizeRegexes['nl-BE'] = sanitizeRegexes['fr-BE'];
16310
+ /*
16311
+ * Validator function
16312
+ * Return true if the passed string is a valid tax identification number
16313
+ * for the specified locale.
16314
+ * Throw an error exception if the locale is not supported.
16315
+ */
16316
+
16317
+ function isTaxID(str) {
16318
+ var locale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'en-US';
16319
+ (0, _assertString.default)(str); // Copy TIN to avoid replacement if sanitized
16320
+
16321
+ var strcopy = str.slice(0);
16322
+
16323
+ if (locale in taxIdFormat) {
16324
+ if (locale in sanitizeRegexes) {
16325
+ strcopy = strcopy.replace(sanitizeRegexes[locale], '');
16326
+ }
16327
+
16328
+ if (!taxIdFormat[locale].test(strcopy)) {
16329
+ return false;
16330
+ }
16331
+
16332
+ if (locale in taxIdCheck) {
16333
+ return taxIdCheck[locale](strcopy);
16334
+ } // Fallthrough; not all locales have algorithmic checks
16335
+
16336
+
16337
+ return true;
16338
+ }
16339
+
16340
+ throw new Error("Invalid locale '".concat(locale, "'"));
16341
+ }
16342
+
16343
+ module.exports = exports.default;
16344
+ module.exports["default"] = exports.default;
16345
+
16346
+ /***/ }),
16347
+
16348
+ /***/ 4922:
16349
+ /***/ (function(module, exports, __webpack_require__) {
16350
+
16351
+ "use strict";
16352
+
16353
+
16354
+ Object.defineProperty(exports, "__esModule", ({
16355
+ value: true
16356
+ }));
16357
+ exports["default"] = isURL;
16358
+
16359
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
16360
+
16361
+ var _isFQDN = _interopRequireDefault(__webpack_require__(8139));
16362
+
16363
+ var _isIP = _interopRequireDefault(__webpack_require__(7962));
16364
+
16365
+ var _merge = _interopRequireDefault(__webpack_require__(1778));
16366
+
16367
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16368
+
16369
+ /*
16370
+ options for isURL method
16371
+
16372
+ require_protocol - if set as true isURL will return false if protocol is not present in the URL
16373
+ require_valid_protocol - isURL will check if the URL's protocol is present in the protocols option
16374
+ protocols - valid protocols can be modified with this option
16375
+ require_host - if set as false isURL will not check if host is present in the URL
16376
+ require_port - if set as true isURL will check if port is present in the URL
16377
+ allow_protocol_relative_urls - if set as true protocol relative URLs will be allowed
16378
+ validate_length - if set as false isURL will skip string length validation (IE maximum is 2083)
16379
+
16380
+ */
16381
+ var default_url_options = {
16382
+ protocols: ['http', 'https', 'ftp'],
16383
+ require_tld: true,
16384
+ require_protocol: false,
16385
+ require_host: true,
16386
+ require_port: false,
16387
+ require_valid_protocol: true,
16388
+ allow_underscores: false,
16389
+ allow_trailing_dot: false,
16390
+ allow_protocol_relative_urls: false,
16391
+ validate_length: true
16392
+ };
16393
+ var wrapped_ipv6 = /^\[([^\]]+)\](?::([0-9]+))?$/;
16394
+
16395
+ function isRegExp(obj) {
16396
+ return Object.prototype.toString.call(obj) === '[object RegExp]';
16397
+ }
16398
+
16399
+ function checkHost(host, matches) {
16400
+ for (var i = 0; i < matches.length; i++) {
16401
+ var match = matches[i];
16402
+
16403
+ if (host === match || isRegExp(match) && match.test(host)) {
16404
+ return true;
16405
+ }
16406
+ }
16407
+
16408
+ return false;
16409
+ }
16410
+
16411
+ function isURL(url, options) {
16412
+ (0, _assertString.default)(url);
16413
+
16414
+ if (!url || /[\s<>]/.test(url)) {
16415
+ return false;
16416
+ }
16417
+
16418
+ if (url.indexOf('mailto:') === 0) {
16419
+ return false;
16420
+ }
16421
+
16422
+ options = (0, _merge.default)(options, default_url_options);
16423
+
16424
+ if (options.validate_length && url.length >= 2083) {
16425
+ return false;
16426
+ }
16427
+
16428
+ var protocol, auth, host, hostname, port, port_str, split, ipv6;
16429
+ split = url.split('#');
16430
+ url = split.shift();
16431
+ split = url.split('?');
16432
+ url = split.shift();
16433
+ split = url.split('://');
16434
+
16435
+ if (split.length > 1) {
16436
+ protocol = split.shift().toLowerCase();
16437
+
16438
+ if (options.require_valid_protocol && options.protocols.indexOf(protocol) === -1) {
16439
+ return false;
16440
+ }
16441
+ } else if (options.require_protocol) {
16442
+ return false;
16443
+ } else if (url.substr(0, 2) === '//') {
16444
+ if (!options.allow_protocol_relative_urls) {
16445
+ return false;
16446
+ }
16447
+
16448
+ split[0] = url.substr(2);
16449
+ }
16450
+
16451
+ url = split.join('://');
16452
+
16453
+ if (url === '') {
16454
+ return false;
16455
+ }
16456
+
16457
+ split = url.split('/');
16458
+ url = split.shift();
16459
+
16460
+ if (url === '' && !options.require_host) {
16461
+ return true;
16462
+ }
16463
+
16464
+ split = url.split('@');
16465
+
16466
+ if (split.length > 1) {
16467
+ if (options.disallow_auth) {
16468
+ return false;
16469
+ }
16470
+
16471
+ auth = split.shift();
16472
+
16473
+ if (auth.indexOf(':') === -1 || auth.indexOf(':') >= 0 && auth.split(':').length > 2) {
16474
+ return false;
16475
+ }
16476
+ }
16477
+
16478
+ hostname = split.join('@');
16479
+ port_str = null;
16480
+ ipv6 = null;
16481
+ var ipv6_match = hostname.match(wrapped_ipv6);
16482
+
16483
+ if (ipv6_match) {
16484
+ host = '';
16485
+ ipv6 = ipv6_match[1];
16486
+ port_str = ipv6_match[2] || null;
16487
+ } else {
16488
+ split = hostname.split(':');
16489
+ host = split.shift();
16490
+
16491
+ if (split.length) {
16492
+ port_str = split.join(':');
16493
+ }
16494
+ }
16495
+
16496
+ if (port_str !== null) {
16497
+ port = parseInt(port_str, 10);
16498
+
16499
+ if (!/^[0-9]+$/.test(port_str) || port <= 0 || port > 65535) {
16500
+ return false;
16501
+ }
16502
+ } else if (options.require_port) {
16503
+ return false;
16504
+ }
16505
+
16506
+ if (!(0, _isIP.default)(host) && !(0, _isFQDN.default)(host, options) && (!ipv6 || !(0, _isIP.default)(ipv6, 6))) {
16507
+ return false;
16508
+ }
16509
+
16510
+ host = host || ipv6;
16511
+
16512
+ if (options.host_whitelist && !checkHost(host, options.host_whitelist)) {
16513
+ return false;
16514
+ }
16515
+
16516
+ if (options.host_blacklist && checkHost(host, options.host_blacklist)) {
16517
+ return false;
16518
+ }
16519
+
16520
+ return true;
16521
+ }
16522
+
16523
+ module.exports = exports.default;
16524
+ module.exports["default"] = exports.default;
16525
+
16526
+ /***/ }),
16527
+
16528
+ /***/ 6368:
16529
+ /***/ (function(module, exports, __webpack_require__) {
16530
+
16531
+ "use strict";
16532
+
16533
+
16534
+ Object.defineProperty(exports, "__esModule", ({
16535
+ value: true
16536
+ }));
16537
+ exports["default"] = isUUID;
16538
+
16539
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
16540
+
16541
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16542
+
16543
+ var uuid = {
16544
+ 3: /^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,
16545
+ 4: /^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,
16546
+ 5: /^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,
16547
+ all: /^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i
16548
+ };
16549
+
16550
+ function isUUID(str) {
16551
+ var version = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'all';
16552
+ (0, _assertString.default)(str);
16553
+ var pattern = uuid[version];
16554
+ return pattern && pattern.test(str);
16555
+ }
16556
+
16557
+ module.exports = exports.default;
16558
+ module.exports["default"] = exports.default;
16559
+
16560
+ /***/ }),
16561
+
16562
+ /***/ 1776:
16563
+ /***/ (function(module, exports, __webpack_require__) {
16564
+
16565
+ "use strict";
16566
+
16567
+
16568
+ Object.defineProperty(exports, "__esModule", ({
16569
+ value: true
16570
+ }));
16571
+ exports["default"] = isUppercase;
16572
+
16573
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
16574
+
16575
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16576
+
16577
+ function isUppercase(str) {
16578
+ (0, _assertString.default)(str);
16579
+ return str === str.toUpperCase();
16580
+ }
16581
+
16582
+ module.exports = exports.default;
16583
+ module.exports["default"] = exports.default;
16584
+
16585
+ /***/ }),
16586
+
16587
+ /***/ 1809:
16588
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
16589
+
16590
+ "use strict";
16591
+
16592
+
16593
+ Object.defineProperty(exports, "__esModule", ({
16594
+ value: true
16595
+ }));
16596
+ exports["default"] = isVAT;
16597
+ exports.vatMatchers = void 0;
16598
+
16599
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
16600
+
16601
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16602
+
16603
+ var vatMatchers = {
16604
+ GB: /^GB((\d{3} \d{4} ([0-8][0-9]|9[0-6]))|(\d{9} \d{3})|(((GD[0-4])|(HA[5-9]))[0-9]{2}))$/
16605
+ };
16606
+ exports.vatMatchers = vatMatchers;
16607
+
16608
+ function isVAT(str, countryCode) {
16609
+ (0, _assertString.default)(str);
16610
+ (0, _assertString.default)(countryCode);
16611
+
16612
+ if (countryCode in vatMatchers) {
16613
+ return vatMatchers[countryCode].test(str);
16614
+ }
16615
+
16616
+ throw new Error("Invalid country code: '".concat(countryCode, "'"));
16617
+ }
16618
+
16619
+ /***/ }),
16620
+
16621
+ /***/ 8831:
16622
+ /***/ (function(module, exports, __webpack_require__) {
16623
+
16624
+ "use strict";
16625
+
16626
+
16627
+ Object.defineProperty(exports, "__esModule", ({
16628
+ value: true
16629
+ }));
16630
+ exports["default"] = isVariableWidth;
16631
+
16632
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
16633
+
16634
+ var _isFullWidth = __webpack_require__(749);
16635
+
16636
+ var _isHalfWidth = __webpack_require__(8408);
16637
+
16638
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16639
+
16640
+ function isVariableWidth(str) {
16641
+ (0, _assertString.default)(str);
16642
+ return _isFullWidth.fullWidth.test(str) && _isHalfWidth.halfWidth.test(str);
16643
+ }
16644
+
16645
+ module.exports = exports.default;
16646
+ module.exports["default"] = exports.default;
16647
+
16648
+ /***/ }),
16649
+
16650
+ /***/ 9293:
16651
+ /***/ (function(module, exports, __webpack_require__) {
16652
+
16653
+ "use strict";
16654
+
16655
+
16656
+ Object.defineProperty(exports, "__esModule", ({
16657
+ value: true
16658
+ }));
16659
+ exports["default"] = isWhitelisted;
16660
+
16661
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
16662
+
16663
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16664
+
16665
+ function isWhitelisted(str, chars) {
16666
+ (0, _assertString.default)(str);
16667
+
16668
+ for (var i = str.length - 1; i >= 0; i--) {
16669
+ if (chars.indexOf(str[i]) === -1) {
16670
+ return false;
16671
+ }
16672
+ }
16673
+
16674
+ return true;
16675
+ }
16676
+
16677
+ module.exports = exports.default;
16678
+ module.exports["default"] = exports.default;
16679
+
16680
+ /***/ }),
16681
+
16682
+ /***/ 5904:
16683
+ /***/ (function(module, exports, __webpack_require__) {
16684
+
16685
+ "use strict";
16686
+
16687
+
16688
+ Object.defineProperty(exports, "__esModule", ({
16689
+ value: true
16690
+ }));
16691
+ exports["default"] = ltrim;
16692
+
16693
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
16694
+
16695
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16696
+
16697
+ function ltrim(str, chars) {
16698
+ (0, _assertString.default)(str); // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#Escaping
16699
+
16700
+ var pattern = chars ? new RegExp("^[".concat(chars.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), "]+"), 'g') : /^\s+/g;
16701
+ return str.replace(pattern, '');
16702
+ }
16703
+
16704
+ module.exports = exports.default;
16705
+ module.exports["default"] = exports.default;
16706
+
16707
+ /***/ }),
16708
+
16709
+ /***/ 401:
16710
+ /***/ (function(module, exports, __webpack_require__) {
16711
+
16712
+ "use strict";
16713
+
16714
+
16715
+ Object.defineProperty(exports, "__esModule", ({
16716
+ value: true
16717
+ }));
16718
+ exports["default"] = matches;
16719
+
16720
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
16721
+
16722
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16723
+
16724
+ function matches(str, pattern, modifiers) {
16725
+ (0, _assertString.default)(str);
16726
+
16727
+ if (Object.prototype.toString.call(pattern) !== '[object RegExp]') {
16728
+ pattern = new RegExp(pattern, modifiers);
16729
+ }
16730
+
16731
+ return pattern.test(str);
16732
+ }
16733
+
16734
+ module.exports = exports.default;
16735
+ module.exports["default"] = exports.default;
16736
+
16737
+ /***/ }),
16738
+
16739
+ /***/ 3517:
16740
+ /***/ (function(module, exports, __webpack_require__) {
16741
+
16742
+ "use strict";
16743
+
16744
+
16745
+ Object.defineProperty(exports, "__esModule", ({
16746
+ value: true
16747
+ }));
16748
+ exports["default"] = normalizeEmail;
16749
+
16750
+ var _merge = _interopRequireDefault(__webpack_require__(1778));
16751
+
16752
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16753
+
16754
+ var default_normalize_email_options = {
16755
+ // The following options apply to all email addresses
16756
+ // Lowercases the local part of the email address.
16757
+ // Please note this may violate RFC 5321 as per http://stackoverflow.com/a/9808332/192024).
16758
+ // The domain is always lowercased, as per RFC 1035
16759
+ all_lowercase: true,
16760
+ // The following conversions are specific to GMail
16761
+ // Lowercases the local part of the GMail address (known to be case-insensitive)
16762
+ gmail_lowercase: true,
16763
+ // Removes dots from the local part of the email address, as that's ignored by GMail
16764
+ gmail_remove_dots: true,
16765
+ // Removes the subaddress (e.g. "+foo") from the email address
16766
+ gmail_remove_subaddress: true,
16767
+ // Conversts the googlemail.com domain to gmail.com
16768
+ gmail_convert_googlemaildotcom: true,
16769
+ // The following conversions are specific to Outlook.com / Windows Live / Hotmail
16770
+ // Lowercases the local part of the Outlook.com address (known to be case-insensitive)
16771
+ outlookdotcom_lowercase: true,
16772
+ // Removes the subaddress (e.g. "+foo") from the email address
16773
+ outlookdotcom_remove_subaddress: true,
16774
+ // The following conversions are specific to Yahoo
16775
+ // Lowercases the local part of the Yahoo address (known to be case-insensitive)
16776
+ yahoo_lowercase: true,
16777
+ // Removes the subaddress (e.g. "-foo") from the email address
16778
+ yahoo_remove_subaddress: true,
16779
+ // The following conversions are specific to Yandex
16780
+ // Lowercases the local part of the Yandex address (known to be case-insensitive)
16781
+ yandex_lowercase: true,
16782
+ // The following conversions are specific to iCloud
16783
+ // Lowercases the local part of the iCloud address (known to be case-insensitive)
16784
+ icloud_lowercase: true,
16785
+ // Removes the subaddress (e.g. "+foo") from the email address
16786
+ icloud_remove_subaddress: true
16787
+ }; // List of domains used by iCloud
16788
+
16789
+ var icloud_domains = ['icloud.com', 'me.com']; // List of domains used by Outlook.com and its predecessors
16790
+ // This list is likely incomplete.
16791
+ // Partial reference:
16792
+ // https://blogs.office.com/2013/04/17/outlook-com-gets-two-step-verification-sign-in-by-alias-and-new-international-domains/
16793
+
16794
+ var outlookdotcom_domains = ['hotmail.at', 'hotmail.be', 'hotmail.ca', 'hotmail.cl', 'hotmail.co.il', 'hotmail.co.nz', 'hotmail.co.th', 'hotmail.co.uk', 'hotmail.com', 'hotmail.com.ar', 'hotmail.com.au', 'hotmail.com.br', 'hotmail.com.gr', 'hotmail.com.mx', 'hotmail.com.pe', 'hotmail.com.tr', 'hotmail.com.vn', 'hotmail.cz', 'hotmail.de', 'hotmail.dk', 'hotmail.es', 'hotmail.fr', 'hotmail.hu', 'hotmail.id', 'hotmail.ie', 'hotmail.in', 'hotmail.it', 'hotmail.jp', 'hotmail.kr', 'hotmail.lv', 'hotmail.my', 'hotmail.ph', 'hotmail.pt', 'hotmail.sa', 'hotmail.sg', 'hotmail.sk', 'live.be', 'live.co.uk', 'live.com', 'live.com.ar', 'live.com.mx', 'live.de', 'live.es', 'live.eu', 'live.fr', 'live.it', 'live.nl', 'msn.com', 'outlook.at', 'outlook.be', 'outlook.cl', 'outlook.co.il', 'outlook.co.nz', 'outlook.co.th', 'outlook.com', 'outlook.com.ar', 'outlook.com.au', 'outlook.com.br', 'outlook.com.gr', 'outlook.com.pe', 'outlook.com.tr', 'outlook.com.vn', 'outlook.cz', 'outlook.de', 'outlook.dk', 'outlook.es', 'outlook.fr', 'outlook.hu', 'outlook.id', 'outlook.ie', 'outlook.in', 'outlook.it', 'outlook.jp', 'outlook.kr', 'outlook.lv', 'outlook.my', 'outlook.ph', 'outlook.pt', 'outlook.sa', 'outlook.sg', 'outlook.sk', 'passport.com']; // List of domains used by Yahoo Mail
16795
+ // This list is likely incomplete
16796
+
16797
+ var yahoo_domains = ['rocketmail.com', 'yahoo.ca', 'yahoo.co.uk', 'yahoo.com', 'yahoo.de', 'yahoo.fr', 'yahoo.in', 'yahoo.it', 'ymail.com']; // List of domains used by yandex.ru
16798
+
16799
+ var yandex_domains = ['yandex.ru', 'yandex.ua', 'yandex.kz', 'yandex.com', 'yandex.by', 'ya.ru']; // replace single dots, but not multiple consecutive dots
16800
+
16801
+ function dotsReplacer(match) {
16802
+ if (match.length > 1) {
16803
+ return match;
16804
+ }
16805
+
16806
+ return '';
16807
+ }
16808
+
16809
+ function normalizeEmail(email, options) {
16810
+ options = (0, _merge.default)(options, default_normalize_email_options);
16811
+ var raw_parts = email.split('@');
16812
+ var domain = raw_parts.pop();
16813
+ var user = raw_parts.join('@');
16814
+ var parts = [user, domain]; // The domain is always lowercased, as it's case-insensitive per RFC 1035
16815
+
16816
+ parts[1] = parts[1].toLowerCase();
16817
+
16818
+ if (parts[1] === 'gmail.com' || parts[1] === 'googlemail.com') {
16819
+ // Address is GMail
16820
+ if (options.gmail_remove_subaddress) {
16821
+ parts[0] = parts[0].split('+')[0];
16822
+ }
16823
+
16824
+ if (options.gmail_remove_dots) {
16825
+ // this does not replace consecutive dots like example..email@gmail.com
16826
+ parts[0] = parts[0].replace(/\.+/g, dotsReplacer);
16827
+ }
16828
+
16829
+ if (!parts[0].length) {
16830
+ return false;
16831
+ }
16832
+
16833
+ if (options.all_lowercase || options.gmail_lowercase) {
16834
+ parts[0] = parts[0].toLowerCase();
16835
+ }
16836
+
16837
+ parts[1] = options.gmail_convert_googlemaildotcom ? 'gmail.com' : parts[1];
16838
+ } else if (icloud_domains.indexOf(parts[1]) >= 0) {
16839
+ // Address is iCloud
16840
+ if (options.icloud_remove_subaddress) {
16841
+ parts[0] = parts[0].split('+')[0];
16842
+ }
16843
+
16844
+ if (!parts[0].length) {
16845
+ return false;
16846
+ }
16847
+
16848
+ if (options.all_lowercase || options.icloud_lowercase) {
16849
+ parts[0] = parts[0].toLowerCase();
16850
+ }
16851
+ } else if (outlookdotcom_domains.indexOf(parts[1]) >= 0) {
16852
+ // Address is Outlook.com
16853
+ if (options.outlookdotcom_remove_subaddress) {
16854
+ parts[0] = parts[0].split('+')[0];
16855
+ }
16856
+
16857
+ if (!parts[0].length) {
16858
+ return false;
16859
+ }
16860
+
16861
+ if (options.all_lowercase || options.outlookdotcom_lowercase) {
16862
+ parts[0] = parts[0].toLowerCase();
16863
+ }
16864
+ } else if (yahoo_domains.indexOf(parts[1]) >= 0) {
16865
+ // Address is Yahoo
16866
+ if (options.yahoo_remove_subaddress) {
16867
+ var components = parts[0].split('-');
16868
+ parts[0] = components.length > 1 ? components.slice(0, -1).join('-') : components[0];
16869
+ }
16870
+
16871
+ if (!parts[0].length) {
16872
+ return false;
16873
+ }
16874
+
16875
+ if (options.all_lowercase || options.yahoo_lowercase) {
16876
+ parts[0] = parts[0].toLowerCase();
16877
+ }
16878
+ } else if (yandex_domains.indexOf(parts[1]) >= 0) {
16879
+ if (options.all_lowercase || options.yandex_lowercase) {
16880
+ parts[0] = parts[0].toLowerCase();
16881
+ }
16882
+
16883
+ parts[1] = 'yandex.ru'; // all yandex domains are equal, 1st preferred
16884
+ } else if (options.all_lowercase) {
16885
+ // Any other address
16886
+ parts[0] = parts[0].toLowerCase();
16887
+ }
16888
+
16889
+ return parts.join('@');
16890
+ }
16891
+
16892
+ module.exports = exports.default;
16893
+ module.exports["default"] = exports.default;
16894
+
16895
+ /***/ }),
16896
+
16897
+ /***/ 1733:
16898
+ /***/ (function(module, exports, __webpack_require__) {
16899
+
16900
+ "use strict";
16901
+
16902
+
16903
+ Object.defineProperty(exports, "__esModule", ({
16904
+ value: true
16905
+ }));
16906
+ exports["default"] = rtrim;
16907
+
16908
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
16909
+
16910
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16911
+
16912
+ function rtrim(str, chars) {
16913
+ (0, _assertString.default)(str); // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#Escaping
16914
+
16915
+ var pattern = chars ? new RegExp("[".concat(chars.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), "]+$"), 'g') : /\s+$/g;
16916
+ return str.replace(pattern, '');
16917
+ }
16918
+
16919
+ module.exports = exports.default;
16920
+ module.exports["default"] = exports.default;
16921
+
16922
+ /***/ }),
16923
+
16924
+ /***/ 4559:
16925
+ /***/ (function(module, exports, __webpack_require__) {
16926
+
16927
+ "use strict";
16928
+
16929
+
16930
+ Object.defineProperty(exports, "__esModule", ({
16931
+ value: true
16932
+ }));
16933
+ exports["default"] = stripLow;
16934
+
16935
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
16936
+
16937
+ var _blacklist = _interopRequireDefault(__webpack_require__(7902));
16938
+
16939
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16940
+
16941
+ function stripLow(str, keep_new_lines) {
16942
+ (0, _assertString.default)(str);
16943
+ var chars = keep_new_lines ? '\\x00-\\x09\\x0B\\x0C\\x0E-\\x1F\\x7F' : '\\x00-\\x1F\\x7F';
16944
+ return (0, _blacklist.default)(str, chars);
16945
+ }
16946
+
16947
+ module.exports = exports.default;
16948
+ module.exports["default"] = exports.default;
16949
+
16950
+ /***/ }),
16951
+
16952
+ /***/ 8676:
16953
+ /***/ (function(module, exports, __webpack_require__) {
16954
+
16955
+ "use strict";
16956
+
16957
+
16958
+ Object.defineProperty(exports, "__esModule", ({
16959
+ value: true
16960
+ }));
16961
+ exports["default"] = toBoolean;
16962
+
16963
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
16964
+
16965
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16966
+
16967
+ function toBoolean(str, strict) {
16968
+ (0, _assertString.default)(str);
16969
+
16970
+ if (strict) {
16971
+ return str === '1' || /^true$/i.test(str);
16972
+ }
16973
+
16974
+ return str !== '0' && !/^false$/i.test(str) && str !== '';
16975
+ }
16976
+
16977
+ module.exports = exports.default;
16978
+ module.exports["default"] = exports.default;
16979
+
16980
+ /***/ }),
16981
+
16982
+ /***/ 7499:
16983
+ /***/ (function(module, exports, __webpack_require__) {
16984
+
16985
+ "use strict";
16986
+
16987
+
16988
+ Object.defineProperty(exports, "__esModule", ({
16989
+ value: true
16990
+ }));
16991
+ exports["default"] = toDate;
16992
+
16993
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
16994
+
16995
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16996
+
16997
+ function toDate(date) {
16998
+ (0, _assertString.default)(date);
16999
+ date = Date.parse(date);
17000
+ return !isNaN(date) ? new Date(date) : null;
17001
+ }
17002
+
17003
+ module.exports = exports.default;
17004
+ module.exports["default"] = exports.default;
17005
+
17006
+ /***/ }),
17007
+
17008
+ /***/ 6840:
17009
+ /***/ (function(module, exports, __webpack_require__) {
17010
+
17011
+ "use strict";
17012
+
17013
+
17014
+ Object.defineProperty(exports, "__esModule", ({
17015
+ value: true
17016
+ }));
17017
+ exports["default"] = toFloat;
17018
+
17019
+ var _isFloat = _interopRequireDefault(__webpack_require__(3612));
17020
+
17021
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17022
+
17023
+ function toFloat(str) {
17024
+ if (!(0, _isFloat.default)(str)) return NaN;
17025
+ return parseFloat(str);
17026
+ }
17027
+
17028
+ module.exports = exports.default;
17029
+ module.exports["default"] = exports.default;
17030
+
17031
+ /***/ }),
17032
+
17033
+ /***/ 7155:
17034
+ /***/ (function(module, exports, __webpack_require__) {
17035
+
17036
+ "use strict";
17037
+
17038
+
17039
+ Object.defineProperty(exports, "__esModule", ({
17040
+ value: true
17041
+ }));
17042
+ exports["default"] = toInt;
17043
+
17044
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
17045
+
17046
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17047
+
17048
+ function toInt(str, radix) {
17049
+ (0, _assertString.default)(str);
17050
+ return parseInt(str, radix || 10);
17051
+ }
17052
+
17053
+ module.exports = exports.default;
17054
+ module.exports["default"] = exports.default;
17055
+
17056
+ /***/ }),
17057
+
17058
+ /***/ 3465:
17059
+ /***/ (function(module, exports, __webpack_require__) {
17060
+
17061
+ "use strict";
17062
+
17063
+
17064
+ Object.defineProperty(exports, "__esModule", ({
17065
+ value: true
17066
+ }));
17067
+ exports["default"] = trim;
17068
+
17069
+ var _rtrim = _interopRequireDefault(__webpack_require__(1733));
17070
+
17071
+ var _ltrim = _interopRequireDefault(__webpack_require__(5904));
17072
+
17073
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17074
+
17075
+ function trim(str, chars) {
17076
+ return (0, _rtrim.default)((0, _ltrim.default)(str, chars), chars);
17077
+ }
17078
+
17079
+ module.exports = exports.default;
17080
+ module.exports["default"] = exports.default;
17081
+
17082
+ /***/ }),
17083
+
17084
+ /***/ 3991:
17085
+ /***/ (function(module, exports, __webpack_require__) {
17086
+
17087
+ "use strict";
17088
+
17089
+
17090
+ Object.defineProperty(exports, "__esModule", ({
17091
+ value: true
17092
+ }));
17093
+ exports["default"] = unescape;
17094
+
17095
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
17096
+
17097
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17098
+
17099
+ function unescape(str) {
17100
+ (0, _assertString.default)(str);
17101
+ return str.replace(/&amp;/g, '&').replace(/&quot;/g, '"').replace(/&#x27;/g, "'").replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&#x2F;/g, '/').replace(/&#x5C;/g, '\\').replace(/&#96;/g, '`');
17102
+ }
17103
+
17104
+ module.exports = exports.default;
17105
+ module.exports["default"] = exports.default;
17106
+
17107
+ /***/ }),
17108
+
17109
+ /***/ 257:
17110
+ /***/ (function(__unused_webpack_module, exports) {
17111
+
17112
+ "use strict";
17113
+
17114
+
17115
+ Object.defineProperty(exports, "__esModule", ({
17116
+ value: true
17117
+ }));
17118
+ exports.iso7064Check = iso7064Check;
17119
+ exports.luhnCheck = luhnCheck;
17120
+ exports.reverseMultiplyAndSum = reverseMultiplyAndSum;
17121
+ exports.verhoeffCheck = verhoeffCheck;
17122
+
17123
+ /**
17124
+ * Algorithmic validation functions
17125
+ * May be used as is or implemented in the workflow of other validators.
17126
+ */
17127
+
17128
+ /*
17129
+ * ISO 7064 validation function
17130
+ * Called with a string of numbers (incl. check digit)
17131
+ * to validate according to ISO 7064 (MOD 11, 10).
17132
+ */
17133
+ function iso7064Check(str) {
17134
+ var checkvalue = 10;
17135
+
17136
+ for (var i = 0; i < str.length - 1; i++) {
17137
+ checkvalue = (parseInt(str[i], 10) + checkvalue) % 10 === 0 ? 10 * 2 % 11 : (parseInt(str[i], 10) + checkvalue) % 10 * 2 % 11;
17138
+ }
17139
+
17140
+ checkvalue = checkvalue === 1 ? 0 : 11 - checkvalue;
17141
+ return checkvalue === parseInt(str[10], 10);
17142
+ }
17143
+ /*
17144
+ * Luhn (mod 10) validation function
17145
+ * Called with a string of numbers (incl. check digit)
17146
+ * to validate according to the Luhn algorithm.
17147
+ */
17148
+
17149
+
17150
+ function luhnCheck(str) {
17151
+ var checksum = 0;
17152
+ var second = false;
17153
+
17154
+ for (var i = str.length - 1; i >= 0; i--) {
17155
+ if (second) {
17156
+ var product = parseInt(str[i], 10) * 2;
17157
+
17158
+ if (product > 9) {
17159
+ // sum digits of product and add to checksum
17160
+ checksum += product.toString().split('').map(function (a) {
17161
+ return parseInt(a, 10);
17162
+ }).reduce(function (a, b) {
17163
+ return a + b;
17164
+ }, 0);
17165
+ } else {
17166
+ checksum += product;
17167
+ }
17168
+ } else {
17169
+ checksum += parseInt(str[i], 10);
17170
+ }
17171
+
17172
+ second = !second;
17173
+ }
17174
+
17175
+ return checksum % 10 === 0;
17176
+ }
17177
+ /*
17178
+ * Reverse TIN multiplication and summation helper function
17179
+ * Called with an array of single-digit integers and a base multiplier
17180
+ * to calculate the sum of the digits multiplied in reverse.
17181
+ * Normally used in variations of MOD 11 algorithmic checks.
17182
+ */
17183
+
17184
+
17185
+ function reverseMultiplyAndSum(digits, base) {
17186
+ var total = 0;
17187
+
17188
+ for (var i = 0; i < digits.length; i++) {
17189
+ total += digits[i] * (base - i);
17190
+ }
17191
+
17192
+ return total;
17193
+ }
17194
+ /*
17195
+ * Verhoeff validation helper function
17196
+ * Called with a string of numbers
17197
+ * to validate according to the Verhoeff algorithm.
17198
+ */
17199
+
17200
+
17201
+ function verhoeffCheck(str) {
17202
+ var d_table = [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [1, 2, 3, 4, 0, 6, 7, 8, 9, 5], [2, 3, 4, 0, 1, 7, 8, 9, 5, 6], [3, 4, 0, 1, 2, 8, 9, 5, 6, 7], [4, 0, 1, 2, 3, 9, 5, 6, 7, 8], [5, 9, 8, 7, 6, 0, 4, 3, 2, 1], [6, 5, 9, 8, 7, 1, 0, 4, 3, 2], [7, 6, 5, 9, 8, 2, 1, 0, 4, 3], [8, 7, 6, 5, 9, 3, 2, 1, 0, 4], [9, 8, 7, 6, 5, 4, 3, 2, 1, 0]];
17203
+ var p_table = [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [1, 5, 7, 6, 2, 8, 3, 0, 9, 4], [5, 8, 0, 3, 7, 9, 6, 1, 4, 2], [8, 9, 1, 6, 0, 4, 3, 5, 2, 7], [9, 4, 5, 3, 1, 2, 6, 8, 7, 0], [4, 2, 8, 6, 5, 7, 3, 9, 0, 1], [2, 7, 9, 3, 8, 0, 6, 4, 1, 5], [7, 0, 4, 6, 9, 1, 3, 2, 5, 8]]; // Copy (to prevent replacement) and reverse
17204
+
17205
+ var str_copy = str.split('').reverse().join('');
17206
+ var checksum = 0;
17207
+
17208
+ for (var i = 0; i < str_copy.length; i++) {
17209
+ checksum = d_table[checksum][p_table[i % 8][parseInt(str_copy[i], 10)]];
17210
+ }
17211
+
17212
+ return checksum === 0;
17213
+ }
17214
+
17215
+ /***/ }),
17216
+
17217
+ /***/ 7359:
17218
+ /***/ (function(module, exports) {
17219
+
17220
+ "use strict";
17221
+
17222
+
17223
+ Object.defineProperty(exports, "__esModule", ({
17224
+ value: true
17225
+ }));
17226
+ exports["default"] = assertString;
17227
+
17228
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
17229
+
17230
+ function assertString(input) {
17231
+ var isString = typeof input === 'string' || input instanceof String;
17232
+
17233
+ if (!isString) {
17234
+ var invalidType = _typeof(input);
17235
+
17236
+ if (input === null) invalidType = 'null';else if (invalidType === 'object') invalidType = input.constructor.name;
17237
+ throw new TypeError("Expected a string but received a ".concat(invalidType));
17238
+ }
17239
+ }
17240
+
17241
+ module.exports = exports.default;
17242
+ module.exports["default"] = exports.default;
17243
+
17244
+ /***/ }),
17245
+
17246
+ /***/ 2900:
17247
+ /***/ (function(module, exports) {
17248
+
17249
+ "use strict";
17250
+
17251
+
17252
+ Object.defineProperty(exports, "__esModule", ({
17253
+ value: true
17254
+ }));
17255
+ exports["default"] = void 0;
17256
+
17257
+ var includes = function includes(arr, val) {
17258
+ return arr.some(function (arrVal) {
17259
+ return val === arrVal;
17260
+ });
17261
+ };
17262
+
17263
+ var _default = includes;
17264
+ exports["default"] = _default;
17265
+ module.exports = exports.default;
17266
+ module.exports["default"] = exports.default;
17267
+
17268
+ /***/ }),
17269
+
17270
+ /***/ 1778:
17271
+ /***/ (function(module, exports) {
17272
+
17273
+ "use strict";
17274
+
17275
+
17276
+ Object.defineProperty(exports, "__esModule", ({
17277
+ value: true
17278
+ }));
17279
+ exports["default"] = merge;
17280
+
17281
+ function merge() {
17282
+ var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
17283
+ var defaults = arguments.length > 1 ? arguments[1] : undefined;
17284
+
17285
+ for (var key in defaults) {
17286
+ if (typeof obj[key] === 'undefined') {
17287
+ obj[key] = defaults[key];
17288
+ }
17289
+ }
17290
+
17291
+ return obj;
17292
+ }
17293
+
17294
+ module.exports = exports.default;
17295
+ module.exports["default"] = exports.default;
17296
+
17297
+ /***/ }),
17298
+
17299
+ /***/ 8041:
17300
+ /***/ (function(module, exports) {
17301
+
17302
+ "use strict";
17303
+
17304
+
17305
+ Object.defineProperty(exports, "__esModule", ({
17306
+ value: true
17307
+ }));
17308
+ exports["default"] = multilineRegexp;
17309
+
17310
+ /**
17311
+ * Build RegExp object from an array
17312
+ * of multiple/multi-line regexp parts
17313
+ *
17314
+ * @param {string[]} parts
17315
+ * @param {string} flags
17316
+ * @return {object} - RegExp object
17317
+ */
17318
+ function multilineRegexp(parts, flags) {
17319
+ var regexpAsStringLiteral = parts.join('');
17320
+ return new RegExp(regexpAsStringLiteral, flags);
17321
+ }
17322
+
17323
+ module.exports = exports.default;
17324
+ module.exports["default"] = exports.default;
17325
+
17326
+ /***/ }),
17327
+
17328
+ /***/ 1589:
17329
+ /***/ (function(module, exports) {
17330
+
17331
+ "use strict";
17332
+
17333
+
17334
+ Object.defineProperty(exports, "__esModule", ({
17335
+ value: true
17336
+ }));
17337
+ exports["default"] = toString;
17338
+
17339
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
17340
+
17341
+ function toString(input) {
17342
+ if (_typeof(input) === 'object' && input !== null) {
17343
+ if (typeof input.toString === 'function') {
17344
+ input = input.toString();
17345
+ } else {
17346
+ input = '[object Object]';
17347
+ }
17348
+ } else if (input === null || typeof input === 'undefined' || isNaN(input) && !input.length) {
17349
+ input = '';
17350
+ }
17351
+
17352
+ return String(input);
17353
+ }
17354
+
17355
+ module.exports = exports.default;
17356
+ module.exports["default"] = exports.default;
17357
+
17358
+ /***/ }),
17359
+
17360
+ /***/ 7224:
17361
+ /***/ (function(module, exports, __webpack_require__) {
17362
+
17363
+ "use strict";
17364
+
17365
+
17366
+ Object.defineProperty(exports, "__esModule", ({
17367
+ value: true
17368
+ }));
17369
+ exports["default"] = whitelist;
17370
+
17371
+ var _assertString = _interopRequireDefault(__webpack_require__(7359));
17372
+
17373
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17374
+
17375
+ function whitelist(str, chars) {
17376
+ (0, _assertString.default)(str);
17377
+ return str.replace(new RegExp("[^".concat(chars, "]+"), 'g'), '');
17378
+ }
17379
+
17380
+ module.exports = exports.default;
17381
+ module.exports["default"] = exports.default;
17382
+
17383
+ /***/ }),
17384
+
17385
+ /***/ 2884:
17386
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
17387
+
17388
+ var uppercamelcase = __webpack_require__(3830);
17389
+ var statusCodes = __webpack_require__(6744);
17390
+
17391
+ module.exports = WPError;
17392
+
17393
+ function WPError () {
17394
+ var self = new Error();
17395
+
17396
+ for (var i = 0; i < arguments.length; i++) {
17397
+ process(self, arguments[i]);
17398
+ }
17399
+
17400
+ if (typeof Error.captureStackTrace === 'function') {
17401
+ Error.captureStackTrace(self, WPError);
17402
+ }
17403
+
17404
+ return self;
17405
+ }
17406
+
17407
+ function process ( self, data ) {
17408
+ if ( ! data ) {
17409
+ return;
17410
+ }
17411
+
17412
+ if (typeof data === 'number') {
17413
+ setStatusCode( self, data );
17414
+
17415
+ } else {
17416
+ // assume it's a plain 'ol Object with some props to copy over
17417
+ if ( data.status_code ) {
17418
+ setStatusCode( self, data.status_code );
17419
+ }
17420
+
17421
+ if ( data.error ) {
17422
+ self.name = toName( data.error );
17423
+ }
17424
+
17425
+ if ( data.error_description ) {
17426
+ self.message = data.error_description;
17427
+ }
17428
+
17429
+ var errors = data.errors;
17430
+ if ( errors ) {
17431
+ var first = errors.length ? errors[0] : errors;
17432
+ process( self, first );
17433
+ }
17434
+
17435
+ for ( var i in data ) {
17436
+ self[i] = data[i];
17437
+ }
17438
+
17439
+ if ( self.status && ( data.method || data.path ) ) {
17440
+ setStatusCodeMessage( self );
17441
+ }
17442
+ }
17443
+ }
17444
+
17445
+ function setStatusCode ( self, code ) {
17446
+ self.name = toName( statusCodes[ code ] );
17447
+ self.status = self.statusCode = code;
17448
+ setStatusCodeMessage( self );
17449
+ }
17450
+
17451
+ function setStatusCodeMessage ( self ) {
17452
+ var code = self.status;
17453
+ var method = self.method;
17454
+ var path = self.path;
17455
+
17456
+ var m = code + ' status code';
17457
+ var extended = method || path;
17458
+
17459
+ if ( extended ) m += ' for "';
17460
+ if ( method ) m += method;
17461
+ if ( extended ) m += ' ';
17462
+ if ( path ) m += path;
17463
+ if ( extended ) m += '"';
17464
+
17465
+ self.message = m;
17466
+ }
17467
+
17468
+ function toName ( str ) {
17469
+ return uppercamelcase( String(str).replace(/error$/i, ''), 'error' );
17470
+ }
17471
+
17472
+
17473
+ /***/ }),
17474
+
17475
+ /***/ 9196:
17476
+ /***/ (function(module) {
17477
+
17478
+ "use strict";
17479
+ module.exports = window["React"];
17480
+
17481
+ /***/ }),
17482
+
17483
+ /***/ 9818:
17484
+ /***/ (function(module) {
17485
+
17486
+ "use strict";
17487
+ module.exports = window["wp"]["data"];
17488
+
17489
+ /***/ }),
17490
+
17491
+ /***/ 3418:
17492
+ /***/ (function(module) {
17493
+
17494
+ "use strict";
17495
+ module.exports = window["wp"]["dataControls"];
17496
+
17497
+ /***/ }),
17498
+
17499
+ /***/ 7180:
17500
+ /***/ (function(module) {
17501
+
17502
+ "use strict";
17503
+ module.exports = window["wp"]["deprecated"];
17504
+
17505
+ /***/ }),
17506
+
17507
+ /***/ 3260:
17508
+ /***/ (function() {
17509
+
17510
+ /* (ignored) */
17511
+
17512
+ /***/ })
17513
+
17514
+ /******/ });
17515
+ /************************************************************************/
17516
+ /******/ // The module cache
17517
+ /******/ var __webpack_module_cache__ = {};
17518
+ /******/
17519
+ /******/ // The require function
17520
+ /******/ function __webpack_require__(moduleId) {
17521
+ /******/ // Check if module is in cache
17522
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
17523
+ /******/ if (cachedModule !== undefined) {
17524
+ /******/ return cachedModule.exports;
17525
+ /******/ }
17526
+ /******/ // Create a new module (and put it into the cache)
17527
+ /******/ var module = __webpack_module_cache__[moduleId] = {
17528
+ /******/ // no module.id needed
17529
+ /******/ // no module.loaded needed
17530
+ /******/ exports: {}
17531
+ /******/ };
17532
+ /******/
17533
+ /******/ // Execute the module function
17534
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
17535
+ /******/
17536
+ /******/ // Return the exports of the module
17537
+ /******/ return module.exports;
17538
+ /******/ }
17539
+ /******/
17540
+ /************************************************************************/
17541
+ /******/ /* webpack/runtime/compat get default export */
17542
+ /******/ !function() {
17543
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
17544
+ /******/ __webpack_require__.n = function(module) {
17545
+ /******/ var getter = module && module.__esModule ?
17546
+ /******/ function() { return module['default']; } :
17547
+ /******/ function() { return module; };
17548
+ /******/ __webpack_require__.d(getter, { a: getter });
17549
+ /******/ return getter;
17550
+ /******/ };
17551
+ /******/ }();
17552
+ /******/
17553
+ /******/ /* webpack/runtime/define property getters */
17554
+ /******/ !function() {
17555
+ /******/ // define getter functions for harmony exports
17556
+ /******/ __webpack_require__.d = function(exports, definition) {
17557
+ /******/ for(var key in definition) {
17558
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
17559
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
17560
+ /******/ }
17561
+ /******/ }
17562
+ /******/ };
17563
+ /******/ }();
17564
+ /******/
17565
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
17566
+ /******/ !function() {
17567
+ /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
17568
+ /******/ }();
17569
+ /******/
17570
+ /******/ /* webpack/runtime/make namespace object */
17571
+ /******/ !function() {
17572
+ /******/ // define __esModule on exports
17573
+ /******/ __webpack_require__.r = function(exports) {
17574
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
17575
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
17576
+ /******/ }
17577
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
17578
+ /******/ };
17579
+ /******/ }();
17580
+ /******/
17581
+ /************************************************************************/
17582
+ var __webpack_exports__ = {};
17583
+ // This entry need to be wrapped in an IIFE because it need to be in strict mode.
17584
+ !function() {
17585
+ "use strict";
17586
+ __webpack_require__.r(__webpack_exports__);
17587
+ /* harmony import */ var _domain_suggestions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6274);
17588
+ /* harmony import */ var _plans__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3857);
17589
+ /* harmony import */ var _site__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(561);
17590
+ /* harmony import */ var _launch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5608);
17591
+ /* harmony import */ var _wpcom_features__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9512);
17592
+
17593
+
17594
+
17595
+
17596
+
17597
+ }();
17598
+ window.EditingToolkit = __webpack_exports__;
17599
+ /******/ })()
17600
+ ;
common/dist/disable-heic-images.js ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******/ (function() { // webpackBootstrap
2
+ /******/ "use strict";
3
+ /******/ var __webpack_modules__ = ({
4
+
5
+ /***/ 4333:
6
+ /***/ (function(module) {
7
+
8
+ module.exports = window["wp"]["compose"];
9
+
10
+ /***/ }),
11
+
12
+ /***/ 9307:
13
+ /***/ (function(module) {
14
+
15
+ module.exports = window["wp"]["element"];
16
+
17
+ /***/ }),
18
+
19
+ /***/ 2694:
20
+ /***/ (function(module) {
21
+
22
+ module.exports = window["wp"]["hooks"];
23
+
24
+ /***/ }),
25
+
26
+ /***/ 5736:
27
+ /***/ (function(module) {
28
+
29
+ module.exports = window["wp"]["i18n"];
30
+
31
+ /***/ })
32
+
33
+ /******/ });
34
+ /************************************************************************/
35
+ /******/ // The module cache
36
+ /******/ var __webpack_module_cache__ = {};
37
+ /******/
38
+ /******/ // The require function
39
+ /******/ function __webpack_require__(moduleId) {
40
+ /******/ // Check if module is in cache
41
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
42
+ /******/ if (cachedModule !== undefined) {
43
+ /******/ return cachedModule.exports;
44
+ /******/ }
45
+ /******/ // Create a new module (and put it into the cache)
46
+ /******/ var module = __webpack_module_cache__[moduleId] = {
47
+ /******/ // no module.id needed
48
+ /******/ // no module.loaded needed
49
+ /******/ exports: {}
50
+ /******/ };
51
+ /******/
52
+ /******/ // Execute the module function
53
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
54
+ /******/
55
+ /******/ // Return the exports of the module
56
+ /******/ return module.exports;
57
+ /******/ }
58
+ /******/
59
+ /************************************************************************/
60
+ /******/ /* webpack/runtime/compat get default export */
61
+ /******/ !function() {
62
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
63
+ /******/ __webpack_require__.n = function(module) {
64
+ /******/ var getter = module && module.__esModule ?
65
+ /******/ function() { return module['default']; } :
66
+ /******/ function() { return module; };
67
+ /******/ __webpack_require__.d(getter, { a: getter });
68
+ /******/ return getter;
69
+ /******/ };
70
+ /******/ }();
71
+ /******/
72
+ /******/ /* webpack/runtime/define property getters */
73
+ /******/ !function() {
74
+ /******/ // define getter functions for harmony exports
75
+ /******/ __webpack_require__.d = function(exports, definition) {
76
+ /******/ for(var key in definition) {
77
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
78
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
79
+ /******/ }
80
+ /******/ }
81
+ /******/ };
82
+ /******/ }();
83
+ /******/
84
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
85
+ /******/ !function() {
86
+ /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
87
+ /******/ }();
88
+ /******/
89
+ /******/ /* webpack/runtime/make namespace object */
90
+ /******/ !function() {
91
+ /******/ // define __esModule on exports
92
+ /******/ __webpack_require__.r = function(exports) {
93
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
94
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
95
+ /******/ }
96
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
97
+ /******/ };
98
+ /******/ }();
99
+ /******/
100
+ /************************************************************************/
101
+ var __webpack_exports__ = {};
102
+ // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
103
+ !function() {
104
+ __webpack_require__.r(__webpack_exports__);
105
+ /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4333);
106
+ /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_0__);
107
+ /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9307);
108
+ /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
109
+ /* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2694);
110
+ /* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_2__);
111
+ /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5736);
112
+ /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
113
+
114
+
115
+
116
+
117
+ const __ = _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__;
118
+ const DisableHEICImages = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_0__.createHigherOrderComponent)(MediaPlaceholder => {
119
+ return props => {
120
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(MediaPlaceholder, { ...props,
121
+ onFilesPreUpload: files => {
122
+ if (files) {
123
+ Object.values(files).forEach(file => {
124
+ var _filename$split$pop;
125
+
126
+ const filename = file.name;
127
+ const extension = (_filename$split$pop = filename.split('.').pop()) === null || _filename$split$pop === void 0 ? void 0 : _filename$split$pop.toLowerCase();
128
+
129
+ if ('heic' === extension || 'heif' === extension) {
130
+ const error = __('HEIC images are not viewable in the editor. Please convert to a JPG, PNG, or GIF and try again.', 'full-site-editing');
131
+
132
+ props.onError(error);
133
+ throw Error(error);
134
+ }
135
+ });
136
+ return files;
137
+ }
138
+ }
139
+ });
140
+ };
141
+ }, 'DisableHEICImages');
142
+ (0,_wordpress_hooks__WEBPACK_IMPORTED_MODULE_2__.addFilter)('editor.MediaPlaceholder', 'wpcom/DisableHEICImages', DisableHEICImages);
143
+ }();
144
+ window.EditingToolkit = __webpack_exports__;
145
+ /******/ })()
146
+ ;
common/dist/hide-plugin-buttons-mobile.js ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******/ (function() { // webpackBootstrap
2
+ /******/ "use strict";
3
+ /******/ var __webpack_modules__ = ({
4
+
5
+ /***/ 4515:
6
+ /***/ (function() {
7
+
8
+ // extracted by mini-css-extract-plugin
9
+
10
+
11
+ /***/ })
12
+
13
+ /******/ });
14
+ /************************************************************************/
15
+ /******/ // The module cache
16
+ /******/ var __webpack_module_cache__ = {};
17
+ /******/
18
+ /******/ // The require function
19
+ /******/ function __webpack_require__(moduleId) {
20
+ /******/ // Check if module is in cache
21
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
22
+ /******/ if (cachedModule !== undefined) {
23
+ /******/ return cachedModule.exports;
24
+ /******/ }
25
+ /******/ // Create a new module (and put it into the cache)
26
+ /******/ var module = __webpack_module_cache__[moduleId] = {
27
+ /******/ // no module.id needed
28
+ /******/ // no module.loaded needed
29
+ /******/ exports: {}
30
+ /******/ };
31
+ /******/
32
+ /******/ // Execute the module function
33
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
34
+ /******/
35
+ /******/ // Return the exports of the module
36
+ /******/ return module.exports;
37
+ /******/ }
38
+ /******/
39
+ /************************************************************************/
40
+ /******/ /* webpack/runtime/make namespace object */
41
+ /******/ !function() {
42
+ /******/ // define __esModule on exports
43
+ /******/ __webpack_require__.r = function(exports) {
44
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
45
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
46
+ /******/ }
47
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
48
+ /******/ };
49
+ /******/ }();
50
+ /******/
51
+ /************************************************************************/
52
+ var __webpack_exports__ = {};
53
+ // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
54
+ !function() {
55
+ __webpack_require__.r(__webpack_exports__);
56
+ /* harmony import */ var _hide_plugin_buttons_mobile_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4515);
57
+
58
+ }();
59
+ window.EditingToolkit = __webpack_exports__;
60
+ /******/ })()
61
+ ;
error-reporting/dist/error-reporting.js ADDED
@@ -0,0 +1,9898 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******/ (function() { // webpackBootstrap
2
+ /******/ "use strict";
3
+ /******/ var __webpack_modules__ = ({
4
+
5
+ /***/ 487:
6
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
7
+
8
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9
+ /* harmony export */ "u": function() { return /* binding */ BrowserBackend; }
10
+ /* harmony export */ });
11
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(334);
12
+ /* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4911);
13
+ /* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(9504);
14
+ /* harmony import */ var _sentry_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2226);
15
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9798);
16
+ /* harmony import */ var _eventbuilder__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1988);
17
+ /* harmony import */ var _transports__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1449);
18
+ /* harmony import */ var _transports__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(6149);
19
+ /* harmony import */ var _transports__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(4827);
20
+ /* harmony import */ var _transports__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(6144);
21
+
22
+
23
+
24
+
25
+
26
+
27
+ /**
28
+ * The Sentry Browser SDK Backend.
29
+ * @hidden
30
+ */
31
+ var BrowserBackend = /** @class */ (function (_super) {
32
+ (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__extends */ .ZT)(BrowserBackend, _super);
33
+ function BrowserBackend() {
34
+ return _super !== null && _super.apply(this, arguments) || this;
35
+ }
36
+ /**
37
+ * @inheritDoc
38
+ */
39
+ BrowserBackend.prototype.eventFromException = function (exception, hint) {
40
+ return (0,_eventbuilder__WEBPACK_IMPORTED_MODULE_1__/* .eventFromException */ .dr)(exception, hint, this._options.attachStacktrace);
41
+ };
42
+ /**
43
+ * @inheritDoc
44
+ */
45
+ BrowserBackend.prototype.eventFromMessage = function (message, level, hint) {
46
+ if (level === void 0) { level = _sentry_types__WEBPACK_IMPORTED_MODULE_2__/* .Severity.Info */ .z.Info; }
47
+ return (0,_eventbuilder__WEBPACK_IMPORTED_MODULE_1__/* .eventFromMessage */ .aB)(message, level, hint, this._options.attachStacktrace);
48
+ };
49
+ /**
50
+ * @inheritDoc
51
+ */
52
+ BrowserBackend.prototype._setupTransport = function () {
53
+ if (!this._options.dsn) {
54
+ // We return the noop transport here in case there is no Dsn.
55
+ return _super.prototype._setupTransport.call(this);
56
+ }
57
+ var transportOptions = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)({}, this._options.transportOptions), { dsn: this._options.dsn, tunnel: this._options.tunnel, sendClientReports: this._options.sendClientReports, _metadata: this._options._metadata });
58
+ var api = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__/* .initAPIDetails */ .hd)(transportOptions.dsn, transportOptions._metadata, transportOptions.tunnel);
59
+ var url = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__/* .getEnvelopeEndpointWithUrlEncodedAuth */ .Ut)(api.dsn, api.tunnel);
60
+ if (this._options.transport) {
61
+ return new this._options.transport(transportOptions);
62
+ }
63
+ if ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__/* .supportsFetch */ .Ak)()) {
64
+ var requestOptions = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)({}, transportOptions.fetchParameters);
65
+ this._newTransport = (0,_transports__WEBPACK_IMPORTED_MODULE_5__/* .makeNewFetchTransport */ .k)({ requestOptions: requestOptions, url: url });
66
+ return new _transports__WEBPACK_IMPORTED_MODULE_6__/* .FetchTransport */ .V(transportOptions);
67
+ }
68
+ this._newTransport = (0,_transports__WEBPACK_IMPORTED_MODULE_7__/* .makeNewXHRTransport */ .H)({
69
+ url: url,
70
+ headers: transportOptions.headers,
71
+ });
72
+ return new _transports__WEBPACK_IMPORTED_MODULE_8__/* .XHRTransport */ .w(transportOptions);
73
+ };
74
+ return BrowserBackend;
75
+ }(_sentry_core__WEBPACK_IMPORTED_MODULE_9__/* .BaseBackend */ .N));
76
+
77
+ //# sourceMappingURL=backend.js.map
78
+
79
+ /***/ }),
80
+
81
+ /***/ 2314:
82
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
83
+
84
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
85
+ /* harmony export */ "R": function() { return /* binding */ BrowserClient; }
86
+ /* harmony export */ });
87
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(334);
88
+ /* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1476);
89
+ /* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(9849);
90
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5907);
91
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8536);
92
+ /* harmony import */ var _backend__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(487);
93
+ /* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7904);
94
+ /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2634);
95
+ /* harmony import */ var _integrations__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(8356);
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+ /**
104
+ * The Sentry Browser SDK Client.
105
+ *
106
+ * @see BrowserOptions for documentation on configuration options.
107
+ * @see SentryClient for usage documentation.
108
+ */
109
+ var BrowserClient = /** @class */ (function (_super) {
110
+ (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__extends */ .ZT)(BrowserClient, _super);
111
+ /**
112
+ * Creates a new Browser SDK instance.
113
+ *
114
+ * @param options Configuration options for this SDK.
115
+ */
116
+ function BrowserClient(options) {
117
+ if (options === void 0) { options = {}; }
118
+ var _this = this;
119
+ options._metadata = options._metadata || {};
120
+ options._metadata.sdk = options._metadata.sdk || {
121
+ name: 'sentry.javascript.browser',
122
+ packages: [
123
+ {
124
+ name: 'npm:@sentry/browser',
125
+ version: _sentry_core__WEBPACK_IMPORTED_MODULE_1__/* .SDK_VERSION */ .J,
126
+ },
127
+ ],
128
+ version: _sentry_core__WEBPACK_IMPORTED_MODULE_1__/* .SDK_VERSION */ .J,
129
+ };
130
+ _this = _super.call(this, _backend__WEBPACK_IMPORTED_MODULE_2__/* .BrowserBackend */ .u, options) || this;
131
+ return _this;
132
+ }
133
+ /**
134
+ * Show a report dialog to the user to send feedback to a specific event.
135
+ *
136
+ * @param options Set individual options for the dialog
137
+ */
138
+ BrowserClient.prototype.showReportDialog = function (options) {
139
+ if (options === void 0) { options = {}; }
140
+ // doesn't work without a document (React Native)
141
+ var document = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__/* .getGlobalObject */ .R)().document;
142
+ if (!document) {
143
+ return;
144
+ }
145
+ if (!this._isEnabled()) {
146
+ _flags__WEBPACK_IMPORTED_MODULE_4__/* .IS_DEBUG_BUILD */ .h && _sentry_utils__WEBPACK_IMPORTED_MODULE_5__/* .logger.error */ .kg.error('Trying to call showReportDialog with Sentry Client disabled');
147
+ return;
148
+ }
149
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_6__/* .injectReportDialog */ .BS)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)({}, options), { dsn: options.dsn || this.getDsn() }));
150
+ };
151
+ /**
152
+ * @inheritDoc
153
+ */
154
+ BrowserClient.prototype._prepareEvent = function (event, scope, hint) {
155
+ event.platform = event.platform || 'javascript';
156
+ return _super.prototype._prepareEvent.call(this, event, scope, hint);
157
+ };
158
+ /**
159
+ * @inheritDoc
160
+ */
161
+ BrowserClient.prototype._sendEvent = function (event) {
162
+ var integration = this.getIntegration(_integrations__WEBPACK_IMPORTED_MODULE_7__/* .Breadcrumbs */ .O);
163
+ if (integration) {
164
+ integration.addSentryBreadcrumb(event);
165
+ }
166
+ _super.prototype._sendEvent.call(this, event);
167
+ };
168
+ return BrowserClient;
169
+ }(_sentry_core__WEBPACK_IMPORTED_MODULE_8__/* .BaseClient */ .W));
170
+
171
+ //# sourceMappingURL=client.js.map
172
+
173
+ /***/ }),
174
+
175
+ /***/ 1988:
176
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
177
+
178
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
179
+ /* harmony export */ "GJ": function() { return /* binding */ exceptionFromError; },
180
+ /* harmony export */ "dr": function() { return /* binding */ eventFromException; },
181
+ /* harmony export */ "aB": function() { return /* binding */ eventFromMessage; },
182
+ /* harmony export */ "ME": function() { return /* binding */ eventFromUnknownInput; }
183
+ /* harmony export */ });
184
+ /* unused harmony exports eventFromPlainObject, eventFromError, parseStackFrames, eventFromString */
185
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(334);
186
+ /* harmony import */ var _sentry_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2226);
187
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1757);
188
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1995);
189
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8035);
190
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9038);
191
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(3699);
192
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7946);
193
+ /* harmony import */ var _stack_parsers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2224);
194
+
195
+
196
+
197
+
198
+ /**
199
+ * This function creates an exception from an TraceKitStackTrace
200
+ * @param stacktrace TraceKitStackTrace that will be converted to an exception
201
+ * @hidden
202
+ */
203
+ function exceptionFromError(ex) {
204
+ // Get the frames first since Opera can lose the stack if we touch anything else first
205
+ var frames = parseStackFrames(ex);
206
+ var exception = {
207
+ type: ex && ex.name,
208
+ value: extractMessage(ex),
209
+ };
210
+ if (frames.length) {
211
+ exception.stacktrace = { frames: frames };
212
+ }
213
+ if (exception.type === undefined && exception.value === '') {
214
+ exception.value = 'Unrecoverable error caught';
215
+ }
216
+ return exception;
217
+ }
218
+ /**
219
+ * @hidden
220
+ */
221
+ function eventFromPlainObject(exception, syntheticException, isUnhandledRejection) {
222
+ var event = {
223
+ exception: {
224
+ values: [
225
+ {
226
+ type: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__/* .isEvent */ .cO)(exception) ? exception.constructor.name : isUnhandledRejection ? 'UnhandledRejection' : 'Error',
227
+ value: "Non-Error " + (isUnhandledRejection ? 'promise rejection' : 'exception') + " captured with keys: " + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__/* .extractExceptionKeysForMessage */ .zf)(exception),
228
+ },
229
+ ],
230
+ },
231
+ extra: {
232
+ __serialized__: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__/* .normalizeToSize */ .Qy)(exception),
233
+ },
234
+ };
235
+ if (syntheticException) {
236
+ var frames_1 = parseStackFrames(syntheticException);
237
+ if (frames_1.length) {
238
+ event.stacktrace = { frames: frames_1 };
239
+ }
240
+ }
241
+ return event;
242
+ }
243
+ /**
244
+ * @hidden
245
+ */
246
+ function eventFromError(ex) {
247
+ return {
248
+ exception: {
249
+ values: [exceptionFromError(ex)],
250
+ },
251
+ };
252
+ }
253
+ /** Parses stack frames from an error */
254
+ function parseStackFrames(ex) {
255
+ // Access and store the stacktrace property before doing ANYTHING
256
+ // else to it because Opera is not very good at providing it
257
+ // reliably in other circumstances.
258
+ var stacktrace = ex.stacktrace || ex.stack || '';
259
+ var popSize = getPopSize(ex);
260
+ try {
261
+ return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__/* .createStackParser */ .pE)(_stack_parsers__WEBPACK_IMPORTED_MODULE_4__/* .opera10StackParser */ .CS, _stack_parsers__WEBPACK_IMPORTED_MODULE_4__/* .opera11StackParser */ .ay, _stack_parsers__WEBPACK_IMPORTED_MODULE_4__/* .chromeStackParser */ .s$, _stack_parsers__WEBPACK_IMPORTED_MODULE_4__/* .winjsStackParser */ .aL, _stack_parsers__WEBPACK_IMPORTED_MODULE_4__/* .geckoStackParser */ .Pi)(stacktrace, popSize);
262
+ }
263
+ catch (e) {
264
+ // no-empty
265
+ }
266
+ return [];
267
+ }
268
+ // Based on our own mapping pattern - https://github.com/getsentry/sentry/blob/9f08305e09866c8bd6d0c24f5b0aabdd7dd6c59c/src/sentry/lang/javascript/errormapping.py#L83-L108
269
+ var reactMinifiedRegexp = /Minified React error #\d+;/i;
270
+ function getPopSize(ex) {
271
+ if (ex) {
272
+ if (typeof ex.framesToPop === 'number') {
273
+ return ex.framesToPop;
274
+ }
275
+ if (reactMinifiedRegexp.test(ex.message)) {
276
+ return 1;
277
+ }
278
+ }
279
+ return 0;
280
+ }
281
+ /**
282
+ * There are cases where stacktrace.message is an Event object
283
+ * https://github.com/getsentry/sentry-javascript/issues/1949
284
+ * In this specific case we try to extract stacktrace.message.error.message
285
+ */
286
+ function extractMessage(ex) {
287
+ var message = ex && ex.message;
288
+ if (!message) {
289
+ return 'No error message';
290
+ }
291
+ if (message.error && typeof message.error.message === 'string') {
292
+ return message.error.message;
293
+ }
294
+ return message;
295
+ }
296
+ /**
297
+ * Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`.
298
+ * @hidden
299
+ */
300
+ function eventFromException(exception, hint, attachStacktrace) {
301
+ var syntheticException = (hint && hint.syntheticException) || undefined;
302
+ var event = eventFromUnknownInput(exception, syntheticException, attachStacktrace);
303
+ (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_5__/* .addExceptionMechanism */ .EG)(event); // defaults to { type: 'generic', handled: true }
304
+ event.level = _sentry_types__WEBPACK_IMPORTED_MODULE_6__/* .Severity.Error */ .z.Error;
305
+ if (hint && hint.event_id) {
306
+ event.event_id = hint.event_id;
307
+ }
308
+ return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_7__/* .resolvedSyncPromise */ .WD)(event);
309
+ }
310
+ /**
311
+ * Builds and Event from a Message
312
+ * @hidden
313
+ */
314
+ function eventFromMessage(message, level, hint, attachStacktrace) {
315
+ if (level === void 0) { level = _sentry_types__WEBPACK_IMPORTED_MODULE_6__/* .Severity.Info */ .z.Info; }
316
+ var syntheticException = (hint && hint.syntheticException) || undefined;
317
+ var event = eventFromString(message, syntheticException, attachStacktrace);
318
+ event.level = level;
319
+ if (hint && hint.event_id) {
320
+ event.event_id = hint.event_id;
321
+ }
322
+ return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_7__/* .resolvedSyncPromise */ .WD)(event);
323
+ }
324
+ /**
325
+ * @hidden
326
+ */
327
+ function eventFromUnknownInput(exception, syntheticException, attachStacktrace, isUnhandledRejection) {
328
+ var event;
329
+ if ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__/* .isErrorEvent */ .VW)(exception) && exception.error) {
330
+ // If it is an ErrorEvent with `error` property, extract it to get actual Error
331
+ var errorEvent = exception;
332
+ return eventFromError(errorEvent.error);
333
+ }
334
+ // If it is a `DOMError` (which is a legacy API, but still supported in some browsers) then we just extract the name
335
+ // and message, as it doesn't provide anything else. According to the spec, all `DOMExceptions` should also be
336
+ // `Error`s, but that's not the case in IE11, so in that case we treat it the same as we do a `DOMError`.
337
+ //
338
+ // https://developer.mozilla.org/en-US/docs/Web/API/DOMError
339
+ // https://developer.mozilla.org/en-US/docs/Web/API/DOMException
340
+ // https://webidl.spec.whatwg.org/#es-DOMException-specialness
341
+ if ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__/* .isDOMError */ .TX)(exception) || (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__/* .isDOMException */ .fm)(exception)) {
342
+ var domException = exception;
343
+ if ('stack' in exception) {
344
+ event = eventFromError(exception);
345
+ }
346
+ else {
347
+ var name_1 = domException.name || ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__/* .isDOMError */ .TX)(domException) ? 'DOMError' : 'DOMException');
348
+ var message = domException.message ? name_1 + ": " + domException.message : name_1;
349
+ event = eventFromString(message, syntheticException, attachStacktrace);
350
+ (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_5__/* .addExceptionTypeValue */ .Db)(event, message);
351
+ }
352
+ if ('code' in domException) {
353
+ event.tags = (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__assign */ .pi)({}, event.tags), { 'DOMException.code': "" + domException.code });
354
+ }
355
+ return event;
356
+ }
357
+ if ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__/* .isError */ .VZ)(exception)) {
358
+ // we have a real Error object, do nothing
359
+ return eventFromError(exception);
360
+ }
361
+ if ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__/* .isPlainObject */ .PO)(exception) || (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__/* .isEvent */ .cO)(exception)) {
362
+ // If it's a plain object or an instance of `Event` (the built-in JS kind, not this SDK's `Event` type), serialize
363
+ // it manually. This will allow us to group events based on top-level keys which is much better than creating a new
364
+ // group on any key/value change.
365
+ var objectException = exception;
366
+ event = eventFromPlainObject(objectException, syntheticException, isUnhandledRejection);
367
+ (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_5__/* .addExceptionMechanism */ .EG)(event, {
368
+ synthetic: true,
369
+ });
370
+ return event;
371
+ }
372
+ // If none of previous checks were valid, then it means that it's not:
373
+ // - an instance of DOMError
374
+ // - an instance of DOMException
375
+ // - an instance of Event
376
+ // - an instance of Error
377
+ // - a valid ErrorEvent (one with an error property)
378
+ // - a plain Object
379
+ //
380
+ // So bail out and capture it as a simple message:
381
+ event = eventFromString(exception, syntheticException, attachStacktrace);
382
+ (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_5__/* .addExceptionTypeValue */ .Db)(event, "" + exception, undefined);
383
+ (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_5__/* .addExceptionMechanism */ .EG)(event, {
384
+ synthetic: true,
385
+ });
386
+ return event;
387
+ }
388
+ /**
389
+ * @hidden
390
+ */
391
+ function eventFromString(input, syntheticException, attachStacktrace) {
392
+ var event = {
393
+ message: input,
394
+ };
395
+ if (attachStacktrace && syntheticException) {
396
+ var frames_2 = parseStackFrames(syntheticException);
397
+ if (frames_2.length) {
398
+ event.stacktrace = { frames: frames_2 };
399
+ }
400
+ }
401
+ return event;
402
+ }
403
+ //# sourceMappingURL=eventbuilder.js.map
404
+
405
+ /***/ }),
406
+
407
+ /***/ 7904:
408
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
409
+
410
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
411
+ /* harmony export */ "h": function() { return /* binding */ IS_DEBUG_BUILD; }
412
+ /* harmony export */ });
413
+ /*
414
+ * This file defines flags and constants that can be modified during compile time in order to facilitate tree shaking
415
+ * for users.
416
+ *
417
+ * Debug flags need to be declared in each package individually and must not be imported across package boundaries,
418
+ * because some build tools have trouble tree-shaking imported guards.
419
+ *
420
+ * As a convention, we define debug flags in a `flags.ts` file in the root of a package's `src` folder.
421
+ *
422
+ * Debug flag files will contain "magic strings" like `__SENTRY_DEBUG__` that may get replaced with actual values during
423
+ * our, or the user's build process. Take care when introducing new flags - they must not throw if they are not
424
+ * replaced.
425
+ */
426
+ /** Flag that is true for debug builds, false otherwise. */
427
+ var IS_DEBUG_BUILD = typeof __SENTRY_DEBUG__ === 'undefined' ? true : __SENTRY_DEBUG__;
428
+ //# sourceMappingURL=flags.js.map
429
+
430
+ /***/ }),
431
+
432
+ /***/ 2634:
433
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
434
+
435
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
436
+ /* harmony export */ "Wz": function() { return /* binding */ shouldIgnoreOnError; },
437
+ /* harmony export */ "re": function() { return /* binding */ wrap; },
438
+ /* harmony export */ "BS": function() { return /* binding */ injectReportDialog; }
439
+ /* harmony export */ });
440
+ /* unused harmony export ignoreNextOnError */
441
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(334);
442
+ /* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4678);
443
+ /* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(4911);
444
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5907);
445
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1995);
446
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3699);
447
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(8536);
448
+ /* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7904);
449
+
450
+
451
+
452
+
453
+ var global = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__/* .getGlobalObject */ .R)();
454
+ var ignoreOnError = 0;
455
+ /**
456
+ * @hidden
457
+ */
458
+ function shouldIgnoreOnError() {
459
+ return ignoreOnError > 0;
460
+ }
461
+ /**
462
+ * @hidden
463
+ */
464
+ function ignoreNextOnError() {
465
+ // onerror should trigger before setTimeout
466
+ ignoreOnError += 1;
467
+ setTimeout(function () {
468
+ ignoreOnError -= 1;
469
+ });
470
+ }
471
+ /**
472
+ * Instruments the given function and sends an event to Sentry every time the
473
+ * function throws an exception.
474
+ *
475
+ * @param fn A function to wrap.
476
+ * @returns The wrapped function.
477
+ * @hidden
478
+ */
479
+ function wrap(fn, options, before) {
480
+ // for future readers what this does is wrap a function and then create
481
+ // a bi-directional wrapping between them.
482
+ //
483
+ // example: wrapped = wrap(original);
484
+ // original.__sentry_wrapped__ -> wrapped
485
+ // wrapped.__sentry_original__ -> original
486
+ if (options === void 0) { options = {}; }
487
+ if (typeof fn !== 'function') {
488
+ return fn;
489
+ }
490
+ try {
491
+ // if we're dealing with a function that was previously wrapped, return
492
+ // the original wrapper.
493
+ var wrapper = fn.__sentry_wrapped__;
494
+ if (wrapper) {
495
+ return wrapper;
496
+ }
497
+ // We don't wanna wrap it twice
498
+ if ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__/* .getOriginalFunction */ .HK)(fn)) {
499
+ return fn;
500
+ }
501
+ }
502
+ catch (e) {
503
+ // Just accessing custom props in some Selenium environments
504
+ // can cause a "Permission denied" exception (see raven-js#495).
505
+ // Bail on wrapping and return the function as-is (defers to window.onerror).
506
+ return fn;
507
+ }
508
+ /* eslint-disable prefer-rest-params */
509
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
510
+ var sentryWrapped = function () {
511
+ var args = Array.prototype.slice.call(arguments);
512
+ try {
513
+ if (before && typeof before === 'function') {
514
+ before.apply(this, arguments);
515
+ }
516
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
517
+ var wrappedArguments = args.map(function (arg) { return wrap(arg, options); });
518
+ // Attempt to invoke user-land function
519
+ // NOTE: If you are a Sentry user, and you are seeing this stack frame, it
520
+ // means the sentry.javascript SDK caught an error invoking your application code. This
521
+ // is expected behavior and NOT indicative of a bug with sentry.javascript.
522
+ return fn.apply(this, wrappedArguments);
523
+ }
524
+ catch (ex) {
525
+ ignoreNextOnError();
526
+ (0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__/* .withScope */ .$e)(function (scope) {
527
+ scope.addEventProcessor(function (event) {
528
+ if (options.mechanism) {
529
+ (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__/* .addExceptionTypeValue */ .Db)(event, undefined, undefined);
530
+ (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__/* .addExceptionMechanism */ .EG)(event, options.mechanism);
531
+ }
532
+ event.extra = (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__assign */ .pi)({}, event.extra), { arguments: args });
533
+ return event;
534
+ });
535
+ (0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__/* .captureException */ .Tb)(ex);
536
+ });
537
+ throw ex;
538
+ }
539
+ };
540
+ /* eslint-enable prefer-rest-params */
541
+ // Accessing some objects may throw
542
+ // ref: https://github.com/getsentry/sentry-javascript/issues/1168
543
+ try {
544
+ for (var property in fn) {
545
+ if (Object.prototype.hasOwnProperty.call(fn, property)) {
546
+ sentryWrapped[property] = fn[property];
547
+ }
548
+ }
549
+ }
550
+ catch (_oO) { } // eslint-disable-line no-empty
551
+ // Signal that this function has been wrapped/filled already
552
+ // for both debugging and to prevent it to being wrapped/filled twice
553
+ (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__/* .markFunctionWrapped */ .$Q)(sentryWrapped, fn);
554
+ (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__/* .addNonEnumerableProperty */ .xp)(fn, '__sentry_wrapped__', sentryWrapped);
555
+ // Restore original function name (not all browsers allow that)
556
+ try {
557
+ var descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name');
558
+ if (descriptor.configurable) {
559
+ Object.defineProperty(sentryWrapped, 'name', {
560
+ get: function () {
561
+ return fn.name;
562
+ },
563
+ });
564
+ }
565
+ // eslint-disable-next-line no-empty
566
+ }
567
+ catch (_oO) { }
568
+ return sentryWrapped;
569
+ }
570
+ /**
571
+ * Injects the Report Dialog script
572
+ * @hidden
573
+ */
574
+ function injectReportDialog(options) {
575
+ if (options === void 0) { options = {}; }
576
+ if (!global.document) {
577
+ return;
578
+ }
579
+ if (!options.eventId) {
580
+ _flags__WEBPACK_IMPORTED_MODULE_5__/* .IS_DEBUG_BUILD */ .h && _sentry_utils__WEBPACK_IMPORTED_MODULE_6__/* .logger.error */ .kg.error('Missing eventId option in showReportDialog call');
581
+ return;
582
+ }
583
+ if (!options.dsn) {
584
+ _flags__WEBPACK_IMPORTED_MODULE_5__/* .IS_DEBUG_BUILD */ .h && _sentry_utils__WEBPACK_IMPORTED_MODULE_6__/* .logger.error */ .kg.error('Missing dsn option in showReportDialog call');
585
+ return;
586
+ }
587
+ var script = global.document.createElement('script');
588
+ script.async = true;
589
+ script.src = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_7__/* .getReportDialogEndpoint */ .hR)(options.dsn, options);
590
+ if (options.onLoad) {
591
+ // eslint-disable-next-line @typescript-eslint/unbound-method
592
+ script.onload = options.onLoad;
593
+ }
594
+ var injectionPoint = global.document.head || global.document.body;
595
+ if (injectionPoint) {
596
+ injectionPoint.appendChild(script);
597
+ }
598
+ }
599
+ //# sourceMappingURL=helpers.js.map
600
+
601
+ /***/ }),
602
+
603
+ /***/ 8356:
604
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
605
+
606
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
607
+ /* harmony export */ "O": function() { return /* binding */ Breadcrumbs; }
608
+ /* harmony export */ });
609
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(334);
610
+ /* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8585);
611
+ /* harmony import */ var _sentry_types__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2226);
612
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3699);
613
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4005);
614
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4194);
615
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8653);
616
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(9660);
617
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(5907);
618
+
619
+ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
620
+ /* eslint-disable max-lines */
621
+
622
+
623
+
624
+ /**
625
+ * Default Breadcrumbs instrumentations
626
+ * TODO: Deprecated - with v6, this will be renamed to `Instrument`
627
+ */
628
+ var Breadcrumbs = /** @class */ (function () {
629
+ /**
630
+ * @inheritDoc
631
+ */
632
+ function Breadcrumbs(options) {
633
+ /**
634
+ * @inheritDoc
635
+ */
636
+ this.name = Breadcrumbs.id;
637
+ this._options = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)({ console: true, dom: true, fetch: true, history: true, sentry: true, xhr: true }, options);
638
+ }
639
+ /**
640
+ * Create a breadcrumb of `sentry` from the events themselves
641
+ */
642
+ Breadcrumbs.prototype.addSentryBreadcrumb = function (event) {
643
+ if (!this._options.sentry) {
644
+ return;
645
+ }
646
+ (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__/* .getCurrentHub */ .Gd)().addBreadcrumb({
647
+ category: "sentry." + (event.type === 'transaction' ? 'transaction' : 'event'),
648
+ event_id: event.event_id,
649
+ level: event.level,
650
+ message: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__/* .getEventDescription */ .jH)(event),
651
+ }, {
652
+ event: event,
653
+ });
654
+ };
655
+ /**
656
+ * Instrument browser built-ins w/ breadcrumb capturing
657
+ * - Console API
658
+ * - DOM API (click/typing)
659
+ * - XMLHttpRequest API
660
+ * - Fetch API
661
+ * - History API
662
+ */
663
+ Breadcrumbs.prototype.setupOnce = function () {
664
+ if (this._options.console) {
665
+ (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__/* .addInstrumentationHandler */ .o)('console', _consoleBreadcrumb);
666
+ }
667
+ if (this._options.dom) {
668
+ (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__/* .addInstrumentationHandler */ .o)('dom', _domBreadcrumb(this._options.dom));
669
+ }
670
+ if (this._options.xhr) {
671
+ (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__/* .addInstrumentationHandler */ .o)('xhr', _xhrBreadcrumb);
672
+ }
673
+ if (this._options.fetch) {
674
+ (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__/* .addInstrumentationHandler */ .o)('fetch', _fetchBreadcrumb);
675
+ }
676
+ if (this._options.history) {
677
+ (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__/* .addInstrumentationHandler */ .o)('history', _historyBreadcrumb);
678
+ }
679
+ };
680
+ /**
681
+ * @inheritDoc
682
+ */
683
+ Breadcrumbs.id = 'Breadcrumbs';
684
+ return Breadcrumbs;
685
+ }());
686
+
687
+ /**
688
+ * A HOC that creaes a function that creates breadcrumbs from DOM API calls.
689
+ * This is a HOC so that we get access to dom options in the closure.
690
+ */
691
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
692
+ function _domBreadcrumb(dom) {
693
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
694
+ function _innerDomBreadcrumb(handlerData) {
695
+ var target;
696
+ var keyAttrs = typeof dom === 'object' ? dom.serializeAttribute : undefined;
697
+ if (typeof keyAttrs === 'string') {
698
+ keyAttrs = [keyAttrs];
699
+ }
700
+ // Accessing event.target can throw (see getsentry/raven-js#838, #768)
701
+ try {
702
+ target = handlerData.event.target
703
+ ? (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__/* .htmlTreeAsString */ .R)(handlerData.event.target, keyAttrs)
704
+ : (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__/* .htmlTreeAsString */ .R)(handlerData.event, keyAttrs);
705
+ }
706
+ catch (e) {
707
+ target = '<unknown>';
708
+ }
709
+ if (target.length === 0) {
710
+ return;
711
+ }
712
+ (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__/* .getCurrentHub */ .Gd)().addBreadcrumb({
713
+ category: "ui." + handlerData.name,
714
+ message: target,
715
+ }, {
716
+ event: handlerData.event,
717
+ name: handlerData.name,
718
+ global: handlerData.global,
719
+ });
720
+ }
721
+ return _innerDomBreadcrumb;
722
+ }
723
+ /**
724
+ * Creates breadcrumbs from console API calls
725
+ */
726
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
727
+ function _consoleBreadcrumb(handlerData) {
728
+ var breadcrumb = {
729
+ category: 'console',
730
+ data: {
731
+ arguments: handlerData.args,
732
+ logger: 'console',
733
+ },
734
+ level: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_5__/* .severityFromString */ .E)(handlerData.level),
735
+ message: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_6__/* .safeJoin */ .nK)(handlerData.args, ' '),
736
+ };
737
+ if (handlerData.level === 'assert') {
738
+ if (handlerData.args[0] === false) {
739
+ breadcrumb.message = "Assertion failed: " + ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_6__/* .safeJoin */ .nK)(handlerData.args.slice(1), ' ') || 'console.assert');
740
+ breadcrumb.data.arguments = handlerData.args.slice(1);
741
+ }
742
+ else {
743
+ // Don't capture a breadcrumb for passed assertions
744
+ return;
745
+ }
746
+ }
747
+ (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__/* .getCurrentHub */ .Gd)().addBreadcrumb(breadcrumb, {
748
+ input: handlerData.args,
749
+ level: handlerData.level,
750
+ });
751
+ }
752
+ /**
753
+ * Creates breadcrumbs from XHR API calls
754
+ */
755
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
756
+ function _xhrBreadcrumb(handlerData) {
757
+ if (handlerData.endTimestamp) {
758
+ // We only capture complete, non-sentry requests
759
+ if (handlerData.xhr.__sentry_own_request__) {
760
+ return;
761
+ }
762
+ var _a = handlerData.xhr.__sentry_xhr__ || {}, method = _a.method, url = _a.url, status_code = _a.status_code, body = _a.body;
763
+ (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__/* .getCurrentHub */ .Gd)().addBreadcrumb({
764
+ category: 'xhr',
765
+ data: {
766
+ method: method,
767
+ url: url,
768
+ status_code: status_code,
769
+ },
770
+ type: 'http',
771
+ }, {
772
+ xhr: handlerData.xhr,
773
+ input: body,
774
+ });
775
+ return;
776
+ }
777
+ }
778
+ /**
779
+ * Creates breadcrumbs from fetch API calls
780
+ */
781
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
782
+ function _fetchBreadcrumb(handlerData) {
783
+ // We only capture complete fetch requests
784
+ if (!handlerData.endTimestamp) {
785
+ return;
786
+ }
787
+ if (handlerData.fetchData.url.match(/sentry_key/) && handlerData.fetchData.method === 'POST') {
788
+ // We will not create breadcrumbs for fetch requests that contain `sentry_key` (internal sentry requests)
789
+ return;
790
+ }
791
+ if (handlerData.error) {
792
+ (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__/* .getCurrentHub */ .Gd)().addBreadcrumb({
793
+ category: 'fetch',
794
+ data: handlerData.fetchData,
795
+ level: _sentry_types__WEBPACK_IMPORTED_MODULE_7__/* .Severity.Error */ .z.Error,
796
+ type: 'http',
797
+ }, {
798
+ data: handlerData.error,
799
+ input: handlerData.args,
800
+ });
801
+ }
802
+ else {
803
+ (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__/* .getCurrentHub */ .Gd)().addBreadcrumb({
804
+ category: 'fetch',
805
+ data: (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)({}, handlerData.fetchData), { status_code: handlerData.response.status }),
806
+ type: 'http',
807
+ }, {
808
+ input: handlerData.args,
809
+ response: handlerData.response,
810
+ });
811
+ }
812
+ }
813
+ /**
814
+ * Creates breadcrumbs from history API calls
815
+ */
816
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
817
+ function _historyBreadcrumb(handlerData) {
818
+ var global = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_8__/* .getGlobalObject */ .R)();
819
+ var from = handlerData.from;
820
+ var to = handlerData.to;
821
+ var parsedLoc = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__/* .parseUrl */ .en)(global.location.href);
822
+ var parsedFrom = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__/* .parseUrl */ .en)(from);
823
+ var parsedTo = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__/* .parseUrl */ .en)(to);
824
+ // Initial pushState doesn't provide `from` information
825
+ if (!parsedFrom.path) {
826
+ parsedFrom = parsedLoc;
827
+ }
828
+ // Use only the path component of the URL if the URL matches the current
829
+ // document (almost all the time when using pushState)
830
+ if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) {
831
+ to = parsedTo.relative;
832
+ }
833
+ if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) {
834
+ from = parsedFrom.relative;
835
+ }
836
+ (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__/* .getCurrentHub */ .Gd)().addBreadcrumb({
837
+ category: 'navigation',
838
+ data: {
839
+ from: from,
840
+ to: to,
841
+ },
842
+ });
843
+ }
844
+ //# sourceMappingURL=breadcrumbs.js.map
845
+
846
+ /***/ }),
847
+
848
+ /***/ 184:
849
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
850
+
851
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
852
+ /* harmony export */ "I": function() { return /* binding */ Dedupe; }
853
+ /* harmony export */ });
854
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8536);
855
+ /* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7904);
856
+
857
+
858
+ /** Deduplication filter */
859
+ var Dedupe = /** @class */ (function () {
860
+ function Dedupe() {
861
+ /**
862
+ * @inheritDoc
863
+ */
864
+ this.name = Dedupe.id;
865
+ }
866
+ /**
867
+ * @inheritDoc
868
+ */
869
+ Dedupe.prototype.setupOnce = function (addGlobalEventProcessor, getCurrentHub) {
870
+ addGlobalEventProcessor(function (currentEvent) {
871
+ var self = getCurrentHub().getIntegration(Dedupe);
872
+ if (self) {
873
+ // Juuust in case something goes wrong
874
+ try {
875
+ if (_shouldDropEvent(currentEvent, self._previousEvent)) {
876
+ _flags__WEBPACK_IMPORTED_MODULE_0__/* .IS_DEBUG_BUILD */ .h && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__/* .logger.warn */ .kg.warn('Event dropped due to being a duplicate of previously captured event.');
877
+ return null;
878
+ }
879
+ }
880
+ catch (_oO) {
881
+ return (self._previousEvent = currentEvent);
882
+ }
883
+ return (self._previousEvent = currentEvent);
884
+ }
885
+ return currentEvent;
886
+ });
887
+ };
888
+ /**
889
+ * @inheritDoc
890
+ */
891
+ Dedupe.id = 'Dedupe';
892
+ return Dedupe;
893
+ }());
894
+
895
+ /** JSDoc */
896
+ function _shouldDropEvent(currentEvent, previousEvent) {
897
+ if (!previousEvent) {
898
+ return false;
899
+ }
900
+ if (_isSameMessageEvent(currentEvent, previousEvent)) {
901
+ return true;
902
+ }
903
+ if (_isSameExceptionEvent(currentEvent, previousEvent)) {
904
+ return true;
905
+ }
906
+ return false;
907
+ }
908
+ /** JSDoc */
909
+ function _isSameMessageEvent(currentEvent, previousEvent) {
910
+ var currentMessage = currentEvent.message;
911
+ var previousMessage = previousEvent.message;
912
+ // If neither event has a message property, they were both exceptions, so bail out
913
+ if (!currentMessage && !previousMessage) {
914
+ return false;
915
+ }
916
+ // If only one event has a stacktrace, but not the other one, they are not the same
917
+ if ((currentMessage && !previousMessage) || (!currentMessage && previousMessage)) {
918
+ return false;
919
+ }
920
+ if (currentMessage !== previousMessage) {
921
+ return false;
922
+ }
923
+ if (!_isSameFingerprint(currentEvent, previousEvent)) {
924
+ return false;
925
+ }
926
+ if (!_isSameStacktrace(currentEvent, previousEvent)) {
927
+ return false;
928
+ }
929
+ return true;
930
+ }
931
+ /** JSDoc */
932
+ function _isSameExceptionEvent(currentEvent, previousEvent) {
933
+ var previousException = _getExceptionFromEvent(previousEvent);
934
+ var currentException = _getExceptionFromEvent(currentEvent);
935
+ if (!previousException || !currentException) {
936
+ return false;
937
+ }
938
+ if (previousException.type !== currentException.type || previousException.value !== currentException.value) {
939
+ return false;
940
+ }
941
+ if (!_isSameFingerprint(currentEvent, previousEvent)) {
942
+ return false;
943
+ }
944
+ if (!_isSameStacktrace(currentEvent, previousEvent)) {
945
+ return false;
946
+ }
947
+ return true;
948
+ }
949
+ /** JSDoc */
950
+ function _isSameStacktrace(currentEvent, previousEvent) {
951
+ var currentFrames = _getFramesFromEvent(currentEvent);
952
+ var previousFrames = _getFramesFromEvent(previousEvent);
953
+ // If neither event has a stacktrace, they are assumed to be the same
954
+ if (!currentFrames && !previousFrames) {
955
+ return true;
956
+ }
957
+ // If only one event has a stacktrace, but not the other one, they are not the same
958
+ if ((currentFrames && !previousFrames) || (!currentFrames && previousFrames)) {
959
+ return false;
960
+ }
961
+ currentFrames = currentFrames;
962
+ previousFrames = previousFrames;
963
+ // If number of frames differ, they are not the same
964
+ if (previousFrames.length !== currentFrames.length) {
965
+ return false;
966
+ }
967
+ // Otherwise, compare the two
968
+ for (var i = 0; i < previousFrames.length; i++) {
969
+ var frameA = previousFrames[i];
970
+ var frameB = currentFrames[i];
971
+ if (frameA.filename !== frameB.filename ||
972
+ frameA.lineno !== frameB.lineno ||
973
+ frameA.colno !== frameB.colno ||
974
+ frameA.function !== frameB.function) {
975
+ return false;
976
+ }
977
+ }
978
+ return true;
979
+ }
980
+ /** JSDoc */
981
+ function _isSameFingerprint(currentEvent, previousEvent) {
982
+ var currentFingerprint = currentEvent.fingerprint;
983
+ var previousFingerprint = previousEvent.fingerprint;
984
+ // If neither event has a fingerprint, they are assumed to be the same
985
+ if (!currentFingerprint && !previousFingerprint) {
986
+ return true;
987
+ }
988
+ // If only one event has a fingerprint, but not the other one, they are not the same
989
+ if ((currentFingerprint && !previousFingerprint) || (!currentFingerprint && previousFingerprint)) {
990
+ return false;
991
+ }
992
+ currentFingerprint = currentFingerprint;
993
+ previousFingerprint = previousFingerprint;
994
+ // Otherwise, compare the two
995
+ try {
996
+ return !!(currentFingerprint.join('') === previousFingerprint.join(''));
997
+ }
998
+ catch (_oO) {
999
+ return false;
1000
+ }
1001
+ }
1002
+ /** JSDoc */
1003
+ function _getExceptionFromEvent(event) {
1004
+ return event.exception && event.exception.values && event.exception.values[0];
1005
+ }
1006
+ /** JSDoc */
1007
+ function _getFramesFromEvent(event) {
1008
+ var exception = event.exception;
1009
+ if (exception) {
1010
+ try {
1011
+ // @ts-ignore Object could be undefined
1012
+ return exception.values[0].stacktrace.frames;
1013
+ }
1014
+ catch (_oO) {
1015
+ return undefined;
1016
+ }
1017
+ }
1018
+ else if (event.stacktrace) {
1019
+ return event.stacktrace.frames;
1020
+ }
1021
+ return undefined;
1022
+ }
1023
+ //# sourceMappingURL=dedupe.js.map
1024
+
1025
+ /***/ }),
1026
+
1027
+ /***/ 1228:
1028
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
1029
+
1030
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1031
+ /* harmony export */ "d": function() { return /* binding */ GlobalHandlers; }
1032
+ /* harmony export */ });
1033
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(334);
1034
+ /* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(8585);
1035
+ /* harmony import */ var _sentry_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2226);
1036
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4005);
1037
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1757);
1038
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(4194);
1039
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(8536);
1040
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(3699);
1041
+ /* harmony import */ var _eventbuilder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1988);
1042
+ /* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7904);
1043
+ /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2634);
1044
+
1045
+ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
1046
+
1047
+
1048
+
1049
+
1050
+
1051
+
1052
+ /** Global handlers */
1053
+ var GlobalHandlers = /** @class */ (function () {
1054
+ /** JSDoc */
1055
+ function GlobalHandlers(options) {
1056
+ /**
1057
+ * @inheritDoc
1058
+ */
1059
+ this.name = GlobalHandlers.id;
1060
+ /**
1061
+ * Stores references functions to installing handlers. Will set to undefined
1062
+ * after they have been run so that they are not used twice.
1063
+ */
1064
+ this._installFunc = {
1065
+ onerror: _installGlobalOnErrorHandler,
1066
+ onunhandledrejection: _installGlobalOnUnhandledRejectionHandler,
1067
+ };
1068
+ this._options = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)({ onerror: true, onunhandledrejection: true }, options);
1069
+ }
1070
+ /**
1071
+ * @inheritDoc
1072
+ */
1073
+ GlobalHandlers.prototype.setupOnce = function () {
1074
+ Error.stackTraceLimit = 50;
1075
+ var options = this._options;
1076
+ // We can disable guard-for-in as we construct the options object above + do checks against
1077
+ // `this._installFunc` for the property.
1078
+ // eslint-disable-next-line guard-for-in
1079
+ for (var key in options) {
1080
+ var installFunc = this._installFunc[key];
1081
+ if (installFunc && options[key]) {
1082
+ globalHandlerLog(key);
1083
+ installFunc();
1084
+ this._installFunc[key] = undefined;
1085
+ }
1086
+ }
1087
+ };
1088
+ /**
1089
+ * @inheritDoc
1090
+ */
1091
+ GlobalHandlers.id = 'GlobalHandlers';
1092
+ return GlobalHandlers;
1093
+ }());
1094
+
1095
+ /** JSDoc */
1096
+ function _installGlobalOnErrorHandler() {
1097
+ (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__/* .addInstrumentationHandler */ .o)('error',
1098
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1099
+ function (data) {
1100
+ var _a = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__read */ .CR)(getHubAndAttachStacktrace(), 2), hub = _a[0], attachStacktrace = _a[1];
1101
+ if (!hub.getIntegration(GlobalHandlers)) {
1102
+ return;
1103
+ }
1104
+ var msg = data.msg, url = data.url, line = data.line, column = data.column, error = data.error;
1105
+ if ((0,_helpers__WEBPACK_IMPORTED_MODULE_2__/* .shouldIgnoreOnError */ .Wz)() || (error && error.__sentry_own_request__)) {
1106
+ return;
1107
+ }
1108
+ var event = error === undefined && (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__/* .isString */ .HD)(msg)
1109
+ ? _eventFromIncompleteOnError(msg, url, line, column)
1110
+ : _enhanceEventWithInitialFrame((0,_eventbuilder__WEBPACK_IMPORTED_MODULE_4__/* .eventFromUnknownInput */ .ME)(error || msg, undefined, attachStacktrace, false), url, line, column);
1111
+ event.level = _sentry_types__WEBPACK_IMPORTED_MODULE_5__/* .Severity.Error */ .z.Error;
1112
+ addMechanismAndCapture(hub, error, event, 'onerror');
1113
+ });
1114
+ }
1115
+ /** JSDoc */
1116
+ function _installGlobalOnUnhandledRejectionHandler() {
1117
+ (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__/* .addInstrumentationHandler */ .o)('unhandledrejection',
1118
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1119
+ function (e) {
1120
+ var _a = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__read */ .CR)(getHubAndAttachStacktrace(), 2), hub = _a[0], attachStacktrace = _a[1];
1121
+ if (!hub.getIntegration(GlobalHandlers)) {
1122
+ return;
1123
+ }
1124
+ var error = e;
1125
+ // dig the object of the rejection out of known event types
1126
+ try {
1127
+ // PromiseRejectionEvents store the object of the rejection under 'reason'
1128
+ // see https://developer.mozilla.org/en-US/docs/Web/API/PromiseRejectionEvent
1129
+ if ('reason' in e) {
1130
+ error = e.reason;
1131
+ }
1132
+ // something, somewhere, (likely a browser extension) effectively casts PromiseRejectionEvents
1133
+ // to CustomEvents, moving the `promise` and `reason` attributes of the PRE into
1134
+ // the CustomEvent's `detail` attribute, since they're not part of CustomEvent's spec
1135
+ // see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent and
1136
+ // https://github.com/getsentry/sentry-javascript/issues/2380
1137
+ else if ('detail' in e && 'reason' in e.detail) {
1138
+ error = e.detail.reason;
1139
+ }
1140
+ }
1141
+ catch (_oO) {
1142
+ // no-empty
1143
+ }
1144
+ if ((0,_helpers__WEBPACK_IMPORTED_MODULE_2__/* .shouldIgnoreOnError */ .Wz)() || (error && error.__sentry_own_request__)) {
1145
+ return true;
1146
+ }
1147
+ var event = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__/* .isPrimitive */ .pt)(error)
1148
+ ? _eventFromRejectionWithPrimitive(error)
1149
+ : (0,_eventbuilder__WEBPACK_IMPORTED_MODULE_4__/* .eventFromUnknownInput */ .ME)(error, undefined, attachStacktrace, true);
1150
+ event.level = _sentry_types__WEBPACK_IMPORTED_MODULE_5__/* .Severity.Error */ .z.Error;
1151
+ addMechanismAndCapture(hub, error, event, 'onunhandledrejection');
1152
+ return;
1153
+ });
1154
+ }
1155
+ /**
1156
+ * Create an event from a promise rejection where the `reason` is a primitive.
1157
+ *
1158
+ * @param reason: The `reason` property of the promise rejection
1159
+ * @returns An Event object with an appropriate `exception` value
1160
+ */
1161
+ function _eventFromRejectionWithPrimitive(reason) {
1162
+ return {
1163
+ exception: {
1164
+ values: [
1165
+ {
1166
+ type: 'UnhandledRejection',
1167
+ // String() is needed because the Primitive type includes symbols (which can't be automatically stringified)
1168
+ value: "Non-Error promise rejection captured with value: " + String(reason),
1169
+ },
1170
+ ],
1171
+ },
1172
+ };
1173
+ }
1174
+ /**
1175
+ * This function creates a stack from an old, error-less onerror handler.
1176
+ */
1177
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1178
+ function _eventFromIncompleteOnError(msg, url, line, column) {
1179
+ var ERROR_TYPES_RE = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;
1180
+ // If 'message' is ErrorEvent, get real message from inside
1181
+ var message = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__/* .isErrorEvent */ .VW)(msg) ? msg.message : msg;
1182
+ var name = 'Error';
1183
+ var groups = message.match(ERROR_TYPES_RE);
1184
+ if (groups) {
1185
+ name = groups[1];
1186
+ message = groups[2];
1187
+ }
1188
+ var event = {
1189
+ exception: {
1190
+ values: [
1191
+ {
1192
+ type: name,
1193
+ value: message,
1194
+ },
1195
+ ],
1196
+ },
1197
+ };
1198
+ return _enhanceEventWithInitialFrame(event, url, line, column);
1199
+ }
1200
+ /** JSDoc */
1201
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1202
+ function _enhanceEventWithInitialFrame(event, url, line, column) {
1203
+ // event.exception
1204
+ var e = (event.exception = event.exception || {});
1205
+ // event.exception.values
1206
+ var ev = (e.values = e.values || []);
1207
+ // event.exception.values[0]
1208
+ var ev0 = (ev[0] = ev[0] || {});
1209
+ // event.exception.values[0].stacktrace
1210
+ var ev0s = (ev0.stacktrace = ev0.stacktrace || {});
1211
+ // event.exception.values[0].stacktrace.frames
1212
+ var ev0sf = (ev0s.frames = ev0s.frames || []);
1213
+ var colno = isNaN(parseInt(column, 10)) ? undefined : column;
1214
+ var lineno = isNaN(parseInt(line, 10)) ? undefined : line;
1215
+ var filename = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__/* .isString */ .HD)(url) && url.length > 0 ? url : (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_6__/* .getLocationHref */ .l)();
1216
+ // event.exception.values[0].stacktrace.frames
1217
+ if (ev0sf.length === 0) {
1218
+ ev0sf.push({
1219
+ colno: colno,
1220
+ filename: filename,
1221
+ function: '?',
1222
+ in_app: true,
1223
+ lineno: lineno,
1224
+ });
1225
+ }
1226
+ return event;
1227
+ }
1228
+ function globalHandlerLog(type) {
1229
+ _flags__WEBPACK_IMPORTED_MODULE_7__/* .IS_DEBUG_BUILD */ .h && _sentry_utils__WEBPACK_IMPORTED_MODULE_8__/* .logger.log */ .kg.log("Global Handler attached: " + type);
1230
+ }
1231
+ function addMechanismAndCapture(hub, error, event, type) {
1232
+ (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_9__/* .addExceptionMechanism */ .EG)(event, {
1233
+ handled: false,
1234
+ type: type,
1235
+ });
1236
+ hub.captureEvent(event, {
1237
+ originalException: error,
1238
+ });
1239
+ }
1240
+ function getHubAndAttachStacktrace() {
1241
+ var hub = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_10__/* .getCurrentHub */ .Gd)();
1242
+ var client = hub.getClient();
1243
+ var attachStacktrace = client && client.getOptions().attachStacktrace;
1244
+ return [hub, attachStacktrace];
1245
+ }
1246
+ //# sourceMappingURL=globalhandlers.js.map
1247
+
1248
+ /***/ }),
1249
+
1250
+ /***/ 3440:
1251
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
1252
+
1253
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1254
+ /* harmony export */ "iP": function() { return /* binding */ LinkedErrors; }
1255
+ /* harmony export */ });
1256
+ /* unused harmony exports _handler, _walkErrorTree */
1257
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(334);
1258
+ /* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1684);
1259
+ /* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8585);
1260
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1757);
1261
+ /* harmony import */ var _eventbuilder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1988);
1262
+
1263
+
1264
+
1265
+
1266
+ var DEFAULT_KEY = 'cause';
1267
+ var DEFAULT_LIMIT = 5;
1268
+ /** Adds SDK info to an event. */
1269
+ var LinkedErrors = /** @class */ (function () {
1270
+ /**
1271
+ * @inheritDoc
1272
+ */
1273
+ function LinkedErrors(options) {
1274
+ if (options === void 0) { options = {}; }
1275
+ /**
1276
+ * @inheritDoc
1277
+ */
1278
+ this.name = LinkedErrors.id;
1279
+ this._key = options.key || DEFAULT_KEY;
1280
+ this._limit = options.limit || DEFAULT_LIMIT;
1281
+ }
1282
+ /**
1283
+ * @inheritDoc
1284
+ */
1285
+ LinkedErrors.prototype.setupOnce = function () {
1286
+ (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__/* .addGlobalEventProcessor */ .c)(function (event, hint) {
1287
+ var self = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__/* .getCurrentHub */ .Gd)().getIntegration(LinkedErrors);
1288
+ return self ? _handler(self._key, self._limit, event, hint) : event;
1289
+ });
1290
+ };
1291
+ /**
1292
+ * @inheritDoc
1293
+ */
1294
+ LinkedErrors.id = 'LinkedErrors';
1295
+ return LinkedErrors;
1296
+ }());
1297
+
1298
+ /**
1299
+ * @inheritDoc
1300
+ */
1301
+ function _handler(key, limit, event, hint) {
1302
+ if (!event.exception || !event.exception.values || !hint || !(0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__/* .isInstanceOf */ .V9)(hint.originalException, Error)) {
1303
+ return event;
1304
+ }
1305
+ var linkedErrors = _walkErrorTree(limit, hint.originalException, key);
1306
+ event.exception.values = (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__spread */ .fl)(linkedErrors, event.exception.values);
1307
+ return event;
1308
+ }
1309
+ /**
1310
+ * JSDOC
1311
+ */
1312
+ function _walkErrorTree(limit, error, key, stack) {
1313
+ if (stack === void 0) { stack = []; }
1314
+ if (!(0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__/* .isInstanceOf */ .V9)(error[key], Error) || stack.length + 1 >= limit) {
1315
+ return stack;
1316
+ }
1317
+ var exception = (0,_eventbuilder__WEBPACK_IMPORTED_MODULE_4__/* .exceptionFromError */ .GJ)(error[key]);
1318
+ return _walkErrorTree(limit, error[key], key, (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__spread */ .fl)([exception], stack));
1319
+ }
1320
+ //# sourceMappingURL=linkederrors.js.map
1321
+
1322
+ /***/ }),
1323
+
1324
+ /***/ 3399:
1325
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
1326
+
1327
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1328
+ /* harmony export */ "p": function() { return /* binding */ TryCatch; }
1329
+ /* harmony export */ });
1330
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(334);
1331
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5907);
1332
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1995);
1333
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9038);
1334
+ /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2634);
1335
+
1336
+
1337
+
1338
+ var DEFAULT_EVENT_TARGET = [
1339
+ 'EventTarget',
1340
+ 'Window',
1341
+ 'Node',
1342
+ 'ApplicationCache',
1343
+ 'AudioTrackList',
1344
+ 'ChannelMergerNode',
1345
+ 'CryptoOperation',
1346
+ 'EventSource',
1347
+ 'FileReader',
1348
+ 'HTMLUnknownElement',
1349
+ 'IDBDatabase',
1350
+ 'IDBRequest',
1351
+ 'IDBTransaction',
1352
+ 'KeyOperation',
1353
+ 'MediaController',
1354
+ 'MessagePort',
1355
+ 'ModalWindow',
1356
+ 'Notification',
1357
+ 'SVGElementInstance',
1358
+ 'Screen',
1359
+ 'TextTrack',
1360
+ 'TextTrackCue',
1361
+ 'TextTrackList',
1362
+ 'WebSocket',
1363
+ 'WebSocketWorker',
1364
+ 'Worker',
1365
+ 'XMLHttpRequest',
1366
+ 'XMLHttpRequestEventTarget',
1367
+ 'XMLHttpRequestUpload',
1368
+ ];
1369
+ /** Wrap timer functions and event targets to catch errors and provide better meta data */
1370
+ var TryCatch = /** @class */ (function () {
1371
+ /**
1372
+ * @inheritDoc
1373
+ */
1374
+ function TryCatch(options) {
1375
+ /**
1376
+ * @inheritDoc
1377
+ */
1378
+ this.name = TryCatch.id;
1379
+ this._options = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)({ XMLHttpRequest: true, eventTarget: true, requestAnimationFrame: true, setInterval: true, setTimeout: true }, options);
1380
+ }
1381
+ /**
1382
+ * Wrap timer functions and event targets to catch errors
1383
+ * and provide better metadata.
1384
+ */
1385
+ TryCatch.prototype.setupOnce = function () {
1386
+ var global = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__/* .getGlobalObject */ .R)();
1387
+ if (this._options.setTimeout) {
1388
+ (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__/* .fill */ .hl)(global, 'setTimeout', _wrapTimeFunction);
1389
+ }
1390
+ if (this._options.setInterval) {
1391
+ (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__/* .fill */ .hl)(global, 'setInterval', _wrapTimeFunction);
1392
+ }
1393
+ if (this._options.requestAnimationFrame) {
1394
+ (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__/* .fill */ .hl)(global, 'requestAnimationFrame', _wrapRAF);
1395
+ }
1396
+ if (this._options.XMLHttpRequest && 'XMLHttpRequest' in global) {
1397
+ (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__/* .fill */ .hl)(XMLHttpRequest.prototype, 'send', _wrapXHR);
1398
+ }
1399
+ var eventTargetOption = this._options.eventTarget;
1400
+ if (eventTargetOption) {
1401
+ var eventTarget = Array.isArray(eventTargetOption) ? eventTargetOption : DEFAULT_EVENT_TARGET;
1402
+ eventTarget.forEach(_wrapEventTarget);
1403
+ }
1404
+ };
1405
+ /**
1406
+ * @inheritDoc
1407
+ */
1408
+ TryCatch.id = 'TryCatch';
1409
+ return TryCatch;
1410
+ }());
1411
+
1412
+ /** JSDoc */
1413
+ function _wrapTimeFunction(original) {
1414
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1415
+ return function () {
1416
+ var args = [];
1417
+ for (var _i = 0; _i < arguments.length; _i++) {
1418
+ args[_i] = arguments[_i];
1419
+ }
1420
+ var originalCallback = args[0];
1421
+ args[0] = (0,_helpers__WEBPACK_IMPORTED_MODULE_3__/* .wrap */ .re)(originalCallback, {
1422
+ mechanism: {
1423
+ data: { function: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__/* .getFunctionName */ .$P)(original) },
1424
+ handled: true,
1425
+ type: 'instrument',
1426
+ },
1427
+ });
1428
+ return original.apply(this, args);
1429
+ };
1430
+ }
1431
+ /** JSDoc */
1432
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1433
+ function _wrapRAF(original) {
1434
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1435
+ return function (callback) {
1436
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
1437
+ return original.apply(this, [
1438
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_3__/* .wrap */ .re)(callback, {
1439
+ mechanism: {
1440
+ data: {
1441
+ function: 'requestAnimationFrame',
1442
+ handler: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__/* .getFunctionName */ .$P)(original),
1443
+ },
1444
+ handled: true,
1445
+ type: 'instrument',
1446
+ },
1447
+ }),
1448
+ ]);
1449
+ };
1450
+ }
1451
+ /** JSDoc */
1452
+ function _wrapXHR(originalSend) {
1453
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1454
+ return function () {
1455
+ var args = [];
1456
+ for (var _i = 0; _i < arguments.length; _i++) {
1457
+ args[_i] = arguments[_i];
1458
+ }
1459
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
1460
+ var xhr = this;
1461
+ var xmlHttpRequestProps = ['onload', 'onerror', 'onprogress', 'onreadystatechange'];
1462
+ xmlHttpRequestProps.forEach(function (prop) {
1463
+ if (prop in xhr && typeof xhr[prop] === 'function') {
1464
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1465
+ (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__/* .fill */ .hl)(xhr, prop, function (original) {
1466
+ var wrapOptions = {
1467
+ mechanism: {
1468
+ data: {
1469
+ function: prop,
1470
+ handler: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__/* .getFunctionName */ .$P)(original),
1471
+ },
1472
+ handled: true,
1473
+ type: 'instrument',
1474
+ },
1475
+ };
1476
+ // If Instrument integration has been called before TryCatch, get the name of original function
1477
+ var originalFunction = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__/* .getOriginalFunction */ .HK)(original);
1478
+ if (originalFunction) {
1479
+ wrapOptions.mechanism.data.handler = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__/* .getFunctionName */ .$P)(originalFunction);
1480
+ }
1481
+ // Otherwise wrap directly
1482
+ return (0,_helpers__WEBPACK_IMPORTED_MODULE_3__/* .wrap */ .re)(original, wrapOptions);
1483
+ });
1484
+ }
1485
+ });
1486
+ return originalSend.apply(this, args);
1487
+ };
1488
+ }
1489
+ /** JSDoc */
1490
+ function _wrapEventTarget(target) {
1491
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1492
+ var global = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__/* .getGlobalObject */ .R)();
1493
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
1494
+ var proto = global[target] && global[target].prototype;
1495
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins
1496
+ if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {
1497
+ return;
1498
+ }
1499
+ (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__/* .fill */ .hl)(proto, 'addEventListener', function (original) {
1500
+ return function (eventName, fn, options) {
1501
+ try {
1502
+ if (typeof fn.handleEvent === 'function') {
1503
+ fn.handleEvent = (0,_helpers__WEBPACK_IMPORTED_MODULE_3__/* .wrap */ .re)(fn.handleEvent.bind(fn), {
1504
+ mechanism: {
1505
+ data: {
1506
+ function: 'handleEvent',
1507
+ handler: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__/* .getFunctionName */ .$P)(fn),
1508
+ target: target,
1509
+ },
1510
+ handled: true,
1511
+ type: 'instrument',
1512
+ },
1513
+ });
1514
+ }
1515
+ }
1516
+ catch (err) {
1517
+ // can sometimes get 'Permission denied to access property "handle Event'
1518
+ }
1519
+ return original.apply(this, [
1520
+ eventName,
1521
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1522
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_3__/* .wrap */ .re)(fn, {
1523
+ mechanism: {
1524
+ data: {
1525
+ function: 'addEventListener',
1526
+ handler: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__/* .getFunctionName */ .$P)(fn),
1527
+ target: target,
1528
+ },
1529
+ handled: true,
1530
+ type: 'instrument',
1531
+ },
1532
+ }),
1533
+ options,
1534
+ ]);
1535
+ };
1536
+ });
1537
+ (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__/* .fill */ .hl)(proto, 'removeEventListener', function (originalRemoveEventListener) {
1538
+ return function (eventName, fn, options) {
1539
+ /**
1540
+ * There are 2 possible scenarios here:
1541
+ *
1542
+ * 1. Someone passes a callback, which was attached prior to Sentry initialization, or by using unmodified
1543
+ * method, eg. `document.addEventListener.call(el, name, handler). In this case, we treat this function
1544
+ * as a pass-through, and call original `removeEventListener` with it.
1545
+ *
1546
+ * 2. Someone passes a callback, which was attached after Sentry was initialized, which means that it was using
1547
+ * our wrapped version of `addEventListener`, which internally calls `wrap` helper.
1548
+ * This helper "wraps" whole callback inside a try/catch statement, and attached appropriate metadata to it,
1549
+ * in order for us to make a distinction between wrapped/non-wrapped functions possible.
1550
+ * If a function was wrapped, it has additional property of `__sentry_wrapped__`, holding the handler.
1551
+ *
1552
+ * When someone adds a handler prior to initialization, and then do it again, but after,
1553
+ * then we have to detach both of them. Otherwise, if we'd detach only wrapped one, it'd be impossible
1554
+ * to get rid of the initial handler and it'd stick there forever.
1555
+ */
1556
+ var wrappedEventHandler = fn;
1557
+ try {
1558
+ var originalEventHandler = wrappedEventHandler && wrappedEventHandler.__sentry_wrapped__;
1559
+ if (originalEventHandler) {
1560
+ originalRemoveEventListener.call(this, eventName, originalEventHandler, options);
1561
+ }
1562
+ }
1563
+ catch (e) {
1564
+ // ignore, accessing __sentry_wrapped__ will throw in some Selenium environments
1565
+ }
1566
+ return originalRemoveEventListener.call(this, eventName, wrappedEventHandler, options);
1567
+ };
1568
+ });
1569
+ }
1570
+ //# sourceMappingURL=trycatch.js.map
1571
+
1572
+ /***/ }),
1573
+
1574
+ /***/ 9992:
1575
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
1576
+
1577
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1578
+ /* harmony export */ "Z": function() { return /* binding */ UserAgent; }
1579
+ /* harmony export */ });
1580
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(334);
1581
+ /* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1684);
1582
+ /* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8585);
1583
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5907);
1584
+
1585
+
1586
+
1587
+ var global = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__/* .getGlobalObject */ .R)();
1588
+ /** UserAgent */
1589
+ var UserAgent = /** @class */ (function () {
1590
+ function UserAgent() {
1591
+ /**
1592
+ * @inheritDoc
1593
+ */
1594
+ this.name = UserAgent.id;
1595
+ }
1596
+ /**
1597
+ * @inheritDoc
1598
+ */
1599
+ UserAgent.prototype.setupOnce = function () {
1600
+ (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__/* .addGlobalEventProcessor */ .c)(function (event) {
1601
+ if ((0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__/* .getCurrentHub */ .Gd)().getIntegration(UserAgent)) {
1602
+ // if none of the information we want exists, don't bother
1603
+ if (!global.navigator && !global.location && !global.document) {
1604
+ return event;
1605
+ }
1606
+ // grab as much info as exists and add it to the event
1607
+ var url = (event.request && event.request.url) || (global.location && global.location.href);
1608
+ var referrer = (global.document || {}).referrer;
1609
+ var userAgent = (global.navigator || {}).userAgent;
1610
+ var headers = (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__assign */ .pi)({}, (event.request && event.request.headers)), (referrer && { Referer: referrer })), (userAgent && { 'User-Agent': userAgent }));
1611
+ var request = (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__assign */ .pi)({}, (url && { url: url })), { headers: headers });
1612
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__assign */ .pi)({}, event), { request: request });
1613
+ }
1614
+ return event;
1615
+ });
1616
+ };
1617
+ /**
1618
+ * @inheritDoc
1619
+ */
1620
+ UserAgent.id = 'UserAgent';
1621
+ return UserAgent;
1622
+ }());
1623
+
1624
+ //# sourceMappingURL=useragent.js.map
1625
+
1626
+ /***/ }),
1627
+
1628
+ /***/ 2456:
1629
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
1630
+
1631
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1632
+ /* harmony export */ "S1": function() { return /* binding */ init; },
1633
+ /* harmony export */ "yl": function() { return /* binding */ flush; }
1634
+ /* harmony export */ });
1635
+ /* unused harmony exports defaultIntegrations, showReportDialog, lastEventId, forceLoad, onLoad, close, wrap */
1636
+ /* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1061);
1637
+ /* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6286);
1638
+ /* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(6853);
1639
+ /* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(8585);
1640
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(5907);
1641
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(8536);
1642
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(7946);
1643
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(4005);
1644
+ /* harmony import */ var _client__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(2314);
1645
+ /* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(7904);
1646
+ /* harmony import */ var _integrations__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3399);
1647
+ /* harmony import */ var _integrations__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8356);
1648
+ /* harmony import */ var _integrations__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1228);
1649
+ /* harmony import */ var _integrations__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(3440);
1650
+ /* harmony import */ var _integrations__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(184);
1651
+ /* harmony import */ var _integrations__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(9992);
1652
+
1653
+
1654
+
1655
+
1656
+
1657
+
1658
+
1659
+ var defaultIntegrations = [
1660
+ new _sentry_core__WEBPACK_IMPORTED_MODULE_0__/* .InboundFilters */ .QD(),
1661
+ new _sentry_core__WEBPACK_IMPORTED_MODULE_1__/* .FunctionToString */ .c(),
1662
+ new _integrations__WEBPACK_IMPORTED_MODULE_2__/* .TryCatch */ .p(),
1663
+ new _integrations__WEBPACK_IMPORTED_MODULE_3__/* .Breadcrumbs */ .O(),
1664
+ new _integrations__WEBPACK_IMPORTED_MODULE_4__/* .GlobalHandlers */ .d(),
1665
+ new _integrations__WEBPACK_IMPORTED_MODULE_5__/* .LinkedErrors */ .iP(),
1666
+ new _integrations__WEBPACK_IMPORTED_MODULE_6__/* .Dedupe */ .I(),
1667
+ new _integrations__WEBPACK_IMPORTED_MODULE_7__/* .UserAgent */ .Z(),
1668
+ ];
1669
+ /**
1670
+ * The Sentry Browser SDK Client.
1671
+ *
1672
+ * To use this SDK, call the {@link init} function as early as possible when
1673
+ * loading the web page. To set context information or send manual events, use
1674
+ * the provided methods.
1675
+ *
1676
+ * @example
1677
+ *
1678
+ * ```
1679
+ *
1680
+ * import { init } from '@sentry/browser';
1681
+ *
1682
+ * init({
1683
+ * dsn: '__DSN__',
1684
+ * // ...
1685
+ * });
1686
+ * ```
1687
+ *
1688
+ * @example
1689
+ * ```
1690
+ *
1691
+ * import { configureScope } from '@sentry/browser';
1692
+ * configureScope((scope: Scope) => {
1693
+ * scope.setExtra({ battery: 0.7 });
1694
+ * scope.setTag({ user_mode: 'admin' });
1695
+ * scope.setUser({ id: '4711' });
1696
+ * });
1697
+ * ```
1698
+ *
1699
+ * @example
1700
+ * ```
1701
+ *
1702
+ * import { addBreadcrumb } from '@sentry/browser';
1703
+ * addBreadcrumb({
1704
+ * message: 'My Breadcrumb',
1705
+ * // ...
1706
+ * });
1707
+ * ```
1708
+ *
1709
+ * @example
1710
+ *
1711
+ * ```
1712
+ *
1713
+ * import * as Sentry from '@sentry/browser';
1714
+ * Sentry.captureMessage('Hello, world!');
1715
+ * Sentry.captureException(new Error('Good bye'));
1716
+ * Sentry.captureEvent({
1717
+ * message: 'Manual',
1718
+ * stacktrace: [
1719
+ * // ...
1720
+ * ],
1721
+ * });
1722
+ * ```
1723
+ *
1724
+ * @see {@link BrowserOptions} for documentation on configuration options.
1725
+ */
1726
+ function init(options) {
1727
+ if (options === void 0) { options = {}; }
1728
+ if (options.defaultIntegrations === undefined) {
1729
+ options.defaultIntegrations = defaultIntegrations;
1730
+ }
1731
+ if (options.release === undefined) {
1732
+ var window_1 = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_8__/* .getGlobalObject */ .R)();
1733
+ // This supports the variable that sentry-webpack-plugin injects
1734
+ if (window_1.SENTRY_RELEASE && window_1.SENTRY_RELEASE.id) {
1735
+ options.release = window_1.SENTRY_RELEASE.id;
1736
+ }
1737
+ }
1738
+ if (options.autoSessionTracking === undefined) {
1739
+ options.autoSessionTracking = true;
1740
+ }
1741
+ if (options.sendClientReports === undefined) {
1742
+ options.sendClientReports = true;
1743
+ }
1744
+ (0,_sentry_core__WEBPACK_IMPORTED_MODULE_9__/* .initAndBind */ .M)(_client__WEBPACK_IMPORTED_MODULE_10__/* .BrowserClient */ .R, options);
1745
+ if (options.autoSessionTracking) {
1746
+ startSessionTracking();
1747
+ }
1748
+ }
1749
+ /**
1750
+ * Present the user with a report dialog.
1751
+ *
1752
+ * @param options Everything is optional, we try to fetch all info need from the global scope.
1753
+ */
1754
+ function showReportDialog(options) {
1755
+ if (options === void 0) { options = {}; }
1756
+ var hub = getCurrentHub();
1757
+ var scope = hub.getScope();
1758
+ if (scope) {
1759
+ options.user = __assign(__assign({}, scope.getUser()), options.user);
1760
+ }
1761
+ if (!options.eventId) {
1762
+ options.eventId = hub.lastEventId();
1763
+ }
1764
+ var client = hub.getClient();
1765
+ if (client) {
1766
+ client.showReportDialog(options);
1767
+ }
1768
+ }
1769
+ /**
1770
+ * This is the getter for lastEventId.
1771
+ *
1772
+ * @returns The last event id of a captured event.
1773
+ */
1774
+ function lastEventId() {
1775
+ return getCurrentHub().lastEventId();
1776
+ }
1777
+ /**
1778
+ * This function is here to be API compatible with the loader.
1779
+ * @hidden
1780
+ */
1781
+ function forceLoad() {
1782
+ // Noop
1783
+ }
1784
+ /**
1785
+ * This function is here to be API compatible with the loader.
1786
+ * @hidden
1787
+ */
1788
+ function onLoad(callback) {
1789
+ callback();
1790
+ }
1791
+ /**
1792
+ * Call `flush()` on the current client, if there is one. See {@link Client.flush}.
1793
+ *
1794
+ * @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause
1795
+ * the client to wait until all events are sent before resolving the promise.
1796
+ * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it
1797
+ * doesn't (or if there's no client defined).
1798
+ */
1799
+ function flush(timeout) {
1800
+ var client = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_11__/* .getCurrentHub */ .Gd)().getClient();
1801
+ if (client) {
1802
+ return client.flush(timeout);
1803
+ }
1804
+ _flags__WEBPACK_IMPORTED_MODULE_12__/* .IS_DEBUG_BUILD */ .h && _sentry_utils__WEBPACK_IMPORTED_MODULE_13__/* .logger.warn */ .kg.warn('Cannot flush events. No client defined.');
1805
+ return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_14__/* .resolvedSyncPromise */ .WD)(false);
1806
+ }
1807
+ /**
1808
+ * Call `close()` on the current client, if there is one. See {@link Client.close}.
1809
+ *
1810
+ * @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this
1811
+ * parameter will cause the client to wait until all events are sent before disabling itself.
1812
+ * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it
1813
+ * doesn't (or if there's no client defined).
1814
+ */
1815
+ function close(timeout) {
1816
+ var client = getCurrentHub().getClient();
1817
+ if (client) {
1818
+ return client.close(timeout);
1819
+ }
1820
+ IS_DEBUG_BUILD && logger.warn('Cannot flush events and disable SDK. No client defined.');
1821
+ return resolvedSyncPromise(false);
1822
+ }
1823
+ /**
1824
+ * Wrap code within a try/catch block so the SDK is able to capture errors.
1825
+ *
1826
+ * @param fn A function to wrap.
1827
+ *
1828
+ * @returns The result of wrapped function call.
1829
+ */
1830
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1831
+ function wrap(fn) {
1832
+ return internalWrap(fn)();
1833
+ }
1834
+ function startSessionOnHub(hub) {
1835
+ hub.startSession({ ignoreDuration: true });
1836
+ hub.captureSession();
1837
+ }
1838
+ /**
1839
+ * Enable automatic Session Tracking for the initial page load.
1840
+ */
1841
+ function startSessionTracking() {
1842
+ var window = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_8__/* .getGlobalObject */ .R)();
1843
+ var document = window.document;
1844
+ if (typeof document === 'undefined') {
1845
+ _flags__WEBPACK_IMPORTED_MODULE_12__/* .IS_DEBUG_BUILD */ .h && _sentry_utils__WEBPACK_IMPORTED_MODULE_13__/* .logger.warn */ .kg.warn('Session tracking in non-browser environment with @sentry/browser is not supported.');
1846
+ return;
1847
+ }
1848
+ var hub = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_11__/* .getCurrentHub */ .Gd)();
1849
+ // The only way for this to be false is for there to be a version mismatch between @sentry/browser (>= 6.0.0) and
1850
+ // @sentry/hub (< 5.27.0). In the simple case, there won't ever be such a mismatch, because the two packages are
1851
+ // pinned at the same version in package.json, but there are edge cases where it's possible. See
1852
+ // https://github.com/getsentry/sentry-javascript/issues/3207 and
1853
+ // https://github.com/getsentry/sentry-javascript/issues/3234 and
1854
+ // https://github.com/getsentry/sentry-javascript/issues/3278.
1855
+ if (!hub.captureSession) {
1856
+ return;
1857
+ }
1858
+ // The session duration for browser sessions does not track a meaningful
1859
+ // concept that can be used as a metric.
1860
+ // Automatically captured sessions are akin to page views, and thus we
1861
+ // discard their duration.
1862
+ startSessionOnHub(hub);
1863
+ // We want to create a session for every navigation as well
1864
+ (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_15__/* .addInstrumentationHandler */ .o)('history', function (_a) {
1865
+ var from = _a.from, to = _a.to;
1866
+ // Don't create an additional session for the initial route or if the location did not change
1867
+ if (!(from === undefined || from === to)) {
1868
+ startSessionOnHub((0,_sentry_core__WEBPACK_IMPORTED_MODULE_11__/* .getCurrentHub */ .Gd)());
1869
+ }
1870
+ });
1871
+ }
1872
+ //# sourceMappingURL=sdk.js.map
1873
+
1874
+ /***/ }),
1875
+
1876
+ /***/ 2224:
1877
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
1878
+
1879
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1880
+ /* harmony export */ "s$": function() { return /* binding */ chromeStackParser; },
1881
+ /* harmony export */ "Pi": function() { return /* binding */ geckoStackParser; },
1882
+ /* harmony export */ "aL": function() { return /* binding */ winjsStackParser; },
1883
+ /* harmony export */ "CS": function() { return /* binding */ opera10StackParser; },
1884
+ /* harmony export */ "ay": function() { return /* binding */ opera11StackParser; }
1885
+ /* harmony export */ });
1886
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(334);
1887
+
1888
+ // global reference to slice
1889
+ var UNKNOWN_FUNCTION = '?';
1890
+ var OPERA10_PRIORITY = 10;
1891
+ var OPERA11_PRIORITY = 20;
1892
+ var CHROME_PRIORITY = 30;
1893
+ var WINJS_PRIORITY = 40;
1894
+ var GECKO_PRIORITY = 50;
1895
+ function createFrame(filename, func, lineno, colno) {
1896
+ var frame = {
1897
+ filename: filename,
1898
+ function: func,
1899
+ // All browser frames are considered in_app
1900
+ in_app: true,
1901
+ };
1902
+ if (lineno !== undefined) {
1903
+ frame.lineno = lineno;
1904
+ }
1905
+ if (colno !== undefined) {
1906
+ frame.colno = colno;
1907
+ }
1908
+ return frame;
1909
+ }
1910
+ // Chromium based browsers: Chrome, Brave, new Opera, new Edge
1911
+ var chromeRegex = /^\s*at (?:(.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i;
1912
+ var chromeEvalRegex = /\((\S*)(?::(\d+))(?::(\d+))\)/;
1913
+ var chrome = function (line) {
1914
+ var parts = chromeRegex.exec(line);
1915
+ if (parts) {
1916
+ var isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line
1917
+ if (isEval) {
1918
+ var subMatch = chromeEvalRegex.exec(parts[2]);
1919
+ if (subMatch) {
1920
+ // throw out eval line/column and use top-most line/column number
1921
+ parts[2] = subMatch[1]; // url
1922
+ parts[3] = subMatch[2]; // line
1923
+ parts[4] = subMatch[3]; // column
1924
+ }
1925
+ }
1926
+ // Kamil: One more hack won't hurt us right? Understanding and adding more rules on top of these regexps right now
1927
+ // would be way too time consuming. (TODO: Rewrite whole RegExp to be more readable)
1928
+ var _a = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__read */ .CR)(extractSafariExtensionDetails(parts[1] || UNKNOWN_FUNCTION, parts[2]), 2), func = _a[0], filename = _a[1];
1929
+ return createFrame(filename, func, parts[3] ? +parts[3] : undefined, parts[4] ? +parts[4] : undefined);
1930
+ }
1931
+ return;
1932
+ };
1933
+ var chromeStackParser = [CHROME_PRIORITY, chrome];
1934
+ // gecko regex: `(?:bundle|\d+\.js)`: `bundle` is for react native, `\d+\.js` also but specifically for ram bundles because it
1935
+ // generates filenames without a prefix like `file://` the filenames in the stacktrace are just 42.js
1936
+ // We need this specific case for now because we want no other regex to match.
1937
+ var geckoREgex = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i;
1938
+ var geckoEvalRegex = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i;
1939
+ var gecko = function (line) {
1940
+ var _a;
1941
+ var parts = geckoREgex.exec(line);
1942
+ if (parts) {
1943
+ var isEval = parts[3] && parts[3].indexOf(' > eval') > -1;
1944
+ if (isEval) {
1945
+ var subMatch = geckoEvalRegex.exec(parts[3]);
1946
+ if (subMatch) {
1947
+ // throw out eval line/column and use top-most line number
1948
+ parts[1] = parts[1] || 'eval';
1949
+ parts[3] = subMatch[1];
1950
+ parts[4] = subMatch[2];
1951
+ parts[5] = ''; // no column when eval
1952
+ }
1953
+ }
1954
+ var filename = parts[3];
1955
+ var func = parts[1] || UNKNOWN_FUNCTION;
1956
+ _a = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__read */ .CR)(extractSafariExtensionDetails(func, filename), 2), func = _a[0], filename = _a[1];
1957
+ return createFrame(filename, func, parts[4] ? +parts[4] : undefined, parts[5] ? +parts[5] : undefined);
1958
+ }
1959
+ return;
1960
+ };
1961
+ var geckoStackParser = [GECKO_PRIORITY, gecko];
1962
+ var winjsRegex = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;
1963
+ var winjs = function (line) {
1964
+ var parts = winjsRegex.exec(line);
1965
+ return parts
1966
+ ? createFrame(parts[2], parts[1] || UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : undefined)
1967
+ : undefined;
1968
+ };
1969
+ var winjsStackParser = [WINJS_PRIORITY, winjs];
1970
+ var opera10Regex = / line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i;
1971
+ var opera10 = function (line) {
1972
+ var parts = opera10Regex.exec(line);
1973
+ return parts ? createFrame(parts[2], parts[3] || UNKNOWN_FUNCTION, +parts[1]) : undefined;
1974
+ };
1975
+ var opera10StackParser = [OPERA10_PRIORITY, opera10];
1976
+ var opera11Regex = / line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i;
1977
+ var opera11 = function (line) {
1978
+ var parts = opera11Regex.exec(line);
1979
+ return parts ? createFrame(parts[5], parts[3] || parts[4] || UNKNOWN_FUNCTION, +parts[1], +parts[2]) : undefined;
1980
+ };
1981
+ var opera11StackParser = [OPERA11_PRIORITY, opera11];
1982
+ /**
1983
+ * Safari web extensions, starting version unknown, can produce "frames-only" stacktraces.
1984
+ * What it means, is that instead of format like:
1985
+ *
1986
+ * Error: wat
1987
+ * at function@url:row:col
1988
+ * at function@url:row:col
1989
+ * at function@url:row:col
1990
+ *
1991
+ * it produces something like:
1992
+ *
1993
+ * function@url:row:col
1994
+ * function@url:row:col
1995
+ * function@url:row:col
1996
+ *
1997
+ * Because of that, it won't be captured by `chrome` RegExp and will fall into `Gecko` branch.
1998
+ * This function is extracted so that we can use it in both places without duplicating the logic.
1999
+ * Unfortunately "just" changing RegExp is too complicated now and making it pass all tests
2000
+ * and fix this case seems like an impossible, or at least way too time-consuming task.
2001
+ */
2002
+ var extractSafariExtensionDetails = function (func, filename) {
2003
+ var isSafariExtension = func.indexOf('safari-extension') !== -1;
2004
+ var isSafariWebExtension = func.indexOf('safari-web-extension') !== -1;
2005
+ return isSafariExtension || isSafariWebExtension
2006
+ ? [
2007
+ func.indexOf('@') !== -1 ? func.split('@')[0] : UNKNOWN_FUNCTION,
2008
+ isSafariExtension ? "safari-extension:" + filename : "safari-web-extension:" + filename,
2009
+ ]
2010
+ : [func, filename];
2011
+ };
2012
+ //# sourceMappingURL=stack-parsers.js.map
2013
+
2014
+ /***/ }),
2015
+
2016
+ /***/ 6526:
2017
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
2018
+
2019
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2020
+ /* harmony export */ "d": function() { return /* binding */ BaseTransport; }
2021
+ /* harmony export */ });
2022
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(334);
2023
+ /* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4911);
2024
+ /* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6508);
2025
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5907);
2026
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8963);
2027
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8536);
2028
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(250);
2029
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3135);
2030
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(6894);
2031
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(8886);
2032
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(1630);
2033
+ /* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7904);
2034
+ /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(5854);
2035
+
2036
+
2037
+
2038
+
2039
+
2040
+ function requestTypeToCategory(ty) {
2041
+ var tyStr = ty;
2042
+ return tyStr === 'event' ? 'error' : tyStr;
2043
+ }
2044
+ var global = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__/* .getGlobalObject */ .R)();
2045
+ /** Base Transport class implementation */
2046
+ var BaseTransport = /** @class */ (function () {
2047
+ function BaseTransport(options) {
2048
+ var _this = this;
2049
+ this.options = options;
2050
+ /** A simple buffer holding all requests. */
2051
+ this._buffer = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__/* .makePromiseBuffer */ .x)(30);
2052
+ /** Locks transport after receiving rate limits in a response */
2053
+ this._rateLimits = {};
2054
+ this._outcomes = {};
2055
+ this._api = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__/* .initAPIDetails */ .hd)(options.dsn, options._metadata, options.tunnel);
2056
+ // eslint-disable-next-line deprecation/deprecation
2057
+ this.url = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__/* .getStoreEndpointWithUrlEncodedAuth */ .qi)(this._api.dsn);
2058
+ if (this.options.sendClientReports && global.document) {
2059
+ global.document.addEventListener('visibilitychange', function () {
2060
+ if (global.document.visibilityState === 'hidden') {
2061
+ _this._flushOutcomes();
2062
+ }
2063
+ });
2064
+ }
2065
+ }
2066
+ /**
2067
+ * @inheritDoc
2068
+ */
2069
+ BaseTransport.prototype.sendEvent = function (event) {
2070
+ return this._sendRequest((0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__/* .eventToSentryRequest */ .nA)(event, this._api), event);
2071
+ };
2072
+ /**
2073
+ * @inheritDoc
2074
+ */
2075
+ BaseTransport.prototype.sendSession = function (session) {
2076
+ return this._sendRequest((0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__/* .sessionToSentryRequest */ .Qz)(session, this._api), session);
2077
+ };
2078
+ /**
2079
+ * @inheritDoc
2080
+ */
2081
+ BaseTransport.prototype.close = function (timeout) {
2082
+ return this._buffer.drain(timeout);
2083
+ };
2084
+ /**
2085
+ * @inheritDoc
2086
+ */
2087
+ BaseTransport.prototype.recordLostEvent = function (reason, category) {
2088
+ var _a;
2089
+ if (!this.options.sendClientReports) {
2090
+ return;
2091
+ }
2092
+ // We want to track each category (event, transaction, session) separately
2093
+ // but still keep the distinction between different type of outcomes.
2094
+ // We could use nested maps, but it's much easier to read and type this way.
2095
+ // A correct type for map-based implementation if we want to go that route
2096
+ // would be `Partial<Record<SentryRequestType, Partial<Record<Outcome, number>>>>`
2097
+ var key = requestTypeToCategory(category) + ":" + reason;
2098
+ _flags__WEBPACK_IMPORTED_MODULE_4__/* .IS_DEBUG_BUILD */ .h && _sentry_utils__WEBPACK_IMPORTED_MODULE_5__/* .logger.log */ .kg.log("Adding outcome: " + key);
2099
+ this._outcomes[key] = (_a = this._outcomes[key], (_a !== null && _a !== void 0 ? _a : 0)) + 1;
2100
+ };
2101
+ /**
2102
+ * Send outcomes as an envelope
2103
+ */
2104
+ BaseTransport.prototype._flushOutcomes = function () {
2105
+ if (!this.options.sendClientReports) {
2106
+ return;
2107
+ }
2108
+ var outcomes = this._outcomes;
2109
+ this._outcomes = {};
2110
+ // Nothing to send
2111
+ if (!Object.keys(outcomes).length) {
2112
+ _flags__WEBPACK_IMPORTED_MODULE_4__/* .IS_DEBUG_BUILD */ .h && _sentry_utils__WEBPACK_IMPORTED_MODULE_5__/* .logger.log */ .kg.log('No outcomes to flush');
2113
+ return;
2114
+ }
2115
+ _flags__WEBPACK_IMPORTED_MODULE_4__/* .IS_DEBUG_BUILD */ .h && _sentry_utils__WEBPACK_IMPORTED_MODULE_5__/* .logger.log */ .kg.log("Flushing outcomes:\n" + JSON.stringify(outcomes, null, 2));
2116
+ var url = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__/* .getEnvelopeEndpointWithUrlEncodedAuth */ .Ut)(this._api.dsn, this._api.tunnel);
2117
+ var discardedEvents = Object.keys(outcomes).map(function (key) {
2118
+ var _a = (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__read */ .CR)(key.split(':'), 2), category = _a[0], reason = _a[1];
2119
+ return {
2120
+ reason: reason,
2121
+ category: category,
2122
+ quantity: outcomes[key],
2123
+ };
2124
+ // TODO: Improve types on discarded_events to get rid of cast
2125
+ });
2126
+ var envelope = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_7__/* .createClientReportEnvelope */ .y)(discardedEvents, this._api.tunnel && (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_8__/* .dsnToString */ .R)(this._api.dsn));
2127
+ try {
2128
+ (0,_utils__WEBPACK_IMPORTED_MODULE_9__/* .sendReport */ .z)(url, (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_10__/* .serializeEnvelope */ .V$)(envelope));
2129
+ }
2130
+ catch (e) {
2131
+ _flags__WEBPACK_IMPORTED_MODULE_4__/* .IS_DEBUG_BUILD */ .h && _sentry_utils__WEBPACK_IMPORTED_MODULE_5__/* .logger.error */ .kg.error(e);
2132
+ }
2133
+ };
2134
+ /**
2135
+ * Handle Sentry repsonse for promise-based transports.
2136
+ */
2137
+ BaseTransport.prototype._handleResponse = function (_a) {
2138
+ var requestType = _a.requestType, response = _a.response, headers = _a.headers, resolve = _a.resolve, reject = _a.reject;
2139
+ var status = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_11__/* .eventStatusFromHttpCode */ .F)(response.status);
2140
+ this._rateLimits = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_12__/* .updateRateLimits */ .WG)(this._rateLimits, headers);
2141
+ // eslint-disable-next-line deprecation/deprecation
2142
+ if (this._isRateLimited(requestType)) {
2143
+ _flags__WEBPACK_IMPORTED_MODULE_4__/* .IS_DEBUG_BUILD */ .h &&
2144
+ // eslint-disable-next-line deprecation/deprecation
2145
+ _sentry_utils__WEBPACK_IMPORTED_MODULE_5__/* .logger.warn */ .kg.warn("Too many " + requestType + " requests, backing off until: " + this._disabledUntil(requestType));
2146
+ }
2147
+ if (status === 'success') {
2148
+ resolve({ status: status });
2149
+ return;
2150
+ }
2151
+ reject(response);
2152
+ };
2153
+ /**
2154
+ * Gets the time that given category is disabled until for rate limiting
2155
+ *
2156
+ * @deprecated Please use `disabledUntil` from @sentry/utils
2157
+ */
2158
+ BaseTransport.prototype._disabledUntil = function (requestType) {
2159
+ var category = requestTypeToCategory(requestType);
2160
+ return new Date((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_12__/* .disabledUntil */ .ns)(this._rateLimits, category));
2161
+ };
2162
+ /**
2163
+ * Checks if a category is rate limited
2164
+ *
2165
+ * @deprecated Please use `isRateLimited` from @sentry/utils
2166
+ */
2167
+ BaseTransport.prototype._isRateLimited = function (requestType) {
2168
+ var category = requestTypeToCategory(requestType);
2169
+ return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_12__/* .isRateLimited */ .Q)(this._rateLimits, category);
2170
+ };
2171
+ return BaseTransport;
2172
+ }());
2173
+
2174
+ //# sourceMappingURL=base.js.map
2175
+
2176
+ /***/ }),
2177
+
2178
+ /***/ 6149:
2179
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
2180
+
2181
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2182
+ /* harmony export */ "V": function() { return /* binding */ FetchTransport; }
2183
+ /* harmony export */ });
2184
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(334);
2185
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9798);
2186
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7946);
2187
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4388);
2188
+ /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(6526);
2189
+ /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5854);
2190
+
2191
+
2192
+
2193
+
2194
+ /** `fetch` based transport */
2195
+ var FetchTransport = /** @class */ (function (_super) {
2196
+ (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__extends */ .ZT)(FetchTransport, _super);
2197
+ function FetchTransport(options, fetchImpl) {
2198
+ if (fetchImpl === void 0) { fetchImpl = (0,_utils__WEBPACK_IMPORTED_MODULE_1__/* .getNativeFetchImplementation */ .x)(); }
2199
+ var _this = _super.call(this, options) || this;
2200
+ _this._fetch = fetchImpl;
2201
+ return _this;
2202
+ }
2203
+ /**
2204
+ * @param sentryRequest Prepared SentryRequest to be delivered
2205
+ * @param originalPayload Original payload used to create SentryRequest
2206
+ */
2207
+ FetchTransport.prototype._sendRequest = function (sentryRequest, originalPayload) {
2208
+ var _this = this;
2209
+ // eslint-disable-next-line deprecation/deprecation
2210
+ if (this._isRateLimited(sentryRequest.type)) {
2211
+ this.recordLostEvent('ratelimit_backoff', sentryRequest.type);
2212
+ return Promise.reject({
2213
+ event: originalPayload,
2214
+ type: sentryRequest.type,
2215
+ // eslint-disable-next-line deprecation/deprecation
2216
+ reason: "Transport for " + sentryRequest.type + " requests locked till " + this._disabledUntil(sentryRequest.type) + " due to too many requests.",
2217
+ status: 429,
2218
+ });
2219
+ }
2220
+ var options = {
2221
+ body: sentryRequest.body,
2222
+ method: 'POST',
2223
+ // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default'
2224
+ // (see https://caniuse.com/#feat=referrer-policy),
2225
+ // it doesn't. And it throws an exception instead of ignoring this parameter...
2226
+ // REF: https://github.com/getsentry/raven-js/issues/1233
2227
+ referrerPolicy: ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__/* .supportsReferrerPolicy */ .hv)() ? 'origin' : ''),
2228
+ };
2229
+ if (this.options.fetchParameters !== undefined) {
2230
+ Object.assign(options, this.options.fetchParameters);
2231
+ }
2232
+ if (this.options.headers !== undefined) {
2233
+ options.headers = this.options.headers;
2234
+ }
2235
+ return this._buffer
2236
+ .add(function () {
2237
+ return new _sentry_utils__WEBPACK_IMPORTED_MODULE_3__/* .SyncPromise */ .cW(function (resolve, reject) {
2238
+ void _this._fetch(sentryRequest.url, options)
2239
+ .then(function (response) {
2240
+ var headers = {
2241
+ 'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'),
2242
+ 'retry-after': response.headers.get('Retry-After'),
2243
+ };
2244
+ _this._handleResponse({
2245
+ requestType: sentryRequest.type,
2246
+ response: response,
2247
+ headers: headers,
2248
+ resolve: resolve,
2249
+ reject: reject,
2250
+ });
2251
+ })
2252
+ .catch(reject);
2253
+ });
2254
+ })
2255
+ .then(undefined, function (reason) {
2256
+ // It's either buffer rejection or any other xhr/fetch error, which are treated as NetworkError.
2257
+ if (reason instanceof _sentry_utils__WEBPACK_IMPORTED_MODULE_4__/* .SentryError */ .b) {
2258
+ _this.recordLostEvent('queue_overflow', sentryRequest.type);
2259
+ }
2260
+ else {
2261
+ _this.recordLostEvent('network_error', sentryRequest.type);
2262
+ }
2263
+ throw reason;
2264
+ });
2265
+ };
2266
+ return FetchTransport;
2267
+ }(_base__WEBPACK_IMPORTED_MODULE_5__/* .BaseTransport */ .d));
2268
+
2269
+ //# sourceMappingURL=fetch.js.map
2270
+
2271
+ /***/ }),
2272
+
2273
+ /***/ 1449:
2274
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
2275
+
2276
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2277
+ /* harmony export */ "k": function() { return /* binding */ makeNewFetchTransport; }
2278
+ /* harmony export */ });
2279
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(334);
2280
+ /* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1518);
2281
+ /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5854);
2282
+
2283
+
2284
+
2285
+ /**
2286
+ * Creates a Transport that uses the Fetch API to send events to Sentry.
2287
+ */
2288
+ function makeNewFetchTransport(options, nativeFetch) {
2289
+ if (nativeFetch === void 0) { nativeFetch = (0,_utils__WEBPACK_IMPORTED_MODULE_0__/* .getNativeFetchImplementation */ .x)(); }
2290
+ function makeRequest(request) {
2291
+ var requestOptions = (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__assign */ .pi)({ body: request.body, method: 'POST', referrerPolicy: 'origin' }, options.requestOptions);
2292
+ return nativeFetch(options.url, requestOptions).then(function (response) {
2293
+ return response.text().then(function (body) { return ({
2294
+ body: body,
2295
+ headers: {
2296
+ 'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'),
2297
+ 'retry-after': response.headers.get('Retry-After'),
2298
+ },
2299
+ reason: response.statusText,
2300
+ statusCode: response.status,
2301
+ }); });
2302
+ });
2303
+ }
2304
+ return (0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__/* .createTransport */ .qv)({ bufferSize: options.bufferSize }, makeRequest);
2305
+ }
2306
+ //# sourceMappingURL=new-fetch.js.map
2307
+
2308
+ /***/ }),
2309
+
2310
+ /***/ 4827:
2311
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
2312
+
2313
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2314
+ /* harmony export */ "H": function() { return /* binding */ makeNewXHRTransport; }
2315
+ /* harmony export */ });
2316
+ /* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1518);
2317
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7946);
2318
+
2319
+
2320
+ /**
2321
+ * The DONE ready state for XmlHttpRequest
2322
+ *
2323
+ * Defining it here as a constant b/c XMLHttpRequest.DONE is not always defined
2324
+ * (e.g. during testing, it is `undefined`)
2325
+ *
2326
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/readyState}
2327
+ */
2328
+ var XHR_READYSTATE_DONE = 4;
2329
+ /**
2330
+ * Creates a Transport that uses the XMLHttpRequest API to send events to Sentry.
2331
+ */
2332
+ function makeNewXHRTransport(options) {
2333
+ function makeRequest(request) {
2334
+ return new _sentry_utils__WEBPACK_IMPORTED_MODULE_0__/* .SyncPromise */ .cW(function (resolve, _reject) {
2335
+ var xhr = new XMLHttpRequest();
2336
+ xhr.onreadystatechange = function () {
2337
+ if (xhr.readyState === XHR_READYSTATE_DONE) {
2338
+ var response = {
2339
+ body: xhr.response,
2340
+ headers: {
2341
+ 'x-sentry-rate-limits': xhr.getResponseHeader('X-Sentry-Rate-Limits'),
2342
+ 'retry-after': xhr.getResponseHeader('Retry-After'),
2343
+ },
2344
+ reason: xhr.statusText,
2345
+ statusCode: xhr.status,
2346
+ };
2347
+ resolve(response);
2348
+ }
2349
+ };
2350
+ xhr.open('POST', options.url);
2351
+ for (var header in options.headers) {
2352
+ if (Object.prototype.hasOwnProperty.call(options.headers, header)) {
2353
+ xhr.setRequestHeader(header, options.headers[header]);
2354
+ }
2355
+ }
2356
+ xhr.send(request.body);
2357
+ });
2358
+ }
2359
+ return (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__/* .createTransport */ .qv)({ bufferSize: options.bufferSize }, makeRequest);
2360
+ }
2361
+ //# sourceMappingURL=new-xhr.js.map
2362
+
2363
+ /***/ }),
2364
+
2365
+ /***/ 5854:
2366
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
2367
+
2368
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2369
+ /* harmony export */ "x": function() { return /* binding */ getNativeFetchImplementation; },
2370
+ /* harmony export */ "z": function() { return /* binding */ sendReport; }
2371
+ /* harmony export */ });
2372
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5907);
2373
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9798);
2374
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8536);
2375
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3518);
2376
+ /* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7904);
2377
+
2378
+
2379
+ var global = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__/* .getGlobalObject */ .R)();
2380
+ var cachedFetchImpl;
2381
+ /**
2382
+ * A special usecase for incorrectly wrapped Fetch APIs in conjunction with ad-blockers.
2383
+ * Whenever someone wraps the Fetch API and returns the wrong promise chain,
2384
+ * this chain becomes orphaned and there is no possible way to capture it's rejections
2385
+ * other than allowing it bubble up to this very handler. eg.
2386
+ *
2387
+ * const f = window.fetch;
2388
+ * window.fetch = function () {
2389
+ * const p = f.apply(this, arguments);
2390
+ *
2391
+ * p.then(function() {
2392
+ * console.log('hi.');
2393
+ * });
2394
+ *
2395
+ * return p;
2396
+ * }
2397
+ *
2398
+ * `p.then(function () { ... })` is producing a completely separate promise chain,
2399
+ * however, what's returned is `p` - the result of original `fetch` call.
2400
+ *
2401
+ * This mean, that whenever we use the Fetch API to send our own requests, _and_
2402
+ * some ad-blocker blocks it, this orphaned chain will _always_ reject,
2403
+ * effectively causing another event to be captured.
2404
+ * This makes a whole process become an infinite loop, which we need to somehow
2405
+ * deal with, and break it in one way or another.
2406
+ *
2407
+ * To deal with this issue, we are making sure that we _always_ use the real
2408
+ * browser Fetch API, instead of relying on what `window.fetch` exposes.
2409
+ * The only downside to this would be missing our own requests as breadcrumbs,
2410
+ * but because we are already not doing this, it should be just fine.
2411
+ *
2412
+ * Possible failed fetch error messages per-browser:
2413
+ *
2414
+ * Chrome: Failed to fetch
2415
+ * Edge: Failed to Fetch
2416
+ * Firefox: NetworkError when attempting to fetch resource
2417
+ * Safari: resource blocked by content blocker
2418
+ */
2419
+ function getNativeFetchImplementation() {
2420
+ if (cachedFetchImpl) {
2421
+ return cachedFetchImpl;
2422
+ }
2423
+ /* eslint-disable @typescript-eslint/unbound-method */
2424
+ // Fast path to avoid DOM I/O
2425
+ if ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__/* .isNativeFetch */ .Du)(global.fetch)) {
2426
+ return (cachedFetchImpl = global.fetch.bind(global));
2427
+ }
2428
+ var document = global.document;
2429
+ var fetchImpl = global.fetch;
2430
+ // eslint-disable-next-line deprecation/deprecation
2431
+ if (document && typeof document.createElement === 'function') {
2432
+ try {
2433
+ var sandbox = document.createElement('iframe');
2434
+ sandbox.hidden = true;
2435
+ document.head.appendChild(sandbox);
2436
+ var contentWindow = sandbox.contentWindow;
2437
+ if (contentWindow && contentWindow.fetch) {
2438
+ fetchImpl = contentWindow.fetch;
2439
+ }
2440
+ document.head.removeChild(sandbox);
2441
+ }
2442
+ catch (e) {
2443
+ _flags__WEBPACK_IMPORTED_MODULE_2__/* .IS_DEBUG_BUILD */ .h &&
2444
+ _sentry_utils__WEBPACK_IMPORTED_MODULE_3__/* .logger.warn */ .kg.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', e);
2445
+ }
2446
+ }
2447
+ return (cachedFetchImpl = fetchImpl.bind(global));
2448
+ /* eslint-enable @typescript-eslint/unbound-method */
2449
+ }
2450
+ /**
2451
+ * Sends sdk client report using sendBeacon or fetch as a fallback if available
2452
+ *
2453
+ * @param url report endpoint
2454
+ * @param body report payload
2455
+ */
2456
+ function sendReport(url, body) {
2457
+ var isRealNavigator = Object.prototype.toString.call(global && global.navigator) === '[object Navigator]';
2458
+ var hasSendBeacon = isRealNavigator && typeof global.navigator.sendBeacon === 'function';
2459
+ if (hasSendBeacon) {
2460
+ // Prevent illegal invocations - https://xgwang.me/posts/you-may-not-know-beacon/#it-may-throw-error%2C-be-sure-to-catch
2461
+ var sendBeacon = global.navigator.sendBeacon.bind(global.navigator);
2462
+ return sendBeacon(url, body);
2463
+ }
2464
+ if ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__/* .supportsFetch */ .Ak)()) {
2465
+ var fetch_1 = getNativeFetchImplementation();
2466
+ return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__/* .forget */ .I)(fetch_1(url, {
2467
+ body: body,
2468
+ method: 'POST',
2469
+ credentials: 'omit',
2470
+ keepalive: true,
2471
+ }));
2472
+ }
2473
+ }
2474
+ //# sourceMappingURL=utils.js.map
2475
+
2476
+ /***/ }),
2477
+
2478
+ /***/ 6144:
2479
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
2480
+
2481
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2482
+ /* harmony export */ "w": function() { return /* binding */ XHRTransport; }
2483
+ /* harmony export */ });
2484
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(334);
2485
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7946);
2486
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4388);
2487
+ /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6526);
2488
+
2489
+
2490
+
2491
+ /** `XHR` based transport */
2492
+ var XHRTransport = /** @class */ (function (_super) {
2493
+ (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__extends */ .ZT)(XHRTransport, _super);
2494
+ function XHRTransport() {
2495
+ return _super !== null && _super.apply(this, arguments) || this;
2496
+ }
2497
+ /**
2498
+ * @param sentryRequest Prepared SentryRequest to be delivered
2499
+ * @param originalPayload Original payload used to create SentryRequest
2500
+ */
2501
+ XHRTransport.prototype._sendRequest = function (sentryRequest, originalPayload) {
2502
+ var _this = this;
2503
+ // eslint-disable-next-line deprecation/deprecation
2504
+ if (this._isRateLimited(sentryRequest.type)) {
2505
+ this.recordLostEvent('ratelimit_backoff', sentryRequest.type);
2506
+ return Promise.reject({
2507
+ event: originalPayload,
2508
+ type: sentryRequest.type,
2509
+ // eslint-disable-next-line deprecation/deprecation
2510
+ reason: "Transport for " + sentryRequest.type + " requests locked till " + this._disabledUntil(sentryRequest.type) + " due to too many requests.",
2511
+ status: 429,
2512
+ });
2513
+ }
2514
+ return this._buffer
2515
+ .add(function () {
2516
+ return new _sentry_utils__WEBPACK_IMPORTED_MODULE_1__/* .SyncPromise */ .cW(function (resolve, reject) {
2517
+ var request = new XMLHttpRequest();
2518
+ request.onreadystatechange = function () {
2519
+ if (request.readyState === 4) {
2520
+ var headers = {
2521
+ 'x-sentry-rate-limits': request.getResponseHeader('X-Sentry-Rate-Limits'),
2522
+ 'retry-after': request.getResponseHeader('Retry-After'),
2523
+ };
2524
+ _this._handleResponse({ requestType: sentryRequest.type, response: request, headers: headers, resolve: resolve, reject: reject });
2525
+ }
2526
+ };
2527
+ request.open('POST', sentryRequest.url);
2528
+ for (var header in _this.options.headers) {
2529
+ if (Object.prototype.hasOwnProperty.call(_this.options.headers, header)) {
2530
+ request.setRequestHeader(header, _this.options.headers[header]);
2531
+ }
2532
+ }
2533
+ request.send(sentryRequest.body);
2534
+ });
2535
+ })
2536
+ .then(undefined, function (reason) {
2537
+ // It's either buffer rejection or any other xhr/fetch error, which are treated as NetworkError.
2538
+ if (reason instanceof _sentry_utils__WEBPACK_IMPORTED_MODULE_2__/* .SentryError */ .b) {
2539
+ _this.recordLostEvent('queue_overflow', sentryRequest.type);
2540
+ }
2541
+ else {
2542
+ _this.recordLostEvent('network_error', sentryRequest.type);
2543
+ }
2544
+ throw reason;
2545
+ });
2546
+ };
2547
+ return XHRTransport;
2548
+ }(_base__WEBPACK_IMPORTED_MODULE_3__/* .BaseTransport */ .d));
2549
+
2550
+ //# sourceMappingURL=xhr.js.map
2551
+
2552
+ /***/ }),
2553
+
2554
+ /***/ 334:
2555
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
2556
+
2557
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2558
+ /* harmony export */ "ZT": function() { return /* binding */ __extends; },
2559
+ /* harmony export */ "pi": function() { return /* binding */ __assign; },
2560
+ /* harmony export */ "CR": function() { return /* binding */ __read; },
2561
+ /* harmony export */ "fl": function() { return /* binding */ __spread; }
2562
+ /* harmony export */ });
2563
+ /* unused harmony exports __rest, __decorate, __param, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet */
2564
+ /*! *****************************************************************************
2565
+ Copyright (c) Microsoft Corporation.
2566
+
2567
+ Permission to use, copy, modify, and/or distribute this software for any
2568
+ purpose with or without fee is hereby granted.
2569
+
2570
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
2571
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
2572
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
2573
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
2574
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
2575
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
2576
+ PERFORMANCE OF THIS SOFTWARE.
2577
+ ***************************************************************************** */
2578
+ /* global Reflect, Promise */
2579
+
2580
+ var extendStatics = function(d, b) {
2581
+ extendStatics = Object.setPrototypeOf ||
2582
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
2583
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
2584
+ return extendStatics(d, b);
2585
+ };
2586
+
2587
+ function __extends(d, b) {
2588
+ extendStatics(d, b);
2589
+ function __() { this.constructor = d; }
2590
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
2591
+ }
2592
+
2593
+ var __assign = function() {
2594
+ __assign = Object.assign || function __assign(t) {
2595
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
2596
+ s = arguments[i];
2597
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
2598
+ }
2599
+ return t;
2600
+ }
2601
+ return __assign.apply(this, arguments);
2602
+ }
2603
+
2604
+ function __rest(s, e) {
2605
+ var t = {};
2606
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
2607
+ t[p] = s[p];
2608
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
2609
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
2610
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
2611
+ t[p[i]] = s[p[i]];
2612
+ }
2613
+ return t;
2614
+ }
2615
+
2616
+ function __decorate(decorators, target, key, desc) {
2617
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2618
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
2619
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2620
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
2621
+ }
2622
+
2623
+ function __param(paramIndex, decorator) {
2624
+ return function (target, key) { decorator(target, key, paramIndex); }
2625
+ }
2626
+
2627
+ function __metadata(metadataKey, metadataValue) {
2628
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
2629
+ }
2630
+
2631
+ function __awaiter(thisArg, _arguments, P, generator) {
2632
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
2633
+ return new (P || (P = Promise))(function (resolve, reject) {
2634
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
2635
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
2636
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
2637
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
2638
+ });
2639
+ }
2640
+
2641
+ function __generator(thisArg, body) {
2642
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
2643
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
2644
+ function verb(n) { return function (v) { return step([n, v]); }; }
2645
+ function step(op) {
2646
+ if (f) throw new TypeError("Generator is already executing.");
2647
+ while (_) try {
2648
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
2649
+ if (y = 0, t) op = [op[0] & 2, t.value];
2650
+ switch (op[0]) {
2651
+ case 0: case 1: t = op; break;
2652
+ case 4: _.label++; return { value: op[1], done: false };
2653
+ case 5: _.label++; y = op[1]; op = [0]; continue;
2654
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
2655
+ default:
2656
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
2657
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
2658
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
2659
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
2660
+ if (t[2]) _.ops.pop();
2661
+ _.trys.pop(); continue;
2662
+ }
2663
+ op = body.call(thisArg, _);
2664
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
2665
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
2666
+ }
2667
+ }
2668
+
2669
+ function __createBinding(o, m, k, k2) {
2670
+ if (k2 === undefined) k2 = k;
2671
+ o[k2] = m[k];
2672
+ }
2673
+
2674
+ function __exportStar(m, exports) {
2675
+ for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p];
2676
+ }
2677
+
2678
+ function __values(o) {
2679
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
2680
+ if (m) return m.call(o);
2681
+ if (o && typeof o.length === "number") return {
2682
+ next: function () {
2683
+ if (o && i >= o.length) o = void 0;
2684
+ return { value: o && o[i++], done: !o };
2685
+ }
2686
+ };
2687
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
2688
+ }
2689
+
2690
+ function __read(o, n) {
2691
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
2692
+ if (!m) return o;
2693
+ var i = m.call(o), r, ar = [], e;
2694
+ try {
2695
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
2696
+ }
2697
+ catch (error) { e = { error: error }; }
2698
+ finally {
2699
+ try {
2700
+ if (r && !r.done && (m = i["return"])) m.call(i);
2701
+ }
2702
+ finally { if (e) throw e.error; }
2703
+ }
2704
+ return ar;
2705
+ }
2706
+
2707
+ function __spread() {
2708
+ for (var ar = [], i = 0; i < arguments.length; i++)
2709
+ ar = ar.concat(__read(arguments[i]));
2710
+ return ar;
2711
+ }
2712
+
2713
+ function __spreadArrays() {
2714
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
2715
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
2716
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
2717
+ r[k] = a[j];
2718
+ return r;
2719
+ };
2720
+
2721
+ function __await(v) {
2722
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
2723
+ }
2724
+
2725
+ function __asyncGenerator(thisArg, _arguments, generator) {
2726
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
2727
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
2728
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
2729
+ function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
2730
+ function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
2731
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
2732
+ function fulfill(value) { resume("next", value); }
2733
+ function reject(value) { resume("throw", value); }
2734
+ function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
2735
+ }
2736
+
2737
+ function __asyncDelegator(o) {
2738
+ var i, p;
2739
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
2740
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
2741
+ }
2742
+
2743
+ function __asyncValues(o) {
2744
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
2745
+ var m = o[Symbol.asyncIterator], i;
2746
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
2747
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
2748
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
2749
+ }
2750
+
2751
+ function __makeTemplateObject(cooked, raw) {
2752
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
2753
+ return cooked;
2754
+ };
2755
+
2756
+ function __importStar(mod) {
2757
+ if (mod && mod.__esModule) return mod;
2758
+ var result = {};
2759
+ if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
2760
+ result.default = mod;
2761
+ return result;
2762
+ }
2763
+
2764
+ function __importDefault(mod) {
2765
+ return (mod && mod.__esModule) ? mod : { default: mod };
2766
+ }
2767
+
2768
+ function __classPrivateFieldGet(receiver, privateMap) {
2769
+ if (!privateMap.has(receiver)) {
2770
+ throw new TypeError("attempted to get private field on non-instance");
2771
+ }
2772
+ return privateMap.get(receiver);
2773
+ }
2774
+
2775
+ function __classPrivateFieldSet(receiver, privateMap, value) {
2776
+ if (!privateMap.has(receiver)) {
2777
+ throw new TypeError("attempted to set private field on non-instance");
2778
+ }
2779
+ privateMap.set(receiver, value);
2780
+ return value;
2781
+ }
2782
+
2783
+
2784
+ /***/ }),
2785
+
2786
+ /***/ 4911:
2787
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
2788
+
2789
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2790
+ /* harmony export */ "hd": function() { return /* binding */ initAPIDetails; },
2791
+ /* harmony export */ "qi": function() { return /* binding */ getStoreEndpointWithUrlEncodedAuth; },
2792
+ /* harmony export */ "Ut": function() { return /* binding */ getEnvelopeEndpointWithUrlEncodedAuth; },
2793
+ /* harmony export */ "hR": function() { return /* binding */ getReportDialogEndpoint; }
2794
+ /* harmony export */ });
2795
+ /* unused harmony exports API, getRequestHeaders */
2796
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3135);
2797
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1995);
2798
+
2799
+ var SENTRY_API_VERSION = '7';
2800
+ /**
2801
+ * Helper class to provide urls, headers and metadata that can be used to form
2802
+ * different types of requests to Sentry endpoints.
2803
+ * Supports both envelopes and regular event requests.
2804
+ *
2805
+ * @deprecated Please use APIDetails
2806
+ **/
2807
+ var API = /** @class */ (function () {
2808
+ /** Create a new instance of API */
2809
+ function API(dsn, metadata, tunnel) {
2810
+ if (metadata === void 0) { metadata = {}; }
2811
+ this.dsn = dsn;
2812
+ this._dsnObject = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__/* .makeDsn */ .v)(dsn);
2813
+ this.metadata = metadata;
2814
+ this._tunnel = tunnel;
2815
+ }
2816
+ /** Returns the Dsn object. */
2817
+ API.prototype.getDsn = function () {
2818
+ return this._dsnObject;
2819
+ };
2820
+ /** Does this transport force envelopes? */
2821
+ API.prototype.forceEnvelope = function () {
2822
+ return !!this._tunnel;
2823
+ };
2824
+ /** Returns the prefix to construct Sentry ingestion API endpoints. */
2825
+ API.prototype.getBaseApiEndpoint = function () {
2826
+ return getBaseApiEndpoint(this._dsnObject);
2827
+ };
2828
+ /** Returns the store endpoint URL. */
2829
+ API.prototype.getStoreEndpoint = function () {
2830
+ return getStoreEndpoint(this._dsnObject);
2831
+ };
2832
+ /**
2833
+ * Returns the store endpoint URL with auth in the query string.
2834
+ *
2835
+ * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.
2836
+ */
2837
+ API.prototype.getStoreEndpointWithUrlEncodedAuth = function () {
2838
+ return getStoreEndpointWithUrlEncodedAuth(this._dsnObject);
2839
+ };
2840
+ /**
2841
+ * Returns the envelope endpoint URL with auth in the query string.
2842
+ *
2843
+ * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.
2844
+ */
2845
+ API.prototype.getEnvelopeEndpointWithUrlEncodedAuth = function () {
2846
+ return getEnvelopeEndpointWithUrlEncodedAuth(this._dsnObject, this._tunnel);
2847
+ };
2848
+ return API;
2849
+ }());
2850
+
2851
+ /** Initializes API Details */
2852
+ function initAPIDetails(dsn, metadata, tunnel) {
2853
+ return {
2854
+ initDsn: dsn,
2855
+ metadata: metadata || {},
2856
+ dsn: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__/* .makeDsn */ .v)(dsn),
2857
+ tunnel: tunnel,
2858
+ };
2859
+ }
2860
+ /** Returns the prefix to construct Sentry ingestion API endpoints. */
2861
+ function getBaseApiEndpoint(dsn) {
2862
+ var protocol = dsn.protocol ? dsn.protocol + ":" : '';
2863
+ var port = dsn.port ? ":" + dsn.port : '';
2864
+ return protocol + "//" + dsn.host + port + (dsn.path ? "/" + dsn.path : '') + "/api/";
2865
+ }
2866
+ /** Returns the ingest API endpoint for target. */
2867
+ function _getIngestEndpoint(dsn, target) {
2868
+ return "" + getBaseApiEndpoint(dsn) + dsn.projectId + "/" + target + "/";
2869
+ }
2870
+ /** Returns a URL-encoded string with auth config suitable for a query string. */
2871
+ function _encodedAuth(dsn) {
2872
+ return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__/* .urlEncode */ ._j)({
2873
+ // We send only the minimum set of required information. See
2874
+ // https://github.com/getsentry/sentry-javascript/issues/2572.
2875
+ sentry_key: dsn.publicKey,
2876
+ sentry_version: SENTRY_API_VERSION,
2877
+ });
2878
+ }
2879
+ /** Returns the store endpoint URL. */
2880
+ function getStoreEndpoint(dsn) {
2881
+ return _getIngestEndpoint(dsn, 'store');
2882
+ }
2883
+ /**
2884
+ * Returns the store endpoint URL with auth in the query string.
2885
+ *
2886
+ * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.
2887
+ */
2888
+ function getStoreEndpointWithUrlEncodedAuth(dsn) {
2889
+ return getStoreEndpoint(dsn) + "?" + _encodedAuth(dsn);
2890
+ }
2891
+ /** Returns the envelope endpoint URL. */
2892
+ function _getEnvelopeEndpoint(dsn) {
2893
+ return _getIngestEndpoint(dsn, 'envelope');
2894
+ }
2895
+ /**
2896
+ * Returns the envelope endpoint URL with auth in the query string.
2897
+ *
2898
+ * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.
2899
+ */
2900
+ function getEnvelopeEndpointWithUrlEncodedAuth(dsn, tunnel) {
2901
+ return tunnel ? tunnel : _getEnvelopeEndpoint(dsn) + "?" + _encodedAuth(dsn);
2902
+ }
2903
+ /**
2904
+ * Returns an object that can be used in request headers.
2905
+ * This is needed for node and the old /store endpoint in sentry
2906
+ */
2907
+ function getRequestHeaders(dsn, clientName, clientVersion) {
2908
+ // CHANGE THIS to use metadata but keep clientName and clientVersion compatible
2909
+ var header = ["Sentry sentry_version=" + SENTRY_API_VERSION];
2910
+ header.push("sentry_client=" + clientName + "/" + clientVersion);
2911
+ header.push("sentry_key=" + dsn.publicKey);
2912
+ if (dsn.pass) {
2913
+ header.push("sentry_secret=" + dsn.pass);
2914
+ }
2915
+ return {
2916
+ 'Content-Type': 'application/json',
2917
+ 'X-Sentry-Auth': header.join(', '),
2918
+ };
2919
+ }
2920
+ /** Returns the url to the report dialog endpoint. */
2921
+ function getReportDialogEndpoint(dsnLike, dialogOptions) {
2922
+ var dsn = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__/* .makeDsn */ .v)(dsnLike);
2923
+ var endpoint = getBaseApiEndpoint(dsn) + "embed/error-page/";
2924
+ var encodedOptions = "dsn=" + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__/* .dsnToString */ .R)(dsn);
2925
+ for (var key in dialogOptions) {
2926
+ if (key === 'dsn') {
2927
+ continue;
2928
+ }
2929
+ if (key === 'user') {
2930
+ if (!dialogOptions.user) {
2931
+ continue;
2932
+ }
2933
+ if (dialogOptions.user.name) {
2934
+ encodedOptions += "&name=" + encodeURIComponent(dialogOptions.user.name);
2935
+ }
2936
+ if (dialogOptions.user.email) {
2937
+ encodedOptions += "&email=" + encodeURIComponent(dialogOptions.user.email);
2938
+ }
2939
+ }
2940
+ else {
2941
+ encodedOptions += "&" + encodeURIComponent(key) + "=" + encodeURIComponent(dialogOptions[key]);
2942
+ }
2943
+ }
2944
+ return endpoint + "?" + encodedOptions;
2945
+ }
2946
+ //# sourceMappingURL=api.js.map
2947
+
2948
+ /***/ }),
2949
+
2950
+ /***/ 9504:
2951
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
2952
+
2953
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2954
+ /* harmony export */ "N": function() { return /* binding */ BaseBackend; }
2955
+ /* harmony export */ });
2956
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5733);
2957
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8536);
2958
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4388);
2959
+ /* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4911);
2960
+ /* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(428);
2961
+ /* harmony import */ var _request__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6508);
2962
+ /* harmony import */ var _transports_noop__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(3926);
2963
+
2964
+
2965
+
2966
+
2967
+
2968
+
2969
+ /**
2970
+ * This is the base implemention of a Backend.
2971
+ * @hidden
2972
+ */
2973
+ var BaseBackend = /** @class */ (function () {
2974
+ /** Creates a new backend instance. */
2975
+ function BaseBackend(options) {
2976
+ this._options = options;
2977
+ if (!this._options.dsn) {
2978
+ _flags__WEBPACK_IMPORTED_MODULE_0__/* .IS_DEBUG_BUILD */ .h && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__/* .logger.warn */ .kg.warn('No DSN provided, backend will not do anything.');
2979
+ }
2980
+ this._transport = this._setupTransport();
2981
+ }
2982
+ /**
2983
+ * @inheritDoc
2984
+ */
2985
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
2986
+ BaseBackend.prototype.eventFromException = function (_exception, _hint) {
2987
+ throw new _sentry_utils__WEBPACK_IMPORTED_MODULE_2__/* .SentryError */ .b('Backend has to implement `eventFromException` method');
2988
+ };
2989
+ /**
2990
+ * @inheritDoc
2991
+ */
2992
+ BaseBackend.prototype.eventFromMessage = function (_message, _level, _hint) {
2993
+ throw new _sentry_utils__WEBPACK_IMPORTED_MODULE_2__/* .SentryError */ .b('Backend has to implement `eventFromMessage` method');
2994
+ };
2995
+ /**
2996
+ * @inheritDoc
2997
+ */
2998
+ BaseBackend.prototype.sendEvent = function (event) {
2999
+ // TODO(v7): Remove the if-else
3000
+ if (this._newTransport &&
3001
+ this._options.dsn &&
3002
+ this._options._experiments &&
3003
+ this._options._experiments.newTransport) {
3004
+ var api = (0,_api__WEBPACK_IMPORTED_MODULE_3__/* .initAPIDetails */ .hd)(this._options.dsn, this._options._metadata, this._options.tunnel);
3005
+ var env = (0,_request__WEBPACK_IMPORTED_MODULE_4__/* .createEventEnvelope */ .Mq)(event, api);
3006
+ void this._newTransport.send(env).then(null, function (reason) {
3007
+ _flags__WEBPACK_IMPORTED_MODULE_0__/* .IS_DEBUG_BUILD */ .h && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__/* .logger.error */ .kg.error('Error while sending event:', reason);
3008
+ });
3009
+ }
3010
+ else {
3011
+ void this._transport.sendEvent(event).then(null, function (reason) {
3012
+ _flags__WEBPACK_IMPORTED_MODULE_0__/* .IS_DEBUG_BUILD */ .h && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__/* .logger.error */ .kg.error('Error while sending event:', reason);
3013
+ });
3014
+ }
3015
+ };
3016
+ /**
3017
+ * @inheritDoc
3018
+ */
3019
+ BaseBackend.prototype.sendSession = function (session) {
3020
+ if (!this._transport.sendSession) {
3021
+ _flags__WEBPACK_IMPORTED_MODULE_0__/* .IS_DEBUG_BUILD */ .h && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__/* .logger.warn */ .kg.warn("Dropping session because custom transport doesn't implement sendSession");
3022
+ return;
3023
+ }
3024
+ // TODO(v7): Remove the if-else
3025
+ if (this._newTransport &&
3026
+ this._options.dsn &&
3027
+ this._options._experiments &&
3028
+ this._options._experiments.newTransport) {
3029
+ var api = (0,_api__WEBPACK_IMPORTED_MODULE_3__/* .initAPIDetails */ .hd)(this._options.dsn, this._options._metadata, this._options.tunnel);
3030
+ var _a = (0,tslib__WEBPACK_IMPORTED_MODULE_5__/* .__read */ .CR)((0,_request__WEBPACK_IMPORTED_MODULE_4__/* .createSessionEnvelope */ .Q3)(session, api), 1), env = _a[0];
3031
+ void this._newTransport.send(env).then(null, function (reason) {
3032
+ _flags__WEBPACK_IMPORTED_MODULE_0__/* .IS_DEBUG_BUILD */ .h && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__/* .logger.error */ .kg.error('Error while sending session:', reason);
3033
+ });
3034
+ }
3035
+ else {
3036
+ void this._transport.sendSession(session).then(null, function (reason) {
3037
+ _flags__WEBPACK_IMPORTED_MODULE_0__/* .IS_DEBUG_BUILD */ .h && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__/* .logger.error */ .kg.error('Error while sending session:', reason);
3038
+ });
3039
+ }
3040
+ };
3041
+ /**
3042
+ * @inheritDoc
3043
+ */
3044
+ BaseBackend.prototype.getTransport = function () {
3045
+ return this._transport;
3046
+ };
3047
+ /**
3048
+ * Sets up the transport so it can be used later to send requests.
3049
+ */
3050
+ BaseBackend.prototype._setupTransport = function () {
3051
+ return new _transports_noop__WEBPACK_IMPORTED_MODULE_6__/* .NoopTransport */ .V();
3052
+ };
3053
+ return BaseBackend;
3054
+ }());
3055
+
3056
+ //# sourceMappingURL=basebackend.js.map
3057
+
3058
+ /***/ }),
3059
+
3060
+ /***/ 9849:
3061
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
3062
+
3063
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3064
+ /* harmony export */ "W": function() { return /* binding */ BaseClient; }
3065
+ /* harmony export */ });
3066
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5733);
3067
+ /* harmony import */ var _sentry_hub__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(1684);
3068
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3135);
3069
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3699);
3070
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8536);
3071
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1757);
3072
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7946);
3073
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(7790);
3074
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(8035);
3075
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(9660);
3076
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(4388);
3077
+ /* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(428);
3078
+ /* harmony import */ var _integration__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8889);
3079
+
3080
+ /* eslint-disable max-lines */
3081
+
3082
+
3083
+
3084
+
3085
+ var ALREADY_SEEN_ERROR = "Not capturing exception because it's already been captured.";
3086
+ /**
3087
+ * Base implementation for all JavaScript SDK clients.
3088
+ *
3089
+ * Call the constructor with the corresponding backend constructor and options
3090
+ * specific to the client subclass. To access these options later, use
3091
+ * {@link Client.getOptions}. Also, the Backend instance is available via
3092
+ * {@link Client.getBackend}.
3093
+ *
3094
+ * If a Dsn is specified in the options, it will be parsed and stored. Use
3095
+ * {@link Client.getDsn} to retrieve the Dsn at any moment. In case the Dsn is
3096
+ * invalid, the constructor will throw a {@link SentryException}. Note that
3097
+ * without a valid Dsn, the SDK will not send any events to Sentry.
3098
+ *
3099
+ * Before sending an event via the backend, it is passed through
3100
+ * {@link BaseClient._prepareEvent} to add SDK information and scope data
3101
+ * (breadcrumbs and context). To add more custom information, override this
3102
+ * method and extend the resulting prepared event.
3103
+ *
3104
+ * To issue automatically created events (e.g. via instrumentation), use
3105
+ * {@link Client.captureEvent}. It will prepare the event and pass it through
3106
+ * the callback lifecycle. To issue auto-breadcrumbs, use
3107
+ * {@link Client.addBreadcrumb}.
3108
+ *
3109
+ * @example
3110
+ * class NodeClient extends BaseClient<NodeBackend, NodeOptions> {
3111
+ * public constructor(options: NodeOptions) {
3112
+ * super(NodeBackend, options);
3113
+ * }
3114
+ *
3115
+ * // ...
3116
+ * }
3117
+ */
3118
+ var BaseClient = /** @class */ (function () {
3119
+ /**
3120
+ * Initializes this client instance.
3121
+ *
3122
+ * @param backendClass A constructor function to create the backend.
3123
+ * @param options Options for the client.
3124
+ */
3125
+ function BaseClient(backendClass, options) {
3126
+ /** Array of used integrations. */
3127
+ this._integrations = {};
3128
+ /** Number of calls being processed */
3129
+ this._numProcessing = 0;
3130
+ this._backend = new backendClass(options);
3131
+ this._options = options;
3132
+ if (options.dsn) {
3133
+ this._dsn = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__/* .makeDsn */ .v)(options.dsn);
3134
+ }
3135
+ }
3136
+ /**
3137
+ * @inheritDoc
3138
+ */
3139
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
3140
+ BaseClient.prototype.captureException = function (exception, hint, scope) {
3141
+ var _this = this;
3142
+ // ensure we haven't captured this very object before
3143
+ if ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__/* .checkOrSetAlreadyCaught */ .YO)(exception)) {
3144
+ _flags__WEBPACK_IMPORTED_MODULE_2__/* .IS_DEBUG_BUILD */ .h && _sentry_utils__WEBPACK_IMPORTED_MODULE_3__/* .logger.log */ .kg.log(ALREADY_SEEN_ERROR);
3145
+ return;
3146
+ }
3147
+ var eventId = hint && hint.event_id;
3148
+ this._process(this._getBackend()
3149
+ .eventFromException(exception, hint)
3150
+ .then(function (event) { return _this._captureEvent(event, hint, scope); })
3151
+ .then(function (result) {
3152
+ eventId = result;
3153
+ }));
3154
+ return eventId;
3155
+ };
3156
+ /**
3157
+ * @inheritDoc
3158
+ */
3159
+ BaseClient.prototype.captureMessage = function (message, level, hint, scope) {
3160
+ var _this = this;
3161
+ var eventId = hint && hint.event_id;
3162
+ var promisedEvent = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__/* .isPrimitive */ .pt)(message)
3163
+ ? this._getBackend().eventFromMessage(String(message), level, hint)
3164
+ : this._getBackend().eventFromException(message, hint);
3165
+ this._process(promisedEvent
3166
+ .then(function (event) { return _this._captureEvent(event, hint, scope); })
3167
+ .then(function (result) {
3168
+ eventId = result;
3169
+ }));
3170
+ return eventId;
3171
+ };
3172
+ /**
3173
+ * @inheritDoc
3174
+ */
3175
+ BaseClient.prototype.captureEvent = function (event, hint, scope) {
3176
+ // ensure we haven't captured this very object before
3177
+ if (hint && hint.originalException && (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__/* .checkOrSetAlreadyCaught */ .YO)(hint.originalException)) {
3178
+ _flags__WEBPACK_IMPORTED_MODULE_2__/* .IS_DEBUG_BUILD */ .h && _sentry_utils__WEBPACK_IMPORTED_MODULE_3__/* .logger.log */ .kg.log(ALREADY_SEEN_ERROR);
3179
+ return;
3180
+ }
3181
+ var eventId = hint && hint.event_id;
3182
+ this._process(this._captureEvent(event, hint, scope).then(function (result) {
3183
+ eventId = result;
3184
+ }));
3185
+ return eventId;
3186
+ };
3187
+ /**
3188
+ * @inheritDoc
3189
+ */
3190
+ BaseClient.prototype.captureSession = function (session) {
3191
+ if (!this._isEnabled()) {
3192
+ _flags__WEBPACK_IMPORTED_MODULE_2__/* .IS_DEBUG_BUILD */ .h && _sentry_utils__WEBPACK_IMPORTED_MODULE_3__/* .logger.warn */ .kg.warn('SDK not enabled, will not capture session.');
3193
+ return;
3194
+ }
3195
+ if (!(typeof session.release === 'string')) {
3196
+ _flags__WEBPACK_IMPORTED_MODULE_2__/* .IS_DEBUG_BUILD */ .h && _sentry_utils__WEBPACK_IMPORTED_MODULE_3__/* .logger.warn */ .kg.warn('Discarded session because of missing or non-string release');
3197
+ }
3198
+ else {
3199
+ this._sendSession(session);
3200
+ // After sending, we set init false to indicate it's not the first occurrence
3201
+ session.update({ init: false });
3202
+ }
3203
+ };
3204
+ /**
3205
+ * @inheritDoc
3206
+ */
3207
+ BaseClient.prototype.getDsn = function () {
3208
+ return this._dsn;
3209
+ };
3210
+ /**
3211
+ * @inheritDoc
3212
+ */
3213
+ BaseClient.prototype.getOptions = function () {
3214
+ return this._options;
3215
+ };
3216
+ /**
3217
+ * @inheritDoc
3218
+ */
3219
+ BaseClient.prototype.getTransport = function () {
3220
+ return this._getBackend().getTransport();
3221
+ };
3222
+ /**
3223
+ * @inheritDoc
3224
+ */
3225
+ BaseClient.prototype.flush = function (timeout) {
3226
+ var _this = this;
3227
+ return this._isClientDoneProcessing(timeout).then(function (clientFinished) {
3228
+ return _this.getTransport()
3229
+ .close(timeout)
3230
+ .then(function (transportFlushed) { return clientFinished && transportFlushed; });
3231
+ });
3232
+ };
3233
+ /**
3234
+ * @inheritDoc
3235
+ */
3236
+ BaseClient.prototype.close = function (timeout) {
3237
+ var _this = this;
3238
+ return this.flush(timeout).then(function (result) {
3239
+ _this.getOptions().enabled = false;
3240
+ return result;
3241
+ });
3242
+ };
3243
+ /**
3244
+ * Sets up the integrations
3245
+ */
3246
+ BaseClient.prototype.setupIntegrations = function () {
3247
+ if (this._isEnabled() && !this._integrations.initialized) {
3248
+ this._integrations = (0,_integration__WEBPACK_IMPORTED_MODULE_5__/* .setupIntegrations */ .q4)(this._options);
3249
+ }
3250
+ };
3251
+ /**
3252
+ * @inheritDoc
3253
+ */
3254
+ BaseClient.prototype.getIntegration = function (integration) {
3255
+ try {
3256
+ return this._integrations[integration.id] || null;
3257
+ }
3258
+ catch (_oO) {
3259
+ _flags__WEBPACK_IMPORTED_MODULE_2__/* .IS_DEBUG_BUILD */ .h && _sentry_utils__WEBPACK_IMPORTED_MODULE_3__/* .logger.warn */ .kg.warn("Cannot retrieve integration " + integration.id + " from the current Client");
3260
+ return null;
3261
+ }
3262
+ };
3263
+ /** Updates existing session based on the provided event */
3264
+ BaseClient.prototype._updateSessionFromEvent = function (session, event) {
3265
+ var e_1, _a;
3266
+ var crashed = false;
3267
+ var errored = false;
3268
+ var exceptions = event.exception && event.exception.values;
3269
+ if (exceptions) {
3270
+ errored = true;
3271
+ try {
3272
+ for (var exceptions_1 = (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__values */ .XA)(exceptions), exceptions_1_1 = exceptions_1.next(); !exceptions_1_1.done; exceptions_1_1 = exceptions_1.next()) {
3273
+ var ex = exceptions_1_1.value;
3274
+ var mechanism = ex.mechanism;
3275
+ if (mechanism && mechanism.handled === false) {
3276
+ crashed = true;
3277
+ break;
3278
+ }
3279
+ }
3280
+ }
3281
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
3282
+ finally {
3283
+ try {
3284
+ if (exceptions_1_1 && !exceptions_1_1.done && (_a = exceptions_1.return)) _a.call(exceptions_1);
3285
+ }
3286
+ finally { if (e_1) throw e_1.error; }
3287
+ }
3288
+ }
3289
+ // A session is updated and that session update is sent in only one of the two following scenarios:
3290
+ // 1. Session with non terminal status and 0 errors + an error occurred -> Will set error count to 1 and send update
3291
+ // 2. Session with non terminal status and 1 error + a crash occurred -> Will set status crashed and send update
3292
+ var sessionNonTerminal = session.status === 'ok';
3293
+ var shouldUpdateAndSend = (sessionNonTerminal && session.errors === 0) || (sessionNonTerminal && crashed);
3294
+ if (shouldUpdateAndSend) {
3295
+ session.update((0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__assign */ .pi)({}, (crashed && { status: 'crashed' })), { errors: session.errors || Number(errored || crashed) }));
3296
+ this.captureSession(session);
3297
+ }
3298
+ };
3299
+ /** Deliver captured session to Sentry */
3300
+ BaseClient.prototype._sendSession = function (session) {
3301
+ this._getBackend().sendSession(session);
3302
+ };
3303
+ /**
3304
+ * Determine if the client is finished processing. Returns a promise because it will wait `timeout` ms before saying
3305
+ * "no" (resolving to `false`) in order to give the client a chance to potentially finish first.
3306
+ *
3307
+ * @param timeout The time, in ms, after which to resolve to `false` if the client is still busy. Passing `0` (or not
3308
+ * passing anything) will make the promise wait as long as it takes for processing to finish before resolving to
3309
+ * `true`.
3310
+ * @returns A promise which will resolve to `true` if processing is already done or finishes before the timeout, and
3311
+ * `false` otherwise
3312
+ */
3313
+ BaseClient.prototype._isClientDoneProcessing = function (timeout) {
3314
+ var _this = this;
3315
+ return new _sentry_utils__WEBPACK_IMPORTED_MODULE_7__/* .SyncPromise */ .cW(function (resolve) {
3316
+ var ticked = 0;
3317
+ var tick = 1;
3318
+ var interval = setInterval(function () {
3319
+ if (_this._numProcessing == 0) {
3320
+ clearInterval(interval);
3321
+ resolve(true);
3322
+ }
3323
+ else {
3324
+ ticked += tick;
3325
+ if (timeout && ticked >= timeout) {
3326
+ clearInterval(interval);
3327
+ resolve(false);
3328
+ }
3329
+ }
3330
+ }, tick);
3331
+ });
3332
+ };
3333
+ /** Returns the current backend. */
3334
+ BaseClient.prototype._getBackend = function () {
3335
+ return this._backend;
3336
+ };
3337
+ /** Determines whether this SDK is enabled and a valid Dsn is present. */
3338
+ BaseClient.prototype._isEnabled = function () {
3339
+ return this.getOptions().enabled !== false && this._dsn !== undefined;
3340
+ };
3341
+ /**
3342
+ * Adds common information to events.
3343
+ *
3344
+ * The information includes release and environment from `options`,
3345
+ * breadcrumbs and context (extra, tags and user) from the scope.
3346
+ *
3347
+ * Information that is already present in the event is never overwritten. For
3348
+ * nested objects, such as the context, keys are merged.
3349
+ *
3350
+ * @param event The original event.
3351
+ * @param hint May contain additional information about the original exception.
3352
+ * @param scope A scope containing event metadata.
3353
+ * @returns A new event with more information.
3354
+ */
3355
+ BaseClient.prototype._prepareEvent = function (event, scope, hint) {
3356
+ var _this = this;
3357
+ var _a = this.getOptions(), _b = _a.normalizeDepth, normalizeDepth = _b === void 0 ? 3 : _b, _c = _a.normalizeMaxBreadth, normalizeMaxBreadth = _c === void 0 ? 1000 : _c;
3358
+ var prepared = (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__assign */ .pi)({}, event), { event_id: event.event_id || (hint && hint.event_id ? hint.event_id : (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__/* .uuid4 */ .DM)()), timestamp: event.timestamp || (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_8__/* .dateTimestampInSeconds */ .yW)() });
3359
+ this._applyClientOptions(prepared);
3360
+ this._applyIntegrationsMetadata(prepared);
3361
+ // If we have scope given to us, use it as the base for further modifications.
3362
+ // This allows us to prevent unnecessary copying of data if `captureContext` is not provided.
3363
+ var finalScope = scope;
3364
+ if (hint && hint.captureContext) {
3365
+ finalScope = _sentry_hub__WEBPACK_IMPORTED_MODULE_9__/* .Scope.clone */ .s.clone(finalScope).update(hint.captureContext);
3366
+ }
3367
+ // We prepare the result here with a resolved Event.
3368
+ var result = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_7__/* .resolvedSyncPromise */ .WD)(prepared);
3369
+ // This should be the last thing called, since we want that
3370
+ // {@link Hub.addEventProcessor} gets the finished prepared event.
3371
+ if (finalScope) {
3372
+ // In case we have a hub we reassign it.
3373
+ result = finalScope.applyToEvent(prepared, hint);
3374
+ }
3375
+ return result.then(function (evt) {
3376
+ if (evt) {
3377
+ // TODO this is more of the hack trying to solve https://github.com/getsentry/sentry-javascript/issues/2809
3378
+ // it is only attached as extra data to the event if the event somehow skips being normalized
3379
+ evt.sdkProcessingMetadata = (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__assign */ .pi)({}, evt.sdkProcessingMetadata), { normalizeDepth: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_10__/* .normalize */ .Fv)(normalizeDepth) + " (" + typeof normalizeDepth + ")" });
3380
+ }
3381
+ if (typeof normalizeDepth === 'number' && normalizeDepth > 0) {
3382
+ return _this._normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth);
3383
+ }
3384
+ return evt;
3385
+ });
3386
+ };
3387
+ /**
3388
+ * Applies `normalize` function on necessary `Event` attributes to make them safe for serialization.
3389
+ * Normalized keys:
3390
+ * - `breadcrumbs.data`
3391
+ * - `user`
3392
+ * - `contexts`
3393
+ * - `extra`
3394
+ * @param event Event
3395
+ * @returns Normalized event
3396
+ */
3397
+ BaseClient.prototype._normalizeEvent = function (event, depth, maxBreadth) {
3398
+ if (!event) {
3399
+ return null;
3400
+ }
3401
+ var normalized = (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__assign */ .pi)({}, event), (event.breadcrumbs && {
3402
+ breadcrumbs: event.breadcrumbs.map(function (b) { return ((0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__assign */ .pi)({}, b), (b.data && {
3403
+ data: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_10__/* .normalize */ .Fv)(b.data, depth, maxBreadth),
3404
+ }))); }),
3405
+ })), (event.user && {
3406
+ user: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_10__/* .normalize */ .Fv)(event.user, depth, maxBreadth),
3407
+ })), (event.contexts && {
3408
+ contexts: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_10__/* .normalize */ .Fv)(event.contexts, depth, maxBreadth),
3409
+ })), (event.extra && {
3410
+ extra: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_10__/* .normalize */ .Fv)(event.extra, depth, maxBreadth),
3411
+ }));
3412
+ // event.contexts.trace stores information about a Transaction. Similarly,
3413
+ // event.spans[] stores information about child Spans. Given that a
3414
+ // Transaction is conceptually a Span, normalization should apply to both
3415
+ // Transactions and Spans consistently.
3416
+ // For now the decision is to skip normalization of Transactions and Spans,
3417
+ // so this block overwrites the normalized event to add back the original
3418
+ // Transaction information prior to normalization.
3419
+ if (event.contexts && event.contexts.trace) {
3420
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
3421
+ normalized.contexts.trace = event.contexts.trace;
3422
+ }
3423
+ normalized.sdkProcessingMetadata = (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__assign */ .pi)({}, normalized.sdkProcessingMetadata), { baseClientNormalized: true });
3424
+ return normalized;
3425
+ };
3426
+ /**
3427
+ * Enhances event using the client configuration.
3428
+ * It takes care of all "static" values like environment, release and `dist`,
3429
+ * as well as truncating overly long values.
3430
+ * @param event event instance to be enhanced
3431
+ */
3432
+ BaseClient.prototype._applyClientOptions = function (event) {
3433
+ var options = this.getOptions();
3434
+ var environment = options.environment, release = options.release, dist = options.dist, _a = options.maxValueLength, maxValueLength = _a === void 0 ? 250 : _a;
3435
+ if (!('environment' in event)) {
3436
+ event.environment = 'environment' in options ? environment : 'production';
3437
+ }
3438
+ if (event.release === undefined && release !== undefined) {
3439
+ event.release = release;
3440
+ }
3441
+ if (event.dist === undefined && dist !== undefined) {
3442
+ event.dist = dist;
3443
+ }
3444
+ if (event.message) {
3445
+ event.message = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_11__/* .truncate */ .$G)(event.message, maxValueLength);
3446
+ }
3447
+ var exception = event.exception && event.exception.values && event.exception.values[0];
3448
+ if (exception && exception.value) {
3449
+ exception.value = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_11__/* .truncate */ .$G)(exception.value, maxValueLength);
3450
+ }
3451
+ var request = event.request;
3452
+ if (request && request.url) {
3453
+ request.url = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_11__/* .truncate */ .$G)(request.url, maxValueLength);
3454
+ }
3455
+ };
3456
+ /**
3457
+ * This function adds all used integrations to the SDK info in the event.
3458
+ * @param event The event that will be filled with all integrations.
3459
+ */
3460
+ BaseClient.prototype._applyIntegrationsMetadata = function (event) {
3461
+ var integrationsArray = Object.keys(this._integrations);
3462
+ if (integrationsArray.length > 0) {
3463
+ event.sdk = event.sdk || {};
3464
+ event.sdk.integrations = (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__spread */ .fl)((event.sdk.integrations || []), integrationsArray);
3465
+ }
3466
+ };
3467
+ /**
3468
+ * Tells the backend to send this event
3469
+ * @param event The Sentry event to send
3470
+ */
3471
+ BaseClient.prototype._sendEvent = function (event) {
3472
+ this._getBackend().sendEvent(event);
3473
+ };
3474
+ /**
3475
+ * Processes the event and logs an error in case of rejection
3476
+ * @param event
3477
+ * @param hint
3478
+ * @param scope
3479
+ */
3480
+ BaseClient.prototype._captureEvent = function (event, hint, scope) {
3481
+ return this._processEvent(event, hint, scope).then(function (finalEvent) {
3482
+ return finalEvent.event_id;
3483
+ }, function (reason) {
3484
+ _flags__WEBPACK_IMPORTED_MODULE_2__/* .IS_DEBUG_BUILD */ .h && _sentry_utils__WEBPACK_IMPORTED_MODULE_3__/* .logger.error */ .kg.error(reason);
3485
+ return undefined;
3486
+ });
3487
+ };
3488
+ /**
3489
+ * Processes an event (either error or message) and sends it to Sentry.
3490
+ *
3491
+ * This also adds breadcrumbs and context information to the event. However,
3492
+ * platform specific meta data (such as the User's IP address) must be added
3493
+ * by the SDK implementor.
3494
+ *
3495
+ *
3496
+ * @param event The event to send to Sentry.
3497
+ * @param hint May contain additional information about the original exception.
3498
+ * @param scope A scope containing event metadata.
3499
+ * @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send.
3500
+ */
3501
+ BaseClient.prototype._processEvent = function (event, hint, scope) {
3502
+ var _this = this;
3503
+ // eslint-disable-next-line @typescript-eslint/unbound-method
3504
+ var _a = this.getOptions(), beforeSend = _a.beforeSend, sampleRate = _a.sampleRate;
3505
+ var transport = this.getTransport();
3506
+ function recordLostEvent(outcome, category) {
3507
+ if (transport.recordLostEvent) {
3508
+ transport.recordLostEvent(outcome, category);
3509
+ }
3510
+ }
3511
+ if (!this._isEnabled()) {
3512
+ return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_7__/* .rejectedSyncPromise */ .$2)(new _sentry_utils__WEBPACK_IMPORTED_MODULE_12__/* .SentryError */ .b('SDK not enabled, will not capture event.'));
3513
+ }
3514
+ var isTransaction = event.type === 'transaction';
3515
+ // 1.0 === 100% events are sent
3516
+ // 0.0 === 0% events are sent
3517
+ // Sampling for transaction happens somewhere else
3518
+ if (!isTransaction && typeof sampleRate === 'number' && Math.random() > sampleRate) {
3519
+ recordLostEvent('sample_rate', 'event');
3520
+ return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_7__/* .rejectedSyncPromise */ .$2)(new _sentry_utils__WEBPACK_IMPORTED_MODULE_12__/* .SentryError */ .b("Discarding event because it's not included in the random sample (sampling rate = " + sampleRate + ")"));
3521
+ }
3522
+ return this._prepareEvent(event, scope, hint)
3523
+ .then(function (prepared) {
3524
+ if (prepared === null) {
3525
+ recordLostEvent('event_processor', event.type || 'event');
3526
+ throw new _sentry_utils__WEBPACK_IMPORTED_MODULE_12__/* .SentryError */ .b('An event processor returned null, will not send event.');
3527
+ }
3528
+ var isInternalException = hint && hint.data && hint.data.__sentry__ === true;
3529
+ if (isInternalException || isTransaction || !beforeSend) {
3530
+ return prepared;
3531
+ }
3532
+ var beforeSendResult = beforeSend(prepared, hint);
3533
+ return _ensureBeforeSendRv(beforeSendResult);
3534
+ })
3535
+ .then(function (processedEvent) {
3536
+ if (processedEvent === null) {
3537
+ recordLostEvent('before_send', event.type || 'event');
3538
+ throw new _sentry_utils__WEBPACK_IMPORTED_MODULE_12__/* .SentryError */ .b('`beforeSend` returned `null`, will not send event.');
3539
+ }
3540
+ var session = scope && scope.getSession && scope.getSession();
3541
+ if (!isTransaction && session) {
3542
+ _this._updateSessionFromEvent(session, processedEvent);
3543
+ }
3544
+ _this._sendEvent(processedEvent);
3545
+ return processedEvent;
3546
+ })
3547
+ .then(null, function (reason) {
3548
+ if (reason instanceof _sentry_utils__WEBPACK_IMPORTED_MODULE_12__/* .SentryError */ .b) {
3549
+ throw reason;
3550
+ }
3551
+ _this.captureException(reason, {
3552
+ data: {
3553
+ __sentry__: true,
3554
+ },
3555
+ originalException: reason,
3556
+ });
3557
+ throw new _sentry_utils__WEBPACK_IMPORTED_MODULE_12__/* .SentryError */ .b("Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: " + reason);
3558
+ });
3559
+ };
3560
+ /**
3561
+ * Occupies the client with processing and event
3562
+ */
3563
+ BaseClient.prototype._process = function (promise) {
3564
+ var _this = this;
3565
+ this._numProcessing += 1;
3566
+ void promise.then(function (value) {
3567
+ _this._numProcessing -= 1;
3568
+ return value;
3569
+ }, function (reason) {
3570
+ _this._numProcessing -= 1;
3571
+ return reason;
3572
+ });
3573
+ };
3574
+ return BaseClient;
3575
+ }());
3576
+
3577
+ /**
3578
+ * Verifies that return value of configured `beforeSend` is of expected type.
3579
+ */
3580
+ function _ensureBeforeSendRv(rv) {
3581
+ var nullErr = '`beforeSend` method has to return `null` or a valid event.';
3582
+ if ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__/* .isThenable */ .J8)(rv)) {
3583
+ return rv.then(function (event) {
3584
+ if (!((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__/* .isPlainObject */ .PO)(event) || event === null)) {
3585
+ throw new _sentry_utils__WEBPACK_IMPORTED_MODULE_12__/* .SentryError */ .b(nullErr);
3586
+ }
3587
+ return event;
3588
+ }, function (e) {
3589
+ throw new _sentry_utils__WEBPACK_IMPORTED_MODULE_12__/* .SentryError */ .b("beforeSend rejected with " + e);
3590
+ });
3591
+ }
3592
+ else if (!((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__/* .isPlainObject */ .PO)(rv) || rv === null)) {
3593
+ throw new _sentry_utils__WEBPACK_IMPORTED_MODULE_12__/* .SentryError */ .b(nullErr);
3594
+ }
3595
+ return rv;
3596
+ }
3597
+ //# sourceMappingURL=baseclient.js.map
3598
+
3599
+ /***/ }),
3600
+
3601
+ /***/ 428:
3602
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
3603
+
3604
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3605
+ /* harmony export */ "h": function() { return /* binding */ IS_DEBUG_BUILD; }
3606
+ /* harmony export */ });
3607
+ /*
3608
+ * This file defines flags and constants that can be modified during compile time in order to facilitate tree shaking
3609
+ * for users.
3610
+ *
3611
+ * Debug flags need to be declared in each package individually and must not be imported across package boundaries,
3612
+ * because some build tools have trouble tree-shaking imported guards.
3613
+ *
3614
+ * As a convention, we define debug flags in a `flags.ts` file in the root of a package's `src` folder.
3615
+ *
3616
+ * Debug flag files will contain "magic strings" like `__SENTRY_DEBUG__` that may get replaced with actual values during
3617
+ * our, or the user's build process. Take care when introducing new flags - they must not throw if they are not
3618
+ * replaced.
3619
+ */
3620
+ /** Flag that is true for debug builds, false otherwise. */
3621
+ var IS_DEBUG_BUILD = typeof __SENTRY_DEBUG__ === 'undefined' ? true : __SENTRY_DEBUG__;
3622
+ //# sourceMappingURL=flags.js.map
3623
+
3624
+ /***/ }),
3625
+
3626
+ /***/ 8889:
3627
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
3628
+
3629
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3630
+ /* harmony export */ "q4": function() { return /* binding */ setupIntegrations; }
3631
+ /* harmony export */ });
3632
+ /* unused harmony exports installedIntegrations, getIntegrationsToSetup, setupIntegration */
3633
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5733);
3634
+ /* harmony import */ var _sentry_hub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1684);
3635
+ /* harmony import */ var _sentry_hub__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8585);
3636
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8536);
3637
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1995);
3638
+ /* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(428);
3639
+
3640
+
3641
+
3642
+
3643
+ var installedIntegrations = [];
3644
+ /**
3645
+ * @private
3646
+ */
3647
+ function filterDuplicates(integrations) {
3648
+ return integrations.reduce(function (acc, integrations) {
3649
+ if (acc.every(function (accIntegration) { return integrations.name !== accIntegration.name; })) {
3650
+ acc.push(integrations);
3651
+ }
3652
+ return acc;
3653
+ }, []);
3654
+ }
3655
+ /** Gets integration to install */
3656
+ function getIntegrationsToSetup(options) {
3657
+ var defaultIntegrations = (options.defaultIntegrations && (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__spread */ .fl)(options.defaultIntegrations)) || [];
3658
+ var userIntegrations = options.integrations;
3659
+ var integrations = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__spread */ .fl)(filterDuplicates(defaultIntegrations));
3660
+ if (Array.isArray(userIntegrations)) {
3661
+ // Filter out integrations that are also included in user options
3662
+ integrations = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__spread */ .fl)(integrations.filter(function (integrations) {
3663
+ return userIntegrations.every(function (userIntegration) { return userIntegration.name !== integrations.name; });
3664
+ }), filterDuplicates(userIntegrations));
3665
+ }
3666
+ else if (typeof userIntegrations === 'function') {
3667
+ integrations = userIntegrations(integrations);
3668
+ integrations = Array.isArray(integrations) ? integrations : [integrations];
3669
+ }
3670
+ // Make sure that if present, `Debug` integration will always run last
3671
+ var integrationsNames = integrations.map(function (i) { return i.name; });
3672
+ var alwaysLastToRun = 'Debug';
3673
+ if (integrationsNames.indexOf(alwaysLastToRun) !== -1) {
3674
+ integrations.push.apply(integrations, (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__spread */ .fl)(integrations.splice(integrationsNames.indexOf(alwaysLastToRun), 1)));
3675
+ }
3676
+ return integrations;
3677
+ }
3678
+ /** Setup given integration */
3679
+ function setupIntegration(integration) {
3680
+ if (installedIntegrations.indexOf(integration.name) !== -1) {
3681
+ return;
3682
+ }
3683
+ integration.setupOnce(_sentry_hub__WEBPACK_IMPORTED_MODULE_1__/* .addGlobalEventProcessor */ .c, _sentry_hub__WEBPACK_IMPORTED_MODULE_2__/* .getCurrentHub */ .Gd);
3684
+ installedIntegrations.push(integration.name);
3685
+ _flags__WEBPACK_IMPORTED_MODULE_3__/* .IS_DEBUG_BUILD */ .h && _sentry_utils__WEBPACK_IMPORTED_MODULE_4__/* .logger.log */ .kg.log("Integration installed: " + integration.name);
3686
+ }
3687
+ /**
3688
+ * Given a list of integration instances this installs them all. When `withDefaults` is set to `true` then all default
3689
+ * integrations are added unless they were already provided before.
3690
+ * @param integrations array of integration instances
3691
+ * @param withDefault should enable default integrations
3692
+ */
3693
+ function setupIntegrations(options) {
3694
+ var integrations = {};
3695
+ getIntegrationsToSetup(options).forEach(function (integration) {
3696
+ integrations[integration.name] = integration;
3697
+ setupIntegration(integration);
3698
+ });
3699
+ // set the `initialized` flag so we don't run through the process again unecessarily; use `Object.defineProperty`
3700
+ // because by default it creates a property which is nonenumerable, which we want since `initialized` shouldn't be
3701
+ // considered a member of the index the way the actual integrations are
3702
+ (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_5__/* .addNonEnumerableProperty */ .xp)(integrations, 'initialized', true);
3703
+ return integrations;
3704
+ }
3705
+ //# sourceMappingURL=integration.js.map
3706
+
3707
+ /***/ }),
3708
+
3709
+ /***/ 6286:
3710
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
3711
+
3712
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3713
+ /* harmony export */ "c": function() { return /* binding */ FunctionToString; }
3714
+ /* harmony export */ });
3715
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1995);
3716
+
3717
+ var originalFunctionToString;
3718
+ /** Patch toString calls to return proper name for wrapped functions */
3719
+ var FunctionToString = /** @class */ (function () {
3720
+ function FunctionToString() {
3721
+ /**
3722
+ * @inheritDoc
3723
+ */
3724
+ this.name = FunctionToString.id;
3725
+ }
3726
+ /**
3727
+ * @inheritDoc
3728
+ */
3729
+ FunctionToString.prototype.setupOnce = function () {
3730
+ // eslint-disable-next-line @typescript-eslint/unbound-method
3731
+ originalFunctionToString = Function.prototype.toString;
3732
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3733
+ Function.prototype.toString = function () {
3734
+ var args = [];
3735
+ for (var _i = 0; _i < arguments.length; _i++) {
3736
+ args[_i] = arguments[_i];
3737
+ }
3738
+ var context = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__/* .getOriginalFunction */ .HK)(this) || this;
3739
+ return originalFunctionToString.apply(context, args);
3740
+ };
3741
+ };
3742
+ /**
3743
+ * @inheritDoc
3744
+ */
3745
+ FunctionToString.id = 'FunctionToString';
3746
+ return FunctionToString;
3747
+ }());
3748
+
3749
+ //# sourceMappingURL=functiontostring.js.map
3750
+
3751
+ /***/ }),
3752
+
3753
+ /***/ 1061:
3754
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
3755
+
3756
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3757
+ /* harmony export */ "QD": function() { return /* binding */ InboundFilters; }
3758
+ /* harmony export */ });
3759
+ /* unused harmony exports _mergeOptions, _shouldDropEvent */
3760
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5733);
3761
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8536);
3762
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3699);
3763
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9660);
3764
+ /* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(428);
3765
+
3766
+
3767
+
3768
+ // "Script error." is hard coded into browsers for errors that it can't read.
3769
+ // this is the result of a script being pulled in from an external domain and CORS.
3770
+ var DEFAULT_IGNORE_ERRORS = [/^Script error\.?$/, /^Javascript error: Script error\.? on line 0$/];
3771
+ /** Inbound filters configurable by the user */
3772
+ var InboundFilters = /** @class */ (function () {
3773
+ function InboundFilters(_options) {
3774
+ if (_options === void 0) { _options = {}; }
3775
+ this._options = _options;
3776
+ /**
3777
+ * @inheritDoc
3778
+ */
3779
+ this.name = InboundFilters.id;
3780
+ }
3781
+ /**
3782
+ * @inheritDoc
3783
+ */
3784
+ InboundFilters.prototype.setupOnce = function (addGlobalEventProcessor, getCurrentHub) {
3785
+ addGlobalEventProcessor(function (event) {
3786
+ var hub = getCurrentHub();
3787
+ if (hub) {
3788
+ var self_1 = hub.getIntegration(InboundFilters);
3789
+ if (self_1) {
3790
+ var client = hub.getClient();
3791
+ var clientOptions = client ? client.getOptions() : {};
3792
+ var options = _mergeOptions(self_1._options, clientOptions);
3793
+ return _shouldDropEvent(event, options) ? null : event;
3794
+ }
3795
+ }
3796
+ return event;
3797
+ });
3798
+ };
3799
+ /**
3800
+ * @inheritDoc
3801
+ */
3802
+ InboundFilters.id = 'InboundFilters';
3803
+ return InboundFilters;
3804
+ }());
3805
+
3806
+ /** JSDoc */
3807
+ function _mergeOptions(internalOptions, clientOptions) {
3808
+ if (internalOptions === void 0) { internalOptions = {}; }
3809
+ if (clientOptions === void 0) { clientOptions = {}; }
3810
+ return {
3811
+ allowUrls: (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__spread */ .fl)((internalOptions.whitelistUrls || []), (internalOptions.allowUrls || []), (clientOptions.whitelistUrls || []), (clientOptions.allowUrls || [])),
3812
+ denyUrls: (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__spread */ .fl)((internalOptions.blacklistUrls || []), (internalOptions.denyUrls || []), (clientOptions.blacklistUrls || []), (clientOptions.denyUrls || [])),
3813
+ ignoreErrors: (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__spread */ .fl)((internalOptions.ignoreErrors || []), (clientOptions.ignoreErrors || []), DEFAULT_IGNORE_ERRORS),
3814
+ ignoreInternal: internalOptions.ignoreInternal !== undefined ? internalOptions.ignoreInternal : true,
3815
+ };
3816
+ }
3817
+ /** JSDoc */
3818
+ function _shouldDropEvent(event, options) {
3819
+ if (options.ignoreInternal && _isSentryError(event)) {
3820
+ _flags__WEBPACK_IMPORTED_MODULE_1__/* .IS_DEBUG_BUILD */ .h &&
3821
+ _sentry_utils__WEBPACK_IMPORTED_MODULE_2__/* .logger.warn */ .kg.warn("Event dropped due to being internal Sentry Error.\nEvent: " + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__/* .getEventDescription */ .jH)(event));
3822
+ return true;
3823
+ }
3824
+ if (_isIgnoredError(event, options.ignoreErrors)) {
3825
+ _flags__WEBPACK_IMPORTED_MODULE_1__/* .IS_DEBUG_BUILD */ .h &&
3826
+ _sentry_utils__WEBPACK_IMPORTED_MODULE_2__/* .logger.warn */ .kg.warn("Event dropped due to being matched by `ignoreErrors` option.\nEvent: " + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__/* .getEventDescription */ .jH)(event));
3827
+ return true;
3828
+ }
3829
+ if (_isDeniedUrl(event, options.denyUrls)) {
3830
+ _flags__WEBPACK_IMPORTED_MODULE_1__/* .IS_DEBUG_BUILD */ .h &&
3831
+ _sentry_utils__WEBPACK_IMPORTED_MODULE_2__/* .logger.warn */ .kg.warn("Event dropped due to being matched by `denyUrls` option.\nEvent: " + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__/* .getEventDescription */ .jH)(event) + ".\nUrl: " + _getEventFilterUrl(event));
3832
+ return true;
3833
+ }
3834
+ if (!_isAllowedUrl(event, options.allowUrls)) {
3835
+ _flags__WEBPACK_IMPORTED_MODULE_1__/* .IS_DEBUG_BUILD */ .h &&
3836
+ _sentry_utils__WEBPACK_IMPORTED_MODULE_2__/* .logger.warn */ .kg.warn("Event dropped due to not being matched by `allowUrls` option.\nEvent: " + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__/* .getEventDescription */ .jH)(event) + ".\nUrl: " + _getEventFilterUrl(event));
3837
+ return true;
3838
+ }
3839
+ return false;
3840
+ }
3841
+ function _isIgnoredError(event, ignoreErrors) {
3842
+ if (!ignoreErrors || !ignoreErrors.length) {
3843
+ return false;
3844
+ }
3845
+ return _getPossibleEventMessages(event).some(function (message) {
3846
+ return ignoreErrors.some(function (pattern) { return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__/* .isMatchingPattern */ .zC)(message, pattern); });
3847
+ });
3848
+ }
3849
+ function _isDeniedUrl(event, denyUrls) {
3850
+ // TODO: Use Glob instead?
3851
+ if (!denyUrls || !denyUrls.length) {
3852
+ return false;
3853
+ }
3854
+ var url = _getEventFilterUrl(event);
3855
+ return !url ? false : denyUrls.some(function (pattern) { return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__/* .isMatchingPattern */ .zC)(url, pattern); });
3856
+ }
3857
+ function _isAllowedUrl(event, allowUrls) {
3858
+ // TODO: Use Glob instead?
3859
+ if (!allowUrls || !allowUrls.length) {
3860
+ return true;
3861
+ }
3862
+ var url = _getEventFilterUrl(event);
3863
+ return !url ? true : allowUrls.some(function (pattern) { return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__/* .isMatchingPattern */ .zC)(url, pattern); });
3864
+ }
3865
+ function _getPossibleEventMessages(event) {
3866
+ if (event.message) {
3867
+ return [event.message];
3868
+ }
3869
+ if (event.exception) {
3870
+ try {
3871
+ var _a = (event.exception.values && event.exception.values[0]) || {}, _b = _a.type, type = _b === void 0 ? '' : _b, _c = _a.value, value = _c === void 0 ? '' : _c;
3872
+ return ["" + value, type + ": " + value];
3873
+ }
3874
+ catch (oO) {
3875
+ _flags__WEBPACK_IMPORTED_MODULE_1__/* .IS_DEBUG_BUILD */ .h && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__/* .logger.error */ .kg.error("Cannot extract message for event " + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__/* .getEventDescription */ .jH)(event));
3876
+ return [];
3877
+ }
3878
+ }
3879
+ return [];
3880
+ }
3881
+ function _isSentryError(event) {
3882
+ try {
3883
+ // @ts-ignore can't be a sentry error if undefined
3884
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
3885
+ return event.exception.values[0].type === 'SentryError';
3886
+ }
3887
+ catch (e) {
3888
+ // ignore
3889
+ }
3890
+ return false;
3891
+ }
3892
+ function _getLastValidUrl(frames) {
3893
+ if (frames === void 0) { frames = []; }
3894
+ for (var i = frames.length - 1; i >= 0; i--) {
3895
+ var frame = frames[i];
3896
+ if (frame && frame.filename !== '<anonymous>' && frame.filename !== '[native code]') {
3897
+ return frame.filename || null;
3898
+ }
3899
+ }
3900
+ return null;
3901
+ }
3902
+ function _getEventFilterUrl(event) {
3903
+ try {
3904
+ if (event.stacktrace) {
3905
+ return _getLastValidUrl(event.stacktrace.frames);
3906
+ }
3907
+ var frames_1;
3908
+ try {
3909
+ // @ts-ignore we only care about frames if the whole thing here is defined
3910
+ frames_1 = event.exception.values[0].stacktrace.frames;
3911
+ }
3912
+ catch (e) {
3913
+ // ignore
3914
+ }
3915
+ return frames_1 ? _getLastValidUrl(frames_1) : null;
3916
+ }
3917
+ catch (oO) {
3918
+ _flags__WEBPACK_IMPORTED_MODULE_1__/* .IS_DEBUG_BUILD */ .h && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__/* .logger.error */ .kg.error("Cannot extract url for event " + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__/* .getEventDescription */ .jH)(event));
3919
+ return null;
3920
+ }
3921
+ }
3922
+ //# sourceMappingURL=inboundfilters.js.map
3923
+
3924
+ /***/ }),
3925
+
3926
+ /***/ 6508:
3927
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
3928
+
3929
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3930
+ /* harmony export */ "Q3": function() { return /* binding */ createSessionEnvelope; },
3931
+ /* harmony export */ "Qz": function() { return /* binding */ sessionToSentryRequest; },
3932
+ /* harmony export */ "Mq": function() { return /* binding */ createEventEnvelope; },
3933
+ /* harmony export */ "nA": function() { return /* binding */ eventToSentryRequest; }
3934
+ /* harmony export */ });
3935
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5733);
3936
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3135);
3937
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6894);
3938
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8035);
3939
+ /* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4911);
3940
+
3941
+
3942
+
3943
+ /** Extract sdk info from from the API metadata */
3944
+ function getSdkMetadataForEnvelopeHeader(api) {
3945
+ if (!api.metadata || !api.metadata.sdk) {
3946
+ return;
3947
+ }
3948
+ var _a = api.metadata.sdk, name = _a.name, version = _a.version;
3949
+ return { name: name, version: version };
3950
+ }
3951
+ /**
3952
+ * Apply SdkInfo (name, version, packages, integrations) to the corresponding event key.
3953
+ * Merge with existing data if any.
3954
+ **/
3955
+ function enhanceEventWithSdkInfo(event, sdkInfo) {
3956
+ if (!sdkInfo) {
3957
+ return event;
3958
+ }
3959
+ event.sdk = event.sdk || {};
3960
+ event.sdk.name = event.sdk.name || sdkInfo.name;
3961
+ event.sdk.version = event.sdk.version || sdkInfo.version;
3962
+ event.sdk.integrations = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__spread */ .fl)((event.sdk.integrations || []), (sdkInfo.integrations || []));
3963
+ event.sdk.packages = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__spread */ .fl)((event.sdk.packages || []), (sdkInfo.packages || []));
3964
+ return event;
3965
+ }
3966
+ /** Creates an envelope from a Session */
3967
+ function createSessionEnvelope(session, api) {
3968
+ var sdkInfo = getSdkMetadataForEnvelopeHeader(api);
3969
+ var envelopeHeaders = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)({ sent_at: new Date().toISOString() }, (sdkInfo && { sdk: sdkInfo })), (!!api.tunnel && { dsn: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__/* .dsnToString */ .R)(api.dsn) }));
3970
+ // I know this is hacky but we don't want to add `sessions` to request type since it's never rate limited
3971
+ var type = 'aggregates' in session ? 'sessions' : 'session';
3972
+ // TODO (v7) Have to cast type because envelope items do not accept a `SentryRequestType`
3973
+ var envelopeItem = [{ type: type }, session];
3974
+ var envelope = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__/* .createEnvelope */ .Jd)(envelopeHeaders, [envelopeItem]);
3975
+ return [envelope, type];
3976
+ }
3977
+ /** Creates a SentryRequest from a Session. */
3978
+ function sessionToSentryRequest(session, api) {
3979
+ var _a = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__read */ .CR)(createSessionEnvelope(session, api), 2), envelope = _a[0], type = _a[1];
3980
+ return {
3981
+ body: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__/* .serializeEnvelope */ .V$)(envelope),
3982
+ type: type,
3983
+ url: (0,_api__WEBPACK_IMPORTED_MODULE_3__/* .getEnvelopeEndpointWithUrlEncodedAuth */ .Ut)(api.dsn, api.tunnel),
3984
+ };
3985
+ }
3986
+ /**
3987
+ * Create an Envelope from an event. Note that this is duplicated from below,
3988
+ * but on purpose as this will be refactored in v7.
3989
+ */
3990
+ function createEventEnvelope(event, api) {
3991
+ var sdkInfo = getSdkMetadataForEnvelopeHeader(api);
3992
+ var eventType = event.type || 'event';
3993
+ var transactionSampling = (event.sdkProcessingMetadata || {}).transactionSampling;
3994
+ var _a = transactionSampling || {}, samplingMethod = _a.method, sampleRate = _a.rate;
3995
+ // TODO: Below is a temporary hack in order to debug a serialization error - see
3996
+ // https://github.com/getsentry/sentry-javascript/issues/2809,
3997
+ // https://github.com/getsentry/sentry-javascript/pull/4425, and
3998
+ // https://github.com/getsentry/sentry-javascript/pull/4574.
3999
+ //
4000
+ // TL; DR: even though we normalize all events (which should prevent this), something is causing `JSON.stringify` to
4001
+ // throw a circular reference error.
4002
+ //
4003
+ // When it's time to remove it:
4004
+ // 1. Delete everything between here and where the request object `req` is created, EXCEPT the line deleting
4005
+ // `sdkProcessingMetadata`
4006
+ // 2. Restore the original version of the request body, which is commented out
4007
+ // 3. Search for either of the PR URLs above and pull out the companion hacks in the browser playwright tests and the
4008
+ // baseClient tests in this package
4009
+ enhanceEventWithSdkInfo(event, api.metadata.sdk);
4010
+ event.tags = event.tags || {};
4011
+ event.extra = event.extra || {};
4012
+ // In theory, all events should be marked as having gone through normalization and so
4013
+ // we should never set this tag/extra data
4014
+ if (!(event.sdkProcessingMetadata && event.sdkProcessingMetadata.baseClientNormalized)) {
4015
+ event.tags.skippedNormalization = true;
4016
+ event.extra.normalizeDepth = event.sdkProcessingMetadata ? event.sdkProcessingMetadata.normalizeDepth : 'unset';
4017
+ }
4018
+ // prevent this data from being sent to sentry
4019
+ // TODO: This is NOT part of the hack - DO NOT DELETE
4020
+ delete event.sdkProcessingMetadata;
4021
+ var envelopeHeaders = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)({ event_id: event.event_id, sent_at: new Date().toISOString() }, (sdkInfo && { sdk: sdkInfo })), (!!api.tunnel && { dsn: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__/* .dsnToString */ .R)(api.dsn) }));
4022
+ var eventItem = [
4023
+ {
4024
+ type: eventType,
4025
+ sample_rates: [{ id: samplingMethod, rate: sampleRate }],
4026
+ },
4027
+ event,
4028
+ ];
4029
+ return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__/* .createEnvelope */ .Jd)(envelopeHeaders, [eventItem]);
4030
+ }
4031
+ /** Creates a SentryRequest from an event. */
4032
+ function eventToSentryRequest(event, api) {
4033
+ var sdkInfo = getSdkMetadataForEnvelopeHeader(api);
4034
+ var eventType = event.type || 'event';
4035
+ var useEnvelope = eventType === 'transaction' || !!api.tunnel;
4036
+ var transactionSampling = (event.sdkProcessingMetadata || {}).transactionSampling;
4037
+ var _a = transactionSampling || {}, samplingMethod = _a.method, sampleRate = _a.rate;
4038
+ // TODO: Below is a temporary hack in order to debug a serialization error - see
4039
+ // https://github.com/getsentry/sentry-javascript/issues/2809,
4040
+ // https://github.com/getsentry/sentry-javascript/pull/4425, and
4041
+ // https://github.com/getsentry/sentry-javascript/pull/4574.
4042
+ //
4043
+ // TL; DR: even though we normalize all events (which should prevent this), something is causing `JSON.stringify` to
4044
+ // throw a circular reference error.
4045
+ //
4046
+ // When it's time to remove it:
4047
+ // 1. Delete everything between here and where the request object `req` is created, EXCEPT the line deleting
4048
+ // `sdkProcessingMetadata`
4049
+ // 2. Restore the original version of the request body, which is commented out
4050
+ // 3. Search for either of the PR URLs above and pull out the companion hacks in the browser playwright tests and the
4051
+ // baseClient tests in this package
4052
+ enhanceEventWithSdkInfo(event, api.metadata.sdk);
4053
+ event.tags = event.tags || {};
4054
+ event.extra = event.extra || {};
4055
+ // In theory, all events should be marked as having gone through normalization and so
4056
+ // we should never set this tag/extra data
4057
+ if (!(event.sdkProcessingMetadata && event.sdkProcessingMetadata.baseClientNormalized)) {
4058
+ event.tags.skippedNormalization = true;
4059
+ event.extra.normalizeDepth = event.sdkProcessingMetadata ? event.sdkProcessingMetadata.normalizeDepth : 'unset';
4060
+ }
4061
+ // prevent this data from being sent to sentry
4062
+ // TODO: This is NOT part of the hack - DO NOT DELETE
4063
+ delete event.sdkProcessingMetadata;
4064
+ var body;
4065
+ try {
4066
+ // 99.9% of events should get through just fine - no change in behavior for them
4067
+ body = JSON.stringify(event);
4068
+ }
4069
+ catch (err) {
4070
+ // Record data about the error without replacing original event data, then force renormalization
4071
+ event.tags.JSONStringifyError = true;
4072
+ event.extra.JSONStringifyError = err;
4073
+ try {
4074
+ body = JSON.stringify((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__/* .normalize */ .Fv)(event));
4075
+ }
4076
+ catch (newErr) {
4077
+ // At this point even renormalization hasn't worked, meaning something about the event data has gone very wrong.
4078
+ // Time to cut our losses and record only the new error. With luck, even in the problematic cases we're trying to
4079
+ // debug with this hack, we won't ever land here.
4080
+ var innerErr = newErr;
4081
+ body = JSON.stringify({
4082
+ message: 'JSON.stringify error after renormalization',
4083
+ // setting `extra: { innerErr }` here for some reason results in an empty object, so unpack manually
4084
+ extra: { message: innerErr.message, stack: innerErr.stack },
4085
+ });
4086
+ }
4087
+ }
4088
+ var req = {
4089
+ // this is the relevant line of code before the hack was added, to make it easy to undo said hack once we've solved
4090
+ // the mystery
4091
+ // body: JSON.stringify(sdkInfo ? enhanceEventWithSdkInfo(event, api.metadata.sdk) : event),
4092
+ body: body,
4093
+ type: eventType,
4094
+ url: useEnvelope
4095
+ ? (0,_api__WEBPACK_IMPORTED_MODULE_3__/* .getEnvelopeEndpointWithUrlEncodedAuth */ .Ut)(api.dsn, api.tunnel)
4096
+ : (0,_api__WEBPACK_IMPORTED_MODULE_3__/* .getStoreEndpointWithUrlEncodedAuth */ .qi)(api.dsn),
4097
+ };
4098
+ // https://develop.sentry.dev/sdk/envelopes/
4099
+ // Since we don't need to manipulate envelopes nor store them, there is no
4100
+ // exported concept of an Envelope with operations including serialization and
4101
+ // deserialization. Instead, we only implement a minimal subset of the spec to
4102
+ // serialize events inline here.
4103
+ if (useEnvelope) {
4104
+ var envelopeHeaders = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)({ event_id: event.event_id, sent_at: new Date().toISOString() }, (sdkInfo && { sdk: sdkInfo })), (!!api.tunnel && { dsn: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__/* .dsnToString */ .R)(api.dsn) }));
4105
+ var eventItem = [
4106
+ {
4107
+ type: eventType,
4108
+ sample_rates: [{ id: samplingMethod, rate: sampleRate }],
4109
+ },
4110
+ req.body,
4111
+ ];
4112
+ var envelope = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__/* .createEnvelope */ .Jd)(envelopeHeaders, [eventItem]);
4113
+ req.body = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__/* .serializeEnvelope */ .V$)(envelope);
4114
+ }
4115
+ return req;
4116
+ }
4117
+ //# sourceMappingURL=request.js.map
4118
+
4119
+ /***/ }),
4120
+
4121
+ /***/ 6853:
4122
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
4123
+
4124
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4125
+ /* harmony export */ "M": function() { return /* binding */ initAndBind; }
4126
+ /* harmony export */ });
4127
+ /* harmony import */ var _sentry_hub__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8585);
4128
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8536);
4129
+ /* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(428);
4130
+
4131
+
4132
+
4133
+ /**
4134
+ * Internal function to create a new SDK client instance. The client is
4135
+ * installed and then bound to the current scope.
4136
+ *
4137
+ * @param clientClass The client class to instantiate.
4138
+ * @param options Options to pass to the client.
4139
+ */
4140
+ function initAndBind(clientClass, options) {
4141
+ if (options.debug === true) {
4142
+ if (_flags__WEBPACK_IMPORTED_MODULE_0__/* .IS_DEBUG_BUILD */ .h) {
4143
+ _sentry_utils__WEBPACK_IMPORTED_MODULE_1__/* .logger.enable */ .kg.enable();
4144
+ }
4145
+ else {
4146
+ // use `console.warn` rather than `logger.warn` since by non-debug bundles have all `logger.x` statements stripped
4147
+ // eslint-disable-next-line no-console
4148
+ console.warn('[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.');
4149
+ }
4150
+ }
4151
+ var hub = (0,_sentry_hub__WEBPACK_IMPORTED_MODULE_2__/* .getCurrentHub */ .Gd)();
4152
+ var scope = hub.getScope();
4153
+ if (scope) {
4154
+ scope.update(options.initialScope);
4155
+ }
4156
+ var client = new clientClass(options);
4157
+ hub.bindClient(client);
4158
+ }
4159
+ //# sourceMappingURL=sdk.js.map
4160
+
4161
+ /***/ }),
4162
+
4163
+ /***/ 1518:
4164
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
4165
+
4166
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4167
+ /* harmony export */ "qv": function() { return /* binding */ createTransport; }
4168
+ /* harmony export */ });
4169
+ /* unused harmony exports ERROR_TRANSPORT_CATEGORY, TRANSACTION_TRANSPORT_CATEGORY, ATTACHMENT_TRANSPORT_CATEGORY, SESSION_TRANSPORT_CATEGORY, DEFAULT_TRANSPORT_BUFFER_SIZE */
4170
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8963);
4171
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6894);
4172
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1630);
4173
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7946);
4174
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8886);
4175
+
4176
+ var ERROR_TRANSPORT_CATEGORY = 'error';
4177
+ var TRANSACTION_TRANSPORT_CATEGORY = 'transaction';
4178
+ var ATTACHMENT_TRANSPORT_CATEGORY = 'attachment';
4179
+ var SESSION_TRANSPORT_CATEGORY = 'session';
4180
+ var DEFAULT_TRANSPORT_BUFFER_SIZE = 30;
4181
+ /**
4182
+ * Creates a `NewTransport`
4183
+ *
4184
+ * @param options
4185
+ * @param makeRequest
4186
+ */
4187
+ function createTransport(options, makeRequest, buffer) {
4188
+ if (buffer === void 0) { buffer = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__/* .makePromiseBuffer */ .x)(options.bufferSize || DEFAULT_TRANSPORT_BUFFER_SIZE); }
4189
+ var rateLimits = {};
4190
+ var flush = function (timeout) { return buffer.drain(timeout); };
4191
+ function send(envelope) {
4192
+ var envCategory = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__/* .getEnvelopeType */ .y7)(envelope);
4193
+ var category = envCategory === 'event' ? 'error' : envCategory;
4194
+ var request = {
4195
+ category: category,
4196
+ body: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__/* .serializeEnvelope */ .V$)(envelope),
4197
+ };
4198
+ // Don't add to buffer if transport is already rate-limited
4199
+ if ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__/* .isRateLimited */ .Q)(rateLimits, category)) {
4200
+ return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__/* .rejectedSyncPromise */ .$2)({
4201
+ status: 'rate_limit',
4202
+ reason: getRateLimitReason(rateLimits, category),
4203
+ });
4204
+ }
4205
+ var requestTask = function () {
4206
+ return makeRequest(request).then(function (_a) {
4207
+ var body = _a.body, headers = _a.headers, reason = _a.reason, statusCode = _a.statusCode;
4208
+ var status = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__/* .eventStatusFromHttpCode */ .F)(statusCode);
4209
+ if (headers) {
4210
+ rateLimits = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__/* .updateRateLimits */ .WG)(rateLimits, headers);
4211
+ }
4212
+ if (status === 'success') {
4213
+ return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__/* .resolvedSyncPromise */ .WD)({ status: status, reason: reason });
4214
+ }
4215
+ return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__/* .rejectedSyncPromise */ .$2)({
4216
+ status: status,
4217
+ reason: reason ||
4218
+ body ||
4219
+ (status === 'rate_limit' ? getRateLimitReason(rateLimits, category) : 'Unknown transport error'),
4220
+ });
4221
+ });
4222
+ };
4223
+ return buffer.add(requestTask);
4224
+ }
4225
+ return {
4226
+ send: send,
4227
+ flush: flush,
4228
+ };
4229
+ }
4230
+ function getRateLimitReason(rateLimits, category) {
4231
+ return "Too many " + category + " requests, backing off until: " + new Date((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__/* .disabledUntil */ .ns)(rateLimits, category)).toISOString();
4232
+ }
4233
+ //# sourceMappingURL=base.js.map
4234
+
4235
+ /***/ }),
4236
+
4237
+ /***/ 3926:
4238
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
4239
+
4240
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4241
+ /* harmony export */ "V": function() { return /* binding */ NoopTransport; }
4242
+ /* harmony export */ });
4243
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7946);
4244
+
4245
+ /** Noop transport */
4246
+ var NoopTransport = /** @class */ (function () {
4247
+ function NoopTransport() {
4248
+ }
4249
+ /**
4250
+ * @inheritDoc
4251
+ */
4252
+ NoopTransport.prototype.sendEvent = function (_) {
4253
+ return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__/* .resolvedSyncPromise */ .WD)({
4254
+ reason: 'NoopTransport: Event has been skipped because no Dsn is configured.',
4255
+ status: 'skipped',
4256
+ });
4257
+ };
4258
+ /**
4259
+ * @inheritDoc
4260
+ */
4261
+ NoopTransport.prototype.close = function (_) {
4262
+ return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__/* .resolvedSyncPromise */ .WD)(true);
4263
+ };
4264
+ return NoopTransport;
4265
+ }());
4266
+
4267
+ //# sourceMappingURL=noop.js.map
4268
+
4269
+ /***/ }),
4270
+
4271
+ /***/ 1476:
4272
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
4273
+
4274
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4275
+ /* harmony export */ "J": function() { return /* binding */ SDK_VERSION; }
4276
+ /* harmony export */ });
4277
+ var SDK_VERSION = '6.19.6';
4278
+ //# sourceMappingURL=version.js.map
4279
+
4280
+ /***/ }),
4281
+
4282
+ /***/ 5733:
4283
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
4284
+
4285
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4286
+ /* harmony export */ "pi": function() { return /* binding */ __assign; },
4287
+ /* harmony export */ "XA": function() { return /* binding */ __values; },
4288
+ /* harmony export */ "CR": function() { return /* binding */ __read; },
4289
+ /* harmony export */ "fl": function() { return /* binding */ __spread; }
4290
+ /* harmony export */ });
4291
+ /* unused harmony exports __extends, __rest, __decorate, __param, __metadata, __awaiter, __generator, __createBinding, __exportStar, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet */
4292
+ /*! *****************************************************************************
4293
+ Copyright (c) Microsoft Corporation.
4294
+
4295
+ Permission to use, copy, modify, and/or distribute this software for any
4296
+ purpose with or without fee is hereby granted.
4297
+
4298
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
4299
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
4300
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
4301
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
4302
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
4303
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
4304
+ PERFORMANCE OF THIS SOFTWARE.
4305
+ ***************************************************************************** */
4306
+ /* global Reflect, Promise */
4307
+
4308
+ var extendStatics = function(d, b) {
4309
+ extendStatics = Object.setPrototypeOf ||
4310
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
4311
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
4312
+ return extendStatics(d, b);
4313
+ };
4314
+
4315
+ function __extends(d, b) {
4316
+ extendStatics(d, b);
4317
+ function __() { this.constructor = d; }
4318
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
4319
+ }
4320
+
4321
+ var __assign = function() {
4322
+ __assign = Object.assign || function __assign(t) {
4323
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4324
+ s = arguments[i];
4325
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
4326
+ }
4327
+ return t;
4328
+ }
4329
+ return __assign.apply(this, arguments);
4330
+ }
4331
+
4332
+ function __rest(s, e) {
4333
+ var t = {};
4334
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4335
+ t[p] = s[p];
4336
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
4337
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
4338
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
4339
+ t[p[i]] = s[p[i]];
4340
+ }
4341
+ return t;
4342
+ }
4343
+
4344
+ function __decorate(decorators, target, key, desc) {
4345
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4346
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4347
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
4348
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
4349
+ }
4350
+
4351
+ function __param(paramIndex, decorator) {
4352
+ return function (target, key) { decorator(target, key, paramIndex); }
4353
+ }
4354
+
4355
+ function __metadata(metadataKey, metadataValue) {
4356
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
4357
+ }
4358
+
4359
+ function __awaiter(thisArg, _arguments, P, generator) {
4360
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4361
+ return new (P || (P = Promise))(function (resolve, reject) {
4362
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
4363
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
4364
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
4365
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
4366
+ });
4367
+ }
4368
+
4369
+ function __generator(thisArg, body) {
4370
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
4371
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
4372
+ function verb(n) { return function (v) { return step([n, v]); }; }
4373
+ function step(op) {
4374
+ if (f) throw new TypeError("Generator is already executing.");
4375
+ while (_) try {
4376
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
4377
+ if (y = 0, t) op = [op[0] & 2, t.value];
4378
+ switch (op[0]) {
4379
+ case 0: case 1: t = op; break;
4380
+ case 4: _.label++; return { value: op[1], done: false };
4381
+ case 5: _.label++; y = op[1]; op = [0]; continue;
4382
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
4383
+ default:
4384
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
4385
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
4386
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
4387
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
4388
+ if (t[2]) _.ops.pop();
4389
+ _.trys.pop(); continue;
4390
+ }
4391
+ op = body.call(thisArg, _);
4392
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
4393
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
4394
+ }
4395
+ }
4396
+
4397
+ function __createBinding(o, m, k, k2) {
4398
+ if (k2 === undefined) k2 = k;
4399
+ o[k2] = m[k];
4400
+ }
4401
+
4402
+ function __exportStar(m, exports) {
4403
+ for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p];
4404
+ }
4405
+
4406
+ function __values(o) {
4407
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
4408
+ if (m) return m.call(o);
4409
+ if (o && typeof o.length === "number") return {
4410
+ next: function () {
4411
+ if (o && i >= o.length) o = void 0;
4412
+ return { value: o && o[i++], done: !o };
4413
+ }
4414
+ };
4415
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
4416
+ }
4417
+
4418
+ function __read(o, n) {
4419
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
4420
+ if (!m) return o;
4421
+ var i = m.call(o), r, ar = [], e;
4422
+ try {
4423
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
4424
+ }
4425
+ catch (error) { e = { error: error }; }
4426
+ finally {
4427
+ try {
4428
+ if (r && !r.done && (m = i["return"])) m.call(i);
4429
+ }
4430
+ finally { if (e) throw e.error; }
4431
+ }
4432
+ return ar;
4433
+ }
4434
+
4435
+ function __spread() {
4436
+ for (var ar = [], i = 0; i < arguments.length; i++)
4437
+ ar = ar.concat(__read(arguments[i]));
4438
+ return ar;
4439
+ }
4440
+
4441
+ function __spreadArrays() {
4442
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
4443
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
4444
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
4445
+ r[k] = a[j];
4446
+ return r;
4447
+ };
4448
+
4449
+ function __await(v) {
4450
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
4451
+ }
4452
+
4453
+ function __asyncGenerator(thisArg, _arguments, generator) {
4454
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
4455
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
4456
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
4457
+ function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
4458
+ function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
4459
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
4460
+ function fulfill(value) { resume("next", value); }
4461
+ function reject(value) { resume("throw", value); }
4462
+ function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
4463
+ }
4464
+
4465
+ function __asyncDelegator(o) {
4466
+ var i, p;
4467
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
4468
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
4469
+ }
4470
+
4471
+ function __asyncValues(o) {
4472
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
4473
+ var m = o[Symbol.asyncIterator], i;
4474
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
4475
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
4476
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
4477
+ }
4478
+
4479
+ function __makeTemplateObject(cooked, raw) {
4480
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4481
+ return cooked;
4482
+ };
4483
+
4484
+ function __importStar(mod) {
4485
+ if (mod && mod.__esModule) return mod;
4486
+ var result = {};
4487
+ if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
4488
+ result.default = mod;
4489
+ return result;
4490
+ }
4491
+
4492
+ function __importDefault(mod) {
4493
+ return (mod && mod.__esModule) ? mod : { default: mod };
4494
+ }
4495
+
4496
+ function __classPrivateFieldGet(receiver, privateMap) {
4497
+ if (!privateMap.has(receiver)) {
4498
+ throw new TypeError("attempted to get private field on non-instance");
4499
+ }
4500
+ return privateMap.get(receiver);
4501
+ }
4502
+
4503
+ function __classPrivateFieldSet(receiver, privateMap, value) {
4504
+ if (!privateMap.has(receiver)) {
4505
+ throw new TypeError("attempted to set private field on non-instance");
4506
+ }
4507
+ privateMap.set(receiver, value);
4508
+ return value;
4509
+ }
4510
+
4511
+
4512
+ /***/ }),
4513
+
4514
+ /***/ 1299:
4515
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
4516
+
4517
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4518
+ /* harmony export */ "h": function() { return /* binding */ IS_DEBUG_BUILD; }
4519
+ /* harmony export */ });
4520
+ /*
4521
+ * This file defines flags and constants that can be modified during compile time in order to facilitate tree shaking
4522
+ * for users.
4523
+ *
4524
+ * Debug flags need to be declared in each package individually and must not be imported across package boundaries,
4525
+ * because some build tools have trouble tree-shaking imported guards.
4526
+ *
4527
+ * As a convention, we define debug flags in a `flags.ts` file in the root of a package's `src` folder.
4528
+ *
4529
+ * Debug flag files will contain "magic strings" like `__SENTRY_DEBUG__` that may get replaced with actual values during
4530
+ * our, or the user's build process. Take care when introducing new flags - they must not throw if they are not
4531
+ * replaced.
4532
+ */
4533
+ /** Flag that is true for debug builds, false otherwise. */
4534
+ var IS_DEBUG_BUILD = typeof __SENTRY_DEBUG__ === 'undefined' ? true : __SENTRY_DEBUG__;
4535
+ //# sourceMappingURL=flags.js.map
4536
+
4537
+ /***/ }),
4538
+
4539
+ /***/ 8585:
4540
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
4541
+
4542
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4543
+ /* harmony export */ "Gd": function() { return /* binding */ getCurrentHub; }
4544
+ /* harmony export */ });
4545
+ /* unused harmony exports API_VERSION, Hub, getMainCarrier, makeMain, getActiveDomain, getHubFromCarrier, setHubOnCarrier */
4546
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8773);
4547
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3699);
4548
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7790);
4549
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8536);
4550
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5907);
4551
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(7392);
4552
+ /* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1299);
4553
+ /* harmony import */ var _scope__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1684);
4554
+ /* harmony import */ var _session__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2430);
4555
+
4556
+
4557
+
4558
+
4559
+
4560
+ /**
4561
+ * API compatibility version of this hub.
4562
+ *
4563
+ * WARNING: This number should only be increased when the global interface
4564
+ * changes and new methods are introduced.
4565
+ *
4566
+ * @hidden
4567
+ */
4568
+ var API_VERSION = 4;
4569
+ /**
4570
+ * Default maximum number of breadcrumbs added to an event. Can be overwritten
4571
+ * with {@link Options.maxBreadcrumbs}.
4572
+ */
4573
+ var DEFAULT_BREADCRUMBS = 100;
4574
+ /**
4575
+ * @inheritDoc
4576
+ */
4577
+ var Hub = /** @class */ (function () {
4578
+ /**
4579
+ * Creates a new instance of the hub, will push one {@link Layer} into the
4580
+ * internal stack on creation.
4581
+ *
4582
+ * @param client bound to the hub.
4583
+ * @param scope bound to the hub.
4584
+ * @param version number, higher number means higher priority.
4585
+ */
4586
+ function Hub(client, scope, _version) {
4587
+ if (scope === void 0) { scope = new _scope__WEBPACK_IMPORTED_MODULE_0__/* .Scope */ .s(); }
4588
+ if (_version === void 0) { _version = API_VERSION; }
4589
+ this._version = _version;
4590
+ /** Is a {@link Layer}[] containing the client and scope */
4591
+ this._stack = [{}];
4592
+ this.getStackTop().scope = scope;
4593
+ if (client) {
4594
+ this.bindClient(client);
4595
+ }
4596
+ }
4597
+ /**
4598
+ * @inheritDoc
4599
+ */
4600
+ Hub.prototype.isOlderThan = function (version) {
4601
+ return this._version < version;
4602
+ };
4603
+ /**
4604
+ * @inheritDoc
4605
+ */
4606
+ Hub.prototype.bindClient = function (client) {
4607
+ var top = this.getStackTop();
4608
+ top.client = client;
4609
+ if (client && client.setupIntegrations) {
4610
+ client.setupIntegrations();
4611
+ }
4612
+ };
4613
+ /**
4614
+ * @inheritDoc
4615
+ */
4616
+ Hub.prototype.pushScope = function () {
4617
+ // We want to clone the content of prev scope
4618
+ var scope = _scope__WEBPACK_IMPORTED_MODULE_0__/* .Scope.clone */ .s.clone(this.getScope());
4619
+ this.getStack().push({
4620
+ client: this.getClient(),
4621
+ scope: scope,
4622
+ });
4623
+ return scope;
4624
+ };
4625
+ /**
4626
+ * @inheritDoc
4627
+ */
4628
+ Hub.prototype.popScope = function () {
4629
+ if (this.getStack().length <= 1)
4630
+ return false;
4631
+ return !!this.getStack().pop();
4632
+ };
4633
+ /**
4634
+ * @inheritDoc
4635
+ */
4636
+ Hub.prototype.withScope = function (callback) {
4637
+ var scope = this.pushScope();
4638
+ try {
4639
+ callback(scope);
4640
+ }
4641
+ finally {
4642
+ this.popScope();
4643
+ }
4644
+ };
4645
+ /**
4646
+ * @inheritDoc
4647
+ */
4648
+ Hub.prototype.getClient = function () {
4649
+ return this.getStackTop().client;
4650
+ };
4651
+ /** Returns the scope of the top stack. */
4652
+ Hub.prototype.getScope = function () {
4653
+ return this.getStackTop().scope;
4654
+ };
4655
+ /** Returns the scope stack for domains or the process. */
4656
+ Hub.prototype.getStack = function () {
4657
+ return this._stack;
4658
+ };
4659
+ /** Returns the topmost scope layer in the order domain > local > process. */
4660
+ Hub.prototype.getStackTop = function () {
4661
+ return this._stack[this._stack.length - 1];
4662
+ };
4663
+ /**
4664
+ * @inheritDoc
4665
+ */
4666
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
4667
+ Hub.prototype.captureException = function (exception, hint) {
4668
+ var eventId = (this._lastEventId = hint && hint.event_id ? hint.event_id : (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__/* .uuid4 */ .DM)());
4669
+ var finalHint = hint;
4670
+ // If there's no explicit hint provided, mimic the same thing that would happen
4671
+ // in the minimal itself to create a consistent behavior.
4672
+ // We don't do this in the client, as it's the lowest level API, and doing this,
4673
+ // would prevent user from having full control over direct calls.
4674
+ if (!hint) {
4675
+ var syntheticException = void 0;
4676
+ try {
4677
+ throw new Error('Sentry syntheticException');
4678
+ }
4679
+ catch (exception) {
4680
+ syntheticException = exception;
4681
+ }
4682
+ finalHint = {
4683
+ originalException: exception,
4684
+ syntheticException: syntheticException,
4685
+ };
4686
+ }
4687
+ this._invokeClient('captureException', exception, (0,tslib__WEBPACK_IMPORTED_MODULE_2__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_2__/* .__assign */ .pi)({}, finalHint), { event_id: eventId }));
4688
+ return eventId;
4689
+ };
4690
+ /**
4691
+ * @inheritDoc
4692
+ */
4693
+ Hub.prototype.captureMessage = function (message, level, hint) {
4694
+ var eventId = (this._lastEventId = hint && hint.event_id ? hint.event_id : (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__/* .uuid4 */ .DM)());
4695
+ var finalHint = hint;
4696
+ // If there's no explicit hint provided, mimic the same thing that would happen
4697
+ // in the minimal itself to create a consistent behavior.
4698
+ // We don't do this in the client, as it's the lowest level API, and doing this,
4699
+ // would prevent user from having full control over direct calls.
4700
+ if (!hint) {
4701
+ var syntheticException = void 0;
4702
+ try {
4703
+ throw new Error(message);
4704
+ }
4705
+ catch (exception) {
4706
+ syntheticException = exception;
4707
+ }
4708
+ finalHint = {
4709
+ originalException: message,
4710
+ syntheticException: syntheticException,
4711
+ };
4712
+ }
4713
+ this._invokeClient('captureMessage', message, level, (0,tslib__WEBPACK_IMPORTED_MODULE_2__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_2__/* .__assign */ .pi)({}, finalHint), { event_id: eventId }));
4714
+ return eventId;
4715
+ };
4716
+ /**
4717
+ * @inheritDoc
4718
+ */
4719
+ Hub.prototype.captureEvent = function (event, hint) {
4720
+ var eventId = hint && hint.event_id ? hint.event_id : (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__/* .uuid4 */ .DM)();
4721
+ if (event.type !== 'transaction') {
4722
+ this._lastEventId = eventId;
4723
+ }
4724
+ this._invokeClient('captureEvent', event, (0,tslib__WEBPACK_IMPORTED_MODULE_2__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_2__/* .__assign */ .pi)({}, hint), { event_id: eventId }));
4725
+ return eventId;
4726
+ };
4727
+ /**
4728
+ * @inheritDoc
4729
+ */
4730
+ Hub.prototype.lastEventId = function () {
4731
+ return this._lastEventId;
4732
+ };
4733
+ /**
4734
+ * @inheritDoc
4735
+ */
4736
+ Hub.prototype.addBreadcrumb = function (breadcrumb, hint) {
4737
+ var _a = this.getStackTop(), scope = _a.scope, client = _a.client;
4738
+ if (!scope || !client)
4739
+ return;
4740
+ // eslint-disable-next-line @typescript-eslint/unbound-method
4741
+ var _b = (client.getOptions && client.getOptions()) || {}, _c = _b.beforeBreadcrumb, beforeBreadcrumb = _c === void 0 ? null : _c, _d = _b.maxBreadcrumbs, maxBreadcrumbs = _d === void 0 ? DEFAULT_BREADCRUMBS : _d;
4742
+ if (maxBreadcrumbs <= 0)
4743
+ return;
4744
+ var timestamp = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__/* .dateTimestampInSeconds */ .yW)();
4745
+ var mergedBreadcrumb = (0,tslib__WEBPACK_IMPORTED_MODULE_2__/* .__assign */ .pi)({ timestamp: timestamp }, breadcrumb);
4746
+ var finalBreadcrumb = beforeBreadcrumb
4747
+ ? (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__/* .consoleSandbox */ .Cf)(function () { return beforeBreadcrumb(mergedBreadcrumb, hint); })
4748
+ : mergedBreadcrumb;
4749
+ if (finalBreadcrumb === null)
4750
+ return;
4751
+ scope.addBreadcrumb(finalBreadcrumb, maxBreadcrumbs);
4752
+ };
4753
+ /**
4754
+ * @inheritDoc
4755
+ */
4756
+ Hub.prototype.setUser = function (user) {
4757
+ var scope = this.getScope();
4758
+ if (scope)
4759
+ scope.setUser(user);
4760
+ };
4761
+ /**
4762
+ * @inheritDoc
4763
+ */
4764
+ Hub.prototype.setTags = function (tags) {
4765
+ var scope = this.getScope();
4766
+ if (scope)
4767
+ scope.setTags(tags);
4768
+ };
4769
+ /**
4770
+ * @inheritDoc
4771
+ */
4772
+ Hub.prototype.setExtras = function (extras) {
4773
+ var scope = this.getScope();
4774
+ if (scope)
4775
+ scope.setExtras(extras);
4776
+ };
4777
+ /**
4778
+ * @inheritDoc
4779
+ */
4780
+ Hub.prototype.setTag = function (key, value) {
4781
+ var scope = this.getScope();
4782
+ if (scope)
4783
+ scope.setTag(key, value);
4784
+ };
4785
+ /**
4786
+ * @inheritDoc
4787
+ */
4788
+ Hub.prototype.setExtra = function (key, extra) {
4789
+ var scope = this.getScope();
4790
+ if (scope)
4791
+ scope.setExtra(key, extra);
4792
+ };
4793
+ /**
4794
+ * @inheritDoc
4795
+ */
4796
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4797
+ Hub.prototype.setContext = function (name, context) {
4798
+ var scope = this.getScope();
4799
+ if (scope)
4800
+ scope.setContext(name, context);
4801
+ };
4802
+ /**
4803
+ * @inheritDoc
4804
+ */
4805
+ Hub.prototype.configureScope = function (callback) {
4806
+ var _a = this.getStackTop(), scope = _a.scope, client = _a.client;
4807
+ if (scope && client) {
4808
+ callback(scope);
4809
+ }
4810
+ };
4811
+ /**
4812
+ * @inheritDoc
4813
+ */
4814
+ Hub.prototype.run = function (callback) {
4815
+ var oldHub = makeMain(this);
4816
+ try {
4817
+ callback(this);
4818
+ }
4819
+ finally {
4820
+ makeMain(oldHub);
4821
+ }
4822
+ };
4823
+ /**
4824
+ * @inheritDoc
4825
+ */
4826
+ Hub.prototype.getIntegration = function (integration) {
4827
+ var client = this.getClient();
4828
+ if (!client)
4829
+ return null;
4830
+ try {
4831
+ return client.getIntegration(integration);
4832
+ }
4833
+ catch (_oO) {
4834
+ _flags__WEBPACK_IMPORTED_MODULE_5__/* .IS_DEBUG_BUILD */ .h && _sentry_utils__WEBPACK_IMPORTED_MODULE_4__/* .logger.warn */ .kg.warn("Cannot retrieve integration " + integration.id + " from the current Hub");
4835
+ return null;
4836
+ }
4837
+ };
4838
+ /**
4839
+ * @inheritDoc
4840
+ */
4841
+ Hub.prototype.startSpan = function (context) {
4842
+ return this._callExtensionMethod('startSpan', context);
4843
+ };
4844
+ /**
4845
+ * @inheritDoc
4846
+ */
4847
+ Hub.prototype.startTransaction = function (context, customSamplingContext) {
4848
+ return this._callExtensionMethod('startTransaction', context, customSamplingContext);
4849
+ };
4850
+ /**
4851
+ * @inheritDoc
4852
+ */
4853
+ Hub.prototype.traceHeaders = function () {
4854
+ return this._callExtensionMethod('traceHeaders');
4855
+ };
4856
+ /**
4857
+ * @inheritDoc
4858
+ */
4859
+ Hub.prototype.captureSession = function (endSession) {
4860
+ if (endSession === void 0) { endSession = false; }
4861
+ // both send the update and pull the session from the scope
4862
+ if (endSession) {
4863
+ return this.endSession();
4864
+ }
4865
+ // only send the update
4866
+ this._sendSessionUpdate();
4867
+ };
4868
+ /**
4869
+ * @inheritDoc
4870
+ */
4871
+ Hub.prototype.endSession = function () {
4872
+ var layer = this.getStackTop();
4873
+ var scope = layer && layer.scope;
4874
+ var session = scope && scope.getSession();
4875
+ if (session) {
4876
+ session.close();
4877
+ }
4878
+ this._sendSessionUpdate();
4879
+ // the session is over; take it off of the scope
4880
+ if (scope) {
4881
+ scope.setSession();
4882
+ }
4883
+ };
4884
+ /**
4885
+ * @inheritDoc
4886
+ */
4887
+ Hub.prototype.startSession = function (context) {
4888
+ var _a = this.getStackTop(), scope = _a.scope, client = _a.client;
4889
+ var _b = (client && client.getOptions()) || {}, release = _b.release, environment = _b.environment;
4890
+ // Will fetch userAgent if called from browser sdk
4891
+ var global = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_6__/* .getGlobalObject */ .R)();
4892
+ var userAgent = (global.navigator || {}).userAgent;
4893
+ var session = new _session__WEBPACK_IMPORTED_MODULE_7__/* .Session */ .z((0,tslib__WEBPACK_IMPORTED_MODULE_2__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_2__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_2__/* .__assign */ .pi)({ release: release,
4894
+ environment: environment }, (scope && { user: scope.getUser() })), (userAgent && { userAgent: userAgent })), context));
4895
+ if (scope) {
4896
+ // End existing session if there's one
4897
+ var currentSession = scope.getSession && scope.getSession();
4898
+ if (currentSession && currentSession.status === 'ok') {
4899
+ currentSession.update({ status: 'exited' });
4900
+ }
4901
+ this.endSession();
4902
+ // Afterwards we set the new session on the scope
4903
+ scope.setSession(session);
4904
+ }
4905
+ return session;
4906
+ };
4907
+ /**
4908
+ * Sends the current Session on the scope
4909
+ */
4910
+ Hub.prototype._sendSessionUpdate = function () {
4911
+ var _a = this.getStackTop(), scope = _a.scope, client = _a.client;
4912
+ if (!scope)
4913
+ return;
4914
+ var session = scope.getSession && scope.getSession();
4915
+ if (session) {
4916
+ if (client && client.captureSession) {
4917
+ client.captureSession(session);
4918
+ }
4919
+ }
4920
+ };
4921
+ /**
4922
+ * Internal helper function to call a method on the top client if it exists.
4923
+ *
4924
+ * @param method The method to call on the client.
4925
+ * @param args Arguments to pass to the client function.
4926
+ */
4927
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4928
+ Hub.prototype._invokeClient = function (method) {
4929
+ var _a;
4930
+ var args = [];
4931
+ for (var _i = 1; _i < arguments.length; _i++) {
4932
+ args[_i - 1] = arguments[_i];
4933
+ }
4934
+ var _b = this.getStackTop(), scope = _b.scope, client = _b.client;
4935
+ if (client && client[method]) {
4936
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any
4937
+ (_a = client)[method].apply(_a, (0,tslib__WEBPACK_IMPORTED_MODULE_2__/* .__spread */ .fl)(args, [scope]));
4938
+ }
4939
+ };
4940
+ /**
4941
+ * Calls global extension method and binding current instance to the function call
4942
+ */
4943
+ // @ts-ignore Function lacks ending return statement and return type does not include 'undefined'. ts(2366)
4944
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4945
+ Hub.prototype._callExtensionMethod = function (method) {
4946
+ var args = [];
4947
+ for (var _i = 1; _i < arguments.length; _i++) {
4948
+ args[_i - 1] = arguments[_i];
4949
+ }
4950
+ var carrier = getMainCarrier();
4951
+ var sentry = carrier.__SENTRY__;
4952
+ if (sentry && sentry.extensions && typeof sentry.extensions[method] === 'function') {
4953
+ return sentry.extensions[method].apply(this, args);
4954
+ }
4955
+ _flags__WEBPACK_IMPORTED_MODULE_5__/* .IS_DEBUG_BUILD */ .h && _sentry_utils__WEBPACK_IMPORTED_MODULE_4__/* .logger.warn */ .kg.warn("Extension method " + method + " couldn't be found, doing nothing.");
4956
+ };
4957
+ return Hub;
4958
+ }());
4959
+
4960
+ /**
4961
+ * Returns the global shim registry.
4962
+ *
4963
+ * FIXME: This function is problematic, because despite always returning a valid Carrier,
4964
+ * it has an optional `__SENTRY__` property, which then in turn requires us to always perform an unnecessary check
4965
+ * at the call-site. We always access the carrier through this function, so we can guarantee that `__SENTRY__` is there.
4966
+ **/
4967
+ function getMainCarrier() {
4968
+ var carrier = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_6__/* .getGlobalObject */ .R)();
4969
+ carrier.__SENTRY__ = carrier.__SENTRY__ || {
4970
+ extensions: {},
4971
+ hub: undefined,
4972
+ };
4973
+ return carrier;
4974
+ }
4975
+ /**
4976
+ * Replaces the current main hub with the passed one on the global object
4977
+ *
4978
+ * @returns The old replaced hub
4979
+ */
4980
+ function makeMain(hub) {
4981
+ var registry = getMainCarrier();
4982
+ var oldHub = getHubFromCarrier(registry);
4983
+ setHubOnCarrier(registry, hub);
4984
+ return oldHub;
4985
+ }
4986
+ /**
4987
+ * Returns the default hub instance.
4988
+ *
4989
+ * If a hub is already registered in the global carrier but this module
4990
+ * contains a more recent version, it replaces the registered version.
4991
+ * Otherwise, the currently registered hub will be returned.
4992
+ */
4993
+ function getCurrentHub() {
4994
+ // Get main carrier (global for every environment)
4995
+ var registry = getMainCarrier();
4996
+ // If there's no hub, or its an old API, assign a new one
4997
+ if (!hasHubOnCarrier(registry) || getHubFromCarrier(registry).isOlderThan(API_VERSION)) {
4998
+ setHubOnCarrier(registry, new Hub());
4999
+ }
5000
+ // Prefer domains over global if they are there (applicable only to Node environment)
5001
+ if ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_8__/* .isNodeEnv */ .KV)()) {
5002
+ return getHubFromActiveDomain(registry);
5003
+ }
5004
+ // Return hub that lives on a global object
5005
+ return getHubFromCarrier(registry);
5006
+ }
5007
+ /**
5008
+ * Returns the active domain, if one exists
5009
+ * @deprecated No longer used; remove in v7
5010
+ * @returns The domain, or undefined if there is no active domain
5011
+ */
5012
+ // eslint-disable-next-line deprecation/deprecation
5013
+ function getActiveDomain() {
5014
+ IS_DEBUG_BUILD && logger.warn('Function `getActiveDomain` is deprecated and will be removed in a future version.');
5015
+ var sentry = getMainCarrier().__SENTRY__;
5016
+ return sentry && sentry.extensions && sentry.extensions.domain && sentry.extensions.domain.active;
5017
+ }
5018
+ /**
5019
+ * Try to read the hub from an active domain, and fallback to the registry if one doesn't exist
5020
+ * @returns discovered hub
5021
+ */
5022
+ function getHubFromActiveDomain(registry) {
5023
+ try {
5024
+ var sentry = getMainCarrier().__SENTRY__;
5025
+ var activeDomain = sentry && sentry.extensions && sentry.extensions.domain && sentry.extensions.domain.active;
5026
+ // If there's no active domain, just return global hub
5027
+ if (!activeDomain) {
5028
+ return getHubFromCarrier(registry);
5029
+ }
5030
+ // If there's no hub on current domain, or it's an old API, assign a new one
5031
+ if (!hasHubOnCarrier(activeDomain) || getHubFromCarrier(activeDomain).isOlderThan(API_VERSION)) {
5032
+ var registryHubTopStack = getHubFromCarrier(registry).getStackTop();
5033
+ setHubOnCarrier(activeDomain, new Hub(registryHubTopStack.client, _scope__WEBPACK_IMPORTED_MODULE_0__/* .Scope.clone */ .s.clone(registryHubTopStack.scope)));
5034
+ }
5035
+ // Return hub that lives on a domain
5036
+ return getHubFromCarrier(activeDomain);
5037
+ }
5038
+ catch (_Oo) {
5039
+ // Return hub that lives on a global object
5040
+ return getHubFromCarrier(registry);
5041
+ }
5042
+ }
5043
+ /**
5044
+ * This will tell whether a carrier has a hub on it or not
5045
+ * @param carrier object
5046
+ */
5047
+ function hasHubOnCarrier(carrier) {
5048
+ return !!(carrier && carrier.__SENTRY__ && carrier.__SENTRY__.hub);
5049
+ }
5050
+ /**
5051
+ * This will create a new {@link Hub} and add to the passed object on
5052
+ * __SENTRY__.hub.
5053
+ * @param carrier object
5054
+ * @hidden
5055
+ */
5056
+ function getHubFromCarrier(carrier) {
5057
+ return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_6__/* .getGlobalSingleton */ .Y)('hub', function () { return new Hub(); }, carrier);
5058
+ }
5059
+ /**
5060
+ * This will set passed {@link Hub} on the passed object's __SENTRY__.hub attribute
5061
+ * @param carrier object
5062
+ * @param hub Hub
5063
+ * @returns A boolean indicating success or failure
5064
+ */
5065
+ function setHubOnCarrier(carrier, hub) {
5066
+ if (!carrier)
5067
+ return false;
5068
+ var __SENTRY__ = (carrier.__SENTRY__ = carrier.__SENTRY__ || {});
5069
+ __SENTRY__.hub = hub;
5070
+ return true;
5071
+ }
5072
+ //# sourceMappingURL=hub.js.map
5073
+
5074
+ /***/ }),
5075
+
5076
+ /***/ 1684:
5077
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
5078
+
5079
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5080
+ /* harmony export */ "s": function() { return /* binding */ Scope; },
5081
+ /* harmony export */ "c": function() { return /* binding */ addGlobalEventProcessor; }
5082
+ /* harmony export */ });
5083
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8773);
5084
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1757);
5085
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7790);
5086
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7946);
5087
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5907);
5088
+
5089
+
5090
+ /**
5091
+ * Absolute maximum number of breadcrumbs added to an event.
5092
+ * The `maxBreadcrumbs` option cannot be higher than this value.
5093
+ */
5094
+ var MAX_BREADCRUMBS = 100;
5095
+ /**
5096
+ * Holds additional event information. {@link Scope.applyToEvent} will be
5097
+ * called by the client before an event will be sent.
5098
+ */
5099
+ var Scope = /** @class */ (function () {
5100
+ function Scope() {
5101
+ /** Flag if notifying is happening. */
5102
+ this._notifyingListeners = false;
5103
+ /** Callback for client to receive scope changes. */
5104
+ this._scopeListeners = [];
5105
+ /** Callback list that will be called after {@link applyToEvent}. */
5106
+ this._eventProcessors = [];
5107
+ /** Array of breadcrumbs. */
5108
+ this._breadcrumbs = [];
5109
+ /** User */
5110
+ this._user = {};
5111
+ /** Tags */
5112
+ this._tags = {};
5113
+ /** Extra */
5114
+ this._extra = {};
5115
+ /** Contexts */
5116
+ this._contexts = {};
5117
+ /**
5118
+ * A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get
5119
+ * sent to Sentry
5120
+ */
5121
+ this._sdkProcessingMetadata = {};
5122
+ }
5123
+ /**
5124
+ * Inherit values from the parent scope.
5125
+ * @param scope to clone.
5126
+ */
5127
+ Scope.clone = function (scope) {
5128
+ var newScope = new Scope();
5129
+ if (scope) {
5130
+ newScope._breadcrumbs = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__spread */ .fl)(scope._breadcrumbs);
5131
+ newScope._tags = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)({}, scope._tags);
5132
+ newScope._extra = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)({}, scope._extra);
5133
+ newScope._contexts = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)({}, scope._contexts);
5134
+ newScope._user = scope._user;
5135
+ newScope._level = scope._level;
5136
+ newScope._span = scope._span;
5137
+ newScope._session = scope._session;
5138
+ newScope._transactionName = scope._transactionName;
5139
+ newScope._fingerprint = scope._fingerprint;
5140
+ newScope._eventProcessors = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__spread */ .fl)(scope._eventProcessors);
5141
+ newScope._requestSession = scope._requestSession;
5142
+ }
5143
+ return newScope;
5144
+ };
5145
+ /**
5146
+ * Add internal on change listener. Used for sub SDKs that need to store the scope.
5147
+ * @hidden
5148
+ */
5149
+ Scope.prototype.addScopeListener = function (callback) {
5150
+ this._scopeListeners.push(callback);
5151
+ };
5152
+ /**
5153
+ * @inheritDoc
5154
+ */
5155
+ Scope.prototype.addEventProcessor = function (callback) {
5156
+ this._eventProcessors.push(callback);
5157
+ return this;
5158
+ };
5159
+ /**
5160
+ * @inheritDoc
5161
+ */
5162
+ Scope.prototype.setUser = function (user) {
5163
+ this._user = user || {};
5164
+ if (this._session) {
5165
+ this._session.update({ user: user });
5166
+ }
5167
+ this._notifyScopeListeners();
5168
+ return this;
5169
+ };
5170
+ /**
5171
+ * @inheritDoc
5172
+ */
5173
+ Scope.prototype.getUser = function () {
5174
+ return this._user;
5175
+ };
5176
+ /**
5177
+ * @inheritDoc
5178
+ */
5179
+ Scope.prototype.getRequestSession = function () {
5180
+ return this._requestSession;
5181
+ };
5182
+ /**
5183
+ * @inheritDoc
5184
+ */
5185
+ Scope.prototype.setRequestSession = function (requestSession) {
5186
+ this._requestSession = requestSession;
5187
+ return this;
5188
+ };
5189
+ /**
5190
+ * @inheritDoc
5191
+ */
5192
+ Scope.prototype.setTags = function (tags) {
5193
+ this._tags = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)({}, this._tags), tags);
5194
+ this._notifyScopeListeners();
5195
+ return this;
5196
+ };
5197
+ /**
5198
+ * @inheritDoc
5199
+ */
5200
+ Scope.prototype.setTag = function (key, value) {
5201
+ var _a;
5202
+ this._tags = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)({}, this._tags), (_a = {}, _a[key] = value, _a));
5203
+ this._notifyScopeListeners();
5204
+ return this;
5205
+ };
5206
+ /**
5207
+ * @inheritDoc
5208
+ */
5209
+ Scope.prototype.setExtras = function (extras) {
5210
+ this._extra = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)({}, this._extra), extras);
5211
+ this._notifyScopeListeners();
5212
+ return this;
5213
+ };
5214
+ /**
5215
+ * @inheritDoc
5216
+ */
5217
+ Scope.prototype.setExtra = function (key, extra) {
5218
+ var _a;
5219
+ this._extra = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)({}, this._extra), (_a = {}, _a[key] = extra, _a));
5220
+ this._notifyScopeListeners();
5221
+ return this;
5222
+ };
5223
+ /**
5224
+ * @inheritDoc
5225
+ */
5226
+ Scope.prototype.setFingerprint = function (fingerprint) {
5227
+ this._fingerprint = fingerprint;
5228
+ this._notifyScopeListeners();
5229
+ return this;
5230
+ };
5231
+ /**
5232
+ * @inheritDoc
5233
+ */
5234
+ Scope.prototype.setLevel = function (level) {
5235
+ this._level = level;
5236
+ this._notifyScopeListeners();
5237
+ return this;
5238
+ };
5239
+ /**
5240
+ * @inheritDoc
5241
+ */
5242
+ Scope.prototype.setTransactionName = function (name) {
5243
+ this._transactionName = name;
5244
+ this._notifyScopeListeners();
5245
+ return this;
5246
+ };
5247
+ /**
5248
+ * Can be removed in major version.
5249
+ * @deprecated in favor of {@link this.setTransactionName}
5250
+ */
5251
+ Scope.prototype.setTransaction = function (name) {
5252
+ return this.setTransactionName(name);
5253
+ };
5254
+ /**
5255
+ * @inheritDoc
5256
+ */
5257
+ Scope.prototype.setContext = function (key, context) {
5258
+ var _a;
5259
+ if (context === null) {
5260
+ // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
5261
+ delete this._contexts[key];
5262
+ }
5263
+ else {
5264
+ this._contexts = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)({}, this._contexts), (_a = {}, _a[key] = context, _a));
5265
+ }
5266
+ this._notifyScopeListeners();
5267
+ return this;
5268
+ };
5269
+ /**
5270
+ * @inheritDoc
5271
+ */
5272
+ Scope.prototype.setSpan = function (span) {
5273
+ this._span = span;
5274
+ this._notifyScopeListeners();
5275
+ return this;
5276
+ };
5277
+ /**
5278
+ * @inheritDoc
5279
+ */
5280
+ Scope.prototype.getSpan = function () {
5281
+ return this._span;
5282
+ };
5283
+ /**
5284
+ * @inheritDoc
5285
+ */
5286
+ Scope.prototype.getTransaction = function () {
5287
+ // Often, this span (if it exists at all) will be a transaction, but it's not guaranteed to be. Regardless, it will
5288
+ // have a pointer to the currently-active transaction.
5289
+ var span = this.getSpan();
5290
+ return span && span.transaction;
5291
+ };
5292
+ /**
5293
+ * @inheritDoc
5294
+ */
5295
+ Scope.prototype.setSession = function (session) {
5296
+ if (!session) {
5297
+ delete this._session;
5298
+ }
5299
+ else {
5300
+ this._session = session;
5301
+ }
5302
+ this._notifyScopeListeners();
5303
+ return this;
5304
+ };
5305
+ /**
5306
+ * @inheritDoc
5307
+ */
5308
+ Scope.prototype.getSession = function () {
5309
+ return this._session;
5310
+ };
5311
+ /**
5312
+ * @inheritDoc
5313
+ */
5314
+ Scope.prototype.update = function (captureContext) {
5315
+ if (!captureContext) {
5316
+ return this;
5317
+ }
5318
+ if (typeof captureContext === 'function') {
5319
+ var updatedScope = captureContext(this);
5320
+ return updatedScope instanceof Scope ? updatedScope : this;
5321
+ }
5322
+ if (captureContext instanceof Scope) {
5323
+ this._tags = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)({}, this._tags), captureContext._tags);
5324
+ this._extra = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)({}, this._extra), captureContext._extra);
5325
+ this._contexts = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)({}, this._contexts), captureContext._contexts);
5326
+ if (captureContext._user && Object.keys(captureContext._user).length) {
5327
+ this._user = captureContext._user;
5328
+ }
5329
+ if (captureContext._level) {
5330
+ this._level = captureContext._level;
5331
+ }
5332
+ if (captureContext._fingerprint) {
5333
+ this._fingerprint = captureContext._fingerprint;
5334
+ }
5335
+ if (captureContext._requestSession) {
5336
+ this._requestSession = captureContext._requestSession;
5337
+ }
5338
+ }
5339
+ else if ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__/* .isPlainObject */ .PO)(captureContext)) {
5340
+ // eslint-disable-next-line no-param-reassign
5341
+ captureContext = captureContext;
5342
+ this._tags = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)({}, this._tags), captureContext.tags);
5343
+ this._extra = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)({}, this._extra), captureContext.extra);
5344
+ this._contexts = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)({}, this._contexts), captureContext.contexts);
5345
+ if (captureContext.user) {
5346
+ this._user = captureContext.user;
5347
+ }
5348
+ if (captureContext.level) {
5349
+ this._level = captureContext.level;
5350
+ }
5351
+ if (captureContext.fingerprint) {
5352
+ this._fingerprint = captureContext.fingerprint;
5353
+ }
5354
+ if (captureContext.requestSession) {
5355
+ this._requestSession = captureContext.requestSession;
5356
+ }
5357
+ }
5358
+ return this;
5359
+ };
5360
+ /**
5361
+ * @inheritDoc
5362
+ */
5363
+ Scope.prototype.clear = function () {
5364
+ this._breadcrumbs = [];
5365
+ this._tags = {};
5366
+ this._extra = {};
5367
+ this._user = {};
5368
+ this._contexts = {};
5369
+ this._level = undefined;
5370
+ this._transactionName = undefined;
5371
+ this._fingerprint = undefined;
5372
+ this._requestSession = undefined;
5373
+ this._span = undefined;
5374
+ this._session = undefined;
5375
+ this._notifyScopeListeners();
5376
+ return this;
5377
+ };
5378
+ /**
5379
+ * @inheritDoc
5380
+ */
5381
+ Scope.prototype.addBreadcrumb = function (breadcrumb, maxBreadcrumbs) {
5382
+ var maxCrumbs = typeof maxBreadcrumbs === 'number' ? Math.min(maxBreadcrumbs, MAX_BREADCRUMBS) : MAX_BREADCRUMBS;
5383
+ // No data has been changed, so don't notify scope listeners
5384
+ if (maxCrumbs <= 0) {
5385
+ return this;
5386
+ }
5387
+ var mergedBreadcrumb = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)({ timestamp: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__/* .dateTimestampInSeconds */ .yW)() }, breadcrumb);
5388
+ this._breadcrumbs = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__spread */ .fl)(this._breadcrumbs, [mergedBreadcrumb]).slice(-maxCrumbs);
5389
+ this._notifyScopeListeners();
5390
+ return this;
5391
+ };
5392
+ /**
5393
+ * @inheritDoc
5394
+ */
5395
+ Scope.prototype.clearBreadcrumbs = function () {
5396
+ this._breadcrumbs = [];
5397
+ this._notifyScopeListeners();
5398
+ return this;
5399
+ };
5400
+ /**
5401
+ * Applies the current context and fingerprint to the event.
5402
+ * Note that breadcrumbs will be added by the client.
5403
+ * Also if the event has already breadcrumbs on it, we do not merge them.
5404
+ * @param event Event
5405
+ * @param hint May contain additional information about the original exception.
5406
+ * @hidden
5407
+ */
5408
+ Scope.prototype.applyToEvent = function (event, hint) {
5409
+ if (this._extra && Object.keys(this._extra).length) {
5410
+ event.extra = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)({}, this._extra), event.extra);
5411
+ }
5412
+ if (this._tags && Object.keys(this._tags).length) {
5413
+ event.tags = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)({}, this._tags), event.tags);
5414
+ }
5415
+ if (this._user && Object.keys(this._user).length) {
5416
+ event.user = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)({}, this._user), event.user);
5417
+ }
5418
+ if (this._contexts && Object.keys(this._contexts).length) {
5419
+ event.contexts = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)({}, this._contexts), event.contexts);
5420
+ }
5421
+ if (this._level) {
5422
+ event.level = this._level;
5423
+ }
5424
+ if (this._transactionName) {
5425
+ event.transaction = this._transactionName;
5426
+ }
5427
+ // We want to set the trace context for normal events only if there isn't already
5428
+ // a trace context on the event. There is a product feature in place where we link
5429
+ // errors with transaction and it relies on that.
5430
+ if (this._span) {
5431
+ event.contexts = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)({ trace: this._span.getTraceContext() }, event.contexts);
5432
+ var transactionName = this._span.transaction && this._span.transaction.name;
5433
+ if (transactionName) {
5434
+ event.tags = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)({ transaction: transactionName }, event.tags);
5435
+ }
5436
+ }
5437
+ this._applyFingerprint(event);
5438
+ event.breadcrumbs = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__spread */ .fl)((event.breadcrumbs || []), this._breadcrumbs);
5439
+ event.breadcrumbs = event.breadcrumbs.length > 0 ? event.breadcrumbs : undefined;
5440
+ event.sdkProcessingMetadata = this._sdkProcessingMetadata;
5441
+ return this._notifyEventProcessors((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__spread */ .fl)(getGlobalEventProcessors(), this._eventProcessors), event, hint);
5442
+ };
5443
+ /**
5444
+ * Add data which will be accessible during event processing but won't get sent to Sentry
5445
+ */
5446
+ Scope.prototype.setSDKProcessingMetadata = function (newData) {
5447
+ this._sdkProcessingMetadata = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)({}, this._sdkProcessingMetadata), newData);
5448
+ return this;
5449
+ };
5450
+ /**
5451
+ * This will be called after {@link applyToEvent} is finished.
5452
+ */
5453
+ Scope.prototype._notifyEventProcessors = function (processors, event, hint, index) {
5454
+ var _this = this;
5455
+ if (index === void 0) { index = 0; }
5456
+ return new _sentry_utils__WEBPACK_IMPORTED_MODULE_3__/* .SyncPromise */ .cW(function (resolve, reject) {
5457
+ var processor = processors[index];
5458
+ if (event === null || typeof processor !== 'function') {
5459
+ resolve(event);
5460
+ }
5461
+ else {
5462
+ var result = processor((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)({}, event), hint);
5463
+ if ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__/* .isThenable */ .J8)(result)) {
5464
+ void result
5465
+ .then(function (final) { return _this._notifyEventProcessors(processors, final, hint, index + 1).then(resolve); })
5466
+ .then(null, reject);
5467
+ }
5468
+ else {
5469
+ void _this._notifyEventProcessors(processors, result, hint, index + 1)
5470
+ .then(resolve)
5471
+ .then(null, reject);
5472
+ }
5473
+ }
5474
+ });
5475
+ };
5476
+ /**
5477
+ * This will be called on every set call.
5478
+ */
5479
+ Scope.prototype._notifyScopeListeners = function () {
5480
+ var _this = this;
5481
+ // We need this check for this._notifyingListeners to be able to work on scope during updates
5482
+ // If this check is not here we'll produce endless recursion when something is done with the scope
5483
+ // during the callback.
5484
+ if (!this._notifyingListeners) {
5485
+ this._notifyingListeners = true;
5486
+ this._scopeListeners.forEach(function (callback) {
5487
+ callback(_this);
5488
+ });
5489
+ this._notifyingListeners = false;
5490
+ }
5491
+ };
5492
+ /**
5493
+ * Applies fingerprint from the scope to the event if there's one,
5494
+ * uses message if there's one instead or get rid of empty fingerprint
5495
+ */
5496
+ Scope.prototype._applyFingerprint = function (event) {
5497
+ // Make sure it's an array first and we actually have something in place
5498
+ event.fingerprint = event.fingerprint
5499
+ ? Array.isArray(event.fingerprint)
5500
+ ? event.fingerprint
5501
+ : [event.fingerprint]
5502
+ : [];
5503
+ // If we have something on the scope, then merge it with event
5504
+ if (this._fingerprint) {
5505
+ event.fingerprint = event.fingerprint.concat(this._fingerprint);
5506
+ }
5507
+ // If we have no data at all, remove empty array default
5508
+ if (event.fingerprint && !event.fingerprint.length) {
5509
+ delete event.fingerprint;
5510
+ }
5511
+ };
5512
+ return Scope;
5513
+ }());
5514
+
5515
+ /**
5516
+ * Returns the global event processors.
5517
+ */
5518
+ function getGlobalEventProcessors() {
5519
+ return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__/* .getGlobalSingleton */ .Y)('globalEventProcessors', function () { return []; });
5520
+ }
5521
+ /**
5522
+ * Add a EventProcessor to be kept globally.
5523
+ * @param callback EventProcessor to add
5524
+ */
5525
+ function addGlobalEventProcessor(callback) {
5526
+ getGlobalEventProcessors().push(callback);
5527
+ }
5528
+ //# sourceMappingURL=scope.js.map
5529
+
5530
+ /***/ }),
5531
+
5532
+ /***/ 2430:
5533
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
5534
+
5535
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5536
+ /* harmony export */ "z": function() { return /* binding */ Session; }
5537
+ /* harmony export */ });
5538
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3699);
5539
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7790);
5540
+ /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1995);
5541
+
5542
+ /**
5543
+ * @inheritdoc
5544
+ */
5545
+ var Session = /** @class */ (function () {
5546
+ function Session(context) {
5547
+ this.errors = 0;
5548
+ this.sid = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__/* .uuid4 */ .DM)();
5549
+ this.duration = 0;
5550
+ this.status = 'ok';
5551
+ this.init = true;
5552
+ this.ignoreDuration = false;
5553
+ // Both timestamp and started are in seconds since the UNIX epoch.
5554
+ var startingTime = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__/* .timestampInSeconds */ .ph)();
5555
+ this.timestamp = startingTime;
5556
+ this.started = startingTime;
5557
+ if (context) {
5558
+ this.update(context);
5559
+ }
5560
+ }
5561
+ /** JSDoc */
5562
+ // eslint-disable-next-line complexity
5563
+ Session.prototype.update = function (context) {
5564
+ if (context === void 0) { context = {}; }
5565
+ if (context.user) {
5566
+ if (!this.ipAddress && context.user.ip_address) {
5567
+ this.ipAddress = context.user.ip_address;
5568
+ }
5569
+ if (!this.did && !context.did) {
5570
+ this.did = context.user.id || context.user.email || context.user.username;
5571
+ }
5572
+ }
5573
+ this.timestamp = context.timestamp || (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__/* .timestampInSeconds */ .ph)();
5574
+ if (context.ignoreDuration) {
5575
+ this.ignoreDuration = context.ignoreDuration;
5576
+ }
5577
+ if (context.sid) {
5578
+ // Good enough uuid validation. — Kamil
5579
+ this.sid = context.sid.length === 32 ? context.sid : (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__/* .uuid4 */ .DM)();
5580
+ }
5581
+ if (context.init !== undefined) {
5582
+ this.init = context.init;
5583
+ }
5584
+ if (!this.did && context.did) {
5585
+ this.did = "" + context.did;
5586
+ }
5587
+ if (typeof context.started === 'number') {
5588
+ this.started = context.started;
5589
+ }
5590
+ if (this.ignoreDuration) {
5591
+ this.duration = undefined;
5592
+ }
5593
+ else if (typeof context.duration === 'number') {
5594
+ this.duration = context.duration;
5595
+ }
5596
+ else {
5597
+ var duration = this.timestamp - this.started;
5598
+ this.duration = duration >= 0 ? duration : 0;
5599
+ }
5600
+ if (context.release) {
5601
+ this.release = context.release;
5602
+ }
5603
+ if (context.environment) {
5604
+ this.environment = context.environment;
5605
+ }
5606
+ if (!this.ipAddress && context.ipAddress) {
5607
+ this.ipAddress = context.ipAddress;
5608
+ }
5609
+ if (!this.userAgent && context.userAgent) {
5610
+ this.userAgent = context.userAgent;
5611
+ }
5612
+ if (typeof context.errors === 'number') {
5613
+ this.errors = context.errors;
5614
+ }
5615
+ if (context.status) {
5616
+ this.status = context.status;
5617
+ }
5618
+ };
5619
+ /** JSDoc */
5620
+ Session.prototype.close = function (status) {
5621
+ if (status) {
5622
+ this.update({ status: status });
5623
+ }
5624
+ else if (this.status === 'ok') {
5625
+ this.update({ status: 'exited' });
5626
+ }
5627
+ else {
5628
+ this.update();
5629
+ }
5630
+ };
5631
+ /** JSDoc */
5632
+ Session.prototype.toJSON = function () {
5633
+ return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__/* .dropUndefinedKeys */ .Jr)({
5634
+ sid: "" + this.sid,
5635
+ init: this.init,
5636
+ // Make sure that sec is converted to ms for date constructor
5637
+ started: new Date(this.started * 1000).toISOString(),
5638
+ timestamp: new Date(this.timestamp * 1000).toISOString(),
5639
+ status: this.status,
5640
+ errors: this.errors,
5641
+ did: typeof this.did === 'number' || typeof this.did === 'string' ? "" + this.did : undefined,
5642
+ duration: this.duration,
5643
+ attrs: {
5644
+ release: this.release,
5645
+ environment: this.environment,
5646
+ ip_address: this.ipAddress,
5647
+ user_agent: this.userAgent,
5648
+ },
5649
+ });
5650
+ };
5651
+ return Session;
5652
+ }());
5653
+
5654
+ //# sourceMappingURL=session.js.map
5655
+
5656
+ /***/ }),
5657
+
5658
+ /***/ 8773:
5659
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
5660
+
5661
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5662
+ /* harmony export */ "pi": function() { return /* binding */ __assign; },
5663
+ /* harmony export */ "fl": function() { return /* binding */ __spread; }
5664
+ /* harmony export */ });
5665
+ /* unused harmony exports __extends, __rest, __decorate, __param, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __read, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet */
5666
+ /*! *****************************************************************************
5667
+ Copyright (c) Microsoft Corporation.
5668
+
5669
+ Permission to use, copy, modify, and/or distribute this software for any
5670
+ purpose with or without fee is hereby granted.
5671
+
5672
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
5673
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
5674
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
5675
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
5676
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
5677
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
5678
+ PERFORMANCE OF THIS SOFTWARE.
5679
+ ***************************************************************************** */
5680
+ /* global Reflect, Promise */
5681
+
5682
+ var extendStatics = function(d, b) {
5683
+ extendStatics = Object.setPrototypeOf ||
5684
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5685
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
5686
+ return extendStatics(d, b);
5687
+ };
5688
+
5689
+ function __extends(d, b) {
5690
+ extendStatics(d, b);
5691
+ function __() { this.constructor = d; }
5692
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
5693
+ }
5694
+
5695
+ var __assign = function() {
5696
+ __assign = Object.assign || function __assign(t) {
5697
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5698
+ s = arguments[i];
5699
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
5700
+ }
5701
+ return t;
5702
+ }
5703
+ return __assign.apply(this, arguments);
5704
+ }
5705
+
5706
+ function __rest(s, e) {
5707
+ var t = {};
5708
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5709
+ t[p] = s[p];
5710
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
5711
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
5712
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
5713
+ t[p[i]] = s[p[i]];
5714
+ }
5715
+ return t;
5716
+ }
5717
+
5718
+ function __decorate(decorators, target, key, desc) {
5719
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5720
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5721
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5722
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
5723
+ }
5724
+
5725
+ function __param(paramIndex, decorator) {
5726
+ return function (target, key) { decorator(target, key, paramIndex); }
5727
+ }
5728
+
5729
+ function __metadata(metadataKey, metadataValue) {
5730
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
5731
+ }
5732
+
5733
+ function __awaiter(thisArg, _arguments, P, generator) {
5734
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5735
+ return new (P || (P = Promise))(function (resolve, reject) {
5736
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5737
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
5738
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
5739
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
5740
+ });
5741
+ }
5742
+
5743
+ function __generator(thisArg, body) {
5744
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
5745
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
5746
+ function verb(n) { return function (v) { return step([n, v]); }; }
5747
+ function step(op) {
5748
+ if (f) throw new TypeError("Generator is already executing.");
5749
+ while (_) try {
5750
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
5751
+ if (y = 0, t) op = [op[0] & 2, t.value];
5752
+ switch (op[0]) {
5753
+ case 0: case 1: t = op; break;
5754
+ case 4: _.label++; return { value: op[1], done: false };
5755
+ case 5: _.label++; y = op[1]; op = [0]; continue;
5756
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
5757
+ default:
5758
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
5759
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
5760
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
5761
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
5762
+ if (t[2]) _.ops.pop();
5763
+ _.trys.pop(); continue;
5764
+ }
5765
+ op = body.call(thisArg, _);
5766
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
5767
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
5768
+ }
5769
+ }
5770
+
5771
+ function __createBinding(o, m, k, k2) {
5772
+ if (k2 === undefined) k2 = k;
5773
+ o[k2] = m[k];
5774
+ }
5775
+
5776
+ function __exportStar(m, exports) {
5777
+ for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p];
5778
+ }
5779
+
5780
+ function __values(o) {
5781
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
5782
+ if (m) return m.call(o);
5783
+ if (o && typeof o.length === "number") return {
5784
+ next: function () {
5785
+ if (o && i >= o.length) o = void 0;
5786
+ return { value: o && o[i++], done: !o };
5787
+ }
5788
+ };
5789
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
5790
+ }
5791
+
5792
+ function __read(o, n) {
5793
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
5794
+ if (!m) return o;
5795
+ var i = m.call(o), r, ar = [], e;
5796
+ try {
5797
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
5798
+ }
5799
+ catch (error) { e = { error: error }; }
5800
+ finally {
5801
+ try {
5802
+ if (r && !r.done && (m = i["return"])) m.call(i);
5803
+ }
5804
+ finally { if (e) throw e.error; }
5805
+ }
5806
+ return ar;
5807
+ }
5808
+
5809
+ function __spread() {
5810
+ for (var ar = [], i = 0; i < arguments.length; i++)
5811
+ ar = ar.concat(__read(arguments[i]));
5812
+ return ar;
5813
+ }
5814
+
5815
+ function __spreadArrays() {
5816
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
5817
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
5818
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
5819
+ r[k] = a[j];
5820
+ return r;
5821
+ };
5822
+
5823
+ function __await(v) {
5824
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
5825
+ }
5826
+
5827
+ function __asyncGenerator(thisArg, _arguments, generator) {
5828
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
5829
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
5830
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
5831
+ function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
5832
+ function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
5833
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
5834
+ function fulfill(value) { resume("next", value); }
5835
+ function reject(value) { resume("throw", value); }
5836
+ function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
5837
+ }
5838
+
5839
+ function __asyncDelegator(o) {
5840
+ var i, p;
5841
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
5842
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
5843
+ }
5844
+
5845
+ function __asyncValues(o) {
5846
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
5847
+ var m = o[Symbol.asyncIterator], i;
5848
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
5849
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
5850
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
5851
+ }
5852
+
5853
+ function __makeTemplateObject(cooked, raw) {
5854
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
5855
+ return cooked;
5856
+ };
5857
+
5858
+ function __importStar(mod) {
5859
+ if (mod && mod.__esModule) return mod;
5860
+ var result = {};
5861
+ if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
5862
+ result.default = mod;
5863
+ return result;
5864
+ }
5865
+
5866
+ function __importDefault(mod) {
5867
+ return (mod && mod.__esModule) ? mod : { default: mod };
5868
+ }
5869
+
5870
+ function __classPrivateFieldGet(receiver, privateMap) {
5871
+ if (!privateMap.has(receiver)) {
5872
+ throw new TypeError("attempted to get private field on non-instance");
5873
+ }
5874
+ return privateMap.get(receiver);
5875
+ }
5876
+
5877
+ function __classPrivateFieldSet(receiver, privateMap, value) {
5878
+ if (!privateMap.has(receiver)) {
5879
+ throw new TypeError("attempted to set private field on non-instance");
5880
+ }
5881
+ privateMap.set(receiver, value);
5882
+ return value;
5883
+ }
5884
+
5885
+
5886
+ /***/ }),
5887
+
5888
+ /***/ 4678:
5889
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
5890
+
5891
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5892
+ /* harmony export */ "Tb": function() { return /* binding */ captureException; },
5893
+ /* harmony export */ "$e": function() { return /* binding */ withScope; }
5894
+ /* harmony export */ });
5895
+ /* unused harmony exports captureMessage, captureEvent, configureScope, addBreadcrumb, setContext, setExtras, setTags, setExtra, setTag, setUser, _callOnClient, startTransaction */
5896
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5559);
5897
+ /* harmony import */ var _sentry_hub__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8585);
5898
+
5899
+
5900
+ /**
5901
+ * This calls a function on the current hub.
5902
+ * @param method function to call on hub.
5903
+ * @param args to pass to function.
5904
+ */
5905
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5906
+ function callOnHub(method) {
5907
+ var args = [];
5908
+ for (var _i = 1; _i < arguments.length; _i++) {
5909
+ args[_i - 1] = arguments[_i];
5910
+ }
5911
+ var hub = (0,_sentry_hub__WEBPACK_IMPORTED_MODULE_0__/* .getCurrentHub */ .Gd)();
5912
+ if (hub && hub[method]) {
5913
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5914
+ return hub[method].apply(hub, (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__spread */ .fl)(args));
5915
+ }
5916
+ throw new Error("No hub defined or " + method + " was not found on the hub, please open a bug report.");
5917
+ }
5918
+ /**
5919
+ * Captures an exception event and sends it to Sentry.
5920
+ *
5921
+ * @param exception An exception-like object.
5922
+ * @returns The generated eventId.
5923
+ */
5924
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
5925
+ function captureException(exception, captureContext) {
5926
+ var syntheticException = new Error('Sentry syntheticException');
5927
+ return callOnHub('captureException', exception, {
5928
+ captureContext: captureContext,
5929
+ originalException: exception,
5930
+ syntheticException: syntheticException,
5931
+ });
5932
+ }
5933
+ /**
5934
+ * Captures a message event and sends it to Sentry.
5935
+ *
5936
+ * @param message The message to send to Sentry.
5937
+ * @param Severity Define the level of the message.
5938
+ * @returns The generated eventId.
5939
+ */
5940
+ function captureMessage(message, captureContext) {
5941
+ var syntheticException = new Error(message);
5942
+ // This is necessary to provide explicit scopes upgrade, without changing the original
5943
+ // arity of the `captureMessage(message, level)` method.
5944
+ var level = typeof captureContext === 'string' ? captureContext : undefined;
5945
+ var context = typeof captureContext !== 'string' ? { captureContext: captureContext } : undefined;
5946
+ return callOnHub('captureMessage', message, level, __assign({ originalException: message, syntheticException: syntheticException }, context));
5947
+ }
5948
+ /**
5949
+ * Captures a manually created event and sends it to Sentry.
5950
+ *
5951
+ * @param event The event to send to Sentry.
5952
+ * @returns The generated eventId.
5953
+ */
5954
+ function captureEvent(event) {
5955
+ return callOnHub('captureEvent', event);
5956
+ }
5957
+ /**
5958
+ * Callback to set context information onto the scope.
5959
+ * @param callback Callback function that receives Scope.
5960
+ */
5961
+ function configureScope(callback) {
5962
+ callOnHub('configureScope', callback);
5963
+ }
5964
+ /**
5965
+ * Records a new breadcrumb which will be attached to future events.
5966
+ *
5967
+ * Breadcrumbs will be added to subsequent events to provide more context on
5968
+ * user's actions prior to an error or crash.
5969
+ *
5970
+ * @param breadcrumb The breadcrumb to record.
5971
+ */
5972
+ function addBreadcrumb(breadcrumb) {
5973
+ callOnHub('addBreadcrumb', breadcrumb);
5974
+ }
5975
+ /**
5976
+ * Sets context data with the given name.
5977
+ * @param name of the context
5978
+ * @param context Any kind of data. This data will be normalized.
5979
+ */
5980
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5981
+ function setContext(name, context) {
5982
+ callOnHub('setContext', name, context);
5983
+ }
5984
+ /**
5985
+ * Set an object that will be merged sent as extra data with the event.
5986
+ * @param extras Extras object to merge into current context.
5987
+ */
5988
+ function setExtras(extras) {
5989
+ callOnHub('setExtras', extras);
5990
+ }
5991
+ /**
5992
+ * Set an object that will be merged sent as tags data with the event.
5993
+ * @param tags Tags context object to merge into current context.
5994
+ */
5995
+ function setTags(tags) {
5996
+ callOnHub('setTags', tags);
5997
+ }
5998
+ /**
5999
+ * Set key:value that will be sent as extra data with the event.
6000
+ * @param key String of extra
6001
+ * @param extra Any kind of data. This data will be normalized.
6002
+ */
6003
+ function setExtra(key, extra) {
6004
+ callOnHub('setExtra', key, extra);
6005
+ }
6006
+ /**
6007
+ * Set key:value that will be sent as tags data with the event.
6008
+ *
6009
+ * Can also be used to unset a tag, by passing `undefined`.
6010
+ *
6011
+ * @param key String key of tag
6012
+ * @param value Value of tag
6013
+ */
6014
+ function setTag(key, value) {
6015
+ callOnHub('setTag', key, value);
6016
+ }
6017
+ /**
6018
+ * Updates user context information for future events.
6019
+ *
6020
+ * @param user User context object to be set in the current context. Pass `null` to unset the user.
6021
+ */
6022
+ function setUser(user) {
6023
+ callOnHub('setUser', user);
6024
+ }
6025
+ /**
6026
+ * Creates a new scope with and executes the given operation within.
6027
+ * The scope is automatically removed once the operation
6028
+ * finishes or throws.
6029
+ *
6030
+ * This is essentially a convenience function for:
6031
+ *
6032
+ * pushScope();
6033
+ * callback();
6034
+ * popScope();
6035
+ *
6036
+ * @param callback that will be enclosed into push/popScope.
6037
+ */
6038
+ function withScope(callback) {
6039
+ callOnHub('withScope', callback);
6040
+ }
6041
+ /**
6042
+ * Calls a function on the latest client. Use this with caution, it's meant as
6043
+ * in "internal" helper so we don't need to expose every possible function in
6044
+ * the shim. It is not guaranteed that the client actually implements the
6045
+ * function.
6046
+ *
6047
+ * @param method The method to call on the client/client.
6048
+ * @param args Arguments to pass to the client/fontend.
6049
+ * @hidden
6050
+ */
6051
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6052
+ function _callOnClient(method) {
6053
+ var args = [];
6054
+ for (var _i = 1; _i < arguments.length; _i++) {
6055
+ args[_i - 1] = arguments[_i];
6056
+ }
6057
+ callOnHub.apply(void 0, __spread(['_invokeClient', method], args));
6058
+ }
6059
+ /**
6060
+ * Starts a new `Transaction` and returns it. This is the entry point to manual tracing instrumentation.
6061
+ *
6062
+ * A tree structure can be built by adding child spans to the transaction, and child spans to other spans. To start a
6063
+ * new child span within the transaction or any span, call the respective `.startChild()` method.
6064
+ *
6065
+ * Every child span must be finished before the transaction is finished, otherwise the unfinished spans are discarded.
6066
+ *
6067
+ * The transaction must be finished with a call to its `.finish()` method, at which point the transaction with all its
6068
+ * finished child spans will be sent to Sentry.
6069
+ *
6070
+ * @param context Properties of the new `Transaction`.
6071
+ * @param customSamplingContext Information given to the transaction sampling function (along with context-dependent
6072
+ * default values). See {@link Options.tracesSampler}.
6073
+ *
6074
+ * @returns The transaction which was just started
6075
+ */
6076
+ function startTransaction(context, customSamplingContext) {
6077
+ return callOnHub('startTransaction', __assign({}, context), customSamplingContext);
6078
+ }
6079
+ //# sourceMappingURL=index.js.map
6080
+
6081
+ /***/ }),
6082
+
6083
+ /***/ 5559:
6084
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6085
+
6086
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6087
+ /* harmony export */ "fl": function() { return /* binding */ __spread; }
6088
+ /* harmony export */ });
6089
+ /* unused harmony exports __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __read, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet */
6090
+ /*! *****************************************************************************
6091
+ Copyright (c) Microsoft Corporation.
6092
+
6093
+ Permission to use, copy, modify, and/or distribute this software for any
6094
+ purpose with or without fee is hereby granted.
6095
+
6096
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
6097
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
6098
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
6099
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
6100
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
6101
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
6102
+ PERFORMANCE OF THIS SOFTWARE.
6103
+ ***************************************************************************** */
6104
+ /* global Reflect, Promise */
6105
+
6106
+ var extendStatics = function(d, b) {
6107
+ extendStatics = Object.setPrototypeOf ||
6108
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6109
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6110
+ return extendStatics(d, b);
6111
+ };
6112
+
6113
+ function __extends(d, b) {
6114
+ extendStatics(d, b);
6115
+ function __() { this.constructor = d; }
6116
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
6117
+ }
6118
+
6119
+ var __assign = function() {
6120
+ __assign = Object.assign || function __assign(t) {
6121
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
6122
+ s = arguments[i];
6123
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
6124
+ }
6125
+ return t;
6126
+ }
6127
+ return __assign.apply(this, arguments);
6128
+ }
6129
+
6130
+ function __rest(s, e) {
6131
+ var t = {};
6132
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
6133
+ t[p] = s[p];
6134
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6135
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
6136
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
6137
+ t[p[i]] = s[p[i]];
6138
+ }
6139
+ return t;
6140
+ }
6141
+
6142
+ function __decorate(decorators, target, key, desc) {
6143
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
6144
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
6145
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6146
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6147
+ }
6148
+
6149
+ function __param(paramIndex, decorator) {
6150
+ return function (target, key) { decorator(target, key, paramIndex); }
6151
+ }
6152
+
6153
+ function __metadata(metadataKey, metadataValue) {
6154
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
6155
+ }
6156
+
6157
+ function __awaiter(thisArg, _arguments, P, generator) {
6158
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
6159
+ return new (P || (P = Promise))(function (resolve, reject) {
6160
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6161
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6162
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
6163
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
6164
+ });
6165
+ }
6166
+
6167
+ function __generator(thisArg, body) {
6168
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
6169
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
6170
+ function verb(n) { return function (v) { return step([n, v]); }; }
6171
+ function step(op) {
6172
+ if (f) throw new TypeError("Generator is already executing.");
6173
+ while (_) try {
6174
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
6175
+ if (y = 0, t) op = [op[0] & 2, t.value];
6176
+ switch (op[0]) {
6177
+ case 0: case 1: t = op; break;
6178
+ case 4: _.label++; return { value: op[1], done: false };
6179
+ case 5: _.label++; y = op[1]; op = [0]; continue;
6180
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
6181
+ default:
6182
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
6183
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
6184
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
6185
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
6186
+ if (t[2]) _.ops.pop();
6187
+ _.trys.pop(); continue;
6188
+ }
6189
+ op = body.call(thisArg, _);
6190
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
6191
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
6192
+ }
6193
+ }
6194
+
6195
+ function __createBinding(o, m, k, k2) {
6196
+ if (k2 === undefined) k2 = k;
6197
+ o[k2] = m[k];
6198
+ }
6199
+
6200
+ function __exportStar(m, exports) {
6201
+ for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p];
6202
+ }
6203
+
6204
+ function __values(o) {
6205
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
6206
+ if (m) return m.call(o);
6207
+ if (o && typeof o.length === "number") return {
6208
+ next: function () {
6209
+ if (o && i >= o.length) o = void 0;
6210
+ return { value: o && o[i++], done: !o };
6211
+ }
6212
+ };
6213
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
6214
+ }
6215
+
6216
+ function __read(o, n) {
6217
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
6218
+ if (!m) return o;
6219
+ var i = m.call(o), r, ar = [], e;
6220
+ try {
6221
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
6222
+ }
6223
+ catch (error) { e = { error: error }; }
6224
+ finally {
6225
+ try {
6226
+ if (r && !r.done && (m = i["return"])) m.call(i);
6227
+ }
6228
+ finally { if (e) throw e.error; }
6229
+ }
6230
+ return ar;
6231
+ }
6232
+
6233
+ function __spread() {
6234
+ for (var ar = [], i = 0; i < arguments.length; i++)
6235
+ ar = ar.concat(__read(arguments[i]));
6236
+ return ar;
6237
+ }
6238
+
6239
+ function __spreadArrays() {
6240
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
6241
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
6242
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
6243
+ r[k] = a[j];
6244
+ return r;
6245
+ };
6246
+
6247
+ function __await(v) {
6248
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
6249
+ }
6250
+
6251
+ function __asyncGenerator(thisArg, _arguments, generator) {
6252
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
6253
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
6254
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
6255
+ function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
6256
+ function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
6257
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
6258
+ function fulfill(value) { resume("next", value); }
6259
+ function reject(value) { resume("throw", value); }
6260
+ function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
6261
+ }
6262
+
6263
+ function __asyncDelegator(o) {
6264
+ var i, p;
6265
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
6266
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
6267
+ }
6268
+
6269
+ function __asyncValues(o) {
6270
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
6271
+ var m = o[Symbol.asyncIterator], i;
6272
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
6273
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
6274
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
6275
+ }
6276
+
6277
+ function __makeTemplateObject(cooked, raw) {
6278
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
6279
+ return cooked;
6280
+ };
6281
+
6282
+ function __importStar(mod) {
6283
+ if (mod && mod.__esModule) return mod;
6284
+ var result = {};
6285
+ if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
6286
+ result.default = mod;
6287
+ return result;
6288
+ }
6289
+
6290
+ function __importDefault(mod) {
6291
+ return (mod && mod.__esModule) ? mod : { default: mod };
6292
+ }
6293
+
6294
+ function __classPrivateFieldGet(receiver, privateMap) {
6295
+ if (!privateMap.has(receiver)) {
6296
+ throw new TypeError("attempted to get private field on non-instance");
6297
+ }
6298
+ return privateMap.get(receiver);
6299
+ }
6300
+
6301
+ function __classPrivateFieldSet(receiver, privateMap, value) {
6302
+ if (!privateMap.has(receiver)) {
6303
+ throw new TypeError("attempted to set private field on non-instance");
6304
+ }
6305
+ privateMap.set(receiver, value);
6306
+ return value;
6307
+ }
6308
+
6309
+
6310
+ /***/ }),
6311
+
6312
+ /***/ 2226:
6313
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6314
+
6315
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6316
+ /* harmony export */ "z": function() { return /* binding */ Severity; }
6317
+ /* harmony export */ });
6318
+ /* unused harmony export SeverityLevels */
6319
+ /**
6320
+ * TODO(v7): Remove this enum and replace with SeverityLevel
6321
+ */
6322
+ var Severity;
6323
+ (function (Severity) {
6324
+ /** JSDoc */
6325
+ Severity["Fatal"] = "fatal";
6326
+ /** JSDoc */
6327
+ Severity["Error"] = "error";
6328
+ /** JSDoc */
6329
+ Severity["Warning"] = "warning";
6330
+ /** JSDoc */
6331
+ Severity["Log"] = "log";
6332
+ /** JSDoc */
6333
+ Severity["Info"] = "info";
6334
+ /** JSDoc */
6335
+ Severity["Debug"] = "debug";
6336
+ /** JSDoc */
6337
+ Severity["Critical"] = "critical";
6338
+ })(Severity || (Severity = {}));
6339
+ // TODO: in v7, these can disappear, because they now also exist in `@sentry/utils`. (Having them there rather than here
6340
+ // is nice because then it enforces the idea that only types are exported from `@sentry/types`.)
6341
+ var SeverityLevels = (/* unused pure expression or super */ null && (['fatal', 'error', 'warning', 'log', 'info', 'debug', 'critical']));
6342
+ //# sourceMappingURL=severity.js.map
6343
+
6344
+ /***/ }),
6345
+
6346
+ /***/ 3518:
6347
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6348
+
6349
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6350
+ /* harmony export */ "I": function() { return /* binding */ forget; }
6351
+ /* harmony export */ });
6352
+ /**
6353
+ * Consumes the promise and logs the error when it rejects.
6354
+ * @param promise A promise to forget.
6355
+ */
6356
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6357
+ function forget(promise) {
6358
+ void promise.then(null, function (e) {
6359
+ // TODO: Use a better logging mechanism
6360
+ // eslint-disable-next-line no-console
6361
+ console.error(e);
6362
+ });
6363
+ }
6364
+ //# sourceMappingURL=async.js.map
6365
+
6366
+ /***/ }),
6367
+
6368
+ /***/ 4194:
6369
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6370
+
6371
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6372
+ /* harmony export */ "R": function() { return /* binding */ htmlTreeAsString; },
6373
+ /* harmony export */ "l": function() { return /* binding */ getLocationHref; }
6374
+ /* harmony export */ });
6375
+ /* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5907);
6376
+ /* harmony import */ var _is__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1757);
6377
+
6378
+
6379
+ /**
6380
+ * Given a child DOM element, returns a query-selector statement describing that
6381
+ * and its ancestors
6382
+ * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]
6383
+ * @returns generated DOM path
6384
+ */
6385
+ function htmlTreeAsString(elem, keyAttrs) {
6386
+ // try/catch both:
6387
+ // - accessing event.target (see getsentry/raven-js#838, #768)
6388
+ // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly
6389
+ // - can throw an exception in some circumstances.
6390
+ try {
6391
+ var currentElem = elem;
6392
+ var MAX_TRAVERSE_HEIGHT = 5;
6393
+ var MAX_OUTPUT_LEN = 80;
6394
+ var out = [];
6395
+ var height = 0;
6396
+ var len = 0;
6397
+ var separator = ' > ';
6398
+ var sepLength = separator.length;
6399
+ var nextStr = void 0;
6400
+ // eslint-disable-next-line no-plusplus
6401
+ while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) {
6402
+ nextStr = _htmlElementAsString(currentElem, keyAttrs);
6403
+ // bail out if
6404
+ // - nextStr is the 'html' element
6405
+ // - the length of the string that would be created exceeds MAX_OUTPUT_LEN
6406
+ // (ignore this limit if we are on the first iteration)
6407
+ if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN)) {
6408
+ break;
6409
+ }
6410
+ out.push(nextStr);
6411
+ len += nextStr.length;
6412
+ currentElem = currentElem.parentNode;
6413
+ }
6414
+ return out.reverse().join(separator);
6415
+ }
6416
+ catch (_oO) {
6417
+ return '<unknown>';
6418
+ }
6419
+ }
6420
+ /**
6421
+ * Returns a simple, query-selector representation of a DOM element
6422
+ * e.g. [HTMLElement] => input#foo.btn[name=baz]
6423
+ * @returns generated DOM path
6424
+ */
6425
+ function _htmlElementAsString(el, keyAttrs) {
6426
+ var elem = el;
6427
+ var out = [];
6428
+ var className;
6429
+ var classes;
6430
+ var key;
6431
+ var attr;
6432
+ var i;
6433
+ if (!elem || !elem.tagName) {
6434
+ return '';
6435
+ }
6436
+ out.push(elem.tagName.toLowerCase());
6437
+ // Pairs of attribute keys defined in `serializeAttribute` and their values on element.
6438
+ var keyAttrPairs = keyAttrs && keyAttrs.length
6439
+ ? keyAttrs.filter(function (keyAttr) { return elem.getAttribute(keyAttr); }).map(function (keyAttr) { return [keyAttr, elem.getAttribute(keyAttr)]; })
6440
+ : null;
6441
+ if (keyAttrPairs && keyAttrPairs.length) {
6442
+ keyAttrPairs.forEach(function (keyAttrPair) {
6443
+ out.push("[" + keyAttrPair[0] + "=\"" + keyAttrPair[1] + "\"]");
6444
+ });
6445
+ }
6446
+ else {
6447
+ if (elem.id) {
6448
+ out.push("#" + elem.id);
6449
+ }
6450
+ // eslint-disable-next-line prefer-const
6451
+ className = elem.className;
6452
+ if (className && (0,_is__WEBPACK_IMPORTED_MODULE_0__/* .isString */ .HD)(className)) {
6453
+ classes = className.split(/\s+/);
6454
+ for (i = 0; i < classes.length; i++) {
6455
+ out.push("." + classes[i]);
6456
+ }
6457
+ }
6458
+ }
6459
+ var allowedAttrs = ['type', 'name', 'title', 'alt'];
6460
+ for (i = 0; i < allowedAttrs.length; i++) {
6461
+ key = allowedAttrs[i];
6462
+ attr = elem.getAttribute(key);
6463
+ if (attr) {
6464
+ out.push("[" + key + "=\"" + attr + "\"]");
6465
+ }
6466
+ }
6467
+ return out.join('');
6468
+ }
6469
+ /**
6470
+ * A safe form of location.href
6471
+ */
6472
+ function getLocationHref() {
6473
+ var global = (0,_global__WEBPACK_IMPORTED_MODULE_1__/* .getGlobalObject */ .R)();
6474
+ try {
6475
+ return global.document.location.href;
6476
+ }
6477
+ catch (oO) {
6478
+ return '';
6479
+ }
6480
+ }
6481
+ //# sourceMappingURL=browser.js.map
6482
+
6483
+ /***/ }),
6484
+
6485
+ /***/ 250:
6486
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6487
+
6488
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6489
+ /* harmony export */ "y": function() { return /* binding */ createClientReportEnvelope; }
6490
+ /* harmony export */ });
6491
+ /* harmony import */ var _envelope__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6894);
6492
+ /* harmony import */ var _time__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7790);
6493
+
6494
+
6495
+ /**
6496
+ * Creates client report envelope
6497
+ * @param discarded_events An array of discard events
6498
+ * @param dsn A DSN that can be set on the header. Optional.
6499
+ */
6500
+ function createClientReportEnvelope(discarded_events, dsn, timestamp) {
6501
+ var clientReportItem = [
6502
+ { type: 'client_report' },
6503
+ {
6504
+ timestamp: timestamp || (0,_time__WEBPACK_IMPORTED_MODULE_0__/* .dateTimestampInSeconds */ .yW)(),
6505
+ discarded_events: discarded_events,
6506
+ },
6507
+ ];
6508
+ return (0,_envelope__WEBPACK_IMPORTED_MODULE_1__/* .createEnvelope */ .Jd)(dsn ? { dsn: dsn } : {}, [clientReportItem]);
6509
+ }
6510
+ //# sourceMappingURL=clientreport.js.map
6511
+
6512
+ /***/ }),
6513
+
6514
+ /***/ 3135:
6515
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6516
+
6517
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6518
+ /* harmony export */ "R": function() { return /* binding */ dsnToString; },
6519
+ /* harmony export */ "v": function() { return /* binding */ makeDsn; }
6520
+ /* harmony export */ });
6521
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4715);
6522
+ /* harmony import */ var _error__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4388);
6523
+ /* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1923);
6524
+
6525
+
6526
+
6527
+ /** Regular expression used to parse a Dsn. */
6528
+ var DSN_REGEX = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w.-]+)(?::(\d+))?\/(.+)/;
6529
+ function isValidProtocol(protocol) {
6530
+ return protocol === 'http' || protocol === 'https';
6531
+ }
6532
+ /**
6533
+ * Renders the string representation of this Dsn.
6534
+ *
6535
+ * By default, this will render the public representation without the password
6536
+ * component. To get the deprecated private representation, set `withPassword`
6537
+ * to true.
6538
+ *
6539
+ * @param withPassword When set to true, the password will be included.
6540
+ */
6541
+ function dsnToString(dsn, withPassword) {
6542
+ if (withPassword === void 0) { withPassword = false; }
6543
+ var host = dsn.host, path = dsn.path, pass = dsn.pass, port = dsn.port, projectId = dsn.projectId, protocol = dsn.protocol, publicKey = dsn.publicKey;
6544
+ return (protocol + "://" + publicKey + (withPassword && pass ? ":" + pass : '') +
6545
+ ("@" + host + (port ? ":" + port : '') + "/" + (path ? path + "/" : path) + projectId));
6546
+ }
6547
+ function dsnFromString(str) {
6548
+ var match = DSN_REGEX.exec(str);
6549
+ if (!match) {
6550
+ throw new _error__WEBPACK_IMPORTED_MODULE_0__/* .SentryError */ .b("Invalid Sentry Dsn: " + str);
6551
+ }
6552
+ var _a = (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__read */ .CR)(match.slice(1), 6), protocol = _a[0], publicKey = _a[1], _b = _a[2], pass = _b === void 0 ? '' : _b, host = _a[3], _c = _a[4], port = _c === void 0 ? '' : _c, lastPath = _a[5];
6553
+ var path = '';
6554
+ var projectId = lastPath;
6555
+ var split = projectId.split('/');
6556
+ if (split.length > 1) {
6557
+ path = split.slice(0, -1).join('/');
6558
+ projectId = split.pop();
6559
+ }
6560
+ if (projectId) {
6561
+ var projectMatch = projectId.match(/^\d+/);
6562
+ if (projectMatch) {
6563
+ projectId = projectMatch[0];
6564
+ }
6565
+ }
6566
+ return dsnFromComponents({ host: host, pass: pass, path: path, projectId: projectId, port: port, protocol: protocol, publicKey: publicKey });
6567
+ }
6568
+ function dsnFromComponents(components) {
6569
+ // TODO this is for backwards compatibility, and can be removed in a future version
6570
+ if ('user' in components && !('publicKey' in components)) {
6571
+ components.publicKey = components.user;
6572
+ }
6573
+ return {
6574
+ user: components.publicKey || '',
6575
+ protocol: components.protocol,
6576
+ publicKey: components.publicKey || '',
6577
+ pass: components.pass || '',
6578
+ host: components.host,
6579
+ port: components.port || '',
6580
+ path: components.path || '',
6581
+ projectId: components.projectId,
6582
+ };
6583
+ }
6584
+ function validateDsn(dsn) {
6585
+ if (!_flags__WEBPACK_IMPORTED_MODULE_2__/* .IS_DEBUG_BUILD */ .h) {
6586
+ return;
6587
+ }
6588
+ var port = dsn.port, projectId = dsn.projectId, protocol = dsn.protocol;
6589
+ var requiredComponents = ['protocol', 'publicKey', 'host', 'projectId'];
6590
+ requiredComponents.forEach(function (component) {
6591
+ if (!dsn[component]) {
6592
+ throw new _error__WEBPACK_IMPORTED_MODULE_0__/* .SentryError */ .b("Invalid Sentry Dsn: " + component + " missing");
6593
+ }
6594
+ });
6595
+ if (!projectId.match(/^\d+$/)) {
6596
+ throw new _error__WEBPACK_IMPORTED_MODULE_0__/* .SentryError */ .b("Invalid Sentry Dsn: Invalid projectId " + projectId);
6597
+ }
6598
+ if (!isValidProtocol(protocol)) {
6599
+ throw new _error__WEBPACK_IMPORTED_MODULE_0__/* .SentryError */ .b("Invalid Sentry Dsn: Invalid protocol " + protocol);
6600
+ }
6601
+ if (port && isNaN(parseInt(port, 10))) {
6602
+ throw new _error__WEBPACK_IMPORTED_MODULE_0__/* .SentryError */ .b("Invalid Sentry Dsn: Invalid port " + port);
6603
+ }
6604
+ return true;
6605
+ }
6606
+ /** The Sentry Dsn, identifying a Sentry instance and project. */
6607
+ function makeDsn(from) {
6608
+ var components = typeof from === 'string' ? dsnFromString(from) : dsnFromComponents(from);
6609
+ validateDsn(components);
6610
+ return components;
6611
+ }
6612
+ //# sourceMappingURL=dsn.js.map
6613
+
6614
+ /***/ }),
6615
+
6616
+ /***/ 6872:
6617
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6618
+
6619
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6620
+ /* harmony export */ "a": function() { return /* binding */ SeverityLevels; }
6621
+ /* harmony export */ });
6622
+ var SeverityLevels = ['fatal', 'error', 'warning', 'log', 'info', 'debug', 'critical'];
6623
+ //# sourceMappingURL=enums.js.map
6624
+
6625
+ /***/ }),
6626
+
6627
+ /***/ 4285:
6628
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6629
+
6630
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6631
+ /* harmony export */ "n": function() { return /* binding */ isBrowserBundle; }
6632
+ /* harmony export */ });
6633
+ /*
6634
+ * This module exists for optimizations in the build process through rollup and terser. We define some global
6635
+ * constants, which can be overridden during build. By guarding certain pieces of code with functions that return these
6636
+ * constants, we can control whether or not they appear in the final bundle. (Any code guarded by a false condition will
6637
+ * never run, and will hence be dropped during treeshaking.) The two primary uses for this are stripping out calls to
6638
+ * `logger` and preventing node-related code from appearing in browser bundles.
6639
+ *
6640
+ * Attention:
6641
+ * This file should not be used to define constants/flags that are intended to be used for tree-shaking conducted by
6642
+ * users. These fags should live in their respective packages, as we identified user tooling (specifically webpack)
6643
+ * having issues tree-shaking these constants across package boundaries.
6644
+ * An example for this is the __SENTRY_DEBUG__ constant. It is declared in each package individually because we want
6645
+ * users to be able to shake away expressions that it guards.
6646
+ */
6647
+ /**
6648
+ * Figures out if we're building a browser bundle.
6649
+ *
6650
+ * @returns true if this is a browser bundle build.
6651
+ */
6652
+ function isBrowserBundle() {
6653
+ return typeof __SENTRY_BROWSER_BUNDLE__ !== 'undefined' && !!__SENTRY_BROWSER_BUNDLE__;
6654
+ }
6655
+ //# sourceMappingURL=env.js.map
6656
+
6657
+ /***/ }),
6658
+
6659
+ /***/ 6894:
6660
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6661
+
6662
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6663
+ /* harmony export */ "Jd": function() { return /* binding */ createEnvelope; },
6664
+ /* harmony export */ "y7": function() { return /* binding */ getEnvelopeType; },
6665
+ /* harmony export */ "V$": function() { return /* binding */ serializeEnvelope; }
6666
+ /* harmony export */ });
6667
+ /* unused harmony export addItemToEnvelope */
6668
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4715);
6669
+ /* harmony import */ var _is__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1757);
6670
+
6671
+
6672
+ /**
6673
+ * Creates an envelope.
6674
+ * Make sure to always explicitly provide the generic to this function
6675
+ * so that the envelope types resolve correctly.
6676
+ */
6677
+ function createEnvelope(headers, items) {
6678
+ if (items === void 0) { items = []; }
6679
+ return [headers, items];
6680
+ }
6681
+ /**
6682
+ * Add an item to an envelope.
6683
+ * Make sure to always explicitly provide the generic to this function
6684
+ * so that the envelope types resolve correctly.
6685
+ */
6686
+ function addItemToEnvelope(envelope, newItem) {
6687
+ var _a = __read(envelope, 2), headers = _a[0], items = _a[1];
6688
+ return [headers, __spread(items, [newItem])];
6689
+ }
6690
+ /**
6691
+ * Get the type of the envelope. Grabs the type from the first envelope item.
6692
+ */
6693
+ function getEnvelopeType(envelope) {
6694
+ var _a = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__read */ .CR)(envelope, 2), _b = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__read */ .CR)(_a[1], 1), _c = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__read */ .CR)(_b[0], 1), firstItemHeader = _c[0];
6695
+ return firstItemHeader.type;
6696
+ }
6697
+ /**
6698
+ * Serializes an envelope into a string.
6699
+ */
6700
+ function serializeEnvelope(envelope) {
6701
+ var _a = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__read */ .CR)(envelope, 2), headers = _a[0], items = _a[1];
6702
+ var serializedHeaders = JSON.stringify(headers);
6703
+ // Have to cast items to any here since Envelope is a union type
6704
+ // Fixed in Typescript 4.2
6705
+ // TODO: Remove any[] cast when we upgrade to TS 4.2
6706
+ // https://github.com/microsoft/TypeScript/issues/36390
6707
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6708
+ return items.reduce(function (acc, item) {
6709
+ var _a = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__read */ .CR)(item, 2), itemHeaders = _a[0], payload = _a[1];
6710
+ // We do not serialize payloads that are primitives
6711
+ var serializedPayload = (0,_is__WEBPACK_IMPORTED_MODULE_1__/* .isPrimitive */ .pt)(payload) ? String(payload) : JSON.stringify(payload);
6712
+ return acc + "\n" + JSON.stringify(itemHeaders) + "\n" + serializedPayload;
6713
+ }, serializedHeaders);
6714
+ }
6715
+ //# sourceMappingURL=envelope.js.map
6716
+
6717
+ /***/ }),
6718
+
6719
+ /***/ 4388:
6720
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6721
+
6722
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6723
+ /* harmony export */ "b": function() { return /* binding */ SentryError; }
6724
+ /* harmony export */ });
6725
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4715);
6726
+ /* harmony import */ var _polyfill__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(467);
6727
+
6728
+
6729
+ /** An error emitted by Sentry SDKs and related utilities. */
6730
+ var SentryError = /** @class */ (function (_super) {
6731
+ (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__extends */ .ZT)(SentryError, _super);
6732
+ function SentryError(message) {
6733
+ var _newTarget = this.constructor;
6734
+ var _this = _super.call(this, message) || this;
6735
+ _this.message = message;
6736
+ _this.name = _newTarget.prototype.constructor.name;
6737
+ (0,_polyfill__WEBPACK_IMPORTED_MODULE_1__/* .setPrototypeOf */ .f)(_this, _newTarget.prototype);
6738
+ return _this;
6739
+ }
6740
+ return SentryError;
6741
+ }(Error));
6742
+
6743
+ //# sourceMappingURL=error.js.map
6744
+
6745
+ /***/ }),
6746
+
6747
+ /***/ 1923:
6748
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6749
+
6750
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6751
+ /* harmony export */ "h": function() { return /* binding */ IS_DEBUG_BUILD; }
6752
+ /* harmony export */ });
6753
+ /*
6754
+ * This file defines flags and constants that can be modified during compile time in order to facilitate tree shaking
6755
+ * for users.
6756
+ *
6757
+ * Debug flags need to be declared in each package individually and must not be imported across package boundaries,
6758
+ * because some build tools have trouble tree-shaking imported guards.
6759
+ *
6760
+ * As a convention, we define debug flags in a `flags.ts` file in the root of a package's `src` folder.
6761
+ *
6762
+ * Debug flag files will contain "magic strings" like `__SENTRY_DEBUG__` that may get replaced with actual values during
6763
+ * our, or the user's build process. Take care when introducing new flags - they must not throw if they are not
6764
+ * replaced.
6765
+ */
6766
+ /** Flag that is true for debug builds, false otherwise. */
6767
+ var IS_DEBUG_BUILD = typeof __SENTRY_DEBUG__ === 'undefined' ? true : __SENTRY_DEBUG__;
6768
+ //# sourceMappingURL=flags.js.map
6769
+
6770
+ /***/ }),
6771
+
6772
+ /***/ 5907:
6773
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6774
+
6775
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6776
+ /* harmony export */ "R": function() { return /* binding */ getGlobalObject; },
6777
+ /* harmony export */ "Y": function() { return /* binding */ getGlobalSingleton; }
6778
+ /* harmony export */ });
6779
+ /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7392);
6780
+ /**
6781
+ * NOTE: In order to avoid circular dependencies, if you add a function to this module and it needs to print something,
6782
+ * you must either a) use `console.log` rather than the logger, or b) put your function elsewhere.
6783
+ */
6784
+
6785
+ var fallbackGlobalObject = {};
6786
+ /**
6787
+ * Safely get global scope object
6788
+ *
6789
+ * @returns Global scope object
6790
+ */
6791
+ function getGlobalObject() {
6792
+ return ((0,_node__WEBPACK_IMPORTED_MODULE_0__/* .isNodeEnv */ .KV)()
6793
+ ? window
6794
+ : typeof window !== 'undefined' // eslint-disable-line no-restricted-globals
6795
+ ? window // eslint-disable-line no-restricted-globals
6796
+ : typeof self !== 'undefined'
6797
+ ? self
6798
+ : fallbackGlobalObject);
6799
+ }
6800
+ /**
6801
+ * Returns a global singleton contained in the global `__SENTRY__` object.
6802
+ *
6803
+ * If the singleton doesn't already exist in `__SENTRY__`, it will be created using the given factory
6804
+ * function and added to the `__SENTRY__` object.
6805
+ *
6806
+ * @param name name of the global singleton on __SENTRY__
6807
+ * @param creator creator Factory function to create the singleton if it doesn't already exist on `__SENTRY__`
6808
+ * @param obj (Optional) The global object on which to look for `__SENTRY__`, if not `getGlobalObject`'s return value
6809
+ * @returns the singleton
6810
+ */
6811
+ function getGlobalSingleton(name, creator, obj) {
6812
+ var global = (obj || getGlobalObject());
6813
+ var __SENTRY__ = (global.__SENTRY__ = global.__SENTRY__ || {});
6814
+ var singleton = __SENTRY__[name] || (__SENTRY__[name] = creator());
6815
+ return singleton;
6816
+ }
6817
+ //# sourceMappingURL=global.js.map
6818
+
6819
+ /***/ }),
6820
+
6821
+ /***/ 4005:
6822
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6823
+
6824
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6825
+ /* harmony export */ "o": function() { return /* binding */ addInstrumentationHandler; }
6826
+ /* harmony export */ });
6827
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4715);
6828
+ /* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1923);
6829
+ /* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5907);
6830
+ /* harmony import */ var _is__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1757);
6831
+ /* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8536);
6832
+ /* harmony import */ var _object__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1995);
6833
+ /* harmony import */ var _stacktrace__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9038);
6834
+ /* harmony import */ var _supports__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(9798);
6835
+
6836
+
6837
+
6838
+
6839
+
6840
+
6841
+
6842
+
6843
+ var global = (0,_global__WEBPACK_IMPORTED_MODULE_0__/* .getGlobalObject */ .R)();
6844
+ /**
6845
+ * Instrument native APIs to call handlers that can be used to create breadcrumbs, APM spans etc.
6846
+ * - Console API
6847
+ * - Fetch API
6848
+ * - XHR API
6849
+ * - History API
6850
+ * - DOM API (click/typing)
6851
+ * - Error API
6852
+ * - UnhandledRejection API
6853
+ */
6854
+ var handlers = {};
6855
+ var instrumented = {};
6856
+ /** Instruments given API */
6857
+ function instrument(type) {
6858
+ if (instrumented[type]) {
6859
+ return;
6860
+ }
6861
+ instrumented[type] = true;
6862
+ switch (type) {
6863
+ case 'console':
6864
+ instrumentConsole();
6865
+ break;
6866
+ case 'dom':
6867
+ instrumentDOM();
6868
+ break;
6869
+ case 'xhr':
6870
+ instrumentXHR();
6871
+ break;
6872
+ case 'fetch':
6873
+ instrumentFetch();
6874
+ break;
6875
+ case 'history':
6876
+ instrumentHistory();
6877
+ break;
6878
+ case 'error':
6879
+ instrumentError();
6880
+ break;
6881
+ case 'unhandledrejection':
6882
+ instrumentUnhandledRejection();
6883
+ break;
6884
+ default:
6885
+ _flags__WEBPACK_IMPORTED_MODULE_1__/* .IS_DEBUG_BUILD */ .h && _logger__WEBPACK_IMPORTED_MODULE_2__/* .logger.warn */ .kg.warn('unknown instrumentation type:', type);
6886
+ return;
6887
+ }
6888
+ }
6889
+ /**
6890
+ * Add handler that will be called when given type of instrumentation triggers.
6891
+ * Use at your own risk, this might break without changelog notice, only used internally.
6892
+ * @hidden
6893
+ */
6894
+ function addInstrumentationHandler(type, callback) {
6895
+ handlers[type] = handlers[type] || [];
6896
+ handlers[type].push(callback);
6897
+ instrument(type);
6898
+ }
6899
+ /** JSDoc */
6900
+ function triggerHandlers(type, data) {
6901
+ var e_1, _a;
6902
+ if (!type || !handlers[type]) {
6903
+ return;
6904
+ }
6905
+ try {
6906
+ for (var _b = (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__values */ .XA)(handlers[type] || []), _c = _b.next(); !_c.done; _c = _b.next()) {
6907
+ var handler = _c.value;
6908
+ try {
6909
+ handler(data);
6910
+ }
6911
+ catch (e) {
6912
+ _flags__WEBPACK_IMPORTED_MODULE_1__/* .IS_DEBUG_BUILD */ .h &&
6913
+ _logger__WEBPACK_IMPORTED_MODULE_2__/* .logger.error */ .kg.error("Error while triggering instrumentation handler.\nType: " + type + "\nName: " + (0,_stacktrace__WEBPACK_IMPORTED_MODULE_4__/* .getFunctionName */ .$P)(handler) + "\nError:", e);
6914
+ }
6915
+ }
6916
+ }
6917
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
6918
+ finally {
6919
+ try {
6920
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
6921
+ }
6922
+ finally { if (e_1) throw e_1.error; }
6923
+ }
6924
+ }
6925
+ /** JSDoc */
6926
+ function instrumentConsole() {
6927
+ if (!('console' in global)) {
6928
+ return;
6929
+ }
6930
+ _logger__WEBPACK_IMPORTED_MODULE_2__/* .CONSOLE_LEVELS.forEach */ .RU.forEach(function (level) {
6931
+ if (!(level in global.console)) {
6932
+ return;
6933
+ }
6934
+ (0,_object__WEBPACK_IMPORTED_MODULE_5__/* .fill */ .hl)(global.console, level, function (originalConsoleMethod) {
6935
+ return function () {
6936
+ var args = [];
6937
+ for (var _i = 0; _i < arguments.length; _i++) {
6938
+ args[_i] = arguments[_i];
6939
+ }
6940
+ triggerHandlers('console', { args: args, level: level });
6941
+ // this fails for some browsers. :(
6942
+ if (originalConsoleMethod) {
6943
+ originalConsoleMethod.apply(global.console, args);
6944
+ }
6945
+ };
6946
+ });
6947
+ });
6948
+ }
6949
+ /** JSDoc */
6950
+ function instrumentFetch() {
6951
+ if (!(0,_supports__WEBPACK_IMPORTED_MODULE_6__/* .supportsNativeFetch */ .t$)()) {
6952
+ return;
6953
+ }
6954
+ (0,_object__WEBPACK_IMPORTED_MODULE_5__/* .fill */ .hl)(global, 'fetch', function (originalFetch) {
6955
+ return function () {
6956
+ var args = [];
6957
+ for (var _i = 0; _i < arguments.length; _i++) {
6958
+ args[_i] = arguments[_i];
6959
+ }
6960
+ var handlerData = {
6961
+ args: args,
6962
+ fetchData: {
6963
+ method: getFetchMethod(args),
6964
+ url: getFetchUrl(args),
6965
+ },
6966
+ startTimestamp: Date.now(),
6967
+ };
6968
+ triggerHandlers('fetch', (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__assign */ .pi)({}, handlerData));
6969
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
6970
+ return originalFetch.apply(global, args).then(function (response) {
6971
+ triggerHandlers('fetch', (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__assign */ .pi)({}, handlerData), { endTimestamp: Date.now(), response: response }));
6972
+ return response;
6973
+ }, function (error) {
6974
+ triggerHandlers('fetch', (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__assign */ .pi)({}, handlerData), { endTimestamp: Date.now(), error: error }));
6975
+ // NOTE: If you are a Sentry user, and you are seeing this stack frame,
6976
+ // it means the sentry.javascript SDK caught an error invoking your application code.
6977
+ // This is expected behavior and NOT indicative of a bug with sentry.javascript.
6978
+ throw error;
6979
+ });
6980
+ };
6981
+ });
6982
+ }
6983
+ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
6984
+ /** Extract `method` from fetch call arguments */
6985
+ function getFetchMethod(fetchArgs) {
6986
+ if (fetchArgs === void 0) { fetchArgs = []; }
6987
+ if ('Request' in global && (0,_is__WEBPACK_IMPORTED_MODULE_7__/* .isInstanceOf */ .V9)(fetchArgs[0], Request) && fetchArgs[0].method) {
6988
+ return String(fetchArgs[0].method).toUpperCase();
6989
+ }
6990
+ if (fetchArgs[1] && fetchArgs[1].method) {
6991
+ return String(fetchArgs[1].method).toUpperCase();
6992
+ }
6993
+ return 'GET';
6994
+ }
6995
+ /** Extract `url` from fetch call arguments */
6996
+ function getFetchUrl(fetchArgs) {
6997
+ if (fetchArgs === void 0) { fetchArgs = []; }
6998
+ if (typeof fetchArgs[0] === 'string') {
6999
+ return fetchArgs[0];
7000
+ }
7001
+ if ('Request' in global && (0,_is__WEBPACK_IMPORTED_MODULE_7__/* .isInstanceOf */ .V9)(fetchArgs[0], Request)) {
7002
+ return fetchArgs[0].url;
7003
+ }
7004
+ return String(fetchArgs[0]);
7005
+ }
7006
+ /* eslint-enable @typescript-eslint/no-unsafe-member-access */
7007
+ /** JSDoc */
7008
+ function instrumentXHR() {
7009
+ if (!('XMLHttpRequest' in global)) {
7010
+ return;
7011
+ }
7012
+ var xhrproto = XMLHttpRequest.prototype;
7013
+ (0,_object__WEBPACK_IMPORTED_MODULE_5__/* .fill */ .hl)(xhrproto, 'open', function (originalOpen) {
7014
+ return function () {
7015
+ var args = [];
7016
+ for (var _i = 0; _i < arguments.length; _i++) {
7017
+ args[_i] = arguments[_i];
7018
+ }
7019
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
7020
+ var xhr = this;
7021
+ var url = args[1];
7022
+ var xhrInfo = (xhr.__sentry_xhr__ = {
7023
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
7024
+ method: (0,_is__WEBPACK_IMPORTED_MODULE_7__/* .isString */ .HD)(args[0]) ? args[0].toUpperCase() : args[0],
7025
+ url: args[1],
7026
+ });
7027
+ // if Sentry key appears in URL, don't capture it as a request
7028
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
7029
+ if ((0,_is__WEBPACK_IMPORTED_MODULE_7__/* .isString */ .HD)(url) && xhrInfo.method === 'POST' && url.match(/sentry_key/)) {
7030
+ xhr.__sentry_own_request__ = true;
7031
+ }
7032
+ var onreadystatechangeHandler = function () {
7033
+ if (xhr.readyState === 4) {
7034
+ try {
7035
+ // touching statusCode in some platforms throws
7036
+ // an exception
7037
+ xhrInfo.status_code = xhr.status;
7038
+ }
7039
+ catch (e) {
7040
+ /* do nothing */
7041
+ }
7042
+ triggerHandlers('xhr', {
7043
+ args: args,
7044
+ endTimestamp: Date.now(),
7045
+ startTimestamp: Date.now(),
7046
+ xhr: xhr,
7047
+ });
7048
+ }
7049
+ };
7050
+ if ('onreadystatechange' in xhr && typeof xhr.onreadystatechange === 'function') {
7051
+ (0,_object__WEBPACK_IMPORTED_MODULE_5__/* .fill */ .hl)(xhr, 'onreadystatechange', function (original) {
7052
+ return function () {
7053
+ var readyStateArgs = [];
7054
+ for (var _i = 0; _i < arguments.length; _i++) {
7055
+ readyStateArgs[_i] = arguments[_i];
7056
+ }
7057
+ onreadystatechangeHandler();
7058
+ return original.apply(xhr, readyStateArgs);
7059
+ };
7060
+ });
7061
+ }
7062
+ else {
7063
+ xhr.addEventListener('readystatechange', onreadystatechangeHandler);
7064
+ }
7065
+ return originalOpen.apply(xhr, args);
7066
+ };
7067
+ });
7068
+ (0,_object__WEBPACK_IMPORTED_MODULE_5__/* .fill */ .hl)(xhrproto, 'send', function (originalSend) {
7069
+ return function () {
7070
+ var args = [];
7071
+ for (var _i = 0; _i < arguments.length; _i++) {
7072
+ args[_i] = arguments[_i];
7073
+ }
7074
+ if (this.__sentry_xhr__ && args[0] !== undefined) {
7075
+ this.__sentry_xhr__.body = args[0];
7076
+ }
7077
+ triggerHandlers('xhr', {
7078
+ args: args,
7079
+ startTimestamp: Date.now(),
7080
+ xhr: this,
7081
+ });
7082
+ return originalSend.apply(this, args);
7083
+ };
7084
+ });
7085
+ }
7086
+ var lastHref;
7087
+ /** JSDoc */
7088
+ function instrumentHistory() {
7089
+ if (!(0,_supports__WEBPACK_IMPORTED_MODULE_6__/* .supportsHistory */ .Bf)()) {
7090
+ return;
7091
+ }
7092
+ var oldOnPopState = global.onpopstate;
7093
+ global.onpopstate = function () {
7094
+ var args = [];
7095
+ for (var _i = 0; _i < arguments.length; _i++) {
7096
+ args[_i] = arguments[_i];
7097
+ }
7098
+ var to = global.location.href;
7099
+ // keep track of the current URL state, as we always receive only the updated state
7100
+ var from = lastHref;
7101
+ lastHref = to;
7102
+ triggerHandlers('history', {
7103
+ from: from,
7104
+ to: to,
7105
+ });
7106
+ if (oldOnPopState) {
7107
+ // Apparently this can throw in Firefox when incorrectly implemented plugin is installed.
7108
+ // https://github.com/getsentry/sentry-javascript/issues/3344
7109
+ // https://github.com/bugsnag/bugsnag-js/issues/469
7110
+ try {
7111
+ return oldOnPopState.apply(this, args);
7112
+ }
7113
+ catch (_oO) {
7114
+ // no-empty
7115
+ }
7116
+ }
7117
+ };
7118
+ /** @hidden */
7119
+ function historyReplacementFunction(originalHistoryFunction) {
7120
+ return function () {
7121
+ var args = [];
7122
+ for (var _i = 0; _i < arguments.length; _i++) {
7123
+ args[_i] = arguments[_i];
7124
+ }
7125
+ var url = args.length > 2 ? args[2] : undefined;
7126
+ if (url) {
7127
+ // coerce to string (this is what pushState does)
7128
+ var from = lastHref;
7129
+ var to = String(url);
7130
+ // keep track of the current URL state, as we always receive only the updated state
7131
+ lastHref = to;
7132
+ triggerHandlers('history', {
7133
+ from: from,
7134
+ to: to,
7135
+ });
7136
+ }
7137
+ return originalHistoryFunction.apply(this, args);
7138
+ };
7139
+ }
7140
+ (0,_object__WEBPACK_IMPORTED_MODULE_5__/* .fill */ .hl)(global.history, 'pushState', historyReplacementFunction);
7141
+ (0,_object__WEBPACK_IMPORTED_MODULE_5__/* .fill */ .hl)(global.history, 'replaceState', historyReplacementFunction);
7142
+ }
7143
+ var debounceDuration = 1000;
7144
+ var debounceTimerID;
7145
+ var lastCapturedEvent;
7146
+ /**
7147
+ * Decide whether the current event should finish the debounce of previously captured one.
7148
+ * @param previous previously captured event
7149
+ * @param current event to be captured
7150
+ */
7151
+ function shouldShortcircuitPreviousDebounce(previous, current) {
7152
+ // If there was no previous event, it should always be swapped for the new one.
7153
+ if (!previous) {
7154
+ return true;
7155
+ }
7156
+ // If both events have different type, then user definitely performed two separate actions. e.g. click + keypress.
7157
+ if (previous.type !== current.type) {
7158
+ return true;
7159
+ }
7160
+ try {
7161
+ // If both events have the same type, it's still possible that actions were performed on different targets.
7162
+ // e.g. 2 clicks on different buttons.
7163
+ if (previous.target !== current.target) {
7164
+ return true;
7165
+ }
7166
+ }
7167
+ catch (e) {
7168
+ // just accessing `target` property can throw an exception in some rare circumstances
7169
+ // see: https://github.com/getsentry/sentry-javascript/issues/838
7170
+ }
7171
+ // If both events have the same type _and_ same `target` (an element which triggered an event, _not necessarily_
7172
+ // to which an event listener was attached), we treat them as the same action, as we want to capture
7173
+ // only one breadcrumb. e.g. multiple clicks on the same button, or typing inside a user input box.
7174
+ return false;
7175
+ }
7176
+ /**
7177
+ * Decide whether an event should be captured.
7178
+ * @param event event to be captured
7179
+ */
7180
+ function shouldSkipDOMEvent(event) {
7181
+ // We are only interested in filtering `keypress` events for now.
7182
+ if (event.type !== 'keypress') {
7183
+ return false;
7184
+ }
7185
+ try {
7186
+ var target = event.target;
7187
+ if (!target || !target.tagName) {
7188
+ return true;
7189
+ }
7190
+ // Only consider keypress events on actual input elements. This will disregard keypresses targeting body
7191
+ // e.g.tabbing through elements, hotkeys, etc.
7192
+ if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable) {
7193
+ return false;
7194
+ }
7195
+ }
7196
+ catch (e) {
7197
+ // just accessing `target` property can throw an exception in some rare circumstances
7198
+ // see: https://github.com/getsentry/sentry-javascript/issues/838
7199
+ }
7200
+ return true;
7201
+ }
7202
+ /**
7203
+ * Wraps addEventListener to capture UI breadcrumbs
7204
+ * @param handler function that will be triggered
7205
+ * @param globalListener indicates whether event was captured by the global event listener
7206
+ * @returns wrapped breadcrumb events handler
7207
+ * @hidden
7208
+ */
7209
+ function makeDOMEventHandler(handler, globalListener) {
7210
+ if (globalListener === void 0) { globalListener = false; }
7211
+ return function (event) {
7212
+ // It's possible this handler might trigger multiple times for the same
7213
+ // event (e.g. event propagation through node ancestors).
7214
+ // Ignore if we've already captured that event.
7215
+ if (!event || lastCapturedEvent === event) {
7216
+ return;
7217
+ }
7218
+ // We always want to skip _some_ events.
7219
+ if (shouldSkipDOMEvent(event)) {
7220
+ return;
7221
+ }
7222
+ var name = event.type === 'keypress' ? 'input' : event.type;
7223
+ // If there is no debounce timer, it means that we can safely capture the new event and store it for future comparisons.
7224
+ if (debounceTimerID === undefined) {
7225
+ handler({
7226
+ event: event,
7227
+ name: name,
7228
+ global: globalListener,
7229
+ });
7230
+ lastCapturedEvent = event;
7231
+ }
7232
+ // If there is a debounce awaiting, see if the new event is different enough to treat it as a unique one.
7233
+ // If that's the case, emit the previous event and store locally the newly-captured DOM event.
7234
+ else if (shouldShortcircuitPreviousDebounce(lastCapturedEvent, event)) {
7235
+ handler({
7236
+ event: event,
7237
+ name: name,
7238
+ global: globalListener,
7239
+ });
7240
+ lastCapturedEvent = event;
7241
+ }
7242
+ // Start a new debounce timer that will prevent us from capturing multiple events that should be grouped together.
7243
+ clearTimeout(debounceTimerID);
7244
+ debounceTimerID = global.setTimeout(function () {
7245
+ debounceTimerID = undefined;
7246
+ }, debounceDuration);
7247
+ };
7248
+ }
7249
+ /** JSDoc */
7250
+ function instrumentDOM() {
7251
+ if (!('document' in global)) {
7252
+ return;
7253
+ }
7254
+ // Make it so that any click or keypress that is unhandled / bubbled up all the way to the document triggers our dom
7255
+ // handlers. (Normally we have only one, which captures a breadcrumb for each click or keypress.) Do this before
7256
+ // we instrument `addEventListener` so that we don't end up attaching this handler twice.
7257
+ var triggerDOMHandler = triggerHandlers.bind(null, 'dom');
7258
+ var globalDOMEventHandler = makeDOMEventHandler(triggerDOMHandler, true);
7259
+ global.document.addEventListener('click', globalDOMEventHandler, false);
7260
+ global.document.addEventListener('keypress', globalDOMEventHandler, false);
7261
+ // After hooking into click and keypress events bubbled up to `document`, we also hook into user-handled
7262
+ // clicks & keypresses, by adding an event listener of our own to any element to which they add a listener. That
7263
+ // way, whenever one of their handlers is triggered, ours will be, too. (This is needed because their handler
7264
+ // could potentially prevent the event from bubbling up to our global listeners. This way, our handler are still
7265
+ // guaranteed to fire at least once.)
7266
+ ['EventTarget', 'Node'].forEach(function (target) {
7267
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
7268
+ var proto = global[target] && global[target].prototype;
7269
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins
7270
+ if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {
7271
+ return;
7272
+ }
7273
+ (0,_object__WEBPACK_IMPORTED_MODULE_5__/* .fill */ .hl)(proto, 'addEventListener', function (originalAddEventListener) {
7274
+ return function (type, listener, options) {
7275
+ if (type === 'click' || type == 'keypress') {
7276
+ try {
7277
+ var el = this;
7278
+ var handlers_1 = (el.__sentry_instrumentation_handlers__ = el.__sentry_instrumentation_handlers__ || {});
7279
+ var handlerForType = (handlers_1[type] = handlers_1[type] || { refCount: 0 });
7280
+ if (!handlerForType.handler) {
7281
+ var handler = makeDOMEventHandler(triggerDOMHandler);
7282
+ handlerForType.handler = handler;
7283
+ originalAddEventListener.call(this, type, handler, options);
7284
+ }
7285
+ handlerForType.refCount += 1;
7286
+ }
7287
+ catch (e) {
7288
+ // Accessing dom properties is always fragile.
7289
+ // Also allows us to skip `addEventListenrs` calls with no proper `this` context.
7290
+ }
7291
+ }
7292
+ return originalAddEventListener.call(this, type, listener, options);
7293
+ };
7294
+ });
7295
+ (0,_object__WEBPACK_IMPORTED_MODULE_5__/* .fill */ .hl)(proto, 'removeEventListener', function (originalRemoveEventListener) {
7296
+ return function (type, listener, options) {
7297
+ if (type === 'click' || type == 'keypress') {
7298
+ try {
7299
+ var el = this;
7300
+ var handlers_2 = el.__sentry_instrumentation_handlers__ || {};
7301
+ var handlerForType = handlers_2[type];
7302
+ if (handlerForType) {
7303
+ handlerForType.refCount -= 1;
7304
+ // If there are no longer any custom handlers of the current type on this element, we can remove ours, too.
7305
+ if (handlerForType.refCount <= 0) {
7306
+ originalRemoveEventListener.call(this, type, handlerForType.handler, options);
7307
+ handlerForType.handler = undefined;
7308
+ delete handlers_2[type]; // eslint-disable-line @typescript-eslint/no-dynamic-delete
7309
+ }
7310
+ // If there are no longer any custom handlers of any type on this element, cleanup everything.
7311
+ if (Object.keys(handlers_2).length === 0) {
7312
+ delete el.__sentry_instrumentation_handlers__;
7313
+ }
7314
+ }
7315
+ }
7316
+ catch (e) {
7317
+ // Accessing dom properties is always fragile.
7318
+ // Also allows us to skip `addEventListenrs` calls with no proper `this` context.
7319
+ }
7320
+ }
7321
+ return originalRemoveEventListener.call(this, type, listener, options);
7322
+ };
7323
+ });
7324
+ });
7325
+ }
7326
+ var _oldOnErrorHandler = null;
7327
+ /** JSDoc */
7328
+ function instrumentError() {
7329
+ _oldOnErrorHandler = global.onerror;
7330
+ global.onerror = function (msg, url, line, column, error) {
7331
+ triggerHandlers('error', {
7332
+ column: column,
7333
+ error: error,
7334
+ line: line,
7335
+ msg: msg,
7336
+ url: url,
7337
+ });
7338
+ if (_oldOnErrorHandler) {
7339
+ // eslint-disable-next-line prefer-rest-params
7340
+ return _oldOnErrorHandler.apply(this, arguments);
7341
+ }
7342
+ return false;
7343
+ };
7344
+ }
7345
+ var _oldOnUnhandledRejectionHandler = null;
7346
+ /** JSDoc */
7347
+ function instrumentUnhandledRejection() {
7348
+ _oldOnUnhandledRejectionHandler = global.onunhandledrejection;
7349
+ global.onunhandledrejection = function (e) {
7350
+ triggerHandlers('unhandledrejection', e);
7351
+ if (_oldOnUnhandledRejectionHandler) {
7352
+ // eslint-disable-next-line prefer-rest-params
7353
+ return _oldOnUnhandledRejectionHandler.apply(this, arguments);
7354
+ }
7355
+ return true;
7356
+ };
7357
+ }
7358
+ //# sourceMappingURL=instrument.js.map
7359
+
7360
+ /***/ }),
7361
+
7362
+ /***/ 1757:
7363
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
7364
+
7365
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7366
+ /* harmony export */ "VZ": function() { return /* binding */ isError; },
7367
+ /* harmony export */ "VW": function() { return /* binding */ isErrorEvent; },
7368
+ /* harmony export */ "TX": function() { return /* binding */ isDOMError; },
7369
+ /* harmony export */ "fm": function() { return /* binding */ isDOMException; },
7370
+ /* harmony export */ "HD": function() { return /* binding */ isString; },
7371
+ /* harmony export */ "pt": function() { return /* binding */ isPrimitive; },
7372
+ /* harmony export */ "PO": function() { return /* binding */ isPlainObject; },
7373
+ /* harmony export */ "cO": function() { return /* binding */ isEvent; },
7374
+ /* harmony export */ "kK": function() { return /* binding */ isElement; },
7375
+ /* harmony export */ "Kj": function() { return /* binding */ isRegExp; },
7376
+ /* harmony export */ "J8": function() { return /* binding */ isThenable; },
7377
+ /* harmony export */ "Cy": function() { return /* binding */ isSyntheticEvent; },
7378
+ /* harmony export */ "i2": function() { return /* binding */ isNaN; },
7379
+ /* harmony export */ "V9": function() { return /* binding */ isInstanceOf; }
7380
+ /* harmony export */ });
7381
+ /* eslint-disable @typescript-eslint/no-explicit-any */
7382
+ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */
7383
+ // eslint-disable-next-line @typescript-eslint/unbound-method
7384
+ var objectToString = Object.prototype.toString;
7385
+ /**
7386
+ * Checks whether given value's type is one of a few Error or Error-like
7387
+ * {@link isError}.
7388
+ *
7389
+ * @param wat A value to be checked.
7390
+ * @returns A boolean representing the result.
7391
+ */
7392
+ function isError(wat) {
7393
+ switch (objectToString.call(wat)) {
7394
+ case '[object Error]':
7395
+ case '[object Exception]':
7396
+ case '[object DOMException]':
7397
+ return true;
7398
+ default:
7399
+ return isInstanceOf(wat, Error);
7400
+ }
7401
+ }
7402
+ function isBuiltin(wat, ty) {
7403
+ return objectToString.call(wat) === "[object " + ty + "]";
7404
+ }
7405
+ /**
7406
+ * Checks whether given value's type is ErrorEvent
7407
+ * {@link isErrorEvent}.
7408
+ *
7409
+ * @param wat A value to be checked.
7410
+ * @returns A boolean representing the result.
7411
+ */
7412
+ function isErrorEvent(wat) {
7413
+ return isBuiltin(wat, 'ErrorEvent');
7414
+ }
7415
+ /**
7416
+ * Checks whether given value's type is DOMError
7417
+ * {@link isDOMError}.
7418
+ *
7419
+ * @param wat A value to be checked.
7420
+ * @returns A boolean representing the result.
7421
+ */
7422
+ function isDOMError(wat) {
7423
+ return isBuiltin(wat, 'DOMError');
7424
+ }
7425
+ /**
7426
+ * Checks whether given value's type is DOMException
7427
+ * {@link isDOMException}.
7428
+ *
7429
+ * @param wat A value to be checked.
7430
+ * @returns A boolean representing the result.
7431
+ */
7432
+ function isDOMException(wat) {
7433
+ return isBuiltin(wat, 'DOMException');
7434
+ }
7435
+ /**
7436
+ * Checks whether given value's type is a string
7437
+ * {@link isString}.
7438
+ *
7439
+ * @param wat A value to be checked.
7440
+ * @returns A boolean representing the result.
7441
+ */
7442
+ function isString(wat) {
7443
+ return isBuiltin(wat, 'String');
7444
+ }
7445
+ /**
7446
+ * Checks whether given value is a primitive (undefined, null, number, boolean, string, bigint, symbol)
7447
+ * {@link isPrimitive}.
7448
+ *
7449
+ * @param wat A value to be checked.
7450
+ * @returns A boolean representing the result.
7451
+ */
7452
+ function isPrimitive(wat) {
7453
+ return wat === null || (typeof wat !== 'object' && typeof wat !== 'function');
7454
+ }
7455
+ /**
7456
+ * Checks whether given value's type is an object literal
7457
+ * {@link isPlainObject}.
7458
+ *
7459
+ * @param wat A value to be checked.
7460
+ * @returns A boolean representing the result.
7461
+ */
7462
+ function isPlainObject(wat) {
7463
+ return isBuiltin(wat, 'Object');
7464
+ }
7465
+ /**
7466
+ * Checks whether given value's type is an Event instance
7467
+ * {@link isEvent}.
7468
+ *
7469
+ * @param wat A value to be checked.
7470
+ * @returns A boolean representing the result.
7471
+ */
7472
+ function isEvent(wat) {
7473
+ return typeof Event !== 'undefined' && isInstanceOf(wat, Event);
7474
+ }
7475
+ /**
7476
+ * Checks whether given value's type is an Element instance
7477
+ * {@link isElement}.
7478
+ *
7479
+ * @param wat A value to be checked.
7480
+ * @returns A boolean representing the result.
7481
+ */
7482
+ function isElement(wat) {
7483
+ return typeof Element !== 'undefined' && isInstanceOf(wat, Element);
7484
+ }
7485
+ /**
7486
+ * Checks whether given value's type is an regexp
7487
+ * {@link isRegExp}.
7488
+ *
7489
+ * @param wat A value to be checked.
7490
+ * @returns A boolean representing the result.
7491
+ */
7492
+ function isRegExp(wat) {
7493
+ return isBuiltin(wat, 'RegExp');
7494
+ }
7495
+ /**
7496
+ * Checks whether given value has a then function.
7497
+ * @param wat A value to be checked.
7498
+ */
7499
+ function isThenable(wat) {
7500
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
7501
+ return Boolean(wat && wat.then && typeof wat.then === 'function');
7502
+ }
7503
+ /**
7504
+ * Checks whether given value's type is a SyntheticEvent
7505
+ * {@link isSyntheticEvent}.
7506
+ *
7507
+ * @param wat A value to be checked.
7508
+ * @returns A boolean representing the result.
7509
+ */
7510
+ function isSyntheticEvent(wat) {
7511
+ return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat;
7512
+ }
7513
+ /**
7514
+ * Checks whether given value is NaN
7515
+ * {@link isNaN}.
7516
+ *
7517
+ * @param wat A value to be checked.
7518
+ * @returns A boolean representing the result.
7519
+ */
7520
+ function isNaN(wat) {
7521
+ return typeof wat === 'number' && wat !== wat;
7522
+ }
7523
+ /**
7524
+ * Checks whether given value's type is an instance of provided constructor.
7525
+ * {@link isInstanceOf}.
7526
+ *
7527
+ * @param wat A value to be checked.
7528
+ * @param base A constructor to be used in a check.
7529
+ * @returns A boolean representing the result.
7530
+ */
7531
+ function isInstanceOf(wat, base) {
7532
+ try {
7533
+ return wat instanceof base;
7534
+ }
7535
+ catch (_e) {
7536
+ return false;
7537
+ }
7538
+ }
7539
+ //# sourceMappingURL=is.js.map
7540
+
7541
+ /***/ }),
7542
+
7543
+ /***/ 8536:
7544
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
7545
+
7546
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7547
+ /* harmony export */ "RU": function() { return /* binding */ CONSOLE_LEVELS; },
7548
+ /* harmony export */ "Cf": function() { return /* binding */ consoleSandbox; },
7549
+ /* harmony export */ "kg": function() { return /* binding */ logger; }
7550
+ /* harmony export */ });
7551
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4715);
7552
+ /* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1923);
7553
+ /* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5907);
7554
+
7555
+
7556
+
7557
+ // TODO: Implement different loggers for different environments
7558
+ var global = (0,_global__WEBPACK_IMPORTED_MODULE_0__/* .getGlobalObject */ .R)();
7559
+ /** Prefix for logging strings */
7560
+ var PREFIX = 'Sentry Logger ';
7561
+ var CONSOLE_LEVELS = ['debug', 'info', 'warn', 'error', 'log', 'assert'];
7562
+ /**
7563
+ * Temporarily disable sentry console instrumentations.
7564
+ *
7565
+ * @param callback The function to run against the original `console` messages
7566
+ * @returns The results of the callback
7567
+ */
7568
+ function consoleSandbox(callback) {
7569
+ var global = (0,_global__WEBPACK_IMPORTED_MODULE_0__/* .getGlobalObject */ .R)();
7570
+ if (!('console' in global)) {
7571
+ return callback();
7572
+ }
7573
+ var originalConsole = global.console;
7574
+ var wrappedLevels = {};
7575
+ // Restore all wrapped console methods
7576
+ CONSOLE_LEVELS.forEach(function (level) {
7577
+ // TODO(v7): Remove this check as it's only needed for Node 6
7578
+ var originalWrappedFunc = originalConsole[level] && originalConsole[level].__sentry_original__;
7579
+ if (level in global.console && originalWrappedFunc) {
7580
+ wrappedLevels[level] = originalConsole[level];
7581
+ originalConsole[level] = originalWrappedFunc;
7582
+ }
7583
+ });
7584
+ try {
7585
+ return callback();
7586
+ }
7587
+ finally {
7588
+ // Revert restoration to wrapped state
7589
+ Object.keys(wrappedLevels).forEach(function (level) {
7590
+ originalConsole[level] = wrappedLevels[level];
7591
+ });
7592
+ }
7593
+ }
7594
+ function makeLogger() {
7595
+ var enabled = false;
7596
+ var logger = {
7597
+ enable: function () {
7598
+ enabled = true;
7599
+ },
7600
+ disable: function () {
7601
+ enabled = false;
7602
+ },
7603
+ };
7604
+ if (_flags__WEBPACK_IMPORTED_MODULE_1__/* .IS_DEBUG_BUILD */ .h) {
7605
+ CONSOLE_LEVELS.forEach(function (name) {
7606
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
7607
+ logger[name] = function () {
7608
+ var args = [];
7609
+ for (var _i = 0; _i < arguments.length; _i++) {
7610
+ args[_i] = arguments[_i];
7611
+ }
7612
+ if (enabled) {
7613
+ consoleSandbox(function () {
7614
+ var _a;
7615
+ (_a = global.console)[name].apply(_a, (0,tslib__WEBPACK_IMPORTED_MODULE_2__/* .__spread */ .fl)([PREFIX + "[" + name + "]:"], args));
7616
+ });
7617
+ }
7618
+ };
7619
+ });
7620
+ }
7621
+ else {
7622
+ CONSOLE_LEVELS.forEach(function (name) {
7623
+ logger[name] = function () { return undefined; };
7624
+ });
7625
+ }
7626
+ return logger;
7627
+ }
7628
+ // Ensure we only have a single logger instance, even if multiple versions of @sentry/utils are being used
7629
+ var logger;
7630
+ if (_flags__WEBPACK_IMPORTED_MODULE_1__/* .IS_DEBUG_BUILD */ .h) {
7631
+ logger = (0,_global__WEBPACK_IMPORTED_MODULE_0__/* .getGlobalSingleton */ .Y)('logger', makeLogger);
7632
+ }
7633
+ else {
7634
+ logger = makeLogger();
7635
+ }
7636
+
7637
+ //# sourceMappingURL=logger.js.map
7638
+
7639
+ /***/ }),
7640
+
7641
+ /***/ 4048:
7642
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
7643
+
7644
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7645
+ /* harmony export */ "i": function() { return /* binding */ memoBuilder; }
7646
+ /* harmony export */ });
7647
+ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
7648
+ /* eslint-disable @typescript-eslint/no-explicit-any */
7649
+ /**
7650
+ * Helper to decycle json objects
7651
+ */
7652
+ function memoBuilder() {
7653
+ var hasWeakSet = typeof WeakSet === 'function';
7654
+ var inner = hasWeakSet ? new WeakSet() : [];
7655
+ function memoize(obj) {
7656
+ if (hasWeakSet) {
7657
+ if (inner.has(obj)) {
7658
+ return true;
7659
+ }
7660
+ inner.add(obj);
7661
+ return false;
7662
+ }
7663
+ // eslint-disable-next-line @typescript-eslint/prefer-for-of
7664
+ for (var i = 0; i < inner.length; i++) {
7665
+ var value = inner[i];
7666
+ if (value === obj) {
7667
+ return true;
7668
+ }
7669
+ }
7670
+ inner.push(obj);
7671
+ return false;
7672
+ }
7673
+ function unmemoize(obj) {
7674
+ if (hasWeakSet) {
7675
+ inner.delete(obj);
7676
+ }
7677
+ else {
7678
+ for (var i = 0; i < inner.length; i++) {
7679
+ if (inner[i] === obj) {
7680
+ inner.splice(i, 1);
7681
+ break;
7682
+ }
7683
+ }
7684
+ }
7685
+ }
7686
+ return [memoize, unmemoize];
7687
+ }
7688
+ //# sourceMappingURL=memo.js.map
7689
+
7690
+ /***/ }),
7691
+
7692
+ /***/ 3699:
7693
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
7694
+
7695
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7696
+ /* harmony export */ "DM": function() { return /* binding */ uuid4; },
7697
+ /* harmony export */ "en": function() { return /* binding */ parseUrl; },
7698
+ /* harmony export */ "jH": function() { return /* binding */ getEventDescription; },
7699
+ /* harmony export */ "Db": function() { return /* binding */ addExceptionTypeValue; },
7700
+ /* harmony export */ "EG": function() { return /* binding */ addExceptionMechanism; },
7701
+ /* harmony export */ "YO": function() { return /* binding */ checkOrSetAlreadyCaught; }
7702
+ /* harmony export */ });
7703
+ /* unused harmony exports parseSemver, addContextToFrame, stripUrlQueryAndFragment */
7704
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4715);
7705
+ /* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5907);
7706
+ /* harmony import */ var _object__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1995);
7707
+
7708
+
7709
+
7710
+
7711
+ /**
7712
+ * UUID4 generator
7713
+ *
7714
+ * @returns string Generated UUID4.
7715
+ */
7716
+ function uuid4() {
7717
+ var global = (0,_global__WEBPACK_IMPORTED_MODULE_0__/* .getGlobalObject */ .R)();
7718
+ var crypto = global.crypto || global.msCrypto;
7719
+ if (!(crypto === void 0) && crypto.getRandomValues) {
7720
+ // Use window.crypto API if available
7721
+ var arr = new Uint16Array(8);
7722
+ crypto.getRandomValues(arr);
7723
+ // set 4 in byte 7
7724
+ // eslint-disable-next-line no-bitwise
7725
+ arr[3] = (arr[3] & 0xfff) | 0x4000;
7726
+ // set 2 most significant bits of byte 9 to '10'
7727
+ // eslint-disable-next-line no-bitwise
7728
+ arr[4] = (arr[4] & 0x3fff) | 0x8000;
7729
+ var pad = function (num) {
7730
+ var v = num.toString(16);
7731
+ while (v.length < 4) {
7732
+ v = "0" + v;
7733
+ }
7734
+ return v;
7735
+ };
7736
+ return (pad(arr[0]) + pad(arr[1]) + pad(arr[2]) + pad(arr[3]) + pad(arr[4]) + pad(arr[5]) + pad(arr[6]) + pad(arr[7]));
7737
+ }
7738
+ // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523
7739
+ return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
7740
+ // eslint-disable-next-line no-bitwise
7741
+ var r = (Math.random() * 16) | 0;
7742
+ // eslint-disable-next-line no-bitwise
7743
+ var v = c === 'x' ? r : (r & 0x3) | 0x8;
7744
+ return v.toString(16);
7745
+ });
7746
+ }
7747
+ /**
7748
+ * Parses string form of URL into an object
7749
+ * // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B
7750
+ * // intentionally using regex and not <a/> href parsing trick because React Native and other
7751
+ * // environments where DOM might not be available
7752
+ * @returns parsed URL object
7753
+ */
7754
+ function parseUrl(url) {
7755
+ if (!url) {
7756
+ return {};
7757
+ }
7758
+ var match = url.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);
7759
+ if (!match) {
7760
+ return {};
7761
+ }
7762
+ // coerce to undefined values to empty string so we don't get 'undefined'
7763
+ var query = match[6] || '';
7764
+ var fragment = match[8] || '';
7765
+ return {
7766
+ host: match[4],
7767
+ path: match[5],
7768
+ protocol: match[2],
7769
+ relative: match[5] + query + fragment,
7770
+ };
7771
+ }
7772
+ function getFirstException(event) {
7773
+ return event.exception && event.exception.values ? event.exception.values[0] : undefined;
7774
+ }
7775
+ /**
7776
+ * Extracts either message or type+value from an event that can be used for user-facing logs
7777
+ * @returns event's description
7778
+ */
7779
+ function getEventDescription(event) {
7780
+ var message = event.message, eventId = event.event_id;
7781
+ if (message) {
7782
+ return message;
7783
+ }
7784
+ var firstException = getFirstException(event);
7785
+ if (firstException) {
7786
+ if (firstException.type && firstException.value) {
7787
+ return firstException.type + ": " + firstException.value;
7788
+ }
7789
+ return firstException.type || firstException.value || eventId || '<unknown>';
7790
+ }
7791
+ return eventId || '<unknown>';
7792
+ }
7793
+ /**
7794
+ * Adds exception values, type and value to an synthetic Exception.
7795
+ * @param event The event to modify.
7796
+ * @param value Value of the exception.
7797
+ * @param type Type of the exception.
7798
+ * @hidden
7799
+ */
7800
+ function addExceptionTypeValue(event, value, type) {
7801
+ var exception = (event.exception = event.exception || {});
7802
+ var values = (exception.values = exception.values || []);
7803
+ var firstException = (values[0] = values[0] || {});
7804
+ if (!firstException.value) {
7805
+ firstException.value = value || '';
7806
+ }
7807
+ if (!firstException.type) {
7808
+ firstException.type = type || 'Error';
7809
+ }
7810
+ }
7811
+ /**
7812
+ * Adds exception mechanism data to a given event. Uses defaults if the second parameter is not passed.
7813
+ *
7814
+ * @param event The event to modify.
7815
+ * @param newMechanism Mechanism data to add to the event.
7816
+ * @hidden
7817
+ */
7818
+ function addExceptionMechanism(event, newMechanism) {
7819
+ var firstException = getFirstException(event);
7820
+ if (!firstException) {
7821
+ return;
7822
+ }
7823
+ var defaultMechanism = { type: 'generic', handled: true };
7824
+ var currentMechanism = firstException.mechanism;
7825
+ firstException.mechanism = (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__assign */ .pi)({}, defaultMechanism), currentMechanism), newMechanism);
7826
+ if (newMechanism && 'data' in newMechanism) {
7827
+ var mergedData = (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__assign */ .pi)({}, (currentMechanism && currentMechanism.data)), newMechanism.data);
7828
+ firstException.mechanism.data = mergedData;
7829
+ }
7830
+ }
7831
+ // https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
7832
+ var SEMVER_REGEXP = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;
7833
+ /**
7834
+ * Parses input into a SemVer interface
7835
+ * @param input string representation of a semver version
7836
+ */
7837
+ function parseSemver(input) {
7838
+ var match = input.match(SEMVER_REGEXP) || [];
7839
+ var major = parseInt(match[1], 10);
7840
+ var minor = parseInt(match[2], 10);
7841
+ var patch = parseInt(match[3], 10);
7842
+ return {
7843
+ buildmetadata: match[5],
7844
+ major: isNaN(major) ? undefined : major,
7845
+ minor: isNaN(minor) ? undefined : minor,
7846
+ patch: isNaN(patch) ? undefined : patch,
7847
+ prerelease: match[4],
7848
+ };
7849
+ }
7850
+ /**
7851
+ * This function adds context (pre/post/line) lines to the provided frame
7852
+ *
7853
+ * @param lines string[] containing all lines
7854
+ * @param frame StackFrame that will be mutated
7855
+ * @param linesOfContext number of context lines we want to add pre/post
7856
+ */
7857
+ function addContextToFrame(lines, frame, linesOfContext) {
7858
+ if (linesOfContext === void 0) { linesOfContext = 5; }
7859
+ var lineno = frame.lineno || 0;
7860
+ var maxLines = lines.length;
7861
+ var sourceLine = Math.max(Math.min(maxLines, lineno - 1), 0);
7862
+ frame.pre_context = lines
7863
+ .slice(Math.max(0, sourceLine - linesOfContext), sourceLine)
7864
+ .map(function (line) { return snipLine(line, 0); });
7865
+ frame.context_line = snipLine(lines[Math.min(maxLines - 1, sourceLine)], frame.colno || 0);
7866
+ frame.post_context = lines
7867
+ .slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext)
7868
+ .map(function (line) { return snipLine(line, 0); });
7869
+ }
7870
+ /**
7871
+ * Strip the query string and fragment off of a given URL or path (if present)
7872
+ *
7873
+ * @param urlPath Full URL or path, including possible query string and/or fragment
7874
+ * @returns URL or path without query string or fragment
7875
+ */
7876
+ function stripUrlQueryAndFragment(urlPath) {
7877
+ // eslint-disable-next-line no-useless-escape
7878
+ return urlPath.split(/[\?#]/, 1)[0];
7879
+ }
7880
+ /**
7881
+ * Checks whether or not we've already captured the given exception (note: not an identical exception - the very object
7882
+ * in question), and marks it captured if not.
7883
+ *
7884
+ * This is useful because it's possible for an error to get captured by more than one mechanism. After we intercept and
7885
+ * record an error, we rethrow it (assuming we've intercepted it before it's reached the top-level global handlers), so
7886
+ * that we don't interfere with whatever effects the error might have had were the SDK not there. At that point, because
7887
+ * the error has been rethrown, it's possible for it to bubble up to some other code we've instrumented. If it's not
7888
+ * caught after that, it will bubble all the way up to the global handlers (which of course we also instrument). This
7889
+ * function helps us ensure that even if we encounter the same error more than once, we only record it the first time we
7890
+ * see it.
7891
+ *
7892
+ * Note: It will ignore primitives (always return `false` and not mark them as seen), as properties can't be set on
7893
+ * them. {@link: Object.objectify} can be used on exceptions to convert any that are primitives into their equivalent
7894
+ * object wrapper forms so that this check will always work. However, because we need to flag the exact object which
7895
+ * will get rethrown, and because that rethrowing happens outside of the event processing pipeline, the objectification
7896
+ * must be done before the exception captured.
7897
+ *
7898
+ * @param A thrown exception to check or flag as having been seen
7899
+ * @returns `true` if the exception has already been captured, `false` if not (with the side effect of marking it seen)
7900
+ */
7901
+ function checkOrSetAlreadyCaught(exception) {
7902
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
7903
+ if (exception && exception.__sentry_captured__) {
7904
+ return true;
7905
+ }
7906
+ try {
7907
+ // set it this way rather than by assignment so that it's not ennumerable and therefore isn't recorded by the
7908
+ // `ExtraErrorData` integration
7909
+ (0,_object__WEBPACK_IMPORTED_MODULE_2__/* .addNonEnumerableProperty */ .xp)(exception, '__sentry_captured__', true);
7910
+ }
7911
+ catch (err) {
7912
+ // `exception` is a primitive, so we can't mark it seen
7913
+ }
7914
+ return false;
7915
+ }
7916
+ //# sourceMappingURL=misc.js.map
7917
+
7918
+ /***/ }),
7919
+
7920
+ /***/ 7392:
7921
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
7922
+
7923
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7924
+ /* harmony export */ "KV": function() { return /* binding */ isNodeEnv; },
7925
+ /* harmony export */ "l$": function() { return /* binding */ dynamicRequire; }
7926
+ /* harmony export */ });
7927
+ /* unused harmony export loadModule */
7928
+ /* harmony import */ var _env__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4285);
7929
+ /* module decorator */ module = __webpack_require__.hmd(module);
7930
+ /**
7931
+ * NOTE: In order to avoid circular dependencies, if you add a function to this module and it needs to print something,
7932
+ * you must either a) use `console.log` rather than the logger, or b) put your function elsewhere.
7933
+ */
7934
+
7935
+ /**
7936
+ * Checks whether we're in the Node.js or Browser environment
7937
+ *
7938
+ * @returns Answer to given question
7939
+ */
7940
+ function isNodeEnv() {
7941
+ // explicitly check for browser bundles as those can be optimized statically
7942
+ // by terser/rollup.
7943
+ return (!(0,_env__WEBPACK_IMPORTED_MODULE_0__/* .isBrowserBundle */ .n)() &&
7944
+ Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]');
7945
+ }
7946
+ /**
7947
+ * Requires a module which is protected against bundler minification.
7948
+ *
7949
+ * @param request The module path to resolve
7950
+ */
7951
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
7952
+ function dynamicRequire(mod, request) {
7953
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
7954
+ return mod.require(request);
7955
+ }
7956
+ /**
7957
+ * Helper for dynamically loading module that should work with linked dependencies.
7958
+ * The problem is that we _should_ be using `require(require.resolve(moduleName, { paths: [cwd()] }))`
7959
+ * However it's _not possible_ to do that with Webpack, as it has to know all the dependencies during
7960
+ * build time. `require.resolve` is also not available in any other way, so we cannot create,
7961
+ * a fake helper like we do with `dynamicRequire`.
7962
+ *
7963
+ * We always prefer to use local package, thus the value is not returned early from each `try/catch` block.
7964
+ * That is to mimic the behavior of `require.resolve` exactly.
7965
+ *
7966
+ * @param moduleName module name to require
7967
+ * @returns possibly required module
7968
+ */
7969
+ function loadModule(moduleName) {
7970
+ var mod;
7971
+ try {
7972
+ mod = dynamicRequire(module, moduleName);
7973
+ }
7974
+ catch (e) {
7975
+ // no-empty
7976
+ }
7977
+ try {
7978
+ var cwd = dynamicRequire(module, 'process').cwd;
7979
+ mod = dynamicRequire(module, cwd() + "/node_modules/" + moduleName);
7980
+ }
7981
+ catch (e) {
7982
+ // no-empty
7983
+ }
7984
+ return mod;
7985
+ }
7986
+ //# sourceMappingURL=node.js.map
7987
+
7988
+ /***/ }),
7989
+
7990
+ /***/ 8035:
7991
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
7992
+
7993
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7994
+ /* harmony export */ "Fv": function() { return /* binding */ normalize; },
7995
+ /* harmony export */ "Qy": function() { return /* binding */ normalizeToSize; }
7996
+ /* harmony export */ });
7997
+ /* unused harmony export walk */
7998
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4715);
7999
+ /* harmony import */ var _is__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1757);
8000
+ /* harmony import */ var _memo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4048);
8001
+ /* harmony import */ var _object__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1995);
8002
+ /* harmony import */ var _stacktrace__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9038);
8003
+
8004
+
8005
+
8006
+
8007
+
8008
+ /**
8009
+ * Recursively normalizes the given object.
8010
+ *
8011
+ * - Creates a copy to prevent original input mutation
8012
+ * - Skips non-enumerable properties
8013
+ * - When stringifying, calls `toJSON` if implemented
8014
+ * - Removes circular references
8015
+ * - Translates non-serializable values (`undefined`/`NaN`/functions) to serializable format
8016
+ * - Translates known global objects/classes to a string representations
8017
+ * - Takes care of `Error` object serialization
8018
+ * - Optionally limits depth of final output
8019
+ * - Optionally limits number of properties/elements included in any single object/array
8020
+ *
8021
+ * @param input The object to be normalized.
8022
+ * @param depth The max depth to which to normalize the object. (Anything deeper stringified whole.)
8023
+ * @param maxProperties The max number of elements or properties to be included in any single array or
8024
+ * object in the normallized output..
8025
+ * @returns A normalized version of the object, or `"**non-serializable**"` if any errors are thrown during normalization.
8026
+ */
8027
+ function normalize(input, depth, maxProperties) {
8028
+ if (depth === void 0) { depth = +Infinity; }
8029
+ if (maxProperties === void 0) { maxProperties = +Infinity; }
8030
+ try {
8031
+ // since we're at the outermost level, there is no key
8032
+ return visit('', input, depth, maxProperties);
8033
+ }
8034
+ catch (err) {
8035
+ return { ERROR: "**non-serializable** (" + err + ")" };
8036
+ }
8037
+ }
8038
+ /** JSDoc */
8039
+ function normalizeToSize(object,
8040
+ // Default Node.js REPL depth
8041
+ depth,
8042
+ // 100kB, as 200kB is max payload size, so half sounds reasonable
8043
+ maxSize) {
8044
+ if (depth === void 0) { depth = 3; }
8045
+ if (maxSize === void 0) { maxSize = 100 * 1024; }
8046
+ var normalized = normalize(object, depth);
8047
+ if (jsonSize(normalized) > maxSize) {
8048
+ return normalizeToSize(object, depth - 1, maxSize);
8049
+ }
8050
+ return normalized;
8051
+ }
8052
+ /**
8053
+ * Visits a node to perform normalization on it
8054
+ *
8055
+ * @param key The key corresponding to the given node
8056
+ * @param value The node to be visited
8057
+ * @param depth Optional number indicating the maximum recursion depth
8058
+ * @param maxProperties Optional maximum number of properties/elements included in any single object/array
8059
+ * @param memo Optional Memo class handling decycling
8060
+ */
8061
+ function visit(key, value, depth, maxProperties, memo) {
8062
+ if (depth === void 0) { depth = +Infinity; }
8063
+ if (maxProperties === void 0) { maxProperties = +Infinity; }
8064
+ if (memo === void 0) { memo = (0,_memo__WEBPACK_IMPORTED_MODULE_0__/* .memoBuilder */ .i)(); }
8065
+ var _a = (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__read */ .CR)(memo, 2), memoize = _a[0], unmemoize = _a[1];
8066
+ // If the value has a `toJSON` method, see if we can bail and let it do the work
8067
+ var valueWithToJSON = value;
8068
+ if (valueWithToJSON && typeof valueWithToJSON.toJSON === 'function') {
8069
+ try {
8070
+ return valueWithToJSON.toJSON();
8071
+ }
8072
+ catch (err) {
8073
+ // pass (The built-in `toJSON` failed, but we can still try to do it ourselves)
8074
+ }
8075
+ }
8076
+ // Get the simple cases out of the way first
8077
+ if (value === null || (['number', 'boolean', 'string'].includes(typeof value) && !(0,_is__WEBPACK_IMPORTED_MODULE_2__/* .isNaN */ .i2)(value))) {
8078
+ return value;
8079
+ }
8080
+ var stringified = stringifyValue(key, value);
8081
+ // Anything we could potentially dig into more (objects or arrays) will have come back as `"[object XXXX]"`.
8082
+ // Everything else will have already been serialized, so if we don't see that pattern, we're done.
8083
+ if (!stringified.startsWith('[object ')) {
8084
+ return stringified;
8085
+ }
8086
+ // We're also done if we've reached the max depth
8087
+ if (depth === 0) {
8088
+ // At this point we know `serialized` is a string of the form `"[object XXXX]"`. Clean it up so it's just `"[XXXX]"`.
8089
+ return stringified.replace('object ', '');
8090
+ }
8091
+ // If we've already visited this branch, bail out, as it's circular reference. If not, note that we're seeing it now.
8092
+ if (memoize(value)) {
8093
+ return '[Circular ~]';
8094
+ }
8095
+ // At this point we know we either have an object or an array, we haven't seen it before, and we're going to recurse
8096
+ // because we haven't yet reached the max depth. Create an accumulator to hold the results of visiting each
8097
+ // property/entry, and keep track of the number of items we add to it.
8098
+ var normalized = (Array.isArray(value) ? [] : {});
8099
+ var numAdded = 0;
8100
+ // Before we begin, convert`Error` and`Event` instances into plain objects, since some of each of their relevant
8101
+ // properties are non-enumerable and otherwise would get missed.
8102
+ var visitable = ((0,_is__WEBPACK_IMPORTED_MODULE_2__/* .isError */ .VZ)(value) || (0,_is__WEBPACK_IMPORTED_MODULE_2__/* .isEvent */ .cO)(value) ? (0,_object__WEBPACK_IMPORTED_MODULE_3__/* .convertToPlainObject */ .Sh)(value) : value);
8103
+ for (var visitKey in visitable) {
8104
+ // Avoid iterating over fields in the prototype if they've somehow been exposed to enumeration.
8105
+ if (!Object.prototype.hasOwnProperty.call(visitable, visitKey)) {
8106
+ continue;
8107
+ }
8108
+ if (numAdded >= maxProperties) {
8109
+ normalized[visitKey] = '[MaxProperties ~]';
8110
+ break;
8111
+ }
8112
+ // Recursively visit all the child nodes
8113
+ var visitValue = visitable[visitKey];
8114
+ normalized[visitKey] = visit(visitKey, visitValue, depth - 1, maxProperties, memo);
8115
+ numAdded += 1;
8116
+ }
8117
+ // Once we've visited all the branches, remove the parent from memo storage
8118
+ unmemoize(value);
8119
+ // Return accumulated values
8120
+ return normalized;
8121
+ }
8122
+ // TODO remove this in v7 (this means the method will no longer be exported, under any name)
8123
+
8124
+ /**
8125
+ * Stringify the given value. Handles various known special values and types.
8126
+ *
8127
+ * Not meant to be used on simple primitives which already have a string representation, as it will, for example, turn
8128
+ * the number 1231 into "[Object Number]", nor on `null`, as it will throw.
8129
+ *
8130
+ * @param value The value to stringify
8131
+ * @returns A stringified representation of the given value
8132
+ */
8133
+ function stringifyValue(key,
8134
+ // this type is a tiny bit of a cheat, since this function does handle NaN (which is technically a number), but for
8135
+ // our internal use, it'll do
8136
+ value) {
8137
+ try {
8138
+ if (key === 'domain' && value && typeof value === 'object' && value._events) {
8139
+ return '[Domain]';
8140
+ }
8141
+ if (key === 'domainEmitter') {
8142
+ return '[DomainEmitter]';
8143
+ }
8144
+ // It's safe to use `global`, `window`, and `document` here in this manner, as we are asserting using `typeof` first
8145
+ // which won't throw if they are not present.
8146
+ if (typeof window !== 'undefined' && value === window) {
8147
+ return '[Global]';
8148
+ }
8149
+ // eslint-disable-next-line no-restricted-globals
8150
+ if (typeof window !== 'undefined' && value === window) {
8151
+ return '[Window]';
8152
+ }
8153
+ // eslint-disable-next-line no-restricted-globals
8154
+ if (typeof document !== 'undefined' && value === document) {
8155
+ return '[Document]';
8156
+ }
8157
+ // React's SyntheticEvent thingy
8158
+ if ((0,_is__WEBPACK_IMPORTED_MODULE_2__/* .isSyntheticEvent */ .Cy)(value)) {
8159
+ return '[SyntheticEvent]';
8160
+ }
8161
+ if (typeof value === 'number' && value !== value) {
8162
+ return '[NaN]';
8163
+ }
8164
+ // this catches `undefined` (but not `null`, which is a primitive and can be serialized on its own)
8165
+ if (value === void 0) {
8166
+ return '[undefined]';
8167
+ }
8168
+ if (typeof value === 'function') {
8169
+ return "[Function: " + (0,_stacktrace__WEBPACK_IMPORTED_MODULE_4__/* .getFunctionName */ .$P)(value) + "]";
8170
+ }
8171
+ if (typeof value === 'symbol') {
8172
+ return "[" + String(value) + "]";
8173
+ }
8174
+ // stringified BigInts are indistinguishable from regular numbers, so we need to label them to avoid confusion
8175
+ if (typeof value === 'bigint') {
8176
+ return "[BigInt: " + String(value) + "]";
8177
+ }
8178
+ // Now that we've knocked out all the special cases and the primitives, all we have left are objects. Simply casting
8179
+ // them to strings means that instances of classes which haven't defined their `toStringTag` will just come out as
8180
+ // `"[object Object]"`. If we instead look at the constructor's name (which is the same as the name of the class),
8181
+ // we can make sure that only plain objects come out that way.
8182
+ return "[object " + Object.getPrototypeOf(value).constructor.name + "]";
8183
+ }
8184
+ catch (err) {
8185
+ return "**non-serializable** (" + err + ")";
8186
+ }
8187
+ }
8188
+ /** Calculates bytes size of input string */
8189
+ function utf8Length(value) {
8190
+ // eslint-disable-next-line no-bitwise
8191
+ return ~-encodeURI(value).split(/%..|./).length;
8192
+ }
8193
+ /** Calculates bytes size of input object */
8194
+ function jsonSize(value) {
8195
+ return utf8Length(JSON.stringify(value));
8196
+ }
8197
+ //# sourceMappingURL=normalize.js.map
8198
+
8199
+ /***/ }),
8200
+
8201
+ /***/ 1995:
8202
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
8203
+
8204
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8205
+ /* harmony export */ "hl": function() { return /* binding */ fill; },
8206
+ /* harmony export */ "xp": function() { return /* binding */ addNonEnumerableProperty; },
8207
+ /* harmony export */ "$Q": function() { return /* binding */ markFunctionWrapped; },
8208
+ /* harmony export */ "HK": function() { return /* binding */ getOriginalFunction; },
8209
+ /* harmony export */ "_j": function() { return /* binding */ urlEncode; },
8210
+ /* harmony export */ "Sh": function() { return /* binding */ convertToPlainObject; },
8211
+ /* harmony export */ "zf": function() { return /* binding */ extractExceptionKeysForMessage; },
8212
+ /* harmony export */ "Jr": function() { return /* binding */ dropUndefinedKeys; }
8213
+ /* harmony export */ });
8214
+ /* unused harmony export objectify */
8215
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4715);
8216
+ /* harmony import */ var _browser__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4194);
8217
+ /* harmony import */ var _is__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1757);
8218
+ /* harmony import */ var _string__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9660);
8219
+
8220
+
8221
+
8222
+
8223
+ /**
8224
+ * Replace a method in an object with a wrapped version of itself.
8225
+ *
8226
+ * @param source An object that contains a method to be wrapped.
8227
+ * @param name The name of the method to be wrapped.
8228
+ * @param replacementFactory A higher-order function that takes the original version of the given method and returns a
8229
+ * wrapped version. Note: The function returned by `replacementFactory` needs to be a non-arrow function, in order to
8230
+ * preserve the correct value of `this`, and the original method must be called using `origMethod.call(this, <other
8231
+ * args>)` or `origMethod.apply(this, [<other args>])` (rather than being called directly), again to preserve `this`.
8232
+ * @returns void
8233
+ */
8234
+ function fill(source, name, replacementFactory) {
8235
+ if (!(name in source)) {
8236
+ return;
8237
+ }
8238
+ var original = source[name];
8239
+ var wrapped = replacementFactory(original);
8240
+ // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work
8241
+ // otherwise it'll throw "TypeError: Object.defineProperties called on non-object"
8242
+ if (typeof wrapped === 'function') {
8243
+ try {
8244
+ markFunctionWrapped(wrapped, original);
8245
+ }
8246
+ catch (_Oo) {
8247
+ // This can throw if multiple fill happens on a global object like XMLHttpRequest
8248
+ // Fixes https://github.com/getsentry/sentry-javascript/issues/2043
8249
+ }
8250
+ }
8251
+ source[name] = wrapped;
8252
+ }
8253
+ /**
8254
+ * Defines a non-enumerable property on the given object.
8255
+ *
8256
+ * @param obj The object on which to set the property
8257
+ * @param name The name of the property to be set
8258
+ * @param value The value to which to set the property
8259
+ */
8260
+ function addNonEnumerableProperty(obj, name, value) {
8261
+ Object.defineProperty(obj, name, {
8262
+ // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it
8263
+ value: value,
8264
+ writable: true,
8265
+ configurable: true,
8266
+ });
8267
+ }
8268
+ /**
8269
+ * Remembers the original function on the wrapped function and
8270
+ * patches up the prototype.
8271
+ *
8272
+ * @param wrapped the wrapper function
8273
+ * @param original the original function that gets wrapped
8274
+ */
8275
+ function markFunctionWrapped(wrapped, original) {
8276
+ var proto = original.prototype || {};
8277
+ wrapped.prototype = original.prototype = proto;
8278
+ addNonEnumerableProperty(wrapped, '__sentry_original__', original);
8279
+ }
8280
+ /**
8281
+ * This extracts the original function if available. See
8282
+ * `markFunctionWrapped` for more information.
8283
+ *
8284
+ * @param func the function to unwrap
8285
+ * @returns the unwrapped version of the function if available.
8286
+ */
8287
+ function getOriginalFunction(func) {
8288
+ return func.__sentry_original__;
8289
+ }
8290
+ /**
8291
+ * Encodes given object into url-friendly format
8292
+ *
8293
+ * @param object An object that contains serializable values
8294
+ * @returns string Encoded
8295
+ */
8296
+ function urlEncode(object) {
8297
+ return Object.keys(object)
8298
+ .map(function (key) { return encodeURIComponent(key) + "=" + encodeURIComponent(object[key]); })
8299
+ .join('&');
8300
+ }
8301
+ /**
8302
+ * Transforms any object into an object literal with all its attributes
8303
+ * attached to it.
8304
+ *
8305
+ * @param value Initial source that we have to transform in order for it to be usable by the serializer
8306
+ */
8307
+ function convertToPlainObject(value) {
8308
+ var newObj = value;
8309
+ if ((0,_is__WEBPACK_IMPORTED_MODULE_0__/* .isError */ .VZ)(value)) {
8310
+ newObj = (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__assign */ .pi)({ message: value.message, name: value.name, stack: value.stack }, getOwnProperties(value));
8311
+ }
8312
+ else if ((0,_is__WEBPACK_IMPORTED_MODULE_0__/* .isEvent */ .cO)(value)) {
8313
+ var event_1 = value;
8314
+ newObj = (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__assign */ .pi)({ type: event_1.type, target: serializeEventTarget(event_1.target), currentTarget: serializeEventTarget(event_1.currentTarget) }, getOwnProperties(event_1));
8315
+ if (typeof CustomEvent !== 'undefined' && (0,_is__WEBPACK_IMPORTED_MODULE_0__/* .isInstanceOf */ .V9)(value, CustomEvent)) {
8316
+ newObj.detail = event_1.detail;
8317
+ }
8318
+ }
8319
+ return newObj;
8320
+ }
8321
+ /** Creates a string representation of the target of an `Event` object */
8322
+ function serializeEventTarget(target) {
8323
+ try {
8324
+ return (0,_is__WEBPACK_IMPORTED_MODULE_0__/* .isElement */ .kK)(target) ? (0,_browser__WEBPACK_IMPORTED_MODULE_2__/* .htmlTreeAsString */ .R)(target) : Object.prototype.toString.call(target);
8325
+ }
8326
+ catch (_oO) {
8327
+ return '<unknown>';
8328
+ }
8329
+ }
8330
+ /** Filters out all but an object's own properties */
8331
+ function getOwnProperties(obj) {
8332
+ var extractedProps = {};
8333
+ for (var property in obj) {
8334
+ if (Object.prototype.hasOwnProperty.call(obj, property)) {
8335
+ extractedProps[property] = obj[property];
8336
+ }
8337
+ }
8338
+ return extractedProps;
8339
+ }
8340
+ /**
8341
+ * Given any captured exception, extract its keys and create a sorted
8342
+ * and truncated list that will be used inside the event message.
8343
+ * eg. `Non-error exception captured with keys: foo, bar, baz`
8344
+ */
8345
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
8346
+ function extractExceptionKeysForMessage(exception, maxLength) {
8347
+ if (maxLength === void 0) { maxLength = 40; }
8348
+ var keys = Object.keys(convertToPlainObject(exception));
8349
+ keys.sort();
8350
+ if (!keys.length) {
8351
+ return '[object has no keys]';
8352
+ }
8353
+ if (keys[0].length >= maxLength) {
8354
+ return (0,_string__WEBPACK_IMPORTED_MODULE_3__/* .truncate */ .$G)(keys[0], maxLength);
8355
+ }
8356
+ for (var includedKeys = keys.length; includedKeys > 0; includedKeys--) {
8357
+ var serialized = keys.slice(0, includedKeys).join(', ');
8358
+ if (serialized.length > maxLength) {
8359
+ continue;
8360
+ }
8361
+ if (includedKeys === keys.length) {
8362
+ return serialized;
8363
+ }
8364
+ return (0,_string__WEBPACK_IMPORTED_MODULE_3__/* .truncate */ .$G)(serialized, maxLength);
8365
+ }
8366
+ return '';
8367
+ }
8368
+ /**
8369
+ * Given any object, return the new object with removed keys that value was `undefined`.
8370
+ * Works recursively on objects and arrays.
8371
+ */
8372
+ function dropUndefinedKeys(val) {
8373
+ var e_1, _a;
8374
+ if ((0,_is__WEBPACK_IMPORTED_MODULE_0__/* .isPlainObject */ .PO)(val)) {
8375
+ var rv = {};
8376
+ try {
8377
+ for (var _b = (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__values */ .XA)(Object.keys(val)), _c = _b.next(); !_c.done; _c = _b.next()) {
8378
+ var key = _c.value;
8379
+ if (typeof val[key] !== 'undefined') {
8380
+ rv[key] = dropUndefinedKeys(val[key]);
8381
+ }
8382
+ }
8383
+ }
8384
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
8385
+ finally {
8386
+ try {
8387
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
8388
+ }
8389
+ finally { if (e_1) throw e_1.error; }
8390
+ }
8391
+ return rv;
8392
+ }
8393
+ if (Array.isArray(val)) {
8394
+ return val.map(dropUndefinedKeys);
8395
+ }
8396
+ return val;
8397
+ }
8398
+ /**
8399
+ * Ensure that something is an object.
8400
+ *
8401
+ * Turns `undefined` and `null` into `String`s and all other primitives into instances of their respective wrapper
8402
+ * classes (String, Boolean, Number, etc.). Acts as the identity function on non-primitives.
8403
+ *
8404
+ * @param wat The subject of the objectification
8405
+ * @returns A version of `wat` which can safely be used with `Object` class methods
8406
+ */
8407
+ function objectify(wat) {
8408
+ var objectified;
8409
+ switch (true) {
8410
+ case wat === undefined || wat === null:
8411
+ objectified = new String(wat);
8412
+ break;
8413
+ // Though symbols and bigints do have wrapper classes (`Symbol` and `BigInt`, respectively), for whatever reason
8414
+ // those classes don't have constructors which can be used with the `new` keyword. We therefore need to cast each as
8415
+ // an object in order to wrap it.
8416
+ case typeof wat === 'symbol' || typeof wat === 'bigint':
8417
+ objectified = Object(wat);
8418
+ break;
8419
+ // this will catch the remaining primitives: `String`, `Number`, and `Boolean`
8420
+ case isPrimitive(wat):
8421
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
8422
+ objectified = new wat.constructor(wat);
8423
+ break;
8424
+ // by process of elimination, at this point we know that `wat` must already be an object
8425
+ default:
8426
+ objectified = wat;
8427
+ break;
8428
+ }
8429
+ return objectified;
8430
+ }
8431
+ //# sourceMappingURL=object.js.map
8432
+
8433
+ /***/ }),
8434
+
8435
+ /***/ 467:
8436
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
8437
+
8438
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8439
+ /* harmony export */ "f": function() { return /* binding */ setPrototypeOf; }
8440
+ /* harmony export */ });
8441
+ var setPrototypeOf = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? setProtoOf : mixinProperties);
8442
+ /**
8443
+ * setPrototypeOf polyfill using __proto__
8444
+ */
8445
+ // eslint-disable-next-line @typescript-eslint/ban-types
8446
+ function setProtoOf(obj, proto) {
8447
+ // @ts-ignore __proto__ does not exist on obj
8448
+ obj.__proto__ = proto;
8449
+ return obj;
8450
+ }
8451
+ /**
8452
+ * setPrototypeOf polyfill using mixin
8453
+ */
8454
+ // eslint-disable-next-line @typescript-eslint/ban-types
8455
+ function mixinProperties(obj, proto) {
8456
+ for (var prop in proto) {
8457
+ if (!Object.prototype.hasOwnProperty.call(obj, prop)) {
8458
+ // @ts-ignore typescript complains about indexing so we remove
8459
+ obj[prop] = proto[prop];
8460
+ }
8461
+ }
8462
+ return obj;
8463
+ }
8464
+ //# sourceMappingURL=polyfill.js.map
8465
+
8466
+ /***/ }),
8467
+
8468
+ /***/ 8963:
8469
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
8470
+
8471
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8472
+ /* harmony export */ "x": function() { return /* binding */ makePromiseBuffer; }
8473
+ /* harmony export */ });
8474
+ /* harmony import */ var _error__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4388);
8475
+ /* harmony import */ var _syncpromise__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7946);
8476
+
8477
+
8478
+ /**
8479
+ * Creates an new PromiseBuffer object with the specified limit
8480
+ * @param limit max number of promises that can be stored in the buffer
8481
+ */
8482
+ function makePromiseBuffer(limit) {
8483
+ var buffer = [];
8484
+ function isReady() {
8485
+ return limit === undefined || buffer.length < limit;
8486
+ }
8487
+ /**
8488
+ * Remove a promise from the queue.
8489
+ *
8490
+ * @param task Can be any PromiseLike<T>
8491
+ * @returns Removed promise.
8492
+ */
8493
+ function remove(task) {
8494
+ return buffer.splice(buffer.indexOf(task), 1)[0];
8495
+ }
8496
+ /**
8497
+ * Add a promise (representing an in-flight action) to the queue, and set it to remove itself on fulfillment.
8498
+ *
8499
+ * @param taskProducer A function producing any PromiseLike<T>; In previous versions this used to be `task:
8500
+ * PromiseLike<T>`, but under that model, Promises were instantly created on the call-site and their executor
8501
+ * functions therefore ran immediately. Thus, even if the buffer was full, the action still happened. By
8502
+ * requiring the promise to be wrapped in a function, we can defer promise creation until after the buffer
8503
+ * limit check.
8504
+ * @returns The original promise.
8505
+ */
8506
+ function add(taskProducer) {
8507
+ if (!isReady()) {
8508
+ return (0,_syncpromise__WEBPACK_IMPORTED_MODULE_0__/* .rejectedSyncPromise */ .$2)(new _error__WEBPACK_IMPORTED_MODULE_1__/* .SentryError */ .b('Not adding Promise due to buffer limit reached.'));
8509
+ }
8510
+ // start the task and add its promise to the queue
8511
+ var task = taskProducer();
8512
+ if (buffer.indexOf(task) === -1) {
8513
+ buffer.push(task);
8514
+ }
8515
+ void task
8516
+ .then(function () { return remove(task); })
8517
+ // Use `then(null, rejectionHandler)` rather than `catch(rejectionHandler)` so that we can use `PromiseLike`
8518
+ // rather than `Promise`. `PromiseLike` doesn't have a `.catch` method, making its polyfill smaller. (ES5 didn't
8519
+ // have promises, so TS has to polyfill when down-compiling.)
8520
+ .then(null, function () {
8521
+ return remove(task).then(null, function () {
8522
+ // We have to add another catch here because `remove()` starts a new promise chain.
8523
+ });
8524
+ });
8525
+ return task;
8526
+ }
8527
+ /**
8528
+ * Wait for all promises in the queue to resolve or for timeout to expire, whichever comes first.
8529
+ *
8530
+ * @param timeout The time, in ms, after which to resolve to `false` if the queue is still non-empty. Passing `0` (or
8531
+ * not passing anything) will make the promise wait as long as it takes for the queue to drain before resolving to
8532
+ * `true`.
8533
+ * @returns A promise which will resolve to `true` if the queue is already empty or drains before the timeout, and
8534
+ * `false` otherwise
8535
+ */
8536
+ function drain(timeout) {
8537
+ return new _syncpromise__WEBPACK_IMPORTED_MODULE_0__/* .SyncPromise */ .cW(function (resolve, reject) {
8538
+ var counter = buffer.length;
8539
+ if (!counter) {
8540
+ return resolve(true);
8541
+ }
8542
+ // wait for `timeout` ms and then resolve to `false` (if not cancelled first)
8543
+ var capturedSetTimeout = setTimeout(function () {
8544
+ if (timeout && timeout > 0) {
8545
+ resolve(false);
8546
+ }
8547
+ }, timeout);
8548
+ // if all promises resolve in time, cancel the timer and resolve to `true`
8549
+ buffer.forEach(function (item) {
8550
+ void (0,_syncpromise__WEBPACK_IMPORTED_MODULE_0__/* .resolvedSyncPromise */ .WD)(item).then(function () {
8551
+ // eslint-disable-next-line no-plusplus
8552
+ if (!--counter) {
8553
+ clearTimeout(capturedSetTimeout);
8554
+ resolve(true);
8555
+ }
8556
+ }, reject);
8557
+ });
8558
+ });
8559
+ }
8560
+ return {
8561
+ $: buffer,
8562
+ add: add,
8563
+ drain: drain,
8564
+ };
8565
+ }
8566
+ //# sourceMappingURL=promisebuffer.js.map
8567
+
8568
+ /***/ }),
8569
+
8570
+ /***/ 1630:
8571
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
8572
+
8573
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8574
+ /* harmony export */ "ns": function() { return /* binding */ disabledUntil; },
8575
+ /* harmony export */ "Q": function() { return /* binding */ isRateLimited; },
8576
+ /* harmony export */ "WG": function() { return /* binding */ updateRateLimits; }
8577
+ /* harmony export */ });
8578
+ /* unused harmony exports DEFAULT_RETRY_AFTER, parseRetryAfterHeader */
8579
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4715);
8580
+
8581
+ var DEFAULT_RETRY_AFTER = 60 * 1000; // 60 seconds
8582
+ /**
8583
+ * Extracts Retry-After value from the request header or returns default value
8584
+ * @param header string representation of 'Retry-After' header
8585
+ * @param now current unix timestamp
8586
+ *
8587
+ */
8588
+ function parseRetryAfterHeader(header, now) {
8589
+ if (now === void 0) { now = Date.now(); }
8590
+ var headerDelay = parseInt("" + header, 10);
8591
+ if (!isNaN(headerDelay)) {
8592
+ return headerDelay * 1000;
8593
+ }
8594
+ var headerDate = Date.parse("" + header);
8595
+ if (!isNaN(headerDate)) {
8596
+ return headerDate - now;
8597
+ }
8598
+ return DEFAULT_RETRY_AFTER;
8599
+ }
8600
+ /**
8601
+ * Gets the time that given category is disabled until for rate limiting
8602
+ */
8603
+ function disabledUntil(limits, category) {
8604
+ return limits[category] || limits.all || 0;
8605
+ }
8606
+ /**
8607
+ * Checks if a category is rate limited
8608
+ */
8609
+ function isRateLimited(limits, category, now) {
8610
+ if (now === void 0) { now = Date.now(); }
8611
+ return disabledUntil(limits, category) > now;
8612
+ }
8613
+ /**
8614
+ * Update ratelimits from incoming headers.
8615
+ * Returns true if headers contains a non-empty rate limiting header.
8616
+ */
8617
+ function updateRateLimits(limits, headers, now) {
8618
+ var e_1, _a, e_2, _b;
8619
+ if (now === void 0) { now = Date.now(); }
8620
+ var updatedRateLimits = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)({}, limits);
8621
+ // "The name is case-insensitive."
8622
+ // https://developer.mozilla.org/en-US/docs/Web/API/Headers/get
8623
+ var rateLimitHeader = headers['x-sentry-rate-limits'];
8624
+ var retryAfterHeader = headers['retry-after'];
8625
+ if (rateLimitHeader) {
8626
+ try {
8627
+ /**
8628
+ * rate limit headers are of the form
8629
+ * <header>,<header>,..
8630
+ * where each <header> is of the form
8631
+ * <retry_after>: <categories>: <scope>: <reason_code>
8632
+ * where
8633
+ * <retry_after> is a delay in seconds
8634
+ * <categories> is the event type(s) (error, transaction, etc) being rate limited and is of the form
8635
+ * <category>;<category>;...
8636
+ * <scope> is what's being limited (org, project, or key) - ignored by SDK
8637
+ * <reason_code> is an arbitrary string like "org_quota" - ignored by SDK
8638
+ */
8639
+ for (var _c = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__values */ .XA)(rateLimitHeader.trim().split(',')), _d = _c.next(); !_d.done; _d = _c.next()) {
8640
+ var limit = _d.value;
8641
+ var parameters = limit.split(':', 2);
8642
+ var headerDelay = parseInt(parameters[0], 10);
8643
+ var delay = (!isNaN(headerDelay) ? headerDelay : 60) * 1000; // 60sec default
8644
+ if (!parameters[1]) {
8645
+ updatedRateLimits.all = now + delay;
8646
+ }
8647
+ else {
8648
+ try {
8649
+ for (var _e = (e_2 = void 0, (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__values */ .XA)(parameters[1].split(';'))), _f = _e.next(); !_f.done; _f = _e.next()) {
8650
+ var category = _f.value;
8651
+ updatedRateLimits[category] = now + delay;
8652
+ }
8653
+ }
8654
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
8655
+ finally {
8656
+ try {
8657
+ if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
8658
+ }
8659
+ finally { if (e_2) throw e_2.error; }
8660
+ }
8661
+ }
8662
+ }
8663
+ }
8664
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
8665
+ finally {
8666
+ try {
8667
+ if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
8668
+ }
8669
+ finally { if (e_1) throw e_1.error; }
8670
+ }
8671
+ }
8672
+ else if (retryAfterHeader) {
8673
+ updatedRateLimits.all = now + parseRetryAfterHeader(retryAfterHeader, now);
8674
+ }
8675
+ return updatedRateLimits;
8676
+ }
8677
+ //# sourceMappingURL=ratelimit.js.map
8678
+
8679
+ /***/ }),
8680
+
8681
+ /***/ 8653:
8682
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
8683
+
8684
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8685
+ /* harmony export */ "E": function() { return /* binding */ severityFromString; }
8686
+ /* harmony export */ });
8687
+ /* harmony import */ var _sentry_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2226);
8688
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6872);
8689
+
8690
+
8691
+ function isSupportedSeverity(level) {
8692
+ return _enums__WEBPACK_IMPORTED_MODULE_0__/* .SeverityLevels.indexOf */ .a.indexOf(level) !== -1;
8693
+ }
8694
+ /**
8695
+ * Converts a string-based level into a {@link Severity}.
8696
+ *
8697
+ * @param level string representation of Severity
8698
+ * @returns Severity
8699
+ */
8700
+ function severityFromString(level) {
8701
+ if (level === 'warn')
8702
+ return _sentry_types__WEBPACK_IMPORTED_MODULE_1__/* .Severity.Warning */ .z.Warning;
8703
+ if (isSupportedSeverity(level)) {
8704
+ return level;
8705
+ }
8706
+ return _sentry_types__WEBPACK_IMPORTED_MODULE_1__/* .Severity.Log */ .z.Log;
8707
+ }
8708
+ //# sourceMappingURL=severity.js.map
8709
+
8710
+ /***/ }),
8711
+
8712
+ /***/ 9038:
8713
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
8714
+
8715
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8716
+ /* harmony export */ "pE": function() { return /* binding */ createStackParser; },
8717
+ /* harmony export */ "$P": function() { return /* binding */ getFunctionName; }
8718
+ /* harmony export */ });
8719
+ /* unused harmony export stripSentryFramesAndReverse */
8720
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4715);
8721
+
8722
+ var STACKTRACE_LIMIT = 50;
8723
+ /**
8724
+ * Creates a stack parser with the supplied line parsers
8725
+ *
8726
+ * StackFrames are returned in the correct order for Sentry Exception
8727
+ * frames and with Sentry SDK internal frames removed from the top and bottom
8728
+ *
8729
+ */
8730
+ function createStackParser() {
8731
+ var parsers = [];
8732
+ for (var _i = 0; _i < arguments.length; _i++) {
8733
+ parsers[_i] = arguments[_i];
8734
+ }
8735
+ var sortedParsers = parsers.sort(function (a, b) { return a[0] - b[0]; }).map(function (p) { return p[1]; });
8736
+ return function (stack, skipFirst) {
8737
+ var e_1, _a, e_2, _b;
8738
+ if (skipFirst === void 0) { skipFirst = 0; }
8739
+ var frames = [];
8740
+ try {
8741
+ for (var _c = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__values */ .XA)(stack.split('\n').slice(skipFirst)), _d = _c.next(); !_d.done; _d = _c.next()) {
8742
+ var line = _d.value;
8743
+ try {
8744
+ for (var sortedParsers_1 = (e_2 = void 0, (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__values */ .XA)(sortedParsers)), sortedParsers_1_1 = sortedParsers_1.next(); !sortedParsers_1_1.done; sortedParsers_1_1 = sortedParsers_1.next()) {
8745
+ var parser = sortedParsers_1_1.value;
8746
+ var frame = parser(line);
8747
+ if (frame) {
8748
+ frames.push(frame);
8749
+ break;
8750
+ }
8751
+ }
8752
+ }
8753
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
8754
+ finally {
8755
+ try {
8756
+ if (sortedParsers_1_1 && !sortedParsers_1_1.done && (_b = sortedParsers_1.return)) _b.call(sortedParsers_1);
8757
+ }
8758
+ finally { if (e_2) throw e_2.error; }
8759
+ }
8760
+ }
8761
+ }
8762
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
8763
+ finally {
8764
+ try {
8765
+ if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
8766
+ }
8767
+ finally { if (e_1) throw e_1.error; }
8768
+ }
8769
+ return stripSentryFramesAndReverse(frames);
8770
+ };
8771
+ }
8772
+ /**
8773
+ * @hidden
8774
+ */
8775
+ function stripSentryFramesAndReverse(stack) {
8776
+ if (!stack.length) {
8777
+ return [];
8778
+ }
8779
+ var localStack = stack;
8780
+ var firstFrameFunction = localStack[0].function || '';
8781
+ var lastFrameFunction = localStack[localStack.length - 1].function || '';
8782
+ // If stack starts with one of our API calls, remove it (starts, meaning it's the top of the stack - aka last call)
8783
+ if (firstFrameFunction.indexOf('captureMessage') !== -1 || firstFrameFunction.indexOf('captureException') !== -1) {
8784
+ localStack = localStack.slice(1);
8785
+ }
8786
+ // If stack ends with one of our internal API calls, remove it (ends, meaning it's the bottom of the stack - aka top-most call)
8787
+ if (lastFrameFunction.indexOf('sentryWrapped') !== -1) {
8788
+ localStack = localStack.slice(0, -1);
8789
+ }
8790
+ // The frame where the crash happened, should be the last entry in the array
8791
+ return localStack
8792
+ .slice(0, STACKTRACE_LIMIT)
8793
+ .map(function (frame) { return ((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .pi)({}, frame), { filename: frame.filename || localStack[0].filename, function: frame.function || '?' })); })
8794
+ .reverse();
8795
+ }
8796
+ var defaultFunctionName = '<anonymous>';
8797
+ /**
8798
+ * Safely extract function name from itself
8799
+ */
8800
+ function getFunctionName(fn) {
8801
+ try {
8802
+ if (!fn || typeof fn !== 'function') {
8803
+ return defaultFunctionName;
8804
+ }
8805
+ return fn.name || defaultFunctionName;
8806
+ }
8807
+ catch (e) {
8808
+ // Just accessing custom props in some Selenium environments
8809
+ // can cause a "Permission denied" exception (see raven-js#495).
8810
+ return defaultFunctionName;
8811
+ }
8812
+ }
8813
+ //# sourceMappingURL=stacktrace.js.map
8814
+
8815
+ /***/ }),
8816
+
8817
+ /***/ 8886:
8818
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
8819
+
8820
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8821
+ /* harmony export */ "F": function() { return /* binding */ eventStatusFromHttpCode; }
8822
+ /* harmony export */ });
8823
+ /**
8824
+ * Converts an HTTP status code to sentry status {@link EventStatus}.
8825
+ *
8826
+ * @param code number HTTP status code
8827
+ * @returns EventStatus
8828
+ */
8829
+ function eventStatusFromHttpCode(code) {
8830
+ if (code >= 200 && code < 300) {
8831
+ return 'success';
8832
+ }
8833
+ if (code === 429) {
8834
+ return 'rate_limit';
8835
+ }
8836
+ if (code >= 400 && code < 500) {
8837
+ return 'invalid';
8838
+ }
8839
+ if (code >= 500) {
8840
+ return 'failed';
8841
+ }
8842
+ return 'unknown';
8843
+ }
8844
+ //# sourceMappingURL=status.js.map
8845
+
8846
+ /***/ }),
8847
+
8848
+ /***/ 9660:
8849
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
8850
+
8851
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8852
+ /* harmony export */ "$G": function() { return /* binding */ truncate; },
8853
+ /* harmony export */ "nK": function() { return /* binding */ safeJoin; },
8854
+ /* harmony export */ "zC": function() { return /* binding */ isMatchingPattern; }
8855
+ /* harmony export */ });
8856
+ /* unused harmony exports snipLine, escapeStringForRegex */
8857
+ /* harmony import */ var _is__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1757);
8858
+
8859
+ /**
8860
+ * Truncates given string to the maximum characters count
8861
+ *
8862
+ * @param str An object that contains serializable values
8863
+ * @param max Maximum number of characters in truncated string (0 = unlimited)
8864
+ * @returns string Encoded
8865
+ */
8866
+ function truncate(str, max) {
8867
+ if (max === void 0) { max = 0; }
8868
+ if (typeof str !== 'string' || max === 0) {
8869
+ return str;
8870
+ }
8871
+ return str.length <= max ? str : str.substr(0, max) + "...";
8872
+ }
8873
+ /**
8874
+ * This is basically just `trim_line` from
8875
+ * https://github.com/getsentry/sentry/blob/master/src/sentry/lang/javascript/processor.py#L67
8876
+ *
8877
+ * @param str An object that contains serializable values
8878
+ * @param max Maximum number of characters in truncated string
8879
+ * @returns string Encoded
8880
+ */
8881
+ function snipLine(line, colno) {
8882
+ var newLine = line;
8883
+ var lineLength = newLine.length;
8884
+ if (lineLength <= 150) {
8885
+ return newLine;
8886
+ }
8887
+ if (colno > lineLength) {
8888
+ // eslint-disable-next-line no-param-reassign
8889
+ colno = lineLength;
8890
+ }
8891
+ var start = Math.max(colno - 60, 0);
8892
+ if (start < 5) {
8893
+ start = 0;
8894
+ }
8895
+ var end = Math.min(start + 140, lineLength);
8896
+ if (end > lineLength - 5) {
8897
+ end = lineLength;
8898
+ }
8899
+ if (end === lineLength) {
8900
+ start = Math.max(end - 140, 0);
8901
+ }
8902
+ newLine = newLine.slice(start, end);
8903
+ if (start > 0) {
8904
+ newLine = "'{snip} " + newLine;
8905
+ }
8906
+ if (end < lineLength) {
8907
+ newLine += ' {snip}';
8908
+ }
8909
+ return newLine;
8910
+ }
8911
+ /**
8912
+ * Join values in array
8913
+ * @param input array of values to be joined together
8914
+ * @param delimiter string to be placed in-between values
8915
+ * @returns Joined values
8916
+ */
8917
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
8918
+ function safeJoin(input, delimiter) {
8919
+ if (!Array.isArray(input)) {
8920
+ return '';
8921
+ }
8922
+ var output = [];
8923
+ // eslint-disable-next-line @typescript-eslint/prefer-for-of
8924
+ for (var i = 0; i < input.length; i++) {
8925
+ var value = input[i];
8926
+ try {
8927
+ output.push(String(value));
8928
+ }
8929
+ catch (e) {
8930
+ output.push('[value cannot be serialized]');
8931
+ }
8932
+ }
8933
+ return output.join(delimiter);
8934
+ }
8935
+ /**
8936
+ * Checks if the value matches a regex or includes the string
8937
+ * @param value The string value to be checked against
8938
+ * @param pattern Either a regex or a string that must be contained in value
8939
+ */
8940
+ function isMatchingPattern(value, pattern) {
8941
+ if (!(0,_is__WEBPACK_IMPORTED_MODULE_0__/* .isString */ .HD)(value)) {
8942
+ return false;
8943
+ }
8944
+ if ((0,_is__WEBPACK_IMPORTED_MODULE_0__/* .isRegExp */ .Kj)(pattern)) {
8945
+ return pattern.test(value);
8946
+ }
8947
+ if (typeof pattern === 'string') {
8948
+ return value.indexOf(pattern) !== -1;
8949
+ }
8950
+ return false;
8951
+ }
8952
+ /**
8953
+ * Given a string, escape characters which have meaning in the regex grammar, such that the result is safe to feed to
8954
+ * `new RegExp()`.
8955
+ *
8956
+ * Based on https://github.com/sindresorhus/escape-string-regexp. Vendored to a) reduce the size by skipping the runtime
8957
+ * type-checking, and b) ensure it gets down-compiled for old versions of Node (the published package only supports Node
8958
+ * 12+).
8959
+ *
8960
+ * @param regexString The string to escape
8961
+ * @returns An version of the string with all special regex characters escaped
8962
+ */
8963
+ function escapeStringForRegex(regexString) {
8964
+ // escape the hyphen separately so we can also replace it with a unicode literal hyphen, to avoid the problems
8965
+ // discussed in https://github.com/sindresorhus/escape-string-regexp/issues/20.
8966
+ return regexString.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&').replace(/-/g, '\\x2d');
8967
+ }
8968
+ //# sourceMappingURL=string.js.map
8969
+
8970
+ /***/ }),
8971
+
8972
+ /***/ 9798:
8973
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
8974
+
8975
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8976
+ /* harmony export */ "Ak": function() { return /* binding */ supportsFetch; },
8977
+ /* harmony export */ "Du": function() { return /* binding */ isNativeFetch; },
8978
+ /* harmony export */ "t$": function() { return /* binding */ supportsNativeFetch; },
8979
+ /* harmony export */ "hv": function() { return /* binding */ supportsReferrerPolicy; },
8980
+ /* harmony export */ "Bf": function() { return /* binding */ supportsHistory; }
8981
+ /* harmony export */ });
8982
+ /* unused harmony exports supportsErrorEvent, supportsDOMError, supportsDOMException, supportsReportingObserver */
8983
+ /* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1923);
8984
+ /* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5907);
8985
+ /* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8536);
8986
+
8987
+
8988
+
8989
+ /**
8990
+ * Tells whether current environment supports ErrorEvent objects
8991
+ * {@link supportsErrorEvent}.
8992
+ *
8993
+ * @returns Answer to the given question.
8994
+ */
8995
+ function supportsErrorEvent() {
8996
+ try {
8997
+ new ErrorEvent('');
8998
+ return true;
8999
+ }
9000
+ catch (e) {
9001
+ return false;
9002
+ }
9003
+ }
9004
+ /**
9005
+ * Tells whether current environment supports DOMError objects
9006
+ * {@link supportsDOMError}.
9007
+ *
9008
+ * @returns Answer to the given question.
9009
+ */
9010
+ function supportsDOMError() {
9011
+ try {
9012
+ // Chrome: VM89:1 Uncaught TypeError: Failed to construct 'DOMError':
9013
+ // 1 argument required, but only 0 present.
9014
+ // @ts-ignore It really needs 1 argument, not 0.
9015
+ new DOMError('');
9016
+ return true;
9017
+ }
9018
+ catch (e) {
9019
+ return false;
9020
+ }
9021
+ }
9022
+ /**
9023
+ * Tells whether current environment supports DOMException objects
9024
+ * {@link supportsDOMException}.
9025
+ *
9026
+ * @returns Answer to the given question.
9027
+ */
9028
+ function supportsDOMException() {
9029
+ try {
9030
+ new DOMException('');
9031
+ return true;
9032
+ }
9033
+ catch (e) {
9034
+ return false;
9035
+ }
9036
+ }
9037
+ /**
9038
+ * Tells whether current environment supports Fetch API
9039
+ * {@link supportsFetch}.
9040
+ *
9041
+ * @returns Answer to the given question.
9042
+ */
9043
+ function supportsFetch() {
9044
+ if (!('fetch' in (0,_global__WEBPACK_IMPORTED_MODULE_0__/* .getGlobalObject */ .R)())) {
9045
+ return false;
9046
+ }
9047
+ try {
9048
+ new Headers();
9049
+ new Request('');
9050
+ new Response();
9051
+ return true;
9052
+ }
9053
+ catch (e) {
9054
+ return false;
9055
+ }
9056
+ }
9057
+ /**
9058
+ * isNativeFetch checks if the given function is a native implementation of fetch()
9059
+ */
9060
+ // eslint-disable-next-line @typescript-eslint/ban-types
9061
+ function isNativeFetch(func) {
9062
+ return func && /^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(func.toString());
9063
+ }
9064
+ /**
9065
+ * Tells whether current environment supports Fetch API natively
9066
+ * {@link supportsNativeFetch}.
9067
+ *
9068
+ * @returns true if `window.fetch` is natively implemented, false otherwise
9069
+ */
9070
+ function supportsNativeFetch() {
9071
+ if (!supportsFetch()) {
9072
+ return false;
9073
+ }
9074
+ var global = (0,_global__WEBPACK_IMPORTED_MODULE_0__/* .getGlobalObject */ .R)();
9075
+ // Fast path to avoid DOM I/O
9076
+ // eslint-disable-next-line @typescript-eslint/unbound-method
9077
+ if (isNativeFetch(global.fetch)) {
9078
+ return true;
9079
+ }
9080
+ // window.fetch is implemented, but is polyfilled or already wrapped (e.g: by a chrome extension)
9081
+ // so create a "pure" iframe to see if that has native fetch
9082
+ var result = false;
9083
+ var doc = global.document;
9084
+ // eslint-disable-next-line deprecation/deprecation
9085
+ if (doc && typeof doc.createElement === 'function') {
9086
+ try {
9087
+ var sandbox = doc.createElement('iframe');
9088
+ sandbox.hidden = true;
9089
+ doc.head.appendChild(sandbox);
9090
+ if (sandbox.contentWindow && sandbox.contentWindow.fetch) {
9091
+ // eslint-disable-next-line @typescript-eslint/unbound-method
9092
+ result = isNativeFetch(sandbox.contentWindow.fetch);
9093
+ }
9094
+ doc.head.removeChild(sandbox);
9095
+ }
9096
+ catch (err) {
9097
+ _flags__WEBPACK_IMPORTED_MODULE_1__/* .IS_DEBUG_BUILD */ .h &&
9098
+ _logger__WEBPACK_IMPORTED_MODULE_2__/* .logger.warn */ .kg.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', err);
9099
+ }
9100
+ }
9101
+ return result;
9102
+ }
9103
+ /**
9104
+ * Tells whether current environment supports ReportingObserver API
9105
+ * {@link supportsReportingObserver}.
9106
+ *
9107
+ * @returns Answer to the given question.
9108
+ */
9109
+ function supportsReportingObserver() {
9110
+ return 'ReportingObserver' in getGlobalObject();
9111
+ }
9112
+ /**
9113
+ * Tells whether current environment supports Referrer Policy API
9114
+ * {@link supportsReferrerPolicy}.
9115
+ *
9116
+ * @returns Answer to the given question.
9117
+ */
9118
+ function supportsReferrerPolicy() {
9119
+ // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default'
9120
+ // (see https://caniuse.com/#feat=referrer-policy),
9121
+ // it doesn't. And it throws an exception instead of ignoring this parameter...
9122
+ // REF: https://github.com/getsentry/raven-js/issues/1233
9123
+ if (!supportsFetch()) {
9124
+ return false;
9125
+ }
9126
+ try {
9127
+ new Request('_', {
9128
+ referrerPolicy: 'origin',
9129
+ });
9130
+ return true;
9131
+ }
9132
+ catch (e) {
9133
+ return false;
9134
+ }
9135
+ }
9136
+ /**
9137
+ * Tells whether current environment supports History API
9138
+ * {@link supportsHistory}.
9139
+ *
9140
+ * @returns Answer to the given question.
9141
+ */
9142
+ function supportsHistory() {
9143
+ // NOTE: in Chrome App environment, touching history.pushState, *even inside
9144
+ // a try/catch block*, will cause Chrome to output an error to console.error
9145
+ // borrowed from: https://github.com/angular/angular.js/pull/13945/files
9146
+ var global = (0,_global__WEBPACK_IMPORTED_MODULE_0__/* .getGlobalObject */ .R)();
9147
+ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
9148
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9149
+ var chrome = global.chrome;
9150
+ var isChromePackagedApp = chrome && chrome.app && chrome.app.runtime;
9151
+ /* eslint-enable @typescript-eslint/no-unsafe-member-access */
9152
+ var hasHistoryApi = 'history' in global && !!global.history.pushState && !!global.history.replaceState;
9153
+ return !isChromePackagedApp && hasHistoryApi;
9154
+ }
9155
+ //# sourceMappingURL=supports.js.map
9156
+
9157
+ /***/ }),
9158
+
9159
+ /***/ 7946:
9160
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
9161
+
9162
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9163
+ /* harmony export */ "WD": function() { return /* binding */ resolvedSyncPromise; },
9164
+ /* harmony export */ "$2": function() { return /* binding */ rejectedSyncPromise; },
9165
+ /* harmony export */ "cW": function() { return /* binding */ SyncPromise; }
9166
+ /* harmony export */ });
9167
+ /* harmony import */ var _is__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1757);
9168
+ /* eslint-disable @typescript-eslint/explicit-function-return-type */
9169
+ /* eslint-disable @typescript-eslint/typedef */
9170
+ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */
9171
+ /* eslint-disable @typescript-eslint/no-explicit-any */
9172
+
9173
+ /**
9174
+ * Creates a resolved sync promise.
9175
+ *
9176
+ * @param value the value to resolve the promise with
9177
+ * @returns the resolved sync promise
9178
+ */
9179
+ function resolvedSyncPromise(value) {
9180
+ return new SyncPromise(function (resolve) {
9181
+ resolve(value);
9182
+ });
9183
+ }
9184
+ /**
9185
+ * Creates a rejected sync promise.
9186
+ *
9187
+ * @param value the value to reject the promise with
9188
+ * @returns the rejected sync promise
9189
+ */
9190
+ function rejectedSyncPromise(reason) {
9191
+ return new SyncPromise(function (_, reject) {
9192
+ reject(reason);
9193
+ });
9194
+ }
9195
+ /**
9196
+ * Thenable class that behaves like a Promise and follows it's interface
9197
+ * but is not async internally
9198
+ */
9199
+ var SyncPromise = /** @class */ (function () {
9200
+ function SyncPromise(executor) {
9201
+ var _this = this;
9202
+ this._state = 0 /* PENDING */;
9203
+ this._handlers = [];
9204
+ /** JSDoc */
9205
+ this._resolve = function (value) {
9206
+ _this._setResult(1 /* RESOLVED */, value);
9207
+ };
9208
+ /** JSDoc */
9209
+ this._reject = function (reason) {
9210
+ _this._setResult(2 /* REJECTED */, reason);
9211
+ };
9212
+ /** JSDoc */
9213
+ this._setResult = function (state, value) {
9214
+ if (_this._state !== 0 /* PENDING */) {
9215
+ return;
9216
+ }
9217
+ if ((0,_is__WEBPACK_IMPORTED_MODULE_0__/* .isThenable */ .J8)(value)) {
9218
+ void value.then(_this._resolve, _this._reject);
9219
+ return;
9220
+ }
9221
+ _this._state = state;
9222
+ _this._value = value;
9223
+ _this._executeHandlers();
9224
+ };
9225
+ /** JSDoc */
9226
+ this._executeHandlers = function () {
9227
+ if (_this._state === 0 /* PENDING */) {
9228
+ return;
9229
+ }
9230
+ var cachedHandlers = _this._handlers.slice();
9231
+ _this._handlers = [];
9232
+ cachedHandlers.forEach(function (handler) {
9233
+ if (handler[0]) {
9234
+ return;
9235
+ }
9236
+ if (_this._state === 1 /* RESOLVED */) {
9237
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
9238
+ handler[1](_this._value);
9239
+ }
9240
+ if (_this._state === 2 /* REJECTED */) {
9241
+ handler[2](_this._value);
9242
+ }
9243
+ handler[0] = true;
9244
+ });
9245
+ };
9246
+ try {
9247
+ executor(this._resolve, this._reject);
9248
+ }
9249
+ catch (e) {
9250
+ this._reject(e);
9251
+ }
9252
+ }
9253
+ /** JSDoc */
9254
+ SyncPromise.prototype.then = function (onfulfilled, onrejected) {
9255
+ var _this = this;
9256
+ return new SyncPromise(function (resolve, reject) {
9257
+ _this._handlers.push([
9258
+ false,
9259
+ function (result) {
9260
+ if (!onfulfilled) {
9261
+ // TODO: ¯\_(ツ)_/¯
9262
+ // TODO: FIXME
9263
+ resolve(result);
9264
+ }
9265
+ else {
9266
+ try {
9267
+ resolve(onfulfilled(result));
9268
+ }
9269
+ catch (e) {
9270
+ reject(e);
9271
+ }
9272
+ }
9273
+ },
9274
+ function (reason) {
9275
+ if (!onrejected) {
9276
+ reject(reason);
9277
+ }
9278
+ else {
9279
+ try {
9280
+ resolve(onrejected(reason));
9281
+ }
9282
+ catch (e) {
9283
+ reject(e);
9284
+ }
9285
+ }
9286
+ },
9287
+ ]);
9288
+ _this._executeHandlers();
9289
+ });
9290
+ };
9291
+ /** JSDoc */
9292
+ SyncPromise.prototype.catch = function (onrejected) {
9293
+ return this.then(function (val) { return val; }, onrejected);
9294
+ };
9295
+ /** JSDoc */
9296
+ SyncPromise.prototype.finally = function (onfinally) {
9297
+ var _this = this;
9298
+ return new SyncPromise(function (resolve, reject) {
9299
+ var val;
9300
+ var isRejected;
9301
+ return _this.then(function (value) {
9302
+ isRejected = false;
9303
+ val = value;
9304
+ if (onfinally) {
9305
+ onfinally();
9306
+ }
9307
+ }, function (reason) {
9308
+ isRejected = true;
9309
+ val = reason;
9310
+ if (onfinally) {
9311
+ onfinally();
9312
+ }
9313
+ }).then(function () {
9314
+ if (isRejected) {
9315
+ reject(val);
9316
+ return;
9317
+ }
9318
+ resolve(val);
9319
+ });
9320
+ });
9321
+ };
9322
+ return SyncPromise;
9323
+ }());
9324
+
9325
+ //# sourceMappingURL=syncpromise.js.map
9326
+
9327
+ /***/ }),
9328
+
9329
+ /***/ 7790:
9330
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
9331
+
9332
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9333
+ /* harmony export */ "yW": function() { return /* binding */ dateTimestampInSeconds; },
9334
+ /* harmony export */ "ph": function() { return /* binding */ timestampInSeconds; }
9335
+ /* harmony export */ });
9336
+ /* unused harmony exports timestampWithMs, usingPerformanceAPI, _browserPerformanceTimeOriginMode, browserPerformanceTimeOrigin */
9337
+ /* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5907);
9338
+ /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7392);
9339
+ /* module decorator */ module = __webpack_require__.hmd(module);
9340
+
9341
+
9342
+ /**
9343
+ * A TimestampSource implementation for environments that do not support the Performance Web API natively.
9344
+ *
9345
+ * Note that this TimestampSource does not use a monotonic clock. A call to `nowSeconds` may return a timestamp earlier
9346
+ * than a previously returned value. We do not try to emulate a monotonic behavior in order to facilitate debugging. It
9347
+ * is more obvious to explain "why does my span have negative duration" than "why my spans have zero duration".
9348
+ */
9349
+ var dateTimestampSource = {
9350
+ nowSeconds: function () { return Date.now() / 1000; },
9351
+ };
9352
+ /**
9353
+ * Returns a wrapper around the native Performance API browser implementation, or undefined for browsers that do not
9354
+ * support the API.
9355
+ *
9356
+ * Wrapping the native API works around differences in behavior from different browsers.
9357
+ */
9358
+ function getBrowserPerformance() {
9359
+ var performance = (0,_global__WEBPACK_IMPORTED_MODULE_0__/* .getGlobalObject */ .R)().performance;
9360
+ if (!performance || !performance.now) {
9361
+ return undefined;
9362
+ }
9363
+ // Replace performance.timeOrigin with our own timeOrigin based on Date.now().
9364
+ //
9365
+ // This is a partial workaround for browsers reporting performance.timeOrigin such that performance.timeOrigin +
9366
+ // performance.now() gives a date arbitrarily in the past.
9367
+ //
9368
+ // Additionally, computing timeOrigin in this way fills the gap for browsers where performance.timeOrigin is
9369
+ // undefined.
9370
+ //
9371
+ // The assumption that performance.timeOrigin + performance.now() ~= Date.now() is flawed, but we depend on it to
9372
+ // interact with data coming out of performance entries.
9373
+ //
9374
+ // Note that despite recommendations against it in the spec, browsers implement the Performance API with a clock that
9375
+ // might stop when the computer is asleep (and perhaps under other circumstances). Such behavior causes
9376
+ // performance.timeOrigin + performance.now() to have an arbitrary skew over Date.now(). In laptop computers, we have
9377
+ // observed skews that can be as long as days, weeks or months.
9378
+ //
9379
+ // See https://github.com/getsentry/sentry-javascript/issues/2590.
9380
+ //
9381
+ // BUG: despite our best intentions, this workaround has its limitations. It mostly addresses timings of pageload
9382
+ // transactions, but ignores the skew built up over time that can aversely affect timestamps of navigation
9383
+ // transactions of long-lived web pages.
9384
+ var timeOrigin = Date.now() - performance.now();
9385
+ return {
9386
+ now: function () { return performance.now(); },
9387
+ timeOrigin: timeOrigin,
9388
+ };
9389
+ }
9390
+ /**
9391
+ * Returns the native Performance API implementation from Node.js. Returns undefined in old Node.js versions that don't
9392
+ * implement the API.
9393
+ */
9394
+ function getNodePerformance() {
9395
+ try {
9396
+ var perfHooks = (0,_node__WEBPACK_IMPORTED_MODULE_1__/* .dynamicRequire */ .l$)(module, 'perf_hooks');
9397
+ return perfHooks.performance;
9398
+ }
9399
+ catch (_) {
9400
+ return undefined;
9401
+ }
9402
+ }
9403
+ /**
9404
+ * The Performance API implementation for the current platform, if available.
9405
+ */
9406
+ var platformPerformance = (0,_node__WEBPACK_IMPORTED_MODULE_1__/* .isNodeEnv */ .KV)() ? getNodePerformance() : getBrowserPerformance();
9407
+ var timestampSource = platformPerformance === undefined
9408
+ ? dateTimestampSource
9409
+ : {
9410
+ nowSeconds: function () { return (platformPerformance.timeOrigin + platformPerformance.now()) / 1000; },
9411
+ };
9412
+ /**
9413
+ * Returns a timestamp in seconds since the UNIX epoch using the Date API.
9414
+ */
9415
+ var dateTimestampInSeconds = dateTimestampSource.nowSeconds.bind(dateTimestampSource);
9416
+ /**
9417
+ * Returns a timestamp in seconds since the UNIX epoch using either the Performance or Date APIs, depending on the
9418
+ * availability of the Performance API.
9419
+ *
9420
+ * See `usingPerformanceAPI` to test whether the Performance API is used.
9421
+ *
9422
+ * BUG: Note that because of how browsers implement the Performance API, the clock might stop when the computer is
9423
+ * asleep. This creates a skew between `dateTimestampInSeconds` and `timestampInSeconds`. The
9424
+ * skew can grow to arbitrary amounts like days, weeks or months.
9425
+ * See https://github.com/getsentry/sentry-javascript/issues/2590.
9426
+ */
9427
+ var timestampInSeconds = timestampSource.nowSeconds.bind(timestampSource);
9428
+ // Re-exported with an old name for backwards-compatibility.
9429
+ var timestampWithMs = (/* unused pure expression or super */ null && (timestampInSeconds));
9430
+ /**
9431
+ * A boolean that is true when timestampInSeconds uses the Performance API to produce monotonic timestamps.
9432
+ */
9433
+ var usingPerformanceAPI = platformPerformance !== undefined;
9434
+ /**
9435
+ * Internal helper to store what is the source of browserPerformanceTimeOrigin below. For debugging only.
9436
+ */
9437
+ var _browserPerformanceTimeOriginMode;
9438
+ /**
9439
+ * The number of milliseconds since the UNIX epoch. This value is only usable in a browser, and only when the
9440
+ * performance API is available.
9441
+ */
9442
+ var browserPerformanceTimeOrigin = (function () {
9443
+ // Unfortunately browsers may report an inaccurate time origin data, through either performance.timeOrigin or
9444
+ // performance.timing.navigationStart, which results in poor results in performance data. We only treat time origin
9445
+ // data as reliable if they are within a reasonable threshold of the current time.
9446
+ var performance = (0,_global__WEBPACK_IMPORTED_MODULE_0__/* .getGlobalObject */ .R)().performance;
9447
+ if (!performance || !performance.now) {
9448
+ _browserPerformanceTimeOriginMode = 'none';
9449
+ return undefined;
9450
+ }
9451
+ var threshold = 3600 * 1000;
9452
+ var performanceNow = performance.now();
9453
+ var dateNow = Date.now();
9454
+ // if timeOrigin isn't available set delta to threshold so it isn't used
9455
+ var timeOriginDelta = performance.timeOrigin
9456
+ ? Math.abs(performance.timeOrigin + performanceNow - dateNow)
9457
+ : threshold;
9458
+ var timeOriginIsReliable = timeOriginDelta < threshold;
9459
+ // While performance.timing.navigationStart is deprecated in favor of performance.timeOrigin, performance.timeOrigin
9460
+ // is not as widely supported. Namely, performance.timeOrigin is undefined in Safari as of writing.
9461
+ // Also as of writing, performance.timing is not available in Web Workers in mainstream browsers, so it is not always
9462
+ // a valid fallback. In the absence of an initial time provided by the browser, fallback to the current time from the
9463
+ // Date API.
9464
+ // eslint-disable-next-line deprecation/deprecation
9465
+ var navigationStart = performance.timing && performance.timing.navigationStart;
9466
+ var hasNavigationStart = typeof navigationStart === 'number';
9467
+ // if navigationStart isn't available set delta to threshold so it isn't used
9468
+ var navigationStartDelta = hasNavigationStart ? Math.abs(navigationStart + performanceNow - dateNow) : threshold;
9469
+ var navigationStartIsReliable = navigationStartDelta < threshold;
9470
+ if (timeOriginIsReliable || navigationStartIsReliable) {
9471
+ // Use the more reliable time origin
9472
+ if (timeOriginDelta <= navigationStartDelta) {
9473
+ _browserPerformanceTimeOriginMode = 'timeOrigin';
9474
+ return performance.timeOrigin;
9475
+ }
9476
+ else {
9477
+ _browserPerformanceTimeOriginMode = 'navigationStart';
9478
+ return navigationStart;
9479
+ }
9480
+ }
9481
+ // Either both timeOrigin and navigationStart are skewed or neither is available, fallback to Date.
9482
+ _browserPerformanceTimeOriginMode = 'dateNow';
9483
+ return dateNow;
9484
+ })();
9485
+ //# sourceMappingURL=time.js.map
9486
+
9487
+ /***/ }),
9488
+
9489
+ /***/ 4715:
9490
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
9491
+
9492
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9493
+ /* harmony export */ "ZT": function() { return /* binding */ __extends; },
9494
+ /* harmony export */ "pi": function() { return /* binding */ __assign; },
9495
+ /* harmony export */ "XA": function() { return /* binding */ __values; },
9496
+ /* harmony export */ "CR": function() { return /* binding */ __read; },
9497
+ /* harmony export */ "fl": function() { return /* binding */ __spread; }
9498
+ /* harmony export */ });
9499
+ /* unused harmony exports __rest, __decorate, __param, __metadata, __awaiter, __generator, __createBinding, __exportStar, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet */
9500
+ /*! *****************************************************************************
9501
+ Copyright (c) Microsoft Corporation.
9502
+
9503
+ Permission to use, copy, modify, and/or distribute this software for any
9504
+ purpose with or without fee is hereby granted.
9505
+
9506
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9507
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9508
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
9509
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
9510
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
9511
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
9512
+ PERFORMANCE OF THIS SOFTWARE.
9513
+ ***************************************************************************** */
9514
+ /* global Reflect, Promise */
9515
+
9516
+ var extendStatics = function(d, b) {
9517
+ extendStatics = Object.setPrototypeOf ||
9518
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
9519
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
9520
+ return extendStatics(d, b);
9521
+ };
9522
+
9523
+ function __extends(d, b) {
9524
+ extendStatics(d, b);
9525
+ function __() { this.constructor = d; }
9526
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
9527
+ }
9528
+
9529
+ var __assign = function() {
9530
+ __assign = Object.assign || function __assign(t) {
9531
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
9532
+ s = arguments[i];
9533
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
9534
+ }
9535
+ return t;
9536
+ }
9537
+ return __assign.apply(this, arguments);
9538
+ }
9539
+
9540
+ function __rest(s, e) {
9541
+ var t = {};
9542
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
9543
+ t[p] = s[p];
9544
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
9545
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
9546
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9547
+ t[p[i]] = s[p[i]];
9548
+ }
9549
+ return t;
9550
+ }
9551
+
9552
+ function __decorate(decorators, target, key, desc) {
9553
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
9554
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
9555
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
9556
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
9557
+ }
9558
+
9559
+ function __param(paramIndex, decorator) {
9560
+ return function (target, key) { decorator(target, key, paramIndex); }
9561
+ }
9562
+
9563
+ function __metadata(metadataKey, metadataValue) {
9564
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
9565
+ }
9566
+
9567
+ function __awaiter(thisArg, _arguments, P, generator) {
9568
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
9569
+ return new (P || (P = Promise))(function (resolve, reject) {
9570
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
9571
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
9572
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9573
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9574
+ });
9575
+ }
9576
+
9577
+ function __generator(thisArg, body) {
9578
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
9579
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
9580
+ function verb(n) { return function (v) { return step([n, v]); }; }
9581
+ function step(op) {
9582
+ if (f) throw new TypeError("Generator is already executing.");
9583
+ while (_) try {
9584
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
9585
+ if (y = 0, t) op = [op[0] & 2, t.value];
9586
+ switch (op[0]) {
9587
+ case 0: case 1: t = op; break;
9588
+ case 4: _.label++; return { value: op[1], done: false };
9589
+ case 5: _.label++; y = op[1]; op = [0]; continue;
9590
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
9591
+ default:
9592
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
9593
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
9594
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
9595
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
9596
+ if (t[2]) _.ops.pop();
9597
+ _.trys.pop(); continue;
9598
+ }
9599
+ op = body.call(thisArg, _);
9600
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
9601
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
9602
+ }
9603
+ }
9604
+
9605
+ function __createBinding(o, m, k, k2) {
9606
+ if (k2 === undefined) k2 = k;
9607
+ o[k2] = m[k];
9608
+ }
9609
+
9610
+ function __exportStar(m, exports) {
9611
+ for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p];
9612
+ }
9613
+
9614
+ function __values(o) {
9615
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
9616
+ if (m) return m.call(o);
9617
+ if (o && typeof o.length === "number") return {
9618
+ next: function () {
9619
+ if (o && i >= o.length) o = void 0;
9620
+ return { value: o && o[i++], done: !o };
9621
+ }
9622
+ };
9623
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
9624
+ }
9625
+
9626
+ function __read(o, n) {
9627
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
9628
+ if (!m) return o;
9629
+ var i = m.call(o), r, ar = [], e;
9630
+ try {
9631
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
9632
+ }
9633
+ catch (error) { e = { error: error }; }
9634
+ finally {
9635
+ try {
9636
+ if (r && !r.done && (m = i["return"])) m.call(i);
9637
+ }
9638
+ finally { if (e) throw e.error; }
9639
+ }
9640
+ return ar;
9641
+ }
9642
+
9643
+ function __spread() {
9644
+ for (var ar = [], i = 0; i < arguments.length; i++)
9645
+ ar = ar.concat(__read(arguments[i]));
9646
+ return ar;
9647
+ }
9648
+
9649
+ function __spreadArrays() {
9650
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
9651
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
9652
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
9653
+ r[k] = a[j];
9654
+ return r;
9655
+ };
9656
+
9657
+ function __await(v) {
9658
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
9659
+ }
9660
+
9661
+ function __asyncGenerator(thisArg, _arguments, generator) {
9662
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
9663
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
9664
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
9665
+ function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
9666
+ function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
9667
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
9668
+ function fulfill(value) { resume("next", value); }
9669
+ function reject(value) { resume("throw", value); }
9670
+ function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
9671
+ }
9672
+
9673
+ function __asyncDelegator(o) {
9674
+ var i, p;
9675
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
9676
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
9677
+ }
9678
+
9679
+ function __asyncValues(o) {
9680
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
9681
+ var m = o[Symbol.asyncIterator], i;
9682
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
9683
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
9684
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
9685
+ }
9686
+
9687
+ function __makeTemplateObject(cooked, raw) {
9688
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
9689
+ return cooked;
9690
+ };
9691
+
9692
+ function __importStar(mod) {
9693
+ if (mod && mod.__esModule) return mod;
9694
+ var result = {};
9695
+ if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
9696
+ result.default = mod;
9697
+ return result;
9698
+ }
9699
+
9700
+ function __importDefault(mod) {
9701
+ return (mod && mod.__esModule) ? mod : { default: mod };
9702
+ }
9703
+
9704
+ function __classPrivateFieldGet(receiver, privateMap) {
9705
+ if (!privateMap.has(receiver)) {
9706
+ throw new TypeError("attempted to get private field on non-instance");
9707
+ }
9708
+ return privateMap.get(receiver);
9709
+ }
9710
+
9711
+ function __classPrivateFieldSet(receiver, privateMap, value) {
9712
+ if (!privateMap.has(receiver)) {
9713
+ throw new TypeError("attempted to set private field on non-instance");
9714
+ }
9715
+ privateMap.set(receiver, value);
9716
+ return value;
9717
+ }
9718
+
9719
+
9720
+ /***/ }),
9721
+
9722
+ /***/ 6989:
9723
+ /***/ (function(module) {
9724
+
9725
+ module.exports = window["wp"]["apiFetch"];
9726
+
9727
+ /***/ })
9728
+
9729
+ /******/ });
9730
+ /************************************************************************/
9731
+ /******/ // The module cache
9732
+ /******/ var __webpack_module_cache__ = {};
9733
+ /******/
9734
+ /******/ // The require function
9735
+ /******/ function __webpack_require__(moduleId) {
9736
+ /******/ // Check if module is in cache
9737
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
9738
+ /******/ if (cachedModule !== undefined) {
9739
+ /******/ return cachedModule.exports;
9740
+ /******/ }
9741
+ /******/ // Create a new module (and put it into the cache)
9742
+ /******/ var module = __webpack_module_cache__[moduleId] = {
9743
+ /******/ id: moduleId,
9744
+ /******/ loaded: false,
9745
+ /******/ exports: {}
9746
+ /******/ };
9747
+ /******/
9748
+ /******/ // Execute the module function
9749
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
9750
+ /******/
9751
+ /******/ // Flag the module as loaded
9752
+ /******/ module.loaded = true;
9753
+ /******/
9754
+ /******/ // Return the exports of the module
9755
+ /******/ return module.exports;
9756
+ /******/ }
9757
+ /******/
9758
+ /************************************************************************/
9759
+ /******/ /* webpack/runtime/compat get default export */
9760
+ /******/ !function() {
9761
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
9762
+ /******/ __webpack_require__.n = function(module) {
9763
+ /******/ var getter = module && module.__esModule ?
9764
+ /******/ function() { return module['default']; } :
9765
+ /******/ function() { return module; };
9766
+ /******/ __webpack_require__.d(getter, { a: getter });
9767
+ /******/ return getter;
9768
+ /******/ };
9769
+ /******/ }();
9770
+ /******/
9771
+ /******/ /* webpack/runtime/define property getters */
9772
+ /******/ !function() {
9773
+ /******/ // define getter functions for harmony exports
9774
+ /******/ __webpack_require__.d = function(exports, definition) {
9775
+ /******/ for(var key in definition) {
9776
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
9777
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
9778
+ /******/ }
9779
+ /******/ }
9780
+ /******/ };
9781
+ /******/ }();
9782
+ /******/
9783
+ /******/ /* webpack/runtime/harmony module decorator */
9784
+ /******/ !function() {
9785
+ /******/ __webpack_require__.hmd = function(module) {
9786
+ /******/ module = Object.create(module);
9787
+ /******/ if (!module.children) module.children = [];
9788
+ /******/ Object.defineProperty(module, 'exports', {
9789
+ /******/ enumerable: true,
9790
+ /******/ set: function() {
9791
+ /******/ throw new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id);
9792
+ /******/ }
9793
+ /******/ });
9794
+ /******/ return module;
9795
+ /******/ };
9796
+ /******/ }();
9797
+ /******/
9798
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
9799
+ /******/ !function() {
9800
+ /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
9801
+ /******/ }();
9802
+ /******/
9803
+ /******/ /* webpack/runtime/make namespace object */
9804
+ /******/ !function() {
9805
+ /******/ // define __esModule on exports
9806
+ /******/ __webpack_require__.r = function(exports) {
9807
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
9808
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
9809
+ /******/ }
9810
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
9811
+ /******/ };
9812
+ /******/ }();
9813
+ /******/
9814
+ /************************************************************************/
9815
+ var __webpack_exports__ = {};
9816
+ // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
9817
+ !function() {
9818
+ __webpack_require__.r(__webpack_exports__);
9819
+ /* harmony import */ var _sentry_browser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2456);
9820
+ /* harmony import */ var _sentry_browser__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4678);
9821
+ /* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6989);
9822
+ /* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0__);
9823
+ var _window$A8C_ETK_Error;
9824
+
9825
+
9826
+
9827
+ const shouldActivateSentry = ((_window$A8C_ETK_Error = window.A8C_ETK_ErrorReporting_Config) === null || _window$A8C_ETK_Error === void 0 ? void 0 : _window$A8C_ETK_Error.shouldActivateSentry) === 'true';
9828
+ /**
9829
+ * Errors that happened before this script had a chance to load
9830
+ * are captured in a global array. See `./index.php`.
9831
+ */
9832
+
9833
+ const headErrors = window._jsErr || [];
9834
+ const headErrorHandler = window._headJsErrorHandler;
9835
+
9836
+ function activateSentry() {
9837
+ _sentry_browser__WEBPACK_IMPORTED_MODULE_1__/* .init */ .S1({
9838
+ dsn: 'https://658ae291b00242148af6b76494d4a49a@o248881.ingest.sentry.io/5876245',
9839
+ // Set tracesSampleRate to 1.0 to capture 100%
9840
+ // of transactions for performance monitoring.
9841
+ // We recommend adjusting this value in production
9842
+ release: 'wpcom-test-01'
9843
+ }); // We still need to report the head errors, if any.
9844
+
9845
+ headErrors.forEach(error => _sentry_browser__WEBPACK_IMPORTED_MODULE_2__/* .captureException */ .Tb(error));
9846
+ _sentry_browser__WEBPACK_IMPORTED_MODULE_1__/* .flush */ .yl().then(() => delete window._jsErr);
9847
+ } // Activate the home-brew error-reporting
9848
+
9849
+
9850
+ function activateHomebrewErrorReporting() {
9851
+ const reportError = _ref => {
9852
+ let {
9853
+ error
9854
+ } = _ref;
9855
+
9856
+ // Sanitized error event objects do not include a nested error attribute. In
9857
+ // that case, we return early to prevent a needless TypeError when defining
9858
+ // `data`, below. Also, sanitized errors don't include any useful information,
9859
+ // so the sensible thing to do is to completely ignore them.
9860
+ if (!error) {
9861
+ return;
9862
+ }
9863
+
9864
+ const data = {
9865
+ message: error.message,
9866
+ trace: error.stack,
9867
+ url: document.location.href,
9868
+ feature: 'wp-admin'
9869
+ };
9870
+ return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default()({
9871
+ global: true,
9872
+ path: '/rest/v1.1/js-error',
9873
+ method: 'POST',
9874
+ data: {
9875
+ error: JSON.stringify(data)
9876
+ }
9877
+ }) // eslint-disable-next-line no-console
9878
+ .catch(() => console.error('Error: Unable to record the error in Logstash.'));
9879
+ };
9880
+
9881
+ window.addEventListener('error', reportError); // We still need to report the head errors, if any.
9882
+
9883
+ Promise.allSettled(headErrors.map(reportError)).then(() => delete window._jsErr);
9884
+ }
9885
+
9886
+ if (shouldActivateSentry) {
9887
+ activateSentry();
9888
+ } else {
9889
+ activateHomebrewErrorReporting();
9890
+ } // Remove the head handler as it's not needed anymore after we set the main one above (either Sentry or homebrew)
9891
+
9892
+
9893
+ window.removeEventListener('error', headErrorHandler);
9894
+ delete window._headJsErrorHandler;
9895
+ }();
9896
+ window.EditingToolkit = __webpack_exports__;
9897
+ /******/ })()
9898
+ ;
event-countdown-block/dist/event-countdown-block.js ADDED
@@ -0,0 +1,423 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******/ (function() { // webpackBootstrap
2
+ /******/ "use strict";
3
+ /******/ var __webpack_modules__ = ({
4
+
5
+ /***/ 129:
6
+ /***/ (function() {
7
+
8
+ // extracted by mini-css-extract-plugin
9
+
10
+
11
+ /***/ }),
12
+
13
+ /***/ 448:
14
+ /***/ (function() {
15
+
16
+ // extracted by mini-css-extract-plugin
17
+
18
+
19
+ /***/ }),
20
+
21
+ /***/ 829:
22
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
23
+
24
+ /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(307);
25
+ /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
26
+ /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(609);
27
+ /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
28
+ /* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(771);
29
+ /* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_date__WEBPACK_IMPORTED_MODULE_2__);
30
+ /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(736);
31
+ /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
32
+ /* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(292);
33
+ /* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_4__);
34
+ /* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(515);
35
+
36
+
37
+ /* eslint-disable wpcalypso/jsx-classname-namespace */
38
+ // disabled CSS class rule due to existing code already
39
+ // that users the non-conformant classnames
40
+
41
+
42
+
43
+ const __ = _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__;
44
+
45
+
46
+ const TIMEZONELESS_FORMAT = 'YYYY-MM-DDTHH:mm:ss';
47
+ /**
48
+ * Assigns timezone to a date without altering it
49
+ *
50
+ * @param {string} date a date in YYYY-MM-DDTHH:mm:ss format
51
+ * @param {number} offset the offset in hours
52
+ * @returns a moment instance
53
+ */
54
+
55
+ function assignTimezone(date, offset) {
56
+ let format = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : TIMEZONELESS_FORMAT;
57
+ // passing the `true` flag to `utcOffset` keeps the date unaltered, only adds a tz
58
+ return moment__WEBPACK_IMPORTED_MODULE_4___default()(date, format).utcOffset(offset * 60, true);
59
+ }
60
+
61
+ const edit = _ref => {
62
+ let {
63
+ attributes,
64
+ setAttributes,
65
+ className
66
+ } = _ref;
67
+
68
+ const settings = (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_2__.__experimentalGetSettings)();
69
+
70
+ let label = __('Choose Date', 'full-site-editing');
71
+
72
+ let eventDate;
73
+
74
+ if (attributes.eventTimestamp) {
75
+ label = (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_2__.dateI18n)(settings.formats.datetimeAbbreviated, // eventTimestamp is UNIX (in seconds), Date expect milliseconds
76
+ new Date(attributes.eventTimestamp * 1000)); // the DateTimePicker requires the date to be in this format
77
+ // we offset the date by the site timezone settings to counteract the Datepicker automatic adjustment to the client-side timezone
78
+
79
+ eventDate = moment__WEBPACK_IMPORTED_MODULE_4___default()(attributes.eventTimestamp * 1000).utcOffset(settings.timezone.offset * 60).format(TIMEZONELESS_FORMAT);
80
+ } else if (attributes.eventDate) {
81
+ // backwards compatibility
82
+ const siteTimeZoneAdjustedTime = assignTimezone(attributes.eventDate, Number.parseFloat(settings.timezone.offset) // offset can be a string if a manual timezone is selected
83
+ );
84
+ label = (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_2__.dateI18n)(settings.formats.datetimeAbbreviated, siteTimeZoneAdjustedTime);
85
+ eventDate = attributes.eventDate;
86
+ }
87
+
88
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Placeholder, {
89
+ label: __('Event Countdown', 'full-site-editing'),
90
+ instructions: __('Count down to an event. Set a title and pick a time and date.', 'full-site-editing'),
91
+ icon: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_icon__WEBPACK_IMPORTED_MODULE_5__/* .EventCountdownIcon */ .p, null),
92
+ className: className
93
+ }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("strong", null, __('Title:', 'full-site-editing')), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("br", null), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("input", {
94
+ type: "text",
95
+ value: attributes.eventTitle,
96
+ onChange: evt => setAttributes({
97
+ eventTitle: evt.target.value
98
+ }),
99
+ placeholder: __('Event Title', 'full-site-editing'),
100
+ className: "event-countdown__event-title",
101
+ "aria-label": __('Event Title', 'full-site-editing')
102
+ })), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("strong", null, __('Date:', 'full-site-editing')), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("br", null), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Dropdown, {
103
+ position: "bottom left",
104
+ renderToggle: _ref2 => {
105
+ let {
106
+ onToggle,
107
+ isOpen
108
+ } = _ref2;
109
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button, {
110
+ onClick: onToggle,
111
+ "aria-expanded": isOpen,
112
+ "aria-live": "polite",
113
+ isSecondary: true
114
+ }, label);
115
+ },
116
+ renderContent: () => (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.DateTimePicker, {
117
+ key: "event-countdown-picker",
118
+ onChange: date => setAttributes({
119
+ eventTimestamp: assignTimezone(date, settings.timezone.offset).unix()
120
+ }),
121
+ currentDate: eventDate
122
+ })
123
+ })));
124
+ };
125
+
126
+ /* harmony default export */ __webpack_exports__["Z"] = (edit);
127
+
128
+ /***/ }),
129
+
130
+ /***/ 515:
131
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
132
+
133
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
134
+ /* harmony export */ "p": function() { return /* binding */ EventCountdownIcon; }
135
+ /* harmony export */ });
136
+ /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(307);
137
+ /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
138
+ /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(609);
139
+ /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
140
+
141
+
142
+ const EventCountdownIcon = () => (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SVG, {
143
+ xmlns: "http://www.w3.org/2000/svg",
144
+ width: "24",
145
+ height: "24",
146
+ viewBox: "0 0 24 24"
147
+ }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Path, {
148
+ d: "M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z"
149
+ }));
150
+
151
+ /***/ }),
152
+
153
+ /***/ 196:
154
+ /***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
155
+
156
+ /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(981);
157
+ /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__);
158
+ /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(736);
159
+ /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
160
+ /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(829);
161
+ /* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(515);
162
+ /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(674);
163
+ /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(129);
164
+ /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(448);
165
+
166
+
167
+ const __ = _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__;
168
+
169
+
170
+
171
+
172
+
173
+ (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)('jetpack/event-countdown', {
174
+ title: __('Event Countdown', 'full-site-editing'),
175
+ description: __('Count down to your favorite next thing, and celebrate with fireworks when the time is right!', 'full-site-editing'),
176
+ icon: _icon__WEBPACK_IMPORTED_MODULE_3__/* .EventCountdownIcon */ .p,
177
+ category: 'widgets',
178
+ supports: {
179
+ align: ['wide', 'full']
180
+ },
181
+ example: {
182
+ attributes: {
183
+ eventTimestamp: 1318874398,
184
+ eventTitle: 'Total Solar Eclipse'
185
+ }
186
+ },
187
+ attributes: {
188
+ eventTitle: {
189
+ type: 'string',
190
+ source: 'text',
191
+ selector: '.event-countdown__event-title'
192
+ },
193
+ eventTimestamp: {
194
+ type: 'number'
195
+ }
196
+ },
197
+ edit: props => {
198
+ if (props.isSelected) {
199
+ return (0,_edit__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)(props);
200
+ }
201
+
202
+ return (0,_view__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)({ ...props,
203
+ isEditView: true
204
+ });
205
+ },
206
+ save: _view__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z,
207
+ deprecated: [{
208
+ attributes: {
209
+ eventTitle: {
210
+ type: 'string',
211
+ source: 'text',
212
+ selector: '.event-countdown__event-title'
213
+ },
214
+ eventDate: {
215
+ type: 'string'
216
+ }
217
+ },
218
+ // the new `view` function can handle the deprecated attributes
219
+ save: _view__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z
220
+ }]
221
+ });
222
+
223
+ /***/ }),
224
+
225
+ /***/ 674:
226
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
227
+
228
+ /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(307);
229
+ /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
230
+ /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(736);
231
+ /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
232
+
233
+
234
+ /* eslint-disable wpcalypso/jsx-classname-namespace */
235
+ // disabled CSS class rule due to existing code already
236
+ // that users the non-conformant classnames
237
+
238
+ const __ = _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__,
239
+ _x = _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__._x;
240
+
241
+ const view = _ref => {
242
+ let {
243
+ attributes,
244
+ className,
245
+ isEditView
246
+ } = _ref;
247
+ // Expected values in save.
248
+ let days = '&nbsp;';
249
+ let hours = '&nbsp;';
250
+ let mins = '&nbsp;';
251
+ let secs = '&nbsp;';
252
+
253
+ if (isEditView) {
254
+ // Zero out.
255
+ days = hours = mins = secs = 0;
256
+ let eventTime;
257
+
258
+ if (attributes.eventTimestamp) {
259
+ eventTime = attributes.eventTimestamp * 1000;
260
+ } else {
261
+ // backwards compatibility
262
+ eventTime = new Date(attributes.eventDate).getTime();
263
+ }
264
+
265
+ const now = Date.now();
266
+ const diff = eventTime - now;
267
+
268
+ if (diff > 0) {
269
+ // Convert diff to seconds.
270
+ let rem = Math.round(diff / 1000);
271
+ days = Math.floor(rem / (24 * 60 * 60));
272
+ rem = rem - days * 24 * 60 * 60;
273
+ hours = Math.floor(rem / (60 * 60));
274
+ rem = rem - hours * 60 * 60;
275
+ mins = Math.floor(rem / 60);
276
+ rem = rem - mins * 60;
277
+ secs = rem;
278
+ }
279
+ }
280
+
281
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
282
+ className: className
283
+ }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
284
+ className: "event-countdown__date"
285
+ }, attributes.eventTimestamp || attributes.eventDate), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
286
+ className: "event-countdown__counter"
287
+ }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("strong", {
288
+ className: "event-countdown__day"
289
+ }, days), ' ', _x('days', 'Countdown days remaining', 'full-site-editing')), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("strong", {
290
+ className: "event-countdown__hour"
291
+ }, hours), ' ', _x('hours', 'Countdown hours remaining', 'full-site-editing')), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("strong", {
292
+ className: "event-countdown__minute"
293
+ }, mins), ' ', _x('minutes', 'Countdown minutes remaining', 'full-site-editing')), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("strong", {
294
+ className: "event-countdown__second"
295
+ }, secs), ' ', _x('seconds', 'Countdown seconds remaining', 'full-site-editing'))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, __('until', 'full-site-editing'))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
296
+ className: "event-countdown__event-title"
297
+ }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, attributes.eventTitle)));
298
+ };
299
+
300
+ /* harmony default export */ __webpack_exports__["Z"] = (view);
301
+
302
+ /***/ }),
303
+
304
+ /***/ 292:
305
+ /***/ (function(module) {
306
+
307
+ module.exports = window["moment"];
308
+
309
+ /***/ }),
310
+
311
+ /***/ 981:
312
+ /***/ (function(module) {
313
+
314
+ module.exports = window["wp"]["blocks"];
315
+
316
+ /***/ }),
317
+
318
+ /***/ 609:
319
+ /***/ (function(module) {
320
+
321
+ module.exports = window["wp"]["components"];
322
+
323
+ /***/ }),
324
+
325
+ /***/ 771:
326
+ /***/ (function(module) {
327
+
328
+ module.exports = window["wp"]["date"];
329
+
330
+ /***/ }),
331
+
332
+ /***/ 307:
333
+ /***/ (function(module) {
334
+
335
+ module.exports = window["wp"]["element"];
336
+
337
+ /***/ }),
338
+
339
+ /***/ 736:
340
+ /***/ (function(module) {
341
+
342
+ module.exports = window["wp"]["i18n"];
343
+
344
+ /***/ })
345
+
346
+ /******/ });
347
+ /************************************************************************/
348
+ /******/ // The module cache
349
+ /******/ var __webpack_module_cache__ = {};
350
+ /******/
351
+ /******/ // The require function
352
+ /******/ function __webpack_require__(moduleId) {
353
+ /******/ // Check if module is in cache
354
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
355
+ /******/ if (cachedModule !== undefined) {
356
+ /******/ return cachedModule.exports;
357
+ /******/ }
358
+ /******/ // Create a new module (and put it into the cache)
359
+ /******/ var module = __webpack_module_cache__[moduleId] = {
360
+ /******/ // no module.id needed
361
+ /******/ // no module.loaded needed
362
+ /******/ exports: {}
363
+ /******/ };
364
+ /******/
365
+ /******/ // Execute the module function
366
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
367
+ /******/
368
+ /******/ // Return the exports of the module
369
+ /******/ return module.exports;
370
+ /******/ }
371
+ /******/
372
+ /************************************************************************/
373
+ /******/ /* webpack/runtime/compat get default export */
374
+ /******/ !function() {
375
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
376
+ /******/ __webpack_require__.n = function(module) {
377
+ /******/ var getter = module && module.__esModule ?
378
+ /******/ function() { return module['default']; } :
379
+ /******/ function() { return module; };
380
+ /******/ __webpack_require__.d(getter, { a: getter });
381
+ /******/ return getter;
382
+ /******/ };
383
+ /******/ }();
384
+ /******/
385
+ /******/ /* webpack/runtime/define property getters */
386
+ /******/ !function() {
387
+ /******/ // define getter functions for harmony exports
388
+ /******/ __webpack_require__.d = function(exports, definition) {
389
+ /******/ for(var key in definition) {
390
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
391
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
392
+ /******/ }
393
+ /******/ }
394
+ /******/ };
395
+ /******/ }();
396
+ /******/
397
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
398
+ /******/ !function() {
399
+ /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
400
+ /******/ }();
401
+ /******/
402
+ /******/ /* webpack/runtime/make namespace object */
403
+ /******/ !function() {
404
+ /******/ // define __esModule on exports
405
+ /******/ __webpack_require__.r = function(exports) {
406
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
407
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
408
+ /******/ }
409
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
410
+ /******/ };
411
+ /******/ }();
412
+ /******/
413
+ /************************************************************************/
414
+ var __webpack_exports__ = {};
415
+ // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
416
+ !function() {
417
+ __webpack_require__.r(__webpack_exports__);
418
+ /* harmony import */ var _blocks_src_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(196);
419
+
420
+ }();
421
+ window.EditingToolkit = __webpack_exports__;
422
+ /******/ })()
423
+ ;
full-site-editing-plugin.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: WordPress.com Editing Toolkit
4
  * Description: Enhances your page creation workflow within the Block Editor.
5
- * Version: 3.35292
6
  * Author: Automattic
7
  * Author URI: https://automattic.com/wordpress-plugins/
8
  * License: GPLv2 or later
@@ -42,7 +42,7 @@ namespace A8C\FSE;
42
  *
43
  * @var string
44
  */
45
- define( 'A8C_ETK_PLUGIN_VERSION', '3.35292' );
46
 
47
  // Always include these helper files for dotcom FSE.
48
  require_once __DIR__ . '/dotcom-fse/helpers.php';
2
  /**
3
  * Plugin Name: WordPress.com Editing Toolkit
4
  * Description: Enhances your page creation workflow within the Block Editor.
5
+ * Version: 3.35311
6
  * Author: Automattic
7
  * Author URI: https://automattic.com/wordpress-plugins/
8
  * License: GPLv2 or later
42
  *
43
  * @var string
44
  */
45
+ define( 'A8C_ETK_PLUGIN_VERSION', '3.35311' );
46
 
47
  // Always include these helper files for dotcom FSE.
48
  require_once __DIR__ . '/dotcom-fse/helpers.php';
global-styles/dist/customizer-fonts.js ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******/ (function() { // webpackBootstrap
2
+ var __webpack_exports__ = {};
3
+ function recordTracksEvent(tracksEventName) {
4
+ window.parent.window._tkq = window.parent.window._tkq || [];
5
+
6
+ if (window.tracks_events_fonts_section_control_variables.user_id) {
7
+ window.parent.window._tkq.push(['identifyUser', Number(window.tracks_events_fonts_section_control_variables.user_id), `${window.tracks_events_fonts_section_control_variables.user_login}`]);
8
+ }
9
+
10
+ window.parent.window._tkq.push(['recordEvent', tracksEventName]);
11
+ }
12
+
13
+ const customizerGlobalStylesBlockEditorLinkElem = window.parent.document.getElementById('customizer_global_styles_block_editor_link');
14
+
15
+ if (customizerGlobalStylesBlockEditorLinkElem) {
16
+ customizerGlobalStylesBlockEditorLinkElem.onclick = function () {
17
+ recordTracksEvent('calypso_customizer_global_styles_block_editor_link_clicked');
18
+ };
19
+ }
20
+
21
+ const customizerGlobalStylesSupportLinkElem = window.parent.document.getElementById('customizer_global_styles_support_link');
22
+
23
+ if (customizerGlobalStylesSupportLinkElem) {
24
+ customizerGlobalStylesSupportLinkElem.onclick = function () {
25
+ recordTracksEvent('calypso_customizer_global_styles_support_link_clicked');
26
+ };
27
+ }
28
+ window.EditingToolkit = __webpack_exports__;
29
+ /******/ })()
30
+ ;
global-styles/dist/global-styles.js ADDED
@@ -0,0 +1,881 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******/ (function() { // webpackBootstrap
2
+ /******/ var __webpack_modules__ = ({
3
+
4
+ /***/ 107:
5
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6
+
7
+ "use strict";
8
+ /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(307);
9
+ /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
10
+ /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(444);
11
+ /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
12
+
13
+
14
+ /**
15
+ * WordPress dependencies
16
+ */
17
+
18
+ const typography = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__.SVG, {
19
+ xmlns: "http://www.w3.org/2000/svg",
20
+ viewBox: "0 0 24 24"
21
+ }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__.Path, {
22
+ d: "M6.9 7L3 17.8h1.7l1-2.8h4.1l1 2.8h1.7L8.6 7H6.9zm-.7 6.6l1.5-4.3 1.5 4.3h-3zM21.6 17c-.1.1-.2.2-.3.2-.1.1-.2.1-.4.1s-.3-.1-.4-.2c-.1-.1-.1-.3-.1-.6V12c0-.5 0-1-.1-1.4-.1-.4-.3-.7-.5-1-.2-.2-.5-.4-.9-.5-.4 0-.8-.1-1.3-.1s-1 .1-1.4.2c-.4.1-.7.3-1 .4-.2.2-.4.3-.6.5-.1.2-.2.4-.2.7 0 .3.1.5.2.8.2.2.4.3.8.3.3 0 .6-.1.8-.3.2-.2.3-.4.3-.7 0-.3-.1-.5-.2-.7-.2-.2-.4-.3-.6-.4.2-.2.4-.3.7-.4.3-.1.6-.1.8-.1.3 0 .6 0 .8.1.2.1.4.3.5.5.1.2.2.5.2.9v1.1c0 .3-.1.5-.3.6-.2.2-.5.3-.9.4-.3.1-.7.3-1.1.4-.4.1-.8.3-1.1.5-.3.2-.6.4-.8.7-.2.3-.3.7-.3 1.2 0 .6.2 1.1.5 1.4.3.4.9.5 1.6.5.5 0 1-.1 1.4-.3.4-.2.8-.6 1.1-1.1 0 .4.1.7.3 1 .2.3.6.4 1.2.4.4 0 .7-.1.9-.2.2-.1.5-.3.7-.4h-.3zm-3-.9c-.2.4-.5.7-.8.8-.3.2-.6.2-.8.2-.4 0-.6-.1-.9-.3-.2-.2-.3-.6-.3-1.1 0-.5.1-.9.3-1.2s.5-.5.8-.7c.3-.2.7-.3 1-.5.3-.1.6-.3.7-.6v3.4z"
23
+ }));
24
+ /* harmony default export */ __webpack_exports__["Z"] = (typography);
25
+ //# sourceMappingURL=typography.js.map
26
+
27
+ /***/ }),
28
+
29
+ /***/ 779:
30
+ /***/ (function(module, exports) {
31
+
32
+ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
33
+ Copyright (c) 2018 Jed Watson.
34
+ Licensed under the MIT License (MIT), see
35
+ http://jedwatson.github.io/classnames
36
+ */
37
+ /* global define */
38
+
39
+ (function () {
40
+ 'use strict';
41
+
42
+ var hasOwn = {}.hasOwnProperty;
43
+
44
+ function classNames() {
45
+ var classes = [];
46
+
47
+ for (var i = 0; i < arguments.length; i++) {
48
+ var arg = arguments[i];
49
+ if (!arg) continue;
50
+
51
+ var argType = typeof arg;
52
+
53
+ if (argType === 'string' || argType === 'number') {
54
+ classes.push(arg);
55
+ } else if (Array.isArray(arg)) {
56
+ if (arg.length) {
57
+ var inner = classNames.apply(null, arg);
58
+ if (inner) {
59
+ classes.push(inner);
60
+ }
61
+ }
62
+ } else if (argType === 'object') {
63
+ if (arg.toString === Object.prototype.toString) {
64
+ for (var key in arg) {
65
+ if (hasOwn.call(arg, key) && arg[key]) {
66
+ classes.push(key);
67
+ }
68
+ }
69
+ } else {
70
+ classes.push(arg.toString());
71
+ }
72
+ }
73
+ }
74
+
75
+ return classes.join(' ');
76
+ }
77
+
78
+ if ( true && module.exports) {
79
+ classNames.default = classNames;
80
+ module.exports = classNames;
81
+ } else if (true) {
82
+ // register as 'classnames', consistent with npm package name
83
+ !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
84
+ return classNames;
85
+ }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
86
+ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
87
+ } else {}
88
+ }());
89
+
90
+
91
+ /***/ }),
92
+
93
+ /***/ 318:
94
+ /***/ (function() {
95
+
96
+ "use strict";
97
+ // extracted by mini-css-extract-plugin
98
+
99
+
100
+ /***/ }),
101
+
102
+ /***/ 682:
103
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
104
+
105
+ "use strict";
106
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
107
+ /* harmony export */ "iU": function() { return /* binding */ FONT_BASE; },
108
+ /* harmony export */ "V6": function() { return /* binding */ FONT_BASE_DEFAULT; },
109
+ /* harmony export */ "GK": function() { return /* binding */ FONT_HEADINGS; },
110
+ /* harmony export */ "c$": function() { return /* binding */ FONT_HEADINGS_DEFAULT; },
111
+ /* harmony export */ "R$": function() { return /* binding */ FONT_PAIRINGS; },
112
+ /* harmony export */ "qD": function() { return /* binding */ FONT_OPTIONS; },
113
+ /* harmony export */ "px": function() { return /* binding */ SITE_NAME; }
114
+ /* harmony export */ });
115
+ const FONT_BASE = 'font_base';
116
+ const FONT_BASE_DEFAULT = 'font_base_default';
117
+ const FONT_HEADINGS = 'font_headings';
118
+ const FONT_HEADINGS_DEFAULT = 'font_headings_default';
119
+ const FONT_PAIRINGS = 'font_pairings';
120
+ const FONT_OPTIONS = 'font_options';
121
+ const SITE_NAME = 'blogname';
122
+
123
+ /***/ }),
124
+
125
+ /***/ 517:
126
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
127
+
128
+ "use strict";
129
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(818);
130
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
131
+ /* harmony import */ var _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(701);
132
+ /* harmony import */ var _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_1__);
133
+ /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(819);
134
+ /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);
135
+
136
+
137
+
138
+ /**
139
+ * DOM updater
140
+ *
141
+ * @param {string[]} options A list of option names to keep track of.
142
+ * @param {Function} getOptionValue A function that given an option name as a string, returns the current option value.
143
+ */
144
+
145
+ /* harmony default export */ __webpack_exports__["Z"] = ((options, getOptionValue) => {
146
+ _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_1___default()(() => {
147
+ // Book-keeping.
148
+ const currentOptions = {};
149
+ let previousOptions = {};
150
+ const cssVariables = {};
151
+ options.forEach(option => {
152
+ cssVariables[option] = `--${option.replace('_', '-')}`;
153
+ });
154
+ let styleElement = null;
155
+ (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.subscribe)(() => {
156
+ /**
157
+ * Do nothing until the editor is ready. This is required when
158
+ * working in wpcom iframe environment to avoid running code before
159
+ * everything has loaded, which can cause bugs like the following.
160
+ *
161
+ * @see https://github.com/Automattic/wp-calypso/pull/40690
162
+ */
163
+ const isEditorReady = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)('core/editor').__unstableIsEditorReady;
164
+
165
+ if (isEditorReady && isEditorReady() === false) {
166
+ return;
167
+ } // Create style element if it has not been created yet. Must happen
168
+ // after the editor is ready or the style element will be appended
169
+ // before the styles it needs to affect.
170
+
171
+
172
+ if (!styleElement) {
173
+ styleElement = document.createElement('style');
174
+ document.body.appendChild(styleElement);
175
+ } // Maybe bail-out early.
176
+
177
+
178
+ options.forEach(option => {
179
+ currentOptions[option] = getOptionValue(option);
180
+ });
181
+
182
+ if ((0,lodash__WEBPACK_IMPORTED_MODULE_2__.isEmpty)(currentOptions) || (0,lodash__WEBPACK_IMPORTED_MODULE_2__.isEqual)(currentOptions, previousOptions)) {
183
+ return;
184
+ }
185
+
186
+ previousOptions = { ...currentOptions
187
+ }; // Update style node. We need this to be a stylesheet rather than inline styles
188
+ // so the styles apply to all editor instances incl. previews.
189
+
190
+ let declarationList = '';
191
+ Object.keys(currentOptions).forEach(key => {
192
+ declarationList += `${cssVariables[key]}:${currentOptions[key]};`;
193
+ });
194
+ styleElement.textContent = `.edit-post-visual-editor .editor-styles-wrapper{${declarationList}}`;
195
+ });
196
+ });
197
+ });
198
+
199
+ /***/ }),
200
+
201
+ /***/ 296:
202
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
203
+
204
+ "use strict";
205
+ /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(307);
206
+ /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
207
+ /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(609);
208
+ /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
209
+ /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(736);
210
+ /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
211
+ /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(630);
212
+ /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_3__);
213
+ /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(779);
214
+ /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_4__);
215
+ /* harmony import */ var _no_support__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(409);
216
+
217
+
218
+
219
+ const __ = _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__;
220
+
221
+
222
+
223
+ /* harmony default export */ __webpack_exports__["Z"] = (_ref => {
224
+ let {
225
+ fontPairings,
226
+ fontBase,
227
+ fontHeadings,
228
+ update
229
+ } = _ref;
230
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("h3", null, __('Font Pairings', 'full-site-editing')), fontPairings && fontHeadings && fontBase ? (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
231
+ className: "style-preview__font-options"
232
+ }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
233
+ className: "style-preview__font-options-desktop"
234
+ }, fontPairings.map(_ref2 => {
235
+ let {
236
+ label,
237
+ headings,
238
+ base
239
+ } = _ref2;
240
+ const isSelected = headings === fontHeadings && base === fontBase;
241
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button, {
242
+ className: classnames__WEBPACK_IMPORTED_MODULE_4___default()('style-preview__font-option', {
243
+ 'is-selected': isSelected
244
+ }),
245
+ onClick: () => update({
246
+ headings,
247
+ base
248
+ }),
249
+ onKeyDown: event => event.keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_3__.ENTER ? update({
250
+ headings,
251
+ base
252
+ }) : null,
253
+ key: label
254
+ }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
255
+ className: "style-preview__font-option-contents"
256
+ }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
257
+ style: {
258
+ fontFamily: headings,
259
+ fontWeight: 700
260
+ }
261
+ }, headings), "\xA0/\xA0", (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
262
+ style: {
263
+ fontFamily: base
264
+ }
265
+ }, base)));
266
+ }))) : (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_no_support__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {
267
+ unsupportedFeature: __('font pairings', 'full-site-editing')
268
+ }));
269
+ });
270
+
271
+ /***/ }),
272
+
273
+ /***/ 529:
274
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
275
+
276
+ "use strict";
277
+ /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(307);
278
+ /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
279
+ /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(609);
280
+ /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
281
+ /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(736);
282
+ /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
283
+ /* harmony import */ var _no_support__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(409);
284
+
285
+
286
+
287
+ const __ = _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__;
288
+
289
+ /* harmony default export */ __webpack_exports__["Z"] = (_ref => {
290
+ let {
291
+ fontBase,
292
+ fontBaseDefault,
293
+ fontHeadings,
294
+ fontHeadingsDefault,
295
+ fontBaseOptions,
296
+ fontHeadingsOptions,
297
+ updateBaseFont,
298
+ updateHeadingsFont
299
+ } = _ref;
300
+
301
+ if (!fontBaseOptions || !fontHeadingsOptions) {
302
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_no_support__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
303
+ unsupportedFeature: __('custom font selection', 'full-site-editing')
304
+ });
305
+ }
306
+
307
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SelectControl, {
308
+ label: __('Heading Font', 'full-site-editing'),
309
+ value: fontHeadings,
310
+ options: fontHeadingsOptions,
311
+ onChange: newValue => updateHeadingsFont(newValue),
312
+ style: {
313
+ fontFamily: fontHeadings !== 'unset' ? fontHeadings : fontHeadingsDefault
314
+ }
315
+ }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SelectControl, {
316
+ label: __('Base Font', 'full-site-editing'),
317
+ value: fontBase,
318
+ options: fontBaseOptions,
319
+ onChange: newValue => updateBaseFont(newValue),
320
+ style: {
321
+ fontFamily: fontBase !== 'unset' ? fontBase : fontBaseDefault
322
+ }
323
+ }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("hr", null));
324
+ });
325
+
326
+ /***/ }),
327
+
328
+ /***/ 464:
329
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
330
+
331
+ "use strict";
332
+ /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(307);
333
+ /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
334
+ /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(609);
335
+ /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
336
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(818);
337
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__);
338
+ /* harmony import */ var _wordpress_edit_post__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(67);
339
+ /* harmony import */ var _wordpress_edit_post__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_edit_post__WEBPACK_IMPORTED_MODULE_3__);
340
+ /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(736);
341
+ /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
342
+ /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(107);
343
+ /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(483);
344
+ /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_5__);
345
+ /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(682);
346
+ /* harmony import */ var _font_pairings_panel__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(296);
347
+ /* harmony import */ var _font_selection_panel__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(529);
348
+
349
+
350
+
351
+
352
+
353
+
354
+ const __ = _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__;
355
+
356
+
357
+
358
+
359
+
360
+ const ANY_PROPERTY = 'ANY_PROPERTY';
361
+
362
+ const isFor = filterProperty => option => option.prop === ANY_PROPERTY || option.prop === filterProperty;
363
+
364
+ const toOption = font => {
365
+ if (typeof font === 'object') {
366
+ const {
367
+ label,
368
+ value,
369
+ prop = ANY_PROPERTY
370
+ } = font;
371
+ return {
372
+ label,
373
+ value,
374
+ prop
375
+ };
376
+ }
377
+
378
+ return {
379
+ label: font,
380
+ value: font,
381
+ prop: ANY_PROPERTY
382
+ };
383
+ };
384
+
385
+ const isNotNull = option => option.value !== null && option.label !== null;
386
+
387
+ const toOptions = (options, filterProperty) => !options ? [] : options.map(toOption).filter(isNotNull).filter(isFor(filterProperty));
388
+
389
+ const PanelActionButtons = _ref => {
390
+ let {
391
+ hasLocalChanges,
392
+ resetAction,
393
+ publishAction,
394
+ className = null
395
+ } = _ref;
396
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
397
+ className: className
398
+ }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button, {
399
+ disabled: !hasLocalChanges,
400
+ isDefault: true,
401
+ onClick: resetAction
402
+ }, __('Reset', 'full-site-editing')), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button, {
403
+ className: 'global-styles-sidebar__publish-button',
404
+ disabled: !hasLocalChanges,
405
+ isPrimary: true,
406
+ onClick: publishAction
407
+ }, __('Publish', 'full-site-editing')));
408
+ };
409
+
410
+ function maybeOpenSidebar() {
411
+ const openSidebar = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_5__.getQueryArg)(window.location.href, 'openSidebar');
412
+
413
+ if ('global-styles' === openSidebar) {
414
+ (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.dispatch)('core/edit-post').openGeneralSidebar('jetpack-global-styles/global-styles');
415
+ }
416
+ }
417
+
418
+ /* harmony default export */ __webpack_exports__["Z"] = (_ref2 => {
419
+ let {
420
+ fontHeadings,
421
+ fontHeadingsDefault,
422
+ fontBase,
423
+ fontBaseDefault,
424
+ fontPairings,
425
+ fontOptions,
426
+ siteName,
427
+ publishOptions,
428
+ updateOptions,
429
+ hasLocalChanges,
430
+ resetLocalChanges
431
+ } = _ref2;
432
+ (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
433
+ maybeOpenSidebar();
434
+ }, []);
435
+
436
+ const publish = () => publishOptions({
437
+ [_constants__WEBPACK_IMPORTED_MODULE_6__/* .FONT_BASE */ .iU]: fontBase,
438
+ [_constants__WEBPACK_IMPORTED_MODULE_6__/* .FONT_HEADINGS */ .GK]: fontHeadings
439
+ });
440
+
441
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_edit_post__WEBPACK_IMPORTED_MODULE_3__.PluginSidebarMoreMenuItem, {
442
+ icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z,
443
+ target: "global-styles"
444
+ }, __('Global Styles', 'full-site-editing')), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_edit_post__WEBPACK_IMPORTED_MODULE_3__.PluginSidebar, {
445
+ icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z,
446
+ name: 'global-styles',
447
+ title: __('Global Styles', 'full-site-editing'),
448
+ className: "global-styles-sidebar"
449
+ }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelBody, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null,
450
+ /* translators: %s: Name of site. */
451
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.sprintf)(__('You are customizing %s.', 'full-site-editing'), siteName)), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, __('Any change you make here will apply to the entire website.', 'full-site-editing')), hasLocalChanges ? (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("em", null, __('You have unsaved changes.', 'full-site-editing'))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(PanelActionButtons, {
452
+ hasLocalChanges: hasLocalChanges,
453
+ publishAction: publish,
454
+ resetAction: resetLocalChanges
455
+ })) : null), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelBody, {
456
+ title: __('Font Selection', 'full-site-editing')
457
+ }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_font_selection_panel__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z, {
458
+ fontBase: fontBase,
459
+ fontBaseDefault: fontBaseDefault,
460
+ fontHeadings: fontHeadings,
461
+ fontHeadingsDefault: fontHeadingsDefault,
462
+ fontBaseOptions: toOptions(fontOptions, _constants__WEBPACK_IMPORTED_MODULE_6__/* .FONT_BASE */ .iU),
463
+ fontHeadingsOptions: toOptions(fontOptions, _constants__WEBPACK_IMPORTED_MODULE_6__/* .FONT_HEADINGS */ .GK),
464
+ updateBaseFont: value => updateOptions({
465
+ [_constants__WEBPACK_IMPORTED_MODULE_6__/* .FONT_BASE */ .iU]: value
466
+ }),
467
+ updateHeadingsFont: value => updateOptions({
468
+ [_constants__WEBPACK_IMPORTED_MODULE_6__/* .FONT_HEADINGS */ .GK]: value
469
+ })
470
+ }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_font_pairings_panel__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z, {
471
+ fontHeadings: fontHeadings,
472
+ fontBase: fontBase,
473
+ fontPairings: fontPairings,
474
+ update: _ref3 => {
475
+ let {
476
+ headings,
477
+ base
478
+ } = _ref3;
479
+ return updateOptions({
480
+ [_constants__WEBPACK_IMPORTED_MODULE_6__/* .FONT_HEADINGS */ .GK]: headings,
481
+ [_constants__WEBPACK_IMPORTED_MODULE_6__/* .FONT_BASE */ .iU]: base
482
+ });
483
+ }
484
+ })), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelBody, null, hasLocalChanges ? (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("em", null, __('You have unsaved changes.', 'full-site-editing'))) : null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(PanelActionButtons, {
485
+ hasLocalChanges: hasLocalChanges,
486
+ publishAction: publish,
487
+ resetAction: resetLocalChanges,
488
+ className: 'global-styles-sidebar__panel-action-buttons'
489
+ }))));
490
+ });
491
+
492
+ /***/ }),
493
+
494
+ /***/ 409:
495
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
496
+
497
+ "use strict";
498
+ /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(307);
499
+ /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
500
+ /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(736);
501
+ /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
502
+
503
+
504
+ const __ = _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__;
505
+ /* harmony default export */ __webpack_exports__["Z"] = (_ref => {
506
+ let {
507
+ unsupportedFeature
508
+ } = _ref;
509
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(
510
+ /* translators: %s: feature name (i.e. font pairings, etc) */
511
+ __("Your active theme doesn't support %s.", 'full-site-editing'), unsupportedFeature));
512
+ });
513
+
514
+ /***/ }),
515
+
516
+ /***/ 942:
517
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
518
+
519
+ "use strict";
520
+ /* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(989);
521
+ /* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0__);
522
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(818);
523
+ /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__);
524
+
525
+
526
+ let cache = {};
527
+ let alreadyFetchedOptions = false;
528
+ const actions = {
529
+ *publishOptions(options) {
530
+ yield {
531
+ type: 'IO_PUBLISH_OPTIONS',
532
+ options
533
+ };
534
+ return {
535
+ type: 'PUBLISH_OPTIONS',
536
+ options
537
+ };
538
+ },
539
+
540
+ updateOptions(options) {
541
+ return {
542
+ type: 'UPDATE_OPTIONS',
543
+ options
544
+ };
545
+ },
546
+
547
+ fetchOptions() {
548
+ return {
549
+ type: 'IO_FETCH_OPTIONS'
550
+ };
551
+ },
552
+
553
+ resetLocalChanges() {
554
+ return {
555
+ type: 'RESET_OPTIONS',
556
+ options: cache
557
+ };
558
+ }
559
+
560
+ };
561
+ /**
562
+ * Store API
563
+ *
564
+ * Selectors under `wp.data.select( STORE_NAME )`:
565
+ *
566
+ * - getOption( String optionName )
567
+ * - hasLocalChanges()
568
+ *
569
+ * Actions under `wp.data.dispatch( STORE_NAME )`:
570
+ *
571
+ * - updateOptions( Object optionsToUpdate )
572
+ * - publishOptions( Object optionsToUpdate )
573
+ * - resetLocalChanges()
574
+ *
575
+ * @param {string} storeName Name of the store.
576
+ * @param {string} optionsPath REST path used to interact with the options API.
577
+ */
578
+
579
+ /* harmony default export */ __webpack_exports__["Z"] = ((storeName, optionsPath) => {
580
+ (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.registerStore)(storeName, {
581
+ reducer(state, action) {
582
+ switch (action.type) {
583
+ case 'UPDATE_OPTIONS':
584
+ case 'RESET_OPTIONS':
585
+ case 'PUBLISH_OPTIONS':
586
+ return { ...state,
587
+ ...action.options
588
+ };
589
+ }
590
+
591
+ return state;
592
+ },
593
+
594
+ actions,
595
+ selectors: {
596
+ getOption(state, key) {
597
+ return state ? state[key] : undefined;
598
+ },
599
+
600
+ hasLocalChanges(state) {
601
+ return !!state && Object.keys(cache).some(key => cache[key] !== state[key]);
602
+ }
603
+
604
+ },
605
+ resolvers: {
606
+ // eslint-disable-next-line no-unused-vars
607
+ *getOption(key) {
608
+ if (alreadyFetchedOptions) {
609
+ return; // do nothing
610
+ }
611
+
612
+ let options;
613
+
614
+ try {
615
+ alreadyFetchedOptions = true;
616
+ options = yield actions.fetchOptions();
617
+ } catch (error) {
618
+ options = {};
619
+ }
620
+
621
+ cache = options;
622
+ return {
623
+ type: 'UPDATE_OPTIONS',
624
+ options
625
+ };
626
+ }
627
+
628
+ },
629
+ controls: {
630
+ IO_FETCH_OPTIONS() {
631
+ return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default()({
632
+ path: optionsPath
633
+ });
634
+ },
635
+
636
+ IO_PUBLISH_OPTIONS(_ref) {
637
+ let {
638
+ options
639
+ } = _ref;
640
+ cache = options; // optimistically update the cache
641
+
642
+ return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default()({
643
+