@bigbinary/neeto-commons-frontend 2.0.38 → 2.0.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/react-utils.js CHANGED
@@ -1,23 +1,24 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { useState, useEffect, useDebugValue, useRef, useImperativeHandle, forwardRef } from 'react';
3
- import { Button, Callout, Typography, Dropdown, Input, Label, Checkbox, Toastr, Tag, Pane, PageLoader, Table, NoData, Alert, Tooltip, Spinner, Switch, Kbd, Select, Modal } from '@bigbinary/neetoui';
3
+ import { Button, Callout, Typography, Dropdown, Input, Label, Checkbox, Tag, Pane, PageLoader, Table, NoData, Alert, Tooltip, Spinner, Switch, Kbd, Select, Toastr, Modal } from '@bigbinary/neetoui';
4
4
  import i18next, { t as t$1 } from 'i18next';
5
- import { mergeLeft, curryN, isNil, complement as complement$1, isEmpty, either as either$1, curry, includes, __, filter, trim, toLower, identity, without, append, prop as prop$1, toPairs, pipe, omit, fromPairs, keys, values, last as last$1, pluck, any, uniq, intersection, difference, pick, assoc, not as not$2 } from 'ramda';
5
+ import { mergeLeft, isNil, curryN, either as either$1, isEmpty, curry, complement as complement$1, includes, __, filter, trim, toLower, identity, without, append, prop as prop$1, toPairs, fromPairs, keys, values, last as last$1, pluck, any, uniq, intersection, difference, pick, assoc, not as not$2 } from 'ramda';
6
6
  import { Trans, useTranslation } from 'react-i18next';
7
- import { Search, MenuHorizontal, Info as Info$3, Copy, Check, Close, Delete, Edit, Plus, Help, ExternalLink, Undo, MenuVertical, Clock, Facebook, Linkedin, Twitter, QrCode, ChatBubble, LeftArrow as LeftArrow$1, User, Settings } from '@bigbinary/neeto-icons';
7
+ import { removeBy as removeBy$1, isNotEmpty, snakeToCamelCase, capitalize, noop as noop$2, findIndexBy, isPresent, isNotPresent as isNotPresent$1, slugify } from '@bigbinary/neeto-commons-frontend/pure';
8
+ import { Search, MenuHorizontal, Info as Info$3, Copy, Check, Close, Delete, Edit, Plus, Help, ExternalLink, Undo, MenuVertical, Clock, Facebook, Linkedin, Twitter, QrCode, ChatBubble, Keyboard, LeftArrow as LeftArrow$1, User, Settings } from '@bigbinary/neeto-icons';
8
9
  import { Container, Header as Header$1, SubHeader, Sidebar as Sidebar$1, AppSwitcher } from '@bigbinary/neetoui/layouts';
9
10
  import { Input as Input$1, Form as Form$2, Button as Button$1, MultiEmailInput, Select as Select$1, Checkbox as Checkbox$1 } from '@bigbinary/neetoui/formik';
10
11
  import { Formik, Form as Form$1, FieldArray, ErrorMessage, useFormikContext } from 'formik';
11
12
  import * as yup from 'yup';
12
- import require$$0$2 from 'util';
13
- import dayjs from 'dayjs';
14
- import relativeTime from 'dayjs/plugin/relativeTime';
15
- import updateLocale from 'dayjs/plugin/updateLocale';
13
+ import { joinHyphenCase, copyToClipboard, timeFormat as timeFormat$1, buildUrl, resetAuthTokens } from '@bigbinary/neeto-commons-frontend/utils';
16
14
  import { useQueryClient, useMutation, useQuery, QueryClient, QueryClientProvider } from 'react-query';
17
15
  import axios$1 from 'axios';
18
16
  import { Honeybadger, HoneybadgerErrorBoundary as HoneybadgerErrorBoundary$1 } from '@honeybadger-io/react';
19
17
  import { manager } from '@bigbinary/neetoui/managers';
20
18
  import { Route, Redirect, useLocation } from 'react-router-dom';
19
+ import dayjs from 'dayjs';
20
+ import relativeTime from 'dayjs/plugin/relativeTime';
21
+ import updateLocale from 'dayjs/plugin/updateLocale';
21
22
  import customParseFormat from 'dayjs/plugin/customParseFormat';
22
23
  import timezone from 'dayjs/plugin/timezone';
23
24
  import utc from 'dayjs/plugin/utc';
@@ -1515,6 +1516,28 @@ function _extends$4() {
1515
1516
  return _extends$4.apply(this, arguments);
1516
1517
  }
1517
1518
 
1519
+ var getStorageValue = function getStorageValue(key, defaultValue) {
1520
+ if (key in localStorage) return JSON.parse(localStorage.getItem(key));
1521
+ return defaultValue;
1522
+ };
1523
+ var useLocalStorage = function useLocalStorage(key, defaultValue) {
1524
+ var _useState = useState(function () {
1525
+ return getStorageValue(key, defaultValue);
1526
+ }),
1527
+ _useState2 = _slicedToArray(_useState, 2),
1528
+ storedValue = _useState2[0],
1529
+ setStoredValue = _useState2[1];
1530
+ var setValue = function setValue(value) {
1531
+ if (isNil(value)) {
1532
+ localStorage.removeItem(key);
1533
+ } else {
1534
+ localStorage.setItem(key, JSON.stringify(value));
1535
+ }
1536
+ setStoredValue(value);
1537
+ };
1538
+ return [storedValue, setValue];
1539
+ };
1540
+
1518
1541
  function _typeof$1(obj) {
1519
1542
  "@babel/helpers - typeof";
1520
1543
 
@@ -1540,33 +1563,13 @@ var nullSafe = function nullSafe(func) {
1540
1563
  })
1541
1564
  );
1542
1565
  };
1543
- var noop$2 = function noop() {};
1544
1566
  var toLabelAndValue = function toLabelAndValue(string) {
1545
1567
  return {
1546
1568
  label: string,
1547
1569
  value: string
1548
1570
  };
1549
1571
  };
1550
- var isNotEmpty = /*#__PURE__*/complement$1(isEmpty);
1551
1572
  var isNotPresent = /*#__PURE__*/either$1(isNil, isEmpty);
1552
- var isPresent = /*#__PURE__*/complement$1(isNotPresent);
1553
-
1554
- var slugify = function slugify(string) {
1555
- return string.toString().toLowerCase().replace(/\s+/g, "-") // Replace spaces with -
1556
- .replace(/&/g, "-and-") // Replace & with 'and'
1557
- .replace(/[^\w-]+/g, "") // Remove all non-word characters
1558
- .replace(/--+/g, "-") // Replace multiple - with single -
1559
- .replace(/^-+/, "") // Trim - from start of text
1560
- .replace(/-+$/, "");
1561
- }; // Trim - from end of text
1562
- var snakeToCamelCase = function snakeToCamelCase(string) {
1563
- return string.replace(/(_\w)/g, function (letter) {
1564
- return letter[1].toUpperCase();
1565
- });
1566
- };
1567
- var capitalize = function capitalize(string) {
1568
- return string.charAt(0).toUpperCase() + string.slice(1);
1569
- };
1570
1573
 
1571
1574
  var matchesImpl = function matchesImpl(pattern, object) {
1572
1575
  var __parent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : object;
@@ -1581,32 +1584,6 @@ var matchesImpl = function matchesImpl(pattern, object) {
1581
1584
  return matchesImpl(value, object[key], __parent);
1582
1585
  });
1583
1586
  };
1584
- var transformObjectDeep = function transformObjectDeep(object, keyValueTransformer) {
1585
- var objectPreProcessor = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
1586
- if (objectPreProcessor && typeof objectPreProcessor === "function") {
1587
- object = objectPreProcessor(object);
1588
- }
1589
- if (Array.isArray(object)) {
1590
- return object.map(function (obj) {
1591
- return transformObjectDeep(obj, keyValueTransformer, objectPreProcessor);
1592
- });
1593
- } else if (object === null || _typeof$1(object) !== "object") {
1594
- return object;
1595
- }
1596
- return Object.fromEntries(Object.entries(object).map(function (_ref3) {
1597
- var _ref4 = _slicedToArray(_ref3, 2),
1598
- key = _ref4[0],
1599
- value = _ref4[1];
1600
- return keyValueTransformer(key, transformObjectDeep(value, keyValueTransformer, objectPreProcessor));
1601
- }));
1602
- };
1603
- var preprocessForSerialization = function preprocessForSerialization(object) {
1604
- return transformObjectDeep(object, function (key, value) {
1605
- return [key, value];
1606
- }, function (object) {
1607
- return typeof (object === null || object === void 0 ? void 0 : object.toJSON) === "function" ? object.toJSON() : object;
1608
- });
1609
- };
1610
1587
  var matches = /*#__PURE__*/curry(function (pattern, object) {
1611
1588
  return matchesImpl(pattern, object);
1612
1589
  });
@@ -1658,31 +1635,6 @@ function _defineProperty(obj, key, value) {
1658
1635
  var removeBy = /*#__PURE__*/curry(function (pattern, array) {
1659
1636
  return array.filter(complement$1(matches(pattern)));
1660
1637
  });
1661
- var findIndexBy = /*#__PURE__*/curry(function (pattern, array) {
1662
- return array.findIndex(matches(pattern));
1663
- });
1664
-
1665
- var getStorageValue = function getStorageValue(key, defaultValue) {
1666
- var saved = localStorage.getItem(key);
1667
- return JSON.parse(saved) || defaultValue;
1668
- };
1669
- var useLocalStorage = function useLocalStorage(key, defaultValue) {
1670
- var _useState = useState(function () {
1671
- return getStorageValue(key, defaultValue);
1672
- }),
1673
- _useState2 = _slicedToArray(_useState, 2),
1674
- storedValue = _useState2[0],
1675
- setStoredValue = _useState2[1];
1676
- var setValue = function setValue(value) {
1677
- if (isNil(value)) {
1678
- localStorage.removeItem(key);
1679
- } else {
1680
- localStorage.setItem(key, JSON.stringify(value));
1681
- }
1682
- setStoredValue(value);
1683
- };
1684
- return [storedValue, setValue];
1685
- };
1686
1638
 
1687
1639
  var removeFixedColumns = function removeFixedColumns(fixedColumns, columnData) {
1688
1640
  return removeBy({
@@ -1740,7 +1692,7 @@ var Columns = function Columns(_ref) {
1740
1692
  return setSearchTerm(value);
1741
1693
  };
1742
1694
  useEffect(function () {
1743
- onChange(removeBy({
1695
+ onChange(removeBy$1({
1744
1696
  dataIndex: includes(__, hiddenColumns)
1745
1697
  }, columnData));
1746
1698
  }, [columnData, hiddenColumns]);
@@ -3306,2835 +3258,426 @@ var mousetrap = {exports: {}};
3306
3258
  * of binding an empty function
3307
3259
  *
3308
3260
  * the keycombo+action has to be exactly the same as
3309
- * it was defined in the bind method
3310
- *
3311
- * @param {string|Array} keys
3312
- * @param {string} action
3313
- * @returns void
3314
- */
3315
- Mousetrap.prototype.unbind = function(keys, action) {
3316
- var self = this;
3317
- return self.bind.call(self, keys, function() {}, action);
3318
- };
3319
-
3320
- /**
3321
- * triggers an event that has already been bound
3322
- *
3323
- * @param {string} keys
3324
- * @param {string=} action
3325
- * @returns void
3326
- */
3327
- Mousetrap.prototype.trigger = function(keys, action) {
3328
- var self = this;
3329
- if (self._directMap[keys + ':' + action]) {
3330
- self._directMap[keys + ':' + action]({}, keys);
3331
- }
3332
- return self;
3333
- };
3334
-
3335
- /**
3336
- * resets the library back to its initial state. this is useful
3337
- * if you want to clear out the current keyboard shortcuts and bind
3338
- * new ones - for example if you switch to another page
3339
- *
3340
- * @returns void
3341
- */
3342
- Mousetrap.prototype.reset = function() {
3343
- var self = this;
3344
- self._callbacks = {};
3345
- self._directMap = {};
3346
- return self;
3347
- };
3348
-
3349
- /**
3350
- * should we stop this event before firing off callbacks
3351
- *
3352
- * @param {Event} e
3353
- * @param {Element} element
3354
- * @return {boolean}
3355
- */
3356
- Mousetrap.prototype.stopCallback = function(e, element) {
3357
- var self = this;
3358
-
3359
- // if the element has the class "mousetrap" then no need to stop
3360
- if ((' ' + element.className + ' ').indexOf(' mousetrap ') > -1) {
3361
- return false;
3362
- }
3363
-
3364
- if (_belongsTo(element, self.target)) {
3365
- return false;
3366
- }
3367
-
3368
- // Events originating from a shadow DOM are re-targetted and `e.target` is the shadow host,
3369
- // not the initial event target in the shadow tree. Note that not all events cross the
3370
- // shadow boundary.
3371
- // For shadow trees with `mode: 'open'`, the initial event target is the first element in
3372
- // the event’s composed path. For shadow trees with `mode: 'closed'`, the initial event
3373
- // target cannot be obtained.
3374
- if ('composedPath' in e && typeof e.composedPath === 'function') {
3375
- // For open shadow trees, update `element` so that the following check works.
3376
- var initialEventTarget = e.composedPath()[0];
3377
- if (initialEventTarget !== e.target) {
3378
- element = initialEventTarget;
3379
- }
3380
- }
3381
-
3382
- // stop for input, select, and textarea
3383
- return element.tagName == 'INPUT' || element.tagName == 'SELECT' || element.tagName == 'TEXTAREA' || element.isContentEditable;
3384
- };
3385
-
3386
- /**
3387
- * exposes _handleKey publicly so it can be overwritten by extensions
3388
- */
3389
- Mousetrap.prototype.handleKey = function() {
3390
- var self = this;
3391
- return self._handleKey.apply(self, arguments);
3392
- };
3393
-
3394
- /**
3395
- * allow custom key mappings
3396
- */
3397
- Mousetrap.addKeycodes = function(object) {
3398
- for (var key in object) {
3399
- if (object.hasOwnProperty(key)) {
3400
- _MAP[key] = object[key];
3401
- }
3402
- }
3403
- _REVERSE_MAP = null;
3404
- };
3405
-
3406
- /**
3407
- * Init the global mousetrap functions
3408
- *
3409
- * This method is needed to allow the global mousetrap functions to work
3410
- * now that mousetrap is a constructor function.
3411
- */
3412
- Mousetrap.init = function() {
3413
- var documentMousetrap = Mousetrap(document);
3414
- for (var method in documentMousetrap) {
3415
- if (method.charAt(0) !== '_') {
3416
- Mousetrap[method] = (function(method) {
3417
- return function() {
3418
- return documentMousetrap[method].apply(documentMousetrap, arguments);
3419
- };
3420
- } (method));
3421
- }
3422
- }
3423
- };
3424
-
3425
- Mousetrap.init();
3426
-
3427
- // expose mousetrap to the global object
3428
- window.Mousetrap = Mousetrap;
3429
-
3430
- // expose as a common js module
3431
- if (module.exports) {
3432
- module.exports = Mousetrap;
3433
- }
3434
-
3435
- // expose mousetrap as an AMD module
3436
- if (typeof undefined$1 === 'function' && undefined$1.amd) {
3437
- undefined$1(function() {
3438
- return Mousetrap;
3439
- });
3440
- }
3441
- }) (typeof window !== 'undefined' ? window : null, typeof window !== 'undefined' ? document : null);
3442
- } (mousetrap));
3443
-
3444
- var Mousetrap$1 = mousetrap.exports;
3445
-
3446
- /**
3447
- * adds a bindGlobal method to Mousetrap that allows you to
3448
- * bind specific keyboard shortcuts that will still work
3449
- * inside a text input field
3450
- *
3451
- * usage:
3452
- * Mousetrap.bindGlobal('ctrl+s', _saveChanges);
3453
- */
3454
- /* global Mousetrap:true */
3455
- (function(Mousetrap) {
3456
- var _globalCallbacks = {};
3457
- var _originalStopCallback = Mousetrap.prototype.stopCallback;
3458
-
3459
- Mousetrap.prototype.stopCallback = function(e, element, combo, sequence) {
3460
- var self = this;
3461
-
3462
- if (self.paused) {
3463
- return true;
3464
- }
3465
-
3466
- if (_globalCallbacks[combo] || _globalCallbacks[sequence]) {
3467
- return false;
3468
- }
3469
-
3470
- return _originalStopCallback.call(self, e, element, combo);
3471
- };
3472
-
3473
- Mousetrap.prototype.bindGlobal = function(keys, callback, action) {
3474
- var self = this;
3475
- self.bind(keys, callback, action);
3476
-
3477
- if (keys instanceof Array) {
3478
- for (var i = 0; i < keys.length; i++) {
3479
- _globalCallbacks[keys[i]] = true;
3480
- }
3481
- return;
3482
- }
3483
-
3484
- _globalCallbacks[keys] = true;
3485
- };
3486
-
3487
- Mousetrap.prototype.unbindGlobal = function(keys, action) {
3488
- var self = this;
3489
- self.unbind(keys, action);
3490
-
3491
- if (keys instanceof Array) {
3492
- for (var i = 0; i < keys.length; i++) {
3493
- _globalCallbacks[keys[i]] = false;
3494
- }
3495
- return;
3496
- }
3497
-
3498
- _globalCallbacks[keys] = false;
3499
- };
3500
-
3501
- Mousetrap.init();
3502
- }) (Mousetrap);
3503
-
3504
- var MAC_TO_WINDOWS_KEYS_MAP = {
3505
- option: "alt",
3506
- command: "ctrl",
3507
- "return": "enter",
3508
- "delete": "backspace"
3509
- };
3510
- var OS = {
3511
- mac: "OS X",
3512
- windows: "Windows"
3513
- };
3514
-
3515
- var convertHotkeyToUsersPlatform = function convertHotkeyToUsersPlatform(hotkey) {
3516
- var _platformInfo$os, _platformInfo$os$fami;
3517
- var platformInfo = platform.parse(navigator.userAgent);
3518
- var isOSX = (_platformInfo$os = platformInfo.os) === null || _platformInfo$os === void 0 ? void 0 : (_platformInfo$os$fami = _platformInfo$os.family) === null || _platformInfo$os$fami === void 0 ? void 0 : _platformInfo$os$fami.includes(OS.mac);
3519
- if (isOSX) return hotkey;
3520
- var hotkeyForWindows = hotkey;
3521
- toPairs(MAC_TO_WINDOWS_KEYS_MAP).forEach(function (_ref) {
3522
- var _ref2 = _slicedToArray(_ref, 2),
3523
- macKey = _ref2[0],
3524
- windowsKey = _ref2[1];
3525
- hotkeyForWindows = hotkeyForWindows.replaceAll(macKey, windowsKey);
3526
- });
3527
- return hotkeyForWindows;
3528
- };
3529
-
3530
- var MODES$1 = {
3531
- "default": "default",
3532
- global: "global",
3533
- scoped: "scoped"
3534
- };
3535
- var DEFAULT_CONFIG = {
3536
- mode: MODES$1["default"],
3537
- unbindOnUnmount: true
3538
- };
3539
-
3540
- var useHotKeys = function useHotKeys(hotkey, handler, userConfig) {
3541
- var ref = useRef(null);
3542
- var convertedHotkey = convertHotkeyToUsersPlatform(hotkey);
3543
- var config = mergeLeft(userConfig, DEFAULT_CONFIG);
3544
- useEffect(function () {
3545
- bindHotKey({
3546
- mode: config.mode,
3547
- hotkey: convertedHotkey,
3548
- handler: handler,
3549
- ref: ref
3550
- });
3551
- return function () {
3552
- config.unbindOnUnmount && unBindHotKey(config.mode, convertedHotkey);
3553
- };
3554
- }, [handler, config.mode, convertedHotkey, config]);
3555
- return config.mode === MODES$1.scoped ? ref : null;
3556
- };
3557
- var bindHotKey = function bindHotKey(_ref) {
3558
- var mode = _ref.mode,
3559
- hotkey = _ref.hotkey,
3560
- handler = _ref.handler,
3561
- ref = _ref.ref;
3562
- switch (mode) {
3563
- case MODES$1.global:
3564
- Mousetrap$1.bindGlobal(hotkey, handler);
3565
- break;
3566
- case MODES$1.scoped:
3567
- Mousetrap$1(ref.current).bind(hotkey, handler);
3568
- break;
3569
- default:
3570
- Mousetrap$1.bind(hotkey, handler);
3571
- }
3572
- };
3573
- var unBindHotKey = function unBindHotKey(mode, hotkey) {
3574
- return mode === MODES$1.global ? Mousetrap$1.unbindGlobal(hotkey) : Mousetrap$1.unbind(hotkey);
3575
- };
3576
-
3577
- var useForceUpdate = function useForceUpdate() {
3578
- // eslint-disable-next-line react/hook-use-state
3579
- var _useState = useState(0),
3580
- _useState2 = _slicedToArray(_useState, 2),
3581
- setValue = _useState2[1];
3582
- return function () {
3583
- return setValue(function (value) {
3584
- return value + 1;
3585
- });
3586
- };
3587
- };
3588
-
3589
- var useIsElementVisibleInDom = function useIsElementVisibleInDom(target) {
3590
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
3591
- var _useState = useState(false),
3592
- _useState2 = _slicedToArray(_useState, 2),
3593
- isIntersecting = _useState2[0],
3594
- setIsIntersecting = _useState2[1];
3595
- var forceUpdate = useForceUpdate();
3596
- useEffect(function () {
3597
- if (!target) return forceUpdate();
3598
- var observer = new IntersectionObserver(function (_ref) {
3599
- var _ref2 = _slicedToArray(_ref, 1),
3600
- entry = _ref2[0];
3601
- return setIsIntersecting(entry.isIntersecting);
3602
- }, options);
3603
- observer.observe(target);
3604
- return function () {
3605
- return observer.unobserve(target);
3606
- };
3607
- }, [target, options]);
3608
- return isIntersecting;
3609
- };
3610
-
3611
- var useOnClickOutside = function useOnClickOutside(ref, handler) {
3612
- useEffect(function () {
3613
- var listener = function listener(event) {
3614
- // Do nothing if clicking ref's element or descendent elements
3615
- if (!ref.current || ref.current.contains(event.target)) {
3616
- return;
3617
- }
3618
- handler(event);
3619
- };
3620
- document.addEventListener("mousedown", listener);
3621
- document.addEventListener("touchstart", listener);
3622
- return function () {
3623
- document.removeEventListener("mousedown", listener);
3624
- document.removeEventListener("touchstart", listener);
3625
- };
3626
- }, [handler]);
3627
- };
3628
-
3629
- var usePrevious = function usePrevious(value) {
3630
- var ref = useRef(value);
3631
- useEffect(function () {
3632
- ref.current = value;
3633
- }, [value]);
3634
- return ref.current;
3635
- };
3636
-
3637
- var useUpdateEffect = function useUpdateEffect(callback) {
3638
- var dependencies = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
3639
- var isInitialMount = useRef(true);
3640
- useEffect(function () {
3641
- if (isInitialMount.current) {
3642
- isInitialMount.current = false;
3643
- return;
3644
- }
3645
- callback();
3646
- }, dependencies);
3647
- };
3648
-
3649
- var DEFAULT_STALE_TIME = 60 * 60 * 1000;
3650
- var DOMAIN_QUERY_KEY = "custom-domain";
3651
- var ENTITY_COUNT = {
3652
- singular: 1,
3653
- plural: 2
3654
- };
3655
-
3656
- var HOSTNAME_REGEX = /^(?!-)[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+/;
3657
- var INITIAL_VALUES$1 = {
3658
- hostname: ""
3659
- };
3660
- var CUSTOM_DOMAIN_VALIDATION_SCHEMA = yup.object().shape({
3661
- hostname: yup.string().required(t$1("neetoCommons.customDomain.formikValidation.required")).matches(HOSTNAME_REGEX, t$1("neetoCommons.customDomain.formikValidation.valid"))
3662
- });
3663
-
3664
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
3665
- try {
3666
- var info = gen[key](arg);
3667
- var value = info.value;
3668
- } catch (error) {
3669
- reject(error);
3670
- return;
3671
- }
3672
- if (info.done) {
3673
- resolve(value);
3674
- } else {
3675
- Promise.resolve(value).then(_next, _throw);
3676
- }
3677
- }
3678
- function _asyncToGenerator(fn) {
3679
- return function () {
3680
- var self = this,
3681
- args = arguments;
3682
- return new Promise(function (resolve, reject) {
3683
- var gen = fn.apply(self, args);
3684
- function _next(value) {
3685
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
3686
- }
3687
- function _throw(err) {
3688
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
3689
- }
3690
- _next(undefined);
3691
- });
3692
- };
3693
- }
3694
-
3695
- var regeneratorRuntime$1 = {exports: {}};
3696
-
3697
- var _typeof = {exports: {}};
3698
-
3699
- (function (module) {
3700
- function _typeof(obj) {
3701
- "@babel/helpers - typeof";
3702
-
3703
- return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
3704
- return typeof obj;
3705
- } : function (obj) {
3706
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
3707
- }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
3708
- }
3709
- module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
3710
- } (_typeof));
3711
-
3712
- (function (module) {
3713
- var _typeof$1 = _typeof.exports["default"];
3714
- function _regeneratorRuntime() {
3715
- module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
3716
- return exports;
3717
- }, module.exports.__esModule = true, module.exports["default"] = module.exports;
3718
- var exports = {},
3719
- Op = Object.prototype,
3720
- hasOwn = Op.hasOwnProperty,
3721
- defineProperty = Object.defineProperty || function (obj, key, desc) {
3722
- obj[key] = desc.value;
3723
- },
3724
- $Symbol = "function" == typeof Symbol ? Symbol : {},
3725
- iteratorSymbol = $Symbol.iterator || "@@iterator",
3726
- asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
3727
- toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
3728
- function define(obj, key, value) {
3729
- return Object.defineProperty(obj, key, {
3730
- value: value,
3731
- enumerable: !0,
3732
- configurable: !0,
3733
- writable: !0
3734
- }), obj[key];
3735
- }
3736
- try {
3737
- define({}, "");
3738
- } catch (err) {
3739
- define = function define(obj, key, value) {
3740
- return obj[key] = value;
3741
- };
3742
- }
3743
- function wrap(innerFn, outerFn, self, tryLocsList) {
3744
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
3745
- generator = Object.create(protoGenerator.prototype),
3746
- context = new Context(tryLocsList || []);
3747
- return defineProperty(generator, "_invoke", {
3748
- value: makeInvokeMethod(innerFn, self, context)
3749
- }), generator;
3750
- }
3751
- function tryCatch(fn, obj, arg) {
3752
- try {
3753
- return {
3754
- type: "normal",
3755
- arg: fn.call(obj, arg)
3756
- };
3757
- } catch (err) {
3758
- return {
3759
- type: "throw",
3760
- arg: err
3761
- };
3762
- }
3763
- }
3764
- exports.wrap = wrap;
3765
- var ContinueSentinel = {};
3766
- function Generator() {}
3767
- function GeneratorFunction() {}
3768
- function GeneratorFunctionPrototype() {}
3769
- var IteratorPrototype = {};
3770
- define(IteratorPrototype, iteratorSymbol, function () {
3771
- return this;
3772
- });
3773
- var getProto = Object.getPrototypeOf,
3774
- NativeIteratorPrototype = getProto && getProto(getProto(values([])));
3775
- NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
3776
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
3777
- function defineIteratorMethods(prototype) {
3778
- ["next", "throw", "return"].forEach(function (method) {
3779
- define(prototype, method, function (arg) {
3780
- return this._invoke(method, arg);
3781
- });
3782
- });
3783
- }
3784
- function AsyncIterator(generator, PromiseImpl) {
3785
- function invoke(method, arg, resolve, reject) {
3786
- var record = tryCatch(generator[method], generator, arg);
3787
- if ("throw" !== record.type) {
3788
- var result = record.arg,
3789
- value = result.value;
3790
- return value && "object" == _typeof$1(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
3791
- invoke("next", value, resolve, reject);
3792
- }, function (err) {
3793
- invoke("throw", err, resolve, reject);
3794
- }) : PromiseImpl.resolve(value).then(function (unwrapped) {
3795
- result.value = unwrapped, resolve(result);
3796
- }, function (error) {
3797
- return invoke("throw", error, resolve, reject);
3798
- });
3799
- }
3800
- reject(record.arg);
3801
- }
3802
- var previousPromise;
3803
- defineProperty(this, "_invoke", {
3804
- value: function value(method, arg) {
3805
- function callInvokeWithMethodAndArg() {
3806
- return new PromiseImpl(function (resolve, reject) {
3807
- invoke(method, arg, resolve, reject);
3808
- });
3809
- }
3810
- return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
3811
- }
3812
- });
3813
- }
3814
- function makeInvokeMethod(innerFn, self, context) {
3815
- var state = "suspendedStart";
3816
- return function (method, arg) {
3817
- if ("executing" === state) throw new Error("Generator is already running");
3818
- if ("completed" === state) {
3819
- if ("throw" === method) throw arg;
3820
- return doneResult();
3821
- }
3822
- for (context.method = method, context.arg = arg;;) {
3823
- var delegate = context.delegate;
3824
- if (delegate) {
3825
- var delegateResult = maybeInvokeDelegate(delegate, context);
3826
- if (delegateResult) {
3827
- if (delegateResult === ContinueSentinel) continue;
3828
- return delegateResult;
3829
- }
3830
- }
3831
- if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
3832
- if ("suspendedStart" === state) throw state = "completed", context.arg;
3833
- context.dispatchException(context.arg);
3834
- } else "return" === context.method && context.abrupt("return", context.arg);
3835
- state = "executing";
3836
- var record = tryCatch(innerFn, self, context);
3837
- if ("normal" === record.type) {
3838
- if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
3839
- return {
3840
- value: record.arg,
3841
- done: context.done
3842
- };
3843
- }
3844
- "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
3845
- }
3846
- };
3847
- }
3848
- function maybeInvokeDelegate(delegate, context) {
3849
- var methodName = context.method,
3850
- method = delegate.iterator[methodName];
3851
- if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
3852
- var record = tryCatch(method, delegate.iterator, context.arg);
3853
- if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
3854
- var info = record.arg;
3855
- return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
3856
- }
3857
- function pushTryEntry(locs) {
3858
- var entry = {
3859
- tryLoc: locs[0]
3860
- };
3861
- 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
3862
- }
3863
- function resetTryEntry(entry) {
3864
- var record = entry.completion || {};
3865
- record.type = "normal", delete record.arg, entry.completion = record;
3866
- }
3867
- function Context(tryLocsList) {
3868
- this.tryEntries = [{
3869
- tryLoc: "root"
3870
- }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
3871
- }
3872
- function values(iterable) {
3873
- if (iterable) {
3874
- var iteratorMethod = iterable[iteratorSymbol];
3875
- if (iteratorMethod) return iteratorMethod.call(iterable);
3876
- if ("function" == typeof iterable.next) return iterable;
3877
- if (!isNaN(iterable.length)) {
3878
- var i = -1,
3879
- next = function next() {
3880
- for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
3881
- return next.value = undefined, next.done = !0, next;
3882
- };
3883
- return next.next = next;
3884
- }
3885
- }
3886
- return {
3887
- next: doneResult
3888
- };
3889
- }
3890
- function doneResult() {
3891
- return {
3892
- value: undefined,
3893
- done: !0
3894
- };
3895
- }
3896
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
3897
- value: GeneratorFunctionPrototype,
3898
- configurable: !0
3899
- }), defineProperty(GeneratorFunctionPrototype, "constructor", {
3900
- value: GeneratorFunction,
3901
- configurable: !0
3902
- }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
3903
- var ctor = "function" == typeof genFun && genFun.constructor;
3904
- return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
3905
- }, exports.mark = function (genFun) {
3906
- return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
3907
- }, exports.awrap = function (arg) {
3908
- return {
3909
- __await: arg
3910
- };
3911
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
3912
- return this;
3913
- }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
3914
- void 0 === PromiseImpl && (PromiseImpl = Promise);
3915
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
3916
- return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
3917
- return result.done ? result.value : iter.next();
3918
- });
3919
- }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
3920
- return this;
3921
- }), define(Gp, "toString", function () {
3922
- return "[object Generator]";
3923
- }), exports.keys = function (val) {
3924
- var object = Object(val),
3925
- keys = [];
3926
- for (var key in object) keys.push(key);
3927
- return keys.reverse(), function next() {
3928
- for (; keys.length;) {
3929
- var key = keys.pop();
3930
- if (key in object) return next.value = key, next.done = !1, next;
3931
- }
3932
- return next.done = !0, next;
3933
- };
3934
- }, exports.values = values, Context.prototype = {
3935
- constructor: Context,
3936
- reset: function reset(skipTempReset) {
3937
- if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
3938
- },
3939
- stop: function stop() {
3940
- this.done = !0;
3941
- var rootRecord = this.tryEntries[0].completion;
3942
- if ("throw" === rootRecord.type) throw rootRecord.arg;
3943
- return this.rval;
3944
- },
3945
- dispatchException: function dispatchException(exception) {
3946
- if (this.done) throw exception;
3947
- var context = this;
3948
- function handle(loc, caught) {
3949
- return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
3950
- }
3951
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
3952
- var entry = this.tryEntries[i],
3953
- record = entry.completion;
3954
- if ("root" === entry.tryLoc) return handle("end");
3955
- if (entry.tryLoc <= this.prev) {
3956
- var hasCatch = hasOwn.call(entry, "catchLoc"),
3957
- hasFinally = hasOwn.call(entry, "finallyLoc");
3958
- if (hasCatch && hasFinally) {
3959
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
3960
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
3961
- } else if (hasCatch) {
3962
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
3963
- } else {
3964
- if (!hasFinally) throw new Error("try statement without catch or finally");
3965
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
3966
- }
3967
- }
3968
- }
3969
- },
3970
- abrupt: function abrupt(type, arg) {
3971
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
3972
- var entry = this.tryEntries[i];
3973
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
3974
- var finallyEntry = entry;
3975
- break;
3976
- }
3977
- }
3978
- finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
3979
- var record = finallyEntry ? finallyEntry.completion : {};
3980
- return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
3981
- },
3982
- complete: function complete(record, afterLoc) {
3983
- if ("throw" === record.type) throw record.arg;
3984
- return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
3985
- },
3986
- finish: function finish(finallyLoc) {
3987
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
3988
- var entry = this.tryEntries[i];
3989
- if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
3990
- }
3991
- },
3992
- "catch": function _catch(tryLoc) {
3993
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
3994
- var entry = this.tryEntries[i];
3995
- if (entry.tryLoc === tryLoc) {
3996
- var record = entry.completion;
3997
- if ("throw" === record.type) {
3998
- var thrown = record.arg;
3999
- resetTryEntry(entry);
4000
- }
4001
- return thrown;
4002
- }
4003
- }
4004
- throw new Error("illegal catch attempt");
4005
- },
4006
- delegateYield: function delegateYield(iterable, resultName, nextLoc) {
4007
- return this.delegate = {
4008
- iterator: values(iterable),
4009
- resultName: resultName,
4010
- nextLoc: nextLoc
4011
- }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
4012
- }
4013
- }, exports;
4014
- }
4015
- module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
4016
- } (regeneratorRuntime$1));
4017
-
4018
- // TODO(Babel 8): Remove this file.
4019
-
4020
- var runtime = regeneratorRuntime$1.exports();
4021
- var regenerator = runtime;
4022
-
4023
- // Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
4024
- try {
4025
- regeneratorRuntime = runtime;
4026
- } catch (accidentalStrictMode) {
4027
- if (typeof globalThis === "object") {
4028
- globalThis.regeneratorRuntime = runtime;
4029
- } else {
4030
- Function("r", "regeneratorRuntime = r")(runtime);
4031
- }
4032
- }
4033
-
4034
- /* eslint complexity: [2, 18], max-statements: [2, 33] */
4035
- var shams = function hasSymbols() {
4036
- if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
4037
- if (typeof Symbol.iterator === 'symbol') { return true; }
4038
-
4039
- var obj = {};
4040
- var sym = Symbol('test');
4041
- var symObj = Object(sym);
4042
- if (typeof sym === 'string') { return false; }
4043
-
4044
- if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
4045
- if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
4046
-
4047
- // temp disabled per https://github.com/ljharb/object.assign/issues/17
4048
- // if (sym instanceof Symbol) { return false; }
4049
- // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
4050
- // if (!(symObj instanceof Symbol)) { return false; }
4051
-
4052
- // if (typeof Symbol.prototype.toString !== 'function') { return false; }
4053
- // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
4054
-
4055
- var symVal = 42;
4056
- obj[sym] = symVal;
4057
- for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
4058
- if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
4059
-
4060
- if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
4061
-
4062
- var syms = Object.getOwnPropertySymbols(obj);
4063
- if (syms.length !== 1 || syms[0] !== sym) { return false; }
4064
-
4065
- if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
4066
-
4067
- if (typeof Object.getOwnPropertyDescriptor === 'function') {
4068
- var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
4069
- if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
4070
- }
4071
-
4072
- return true;
4073
- };
4074
-
4075
- var origSymbol = typeof Symbol !== 'undefined' && Symbol;
4076
- var hasSymbolSham = shams;
4077
-
4078
- var hasSymbols$1 = function hasNativeSymbols() {
4079
- if (typeof origSymbol !== 'function') { return false; }
4080
- if (typeof Symbol !== 'function') { return false; }
4081
- if (typeof origSymbol('foo') !== 'symbol') { return false; }
4082
- if (typeof Symbol('bar') !== 'symbol') { return false; }
4083
-
4084
- return hasSymbolSham();
4085
- };
4086
-
4087
- /* eslint no-invalid-this: 1 */
4088
-
4089
- var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
4090
- var slice = Array.prototype.slice;
4091
- var toStr$1 = Object.prototype.toString;
4092
- var funcType = '[object Function]';
4093
-
4094
- var implementation$1 = function bind(that) {
4095
- var target = this;
4096
- if (typeof target !== 'function' || toStr$1.call(target) !== funcType) {
4097
- throw new TypeError(ERROR_MESSAGE + target);
4098
- }
4099
- var args = slice.call(arguments, 1);
4100
-
4101
- var bound;
4102
- var binder = function () {
4103
- if (this instanceof bound) {
4104
- var result = target.apply(
4105
- this,
4106
- args.concat(slice.call(arguments))
4107
- );
4108
- if (Object(result) === result) {
4109
- return result;
4110
- }
4111
- return this;
4112
- } else {
4113
- return target.apply(
4114
- that,
4115
- args.concat(slice.call(arguments))
4116
- );
4117
- }
4118
- };
4119
-
4120
- var boundLength = Math.max(0, target.length - args.length);
4121
- var boundArgs = [];
4122
- for (var i = 0; i < boundLength; i++) {
4123
- boundArgs.push('$' + i);
4124
- }
4125
-
4126
- bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
4127
-
4128
- if (target.prototype) {
4129
- var Empty = function Empty() {};
4130
- Empty.prototype = target.prototype;
4131
- bound.prototype = new Empty();
4132
- Empty.prototype = null;
4133
- }
4134
-
4135
- return bound;
4136
- };
4137
-
4138
- var implementation = implementation$1;
4139
-
4140
- var functionBind = Function.prototype.bind || implementation;
4141
-
4142
- var bind$1 = functionBind;
4143
-
4144
- var src = bind$1.call(Function.call, Object.prototype.hasOwnProperty);
4145
-
4146
- var undefined$1;
4147
-
4148
- var $SyntaxError = SyntaxError;
4149
- var $Function = Function;
4150
- var $TypeError$1 = TypeError;
4151
-
4152
- // eslint-disable-next-line consistent-return
4153
- var getEvalledConstructor = function (expressionSyntax) {
4154
- try {
4155
- return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
4156
- } catch (e) {}
4157
- };
4158
-
4159
- var $gOPD = Object.getOwnPropertyDescriptor;
4160
- if ($gOPD) {
4161
- try {
4162
- $gOPD({}, '');
4163
- } catch (e) {
4164
- $gOPD = null; // this is IE 8, which has a broken gOPD
4165
- }
4166
- }
4167
-
4168
- var throwTypeError = function () {
4169
- throw new $TypeError$1();
4170
- };
4171
- var ThrowTypeError = $gOPD
4172
- ? (function () {
4173
- try {
4174
- // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
4175
- arguments.callee; // IE 8 does not throw here
4176
- return throwTypeError;
4177
- } catch (calleeThrows) {
4178
- try {
4179
- // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
4180
- return $gOPD(arguments, 'callee').get;
4181
- } catch (gOPDthrows) {
4182
- return throwTypeError;
4183
- }
4184
- }
4185
- }())
4186
- : throwTypeError;
4187
-
4188
- var hasSymbols = hasSymbols$1();
4189
-
4190
- var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
4191
-
4192
- var needsEval = {};
4193
-
4194
- var TypedArray = typeof Uint8Array === 'undefined' ? undefined$1 : getProto(Uint8Array);
4195
-
4196
- var INTRINSICS = {
4197
- '%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
4198
- '%Array%': Array,
4199
- '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
4200
- '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined$1,
4201
- '%AsyncFromSyncIteratorPrototype%': undefined$1,
4202
- '%AsyncFunction%': needsEval,
4203
- '%AsyncGenerator%': needsEval,
4204
- '%AsyncGeneratorFunction%': needsEval,
4205
- '%AsyncIteratorPrototype%': needsEval,
4206
- '%Atomics%': typeof Atomics === 'undefined' ? undefined$1 : Atomics,
4207
- '%BigInt%': typeof BigInt === 'undefined' ? undefined$1 : BigInt,
4208
- '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined$1 : BigInt64Array,
4209
- '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined$1 : BigUint64Array,
4210
- '%Boolean%': Boolean,
4211
- '%DataView%': typeof DataView === 'undefined' ? undefined$1 : DataView,
4212
- '%Date%': Date,
4213
- '%decodeURI%': decodeURI,
4214
- '%decodeURIComponent%': decodeURIComponent,
4215
- '%encodeURI%': encodeURI,
4216
- '%encodeURIComponent%': encodeURIComponent,
4217
- '%Error%': Error,
4218
- '%eval%': eval, // eslint-disable-line no-eval
4219
- '%EvalError%': EvalError,
4220
- '%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
4221
- '%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
4222
- '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined$1 : FinalizationRegistry,
4223
- '%Function%': $Function,
4224
- '%GeneratorFunction%': needsEval,
4225
- '%Int8Array%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array,
4226
- '%Int16Array%': typeof Int16Array === 'undefined' ? undefined$1 : Int16Array,
4227
- '%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
4228
- '%isFinite%': isFinite,
4229
- '%isNaN%': isNaN,
4230
- '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
4231
- '%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
4232
- '%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
4233
- '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined$1 : getProto(new Map()[Symbol.iterator]()),
4234
- '%Math%': Math,
4235
- '%Number%': Number,
4236
- '%Object%': Object,
4237
- '%parseFloat%': parseFloat,
4238
- '%parseInt%': parseInt,
4239
- '%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise,
4240
- '%Proxy%': typeof Proxy === 'undefined' ? undefined$1 : Proxy,
4241
- '%RangeError%': RangeError,
4242
- '%ReferenceError%': ReferenceError,
4243
- '%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
4244
- '%RegExp%': RegExp,
4245
- '%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
4246
- '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined$1 : getProto(new Set()[Symbol.iterator]()),
4247
- '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
4248
- '%String%': String,
4249
- '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined$1,
4250
- '%Symbol%': hasSymbols ? Symbol : undefined$1,
4251
- '%SyntaxError%': $SyntaxError,
4252
- '%ThrowTypeError%': ThrowTypeError,
4253
- '%TypedArray%': TypedArray,
4254
- '%TypeError%': $TypeError$1,
4255
- '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array,
4256
- '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray,
4257
- '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array,
4258
- '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array,
4259
- '%URIError%': URIError,
4260
- '%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap,
4261
- '%WeakRef%': typeof WeakRef === 'undefined' ? undefined$1 : WeakRef,
4262
- '%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet
4263
- };
4264
-
4265
- try {
4266
- null.error; // eslint-disable-line no-unused-expressions
4267
- } catch (e) {
4268
- // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
4269
- var errorProto = getProto(getProto(e));
4270
- INTRINSICS['%Error.prototype%'] = errorProto;
4271
- }
4272
-
4273
- var doEval = function doEval(name) {
4274
- var value;
4275
- if (name === '%AsyncFunction%') {
4276
- value = getEvalledConstructor('async function () {}');
4277
- } else if (name === '%GeneratorFunction%') {
4278
- value = getEvalledConstructor('function* () {}');
4279
- } else if (name === '%AsyncGeneratorFunction%') {
4280
- value = getEvalledConstructor('async function* () {}');
4281
- } else if (name === '%AsyncGenerator%') {
4282
- var fn = doEval('%AsyncGeneratorFunction%');
4283
- if (fn) {
4284
- value = fn.prototype;
4285
- }
4286
- } else if (name === '%AsyncIteratorPrototype%') {
4287
- var gen = doEval('%AsyncGenerator%');
4288
- if (gen) {
4289
- value = getProto(gen.prototype);
4290
- }
4291
- }
4292
-
4293
- INTRINSICS[name] = value;
4294
-
4295
- return value;
4296
- };
4297
-
4298
- var LEGACY_ALIASES = {
4299
- '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
4300
- '%ArrayPrototype%': ['Array', 'prototype'],
4301
- '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
4302
- '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
4303
- '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
4304
- '%ArrayProto_values%': ['Array', 'prototype', 'values'],
4305
- '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
4306
- '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
4307
- '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
4308
- '%BooleanPrototype%': ['Boolean', 'prototype'],
4309
- '%DataViewPrototype%': ['DataView', 'prototype'],
4310
- '%DatePrototype%': ['Date', 'prototype'],
4311
- '%ErrorPrototype%': ['Error', 'prototype'],
4312
- '%EvalErrorPrototype%': ['EvalError', 'prototype'],
4313
- '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
4314
- '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
4315
- '%FunctionPrototype%': ['Function', 'prototype'],
4316
- '%Generator%': ['GeneratorFunction', 'prototype'],
4317
- '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
4318
- '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
4319
- '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
4320
- '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
4321
- '%JSONParse%': ['JSON', 'parse'],
4322
- '%JSONStringify%': ['JSON', 'stringify'],
4323
- '%MapPrototype%': ['Map', 'prototype'],
4324
- '%NumberPrototype%': ['Number', 'prototype'],
4325
- '%ObjectPrototype%': ['Object', 'prototype'],
4326
- '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
4327
- '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
4328
- '%PromisePrototype%': ['Promise', 'prototype'],
4329
- '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
4330
- '%Promise_all%': ['Promise', 'all'],
4331
- '%Promise_reject%': ['Promise', 'reject'],
4332
- '%Promise_resolve%': ['Promise', 'resolve'],
4333
- '%RangeErrorPrototype%': ['RangeError', 'prototype'],
4334
- '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
4335
- '%RegExpPrototype%': ['RegExp', 'prototype'],
4336
- '%SetPrototype%': ['Set', 'prototype'],
4337
- '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
4338
- '%StringPrototype%': ['String', 'prototype'],
4339
- '%SymbolPrototype%': ['Symbol', 'prototype'],
4340
- '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
4341
- '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
4342
- '%TypeErrorPrototype%': ['TypeError', 'prototype'],
4343
- '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
4344
- '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
4345
- '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
4346
- '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
4347
- '%URIErrorPrototype%': ['URIError', 'prototype'],
4348
- '%WeakMapPrototype%': ['WeakMap', 'prototype'],
4349
- '%WeakSetPrototype%': ['WeakSet', 'prototype']
4350
- };
4351
-
4352
- var bind = functionBind;
4353
- var hasOwn$1 = src;
4354
- var $concat$1 = bind.call(Function.call, Array.prototype.concat);
4355
- var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
4356
- var $replace$1 = bind.call(Function.call, String.prototype.replace);
4357
- var $strSlice = bind.call(Function.call, String.prototype.slice);
4358
- var $exec = bind.call(Function.call, RegExp.prototype.exec);
4359
-
4360
- /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
4361
- var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
4362
- var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
4363
- var stringToPath = function stringToPath(string) {
4364
- var first = $strSlice(string, 0, 1);
4365
- var last = $strSlice(string, -1);
4366
- if (first === '%' && last !== '%') {
4367
- throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
4368
- } else if (last === '%' && first !== '%') {
4369
- throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
4370
- }
4371
- var result = [];
4372
- $replace$1(string, rePropName, function (match, number, quote, subString) {
4373
- result[result.length] = quote ? $replace$1(subString, reEscapeChar, '$1') : number || match;
4374
- });
4375
- return result;
4376
- };
4377
- /* end adaptation */
4378
-
4379
- var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
4380
- var intrinsicName = name;
4381
- var alias;
4382
- if (hasOwn$1(LEGACY_ALIASES, intrinsicName)) {
4383
- alias = LEGACY_ALIASES[intrinsicName];
4384
- intrinsicName = '%' + alias[0] + '%';
4385
- }
4386
-
4387
- if (hasOwn$1(INTRINSICS, intrinsicName)) {
4388
- var value = INTRINSICS[intrinsicName];
4389
- if (value === needsEval) {
4390
- value = doEval(intrinsicName);
4391
- }
4392
- if (typeof value === 'undefined' && !allowMissing) {
4393
- throw new $TypeError$1('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
4394
- }
4395
-
4396
- return {
4397
- alias: alias,
4398
- name: intrinsicName,
4399
- value: value
4400
- };
4401
- }
4402
-
4403
- throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
4404
- };
4405
-
4406
- var getIntrinsic = function GetIntrinsic(name, allowMissing) {
4407
- if (typeof name !== 'string' || name.length === 0) {
4408
- throw new $TypeError$1('intrinsic name must be a non-empty string');
4409
- }
4410
- if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
4411
- throw new $TypeError$1('"allowMissing" argument must be a boolean');
4412
- }
4413
-
4414
- if ($exec(/^%?[^%]*%?$/, name) === null) {
4415
- throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
4416
- }
4417
- var parts = stringToPath(name);
4418
- var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
4419
-
4420
- var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
4421
- var intrinsicRealName = intrinsic.name;
4422
- var value = intrinsic.value;
4423
- var skipFurtherCaching = false;
4424
-
4425
- var alias = intrinsic.alias;
4426
- if (alias) {
4427
- intrinsicBaseName = alias[0];
4428
- $spliceApply(parts, $concat$1([0, 1], alias));
4429
- }
4430
-
4431
- for (var i = 1, isOwn = true; i < parts.length; i += 1) {
4432
- var part = parts[i];
4433
- var first = $strSlice(part, 0, 1);
4434
- var last = $strSlice(part, -1);
4435
- if (
4436
- (
4437
- (first === '"' || first === "'" || first === '`')
4438
- || (last === '"' || last === "'" || last === '`')
4439
- )
4440
- && first !== last
4441
- ) {
4442
- throw new $SyntaxError('property names with quotes must have matching quotes');
4443
- }
4444
- if (part === 'constructor' || !isOwn) {
4445
- skipFurtherCaching = true;
4446
- }
4447
-
4448
- intrinsicBaseName += '.' + part;
4449
- intrinsicRealName = '%' + intrinsicBaseName + '%';
4450
-
4451
- if (hasOwn$1(INTRINSICS, intrinsicRealName)) {
4452
- value = INTRINSICS[intrinsicRealName];
4453
- } else if (value != null) {
4454
- if (!(part in value)) {
4455
- if (!allowMissing) {
4456
- throw new $TypeError$1('base intrinsic for ' + name + ' exists, but the property is not available.');
4457
- }
4458
- return void undefined$1;
4459
- }
4460
- if ($gOPD && (i + 1) >= parts.length) {
4461
- var desc = $gOPD(value, part);
4462
- isOwn = !!desc;
4463
-
4464
- // By convention, when a data property is converted to an accessor
4465
- // property to emulate a data property that does not suffer from
4466
- // the override mistake, that accessor's getter is marked with
4467
- // an `originalValue` property. Here, when we detect this, we
4468
- // uphold the illusion by pretending to see that original data
4469
- // property, i.e., returning the value rather than the getter
4470
- // itself.
4471
- if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
4472
- value = desc.get;
4473
- } else {
4474
- value = value[part];
4475
- }
4476
- } else {
4477
- isOwn = hasOwn$1(value, part);
4478
- value = value[part];
4479
- }
4480
-
4481
- if (isOwn && !skipFurtherCaching) {
4482
- INTRINSICS[intrinsicRealName] = value;
4483
- }
4484
- }
4485
- }
4486
- return value;
4487
- };
4488
-
4489
- var callBind$1 = {exports: {}};
4490
-
4491
- (function (module) {
4492
-
4493
- var bind = functionBind;
4494
- var GetIntrinsic = getIntrinsic;
4495
-
4496
- var $apply = GetIntrinsic('%Function.prototype.apply%');
4497
- var $call = GetIntrinsic('%Function.prototype.call%');
4498
- var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
4499
-
4500
- var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
4501
- var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
4502
- var $max = GetIntrinsic('%Math.max%');
4503
-
4504
- if ($defineProperty) {
4505
- try {
4506
- $defineProperty({}, 'a', { value: 1 });
4507
- } catch (e) {
4508
- // IE 8 has a broken defineProperty
4509
- $defineProperty = null;
4510
- }
4511
- }
4512
-
4513
- module.exports = function callBind(originalFunction) {
4514
- var func = $reflectApply(bind, $call, arguments);
4515
- if ($gOPD && $defineProperty) {
4516
- var desc = $gOPD(func, 'length');
4517
- if (desc.configurable) {
4518
- // original length, plus the receiver, minus any additional arguments (after the receiver)
4519
- $defineProperty(
4520
- func,
4521
- 'length',
4522
- { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
4523
- );
4524
- }
4525
- }
4526
- return func;
4527
- };
4528
-
4529
- var applyBind = function applyBind() {
4530
- return $reflectApply(bind, $apply, arguments);
4531
- };
4532
-
4533
- if ($defineProperty) {
4534
- $defineProperty(module.exports, 'apply', { value: applyBind });
4535
- } else {
4536
- module.exports.apply = applyBind;
4537
- }
4538
- } (callBind$1));
4539
-
4540
- var GetIntrinsic$1 = getIntrinsic;
4541
-
4542
- var callBind = callBind$1.exports;
4543
-
4544
- var $indexOf = callBind(GetIntrinsic$1('String.prototype.indexOf'));
4545
-
4546
- var callBound$1 = function callBoundIntrinsic(name, allowMissing) {
4547
- var intrinsic = GetIntrinsic$1(name, !!allowMissing);
4548
- if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
4549
- return callBind(intrinsic);
4550
- }
4551
- return intrinsic;
4552
- };
4553
-
4554
- var util_inspect = require$$0$2.inspect;
4555
-
4556
- var hasMap = typeof Map === 'function' && Map.prototype;
4557
- var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
4558
- var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
4559
- var mapForEach = hasMap && Map.prototype.forEach;
4560
- var hasSet = typeof Set === 'function' && Set.prototype;
4561
- var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;
4562
- var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;
4563
- var setForEach = hasSet && Set.prototype.forEach;
4564
- var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;
4565
- var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
4566
- var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;
4567
- var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
4568
- var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;
4569
- var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
4570
- var booleanValueOf = Boolean.prototype.valueOf;
4571
- var objectToString = Object.prototype.toString;
4572
- var functionToString = Function.prototype.toString;
4573
- var $match = String.prototype.match;
4574
- var $slice = String.prototype.slice;
4575
- var $replace = String.prototype.replace;
4576
- var $toUpperCase = String.prototype.toUpperCase;
4577
- var $toLowerCase = String.prototype.toLowerCase;
4578
- var $test = RegExp.prototype.test;
4579
- var $concat = Array.prototype.concat;
4580
- var $join = Array.prototype.join;
4581
- var $arrSlice = Array.prototype.slice;
4582
- var $floor = Math.floor;
4583
- var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
4584
- var gOPS = Object.getOwnPropertySymbols;
4585
- var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
4586
- var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
4587
- // ie, `has-tostringtag/shams
4588
- var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')
4589
- ? Symbol.toStringTag
4590
- : null;
4591
- var isEnumerable = Object.prototype.propertyIsEnumerable;
4592
-
4593
- var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (
4594
- [].__proto__ === Array.prototype // eslint-disable-line no-proto
4595
- ? function (O) {
4596
- return O.__proto__; // eslint-disable-line no-proto
4597
- }
4598
- : null
4599
- );
4600
-
4601
- function addNumericSeparator(num, str) {
4602
- if (
4603
- num === Infinity
4604
- || num === -Infinity
4605
- || num !== num
4606
- || (num && num > -1000 && num < 1000)
4607
- || $test.call(/e/, str)
4608
- ) {
4609
- return str;
4610
- }
4611
- var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
4612
- if (typeof num === 'number') {
4613
- var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)
4614
- if (int !== num) {
4615
- var intStr = String(int);
4616
- var dec = $slice.call(str, intStr.length + 1);
4617
- return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');
4618
- }
4619
- }
4620
- return $replace.call(str, sepRegex, '$&_');
4621
- }
4622
-
4623
- var utilInspect = util_inspect;
4624
- var inspectCustom = utilInspect.custom;
4625
- var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
4626
-
4627
- var objectInspect = function inspect_(obj, options, depth, seen) {
4628
- var opts = options || {};
4629
-
4630
- if (has$3(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {
4631
- throw new TypeError('option "quoteStyle" must be "single" or "double"');
4632
- }
4633
- if (
4634
- has$3(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'
4635
- ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity
4636
- : opts.maxStringLength !== null
4637
- )
4638
- ) {
4639
- throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
4640
- }
4641
- var customInspect = has$3(opts, 'customInspect') ? opts.customInspect : true;
4642
- if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {
4643
- throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');
4644
- }
4645
-
4646
- if (
4647
- has$3(opts, 'indent')
4648
- && opts.indent !== null
4649
- && opts.indent !== '\t'
4650
- && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)
4651
- ) {
4652
- throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
4653
- }
4654
- if (has$3(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {
4655
- throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
4656
- }
4657
- var numericSeparator = opts.numericSeparator;
4658
-
4659
- if (typeof obj === 'undefined') {
4660
- return 'undefined';
4661
- }
4662
- if (obj === null) {
4663
- return 'null';
4664
- }
4665
- if (typeof obj === 'boolean') {
4666
- return obj ? 'true' : 'false';
4667
- }
4668
-
4669
- if (typeof obj === 'string') {
4670
- return inspectString(obj, opts);
4671
- }
4672
- if (typeof obj === 'number') {
4673
- if (obj === 0) {
4674
- return Infinity / obj > 0 ? '0' : '-0';
4675
- }
4676
- var str = String(obj);
4677
- return numericSeparator ? addNumericSeparator(obj, str) : str;
4678
- }
4679
- if (typeof obj === 'bigint') {
4680
- var bigIntStr = String(obj) + 'n';
4681
- return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
4682
- }
4683
-
4684
- var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
4685
- if (typeof depth === 'undefined') { depth = 0; }
4686
- if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {
4687
- return isArray$3(obj) ? '[Array]' : '[Object]';
4688
- }
4689
-
4690
- var indent = getIndent(opts, depth);
4691
-
4692
- if (typeof seen === 'undefined') {
4693
- seen = [];
4694
- } else if (indexOf(seen, obj) >= 0) {
4695
- return '[Circular]';
4696
- }
4697
-
4698
- function inspect(value, from, noIndent) {
4699
- if (from) {
4700
- seen = $arrSlice.call(seen);
4701
- seen.push(from);
4702
- }
4703
- if (noIndent) {
4704
- var newOpts = {
4705
- depth: opts.depth
4706
- };
4707
- if (has$3(opts, 'quoteStyle')) {
4708
- newOpts.quoteStyle = opts.quoteStyle;
4709
- }
4710
- return inspect_(value, newOpts, depth + 1, seen);
4711
- }
4712
- return inspect_(value, opts, depth + 1, seen);
4713
- }
4714
-
4715
- if (typeof obj === 'function' && !isRegExp$1(obj)) { // in older engines, regexes are callable
4716
- var name = nameOf(obj);
4717
- var keys = arrObjKeys(obj, inspect);
4718
- return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
4719
- }
4720
- if (isSymbol(obj)) {
4721
- var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
4722
- return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
4723
- }
4724
- if (isElement(obj)) {
4725
- var s = '<' + $toLowerCase.call(String(obj.nodeName));
4726
- var attrs = obj.attributes || [];
4727
- for (var i = 0; i < attrs.length; i++) {
4728
- s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);
4729
- }
4730
- s += '>';
4731
- if (obj.childNodes && obj.childNodes.length) { s += '...'; }
4732
- s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';
4733
- return s;
4734
- }
4735
- if (isArray$3(obj)) {
4736
- if (obj.length === 0) { return '[]'; }
4737
- var xs = arrObjKeys(obj, inspect);
4738
- if (indent && !singleLineValues(xs)) {
4739
- return '[' + indentedJoin(xs, indent) + ']';
4740
- }
4741
- return '[ ' + $join.call(xs, ', ') + ' ]';
4742
- }
4743
- if (isError(obj)) {
4744
- var parts = arrObjKeys(obj, inspect);
4745
- if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {
4746
- return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
4747
- }
4748
- if (parts.length === 0) { return '[' + String(obj) + ']'; }
4749
- return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
4750
- }
4751
- if (typeof obj === 'object' && customInspect) {
4752
- if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {
4753
- return utilInspect(obj, { depth: maxDepth - depth });
4754
- } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
4755
- return obj.inspect();
4756
- }
4757
- }
4758
- if (isMap(obj)) {
4759
- var mapParts = [];
4760
- if (mapForEach) {
4761
- mapForEach.call(obj, function (value, key) {
4762
- mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));
4763
- });
4764
- }
4765
- return collectionOf('Map', mapSize.call(obj), mapParts, indent);
4766
- }
4767
- if (isSet(obj)) {
4768
- var setParts = [];
4769
- if (setForEach) {
4770
- setForEach.call(obj, function (value) {
4771
- setParts.push(inspect(value, obj));
4772
- });
4773
- }
4774
- return collectionOf('Set', setSize.call(obj), setParts, indent);
4775
- }
4776
- if (isWeakMap(obj)) {
4777
- return weakCollectionOf('WeakMap');
4778
- }
4779
- if (isWeakSet(obj)) {
4780
- return weakCollectionOf('WeakSet');
4781
- }
4782
- if (isWeakRef(obj)) {
4783
- return weakCollectionOf('WeakRef');
4784
- }
4785
- if (isNumber(obj)) {
4786
- return markBoxed(inspect(Number(obj)));
4787
- }
4788
- if (isBigInt(obj)) {
4789
- return markBoxed(inspect(bigIntValueOf.call(obj)));
4790
- }
4791
- if (isBoolean(obj)) {
4792
- return markBoxed(booleanValueOf.call(obj));
4793
- }
4794
- if (isString(obj)) {
4795
- return markBoxed(inspect(String(obj)));
4796
- }
4797
- if (!isDate(obj) && !isRegExp$1(obj)) {
4798
- var ys = arrObjKeys(obj, inspect);
4799
- var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
4800
- var protoTag = obj instanceof Object ? '' : 'null prototype';
4801
- var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';
4802
- var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';
4803
- var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');
4804
- if (ys.length === 0) { return tag + '{}'; }
4805
- if (indent) {
4806
- return tag + '{' + indentedJoin(ys, indent) + '}';
4807
- }
4808
- return tag + '{ ' + $join.call(ys, ', ') + ' }';
4809
- }
4810
- return String(obj);
4811
- };
4812
-
4813
- function wrapQuotes(s, defaultStyle, opts) {
4814
- var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'";
4815
- return quoteChar + s + quoteChar;
4816
- }
4817
-
4818
- function quote(s) {
4819
- return $replace.call(String(s), /"/g, '&quot;');
4820
- }
4821
-
4822
- function isArray$3(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
4823
- function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
4824
- function isRegExp$1(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
4825
- function isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
4826
- function isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
4827
- function isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
4828
- function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
4829
-
4830
- // Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
4831
- function isSymbol(obj) {
4832
- if (hasShammedSymbols) {
4833
- return obj && typeof obj === 'object' && obj instanceof Symbol;
4834
- }
4835
- if (typeof obj === 'symbol') {
4836
- return true;
4837
- }
4838
- if (!obj || typeof obj !== 'object' || !symToString) {
4839
- return false;
4840
- }
4841
- try {
4842
- symToString.call(obj);
4843
- return true;
4844
- } catch (e) {}
4845
- return false;
4846
- }
4847
-
4848
- function isBigInt(obj) {
4849
- if (!obj || typeof obj !== 'object' || !bigIntValueOf) {
4850
- return false;
4851
- }
4852
- try {
4853
- bigIntValueOf.call(obj);
4854
- return true;
4855
- } catch (e) {}
4856
- return false;
4857
- }
4858
-
4859
- var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };
4860
- function has$3(obj, key) {
4861
- return hasOwn.call(obj, key);
4862
- }
4863
-
4864
- function toStr(obj) {
4865
- return objectToString.call(obj);
4866
- }
4867
-
4868
- function nameOf(f) {
4869
- if (f.name) { return f.name; }
4870
- var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
4871
- if (m) { return m[1]; }
4872
- return null;
4873
- }
4874
-
4875
- function indexOf(xs, x) {
4876
- if (xs.indexOf) { return xs.indexOf(x); }
4877
- for (var i = 0, l = xs.length; i < l; i++) {
4878
- if (xs[i] === x) { return i; }
4879
- }
4880
- return -1;
4881
- }
4882
-
4883
- function isMap(x) {
4884
- if (!mapSize || !x || typeof x !== 'object') {
4885
- return false;
4886
- }
4887
- try {
4888
- mapSize.call(x);
4889
- try {
4890
- setSize.call(x);
4891
- } catch (s) {
4892
- return true;
4893
- }
4894
- return x instanceof Map; // core-js workaround, pre-v2.5.0
4895
- } catch (e) {}
4896
- return false;
4897
- }
4898
-
4899
- function isWeakMap(x) {
4900
- if (!weakMapHas || !x || typeof x !== 'object') {
4901
- return false;
4902
- }
4903
- try {
4904
- weakMapHas.call(x, weakMapHas);
4905
- try {
4906
- weakSetHas.call(x, weakSetHas);
4907
- } catch (s) {
4908
- return true;
4909
- }
4910
- return x instanceof WeakMap; // core-js workaround, pre-v2.5.0
4911
- } catch (e) {}
4912
- return false;
4913
- }
4914
-
4915
- function isWeakRef(x) {
4916
- if (!weakRefDeref || !x || typeof x !== 'object') {
4917
- return false;
4918
- }
4919
- try {
4920
- weakRefDeref.call(x);
4921
- return true;
4922
- } catch (e) {}
4923
- return false;
4924
- }
4925
-
4926
- function isSet(x) {
4927
- if (!setSize || !x || typeof x !== 'object') {
4928
- return false;
4929
- }
4930
- try {
4931
- setSize.call(x);
4932
- try {
4933
- mapSize.call(x);
4934
- } catch (m) {
4935
- return true;
4936
- }
4937
- return x instanceof Set; // core-js workaround, pre-v2.5.0
4938
- } catch (e) {}
4939
- return false;
4940
- }
4941
-
4942
- function isWeakSet(x) {
4943
- if (!weakSetHas || !x || typeof x !== 'object') {
4944
- return false;
4945
- }
4946
- try {
4947
- weakSetHas.call(x, weakSetHas);
4948
- try {
4949
- weakMapHas.call(x, weakMapHas);
4950
- } catch (s) {
4951
- return true;
4952
- }
4953
- return x instanceof WeakSet; // core-js workaround, pre-v2.5.0
4954
- } catch (e) {}
4955
- return false;
4956
- }
4957
-
4958
- function isElement(x) {
4959
- if (!x || typeof x !== 'object') { return false; }
4960
- if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {
4961
- return true;
4962
- }
4963
- return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';
4964
- }
4965
-
4966
- function inspectString(str, opts) {
4967
- if (str.length > opts.maxStringLength) {
4968
- var remaining = str.length - opts.maxStringLength;
4969
- var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
4970
- return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
4971
- }
4972
- // eslint-disable-next-line no-control-regex
4973
- var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte);
4974
- return wrapQuotes(s, 'single', opts);
4975
- }
4976
-
4977
- function lowbyte(c) {
4978
- var n = c.charCodeAt(0);
4979
- var x = {
4980
- 8: 'b',
4981
- 9: 't',
4982
- 10: 'n',
4983
- 12: 'f',
4984
- 13: 'r'
4985
- }[n];
4986
- if (x) { return '\\' + x; }
4987
- return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));
4988
- }
4989
-
4990
- function markBoxed(str) {
4991
- return 'Object(' + str + ')';
4992
- }
4993
-
4994
- function weakCollectionOf(type) {
4995
- return type + ' { ? }';
4996
- }
4997
-
4998
- function collectionOf(type, size, entries, indent) {
4999
- var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');
5000
- return type + ' (' + size + ') {' + joinedEntries + '}';
5001
- }
5002
-
5003
- function singleLineValues(xs) {
5004
- for (var i = 0; i < xs.length; i++) {
5005
- if (indexOf(xs[i], '\n') >= 0) {
5006
- return false;
5007
- }
5008
- }
5009
- return true;
5010
- }
5011
-
5012
- function getIndent(opts, depth) {
5013
- var baseIndent;
5014
- if (opts.indent === '\t') {
5015
- baseIndent = '\t';
5016
- } else if (typeof opts.indent === 'number' && opts.indent > 0) {
5017
- baseIndent = $join.call(Array(opts.indent + 1), ' ');
5018
- } else {
5019
- return null;
5020
- }
5021
- return {
5022
- base: baseIndent,
5023
- prev: $join.call(Array(depth + 1), baseIndent)
5024
- };
5025
- }
5026
-
5027
- function indentedJoin(xs, indent) {
5028
- if (xs.length === 0) { return ''; }
5029
- var lineJoiner = '\n' + indent.prev + indent.base;
5030
- return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev;
5031
- }
5032
-
5033
- function arrObjKeys(obj, inspect) {
5034
- var isArr = isArray$3(obj);
5035
- var xs = [];
5036
- if (isArr) {
5037
- xs.length = obj.length;
5038
- for (var i = 0; i < obj.length; i++) {
5039
- xs[i] = has$3(obj, i) ? inspect(obj[i], obj) : '';
5040
- }
5041
- }
5042
- var syms = typeof gOPS === 'function' ? gOPS(obj) : [];
5043
- var symMap;
5044
- if (hasShammedSymbols) {
5045
- symMap = {};
5046
- for (var k = 0; k < syms.length; k++) {
5047
- symMap['$' + syms[k]] = syms[k];
5048
- }
5049
- }
5050
-
5051
- for (var key in obj) { // eslint-disable-line no-restricted-syntax
5052
- if (!has$3(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
5053
- if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
5054
- if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
5055
- // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
5056
- continue; // eslint-disable-line no-restricted-syntax, no-continue
5057
- } else if ($test.call(/[^\w$]/, key)) {
5058
- xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
5059
- } else {
5060
- xs.push(key + ': ' + inspect(obj[key], obj));
5061
- }
5062
- }
5063
- if (typeof gOPS === 'function') {
5064
- for (var j = 0; j < syms.length; j++) {
5065
- if (isEnumerable.call(obj, syms[j])) {
5066
- xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));
5067
- }
5068
- }
5069
- }
5070
- return xs;
5071
- }
5072
-
5073
- var GetIntrinsic = getIntrinsic;
5074
- var callBound = callBound$1;
5075
- var inspect = objectInspect;
5076
-
5077
- var $TypeError = GetIntrinsic('%TypeError%');
5078
- var $WeakMap = GetIntrinsic('%WeakMap%', true);
5079
- var $Map = GetIntrinsic('%Map%', true);
5080
-
5081
- var $weakMapGet = callBound('WeakMap.prototype.get', true);
5082
- var $weakMapSet = callBound('WeakMap.prototype.set', true);
5083
- var $weakMapHas = callBound('WeakMap.prototype.has', true);
5084
- var $mapGet = callBound('Map.prototype.get', true);
5085
- var $mapSet = callBound('Map.prototype.set', true);
5086
- var $mapHas = callBound('Map.prototype.has', true);
5087
-
5088
- /*
5089
- * This function traverses the list returning the node corresponding to the
5090
- * given key.
5091
- *
5092
- * That node is also moved to the head of the list, so that if it's accessed
5093
- * again we don't need to traverse the whole list. By doing so, all the recently
5094
- * used nodes can be accessed relatively quickly.
5095
- */
5096
- var listGetNode = function (list, key) { // eslint-disable-line consistent-return
5097
- for (var prev = list, curr; (curr = prev.next) !== null; prev = curr) {
5098
- if (curr.key === key) {
5099
- prev.next = curr.next;
5100
- curr.next = list.next;
5101
- list.next = curr; // eslint-disable-line no-param-reassign
5102
- return curr;
5103
- }
5104
- }
5105
- };
5106
-
5107
- var listGet = function (objects, key) {
5108
- var node = listGetNode(objects, key);
5109
- return node && node.value;
5110
- };
5111
- var listSet = function (objects, key, value) {
5112
- var node = listGetNode(objects, key);
5113
- if (node) {
5114
- node.value = value;
5115
- } else {
5116
- // Prepend the new node to the beginning of the list
5117
- objects.next = { // eslint-disable-line no-param-reassign
5118
- key: key,
5119
- next: objects.next,
5120
- value: value
5121
- };
5122
- }
5123
- };
5124
- var listHas = function (objects, key) {
5125
- return !!listGetNode(objects, key);
5126
- };
5127
-
5128
- var sideChannel = function getSideChannel() {
5129
- var $wm;
5130
- var $m;
5131
- var $o;
5132
- var channel = {
5133
- assert: function (key) {
5134
- if (!channel.has(key)) {
5135
- throw new $TypeError('Side channel does not contain ' + inspect(key));
5136
- }
5137
- },
5138
- get: function (key) { // eslint-disable-line consistent-return
5139
- if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
5140
- if ($wm) {
5141
- return $weakMapGet($wm, key);
5142
- }
5143
- } else if ($Map) {
5144
- if ($m) {
5145
- return $mapGet($m, key);
5146
- }
5147
- } else {
5148
- if ($o) { // eslint-disable-line no-lonely-if
5149
- return listGet($o, key);
5150
- }
5151
- }
5152
- },
5153
- has: function (key) {
5154
- if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
5155
- if ($wm) {
5156
- return $weakMapHas($wm, key);
5157
- }
5158
- } else if ($Map) {
5159
- if ($m) {
5160
- return $mapHas($m, key);
5161
- }
5162
- } else {
5163
- if ($o) { // eslint-disable-line no-lonely-if
5164
- return listHas($o, key);
5165
- }
5166
- }
5167
- return false;
5168
- },
5169
- set: function (key, value) {
5170
- if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
5171
- if (!$wm) {
5172
- $wm = new $WeakMap();
5173
- }
5174
- $weakMapSet($wm, key, value);
5175
- } else if ($Map) {
5176
- if (!$m) {
5177
- $m = new $Map();
5178
- }
5179
- $mapSet($m, key, value);
5180
- } else {
5181
- if (!$o) {
5182
- /*
5183
- * Initialize the linked list as an empty node, so that we don't have
5184
- * to special-case handling of the first node: we can always refer to
5185
- * it as (previous node).next, instead of something like (list).head
5186
- */
5187
- $o = { key: {}, next: null };
5188
- }
5189
- listSet($o, key, value);
5190
- }
5191
- }
5192
- };
5193
- return channel;
5194
- };
5195
-
5196
- var replace = String.prototype.replace;
5197
- var percentTwenties = /%20/g;
5198
-
5199
- var Format = {
5200
- RFC1738: 'RFC1738',
5201
- RFC3986: 'RFC3986'
5202
- };
5203
-
5204
- var formats$3 = {
5205
- 'default': Format.RFC3986,
5206
- formatters: {
5207
- RFC1738: function (value) {
5208
- return replace.call(value, percentTwenties, '+');
5209
- },
5210
- RFC3986: function (value) {
5211
- return String(value);
5212
- }
5213
- },
5214
- RFC1738: Format.RFC1738,
5215
- RFC3986: Format.RFC3986
5216
- };
5217
-
5218
- var formats$2 = formats$3;
5219
-
5220
- var has$2 = Object.prototype.hasOwnProperty;
5221
- var isArray$2 = Array.isArray;
5222
-
5223
- var hexTable = (function () {
5224
- var array = [];
5225
- for (var i = 0; i < 256; ++i) {
5226
- array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
5227
- }
5228
-
5229
- return array;
5230
- }());
5231
-
5232
- var compactQueue = function compactQueue(queue) {
5233
- while (queue.length > 1) {
5234
- var item = queue.pop();
5235
- var obj = item.obj[item.prop];
5236
-
5237
- if (isArray$2(obj)) {
5238
- var compacted = [];
5239
-
5240
- for (var j = 0; j < obj.length; ++j) {
5241
- if (typeof obj[j] !== 'undefined') {
5242
- compacted.push(obj[j]);
5243
- }
5244
- }
5245
-
5246
- item.obj[item.prop] = compacted;
5247
- }
5248
- }
5249
- };
5250
-
5251
- var arrayToObject = function arrayToObject(source, options) {
5252
- var obj = options && options.plainObjects ? Object.create(null) : {};
5253
- for (var i = 0; i < source.length; ++i) {
5254
- if (typeof source[i] !== 'undefined') {
5255
- obj[i] = source[i];
5256
- }
5257
- }
5258
-
5259
- return obj;
5260
- };
5261
-
5262
- var merge$2 = function merge(target, source, options) {
5263
- /* eslint no-param-reassign: 0 */
5264
- if (!source) {
5265
- return target;
5266
- }
5267
-
5268
- if (typeof source !== 'object') {
5269
- if (isArray$2(target)) {
5270
- target.push(source);
5271
- } else if (target && typeof target === 'object') {
5272
- if ((options && (options.plainObjects || options.allowPrototypes)) || !has$2.call(Object.prototype, source)) {
5273
- target[source] = true;
5274
- }
5275
- } else {
5276
- return [target, source];
5277
- }
5278
-
5279
- return target;
5280
- }
5281
-
5282
- if (!target || typeof target !== 'object') {
5283
- return [target].concat(source);
5284
- }
5285
-
5286
- var mergeTarget = target;
5287
- if (isArray$2(target) && !isArray$2(source)) {
5288
- mergeTarget = arrayToObject(target, options);
5289
- }
5290
-
5291
- if (isArray$2(target) && isArray$2(source)) {
5292
- source.forEach(function (item, i) {
5293
- if (has$2.call(target, i)) {
5294
- var targetItem = target[i];
5295
- if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
5296
- target[i] = merge(targetItem, item, options);
5297
- } else {
5298
- target.push(item);
5299
- }
5300
- } else {
5301
- target[i] = item;
5302
- }
5303
- });
5304
- return target;
5305
- }
5306
-
5307
- return Object.keys(source).reduce(function (acc, key) {
5308
- var value = source[key];
5309
-
5310
- if (has$2.call(acc, key)) {
5311
- acc[key] = merge(acc[key], value, options);
5312
- } else {
5313
- acc[key] = value;
5314
- }
5315
- return acc;
5316
- }, mergeTarget);
5317
- };
5318
-
5319
- var assign = function assignSingleSource(target, source) {
5320
- return Object.keys(source).reduce(function (acc, key) {
5321
- acc[key] = source[key];
5322
- return acc;
5323
- }, target);
5324
- };
5325
-
5326
- var decode$1 = function (str, decoder, charset) {
5327
- var strWithoutPlus = str.replace(/\+/g, ' ');
5328
- if (charset === 'iso-8859-1') {
5329
- // unescape never throws, no try...catch needed:
5330
- return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
5331
- }
5332
- // utf-8
5333
- try {
5334
- return decodeURIComponent(strWithoutPlus);
5335
- } catch (e) {
5336
- return strWithoutPlus;
5337
- }
5338
- };
5339
-
5340
- var encode$1 = function encode(str, defaultEncoder, charset, kind, format) {
5341
- // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
5342
- // It has been adapted here for stricter adherence to RFC 3986
5343
- if (str.length === 0) {
5344
- return str;
5345
- }
5346
-
5347
- var string = str;
5348
- if (typeof str === 'symbol') {
5349
- string = Symbol.prototype.toString.call(str);
5350
- } else if (typeof str !== 'string') {
5351
- string = String(str);
5352
- }
5353
-
5354
- if (charset === 'iso-8859-1') {
5355
- return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
5356
- return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
5357
- });
5358
- }
5359
-
5360
- var out = '';
5361
- for (var i = 0; i < string.length; ++i) {
5362
- var c = string.charCodeAt(i);
5363
-
5364
- if (
5365
- c === 0x2D // -
5366
- || c === 0x2E // .
5367
- || c === 0x5F // _
5368
- || c === 0x7E // ~
5369
- || (c >= 0x30 && c <= 0x39) // 0-9
5370
- || (c >= 0x41 && c <= 0x5A) // a-z
5371
- || (c >= 0x61 && c <= 0x7A) // A-Z
5372
- || (format === formats$2.RFC1738 && (c === 0x28 || c === 0x29)) // ( )
5373
- ) {
5374
- out += string.charAt(i);
5375
- continue;
5376
- }
5377
-
5378
- if (c < 0x80) {
5379
- out = out + hexTable[c];
5380
- continue;
5381
- }
5382
-
5383
- if (c < 0x800) {
5384
- out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
5385
- continue;
5386
- }
5387
-
5388
- if (c < 0xD800 || c >= 0xE000) {
5389
- out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
5390
- continue;
5391
- }
5392
-
5393
- i += 1;
5394
- c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
5395
- /* eslint operator-linebreak: [2, "before"] */
5396
- out += hexTable[0xF0 | (c >> 18)]
5397
- + hexTable[0x80 | ((c >> 12) & 0x3F)]
5398
- + hexTable[0x80 | ((c >> 6) & 0x3F)]
5399
- + hexTable[0x80 | (c & 0x3F)];
5400
- }
5401
-
5402
- return out;
5403
- };
5404
-
5405
- var compact = function compact(value) {
5406
- var queue = [{ obj: { o: value }, prop: 'o' }];
5407
- var refs = [];
5408
-
5409
- for (var i = 0; i < queue.length; ++i) {
5410
- var item = queue[i];
5411
- var obj = item.obj[item.prop];
5412
-
5413
- var keys = Object.keys(obj);
5414
- for (var j = 0; j < keys.length; ++j) {
5415
- var key = keys[j];
5416
- var val = obj[key];
5417
- if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
5418
- queue.push({ obj: obj, prop: key });
5419
- refs.push(val);
5420
- }
5421
- }
5422
- }
5423
-
5424
- compactQueue(queue);
5425
-
5426
- return value;
5427
- };
5428
-
5429
- var isRegExp = function isRegExp(obj) {
5430
- return Object.prototype.toString.call(obj) === '[object RegExp]';
5431
- };
5432
-
5433
- var isBuffer = function isBuffer(obj) {
5434
- if (!obj || typeof obj !== 'object') {
5435
- return false;
5436
- }
5437
-
5438
- return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
5439
- };
5440
-
5441
- var combine = function combine(a, b) {
5442
- return [].concat(a, b);
5443
- };
5444
-
5445
- var maybeMap = function maybeMap(val, fn) {
5446
- if (isArray$2(val)) {
5447
- var mapped = [];
5448
- for (var i = 0; i < val.length; i += 1) {
5449
- mapped.push(fn(val[i]));
5450
- }
5451
- return mapped;
5452
- }
5453
- return fn(val);
5454
- };
5455
-
5456
- var utils$2 = {
5457
- arrayToObject: arrayToObject,
5458
- assign: assign,
5459
- combine: combine,
5460
- compact: compact,
5461
- decode: decode$1,
5462
- encode: encode$1,
5463
- isBuffer: isBuffer,
5464
- isRegExp: isRegExp,
5465
- maybeMap: maybeMap,
5466
- merge: merge$2
5467
- };
5468
-
5469
- var getSideChannel = sideChannel;
5470
- var utils$1 = utils$2;
5471
- var formats$1 = formats$3;
5472
- var has$1 = Object.prototype.hasOwnProperty;
5473
-
5474
- var arrayPrefixGenerators = {
5475
- brackets: function brackets(prefix) {
5476
- return prefix + '[]';
5477
- },
5478
- comma: 'comma',
5479
- indices: function indices(prefix, key) {
5480
- return prefix + '[' + key + ']';
5481
- },
5482
- repeat: function repeat(prefix) {
5483
- return prefix;
5484
- }
5485
- };
5486
-
5487
- var isArray$1 = Array.isArray;
5488
- var split = String.prototype.split;
5489
- var push = Array.prototype.push;
5490
- var pushToArray = function (arr, valueOrArray) {
5491
- push.apply(arr, isArray$1(valueOrArray) ? valueOrArray : [valueOrArray]);
5492
- };
5493
-
5494
- var toISO = Date.prototype.toISOString;
5495
-
5496
- var defaultFormat = formats$1['default'];
5497
- var defaults$2 = {
5498
- addQueryPrefix: false,
5499
- allowDots: false,
5500
- charset: 'utf-8',
5501
- charsetSentinel: false,
5502
- delimiter: '&',
5503
- encode: true,
5504
- encoder: utils$1.encode,
5505
- encodeValuesOnly: false,
5506
- format: defaultFormat,
5507
- formatter: formats$1.formatters[defaultFormat],
5508
- // deprecated
5509
- indices: false,
5510
- serializeDate: function serializeDate(date) {
5511
- return toISO.call(date);
5512
- },
5513
- skipNulls: false,
5514
- strictNullHandling: false
5515
- };
5516
-
5517
- var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
5518
- return typeof v === 'string'
5519
- || typeof v === 'number'
5520
- || typeof v === 'boolean'
5521
- || typeof v === 'symbol'
5522
- || typeof v === 'bigint';
5523
- };
5524
-
5525
- var sentinel = {};
5526
-
5527
- var stringify$4 = function stringify(
5528
- object,
5529
- prefix,
5530
- generateArrayPrefix,
5531
- commaRoundTrip,
5532
- strictNullHandling,
5533
- skipNulls,
5534
- encoder,
5535
- filter,
5536
- sort,
5537
- allowDots,
5538
- serializeDate,
5539
- format,
5540
- formatter,
5541
- encodeValuesOnly,
5542
- charset,
5543
- sideChannel
5544
- ) {
5545
- var obj = object;
5546
-
5547
- var tmpSc = sideChannel;
5548
- var step = 0;
5549
- var findFlag = false;
5550
- while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {
5551
- // Where object last appeared in the ref tree
5552
- var pos = tmpSc.get(object);
5553
- step += 1;
5554
- if (typeof pos !== 'undefined') {
5555
- if (pos === step) {
5556
- throw new RangeError('Cyclic object value');
5557
- } else {
5558
- findFlag = true; // Break while
5559
- }
5560
- }
5561
- if (typeof tmpSc.get(sentinel) === 'undefined') {
5562
- step = 0;
5563
- }
5564
- }
5565
-
5566
- if (typeof filter === 'function') {
5567
- obj = filter(prefix, obj);
5568
- } else if (obj instanceof Date) {
5569
- obj = serializeDate(obj);
5570
- } else if (generateArrayPrefix === 'comma' && isArray$1(obj)) {
5571
- obj = utils$1.maybeMap(obj, function (value) {
5572
- if (value instanceof Date) {
5573
- return serializeDate(value);
5574
- }
5575
- return value;
5576
- });
5577
- }
5578
-
5579
- if (obj === null) {
5580
- if (strictNullHandling) {
5581
- return encoder && !encodeValuesOnly ? encoder(prefix, defaults$2.encoder, charset, 'key', format) : prefix;
5582
- }
5583
-
5584
- obj = '';
5585
- }
5586
-
5587
- if (isNonNullishPrimitive(obj) || utils$1.isBuffer(obj)) {
5588
- if (encoder) {
5589
- var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults$2.encoder, charset, 'key', format);
5590
- if (generateArrayPrefix === 'comma' && encodeValuesOnly) {
5591
- var valuesArray = split.call(String(obj), ',');
5592
- var valuesJoined = '';
5593
- for (var i = 0; i < valuesArray.length; ++i) {
5594
- valuesJoined += (i === 0 ? '' : ',') + formatter(encoder(valuesArray[i], defaults$2.encoder, charset, 'value', format));
5595
- }
5596
- return [formatter(keyValue) + (commaRoundTrip && isArray$1(obj) && valuesArray.length === 1 ? '[]' : '') + '=' + valuesJoined];
5597
- }
5598
- return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults$2.encoder, charset, 'value', format))];
5599
- }
5600
- return [formatter(prefix) + '=' + formatter(String(obj))];
5601
- }
5602
-
5603
- var values = [];
5604
-
5605
- if (typeof obj === 'undefined') {
5606
- return values;
5607
- }
5608
-
5609
- var objKeys;
5610
- if (generateArrayPrefix === 'comma' && isArray$1(obj)) {
5611
- // we need to join elements in
5612
- objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
5613
- } else if (isArray$1(filter)) {
5614
- objKeys = filter;
5615
- } else {
5616
- var keys = Object.keys(obj);
5617
- objKeys = sort ? keys.sort(sort) : keys;
5618
- }
5619
-
5620
- var adjustedPrefix = commaRoundTrip && isArray$1(obj) && obj.length === 1 ? prefix + '[]' : prefix;
5621
-
5622
- for (var j = 0; j < objKeys.length; ++j) {
5623
- var key = objKeys[j];
5624
- var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
5625
-
5626
- if (skipNulls && value === null) {
5627
- continue;
5628
- }
5629
-
5630
- var keyPrefix = isArray$1(obj)
5631
- ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix
5632
- : adjustedPrefix + (allowDots ? '.' + key : '[' + key + ']');
5633
-
5634
- sideChannel.set(object, step);
5635
- var valueSideChannel = getSideChannel();
5636
- valueSideChannel.set(sentinel, sideChannel);
5637
- pushToArray(values, stringify(
5638
- value,
5639
- keyPrefix,
5640
- generateArrayPrefix,
5641
- commaRoundTrip,
5642
- strictNullHandling,
5643
- skipNulls,
5644
- encoder,
5645
- filter,
5646
- sort,
5647
- allowDots,
5648
- serializeDate,
5649
- format,
5650
- formatter,
5651
- encodeValuesOnly,
5652
- charset,
5653
- valueSideChannel
5654
- ));
5655
- }
5656
-
5657
- return values;
5658
- };
5659
-
5660
- var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
5661
- if (!opts) {
5662
- return defaults$2;
5663
- }
5664
-
5665
- if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
5666
- throw new TypeError('Encoder has to be a function.');
5667
- }
3261
+ * it was defined in the bind method
3262
+ *
3263
+ * @param {string|Array} keys
3264
+ * @param {string} action
3265
+ * @returns void
3266
+ */
3267
+ Mousetrap.prototype.unbind = function(keys, action) {
3268
+ var self = this;
3269
+ return self.bind.call(self, keys, function() {}, action);
3270
+ };
5668
3271
 
5669
- var charset = opts.charset || defaults$2.charset;
5670
- if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
5671
- throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
5672
- }
3272
+ /**
3273
+ * triggers an event that has already been bound
3274
+ *
3275
+ * @param {string} keys
3276
+ * @param {string=} action
3277
+ * @returns void
3278
+ */
3279
+ Mousetrap.prototype.trigger = function(keys, action) {
3280
+ var self = this;
3281
+ if (self._directMap[keys + ':' + action]) {
3282
+ self._directMap[keys + ':' + action]({}, keys);
3283
+ }
3284
+ return self;
3285
+ };
5673
3286
 
5674
- var format = formats$1['default'];
5675
- if (typeof opts.format !== 'undefined') {
5676
- if (!has$1.call(formats$1.formatters, opts.format)) {
5677
- throw new TypeError('Unknown format option provided.');
5678
- }
5679
- format = opts.format;
5680
- }
5681
- var formatter = formats$1.formatters[format];
3287
+ /**
3288
+ * resets the library back to its initial state. this is useful
3289
+ * if you want to clear out the current keyboard shortcuts and bind
3290
+ * new ones - for example if you switch to another page
3291
+ *
3292
+ * @returns void
3293
+ */
3294
+ Mousetrap.prototype.reset = function() {
3295
+ var self = this;
3296
+ self._callbacks = {};
3297
+ self._directMap = {};
3298
+ return self;
3299
+ };
5682
3300
 
5683
- var filter = defaults$2.filter;
5684
- if (typeof opts.filter === 'function' || isArray$1(opts.filter)) {
5685
- filter = opts.filter;
5686
- }
3301
+ /**
3302
+ * should we stop this event before firing off callbacks
3303
+ *
3304
+ * @param {Event} e
3305
+ * @param {Element} element
3306
+ * @return {boolean}
3307
+ */
3308
+ Mousetrap.prototype.stopCallback = function(e, element) {
3309
+ var self = this;
5687
3310
 
5688
- return {
5689
- addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults$2.addQueryPrefix,
5690
- allowDots: typeof opts.allowDots === 'undefined' ? defaults$2.allowDots : !!opts.allowDots,
5691
- charset: charset,
5692
- charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults$2.charsetSentinel,
5693
- delimiter: typeof opts.delimiter === 'undefined' ? defaults$2.delimiter : opts.delimiter,
5694
- encode: typeof opts.encode === 'boolean' ? opts.encode : defaults$2.encode,
5695
- encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults$2.encoder,
5696
- encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults$2.encodeValuesOnly,
5697
- filter: filter,
5698
- format: format,
5699
- formatter: formatter,
5700
- serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults$2.serializeDate,
5701
- skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults$2.skipNulls,
5702
- sort: typeof opts.sort === 'function' ? opts.sort : null,
5703
- strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults$2.strictNullHandling
5704
- };
5705
- };
3311
+ // if the element has the class "mousetrap" then no need to stop
3312
+ if ((' ' + element.className + ' ').indexOf(' mousetrap ') > -1) {
3313
+ return false;
3314
+ }
5706
3315
 
5707
- var stringify_1 = function (object, opts) {
5708
- var obj = object;
5709
- var options = normalizeStringifyOptions(opts);
3316
+ if (_belongsTo(element, self.target)) {
3317
+ return false;
3318
+ }
5710
3319
 
5711
- var objKeys;
5712
- var filter;
3320
+ // Events originating from a shadow DOM are re-targetted and `e.target` is the shadow host,
3321
+ // not the initial event target in the shadow tree. Note that not all events cross the
3322
+ // shadow boundary.
3323
+ // For shadow trees with `mode: 'open'`, the initial event target is the first element in
3324
+ // the event’s composed path. For shadow trees with `mode: 'closed'`, the initial event
3325
+ // target cannot be obtained.
3326
+ if ('composedPath' in e && typeof e.composedPath === 'function') {
3327
+ // For open shadow trees, update `element` so that the following check works.
3328
+ var initialEventTarget = e.composedPath()[0];
3329
+ if (initialEventTarget !== e.target) {
3330
+ element = initialEventTarget;
3331
+ }
3332
+ }
5713
3333
 
5714
- if (typeof options.filter === 'function') {
5715
- filter = options.filter;
5716
- obj = filter('', obj);
5717
- } else if (isArray$1(options.filter)) {
5718
- filter = options.filter;
5719
- objKeys = filter;
5720
- }
3334
+ // stop for input, select, and textarea
3335
+ return element.tagName == 'INPUT' || element.tagName == 'SELECT' || element.tagName == 'TEXTAREA' || element.isContentEditable;
3336
+ };
5721
3337
 
5722
- var keys = [];
3338
+ /**
3339
+ * exposes _handleKey publicly so it can be overwritten by extensions
3340
+ */
3341
+ Mousetrap.prototype.handleKey = function() {
3342
+ var self = this;
3343
+ return self._handleKey.apply(self, arguments);
3344
+ };
5723
3345
 
5724
- if (typeof obj !== 'object' || obj === null) {
5725
- return '';
5726
- }
3346
+ /**
3347
+ * allow custom key mappings
3348
+ */
3349
+ Mousetrap.addKeycodes = function(object) {
3350
+ for (var key in object) {
3351
+ if (object.hasOwnProperty(key)) {
3352
+ _MAP[key] = object[key];
3353
+ }
3354
+ }
3355
+ _REVERSE_MAP = null;
3356
+ };
5727
3357
 
5728
- var arrayFormat;
5729
- if (opts && opts.arrayFormat in arrayPrefixGenerators) {
5730
- arrayFormat = opts.arrayFormat;
5731
- } else if (opts && 'indices' in opts) {
5732
- arrayFormat = opts.indices ? 'indices' : 'repeat';
5733
- } else {
5734
- arrayFormat = 'indices';
5735
- }
3358
+ /**
3359
+ * Init the global mousetrap functions
3360
+ *
3361
+ * This method is needed to allow the global mousetrap functions to work
3362
+ * now that mousetrap is a constructor function.
3363
+ */
3364
+ Mousetrap.init = function() {
3365
+ var documentMousetrap = Mousetrap(document);
3366
+ for (var method in documentMousetrap) {
3367
+ if (method.charAt(0) !== '_') {
3368
+ Mousetrap[method] = (function(method) {
3369
+ return function() {
3370
+ return documentMousetrap[method].apply(documentMousetrap, arguments);
3371
+ };
3372
+ } (method));
3373
+ }
3374
+ }
3375
+ };
5736
3376
 
5737
- var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
5738
- if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
5739
- throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
5740
- }
5741
- var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;
3377
+ Mousetrap.init();
5742
3378
 
5743
- if (!objKeys) {
5744
- objKeys = Object.keys(obj);
5745
- }
3379
+ // expose mousetrap to the global object
3380
+ window.Mousetrap = Mousetrap;
5746
3381
 
5747
- if (options.sort) {
5748
- objKeys.sort(options.sort);
5749
- }
3382
+ // expose as a common js module
3383
+ if (module.exports) {
3384
+ module.exports = Mousetrap;
3385
+ }
5750
3386
 
5751
- var sideChannel = getSideChannel();
5752
- for (var i = 0; i < objKeys.length; ++i) {
5753
- var key = objKeys[i];
3387
+ // expose mousetrap as an AMD module
3388
+ if (typeof undefined$1 === 'function' && undefined$1.amd) {
3389
+ undefined$1(function() {
3390
+ return Mousetrap;
3391
+ });
3392
+ }
3393
+ }) (typeof window !== 'undefined' ? window : null, typeof window !== 'undefined' ? document : null);
3394
+ } (mousetrap));
5754
3395
 
5755
- if (options.skipNulls && obj[key] === null) {
5756
- continue;
5757
- }
5758
- pushToArray(keys, stringify$4(
5759
- obj[key],
5760
- key,
5761
- generateArrayPrefix,
5762
- commaRoundTrip,
5763
- options.strictNullHandling,
5764
- options.skipNulls,
5765
- options.encode ? options.encoder : null,
5766
- options.filter,
5767
- options.sort,
5768
- options.allowDots,
5769
- options.serializeDate,
5770
- options.format,
5771
- options.formatter,
5772
- options.encodeValuesOnly,
5773
- options.charset,
5774
- sideChannel
5775
- ));
5776
- }
3396
+ var Mousetrap$1 = mousetrap.exports;
5777
3397
 
5778
- var joined = keys.join(options.delimiter);
5779
- var prefix = options.addQueryPrefix === true ? '?' : '';
3398
+ /**
3399
+ * adds a bindGlobal method to Mousetrap that allows you to
3400
+ * bind specific keyboard shortcuts that will still work
3401
+ * inside a text input field
3402
+ *
3403
+ * usage:
3404
+ * Mousetrap.bindGlobal('ctrl+s', _saveChanges);
3405
+ */
3406
+ /* global Mousetrap:true */
3407
+ (function(Mousetrap) {
3408
+ var _globalCallbacks = {};
3409
+ var _originalStopCallback = Mousetrap.prototype.stopCallback;
3410
+
3411
+ Mousetrap.prototype.stopCallback = function(e, element, combo, sequence) {
3412
+ var self = this;
3413
+
3414
+ if (self.paused) {
3415
+ return true;
3416
+ }
3417
+
3418
+ if (_globalCallbacks[combo] || _globalCallbacks[sequence]) {
3419
+ return false;
3420
+ }
3421
+
3422
+ return _originalStopCallback.call(self, e, element, combo);
3423
+ };
3424
+
3425
+ Mousetrap.prototype.bindGlobal = function(keys, callback, action) {
3426
+ var self = this;
3427
+ self.bind(keys, callback, action);
3428
+
3429
+ if (keys instanceof Array) {
3430
+ for (var i = 0; i < keys.length; i++) {
3431
+ _globalCallbacks[keys[i]] = true;
3432
+ }
3433
+ return;
3434
+ }
3435
+
3436
+ _globalCallbacks[keys] = true;
3437
+ };
3438
+
3439
+ Mousetrap.prototype.unbindGlobal = function(keys, action) {
3440
+ var self = this;
3441
+ self.unbind(keys, action);
3442
+
3443
+ if (keys instanceof Array) {
3444
+ for (var i = 0; i < keys.length; i++) {
3445
+ _globalCallbacks[keys[i]] = false;
3446
+ }
3447
+ return;
3448
+ }
3449
+
3450
+ _globalCallbacks[keys] = false;
3451
+ };
3452
+
3453
+ Mousetrap.init();
3454
+ }) (Mousetrap);
5780
3455
 
5781
- if (options.charsetSentinel) {
5782
- if (options.charset === 'iso-8859-1') {
5783
- // encodeURIComponent('&#10003;'), the "numeric entity" representation of a checkmark
5784
- prefix += 'utf8=%26%2310003%3B&';
5785
- } else {
5786
- // encodeURIComponent('✓')
5787
- prefix += 'utf8=%E2%9C%93&';
5788
- }
5789
- }
3456
+ var MAC_TO_WINDOWS_KEYS_MAP = {
3457
+ option: "alt",
3458
+ command: "ctrl",
3459
+ "return": "enter",
3460
+ "delete": "backspace"
3461
+ };
3462
+ var OS = {
3463
+ mac: "OS X",
3464
+ windows: "Windows"
3465
+ };
5790
3466
 
5791
- return joined.length > 0 ? prefix + joined : '';
3467
+ var convertHotkeyToUsersPlatform = function convertHotkeyToUsersPlatform(hotkey) {
3468
+ var _platformInfo$os, _platformInfo$os$fami;
3469
+ var platformInfo = platform.parse(navigator.userAgent);
3470
+ var isOSX = (_platformInfo$os = platformInfo.os) === null || _platformInfo$os === void 0 ? void 0 : (_platformInfo$os$fami = _platformInfo$os.family) === null || _platformInfo$os$fami === void 0 ? void 0 : _platformInfo$os$fami.includes(OS.mac);
3471
+ if (isOSX) return hotkey;
3472
+ var hotkeyForWindows = hotkey;
3473
+ toPairs(MAC_TO_WINDOWS_KEYS_MAP).forEach(function (_ref) {
3474
+ var _ref2 = _slicedToArray(_ref, 2),
3475
+ macKey = _ref2[0],
3476
+ windowsKey = _ref2[1];
3477
+ hotkeyForWindows = hotkeyForWindows.replaceAll(macKey, windowsKey);
3478
+ });
3479
+ return hotkeyForWindows;
5792
3480
  };
5793
3481
 
5794
- var utils = utils$2;
5795
-
5796
- var has = Object.prototype.hasOwnProperty;
5797
- var isArray = Array.isArray;
5798
-
5799
- var defaults$1 = {
5800
- allowDots: false,
5801
- allowPrototypes: false,
5802
- allowSparse: false,
5803
- arrayLimit: 20,
5804
- charset: 'utf-8',
5805
- charsetSentinel: false,
5806
- comma: false,
5807
- decoder: utils.decode,
5808
- delimiter: '&',
5809
- depth: 5,
5810
- ignoreQueryPrefix: false,
5811
- interpretNumericEntities: false,
5812
- parameterLimit: 1000,
5813
- parseArrays: true,
5814
- plainObjects: false,
5815
- strictNullHandling: false
3482
+ var MODES$1 = {
3483
+ "default": "default",
3484
+ global: "global",
3485
+ scoped: "scoped"
3486
+ };
3487
+ var DEFAULT_CONFIG = {
3488
+ mode: MODES$1["default"],
3489
+ unbindOnUnmount: true,
3490
+ enabled: true
5816
3491
  };
5817
3492
 
5818
- var interpretNumericEntities = function (str) {
5819
- return str.replace(/&#(\d+);/g, function ($0, numberStr) {
5820
- return String.fromCharCode(parseInt(numberStr, 10));
3493
+ var useHotKeys = function useHotKeys(hotkey, handler, userConfig) {
3494
+ var ref = useRef(null);
3495
+ var convertedHotkey = convertHotkeyToUsersPlatform(hotkey);
3496
+ var config = mergeLeft(userConfig, DEFAULT_CONFIG);
3497
+ useEffect(function () {
3498
+ config.enabled && bindHotKey({
3499
+ mode: config.mode,
3500
+ hotkey: convertedHotkey,
3501
+ handler: handler,
3502
+ ref: ref
5821
3503
  });
3504
+ return function () {
3505
+ config.unbindOnUnmount && unBindHotKey(config.mode, convertedHotkey);
3506
+ };
3507
+ }, [handler, config.mode, convertedHotkey, config]);
3508
+ return config.mode === MODES$1.scoped ? ref : null;
5822
3509
  };
5823
-
5824
- var parseArrayValue = function (val, options) {
5825
- if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
5826
- return val.split(',');
5827
- }
5828
-
5829
- return val;
3510
+ var bindHotKey = function bindHotKey(_ref) {
3511
+ var mode = _ref.mode,
3512
+ hotkey = _ref.hotkey,
3513
+ handler = _ref.handler,
3514
+ ref = _ref.ref;
3515
+ switch (mode) {
3516
+ case MODES$1.global:
3517
+ Mousetrap$1.bindGlobal(hotkey, handler);
3518
+ break;
3519
+ case MODES$1.scoped:
3520
+ Mousetrap$1(ref.current).bind(hotkey, handler);
3521
+ break;
3522
+ default:
3523
+ Mousetrap$1.bind(hotkey, handler);
3524
+ }
5830
3525
  };
5831
-
5832
- // This is what browsers will submit when the ✓ character occurs in an
5833
- // application/x-www-form-urlencoded body and the encoding of the page containing
5834
- // the form is iso-8859-1, or when the submitted form has an accept-charset
5835
- // attribute of iso-8859-1. Presumably also with other charsets that do not contain
5836
- // the ✓ character, such as us-ascii.
5837
- var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('&#10003;')
5838
-
5839
- // These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
5840
- var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
5841
-
5842
- var parseValues = function parseQueryStringValues(str, options) {
5843
- var obj = {};
5844
- var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
5845
- var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
5846
- var parts = cleanStr.split(options.delimiter, limit);
5847
- var skipIndex = -1; // Keep track of where the utf8 sentinel was found
5848
- var i;
5849
-
5850
- var charset = options.charset;
5851
- if (options.charsetSentinel) {
5852
- for (i = 0; i < parts.length; ++i) {
5853
- if (parts[i].indexOf('utf8=') === 0) {
5854
- if (parts[i] === charsetSentinel) {
5855
- charset = 'utf-8';
5856
- } else if (parts[i] === isoSentinel) {
5857
- charset = 'iso-8859-1';
5858
- }
5859
- skipIndex = i;
5860
- i = parts.length; // The eslint settings do not allow break;
5861
- }
5862
- }
5863
- }
5864
-
5865
- for (i = 0; i < parts.length; ++i) {
5866
- if (i === skipIndex) {
5867
- continue;
5868
- }
5869
- var part = parts[i];
5870
-
5871
- var bracketEqualsPos = part.indexOf(']=');
5872
- var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
5873
-
5874
- var key, val;
5875
- if (pos === -1) {
5876
- key = options.decoder(part, defaults$1.decoder, charset, 'key');
5877
- val = options.strictNullHandling ? null : '';
5878
- } else {
5879
- key = options.decoder(part.slice(0, pos), defaults$1.decoder, charset, 'key');
5880
- val = utils.maybeMap(
5881
- parseArrayValue(part.slice(pos + 1), options),
5882
- function (encodedVal) {
5883
- return options.decoder(encodedVal, defaults$1.decoder, charset, 'value');
5884
- }
5885
- );
5886
- }
5887
-
5888
- if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
5889
- val = interpretNumericEntities(val);
5890
- }
5891
-
5892
- if (part.indexOf('[]=') > -1) {
5893
- val = isArray(val) ? [val] : val;
5894
- }
5895
-
5896
- if (has.call(obj, key)) {
5897
- obj[key] = utils.combine(obj[key], val);
5898
- } else {
5899
- obj[key] = val;
5900
- }
5901
- }
5902
-
5903
- return obj;
3526
+ var unBindHotKey = function unBindHotKey(mode, hotkey) {
3527
+ return mode === MODES$1.global ? Mousetrap$1.unbindGlobal(hotkey) : Mousetrap$1.unbind(hotkey);
5904
3528
  };
5905
3529
 
5906
- var parseObject = function (chain, val, options, valuesParsed) {
5907
- var leaf = valuesParsed ? val : parseArrayValue(val, options);
5908
-
5909
- for (var i = chain.length - 1; i >= 0; --i) {
5910
- var obj;
5911
- var root = chain[i];
5912
-
5913
- if (root === '[]' && options.parseArrays) {
5914
- obj = [].concat(leaf);
5915
- } else {
5916
- obj = options.plainObjects ? Object.create(null) : {};
5917
- var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
5918
- var index = parseInt(cleanRoot, 10);
5919
- if (!options.parseArrays && cleanRoot === '') {
5920
- obj = { 0: leaf };
5921
- } else if (
5922
- !isNaN(index)
5923
- && root !== cleanRoot
5924
- && String(index) === cleanRoot
5925
- && index >= 0
5926
- && (options.parseArrays && index <= options.arrayLimit)
5927
- ) {
5928
- obj = [];
5929
- obj[index] = leaf;
5930
- } else if (cleanRoot !== '__proto__') {
5931
- obj[cleanRoot] = leaf;
5932
- }
5933
- }
5934
-
5935
- leaf = obj;
5936
- }
3530
+ var useForceUpdate = function useForceUpdate() {
3531
+ // eslint-disable-next-line react/hook-use-state
3532
+ var _useState = useState(0),
3533
+ _useState2 = _slicedToArray(_useState, 2),
3534
+ setValue = _useState2[1];
3535
+ return function () {
3536
+ return setValue(function (value) {
3537
+ return value + 1;
3538
+ });
3539
+ };
3540
+ };
5937
3541
 
5938
- return leaf;
3542
+ var useIsElementVisibleInDom = function useIsElementVisibleInDom(target) {
3543
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
3544
+ var _useState = useState(false),
3545
+ _useState2 = _slicedToArray(_useState, 2),
3546
+ isIntersecting = _useState2[0],
3547
+ setIsIntersecting = _useState2[1];
3548
+ var forceUpdate = useForceUpdate();
3549
+ useEffect(function () {
3550
+ if (!target) return forceUpdate();
3551
+ var observer = new IntersectionObserver(function (_ref) {
3552
+ var _ref2 = _slicedToArray(_ref, 1),
3553
+ entry = _ref2[0];
3554
+ return setIsIntersecting(entry.isIntersecting);
3555
+ }, options);
3556
+ observer.observe(target);
3557
+ return function () {
3558
+ return observer.unobserve(target);
3559
+ };
3560
+ }, [target, options]);
3561
+ return isIntersecting;
5939
3562
  };
5940
3563
 
5941
- var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
5942
- if (!givenKey) {
5943
- return;
3564
+ function shallow(objA, objB) {
3565
+ if (Object.is(objA, objB)) {
3566
+ return true;
3567
+ }
3568
+ if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) {
3569
+ return false;
3570
+ }
3571
+ if (objA instanceof Map && objB instanceof Map) {
3572
+ if (objA.size !== objB.size)
3573
+ return false;
3574
+ for (const [key, value] of objA) {
3575
+ if (!Object.is(value, objB.get(key))) {
3576
+ return false;
3577
+ }
5944
3578
  }
5945
-
5946
- // Transform dot notation to bracket notation
5947
- var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
5948
-
5949
- // The regex chunks
5950
-
5951
- var brackets = /(\[[^[\]]*])/;
5952
- var child = /(\[[^[\]]*])/g;
5953
-
5954
- // Get the parent
5955
-
5956
- var segment = options.depth > 0 && brackets.exec(key);
5957
- var parent = segment ? key.slice(0, segment.index) : key;
5958
-
5959
- // Stash the parent if it exists
5960
-
5961
- var keys = [];
5962
- if (parent) {
5963
- // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
5964
- if (!options.plainObjects && has.call(Object.prototype, parent)) {
5965
- if (!options.allowPrototypes) {
5966
- return;
5967
- }
5968
- }
5969
-
5970
- keys.push(parent);
3579
+ return true;
3580
+ }
3581
+ if (objA instanceof Set && objB instanceof Set) {
3582
+ if (objA.size !== objB.size)
3583
+ return false;
3584
+ for (const value of objA) {
3585
+ if (!objB.has(value)) {
3586
+ return false;
3587
+ }
5971
3588
  }
5972
-
5973
- // Loop through children appending to the array until we hit depth
5974
-
5975
- var i = 0;
5976
- while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
5977
- i += 1;
5978
- if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
5979
- if (!options.allowPrototypes) {
5980
- return;
5981
- }
5982
- }
5983
- keys.push(segment[1]);
3589
+ return true;
3590
+ }
3591
+ const keysA = Object.keys(objA);
3592
+ if (keysA.length !== Object.keys(objB).length) {
3593
+ return false;
3594
+ }
3595
+ for (let i = 0; i < keysA.length; i++) {
3596
+ if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) {
3597
+ return false;
5984
3598
  }
3599
+ }
3600
+ return true;
3601
+ }
5985
3602
 
5986
- // If there's a remainder, just add whatever is left
5987
-
5988
- if (segment) {
5989
- keys.push('[' + key.slice(segment.index) + ']');
3603
+ var useKeyboardShortcutsStore = create$9(function (set) {
3604
+ return {
3605
+ isOpen: false,
3606
+ setIsOpen: function setIsOpen(arg) {
3607
+ if (typeof arg === "function") {
3608
+ set(function (state) {
3609
+ return {
3610
+ isOpen: arg(state.isOpen)
3611
+ };
3612
+ });
3613
+ } else {
3614
+ set({
3615
+ isOpen: arg
3616
+ });
3617
+ }
5990
3618
  }
5991
-
5992
- return parseObject(keys, val, options, valuesParsed);
3619
+ };
3620
+ });
3621
+ var useKeyboardShortcutsPaneState = function useKeyboardShortcutsPaneState() {
3622
+ return useKeyboardShortcutsStore(function (_ref) {
3623
+ var isOpen = _ref.isOpen,
3624
+ setIsOpen = _ref.setIsOpen;
3625
+ return [isOpen, setIsOpen];
3626
+ }, shallow);
5993
3627
  };
5994
3628
 
5995
- var normalizeParseOptions = function normalizeParseOptions(opts) {
5996
- if (!opts) {
5997
- return defaults$1;
5998
- }
5999
-
6000
- if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
6001
- throw new TypeError('Decoder has to be a function.');
6002
- }
6003
-
6004
- if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
6005
- throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
6006
- }
6007
- var charset = typeof opts.charset === 'undefined' ? defaults$1.charset : opts.charset;
6008
-
6009
- return {
6010
- allowDots: typeof opts.allowDots === 'undefined' ? defaults$1.allowDots : !!opts.allowDots,
6011
- allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults$1.allowPrototypes,
6012
- allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults$1.allowSparse,
6013
- arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults$1.arrayLimit,
6014
- charset: charset,
6015
- charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults$1.charsetSentinel,
6016
- comma: typeof opts.comma === 'boolean' ? opts.comma : defaults$1.comma,
6017
- decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults$1.decoder,
6018
- delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults$1.delimiter,
6019
- // eslint-disable-next-line no-implicit-coercion, no-extra-parens
6020
- depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults$1.depth,
6021
- ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
6022
- interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults$1.interpretNumericEntities,
6023
- parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults$1.parameterLimit,
6024
- parseArrays: opts.parseArrays !== false,
6025
- plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults$1.plainObjects,
6026
- strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults$1.strictNullHandling
3629
+ var useOnClickOutside = function useOnClickOutside(ref, handler) {
3630
+ useEffect(function () {
3631
+ var listener = function listener(event) {
3632
+ // Do nothing if clicking ref's element or descendent elements
3633
+ if (!ref.current || ref.current.contains(event.target)) {
3634
+ return;
3635
+ }
3636
+ handler(event);
3637
+ };
3638
+ document.addEventListener("mousedown", listener);
3639
+ document.addEventListener("touchstart", listener);
3640
+ return function () {
3641
+ document.removeEventListener("mousedown", listener);
3642
+ document.removeEventListener("touchstart", listener);
6027
3643
  };
3644
+ }, [handler]);
6028
3645
  };
6029
3646
 
6030
- var parse$5 = function (str, opts) {
6031
- var options = normalizeParseOptions(opts);
6032
-
6033
- if (str === '' || str === null || typeof str === 'undefined') {
6034
- return options.plainObjects ? Object.create(null) : {};
6035
- }
6036
-
6037
- var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
6038
- var obj = options.plainObjects ? Object.create(null) : {};
6039
-
6040
- // Iterate over the keys and setup the new object
6041
-
6042
- var keys = Object.keys(tempObj);
6043
- for (var i = 0; i < keys.length; ++i) {
6044
- var key = keys[i];
6045
- var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
6046
- obj = utils.merge(obj, newObj, options);
6047
- }
3647
+ var usePrevious = function usePrevious(value) {
3648
+ var ref = useRef(value);
3649
+ useEffect(function () {
3650
+ ref.current = value;
3651
+ }, [value]);
3652
+ return ref.current;
3653
+ };
6048
3654
 
6049
- if (options.allowSparse === true) {
6050
- return obj;
3655
+ var useUpdateEffect = function useUpdateEffect(callback) {
3656
+ var dependencies = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
3657
+ var isInitialMount = useRef(true);
3658
+ useEffect(function () {
3659
+ if (isInitialMount.current) {
3660
+ isInitialMount.current = false;
3661
+ return;
6051
3662
  }
6052
-
6053
- return utils.compact(obj);
3663
+ callback();
3664
+ }, dependencies);
6054
3665
  };
6055
3666
 
6056
- var stringify$3 = stringify_1;
6057
- var parse$4 = parse$5;
6058
- var formats = formats$3;
6059
-
6060
- var lib = {
6061
- formats: formats,
6062
- parse: parse$4,
6063
- stringify: stringify$3
3667
+ var DEFAULT_STALE_TIME = 60 * 60 * 1000;
3668
+ var DOMAIN_QUERY_KEY = "custom-domain";
3669
+ var ENTITY_COUNT = {
3670
+ singular: 1,
3671
+ plural: 2
6064
3672
  };
6065
3673
 
6066
- var copyToClipboard = /*#__PURE__*/function () {
6067
- var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(text) {
6068
- var _ref2,
6069
- _ref2$showToastr,
6070
- showToastr,
6071
- _ref2$message,
6072
- message,
6073
- textArea,
6074
- _args = arguments;
6075
- return regenerator.wrap(function _callee$(_context) {
6076
- while (1) switch (_context.prev = _context.next) {
6077
- case 0:
6078
- _ref2 = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}, _ref2$showToastr = _ref2.showToastr, showToastr = _ref2$showToastr === void 0 ? true : _ref2$showToastr, _ref2$message = _ref2.message, message = _ref2$message === void 0 ? i18next.t("neetoCommons.toastr.success.copiedToClipboard") : _ref2$message;
6079
- _context.prev = 1;
6080
- if (!(navigator.clipboard && window.isSecureContext)) {
6081
- _context.next = 7;
6082
- break;
6083
- }
6084
- _context.next = 5;
6085
- return navigator.clipboard.writeText(text);
6086
- case 5:
6087
- _context.next = 17;
6088
- break;
6089
- case 7:
6090
- textArea = document.createElement("textarea");
6091
- textArea.value = text;
6092
- textArea.style.top = "0";
6093
- textArea.style.left = "0";
6094
- textArea.style.position = "fixed";
6095
- document.body.appendChild(textArea);
6096
- textArea.focus();
6097
- textArea.select();
6098
- document.execCommand("copy");
6099
- document.body.removeChild(textArea);
6100
- case 17:
6101
- showToastr && Toastr.success(message);
6102
- _context.next = 23;
6103
- break;
6104
- case 20:
6105
- _context.prev = 20;
6106
- _context.t0 = _context["catch"](1);
6107
- Toastr.error(_context.t0);
6108
- case 23:
6109
- case "end":
6110
- return _context.stop();
6111
- }
6112
- }, _callee, null, [[1, 20]]);
6113
- }));
6114
- return function copyToClipboard(_x) {
6115
- return _ref.apply(this, arguments);
6116
- };
6117
- }();
6118
- var buildUrl = function buildUrl(route, params) {
6119
- var placeHolders = [];
6120
- toPairs(params).forEach(function (_ref3) {
6121
- var _ref4 = _slicedToArray(_ref3, 2),
6122
- key = _ref4[0],
6123
- value = _ref4[1];
6124
- if (route.includes(":".concat(key))) {
6125
- placeHolders.push(key);
6126
- route = route.replace(":".concat(key), encodeURIComponent(value));
6127
- }
6128
- });
6129
- var queryParams = pipe(omit(placeHolders), preprocessForSerialization, lib.stringify)(params);
6130
- return isEmpty(queryParams) ? route : "".concat(route, "?").concat(queryParams);
6131
- };
6132
- var joinHyphenCase = function joinHyphenCase() {
6133
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
6134
- args[_key] = arguments[_key];
6135
- }
6136
- return args.join(" ").replace(/\s+/g, "-").toLowerCase();
3674
+ var HOSTNAME_REGEX = /^(?!-)[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+/;
3675
+ var INITIAL_VALUES$1 = {
3676
+ hostname: ""
6137
3677
  };
3678
+ var CUSTOM_DOMAIN_VALIDATION_SCHEMA = yup.object().shape({
3679
+ hostname: yup.string().required(t$1("neetoCommons.customDomain.formikValidation.required")).matches(HOSTNAME_REGEX, t$1("neetoCommons.customDomain.formikValidation.valid"))
3680
+ });
6138
3681
 
6139
3682
  var classnames$1 = {exports: {}};
6140
3683
 
@@ -6351,37 +3894,6 @@ var Record = function Record(_ref) {
6351
3894
  }));
6352
3895
  };
6353
3896
 
6354
- dayjs.extend(relativeTime);
6355
- dayjs.extend(updateLocale);
6356
- var timeFormat = {
6357
- fromNow: function fromNow(time) {
6358
- return dayjs(time).fromNow();
6359
- },
6360
- time: function time(_time) {
6361
- return dayjs(_time).format("h:mm A");
6362
- },
6363
- date: function date(time) {
6364
- return dayjs(time).format("MMM D, YYYY");
6365
- },
6366
- dateWeek: function dateWeek(time) {
6367
- return dayjs(time).format("MMM D, YYYY ddd");
6368
- },
6369
- dateWeekWithoutYear: function dateWeekWithoutYear(time) {
6370
- return dayjs(time).format("MMM D, ddd");
6371
- },
6372
- dateTime: function dateTime(time) {
6373
- return dayjs(time).format("MMM D, YYYY h:mm A");
6374
- },
6375
- dateWeekTime: function dateWeekTime(time) {
6376
- return dayjs(time).format("MMM D, YYYY ddd h:mm A");
6377
- },
6378
- extended: function extended(time) {
6379
- var dateTime = dayjs(time).format("dddd MMMM D, YYYY h:mm A");
6380
- var fromNow = dayjs(time).fromNow();
6381
- return "".concat(dateTime, " (").concat(fromNow, ")");
6382
- }
6383
- };
6384
-
6385
3897
  var CustomDomainInfo = function CustomDomainInfo(_ref) {
6386
3898
  var time = _ref.time;
6387
3899
  var _useTranslation = useTranslation(),
@@ -6400,7 +3912,7 @@ var CustomDomainInfo = function CustomDomainInfo(_ref) {
6400
3912
  icon: Info$3,
6401
3913
  style: "info"
6402
3914
  }, t("neetoCommons.customDomain.messageBlock.cnameAddedTime", {
6403
- time: timeFormat.fromNow(time)
3915
+ time: timeFormat$1.fromNow(time)
6404
3916
  })));
6405
3917
  };
6406
3918
 
@@ -6754,7 +4266,7 @@ var CustomDomain = function CustomDomain(_ref) {
6754
4266
  }));
6755
4267
  };
6756
4268
 
6757
- var DateFormat = fromPairs(keys(timeFormat).map(function (key) {
4269
+ var DateFormat = fromPairs(keys(timeFormat$1).map(function (key) {
6758
4270
  return [capitalize(key), function (_ref) {
6759
4271
  var date = _ref.date,
6760
4272
  _ref$tooltipProps = _ref.tooltipProps,
@@ -6764,9 +4276,9 @@ var DateFormat = fromPairs(keys(timeFormat).map(function (key) {
6764
4276
  var dateDisplay = /*#__PURE__*/React__default.createElement(Typography, _extends$4({
6765
4277
  component: "span",
6766
4278
  style: "body2"
6767
- }, typographyProps), timeFormat[key](date));
4279
+ }, typographyProps), timeFormat$1[key](date));
6768
4280
  return key === "extended" ? dateDisplay : /*#__PURE__*/React__default.createElement(Tooltip, _extends$4({
6769
- content: timeFormat.extended(date),
4281
+ content: timeFormat$1.extended(date),
6770
4282
  position: "top"
6771
4283
  }, tooltipProps), dateDisplay);
6772
4284
  }];
@@ -10458,16 +7970,16 @@ var HotKeyList = function HotKeyList(_ref) {
10458
7970
  var KeyboardShortcutsPane = function KeyboardShortcutsPane(_ref) {
10459
7971
  var _ref$productShortcuts = _ref.productShortcuts,
10460
7972
  productShortcuts = _ref$productShortcuts === void 0 ? {} : _ref$productShortcuts;
10461
- var _useState = useState(false),
10462
- _useState2 = _slicedToArray(_useState, 2),
10463
- isOpen = _useState2[0],
10464
- setIsOpen = _useState2[1];
7973
+ var _useKeyboardShortcuts = useKeyboardShortcutsPaneState(),
7974
+ _useKeyboardShortcuts2 = _slicedToArray(_useKeyboardShortcuts, 2),
7975
+ isOpen = _useKeyboardShortcuts2[0],
7976
+ setIsOpen = _useKeyboardShortcuts2[1];
10465
7977
  var hasOverlays = manager.hasOverlays();
10466
7978
  var GLOBAL_SHORTCUTS = getGlobalShortcuts();
10467
7979
  var shortcuts = GLOBAL_SHORTCUTS[i18next.t("neetoCommons.keyboardShortcuts.global.categoryName")];
10468
7980
  useHotKeys(shortcuts.openKeyboardShortcutsPane.sequence, function () {
10469
- return setIsOpen(function (prevState) {
10470
- return !prevState;
7981
+ return setIsOpen(function (prevIsOpen) {
7982
+ return !prevIsOpen;
10471
7983
  });
10472
7984
  }, {
10473
7985
  mode: "global"
@@ -10479,7 +7991,7 @@ var KeyboardShortcutsPane = function KeyboardShortcutsPane(_ref) {
10479
7991
  });
10480
7992
  return /*#__PURE__*/React__default.createElement("div", {
10481
7993
  className: classnames("neeto-commons-keyboard-shortcuts-pane neeto-ui-border-gray-300 transition-width ml-auto min-h-screen border-l bg-white duration-300 ease-in-out overflow-y-scroll", {
10482
- "w-96": isOpen,
7994
+ "w-80": isOpen,
10483
7995
  "w-0": !isOpen,
10484
7996
  absolute: hasOverlays,
10485
7997
  "right-0": hasOverlays
@@ -11592,7 +9104,7 @@ class TokenTreeEmitter extends TokenTree {
11592
9104
  * @param {string} value
11593
9105
  * @returns {RegExp}
11594
9106
  * */
11595
- function escape$1(value) {
9107
+ function escape(value) {
11596
9108
  return new RegExp(value.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&'), 'm');
11597
9109
  }
11598
9110
 
@@ -12753,7 +10265,7 @@ Syntax highlighting with language autodetection.
12753
10265
  https://highlightjs.org/
12754
10266
  */
12755
10267
 
12756
- const escape$1$1 = escapeHTML;
10268
+ const escape$1 = escapeHTML;
12757
10269
  const inherit$1 = inherit;
12758
10270
  const NO_MATCH = Symbol("nomatch");
12759
10271
 
@@ -13063,7 +10575,7 @@ const HLJS = function(hljs) {
13063
10575
  }
13064
10576
 
13065
10577
  if (newMode && newMode.endSameAsBegin) {
13066
- newMode.endRe = escape$1(lexeme);
10578
+ newMode.endRe = escape(lexeme);
13067
10579
  }
13068
10580
 
13069
10581
  if (newMode.skip) {
@@ -13292,14 +10804,14 @@ const HLJS = function(hljs) {
13292
10804
  },
13293
10805
  sofar: result,
13294
10806
  relevance: 0,
13295
- value: escape$1$1(codeToHighlight),
10807
+ value: escape$1(codeToHighlight),
13296
10808
  emitter: emitter
13297
10809
  };
13298
10810
  } else if (SAFE_MODE) {
13299
10811
  return {
13300
10812
  illegal: false,
13301
10813
  relevance: 0,
13302
- value: escape$1$1(codeToHighlight),
10814
+ value: escape$1(codeToHighlight),
13303
10815
  emitter: emitter,
13304
10816
  language: languageName,
13305
10817
  top: top,
@@ -13322,7 +10834,7 @@ const HLJS = function(hljs) {
13322
10834
  const result = {
13323
10835
  relevance: 0,
13324
10836
  emitter: new options.__emitter(options),
13325
- value: escape$1$1(code),
10837
+ value: escape$1(code),
13326
10838
  illegal: false,
13327
10839
  top: PLAINTEXT_LANGUAGE
13328
10840
  };
@@ -59022,6 +56534,37 @@ var supportedLanguages$1 = ['1c', 'abnf', 'accesslog', 'actionscript', 'ada', 'a
59022
56534
  var highlighter$1 = highlight$3(lowlight, defaultStyle$1);
59023
56535
  highlighter$1.supportedLanguages = supportedLanguages$1;
59024
56536
 
56537
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
56538
+ try {
56539
+ var info = gen[key](arg);
56540
+ var value = info.value;
56541
+ } catch (error) {
56542
+ reject(error);
56543
+ return;
56544
+ }
56545
+ if (info.done) {
56546
+ resolve(value);
56547
+ } else {
56548
+ Promise.resolve(value).then(_next, _throw);
56549
+ }
56550
+ }
56551
+ function _asyncToGenerator(fn) {
56552
+ return function () {
56553
+ var self = this,
56554
+ args = arguments;
56555
+ return new Promise(function (resolve, reject) {
56556
+ var gen = fn.apply(self, args);
56557
+ function _next(value) {
56558
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
56559
+ }
56560
+ function _throw(err) {
56561
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
56562
+ }
56563
+ _next(undefined);
56564
+ });
56565
+ };
56566
+ }
56567
+
59025
56568
  function _classCallCheck(instance, Constructor) {
59026
56569
  if (!(instance instanceof Constructor)) {
59027
56570
  throw new TypeError("Cannot call a class as a function");
@@ -59094,6 +56637,345 @@ function _getPrototypeOf(o) {
59094
56637
  return _getPrototypeOf(o);
59095
56638
  }
59096
56639
 
56640
+ var regeneratorRuntime$1 = {exports: {}};
56641
+
56642
+ var _typeof = {exports: {}};
56643
+
56644
+ (function (module) {
56645
+ function _typeof(obj) {
56646
+ "@babel/helpers - typeof";
56647
+
56648
+ return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
56649
+ return typeof obj;
56650
+ } : function (obj) {
56651
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
56652
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
56653
+ }
56654
+ module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
56655
+ } (_typeof));
56656
+
56657
+ (function (module) {
56658
+ var _typeof$1 = _typeof.exports["default"];
56659
+ function _regeneratorRuntime() {
56660
+ module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
56661
+ return exports;
56662
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports;
56663
+ var exports = {},
56664
+ Op = Object.prototype,
56665
+ hasOwn = Op.hasOwnProperty,
56666
+ defineProperty = Object.defineProperty || function (obj, key, desc) {
56667
+ obj[key] = desc.value;
56668
+ },
56669
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
56670
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
56671
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
56672
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
56673
+ function define(obj, key, value) {
56674
+ return Object.defineProperty(obj, key, {
56675
+ value: value,
56676
+ enumerable: !0,
56677
+ configurable: !0,
56678
+ writable: !0
56679
+ }), obj[key];
56680
+ }
56681
+ try {
56682
+ define({}, "");
56683
+ } catch (err) {
56684
+ define = function define(obj, key, value) {
56685
+ return obj[key] = value;
56686
+ };
56687
+ }
56688
+ function wrap(innerFn, outerFn, self, tryLocsList) {
56689
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
56690
+ generator = Object.create(protoGenerator.prototype),
56691
+ context = new Context(tryLocsList || []);
56692
+ return defineProperty(generator, "_invoke", {
56693
+ value: makeInvokeMethod(innerFn, self, context)
56694
+ }), generator;
56695
+ }
56696
+ function tryCatch(fn, obj, arg) {
56697
+ try {
56698
+ return {
56699
+ type: "normal",
56700
+ arg: fn.call(obj, arg)
56701
+ };
56702
+ } catch (err) {
56703
+ return {
56704
+ type: "throw",
56705
+ arg: err
56706
+ };
56707
+ }
56708
+ }
56709
+ exports.wrap = wrap;
56710
+ var ContinueSentinel = {};
56711
+ function Generator() {}
56712
+ function GeneratorFunction() {}
56713
+ function GeneratorFunctionPrototype() {}
56714
+ var IteratorPrototype = {};
56715
+ define(IteratorPrototype, iteratorSymbol, function () {
56716
+ return this;
56717
+ });
56718
+ var getProto = Object.getPrototypeOf,
56719
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
56720
+ NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
56721
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
56722
+ function defineIteratorMethods(prototype) {
56723
+ ["next", "throw", "return"].forEach(function (method) {
56724
+ define(prototype, method, function (arg) {
56725
+ return this._invoke(method, arg);
56726
+ });
56727
+ });
56728
+ }
56729
+ function AsyncIterator(generator, PromiseImpl) {
56730
+ function invoke(method, arg, resolve, reject) {
56731
+ var record = tryCatch(generator[method], generator, arg);
56732
+ if ("throw" !== record.type) {
56733
+ var result = record.arg,
56734
+ value = result.value;
56735
+ return value && "object" == _typeof$1(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
56736
+ invoke("next", value, resolve, reject);
56737
+ }, function (err) {
56738
+ invoke("throw", err, resolve, reject);
56739
+ }) : PromiseImpl.resolve(value).then(function (unwrapped) {
56740
+ result.value = unwrapped, resolve(result);
56741
+ }, function (error) {
56742
+ return invoke("throw", error, resolve, reject);
56743
+ });
56744
+ }
56745
+ reject(record.arg);
56746
+ }
56747
+ var previousPromise;
56748
+ defineProperty(this, "_invoke", {
56749
+ value: function value(method, arg) {
56750
+ function callInvokeWithMethodAndArg() {
56751
+ return new PromiseImpl(function (resolve, reject) {
56752
+ invoke(method, arg, resolve, reject);
56753
+ });
56754
+ }
56755
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
56756
+ }
56757
+ });
56758
+ }
56759
+ function makeInvokeMethod(innerFn, self, context) {
56760
+ var state = "suspendedStart";
56761
+ return function (method, arg) {
56762
+ if ("executing" === state) throw new Error("Generator is already running");
56763
+ if ("completed" === state) {
56764
+ if ("throw" === method) throw arg;
56765
+ return doneResult();
56766
+ }
56767
+ for (context.method = method, context.arg = arg;;) {
56768
+ var delegate = context.delegate;
56769
+ if (delegate) {
56770
+ var delegateResult = maybeInvokeDelegate(delegate, context);
56771
+ if (delegateResult) {
56772
+ if (delegateResult === ContinueSentinel) continue;
56773
+ return delegateResult;
56774
+ }
56775
+ }
56776
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
56777
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
56778
+ context.dispatchException(context.arg);
56779
+ } else "return" === context.method && context.abrupt("return", context.arg);
56780
+ state = "executing";
56781
+ var record = tryCatch(innerFn, self, context);
56782
+ if ("normal" === record.type) {
56783
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
56784
+ return {
56785
+ value: record.arg,
56786
+ done: context.done
56787
+ };
56788
+ }
56789
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
56790
+ }
56791
+ };
56792
+ }
56793
+ function maybeInvokeDelegate(delegate, context) {
56794
+ var methodName = context.method,
56795
+ method = delegate.iterator[methodName];
56796
+ if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
56797
+ var record = tryCatch(method, delegate.iterator, context.arg);
56798
+ if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
56799
+ var info = record.arg;
56800
+ return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
56801
+ }
56802
+ function pushTryEntry(locs) {
56803
+ var entry = {
56804
+ tryLoc: locs[0]
56805
+ };
56806
+ 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
56807
+ }
56808
+ function resetTryEntry(entry) {
56809
+ var record = entry.completion || {};
56810
+ record.type = "normal", delete record.arg, entry.completion = record;
56811
+ }
56812
+ function Context(tryLocsList) {
56813
+ this.tryEntries = [{
56814
+ tryLoc: "root"
56815
+ }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
56816
+ }
56817
+ function values(iterable) {
56818
+ if (iterable) {
56819
+ var iteratorMethod = iterable[iteratorSymbol];
56820
+ if (iteratorMethod) return iteratorMethod.call(iterable);
56821
+ if ("function" == typeof iterable.next) return iterable;
56822
+ if (!isNaN(iterable.length)) {
56823
+ var i = -1,
56824
+ next = function next() {
56825
+ for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
56826
+ return next.value = undefined, next.done = !0, next;
56827
+ };
56828
+ return next.next = next;
56829
+ }
56830
+ }
56831
+ return {
56832
+ next: doneResult
56833
+ };
56834
+ }
56835
+ function doneResult() {
56836
+ return {
56837
+ value: undefined,
56838
+ done: !0
56839
+ };
56840
+ }
56841
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
56842
+ value: GeneratorFunctionPrototype,
56843
+ configurable: !0
56844
+ }), defineProperty(GeneratorFunctionPrototype, "constructor", {
56845
+ value: GeneratorFunction,
56846
+ configurable: !0
56847
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
56848
+ var ctor = "function" == typeof genFun && genFun.constructor;
56849
+ return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
56850
+ }, exports.mark = function (genFun) {
56851
+ return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
56852
+ }, exports.awrap = function (arg) {
56853
+ return {
56854
+ __await: arg
56855
+ };
56856
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
56857
+ return this;
56858
+ }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
56859
+ void 0 === PromiseImpl && (PromiseImpl = Promise);
56860
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
56861
+ return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
56862
+ return result.done ? result.value : iter.next();
56863
+ });
56864
+ }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
56865
+ return this;
56866
+ }), define(Gp, "toString", function () {
56867
+ return "[object Generator]";
56868
+ }), exports.keys = function (val) {
56869
+ var object = Object(val),
56870
+ keys = [];
56871
+ for (var key in object) keys.push(key);
56872
+ return keys.reverse(), function next() {
56873
+ for (; keys.length;) {
56874
+ var key = keys.pop();
56875
+ if (key in object) return next.value = key, next.done = !1, next;
56876
+ }
56877
+ return next.done = !0, next;
56878
+ };
56879
+ }, exports.values = values, Context.prototype = {
56880
+ constructor: Context,
56881
+ reset: function reset(skipTempReset) {
56882
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
56883
+ },
56884
+ stop: function stop() {
56885
+ this.done = !0;
56886
+ var rootRecord = this.tryEntries[0].completion;
56887
+ if ("throw" === rootRecord.type) throw rootRecord.arg;
56888
+ return this.rval;
56889
+ },
56890
+ dispatchException: function dispatchException(exception) {
56891
+ if (this.done) throw exception;
56892
+ var context = this;
56893
+ function handle(loc, caught) {
56894
+ return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
56895
+ }
56896
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
56897
+ var entry = this.tryEntries[i],
56898
+ record = entry.completion;
56899
+ if ("root" === entry.tryLoc) return handle("end");
56900
+ if (entry.tryLoc <= this.prev) {
56901
+ var hasCatch = hasOwn.call(entry, "catchLoc"),
56902
+ hasFinally = hasOwn.call(entry, "finallyLoc");
56903
+ if (hasCatch && hasFinally) {
56904
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
56905
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
56906
+ } else if (hasCatch) {
56907
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
56908
+ } else {
56909
+ if (!hasFinally) throw new Error("try statement without catch or finally");
56910
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
56911
+ }
56912
+ }
56913
+ }
56914
+ },
56915
+ abrupt: function abrupt(type, arg) {
56916
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
56917
+ var entry = this.tryEntries[i];
56918
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
56919
+ var finallyEntry = entry;
56920
+ break;
56921
+ }
56922
+ }
56923
+ finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
56924
+ var record = finallyEntry ? finallyEntry.completion : {};
56925
+ return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
56926
+ },
56927
+ complete: function complete(record, afterLoc) {
56928
+ if ("throw" === record.type) throw record.arg;
56929
+ return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
56930
+ },
56931
+ finish: function finish(finallyLoc) {
56932
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
56933
+ var entry = this.tryEntries[i];
56934
+ if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
56935
+ }
56936
+ },
56937
+ "catch": function _catch(tryLoc) {
56938
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
56939
+ var entry = this.tryEntries[i];
56940
+ if (entry.tryLoc === tryLoc) {
56941
+ var record = entry.completion;
56942
+ if ("throw" === record.type) {
56943
+ var thrown = record.arg;
56944
+ resetTryEntry(entry);
56945
+ }
56946
+ return thrown;
56947
+ }
56948
+ }
56949
+ throw new Error("illegal catch attempt");
56950
+ },
56951
+ delegateYield: function delegateYield(iterable, resultName, nextLoc) {
56952
+ return this.delegate = {
56953
+ iterator: values(iterable),
56954
+ resultName: resultName,
56955
+ nextLoc: nextLoc
56956
+ }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
56957
+ }
56958
+ }, exports;
56959
+ }
56960
+ module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
56961
+ } (regeneratorRuntime$1));
56962
+
56963
+ // TODO(Babel 8): Remove this file.
56964
+
56965
+ var runtime = regeneratorRuntime$1.exports();
56966
+ var regenerator = runtime;
56967
+
56968
+ // Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
56969
+ try {
56970
+ regeneratorRuntime = runtime;
56971
+ } catch (accidentalStrictMode) {
56972
+ if (typeof globalThis === "object") {
56973
+ globalThis.regeneratorRuntime = runtime;
56974
+ } else {
56975
+ Function("r", "regeneratorRuntime = r")(runtime);
56976
+ }
56977
+ }
56978
+
59097
56979
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
59098
56980
 
59099
56981
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
@@ -93711,6 +91593,37 @@ var PublishBlock = function PublishBlock(_ref) {
93711
91593
  };
93712
91594
  PublishBlock.Alert = AlertBlock;
93713
91595
 
91596
+ dayjs.extend(relativeTime);
91597
+ dayjs.extend(updateLocale);
91598
+ var timeFormat = {
91599
+ fromNow: function fromNow(time) {
91600
+ return dayjs(time).fromNow();
91601
+ },
91602
+ time: function time(_time) {
91603
+ return dayjs(_time).format("h:mm A");
91604
+ },
91605
+ date: function date(time) {
91606
+ return dayjs(time).format("MMM D, YYYY");
91607
+ },
91608
+ dateWeek: function dateWeek(time) {
91609
+ return dayjs(time).format("MMM D, YYYY ddd");
91610
+ },
91611
+ dateWeekWithoutYear: function dateWeekWithoutYear(time) {
91612
+ return dayjs(time).format("MMM D, ddd");
91613
+ },
91614
+ dateTime: function dateTime(time) {
91615
+ return dayjs(time).format("MMM D, YYYY h:mm A");
91616
+ },
91617
+ dateWeekTime: function dateWeekTime(time) {
91618
+ return dayjs(time).format("MMM D, YYYY ddd h:mm A");
91619
+ },
91620
+ extended: function extended(time) {
91621
+ var dateTime = dayjs(time).format("dddd MMMM D, YYYY h:mm A");
91622
+ var fromNow = dayjs(time).fromNow();
91623
+ return "".concat(dateTime, " (").concat(fromNow, ")");
91624
+ }
91625
+ };
91626
+
93714
91627
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
93715
91628
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
93716
91629
  var REMOVE_SELECT_DOWN_ARROW = {
@@ -93729,6 +91642,7 @@ var BLUR_TEXT_WHEN_SELECT_MENU_IS_OPEN = {
93729
91642
  }
93730
91643
  };
93731
91644
  var SLOT_TIME_FORMAT = "hh:mm A";
91645
+ var END_OF_DAY = "11:59 PM";
93732
91646
 
93733
91647
  var INTERVALS = ["year", "quarter", "month", "week", "day", "hour", "minute", "second"];
93734
91648
 
@@ -94012,6 +91926,7 @@ var buildSlotIntervals = function buildSlotIntervals(_ref) {
94012
91926
  value: selectedValue
94013
91927
  };
94014
91928
  var allIntervalsForADay = dayjsExtended.timeIntervalsForDay(interval);
91929
+ allIntervalsForADay.push(END_OF_DAY);
94015
91930
  var uniqBookedSlots = uniq(pluck(slotType, bookedSlots));
94016
91931
  var slotsAvailableForBooking = difference(allIntervalsForADay, uniqBookedSlots);
94017
91932
  var slots = slotsAvailableForBooking.map(toLabelAndValue);
@@ -94195,7 +92110,7 @@ var Form = function Form(_ref) {
94195
92110
  setFieldValue("wdays[".concat(index, "].available"), true);
94196
92111
  if ((_deletedPeriods$ = deletedPeriods[0]) !== null && _deletedPeriods$ !== void 0 && _deletedPeriods$.startTime) {
94197
92112
  restoreDeletedPeriods(setFieldValue);
94198
- } else if (isNotPresent(values.wdays[index].periods)) {
92113
+ } else if (isNotPresent$1(values.wdays[index].periods)) {
94199
92114
  setFieldValue("wdays[".concat(index, "].periods"), [addDefaultPeriod(day)]);
94200
92115
  } else {
94201
92116
  setFieldValue("wdays[".concat(index, "].periods"), [""]);
@@ -94275,7 +92190,7 @@ var Form = function Form(_ref) {
94275
92190
  }
94276
92191
  })));
94277
92192
  }), /*#__PURE__*/React__default.createElement("li", null, /*#__PURE__*/React__default.createElement(Button, {
94278
- disabled: isNotPresent(wdaysToCopy),
92193
+ disabled: isNotPresent$1(wdaysToCopy),
94279
92194
  label: "Submit",
94280
92195
  size: "small",
94281
92196
  onClick: function onClick() {
@@ -94526,6 +92441,7 @@ var Link = function Link(_ref) {
94526
92441
  entityName = _ref.entityName,
94527
92442
  handleRegenerate = _ref.handleRegenerate,
94528
92443
  isRegenerating = _ref.isRegenerating,
92444
+ previewUrl = _ref.previewUrl,
94529
92445
  url = _ref.url;
94530
92446
  var _useState = useState(false),
94531
92447
  _useState2 = _slicedToArray(_useState, 2),
@@ -94564,7 +92480,7 @@ var Link = function Link(_ref) {
94564
92480
  }
94565
92481
  }), /*#__PURE__*/React__default.createElement(Button, {
94566
92482
  "data-testid": "preview-button",
94567
- href: url,
92483
+ href: previewUrl || url,
94568
92484
  icon: ExternalLink,
94569
92485
  style: "secondary",
94570
92486
  target: "_blank",
@@ -94593,20 +92509,6 @@ var Link = function Link(_ref) {
94593
92509
  }))));
94594
92510
  };
94595
92511
 
94596
- var HEADERS_KEYS = {
94597
- xAuthEmail: "X-Auth-Email",
94598
- xAuthToken: "X-Auth-Token",
94599
- xCsrfToken: "X-CSRF-TOKEN",
94600
- contentType: "Content-Type",
94601
- accept: "Accept"
94602
- };
94603
-
94604
- var resetAuthTokens = function resetAuthTokens() {
94605
- values(HEADERS_KEYS).forEach(function (header) {
94606
- delete axios$1.defaults.headers[header];
94607
- });
94608
- };
94609
-
94610
92512
  var facebookShareLink = function facebookShareLink(_ref) {
94611
92513
  var id = _ref.id;
94612
92514
  return buildUrl("https://www.facebook.com/sharer/sharer.php", {
@@ -95640,6 +93542,8 @@ var ShareViaLink = function ShareViaLink(_ref) {
95640
93542
  entityName = _ref.entityName,
95641
93543
  _ref$handleRegenerate = _ref.handleRegenerate,
95642
93544
  handleRegenerate = _ref$handleRegenerate === void 0 ? noop$2 : _ref$handleRegenerate,
93545
+ _ref$previewUrl = _ref.previewUrl,
93546
+ previewUrl = _ref$previewUrl === void 0 ? "" : _ref$previewUrl,
95643
93547
  socialMediaPostTitle = _ref.socialMediaPostTitle,
95644
93548
  url = _ref.url;
95645
93549
  return /*#__PURE__*/React__default.createElement("div", {
@@ -95650,6 +93554,7 @@ var ShareViaLink = function ShareViaLink(_ref) {
95650
93554
  entityName: entityName,
95651
93555
  handleRegenerate: handleRegenerate,
95652
93556
  isRegenerating: isRegenerating,
93557
+ previewUrl: previewUrl,
95653
93558
  url: url
95654
93559
  }), /*#__PURE__*/React__default.createElement(SocialMedia, {
95655
93560
  entity: entity,
@@ -95715,6 +93620,9 @@ var Sidebar = function Sidebar(_ref) {
95715
93620
  isAppSwitcherOpen = _useState2[0],
95716
93621
  setIsAppSwitcherOpen = _useState2[1];
95717
93622
  var location = useLocation();
93623
+ var _useKeyboardShortcuts = useKeyboardShortcutsPaneState(),
93624
+ _useKeyboardShortcuts2 = _slicedToArray(_useKeyboardShortcuts, 2),
93625
+ setIsOpen = _useKeyboardShortcuts2[1];
95718
93626
  useEffect(function () {
95719
93627
  isAppSwitcherOpen && setIsAppSwitcherOpen(false);
95720
93628
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -95738,6 +93646,13 @@ var Sidebar = function Sidebar(_ref) {
95738
93646
  label: i18next.t("neetoCommons.sidebar.livechat"),
95739
93647
  onClick: openChatWidget,
95740
93648
  "data-cy": "profile-livechat-button"
93649
+ }, {
93650
+ icon: Keyboard,
93651
+ label: i18next.t("neetoCommons.sidebar.keyboardShortcuts"),
93652
+ onClick: function onClick() {
93653
+ return setIsOpen(true);
93654
+ },
93655
+ "data-cy": "profile-keyboard-shortcuts-button"
95741
93656
  }, {
95742
93657
  icon: LeftArrow$1,
95743
93658
  label: i18next.t("neetoCommons.sidebar.logout"),
@@ -95748,7 +93663,7 @@ var Sidebar = function Sidebar(_ref) {
95748
93663
  icon: Help,
95749
93664
  label: i18next.t("neetoCommons.sidebar.help"),
95750
93665
  onClick: function onClick() {
95751
- return window.open("https://neeto".concat(toLower(appName), "help.neetokb.com/"), "_blank");
93666
+ return window.open("https://help.neeto".concat(toLower(appName), ".com/"), "_blank");
95752
93667
  }
95753
93668
  },
95754
93669
  changelogProps: {
@@ -95779,7 +93694,7 @@ var Sidebar = function Sidebar(_ref) {
95779
93694
 
95780
93695
  var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
95781
93696
 
95782
- var css$1 = ".neeto-commons-publish-block{align-items:center;display:flex;gap:12px;justify-content:flex-end}.neeto-commons-publish-block__action-btn{align-items:center;display:inline-flex;flex-direction:row;gap:1px;justify-content:center}.neeto-commons-publish-block__action-btn>.neeto-ui-btn:first-child{border-bottom-right-radius:0;border-top-right-radius:0}.neeto-commons-publish-block__action-btn>.neeto-ui-btn:last-child{border-bottom-left-radius:0;border-top-left-radius:0}.neeto-commons-keyboard-shortcuts-pane{z-index:calc(var(--neeto-ui-modal-z-index) + 1)}";
93697
+ var css$1 = ".neeto-commons-publish-block{align-items:center;display:flex;gap:12px;justify-content:flex-end}.neeto-commons-publish-block__action-btn{align-items:center;display:inline-flex;flex-direction:row;gap:1px;justify-content:center}.neeto-commons-publish-block__action-btn>.neeto-ui-btn:first-child{border-bottom-right-radius:0;border-top-right-radius:0}.neeto-commons-publish-block__action-btn>.neeto-ui-btn:last-child{border-bottom-left-radius:0;border-top-left-radius:0}.neeto-commons-keyboard-shortcuts-pane{flex-grow:0;flex-shrink:0;z-index:calc(var(--neeto-ui-modal-z-index) + 1)}";
95783
93698
  n(css$1,{});
95784
93699
 
95785
93700
  var NeetoWidget = {
@@ -99563,4 +97478,4 @@ var zig = /*#__PURE__*/_mergeNamespaces({
99563
97478
  'default': zigExports
99564
97479
  }, [zigExports]);
99565
97480
 
99566
- export { BrowserSupport, Columns, CustomDomain, DateFormat, ErrorPage, HoneybadgerErrorBoundary, IpRestriction, KeyboardShortcutsPane, SignIn as LoginPage, NeetoWidget, PrivateRoute, PublishBlock, Schedule, ShareViaLink, Sidebar, TimeFormat, destroyBrowserSubscription, handleMetaClick, isMetaKeyPressed, registerBrowserNotifications, useDebounce, useDisplayErrorPage, useErrorDisplayStore, useFuncDebounce, useHotKeys, useIsElementVisibleInDom, useLocalStorage, useOnClickOutside, usePrevious, useUpdateEffect, withImmutableActions, withTitle };
97481
+ export { BrowserSupport, Columns, CustomDomain, DateFormat, ErrorPage, HoneybadgerErrorBoundary, IpRestriction, KeyboardShortcutsPane, SignIn as LoginPage, NeetoWidget, PrivateRoute, PublishBlock, Schedule, ShareViaLink, Sidebar, TimeFormat, destroyBrowserSubscription, handleMetaClick, isMetaKeyPressed, registerBrowserNotifications, useDebounce, useDisplayErrorPage, useErrorDisplayStore, useFuncDebounce, useHotKeys, useIsElementVisibleInDom, useKeyboardShortcutsPaneState, useLocalStorage, useOnClickOutside, usePrevious, useUpdateEffect, withImmutableActions, withTitle };