= (message: string) => () => Promise.reject(message);\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","import useUpdatedRef from './useUpdatedRef';\nimport { useEffect } from 'react';\n\n/**\n * Attach a callback that fires when a component unmounts\n *\n * @param fn Handler to run when the component unmounts\n * @category effects\n */\nexport default function useWillUnmount(fn) {\n const onUnmount = useUpdatedRef(fn);\n useEffect(() => () => onUnmount.current(), []);\n}","import { useRef } from 'react';\n\n/**\n * Returns a ref that is immediately updated with the new value\n *\n * @param value The Ref value\n * @category refs\n */\nexport default function useUpdatedRef(value) {\n const valueRef = useRef(value);\n valueRef.current = value;\n return valueRef;\n}","import css from './css';\nimport listen from './listen';\nimport triggerEvent from './triggerEvent';\n\nfunction parseDuration(node) {\n var str = css(node, 'transitionDuration') || '';\n var mult = str.indexOf('ms') === -1 ? 1000 : 1;\n return parseFloat(str) * mult;\n}\n\nfunction emulateTransitionEnd(element, duration, padding) {\n if (padding === void 0) {\n padding = 5;\n }\n\n var called = false;\n var handle = setTimeout(function () {\n if (!called) triggerEvent(element, 'transitionend', true);\n }, duration + padding);\n var remove = listen(element, 'transitionend', function () {\n called = true;\n }, {\n once: true\n });\n return function () {\n clearTimeout(handle);\n remove();\n };\n}\n\nexport default function transitionEnd(element, handler, duration, padding) {\n if (duration == null) duration = parseDuration(element) || 0;\n var removeEmulate = emulateTransitionEnd(element, duration, padding);\n var remove = listen(element, 'transitionend', handler);\n return function () {\n removeEmulate();\n remove();\n };\n}","/**\n * Triggers an event on a given element.\n * \n * @param node the element\n * @param eventName the event name to trigger\n * @param bubbles whether the event should bubble up\n * @param cancelable whether the event should be cancelable\n */\nexport default function triggerEvent(node, eventName, bubbles, cancelable) {\n if (bubbles === void 0) {\n bubbles = false;\n }\n\n if (cancelable === void 0) {\n cancelable = true;\n }\n\n if (node) {\n var event = document.createEvent('HTMLEvents');\n event.initEvent(eventName, bubbles, cancelable);\n node.dispatchEvent(event);\n }\n}","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","/*\n * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n * the License. A copy of the License is located at\n *\n * http://aws.amazon.com/apache2.0/\n *\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\n// Logging constants\nvar AWS_CLOUDWATCH_BASE_BUFFER_SIZE = 26;\nvar AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE = 1048576;\nvar AWS_CLOUDWATCH_MAX_EVENT_SIZE = 256000;\nvar AWS_CLOUDWATCH_CATEGORY = 'Logging';\nvar AWS_CLOUDWATCH_PROVIDER_NAME = 'AWSCloudWatch';\nvar NO_CREDS_ERROR_STRING = 'No credentials';\nvar RETRY_ERROR_CODES = [\n 'ResourceNotFoundException',\n 'InvalidSequenceTokenException',\n];\nexport { AWS_CLOUDWATCH_BASE_BUFFER_SIZE, AWS_CLOUDWATCH_CATEGORY, AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE, AWS_CLOUDWATCH_MAX_EVENT_SIZE, AWS_CLOUDWATCH_PROVIDER_NAME, NO_CREDS_ERROR_STRING, RETRY_ERROR_CODES, };\n//# sourceMappingURL=Constants.js.map","/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n","'use strict';\nvar globalThis = require('../internals/global-this');\nvar DOMIterables = require('../internals/dom-iterables');\nvar DOMTokenListPrototype = require('../internals/dom-token-list-prototype');\nvar ArrayIteratorMethods = require('../modules/es.array.iterator');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar ArrayValues = ArrayIteratorMethods.values;\n\nvar handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {\n if (CollectionPrototype) {\n // some Chrome versions have non-configurable methods on DOMTokenList\n if (CollectionPrototype[ITERATOR] !== ArrayValues) try {\n createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);\n } catch (error) {\n CollectionPrototype[ITERATOR] = ArrayValues;\n }\n setToStringTag(CollectionPrototype, COLLECTION_NAME, true);\n if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {\n // some Chrome versions have non-configurable methods on DOMTokenList\n if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {\n createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);\n } catch (error) {\n CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];\n }\n }\n }\n};\n\nfor (var COLLECTION_NAME in DOMIterables) {\n handlePrototype(globalThis[COLLECTION_NAME] && globalThis[COLLECTION_NAME].prototype, COLLECTION_NAME);\n}\n\nhandlePrototype(DOMTokenListPrototype, 'DOMTokenList');\n","'use strict';\nvar IS_PURE = require('../internals/is-pure');\nvar globalThis = require('../internals/global-this');\nvar defineGlobalProperty = require('../internals/define-global-property');\n\nvar SHARED = '__core-js_shared__';\nvar store = module.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {});\n\n(store.versions || (store.versions = [])).push({\n version: '3.38.1',\n mode: IS_PURE ? 'pure' : 'global',\n copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',\n license: 'https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE',\n source: 'https://github.com/zloirock/core-js'\n});\n","'use strict';\nvar globalThis = require('../internals/global-this');\n\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar defineProperty = Object.defineProperty;\n\nmodule.exports = function (key, value) {\n try {\n defineProperty(globalThis, key, { value: value, configurable: true, writable: true });\n } catch (error) {\n globalThis[key] = value;\n } return value;\n};\n","'use strict';\nvar call = require('../internals/function-call');\nvar isObject = require('../internals/is-object');\nvar isSymbol = require('../internals/is-symbol');\nvar getMethod = require('../internals/get-method');\nvar ordinaryToPrimitive = require('../internals/ordinary-to-primitive');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar $TypeError = TypeError;\nvar TO_PRIMITIVE = wellKnownSymbol('toPrimitive');\n\n// `ToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-toprimitive\nmodule.exports = function (input, pref) {\n if (!isObject(input) || isSymbol(input)) return input;\n var exoticToPrim = getMethod(input, TO_PRIMITIVE);\n var result;\n if (exoticToPrim) {\n if (pref === undefined) pref = 'default';\n result = call(exoticToPrim, input, pref);\n if (!isObject(result) || isSymbol(result)) return result;\n throw new $TypeError(\"Can't convert object to primitive value\");\n }\n if (pref === undefined) pref = 'number';\n return ordinaryToPrimitive(input, pref);\n};\n","'use strict';\n// IE8- don't enum bug keys\nmodule.exports = [\n 'constructor',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'toLocaleString',\n 'toString',\n 'valueOf'\n];\n","'use strict';\nvar $ = require('../internals/export');\nvar call = require('../internals/function-call');\nvar IS_PURE = require('../internals/is-pure');\nvar FunctionName = require('../internals/function-name');\nvar isCallable = require('../internals/is-callable');\nvar createIteratorConstructor = require('../internals/iterator-create-constructor');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar Iterators = require('../internals/iterators');\nvar IteratorsCore = require('../internals/iterators-core');\n\nvar PROPER_FUNCTION_NAME = FunctionName.PROPER;\nvar CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;\nvar IteratorPrototype = IteratorsCore.IteratorPrototype;\nvar BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;\nvar ITERATOR = wellKnownSymbol('iterator');\nvar KEYS = 'keys';\nvar VALUES = 'values';\nvar ENTRIES = 'entries';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {\n createIteratorConstructor(IteratorConstructor, NAME, next);\n\n var getIterationMethod = function (KIND) {\n if (KIND === DEFAULT && defaultIterator) return defaultIterator;\n if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) return IterablePrototype[KIND];\n\n switch (KIND) {\n case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };\n case VALUES: return function values() { return new IteratorConstructor(this, KIND); };\n case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };\n }\n\n return function () { return new IteratorConstructor(this); };\n };\n\n var TO_STRING_TAG = NAME + ' Iterator';\n var INCORRECT_VALUES_NAME = false;\n var IterablePrototype = Iterable.prototype;\n var nativeIterator = IterablePrototype[ITERATOR]\n || IterablePrototype['@@iterator']\n || DEFAULT && IterablePrototype[DEFAULT];\n var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);\n var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;\n var CurrentIteratorPrototype, methods, KEY;\n\n // fix native\n if (anyNativeIterator) {\n CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));\n if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {\n if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {\n if (setPrototypeOf) {\n setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);\n } else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) {\n defineBuiltIn(CurrentIteratorPrototype, ITERATOR, returnThis);\n }\n }\n // Set @@toStringTag to native iterators\n setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);\n if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;\n }\n }\n\n // fix Array.prototype.{ values, @@iterator }.name in V8 / FF\n if (PROPER_FUNCTION_NAME && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {\n if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) {\n createNonEnumerableProperty(IterablePrototype, 'name', VALUES);\n } else {\n INCORRECT_VALUES_NAME = true;\n defaultIterator = function values() { return call(nativeIterator, this); };\n }\n }\n\n // export additional methods\n if (DEFAULT) {\n methods = {\n values: getIterationMethod(VALUES),\n keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),\n entries: getIterationMethod(ENTRIES)\n };\n if (FORCED) for (KEY in methods) {\n if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {\n defineBuiltIn(IterablePrototype, KEY, methods[KEY]);\n }\n } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);\n }\n\n // define iterator\n if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {\n defineBuiltIn(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT });\n }\n Iterators[NAME] = defaultIterator;\n\n return methods;\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\nvar hasOwn = require('../internals/has-own-property');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar CONFIGURABLE_FUNCTION_NAME = require('../internals/function-name').CONFIGURABLE;\nvar inspectSource = require('../internals/inspect-source');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar enforceInternalState = InternalStateModule.enforce;\nvar getInternalState = InternalStateModule.get;\nvar $String = String;\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar defineProperty = Object.defineProperty;\nvar stringSlice = uncurryThis(''.slice);\nvar replace = uncurryThis(''.replace);\nvar join = uncurryThis([].join);\n\nvar CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function () {\n return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;\n});\n\nvar TEMPLATE = String(String).split('String');\n\nvar makeBuiltIn = module.exports = function (value, name, options) {\n if (stringSlice($String(name), 0, 7) === 'Symbol(') {\n name = '[' + replace($String(name), /^Symbol\\(([^)]*)\\).*$/, '$1') + ']';\n }\n if (options && options.getter) name = 'get ' + name;\n if (options && options.setter) name = 'set ' + name;\n if (!hasOwn(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {\n if (DESCRIPTORS) defineProperty(value, 'name', { value: name, configurable: true });\n else value.name = name;\n }\n if (CONFIGURABLE_LENGTH && options && hasOwn(options, 'arity') && value.length !== options.arity) {\n defineProperty(value, 'length', { value: options.arity });\n }\n try {\n if (options && hasOwn(options, 'constructor') && options.constructor) {\n if (DESCRIPTORS) defineProperty(value, 'prototype', { writable: false });\n // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable\n } else if (value.prototype) value.prototype = undefined;\n } catch (error) { /* empty */ }\n var state = enforceInternalState(value);\n if (!hasOwn(state, 'source')) {\n state.source = join(TEMPLATE, typeof name == 'string' ? name : '');\n } return value;\n};\n\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n// eslint-disable-next-line no-extend-native -- required\nFunction.prototype.toString = makeBuiltIn(function toString() {\n return isCallable(this) && getInternalState(this).source || inspectSource(this);\n}, 'toString');\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar isCallable = require('../internals/is-callable');\nvar store = require('../internals/shared-store');\n\nvar functionToString = uncurryThis(Function.toString);\n\n// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper\nif (!isCallable(store.inspectSource)) {\n store.inspectSource = function (it) {\n return functionToString(it);\n };\n}\n\nmodule.exports = store.inspectSource;\n","'use strict';\nvar hasOwn = require('../internals/has-own-property');\nvar ownKeys = require('../internals/own-keys');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\nvar definePropertyModule = require('../internals/object-define-property');\n\nmodule.exports = function (target, source, exceptions) {\n var keys = ownKeys(source);\n var defineProperty = definePropertyModule.f;\n var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {\n defineProperty(target, key, getOwnPropertyDescriptor(source, key));\n }\n }\n};\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar getOwnPropertyNamesModule = require('../internals/object-get-own-property-names');\nvar getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');\nvar anObject = require('../internals/an-object');\n\nvar concat = uncurryThis([].concat);\n\n// all object keys, includes non-enumerable and symbols\nmodule.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {\n var keys = getOwnPropertyNamesModule.f(anObject(it));\n var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;\n return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;\n};\n","'use strict';\nvar fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n function F() { /* empty */ }\n F.prototype.constructor = null;\n // eslint-disable-next-line es/no-object-getprototypeof -- required for testing\n return Object.getPrototypeOf(new F()) !== F.prototype;\n});\n","'use strict';\n/* eslint-disable es/no-object-getownpropertynames -- safe */\nvar classof = require('../internals/classof-raw');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar $getOwnPropertyNames = require('../internals/object-get-own-property-names').f;\nvar arraySlice = require('../internals/array-slice');\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function (it) {\n try {\n return $getOwnPropertyNames(it);\n } catch (error) {\n return arraySlice(windowNames);\n }\n};\n\n// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nmodule.exports.f = function getOwnPropertyNames(it) {\n return windowNames && classof(it) === 'Window'\n ? getWindowNames(it)\n : $getOwnPropertyNames(toIndexedObject(it));\n};\n","'use strict';\nvar fails = require('../internals/fails');\nvar isObject = require('../internals/is-object');\nvar classof = require('../internals/classof-raw');\nvar ARRAY_BUFFER_NON_EXTENSIBLE = require('../internals/array-buffer-non-extensible');\n\n// eslint-disable-next-line es/no-object-isextensible -- safe\nvar $isExtensible = Object.isExtensible;\nvar FAILS_ON_PRIMITIVES = fails(function () { $isExtensible(1); });\n\n// `Object.isExtensible` method\n// https://tc39.es/ecma262/#sec-object.isextensible\nmodule.exports = (FAILS_ON_PRIMITIVES || ARRAY_BUFFER_NON_EXTENSIBLE) ? function isExtensible(it) {\n if (!isObject(it)) return false;\n if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it) === 'ArrayBuffer') return false;\n return $isExtensible ? $isExtensible(it) : true;\n} : $isExtensible;\n","'use strict';\n// FF26- bug: ArrayBuffers are non-extensible, but Object.isExtensible does not report it\nvar fails = require('../internals/fails');\n\nmodule.exports = fails(function () {\n if (typeof ArrayBuffer == 'function') {\n var buffer = new ArrayBuffer(8);\n // eslint-disable-next-line es/no-object-isextensible, es/no-object-defineproperty -- safe\n if (Object.isExtensible(buffer)) Object.defineProperty(buffer, 'a', { value: 8 });\n }\n});\n","'use strict';\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar Iterators = require('../internals/iterators');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar ArrayPrototype = Array.prototype;\n\n// check on default Array iterator\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);\n};\n","'use strict';\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar test = {};\n\ntest[TO_STRING_TAG] = 'z';\n\nmodule.exports = String(test) === '[object z]';\n","'use strict';\nvar TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar toString = require('../internals/object-to-string');\n\n// `Object.prototype.toString` method\n// https://tc39.es/ecma262/#sec-object.prototype.tostring\nif (!TO_STRING_TAG_SUPPORT) {\n defineBuiltIn(Object.prototype, 'toString', toString, { unsafe: true });\n}\n","'use strict';\nvar SetHelpers = require('../internals/set-helpers');\nvar iterate = require('../internals/set-iterate');\n\nvar Set = SetHelpers.Set;\nvar add = SetHelpers.add;\n\nmodule.exports = function (set) {\n var result = new Set();\n iterate(set, function (it) {\n add(result, it);\n });\n return result;\n};\n","'use strict';\nvar $TypeError = TypeError;\nvar MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991\n\nmodule.exports = function (it) {\n if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded');\n return it;\n};\n","'use strict';\nvar tryToString = require('../internals/try-to-string');\n\nvar $TypeError = TypeError;\n\nmodule.exports = function (O, P) {\n if (!delete O[P]) throw new $TypeError('Cannot delete property ' + tryToString(P) + ' of ' + tryToString(O));\n};\n","'use strict';\nvar toObject = require('../internals/to-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\n\n// `Array.prototype.fill` method implementation\n// https://tc39.es/ecma262/#sec-array.prototype.fill\nmodule.exports = function fill(value /* , start = 0, end = @length */) {\n var O = toObject(this);\n var length = lengthOfArrayLike(O);\n var argumentsLength = arguments.length;\n var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length);\n var end = argumentsLength > 2 ? arguments[2] : undefined;\n var endPos = end === undefined ? length : toAbsoluteIndex(end, length);\n while (endPos > index) O[index++] = value;\n return O;\n};\n","'use strict';\nvar arraySlice = require('../internals/array-slice');\n\nvar floor = Math.floor;\n\nvar sort = function (array, comparefn) {\n var length = array.length;\n\n if (length < 8) {\n // insertion sort\n var i = 1;\n var element, j;\n\n while (i < length) {\n j = i;\n element = array[i];\n while (j && comparefn(array[j - 1], element) > 0) {\n array[j] = array[--j];\n }\n if (j !== i++) array[j] = element;\n }\n } else {\n // merge sort\n var middle = floor(length / 2);\n var left = sort(arraySlice(array, 0, middle), comparefn);\n var right = sort(arraySlice(array, middle), comparefn);\n var llength = left.length;\n var rlength = right.length;\n var lindex = 0;\n var rindex = 0;\n\n while (lindex < llength || rindex < rlength) {\n array[lindex + rindex] = (lindex < llength && rindex < rlength)\n ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]\n : lindex < llength ? left[lindex++] : right[rindex++];\n }\n }\n\n return array;\n};\n\nmodule.exports = sort;\n","'use strict';\nvar userAgent = require('../internals/environment-user-agent');\n\nvar webkit = userAgent.match(/AppleWebKit\\/(\\d+)\\./);\n\nmodule.exports = !!webkit && +webkit[1];\n","'use strict';\n// eslint-disable-next-line es/no-typed-arrays -- safe\nmodule.exports = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined';\n","'use strict';\n// `Math.sign` method implementation\n// https://tc39.es/ecma262/#sec-math.sign\n// eslint-disable-next-line es/no-math-sign -- safe\nmodule.exports = Math.sign || function sign(x) {\n var n = +x;\n // eslint-disable-next-line no-self-compare -- NaN check\n return n === 0 || n !== n ? n : n < 0 ? -1 : 1;\n};\n","'use strict';\nvar isConstructor = require('../internals/is-constructor');\nvar tryToString = require('../internals/try-to-string');\n\nvar $TypeError = TypeError;\n\n// `Assert: IsConstructor(argument) is true`\nmodule.exports = function (argument) {\n if (isConstructor(argument)) return argument;\n throw new $TypeError(tryToString(argument) + ' is not a constructor');\n};\n","'use strict';\nvar isObject = require('../internals/is-object');\n\nvar floor = Math.floor;\n\n// `IsIntegralNumber` abstract operation\n// https://tc39.es/ecma262/#sec-isintegralnumber\n// eslint-disable-next-line es/no-number-isinteger -- safe\nmodule.exports = Number.isInteger || function isInteger(it) {\n return !isObject(it) && isFinite(it) && floor(it) === it;\n};\n","'use strict';\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\nvar toString = require('../internals/to-string');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nvar $RangeError = RangeError;\n\n// `String.prototype.repeat` method implementation\n// https://tc39.es/ecma262/#sec-string.prototype.repeat\nmodule.exports = function repeat(count) {\n var str = toString(requireObjectCoercible(this));\n var result = '';\n var n = toIntegerOrInfinity(count);\n if (n < 0 || n === Infinity) throw new $RangeError('Wrong number of repetitions');\n for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str;\n return result;\n};\n","'use strict';\nvar ENVIRONMENT = require('../internals/environment');\n\nmodule.exports = ENVIRONMENT === 'NODE';\n","'use strict';\n/* global Bun, Deno -- detection */\nvar globalThis = require('../internals/global-this');\nvar userAgent = require('../internals/environment-user-agent');\nvar classof = require('../internals/classof-raw');\n\nvar userAgentStartsWith = function (string) {\n return userAgent.slice(0, string.length) === string;\n};\n\nmodule.exports = (function () {\n if (userAgentStartsWith('Bun/')) return 'BUN';\n if (userAgentStartsWith('Cloudflare-Workers')) return 'CLOUDFLARE';\n if (userAgentStartsWith('Deno/')) return 'DENO';\n if (userAgentStartsWith('Node.js/')) return 'NODE';\n if (globalThis.Bun && typeof Bun.version == 'string') return 'BUN';\n if (globalThis.Deno && typeof Deno.version == 'object') return 'DENO';\n if (classof(globalThis.process) === 'process') return 'NODE';\n if (globalThis.window && globalThis.document) return 'BROWSER';\n return 'REST';\n})();\n","'use strict';\nmodule.exports = function (exec) {\n try {\n return { error: false, value: exec() };\n } catch (error) {\n return { error: true, value: error };\n }\n};\n","'use strict';\nvar anObject = require('../internals/an-object');\n\n// `RegExp.prototype.flags` getter implementation\n// https://tc39.es/ecma262/#sec-get-regexp.prototype.flags\nmodule.exports = function () {\n var that = anObject(this);\n var result = '';\n if (that.hasIndices) result += 'd';\n if (that.global) result += 'g';\n if (that.ignoreCase) result += 'i';\n if (that.multiline) result += 'm';\n if (that.dotAll) result += 's';\n if (that.unicode) result += 'u';\n if (that.unicodeSets) result += 'v';\n if (that.sticky) result += 'y';\n return result;\n};\n","'use strict';\nvar fails = require('../internals/fails');\nvar globalThis = require('../internals/global-this');\n\n// babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError\nvar $RegExp = globalThis.RegExp;\n\nvar UNSUPPORTED_Y = fails(function () {\n var re = $RegExp('a', 'y');\n re.lastIndex = 2;\n return re.exec('abcd') !== null;\n});\n\n// UC Browser bug\n// https://github.com/zloirock/core-js/issues/1008\nvar MISSED_STICKY = UNSUPPORTED_Y || fails(function () {\n return !$RegExp('a', 'y').sticky;\n});\n\nvar BROKEN_CARET = UNSUPPORTED_Y || fails(function () {\n // https://bugzilla.mozilla.org/show_bug.cgi?id=773687\n var re = $RegExp('^r', 'gy');\n re.lastIndex = 2;\n return re.exec('str') !== null;\n});\n\nmodule.exports = {\n BROKEN_CARET: BROKEN_CARET,\n MISSED_STICKY: MISSED_STICKY,\n UNSUPPORTED_Y: UNSUPPORTED_Y\n};\n","'use strict';\n/* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */\n/* eslint-disable regexp/no-useless-quantifier -- testing */\nvar call = require('../internals/function-call');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar toString = require('../internals/to-string');\nvar regexpFlags = require('../internals/regexp-flags');\nvar stickyHelpers = require('../internals/regexp-sticky-helpers');\nvar shared = require('../internals/shared');\nvar create = require('../internals/object-create');\nvar getInternalState = require('../internals/internal-state').get;\nvar UNSUPPORTED_DOT_ALL = require('../internals/regexp-unsupported-dot-all');\nvar UNSUPPORTED_NCG = require('../internals/regexp-unsupported-ncg');\n\nvar nativeReplace = shared('native-string-replace', String.prototype.replace);\nvar nativeExec = RegExp.prototype.exec;\nvar patchedExec = nativeExec;\nvar charAt = uncurryThis(''.charAt);\nvar indexOf = uncurryThis(''.indexOf);\nvar replace = uncurryThis(''.replace);\nvar stringSlice = uncurryThis(''.slice);\n\nvar UPDATES_LAST_INDEX_WRONG = (function () {\n var re1 = /a/;\n var re2 = /b*/g;\n call(nativeExec, re1, 'a');\n call(nativeExec, re2, 'a');\n return re1.lastIndex !== 0 || re2.lastIndex !== 0;\n})();\n\nvar UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET;\n\n// nonparticipating capturing group, copied from es5-shim's String#split patch.\nvar NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;\n\nvar PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;\n\nif (PATCH) {\n patchedExec = function exec(string) {\n var re = this;\n var state = getInternalState(re);\n var str = toString(string);\n var raw = state.raw;\n var result, reCopy, lastIndex, match, i, object, group;\n\n if (raw) {\n raw.lastIndex = re.lastIndex;\n result = call(patchedExec, raw, str);\n re.lastIndex = raw.lastIndex;\n return result;\n }\n\n var groups = state.groups;\n var sticky = UNSUPPORTED_Y && re.sticky;\n var flags = call(regexpFlags, re);\n var source = re.source;\n var charsAdded = 0;\n var strCopy = str;\n\n if (sticky) {\n flags = replace(flags, 'y', '');\n if (indexOf(flags, 'g') === -1) {\n flags += 'g';\n }\n\n strCopy = stringSlice(str, re.lastIndex);\n // Support anchored sticky behavior.\n if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt(str, re.lastIndex - 1) !== '\\n')) {\n source = '(?: ' + source + ')';\n strCopy = ' ' + strCopy;\n charsAdded++;\n }\n // ^(? + rx + ) is needed, in combination with some str slicing, to\n // simulate the 'y' flag.\n reCopy = new RegExp('^(?:' + source + ')', flags);\n }\n\n if (NPCG_INCLUDED) {\n reCopy = new RegExp('^' + source + '$(?!\\\\s)', flags);\n }\n if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;\n\n match = call(nativeExec, sticky ? reCopy : re, strCopy);\n\n if (sticky) {\n if (match) {\n match.input = stringSlice(match.input, charsAdded);\n match[0] = stringSlice(match[0], charsAdded);\n match.index = re.lastIndex;\n re.lastIndex += match[0].length;\n } else re.lastIndex = 0;\n } else if (UPDATES_LAST_INDEX_WRONG && match) {\n re.lastIndex = re.global ? match.index + match[0].length : lastIndex;\n }\n if (NPCG_INCLUDED && match && match.length > 1) {\n // Fix browsers whose `exec` methods don't consistently return `undefined`\n // for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/\n call(nativeReplace, match[0], reCopy, function () {\n for (i = 1; i < arguments.length - 2; i++) {\n if (arguments[i] === undefined) match[i] = undefined;\n }\n });\n }\n\n if (match && groups) {\n match.groups = object = create(null);\n for (i = 0; i < groups.length; i++) {\n group = groups[i];\n object[group[0]] = match[group[1]];\n }\n }\n\n return match;\n };\n}\n\nmodule.exports = patchedExec;\n","'use strict';\nvar isRegExp = require('../internals/is-regexp');\n\nvar $TypeError = TypeError;\n\nmodule.exports = function (it) {\n if (isRegExp(it)) {\n throw new $TypeError(\"The method doesn't accept regular expressions\");\n } return it;\n};\n","'use strict';\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar MATCH = wellKnownSymbol('match');\n\nmodule.exports = function (METHOD_NAME) {\n var regexp = /./;\n try {\n '/./'[METHOD_NAME](regexp);\n } catch (error1) {\n try {\n regexp[MATCH] = false;\n return '/./'[METHOD_NAME](regexp);\n } catch (error2) { /* empty */ }\n } return false;\n};\n","'use strict';\nvar charAt = require('../internals/string-multibyte').charAt;\n\n// `AdvanceStringIndex` abstract operation\n// https://tc39.es/ecma262/#sec-advancestringindex\nmodule.exports = function (S, index, unicode) {\n return index + (unicode ? charAt(S, index).length : 1);\n};\n","'use strict';\nvar PROPER_FUNCTION_NAME = require('../internals/function-name').PROPER;\nvar fails = require('../internals/fails');\nvar whitespaces = require('../internals/whitespaces');\n\nvar non = '\\u200B\\u0085\\u180E';\n\n// check that a method works with the correct list\n// of whitespaces and has a correct name\nmodule.exports = function (METHOD_NAME) {\n return fails(function () {\n return !!whitespaces[METHOD_NAME]()\n || non[METHOD_NAME]() !== non\n || (PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME);\n });\n};\n","'use strict';\n/* eslint-disable no-new, sonar/inconsistent-function-call -- required for testing */\nvar globalThis = require('../internals/global-this');\nvar fails = require('../internals/fails');\nvar checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration');\nvar NATIVE_ARRAY_BUFFER_VIEWS = require('../internals/array-buffer-view-core').NATIVE_ARRAY_BUFFER_VIEWS;\n\nvar ArrayBuffer = globalThis.ArrayBuffer;\nvar Int8Array = globalThis.Int8Array;\n\nmodule.exports = !NATIVE_ARRAY_BUFFER_VIEWS || !fails(function () {\n Int8Array(1);\n}) || !fails(function () {\n new Int8Array(-1);\n}) || !checkCorrectnessOfIteration(function (iterable) {\n new Int8Array();\n new Int8Array(null);\n new Int8Array(1.5);\n new Int8Array(iterable);\n}, true) || fails(function () {\n // Safari (11+) bug - a reason why even Safari 13 should load a typed array polyfill\n return new Int8Array(new ArrayBuffer(2), 1, undefined).length !== 1;\n});\n","'use strict';\nvar globalThis = require('../internals/global-this');\nvar apply = require('../internals/function-apply');\nvar isCallable = require('../internals/is-callable');\nvar ENVIRONMENT = require('../internals/environment');\nvar USER_AGENT = require('../internals/environment-user-agent');\nvar arraySlice = require('../internals/array-slice');\nvar validateArgumentsLength = require('../internals/validate-arguments-length');\n\nvar Function = globalThis.Function;\n// dirty IE9- and Bun 0.3.0- checks\nvar WRAP = /MSIE .\\./.test(USER_AGENT) || ENVIRONMENT === 'BUN' && (function () {\n var version = globalThis.Bun.version.split('.');\n return version.length < 3 || version[0] === '0' && (version[1] < 3 || version[1] === '3' && version[2] === '0');\n})();\n\n// IE9- / Bun 0.3.0- setTimeout / setInterval / setImmediate additional parameters fix\n// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers\n// https://github.com/oven-sh/bun/issues/1633\nmodule.exports = function (scheduler, hasTimeArg) {\n var firstParamIndex = hasTimeArg ? 2 : 1;\n return WRAP ? function (handler, timeout /* , ...arguments */) {\n var boundArgs = validateArgumentsLength(arguments.length, 1) > firstParamIndex;\n var fn = isCallable(handler) ? handler : Function(handler);\n var params = boundArgs ? arraySlice(arguments, firstParamIndex) : [];\n var callback = boundArgs ? function () {\n apply(fn, this, params);\n } : fn;\n return hasTimeArg ? scheduler(callback, timeout) : scheduler(callback);\n } : scheduler;\n};\n","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}","'use strict';\n\nvar stringify = require('./stringify');\nvar parse = require('./parse');\nvar formats = require('./formats');\n\nmodule.exports = {\n formats: formats,\n parse: parse,\n stringify: stringify\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = Function.prototype.bind || implementation;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\n/** @type {import('.')} */\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true) || false;\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = false;\n\t}\n}\n\nmodule.exports = $defineProperty;\n","'use strict';\n\nvar replace = String.prototype.replace;\nvar percentTwenties = /%20/g;\n\nvar Format = {\n RFC1738: 'RFC1738',\n RFC3986: 'RFC3986'\n};\n\nmodule.exports = {\n 'default': Format.RFC3986,\n formatters: {\n RFC1738: function (value) {\n return replace.call(value, percentTwenties, '+');\n },\n RFC3986: function (value) {\n return String(value);\n }\n },\n RFC1738: Format.RFC1738,\n RFC3986: Format.RFC3986\n};\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","const fallbackWindow = {};\nexport function locateWindow() {\n if (typeof window !== \"undefined\") {\n return window;\n }\n else if (typeof self !== \"undefined\") {\n return self;\n }\n return fallbackWindow;\n}\n","var arrayLikeToArray = require(\"./arrayLikeToArray\");\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(n);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}\n\nmodule.exports = _unsupportedIterableToArray;","import React from 'react';\nexport default React.createContext(null);","/*\n * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n * the License. A copy of the License is located at\n *\n * http://aws.amazon.com/apache2.0/\n *\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { ConsoleLogger as Logger } from './Logger';\nimport { Sha256 as jsSha256 } from '@aws-crypto/sha256-js';\nimport { toHex } from '@aws-sdk/util-hex-encoding';\nimport { parse, format } from 'url';\nimport { DateUtils } from './Util';\nvar logger = new Logger('Signer');\nvar DEFAULT_ALGORITHM = 'AWS4-HMAC-SHA256';\nvar IOT_SERVICE_NAME = 'iotdevicegateway';\nvar encrypt = function (key, src) {\n var hash = new jsSha256(key);\n hash.update(src);\n return hash.digestSync();\n};\nvar hash = function (src) {\n var arg = src || '';\n var hash = new jsSha256();\n hash.update(arg);\n return toHex(hash.digestSync());\n};\n/**\n * @private\n * RFC 3986 compliant version of encodeURIComponent\n */\nvar escape_RFC3986 = function (component) {\n return component.replace(/[!'()*]/g, function (c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase();\n });\n};\n/**\n * @private\n * Create canonical query string\n *\n */\nvar canonical_query = function (query) {\n if (!query || query.length === 0) {\n return '';\n }\n return query\n .split('&')\n .map(function (e) {\n var key_val = e.split('=');\n if (key_val.length === 1) {\n return e;\n }\n else {\n var reencoded_val = escape_RFC3986(key_val[1]);\n return key_val[0] + '=' + reencoded_val;\n }\n })\n .sort(function (a, b) {\n var key_a = a.split('=')[0];\n var key_b = b.split('=')[0];\n if (key_a === key_b) {\n return a < b ? -1 : 1;\n }\n else {\n return key_a < key_b ? -1 : 1;\n }\n })\n .join('&');\n};\n/**\n* @private\n* Create canonical headers\n*\n\nCanonicalHeaders =\n CanonicalHeadersEntry0 + CanonicalHeadersEntry1 + ... + CanonicalHeadersEntryN\nCanonicalHeadersEntry =\n Lowercase(HeaderName) + ':' + Trimall(HeaderValue) + '\\n'\n
\n*/\nvar canonical_headers = function (headers) {\n if (!headers || Object.keys(headers).length === 0) {\n return '';\n }\n return (Object.keys(headers)\n .map(function (key) {\n return {\n key: key.toLowerCase(),\n value: headers[key] ? headers[key].trim().replace(/\\s+/g, ' ') : '',\n };\n })\n .sort(function (a, b) {\n return a.key < b.key ? -1 : 1;\n })\n .map(function (item) {\n return item.key + ':' + item.value;\n })\n .join('\\n') + '\\n');\n};\n/**\n * List of header keys included in the canonical headers.\n * @access private\n */\nvar signed_headers = function (headers) {\n return Object.keys(headers)\n .map(function (key) {\n return key.toLowerCase();\n })\n .sort()\n .join(';');\n};\n/**\n* @private\n* Create canonical request\n* Refer to\n* {@link http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html|Create a Canonical Request}\n*\n\nCanonicalRequest =\n HTTPRequestMethod + '\\n' +\n CanonicalURI + '\\n' +\n CanonicalQueryString + '\\n' +\n CanonicalHeaders + '\\n' +\n SignedHeaders + '\\n' +\n HexEncode(Hash(RequestPayload))\n
\n*/\nvar canonical_request = function (request) {\n var url_info = parse(request.url);\n return [\n request.method || '/',\n encodeURIComponent(url_info.pathname).replace(/%2F/gi, '/'),\n canonical_query(url_info.query),\n canonical_headers(request.headers),\n signed_headers(request.headers),\n hash(request.data),\n ].join('\\n');\n};\nvar parse_service_info = function (request) {\n var url_info = parse(request.url), host = url_info.host;\n var matched = host.match(/([^\\.]+)\\.(?:([^\\.]*)\\.)?amazonaws\\.com$/);\n var parsed = (matched || []).slice(1, 3);\n if (parsed[1] === 'es') {\n // Elastic Search\n parsed = parsed.reverse();\n }\n return {\n service: request.service || parsed[0],\n region: request.region || parsed[1],\n };\n};\nvar credential_scope = function (d_str, region, service) {\n return [d_str, region, service, 'aws4_request'].join('/');\n};\n/**\n* @private\n* Create a string to sign\n* Refer to\n* {@link http://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html|Create String to Sign}\n*\n\nStringToSign =\n Algorithm + \\n +\n RequestDateTime + \\n +\n CredentialScope + \\n +\n HashedCanonicalRequest\n
\n*/\nvar string_to_sign = function (algorithm, canonical_request, dt_str, scope) {\n return [algorithm, dt_str, scope, hash(canonical_request)].join('\\n');\n};\n/**\n* @private\n* Create signing key\n* Refer to\n* {@link http://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html|Calculate Signature}\n*\n\nkSecret = your secret access key\nkDate = HMAC(\"AWS4\" + kSecret, Date)\nkRegion = HMAC(kDate, Region)\nkService = HMAC(kRegion, Service)\nkSigning = HMAC(kService, \"aws4_request\")\n
\n*/\nvar get_signing_key = function (secret_key, d_str, service_info) {\n logger.debug(service_info);\n var k = 'AWS4' + secret_key, k_date = encrypt(k, d_str), k_region = encrypt(k_date, service_info.region), k_service = encrypt(k_region, service_info.service), k_signing = encrypt(k_service, 'aws4_request');\n return k_signing;\n};\nvar get_signature = function (signing_key, str_to_sign) {\n return toHex(encrypt(signing_key, str_to_sign));\n};\n/**\n * @private\n * Create authorization header\n * Refer to\n * {@link http://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html|Add the Signing Information}\n */\nvar get_authorization_header = function (algorithm, access_key, scope, signed_headers, signature) {\n return [\n algorithm + ' ' + 'Credential=' + access_key + '/' + scope,\n 'SignedHeaders=' + signed_headers,\n 'Signature=' + signature,\n ].join(', ');\n};\nvar Signer = /** @class */ (function () {\n function Signer() {\n }\n /**\n * Sign a HTTP request, add 'Authorization' header to request param\n * @method sign\n * @memberof Signer\n * @static\n *\n * @param {object} request - HTTP request object\n \n request: {\n method: GET | POST | PUT ...\n url: ...,\n headers: {\n header1: ...\n },\n data: data\n }\n
\n * @param {object} access_info - AWS access credential info\n \n access_info: {\n access_key: ...,\n secret_key: ...,\n session_token: ...\n }\n
\n * @param {object} [service_info] - AWS service type and region, optional,\n * if not provided then parse out from url\n \n service_info: {\n service: ...,\n region: ...\n }\n
\n *\n * @returns {object} Signed HTTP request\n */\n Signer.sign = function (request, access_info, service_info) {\n if (service_info === void 0) { service_info = null; }\n request.headers = request.headers || {};\n if (request.body && !request.data) {\n throw new Error('The attribute \"body\" was found on the request object. Please use the attribute \"data\" instead.');\n }\n // datetime string and date string\n var dt = DateUtils.getDateWithClockOffset(), dt_str = dt.toISOString().replace(/[:\\-]|\\.\\d{3}/g, ''), d_str = dt_str.substr(0, 8);\n var url_info = parse(request.url);\n request.headers['host'] = url_info.host;\n request.headers['x-amz-date'] = dt_str;\n if (access_info.session_token) {\n request.headers['X-Amz-Security-Token'] = access_info.session_token;\n }\n // Task 1: Create a Canonical Request\n var request_str = canonical_request(request);\n logger.debug(request_str);\n // Task 2: Create a String to Sign\n var serviceInfo = service_info || parse_service_info(request), scope = credential_scope(d_str, serviceInfo.region, serviceInfo.service), str_to_sign = string_to_sign(DEFAULT_ALGORITHM, request_str, dt_str, scope);\n // Task 3: Calculate the Signature\n var signing_key = get_signing_key(access_info.secret_key, d_str, serviceInfo), signature = get_signature(signing_key, str_to_sign);\n // Task 4: Adding the Signing information to the Request\n var authorization_header = get_authorization_header(DEFAULT_ALGORITHM, access_info.access_key, scope, signed_headers(request.headers), signature);\n request.headers['Authorization'] = authorization_header;\n return request;\n };\n Signer.signUrl = function (urlOrRequest, accessInfo, serviceInfo, expiration) {\n var urlToSign = typeof urlOrRequest === 'object' ? urlOrRequest.url : urlOrRequest;\n var method = typeof urlOrRequest === 'object' ? urlOrRequest.method : 'GET';\n var body = typeof urlOrRequest === 'object' ? urlOrRequest.body : undefined;\n var now = DateUtils.getDateWithClockOffset()\n .toISOString()\n .replace(/[:\\-]|\\.\\d{3}/g, '');\n var today = now.substr(0, 8);\n // Intentionally discarding search\n var _a = parse(urlToSign, true, true), search = _a.search, parsedUrl = __rest(_a, [\"search\"]);\n var host = parsedUrl.host;\n var signedHeaders = { host: host };\n var _b = serviceInfo || parse_service_info({ url: format(parsedUrl) }), region = _b.region, service = _b.service;\n var credentialScope = credential_scope(today, region, service);\n // IoT service does not allow the session token in the canonical request\n // https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n var sessionTokenRequired = accessInfo.session_token && service !== IOT_SERVICE_NAME;\n var queryParams = __assign(__assign(__assign({ 'X-Amz-Algorithm': DEFAULT_ALGORITHM, 'X-Amz-Credential': [accessInfo.access_key, credentialScope].join('/'), 'X-Amz-Date': now.substr(0, 16) }, (sessionTokenRequired\n ? { 'X-Amz-Security-Token': \"\" + accessInfo.session_token }\n : {})), (expiration ? { 'X-Amz-Expires': \"\" + expiration } : {})), { 'X-Amz-SignedHeaders': Object.keys(signedHeaders).join(',') });\n var canonicalRequest = canonical_request({\n method: method,\n url: format(__assign(__assign({}, parsedUrl), { query: __assign(__assign({}, parsedUrl.query), queryParams) })),\n headers: signedHeaders,\n data: body,\n });\n var stringToSign = string_to_sign(DEFAULT_ALGORITHM, canonicalRequest, now, credentialScope);\n var signing_key = get_signing_key(accessInfo.secret_key, today, {\n region: region,\n service: service,\n });\n var signature = get_signature(signing_key, stringToSign);\n var additionalQueryParams = __assign({ 'X-Amz-Signature': signature }, (accessInfo.session_token && {\n 'X-Amz-Security-Token': accessInfo.session_token,\n }));\n var result = format({\n protocol: parsedUrl.protocol,\n slashes: true,\n hostname: parsedUrl.hostname,\n port: parsedUrl.port,\n pathname: parsedUrl.pathname,\n query: __assign(__assign(__assign({}, parsedUrl.query), queryParams), additionalQueryParams),\n });\n return result;\n };\n return Signer;\n}());\nexport { Signer };\n/**\n * @deprecated use per-function import\n */\nexport default Signer;\n//# sourceMappingURL=Signer.js.map","/*\n * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n * the License. A copy of the License is located at\n *\n * http://aws.amazon.com/apache2.0/\n *\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\nvar SELF = '_self';\nexport var launchUri = function (url) {\n var windowProxy = window.open(url, SELF);\n if (windowProxy) {\n return Promise.resolve(windowProxy);\n }\n else {\n return Promise.reject();\n }\n};\n//# sourceMappingURL=urlOpener.js.map","/*\n * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n * the License. A copy of the License is located at\n *\n * http://aws.amazon.com/apache2.0/\n *\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nimport { parse } from 'url'; // Used for OAuth parsing of Cognito Hosted UI\nimport { launchUri } from './urlOpener';\nimport * as oAuthStorage from './oauthStorage';\nimport { isCognitoHostedOpts, CognitoHostedUIIdentityProvider, } from '../types/Auth';\nimport { ConsoleLogger as Logger, Hub, urlSafeEncode } from '@aws-amplify/core';\nimport sha256 from 'crypto-js/sha256';\nimport Base64 from 'crypto-js/enc-base64';\nvar AMPLIFY_SYMBOL = (typeof Symbol !== 'undefined' &&\n typeof Symbol.for === 'function'\n ? Symbol.for('amplify_default')\n : '@@amplify_default');\nvar dispatchAuthEvent = function (event, data, message) {\n Hub.dispatch('auth', { event: event, data: data, message: message }, 'Auth', AMPLIFY_SYMBOL);\n};\nvar logger = new Logger('OAuth');\nvar OAuth = /** @class */ (function () {\n function OAuth(_a) {\n var config = _a.config, cognitoClientId = _a.cognitoClientId, _b = _a.scopes, scopes = _b === void 0 ? [] : _b;\n this._urlOpener = config.urlOpener || launchUri;\n this._config = config;\n this._cognitoClientId = cognitoClientId;\n if (!this.isValidScopes(scopes))\n throw Error('scopes must be a String Array');\n this._scopes = scopes;\n }\n OAuth.prototype.isValidScopes = function (scopes) {\n return (Array.isArray(scopes) && scopes.every(function (scope) { return typeof scope === 'string'; }));\n };\n OAuth.prototype.oauthSignIn = function (responseType, domain, redirectSignIn, clientId, provider, customState) {\n if (responseType === void 0) { responseType = 'code'; }\n if (provider === void 0) { provider = CognitoHostedUIIdentityProvider.Cognito; }\n var generatedState = this._generateState(32);\n /* encodeURIComponent is not URL safe, use urlSafeEncode instead. Cognito\n single-encodes/decodes url on first sign in and double-encodes/decodes url\n when user already signed in. Using encodeURIComponent, Base32, Base64 add\n characters % or = which on further encoding becomes unsafe. '=' create issue\n for parsing query params.\n Refer: https://github.com/aws-amplify/amplify-js/issues/5218 */\n var state = customState\n ? generatedState + \"-\" + urlSafeEncode(customState)\n : generatedState;\n oAuthStorage.setState(state);\n var pkce_key = this._generateRandom(128);\n oAuthStorage.setPKCE(pkce_key);\n var code_challenge = this._generateChallenge(pkce_key);\n var code_challenge_method = 'S256';\n var scopesString = this._scopes.join(' ');\n var queryString = Object.entries(__assign(__assign({ redirect_uri: redirectSignIn, response_type: responseType, client_id: clientId, identity_provider: provider, scope: scopesString, state: state }, (responseType === 'code' ? { code_challenge: code_challenge } : {})), (responseType === 'code' ? { code_challenge_method: code_challenge_method } : {})))\n .map(function (_a) {\n var _b = __read(_a, 2), k = _b[0], v = _b[1];\n return encodeURIComponent(k) + \"=\" + encodeURIComponent(v);\n })\n .join('&');\n var URL = \"https://\" + domain + \"/oauth2/authorize?\" + queryString;\n logger.debug(\"Redirecting to \" + URL);\n this._urlOpener(URL, redirectSignIn);\n };\n OAuth.prototype._handleCodeFlow = function (currentUrl) {\n return __awaiter(this, void 0, void 0, function () {\n var code, currentUrlPathname, redirectSignInPathname, oAuthTokenEndpoint, client_id, redirect_uri, code_verifier, oAuthTokenBody, body, _a, access_token, refresh_token, id_token, error;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n code = (parse(currentUrl).query || '')\n .split('&')\n .map(function (pairings) { return pairings.split('='); })\n .reduce(function (accum, _a) {\n var _b;\n var _c = __read(_a, 2), k = _c[0], v = _c[1];\n return (__assign(__assign({}, accum), (_b = {}, _b[k] = v, _b)));\n }, { code: undefined }).code;\n currentUrlPathname = parse(currentUrl).pathname || '/';\n redirectSignInPathname = parse(this._config.redirectSignIn).pathname || '/';\n if (!code || currentUrlPathname !== redirectSignInPathname) {\n return [2 /*return*/];\n }\n oAuthTokenEndpoint = 'https://' + this._config.domain + '/oauth2/token';\n dispatchAuthEvent('codeFlow', {}, \"Retrieving tokens from \" + oAuthTokenEndpoint);\n client_id = isCognitoHostedOpts(this._config)\n ? this._cognitoClientId\n : this._config.clientID;\n redirect_uri = isCognitoHostedOpts(this._config)\n ? this._config.redirectSignIn\n : this._config.redirectUri;\n code_verifier = oAuthStorage.getPKCE();\n oAuthTokenBody = __assign({ grant_type: 'authorization_code', code: code,\n client_id: client_id,\n redirect_uri: redirect_uri }, (code_verifier ? { code_verifier: code_verifier } : {}));\n logger.debug(\"Calling token endpoint: \" + oAuthTokenEndpoint + \" with\", oAuthTokenBody);\n body = Object.entries(oAuthTokenBody)\n .map(function (_a) {\n var _b = __read(_a, 2), k = _b[0], v = _b[1];\n return encodeURIComponent(k) + \"=\" + encodeURIComponent(v);\n })\n .join('&');\n return [4 /*yield*/, fetch(oAuthTokenEndpoint, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n body: body,\n })];\n case 1: return [4 /*yield*/, (_b.sent()).json()];\n case 2:\n _a = _b.sent(), access_token = _a.access_token, refresh_token = _a.refresh_token, id_token = _a.id_token, error = _a.error;\n if (error) {\n throw new Error(error);\n }\n return [2 /*return*/, {\n accessToken: access_token,\n refreshToken: refresh_token,\n idToken: id_token,\n }];\n }\n });\n });\n };\n OAuth.prototype._handleImplicitFlow = function (currentUrl) {\n return __awaiter(this, void 0, void 0, function () {\n var _a, id_token, access_token;\n return __generator(this, function (_b) {\n _a = (parse(currentUrl).hash || '#')\n .substr(1) // Remove # from returned code\n .split('&')\n .map(function (pairings) { return pairings.split('='); })\n .reduce(function (accum, _a) {\n var _b;\n var _c = __read(_a, 2), k = _c[0], v = _c[1];\n return (__assign(__assign({}, accum), (_b = {}, _b[k] = v, _b)));\n }, {\n id_token: undefined,\n access_token: undefined,\n }), id_token = _a.id_token, access_token = _a.access_token;\n dispatchAuthEvent('implicitFlow', {}, \"Got tokens from \" + currentUrl);\n logger.debug(\"Retrieving implicit tokens from \" + currentUrl + \" with\");\n return [2 /*return*/, {\n accessToken: access_token,\n idToken: id_token,\n refreshToken: null,\n }];\n });\n });\n };\n OAuth.prototype.handleAuthResponse = function (currentUrl) {\n return __awaiter(this, void 0, void 0, function () {\n var urlParams, error, error_description, state, _a, _b, e_1;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n _c.trys.push([0, 5, , 6]);\n urlParams = currentUrl\n ? __assign(__assign({}, (parse(currentUrl).hash || '#')\n .substr(1)\n .split('&')\n .map(function (entry) { return entry.split('='); })\n .reduce(function (acc, _a) {\n var _b = __read(_a, 2), k = _b[0], v = _b[1];\n return ((acc[k] = v), acc);\n }, {})), (parse(currentUrl).query || '')\n .split('&')\n .map(function (entry) { return entry.split('='); })\n .reduce(function (acc, _a) {\n var _b = __read(_a, 2), k = _b[0], v = _b[1];\n return ((acc[k] = v), acc);\n }, {}))\n : {};\n error = urlParams.error, error_description = urlParams.error_description;\n if (error) {\n throw new Error(error_description);\n }\n state = this._validateState(urlParams);\n logger.debug(\"Starting \" + this._config.responseType + \" flow with \" + currentUrl);\n if (!(this._config.responseType === 'code')) return [3 /*break*/, 2];\n _a = [{}];\n return [4 /*yield*/, this._handleCodeFlow(currentUrl)];\n case 1: return [2 /*return*/, __assign.apply(void 0, [__assign.apply(void 0, _a.concat([(_c.sent())])), { state: state }])];\n case 2:\n _b = [{}];\n return [4 /*yield*/, this._handleImplicitFlow(currentUrl)];\n case 3: return [2 /*return*/, __assign.apply(void 0, [__assign.apply(void 0, _b.concat([(_c.sent())])), { state: state }])];\n case 4: return [3 /*break*/, 6];\n case 5:\n e_1 = _c.sent();\n logger.error(\"Error handling auth response.\", e_1);\n throw e_1;\n case 6: return [2 /*return*/];\n }\n });\n });\n };\n OAuth.prototype._validateState = function (urlParams) {\n if (!urlParams) {\n return;\n }\n var savedState = oAuthStorage.getState();\n var returnedState = urlParams.state;\n // This is because savedState only exists if the flow was initiated by Amplify\n if (savedState && savedState !== returnedState) {\n throw new Error('Invalid state in OAuth flow');\n }\n return returnedState;\n };\n OAuth.prototype.signOut = function () {\n return __awaiter(this, void 0, void 0, function () {\n var oAuthLogoutEndpoint, client_id, signout_uri;\n return __generator(this, function (_a) {\n oAuthLogoutEndpoint = 'https://' + this._config.domain + '/logout?';\n client_id = isCognitoHostedOpts(this._config)\n ? this._cognitoClientId\n : this._config.oauth.clientID;\n signout_uri = isCognitoHostedOpts(this._config)\n ? this._config.redirectSignOut\n : this._config.returnTo;\n oAuthLogoutEndpoint += Object.entries({\n client_id: client_id,\n logout_uri: encodeURIComponent(signout_uri),\n })\n .map(function (_a) {\n var _b = __read(_a, 2), k = _b[0], v = _b[1];\n return k + \"=\" + v;\n })\n .join('&');\n dispatchAuthEvent('oAuthSignOut', { oAuth: 'signOut' }, \"Signing out from \" + oAuthLogoutEndpoint);\n logger.debug(\"Signing out from \" + oAuthLogoutEndpoint);\n return [2 /*return*/, this._urlOpener(oAuthLogoutEndpoint)];\n });\n });\n };\n OAuth.prototype._generateState = function (length) {\n var result = '';\n var i = length;\n var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n for (; i > 0; --i)\n result += chars[Math.round(Math.random() * (chars.length - 1))];\n return result;\n };\n OAuth.prototype._generateChallenge = function (code) {\n return this._base64URL(sha256(code));\n };\n OAuth.prototype._base64URL = function (string) {\n return string\n .toString(Base64)\n .replace(/=/g, '')\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_');\n };\n OAuth.prototype._generateRandom = function (size) {\n var CHARSET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~';\n var buffer = new Uint8Array(size);\n if (typeof window !== 'undefined' && !!window.crypto) {\n window.crypto.getRandomValues(buffer);\n }\n else {\n for (var i = 0; i < size; i += 1) {\n buffer[i] = (Math.random() * CHARSET.length) | 0;\n }\n }\n return this._bufferToString(buffer);\n };\n OAuth.prototype._bufferToString = function (buffer) {\n var CHARSET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n var state = [];\n for (var i = 0; i < buffer.byteLength; i += 1) {\n var index = buffer[i] % CHARSET.length;\n state.push(CHARSET[index]);\n }\n return state.join('');\n };\n return OAuth;\n}());\nexport default OAuth;\n//# sourceMappingURL=OAuth.js.map","export function urlSafeEncode(str) {\n return str\n .split('')\n .map(function (char) {\n return char\n .charCodeAt(0)\n .toString(16)\n .padStart(2, '0');\n })\n .join('');\n}\nexport function urlSafeDecode(hex) {\n return hex\n .match(/.{2}/g)\n .map(function (char) { return String.fromCharCode(parseInt(char, 16)); })\n .join('');\n}\n//# sourceMappingURL=StringUtils.js.map","/*\n * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n * the License. A copy of the License is located at\n *\n * http://aws.amazon.com/apache2.0/\n *\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\nexport var setState = function (state) {\n window.sessionStorage.setItem('oauth_state', state);\n};\nexport var getState = function () {\n var oauth_state = window.sessionStorage.getItem('oauth_state');\n window.sessionStorage.removeItem('oauth_state');\n return oauth_state;\n};\nexport var setPKCE = function (private_key) {\n window.sessionStorage.setItem('ouath_pkce_key', private_key);\n};\nexport var getPKCE = function () {\n var ouath_pkce_key = window.sessionStorage.getItem('ouath_pkce_key');\n window.sessionStorage.removeItem('ouath_pkce_key');\n return ouath_pkce_key;\n};\nexport var clearAll = function () {\n window.sessionStorage.removeItem('ouath_pkce_key');\n window.sessionStorage.removeItem('oauth_state');\n};\n//# sourceMappingURL=oauthStorage.js.map","/*\n * Copyright 2019-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n * the License. A copy of the License is located at\n *\n * http://aws.amazon.com/apache2.0/\n *\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { ConsoleLogger as Logger } from '@aws-amplify/core';\nimport { AuthErrorStrings } from './common/AuthErrorStrings';\nvar logger = new Logger('AuthError');\nvar AuthError = /** @class */ (function (_super) {\n __extends(AuthError, _super);\n function AuthError(type) {\n var _this = this;\n var _a = authErrorMessages[type], message = _a.message, log = _a.log;\n _this = _super.call(this, message) || this;\n // Hack for making the custom error class work when transpiled to es5\n // TODO: Delete the following 2 lines after we change the build target to >= es2015\n _this.constructor = AuthError;\n Object.setPrototypeOf(_this, AuthError.prototype);\n _this.name = 'AuthError';\n _this.log = log || message;\n logger.error(_this.log);\n return _this;\n }\n return AuthError;\n}(Error));\nexport { AuthError };\nvar NoUserPoolError = /** @class */ (function (_super) {\n __extends(NoUserPoolError, _super);\n function NoUserPoolError(type) {\n var _this = _super.call(this, type) || this;\n // Hack for making the custom error class work when transpiled to es5\n // TODO: Delete the following 2 lines after we change the build target to >= es2015\n _this.constructor = NoUserPoolError;\n Object.setPrototypeOf(_this, NoUserPoolError.prototype);\n _this.name = 'NoUserPoolError';\n return _this;\n }\n return NoUserPoolError;\n}(AuthError));\nexport { NoUserPoolError };\nexport var authErrorMessages = {\n noConfig: {\n message: AuthErrorStrings.DEFAULT_MSG,\n log: \"\\n Error: Amplify has not been configured correctly.\\n This error is typically caused by one of the following scenarios:\\n\\n 1. Make sure you're passing the awsconfig object to Amplify.configure() in your app's entry point\\n See https://aws-amplify.github.io/docs/js/authentication#configure-your-app for more information\\n \\n 2. There might be multiple conflicting versions of amplify packages in your node_modules.\\n\\t\\t\\t\\tRefer to our docs site for help upgrading Amplify packages (https://docs.amplify.aws/lib/troubleshooting/upgrading/q/platform/js)\\n \",\n },\n missingAuthConfig: {\n message: AuthErrorStrings.DEFAULT_MSG,\n log: \"\\n Error: Amplify has not been configured correctly. \\n The configuration object is missing required auth properties.\\n This error is typically caused by one of the following scenarios:\\n\\n 1. Did you run `amplify push` after adding auth via `amplify add auth`?\\n See https://aws-amplify.github.io/docs/js/authentication#amplify-project-setup for more information\\n\\n 2. This could also be caused by multiple conflicting versions of amplify packages, see (https://docs.amplify.aws/lib/troubleshooting/upgrading/q/platform/js) for help upgrading Amplify packages.\\n \",\n },\n emptyUsername: {\n message: AuthErrorStrings.EMPTY_USERNAME,\n },\n // TODO: should include a list of valid sign-in types\n invalidUsername: {\n message: AuthErrorStrings.INVALID_USERNAME,\n },\n emptyPassword: {\n message: AuthErrorStrings.EMPTY_PASSWORD,\n },\n emptyCode: {\n message: AuthErrorStrings.EMPTY_CODE,\n },\n signUpError: {\n message: AuthErrorStrings.SIGN_UP_ERROR,\n log: 'The first parameter should either be non-null string or object',\n },\n noMFA: {\n message: AuthErrorStrings.NO_MFA,\n },\n invalidMFA: {\n message: AuthErrorStrings.INVALID_MFA,\n },\n emptyChallengeResponse: {\n message: AuthErrorStrings.EMPTY_CHALLENGE,\n },\n noUserSession: {\n message: AuthErrorStrings.NO_USER_SESSION,\n },\n default: {\n message: AuthErrorStrings.DEFAULT_MSG,\n },\n};\n//# sourceMappingURL=Errors.js.map","/*\n * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n * the License. A copy of the License is located at\n *\n *\t http://aws.amazon.com/apache2.0/\n *\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nimport { isUsernamePasswordOpts, isCognitoHostedOpts, isFederatedSignInOptions, isFederatedSignInOptionsCustom, hasCustomState, } from './types';\nimport { Amplify, ConsoleLogger as Logger, Credentials, Hub, StorageHelper, Parser, JS, UniversalStorage, urlSafeDecode, } from '@aws-amplify/core';\nimport { CookieStorage, CognitoUserPool, AuthenticationDetails, CognitoUser, CognitoUserSession, CognitoUserAttribute, CognitoIdToken, CognitoRefreshToken, CognitoAccessToken, } from 'amazon-cognito-identity-js';\nimport { parse } from 'url';\nimport OAuth from './OAuth/OAuth';\nimport { default as urlListener } from './urlListener';\nimport { AuthError, NoUserPoolError } from './Errors';\nimport { AuthErrorTypes, CognitoHostedUIIdentityProvider } from './types/Auth';\nvar logger = new Logger('AuthClass');\nvar USER_ADMIN_SCOPE = 'aws.cognito.signin.user.admin';\n// 10 sec, following this guide https://www.nngroup.com/articles/response-times-3-important-limits/\nvar OAUTH_FLOW_MS_TIMEOUT = 10 * 1000;\nvar AMPLIFY_SYMBOL = (typeof Symbol !== 'undefined' &&\n typeof Symbol.for === 'function'\n ? Symbol.for('amplify_default')\n : '@@amplify_default');\nvar dispatchAuthEvent = function (event, data, message) {\n Hub.dispatch('auth', { event: event, data: data, message: message }, 'Auth', AMPLIFY_SYMBOL);\n};\n/**\n * Provide authentication steps\n */\nvar AuthClass = /** @class */ (function () {\n /**\n * Initialize Auth with AWS configurations\n * @param {Object} config - Configuration of the Auth\n */\n function AuthClass(config) {\n var _this = this;\n this.userPool = null;\n this.user = null;\n this.oAuthFlowInProgress = false;\n this.Credentials = Credentials;\n this.wrapRefreshSessionCallback = function (callback) {\n var wrapped = function (error, data) {\n if (data) {\n dispatchAuthEvent('tokenRefresh', undefined, \"New token retrieved\");\n }\n else {\n dispatchAuthEvent('tokenRefresh_failure', error, \"Failed to retrieve new token\");\n }\n return callback(error, data);\n };\n return wrapped;\n }; // prettier-ignore\n this.configure(config);\n this.currentCredentials = this.currentCredentials.bind(this);\n this.currentUserCredentials = this.currentUserCredentials.bind(this);\n Hub.listen('auth', function (_a) {\n var payload = _a.payload;\n var event = payload.event;\n switch (event) {\n case 'signIn':\n _this._storage.setItem('amplify-signin-with-hostedUI', 'false');\n break;\n case 'signOut':\n _this._storage.removeItem('amplify-signin-with-hostedUI');\n break;\n case 'cognitoHostedUI':\n _this._storage.setItem('amplify-signin-with-hostedUI', 'true');\n break;\n }\n });\n }\n AuthClass.prototype.getModuleName = function () {\n return 'Auth';\n };\n AuthClass.prototype.configure = function (config) {\n var _this = this;\n if (!config)\n return this._config || {};\n logger.debug('configure Auth');\n var conf = Object.assign({}, this._config, Parser.parseMobilehubConfig(config).Auth, config);\n this._config = conf;\n var _a = this._config, userPoolId = _a.userPoolId, userPoolWebClientId = _a.userPoolWebClientId, cookieStorage = _a.cookieStorage, oauth = _a.oauth, region = _a.region, identityPoolId = _a.identityPoolId, mandatorySignIn = _a.mandatorySignIn, refreshHandlers = _a.refreshHandlers, identityPoolRegion = _a.identityPoolRegion, clientMetadata = _a.clientMetadata, endpoint = _a.endpoint;\n if (!this._config.storage) {\n // backward compatability\n if (cookieStorage)\n this._storage = new CookieStorage(cookieStorage);\n else {\n this._storage = config.ssr\n ? new UniversalStorage()\n : new StorageHelper().getStorage();\n }\n }\n else {\n if (!this._isValidAuthStorage(this._config.storage)) {\n logger.error('The storage in the Auth config is not valid!');\n throw new Error('Empty storage object');\n }\n this._storage = this._config.storage;\n }\n this._storageSync = Promise.resolve();\n if (typeof this._storage['sync'] === 'function') {\n this._storageSync = this._storage['sync']();\n }\n if (userPoolId) {\n var userPoolData = {\n UserPoolId: userPoolId,\n ClientId: userPoolWebClientId,\n endpoint: endpoint,\n };\n userPoolData.Storage = this._storage;\n this.userPool = new CognitoUserPool(userPoolData, this.wrapRefreshSessionCallback);\n }\n this.Credentials.configure({\n mandatorySignIn: mandatorySignIn,\n region: identityPoolRegion || region,\n userPoolId: userPoolId,\n identityPoolId: identityPoolId,\n refreshHandlers: refreshHandlers,\n storage: this._storage,\n });\n // initialize cognitoauth client if hosted ui options provided\n // to keep backward compatibility:\n var cognitoHostedUIConfig = oauth\n ? isCognitoHostedOpts(this._config.oauth)\n ? oauth\n : oauth.awsCognito\n : undefined;\n if (cognitoHostedUIConfig) {\n var cognitoAuthParams = Object.assign({\n cognitoClientId: userPoolWebClientId,\n UserPoolId: userPoolId,\n domain: cognitoHostedUIConfig['domain'],\n scopes: cognitoHostedUIConfig['scope'],\n redirectSignIn: cognitoHostedUIConfig['redirectSignIn'],\n redirectSignOut: cognitoHostedUIConfig['redirectSignOut'],\n responseType: cognitoHostedUIConfig['responseType'],\n Storage: this._storage,\n urlOpener: cognitoHostedUIConfig['urlOpener'],\n clientMetadata: clientMetadata,\n }, cognitoHostedUIConfig['options']);\n this._oAuthHandler = new OAuth({\n scopes: cognitoAuthParams.scopes,\n config: cognitoAuthParams,\n cognitoClientId: cognitoAuthParams.cognitoClientId,\n });\n // **NOTE** - Remove this in a future major release as it is a breaking change\n // Prevents _handleAuthResponse from being called multiple times in Expo\n // See https://github.com/aws-amplify/amplify-js/issues/4388\n var usedResponseUrls_1 = {};\n urlListener(function (_a) {\n var url = _a.url;\n if (usedResponseUrls_1[url]) {\n return;\n }\n usedResponseUrls_1[url] = true;\n _this._handleAuthResponse(url);\n });\n }\n dispatchAuthEvent('configured', null, \"The Auth category has been configured successfully\");\n return this._config;\n };\n /**\n * Sign up with username, password and other attributes like phone, email\n * @param {String | object} params - The user attributes used for signin\n * @param {String[]} restOfAttrs - for the backward compatability\n * @return - A promise resolves callback data if success\n */\n AuthClass.prototype.signUp = function (params) {\n var _this = this;\n var restOfAttrs = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n restOfAttrs[_i - 1] = arguments[_i];\n }\n if (!this.userPool) {\n return this.rejectNoUserPool();\n }\n var username = null;\n var password = null;\n var attributes = [];\n var validationData = null;\n var clientMetadata;\n if (params && typeof params === 'string') {\n username = params;\n password = restOfAttrs ? restOfAttrs[0] : null;\n var email = restOfAttrs ? restOfAttrs[1] : null;\n var phone_number = restOfAttrs ? restOfAttrs[2] : null;\n if (email)\n attributes.push(new CognitoUserAttribute({ Name: 'email', Value: email }));\n if (phone_number)\n attributes.push(new CognitoUserAttribute({\n Name: 'phone_number',\n Value: phone_number,\n }));\n }\n else if (params && typeof params === 'object') {\n username = params['username'];\n password = params['password'];\n if (params && params.clientMetadata) {\n clientMetadata = params.clientMetadata;\n }\n else if (this._config.clientMetadata) {\n clientMetadata = this._config.clientMetadata;\n }\n var attrs_1 = params['attributes'];\n if (attrs_1) {\n Object.keys(attrs_1).map(function (key) {\n attributes.push(new CognitoUserAttribute({ Name: key, Value: attrs_1[key] }));\n });\n }\n var validationDataObject_1 = params['validationData'];\n if (validationDataObject_1) {\n validationData = [];\n Object.keys(validationDataObject_1).map(function (key) {\n validationData.push(new CognitoUserAttribute({\n Name: key,\n Value: validationDataObject_1[key],\n }));\n });\n }\n }\n else {\n return this.rejectAuthError(AuthErrorTypes.SignUpError);\n }\n if (!username) {\n return this.rejectAuthError(AuthErrorTypes.EmptyUsername);\n }\n if (!password) {\n return this.rejectAuthError(AuthErrorTypes.EmptyPassword);\n }\n logger.debug('signUp attrs:', attributes);\n logger.debug('signUp validation data:', validationData);\n return new Promise(function (resolve, reject) {\n _this.userPool.signUp(username, password, attributes, validationData, function (err, data) {\n if (err) {\n dispatchAuthEvent('signUp_failure', err, username + \" failed to signup\");\n reject(err);\n }\n else {\n dispatchAuthEvent('signUp', data, username + \" has signed up successfully\");\n resolve(data);\n }\n }, clientMetadata);\n });\n };\n /**\n * Send the verification code to confirm sign up\n * @param {String} username - The username to be confirmed\n * @param {String} code - The verification code\n * @param {ConfirmSignUpOptions} options - other options for confirm signup\n * @return - A promise resolves callback data if success\n */\n AuthClass.prototype.confirmSignUp = function (username, code, options) {\n if (!this.userPool) {\n return this.rejectNoUserPool();\n }\n if (!username) {\n return this.rejectAuthError(AuthErrorTypes.EmptyUsername);\n }\n if (!code) {\n return this.rejectAuthError(AuthErrorTypes.EmptyCode);\n }\n var user = this.createCognitoUser(username);\n var forceAliasCreation = options && typeof options.forceAliasCreation === 'boolean'\n ? options.forceAliasCreation\n : true;\n var clientMetadata;\n if (options && options.clientMetadata) {\n clientMetadata = options.clientMetadata;\n }\n else if (this._config.clientMetadata) {\n clientMetadata = this._config.clientMetadata;\n }\n return new Promise(function (resolve, reject) {\n user.confirmRegistration(code, forceAliasCreation, function (err, data) {\n if (err) {\n reject(err);\n }\n else {\n resolve(data);\n }\n }, clientMetadata);\n });\n };\n /**\n * Resend the verification code\n * @param {String} username - The username to be confirmed\n * @param {ClientMetadata} clientMetadata - Metadata to be passed to Cognito Lambda triggers\n * @return - A promise resolves code delivery details if successful\n */\n AuthClass.prototype.resendSignUp = function (username, clientMetadata) {\n if (clientMetadata === void 0) { clientMetadata = this._config.clientMetadata; }\n if (!this.userPool) {\n return this.rejectNoUserPool();\n }\n if (!username) {\n return this.rejectAuthError(AuthErrorTypes.EmptyUsername);\n }\n var user = this.createCognitoUser(username);\n return new Promise(function (resolve, reject) {\n user.resendConfirmationCode(function (err, data) {\n if (err) {\n reject(err);\n }\n else {\n resolve(data);\n }\n }, clientMetadata);\n });\n };\n /**\n * Sign in\n * @param {String | SignInOpts} usernameOrSignInOpts - The username to be signed in or the sign in options\n * @param {String} password - The password of the username\n * @return - A promise resolves the CognitoUser\n */\n AuthClass.prototype.signIn = function (usernameOrSignInOpts, pw, clientMetadata) {\n if (clientMetadata === void 0) { clientMetadata = this._config.clientMetadata; }\n if (!this.userPool) {\n return this.rejectNoUserPool();\n }\n var username = null;\n var password = null;\n var validationData = {};\n // for backward compatibility\n if (typeof usernameOrSignInOpts === 'string') {\n username = usernameOrSignInOpts;\n password = pw;\n }\n else if (isUsernamePasswordOpts(usernameOrSignInOpts)) {\n if (typeof pw !== 'undefined') {\n logger.warn('The password should be defined under the first parameter object!');\n }\n username = usernameOrSignInOpts.username;\n password = usernameOrSignInOpts.password;\n validationData = usernameOrSignInOpts.validationData;\n }\n else {\n return this.rejectAuthError(AuthErrorTypes.InvalidUsername);\n }\n if (!username) {\n return this.rejectAuthError(AuthErrorTypes.EmptyUsername);\n }\n var authDetails = new AuthenticationDetails({\n Username: username,\n Password: password,\n ValidationData: validationData,\n ClientMetadata: clientMetadata,\n });\n if (password) {\n return this.signInWithPassword(authDetails);\n }\n else {\n return this.signInWithoutPassword(authDetails);\n }\n };\n /**\n * Return an object with the authentication callbacks\n * @param {CognitoUser} user - the cognito user object\n * @param {} resolve - function called when resolving the current step\n * @param {} reject - function called when rejecting the current step\n * @return - an object with the callback methods for user authentication\n */\n AuthClass.prototype.authCallbacks = function (user, resolve, reject) {\n var _this = this;\n var that = this;\n return {\n onSuccess: function (session) { return __awaiter(_this, void 0, void 0, function () {\n var cred, e_1, currentUser, e_2;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n logger.debug(session);\n delete user['challengeName'];\n delete user['challengeParam'];\n _a.label = 1;\n case 1:\n _a.trys.push([1, 4, 5, 9]);\n return [4 /*yield*/, this.Credentials.clear()];\n case 2:\n _a.sent();\n return [4 /*yield*/, this.Credentials.set(session, 'session')];\n case 3:\n cred = _a.sent();\n logger.debug('succeed to get cognito credentials', cred);\n return [3 /*break*/, 9];\n case 4:\n e_1 = _a.sent();\n logger.debug('cannot get cognito credentials', e_1);\n return [3 /*break*/, 9];\n case 5:\n _a.trys.push([5, 7, , 8]);\n return [4 /*yield*/, this.currentUserPoolUser()];\n case 6:\n currentUser = _a.sent();\n that.user = currentUser;\n dispatchAuthEvent('signIn', currentUser, \"A user \" + user.getUsername() + \" has been signed in\");\n resolve(currentUser);\n return [3 /*break*/, 8];\n case 7:\n e_2 = _a.sent();\n logger.error('Failed to get the signed in user', e_2);\n reject(e_2);\n return [3 /*break*/, 8];\n case 8: return [7 /*endfinally*/];\n case 9: return [2 /*return*/];\n }\n });\n }); },\n onFailure: function (err) {\n logger.debug('signIn failure', err);\n dispatchAuthEvent('signIn_failure', err, user.getUsername() + \" failed to signin\");\n reject(err);\n },\n customChallenge: function (challengeParam) {\n logger.debug('signIn custom challenge answer required');\n user['challengeName'] = 'CUSTOM_CHALLENGE';\n user['challengeParam'] = challengeParam;\n resolve(user);\n },\n mfaRequired: function (challengeName, challengeParam) {\n logger.debug('signIn MFA required');\n user['challengeName'] = challengeName;\n user['challengeParam'] = challengeParam;\n resolve(user);\n },\n mfaSetup: function (challengeName, challengeParam) {\n logger.debug('signIn mfa setup', challengeName);\n user['challengeName'] = challengeName;\n user['challengeParam'] = challengeParam;\n resolve(user);\n },\n newPasswordRequired: function (userAttributes, requiredAttributes) {\n logger.debug('signIn new password');\n user['challengeName'] = 'NEW_PASSWORD_REQUIRED';\n user['challengeParam'] = {\n userAttributes: userAttributes,\n requiredAttributes: requiredAttributes,\n };\n resolve(user);\n },\n totpRequired: function (challengeName, challengeParam) {\n logger.debug('signIn totpRequired');\n user['challengeName'] = challengeName;\n user['challengeParam'] = challengeParam;\n resolve(user);\n },\n selectMFAType: function (challengeName, challengeParam) {\n logger.debug('signIn selectMFAType', challengeName);\n user['challengeName'] = challengeName;\n user['challengeParam'] = challengeParam;\n resolve(user);\n },\n };\n };\n /**\n * Sign in with a password\n * @private\n * @param {AuthenticationDetails} authDetails - the user sign in data\n * @return - A promise resolves the CognitoUser object if success or mfa required\n */\n AuthClass.prototype.signInWithPassword = function (authDetails) {\n var _this = this;\n if (this.pendingSignIn) {\n throw new Error('Pending sign-in attempt already in progress');\n }\n var user = this.createCognitoUser(authDetails.getUsername());\n this.pendingSignIn = new Promise(function (resolve, reject) {\n user.authenticateUser(authDetails, _this.authCallbacks(user, function (value) {\n _this.pendingSignIn = null;\n resolve(value);\n }, function (error) {\n _this.pendingSignIn = null;\n reject(error);\n }));\n });\n return this.pendingSignIn;\n };\n /**\n * Sign in without a password\n * @private\n * @param {AuthenticationDetails} authDetails - the user sign in data\n * @return - A promise resolves the CognitoUser object if success or mfa required\n */\n AuthClass.prototype.signInWithoutPassword = function (authDetails) {\n var _this = this;\n var user = this.createCognitoUser(authDetails.getUsername());\n user.setAuthenticationFlowType('CUSTOM_AUTH');\n return new Promise(function (resolve, reject) {\n user.initiateAuth(authDetails, _this.authCallbacks(user, resolve, reject));\n });\n };\n /**\n * This was previously used by an authenticated user to get MFAOptions,\n * but no longer returns a meaningful response. Refer to the documentation for\n * how to setup and use MFA: https://docs.amplify.aws/lib/auth/mfa/q/platform/js\n * @deprecated\n * @param {CognitoUser} user - the current user\n * @return - A promise resolves the current preferred mfa option if success\n */\n AuthClass.prototype.getMFAOptions = function (user) {\n return new Promise(function (res, rej) {\n user.getMFAOptions(function (err, mfaOptions) {\n if (err) {\n logger.debug('get MFA Options failed', err);\n rej(err);\n return;\n }\n logger.debug('get MFA options success', mfaOptions);\n res(mfaOptions);\n return;\n });\n });\n };\n /**\n * get preferred mfa method\n * @param {CognitoUser} user - the current cognito user\n * @param {GetPreferredMFAOpts} params - options for getting the current user preferred MFA\n */\n AuthClass.prototype.getPreferredMFA = function (user, params) {\n var _this = this;\n var that = this;\n return new Promise(function (res, rej) {\n var clientMetadata = _this._config.clientMetadata; // TODO: verify behavior if this is override during signIn\n var bypassCache = params ? params.bypassCache : false;\n user.getUserData(function (err, data) {\n if (err) {\n logger.debug('getting preferred mfa failed', err);\n rej(err);\n return;\n }\n var mfaType = that._getMfaTypeFromUserData(data);\n if (!mfaType) {\n rej('invalid MFA Type');\n return;\n }\n else {\n res(mfaType);\n return;\n }\n }, { bypassCache: bypassCache, clientMetadata: clientMetadata });\n });\n };\n AuthClass.prototype._getMfaTypeFromUserData = function (data) {\n var ret = null;\n var preferredMFA = data.PreferredMfaSetting;\n // if the user has used Auth.setPreferredMFA() to setup the mfa type\n // then the \"PreferredMfaSetting\" would exist in the response\n if (preferredMFA) {\n ret = preferredMFA;\n }\n else {\n // if mfaList exists but empty, then its noMFA\n var mfaList = data.UserMFASettingList;\n if (!mfaList) {\n // if SMS was enabled by using Auth.enableSMS(),\n // the response would contain MFAOptions\n // as for now Cognito only supports for SMS, so we will say it is 'SMS_MFA'\n // if it does not exist, then it should be NOMFA\n var MFAOptions = data.MFAOptions;\n if (MFAOptions) {\n ret = 'SMS_MFA';\n }\n else {\n ret = 'NOMFA';\n }\n }\n else if (mfaList.length === 0) {\n ret = 'NOMFA';\n }\n else {\n logger.debug('invalid case for getPreferredMFA', data);\n }\n }\n return ret;\n };\n AuthClass.prototype._getUserData = function (user, params) {\n return new Promise(function (res, rej) {\n user.getUserData(function (err, data) {\n if (err) {\n logger.debug('getting user data failed', err);\n rej(err);\n return;\n }\n else {\n res(data);\n return;\n }\n }, params);\n });\n };\n /**\n * set preferred MFA method\n * @param {CognitoUser} user - the current Cognito user\n * @param {string} mfaMethod - preferred mfa method\n * @return - A promise resolve if success\n */\n AuthClass.prototype.setPreferredMFA = function (user, mfaMethod) {\n return __awaiter(this, void 0, void 0, function () {\n var clientMetadata, userData, smsMfaSettings, totpMfaSettings, _a, mfaList, currentMFAType, that;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n clientMetadata = this._config.clientMetadata;\n return [4 /*yield*/, this._getUserData(user, {\n bypassCache: true,\n clientMetadata: clientMetadata,\n })];\n case 1:\n userData = _b.sent();\n smsMfaSettings = null;\n totpMfaSettings = null;\n _a = mfaMethod;\n switch (_a) {\n case 'TOTP' || 'SOFTWARE_TOKEN_MFA': return [3 /*break*/, 2];\n case 'SMS' || 'SMS_MFA': return [3 /*break*/, 3];\n case 'NOMFA': return [3 /*break*/, 4];\n }\n return [3 /*break*/, 6];\n case 2:\n totpMfaSettings = {\n PreferredMfa: true,\n Enabled: true,\n };\n return [3 /*break*/, 7];\n case 3:\n smsMfaSettings = {\n PreferredMfa: true,\n Enabled: true,\n };\n return [3 /*break*/, 7];\n case 4:\n mfaList = userData['UserMFASettingList'];\n return [4 /*yield*/, this._getMfaTypeFromUserData(userData)];\n case 5:\n currentMFAType = _b.sent();\n if (currentMFAType === 'NOMFA') {\n return [2 /*return*/, Promise.resolve('No change for mfa type')];\n }\n else if (currentMFAType === 'SMS_MFA') {\n smsMfaSettings = {\n PreferredMfa: false,\n Enabled: false,\n };\n }\n else if (currentMFAType === 'SOFTWARE_TOKEN_MFA') {\n totpMfaSettings = {\n PreferredMfa: false,\n Enabled: false,\n };\n }\n else {\n return [2 /*return*/, this.rejectAuthError(AuthErrorTypes.InvalidMFA)];\n }\n // if there is a UserMFASettingList in the response\n // we need to disable every mfa type in that list\n if (mfaList && mfaList.length !== 0) {\n // to disable SMS or TOTP if exists in that list\n mfaList.forEach(function (mfaType) {\n if (mfaType === 'SMS_MFA') {\n smsMfaSettings = {\n PreferredMfa: false,\n Enabled: false,\n };\n }\n else if (mfaType === 'SOFTWARE_TOKEN_MFA') {\n totpMfaSettings = {\n PreferredMfa: false,\n Enabled: false,\n };\n }\n });\n }\n return [3 /*break*/, 7];\n case 6:\n logger.debug('no validmfa method provided');\n return [2 /*return*/, this.rejectAuthError(AuthErrorTypes.NoMFA)];\n case 7:\n that = this;\n return [2 /*return*/, new Promise(function (res, rej) {\n user.setUserMfaPreference(smsMfaSettings, totpMfaSettings, function (err, result) {\n if (err) {\n logger.debug('Set user mfa preference error', err);\n return rej(err);\n }\n logger.debug('Set user mfa success', result);\n logger.debug('Caching the latest user data into local');\n // cache the latest result into user data\n user.getUserData(function (err, data) {\n if (err) {\n logger.debug('getting user data failed', err);\n return rej(err);\n }\n else {\n return res(result);\n }\n }, {\n bypassCache: true,\n clientMetadata: clientMetadata,\n });\n });\n })];\n }\n });\n });\n };\n /**\n * diable SMS\n * @deprecated\n * @param {CognitoUser} user - the current user\n * @return - A promise resolves is success\n */\n AuthClass.prototype.disableSMS = function (user) {\n return new Promise(function (res, rej) {\n user.disableMFA(function (err, data) {\n if (err) {\n logger.debug('disable mfa failed', err);\n rej(err);\n return;\n }\n logger.debug('disable mfa succeed', data);\n res(data);\n return;\n });\n });\n };\n /**\n * enable SMS\n * @deprecated\n * @param {CognitoUser} user - the current user\n * @return - A promise resolves is success\n */\n AuthClass.prototype.enableSMS = function (user) {\n return new Promise(function (res, rej) {\n user.enableMFA(function (err, data) {\n if (err) {\n logger.debug('enable mfa failed', err);\n rej(err);\n return;\n }\n logger.debug('enable mfa succeed', data);\n res(data);\n return;\n });\n });\n };\n /**\n * Setup TOTP\n * @param {CognitoUser} user - the current user\n * @return - A promise resolves with the secret code if success\n */\n AuthClass.prototype.setupTOTP = function (user) {\n return new Promise(function (res, rej) {\n user.associateSoftwareToken({\n onFailure: function (err) {\n logger.debug('associateSoftwareToken failed', err);\n rej(err);\n return;\n },\n associateSecretCode: function (secretCode) {\n logger.debug('associateSoftwareToken sucess', secretCode);\n res(secretCode);\n return;\n },\n });\n });\n };\n /**\n * verify TOTP setup\n * @param {CognitoUser} user - the current user\n * @param {string} challengeAnswer - challenge answer\n * @return - A promise resolves is success\n */\n AuthClass.prototype.verifyTotpToken = function (user, challengeAnswer) {\n logger.debug('verification totp token', user, challengeAnswer);\n return new Promise(function (res, rej) {\n user.verifySoftwareToken(challengeAnswer, 'My TOTP device', {\n onFailure: function (err) {\n logger.debug('verifyTotpToken failed', err);\n rej(err);\n return;\n },\n onSuccess: function (data) {\n dispatchAuthEvent('signIn', user, \"A user \" + user.getUsername() + \" has been signed in\");\n logger.debug('verifyTotpToken success', data);\n res(data);\n return;\n },\n });\n });\n };\n /**\n * Send MFA code to confirm sign in\n * @param {Object} user - The CognitoUser object\n * @param {String} code - The confirmation code\n */\n AuthClass.prototype.confirmSignIn = function (user, code, mfaType, clientMetadata) {\n var _this = this;\n if (clientMetadata === void 0) { clientMetadata = this._config.clientMetadata; }\n if (!code) {\n return this.rejectAuthError(AuthErrorTypes.EmptyCode);\n }\n var that = this;\n return new Promise(function (resolve, reject) {\n user.sendMFACode(code, {\n onSuccess: function (session) { return __awaiter(_this, void 0, void 0, function () {\n var cred, e_3;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n logger.debug(session);\n _a.label = 1;\n case 1:\n _a.trys.push([1, 4, 5, 6]);\n return [4 /*yield*/, this.Credentials.clear()];\n case 2:\n _a.sent();\n return [4 /*yield*/, this.Credentials.set(session, 'session')];\n case 3:\n cred = _a.sent();\n logger.debug('succeed to get cognito credentials', cred);\n return [3 /*break*/, 6];\n case 4:\n e_3 = _a.sent();\n logger.debug('cannot get cognito credentials', e_3);\n return [3 /*break*/, 6];\n case 5:\n that.user = user;\n dispatchAuthEvent('signIn', user, \"A user \" + user.getUsername() + \" has been signed in\");\n resolve(user);\n return [7 /*endfinally*/];\n case 6: return [2 /*return*/];\n }\n });\n }); },\n onFailure: function (err) {\n logger.debug('confirm signIn failure', err);\n reject(err);\n },\n }, mfaType, clientMetadata);\n });\n };\n AuthClass.prototype.completeNewPassword = function (user, password, requiredAttributes, clientMetadata) {\n var _this = this;\n if (requiredAttributes === void 0) { requiredAttributes = {}; }\n if (clientMetadata === void 0) { clientMetadata = this._config.clientMetadata; }\n if (!password) {\n return this.rejectAuthError(AuthErrorTypes.EmptyPassword);\n }\n var that = this;\n return new Promise(function (resolve, reject) {\n user.completeNewPasswordChallenge(password, requiredAttributes, {\n onSuccess: function (session) { return __awaiter(_this, void 0, void 0, function () {\n var cred, e_4;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n logger.debug(session);\n _a.label = 1;\n case 1:\n _a.trys.push([1, 4, 5, 6]);\n return [4 /*yield*/, this.Credentials.clear()];\n case 2:\n _a.sent();\n return [4 /*yield*/, this.Credentials.set(session, 'session')];\n case 3:\n cred = _a.sent();\n logger.debug('succeed to get cognito credentials', cred);\n return [3 /*break*/, 6];\n case 4:\n e_4 = _a.sent();\n logger.debug('cannot get cognito credentials', e_4);\n return [3 /*break*/, 6];\n case 5:\n that.user = user;\n dispatchAuthEvent('signIn', user, \"A user \" + user.getUsername() + \" has been signed in\");\n resolve(user);\n return [7 /*endfinally*/];\n case 6: return [2 /*return*/];\n }\n });\n }); },\n onFailure: function (err) {\n logger.debug('completeNewPassword failure', err);\n dispatchAuthEvent('completeNewPassword_failure', err, _this.user + \" failed to complete the new password flow\");\n reject(err);\n },\n mfaRequired: function (challengeName, challengeParam) {\n logger.debug('signIn MFA required');\n user['challengeName'] = challengeName;\n user['challengeParam'] = challengeParam;\n resolve(user);\n },\n mfaSetup: function (challengeName, challengeParam) {\n logger.debug('signIn mfa setup', challengeName);\n user['challengeName'] = challengeName;\n user['challengeParam'] = challengeParam;\n resolve(user);\n },\n totpRequired: function (challengeName, challengeParam) {\n logger.debug('signIn mfa setup', challengeName);\n user['challengeName'] = challengeName;\n user['challengeParam'] = challengeParam;\n resolve(user);\n },\n }, clientMetadata);\n });\n };\n /**\n * Send the answer to a custom challenge\n * @param {CognitoUser} user - The CognitoUser object\n * @param {String} challengeResponses - The confirmation code\n */\n AuthClass.prototype.sendCustomChallengeAnswer = function (user, challengeResponses, clientMetadata) {\n var _this = this;\n if (clientMetadata === void 0) { clientMetadata = this._config.clientMetadata; }\n if (!this.userPool) {\n return this.rejectNoUserPool();\n }\n if (!challengeResponses) {\n return this.rejectAuthError(AuthErrorTypes.EmptyChallengeResponse);\n }\n var that = this;\n return new Promise(function (resolve, reject) {\n user.sendCustomChallengeAnswer(challengeResponses, _this.authCallbacks(user, resolve, reject), clientMetadata);\n });\n };\n /**\n * Update an authenticated users' attributes\n * @param {CognitoUser} - The currently logged in user object\n * @return {Promise}\n **/\n AuthClass.prototype.updateUserAttributes = function (user, attributes, clientMetadata) {\n if (clientMetadata === void 0) { clientMetadata = this._config.clientMetadata; }\n var attributeList = [];\n var that = this;\n return new Promise(function (resolve, reject) {\n that.userSession(user).then(function (session) {\n for (var key in attributes) {\n if (key !== 'sub' && key.indexOf('_verified') < 0) {\n var attr = {\n Name: key,\n Value: attributes[key],\n };\n attributeList.push(attr);\n }\n }\n user.updateAttributes(attributeList, function (err, result) {\n if (err) {\n return reject(err);\n }\n else {\n return resolve(result);\n }\n }, clientMetadata);\n });\n });\n };\n /**\n * Return user attributes\n * @param {Object} user - The CognitoUser object\n * @return - A promise resolves to user attributes if success\n */\n AuthClass.prototype.userAttributes = function (user) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n _this.userSession(user).then(function (session) {\n user.getUserAttributes(function (err, attributes) {\n if (err) {\n reject(err);\n }\n else {\n resolve(attributes);\n }\n });\n });\n });\n };\n AuthClass.prototype.verifiedContact = function (user) {\n var that = this;\n return this.userAttributes(user).then(function (attributes) {\n var attrs = that.attributesToObject(attributes);\n var unverified = {};\n var verified = {};\n if (attrs['email']) {\n if (attrs['email_verified']) {\n verified['email'] = attrs['email'];\n }\n else {\n unverified['email'] = attrs['email'];\n }\n }\n if (attrs['phone_number']) {\n if (attrs['phone_number_verified']) {\n verified['phone_number'] = attrs['phone_number'];\n }\n else {\n unverified['phone_number'] = attrs['phone_number'];\n }\n }\n return {\n verified: verified,\n unverified: unverified,\n };\n });\n };\n /**\n * Get current authenticated user\n * @return - A promise resolves to current authenticated CognitoUser if success\n */\n AuthClass.prototype.currentUserPoolUser = function (params) {\n var _this = this;\n if (!this.userPool) {\n return this.rejectNoUserPool();\n }\n return new Promise(function (res, rej) {\n _this._storageSync\n .then(function () { return __awaiter(_this, void 0, void 0, function () {\n var user, clientMetadata;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!this.isOAuthInProgress()) return [3 /*break*/, 2];\n logger.debug('OAuth signIn in progress, waiting for resolution...');\n return [4 /*yield*/, new Promise(function (res) {\n var timeoutId = setTimeout(function () {\n logger.debug('OAuth signIn in progress timeout');\n Hub.remove('auth', hostedUISignCallback);\n res();\n }, OAUTH_FLOW_MS_TIMEOUT);\n Hub.listen('auth', hostedUISignCallback);\n function hostedUISignCallback(_a) {\n var payload = _a.payload;\n var event = payload.event;\n if (event === 'cognitoHostedUI' ||\n event === 'cognitoHostedUI_failure') {\n logger.debug(\"OAuth signIn resolved: \" + event);\n clearTimeout(timeoutId);\n Hub.remove('auth', hostedUISignCallback);\n res();\n }\n }\n })];\n case 1:\n _a.sent();\n _a.label = 2;\n case 2:\n user = this.userPool.getCurrentUser();\n if (!user) {\n logger.debug('Failed to get user from user pool');\n rej('No current user');\n return [2 /*return*/];\n }\n clientMetadata = this._config.clientMetadata;\n // refresh the session if the session expired.\n user.getSession(function (err, session) { return __awaiter(_this, void 0, void 0, function () {\n var bypassCache, clientMetadata, _a, scope;\n var _this = this;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n if (err) {\n logger.debug('Failed to get the user session', err);\n rej(err);\n return [2 /*return*/];\n }\n bypassCache = params ? params.bypassCache : false;\n if (!bypassCache) return [3 /*break*/, 2];\n return [4 /*yield*/, this.Credentials.clear()];\n case 1:\n _b.sent();\n _b.label = 2;\n case 2:\n clientMetadata = this._config.clientMetadata;\n _a = session.getAccessToken().decodePayload().scope, scope = _a === void 0 ? '' : _a;\n if (scope.split(' ').includes(USER_ADMIN_SCOPE)) {\n user.getUserData(function (err, data) {\n if (err) {\n logger.debug('getting user data failed', err);\n // Make sure the user is still valid\n if (err.message === 'User is disabled.' ||\n err.message === 'User does not exist.' ||\n err.message === 'Access Token has been revoked' // Session revoked by another app\n ) {\n rej(err);\n }\n else {\n // the error may also be thrown when lack of permissions to get user info etc\n // in that case we just bypass the error\n res(user);\n }\n return;\n }\n var preferredMFA = data.PreferredMfaSetting || 'NOMFA';\n var attributeList = [];\n for (var i = 0; i < data.UserAttributes.length; i++) {\n var attribute = {\n Name: data.UserAttributes[i].Name,\n Value: data.UserAttributes[i].Value,\n };\n var userAttribute = new CognitoUserAttribute(attribute);\n attributeList.push(userAttribute);\n }\n var attributes = _this.attributesToObject(attributeList);\n Object.assign(user, { attributes: attributes, preferredMFA: preferredMFA });\n return res(user);\n }, { bypassCache: bypassCache, clientMetadata: clientMetadata });\n }\n else {\n logger.debug(\"Unable to get the user data because the \" + USER_ADMIN_SCOPE + \" \" +\n \"is not in the scopes of the access token\");\n return [2 /*return*/, res(user)];\n }\n return [2 /*return*/];\n }\n });\n }); }, { clientMetadata: clientMetadata });\n return [2 /*return*/];\n }\n });\n }); })\n .catch(function (e) {\n logger.debug('Failed to sync cache info into memory', e);\n return rej(e);\n });\n });\n };\n AuthClass.prototype.isOAuthInProgress = function () {\n return this.oAuthFlowInProgress;\n };\n /**\n * Get current authenticated user\n * @param {CurrentUserOpts} - options for getting the current user\n * @return - A promise resolves to current authenticated CognitoUser if success\n */\n AuthClass.prototype.currentAuthenticatedUser = function (params) {\n return __awaiter(this, void 0, void 0, function () {\n var federatedUser, e_5, federatedInfo, user, e_6;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n logger.debug('getting current authenticated user');\n federatedUser = null;\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, this._storageSync];\n case 2:\n _a.sent();\n return [3 /*break*/, 4];\n case 3:\n e_5 = _a.sent();\n logger.debug('Failed to sync cache info into memory', e_5);\n throw e_5;\n case 4:\n try {\n federatedInfo = JSON.parse(this._storage.getItem('aws-amplify-federatedInfo'));\n if (federatedInfo) {\n federatedUser = __assign(__assign({}, federatedInfo.user), { token: federatedInfo.token });\n }\n }\n catch (e) {\n logger.debug('cannot load federated user from auth storage');\n }\n if (!federatedUser) return [3 /*break*/, 5];\n this.user = federatedUser;\n logger.debug('get current authenticated federated user', this.user);\n return [2 /*return*/, this.user];\n case 5:\n logger.debug('get current authenticated userpool user');\n user = null;\n _a.label = 6;\n case 6:\n _a.trys.push([6, 8, , 9]);\n return [4 /*yield*/, this.currentUserPoolUser(params)];\n case 7:\n user = _a.sent();\n return [3 /*break*/, 9];\n case 8:\n e_6 = _a.sent();\n if (e_6 === 'No userPool') {\n logger.error('Cannot get the current user because the user pool is missing. ' +\n 'Please make sure the Auth module is configured with a valid Cognito User Pool ID');\n }\n logger.debug('The user is not authenticated by the error', e_6);\n return [2 /*return*/, Promise.reject('The user is not authenticated')];\n case 9:\n this.user = user;\n return [2 /*return*/, this.user];\n }\n });\n });\n };\n /**\n * Get current user's session\n * @return - A promise resolves to session object if success\n */\n AuthClass.prototype.currentSession = function () {\n var that = this;\n logger.debug('Getting current session');\n // Purposely not calling the reject method here because we don't need a console error\n if (!this.userPool) {\n return Promise.reject();\n }\n return new Promise(function (res, rej) {\n that\n .currentUserPoolUser()\n .then(function (user) {\n that\n .userSession(user)\n .then(function (session) {\n res(session);\n return;\n })\n .catch(function (e) {\n logger.debug('Failed to get the current session', e);\n rej(e);\n return;\n });\n })\n .catch(function (e) {\n logger.debug('Failed to get the current user', e);\n rej(e);\n return;\n });\n });\n };\n /**\n * Get the corresponding user session\n * @param {Object} user - The CognitoUser object\n * @return - A promise resolves to the session\n */\n AuthClass.prototype.userSession = function (user) {\n if (!user) {\n logger.debug('the user is null');\n return this.rejectAuthError(AuthErrorTypes.NoUserSession);\n }\n var clientMetadata = this._config.clientMetadata; // TODO: verify behavior if this is override during signIn\n return new Promise(function (resolve, reject) {\n logger.debug('Getting the session from this user:', user);\n user.getSession(function (err, session) {\n if (err) {\n logger.debug('Failed to get the session from user', user);\n reject(err);\n return;\n }\n else {\n logger.debug('Succeed to get the user session', session);\n resolve(session);\n return;\n }\n }, { clientMetadata: clientMetadata });\n });\n };\n /**\n * Get authenticated credentials of current user.\n * @return - A promise resolves to be current user's credentials\n */\n AuthClass.prototype.currentUserCredentials = function () {\n return __awaiter(this, void 0, void 0, function () {\n var e_7, federatedInfo;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n logger.debug('Getting current user credentials');\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, this._storageSync];\n case 2:\n _a.sent();\n return [3 /*break*/, 4];\n case 3:\n e_7 = _a.sent();\n logger.debug('Failed to sync cache info into memory', e_7);\n throw e_7;\n case 4:\n federatedInfo = null;\n try {\n federatedInfo = JSON.parse(this._storage.getItem('aws-amplify-federatedInfo'));\n }\n catch (e) {\n logger.debug('failed to get or parse item aws-amplify-federatedInfo', e);\n }\n if (federatedInfo) {\n // refresh the jwt token here if necessary\n return [2 /*return*/, this.Credentials.refreshFederatedToken(federatedInfo)];\n }\n else {\n return [2 /*return*/, this.currentSession()\n .then(function (session) {\n logger.debug('getting session success', session);\n return _this.Credentials.set(session, 'session');\n })\n .catch(function (error) {\n logger.debug('getting session failed', error);\n return _this.Credentials.set(null, 'guest');\n })];\n }\n return [2 /*return*/];\n }\n });\n });\n };\n AuthClass.prototype.currentCredentials = function () {\n logger.debug('getting current credentials');\n return this.Credentials.get();\n };\n /**\n * Initiate an attribute confirmation request\n * @param {Object} user - The CognitoUser\n * @param {Object} attr - The attributes to be verified\n * @return - A promise resolves to callback data if success\n */\n AuthClass.prototype.verifyUserAttribute = function (user, attr, clientMetadata) {\n if (clientMetadata === void 0) { clientMetadata = this._config.clientMetadata; }\n return new Promise(function (resolve, reject) {\n user.getAttributeVerificationCode(attr, {\n onSuccess: function () {\n return resolve();\n },\n onFailure: function (err) {\n return reject(err);\n },\n }, clientMetadata);\n });\n };\n /**\n * Confirm an attribute using a confirmation code\n * @param {Object} user - The CognitoUser\n * @param {Object} attr - The attribute to be verified\n * @param {String} code - The confirmation code\n * @return - A promise resolves to callback data if success\n */\n AuthClass.prototype.verifyUserAttributeSubmit = function (user, attr, code) {\n if (!code) {\n return this.rejectAuthError(AuthErrorTypes.EmptyCode);\n }\n return new Promise(function (resolve, reject) {\n user.verifyAttribute(attr, code, {\n onSuccess: function (data) {\n resolve(data);\n return;\n },\n onFailure: function (err) {\n reject(err);\n return;\n },\n });\n });\n };\n AuthClass.prototype.verifyCurrentUserAttribute = function (attr) {\n var that = this;\n return that\n .currentUserPoolUser()\n .then(function (user) { return that.verifyUserAttribute(user, attr); });\n };\n /**\n * Confirm current user's attribute using a confirmation code\n * @param {Object} attr - The attribute to be verified\n * @param {String} code - The confirmation code\n * @return - A promise resolves to callback data if success\n */\n AuthClass.prototype.verifyCurrentUserAttributeSubmit = function (attr, code) {\n var that = this;\n return that\n .currentUserPoolUser()\n .then(function (user) { return that.verifyUserAttributeSubmit(user, attr, code); });\n };\n AuthClass.prototype.cognitoIdentitySignOut = function (opts, user) {\n return __awaiter(this, void 0, void 0, function () {\n var e_8, isSignedInHostedUI;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 2, , 3]);\n return [4 /*yield*/, this._storageSync];\n case 1:\n _a.sent();\n return [3 /*break*/, 3];\n case 2:\n e_8 = _a.sent();\n logger.debug('Failed to sync cache info into memory', e_8);\n throw e_8;\n case 3:\n isSignedInHostedUI = this._oAuthHandler &&\n this._storage.getItem('amplify-signin-with-hostedUI') === 'true';\n return [2 /*return*/, new Promise(function (res, rej) {\n if (opts && opts.global) {\n logger.debug('user global sign out', user);\n // in order to use global signout\n // we must validate the user as an authenticated user by using getSession\n var clientMetadata = _this._config.clientMetadata; // TODO: verify behavior if this is override during signIn\n user.getSession(function (err, result) {\n if (err) {\n logger.debug('failed to get the user session', err);\n return rej(err);\n }\n user.globalSignOut({\n onSuccess: function (data) {\n logger.debug('global sign out success');\n if (isSignedInHostedUI) {\n _this.oAuthSignOutRedirect(res, rej);\n }\n else {\n return res();\n }\n },\n onFailure: function (err) {\n logger.debug('global sign out failed', err);\n return rej(err);\n },\n });\n }, { clientMetadata: clientMetadata });\n }\n else {\n logger.debug('user sign out', user);\n user.signOut();\n if (isSignedInHostedUI) {\n _this.oAuthSignOutRedirect(res, rej);\n }\n else {\n return res();\n }\n }\n })];\n }\n });\n });\n };\n AuthClass.prototype.oAuthSignOutRedirect = function (resolve, reject) {\n var isBrowser = JS.browserOrNode().isBrowser;\n if (isBrowser) {\n this.oAuthSignOutRedirectOrReject(reject);\n }\n else {\n this.oAuthSignOutAndResolve(resolve);\n }\n };\n AuthClass.prototype.oAuthSignOutAndResolve = function (resolve) {\n this._oAuthHandler.signOut();\n resolve();\n };\n AuthClass.prototype.oAuthSignOutRedirectOrReject = function (reject) {\n this._oAuthHandler.signOut(); // this method redirects url\n // App should be redirected to another url otherwise it will reject\n setTimeout(function () { return reject('Signout timeout fail'); }, 3000);\n };\n /**\n * Sign out method\n * @\n * @return - A promise resolved if success\n */\n AuthClass.prototype.signOut = function (opts) {\n return __awaiter(this, void 0, void 0, function () {\n var e_9, user;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 2, , 3]);\n return [4 /*yield*/, this.cleanCachedItems()];\n case 1:\n _a.sent();\n return [3 /*break*/, 3];\n case 2:\n e_9 = _a.sent();\n logger.debug('failed to clear cached items');\n return [3 /*break*/, 3];\n case 3:\n if (!this.userPool) return [3 /*break*/, 7];\n user = this.userPool.getCurrentUser();\n if (!user) return [3 /*break*/, 5];\n return [4 /*yield*/, this.cognitoIdentitySignOut(opts, user)];\n case 4:\n _a.sent();\n return [3 /*break*/, 6];\n case 5:\n logger.debug('no current Cognito user');\n _a.label = 6;\n case 6: return [3 /*break*/, 8];\n case 7:\n logger.debug('no Congito User pool');\n _a.label = 8;\n case 8:\n /**\n * Note for future refactor - no reliable way to get username with\n * Cognito User Pools vs Identity when federating with Social Providers\n * This is why we need a well structured session object that can be inspected\n * and information passed back in the message below for Hub dispatch\n */\n dispatchAuthEvent('signOut', this.user, \"A user has been signed out\");\n this.user = null;\n return [2 /*return*/];\n }\n });\n });\n };\n AuthClass.prototype.cleanCachedItems = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: \n // clear cognito cached item\n return [4 /*yield*/, this.Credentials.clear()];\n case 1:\n // clear cognito cached item\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n /**\n * Change a password for an authenticated user\n * @param {Object} user - The CognitoUser object\n * @param {String} oldPassword - the current password\n * @param {String} newPassword - the requested new password\n * @return - A promise resolves if success\n */\n AuthClass.prototype.changePassword = function (user, oldPassword, newPassword, clientMetadata) {\n var _this = this;\n if (clientMetadata === void 0) { clientMetadata = this._config.clientMetadata; }\n return new Promise(function (resolve, reject) {\n _this.userSession(user).then(function (session) {\n user.changePassword(oldPassword, newPassword, function (err, data) {\n if (err) {\n logger.debug('change password failure', err);\n return reject(err);\n }\n else {\n return resolve(data);\n }\n }, clientMetadata);\n });\n });\n };\n /**\n * Initiate a forgot password request\n * @param {String} username - the username to change password\n * @return - A promise resolves if success\n */\n AuthClass.prototype.forgotPassword = function (username, clientMetadata) {\n if (clientMetadata === void 0) { clientMetadata = this._config.clientMetadata; }\n if (!this.userPool) {\n return this.rejectNoUserPool();\n }\n if (!username) {\n return this.rejectAuthError(AuthErrorTypes.EmptyUsername);\n }\n var user = this.createCognitoUser(username);\n return new Promise(function (resolve, reject) {\n user.forgotPassword({\n onSuccess: function () {\n resolve();\n return;\n },\n onFailure: function (err) {\n logger.debug('forgot password failure', err);\n dispatchAuthEvent('forgotPassword_failure', err, username + \" forgotPassword failed\");\n reject(err);\n return;\n },\n inputVerificationCode: function (data) {\n dispatchAuthEvent('forgotPassword', user, username + \" has initiated forgot password flow\");\n resolve(data);\n return;\n },\n }, clientMetadata);\n });\n };\n /**\n * Confirm a new password using a confirmation Code\n * @param {String} username - The username\n * @param {String} code - The confirmation code\n * @param {String} password - The new password\n * @return - A promise that resolves if success\n */\n AuthClass.prototype.forgotPasswordSubmit = function (username, code, password, clientMetadata) {\n if (clientMetadata === void 0) { clientMetadata = this._config.clientMetadata; }\n if (!this.userPool) {\n return this.rejectNoUserPool();\n }\n if (!username) {\n return this.rejectAuthError(AuthErrorTypes.EmptyUsername);\n }\n if (!code) {\n return this.rejectAuthError(AuthErrorTypes.EmptyCode);\n }\n if (!password) {\n return this.rejectAuthError(AuthErrorTypes.EmptyPassword);\n }\n var user = this.createCognitoUser(username);\n return new Promise(function (resolve, reject) {\n user.confirmPassword(code, password, {\n onSuccess: function () {\n dispatchAuthEvent('forgotPasswordSubmit', user, username + \" forgotPasswordSubmit successful\");\n resolve();\n return;\n },\n onFailure: function (err) {\n dispatchAuthEvent('forgotPasswordSubmit_failure', err, username + \" forgotPasswordSubmit failed\");\n reject(err);\n return;\n },\n }, clientMetadata);\n });\n };\n /**\n * Get user information\n * @async\n * @return {Object }- current User's information\n */\n AuthClass.prototype.currentUserInfo = function () {\n return __awaiter(this, void 0, void 0, function () {\n var source, user, attributes, userAttrs, credentials, e_10, info, err_1, user;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n source = this.Credentials.getCredSource();\n if (!(!source || source === 'aws' || source === 'userPool')) return [3 /*break*/, 9];\n return [4 /*yield*/, this.currentUserPoolUser().catch(function (err) {\n return logger.debug(err);\n })];\n case 1:\n user = _a.sent();\n if (!user) {\n return [2 /*return*/, null];\n }\n _a.label = 2;\n case 2:\n _a.trys.push([2, 8, , 9]);\n return [4 /*yield*/, this.userAttributes(user)];\n case 3:\n attributes = _a.sent();\n userAttrs = this.attributesToObject(attributes);\n credentials = null;\n _a.label = 4;\n case 4:\n _a.trys.push([4, 6, , 7]);\n return [4 /*yield*/, this.currentCredentials()];\n case 5:\n credentials = _a.sent();\n return [3 /*break*/, 7];\n case 6:\n e_10 = _a.sent();\n logger.debug('Failed to retrieve credentials while getting current user info', e_10);\n return [3 /*break*/, 7];\n case 7:\n info = {\n id: credentials ? credentials.identityId : undefined,\n username: user.getUsername(),\n attributes: userAttrs,\n };\n return [2 /*return*/, info];\n case 8:\n err_1 = _a.sent();\n logger.debug('currentUserInfo error', err_1);\n return [2 /*return*/, {}];\n case 9:\n if (source === 'federated') {\n user = this.user;\n return [2 /*return*/, user ? user : {}];\n }\n return [2 /*return*/];\n }\n });\n });\n };\n AuthClass.prototype.federatedSignIn = function (providerOrOptions, response, user) {\n return __awaiter(this, void 0, void 0, function () {\n var options, provider, customState, client_id, redirect_uri, provider, loggedInUser, token, identity_id, expires_at, credentials, currentUser;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!this._config.identityPoolId && !this._config.userPoolId) {\n throw new Error(\"Federation requires either a User Pool or Identity Pool in config\");\n }\n // Ensure backwards compatability\n if (typeof providerOrOptions === 'undefined') {\n if (this._config.identityPoolId && !this._config.userPoolId) {\n throw new Error(\"Federation with Identity Pools requires tokens passed as arguments\");\n }\n }\n if (!(isFederatedSignInOptions(providerOrOptions) ||\n isFederatedSignInOptionsCustom(providerOrOptions) ||\n hasCustomState(providerOrOptions) ||\n typeof providerOrOptions === 'undefined')) return [3 /*break*/, 1];\n options = providerOrOptions || {\n provider: CognitoHostedUIIdentityProvider.Cognito,\n };\n provider = isFederatedSignInOptions(options)\n ? options.provider\n : options.customProvider;\n customState = isFederatedSignInOptions(options)\n ? options.customState\n : options.customState;\n if (this._config.userPoolId) {\n client_id = isCognitoHostedOpts(this._config.oauth)\n ? this._config.userPoolWebClientId\n : this._config.oauth.clientID;\n redirect_uri = isCognitoHostedOpts(this._config.oauth)\n ? this._config.oauth.redirectSignIn\n : this._config.oauth.redirectUri;\n this._oAuthHandler.oauthSignIn(this._config.oauth.responseType, this._config.oauth.domain, redirect_uri, client_id, provider, customState);\n }\n return [3 /*break*/, 4];\n case 1:\n provider = providerOrOptions;\n // To check if the user is already logged in\n try {\n loggedInUser = JSON.stringify(JSON.parse(this._storage.getItem('aws-amplify-federatedInfo')).user);\n if (loggedInUser) {\n logger.warn(\"There is already a signed in user: \" + loggedInUser + \" in your app.\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tYou should not call Auth.federatedSignIn method again as it may cause unexpected behavior.\");\n }\n }\n catch (e) { }\n token = response.token, identity_id = response.identity_id, expires_at = response.expires_at;\n return [4 /*yield*/, this.Credentials.set({ provider: provider, token: token, identity_id: identity_id, user: user, expires_at: expires_at }, 'federation')];\n case 2:\n credentials = _a.sent();\n return [4 /*yield*/, this.currentAuthenticatedUser()];\n case 3:\n currentUser = _a.sent();\n dispatchAuthEvent('signIn', currentUser, \"A user \" + currentUser.username + \" has been signed in\");\n logger.debug('federated sign in credentials', credentials);\n return [2 /*return*/, credentials];\n case 4: return [2 /*return*/];\n }\n });\n });\n };\n /**\n * Used to complete the OAuth flow with or without the Cognito Hosted UI\n * @param {String} URL - optional parameter for customers to pass in the response URL\n */\n AuthClass.prototype._handleAuthResponse = function (URL) {\n return __awaiter(this, void 0, void 0, function () {\n var currentUrl, hasCodeOrError, hasTokenOrError, _a, accessToken, idToken, refreshToken, state, session, credentials, isCustomStateIncluded, currentUser, customState, err_2;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n if (this.oAuthFlowInProgress) {\n logger.debug(\"Skipping URL \" + URL + \" current flow in progress\");\n return [2 /*return*/];\n }\n _b.label = 1;\n case 1:\n _b.trys.push([1, , 8, 9]);\n this.oAuthFlowInProgress = true;\n if (!this._config.userPoolId) {\n throw new Error(\"OAuth responses require a User Pool defined in config\");\n }\n dispatchAuthEvent('parsingCallbackUrl', { url: URL }, \"The callback url is being parsed\");\n currentUrl = URL || (JS.browserOrNode().isBrowser ? window.location.href : '');\n hasCodeOrError = !!(parse(currentUrl).query || '')\n .split('&')\n .map(function (entry) { return entry.split('='); })\n .find(function (_a) {\n var _b = __read(_a, 1), k = _b[0];\n return k === 'code' || k === 'error';\n });\n hasTokenOrError = !!(parse(currentUrl).hash || '#')\n .substr(1)\n .split('&')\n .map(function (entry) { return entry.split('='); })\n .find(function (_a) {\n var _b = __read(_a, 1), k = _b[0];\n return k === 'access_token' || k === 'error';\n });\n if (!(hasCodeOrError || hasTokenOrError)) return [3 /*break*/, 7];\n this._storage.setItem('amplify-redirected-from-hosted-ui', 'true');\n _b.label = 2;\n case 2:\n _b.trys.push([2, 6, , 7]);\n return [4 /*yield*/, this._oAuthHandler.handleAuthResponse(currentUrl)];\n case 3:\n _a = _b.sent(), accessToken = _a.accessToken, idToken = _a.idToken, refreshToken = _a.refreshToken, state = _a.state;\n session = new CognitoUserSession({\n IdToken: new CognitoIdToken({ IdToken: idToken }),\n RefreshToken: new CognitoRefreshToken({\n RefreshToken: refreshToken,\n }),\n AccessToken: new CognitoAccessToken({\n AccessToken: accessToken,\n }),\n });\n credentials = void 0;\n if (!this._config.identityPoolId) return [3 /*break*/, 5];\n return [4 /*yield*/, this.Credentials.set(session, 'session')];\n case 4:\n credentials = _b.sent();\n logger.debug('AWS credentials', credentials);\n _b.label = 5;\n case 5:\n isCustomStateIncluded = /-/.test(state);\n currentUser = this.createCognitoUser(session.getIdToken().decodePayload()['cognito:username']);\n // This calls cacheTokens() in Cognito SDK\n currentUser.setSignInUserSession(session);\n if (window && typeof window.history !== 'undefined') {\n window.history.replaceState({}, null, this._config.oauth.redirectSignIn);\n }\n dispatchAuthEvent('signIn', currentUser, \"A user \" + currentUser.getUsername() + \" has been signed in\");\n dispatchAuthEvent('cognitoHostedUI', currentUser, \"A user \" + currentUser.getUsername() + \" has been signed in via Cognito Hosted UI\");\n if (isCustomStateIncluded) {\n customState = state\n .split('-')\n .splice(1)\n .join('-');\n dispatchAuthEvent('customOAuthState', urlSafeDecode(customState), \"State for user \" + currentUser.getUsername());\n }\n //#endregion\n return [2 /*return*/, credentials];\n case 6:\n err_2 = _b.sent();\n logger.debug('Error in cognito hosted auth response', err_2);\n dispatchAuthEvent('signIn_failure', err_2, \"The OAuth response flow failed\");\n dispatchAuthEvent('cognitoHostedUI_failure', err_2, \"A failure occurred when returning to the Cognito Hosted UI\");\n dispatchAuthEvent('customState_failure', err_2, \"A failure occurred when returning state\");\n return [3 /*break*/, 7];\n case 7: return [3 /*break*/, 9];\n case 8:\n this.oAuthFlowInProgress = false;\n return [7 /*endfinally*/];\n case 9: return [2 /*return*/];\n }\n });\n });\n };\n /**\n * Compact version of credentials\n * @param {Object} credentials\n * @return {Object} - Credentials\n */\n AuthClass.prototype.essentialCredentials = function (credentials) {\n return {\n accessKeyId: credentials.accessKeyId,\n sessionToken: credentials.sessionToken,\n secretAccessKey: credentials.secretAccessKey,\n identityId: credentials.identityId,\n authenticated: credentials.authenticated,\n };\n };\n AuthClass.prototype.attributesToObject = function (attributes) {\n var _this = this;\n var obj = {};\n if (attributes) {\n attributes.map(function (attribute) {\n if (attribute.Name === 'email_verified' ||\n attribute.Name === 'phone_number_verified') {\n obj[attribute.Name] = _this.isTruthyString(attribute.Value) || attribute.Value === true;\n }\n else {\n obj[attribute.Name] = attribute.Value;\n }\n });\n }\n return obj;\n };\n AuthClass.prototype.isTruthyString = function (value) {\n return typeof value.toLowerCase === 'function' && value.toLowerCase() === 'true';\n };\n AuthClass.prototype.createCognitoUser = function (username) {\n var userData = {\n Username: username,\n Pool: this.userPool,\n };\n userData.Storage = this._storage;\n var authenticationFlowType = this._config.authenticationFlowType;\n var user = new CognitoUser(userData);\n if (authenticationFlowType) {\n user.setAuthenticationFlowType(authenticationFlowType);\n }\n return user;\n };\n AuthClass.prototype._isValidAuthStorage = function (obj) {\n // We need to check if the obj has the functions of Storage\n return (!!obj &&\n typeof obj.getItem === 'function' &&\n typeof obj.setItem === 'function' &&\n typeof obj.removeItem === 'function' &&\n typeof obj.clear === 'function');\n };\n AuthClass.prototype.noUserPoolErrorHandler = function (config) {\n if (config) {\n if (!config.userPoolId || !config.identityPoolId) {\n return AuthErrorTypes.MissingAuthConfig;\n }\n }\n return AuthErrorTypes.NoConfig;\n };\n AuthClass.prototype.rejectAuthError = function (type) {\n return Promise.reject(new AuthError(type));\n };\n AuthClass.prototype.rejectNoUserPool = function () {\n var type = this.noUserPoolErrorHandler(this._config);\n return Promise.reject(new NoUserPoolError(type));\n };\n return AuthClass;\n}());\nexport { AuthClass };\nexport var Auth = new AuthClass(null);\nAmplify.register(Auth);\n//# sourceMappingURL=Auth.js.map","/*\n * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n * the License. A copy of the License is located at\n *\n * http://aws.amazon.com/apache2.0/\n *\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\nimport { JS } from '@aws-amplify/core';\nexport default (function (callback) {\n if (JS.browserOrNode().isBrowser && window.location) {\n var url = window.location.href;\n callback({ url: url });\n }\n else if (JS.browserOrNode().isNode) {\n // continue building on ssr\n (function () { }); // noop\n }\n else {\n throw new Error('Not supported');\n }\n});\n//# sourceMappingURL=urlListener.js.map","var isarray = require('isarray')\n\n/**\n * Expose `pathToRegexp`.\n */\nmodule.exports = pathToRegexp\nmodule.exports.parse = parse\nmodule.exports.compile = compile\nmodule.exports.tokensToFunction = tokensToFunction\nmodule.exports.tokensToRegExp = tokensToRegExp\n\n/**\n * The main path matching regexp utility.\n *\n * @type {RegExp}\n */\nvar PATH_REGEXP = new RegExp([\n // Match escaped characters that would otherwise appear in future matches.\n // This allows the user to escape special characters that won't transform.\n '(\\\\\\\\.)',\n // Match Express-style parameters and un-named parameters with a prefix\n // and optional suffixes. Matches appear as:\n //\n // \"/:test(\\\\d+)?\" => [\"/\", \"test\", \"\\d+\", undefined, \"?\", undefined]\n // \"/route(\\\\d+)\" => [undefined, undefined, undefined, \"\\d+\", undefined, undefined]\n // \"/*\" => [\"/\", undefined, undefined, undefined, undefined, \"*\"]\n '([\\\\/.])?(?:(?:\\\\:(\\\\w+)(?:\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))?|\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))([+*?])?|(\\\\*))'\n].join('|'), 'g')\n\n/**\n * Parse a string for the raw tokens.\n *\n * @param {string} str\n * @param {Object=} options\n * @return {!Array}\n */\nfunction parse (str, options) {\n var tokens = []\n var key = 0\n var index = 0\n var path = ''\n var defaultDelimiter = options && options.delimiter || '/'\n var res\n\n while ((res = PATH_REGEXP.exec(str)) != null) {\n var m = res[0]\n var escaped = res[1]\n var offset = res.index\n path += str.slice(index, offset)\n index = offset + m.length\n\n // Ignore already escaped sequences.\n if (escaped) {\n path += escaped[1]\n continue\n }\n\n var next = str[index]\n var prefix = res[2]\n var name = res[3]\n var capture = res[4]\n var group = res[5]\n var modifier = res[6]\n var asterisk = res[7]\n\n // Push the current path onto the tokens.\n if (path) {\n tokens.push(path)\n path = ''\n }\n\n var partial = prefix != null && next != null && next !== prefix\n var repeat = modifier === '+' || modifier === '*'\n var optional = modifier === '?' || modifier === '*'\n var delimiter = prefix || defaultDelimiter\n var pattern = capture || group\n var prevText = prefix || (typeof tokens[tokens.length - 1] === 'string' ? tokens[tokens.length - 1] : '')\n\n tokens.push({\n name: name || key++,\n prefix: prefix || '',\n delimiter: delimiter,\n optional: optional,\n repeat: repeat,\n partial: partial,\n asterisk: !!asterisk,\n pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : restrictBacktrack(delimiter, prevText))\n })\n }\n\n // Match any characters still remaining.\n if (index < str.length) {\n path += str.substr(index)\n }\n\n // If the path exists, push it onto the end.\n if (path) {\n tokens.push(path)\n }\n\n return tokens\n}\n\nfunction restrictBacktrack(delimiter, prevText) {\n if (!prevText || prevText.indexOf(delimiter) > -1) {\n return '[^' + escapeString(delimiter) + ']+?'\n }\n\n return escapeString(prevText) + '|(?:(?!' + escapeString(prevText) + ')[^' + escapeString(delimiter) + '])+?'\n}\n\n/**\n * Compile a string to a template function for the path.\n *\n * @param {string} str\n * @param {Object=} options\n * @return {!function(Object=, Object=)}\n */\nfunction compile (str, options) {\n return tokensToFunction(parse(str, options), options)\n}\n\n/**\n * Prettier encoding of URI path segments.\n *\n * @param {string}\n * @return {string}\n */\nfunction encodeURIComponentPretty (str) {\n return encodeURI(str).replace(/[\\/?#]/g, function (c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n })\n}\n\n/**\n * Encode the asterisk parameter. Similar to `pretty`, but allows slashes.\n *\n * @param {string}\n * @return {string}\n */\nfunction encodeAsterisk (str) {\n return encodeURI(str).replace(/[?#]/g, function (c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n })\n}\n\n/**\n * Expose a method for transforming tokens into the path function.\n */\nfunction tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}\n\n/**\n * Escape a regular expression string.\n *\n * @param {string} str\n * @return {string}\n */\nfunction escapeString (str) {\n return str.replace(/([.+*?=^!:${}()[\\]|\\/\\\\])/g, '\\\\$1')\n}\n\n/**\n * Escape the capturing group by escaping special characters and meaning.\n *\n * @param {string} group\n * @return {string}\n */\nfunction escapeGroup (group) {\n return group.replace(/([=!:$\\/()])/g, '\\\\$1')\n}\n\n/**\n * Attach the keys as a property of the regexp.\n *\n * @param {!RegExp} re\n * @param {Array} keys\n * @return {!RegExp}\n */\nfunction attachKeys (re, keys) {\n re.keys = keys\n return re\n}\n\n/**\n * Get the flags for a regexp from the options.\n *\n * @param {Object} options\n * @return {string}\n */\nfunction flags (options) {\n return options && options.sensitive ? '' : 'i'\n}\n\n/**\n * Pull out keys from a regexp.\n *\n * @param {!RegExp} path\n * @param {!Array} keys\n * @return {!RegExp}\n */\nfunction regexpToRegexp (path, keys) {\n // Use a negative lookahead to match only capturing groups.\n var groups = path.source.match(/\\((?!\\?)/g)\n\n if (groups) {\n for (var i = 0; i < groups.length; i++) {\n keys.push({\n name: i,\n prefix: null,\n delimiter: null,\n optional: false,\n repeat: false,\n partial: false,\n asterisk: false,\n pattern: null\n })\n }\n }\n\n return attachKeys(path, keys)\n}\n\n/**\n * Transform an array into a regexp.\n *\n * @param {!Array} path\n * @param {Array} keys\n * @param {!Object} options\n * @return {!RegExp}\n */\nfunction arrayToRegexp (path, keys, options) {\n var parts = []\n\n for (var i = 0; i < path.length; i++) {\n parts.push(pathToRegexp(path[i], keys, options).source)\n }\n\n var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options))\n\n return attachKeys(regexp, keys)\n}\n\n/**\n * Create a path regexp from string input.\n *\n * @param {string} path\n * @param {!Array} keys\n * @param {!Object} options\n * @return {!RegExp}\n */\nfunction stringToRegexp (path, keys, options) {\n return tokensToRegExp(parse(path, options), keys, options)\n}\n\n/**\n * Expose a function for taking tokens and returning a RegExp.\n *\n * @param {!Array} tokens\n * @param {(Array|Object)=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\nfunction tokensToRegExp (tokens, keys, options) {\n if (!isarray(keys)) {\n options = /** @type {!Object} */ (keys || options)\n keys = []\n }\n\n options = options || {}\n\n var strict = options.strict\n var end = options.end !== false\n var route = ''\n\n // Iterate over the tokens and create our regexp string.\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n route += escapeString(token)\n } else {\n var prefix = escapeString(token.prefix)\n var capture = '(?:' + token.pattern + ')'\n\n keys.push(token)\n\n if (token.repeat) {\n capture += '(?:' + prefix + capture + ')*'\n }\n\n if (token.optional) {\n if (!token.partial) {\n capture = '(?:' + prefix + '(' + capture + '))?'\n } else {\n capture = prefix + '(' + capture + ')?'\n }\n } else {\n capture = prefix + '(' + capture + ')'\n }\n\n route += capture\n }\n }\n\n var delimiter = escapeString(options.delimiter || '/')\n var endsWithDelimiter = route.slice(-delimiter.length) === delimiter\n\n // In non-strict mode we allow a slash at the end of match. If the path to\n // match already ends with a slash, we remove it for consistency. The slash\n // is valid at the end of a path match, not in the middle. This is important\n // in non-ending mode, where \"/test/\" shouldn't match \"/test//route\".\n if (!strict) {\n route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?'\n }\n\n if (end) {\n route += '$'\n } else {\n // In non-ending mode, we need the capturing groups to match as much as\n // possible by using a positive lookahead to the end or next path segment.\n route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)'\n }\n\n return attachKeys(new RegExp('^' + route, flags(options)), keys)\n}\n\n/**\n * Normalize the given path string, returning a regular expression.\n *\n * An empty array can be passed in for the keys, which will hold the\n * placeholder key descriptions. For example, using `/user/:id`, `keys` will\n * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.\n *\n * @param {(string|RegExp|Array)} path\n * @param {(Array|Object)=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\nfunction pathToRegexp (path, keys, options) {\n if (!isarray(keys)) {\n options = /** @type {!Object} */ (keys || options)\n keys = []\n }\n\n options = options || {}\n\n if (path instanceof RegExp) {\n return regexpToRegexp(path, /** @type {!Array} */ (keys))\n }\n\n if (isarray(path)) {\n return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)\n }\n\n return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)\n}\n","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nvar _excluded = [\"bsPrefix\", \"variant\", \"size\", \"active\", \"className\", \"block\", \"type\", \"as\"];\nimport classNames from 'classnames';\nimport React from 'react';\nimport { useBootstrapPrefix } from './ThemeProvider';\nimport SafeAnchor from './SafeAnchor';\nvar defaultProps = {\n variant: 'primary',\n active: false,\n disabled: false\n};\nvar Button = /*#__PURE__*/React.forwardRef(function (_ref, ref) {\n var bsPrefix = _ref.bsPrefix,\n variant = _ref.variant,\n size = _ref.size,\n active = _ref.active,\n className = _ref.className,\n block = _ref.block,\n type = _ref.type,\n as = _ref.as,\n props = _objectWithoutPropertiesLoose(_ref, _excluded);\n\n var prefix = useBootstrapPrefix(bsPrefix, 'btn');\n var classes = classNames(className, prefix, active && 'active', variant && prefix + \"-\" + variant, block && prefix + \"-block\", size && prefix + \"-\" + size);\n\n if (props.href) {\n return /*#__PURE__*/React.createElement(SafeAnchor, _extends({}, props, {\n as: as,\n ref: ref,\n className: classNames(classes, props.disabled && 'disabled')\n }));\n }\n\n if (ref) {\n props.ref = ref;\n }\n\n if (type) {\n props.type = type;\n } else if (!as) {\n props.type = 'button';\n }\n\n var Component = as || 'button';\n return /*#__PURE__*/React.createElement(Component, _extends({}, props, {\n className: classes\n }));\n});\nButton.displayName = 'Button';\nButton.defaultProps = defaultProps;\nexport default Button;","function memoize(fn) {\n var cache = Object.create(null);\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport { memoize as default };\n","import memoize from '@emotion/memoize';\n\n// eslint-disable-next-line no-undef\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar isPropValid = /* #__PURE__ */memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport { isPropValid as default };\n","import { __extends } from \"tslib\";\nimport { GetIdInput, GetIdResponse } from \"../models/models_0\";\nimport { deserializeAws_json1_1GetIdCommand, serializeAws_json1_1GetIdCommand } from \"../protocols/Aws_json1_1\";\nimport { getSerdePlugin } from \"@aws-sdk/middleware-serde\";\nimport { Command as $Command } from \"@aws-sdk/smithy-client\";\n/**\n * Generates (or retrieves) a Cognito ID. Supplying multiple logins will create an\n * implicit linked account.
\n * This is a public API. You do not need any credentials to call this API.
\n */\nvar GetIdCommand = /** @class */ (function (_super) {\n __extends(GetIdCommand, _super);\n // Start section: command_properties\n // End section: command_properties\n function GetIdCommand(input) {\n var _this = \n // Start section: command_constructor\n _super.call(this) || this;\n _this.input = input;\n return _this;\n // End section: command_constructor\n }\n /**\n * @internal\n */\n GetIdCommand.prototype.resolveMiddleware = function (clientStack, configuration, options) {\n this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));\n var stack = clientStack.concat(this.middlewareStack);\n var logger = configuration.logger;\n var clientName = \"CognitoIdentityClient\";\n var commandName = \"GetIdCommand\";\n var handlerExecutionContext = {\n logger: logger,\n clientName: clientName,\n commandName: commandName,\n inputFilterSensitiveLog: GetIdInput.filterSensitiveLog,\n outputFilterSensitiveLog: GetIdResponse.filterSensitiveLog,\n };\n var requestHandler = configuration.requestHandler;\n return stack.resolve(function (request) {\n return requestHandler.handle(request.request, options || {});\n }, handlerExecutionContext);\n };\n GetIdCommand.prototype.serialize = function (input, context) {\n return serializeAws_json1_1GetIdCommand(input, context);\n };\n GetIdCommand.prototype.deserialize = function (output, context) {\n return deserializeAws_json1_1GetIdCommand(output, context);\n };\n return GetIdCommand;\n}($Command));\nexport { GetIdCommand };\n//# sourceMappingURL=GetIdCommand.js.map","import { __assign } from \"tslib\";\n// Partition default templates\nvar AWS_TEMPLATE = \"pinpoint.{region}.amazonaws.com\";\nvar AWS_CN_TEMPLATE = \"pinpoint.{region}.amazonaws.com.cn\";\nvar AWS_ISO_TEMPLATE = \"pinpoint.{region}.c2s.ic.gov\";\nvar AWS_ISO_B_TEMPLATE = \"pinpoint.{region}.sc2s.sgov.gov\";\nvar AWS_US_GOV_TEMPLATE = \"pinpoint.{region}.amazonaws.com\";\n// Partition regions\nvar AWS_REGIONS = new Set([\n \"af-south-1\",\n \"ap-east-1\",\n \"ap-northeast-1\",\n \"ap-northeast-2\",\n \"ap-south-1\",\n \"ap-southeast-1\",\n \"ap-southeast-2\",\n \"ca-central-1\",\n \"eu-central-1\",\n \"eu-north-1\",\n \"eu-south-1\",\n \"eu-west-1\",\n \"eu-west-2\",\n \"eu-west-3\",\n \"me-south-1\",\n \"sa-east-1\",\n \"us-east-1\",\n \"us-east-2\",\n \"us-west-1\",\n \"us-west-2\",\n]);\nvar AWS_CN_REGIONS = new Set([\"cn-north-1\", \"cn-northwest-1\"]);\nvar AWS_ISO_REGIONS = new Set([\"us-iso-east-1\"]);\nvar AWS_ISO_B_REGIONS = new Set([\"us-isob-east-1\"]);\nvar AWS_US_GOV_REGIONS = new Set([\"us-gov-east-1\", \"us-gov-west-1\"]);\nexport var defaultRegionInfoProvider = function (region, options) {\n var regionInfo = undefined;\n switch (region) {\n // First, try to match exact region names.\n case \"ap-northeast-1\":\n regionInfo = {\n hostname: \"pinpoint.ap-northeast-1.amazonaws.com\",\n partition: \"aws\",\n signingService: \"mobiletargeting\",\n };\n break;\n case \"ap-northeast-2\":\n regionInfo = {\n hostname: \"pinpoint.ap-northeast-2.amazonaws.com\",\n partition: \"aws\",\n signingService: \"mobiletargeting\",\n };\n break;\n case \"ap-south-1\":\n regionInfo = {\n hostname: \"pinpoint.ap-south-1.amazonaws.com\",\n partition: \"aws\",\n signingService: \"mobiletargeting\",\n };\n break;\n case \"ap-southeast-1\":\n regionInfo = {\n hostname: \"pinpoint.ap-southeast-1.amazonaws.com\",\n partition: \"aws\",\n signingService: \"mobiletargeting\",\n };\n break;\n case \"ap-southeast-2\":\n regionInfo = {\n hostname: \"pinpoint.ap-southeast-2.amazonaws.com\",\n partition: \"aws\",\n signingService: \"mobiletargeting\",\n };\n break;\n case \"ca-central-1\":\n regionInfo = {\n hostname: \"pinpoint.ca-central-1.amazonaws.com\",\n partition: \"aws\",\n signingService: \"mobiletargeting\",\n };\n break;\n case \"eu-central-1\":\n regionInfo = {\n hostname: \"pinpoint.eu-central-1.amazonaws.com\",\n partition: \"aws\",\n signingService: \"mobiletargeting\",\n };\n break;\n case \"eu-west-1\":\n regionInfo = {\n hostname: \"pinpoint.eu-west-1.amazonaws.com\",\n partition: \"aws\",\n signingService: \"mobiletargeting\",\n };\n break;\n case \"eu-west-2\":\n regionInfo = {\n hostname: \"pinpoint.eu-west-2.amazonaws.com\",\n partition: \"aws\",\n signingService: \"mobiletargeting\",\n };\n break;\n case \"fips-us-east-1\":\n regionInfo = {\n hostname: \"pinpoint-fips.us-east-1.amazonaws.com\",\n partition: \"aws\",\n signingRegion: \"us-east-1\",\n };\n break;\n case \"fips-us-gov-west-1\":\n regionInfo = {\n hostname: \"pinpoint-fips.us-gov-west-1.amazonaws.com\",\n partition: \"aws-us-gov\",\n signingRegion: \"us-gov-west-1\",\n };\n break;\n case \"fips-us-west-2\":\n regionInfo = {\n hostname: \"pinpoint-fips.us-west-2.amazonaws.com\",\n partition: \"aws\",\n signingRegion: \"us-west-2\",\n };\n break;\n case \"us-east-1\":\n regionInfo = {\n hostname: \"pinpoint.us-east-1.amazonaws.com\",\n partition: \"aws\",\n signingRegion: \"us-east-1\",\n };\n break;\n case \"us-gov-west-1\":\n regionInfo = {\n hostname: \"pinpoint.us-gov-west-1.amazonaws.com\",\n partition: \"aws-us-gov\",\n signingRegion: \"us-gov-west-1\",\n };\n break;\n case \"us-west-2\":\n regionInfo = {\n hostname: \"pinpoint.us-west-2.amazonaws.com\",\n partition: \"aws\",\n signingRegion: \"us-west-2\",\n };\n break;\n // Next, try to match partition endpoints.\n default:\n if (AWS_REGIONS.has(region)) {\n regionInfo = {\n hostname: AWS_TEMPLATE.replace(\"{region}\", region),\n partition: \"aws\",\n signingService: \"mobiletargeting\",\n };\n }\n if (AWS_CN_REGIONS.has(region)) {\n regionInfo = {\n hostname: AWS_CN_TEMPLATE.replace(\"{region}\", region),\n partition: \"aws-cn\",\n };\n }\n if (AWS_ISO_REGIONS.has(region)) {\n regionInfo = {\n hostname: AWS_ISO_TEMPLATE.replace(\"{region}\", region),\n partition: \"aws-iso\",\n };\n }\n if (AWS_ISO_B_REGIONS.has(region)) {\n regionInfo = {\n hostname: AWS_ISO_B_TEMPLATE.replace(\"{region}\", region),\n partition: \"aws-iso-b\",\n };\n }\n if (AWS_US_GOV_REGIONS.has(region)) {\n regionInfo = {\n hostname: AWS_US_GOV_TEMPLATE.replace(\"{region}\", region),\n partition: \"aws-us-gov\",\n signingService: \"mobiletargeting\",\n };\n }\n // Finally, assume it's an AWS partition endpoint.\n if (regionInfo === undefined) {\n regionInfo = {\n hostname: AWS_TEMPLATE.replace(\"{region}\", region),\n partition: \"aws\",\n signingService: \"mobiletargeting\",\n };\n }\n }\n return Promise.resolve(__assign({ signingService: \"mobiletargeting\" }, regionInfo));\n};\n//# sourceMappingURL=endpoints.js.map","import { defaultRegionInfoProvider } from \"./endpoints\";\nimport { parseUrl } from \"@aws-sdk/url-parser\";\n/**\n * @internal\n */\nexport var ClientSharedValues = {\n apiVersion: \"2016-12-01\",\n disableHostPrefix: false,\n logger: {},\n regionInfoProvider: defaultRegionInfoProvider,\n serviceId: \"Pinpoint\",\n urlParser: parseUrl,\n};\n//# sourceMappingURL=runtimeConfig.shared.js.map","import { __assign } from \"tslib\";\nimport packageInfo from \"./package.json\";\nimport { Sha256 } from \"@aws-crypto/sha256-browser\";\nimport { FetchHttpHandler, streamCollector } from \"@aws-sdk/fetch-http-handler\";\nimport { invalidProvider } from \"@aws-sdk/invalid-dependency\";\nimport { DEFAULT_MAX_ATTEMPTS } from \"@aws-sdk/middleware-retry\";\nimport { fromBase64, toBase64 } from \"@aws-sdk/util-base64-browser\";\nimport { calculateBodyLength } from \"@aws-sdk/util-body-length-browser\";\nimport { defaultUserAgent } from \"@aws-sdk/util-user-agent-browser\";\nimport { fromUtf8, toUtf8 } from \"@aws-sdk/util-utf8-browser\";\nimport { ClientSharedValues } from \"./runtimeConfig.shared\";\n/**\n * @internal\n */\nexport var ClientDefaultValues = __assign(__assign({}, ClientSharedValues), { runtime: \"browser\", base64Decoder: fromBase64, base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: function (_) { return function () { return Promise.reject(new Error(\"Credential is missing\")); }; }, defaultUserAgentProvider: defaultUserAgent({\n serviceId: ClientSharedValues.serviceId,\n clientVersion: packageInfo.version,\n }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidProvider(\"Region is missing\"), requestHandler: new FetchHttpHandler(), sha256: Sha256, streamCollector: streamCollector, utf8Decoder: fromUtf8, utf8Encoder: toUtf8 });\n//# sourceMappingURL=runtimeConfig.browser.js.map","import { __assign, __extends } from \"tslib\";\nimport { ClientDefaultValues as __ClientDefaultValues } from \"./runtimeConfig\";\nimport { resolveEndpointsConfig, resolveRegionConfig, } from \"@aws-sdk/config-resolver\";\nimport { getContentLengthPlugin } from \"@aws-sdk/middleware-content-length\";\nimport { getHostHeaderPlugin, resolveHostHeaderConfig, } from \"@aws-sdk/middleware-host-header\";\nimport { getLoggerPlugin } from \"@aws-sdk/middleware-logger\";\nimport { getRetryPlugin, resolveRetryConfig } from \"@aws-sdk/middleware-retry\";\nimport { resolveAwsAuthConfig } from \"@aws-sdk/middleware-signing\";\nimport { getUserAgentPlugin, resolveUserAgentConfig, } from \"@aws-sdk/middleware-user-agent\";\nimport { Client as __Client, } from \"@aws-sdk/smithy-client\";\n/**\n * Amazon Cognito Federated Identities\n * Amazon Cognito Federated Identities is a web service that delivers scoped temporary\n * credentials to mobile devices and other untrusted environments. It uniquely identifies a\n * device and supplies the user with a consistent identity over the lifetime of an\n * application.
\n * Using Amazon Cognito Federated Identities, you can enable authentication with one or\n * more third-party identity providers (Facebook, Google, or Login with Amazon) or an Amazon\n * Cognito user pool, and you can also choose to support unauthenticated access from your app.\n * Cognito delivers a unique identifier for each user and acts as an OpenID token provider\n * trusted by AWS Security Token Service (STS) to access temporary, limited-privilege AWS\n * credentials.
\n * For a description of the authentication flow from the Amazon Cognito Developer Guide\n * see Authentication Flow.
\n * For more information see Amazon Cognito Federated Identities.
\n */\nvar CognitoIdentityClient = /** @class */ (function (_super) {\n __extends(CognitoIdentityClient, _super);\n function CognitoIdentityClient(configuration) {\n var _this = this;\n var _config_0 = __assign(__assign({}, __ClientDefaultValues), configuration);\n var _config_1 = resolveRegionConfig(_config_0);\n var _config_2 = resolveEndpointsConfig(_config_1);\n var _config_3 = resolveAwsAuthConfig(_config_2);\n var _config_4 = resolveRetryConfig(_config_3);\n var _config_5 = resolveHostHeaderConfig(_config_4);\n var _config_6 = resolveUserAgentConfig(_config_5);\n _this = _super.call(this, _config_6) || this;\n _this.config = _config_6;\n _this.middlewareStack.use(getRetryPlugin(_this.config));\n _this.middlewareStack.use(getContentLengthPlugin(_this.config));\n _this.middlewareStack.use(getHostHeaderPlugin(_this.config));\n _this.middlewareStack.use(getLoggerPlugin(_this.config));\n _this.middlewareStack.use(getUserAgentPlugin(_this.config));\n return _this;\n }\n CognitoIdentityClient.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n };\n return CognitoIdentityClient;\n}(__Client));\nexport { CognitoIdentityClient };\n//# sourceMappingURL=CognitoIdentityClient.js.map","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nexport { _defineProperty as default };","module.exports = require('./lib/axios');","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function get() {\n return _FadeIn[\"default\"];\n }\n});\n\nvar _FadeIn = _interopRequireDefault(require(\"./FadeIn\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }","import React from 'react';\nvar TabContext = /*#__PURE__*/React.createContext(null);\nexport default TabContext;","module.exports = require('./dist/index');","import React from 'react';\nvar context = /*#__PURE__*/React.createContext(null);\ncontext.displayName = 'CardContext';\nexport default context;","'use strict';\nconst strictUriEncode = require('strict-uri-encode');\nconst decodeComponent = require('decode-uri-component');\nconst splitOnFirst = require('split-on-first');\nconst filterObject = require('filter-obj');\n\nconst isNullOrUndefined = value => value === null || value === undefined;\n\nfunction encoderForArrayFormat(options) {\n\tswitch (options.arrayFormat) {\n\t\tcase 'index':\n\t\t\treturn key => (result, value) => {\n\t\t\t\tconst index = result.length;\n\n\t\t\t\tif (\n\t\t\t\t\tvalue === undefined ||\n\t\t\t\t\t(options.skipNull && value === null) ||\n\t\t\t\t\t(options.skipEmptyString && value === '')\n\t\t\t\t) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\n\t\t\t\tif (value === null) {\n\t\t\t\t\treturn [...result, [encode(key, options), '[', index, ']'].join('')];\n\t\t\t\t}\n\n\t\t\t\treturn [\n\t\t\t\t\t...result,\n\t\t\t\t\t[encode(key, options), '[', encode(index, options), ']=', encode(value, options)].join('')\n\t\t\t\t];\n\t\t\t};\n\n\t\tcase 'bracket':\n\t\t\treturn key => (result, value) => {\n\t\t\t\tif (\n\t\t\t\t\tvalue === undefined ||\n\t\t\t\t\t(options.skipNull && value === null) ||\n\t\t\t\t\t(options.skipEmptyString && value === '')\n\t\t\t\t) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\n\t\t\t\tif (value === null) {\n\t\t\t\t\treturn [...result, [encode(key, options), '[]'].join('')];\n\t\t\t\t}\n\n\t\t\t\treturn [...result, [encode(key, options), '[]=', encode(value, options)].join('')];\n\t\t\t};\n\n\t\tcase 'comma':\n\t\tcase 'separator':\n\t\t\treturn key => (result, value) => {\n\t\t\t\tif (value === null || value === undefined || value.length === 0) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\n\t\t\t\tif (result.length === 0) {\n\t\t\t\t\treturn [[encode(key, options), '=', encode(value, options)].join('')];\n\t\t\t\t}\n\n\t\t\t\treturn [[result, encode(value, options)].join(options.arrayFormatSeparator)];\n\t\t\t};\n\n\t\tdefault:\n\t\t\treturn key => (result, value) => {\n\t\t\t\tif (\n\t\t\t\t\tvalue === undefined ||\n\t\t\t\t\t(options.skipNull && value === null) ||\n\t\t\t\t\t(options.skipEmptyString && value === '')\n\t\t\t\t) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\n\t\t\t\tif (value === null) {\n\t\t\t\t\treturn [...result, encode(key, options)];\n\t\t\t\t}\n\n\t\t\t\treturn [...result, [encode(key, options), '=', encode(value, options)].join('')];\n\t\t\t};\n\t}\n}\n\nfunction parserForArrayFormat(options) {\n\tlet result;\n\n\tswitch (options.arrayFormat) {\n\t\tcase 'index':\n\t\t\treturn (key, value, accumulator) => {\n\t\t\t\tresult = /\\[(\\d*)\\]$/.exec(key);\n\n\t\t\t\tkey = key.replace(/\\[\\d*\\]$/, '');\n\n\t\t\t\tif (!result) {\n\t\t\t\t\taccumulator[key] = value;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (accumulator[key] === undefined) {\n\t\t\t\t\taccumulator[key] = {};\n\t\t\t\t}\n\n\t\t\t\taccumulator[key][result[1]] = value;\n\t\t\t};\n\n\t\tcase 'bracket':\n\t\t\treturn (key, value, accumulator) => {\n\t\t\t\tresult = /(\\[\\])$/.exec(key);\n\t\t\t\tkey = key.replace(/\\[\\]$/, '');\n\n\t\t\t\tif (!result) {\n\t\t\t\t\taccumulator[key] = value;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (accumulator[key] === undefined) {\n\t\t\t\t\taccumulator[key] = [value];\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\taccumulator[key] = [].concat(accumulator[key], value);\n\t\t\t};\n\n\t\tcase 'comma':\n\t\tcase 'separator':\n\t\t\treturn (key, value, accumulator) => {\n\t\t\t\tconst isArray = typeof value === 'string' && value.includes(options.arrayFormatSeparator);\n\t\t\t\tconst isEncodedArray = (typeof value === 'string' && !isArray && decode(value, options).includes(options.arrayFormatSeparator));\n\t\t\t\tvalue = isEncodedArray ? decode(value, options) : value;\n\t\t\t\tconst newValue = isArray || isEncodedArray ? value.split(options.arrayFormatSeparator).map(item => decode(item, options)) : value === null ? value : decode(value, options);\n\t\t\t\taccumulator[key] = newValue;\n\t\t\t};\n\n\t\tdefault:\n\t\t\treturn (key, value, accumulator) => {\n\t\t\t\tif (accumulator[key] === undefined) {\n\t\t\t\t\taccumulator[key] = value;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\taccumulator[key] = [].concat(accumulator[key], value);\n\t\t\t};\n\t}\n}\n\nfunction validateArrayFormatSeparator(value) {\n\tif (typeof value !== 'string' || value.length !== 1) {\n\t\tthrow new TypeError('arrayFormatSeparator must be single character string');\n\t}\n}\n\nfunction encode(value, options) {\n\tif (options.encode) {\n\t\treturn options.strict ? strictUriEncode(value) : encodeURIComponent(value);\n\t}\n\n\treturn value;\n}\n\nfunction decode(value, options) {\n\tif (options.decode) {\n\t\treturn decodeComponent(value);\n\t}\n\n\treturn value;\n}\n\nfunction keysSorter(input) {\n\tif (Array.isArray(input)) {\n\t\treturn input.sort();\n\t}\n\n\tif (typeof input === 'object') {\n\t\treturn keysSorter(Object.keys(input))\n\t\t\t.sort((a, b) => Number(a) - Number(b))\n\t\t\t.map(key => input[key]);\n\t}\n\n\treturn input;\n}\n\nfunction removeHash(input) {\n\tconst hashStart = input.indexOf('#');\n\tif (hashStart !== -1) {\n\t\tinput = input.slice(0, hashStart);\n\t}\n\n\treturn input;\n}\n\nfunction getHash(url) {\n\tlet hash = '';\n\tconst hashStart = url.indexOf('#');\n\tif (hashStart !== -1) {\n\t\thash = url.slice(hashStart);\n\t}\n\n\treturn hash;\n}\n\nfunction extract(input) {\n\tinput = removeHash(input);\n\tconst queryStart = input.indexOf('?');\n\tif (queryStart === -1) {\n\t\treturn '';\n\t}\n\n\treturn input.slice(queryStart + 1);\n}\n\nfunction parseValue(value, options) {\n\tif (options.parseNumbers && !Number.isNaN(Number(value)) && (typeof value === 'string' && value.trim() !== '')) {\n\t\tvalue = Number(value);\n\t} else if (options.parseBooleans && value !== null && (value.toLowerCase() === 'true' || value.toLowerCase() === 'false')) {\n\t\tvalue = value.toLowerCase() === 'true';\n\t}\n\n\treturn value;\n}\n\nfunction parse(query, options) {\n\toptions = Object.assign({\n\t\tdecode: true,\n\t\tsort: true,\n\t\tarrayFormat: 'none',\n\t\tarrayFormatSeparator: ',',\n\t\tparseNumbers: false,\n\t\tparseBooleans: false\n\t}, options);\n\n\tvalidateArrayFormatSeparator(options.arrayFormatSeparator);\n\n\tconst formatter = parserForArrayFormat(options);\n\n\t// Create an object with no prototype\n\tconst ret = Object.create(null);\n\n\tif (typeof query !== 'string') {\n\t\treturn ret;\n\t}\n\n\tquery = query.trim().replace(/^[?#&]/, '');\n\n\tif (!query) {\n\t\treturn ret;\n\t}\n\n\tfor (const param of query.split('&')) {\n\t\tif (param === '') {\n\t\t\tcontinue;\n\t\t}\n\n\t\tlet [key, value] = splitOnFirst(options.decode ? param.replace(/\\+/g, ' ') : param, '=');\n\n\t\t// Missing `=` should be `null`:\n\t\t// http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters\n\t\tvalue = value === undefined ? null : ['comma', 'separator'].includes(options.arrayFormat) ? value : decode(value, options);\n\t\tformatter(decode(key, options), value, ret);\n\t}\n\n\tfor (const key of Object.keys(ret)) {\n\t\tconst value = ret[key];\n\t\tif (typeof value === 'object' && value !== null) {\n\t\t\tfor (const k of Object.keys(value)) {\n\t\t\t\tvalue[k] = parseValue(value[k], options);\n\t\t\t}\n\t\t} else {\n\t\t\tret[key] = parseValue(value, options);\n\t\t}\n\t}\n\n\tif (options.sort === false) {\n\t\treturn ret;\n\t}\n\n\treturn (options.sort === true ? Object.keys(ret).sort() : Object.keys(ret).sort(options.sort)).reduce((result, key) => {\n\t\tconst value = ret[key];\n\t\tif (Boolean(value) && typeof value === 'object' && !Array.isArray(value)) {\n\t\t\t// Sort object keys, not values\n\t\t\tresult[key] = keysSorter(value);\n\t\t} else {\n\t\t\tresult[key] = value;\n\t\t}\n\n\t\treturn result;\n\t}, Object.create(null));\n}\n\nexports.extract = extract;\nexports.parse = parse;\n\nexports.stringify = (object, options) => {\n\tif (!object) {\n\t\treturn '';\n\t}\n\n\toptions = Object.assign({\n\t\tencode: true,\n\t\tstrict: true,\n\t\tarrayFormat: 'none',\n\t\tarrayFormatSeparator: ','\n\t}, options);\n\n\tvalidateArrayFormatSeparator(options.arrayFormatSeparator);\n\n\tconst shouldFilter = key => (\n\t\t(options.skipNull && isNullOrUndefined(object[key])) ||\n\t\t(options.skipEmptyString && object[key] === '')\n\t);\n\n\tconst formatter = encoderForArrayFormat(options);\n\n\tconst objectCopy = {};\n\n\tfor (const key of Object.keys(object)) {\n\t\tif (!shouldFilter(key)) {\n\t\t\tobjectCopy[key] = object[key];\n\t\t}\n\t}\n\n\tconst keys = Object.keys(objectCopy);\n\n\tif (options.sort !== false) {\n\t\tkeys.sort(options.sort);\n\t}\n\n\treturn keys.map(key => {\n\t\tconst value = object[key];\n\n\t\tif (value === undefined) {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (value === null) {\n\t\t\treturn encode(key, options);\n\t\t}\n\n\t\tif (Array.isArray(value)) {\n\t\t\treturn value\n\t\t\t\t.reduce(formatter(key), [])\n\t\t\t\t.join('&');\n\t\t}\n\n\t\treturn encode(key, options) + '=' + encode(value, options);\n\t}).filter(x => x.length > 0).join('&');\n};\n\nexports.parseUrl = (url, options) => {\n\toptions = Object.assign({\n\t\tdecode: true\n\t}, options);\n\n\tconst [url_, hash] = splitOnFirst(url, '#');\n\n\treturn Object.assign(\n\t\t{\n\t\t\turl: url_.split('?')[0] || '',\n\t\t\tquery: parse(extract(url), options)\n\t\t},\n\t\toptions && options.parseFragmentIdentifier && hash ? {fragmentIdentifier: decode(hash, options)} : {}\n\t);\n};\n\nexports.stringifyUrl = (object, options) => {\n\toptions = Object.assign({\n\t\tencode: true,\n\t\tstrict: true\n\t}, options);\n\n\tconst url = removeHash(object.url).split('?')[0] || '';\n\tconst queryFromUrl = exports.extract(object.url);\n\tconst parsedQueryFromUrl = exports.parse(queryFromUrl, {sort: false});\n\n\tconst query = Object.assign(parsedQueryFromUrl, object.query);\n\tlet queryString = exports.stringify(query, options);\n\tif (queryString) {\n\t\tqueryString = `?${queryString}`;\n\t}\n\n\tlet hash = getHash(object.url);\n\tif (object.fragmentIdentifier) {\n\t\thash = `#${encode(object.fragmentIdentifier, options)}`;\n\t}\n\n\treturn `${url}${queryString}${hash}`;\n};\n\nexports.pick = (input, filter, options) => {\n\toptions = Object.assign({\n\t\tparseFragmentIdentifier: true\n\t}, options);\n\n\tconst {url, query, fragmentIdentifier} = exports.parseUrl(input, options);\n\treturn exports.stringifyUrl({\n\t\turl,\n\t\tquery: filterObject(query, filter),\n\t\tfragmentIdentifier\n\t}, options);\n};\n\nexports.exclude = (input, filter, options) => {\n\tconst exclusionFilter = Array.isArray(filter) ? key => !filter.includes(key) : (key, value) => !filter(key, value);\n\n\treturn exports.pick(input, exclusionFilter, options);\n};\n","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nvar _excluded = [\"bsPrefix\", \"className\", \"children\", \"as\"];\nimport classNames from 'classnames';\nimport React from 'react';\nimport { useBootstrapPrefix } from './ThemeProvider';\nvar NavItem = /*#__PURE__*/React.forwardRef( // Need to define the default \"as\" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595\nfunction (_ref, ref) {\n var bsPrefix = _ref.bsPrefix,\n className = _ref.className,\n children = _ref.children,\n _ref$as = _ref.as,\n Component = _ref$as === void 0 ? 'div' : _ref$as,\n props = _objectWithoutPropertiesLoose(_ref, _excluded);\n\n bsPrefix = useBootstrapPrefix(bsPrefix, 'nav-item');\n return /*#__PURE__*/React.createElement(Component, _extends({}, props, {\n ref: ref,\n className: classNames(className, bsPrefix)\n }), children);\n});\nNavItem.displayName = 'NavItem';\nexport default NavItem;","'use strict';\n/* eslint-disable es/no-symbol -- required for testing */\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\n\nmodule.exports = NATIVE_SYMBOL\n && !Symbol.sham\n && typeof Symbol.iterator == 'symbol';\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar V8_PROTOTYPE_DEFINE_BUG = require('../internals/v8-prototype-define-bug');\nvar definePropertyModule = require('../internals/object-define-property');\nvar anObject = require('../internals/an-object');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar objectKeys = require('../internals/object-keys');\n\n// `Object.defineProperties` method\n// https://tc39.es/ecma262/#sec-object.defineproperties\n// eslint-disable-next-line es/no-object-defineproperties -- safe\nexports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var props = toIndexedObject(Properties);\n var keys = objectKeys(Properties);\n var length = keys.length;\n var index = 0;\n var key;\n while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);\n return O;\n};\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\n\n// V8 ~ Chrome 36-\n// https://bugs.chromium.org/p/v8/issues/detail?id=3334\nmodule.exports = DESCRIPTORS && fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty(function () { /* empty */ }, 'prototype', {\n value: 42,\n writable: false\n }).prototype !== 42;\n});\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar createElement = require('../internals/document-create-element');\n\n// Thanks to IE8 for its funny defineProperty\nmodule.exports = !DESCRIPTORS && !fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty(createElement('div'), 'a', {\n get: function () { return 7; }\n }).a !== 7;\n});\n","'use strict';\nvar call = require('../internals/function-call');\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\n\nvar $TypeError = TypeError;\n\n// `OrdinaryToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-ordinarytoprimitive\nmodule.exports = function (input, pref) {\n var fn, val;\n if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;\n if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n throw new $TypeError(\"Can't convert object to primitive value\");\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar hasOwn = require('../internals/has-own-property');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar indexOf = require('../internals/array-includes').indexOf;\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar push = uncurryThis([].push);\n\nmodule.exports = function (object, names) {\n var O = toIndexedObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (hasOwn(O, key = names[i++])) {\n ~indexOf(result, key) || push(result, key);\n }\n return result;\n};\n","'use strict';\nvar ceil = Math.ceil;\nvar floor = Math.floor;\n\n// `Math.trunc` method\n// https://tc39.es/ecma262/#sec-math.trunc\n// eslint-disable-next-line es/no-math-trunc -- safe\nmodule.exports = Math.trunc || function trunc(x) {\n var n = +x;\n return (n > 0 ? floor : ceil)(n);\n};\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\n\nmodule.exports = getBuiltIn('document', 'documentElement');\n","'use strict';\nvar globalThis = require('../internals/global-this');\nvar isCallable = require('../internals/is-callable');\n\nvar WeakMap = globalThis.WeakMap;\n\nmodule.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap));\n","'use strict';\nvar IteratorPrototype = require('../internals/iterators-core').IteratorPrototype;\nvar create = require('../internals/object-create');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar Iterators = require('../internals/iterators');\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {\n var TO_STRING_TAG = NAME + ' Iterator';\n IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });\n setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);\n Iterators[TO_STRING_TAG] = returnThis;\n return IteratorConstructor;\n};\n","'use strict';\nvar fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\nvar create = require('../internals/object-create');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IS_PURE = require('../internals/is-pure');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar BUGGY_SAFARI_ITERATORS = false;\n\n// `%IteratorPrototype%` object\n// https://tc39.es/ecma262/#sec-%iteratorprototype%-object\nvar IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;\n\n/* eslint-disable es/no-array-prototype-keys -- safe */\nif ([].keys) {\n arrayIterator = [].keys();\n // Safari 8 has buggy iterators w/o `next`\n if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;\n else {\n PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));\n if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;\n }\n}\n\nvar NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype) || fails(function () {\n var test = {};\n // FF44- legacy iterators case\n return IteratorPrototype[ITERATOR].call(test) !== test;\n});\n\nif (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};\nelse if (IS_PURE) IteratorPrototype = create(IteratorPrototype);\n\n// `%IteratorPrototype%[@@iterator]()` method\n// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator\nif (!isCallable(IteratorPrototype[ITERATOR])) {\n defineBuiltIn(IteratorPrototype, ITERATOR, function () {\n return this;\n });\n}\n\nmodule.exports = {\n IteratorPrototype: IteratorPrototype,\n BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar aCallable = require('../internals/a-callable');\n\nmodule.exports = function (object, key, method) {\n try {\n // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\n return uncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method]));\n } catch (error) { /* empty */ }\n};\n","'use strict';\nvar isPossiblePrototype = require('../internals/is-possible-prototype');\n\nvar $String = String;\nvar $TypeError = TypeError;\n\nmodule.exports = function (argument) {\n if (isPossiblePrototype(argument)) return argument;\n throw new $TypeError(\"Can't set \" + $String(argument) + ' as a prototype');\n};\n","'use strict';\n// TODO: Remove this module from `core-js@4` since it's replaced to module below\nrequire('../modules/es.map.constructor');\n","'use strict';\nvar create = require('../internals/object-create');\nvar defineBuiltInAccessor = require('../internals/define-built-in-accessor');\nvar defineBuiltIns = require('../internals/define-built-ins');\nvar bind = require('../internals/function-bind-context');\nvar anInstance = require('../internals/an-instance');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\nvar iterate = require('../internals/iterate');\nvar defineIterator = require('../internals/iterator-define');\nvar createIterResultObject = require('../internals/create-iter-result-object');\nvar setSpecies = require('../internals/set-species');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar fastKey = require('../internals/internal-metadata').fastKey;\nvar InternalStateModule = require('../internals/internal-state');\n\nvar setInternalState = InternalStateModule.set;\nvar internalStateGetterFor = InternalStateModule.getterFor;\n\nmodule.exports = {\n getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {\n var Constructor = wrapper(function (that, iterable) {\n anInstance(that, Prototype);\n setInternalState(that, {\n type: CONSTRUCTOR_NAME,\n index: create(null),\n first: null,\n last: null,\n size: 0\n });\n if (!DESCRIPTORS) that.size = 0;\n if (!isNullOrUndefined(iterable)) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });\n });\n\n var Prototype = Constructor.prototype;\n\n var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);\n\n var define = function (that, key, value) {\n var state = getInternalState(that);\n var entry = getEntry(that, key);\n var previous, index;\n // change existing entry\n if (entry) {\n entry.value = value;\n // create new entry\n } else {\n state.last = entry = {\n index: index = fastKey(key, true),\n key: key,\n value: value,\n previous: previous = state.last,\n next: null,\n removed: false\n };\n if (!state.first) state.first = entry;\n if (previous) previous.next = entry;\n if (DESCRIPTORS) state.size++;\n else that.size++;\n // add to index\n if (index !== 'F') state.index[index] = entry;\n } return that;\n };\n\n var getEntry = function (that, key) {\n var state = getInternalState(that);\n // fast case\n var index = fastKey(key);\n var entry;\n if (index !== 'F') return state.index[index];\n // frozen object case\n for (entry = state.first; entry; entry = entry.next) {\n if (entry.key === key) return entry;\n }\n };\n\n defineBuiltIns(Prototype, {\n // `{ Map, Set }.prototype.clear()` methods\n // https://tc39.es/ecma262/#sec-map.prototype.clear\n // https://tc39.es/ecma262/#sec-set.prototype.clear\n clear: function clear() {\n var that = this;\n var state = getInternalState(that);\n var entry = state.first;\n while (entry) {\n entry.removed = true;\n if (entry.previous) entry.previous = entry.previous.next = null;\n entry = entry.next;\n }\n state.first = state.last = null;\n state.index = create(null);\n if (DESCRIPTORS) state.size = 0;\n else that.size = 0;\n },\n // `{ Map, Set }.prototype.delete(key)` methods\n // https://tc39.es/ecma262/#sec-map.prototype.delete\n // https://tc39.es/ecma262/#sec-set.prototype.delete\n 'delete': function (key) {\n var that = this;\n var state = getInternalState(that);\n var entry = getEntry(that, key);\n if (entry) {\n var next = entry.next;\n var prev = entry.previous;\n delete state.index[entry.index];\n entry.removed = true;\n if (prev) prev.next = next;\n if (next) next.previous = prev;\n if (state.first === entry) state.first = next;\n if (state.last === entry) state.last = prev;\n if (DESCRIPTORS) state.size--;\n else that.size--;\n } return !!entry;\n },\n // `{ Map, Set }.prototype.forEach(callbackfn, thisArg = undefined)` methods\n // https://tc39.es/ecma262/#sec-map.prototype.foreach\n // https://tc39.es/ecma262/#sec-set.prototype.foreach\n forEach: function forEach(callbackfn /* , that = undefined */) {\n var state = getInternalState(this);\n var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n var entry;\n while (entry = entry ? entry.next : state.first) {\n boundFunction(entry.value, entry.key, this);\n // revert to the last existing entry\n while (entry && entry.removed) entry = entry.previous;\n }\n },\n // `{ Map, Set}.prototype.has(key)` methods\n // https://tc39.es/ecma262/#sec-map.prototype.has\n // https://tc39.es/ecma262/#sec-set.prototype.has\n has: function has(key) {\n return !!getEntry(this, key);\n }\n });\n\n defineBuiltIns(Prototype, IS_MAP ? {\n // `Map.prototype.get(key)` method\n // https://tc39.es/ecma262/#sec-map.prototype.get\n get: function get(key) {\n var entry = getEntry(this, key);\n return entry && entry.value;\n },\n // `Map.prototype.set(key, value)` method\n // https://tc39.es/ecma262/#sec-map.prototype.set\n set: function set(key, value) {\n return define(this, key === 0 ? 0 : key, value);\n }\n } : {\n // `Set.prototype.add(value)` method\n // https://tc39.es/ecma262/#sec-set.prototype.add\n add: function add(value) {\n return define(this, value = value === 0 ? 0 : value, value);\n }\n });\n if (DESCRIPTORS) defineBuiltInAccessor(Prototype, 'size', {\n configurable: true,\n get: function () {\n return getInternalState(this).size;\n }\n });\n return Constructor;\n },\n setStrong: function (Constructor, CONSTRUCTOR_NAME, IS_MAP) {\n var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';\n var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);\n var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);\n // `{ Map, Set }.prototype.{ keys, values, entries, @@iterator }()` methods\n // https://tc39.es/ecma262/#sec-map.prototype.entries\n // https://tc39.es/ecma262/#sec-map.prototype.keys\n // https://tc39.es/ecma262/#sec-map.prototype.values\n // https://tc39.es/ecma262/#sec-map.prototype-@@iterator\n // https://tc39.es/ecma262/#sec-set.prototype.entries\n // https://tc39.es/ecma262/#sec-set.prototype.keys\n // https://tc39.es/ecma262/#sec-set.prototype.values\n // https://tc39.es/ecma262/#sec-set.prototype-@@iterator\n defineIterator(Constructor, CONSTRUCTOR_NAME, function (iterated, kind) {\n setInternalState(this, {\n type: ITERATOR_NAME,\n target: iterated,\n state: getInternalCollectionState(iterated),\n kind: kind,\n last: null\n });\n }, function () {\n var state = getInternalIteratorState(this);\n var kind = state.kind;\n var entry = state.last;\n // revert to the last existing entry\n while (entry && entry.removed) entry = entry.previous;\n // get next entry\n if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {\n // or finish the iteration\n state.target = null;\n return createIterResultObject(undefined, true);\n }\n // return step by kind\n if (kind === 'keys') return createIterResultObject(entry.key, false);\n if (kind === 'values') return createIterResultObject(entry.value, false);\n return createIterResultObject([entry.key, entry.value], false);\n }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);\n\n // `{ Map, Set }.prototype[@@species]` accessors\n // https://tc39.es/ecma262/#sec-get-map-@@species\n // https://tc39.es/ecma262/#sec-get-set-@@species\n setSpecies(CONSTRUCTOR_NAME);\n }\n};\n","'use strict';\n// TODO: Remove this module from `core-js@4` since it's replaced to module below\nrequire('../modules/es.set.constructor');\n","'use strict';\n// https://tc39.github.io/proposal-setmap-offrom/\nvar bind = require('../internals/function-bind-context');\nvar anObject = require('../internals/an-object');\nvar toObject = require('../internals/to-object');\nvar iterate = require('../internals/iterate');\n\nmodule.exports = function (C, adder, ENTRY) {\n return function from(source /* , mapFn, thisArg */) {\n var O = toObject(source);\n var length = arguments.length;\n var mapFn = length > 1 ? arguments[1] : undefined;\n var mapping = mapFn !== undefined;\n var boundFunction = mapping ? bind(mapFn, length > 2 ? arguments[2] : undefined) : undefined;\n var result = new C();\n var n = 0;\n iterate(O, function (nextItem) {\n var entry = mapping ? boundFunction(nextItem, n++) : nextItem;\n if (ENTRY) adder(result, anObject(entry)[0], entry[1]);\n else adder(result, entry);\n });\n return result;\n };\n};\n","'use strict';\nvar anObject = require('../internals/an-object');\n\n// https://tc39.github.io/proposal-setmap-offrom/\nmodule.exports = function (C, adder, ENTRY) {\n return function of() {\n var result = new C();\n var length = arguments.length;\n for (var index = 0; index < length; index++) {\n var entry = arguments[index];\n if (ENTRY) adder(result, anObject(entry)[0], entry[1]);\n else adder(result, entry);\n } return result;\n };\n};\n","'use strict';\n// iterable DOM collections\n// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods\nmodule.exports = {\n CSSRuleList: 0,\n CSSStyleDeclaration: 0,\n CSSValueList: 0,\n ClientRectList: 0,\n DOMRectList: 0,\n DOMStringList: 0,\n DOMTokenList: 1,\n DataTransferItemList: 0,\n FileList: 0,\n HTMLAllCollection: 0,\n HTMLCollection: 0,\n HTMLFormElement: 0,\n HTMLSelectElement: 0,\n MediaList: 0,\n MimeTypeArray: 0,\n NamedNodeMap: 0,\n NodeList: 1,\n PaintRequestList: 0,\n Plugin: 0,\n PluginArray: 0,\n SVGLengthList: 0,\n SVGNumberList: 0,\n SVGPathSegList: 0,\n SVGPointList: 0,\n SVGStringList: 0,\n SVGTransformList: 0,\n SourceBufferList: 0,\n StyleSheetList: 0,\n TextTrackCueList: 0,\n TextTrackList: 0,\n TouchList: 0\n};\n","'use strict';\n// in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`\nvar documentCreateElement = require('../internals/document-create-element');\n\nvar classList = documentCreateElement('span').classList;\nvar DOMTokenListPrototype = classList && classList.constructor && classList.constructor.prototype;\n\nmodule.exports = DOMTokenListPrototype === Object.prototype ? undefined : DOMTokenListPrototype;\n","'use strict';\n// TODO: Remove this module from `core-js@4` since it's split to modules listed below\nrequire('../modules/es.symbol.constructor');\nrequire('../modules/es.symbol.for');\nrequire('../modules/es.symbol.key-for');\nrequire('../modules/es.json.stringify');\nrequire('../modules/es.object.get-own-property-symbols');\n","'use strict';\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nexports.f = wellKnownSymbol;\n","'use strict';\nvar globalThis = require('../internals/global-this');\n\nmodule.exports = globalThis;\n","'use strict';\nvar call = require('../internals/function-call');\nvar getBuiltIn = require('../internals/get-built-in');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar defineBuiltIn = require('../internals/define-built-in');\n\nmodule.exports = function () {\n var Symbol = getBuiltIn('Symbol');\n var SymbolPrototype = Symbol && Symbol.prototype;\n var valueOf = SymbolPrototype && SymbolPrototype.valueOf;\n var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');\n\n if (SymbolPrototype && !SymbolPrototype[TO_PRIMITIVE]) {\n // `Symbol.prototype[@@toPrimitive]` method\n // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive\n // eslint-disable-next-line no-unused-vars -- required for .length\n defineBuiltIn(SymbolPrototype, TO_PRIMITIVE, function (hint) {\n return call(valueOf, this);\n }, { arity: 1 });\n }\n};\n","'use strict';\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\n\n/* eslint-disable es/no-symbol -- safe */\nmodule.exports = NATIVE_SYMBOL && !!Symbol['for'] && !!Symbol.keyFor;\n","// `Symbol.prototype.description` getter\n// https://tc39.es/ecma262/#sec-symbol.prototype.description\n'use strict';\nvar $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar globalThis = require('../internals/global-this');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar hasOwn = require('../internals/has-own-property');\nvar isCallable = require('../internals/is-callable');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar toString = require('../internals/to-string');\nvar defineBuiltInAccessor = require('../internals/define-built-in-accessor');\nvar copyConstructorProperties = require('../internals/copy-constructor-properties');\n\nvar NativeSymbol = globalThis.Symbol;\nvar SymbolPrototype = NativeSymbol && NativeSymbol.prototype;\n\nif (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototype) ||\n // Safari 12 bug\n NativeSymbol().description !== undefined\n)) {\n var EmptyStringDescriptionStore = {};\n // wrap Symbol constructor for correct work with undefined description\n var SymbolWrapper = function Symbol() {\n var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString(arguments[0]);\n var result = isPrototypeOf(SymbolPrototype, this)\n // eslint-disable-next-line sonar/inconsistent-function-call -- ok\n ? new NativeSymbol(description)\n // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'\n : description === undefined ? NativeSymbol() : NativeSymbol(description);\n if (description === '') EmptyStringDescriptionStore[result] = true;\n return result;\n };\n\n copyConstructorProperties(SymbolWrapper, NativeSymbol);\n SymbolWrapper.prototype = SymbolPrototype;\n SymbolPrototype.constructor = SymbolWrapper;\n\n var NATIVE_SYMBOL = String(NativeSymbol('description detection')) === 'Symbol(description detection)';\n var thisSymbolValue = uncurryThis(SymbolPrototype.valueOf);\n var symbolDescriptiveString = uncurryThis(SymbolPrototype.toString);\n var regexp = /^Symbol\\((.*)\\)[^)]+$/;\n var replace = uncurryThis(''.replace);\n var stringSlice = uncurryThis(''.slice);\n\n defineBuiltInAccessor(SymbolPrototype, 'description', {\n configurable: true,\n get: function description() {\n var symbol = thisSymbolValue(this);\n if (hasOwn(EmptyStringDescriptionStore, symbol)) return '';\n var string = symbolDescriptiveString(symbol);\n var desc = NATIVE_SYMBOL ? stringSlice(string, 7, -1) : replace(string, regexp, '$1');\n return desc === '' ? undefined : desc;\n }\n });\n\n $({ global: true, constructor: true, forced: true }, {\n Symbol: SymbolWrapper\n });\n}\n","'use strict';\nvar defineWellKnownSymbol = require('../internals/well-known-symbol-define');\n\n// `Symbol.asyncIterator` well-known symbol\n// https://tc39.es/ecma262/#sec-symbol.asynciterator\ndefineWellKnownSymbol('asyncIterator');\n","'use strict';\nvar defineWellKnownSymbol = require('../internals/well-known-symbol-define');\n\n// `Symbol.hasInstance` well-known symbol\n// https://tc39.es/ecma262/#sec-symbol.hasinstance\ndefineWellKnownSymbol('hasInstance');\n","'use strict';\nvar defineWellKnownSymbol = require('../internals/well-known-symbol-define');\n\n// `Symbol.isConcatSpreadable` well-known symbol\n// https://tc39.es/ecma262/#sec-symbol.isconcatspreadable\ndefineWellKnownSymbol('isConcatSpreadable');\n","'use strict';\nvar defineWellKnownSymbol = require('../internals/well-known-symbol-define');\n\n// `Symbol.iterator` well-known symbol\n// https://tc39.es/ecma262/#sec-symbol.iterator\ndefineWellKnownSymbol('iterator');\n","'use strict';\nvar defineWellKnownSymbol = require('../internals/well-known-symbol-define');\n\n// `Symbol.match` well-known symbol\n// https://tc39.es/ecma262/#sec-symbol.match\ndefineWellKnownSymbol('match');\n","'use strict';\nvar defineWellKnownSymbol = require('../internals/well-known-symbol-define');\n\n// `Symbol.replace` well-known symbol\n// https://tc39.es/ecma262/#sec-symbol.replace\ndefineWellKnownSymbol('replace');\n","'use strict';\nvar defineWellKnownSymbol = require('../internals/well-known-symbol-define');\n\n// `Symbol.search` well-known symbol\n// https://tc39.es/ecma262/#sec-symbol.search\ndefineWellKnownSymbol('search');\n","'use strict';\nvar defineWellKnownSymbol = require('../internals/well-known-symbol-define');\n\n// `Symbol.species` well-known symbol\n// https://tc39.es/ecma262/#sec-symbol.species\ndefineWellKnownSymbol('species');\n","'use strict';\nvar defineWellKnownSymbol = require('../internals/well-known-symbol-define');\n\n// `Symbol.split` well-known symbol\n// https://tc39.es/ecma262/#sec-symbol.split\ndefineWellKnownSymbol('split');\n","'use strict';\nvar defineWellKnownSymbol = require('../internals/well-known-symbol-define');\nvar defineSymbolToPrimitive = require('../internals/symbol-define-to-primitive');\n\n// `Symbol.toPrimitive` well-known symbol\n// https://tc39.es/ecma262/#sec-symbol.toprimitive\ndefineWellKnownSymbol('toPrimitive');\n\n// `Symbol.prototype[@@toPrimitive]` method\n// https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive\ndefineSymbolToPrimitive();\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\nvar defineWellKnownSymbol = require('../internals/well-known-symbol-define');\nvar setToStringTag = require('../internals/set-to-string-tag');\n\n// `Symbol.toStringTag` well-known symbol\n// https://tc39.es/ecma262/#sec-symbol.tostringtag\ndefineWellKnownSymbol('toStringTag');\n\n// `Symbol.prototype[@@toStringTag]` property\n// https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag\nsetToStringTag(getBuiltIn('Symbol'), 'Symbol');\n","'use strict';\nvar defineWellKnownSymbol = require('../internals/well-known-symbol-define');\n\n// `Symbol.unscopables` well-known symbol\n// https://tc39.es/ecma262/#sec-symbol.unscopables\ndefineWellKnownSymbol('unscopables');\n","'use strict';\nvar $ = require('../internals/export');\nvar fails = require('../internals/fails');\nvar isArray = require('../internals/is-array');\nvar isObject = require('../internals/is-object');\nvar toObject = require('../internals/to-object');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar doesNotExceedSafeInteger = require('../internals/does-not-exceed-safe-integer');\nvar createProperty = require('../internals/create-property');\nvar arraySpeciesCreate = require('../internals/array-species-create');\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar V8_VERSION = require('../internals/environment-v8-version');\n\nvar IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');\n\n// We can't use this feature detection in V8 since it causes\n// deoptimization and serious performance degradation\n// https://github.com/zloirock/core-js/issues/679\nvar IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {\n var array = [];\n array[IS_CONCAT_SPREADABLE] = false;\n return array.concat()[0] !== array;\n});\n\nvar isConcatSpreadable = function (O) {\n if (!isObject(O)) return false;\n var spreadable = O[IS_CONCAT_SPREADABLE];\n return spreadable !== undefined ? !!spreadable : isArray(O);\n};\n\nvar FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !arrayMethodHasSpeciesSupport('concat');\n\n// `Array.prototype.concat` method\n// https://tc39.es/ecma262/#sec-array.prototype.concat\n// with adding support of @@isConcatSpreadable and @@species\n$({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n concat: function concat(arg) {\n var O = toObject(this);\n var A = arraySpeciesCreate(O, 0);\n var n = 0;\n var i, k, length, len, E;\n for (i = -1, length = arguments.length; i < length; i++) {\n E = i === -1 ? O : arguments[i];\n if (isConcatSpreadable(E)) {\n len = lengthOfArrayLike(E);\n doesNotExceedSafeInteger(n + len);\n for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);\n } else {\n doesNotExceedSafeInteger(n + 1);\n createProperty(A, n++, E);\n }\n }\n A.length = n;\n return A;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar from = require('../internals/array-from');\nvar checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration');\n\nvar INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) {\n // eslint-disable-next-line es/no-array-from -- required for testing\n Array.from(iterable);\n});\n\n// `Array.from` method\n// https://tc39.es/ecma262/#sec-array.from\n$({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, {\n from: from\n});\n","'use strict';\nvar bind = require('../internals/function-bind-context');\nvar call = require('../internals/function-call');\nvar toObject = require('../internals/to-object');\nvar callWithSafeIterationClosing = require('../internals/call-with-safe-iteration-closing');\nvar isArrayIteratorMethod = require('../internals/is-array-iterator-method');\nvar isConstructor = require('../internals/is-constructor');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar createProperty = require('../internals/create-property');\nvar getIterator = require('../internals/get-iterator');\nvar getIteratorMethod = require('../internals/get-iterator-method');\n\nvar $Array = Array;\n\n// `Array.from` method implementation\n// https://tc39.es/ecma262/#sec-array.from\nmodule.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {\n var O = toObject(arrayLike);\n var IS_CONSTRUCTOR = isConstructor(this);\n var argumentsLength = arguments.length;\n var mapfn = argumentsLength > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined);\n var iteratorMethod = getIteratorMethod(O);\n var index = 0;\n var length, result, step, iterator, next, value;\n // if the target is not iterable or it's an array with the default iterator - use a simple case\n if (iteratorMethod && !(this === $Array && isArrayIteratorMethod(iteratorMethod))) {\n result = IS_CONSTRUCTOR ? new this() : [];\n iterator = getIterator(O, iteratorMethod);\n next = iterator.next;\n for (;!(step = call(next, iterator)).done; index++) {\n value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;\n createProperty(result, index, value);\n }\n } else {\n length = lengthOfArrayLike(O);\n result = IS_CONSTRUCTOR ? new this(length) : $Array(length);\n for (;length > index; index++) {\n value = mapping ? mapfn(O[index], index) : O[index];\n createProperty(result, index, value);\n }\n }\n result.length = index;\n return result;\n};\n","'use strict';\nvar globalThis = require('../internals/global-this');\nvar setToStringTag = require('../internals/set-to-string-tag');\n\n// JSON[@@toStringTag] property\n// https://tc39.es/ecma262/#sec-json-@@tostringtag\nsetToStringTag(globalThis.JSON, 'JSON', true);\n","'use strict';\nvar setToStringTag = require('../internals/set-to-string-tag');\n\n// Math[@@toStringTag] property\n// https://tc39.es/ecma262/#sec-math-@@tostringtag\nsetToStringTag(Math, 'Math', true);\n","'use strict';\n\nvar asap = require('asap/raw');\n\nfunction noop() {}\n\n// States:\n//\n// 0 - pending\n// 1 - fulfilled with _value\n// 2 - rejected with _value\n// 3 - adopted the state of another promise, _value\n//\n// once the state is no longer pending (0) it is immutable\n\n// All `_` prefixed properties will be reduced to `_{random number}`\n// at build time to obfuscate them and discourage their use.\n// We don't use symbols or Object.defineProperty to fully hide them\n// because the performance isn't good enough.\n\n\n// to avoid using try/catch inside critical functions, we\n// extract them to here.\nvar LAST_ERROR = null;\nvar IS_ERROR = {};\nfunction getThen(obj) {\n try {\n return obj.then;\n } catch (ex) {\n LAST_ERROR = ex;\n return IS_ERROR;\n }\n}\n\nfunction tryCallOne(fn, a) {\n try {\n return fn(a);\n } catch (ex) {\n LAST_ERROR = ex;\n return IS_ERROR;\n }\n}\nfunction tryCallTwo(fn, a, b) {\n try {\n fn(a, b);\n } catch (ex) {\n LAST_ERROR = ex;\n return IS_ERROR;\n }\n}\n\nmodule.exports = Promise;\n\nfunction Promise(fn) {\n if (typeof this !== 'object') {\n throw new TypeError('Promises must be constructed via new');\n }\n if (typeof fn !== 'function') {\n throw new TypeError('Promise constructor\\'s argument is not a function');\n }\n this._x = 0;\n this._y = 0;\n this._z = null;\n this._A = null;\n if (fn === noop) return;\n doResolve(fn, this);\n}\nPromise._B = null;\nPromise._C = null;\nPromise._D = noop;\n\nPromise.prototype.then = function(onFulfilled, onRejected) {\n if (this.constructor !== Promise) {\n return safeThen(this, onFulfilled, onRejected);\n }\n var res = new Promise(noop);\n handle(this, new Handler(onFulfilled, onRejected, res));\n return res;\n};\n\nfunction safeThen(self, onFulfilled, onRejected) {\n return new self.constructor(function (resolve, reject) {\n var res = new Promise(noop);\n res.then(resolve, reject);\n handle(self, new Handler(onFulfilled, onRejected, res));\n });\n}\nfunction handle(self, deferred) {\n while (self._y === 3) {\n self = self._z;\n }\n if (Promise._B) {\n Promise._B(self);\n }\n if (self._y === 0) {\n if (self._x === 0) {\n self._x = 1;\n self._A = deferred;\n return;\n }\n if (self._x === 1) {\n self._x = 2;\n self._A = [self._A, deferred];\n return;\n }\n self._A.push(deferred);\n return;\n }\n handleResolved(self, deferred);\n}\n\nfunction handleResolved(self, deferred) {\n asap(function() {\n var cb = self._y === 1 ? deferred.onFulfilled : deferred.onRejected;\n if (cb === null) {\n if (self._y === 1) {\n resolve(deferred.promise, self._z);\n } else {\n reject(deferred.promise, self._z);\n }\n return;\n }\n var ret = tryCallOne(cb, self._z);\n if (ret === IS_ERROR) {\n reject(deferred.promise, LAST_ERROR);\n } else {\n resolve(deferred.promise, ret);\n }\n });\n}\nfunction resolve(self, newValue) {\n // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure\n if (newValue === self) {\n return reject(\n self,\n new TypeError('A promise cannot be resolved with itself.')\n );\n }\n if (\n newValue &&\n (typeof newValue === 'object' || typeof newValue === 'function')\n ) {\n var then = getThen(newValue);\n if (then === IS_ERROR) {\n return reject(self, LAST_ERROR);\n }\n if (\n then === self.then &&\n newValue instanceof Promise\n ) {\n self._y = 3;\n self._z = newValue;\n finale(self);\n return;\n } else if (typeof then === 'function') {\n doResolve(then.bind(newValue), self);\n return;\n }\n }\n self._y = 1;\n self._z = newValue;\n finale(self);\n}\n\nfunction reject(self, newValue) {\n self._y = 2;\n self._z = newValue;\n if (Promise._C) {\n Promise._C(self, newValue);\n }\n finale(self);\n}\nfunction finale(self) {\n if (self._x === 1) {\n handle(self, self._A);\n self._A = null;\n }\n if (self._x === 2) {\n for (var i = 0; i < self._A.length; i++) {\n handle(self, self._A[i]);\n }\n self._A = null;\n }\n}\n\nfunction Handler(onFulfilled, onRejected, promise){\n this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;\n this.onRejected = typeof onRejected === 'function' ? onRejected : null;\n this.promise = promise;\n}\n\n/**\n * Take a potentially misbehaving resolver function and make sure\n * onFulfilled and onRejected are only called once.\n *\n * Makes no guarantees about asynchrony.\n */\nfunction doResolve(fn, promise) {\n var done = false;\n var res = tryCallTwo(fn, function (value) {\n if (done) return;\n done = true;\n resolve(promise, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(promise, reason);\n });\n if (!done && res === IS_ERROR) {\n done = true;\n reject(promise, LAST_ERROR);\n }\n}\n","'use strict';\nvar toObject = require('../internals/to-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar deletePropertyOrThrow = require('../internals/delete-property-or-throw');\n\nvar min = Math.min;\n\n// `Array.prototype.copyWithin` method implementation\n// https://tc39.es/ecma262/#sec-array.prototype.copywithin\n// eslint-disable-next-line es/no-array-prototype-copywithin -- safe\nmodule.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {\n var O = toObject(this);\n var len = lengthOfArrayLike(O);\n var to = toAbsoluteIndex(target, len);\n var from = toAbsoluteIndex(start, len);\n var end = arguments.length > 2 ? arguments[2] : undefined;\n var count = min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to);\n var inc = 1;\n if (from < to && to < from + count) {\n inc = -1;\n from += count - 1;\n to += count - 1;\n }\n while (count-- > 0) {\n if (from in O) O[to] = O[from];\n else deletePropertyOrThrow(O, to);\n to += inc;\n from += inc;\n } return O;\n};\n","'use strict';\nvar isArray = require('../internals/is-array');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar doesNotExceedSafeInteger = require('../internals/does-not-exceed-safe-integer');\nvar bind = require('../internals/function-bind-context');\n\n// `FlattenIntoArray` abstract operation\n// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray\nvar flattenIntoArray = function (target, original, source, sourceLen, start, depth, mapper, thisArg) {\n var targetIndex = start;\n var sourceIndex = 0;\n var mapFn = mapper ? bind(mapper, thisArg) : false;\n var element, elementLen;\n\n while (sourceIndex < sourceLen) {\n if (sourceIndex in source) {\n element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];\n\n if (depth > 0 && isArray(element)) {\n elementLen = lengthOfArrayLike(element);\n targetIndex = flattenIntoArray(target, original, element, elementLen, targetIndex, depth - 1) - 1;\n } else {\n doesNotExceedSafeInteger(targetIndex + 1);\n target[targetIndex] = element;\n }\n\n targetIndex++;\n }\n sourceIndex++;\n }\n return targetIndex;\n};\n\nmodule.exports = flattenIntoArray;\n","'use strict';\nvar userAgent = require('../internals/environment-user-agent');\n\nvar firefox = userAgent.match(/firefox\\/(\\d+)/i);\n\nmodule.exports = !!firefox && +firefox[1];\n","'use strict';\nvar UA = require('../internals/environment-user-agent');\n\nmodule.exports = /MSIE|Trident/.test(UA);\n","'use strict';\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\nvar toLength = require('../internals/to-length');\n\nvar $RangeError = RangeError;\n\n// `ToIndex` abstract operation\n// https://tc39.es/ecma262/#sec-toindex\nmodule.exports = function (it) {\n if (it === undefined) return 0;\n var number = toIntegerOrInfinity(it);\n var length = toLength(number);\n if (number !== length) throw new $RangeError('Wrong length or index');\n return length;\n};\n","'use strict';\nvar floatRound = require('../internals/math-float-round');\n\nvar FLOAT32_EPSILON = 1.1920928955078125e-7; // 2 ** -23;\nvar FLOAT32_MAX_VALUE = 3.4028234663852886e+38; // 2 ** 128 - 2 ** 104\nvar FLOAT32_MIN_VALUE = 1.1754943508222875e-38; // 2 ** -126;\n\n// `Math.fround` method implementation\n// https://tc39.es/ecma262/#sec-math.fround\n// eslint-disable-next-line es/no-math-fround -- safe\nmodule.exports = Math.fround || function fround(x) {\n return floatRound(x, FLOAT32_EPSILON, FLOAT32_MAX_VALUE, FLOAT32_MIN_VALUE);\n};\n","'use strict';\nvar log = Math.log;\n\n// `Math.log1p` method implementation\n// https://tc39.es/ecma262/#sec-math.log1p\n// eslint-disable-next-line es/no-math-log1p -- safe\nmodule.exports = Math.log1p || function log1p(x) {\n var n = +x;\n return n > -1e-8 && n < 1e-8 ? n - n * n / 2 : log(1 + n);\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\n\n// `thisNumberValue` abstract operation\n// https://tc39.es/ecma262/#sec-thisnumbervalue\nmodule.exports = uncurryThis(1.0.valueOf);\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar call = require('../internals/function-call');\nvar fails = require('../internals/fails');\nvar objectKeys = require('../internals/object-keys');\nvar getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar toObject = require('../internals/to-object');\nvar IndexedObject = require('../internals/indexed-object');\n\n// eslint-disable-next-line es/no-object-assign -- safe\nvar $assign = Object.assign;\n// eslint-disable-next-line es/no-object-defineproperty -- required for testing\nvar defineProperty = Object.defineProperty;\nvar concat = uncurryThis([].concat);\n\n// `Object.assign` method\n// https://tc39.es/ecma262/#sec-object.assign\nmodule.exports = !$assign || fails(function () {\n // should have correct order of operations (Edge bug)\n if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {\n enumerable: true,\n get: function () {\n defineProperty(this, 'b', {\n value: 3,\n enumerable: false\n });\n }\n }), { b: 2 })).b !== 1) return true;\n // should work with symbols and should have deterministic property order (V8 bug)\n var A = {};\n var B = {};\n // eslint-disable-next-line es/no-symbol -- safe\n var symbol = Symbol('assign detection');\n var alphabet = 'abcdefghijklmnopqrst';\n A[symbol] = 7;\n alphabet.split('').forEach(function (chr) { B[chr] = chr; });\n return $assign({}, A)[symbol] !== 7 || objectKeys($assign({}, B)).join('') !== alphabet;\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`\n var T = toObject(target);\n var argumentsLength = arguments.length;\n var index = 1;\n var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;\n var propertyIsEnumerable = propertyIsEnumerableModule.f;\n while (argumentsLength > index) {\n var S = IndexedObject(arguments[index++]);\n var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);\n var length = keys.length;\n var j = 0;\n var key;\n while (length > j) {\n key = keys[j++];\n if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key];\n }\n } return T;\n} : $assign;\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar objectGetPrototypeOf = require('../internals/object-get-prototype-of');\nvar objectKeys = require('../internals/object-keys');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar $propertyIsEnumerable = require('../internals/object-property-is-enumerable').f;\n\nvar propertyIsEnumerable = uncurryThis($propertyIsEnumerable);\nvar push = uncurryThis([].push);\n\n// in some IE versions, `propertyIsEnumerable` returns incorrect result on integer keys\n// of `null` prototype objects\nvar IE_BUG = DESCRIPTORS && fails(function () {\n // eslint-disable-next-line es/no-object-create -- safe\n var O = Object.create(null);\n O[2] = 2;\n return !propertyIsEnumerable(O, 2);\n});\n\n// `Object.{ entries, values }` methods implementation\nvar createMethod = function (TO_ENTRIES) {\n return function (it) {\n var O = toIndexedObject(it);\n var keys = objectKeys(O);\n var IE_WORKAROUND = IE_BUG && objectGetPrototypeOf(O) === null;\n var length = keys.length;\n var i = 0;\n var result = [];\n var key;\n while (length > i) {\n key = keys[i++];\n if (!DESCRIPTORS || (IE_WORKAROUND ? key in O : propertyIsEnumerable(O, key))) {\n push(result, TO_ENTRIES ? [key, O[key]] : O[key]);\n }\n }\n return result;\n };\n};\n\nmodule.exports = {\n // `Object.entries` method\n // https://tc39.es/ecma262/#sec-object.entries\n entries: createMethod(true),\n // `Object.values` method\n // https://tc39.es/ecma262/#sec-object.values\n values: createMethod(false)\n};\n","'use strict';\n// `SameValue` abstract operation\n// https://tc39.es/ecma262/#sec-samevalue\n// eslint-disable-next-line es/no-object-is -- safe\nmodule.exports = Object.is || function is(x, y) {\n // eslint-disable-next-line no-self-compare -- NaN check\n return x === y ? x !== 0 || 1 / x === 1 / y : x !== x && y !== y;\n};\n","'use strict';\nvar userAgent = require('../internals/environment-user-agent');\n\n// eslint-disable-next-line redos/no-vulnerable -- safe\nmodule.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent);\n","'use strict';\nvar globalThis = require('../internals/global-this');\nvar safeGetBuiltIn = require('../internals/safe-get-built-in');\nvar bind = require('../internals/function-bind-context');\nvar macrotask = require('../internals/task').set;\nvar Queue = require('../internals/queue');\nvar IS_IOS = require('../internals/environment-is-ios');\nvar IS_IOS_PEBBLE = require('../internals/environment-is-ios-pebble');\nvar IS_WEBOS_WEBKIT = require('../internals/environment-is-webos-webkit');\nvar IS_NODE = require('../internals/environment-is-node');\n\nvar MutationObserver = globalThis.MutationObserver || globalThis.WebKitMutationObserver;\nvar document = globalThis.document;\nvar process = globalThis.process;\nvar Promise = globalThis.Promise;\nvar microtask = safeGetBuiltIn('queueMicrotask');\nvar notify, toggle, node, promise, then;\n\n// modern engines have queueMicrotask method\nif (!microtask) {\n var queue = new Queue();\n\n var flush = function () {\n var parent, fn;\n if (IS_NODE && (parent = process.domain)) parent.exit();\n while (fn = queue.get()) try {\n fn();\n } catch (error) {\n if (queue.head) notify();\n throw error;\n }\n if (parent) parent.enter();\n };\n\n // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339\n // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898\n if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document) {\n toggle = true;\n node = document.createTextNode('');\n new MutationObserver(flush).observe(node, { characterData: true });\n notify = function () {\n node.data = toggle = !toggle;\n };\n // environments with maybe non-completely correct, but existent Promise\n } else if (!IS_IOS_PEBBLE && Promise && Promise.resolve) {\n // Promise.resolve without an argument throws an error in LG WebOS 2\n promise = Promise.resolve(undefined);\n // workaround of WebKit ~ iOS Safari 10.1 bug\n promise.constructor = Promise;\n then = bind(promise.then, promise);\n notify = function () {\n then(flush);\n };\n // Node.js without promises\n } else if (IS_NODE) {\n notify = function () {\n process.nextTick(flush);\n };\n // for other environments - macrotask based on:\n // - setImmediate\n // - MessageChannel\n // - window.postMessage\n // - onreadystatechange\n // - setTimeout\n } else {\n // `webpack` dev server bug on IE global methods - use bind(fn, global)\n macrotask = bind(macrotask, globalThis);\n notify = function () {\n macrotask(flush);\n };\n }\n\n microtask = function (fn) {\n if (!queue.head) notify();\n queue.add(fn);\n };\n}\n\nmodule.exports = microtask;\n","'use strict';\nvar globalThis = require('../internals/global-this');\nvar DESCRIPTORS = require('../internals/descriptors');\n\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// Avoid NodeJS experimental warning\nmodule.exports = function (name) {\n if (!DESCRIPTORS) return globalThis[name];\n var descriptor = getOwnPropertyDescriptor(globalThis, name);\n return descriptor && descriptor.value;\n};\n","'use strict';\nvar Queue = function () {\n this.head = null;\n this.tail = null;\n};\n\nQueue.prototype = {\n add: function (item) {\n var entry = { item: item, next: null };\n var tail = this.tail;\n if (tail) tail.next = entry;\n else this.head = entry;\n this.tail = entry;\n },\n get: function () {\n var entry = this.head;\n if (entry) {\n var next = this.head = entry.next;\n if (next === null) this.tail = null;\n return entry.item;\n }\n }\n};\n\nmodule.exports = Queue;\n","'use strict';\nvar NativePromiseConstructor = require('../internals/promise-native-constructor');\nvar checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration');\nvar FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR;\n\nmodule.exports = FORCED_PROMISE_CONSTRUCTOR || !checkCorrectnessOfIteration(function (iterable) {\n NativePromiseConstructor.all(iterable).then(undefined, function () { /* empty */ });\n});\n","'use strict';\nvar anObject = require('../internals/an-object');\nvar isObject = require('../internals/is-object');\nvar newPromiseCapability = require('../internals/new-promise-capability');\n\nmodule.exports = function (C, x) {\n anObject(C);\n if (isObject(x) && x.constructor === C) return x;\n var promiseCapability = newPromiseCapability.f(C);\n var resolve = promiseCapability.resolve;\n resolve(x);\n return promiseCapability.promise;\n};\n","'use strict';\nvar hasOwn = require('../internals/has-own-property');\n\nmodule.exports = function (descriptor) {\n return descriptor !== undefined && (hasOwn(descriptor, 'value') || hasOwn(descriptor, 'writable'));\n};\n","'use strict';\nvar isObject = require('../internals/is-object');\nvar classof = require('../internals/classof-raw');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar MATCH = wellKnownSymbol('match');\n\n// `IsRegExp` abstract operation\n// https://tc39.es/ecma262/#sec-isregexp\nmodule.exports = function (it) {\n var isRegExp;\n return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) === 'RegExp');\n};\n","'use strict';\nvar call = require('../internals/function-call');\nvar hasOwn = require('../internals/has-own-property');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar regExpFlags = require('../internals/regexp-flags');\n\nvar RegExpPrototype = RegExp.prototype;\n\nmodule.exports = function (R) {\n var flags = R.flags;\n return flags === undefined && !('flags' in RegExpPrototype) && !hasOwn(R, 'flags') && isPrototypeOf(RegExpPrototype, R)\n ? call(regExpFlags, R) : flags;\n};\n","'use strict';\nvar fails = require('../internals/fails');\nvar globalThis = require('../internals/global-this');\n\n// babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError\nvar $RegExp = globalThis.RegExp;\n\nmodule.exports = fails(function () {\n var re = $RegExp('.', 's');\n return !(re.dotAll && re.test('\\n') && re.flags === 's');\n});\n","'use strict';\nvar fails = require('../internals/fails');\nvar globalThis = require('../internals/global-this');\n\n// babel-minify and Closure Compiler transpiles RegExp('(?b)', 'g') -> /(?b)/g and it causes SyntaxError\nvar $RegExp = globalThis.RegExp;\n\nmodule.exports = fails(function () {\n var re = $RegExp('(?b)', 'g');\n return re.exec('b').groups.a !== 'b' ||\n 'b'.replace(re, '$c') !== 'bc';\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar exec = require('../internals/regexp-exec');\n\n// `RegExp.prototype.exec` method\n// https://tc39.es/ecma262/#sec-regexp.prototype.exec\n$({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {\n exec: exec\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\n\nvar $RangeError = RangeError;\nvar fromCharCode = String.fromCharCode;\n// eslint-disable-next-line es/no-string-fromcodepoint -- required for testing\nvar $fromCodePoint = String.fromCodePoint;\nvar join = uncurryThis([].join);\n\n// length should be 1, old FF problem\nvar INCORRECT_LENGTH = !!$fromCodePoint && $fromCodePoint.length !== 1;\n\n// `String.fromCodePoint` method\n// https://tc39.es/ecma262/#sec-string.fromcodepoint\n$({ target: 'String', stat: true, arity: 1, forced: INCORRECT_LENGTH }, {\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n fromCodePoint: function fromCodePoint(x) {\n var elements = [];\n var length = arguments.length;\n var i = 0;\n var code;\n while (length > i) {\n code = +arguments[i++];\n if (toAbsoluteIndex(code, 0x10FFFF) !== code) throw new $RangeError(code + ' is not a valid code point');\n elements[i] = code < 0x10000\n ? fromCharCode(code)\n : fromCharCode(((code -= 0x10000) >> 10) + 0xD800, code % 0x400 + 0xDC00);\n } return join(elements, '');\n }\n});\n","'use strict';\n// https://github.com/tc39/proposal-string-pad-start-end\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar toLength = require('../internals/to-length');\nvar toString = require('../internals/to-string');\nvar $repeat = require('../internals/string-repeat');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nvar repeat = uncurryThis($repeat);\nvar stringSlice = uncurryThis(''.slice);\nvar ceil = Math.ceil;\n\n// `String.prototype.{ padStart, padEnd }` methods implementation\nvar createMethod = function (IS_END) {\n return function ($this, maxLength, fillString) {\n var S = toString(requireObjectCoercible($this));\n var intMaxLength = toLength(maxLength);\n var stringLength = S.length;\n var fillStr = fillString === undefined ? ' ' : toString(fillString);\n var fillLen, stringFiller;\n if (intMaxLength <= stringLength || fillStr === '') return S;\n fillLen = intMaxLength - stringLength;\n stringFiller = repeat(fillStr, ceil(fillLen / fillStr.length));\n if (stringFiller.length > fillLen) stringFiller = stringSlice(stringFiller, 0, fillLen);\n return IS_END ? S + stringFiller : stringFiller + S;\n };\n};\n\nmodule.exports = {\n // `String.prototype.padStart` method\n // https://tc39.es/ecma262/#sec-string.prototype.padstart\n start: createMethod(false),\n // `String.prototype.padEnd` method\n // https://tc39.es/ecma262/#sec-string.prototype.padend\n end: createMethod(true)\n};\n","'use strict';\n// https://github.com/zloirock/core-js/issues/280\nvar userAgent = require('../internals/environment-user-agent');\n\nmodule.exports = /Version\\/10(?:\\.\\d+){1,2}(?: [\\w./]+)?(?: Mobile\\/\\w+)? Safari\\//.test(userAgent);\n","'use strict';\nvar $trimEnd = require('../internals/string-trim').end;\nvar forcedStringTrimMethod = require('../internals/string-trim-forced');\n\n// `String.prototype.{ trimEnd, trimRight }` method\n// https://tc39.es/ecma262/#sec-string.prototype.trimend\n// https://tc39.es/ecma262/#String.prototype.trimright\nmodule.exports = forcedStringTrimMethod('trimEnd') ? function trimEnd() {\n return $trimEnd(this);\n// eslint-disable-next-line es/no-string-prototype-trimstart-trimend -- safe\n} : ''.trimEnd;\n","'use strict';\nvar $trimStart = require('../internals/string-trim').start;\nvar forcedStringTrimMethod = require('../internals/string-trim-forced');\n\n// `String.prototype.{ trimStart, trimLeft }` method\n// https://tc39.es/ecma262/#sec-string.prototype.trimstart\n// https://tc39.es/ecma262/#String.prototype.trimleft\nmodule.exports = forcedStringTrimMethod('trimStart') ? function trimStart() {\n return $trimStart(this);\n// eslint-disable-next-line es/no-string-prototype-trimstart-trimend -- safe\n} : ''.trimStart;\n","'use strict';\nvar toPositiveInteger = require('../internals/to-positive-integer');\n\nvar $RangeError = RangeError;\n\nmodule.exports = function (it, BYTES) {\n var offset = toPositiveInteger(it);\n if (offset % BYTES) throw new $RangeError('Wrong offset');\n return offset;\n};\n","'use strict';\nvar bind = require('../internals/function-bind-context');\nvar call = require('../internals/function-call');\nvar aConstructor = require('../internals/a-constructor');\nvar toObject = require('../internals/to-object');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar getIterator = require('../internals/get-iterator');\nvar getIteratorMethod = require('../internals/get-iterator-method');\nvar isArrayIteratorMethod = require('../internals/is-array-iterator-method');\nvar isBigIntArray = require('../internals/is-big-int-array');\nvar aTypedArrayConstructor = require('../internals/array-buffer-view-core').aTypedArrayConstructor;\nvar toBigInt = require('../internals/to-big-int');\n\nmodule.exports = function from(source /* , mapfn, thisArg */) {\n var C = aConstructor(this);\n var O = toObject(source);\n var argumentsLength = arguments.length;\n var mapfn = argumentsLength > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var iteratorMethod = getIteratorMethod(O);\n var i, length, result, thisIsBigIntArray, value, step, iterator, next;\n if (iteratorMethod && !isArrayIteratorMethod(iteratorMethod)) {\n iterator = getIterator(O, iteratorMethod);\n next = iterator.next;\n O = [];\n while (!(step = call(next, iterator)).done) {\n O.push(step.value);\n }\n }\n if (mapping && argumentsLength > 2) {\n mapfn = bind(mapfn, arguments[2]);\n }\n length = lengthOfArrayLike(O);\n result = new (aTypedArrayConstructor(C))(length);\n thisIsBigIntArray = isBigIntArray(result);\n for (i = 0; length > i; i++) {\n value = mapping ? mapfn(O[i], i) : O[i];\n // FF30- typed arrays doesn't properly convert objects to typed array values\n result[i] = thisIsBigIntArray ? toBigInt(value) : +value;\n }\n return result;\n};\n","'use strict';\nvar toPrimitive = require('../internals/to-primitive');\n\nvar $TypeError = TypeError;\n\n// `ToBigInt` abstract operation\n// https://tc39.es/ecma262/#sec-tobigint\nmodule.exports = function (argument) {\n var prim = toPrimitive(argument, 'number');\n if (typeof prim == 'number') throw new $TypeError(\"Can't convert number to bigint\");\n // eslint-disable-next-line es/no-bigint -- safe\n return BigInt(prim);\n};\n","'use strict';\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\n\nmodule.exports = function (Constructor, list, $length) {\n var index = 0;\n var length = arguments.length > 2 ? $length : lengthOfArrayLike(list);\n var result = new Constructor(length);\n while (length > index) result[index] = list[index++];\n return result;\n};\n","'use strict';\nvar aCallable = require('../internals/a-callable');\nvar toObject = require('../internals/to-object');\nvar IndexedObject = require('../internals/indexed-object');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\n\nvar $TypeError = TypeError;\n\nvar REDUCE_EMPTY = 'Reduce of empty array with no initial value';\n\n// `Array.prototype.{ reduce, reduceRight }` methods implementation\nvar createMethod = function (IS_RIGHT) {\n return function (that, callbackfn, argumentsLength, memo) {\n var O = toObject(that);\n var self = IndexedObject(O);\n var length = lengthOfArrayLike(O);\n aCallable(callbackfn);\n if (length === 0 && argumentsLength < 2) throw new $TypeError(REDUCE_EMPTY);\n var index = IS_RIGHT ? length - 1 : 0;\n var i = IS_RIGHT ? -1 : 1;\n if (argumentsLength < 2) while (true) {\n if (index in self) {\n memo = self[index];\n index += i;\n break;\n }\n index += i;\n if (IS_RIGHT ? index < 0 : length <= index) {\n throw new $TypeError(REDUCE_EMPTY);\n }\n }\n for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {\n memo = callbackfn(memo, self[index], index, O);\n }\n return memo;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.reduce` method\n // https://tc39.es/ecma262/#sec-array.prototype.reduce\n left: createMethod(false),\n // `Array.prototype.reduceRight` method\n // https://tc39.es/ecma262/#sec-array.prototype.reduceright\n right: createMethod(true)\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar defineBuiltIns = require('../internals/define-built-ins');\nvar getWeakData = require('../internals/internal-metadata').getWeakData;\nvar anInstance = require('../internals/an-instance');\nvar anObject = require('../internals/an-object');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\nvar isObject = require('../internals/is-object');\nvar iterate = require('../internals/iterate');\nvar ArrayIterationModule = require('../internals/array-iteration');\nvar hasOwn = require('../internals/has-own-property');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar setInternalState = InternalStateModule.set;\nvar internalStateGetterFor = InternalStateModule.getterFor;\nvar find = ArrayIterationModule.find;\nvar findIndex = ArrayIterationModule.findIndex;\nvar splice = uncurryThis([].splice);\nvar id = 0;\n\n// fallback for uncaught frozen keys\nvar uncaughtFrozenStore = function (state) {\n return state.frozen || (state.frozen = new UncaughtFrozenStore());\n};\n\nvar UncaughtFrozenStore = function () {\n this.entries = [];\n};\n\nvar findUncaughtFrozen = function (store, key) {\n return find(store.entries, function (it) {\n return it[0] === key;\n });\n};\n\nUncaughtFrozenStore.prototype = {\n get: function (key) {\n var entry = findUncaughtFrozen(this, key);\n if (entry) return entry[1];\n },\n has: function (key) {\n return !!findUncaughtFrozen(this, key);\n },\n set: function (key, value) {\n var entry = findUncaughtFrozen(this, key);\n if (entry) entry[1] = value;\n else this.entries.push([key, value]);\n },\n 'delete': function (key) {\n var index = findIndex(this.entries, function (it) {\n return it[0] === key;\n });\n if (~index) splice(this.entries, index, 1);\n return !!~index;\n }\n};\n\nmodule.exports = {\n getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {\n var Constructor = wrapper(function (that, iterable) {\n anInstance(that, Prototype);\n setInternalState(that, {\n type: CONSTRUCTOR_NAME,\n id: id++,\n frozen: null\n });\n if (!isNullOrUndefined(iterable)) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });\n });\n\n var Prototype = Constructor.prototype;\n\n var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);\n\n var define = function (that, key, value) {\n var state = getInternalState(that);\n var data = getWeakData(anObject(key), true);\n if (data === true) uncaughtFrozenStore(state).set(key, value);\n else data[state.id] = value;\n return that;\n };\n\n defineBuiltIns(Prototype, {\n // `{ WeakMap, WeakSet }.prototype.delete(key)` methods\n // https://tc39.es/ecma262/#sec-weakmap.prototype.delete\n // https://tc39.es/ecma262/#sec-weakset.prototype.delete\n 'delete': function (key) {\n var state = getInternalState(this);\n if (!isObject(key)) return false;\n var data = getWeakData(key);\n if (data === true) return uncaughtFrozenStore(state)['delete'](key);\n return data && hasOwn(data, state.id) && delete data[state.id];\n },\n // `{ WeakMap, WeakSet }.prototype.has(key)` methods\n // https://tc39.es/ecma262/#sec-weakmap.prototype.has\n // https://tc39.es/ecma262/#sec-weakset.prototype.has\n has: function has(key) {\n var state = getInternalState(this);\n if (!isObject(key)) return false;\n var data = getWeakData(key);\n if (data === true) return uncaughtFrozenStore(state).has(key);\n return data && hasOwn(data, state.id);\n }\n });\n\n defineBuiltIns(Prototype, IS_MAP ? {\n // `WeakMap.prototype.get(key)` method\n // https://tc39.es/ecma262/#sec-weakmap.prototype.get\n get: function get(key) {\n var state = getInternalState(this);\n if (isObject(key)) {\n var data = getWeakData(key);\n if (data === true) return uncaughtFrozenStore(state).get(key);\n if (data) return data[state.id];\n }\n },\n // `WeakMap.prototype.set(key, value)` method\n // https://tc39.es/ecma262/#sec-weakmap.prototype.set\n set: function set(key, value) {\n return define(this, key, value);\n }\n } : {\n // `WeakSet.prototype.add(value)` method\n // https://tc39.es/ecma262/#sec-weakset.prototype.add\n add: function add(value) {\n return define(this, value, true);\n }\n });\n\n return Constructor;\n }\n};\n","'use strict';\nvar fails = require('../internals/fails');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar IS_PURE = require('../internals/is-pure');\n\nvar ITERATOR = wellKnownSymbol('iterator');\n\nmodule.exports = !fails(function () {\n // eslint-disable-next-line unicorn/relative-url-style -- required for testing\n var url = new URL('b?a=1&b=2&c=3', 'https://a');\n var params = url.searchParams;\n var params2 = new URLSearchParams('a=1&a=2&b=3');\n var result = '';\n url.pathname = 'c%20d';\n params.forEach(function (value, key) {\n params['delete']('b');\n result += key + value;\n });\n params2['delete']('a', 2);\n // `undefined` case is a Chromium 117 bug\n // https://bugs.chromium.org/p/v8/issues/detail?id=14222\n params2['delete']('b', undefined);\n return (IS_PURE && (!url.toJSON || !params2.has('a', 1) || params2.has('a', 2) || !params2.has('a', undefined) || params2.has('b')))\n || (!params.size && (IS_PURE || !DESCRIPTORS))\n || !params.sort\n || url.href !== 'https://a/c%20d?a=1&c=3'\n || params.get('c') !== '3'\n || String(new URLSearchParams('?a=1')) !== 'a=1'\n || !params[ITERATOR]\n // throws in Edge\n || new URL('https://a@b').username !== 'a'\n || new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b'\n // not punycoded in Edge\n || new URL('https://тест').host !== 'xn--e1aybc'\n // not escaped in Chrome 62-\n || new URL('https://a#б').hash !== '#%D0%B1'\n // fails in Chrome 66-\n || result !== 'a1c3'\n // throws in Safari\n || new URL('https://x', undefined).host !== 'x';\n});\n","'use strict';\n// TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`\nrequire('../modules/es.array.iterator');\nrequire('../modules/es.string.from-code-point');\nvar $ = require('../internals/export');\nvar globalThis = require('../internals/global-this');\nvar safeGetBuiltIn = require('../internals/safe-get-built-in');\nvar getBuiltIn = require('../internals/get-built-in');\nvar call = require('../internals/function-call');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar USE_NATIVE_URL = require('../internals/url-constructor-detection');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar defineBuiltInAccessor = require('../internals/define-built-in-accessor');\nvar defineBuiltIns = require('../internals/define-built-ins');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar createIteratorConstructor = require('../internals/iterator-create-constructor');\nvar InternalStateModule = require('../internals/internal-state');\nvar anInstance = require('../internals/an-instance');\nvar isCallable = require('../internals/is-callable');\nvar hasOwn = require('../internals/has-own-property');\nvar bind = require('../internals/function-bind-context');\nvar classof = require('../internals/classof');\nvar anObject = require('../internals/an-object');\nvar isObject = require('../internals/is-object');\nvar $toString = require('../internals/to-string');\nvar create = require('../internals/object-create');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar getIterator = require('../internals/get-iterator');\nvar getIteratorMethod = require('../internals/get-iterator-method');\nvar createIterResultObject = require('../internals/create-iter-result-object');\nvar validateArgumentsLength = require('../internals/validate-arguments-length');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar arraySort = require('../internals/array-sort');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar URL_SEARCH_PARAMS = 'URLSearchParams';\nvar URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + 'Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalParamsState = InternalStateModule.getterFor(URL_SEARCH_PARAMS);\nvar getInternalIteratorState = InternalStateModule.getterFor(URL_SEARCH_PARAMS_ITERATOR);\n\nvar nativeFetch = safeGetBuiltIn('fetch');\nvar NativeRequest = safeGetBuiltIn('Request');\nvar Headers = safeGetBuiltIn('Headers');\nvar RequestPrototype = NativeRequest && NativeRequest.prototype;\nvar HeadersPrototype = Headers && Headers.prototype;\nvar TypeError = globalThis.TypeError;\nvar encodeURIComponent = globalThis.encodeURIComponent;\nvar fromCharCode = String.fromCharCode;\nvar fromCodePoint = getBuiltIn('String', 'fromCodePoint');\nvar $parseInt = parseInt;\nvar charAt = uncurryThis(''.charAt);\nvar join = uncurryThis([].join);\nvar push = uncurryThis([].push);\nvar replace = uncurryThis(''.replace);\nvar shift = uncurryThis([].shift);\nvar splice = uncurryThis([].splice);\nvar split = uncurryThis(''.split);\nvar stringSlice = uncurryThis(''.slice);\nvar exec = uncurryThis(/./.exec);\n\nvar plus = /\\+/g;\nvar FALLBACK_REPLACER = '\\uFFFD';\nvar VALID_HEX = /^[0-9a-f]+$/i;\n\nvar parseHexOctet = function (string, start) {\n var substr = stringSlice(string, start, start + 2);\n if (!exec(VALID_HEX, substr)) return NaN;\n\n return $parseInt(substr, 16);\n};\n\nvar getLeadingOnes = function (octet) {\n var count = 0;\n for (var mask = 0x80; mask > 0 && (octet & mask) !== 0; mask >>= 1) {\n count++;\n }\n return count;\n};\n\nvar utf8Decode = function (octets) {\n var codePoint = null;\n\n switch (octets.length) {\n case 1:\n codePoint = octets[0];\n break;\n case 2:\n codePoint = (octets[0] & 0x1F) << 6 | (octets[1] & 0x3F);\n break;\n case 3:\n codePoint = (octets[0] & 0x0F) << 12 | (octets[1] & 0x3F) << 6 | (octets[2] & 0x3F);\n break;\n case 4:\n codePoint = (octets[0] & 0x07) << 18 | (octets[1] & 0x3F) << 12 | (octets[2] & 0x3F) << 6 | (octets[3] & 0x3F);\n break;\n }\n\n return codePoint > 0x10FFFF ? null : codePoint;\n};\n\nvar decode = function (input) {\n input = replace(input, plus, ' ');\n var length = input.length;\n var result = '';\n var i = 0;\n\n while (i < length) {\n var decodedChar = charAt(input, i);\n\n if (decodedChar === '%') {\n if (charAt(input, i + 1) === '%' || i + 3 > length) {\n result += '%';\n i++;\n continue;\n }\n\n var octet = parseHexOctet(input, i + 1);\n\n // eslint-disable-next-line no-self-compare -- NaN check\n if (octet !== octet) {\n result += decodedChar;\n i++;\n continue;\n }\n\n i += 2;\n var byteSequenceLength = getLeadingOnes(octet);\n\n if (byteSequenceLength === 0) {\n decodedChar = fromCharCode(octet);\n } else {\n if (byteSequenceLength === 1 || byteSequenceLength > 4) {\n result += FALLBACK_REPLACER;\n i++;\n continue;\n }\n\n var octets = [octet];\n var sequenceIndex = 1;\n\n while (sequenceIndex < byteSequenceLength) {\n i++;\n if (i + 3 > length || charAt(input, i) !== '%') break;\n\n var nextByte = parseHexOctet(input, i + 1);\n\n // eslint-disable-next-line no-self-compare -- NaN check\n if (nextByte !== nextByte) {\n i += 3;\n break;\n }\n if (nextByte > 191 || nextByte < 128) break;\n\n push(octets, nextByte);\n i += 2;\n sequenceIndex++;\n }\n\n if (octets.length !== byteSequenceLength) {\n result += FALLBACK_REPLACER;\n continue;\n }\n\n var codePoint = utf8Decode(octets);\n if (codePoint === null) {\n result += FALLBACK_REPLACER;\n } else {\n decodedChar = fromCodePoint(codePoint);\n }\n }\n }\n\n result += decodedChar;\n i++;\n }\n\n return result;\n};\n\nvar find = /[!'()~]|%20/g;\n\nvar replacements = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+'\n};\n\nvar replacer = function (match) {\n return replacements[match];\n};\n\nvar serialize = function (it) {\n return replace(encodeURIComponent(it), find, replacer);\n};\n\nvar URLSearchParamsIterator = createIteratorConstructor(function Iterator(params, kind) {\n setInternalState(this, {\n type: URL_SEARCH_PARAMS_ITERATOR,\n target: getInternalParamsState(params).entries,\n index: 0,\n kind: kind\n });\n}, URL_SEARCH_PARAMS, function next() {\n var state = getInternalIteratorState(this);\n var target = state.target;\n var index = state.index++;\n if (!target || index >= target.length) {\n state.target = null;\n return createIterResultObject(undefined, true);\n }\n var entry = target[index];\n switch (state.kind) {\n case 'keys': return createIterResultObject(entry.key, false);\n case 'values': return createIterResultObject(entry.value, false);\n } return createIterResultObject([entry.key, entry.value], false);\n}, true);\n\nvar URLSearchParamsState = function (init) {\n this.entries = [];\n this.url = null;\n\n if (init !== undefined) {\n if (isObject(init)) this.parseObject(init);\n else this.parseQuery(typeof init == 'string' ? charAt(init, 0) === '?' ? stringSlice(init, 1) : init : $toString(init));\n }\n};\n\nURLSearchParamsState.prototype = {\n type: URL_SEARCH_PARAMS,\n bindURL: function (url) {\n this.url = url;\n this.update();\n },\n parseObject: function (object) {\n var entries = this.entries;\n var iteratorMethod = getIteratorMethod(object);\n var iterator, next, step, entryIterator, entryNext, first, second;\n\n if (iteratorMethod) {\n iterator = getIterator(object, iteratorMethod);\n next = iterator.next;\n while (!(step = call(next, iterator)).done) {\n entryIterator = getIterator(anObject(step.value));\n entryNext = entryIterator.next;\n if (\n (first = call(entryNext, entryIterator)).done ||\n (second = call(entryNext, entryIterator)).done ||\n !call(entryNext, entryIterator).done\n ) throw new TypeError('Expected sequence with length 2');\n push(entries, { key: $toString(first.value), value: $toString(second.value) });\n }\n } else for (var key in object) if (hasOwn(object, key)) {\n push(entries, { key: key, value: $toString(object[key]) });\n }\n },\n parseQuery: function (query) {\n if (query) {\n var entries = this.entries;\n var attributes = split(query, '&');\n var index = 0;\n var attribute, entry;\n while (index < attributes.length) {\n attribute = attributes[index++];\n if (attribute.length) {\n entry = split(attribute, '=');\n push(entries, {\n key: decode(shift(entry)),\n value: decode(join(entry, '='))\n });\n }\n }\n }\n },\n serialize: function () {\n var entries = this.entries;\n var result = [];\n var index = 0;\n var entry;\n while (index < entries.length) {\n entry = entries[index++];\n push(result, serialize(entry.key) + '=' + serialize(entry.value));\n } return join(result, '&');\n },\n update: function () {\n this.entries.length = 0;\n this.parseQuery(this.url.query);\n },\n updateURL: function () {\n if (this.url) this.url.update();\n }\n};\n\n// `URLSearchParams` constructor\n// https://url.spec.whatwg.org/#interface-urlsearchparams\nvar URLSearchParamsConstructor = function URLSearchParams(/* init */) {\n anInstance(this, URLSearchParamsPrototype);\n var init = arguments.length > 0 ? arguments[0] : undefined;\n var state = setInternalState(this, new URLSearchParamsState(init));\n if (!DESCRIPTORS) this.size = state.entries.length;\n};\n\nvar URLSearchParamsPrototype = URLSearchParamsConstructor.prototype;\n\ndefineBuiltIns(URLSearchParamsPrototype, {\n // `URLSearchParams.prototype.append` method\n // https://url.spec.whatwg.org/#dom-urlsearchparams-append\n append: function append(name, value) {\n var state = getInternalParamsState(this);\n validateArgumentsLength(arguments.length, 2);\n push(state.entries, { key: $toString(name), value: $toString(value) });\n if (!DESCRIPTORS) this.length++;\n state.updateURL();\n },\n // `URLSearchParams.prototype.delete` method\n // https://url.spec.whatwg.org/#dom-urlsearchparams-delete\n 'delete': function (name /* , value */) {\n var state = getInternalParamsState(this);\n var length = validateArgumentsLength(arguments.length, 1);\n var entries = state.entries;\n var key = $toString(name);\n var $value = length < 2 ? undefined : arguments[1];\n var value = $value === undefined ? $value : $toString($value);\n var index = 0;\n while (index < entries.length) {\n var entry = entries[index];\n if (entry.key === key && (value === undefined || entry.value === value)) {\n splice(entries, index, 1);\n if (value !== undefined) break;\n } else index++;\n }\n if (!DESCRIPTORS) this.size = entries.length;\n state.updateURL();\n },\n // `URLSearchParams.prototype.get` method\n // https://url.spec.whatwg.org/#dom-urlsearchparams-get\n get: function get(name) {\n var entries = getInternalParamsState(this).entries;\n validateArgumentsLength(arguments.length, 1);\n var key = $toString(name);\n var index = 0;\n for (; index < entries.length; index++) {\n if (entries[index].key === key) return entries[index].value;\n }\n return null;\n },\n // `URLSearchParams.prototype.getAll` method\n // https://url.spec.whatwg.org/#dom-urlsearchparams-getall\n getAll: function getAll(name) {\n var entries = getInternalParamsState(this).entries;\n validateArgumentsLength(arguments.length, 1);\n var key = $toString(name);\n var result = [];\n var index = 0;\n for (; index < entries.length; index++) {\n if (entries[index].key === key) push(result, entries[index].value);\n }\n return result;\n },\n // `URLSearchParams.prototype.has` method\n // https://url.spec.whatwg.org/#dom-urlsearchparams-has\n has: function has(name /* , value */) {\n var entries = getInternalParamsState(this).entries;\n var length = validateArgumentsLength(arguments.length, 1);\n var key = $toString(name);\n var $value = length < 2 ? undefined : arguments[1];\n var value = $value === undefined ? $value : $toString($value);\n var index = 0;\n while (index < entries.length) {\n var entry = entries[index++];\n if (entry.key === key && (value === undefined || entry.value === value)) return true;\n }\n return false;\n },\n // `URLSearchParams.prototype.set` method\n // https://url.spec.whatwg.org/#dom-urlsearchparams-set\n set: function set(name, value) {\n var state = getInternalParamsState(this);\n validateArgumentsLength(arguments.length, 1);\n var entries = state.entries;\n var found = false;\n var key = $toString(name);\n var val = $toString(value);\n var index = 0;\n var entry;\n for (; index < entries.length; index++) {\n entry = entries[index];\n if (entry.key === key) {\n if (found) splice(entries, index--, 1);\n else {\n found = true;\n entry.value = val;\n }\n }\n }\n if (!found) push(entries, { key: key, value: val });\n if (!DESCRIPTORS) this.size = entries.length;\n state.updateURL();\n },\n // `URLSearchParams.prototype.sort` method\n // https://url.spec.whatwg.org/#dom-urlsearchparams-sort\n sort: function sort() {\n var state = getInternalParamsState(this);\n arraySort(state.entries, function (a, b) {\n return a.key > b.key ? 1 : -1;\n });\n state.updateURL();\n },\n // `URLSearchParams.prototype.forEach` method\n forEach: function forEach(callback /* , thisArg */) {\n var entries = getInternalParamsState(this).entries;\n var boundFunction = bind(callback, arguments.length > 1 ? arguments[1] : undefined);\n var index = 0;\n var entry;\n while (index < entries.length) {\n entry = entries[index++];\n boundFunction(entry.value, entry.key, this);\n }\n },\n // `URLSearchParams.prototype.keys` method\n keys: function keys() {\n return new URLSearchParamsIterator(this, 'keys');\n },\n // `URLSearchParams.prototype.values` method\n values: function values() {\n return new URLSearchParamsIterator(this, 'values');\n },\n // `URLSearchParams.prototype.entries` method\n entries: function entries() {\n return new URLSearchParamsIterator(this, 'entries');\n }\n}, { enumerable: true });\n\n// `URLSearchParams.prototype[@@iterator]` method\ndefineBuiltIn(URLSearchParamsPrototype, ITERATOR, URLSearchParamsPrototype.entries, { name: 'entries' });\n\n// `URLSearchParams.prototype.toString` method\n// https://url.spec.whatwg.org/#urlsearchparams-stringification-behavior\ndefineBuiltIn(URLSearchParamsPrototype, 'toString', function toString() {\n return getInternalParamsState(this).serialize();\n}, { enumerable: true });\n\n// `URLSearchParams.prototype.size` getter\n// https://github.com/whatwg/url/pull/734\nif (DESCRIPTORS) defineBuiltInAccessor(URLSearchParamsPrototype, 'size', {\n get: function size() {\n return getInternalParamsState(this).entries.length;\n },\n configurable: true,\n enumerable: true\n});\n\nsetToStringTag(URLSearchParamsConstructor, URL_SEARCH_PARAMS);\n\n$({ global: true, constructor: true, forced: !USE_NATIVE_URL }, {\n URLSearchParams: URLSearchParamsConstructor\n});\n\n// Wrap `fetch` and `Request` for correct work with polyfilled `URLSearchParams`\nif (!USE_NATIVE_URL && isCallable(Headers)) {\n var headersHas = uncurryThis(HeadersPrototype.has);\n var headersSet = uncurryThis(HeadersPrototype.set);\n\n var wrapRequestOptions = function (init) {\n if (isObject(init)) {\n var body = init.body;\n var headers;\n if (classof(body) === URL_SEARCH_PARAMS) {\n headers = init.headers ? new Headers(init.headers) : new Headers();\n if (!headersHas(headers, 'content-type')) {\n headersSet(headers, 'content-type', 'application/x-www-form-urlencoded;charset=UTF-8');\n }\n return create(init, {\n body: createPropertyDescriptor(0, $toString(body)),\n headers: createPropertyDescriptor(0, headers)\n });\n }\n } return init;\n };\n\n if (isCallable(nativeFetch)) {\n $({ global: true, enumerable: true, dontCallGetSet: true, forced: true }, {\n fetch: function fetch(input /* , init */) {\n return nativeFetch(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : {});\n }\n });\n }\n\n if (isCallable(NativeRequest)) {\n var RequestConstructor = function Request(input /* , init */) {\n anInstance(this, RequestPrototype);\n return new NativeRequest(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : {});\n };\n\n RequestPrototype.constructor = RequestConstructor;\n RequestConstructor.prototype = RequestPrototype;\n\n $({ global: true, constructor: true, dontCallGetSet: true, forced: true }, {\n Request: RequestConstructor\n });\n }\n}\n\nmodule.exports = {\n URLSearchParams: URLSearchParamsConstructor,\n getState: getInternalParamsState\n};\n","// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto\n// implementation. Also, find the complete implementation of crypto on IE11.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));\n\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n","/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return ([\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]]\n ]).join('');\n}\n\nmodule.exports = bytesToUuid;\n","export default function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}","export default function _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}","function _setPrototypeOf(t, e) {\n return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {\n return t.__proto__ = e, t;\n }, _setPrototypeOf(t, e);\n}\nexport { _setPrototypeOf as default };","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","'use strict';\n\n/** @type {import('./syntax')} */\nmodule.exports = SyntaxError;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\n\nif ($gOPD) {\n\ttry {\n\t\t$gOPD([], 'length');\n\t} catch (e) {\n\t\t// IE 8 has a broken gOPD\n\t\t$gOPD = null;\n\t}\n}\n\nmodule.exports = $gOPD;\n","'use strict';\n\nvar formats = require('./formats');\n\nvar has = Object.prototype.hasOwnProperty;\nvar isArray = Array.isArray;\n\nvar hexTable = (function () {\n var array = [];\n for (var i = 0; i < 256; ++i) {\n array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());\n }\n\n return array;\n}());\n\nvar compactQueue = function compactQueue(queue) {\n while (queue.length > 1) {\n var item = queue.pop();\n var obj = item.obj[item.prop];\n\n if (isArray(obj)) {\n var compacted = [];\n\n for (var j = 0; j < obj.length; ++j) {\n if (typeof obj[j] !== 'undefined') {\n compacted.push(obj[j]);\n }\n }\n\n item.obj[item.prop] = compacted;\n }\n }\n};\n\nvar arrayToObject = function arrayToObject(source, options) {\n var obj = options && options.plainObjects ? Object.create(null) : {};\n for (var i = 0; i < source.length; ++i) {\n if (typeof source[i] !== 'undefined') {\n obj[i] = source[i];\n }\n }\n\n return obj;\n};\n\nvar merge = function merge(target, source, options) {\n /* eslint no-param-reassign: 0 */\n if (!source) {\n return target;\n }\n\n if (typeof source !== 'object') {\n if (isArray(target)) {\n target.push(source);\n } else if (target && typeof target === 'object') {\n if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) {\n target[source] = true;\n }\n } else {\n return [target, source];\n }\n\n return target;\n }\n\n if (!target || typeof target !== 'object') {\n return [target].concat(source);\n }\n\n var mergeTarget = target;\n if (isArray(target) && !isArray(source)) {\n mergeTarget = arrayToObject(target, options);\n }\n\n if (isArray(target) && isArray(source)) {\n source.forEach(function (item, i) {\n if (has.call(target, i)) {\n var targetItem = target[i];\n if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {\n target[i] = merge(targetItem, item, options);\n } else {\n target.push(item);\n }\n } else {\n target[i] = item;\n }\n });\n return target;\n }\n\n return Object.keys(source).reduce(function (acc, key) {\n var value = source[key];\n\n if (has.call(acc, key)) {\n acc[key] = merge(acc[key], value, options);\n } else {\n acc[key] = value;\n }\n return acc;\n }, mergeTarget);\n};\n\nvar assign = function assignSingleSource(target, source) {\n return Object.keys(source).reduce(function (acc, key) {\n acc[key] = source[key];\n return acc;\n }, target);\n};\n\nvar decode = function (str, decoder, charset) {\n var strWithoutPlus = str.replace(/\\+/g, ' ');\n if (charset === 'iso-8859-1') {\n // unescape never throws, no try...catch needed:\n return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);\n }\n // utf-8\n try {\n return decodeURIComponent(strWithoutPlus);\n } catch (e) {\n return strWithoutPlus;\n }\n};\n\nvar limit = 1024;\n\n/* eslint operator-linebreak: [2, \"before\"] */\n\nvar encode = function encode(str, defaultEncoder, charset, kind, format) {\n // This code was originally written by Brian White (mscdex) for the io.js core querystring library.\n // It has been adapted here for stricter adherence to RFC 3986\n if (str.length === 0) {\n return str;\n }\n\n var string = str;\n if (typeof str === 'symbol') {\n string = Symbol.prototype.toString.call(str);\n } else if (typeof str !== 'string') {\n string = String(str);\n }\n\n if (charset === 'iso-8859-1') {\n return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {\n return '%26%23' + parseInt($0.slice(2), 16) + '%3B';\n });\n }\n\n var out = '';\n for (var j = 0; j < string.length; j += limit) {\n var segment = string.length >= limit ? string.slice(j, j + limit) : string;\n var arr = [];\n\n for (var i = 0; i < segment.length; ++i) {\n var c = segment.charCodeAt(i);\n if (\n c === 0x2D // -\n || c === 0x2E // .\n || c === 0x5F // _\n || c === 0x7E // ~\n || (c >= 0x30 && c <= 0x39) // 0-9\n || (c >= 0x41 && c <= 0x5A) // a-z\n || (c >= 0x61 && c <= 0x7A) // A-Z\n || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( )\n ) {\n arr[arr.length] = segment.charAt(i);\n continue;\n }\n\n if (c < 0x80) {\n arr[arr.length] = hexTable[c];\n continue;\n }\n\n if (c < 0x800) {\n arr[arr.length] = hexTable[0xC0 | (c >> 6)]\n + hexTable[0x80 | (c & 0x3F)];\n continue;\n }\n\n if (c < 0xD800 || c >= 0xE000) {\n arr[arr.length] = hexTable[0xE0 | (c >> 12)]\n + hexTable[0x80 | ((c >> 6) & 0x3F)]\n + hexTable[0x80 | (c & 0x3F)];\n continue;\n }\n\n i += 1;\n c = 0x10000 + (((c & 0x3FF) << 10) | (segment.charCodeAt(i) & 0x3FF));\n\n arr[arr.length] = hexTable[0xF0 | (c >> 18)]\n + hexTable[0x80 | ((c >> 12) & 0x3F)]\n + hexTable[0x80 | ((c >> 6) & 0x3F)]\n + hexTable[0x80 | (c & 0x3F)];\n }\n\n out += arr.join('');\n }\n\n return out;\n};\n\nvar compact = function compact(value) {\n var queue = [{ obj: { o: value }, prop: 'o' }];\n var refs = [];\n\n for (var i = 0; i < queue.length; ++i) {\n var item = queue[i];\n var obj = item.obj[item.prop];\n\n var keys = Object.keys(obj);\n for (var j = 0; j < keys.length; ++j) {\n var key = keys[j];\n var val = obj[key];\n if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {\n queue.push({ obj: obj, prop: key });\n refs.push(val);\n }\n }\n }\n\n compactQueue(queue);\n\n return value;\n};\n\nvar isRegExp = function isRegExp(obj) {\n return Object.prototype.toString.call(obj) === '[object RegExp]';\n};\n\nvar isBuffer = function isBuffer(obj) {\n if (!obj || typeof obj !== 'object') {\n return false;\n }\n\n return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));\n};\n\nvar combine = function combine(a, b) {\n return [].concat(a, b);\n};\n\nvar maybeMap = function maybeMap(val, fn) {\n if (isArray(val)) {\n var mapped = [];\n for (var i = 0; i < val.length; i += 1) {\n mapped.push(fn(val[i]));\n }\n return mapped;\n }\n return fn(val);\n};\n\nmodule.exports = {\n arrayToObject: arrayToObject,\n assign: assign,\n combine: combine,\n compact: compact,\n decode: decode,\n encode: encode,\n isBuffer: isBuffer,\n isRegExp: isRegExp,\n maybeMap: maybeMap,\n merge: merge\n};\n","import { isEmptyData } from \"./isEmptyData\";\nimport { SHA_256_HMAC_ALGO } from \"./constants\";\nimport { Hash, SourceData } from \"@aws-sdk/types\";\nimport { fromUtf8 } from \"@aws-sdk/util-utf8-browser\";\nimport { CryptoOperation, Key, MsWindow } from \"@aws-crypto/ie11-detection\";\nimport { locateWindow } from \"@aws-sdk/util-locate-window\";\n\nexport class Sha256 implements Hash {\n private operation: Promise;\n\n constructor(secret?: SourceData) {\n if (secret) {\n this.operation = getKeyPromise(secret).then(keyData =>\n (locateWindow() as MsWindow).msCrypto.subtle.sign(\n SHA_256_HMAC_ALGO,\n keyData\n )\n );\n this.operation.catch(() => {});\n } else {\n this.operation = Promise.resolve(\n (locateWindow() as MsWindow).msCrypto.subtle.digest(\"SHA-256\")\n );\n }\n }\n\n update(toHash: SourceData): void {\n if (isEmptyData(toHash)) {\n return;\n }\n\n this.operation = this.operation.then(operation => {\n operation.onerror = () => {\n this.operation = Promise.reject(\n new Error(\"Error encountered updating hash\")\n );\n };\n operation.process(toArrayBufferView(toHash));\n\n return operation;\n });\n this.operation.catch(() => {});\n }\n\n digest(): Promise {\n return this.operation.then(\n operation =>\n new Promise((resolve, reject) => {\n operation.onerror = () => {\n reject(new Error(\"Error encountered finalizing hash\"));\n };\n operation.oncomplete = () => {\n if (operation.result) {\n resolve(new Uint8Array(operation.result));\n }\n reject(new Error(\"Error encountered finalizing hash\"));\n };\n\n operation.finish();\n })\n );\n }\n}\n\nfunction getKeyPromise(secret: SourceData): Promise