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,EACHz+B,IAAK,CAACl4B,EAAQgN,EAAMynD,IAAa6B,EAAUt2D,EAAQgN,IAAS2pD,EAASz+B,IAAIl4B,EAAQgN,EAAMynD,GACvFvY,IAAK,CAACl8C,EAAQgN,MAAWspD,EAAUt2D,EAAQgN,IAAS2pD,EAASza,IAAIl8C,EAAQgN,KD4BzDhc,CAASwjE","sources":["webpack://realm_app/./node_modules/@firebase/util/dist/index.esm2017.js","webpack://realm_app/./node_modules/@mui/icons-material/AccountBalance.js","webpack://realm_app/./node_modules/@mui/icons-material/ArrowBack.js","webpack://realm_app/./node_modules/@mui/icons-material/ArrowDownward.js","webpack://realm_app/./node_modules/@mui/icons-material/ArrowForward.js","webpack://realm_app/./node_modules/@mui/icons-material/ArrowUpward.js","webpack://realm_app/./node_modules/@mui/icons-material/Assessment.js","webpack://realm_app/./node_modules/@mui/icons-material/AssignmentTurnedIn.js","webpack://realm_app/./node_modules/@mui/icons-material/AttachMoney.js","webpack://realm_app/./node_modules/@mui/icons-material/CreditCard.js","webpack://realm_app/./node_modules/@mui/icons-material/ExpandLess.js","webpack://realm_app/./node_modules/@mui/icons-material/ExpandMore.js","webpack://realm_app/./node_modules/@mui/icons-material/Gavel.js","webpack://realm_app/./node_modules/@mui/icons-material/Handshake.js","webpack://realm_app/./node_modules/@mui/icons-material/Home.js","webpack://realm_app/./node_modules/@mui/icons-material/ImageSearch.js","webpack://realm_app/./node_modules/@mui/icons-material/InsertDriveFile.js","webpack://realm_app/./node_modules/@mui/icons-material/Link.js","webpack://realm_app/./node_modules/@mui/icons-material/MobileFriendly.js","webpack://realm_app/./node_modules/@mui/icons-material/People.js","webpack://realm_app/./node_modules/@mui/icons-material/Person.js","webpack://realm_app/./node_modules/@mui/icons-material/PhotoLibrary.js","webpack://realm_app/./node_modules/@mui/icons-material/RadioButtonChecked.js","webpack://realm_app/./node_modules/@mui/icons-material/RadioButtonUnchecked.js","webpack://realm_app/./node_modules/@mui/icons-material/TransferWithinAStation.js","webpack://realm_app/./node_modules/@stripe/stripe-js/dist/pure.js","webpack://realm_app/./node_modules/@stripe/stripe-js/pure/index.js","webpack://realm_app/./node_modules/copy-to-clipboard/index.js","webpack://realm_app/./node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://realm_app/./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://realm_app/./node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://realm_app/./node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://realm_app/./node_modules/@babel/runtime/helpers/esm/objectSpread2.js","webpack://realm_app/./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","webpack://realm_app/./node_modules/@babel/runtime/helpers/esm/classCallCheck.js","webpack://realm_app/./node_modules/@babel/runtime/helpers/esm/createClass.js","webpack://realm_app/./node_modules/@babel/runtime/helpers/esm/inherits.js","webpack://realm_app/./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js","webpack://realm_app/./node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js","webpack://realm_app/./node_modules/@babel/runtime/helpers/esm/createSuper.js","webpack://realm_app/./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js","webpack://realm_app/./node_modules/rc-util/es/raf.js","webpack://realm_app/./node_modules/rc-util/es/Dom/contains.js","webpack://realm_app/./node_modules/rc-util/es/Dom/findDOMNode.js","webpack://realm_app/./node_modules/rc-util/es/ref.js","webpack://realm_app/./node_modules/rc-util/es/Dom/addEventListener.js","webpack://realm_app/./node_modules/rc-util/es/Dom/canUseDom.js","webpack://realm_app/./node_modules/rc-util/es/Portal.js","webpack://realm_app/./node_modules/rc-trigger/es/utils/alignUtil.js","webpack://realm_app/./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","webpack://realm_app/./node_modules/@babel/runtime/helpers/esm/slicedToArray.js","webpack://realm_app/./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js","webpack://realm_app/./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js","webpack://realm_app/./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","webpack://realm_app/./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js","webpack://realm_app/./node_modules/rc-motion/es/util/motion.js","webpack://realm_app/./node_modules/rc-motion/es/interface.js","webpack://realm_app/./node_modules/rc-motion/es/hooks/useState.js","webpack://realm_app/./node_modules/rc-motion/es/hooks/useIsomorphicLayoutEffect.js","webpack://realm_app/./node_modules/rc-motion/es/hooks/useStepQueue.js","webpack://realm_app/./node_modules/rc-motion/es/hooks/useNextFrame.js","webpack://realm_app/./node_modules/rc-motion/es/hooks/useDomMotionEvents.js","webpack://realm_app/./node_modules/rc-motion/es/DomWrapper.js","webpack://realm_app/./node_modules/rc-motion/es/CSSMotion.js","webpack://realm_app/./node_modules/rc-motion/es/hooks/useStatus.js","webpack://realm_app/./node_modules/rc-motion/es/util/diff.js","webpack://realm_app/./node_modules/rc-motion/es/CSSMotionList.js","webpack://realm_app/./node_modules/rc-motion/es/index.js","webpack://realm_app/./node_modules/rc-trigger/es/utils/legacyUtil.js","webpack://realm_app/./node_modules/rc-trigger/es/Popup/Mask.js","webpack://realm_app/./node_modules/rc-util/es/Dom/isVisible.js","webpack://realm_app/./node_modules/dom-align/dist-web/index.js","webpack://realm_app/./node_modules/rc-align/es/util.js","webpack://realm_app/./node_modules/rc-align/es/Align.js","webpack://realm_app/./node_modules/rc-align/es/hooks/useBuffer.js","webpack://realm_app/./node_modules/rc-align/es/index.js","webpack://realm_app/./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","webpack://realm_app/./node_modules/rc-trigger/es/Popup/useVisibleStatus.js","webpack://realm_app/./node_modules/rc-trigger/es/Popup/PopupInner.js","webpack://realm_app/./node_modules/rc-trigger/es/Popup/useStretchStyle.js","webpack://realm_app/./node_modules/rc-trigger/es/Popup/index.js","webpack://realm_app/./node_modules/rc-trigger/es/context.js","webpack://realm_app/./node_modules/rc-trigger/es/index.js","webpack://realm_app/./node_modules/rc-tooltip/es/placements.js","webpack://realm_app/./node_modules/rc-tooltip/es/Content.js","webpack://realm_app/./node_modules/rc-tooltip/es/Tooltip.js","webpack://realm_app/./node_modules/rc-tooltip/es/index.js","webpack://realm_app/./node_modules/react-calendly/dist/index.es.js","webpack://realm_app/./node_modules/react-plaid-link/dist/index.umd.js","webpack://realm_app/./node_modules/react-text-mask/dist/reactTextMask.js","webpack://realm_app/./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/rng.js","webpack://realm_app/./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/bytesToUuid.js","webpack://realm_app/./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v4.js","webpack://realm_app/./node_modules/react-tooltip/dist/index.es.js","webpack://realm_app/./node_modules/dom-helpers/esm/removeClass.js","webpack://realm_app/./node_modules/react-transition-group/esm/config.js","webpack://realm_app/./node_modules/react-transition-group/esm/utils/reflow.js","webpack://realm_app/./node_modules/react-transition-group/esm/Transition.js","webpack://realm_app/./node_modules/react-transition-group/esm/CSSTransition.js","webpack://realm_app/./node_modules/dom-helpers/esm/addClass.js","webpack://realm_app/./node_modules/dom-helpers/esm/hasClass.js","webpack://realm_app/./node_modules/react-transition-group/esm/utils/ChildMapping.js","webpack://realm_app/./node_modules/react-transition-group/esm/TransitionGroup.js","webpack://realm_app/./node_modules/react-transition-group/esm/TransitionGroupContext.js","webpack://realm_app/./node_modules/text-mask-addons/dist/createNumberMask.js","webpack://realm_app/./node_modules/toggle-selection/index.js","webpack://realm_app/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js","webpack://realm_app/./node_modules/@babel/runtime/helpers/typeof.js","webpack://realm_app/./node_modules/@babel/runtime/regenerator/index.js","webpack://realm_app/./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","webpack://realm_app/./node_modules/@firebase/app/dist/esm/index.esm2017.js","webpack://realm_app/./node_modules/@firebase/component/dist/esm/index.esm2017.js","webpack://realm_app/./node_modules/@firebase/logger/dist/esm/index.esm2017.js","webpack://realm_app/./node_modules/firebase/app/dist/esm/index.esm.js","webpack://realm_app/./node_modules/@firebase/installations/dist/esm/index.esm2017.js","webpack://realm_app/./node_modules/@firebase/remote-config/dist/esm/index.esm2017.js","webpack://realm_app/./node_modules/idb/build/wrap-idb-value.js","webpack://realm_app/./node_modules/idb/build/index.js"],"sourcesContent":["/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @fileoverview Firebase constants. Some of these (@defines) can be overridden at compile-time.\r\n */\r\nconst CONSTANTS = {\r\n /**\r\n * @define {boolean} Whether this is the client Node.js SDK.\r\n */\r\n NODE_CLIENT: false,\r\n /**\r\n * @define {boolean} Whether this is the Admin Node.js SDK.\r\n */\r\n NODE_ADMIN: false,\r\n /**\r\n * Firebase SDK Version\r\n */\r\n SDK_VERSION: '${JSCORE_VERSION}'\r\n};\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Throws an error if the provided assertion is falsy\r\n */\r\nconst assert = function (assertion, message) {\r\n if (!assertion) {\r\n throw assertionError(message);\r\n }\r\n};\r\n/**\r\n * Returns an Error object suitable for throwing.\r\n */\r\nconst assertionError = function (message) {\r\n return new Error('Firebase Database (' +\r\n CONSTANTS.SDK_VERSION +\r\n ') INTERNAL ASSERT FAILED: ' +\r\n message);\r\n};\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst stringToByteArray$1 = function (str) {\r\n // TODO(user): Use native implementations if/when available\r\n const out = [];\r\n let p = 0;\r\n for (let i = 0; i < str.length; i++) {\r\n let c = str.charCodeAt(i);\r\n if (c < 128) {\r\n out[p++] = c;\r\n }\r\n else if (c < 2048) {\r\n out[p++] = (c >> 6) | 192;\r\n out[p++] = (c & 63) | 128;\r\n }\r\n else if ((c & 0xfc00) === 0xd800 &&\r\n i + 1 < str.length &&\r\n (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {\r\n // Surrogate Pair\r\n c = 0x10000 + ((c & 0x03ff) << 10) + (str.charCodeAt(++i) & 0x03ff);\r\n out[p++] = (c >> 18) | 240;\r\n out[p++] = ((c >> 12) & 63) | 128;\r\n out[p++] = ((c >> 6) & 63) | 128;\r\n out[p++] = (c & 63) | 128;\r\n }\r\n else {\r\n out[p++] = (c >> 12) | 224;\r\n out[p++] = ((c >> 6) & 63) | 128;\r\n out[p++] = (c & 63) | 128;\r\n }\r\n }\r\n return out;\r\n};\r\n/**\r\n * Turns an array of numbers into the string given by the concatenation of the\r\n * characters to which the numbers correspond.\r\n * @param bytes Array of numbers representing characters.\r\n * @return Stringification of the array.\r\n */\r\nconst byteArrayToString = function (bytes) {\r\n // TODO(user): Use native implementations if/when available\r\n const out = [];\r\n let pos = 0, c = 0;\r\n while (pos < bytes.length) {\r\n const c1 = bytes[pos++];\r\n if (c1 < 128) {\r\n out[c++] = String.fromCharCode(c1);\r\n }\r\n else if (c1 > 191 && c1 < 224) {\r\n const c2 = bytes[pos++];\r\n out[c++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63));\r\n }\r\n else if (c1 > 239 && c1 < 365) {\r\n // Surrogate Pair\r\n const c2 = bytes[pos++];\r\n const c3 = bytes[pos++];\r\n const c4 = bytes[pos++];\r\n const u = (((c1 & 7) << 18) | ((c2 & 63) << 12) | ((c3 & 63) << 6) | (c4 & 63)) -\r\n 0x10000;\r\n out[c++] = String.fromCharCode(0xd800 + (u >> 10));\r\n out[c++] = String.fromCharCode(0xdc00 + (u & 1023));\r\n }\r\n else {\r\n const c2 = bytes[pos++];\r\n const c3 = bytes[pos++];\r\n out[c++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\r\n }\r\n }\r\n return out.join('');\r\n};\r\n// We define it as an object literal instead of a class because a class compiled down to es5 can't\r\n// be treeshaked. https://github.com/rollup/rollup/issues/1691\r\n// Static lookup maps, lazily populated by init_()\r\nconst base64 = {\r\n /**\r\n * Maps bytes to characters.\r\n */\r\n byteToCharMap_: null,\r\n /**\r\n * Maps characters to bytes.\r\n */\r\n charToByteMap_: null,\r\n /**\r\n * Maps bytes to websafe characters.\r\n * @private\r\n */\r\n byteToCharMapWebSafe_: null,\r\n /**\r\n * Maps websafe characters to bytes.\r\n * @private\r\n */\r\n charToByteMapWebSafe_: null,\r\n /**\r\n * Our default alphabet, shared between\r\n * ENCODED_VALS and ENCODED_VALS_WEBSAFE\r\n */\r\n ENCODED_VALS_BASE: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + 'abcdefghijklmnopqrstuvwxyz' + '0123456789',\r\n /**\r\n * Our default alphabet. Value 64 (=) is special; it means \"nothing.\"\r\n */\r\n get ENCODED_VALS() {\r\n return this.ENCODED_VALS_BASE + '+/=';\r\n },\r\n /**\r\n * Our websafe alphabet.\r\n */\r\n get ENCODED_VALS_WEBSAFE() {\r\n return this.ENCODED_VALS_BASE + '-_.';\r\n },\r\n /**\r\n * Whether this browser supports the atob and btoa functions. This extension\r\n * started at Mozilla but is now implemented by many browsers. We use the\r\n * ASSUME_* variables to avoid pulling in the full useragent detection library\r\n * but still allowing the standard per-browser compilations.\r\n *\r\n */\r\n HAS_NATIVE_SUPPORT: typeof atob === 'function',\r\n /**\r\n * Base64-encode an array of bytes.\r\n *\r\n * @param input An array of bytes (numbers with\r\n * value in [0, 255]) to encode.\r\n * @param webSafe Boolean indicating we should use the\r\n * alternative alphabet.\r\n * @return The base64 encoded string.\r\n */\r\n encodeByteArray(input, webSafe) {\r\n if (!Array.isArray(input)) {\r\n throw Error('encodeByteArray takes an array as a parameter');\r\n }\r\n this.init_();\r\n const byteToCharMap = webSafe\r\n ? this.byteToCharMapWebSafe_\r\n : this.byteToCharMap_;\r\n const output = [];\r\n for (let i = 0; i < input.length; i += 3) {\r\n const byte1 = input[i];\r\n const haveByte2 = i + 1 < input.length;\r\n const byte2 = haveByte2 ? input[i + 1] : 0;\r\n const haveByte3 = i + 2 < input.length;\r\n const byte3 = haveByte3 ? input[i + 2] : 0;\r\n const outByte1 = byte1 >> 2;\r\n const outByte2 = ((byte1 & 0x03) << 4) | (byte2 >> 4);\r\n let outByte3 = ((byte2 & 0x0f) << 2) | (byte3 >> 6);\r\n let outByte4 = byte3 & 0x3f;\r\n if (!haveByte3) {\r\n outByte4 = 64;\r\n if (!haveByte2) {\r\n outByte3 = 64;\r\n }\r\n }\r\n output.push(byteToCharMap[outByte1], byteToCharMap[outByte2], byteToCharMap[outByte3], byteToCharMap[outByte4]);\r\n }\r\n return output.join('');\r\n },\r\n /**\r\n * Base64-encode a string.\r\n *\r\n * @param input A string to encode.\r\n * @param webSafe If true, we should use the\r\n * alternative alphabet.\r\n * @return The base64 encoded string.\r\n */\r\n encodeString(input, webSafe) {\r\n // Shortcut for Mozilla browsers that implement\r\n // a native base64 encoder in the form of \"btoa/atob\"\r\n if (this.HAS_NATIVE_SUPPORT && !webSafe) {\r\n return btoa(input);\r\n }\r\n return this.encodeByteArray(stringToByteArray$1(input), webSafe);\r\n },\r\n /**\r\n * Base64-decode a string.\r\n *\r\n * @param input to decode.\r\n * @param webSafe True if we should use the\r\n * alternative alphabet.\r\n * @return string representing the decoded value.\r\n */\r\n decodeString(input, webSafe) {\r\n // Shortcut for Mozilla browsers that implement\r\n // a native base64 encoder in the form of \"btoa/atob\"\r\n if (this.HAS_NATIVE_SUPPORT && !webSafe) {\r\n return atob(input);\r\n }\r\n return byteArrayToString(this.decodeStringToByteArray(input, webSafe));\r\n },\r\n /**\r\n * Base64-decode a string.\r\n *\r\n * In base-64 decoding, groups of four characters are converted into three\r\n * bytes. If the encoder did not apply padding, the input length may not\r\n * be a multiple of 4.\r\n *\r\n * In this case, the last group will have fewer than 4 characters, and\r\n * padding will be inferred. If the group has one or two characters, it decodes\r\n * to one byte. If the group has three characters, it decodes to two bytes.\r\n *\r\n * @param input Input to decode.\r\n * @param webSafe True if we should use the web-safe alphabet.\r\n * @return bytes representing the decoded value.\r\n */\r\n decodeStringToByteArray(input, webSafe) {\r\n this.init_();\r\n const charToByteMap = webSafe\r\n ? this.charToByteMapWebSafe_\r\n : this.charToByteMap_;\r\n const output = [];\r\n for (let i = 0; i < input.length;) {\r\n const byte1 = charToByteMap[input.charAt(i++)];\r\n const haveByte2 = i < input.length;\r\n const byte2 = haveByte2 ? charToByteMap[input.charAt(i)] : 0;\r\n ++i;\r\n const haveByte3 = i < input.length;\r\n const byte3 = haveByte3 ? charToByteMap[input.charAt(i)] : 64;\r\n ++i;\r\n const haveByte4 = i < input.length;\r\n const byte4 = haveByte4 ? charToByteMap[input.charAt(i)] : 64;\r\n ++i;\r\n if (byte1 == null || byte2 == null || byte3 == null || byte4 == null) {\r\n throw new DecodeBase64StringError();\r\n }\r\n const outByte1 = (byte1 << 2) | (byte2 >> 4);\r\n output.push(outByte1);\r\n if (byte3 !== 64) {\r\n const outByte2 = ((byte2 << 4) & 0xf0) | (byte3 >> 2);\r\n output.push(outByte2);\r\n if (byte4 !== 64) {\r\n const outByte3 = ((byte3 << 6) & 0xc0) | byte4;\r\n output.push(outByte3);\r\n }\r\n }\r\n }\r\n return output;\r\n },\r\n /**\r\n * Lazy static initialization function. Called before\r\n * accessing any of the static map variables.\r\n * @private\r\n */\r\n init_() {\r\n if (!this.byteToCharMap_) {\r\n this.byteToCharMap_ = {};\r\n this.charToByteMap_ = {};\r\n this.byteToCharMapWebSafe_ = {};\r\n this.charToByteMapWebSafe_ = {};\r\n // We want quick mappings back and forth, so we precompute two maps.\r\n for (let i = 0; i < this.ENCODED_VALS.length; i++) {\r\n this.byteToCharMap_[i] = this.ENCODED_VALS.charAt(i);\r\n this.charToByteMap_[this.byteToCharMap_[i]] = i;\r\n this.byteToCharMapWebSafe_[i] = this.ENCODED_VALS_WEBSAFE.charAt(i);\r\n this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[i]] = i;\r\n // Be forgiving when decoding and correctly decode both encodings.\r\n if (i >= this.ENCODED_VALS_BASE.length) {\r\n this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(i)] = i;\r\n this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(i)] = i;\r\n }\r\n }\r\n }\r\n }\r\n};\r\n/**\r\n * An error encountered while decoding base64 string.\r\n */\r\nclass DecodeBase64StringError extends Error {\r\n constructor() {\r\n super(...arguments);\r\n this.name = 'DecodeBase64StringError';\r\n }\r\n}\r\n/**\r\n * URL-safe base64 encoding\r\n */\r\nconst base64Encode = function (str) {\r\n const utf8Bytes = stringToByteArray$1(str);\r\n return base64.encodeByteArray(utf8Bytes, true);\r\n};\r\n/**\r\n * URL-safe base64 encoding (without \".\" padding in the end).\r\n * e.g. Used in JSON Web Token (JWT) parts.\r\n */\r\nconst base64urlEncodeWithoutPadding = function (str) {\r\n // Use base64url encoding and remove padding in the end (dot characters).\r\n return base64Encode(str).replace(/\\./g, '');\r\n};\r\n/**\r\n * URL-safe base64 decoding\r\n *\r\n * NOTE: DO NOT use the global atob() function - it does NOT support the\r\n * base64Url variant encoding.\r\n *\r\n * @param str To be decoded\r\n * @return Decoded result, if possible\r\n */\r\nconst base64Decode = function (str) {\r\n try {\r\n return base64.decodeString(str, true);\r\n }\r\n catch (e) {\r\n console.error('base64Decode failed: ', e);\r\n }\r\n return null;\r\n};\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Do a deep-copy of basic JavaScript Objects or Arrays.\r\n */\r\nfunction deepCopy(value) {\r\n return deepExtend(undefined, value);\r\n}\r\n/**\r\n * Copy properties from source to target (recursively allows extension\r\n * of Objects and Arrays). Scalar values in the target are over-written.\r\n * If target is undefined, an object of the appropriate type will be created\r\n * (and returned).\r\n *\r\n * We recursively copy all child properties of plain Objects in the source- so\r\n * that namespace- like dictionaries are merged.\r\n *\r\n * Note that the target can be a function, in which case the properties in\r\n * the source Object are copied onto it as static properties of the Function.\r\n *\r\n * Note: we don't merge __proto__ to prevent prototype pollution\r\n */\r\nfunction deepExtend(target, source) {\r\n if (!(source instanceof Object)) {\r\n return source;\r\n }\r\n switch (source.constructor) {\r\n case Date:\r\n // Treat Dates like scalars; if the target date object had any child\r\n // properties - they will be lost!\r\n const dateValue = source;\r\n return new Date(dateValue.getTime());\r\n case Object:\r\n if (target === undefined) {\r\n target = {};\r\n }\r\n break;\r\n case Array:\r\n // Always copy the array source and overwrite the target.\r\n target = [];\r\n break;\r\n default:\r\n // Not a plain Object - treat it as a scalar.\r\n return source;\r\n }\r\n for (const prop in source) {\r\n // use isValidKey to guard against prototype pollution. See https://snyk.io/vuln/SNYK-JS-LODASH-450202\r\n if (!source.hasOwnProperty(prop) || !isValidKey(prop)) {\r\n continue;\r\n }\r\n target[prop] = deepExtend(target[prop], source[prop]);\r\n }\r\n return target;\r\n}\r\nfunction isValidKey(key) {\r\n return key !== '__proto__';\r\n}\n\n/**\r\n * @license\r\n * Copyright 2022 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Polyfill for `globalThis` object.\r\n * @returns the `globalThis` object for the given environment.\r\n * @public\r\n */\r\nfunction getGlobal() {\r\n if (typeof self !== 'undefined') {\r\n return self;\r\n }\r\n if (typeof window !== 'undefined') {\r\n return window;\r\n }\r\n if (typeof global !== 'undefined') {\r\n return global;\r\n }\r\n throw new Error('Unable to locate global object.');\r\n}\n\n/**\r\n * @license\r\n * Copyright 2022 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst getDefaultsFromGlobal = () => getGlobal().__FIREBASE_DEFAULTS__;\r\n/**\r\n * Attempt to read defaults from a JSON string provided to\r\n * process(.)env(.)__FIREBASE_DEFAULTS__ or a JSON file whose path is in\r\n * process(.)env(.)__FIREBASE_DEFAULTS_PATH__\r\n * The dots are in parens because certain compilers (Vite?) cannot\r\n * handle seeing that variable in comments.\r\n * See https://github.com/firebase/firebase-js-sdk/issues/6838\r\n */\r\nconst getDefaultsFromEnvVariable = () => {\r\n if (typeof process === 'undefined' || typeof process.env === 'undefined') {\r\n return;\r\n }\r\n const defaultsJsonString = process.env.__FIREBASE_DEFAULTS__;\r\n if (defaultsJsonString) {\r\n return JSON.parse(defaultsJsonString);\r\n }\r\n};\r\nconst getDefaultsFromCookie = () => {\r\n if (typeof document === 'undefined') {\r\n return;\r\n }\r\n let match;\r\n try {\r\n match = document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/);\r\n }\r\n catch (e) {\r\n // Some environments such as Angular Universal SSR have a\r\n // `document` object but error on accessing `document.cookie`.\r\n return;\r\n }\r\n const decoded = match && base64Decode(match[1]);\r\n return decoded && JSON.parse(decoded);\r\n};\r\n/**\r\n * Get the __FIREBASE_DEFAULTS__ object. It checks in order:\r\n * (1) if such an object exists as a property of `globalThis`\r\n * (2) if such an object was provided on a shell environment variable\r\n * (3) if such an object exists in a cookie\r\n * @public\r\n */\r\nconst getDefaults = () => {\r\n try {\r\n return (getDefaultsFromGlobal() ||\r\n getDefaultsFromEnvVariable() ||\r\n getDefaultsFromCookie());\r\n }\r\n catch (e) {\r\n /**\r\n * Catch-all for being unable to get __FIREBASE_DEFAULTS__ due\r\n * to any environment case we have not accounted for. Log to\r\n * info instead of swallowing so we can find these unknown cases\r\n * and add paths for them if needed.\r\n */\r\n console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);\r\n return;\r\n }\r\n};\r\n/**\r\n * Returns emulator host stored in the __FIREBASE_DEFAULTS__ object\r\n * for the given product.\r\n * @returns a URL host formatted like `127.0.0.1:9999` or `[::1]:4000` if available\r\n * @public\r\n */\r\nconst getDefaultEmulatorHost = (productName) => { var _a, _b; return (_b = (_a = getDefaults()) === null || _a === void 0 ? void 0 : _a.emulatorHosts) === null || _b === void 0 ? void 0 : _b[productName]; };\r\n/**\r\n * Returns emulator hostname and port stored in the __FIREBASE_DEFAULTS__ object\r\n * for the given product.\r\n * @returns a pair of hostname and port like `[\"::1\", 4000]` if available\r\n * @public\r\n */\r\nconst getDefaultEmulatorHostnameAndPort = (productName) => {\r\n const host = getDefaultEmulatorHost(productName);\r\n if (!host) {\r\n return undefined;\r\n }\r\n const separatorIndex = host.lastIndexOf(':'); // Finding the last since IPv6 addr also has colons.\r\n if (separatorIndex <= 0 || separatorIndex + 1 === host.length) {\r\n throw new Error(`Invalid host ${host} with no separate hostname and port!`);\r\n }\r\n // eslint-disable-next-line no-restricted-globals\r\n const port = parseInt(host.substring(separatorIndex + 1), 10);\r\n if (host[0] === '[') {\r\n // Bracket-quoted `[ipv6addr]:port` => return \"ipv6addr\" (without brackets).\r\n return [host.substring(1, separatorIndex - 1), port];\r\n }\r\n else {\r\n return [host.substring(0, separatorIndex), port];\r\n }\r\n};\r\n/**\r\n * Returns Firebase app config stored in the __FIREBASE_DEFAULTS__ object.\r\n * @public\r\n */\r\nconst getDefaultAppConfig = () => { var _a; return (_a = getDefaults()) === null || _a === void 0 ? void 0 : _a.config; };\r\n/**\r\n * Returns an experimental setting on the __FIREBASE_DEFAULTS__ object (properties\r\n * prefixed by \"_\")\r\n * @public\r\n */\r\nconst getExperimentalSetting = (name) => { var _a; return (_a = getDefaults()) === null || _a === void 0 ? void 0 : _a[`_${name}`]; };\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nclass Deferred {\r\n constructor() {\r\n this.reject = () => { };\r\n this.resolve = () => { };\r\n this.promise = new Promise((resolve, reject) => {\r\n this.resolve = resolve;\r\n this.reject = reject;\r\n });\r\n }\r\n /**\r\n * Our API internals are not promiseified and cannot because our callback APIs have subtle expectations around\r\n * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback\r\n * and returns a node-style callback which will resolve or reject the Deferred's promise.\r\n */\r\n wrapCallback(callback) {\r\n return (error, value) => {\r\n if (error) {\r\n this.reject(error);\r\n }\r\n else {\r\n this.resolve(value);\r\n }\r\n if (typeof callback === 'function') {\r\n // Attaching noop handler just in case developer wasn't expecting\r\n // promises\r\n this.promise.catch(() => { });\r\n // Some of our callbacks don't expect a value and our own tests\r\n // assert that the parameter length is 1\r\n if (callback.length === 1) {\r\n callback(error);\r\n }\r\n else {\r\n callback(error, value);\r\n }\r\n }\r\n };\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2021 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction createMockUserToken(token, projectId) {\r\n if (token.uid) {\r\n throw new Error('The \"uid\" field is no longer supported by mockUserToken. Please use \"sub\" instead for Firebase Auth User ID.');\r\n }\r\n // Unsecured JWTs use \"none\" as the algorithm.\r\n const header = {\r\n alg: 'none',\r\n type: 'JWT'\r\n };\r\n const project = projectId || 'demo-project';\r\n const iat = token.iat || 0;\r\n const sub = token.sub || token.user_id;\r\n if (!sub) {\r\n throw new Error(\"mockUserToken must contain 'sub' or 'user_id' field!\");\r\n }\r\n const payload = Object.assign({ \r\n // Set all required fields to decent defaults\r\n iss: `https://securetoken.google.com/${project}`, aud: project, iat, exp: iat + 3600, auth_time: iat, sub, user_id: sub, firebase: {\r\n sign_in_provider: 'custom',\r\n identities: {}\r\n } }, token);\r\n // Unsecured JWTs use the empty string as a signature.\r\n const signature = '';\r\n return [\r\n base64urlEncodeWithoutPadding(JSON.stringify(header)),\r\n base64urlEncodeWithoutPadding(JSON.stringify(payload)),\r\n signature\r\n ].join('.');\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Returns navigator.userAgent string or '' if it's not defined.\r\n * @return user agent string\r\n */\r\nfunction getUA() {\r\n if (typeof navigator !== 'undefined' &&\r\n typeof navigator['userAgent'] === 'string') {\r\n return navigator['userAgent'];\r\n }\r\n else {\r\n return '';\r\n }\r\n}\r\n/**\r\n * Detect Cordova / PhoneGap / Ionic frameworks on a mobile device.\r\n *\r\n * Deliberately does not rely on checking `file://` URLs (as this fails PhoneGap\r\n * in the Ripple emulator) nor Cordova `onDeviceReady`, which would normally\r\n * wait for a callback.\r\n */\r\nfunction isMobileCordova() {\r\n return (typeof window !== 'undefined' &&\r\n // @ts-ignore Setting up an broadly applicable index signature for Window\r\n // just to deal with this case would probably be a bad idea.\r\n !!(window['cordova'] || window['phonegap'] || window['PhoneGap']) &&\r\n /ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(getUA()));\r\n}\r\n/**\r\n * Detect Node.js.\r\n *\r\n * @return true if Node.js environment is detected or specified.\r\n */\r\n// Node detection logic from: https://github.com/iliakan/detect-node/\r\nfunction isNode() {\r\n var _a;\r\n const forceEnvironment = (_a = getDefaults()) === null || _a === void 0 ? void 0 : _a.forceEnvironment;\r\n if (forceEnvironment === 'node') {\r\n return true;\r\n }\r\n else if (forceEnvironment === 'browser') {\r\n return false;\r\n }\r\n try {\r\n return (Object.prototype.toString.call(global.process) === '[object process]');\r\n }\r\n catch (e) {\r\n return false;\r\n }\r\n}\r\n/**\r\n * Detect Browser Environment\r\n */\r\nfunction isBrowser() {\r\n return typeof self === 'object' && self.self === self;\r\n}\r\nfunction isBrowserExtension() {\r\n const runtime = typeof chrome === 'object'\r\n ? chrome.runtime\r\n : typeof browser === 'object'\r\n ? browser.runtime\r\n : undefined;\r\n return typeof runtime === 'object' && runtime.id !== undefined;\r\n}\r\n/**\r\n * Detect React Native.\r\n *\r\n * @return true if ReactNative environment is detected.\r\n */\r\nfunction isReactNative() {\r\n return (typeof navigator === 'object' && navigator['product'] === 'ReactNative');\r\n}\r\n/** Detects Electron apps. */\r\nfunction isElectron() {\r\n return getUA().indexOf('Electron/') >= 0;\r\n}\r\n/** Detects Internet Explorer. */\r\nfunction isIE() {\r\n const ua = getUA();\r\n return ua.indexOf('MSIE ') >= 0 || ua.indexOf('Trident/') >= 0;\r\n}\r\n/** Detects Universal Windows Platform apps. */\r\nfunction isUWP() {\r\n return getUA().indexOf('MSAppHost/') >= 0;\r\n}\r\n/**\r\n * Detect whether the current SDK build is the Node version.\r\n *\r\n * @return true if it's the Node SDK build.\r\n */\r\nfunction isNodeSdk() {\r\n return CONSTANTS.NODE_CLIENT === true || CONSTANTS.NODE_ADMIN === true;\r\n}\r\n/** Returns true if we are running in Safari. */\r\nfunction isSafari() {\r\n return (!isNode() &&\r\n !!navigator.userAgent &&\r\n navigator.userAgent.includes('Safari') &&\r\n !navigator.userAgent.includes('Chrome'));\r\n}\r\n/**\r\n * This method checks if indexedDB is supported by current browser/service worker context\r\n * @return true if indexedDB is supported by current browser/service worker context\r\n */\r\nfunction isIndexedDBAvailable() {\r\n try {\r\n return typeof indexedDB === 'object';\r\n }\r\n catch (e) {\r\n return false;\r\n }\r\n}\r\n/**\r\n * This method validates browser/sw context for indexedDB by opening a dummy indexedDB database and reject\r\n * if errors occur during the database open operation.\r\n *\r\n * @throws exception if current browser/sw context can't run idb.open (ex: Safari iframe, Firefox\r\n * private browsing)\r\n */\r\nfunction validateIndexedDBOpenable() {\r\n return new Promise((resolve, reject) => {\r\n try {\r\n let preExist = true;\r\n const DB_CHECK_NAME = 'validate-browser-context-for-indexeddb-analytics-module';\r\n const request = self.indexedDB.open(DB_CHECK_NAME);\r\n request.onsuccess = () => {\r\n request.result.close();\r\n // delete database only when it doesn't pre-exist\r\n if (!preExist) {\r\n self.indexedDB.deleteDatabase(DB_CHECK_NAME);\r\n }\r\n resolve(true);\r\n };\r\n request.onupgradeneeded = () => {\r\n preExist = false;\r\n };\r\n request.onerror = () => {\r\n var _a;\r\n reject(((_a = request.error) === null || _a === void 0 ? void 0 : _a.message) || '');\r\n };\r\n }\r\n catch (error) {\r\n reject(error);\r\n }\r\n });\r\n}\r\n/**\r\n *\r\n * This method checks whether cookie is enabled within current browser\r\n * @return true if cookie is enabled within current browser\r\n */\r\nfunction areCookiesEnabled() {\r\n if (typeof navigator === 'undefined' || !navigator.cookieEnabled) {\r\n return false;\r\n }\r\n return true;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @fileoverview Standardized Firebase Error.\r\n *\r\n * Usage:\r\n *\r\n * // Typescript string literals for type-safe codes\r\n * type Err =\r\n * 'unknown' |\r\n * 'object-not-found'\r\n * ;\r\n *\r\n * // Closure enum for type-safe error codes\r\n * // at-enum {string}\r\n * var Err = {\r\n * UNKNOWN: 'unknown',\r\n * OBJECT_NOT_FOUND: 'object-not-found',\r\n * }\r\n *\r\n * let errors: Map = {\r\n * 'generic-error': \"Unknown error\",\r\n * 'file-not-found': \"Could not find file: {$file}\",\r\n * };\r\n *\r\n * // Type-safe function - must pass a valid error code as param.\r\n * let error = new ErrorFactory('service', 'Service', errors);\r\n *\r\n * ...\r\n * throw error.create(Err.GENERIC);\r\n * ...\r\n * throw error.create(Err.FILE_NOT_FOUND, {'file': fileName});\r\n * ...\r\n * // Service: Could not file file: foo.txt (service/file-not-found).\r\n *\r\n * catch (e) {\r\n * assert(e.message === \"Could not find file: foo.txt.\");\r\n * if ((e as FirebaseError)?.code === 'service/file-not-found') {\r\n * console.log(\"Could not read file: \" + e['file']);\r\n * }\r\n * }\r\n */\r\nconst ERROR_NAME = 'FirebaseError';\r\n// Based on code from:\r\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Custom_Error_Types\r\nclass FirebaseError extends Error {\r\n constructor(\r\n /** The error code for this error. */\r\n code, message, \r\n /** Custom data for this error. */\r\n customData) {\r\n super(message);\r\n this.code = code;\r\n this.customData = customData;\r\n /** The custom name for all FirebaseErrors. */\r\n this.name = ERROR_NAME;\r\n // Fix For ES5\r\n // https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\r\n Object.setPrototypeOf(this, FirebaseError.prototype);\r\n // Maintains proper stack trace for where our error was thrown.\r\n // Only available on V8.\r\n if (Error.captureStackTrace) {\r\n Error.captureStackTrace(this, ErrorFactory.prototype.create);\r\n }\r\n }\r\n}\r\nclass ErrorFactory {\r\n constructor(service, serviceName, errors) {\r\n this.service = service;\r\n this.serviceName = serviceName;\r\n this.errors = errors;\r\n }\r\n create(code, ...data) {\r\n const customData = data[0] || {};\r\n const fullCode = `${this.service}/${code}`;\r\n const template = this.errors[code];\r\n const message = template ? replaceTemplate(template, customData) : 'Error';\r\n // Service Name: Error message (service/code).\r\n const fullMessage = `${this.serviceName}: ${message} (${fullCode}).`;\r\n const error = new FirebaseError(fullCode, fullMessage, customData);\r\n return error;\r\n }\r\n}\r\nfunction replaceTemplate(template, data) {\r\n return template.replace(PATTERN, (_, key) => {\r\n const value = data[key];\r\n return value != null ? String(value) : `<${key}?>`;\r\n });\r\n}\r\nconst PATTERN = /\\{\\$([^}]+)}/g;\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Evaluates a JSON string into a javascript object.\r\n *\r\n * @param {string} str A string containing JSON.\r\n * @return {*} The javascript object representing the specified JSON.\r\n */\r\nfunction jsonEval(str) {\r\n return JSON.parse(str);\r\n}\r\n/**\r\n * Returns JSON representing a javascript object.\r\n * @param {*} data Javascript object to be stringified.\r\n * @return {string} The JSON contents of the object.\r\n */\r\nfunction stringify(data) {\r\n return JSON.stringify(data);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Decodes a Firebase auth. token into constituent parts.\r\n *\r\n * Notes:\r\n * - May return with invalid / incomplete claims if there's no native base64 decoding support.\r\n * - Doesn't check if the token is actually valid.\r\n */\r\nconst decode = function (token) {\r\n let header = {}, claims = {}, data = {}, signature = '';\r\n try {\r\n const parts = token.split('.');\r\n header = jsonEval(base64Decode(parts[0]) || '');\r\n claims = jsonEval(base64Decode(parts[1]) || '');\r\n signature = parts[2];\r\n data = claims['d'] || {};\r\n delete claims['d'];\r\n }\r\n catch (e) { }\r\n return {\r\n header,\r\n claims,\r\n data,\r\n signature\r\n };\r\n};\r\n/**\r\n * Decodes a Firebase auth. token and checks the validity of its time-based claims. Will return true if the\r\n * token is within the time window authorized by the 'nbf' (not-before) and 'iat' (issued-at) claims.\r\n *\r\n * Notes:\r\n * - May return a false negative if there's no native base64 decoding support.\r\n * - Doesn't check if the token is actually valid.\r\n */\r\nconst isValidTimestamp = function (token) {\r\n const claims = decode(token).claims;\r\n const now = Math.floor(new Date().getTime() / 1000);\r\n let validSince = 0, validUntil = 0;\r\n if (typeof claims === 'object') {\r\n if (claims.hasOwnProperty('nbf')) {\r\n validSince = claims['nbf'];\r\n }\r\n else if (claims.hasOwnProperty('iat')) {\r\n validSince = claims['iat'];\r\n }\r\n if (claims.hasOwnProperty('exp')) {\r\n validUntil = claims['exp'];\r\n }\r\n else {\r\n // token will expire after 24h by default\r\n validUntil = validSince + 86400;\r\n }\r\n }\r\n return (!!now &&\r\n !!validSince &&\r\n !!validUntil &&\r\n now >= validSince &&\r\n now <= validUntil);\r\n};\r\n/**\r\n * Decodes a Firebase auth. token and returns its issued at time if valid, null otherwise.\r\n *\r\n * Notes:\r\n * - May return null if there's no native base64 decoding support.\r\n * - Doesn't check if the token is actually valid.\r\n */\r\nconst issuedAtTime = function (token) {\r\n const claims = decode(token).claims;\r\n if (typeof claims === 'object' && claims.hasOwnProperty('iat')) {\r\n return claims['iat'];\r\n }\r\n return null;\r\n};\r\n/**\r\n * Decodes a Firebase auth. token and checks the validity of its format. Expects a valid issued-at time.\r\n *\r\n * Notes:\r\n * - May return a false negative if there's no native base64 decoding support.\r\n * - Doesn't check if the token is actually valid.\r\n */\r\nconst isValidFormat = function (token) {\r\n const decoded = decode(token), claims = decoded.claims;\r\n return !!claims && typeof claims === 'object' && claims.hasOwnProperty('iat');\r\n};\r\n/**\r\n * Attempts to peer into an auth token and determine if it's an admin auth token by looking at the claims portion.\r\n *\r\n * Notes:\r\n * - May return a false negative if there's no native base64 decoding support.\r\n * - Doesn't check if the token is actually valid.\r\n */\r\nconst isAdmin = function (token) {\r\n const claims = decode(token).claims;\r\n return typeof claims === 'object' && claims['admin'] === true;\r\n};\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction contains(obj, key) {\r\n return Object.prototype.hasOwnProperty.call(obj, key);\r\n}\r\nfunction safeGet(obj, key) {\r\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\r\n return obj[key];\r\n }\r\n else {\r\n return undefined;\r\n }\r\n}\r\nfunction isEmpty(obj) {\r\n for (const key in obj) {\r\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\r\nfunction map(obj, fn, contextObj) {\r\n const res = {};\r\n for (const key in obj) {\r\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\r\n res[key] = fn.call(contextObj, obj[key], key, obj);\r\n }\r\n }\r\n return res;\r\n}\r\n/**\r\n * Deep equal two objects. Support Arrays and Objects.\r\n */\r\nfunction deepEqual(a, b) {\r\n if (a === b) {\r\n return true;\r\n }\r\n const aKeys = Object.keys(a);\r\n const bKeys = Object.keys(b);\r\n for (const k of aKeys) {\r\n if (!bKeys.includes(k)) {\r\n return false;\r\n }\r\n const aProp = a[k];\r\n const bProp = b[k];\r\n if (isObject(aProp) && isObject(bProp)) {\r\n if (!deepEqual(aProp, bProp)) {\r\n return false;\r\n }\r\n }\r\n else if (aProp !== bProp) {\r\n return false;\r\n }\r\n }\r\n for (const k of bKeys) {\r\n if (!aKeys.includes(k)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\r\nfunction isObject(thing) {\r\n return thing !== null && typeof thing === 'object';\r\n}\n\n/**\r\n * @license\r\n * Copyright 2022 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Rejects if the given promise doesn't resolve in timeInMS milliseconds.\r\n * @internal\r\n */\r\nfunction promiseWithTimeout(promise, timeInMS = 2000) {\r\n const deferredPromise = new Deferred();\r\n setTimeout(() => deferredPromise.reject('timeout!'), timeInMS);\r\n promise.then(deferredPromise.resolve, deferredPromise.reject);\r\n return deferredPromise.promise;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Returns a querystring-formatted string (e.g. &arg=val&arg2=val2) from a\r\n * params object (e.g. {arg: 'val', arg2: 'val2'})\r\n * Note: You must prepend it with ? when adding it to a URL.\r\n */\r\nfunction querystring(querystringParams) {\r\n const params = [];\r\n for (const [key, value] of Object.entries(querystringParams)) {\r\n if (Array.isArray(value)) {\r\n value.forEach(arrayVal => {\r\n params.push(encodeURIComponent(key) + '=' + encodeURIComponent(arrayVal));\r\n });\r\n }\r\n else {\r\n params.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));\r\n }\r\n }\r\n return params.length ? '&' + params.join('&') : '';\r\n}\r\n/**\r\n * Decodes a querystring (e.g. ?arg=val&arg2=val2) into a params object\r\n * (e.g. {arg: 'val', arg2: 'val2'})\r\n */\r\nfunction querystringDecode(querystring) {\r\n const obj = {};\r\n const tokens = querystring.replace(/^\\?/, '').split('&');\r\n tokens.forEach(token => {\r\n if (token) {\r\n const [key, value] = token.split('=');\r\n obj[decodeURIComponent(key)] = decodeURIComponent(value);\r\n }\r\n });\r\n return obj;\r\n}\r\n/**\r\n * Extract the query string part of a URL, including the leading question mark (if present).\r\n */\r\nfunction extractQuerystring(url) {\r\n const queryStart = url.indexOf('?');\r\n if (!queryStart) {\r\n return '';\r\n }\r\n const fragmentStart = url.indexOf('#', queryStart);\r\n return url.substring(queryStart, fragmentStart > 0 ? fragmentStart : undefined);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @fileoverview SHA-1 cryptographic hash.\r\n * Variable names follow the notation in FIPS PUB 180-3:\r\n * http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf.\r\n *\r\n * Usage:\r\n * var sha1 = new sha1();\r\n * sha1.update(bytes);\r\n * var hash = sha1.digest();\r\n *\r\n * Performance:\r\n * Chrome 23: ~400 Mbit/s\r\n * Firefox 16: ~250 Mbit/s\r\n *\r\n */\r\n/**\r\n * SHA-1 cryptographic hash constructor.\r\n *\r\n * The properties declared here are discussed in the above algorithm document.\r\n * @constructor\r\n * @final\r\n * @struct\r\n */\r\nclass Sha1 {\r\n constructor() {\r\n /**\r\n * Holds the previous values of accumulated variables a-e in the compress_\r\n * function.\r\n * @private\r\n */\r\n this.chain_ = [];\r\n /**\r\n * A buffer holding the partially computed hash result.\r\n * @private\r\n */\r\n this.buf_ = [];\r\n /**\r\n * An array of 80 bytes, each a part of the message to be hashed. Referred to\r\n * as the message schedule in the docs.\r\n * @private\r\n */\r\n this.W_ = [];\r\n /**\r\n * Contains data needed to pad messages less than 64 bytes.\r\n * @private\r\n */\r\n this.pad_ = [];\r\n /**\r\n * @private {number}\r\n */\r\n this.inbuf_ = 0;\r\n /**\r\n * @private {number}\r\n */\r\n this.total_ = 0;\r\n this.blockSize = 512 / 8;\r\n this.pad_[0] = 128;\r\n for (let i = 1; i < this.blockSize; ++i) {\r\n this.pad_[i] = 0;\r\n }\r\n this.reset();\r\n }\r\n reset() {\r\n this.chain_[0] = 0x67452301;\r\n this.chain_[1] = 0xefcdab89;\r\n this.chain_[2] = 0x98badcfe;\r\n this.chain_[3] = 0x10325476;\r\n this.chain_[4] = 0xc3d2e1f0;\r\n this.inbuf_ = 0;\r\n this.total_ = 0;\r\n }\r\n /**\r\n * Internal compress helper function.\r\n * @param buf Block to compress.\r\n * @param offset Offset of the block in the buffer.\r\n * @private\r\n */\r\n compress_(buf, offset) {\r\n if (!offset) {\r\n offset = 0;\r\n }\r\n const W = this.W_;\r\n // get 16 big endian words\r\n if (typeof buf === 'string') {\r\n for (let i = 0; i < 16; i++) {\r\n // TODO(user): [bug 8140122] Recent versions of Safari for Mac OS and iOS\r\n // have a bug that turns the post-increment ++ operator into pre-increment\r\n // during JIT compilation. We have code that depends heavily on SHA-1 for\r\n // correctness and which is affected by this bug, so I've removed all uses\r\n // of post-increment ++ in which the result value is used. We can revert\r\n // this change once the Safari bug\r\n // (https://bugs.webkit.org/show_bug.cgi?id=109036) has been fixed and\r\n // most clients have been updated.\r\n W[i] =\r\n (buf.charCodeAt(offset) << 24) |\r\n (buf.charCodeAt(offset + 1) << 16) |\r\n (buf.charCodeAt(offset + 2) << 8) |\r\n buf.charCodeAt(offset + 3);\r\n offset += 4;\r\n }\r\n }\r\n else {\r\n for (let i = 0; i < 16; i++) {\r\n W[i] =\r\n (buf[offset] << 24) |\r\n (buf[offset + 1] << 16) |\r\n (buf[offset + 2] << 8) |\r\n buf[offset + 3];\r\n offset += 4;\r\n }\r\n }\r\n // expand to 80 words\r\n for (let i = 16; i < 80; i++) {\r\n const t = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];\r\n W[i] = ((t << 1) | (t >>> 31)) & 0xffffffff;\r\n }\r\n let a = this.chain_[0];\r\n let b = this.chain_[1];\r\n let c = this.chain_[2];\r\n let d = this.chain_[3];\r\n let e = this.chain_[4];\r\n let f, k;\r\n // TODO(user): Try to unroll this loop to speed up the computation.\r\n for (let i = 0; i < 80; i++) {\r\n if (i < 40) {\r\n if (i < 20) {\r\n f = d ^ (b & (c ^ d));\r\n k = 0x5a827999;\r\n }\r\n else {\r\n f = b ^ c ^ d;\r\n k = 0x6ed9eba1;\r\n }\r\n }\r\n else {\r\n if (i < 60) {\r\n f = (b & c) | (d & (b | c));\r\n k = 0x8f1bbcdc;\r\n }\r\n else {\r\n f = b ^ c ^ d;\r\n k = 0xca62c1d6;\r\n }\r\n }\r\n const t = (((a << 5) | (a >>> 27)) + f + e + k + W[i]) & 0xffffffff;\r\n e = d;\r\n d = c;\r\n c = ((b << 30) | (b >>> 2)) & 0xffffffff;\r\n b = a;\r\n a = t;\r\n }\r\n this.chain_[0] = (this.chain_[0] + a) & 0xffffffff;\r\n this.chain_[1] = (this.chain_[1] + b) & 0xffffffff;\r\n this.chain_[2] = (this.chain_[2] + c) & 0xffffffff;\r\n this.chain_[3] = (this.chain_[3] + d) & 0xffffffff;\r\n this.chain_[4] = (this.chain_[4] + e) & 0xffffffff;\r\n }\r\n update(bytes, length) {\r\n // TODO(johnlenz): tighten the function signature and remove this check\r\n if (bytes == null) {\r\n return;\r\n }\r\n if (length === undefined) {\r\n length = bytes.length;\r\n }\r\n const lengthMinusBlock = length - this.blockSize;\r\n let n = 0;\r\n // Using local instead of member variables gives ~5% speedup on Firefox 16.\r\n const buf = this.buf_;\r\n let inbuf = this.inbuf_;\r\n // The outer while loop should execute at most twice.\r\n while (n < length) {\r\n // When we have no data in the block to top up, we can directly process the\r\n // input buffer (assuming it contains sufficient data). This gives ~25%\r\n // speedup on Chrome 23 and ~15% speedup on Firefox 16, but requires that\r\n // the data is provided in large chunks (or in multiples of 64 bytes).\r\n if (inbuf === 0) {\r\n while (n <= lengthMinusBlock) {\r\n this.compress_(bytes, n);\r\n n += this.blockSize;\r\n }\r\n }\r\n if (typeof bytes === 'string') {\r\n while (n < length) {\r\n buf[inbuf] = bytes.charCodeAt(n);\r\n ++inbuf;\r\n ++n;\r\n if (inbuf === this.blockSize) {\r\n this.compress_(buf);\r\n inbuf = 0;\r\n // Jump to the outer loop so we use the full-block optimization.\r\n break;\r\n }\r\n }\r\n }\r\n else {\r\n while (n < length) {\r\n buf[inbuf] = bytes[n];\r\n ++inbuf;\r\n ++n;\r\n if (inbuf === this.blockSize) {\r\n this.compress_(buf);\r\n inbuf = 0;\r\n // Jump to the outer loop so we use the full-block optimization.\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n this.inbuf_ = inbuf;\r\n this.total_ += length;\r\n }\r\n /** @override */\r\n digest() {\r\n const digest = [];\r\n let totalBits = this.total_ * 8;\r\n // Add pad 0x80 0x00*.\r\n if (this.inbuf_ < 56) {\r\n this.update(this.pad_, 56 - this.inbuf_);\r\n }\r\n else {\r\n this.update(this.pad_, this.blockSize - (this.inbuf_ - 56));\r\n }\r\n // Add # bits.\r\n for (let i = this.blockSize - 1; i >= 56; i--) {\r\n this.buf_[i] = totalBits & 255;\r\n totalBits /= 256; // Don't use bit-shifting here!\r\n }\r\n this.compress_(this.buf_);\r\n let n = 0;\r\n for (let i = 0; i < 5; i++) {\r\n for (let j = 24; j >= 0; j -= 8) {\r\n digest[n] = (this.chain_[i] >> j) & 255;\r\n ++n;\r\n }\r\n }\r\n return digest;\r\n }\r\n}\n\n/**\r\n * Helper to make a Subscribe function (just like Promise helps make a\r\n * Thenable).\r\n *\r\n * @param executor Function which can make calls to a single Observer\r\n * as a proxy.\r\n * @param onNoObservers Callback when count of Observers goes to zero.\r\n */\r\nfunction createSubscribe(executor, onNoObservers) {\r\n const proxy = new ObserverProxy(executor, onNoObservers);\r\n return proxy.subscribe.bind(proxy);\r\n}\r\n/**\r\n * Implement fan-out for any number of Observers attached via a subscribe\r\n * function.\r\n */\r\nclass ObserverProxy {\r\n /**\r\n * @param executor Function which can make calls to a single Observer\r\n * as a proxy.\r\n * @param onNoObservers Callback when count of Observers goes to zero.\r\n */\r\n constructor(executor, onNoObservers) {\r\n this.observers = [];\r\n this.unsubscribes = [];\r\n this.observerCount = 0;\r\n // Micro-task scheduling by calling task.then().\r\n this.task = Promise.resolve();\r\n this.finalized = false;\r\n this.onNoObservers = onNoObservers;\r\n // Call the executor asynchronously so subscribers that are called\r\n // synchronously after the creation of the subscribe function\r\n // can still receive the very first value generated in the executor.\r\n this.task\r\n .then(() => {\r\n executor(this);\r\n })\r\n .catch(e => {\r\n this.error(e);\r\n });\r\n }\r\n next(value) {\r\n this.forEachObserver((observer) => {\r\n observer.next(value);\r\n });\r\n }\r\n error(error) {\r\n this.forEachObserver((observer) => {\r\n observer.error(error);\r\n });\r\n this.close(error);\r\n }\r\n complete() {\r\n this.forEachObserver((observer) => {\r\n observer.complete();\r\n });\r\n this.close();\r\n }\r\n /**\r\n * Subscribe function that can be used to add an Observer to the fan-out list.\r\n *\r\n * - We require that no event is sent to a subscriber sychronously to their\r\n * call to subscribe().\r\n */\r\n subscribe(nextOrObserver, error, complete) {\r\n let observer;\r\n if (nextOrObserver === undefined &&\r\n error === undefined &&\r\n complete === undefined) {\r\n throw new Error('Missing Observer.');\r\n }\r\n // Assemble an Observer object when passed as callback functions.\r\n if (implementsAnyMethods(nextOrObserver, [\r\n 'next',\r\n 'error',\r\n 'complete'\r\n ])) {\r\n observer = nextOrObserver;\r\n }\r\n else {\r\n observer = {\r\n next: nextOrObserver,\r\n error,\r\n complete\r\n };\r\n }\r\n if (observer.next === undefined) {\r\n observer.next = noop;\r\n }\r\n if (observer.error === undefined) {\r\n observer.error = noop;\r\n }\r\n if (observer.complete === undefined) {\r\n observer.complete = noop;\r\n }\r\n const unsub = this.unsubscribeOne.bind(this, this.observers.length);\r\n // Attempt to subscribe to a terminated Observable - we\r\n // just respond to the Observer with the final error or complete\r\n // event.\r\n if (this.finalized) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.task.then(() => {\r\n try {\r\n if (this.finalError) {\r\n observer.error(this.finalError);\r\n }\r\n else {\r\n observer.complete();\r\n }\r\n }\r\n catch (e) {\r\n // nothing\r\n }\r\n return;\r\n });\r\n }\r\n this.observers.push(observer);\r\n return unsub;\r\n }\r\n // Unsubscribe is synchronous - we guarantee that no events are sent to\r\n // any unsubscribed Observer.\r\n unsubscribeOne(i) {\r\n if (this.observers === undefined || this.observers[i] === undefined) {\r\n return;\r\n }\r\n delete this.observers[i];\r\n this.observerCount -= 1;\r\n if (this.observerCount === 0 && this.onNoObservers !== undefined) {\r\n this.onNoObservers(this);\r\n }\r\n }\r\n forEachObserver(fn) {\r\n if (this.finalized) {\r\n // Already closed by previous event....just eat the additional values.\r\n return;\r\n }\r\n // Since sendOne calls asynchronously - there is no chance that\r\n // this.observers will become undefined.\r\n for (let i = 0; i < this.observers.length; i++) {\r\n this.sendOne(i, fn);\r\n }\r\n }\r\n // Call the Observer via one of it's callback function. We are careful to\r\n // confirm that the observe has not been unsubscribed since this asynchronous\r\n // function had been queued.\r\n sendOne(i, fn) {\r\n // Execute the callback asynchronously\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.task.then(() => {\r\n if (this.observers !== undefined && this.observers[i] !== undefined) {\r\n try {\r\n fn(this.observers[i]);\r\n }\r\n catch (e) {\r\n // Ignore exceptions raised in Observers or missing methods of an\r\n // Observer.\r\n // Log error to console. b/31404806\r\n if (typeof console !== 'undefined' && console.error) {\r\n console.error(e);\r\n }\r\n }\r\n }\r\n });\r\n }\r\n close(err) {\r\n if (this.finalized) {\r\n return;\r\n }\r\n this.finalized = true;\r\n if (err !== undefined) {\r\n this.finalError = err;\r\n }\r\n // Proxy is no longer needed - garbage collect references\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.task.then(() => {\r\n this.observers = undefined;\r\n this.onNoObservers = undefined;\r\n });\r\n }\r\n}\r\n/** Turn synchronous function into one called asynchronously. */\r\n// eslint-disable-next-line @typescript-eslint/ban-types\r\nfunction async(fn, onError) {\r\n return (...args) => {\r\n Promise.resolve(true)\r\n .then(() => {\r\n fn(...args);\r\n })\r\n .catch((error) => {\r\n if (onError) {\r\n onError(error);\r\n }\r\n });\r\n };\r\n}\r\n/**\r\n * Return true if the object passed in implements any of the named methods.\r\n */\r\nfunction implementsAnyMethods(obj, methods) {\r\n if (typeof obj !== 'object' || obj === null) {\r\n return false;\r\n }\r\n for (const method of methods) {\r\n if (method in obj && typeof obj[method] === 'function') {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\nfunction noop() {\r\n // do nothing\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Check to make sure the appropriate number of arguments are provided for a public function.\r\n * Throws an error if it fails.\r\n *\r\n * @param fnName The function name\r\n * @param minCount The minimum number of arguments to allow for the function call\r\n * @param maxCount The maximum number of argument to allow for the function call\r\n * @param argCount The actual number of arguments provided.\r\n */\r\nconst validateArgCount = function (fnName, minCount, maxCount, argCount) {\r\n let argError;\r\n if (argCount < minCount) {\r\n argError = 'at least ' + minCount;\r\n }\r\n else if (argCount > maxCount) {\r\n argError = maxCount === 0 ? 'none' : 'no more than ' + maxCount;\r\n }\r\n if (argError) {\r\n const error = fnName +\r\n ' failed: Was called with ' +\r\n argCount +\r\n (argCount === 1 ? ' argument.' : ' arguments.') +\r\n ' Expects ' +\r\n argError +\r\n '.';\r\n throw new Error(error);\r\n }\r\n};\r\n/**\r\n * Generates a string to prefix an error message about failed argument validation\r\n *\r\n * @param fnName The function name\r\n * @param argName The name of the argument\r\n * @return The prefix to add to the error thrown for validation.\r\n */\r\nfunction errorPrefix(fnName, argName) {\r\n return `${fnName} failed: ${argName} argument `;\r\n}\r\n/**\r\n * @param fnName\r\n * @param argumentNumber\r\n * @param namespace\r\n * @param optional\r\n */\r\nfunction validateNamespace(fnName, namespace, optional) {\r\n if (optional && !namespace) {\r\n return;\r\n }\r\n if (typeof namespace !== 'string') {\r\n //TODO: I should do more validation here. We only allow certain chars in namespaces.\r\n throw new Error(errorPrefix(fnName, 'namespace') + 'must be a valid firebase namespace.');\r\n }\r\n}\r\nfunction validateCallback(fnName, argumentName, \r\n// eslint-disable-next-line @typescript-eslint/ban-types\r\ncallback, optional) {\r\n if (optional && !callback) {\r\n return;\r\n }\r\n if (typeof callback !== 'function') {\r\n throw new Error(errorPrefix(fnName, argumentName) + 'must be a valid function.');\r\n }\r\n}\r\nfunction validateContextObject(fnName, argumentName, context, optional) {\r\n if (optional && !context) {\r\n return;\r\n }\r\n if (typeof context !== 'object' || context === null) {\r\n throw new Error(errorPrefix(fnName, argumentName) + 'must be a valid context object.');\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// Code originally came from goog.crypt.stringToUtf8ByteArray, but for some reason they\r\n// automatically replaced '\\r\\n' with '\\n', and they didn't handle surrogate pairs,\r\n// so it's been modified.\r\n// Note that not all Unicode characters appear as single characters in JavaScript strings.\r\n// fromCharCode returns the UTF-16 encoding of a character - so some Unicode characters\r\n// use 2 characters in Javascript. All 4-byte UTF-8 characters begin with a first\r\n// character in the range 0xD800 - 0xDBFF (the first character of a so-called surrogate\r\n// pair).\r\n// See http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3\r\n/**\r\n * @param {string} str\r\n * @return {Array}\r\n */\r\nconst stringToByteArray = function (str) {\r\n const out = [];\r\n let p = 0;\r\n for (let i = 0; i < str.length; i++) {\r\n let c = str.charCodeAt(i);\r\n // Is this the lead surrogate in a surrogate pair?\r\n if (c >= 0xd800 && c <= 0xdbff) {\r\n const high = c - 0xd800; // the high 10 bits.\r\n i++;\r\n assert(i < str.length, 'Surrogate pair missing trail surrogate.');\r\n const low = str.charCodeAt(i) - 0xdc00; // the low 10 bits.\r\n c = 0x10000 + (high << 10) + low;\r\n }\r\n if (c < 128) {\r\n out[p++] = c;\r\n }\r\n else if (c < 2048) {\r\n out[p++] = (c >> 6) | 192;\r\n out[p++] = (c & 63) | 128;\r\n }\r\n else if (c < 65536) {\r\n out[p++] = (c >> 12) | 224;\r\n out[p++] = ((c >> 6) & 63) | 128;\r\n out[p++] = (c & 63) | 128;\r\n }\r\n else {\r\n out[p++] = (c >> 18) | 240;\r\n out[p++] = ((c >> 12) & 63) | 128;\r\n out[p++] = ((c >> 6) & 63) | 128;\r\n out[p++] = (c & 63) | 128;\r\n }\r\n }\r\n return out;\r\n};\r\n/**\r\n * Calculate length without actually converting; useful for doing cheaper validation.\r\n * @param {string} str\r\n * @return {number}\r\n */\r\nconst stringLength = function (str) {\r\n let p = 0;\r\n for (let i = 0; i < str.length; i++) {\r\n const c = str.charCodeAt(i);\r\n if (c < 128) {\r\n p++;\r\n }\r\n else if (c < 2048) {\r\n p += 2;\r\n }\r\n else if (c >= 0xd800 && c <= 0xdbff) {\r\n // Lead surrogate of a surrogate pair. The pair together will take 4 bytes to represent.\r\n p += 4;\r\n i++; // skip trail surrogate.\r\n }\r\n else {\r\n p += 3;\r\n }\r\n }\r\n return p;\r\n};\n\n/**\r\n * @license\r\n * Copyright 2022 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Copied from https://stackoverflow.com/a/2117523\r\n * Generates a new uuid.\r\n * @public\r\n */\r\nconst uuidv4 = function () {\r\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {\r\n const r = (Math.random() * 16) | 0, v = c === 'x' ? r : (r & 0x3) | 0x8;\r\n return v.toString(16);\r\n });\r\n};\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * The amount of milliseconds to exponentially increase.\r\n */\r\nconst DEFAULT_INTERVAL_MILLIS = 1000;\r\n/**\r\n * The factor to backoff by.\r\n * Should be a number greater than 1.\r\n */\r\nconst DEFAULT_BACKOFF_FACTOR = 2;\r\n/**\r\n * The maximum milliseconds to increase to.\r\n *\r\n *

Visible for testing\r\n */\r\nconst MAX_VALUE_MILLIS = 4 * 60 * 60 * 1000; // Four hours, like iOS and Android.\r\n/**\r\n * The percentage of backoff time to randomize by.\r\n * See\r\n * http://go/safe-client-behavior#step-1-determine-the-appropriate-retry-interval-to-handle-spike-traffic\r\n * for context.\r\n *\r\n *

Visible for testing\r\n */\r\nconst RANDOM_FACTOR = 0.5;\r\n/**\r\n * Based on the backoff method from\r\n * https://github.com/google/closure-library/blob/master/closure/goog/math/exponentialbackoff.js.\r\n * Extracted here so we don't need to pass metadata and a stateful ExponentialBackoff object around.\r\n */\r\nfunction calculateBackoffMillis(backoffCount, intervalMillis = DEFAULT_INTERVAL_MILLIS, backoffFactor = DEFAULT_BACKOFF_FACTOR) {\r\n // Calculates an exponentially increasing value.\r\n // Deviation: calculates value from count and a constant interval, so we only need to save value\r\n // and count to restore state.\r\n const currBaseValue = intervalMillis * Math.pow(backoffFactor, backoffCount);\r\n // A random \"fuzz\" to avoid waves of retries.\r\n // Deviation: randomFactor is required.\r\n const randomWait = Math.round(\r\n // A fraction of the backoff value to add/subtract.\r\n // Deviation: changes multiplication order to improve readability.\r\n RANDOM_FACTOR *\r\n currBaseValue *\r\n // A random float (rounded to int by Math.round above) in the range [-1, 1]. Determines\r\n // if we add or subtract.\r\n (Math.random() - 0.5) *\r\n 2);\r\n // Limits backoff to max to avoid effectively permanent backoff.\r\n return Math.min(MAX_VALUE_MILLIS, currBaseValue + randomWait);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Provide English ordinal letters after a number\r\n */\r\nfunction ordinal(i) {\r\n if (!Number.isFinite(i)) {\r\n return `${i}`;\r\n }\r\n return i + indicator(i);\r\n}\r\nfunction indicator(i) {\r\n i = Math.abs(i);\r\n const cent = i % 100;\r\n if (cent >= 10 && cent <= 20) {\r\n return 'th';\r\n }\r\n const dec = i % 10;\r\n if (dec === 1) {\r\n return 'st';\r\n }\r\n if (dec === 2) {\r\n return 'nd';\r\n }\r\n if (dec === 3) {\r\n return 'rd';\r\n }\r\n return 'th';\r\n}\n\n/**\r\n * @license\r\n * Copyright 2021 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction getModularInstance(service) {\r\n if (service && service._delegate) {\r\n return service._delegate;\r\n }\r\n else {\r\n return service;\r\n }\r\n}\n\nexport { CONSTANTS, DecodeBase64StringError, Deferred, ErrorFactory, FirebaseError, MAX_VALUE_MILLIS, RANDOM_FACTOR, Sha1, areCookiesEnabled, assert, assertionError, async, base64, base64Decode, base64Encode, base64urlEncodeWithoutPadding, calculateBackoffMillis, contains, createMockUserToken, createSubscribe, decode, deepCopy, deepEqual, deepExtend, errorPrefix, extractQuerystring, getDefaultAppConfig, getDefaultEmulatorHost, getDefaultEmulatorHostnameAndPort, getDefaults, getExperimentalSetting, getGlobal, getModularInstance, getUA, isAdmin, isBrowser, isBrowserExtension, isElectron, isEmpty, isIE, isIndexedDBAvailable, isMobileCordova, isNode, isNodeSdk, isReactNative, isSafari, isUWP, isValidFormat, isValidTimestamp, issuedAtTime, jsonEval, map, ordinal, promiseWithTimeout, querystring, querystringDecode, safeGet, stringLength, stringToByteArray, stringify, uuidv4, validateArgCount, validateCallback, validateContextObject, validateIndexedDBOpenable, validateNamespace };\n//# sourceMappingURL=index.esm2017.js.map\n","\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M4 10h3v7H4zm6.5 0h3v7h-3zM2 19h20v3H2zm15-9h3v7h-3zm-5-9L2 6v2h20V6z\"\n}), 'AccountBalance');","\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z\"\n}), 'ArrowBack');","\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"m20 12-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8z\"\n}), 'ArrowDownward');","\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"m12 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z\"\n}), 'ArrowForward');","\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z\"\n}), 'ArrowUpward');","\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2M9 17H7v-7h2zm4 0h-2V7h2zm4 0h-2v-4h2z\"\n}), 'Assessment');","\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1m-2 14-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9z\"\n}), 'AssignmentTurnedIn');","\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M11.8 10.9c-2.27-.59-3-1.2-3-2.15 0-1.09 1.01-1.85 2.7-1.85 1.78 0 2.44.85 2.5 2.1h2.21c-.07-1.72-1.12-3.3-3.21-3.81V3h-3v2.16c-1.94.42-3.5 1.68-3.5 3.61 0 2.31 1.91 3.46 4.7 4.13 2.5.6 3 1.48 3 2.41 0 .69-.49 1.79-2.7 1.79-2.06 0-2.87-.92-2.98-2.1h-2.2c.12 2.19 1.76 3.42 3.68 3.83V21h3v-2.15c1.95-.37 3.5-1.5 3.5-3.55 0-2.84-2.43-3.81-4.7-4.4\"\n}), 'AttachMoney');","\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2m0 14H4v-6h16zm0-10H4V6h16z\"\n}), 'CreditCard');","\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z\"\n}), 'ExpandLess');","\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z\"\n}), 'ExpandMore');","\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"m5.2494 8.0688 2.83-2.8269 14.1343 14.15-2.83 2.8269zm4.2363-4.2415 2.828-2.8289 5.6577 5.656-2.828 2.8289zM.9989 12.3147l2.8284-2.8285 5.6569 5.6569-2.8285 2.8284zM1 21h12v2H1z\"\n}), 'Gavel');","\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M16.48 10.41c-.39.39-1.04.39-1.43 0l-4.47-4.46-7.05 7.04-.66-.63c-1.17-1.17-1.17-3.07 0-4.24l4.24-4.24c1.17-1.17 3.07-1.17 4.24 0L16.48 9c.39.39.39 1.02 0 1.41m.7-2.12c.78.78.78 2.05 0 2.83-1.27 1.27-2.61.22-2.83 0l-3.76-3.76-5.57 5.57c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.42 0l4.62-4.62.71.71-4.62 4.62c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.42 0l4.62-4.62.71.71-4.62 4.62c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0l4.62-4.62.71.71-4.62 4.62c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0l8.32-8.34c1.17-1.17 1.17-3.07 0-4.24l-4.24-4.24c-1.15-1.15-3.01-1.17-4.18-.06z\"\n}), 'Handshake');","\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z\"\n}), 'Home');","\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M18 13v7H4V6h5.02c.05-.71.22-1.38.48-2H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-5zm-1.5 5h-11l2.75-3.53 1.96 2.36 2.75-3.54zm2.8-9.11c.44-.7.7-1.51.7-2.39C20 4.01 17.99 2 15.5 2S11 4.01 11 6.5s2.01 4.5 4.49 4.5c.88 0 1.7-.26 2.39-.7L21 13.42 22.42 12zM15.5 9C14.12 9 13 7.88 13 6.5S14.12 4 15.5 4 18 5.12 18 6.5 16.88 9 15.5 9\"\n}), 'ImageSearch');","\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm7 7V3.5L18.5 9z\"\n}), 'InsertDriveFile');","\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5\"\n}), 'Link');","\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M19 1H9c-1.1 0-2 .9-2 2v3h2V4h10v16H9v-2H7v3c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2M7.01 13.47l-2.55-2.55-1.27 1.27L7 16l7.19-7.19-1.27-1.27z\"\n}), 'MobileFriendly');","\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3m-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3m0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5m8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5\"\n}), 'People');","\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4\"\n}), 'Person');","\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2m-11-4 2.03 2.71L16 11l4 5H8zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6z\"\n}), 'PhotoLibrary');","\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5m0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8\"\n}), 'RadioButtonChecked');","\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8\"\n}), 'RadioButtonUnchecked');","\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M16.49 15.5v-1.75L14 16.25l2.49 2.5V17H22v-1.5zm3.02 4.25H14v1.5h5.51V23L22 20.5 19.51 18zM9.5 5.5c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2M5.75 8.9 3 23h2.1l1.75-8L9 17v6h2v-7.55L8.95 13.4l.6-3C10.85 12 12.8 13 15 13v-2c-1.85 0-3.45-1-4.35-2.45l-.95-1.6C9.35 6.35 8.7 6 8 6c-.25 0-.5.05-.75.15L2 8.3V13h2V9.65z\"\n}), 'TransferWithinAStation');","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nvar V3_URL = 'https://js.stripe.com/v3';\nvar V3_URL_REGEX = /^https:\\/\\/js\\.stripe\\.com\\/v3\\/?(\\?.*)?$/;\nvar EXISTING_SCRIPT_MESSAGE = 'loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used';\nvar findScript = function findScript() {\n var scripts = document.querySelectorAll(\"script[src^=\\\"\".concat(V3_URL, \"\\\"]\"));\n\n for (var i = 0; i < scripts.length; i++) {\n var script = scripts[i];\n\n if (!V3_URL_REGEX.test(script.src)) {\n continue;\n }\n\n return script;\n }\n\n return null;\n};\n\nvar injectScript = function injectScript(params) {\n var queryString = params && !params.advancedFraudSignals ? '?advancedFraudSignals=false' : '';\n var script = document.createElement('script');\n script.src = \"\".concat(V3_URL).concat(queryString);\n var headOrBody = document.head || document.body;\n\n if (!headOrBody) {\n throw new Error('Expected document.body not to be null. Stripe.js requires a element.');\n }\n\n headOrBody.appendChild(script);\n return script;\n};\n\nvar registerWrapper = function registerWrapper(stripe, startTime) {\n if (!stripe || !stripe._registerWrapper) {\n return;\n }\n\n stripe._registerWrapper({\n name: 'stripe-js',\n version: \"4.4.0\",\n startTime: startTime\n });\n};\n\nvar stripePromise = null;\nvar onErrorListener = null;\nvar onLoadListener = null;\n\nvar onError = function onError(reject) {\n return function () {\n reject(new Error('Failed to load Stripe.js'));\n };\n};\n\nvar onLoad = function onLoad(resolve, reject) {\n return function () {\n if (window.Stripe) {\n resolve(window.Stripe);\n } else {\n reject(new Error('Stripe.js not available'));\n }\n };\n};\n\nvar loadScript = function loadScript(params) {\n // Ensure that we only attempt to load Stripe.js at most once\n if (stripePromise !== null) {\n return stripePromise;\n }\n\n stripePromise = new Promise(function (resolve, reject) {\n if (typeof window === 'undefined' || typeof document === 'undefined') {\n // Resolve to null when imported server side. This makes the module\n // safe to import in an isomorphic code base.\n resolve(null);\n return;\n }\n\n if (window.Stripe && params) {\n console.warn(EXISTING_SCRIPT_MESSAGE);\n }\n\n if (window.Stripe) {\n resolve(window.Stripe);\n return;\n }\n\n try {\n var script = findScript();\n\n if (script && params) {\n console.warn(EXISTING_SCRIPT_MESSAGE);\n } else if (!script) {\n script = injectScript(params);\n } else if (script && onLoadListener !== null && onErrorListener !== null) {\n var _script$parentNode;\n\n // remove event listeners\n script.removeEventListener('load', onLoadListener);\n script.removeEventListener('error', onErrorListener); // if script exists, but we are reloading due to an error,\n // reload script to trigger 'load' event\n\n (_script$parentNode = script.parentNode) === null || _script$parentNode === void 0 ? void 0 : _script$parentNode.removeChild(script);\n script = injectScript(params);\n }\n\n onLoadListener = onLoad(resolve, reject);\n onErrorListener = onError(reject);\n script.addEventListener('load', onLoadListener);\n script.addEventListener('error', onErrorListener);\n } catch (error) {\n reject(error);\n return;\n }\n }); // Resets stripePromise on error\n\n return stripePromise[\"catch\"](function (error) {\n stripePromise = null;\n return Promise.reject(error);\n });\n};\nvar initStripe = function initStripe(maybeStripe, args, startTime) {\n if (maybeStripe === null) {\n return null;\n }\n\n var stripe = maybeStripe.apply(undefined, args);\n registerWrapper(stripe, startTime);\n return stripe;\n}; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\nvar validateLoadParams = function validateLoadParams(params) {\n var errorMessage = \"invalid load parameters; expected object of shape\\n\\n {advancedFraudSignals: boolean}\\n\\nbut received\\n\\n \".concat(JSON.stringify(params), \"\\n\");\n\n if (params === null || _typeof(params) !== 'object') {\n throw new Error(errorMessage);\n }\n\n if (Object.keys(params).length === 1 && typeof params.advancedFraudSignals === 'boolean') {\n return params;\n }\n\n throw new Error(errorMessage);\n};\n\nvar loadParams;\nvar loadStripeCalled = false;\nvar loadStripe = function loadStripe() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n loadStripeCalled = true;\n var startTime = Date.now();\n return loadScript(loadParams).then(function (maybeStripe) {\n return initStripe(maybeStripe, args, startTime);\n });\n};\n\nloadStripe.setLoadParameters = function (params) {\n // we won't throw an error if setLoadParameters is called with the same values as before\n if (loadStripeCalled && loadParams) {\n var validatedParams = validateLoadParams(params);\n var parameterKeys = Object.keys(validatedParams);\n var sameParameters = parameterKeys.reduce(function (previousValue, currentValue) {\n var _loadParams;\n\n return previousValue && params[currentValue] === ((_loadParams = loadParams) === null || _loadParams === void 0 ? void 0 : _loadParams[currentValue]);\n }, true);\n\n if (sameParameters) {\n return;\n }\n }\n\n if (loadStripeCalled) {\n throw new Error('You cannot change load parameters after calling loadStripe');\n }\n\n loadParams = validateLoadParams(params);\n};\n\nexports.loadStripe = loadStripe;\n","module.exports = require('../dist/pure');\n","\"use strict\";\n\nvar deselectCurrent = require(\"toggle-selection\");\n\nvar clipboardToIE11Formatting = {\n \"text/plain\": \"Text\",\n \"text/html\": \"Url\",\n \"default\": \"Text\"\n}\n\nvar defaultMessage = \"Copy to clipboard: #{key}, Enter\";\n\nfunction format(message) {\n var copyKey = (/mac os x/i.test(navigator.userAgent) ? \"⌘\" : \"Ctrl\") + \"+C\";\n return message.replace(/#{\\s*key\\s*}/g, copyKey);\n}\n\nfunction copy(text, options) {\n var debug,\n message,\n reselectPrevious,\n range,\n selection,\n mark,\n success = false;\n if (!options) {\n options = {};\n }\n debug = options.debug || false;\n try {\n reselectPrevious = deselectCurrent();\n\n range = document.createRange();\n selection = document.getSelection();\n\n mark = document.createElement(\"span\");\n mark.textContent = text;\n // reset user styles for span element\n mark.style.all = \"unset\";\n // prevents scrolling to the end of the page\n mark.style.position = \"fixed\";\n mark.style.top = 0;\n mark.style.clip = \"rect(0, 0, 0, 0)\";\n // used to preserve spaces and line breaks\n mark.style.whiteSpace = \"pre\";\n // do not inherit user-select (it may be `none`)\n mark.style.webkitUserSelect = \"text\";\n mark.style.MozUserSelect = \"text\";\n mark.style.msUserSelect = \"text\";\n mark.style.userSelect = \"text\";\n mark.addEventListener(\"copy\", function(e) {\n e.stopPropagation();\n if (options.format) {\n e.preventDefault();\n if (typeof e.clipboardData === \"undefined\") { // IE 11\n debug && console.warn(\"unable to use e.clipboardData\");\n debug && console.warn(\"trying IE specific stuff\");\n window.clipboardData.clearData();\n var format = clipboardToIE11Formatting[options.format] || clipboardToIE11Formatting[\"default\"]\n window.clipboardData.setData(format, text);\n } else { // all other browsers\n e.clipboardData.clearData();\n e.clipboardData.setData(options.format, text);\n }\n }\n if (options.onCopy) {\n e.preventDefault();\n options.onCopy(e.clipboardData);\n }\n });\n\n document.body.appendChild(mark);\n\n range.selectNodeContents(mark);\n selection.addRange(range);\n\n var successful = document.execCommand(\"copy\");\n if (!successful) {\n throw new Error(\"copy command was unsuccessful\");\n }\n success = true;\n } catch (err) {\n debug && console.error(\"unable to copy using execCommand: \", err);\n debug && console.warn(\"trying IE specific stuff\");\n try {\n window.clipboardData.setData(options.format || \"text\", text);\n options.onCopy && options.onCopy(window.clipboardData);\n success = true;\n } catch (err) {\n debug && console.error(\"unable to copy using clipboardData: \", err);\n debug && console.error(\"falling back to prompt\");\n message = format(\"message\" in options ? options.message : defaultMessage);\n window.prompt(message, text);\n }\n } finally {\n if (selection) {\n if (typeof selection.removeRange == \"function\") {\n selection.removeRange(range);\n } else {\n selection.removeAllRanges();\n }\n }\n\n if (mark) {\n document.body.removeChild(mark);\n }\n reselectPrevious();\n }\n\n return success;\n}\n\nmodule.exports = copy;\n","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };","import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };","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 };","import defineProperty from \"./defineProperty.js\";\nfunction ownKeys(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function (r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nfunction _objectSpread2(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {\n defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}\nexport { _objectSpread2 as default };","import objectWithoutPropertiesLoose from \"./objectWithoutPropertiesLoose.js\";\nfunction _objectWithoutProperties(e, t) {\n if (null == e) return {};\n var o,\n r,\n i = objectWithoutPropertiesLoose(e, t);\n if (Object.getOwnPropertySymbols) {\n var n = Object.getOwnPropertySymbols(e);\n for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);\n }\n return i;\n}\nexport { _objectWithoutProperties as default };","function _classCallCheck(a, n) {\n if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\");\n}\nexport { _classCallCheck as default };","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperties(e, r) {\n for (var t = 0; t < r.length; t++) {\n var o = r[t];\n o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o);\n }\n}\nfunction _createClass(e, r, t) {\n return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", {\n writable: !1\n }), e;\n}\nexport { _createClass as default };","import setPrototypeOf from \"./setPrototypeOf.js\";\nfunction _inherits(t, e) {\n if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\");\n t.prototype = Object.create(e && e.prototype, {\n constructor: {\n value: t,\n writable: !0,\n configurable: !0\n }\n }), Object.defineProperty(t, \"prototype\", {\n writable: !1\n }), e && setPrototypeOf(t, e);\n}\nexport { _inherits as default };","function _getPrototypeOf(t) {\n return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {\n return t.__proto__ || Object.getPrototypeOf(t);\n }, _getPrototypeOf(t);\n}\nexport { _getPrototypeOf as default };","function _isNativeReflectConstruct() {\n try {\n var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n } catch (t) {}\n return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {\n return !!t;\n })();\n}\nexport { _isNativeReflectConstruct as default };","import getPrototypeOf from \"./getPrototypeOf.js\";\nimport isNativeReflectConstruct from \"./isNativeReflectConstruct.js\";\nimport possibleConstructorReturn from \"./possibleConstructorReturn.js\";\nfunction _createSuper(t) {\n var r = isNativeReflectConstruct();\n return function () {\n var e,\n o = getPrototypeOf(t);\n if (r) {\n var s = getPrototypeOf(this).constructor;\n e = Reflect.construct(o, arguments, s);\n } else e = o.apply(this, arguments);\n return possibleConstructorReturn(this, e);\n };\n}\nexport { _createSuper as default };","import _typeof from \"./typeof.js\";\nimport assertThisInitialized from \"./assertThisInitialized.js\";\nfunction _possibleConstructorReturn(t, e) {\n if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e;\n if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\");\n return assertThisInitialized(t);\n}\nexport { _possibleConstructorReturn as default };","var raf = function raf(callback) {\n return +setTimeout(callback, 16);\n};\n\nvar caf = function caf(num) {\n return clearTimeout(num);\n};\n\nif (typeof window !== 'undefined' && 'requestAnimationFrame' in window) {\n raf = function raf(callback) {\n return window.requestAnimationFrame(callback);\n };\n\n caf = function caf(handle) {\n return window.cancelAnimationFrame(handle);\n };\n}\n\nexport default function wrapperRaf(callback) {\n return raf(callback);\n}\nwrapperRaf.cancel = caf;","export default function contains(root, n) {\n if (!root) {\n return false;\n }\n\n return root.contains(n);\n}","import ReactDOM from 'react-dom';\n/**\n * Return if a node is a DOM node. Else will return by `findDOMNode`\n */\n\nexport default function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return ReactDOM.findDOMNode(node);\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport { isMemo } from 'react-is';\nexport function fillRef(ref, node) {\n if (typeof ref === 'function') {\n ref(node);\n } else if (_typeof(ref) === 'object' && ref && 'current' in ref) {\n ref.current = node;\n }\n}\n/**\n * Merge refs into one ref function to support ref passing.\n */\n\nexport function composeRef() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n\n return function (node) {\n refs.forEach(function (ref) {\n fillRef(ref, node);\n });\n };\n}\nexport function supportRef(nodeOrComponent) {\n var _type$prototype, _nodeOrComponent$prot;\n\n var type = isMemo(nodeOrComponent) ? nodeOrComponent.type.type : nodeOrComponent.type; // Function component node\n\n if (typeof type === 'function' && !((_type$prototype = type.prototype) === null || _type$prototype === void 0 ? void 0 : _type$prototype.render)) {\n return false;\n } // Class component\n\n\n if (typeof nodeOrComponent === 'function' && !((_nodeOrComponent$prot = nodeOrComponent.prototype) === null || _nodeOrComponent$prot === void 0 ? void 0 : _nodeOrComponent$prot.render)) {\n return false;\n }\n\n return true;\n}\n/* eslint-enable */","import ReactDOM from 'react-dom';\nexport default function addEventListenerWrap(target, eventType, cb, option) {\n /* eslint camelcase: 2 */\n var callback = ReactDOM.unstable_batchedUpdates ? function run(e) {\n ReactDOM.unstable_batchedUpdates(cb, e);\n } : cb;\n\n if (target.addEventListener) {\n target.addEventListener(eventType, callback, option);\n }\n\n return {\n remove: function remove() {\n if (target.removeEventListener) {\n target.removeEventListener(eventType, callback);\n }\n }\n };\n}","export default function canUseDom() {\n return !!(typeof window !== 'undefined' && window.document && window.document.createElement);\n}","import { useRef, useEffect, forwardRef, useImperativeHandle } from 'react';\nimport ReactDOM from 'react-dom';\nimport canUseDom from './Dom/canUseDom';\nvar Portal = forwardRef(function (props, ref) {\n var didUpdate = props.didUpdate,\n getContainer = props.getContainer,\n children = props.children;\n var containerRef = useRef(); // Ref return nothing, only for wrapper check exist\n\n useImperativeHandle(ref, function () {\n return {};\n }); // Create container in client side with sync to avoid useEffect not get ref\n\n var initRef = useRef(false);\n\n if (!initRef.current && canUseDom()) {\n containerRef.current = getContainer();\n initRef.current = true;\n } // [Legacy] Used by `rc-trigger`\n\n\n useEffect(function () {\n didUpdate === null || didUpdate === void 0 ? void 0 : didUpdate(props);\n });\n useEffect(function () {\n return function () {\n var _containerRef$current, _containerRef$current2;\n\n // [Legacy] This should not be handle by Portal but parent PortalWrapper instead.\n // Since some component use `Portal` directly, we have to keep the logic here.\n (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : (_containerRef$current2 = _containerRef$current.parentNode) === null || _containerRef$current2 === void 0 ? void 0 : _containerRef$current2.removeChild(containerRef.current);\n };\n }, []);\n return containerRef.current ? ReactDOM.createPortal(children, containerRef.current) : null;\n});\nexport default Portal;","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n\nfunction isPointsEq(a1, a2, isAlignPoint) {\n if (isAlignPoint) {\n return a1[0] === a2[0];\n }\n\n return a1[0] === a2[0] && a1[1] === a2[1];\n}\n\nexport function getAlignFromPlacement(builtinPlacements, placementStr, align) {\n var baseAlign = builtinPlacements[placementStr] || {};\n return _objectSpread(_objectSpread({}, baseAlign), align);\n}\nexport function getAlignPopupClassName(builtinPlacements, prefixCls, align, isAlignPoint) {\n var points = align.points;\n var placements = Object.keys(builtinPlacements);\n\n for (var i = 0; i < placements.length; i += 1) {\n var placement = placements[i];\n\n if (isPointsEq(builtinPlacements[placement].points, points, isAlignPoint)) {\n return \"\".concat(prefixCls, \"-placement-\").concat(placement);\n }\n }\n\n return '';\n}","function _arrayLikeToArray(r, a) {\n (null == a || a > r.length) && (a = r.length);\n for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];\n return n;\n}\nexport { _arrayLikeToArray as default };","import arrayWithHoles from \"./arrayWithHoles.js\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableRest from \"./nonIterableRest.js\";\nfunction _slicedToArray(r, e) {\n return arrayWithHoles(r) || iterableToArrayLimit(r, e) || unsupportedIterableToArray(r, e) || nonIterableRest();\n}\nexport { _slicedToArray as default };","function _arrayWithHoles(r) {\n if (Array.isArray(r)) return r;\n}\nexport { _arrayWithHoles as default };","function _iterableToArrayLimit(r, l) {\n var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n if (null != t) {\n var e,\n n,\n i,\n u,\n a = [],\n f = !0,\n o = !1;\n try {\n if (i = (t = t.call(r)).next, 0 === l) {\n if (Object(t) !== t) return;\n f = !1;\n } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n } catch (r) {\n o = !0, n = r;\n } finally {\n try {\n if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return;\n } finally {\n if (o) throw n;\n }\n }\n return a;\n }\n}\nexport { _iterableToArrayLimit as default };","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nfunction _unsupportedIterableToArray(r, a) {\n if (r) {\n if (\"string\" == typeof r) return arrayLikeToArray(r, a);\n var t = {}.toString.call(r).slice(8, -1);\n return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? arrayLikeToArray(r, a) : void 0;\n }\n}\nexport { _unsupportedIterableToArray as default };","function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nexport { _nonIterableRest as default };","import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport canUseDOM from \"rc-util/es/Dom/canUseDom\"; // ================= Transition =================\n// Event wrapper. Copy from react source code\n\nfunction makePrefixMap(styleProp, eventName) {\n var prefixes = {};\n prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();\n prefixes[\"Webkit\".concat(styleProp)] = \"webkit\".concat(eventName);\n prefixes[\"Moz\".concat(styleProp)] = \"moz\".concat(eventName);\n prefixes[\"ms\".concat(styleProp)] = \"MS\".concat(eventName);\n prefixes[\"O\".concat(styleProp)] = \"o\".concat(eventName.toLowerCase());\n return prefixes;\n}\n\nexport function getVendorPrefixes(domSupport, win) {\n var prefixes = {\n animationend: makePrefixMap('Animation', 'AnimationEnd'),\n transitionend: makePrefixMap('Transition', 'TransitionEnd')\n };\n\n if (domSupport) {\n if (!('AnimationEvent' in win)) {\n delete prefixes.animationend.animation;\n }\n\n if (!('TransitionEvent' in win)) {\n delete prefixes.transitionend.transition;\n }\n }\n\n return prefixes;\n}\nvar vendorPrefixes = getVendorPrefixes(canUseDOM(), typeof window !== 'undefined' ? window : {});\nvar style = {};\n\nif (canUseDOM()) {\n var _document$createEleme = document.createElement('div');\n\n style = _document$createEleme.style;\n}\n\nvar prefixedEventNames = {};\nexport function getVendorPrefixedEventName(eventName) {\n if (prefixedEventNames[eventName]) {\n return prefixedEventNames[eventName];\n }\n\n var prefixMap = vendorPrefixes[eventName];\n\n if (prefixMap) {\n var stylePropList = Object.keys(prefixMap);\n var len = stylePropList.length;\n\n for (var i = 0; i < len; i += 1) {\n var styleProp = stylePropList[i];\n\n if (Object.prototype.hasOwnProperty.call(prefixMap, styleProp) && styleProp in style) {\n prefixedEventNames[eventName] = prefixMap[styleProp];\n return prefixedEventNames[eventName];\n }\n }\n }\n\n return '';\n}\nvar internalAnimationEndName = getVendorPrefixedEventName('animationend');\nvar internalTransitionEndName = getVendorPrefixedEventName('transitionend');\nexport var supportTransition = !!(internalAnimationEndName && internalTransitionEndName);\nexport var animationEndName = internalAnimationEndName || 'animationend';\nexport var transitionEndName = internalTransitionEndName || 'transitionend';\nexport function getTransitionName(transitionName, transitionType) {\n if (!transitionName) return null;\n\n if (_typeof(transitionName) === 'object') {\n var type = transitionType.replace(/-\\w/g, function (match) {\n return match[1].toUpperCase();\n });\n return transitionName[type];\n }\n\n return \"\".concat(transitionName, \"-\").concat(transitionType);\n}","export var STATUS_NONE = 'none';\nexport var STATUS_APPEAR = 'appear';\nexport var STATUS_ENTER = 'enter';\nexport var STATUS_LEAVE = 'leave';\nexport var STEP_NONE = 'none';\nexport var STEP_PREPARE = 'prepare';\nexport var STEP_START = 'start';\nexport var STEP_ACTIVE = 'active';\nexport var STEP_ACTIVATED = 'end';","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport { useEffect, useState, useRef } from 'react';\nexport default function useMountStatus(defaultValue) {\n var destroyRef = useRef(false);\n\n var _useState = useState(defaultValue),\n _useState2 = _slicedToArray(_useState, 2),\n val = _useState2[0],\n setVal = _useState2[1];\n\n function setValue(next) {\n if (!destroyRef.current) {\n setVal(next);\n }\n }\n\n useEffect(function () {\n return function () {\n destroyRef.current = true;\n };\n }, []);\n return [val, setValue];\n}","import { useEffect, useLayoutEffect } from 'react';\nimport canUseDom from \"rc-util/es/Dom/canUseDom\"; // It's safe to use `useLayoutEffect` but the warning is annoying\n\nvar useIsomorphicLayoutEffect = canUseDom() ? useLayoutEffect : useEffect;\nexport default useIsomorphicLayoutEffect;","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport { STEP_PREPARE, STEP_ACTIVE, STEP_START, STEP_ACTIVATED, STEP_NONE } from '../interface';\nimport useIsomorphicLayoutEffect from './useIsomorphicLayoutEffect';\nimport useNextFrame from './useNextFrame';\nvar STEP_QUEUE = [STEP_PREPARE, STEP_START, STEP_ACTIVE, STEP_ACTIVATED];\n/** Skip current step */\n\nexport var SkipStep = false;\n/** Current step should be update in */\n\nexport var DoStep = true;\nexport function isActive(step) {\n return step === STEP_ACTIVE || step === STEP_ACTIVATED;\n}\nexport default (function (callback) {\n var _React$useState = React.useState(STEP_NONE),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n step = _React$useState2[0],\n setStep = _React$useState2[1];\n\n var _useNextFrame = useNextFrame(),\n _useNextFrame2 = _slicedToArray(_useNextFrame, 2),\n nextFrame = _useNextFrame2[0],\n cancelNextFrame = _useNextFrame2[1];\n\n function startQueue() {\n setStep(STEP_PREPARE);\n }\n\n useIsomorphicLayoutEffect(function () {\n if (step !== STEP_NONE && step !== STEP_ACTIVATED) {\n var index = STEP_QUEUE.indexOf(step);\n var nextStep = STEP_QUEUE[index + 1];\n var result = callback(step);\n\n if (result === SkipStep) {\n // Skip when no needed\n setStep(nextStep);\n } else {\n // Do as frame for step update\n nextFrame(function (info) {\n function doNext() {\n // Skip since current queue is ood\n if (info.isCanceled()) return;\n setStep(nextStep);\n }\n\n if (result === true) {\n doNext();\n } else {\n // Only promise should be async\n Promise.resolve(result).then(doNext);\n }\n });\n }\n }\n }, [step]);\n React.useEffect(function () {\n return function () {\n cancelNextFrame();\n };\n }, []);\n return [startQueue, step];\n});","import * as React from 'react';\nimport raf from \"rc-util/es/raf\";\nexport default (function () {\n var nextFrameRef = React.useRef(null);\n\n function cancelNextFrame() {\n raf.cancel(nextFrameRef.current);\n }\n\n function nextFrame(callback) {\n var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;\n cancelNextFrame();\n var nextFrameId = raf(function () {\n if (delay <= 1) {\n callback({\n isCanceled: function isCanceled() {\n return nextFrameId !== nextFrameRef.current;\n }\n });\n } else {\n nextFrame(callback, delay - 1);\n }\n });\n nextFrameRef.current = nextFrameId;\n }\n\n React.useEffect(function () {\n return function () {\n cancelNextFrame();\n };\n }, []);\n return [nextFrame, cancelNextFrame];\n});","import * as React from 'react';\nimport { useRef } from 'react';\nimport { animationEndName, transitionEndName } from '../util/motion';\nexport default (function (callback) {\n var cacheElementRef = useRef(); // Cache callback\n\n var callbackRef = useRef(callback);\n callbackRef.current = callback; // Internal motion event handler\n\n var onInternalMotionEnd = React.useCallback(function (event) {\n callbackRef.current(event);\n }, []); // Remove events\n\n function removeMotionEvents(element) {\n if (element) {\n element.removeEventListener(transitionEndName, onInternalMotionEnd);\n element.removeEventListener(animationEndName, onInternalMotionEnd);\n }\n } // Patch events\n\n\n function patchMotionEvents(element) {\n if (cacheElementRef.current && cacheElementRef.current !== element) {\n removeMotionEvents(cacheElementRef.current);\n }\n\n if (element && element !== cacheElementRef.current) {\n element.addEventListener(transitionEndName, onInternalMotionEnd);\n element.addEventListener(animationEndName, onInternalMotionEnd); // Save as cache in case dom removed trigger by `motionDeadline`\n\n cacheElementRef.current = element;\n }\n } // Clean up when removed\n\n\n React.useEffect(function () {\n return function () {\n removeMotionEvents(cacheElementRef.current);\n };\n }, []);\n return [patchMotionEvents, removeMotionEvents];\n});","import _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _createSuper from \"@babel/runtime/helpers/esm/createSuper\";\nimport * as React from 'react';\n\nvar DomWrapper = /*#__PURE__*/function (_React$Component) {\n _inherits(DomWrapper, _React$Component);\n\n var _super = _createSuper(DomWrapper);\n\n function DomWrapper() {\n _classCallCheck(this, DomWrapper);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(DomWrapper, [{\n key: \"render\",\n value: function render() {\n return this.props.children;\n }\n }]);\n\n return DomWrapper;\n}(React.Component);\n\nexport default DomWrapper;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\n\n/* eslint-disable react/default-props-match-prop-types, react/no-multi-comp, react/prop-types */\nimport * as React from 'react';\nimport { useRef } from 'react';\nimport findDOMNode from \"rc-util/es/Dom/findDOMNode\";\nimport { fillRef } from \"rc-util/es/ref\";\nimport classNames from 'classnames';\nimport { getTransitionName, supportTransition } from './util/motion';\nimport { STATUS_NONE, STEP_PREPARE, STEP_START } from './interface';\nimport useStatus from './hooks/useStatus';\nimport DomWrapper from './DomWrapper';\nimport { isActive } from './hooks/useStepQueue';\n/**\n * `transitionSupport` is used for none transition test case.\n * Default we use browser transition event support check.\n */\n\nexport function genCSSMotion(config) {\n var transitionSupport = config;\n\n if (_typeof(config) === 'object') {\n transitionSupport = config.transitionSupport;\n }\n\n function isSupportTransition(props) {\n return !!(props.motionName && transitionSupport);\n }\n\n var CSSMotion = React.forwardRef(function (props, ref) {\n var _props$visible = props.visible,\n visible = _props$visible === void 0 ? true : _props$visible,\n _props$removeOnLeave = props.removeOnLeave,\n removeOnLeave = _props$removeOnLeave === void 0 ? true : _props$removeOnLeave,\n forceRender = props.forceRender,\n children = props.children,\n motionName = props.motionName,\n leavedClassName = props.leavedClassName,\n eventProps = props.eventProps;\n var supportMotion = isSupportTransition(props); // Ref to the react node, it may be a HTMLElement\n\n var nodeRef = useRef(); // Ref to the dom wrapper in case ref can not pass to HTMLElement\n\n var wrapperNodeRef = useRef();\n\n function getDomElement() {\n try {\n return findDOMNode(nodeRef.current || wrapperNodeRef.current);\n } catch (e) {\n // Only happen when `motionDeadline` trigger but element removed.\n return null;\n }\n }\n\n var _useStatus = useStatus(supportMotion, visible, getDomElement, props),\n _useStatus2 = _slicedToArray(_useStatus, 4),\n status = _useStatus2[0],\n statusStep = _useStatus2[1],\n statusStyle = _useStatus2[2],\n mergedVisible = _useStatus2[3]; // ====================== Refs ======================\n\n\n var originRef = useRef(ref);\n originRef.current = ref;\n var setNodeRef = React.useCallback(function (node) {\n nodeRef.current = node;\n fillRef(originRef.current, node);\n }, []); // ===================== Render =====================\n\n var motionChildren;\n\n if (!children) {\n // No children\n motionChildren = null;\n } else if (status === STATUS_NONE || !isSupportTransition(props)) {\n // Stable children\n if (mergedVisible) {\n motionChildren = children(_objectSpread({}, eventProps), setNodeRef);\n } else if (!removeOnLeave) {\n motionChildren = children(_objectSpread(_objectSpread({}, eventProps), {}, {\n className: leavedClassName\n }), setNodeRef);\n } else if (forceRender) {\n motionChildren = children(_objectSpread(_objectSpread({}, eventProps), {}, {\n style: {\n display: 'none'\n }\n }), setNodeRef);\n } else {\n motionChildren = null;\n }\n } else {\n var _classNames;\n\n // In motion\n var statusSuffix;\n\n if (statusStep === STEP_PREPARE) {\n statusSuffix = 'prepare';\n } else if (isActive(statusStep)) {\n statusSuffix = 'active';\n } else if (statusStep === STEP_START) {\n statusSuffix = 'start';\n }\n\n motionChildren = children(_objectSpread(_objectSpread({}, eventProps), {}, {\n className: classNames(getTransitionName(motionName, status), (_classNames = {}, _defineProperty(_classNames, getTransitionName(motionName, \"\".concat(status, \"-\").concat(statusSuffix)), statusSuffix), _defineProperty(_classNames, motionName, typeof motionName === 'string'), _classNames)),\n style: statusStyle\n }), setNodeRef);\n }\n\n return React.createElement(DomWrapper, {\n ref: wrapperNodeRef\n }, motionChildren);\n });\n CSSMotion.displayName = 'CSSMotion';\n return CSSMotion;\n}\nexport default genCSSMotion(supportTransition);","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport { useRef, useEffect } from 'react';\nimport { STATUS_APPEAR, STATUS_NONE, STATUS_LEAVE, STATUS_ENTER, STEP_PREPARE, STEP_START, STEP_ACTIVE } from '../interface';\nimport useState from './useState';\nimport useIsomorphicLayoutEffect from './useIsomorphicLayoutEffect';\nimport useStepQueue, { DoStep, SkipStep, isActive } from './useStepQueue';\nimport useDomMotionEvents from './useDomMotionEvents';\nexport default function useStatus(supportMotion, visible, getElement, _ref) {\n var _ref$motionEnter = _ref.motionEnter,\n motionEnter = _ref$motionEnter === void 0 ? true : _ref$motionEnter,\n _ref$motionAppear = _ref.motionAppear,\n motionAppear = _ref$motionAppear === void 0 ? true : _ref$motionAppear,\n _ref$motionLeave = _ref.motionLeave,\n motionLeave = _ref$motionLeave === void 0 ? true : _ref$motionLeave,\n motionDeadline = _ref.motionDeadline,\n motionLeaveImmediately = _ref.motionLeaveImmediately,\n onAppearPrepare = _ref.onAppearPrepare,\n onEnterPrepare = _ref.onEnterPrepare,\n onLeavePrepare = _ref.onLeavePrepare,\n onAppearStart = _ref.onAppearStart,\n onEnterStart = _ref.onEnterStart,\n onLeaveStart = _ref.onLeaveStart,\n onAppearActive = _ref.onAppearActive,\n onEnterActive = _ref.onEnterActive,\n onLeaveActive = _ref.onLeaveActive,\n onAppearEnd = _ref.onAppearEnd,\n onEnterEnd = _ref.onEnterEnd,\n onLeaveEnd = _ref.onLeaveEnd,\n onVisibleChanged = _ref.onVisibleChanged;\n\n // Used for outer render usage to avoid `visible: false & status: none` to render nothing\n var _useState = useState(),\n _useState2 = _slicedToArray(_useState, 2),\n asyncVisible = _useState2[0],\n setAsyncVisible = _useState2[1];\n\n var _useState3 = useState(STATUS_NONE),\n _useState4 = _slicedToArray(_useState3, 2),\n status = _useState4[0],\n setStatus = _useState4[1];\n\n var _useState5 = useState(null),\n _useState6 = _slicedToArray(_useState5, 2),\n style = _useState6[0],\n setStyle = _useState6[1];\n\n var mountedRef = useRef(false);\n var deadlineRef = useRef(null);\n var destroyedRef = useRef(false); // =========================== Dom Node ===========================\n\n var cacheElementRef = useRef(null);\n\n function getDomElement() {\n var element = getElement();\n return element || cacheElementRef.current;\n } // ========================== Motion End ==========================\n\n\n var activeRef = useRef(false);\n\n function onInternalMotionEnd(event) {\n var element = getDomElement();\n\n if (event && !event.deadline && event.target !== element) {\n // event exists\n // not initiated by deadline\n // transitionEnd not fired by inner elements\n return;\n }\n\n var canEnd;\n\n if (status === STATUS_APPEAR && activeRef.current) {\n canEnd = onAppearEnd === null || onAppearEnd === void 0 ? void 0 : onAppearEnd(element, event);\n } else if (status === STATUS_ENTER && activeRef.current) {\n canEnd = onEnterEnd === null || onEnterEnd === void 0 ? void 0 : onEnterEnd(element, event);\n } else if (status === STATUS_LEAVE && activeRef.current) {\n canEnd = onLeaveEnd === null || onLeaveEnd === void 0 ? void 0 : onLeaveEnd(element, event);\n } // Only update status when `canEnd` and not destroyed\n\n\n if (canEnd !== false && !destroyedRef.current) {\n setStatus(STATUS_NONE);\n setStyle(null);\n }\n }\n\n var _useDomMotionEvents = useDomMotionEvents(onInternalMotionEnd),\n _useDomMotionEvents2 = _slicedToArray(_useDomMotionEvents, 1),\n patchMotionEvents = _useDomMotionEvents2[0]; // ============================= Step =============================\n\n\n var eventHandlers = React.useMemo(function () {\n var _ref2, _ref3, _ref4;\n\n switch (status) {\n case 'appear':\n return _ref2 = {}, _defineProperty(_ref2, STEP_PREPARE, onAppearPrepare), _defineProperty(_ref2, STEP_START, onAppearStart), _defineProperty(_ref2, STEP_ACTIVE, onAppearActive), _ref2;\n\n case 'enter':\n return _ref3 = {}, _defineProperty(_ref3, STEP_PREPARE, onEnterPrepare), _defineProperty(_ref3, STEP_START, onEnterStart), _defineProperty(_ref3, STEP_ACTIVE, onEnterActive), _ref3;\n\n case 'leave':\n return _ref4 = {}, _defineProperty(_ref4, STEP_PREPARE, onLeavePrepare), _defineProperty(_ref4, STEP_START, onLeaveStart), _defineProperty(_ref4, STEP_ACTIVE, onLeaveActive), _ref4;\n\n default:\n return {};\n }\n }, [status]);\n\n var _useStepQueue = useStepQueue(function (newStep) {\n // Only prepare step can be skip\n if (newStep === STEP_PREPARE) {\n var onPrepare = eventHandlers[STEP_PREPARE];\n\n if (!onPrepare) {\n return SkipStep;\n }\n\n return onPrepare(getDomElement());\n } // Rest step is sync update\n\n\n if (step in eventHandlers) {\n var _eventHandlers$step;\n\n setStyle(((_eventHandlers$step = eventHandlers[step]) === null || _eventHandlers$step === void 0 ? void 0 : _eventHandlers$step.call(eventHandlers, getDomElement(), null)) || null);\n }\n\n if (step === STEP_ACTIVE) {\n // Patch events when motion needed\n patchMotionEvents(getDomElement());\n\n if (motionDeadline > 0) {\n clearTimeout(deadlineRef.current);\n deadlineRef.current = setTimeout(function () {\n onInternalMotionEnd({\n deadline: true\n });\n }, motionDeadline);\n }\n }\n\n return DoStep;\n }),\n _useStepQueue2 = _slicedToArray(_useStepQueue, 2),\n startStep = _useStepQueue2[0],\n step = _useStepQueue2[1];\n\n var active = isActive(step);\n activeRef.current = active; // ============================ Status ============================\n // Update with new status\n\n useIsomorphicLayoutEffect(function () {\n setAsyncVisible(visible);\n\n if (!supportMotion) {\n return;\n }\n\n var isMounted = mountedRef.current;\n mountedRef.current = true;\n var nextStatus; // Appear\n\n if (!isMounted && visible && motionAppear) {\n nextStatus = STATUS_APPEAR;\n } // Enter\n\n\n if (isMounted && visible && motionEnter) {\n nextStatus = STATUS_ENTER;\n } // Leave\n\n\n if (isMounted && !visible && motionLeave || !isMounted && motionLeaveImmediately && !visible && motionLeave) {\n nextStatus = STATUS_LEAVE;\n } // Update to next status\n\n\n if (nextStatus) {\n setStatus(nextStatus);\n startStep();\n }\n }, [visible]); // ============================ Effect ============================\n // Reset when motion changed\n\n useEffect(function () {\n if ( // Cancel appear\n status === STATUS_APPEAR && !motionAppear || // Cancel enter\n status === STATUS_ENTER && !motionEnter || // Cancel leave\n status === STATUS_LEAVE && !motionLeave) {\n setStatus(STATUS_NONE);\n }\n }, [motionAppear, motionEnter, motionLeave]);\n useEffect(function () {\n return function () {\n clearTimeout(deadlineRef.current);\n destroyedRef.current = true;\n };\n }, []); // Trigger `onVisibleChanged`\n\n useEffect(function () {\n if (asyncVisible !== undefined && status === STATUS_NONE) {\n onVisibleChanged === null || onVisibleChanged === void 0 ? void 0 : onVisibleChanged(asyncVisible);\n }\n }, [asyncVisible, status]); // ============================ Styles ============================\n\n var mergedStyle = style;\n\n if (eventHandlers[STEP_PREPARE] && step === STEP_START) {\n mergedStyle = _objectSpread({\n transition: 'none'\n }, mergedStyle);\n }\n\n return [status, step, mergedStyle, asyncVisible !== null && asyncVisible !== void 0 ? asyncVisible : visible];\n}","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nexport var STATUS_ADD = 'add';\nexport var STATUS_KEEP = 'keep';\nexport var STATUS_REMOVE = 'remove';\nexport var STATUS_REMOVED = 'removed';\nexport function wrapKeyToObject(key) {\n var keyObj;\n\n if (key && _typeof(key) === 'object' && 'key' in key) {\n keyObj = key;\n } else {\n keyObj = {\n key: key\n };\n }\n\n return _objectSpread(_objectSpread({}, keyObj), {}, {\n key: String(keyObj.key)\n });\n}\nexport function parseKeys() {\n var keys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n return keys.map(wrapKeyToObject);\n}\nexport function diffKeys() {\n var prevKeys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var currentKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n var list = [];\n var currentIndex = 0;\n var currentLen = currentKeys.length;\n var prevKeyObjects = parseKeys(prevKeys);\n var currentKeyObjects = parseKeys(currentKeys); // Check prev keys to insert or keep\n\n prevKeyObjects.forEach(function (keyObj) {\n var hit = false;\n\n for (var i = currentIndex; i < currentLen; i += 1) {\n var currentKeyObj = currentKeyObjects[i];\n\n if (currentKeyObj.key === keyObj.key) {\n // New added keys should add before current key\n if (currentIndex < i) {\n list = list.concat(currentKeyObjects.slice(currentIndex, i).map(function (obj) {\n return _objectSpread(_objectSpread({}, obj), {}, {\n status: STATUS_ADD\n });\n }));\n currentIndex = i;\n }\n\n list.push(_objectSpread(_objectSpread({}, currentKeyObj), {}, {\n status: STATUS_KEEP\n }));\n currentIndex += 1;\n hit = true;\n break;\n }\n } // If not hit, it means key is removed\n\n\n if (!hit) {\n list.push(_objectSpread(_objectSpread({}, keyObj), {}, {\n status: STATUS_REMOVE\n }));\n }\n }); // Add rest to the list\n\n if (currentIndex < currentLen) {\n list = list.concat(currentKeyObjects.slice(currentIndex).map(function (obj) {\n return _objectSpread(_objectSpread({}, obj), {}, {\n status: STATUS_ADD\n });\n }));\n }\n /**\n * Merge same key when it remove and add again:\n * [1 - add, 2 - keep, 1 - remove] -> [1 - keep, 2 - keep]\n */\n\n\n var keys = {};\n list.forEach(function (_ref) {\n var key = _ref.key;\n keys[key] = (keys[key] || 0) + 1;\n });\n var duplicatedKeys = Object.keys(keys).filter(function (key) {\n return keys[key] > 1;\n });\n duplicatedKeys.forEach(function (matchKey) {\n // Remove `STATUS_REMOVE` node.\n list = list.filter(function (_ref2) {\n var key = _ref2.key,\n status = _ref2.status;\n return key !== matchKey || status !== STATUS_REMOVE;\n }); // Update `STATUS_ADD` to `STATUS_KEEP`\n\n list.forEach(function (node) {\n if (node.key === matchKey) {\n // eslint-disable-next-line no-param-reassign\n node.status = STATUS_KEEP;\n }\n });\n });\n return list;\n}","import _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _createSuper from \"@babel/runtime/helpers/esm/createSuper\";\n\n/* eslint react/prop-types: 0 */\nimport * as React from 'react';\nimport OriginCSSMotion from './CSSMotion';\nimport { supportTransition } from './util/motion';\nimport { STATUS_ADD, STATUS_KEEP, STATUS_REMOVE, STATUS_REMOVED, diffKeys, parseKeys } from './util/diff';\nvar MOTION_PROP_NAMES = ['eventProps', 'visible', 'children', 'motionName', 'motionAppear', 'motionEnter', 'motionLeave', 'motionLeaveImmediately', 'motionDeadline', 'removeOnLeave', 'leavedClassName', 'onAppearStart', 'onAppearActive', 'onAppearEnd', 'onEnterStart', 'onEnterActive', 'onEnterEnd', 'onLeaveStart', 'onLeaveActive', 'onLeaveEnd'];\n/**\n * Generate a CSSMotionList component with config\n * @param transitionSupport No need since CSSMotionList no longer depends on transition support\n * @param CSSMotion CSSMotion component\n */\n\nexport function genCSSMotionList(transitionSupport) {\n var CSSMotion = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : OriginCSSMotion;\n\n var CSSMotionList = /*#__PURE__*/function (_React$Component) {\n _inherits(CSSMotionList, _React$Component);\n\n var _super = _createSuper(CSSMotionList);\n\n function CSSMotionList() {\n var _this;\n\n _classCallCheck(this, CSSMotionList);\n\n _this = _super.apply(this, arguments);\n _this.state = {\n keyEntities: []\n };\n\n _this.removeKey = function (removeKey) {\n _this.setState(function (_ref) {\n var keyEntities = _ref.keyEntities;\n return {\n keyEntities: keyEntities.map(function (entity) {\n if (entity.key !== removeKey) return entity;\n return _objectSpread(_objectSpread({}, entity), {}, {\n status: STATUS_REMOVED\n });\n })\n };\n });\n };\n\n return _this;\n }\n\n _createClass(CSSMotionList, [{\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var keyEntities = this.state.keyEntities;\n\n var _this$props = this.props,\n component = _this$props.component,\n children = _this$props.children,\n _onVisibleChanged = _this$props.onVisibleChanged,\n restProps = _objectWithoutProperties(_this$props, [\"component\", \"children\", \"onVisibleChanged\"]);\n\n var Component = component || React.Fragment;\n var motionProps = {};\n MOTION_PROP_NAMES.forEach(function (prop) {\n motionProps[prop] = restProps[prop];\n delete restProps[prop];\n });\n delete restProps.keys;\n return React.createElement(Component, Object.assign({}, restProps), keyEntities.map(function (_ref2) {\n var status = _ref2.status,\n eventProps = _objectWithoutProperties(_ref2, [\"status\"]);\n\n var visible = status === STATUS_ADD || status === STATUS_KEEP;\n return React.createElement(CSSMotion, Object.assign({}, motionProps, {\n key: eventProps.key,\n visible: visible,\n eventProps: eventProps,\n onVisibleChanged: function onVisibleChanged(changedVisible) {\n _onVisibleChanged === null || _onVisibleChanged === void 0 ? void 0 : _onVisibleChanged(changedVisible, {\n key: eventProps.key\n });\n\n if (!changedVisible) {\n _this2.removeKey(eventProps.key);\n }\n }\n }), children);\n }));\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(_ref3, _ref4) {\n var keys = _ref3.keys;\n var keyEntities = _ref4.keyEntities;\n var parsedKeyObjects = parseKeys(keys);\n var mixedKeyEntities = diffKeys(keyEntities, parsedKeyObjects);\n return {\n keyEntities: mixedKeyEntities.filter(function (entity) {\n var prevEntity = keyEntities.find(function (_ref5) {\n var key = _ref5.key;\n return entity.key === key;\n }); // Remove if already mark as removed\n\n if (prevEntity && prevEntity.status === STATUS_REMOVED && entity.status === STATUS_REMOVE) {\n return false;\n }\n\n return true;\n })\n };\n }\n }]);\n\n return CSSMotionList;\n }(React.Component);\n\n CSSMotionList.defaultProps = {\n component: 'div'\n };\n return CSSMotionList;\n}\nexport default genCSSMotionList(supportTransition);","import CSSMotion from './CSSMotion';\nimport CSSMotionList from './CSSMotionList';\nexport { CSSMotionList };\nexport default CSSMotion;","export function getMotion(_ref) {\n var prefixCls = _ref.prefixCls,\n motion = _ref.motion,\n animation = _ref.animation,\n transitionName = _ref.transitionName;\n\n if (motion) {\n return motion;\n }\n\n if (animation) {\n return {\n motionName: \"\".concat(prefixCls, \"-\").concat(animation)\n };\n }\n\n if (transitionName) {\n return {\n motionName: transitionName\n };\n }\n\n return null;\n}","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport CSSMotion from 'rc-motion';\nimport { getMotion } from '../utils/legacyUtil';\nexport default function Mask(props) {\n var prefixCls = props.prefixCls,\n visible = props.visible,\n zIndex = props.zIndex,\n mask = props.mask,\n maskMotion = props.maskMotion,\n maskAnimation = props.maskAnimation,\n maskTransitionName = props.maskTransitionName;\n\n if (!mask) {\n return null;\n }\n\n var motion = {};\n\n if (maskMotion || maskTransitionName || maskAnimation) {\n motion = _objectSpread({\n motionAppear: true\n }, getMotion({\n motion: maskMotion,\n prefixCls: prefixCls,\n transitionName: maskTransitionName,\n animation: maskAnimation\n }));\n }\n\n return React.createElement(CSSMotion, Object.assign({}, motion, {\n visible: visible,\n removeOnLeave: true\n }), function (_ref) {\n var className = _ref.className;\n return React.createElement(\"div\", {\n style: {\n zIndex: zIndex\n },\n className: classNames(\"\".concat(prefixCls, \"-mask\"), className)\n });\n });\n}","export default (function (element) {\n if (!element) {\n return false;\n }\n\n if (element.offsetParent) {\n return true;\n }\n\n if (element.getBBox) {\n var box = element.getBBox();\n\n if (box.width || box.height) {\n return true;\n }\n }\n\n if (element.getBoundingClientRect) {\n var _box = element.getBoundingClientRect();\n\n if (_box.width || _box.height) {\n return true;\n }\n }\n\n return false;\n});","function _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(source, true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(source).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nvar vendorPrefix;\nvar jsCssMap = {\n Webkit: '-webkit-',\n Moz: '-moz-',\n // IE did it wrong again ...\n ms: '-ms-',\n O: '-o-'\n};\n\nfunction getVendorPrefix() {\n if (vendorPrefix !== undefined) {\n return vendorPrefix;\n }\n\n vendorPrefix = '';\n var style = document.createElement('p').style;\n var testProp = 'Transform';\n\n for (var key in jsCssMap) {\n if (key + testProp in style) {\n vendorPrefix = key;\n }\n }\n\n return vendorPrefix;\n}\n\nfunction getTransitionName() {\n return getVendorPrefix() ? \"\".concat(getVendorPrefix(), \"TransitionProperty\") : 'transitionProperty';\n}\n\nfunction getTransformName() {\n return getVendorPrefix() ? \"\".concat(getVendorPrefix(), \"Transform\") : 'transform';\n}\nfunction setTransitionProperty(node, value) {\n var name = getTransitionName();\n\n if (name) {\n node.style[name] = value;\n\n if (name !== 'transitionProperty') {\n node.style.transitionProperty = value;\n }\n }\n}\n\nfunction setTransform(node, value) {\n var name = getTransformName();\n\n if (name) {\n node.style[name] = value;\n\n if (name !== 'transform') {\n node.style.transform = value;\n }\n }\n}\n\nfunction getTransitionProperty(node) {\n return node.style.transitionProperty || node.style[getTransitionName()];\n}\nfunction getTransformXY(node) {\n var style = window.getComputedStyle(node, null);\n var transform = style.getPropertyValue('transform') || style.getPropertyValue(getTransformName());\n\n if (transform && transform !== 'none') {\n var matrix = transform.replace(/[^0-9\\-.,]/g, '').split(',');\n return {\n x: parseFloat(matrix[12] || matrix[4], 0),\n y: parseFloat(matrix[13] || matrix[5], 0)\n };\n }\n\n return {\n x: 0,\n y: 0\n };\n}\nvar matrix2d = /matrix\\((.*)\\)/;\nvar matrix3d = /matrix3d\\((.*)\\)/;\nfunction setTransformXY(node, xy) {\n var style = window.getComputedStyle(node, null);\n var transform = style.getPropertyValue('transform') || style.getPropertyValue(getTransformName());\n\n if (transform && transform !== 'none') {\n var arr;\n var match2d = transform.match(matrix2d);\n\n if (match2d) {\n match2d = match2d[1];\n arr = match2d.split(',').map(function (item) {\n return parseFloat(item, 10);\n });\n arr[4] = xy.x;\n arr[5] = xy.y;\n setTransform(node, \"matrix(\".concat(arr.join(','), \")\"));\n } else {\n var match3d = transform.match(matrix3d)[1];\n arr = match3d.split(',').map(function (item) {\n return parseFloat(item, 10);\n });\n arr[12] = xy.x;\n arr[13] = xy.y;\n setTransform(node, \"matrix3d(\".concat(arr.join(','), \")\"));\n }\n } else {\n setTransform(node, \"translateX(\".concat(xy.x, \"px) translateY(\").concat(xy.y, \"px) translateZ(0)\"));\n }\n}\n\nvar RE_NUM = /[\\-+]?(?:\\d*\\.|)\\d+(?:[eE][\\-+]?\\d+|)/.source;\nvar getComputedStyleX; // https://stackoverflow.com/a/3485654/3040605\n\nfunction forceRelayout(elem) {\n var originalStyle = elem.style.display;\n elem.style.display = 'none';\n elem.offsetHeight; // eslint-disable-line\n\n elem.style.display = originalStyle;\n}\n\nfunction css(el, name, v) {\n var value = v;\n\n if (_typeof(name) === 'object') {\n for (var i in name) {\n if (name.hasOwnProperty(i)) {\n css(el, i, name[i]);\n }\n }\n\n return undefined;\n }\n\n if (typeof value !== 'undefined') {\n if (typeof value === 'number') {\n value = \"\".concat(value, \"px\");\n }\n\n el.style[name] = value;\n return undefined;\n }\n\n return getComputedStyleX(el, name);\n}\n\nfunction getClientPosition(elem) {\n var box;\n var x;\n var y;\n var doc = elem.ownerDocument;\n var body = doc.body;\n var docElem = doc && doc.documentElement; // 根据 GBS 最新数据,A-Grade Browsers 都已支持 getBoundingClientRect 方法,不用再考虑传统的实现方式\n\n box = elem.getBoundingClientRect(); // 注:jQuery 还考虑减去 docElem.clientLeft/clientTop\n // 但测试发现,这样反而会导致当 html 和 body 有边距/边框样式时,获取的值不正确\n // 此外,ie6 会忽略 html 的 margin 值,幸运地是没有谁会去设置 html 的 margin\n\n x = box.left;\n y = box.top; // In IE, most of the time, 2 extra pixels are added to the top and left\n // due to the implicit 2-pixel inset border. In IE6/7 quirks mode and\n // IE6 standards mode, this border can be overridden by setting the\n // document element's border to zero -- thus, we cannot rely on the\n // offset always being 2 pixels.\n // In quirks mode, the offset can be determined by querying the body's\n // clientLeft/clientTop, but in standards mode, it is found by querying\n // the document element's clientLeft/clientTop. Since we already called\n // getClientBoundingRect we have already forced a reflow, so it is not\n // too expensive just to query them all.\n // ie 下应该减去窗口的边框吧,毕竟默认 absolute 都是相对窗口定位的\n // 窗口边框标准是设 documentElement ,quirks 时设置 body\n // 最好禁止在 body 和 html 上边框 ,但 ie < 9 html 默认有 2px ,减去\n // 但是非 ie 不可能设置窗口边框,body html 也不是窗口 ,ie 可以通过 html,body 设置\n // 标准 ie 下 docElem.clientTop 就是 border-top\n // ie7 html 即窗口边框改变不了。永远为 2\n // 但标准 firefox/chrome/ie9 下 docElem.clientTop 是窗口边框,即使设了 border-top 也为 0\n\n x -= docElem.clientLeft || body.clientLeft || 0;\n y -= docElem.clientTop || body.clientTop || 0;\n return {\n left: x,\n top: y\n };\n}\n\nfunction getScroll(w, top) {\n var ret = w[\"page\".concat(top ? 'Y' : 'X', \"Offset\")];\n var method = \"scroll\".concat(top ? 'Top' : 'Left');\n\n if (typeof ret !== 'number') {\n var d = w.document; // ie6,7,8 standard mode\n\n ret = d.documentElement[method];\n\n if (typeof ret !== 'number') {\n // quirks mode\n ret = d.body[method];\n }\n }\n\n return ret;\n}\n\nfunction getScrollLeft(w) {\n return getScroll(w);\n}\n\nfunction getScrollTop(w) {\n return getScroll(w, true);\n}\n\nfunction getOffset(el) {\n var pos = getClientPosition(el);\n var doc = el.ownerDocument;\n var w = doc.defaultView || doc.parentWindow;\n pos.left += getScrollLeft(w);\n pos.top += getScrollTop(w);\n return pos;\n}\n/**\n * A crude way of determining if an object is a window\n * @member util\n */\n\n\nfunction isWindow(obj) {\n // must use == for ie8\n\n /* eslint eqeqeq:0 */\n return obj !== null && obj !== undefined && obj == obj.window;\n}\n\nfunction getDocument(node) {\n if (isWindow(node)) {\n return node.document;\n }\n\n if (node.nodeType === 9) {\n return node;\n }\n\n return node.ownerDocument;\n}\n\nfunction _getComputedStyle(elem, name, cs) {\n var computedStyle = cs;\n var val = '';\n var d = getDocument(elem);\n computedStyle = computedStyle || d.defaultView.getComputedStyle(elem, null); // https://github.com/kissyteam/kissy/issues/61\n\n if (computedStyle) {\n val = computedStyle.getPropertyValue(name) || computedStyle[name];\n }\n\n return val;\n}\n\nvar _RE_NUM_NO_PX = new RegExp(\"^(\".concat(RE_NUM, \")(?!px)[a-z%]+$\"), 'i');\n\nvar RE_POS = /^(top|right|bottom|left)$/;\nvar CURRENT_STYLE = 'currentStyle';\nvar RUNTIME_STYLE = 'runtimeStyle';\nvar LEFT = 'left';\nvar PX = 'px';\n\nfunction _getComputedStyleIE(elem, name) {\n // currentStyle maybe null\n // http://msdn.microsoft.com/en-us/library/ms535231.aspx\n var ret = elem[CURRENT_STYLE] && elem[CURRENT_STYLE][name]; // 当 width/height 设置为百分比时,通过 pixelLeft 方式转换的 width/height 值\n // 一开始就处理了! CUSTOM_STYLE.height,CUSTOM_STYLE.width ,cssHook 解决@2011-08-19\n // 在 ie 下不对,需要直接用 offset 方式\n // borderWidth 等值也有问题,但考虑到 borderWidth 设为百分比的概率很小,这里就不考虑了\n // From the awesome hack by Dean Edwards\n // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291\n // If we're not dealing with a regular pixel number\n // but a number that has a weird ending, we need to convert it to pixels\n // exclude left right for relativity\n\n if (_RE_NUM_NO_PX.test(ret) && !RE_POS.test(name)) {\n // Remember the original values\n var style = elem.style;\n var left = style[LEFT];\n var rsLeft = elem[RUNTIME_STYLE][LEFT]; // prevent flashing of content\n\n elem[RUNTIME_STYLE][LEFT] = elem[CURRENT_STYLE][LEFT]; // Put in the new values to get a computed value out\n\n style[LEFT] = name === 'fontSize' ? '1em' : ret || 0;\n ret = style.pixelLeft + PX; // Revert the changed values\n\n style[LEFT] = left;\n elem[RUNTIME_STYLE][LEFT] = rsLeft;\n }\n\n return ret === '' ? 'auto' : ret;\n}\n\nif (typeof window !== 'undefined') {\n getComputedStyleX = window.getComputedStyle ? _getComputedStyle : _getComputedStyleIE;\n}\n\nfunction getOffsetDirection(dir, option) {\n if (dir === 'left') {\n return option.useCssRight ? 'right' : dir;\n }\n\n return option.useCssBottom ? 'bottom' : dir;\n}\n\nfunction oppositeOffsetDirection(dir) {\n if (dir === 'left') {\n return 'right';\n } else if (dir === 'right') {\n return 'left';\n } else if (dir === 'top') {\n return 'bottom';\n } else if (dir === 'bottom') {\n return 'top';\n }\n} // 设置 elem 相对 elem.ownerDocument 的坐标\n\n\nfunction setLeftTop(elem, offset, option) {\n // set position first, in-case top/left are set even on static elem\n if (css(elem, 'position') === 'static') {\n elem.style.position = 'relative';\n }\n\n var presetH = -999;\n var presetV = -999;\n var horizontalProperty = getOffsetDirection('left', option);\n var verticalProperty = getOffsetDirection('top', option);\n var oppositeHorizontalProperty = oppositeOffsetDirection(horizontalProperty);\n var oppositeVerticalProperty = oppositeOffsetDirection(verticalProperty);\n\n if (horizontalProperty !== 'left') {\n presetH = 999;\n }\n\n if (verticalProperty !== 'top') {\n presetV = 999;\n }\n\n var originalTransition = '';\n var originalOffset = getOffset(elem);\n\n if ('left' in offset || 'top' in offset) {\n originalTransition = getTransitionProperty(elem) || '';\n setTransitionProperty(elem, 'none');\n }\n\n if ('left' in offset) {\n elem.style[oppositeHorizontalProperty] = '';\n elem.style[horizontalProperty] = \"\".concat(presetH, \"px\");\n }\n\n if ('top' in offset) {\n elem.style[oppositeVerticalProperty] = '';\n elem.style[verticalProperty] = \"\".concat(presetV, \"px\");\n } // force relayout\n\n\n forceRelayout(elem);\n var old = getOffset(elem);\n var originalStyle = {};\n\n for (var key in offset) {\n if (offset.hasOwnProperty(key)) {\n var dir = getOffsetDirection(key, option);\n var preset = key === 'left' ? presetH : presetV;\n var off = originalOffset[key] - old[key];\n\n if (dir === key) {\n originalStyle[dir] = preset + off;\n } else {\n originalStyle[dir] = preset - off;\n }\n }\n }\n\n css(elem, originalStyle); // force relayout\n\n forceRelayout(elem);\n\n if ('left' in offset || 'top' in offset) {\n setTransitionProperty(elem, originalTransition);\n }\n\n var ret = {};\n\n for (var _key in offset) {\n if (offset.hasOwnProperty(_key)) {\n var _dir = getOffsetDirection(_key, option);\n\n var _off = offset[_key] - originalOffset[_key];\n\n if (_key === _dir) {\n ret[_dir] = originalStyle[_dir] + _off;\n } else {\n ret[_dir] = originalStyle[_dir] - _off;\n }\n }\n }\n\n css(elem, ret);\n}\n\nfunction setTransform$1(elem, offset) {\n var originalOffset = getOffset(elem);\n var originalXY = getTransformXY(elem);\n var resultXY = {\n x: originalXY.x,\n y: originalXY.y\n };\n\n if ('left' in offset) {\n resultXY.x = originalXY.x + offset.left - originalOffset.left;\n }\n\n if ('top' in offset) {\n resultXY.y = originalXY.y + offset.top - originalOffset.top;\n }\n\n setTransformXY(elem, resultXY);\n}\n\nfunction setOffset(elem, offset, option) {\n if (option.ignoreShake) {\n var oriOffset = getOffset(elem);\n var oLeft = oriOffset.left.toFixed(0);\n var oTop = oriOffset.top.toFixed(0);\n var tLeft = offset.left.toFixed(0);\n var tTop = offset.top.toFixed(0);\n\n if (oLeft === tLeft && oTop === tTop) {\n return;\n }\n }\n\n if (option.useCssRight || option.useCssBottom) {\n setLeftTop(elem, offset, option);\n } else if (option.useCssTransform && getTransformName() in document.body.style) {\n setTransform$1(elem, offset);\n } else {\n setLeftTop(elem, offset, option);\n }\n}\n\nfunction each(arr, fn) {\n for (var i = 0; i < arr.length; i++) {\n fn(arr[i]);\n }\n}\n\nfunction isBorderBoxFn(elem) {\n return getComputedStyleX(elem, 'boxSizing') === 'border-box';\n}\n\nvar BOX_MODELS = ['margin', 'border', 'padding'];\nvar CONTENT_INDEX = -1;\nvar PADDING_INDEX = 2;\nvar BORDER_INDEX = 1;\nvar MARGIN_INDEX = 0;\n\nfunction swap(elem, options, callback) {\n var old = {};\n var style = elem.style;\n var name; // Remember the old values, and insert the new ones\n\n for (name in options) {\n if (options.hasOwnProperty(name)) {\n old[name] = style[name];\n style[name] = options[name];\n }\n }\n\n callback.call(elem); // Revert the old values\n\n for (name in options) {\n if (options.hasOwnProperty(name)) {\n style[name] = old[name];\n }\n }\n}\n\nfunction getPBMWidth(elem, props, which) {\n var value = 0;\n var prop;\n var j;\n var i;\n\n for (j = 0; j < props.length; j++) {\n prop = props[j];\n\n if (prop) {\n for (i = 0; i < which.length; i++) {\n var cssProp = void 0;\n\n if (prop === 'border') {\n cssProp = \"\".concat(prop).concat(which[i], \"Width\");\n } else {\n cssProp = prop + which[i];\n }\n\n value += parseFloat(getComputedStyleX(elem, cssProp)) || 0;\n }\n }\n }\n\n return value;\n}\n\nvar domUtils = {\n getParent: function getParent(element) {\n var parent = element;\n\n do {\n if (parent.nodeType === 11 && parent.host) {\n parent = parent.host;\n } else {\n parent = parent.parentNode;\n }\n } while (parent && parent.nodeType !== 1 && parent.nodeType !== 9);\n\n return parent;\n }\n};\neach(['Width', 'Height'], function (name) {\n domUtils[\"doc\".concat(name)] = function (refWin) {\n var d = refWin.document;\n return Math.max( // firefox chrome documentElement.scrollHeight< body.scrollHeight\n // ie standard mode : documentElement.scrollHeight> body.scrollHeight\n d.documentElement[\"scroll\".concat(name)], // quirks : documentElement.scrollHeight 最大等于可视窗口多一点?\n d.body[\"scroll\".concat(name)], domUtils[\"viewport\".concat(name)](d));\n };\n\n domUtils[\"viewport\".concat(name)] = function (win) {\n // pc browser includes scrollbar in window.innerWidth\n var prop = \"client\".concat(name);\n var doc = win.document;\n var body = doc.body;\n var documentElement = doc.documentElement;\n var documentElementProp = documentElement[prop]; // 标准模式取 documentElement\n // backcompat 取 body\n\n return doc.compatMode === 'CSS1Compat' && documentElementProp || body && body[prop] || documentElementProp;\n };\n});\n/*\n 得到元素的大小信息\n @param elem\n @param name\n @param {String} [extra] 'padding' : (css width) + padding\n 'border' : (css width) + padding + border\n 'margin' : (css width) + padding + border + margin\n */\n\nfunction getWH(elem, name, ex) {\n var extra = ex;\n\n if (isWindow(elem)) {\n return name === 'width' ? domUtils.viewportWidth(elem) : domUtils.viewportHeight(elem);\n } else if (elem.nodeType === 9) {\n return name === 'width' ? domUtils.docWidth(elem) : domUtils.docHeight(elem);\n }\n\n var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];\n var borderBoxValue = name === 'width' ? elem.getBoundingClientRect().width : elem.getBoundingClientRect().height;\n var computedStyle = getComputedStyleX(elem);\n var isBorderBox = isBorderBoxFn(elem);\n var cssBoxValue = 0;\n\n if (borderBoxValue === null || borderBoxValue === undefined || borderBoxValue <= 0) {\n borderBoxValue = undefined; // Fall back to computed then un computed css if necessary\n\n cssBoxValue = getComputedStyleX(elem, name);\n\n if (cssBoxValue === null || cssBoxValue === undefined || Number(cssBoxValue) < 0) {\n cssBoxValue = elem.style[name] || 0;\n } // Normalize '', auto, and prepare for extra\n\n\n cssBoxValue = parseFloat(cssBoxValue) || 0;\n }\n\n if (extra === undefined) {\n extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX;\n }\n\n var borderBoxValueOrIsBorderBox = borderBoxValue !== undefined || isBorderBox;\n var val = borderBoxValue || cssBoxValue;\n\n if (extra === CONTENT_INDEX) {\n if (borderBoxValueOrIsBorderBox) {\n return val - getPBMWidth(elem, ['border', 'padding'], which);\n }\n\n return cssBoxValue;\n } else if (borderBoxValueOrIsBorderBox) {\n if (extra === BORDER_INDEX) {\n return val;\n }\n\n return val + (extra === PADDING_INDEX ? -getPBMWidth(elem, ['border'], which) : getPBMWidth(elem, ['margin'], which));\n }\n\n return cssBoxValue + getPBMWidth(elem, BOX_MODELS.slice(extra), which);\n}\n\nvar cssShow = {\n position: 'absolute',\n visibility: 'hidden',\n display: 'block'\n}; // fix #119 : https://github.com/kissyteam/kissy/issues/119\n\nfunction getWHIgnoreDisplay() {\n for (var _len = arguments.length, args = new Array(_len), _key2 = 0; _key2 < _len; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n var val;\n var elem = args[0]; // in case elem is window\n // elem.offsetWidth === undefined\n\n if (elem.offsetWidth !== 0) {\n val = getWH.apply(undefined, args);\n } else {\n swap(elem, cssShow, function () {\n val = getWH.apply(undefined, args);\n });\n }\n\n return val;\n}\n\neach(['width', 'height'], function (name) {\n var first = name.charAt(0).toUpperCase() + name.slice(1);\n\n domUtils[\"outer\".concat(first)] = function (el, includeMargin) {\n return el && getWHIgnoreDisplay(el, name, includeMargin ? MARGIN_INDEX : BORDER_INDEX);\n };\n\n var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];\n\n domUtils[name] = function (elem, v) {\n var val = v;\n\n if (val !== undefined) {\n if (elem) {\n var computedStyle = getComputedStyleX(elem);\n var isBorderBox = isBorderBoxFn(elem);\n\n if (isBorderBox) {\n val += getPBMWidth(elem, ['padding', 'border'], which);\n }\n\n return css(elem, name, val);\n }\n\n return undefined;\n }\n\n return elem && getWHIgnoreDisplay(elem, name, CONTENT_INDEX);\n };\n});\n\nfunction mix(to, from) {\n for (var i in from) {\n if (from.hasOwnProperty(i)) {\n to[i] = from[i];\n }\n }\n\n return to;\n}\n\nvar utils = {\n getWindow: function getWindow(node) {\n if (node && node.document && node.setTimeout) {\n return node;\n }\n\n var doc = node.ownerDocument || node;\n return doc.defaultView || doc.parentWindow;\n },\n getDocument: getDocument,\n offset: function offset(el, value, option) {\n if (typeof value !== 'undefined') {\n setOffset(el, value, option || {});\n } else {\n return getOffset(el);\n }\n },\n isWindow: isWindow,\n each: each,\n css: css,\n clone: function clone(obj) {\n var i;\n var ret = {};\n\n for (i in obj) {\n if (obj.hasOwnProperty(i)) {\n ret[i] = obj[i];\n }\n }\n\n var overflow = obj.overflow;\n\n if (overflow) {\n for (i in obj) {\n if (obj.hasOwnProperty(i)) {\n ret.overflow[i] = obj.overflow[i];\n }\n }\n }\n\n return ret;\n },\n mix: mix,\n getWindowScrollLeft: function getWindowScrollLeft(w) {\n return getScrollLeft(w);\n },\n getWindowScrollTop: function getWindowScrollTop(w) {\n return getScrollTop(w);\n },\n merge: function merge() {\n var ret = {};\n\n for (var i = 0; i < arguments.length; i++) {\n utils.mix(ret, i < 0 || arguments.length <= i ? undefined : arguments[i]);\n }\n\n return ret;\n },\n viewportWidth: 0,\n viewportHeight: 0\n};\nmix(utils, domUtils);\n\n/**\n * 得到会导致元素显示不全的祖先元素\n */\n\nvar getParent = utils.getParent;\n\nfunction getOffsetParent(element) {\n if (utils.isWindow(element) || element.nodeType === 9) {\n return null;\n } // ie 这个也不是完全可行\n\n /*\n

\n
\n 元素 6 高 100px 宽 50px
\n
\n
\n */\n // element.offsetParent does the right thing in ie7 and below. Return parent with layout!\n // In other browsers it only includes elements with position absolute, relative or\n // fixed, not elements with overflow set to auto or scroll.\n // if (UA.ie && ieMode < 8) {\n // return element.offsetParent;\n // }\n // 统一的 offsetParent 方法\n\n\n var doc = utils.getDocument(element);\n var body = doc.body;\n var parent;\n var positionStyle = utils.css(element, 'position');\n var skipStatic = positionStyle === 'fixed' || positionStyle === 'absolute';\n\n if (!skipStatic) {\n return element.nodeName.toLowerCase() === 'html' ? null : getParent(element);\n }\n\n for (parent = getParent(element); parent && parent !== body && parent.nodeType !== 9; parent = getParent(parent)) {\n positionStyle = utils.css(parent, 'position');\n\n if (positionStyle !== 'static') {\n return parent;\n }\n }\n\n return null;\n}\n\nvar getParent$1 = utils.getParent;\nfunction isAncestorFixed(element) {\n if (utils.isWindow(element) || element.nodeType === 9) {\n return false;\n }\n\n var doc = utils.getDocument(element);\n var body = doc.body;\n var parent = null;\n\n for (parent = getParent$1(element); parent && parent !== body; parent = getParent$1(parent)) {\n var positionStyle = utils.css(parent, 'position');\n\n if (positionStyle === 'fixed') {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * 获得元素的显示部分的区域\n */\n\nfunction getVisibleRectForElement(element, alwaysByViewport) {\n var visibleRect = {\n left: 0,\n right: Infinity,\n top: 0,\n bottom: Infinity\n };\n var el = getOffsetParent(element);\n var doc = utils.getDocument(element);\n var win = doc.defaultView || doc.parentWindow;\n var body = doc.body;\n var documentElement = doc.documentElement; // Determine the size of the visible rect by climbing the dom accounting for\n // all scrollable containers.\n\n while (el) {\n // clientWidth is zero for inline block elements in ie.\n if ((navigator.userAgent.indexOf('MSIE') === -1 || el.clientWidth !== 0) && // body may have overflow set on it, yet we still get the entire\n // viewport. In some browsers, el.offsetParent may be\n // document.documentElement, so check for that too.\n el !== body && el !== documentElement && utils.css(el, 'overflow') !== 'visible') {\n var pos = utils.offset(el); // add border\n\n pos.left += el.clientLeft;\n pos.top += el.clientTop;\n visibleRect.top = Math.max(visibleRect.top, pos.top);\n visibleRect.right = Math.min(visibleRect.right, // consider area without scrollBar\n pos.left + el.clientWidth);\n visibleRect.bottom = Math.min(visibleRect.bottom, pos.top + el.clientHeight);\n visibleRect.left = Math.max(visibleRect.left, pos.left);\n } else if (el === body || el === documentElement) {\n break;\n }\n\n el = getOffsetParent(el);\n } // Set element position to fixed\n // make sure absolute element itself don't affect it's visible area\n // https://github.com/ant-design/ant-design/issues/7601\n\n\n var originalPosition = null;\n\n if (!utils.isWindow(element) && element.nodeType !== 9) {\n originalPosition = element.style.position;\n var position = utils.css(element, 'position');\n\n if (position === 'absolute') {\n element.style.position = 'fixed';\n }\n }\n\n var scrollX = utils.getWindowScrollLeft(win);\n var scrollY = utils.getWindowScrollTop(win);\n var viewportWidth = utils.viewportWidth(win);\n var viewportHeight = utils.viewportHeight(win);\n var documentWidth = documentElement.scrollWidth;\n var documentHeight = documentElement.scrollHeight; // scrollXXX on html is sync with body which means overflow: hidden on body gets wrong scrollXXX.\n // We should cut this ourself.\n\n var bodyStyle = window.getComputedStyle(body);\n\n if (bodyStyle.overflowX === 'hidden') {\n documentWidth = win.innerWidth;\n }\n\n if (bodyStyle.overflowY === 'hidden') {\n documentHeight = win.innerHeight;\n } // Reset element position after calculate the visible area\n\n\n if (element.style) {\n element.style.position = originalPosition;\n }\n\n if (alwaysByViewport || isAncestorFixed(element)) {\n // Clip by viewport's size.\n visibleRect.left = Math.max(visibleRect.left, scrollX);\n visibleRect.top = Math.max(visibleRect.top, scrollY);\n visibleRect.right = Math.min(visibleRect.right, scrollX + viewportWidth);\n visibleRect.bottom = Math.min(visibleRect.bottom, scrollY + viewportHeight);\n } else {\n // Clip by document's size.\n var maxVisibleWidth = Math.max(documentWidth, scrollX + viewportWidth);\n visibleRect.right = Math.min(visibleRect.right, maxVisibleWidth);\n var maxVisibleHeight = Math.max(documentHeight, scrollY + viewportHeight);\n visibleRect.bottom = Math.min(visibleRect.bottom, maxVisibleHeight);\n }\n\n return visibleRect.top >= 0 && visibleRect.left >= 0 && visibleRect.bottom > visibleRect.top && visibleRect.right > visibleRect.left ? visibleRect : null;\n}\n\nfunction adjustForViewport(elFuturePos, elRegion, visibleRect, overflow) {\n var pos = utils.clone(elFuturePos);\n var size = {\n width: elRegion.width,\n height: elRegion.height\n };\n\n if (overflow.adjustX && pos.left < visibleRect.left) {\n pos.left = visibleRect.left;\n } // Left edge inside and right edge outside viewport, try to resize it.\n\n\n if (overflow.resizeWidth && pos.left >= visibleRect.left && pos.left + size.width > visibleRect.right) {\n size.width -= pos.left + size.width - visibleRect.right;\n } // Right edge outside viewport, try to move it.\n\n\n if (overflow.adjustX && pos.left + size.width > visibleRect.right) {\n // 保证左边界和可视区域左边界对齐\n pos.left = Math.max(visibleRect.right - size.width, visibleRect.left);\n } // Top edge outside viewport, try to move it.\n\n\n if (overflow.adjustY && pos.top < visibleRect.top) {\n pos.top = visibleRect.top;\n } // Top edge inside and bottom edge outside viewport, try to resize it.\n\n\n if (overflow.resizeHeight && pos.top >= visibleRect.top && pos.top + size.height > visibleRect.bottom) {\n size.height -= pos.top + size.height - visibleRect.bottom;\n } // Bottom edge outside viewport, try to move it.\n\n\n if (overflow.adjustY && pos.top + size.height > visibleRect.bottom) {\n // 保证上边界和可视区域上边界对齐\n pos.top = Math.max(visibleRect.bottom - size.height, visibleRect.top);\n }\n\n return utils.mix(pos, size);\n}\n\nfunction getRegion(node) {\n var offset;\n var w;\n var h;\n\n if (!utils.isWindow(node) && node.nodeType !== 9) {\n offset = utils.offset(node);\n w = utils.outerWidth(node);\n h = utils.outerHeight(node);\n } else {\n var win = utils.getWindow(node);\n offset = {\n left: utils.getWindowScrollLeft(win),\n top: utils.getWindowScrollTop(win)\n };\n w = utils.viewportWidth(win);\n h = utils.viewportHeight(win);\n }\n\n offset.width = w;\n offset.height = h;\n return offset;\n}\n\n/**\n * 获取 node 上的 align 对齐点 相对于页面的坐标\n */\nfunction getAlignOffset(region, align) {\n var V = align.charAt(0);\n var H = align.charAt(1);\n var w = region.width;\n var h = region.height;\n var x = region.left;\n var y = region.top;\n\n if (V === 'c') {\n y += h / 2;\n } else if (V === 'b') {\n y += h;\n }\n\n if (H === 'c') {\n x += w / 2;\n } else if (H === 'r') {\n x += w;\n }\n\n return {\n left: x,\n top: y\n };\n}\n\nfunction getElFuturePos(elRegion, refNodeRegion, points, offset, targetOffset) {\n var p1 = getAlignOffset(refNodeRegion, points[1]);\n var p2 = getAlignOffset(elRegion, points[0]);\n var diff = [p2.left - p1.left, p2.top - p1.top];\n return {\n left: Math.round(elRegion.left - diff[0] + offset[0] - targetOffset[0]),\n top: Math.round(elRegion.top - diff[1] + offset[1] - targetOffset[1])\n };\n}\n\n/**\n * align dom node flexibly\n * @author yiminghe@gmail.com\n */\n\nfunction isFailX(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n}\n\nfunction isFailY(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.top < visibleRect.top || elFuturePos.top + elRegion.height > visibleRect.bottom;\n}\n\nfunction isCompleteFailX(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.left > visibleRect.right || elFuturePos.left + elRegion.width < visibleRect.left;\n}\n\nfunction isCompleteFailY(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.top > visibleRect.bottom || elFuturePos.top + elRegion.height < visibleRect.top;\n}\n\nfunction flip(points, reg, map) {\n var ret = [];\n utils.each(points, function (p) {\n ret.push(p.replace(reg, function (m) {\n return map[m];\n }));\n });\n return ret;\n}\n\nfunction flipOffset(offset, index) {\n offset[index] = -offset[index];\n return offset;\n}\n\nfunction convertOffset(str, offsetLen) {\n var n;\n\n if (/%$/.test(str)) {\n n = parseInt(str.substring(0, str.length - 1), 10) / 100 * offsetLen;\n } else {\n n = parseInt(str, 10);\n }\n\n return n || 0;\n}\n\nfunction normalizeOffset(offset, el) {\n offset[0] = convertOffset(offset[0], el.width);\n offset[1] = convertOffset(offset[1], el.height);\n}\n/**\n * @param el\n * @param tgtRegion 参照节点所占的区域: { left, top, width, height }\n * @param align\n */\n\n\nfunction doAlign(el, tgtRegion, align, isTgtRegionVisible) {\n var points = align.points;\n var offset = align.offset || [0, 0];\n var targetOffset = align.targetOffset || [0, 0];\n var overflow = align.overflow;\n var source = align.source || el;\n offset = [].concat(offset);\n targetOffset = [].concat(targetOffset);\n overflow = overflow || {};\n var newOverflowCfg = {};\n var fail = 0;\n var alwaysByViewport = !!(overflow && overflow.alwaysByViewport); // 当前节点可以被放置的显示区域\n\n var visibleRect = getVisibleRectForElement(source, alwaysByViewport); // 当前节点所占的区域, left/top/width/height\n\n var elRegion = getRegion(source); // 将 offset 转换成数值,支持百分比\n\n normalizeOffset(offset, elRegion);\n normalizeOffset(targetOffset, tgtRegion); // 当前节点将要被放置的位置\n\n var elFuturePos = getElFuturePos(elRegion, tgtRegion, points, offset, targetOffset); // 当前节点将要所处的区域\n\n var newElRegion = utils.merge(elRegion, elFuturePos); // 如果可视区域不能完全放置当前节点时允许调整\n\n if (visibleRect && (overflow.adjustX || overflow.adjustY) && isTgtRegionVisible) {\n if (overflow.adjustX) {\n // 如果横向不能放下\n if (isFailX(elFuturePos, elRegion, visibleRect)) {\n // 对齐位置反下\n var newPoints = flip(points, /[lr]/gi, {\n l: 'r',\n r: 'l'\n }); // 偏移量也反下\n\n var newOffset = flipOffset(offset, 0);\n var newTargetOffset = flipOffset(targetOffset, 0);\n var newElFuturePos = getElFuturePos(elRegion, tgtRegion, newPoints, newOffset, newTargetOffset);\n\n if (!isCompleteFailX(newElFuturePos, elRegion, visibleRect)) {\n fail = 1;\n points = newPoints;\n offset = newOffset;\n targetOffset = newTargetOffset;\n }\n }\n }\n\n if (overflow.adjustY) {\n // 如果纵向不能放下\n if (isFailY(elFuturePos, elRegion, visibleRect)) {\n // 对齐位置反下\n var _newPoints = flip(points, /[tb]/gi, {\n t: 'b',\n b: 't'\n }); // 偏移量也反下\n\n\n var _newOffset = flipOffset(offset, 1);\n\n var _newTargetOffset = flipOffset(targetOffset, 1);\n\n var _newElFuturePos = getElFuturePos(elRegion, tgtRegion, _newPoints, _newOffset, _newTargetOffset);\n\n if (!isCompleteFailY(_newElFuturePos, elRegion, visibleRect)) {\n fail = 1;\n points = _newPoints;\n offset = _newOffset;\n targetOffset = _newTargetOffset;\n }\n }\n } // 如果失败,重新计算当前节点将要被放置的位置\n\n\n if (fail) {\n elFuturePos = getElFuturePos(elRegion, tgtRegion, points, offset, targetOffset);\n utils.mix(newElRegion, elFuturePos);\n }\n\n var isStillFailX = isFailX(elFuturePos, elRegion, visibleRect);\n var isStillFailY = isFailY(elFuturePos, elRegion, visibleRect); // 检查反下后的位置是否可以放下了,如果仍然放不下:\n // 1. 复原修改过的定位参数\n\n if (isStillFailX || isStillFailY) {\n var _newPoints2 = points; // 重置对应部分的翻转逻辑\n\n if (isStillFailX) {\n _newPoints2 = flip(points, /[lr]/gi, {\n l: 'r',\n r: 'l'\n });\n }\n\n if (isStillFailY) {\n _newPoints2 = flip(points, /[tb]/gi, {\n t: 'b',\n b: 't'\n });\n }\n\n points = _newPoints2;\n offset = align.offset || [0, 0];\n targetOffset = align.targetOffset || [0, 0];\n } // 2. 只有指定了可以调整当前方向才调整\n\n\n newOverflowCfg.adjustX = overflow.adjustX && isStillFailX;\n newOverflowCfg.adjustY = overflow.adjustY && isStillFailY; // 确实要调整,甚至可能会调整高度宽度\n\n if (newOverflowCfg.adjustX || newOverflowCfg.adjustY) {\n newElRegion = adjustForViewport(elFuturePos, elRegion, visibleRect, newOverflowCfg);\n }\n } // need judge to in case set fixed with in css on height auto element\n\n\n if (newElRegion.width !== elRegion.width) {\n utils.css(source, 'width', utils.width(source) + newElRegion.width - elRegion.width);\n }\n\n if (newElRegion.height !== elRegion.height) {\n utils.css(source, 'height', utils.height(source) + newElRegion.height - elRegion.height);\n } // https://github.com/kissyteam/kissy/issues/190\n // 相对于屏幕位置没变,而 left/top 变了\n // 例如
\n\n\n utils.offset(source, {\n left: newElRegion.left,\n top: newElRegion.top\n }, {\n useCssRight: align.useCssRight,\n useCssBottom: align.useCssBottom,\n useCssTransform: align.useCssTransform,\n ignoreShake: align.ignoreShake\n });\n return {\n points: points,\n offset: offset,\n targetOffset: targetOffset,\n overflow: newOverflowCfg\n };\n}\n/**\n * 2012-04-26 yiminghe@gmail.com\n * - 优化智能对齐算法\n * - 慎用 resizeXX\n *\n * 2011-07-13 yiminghe@gmail.com note:\n * - 增加智能对齐,以及大小调整选项\n **/\n\nfunction isOutOfVisibleRect(target, alwaysByViewport) {\n var visibleRect = getVisibleRectForElement(target, alwaysByViewport);\n var targetRegion = getRegion(target);\n return !visibleRect || targetRegion.left + targetRegion.width <= visibleRect.left || targetRegion.top + targetRegion.height <= visibleRect.top || targetRegion.left >= visibleRect.right || targetRegion.top >= visibleRect.bottom;\n}\n\nfunction alignElement(el, refNode, align) {\n var target = align.target || refNode;\n var refNodeRegion = getRegion(target);\n var isTargetNotOutOfVisible = !isOutOfVisibleRect(target, align.overflow && align.overflow.alwaysByViewport);\n return doAlign(el, refNodeRegion, align, isTargetNotOutOfVisible);\n}\n\nalignElement.__getOffsetParent = getOffsetParent;\nalignElement.__getVisibleRectForElement = getVisibleRectForElement;\n\n/**\n * `tgtPoint`: { pageX, pageY } or { clientX, clientY }.\n * If client position provided, will internal convert to page position.\n */\n\nfunction alignPoint(el, tgtPoint, align) {\n var pageX;\n var pageY;\n var doc = utils.getDocument(el);\n var win = doc.defaultView || doc.parentWindow;\n var scrollX = utils.getWindowScrollLeft(win);\n var scrollY = utils.getWindowScrollTop(win);\n var viewportWidth = utils.viewportWidth(win);\n var viewportHeight = utils.viewportHeight(win);\n\n if ('pageX' in tgtPoint) {\n pageX = tgtPoint.pageX;\n } else {\n pageX = scrollX + tgtPoint.clientX;\n }\n\n if ('pageY' in tgtPoint) {\n pageY = tgtPoint.pageY;\n } else {\n pageY = scrollY + tgtPoint.clientY;\n }\n\n var tgtRegion = {\n left: pageX,\n top: pageY,\n width: 0,\n height: 0\n };\n var pointInView = pageX >= 0 && pageX <= scrollX + viewportWidth && pageY >= 0 && pageY <= scrollY + viewportHeight; // Provide default target point\n\n var points = [align.points[0], 'cc'];\n return doAlign(el, tgtRegion, _objectSpread2({}, align, {\n points: points\n }), pointInView);\n}\n\nexport default alignElement;\nexport { alignElement, alignPoint };\n//# sourceMappingURL=index.js.map\n","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport ResizeObserver from 'resize-observer-polyfill';\nimport contains from \"rc-util/es/Dom/contains\";\nexport function isSamePoint(prev, next) {\n if (prev === next) return true;\n if (!prev || !next) return false;\n\n if ('pageX' in next && 'pageY' in next) {\n return prev.pageX === next.pageX && prev.pageY === next.pageY;\n }\n\n if ('clientX' in next && 'clientY' in next) {\n return prev.clientX === next.clientX && prev.clientY === next.clientY;\n }\n\n return false;\n}\nexport function restoreFocus(activeElement, container) {\n // Focus back if is in the container\n if (activeElement !== document.activeElement && contains(container, activeElement) && typeof activeElement.focus === 'function') {\n activeElement.focus();\n }\n}\nexport function monitorResize(element, callback) {\n var prevWidth = null;\n var prevHeight = null;\n\n function onResize(_ref) {\n var _ref2 = _slicedToArray(_ref, 1),\n target = _ref2[0].target;\n\n if (!document.documentElement.contains(target)) return;\n\n var _target$getBoundingCl = target.getBoundingClientRect(),\n width = _target$getBoundingCl.width,\n height = _target$getBoundingCl.height;\n\n var fixedWidth = Math.floor(width);\n var fixedHeight = Math.floor(height);\n\n if (prevWidth !== fixedWidth || prevHeight !== fixedHeight) {\n // https://webkit.org/blog/9997/resizeobserver-in-webkit/\n Promise.resolve().then(function () {\n callback({\n width: fixedWidth,\n height: fixedHeight\n });\n });\n }\n\n prevWidth = fixedWidth;\n prevHeight = fixedHeight;\n }\n\n var resizeObserver = new ResizeObserver(onResize);\n\n if (element) {\n resizeObserver.observe(element);\n }\n\n return function () {\n resizeObserver.disconnect();\n };\n}","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\n\n/**\n * Removed props:\n * - childrenProps\n */\nimport React from 'react';\nimport { composeRef } from \"rc-util/es/ref\";\nimport isVisible from \"rc-util/es/Dom/isVisible\";\nimport { alignElement, alignPoint } from 'dom-align';\nimport addEventListener from \"rc-util/es/Dom/addEventListener\";\nimport { isSamePoint, restoreFocus, monitorResize } from './util';\nimport useBuffer from './hooks/useBuffer';\n\nfunction getElement(func) {\n if (typeof func !== 'function') return null;\n return func();\n}\n\nfunction getPoint(point) {\n if (_typeof(point) !== 'object' || !point) return null;\n return point;\n}\n\nvar Align = function Align(_ref, ref) {\n var children = _ref.children,\n disabled = _ref.disabled,\n target = _ref.target,\n align = _ref.align,\n onAlign = _ref.onAlign,\n monitorWindowResize = _ref.monitorWindowResize,\n _ref$monitorBufferTim = _ref.monitorBufferTime,\n monitorBufferTime = _ref$monitorBufferTim === void 0 ? 0 : _ref$monitorBufferTim;\n var cacheRef = React.useRef({});\n var nodeRef = React.useRef();\n var childNode = React.Children.only(children); // ===================== Align ======================\n // We save the props here to avoid closure makes props ood\n\n var forceAlignPropsRef = React.useRef({});\n forceAlignPropsRef.current.disabled = disabled;\n forceAlignPropsRef.current.target = target;\n forceAlignPropsRef.current.onAlign = onAlign;\n\n var _useBuffer = useBuffer(function () {\n var _forceAlignPropsRef$c = forceAlignPropsRef.current,\n latestDisabled = _forceAlignPropsRef$c.disabled,\n latestTarget = _forceAlignPropsRef$c.target;\n\n if (!latestDisabled && latestTarget) {\n var source = nodeRef.current;\n var result;\n var element = getElement(latestTarget);\n var point = getPoint(latestTarget);\n cacheRef.current.element = element;\n cacheRef.current.point = point; // IE lose focus after element realign\n // We should record activeElement and restore later\n\n var _document = document,\n activeElement = _document.activeElement; // We only align when element is visible\n\n if (element && isVisible(element)) {\n result = alignElement(source, element, align);\n } else if (point) {\n result = alignPoint(source, point, align);\n }\n\n restoreFocus(activeElement, source);\n\n if (onAlign && result) {\n onAlign(source, result);\n }\n\n return true;\n }\n\n return false;\n }, monitorBufferTime),\n _useBuffer2 = _slicedToArray(_useBuffer, 2),\n _forceAlign = _useBuffer2[0],\n cancelForceAlign = _useBuffer2[1]; // ===================== Effect =====================\n // Listen for target updated\n\n\n var resizeMonitor = React.useRef({\n cancel: function cancel() {}\n }); // Listen for source updated\n\n var sourceResizeMonitor = React.useRef({\n cancel: function cancel() {}\n });\n React.useEffect(function () {\n var element = getElement(target);\n var point = getPoint(target);\n\n if (nodeRef.current !== sourceResizeMonitor.current.element) {\n sourceResizeMonitor.current.cancel();\n sourceResizeMonitor.current.element = nodeRef.current;\n sourceResizeMonitor.current.cancel = monitorResize(nodeRef.current, _forceAlign);\n }\n\n if (cacheRef.current.element !== element || !isSamePoint(cacheRef.current.point, point)) {\n _forceAlign(); // Add resize observer\n\n\n if (resizeMonitor.current.element !== element) {\n resizeMonitor.current.cancel();\n resizeMonitor.current.element = element;\n resizeMonitor.current.cancel = monitorResize(element, _forceAlign);\n }\n }\n }); // Listen for disabled change\n\n React.useEffect(function () {\n if (!disabled) {\n _forceAlign();\n } else {\n cancelForceAlign();\n }\n }, [disabled]); // Listen for window resize\n\n var winResizeRef = React.useRef(null);\n React.useEffect(function () {\n if (monitorWindowResize) {\n if (!winResizeRef.current) {\n winResizeRef.current = addEventListener(window, 'resize', _forceAlign);\n }\n } else if (winResizeRef.current) {\n winResizeRef.current.remove();\n winResizeRef.current = null;\n }\n }, [monitorWindowResize]); // Clear all if unmount\n\n React.useEffect(function () {\n return function () {\n resizeMonitor.current.cancel();\n sourceResizeMonitor.current.cancel();\n if (winResizeRef.current) winResizeRef.current.remove();\n cancelForceAlign();\n };\n }, []); // ====================== Ref =======================\n\n React.useImperativeHandle(ref, function () {\n return {\n forceAlign: function forceAlign() {\n return _forceAlign(true);\n }\n };\n }); // ===================== Render =====================\n\n if (React.isValidElement(childNode)) {\n childNode = React.cloneElement(childNode, {\n ref: composeRef(childNode.ref, nodeRef)\n });\n }\n\n return childNode;\n};\n\nvar RefAlign = React.forwardRef(Align);\nRefAlign.displayName = 'Align';\nexport default RefAlign;","import React from 'react';\nexport default (function (callback, buffer) {\n var calledRef = React.useRef(false);\n var timeoutRef = React.useRef(null);\n\n function cancelTrigger() {\n window.clearTimeout(timeoutRef.current);\n }\n\n function trigger(force) {\n if (!calledRef.current || force === true) {\n if (callback() === false) {\n // Not delay since callback cancelled self\n return;\n }\n\n calledRef.current = true;\n cancelTrigger();\n timeoutRef.current = window.setTimeout(function () {\n calledRef.current = false;\n }, buffer);\n } else {\n cancelTrigger();\n timeoutRef.current = window.setTimeout(function () {\n calledRef.current = false;\n trigger();\n }, buffer);\n }\n }\n\n return [trigger, function () {\n calledRef.current = false;\n cancelTrigger();\n }];\n});","// export this package's api\nimport Align from './Align';\nexport default Align;","function asyncGeneratorStep(n, t, e, r, o, a, c) {\n try {\n var i = n[a](c),\n u = i.value;\n } catch (n) {\n return void e(n);\n }\n i.done ? t(u) : Promise.resolve(u).then(r, o);\n}\nfunction _asyncToGenerator(n) {\n return function () {\n var t = this,\n e = arguments;\n return new Promise(function (r, o) {\n var a = n.apply(t, e);\n function _next(n) {\n asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n);\n }\n function _throw(n) {\n asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n);\n }\n _next(void 0);\n });\n };\n}\nexport { _asyncToGenerator as default };","import _regeneratorRuntime from \"@babel/runtime/regenerator\";\nimport _asyncToGenerator from \"@babel/runtime/helpers/esm/asyncToGenerator\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport { useState, useEffect, useRef } from 'react';\nimport raf from \"rc-util/es/raf\";\nvar StatusQueue = ['measure', 'align', null, 'motion'];\nexport default (function (visible, doMeasure) {\n var _useState = useState(null),\n _useState2 = _slicedToArray(_useState, 2),\n status = _useState2[0],\n setStatus = _useState2[1];\n\n var rafRef = useRef();\n\n function cancelRaf() {\n raf.cancel(rafRef.current);\n }\n\n function goNextStatus(callback) {\n cancelRaf();\n rafRef.current = raf(function () {\n // Only align should be manually trigger\n setStatus(function (prev) {\n switch (status) {\n case 'align':\n return 'motion';\n\n case 'motion':\n return 'stable';\n }\n\n return prev;\n });\n callback === null || callback === void 0 ? void 0 : callback();\n });\n } // Init status\n\n\n useEffect(function () {\n setStatus('measure');\n }, [visible]); // Go next status\n\n useEffect(function () {\n switch (status) {\n case 'measure':\n doMeasure();\n break;\n }\n\n if (status) {\n rafRef.current = raf( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {\n var index, nextStatus;\n return _regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n index = StatusQueue.indexOf(status);\n nextStatus = StatusQueue[index + 1];\n\n if (nextStatus && index !== -1) {\n setStatus(nextStatus);\n }\n\n case 3:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n })));\n }\n }, [status]);\n useEffect(function () {\n return function () {\n cancelRaf();\n };\n }, []);\n return [status, goNextStatus];\n});","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport { useRef, useState } from 'react';\nimport Align from 'rc-align';\nimport CSSMotion from 'rc-motion';\nimport classNames from 'classnames';\nimport useVisibleStatus from './useVisibleStatus';\nimport { getMotion } from '../utils/legacyUtil';\nimport useStretchStyle from './useStretchStyle';\nvar PopupInner = React.forwardRef(function (props, ref) {\n var visible = props.visible,\n prefixCls = props.prefixCls,\n className = props.className,\n style = props.style,\n children = props.children,\n zIndex = props.zIndex,\n stretch = props.stretch,\n destroyPopupOnHide = props.destroyPopupOnHide,\n align = props.align,\n point = props.point,\n getRootDomNode = props.getRootDomNode,\n getClassNameFromAlign = props.getClassNameFromAlign,\n onAlign = props.onAlign,\n onMouseEnter = props.onMouseEnter,\n onMouseLeave = props.onMouseLeave,\n onMouseDown = props.onMouseDown,\n onTouchStart = props.onTouchStart;\n var alignRef = useRef();\n var elementRef = useRef();\n\n var _useState = useState(),\n _useState2 = _slicedToArray(_useState, 2),\n alignedClassName = _useState2[0],\n setAlignedClassName = _useState2[1]; // ======================= Measure ========================\n\n\n var _useStretchStyle = useStretchStyle(stretch),\n _useStretchStyle2 = _slicedToArray(_useStretchStyle, 2),\n stretchStyle = _useStretchStyle2[0],\n measureStretchStyle = _useStretchStyle2[1];\n\n function doMeasure() {\n if (stretch) {\n measureStretchStyle(getRootDomNode());\n }\n } // ======================== Status ========================\n\n\n var _useVisibleStatus = useVisibleStatus(visible, doMeasure),\n _useVisibleStatus2 = _slicedToArray(_useVisibleStatus, 2),\n status = _useVisibleStatus2[0],\n goNextStatus = _useVisibleStatus2[1]; // ======================== Aligns ========================\n\n\n var prepareResolveRef = useRef(); // `target` on `rc-align` can accept as a function to get the bind element or a point.\n // ref: https://www.npmjs.com/package/rc-align\n\n function getAlignTarget() {\n if (point) {\n return point;\n }\n\n return getRootDomNode;\n }\n\n function forceAlign() {\n var _alignRef$current;\n\n (_alignRef$current = alignRef.current) === null || _alignRef$current === void 0 ? void 0 : _alignRef$current.forceAlign();\n }\n\n function onInternalAlign(popupDomNode, matchAlign) {\n if (status === 'align') {\n var nextAlignedClassName = getClassNameFromAlign(matchAlign);\n setAlignedClassName(nextAlignedClassName); // Repeat until not more align needed\n\n if (alignedClassName !== nextAlignedClassName) {\n Promise.resolve().then(function () {\n forceAlign();\n });\n } else {\n goNextStatus(function () {\n var _prepareResolveRef$cu;\n\n (_prepareResolveRef$cu = prepareResolveRef.current) === null || _prepareResolveRef$cu === void 0 ? void 0 : _prepareResolveRef$cu.call(prepareResolveRef);\n });\n }\n\n onAlign === null || onAlign === void 0 ? void 0 : onAlign(popupDomNode, matchAlign);\n }\n } // ======================== Motion ========================\n\n\n var motion = _objectSpread({}, getMotion(props));\n\n ['onAppearEnd', 'onEnterEnd', 'onLeaveEnd'].forEach(function (eventName) {\n var originHandler = motion[eventName];\n\n motion[eventName] = function (element, event) {\n goNextStatus();\n return originHandler === null || originHandler === void 0 ? void 0 : originHandler(element, event);\n };\n });\n\n function onShowPrepare() {\n return new Promise(function (resolve) {\n prepareResolveRef.current = resolve;\n });\n } // Go to stable directly when motion not provided\n\n\n React.useEffect(function () {\n if (!motion.motionName && status === 'motion') {\n goNextStatus();\n }\n }, [motion.motionName, status]); // ========================= Refs =========================\n\n React.useImperativeHandle(ref, function () {\n return {\n forceAlign: forceAlign,\n getElement: function getElement() {\n return elementRef.current;\n }\n };\n }); // ======================== Render ========================\n\n var mergedStyle = _objectSpread(_objectSpread(_objectSpread({}, stretchStyle), {}, {\n zIndex: zIndex\n }, style), {}, {\n opacity: status === 'motion' || status === 'stable' || !visible ? undefined : 0,\n pointerEvents: status === 'stable' ? undefined : 'none'\n }); // Align status\n\n\n var alignDisabled = true;\n\n if ((align === null || align === void 0 ? void 0 : align.points) && (status === 'align' || status === 'stable')) {\n alignDisabled = false;\n }\n\n var childNode = children; // Wrapper when multiple children\n\n if (React.Children.count(children) > 1) {\n childNode = React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-content\")\n }, children);\n }\n\n return React.createElement(CSSMotion, Object.assign({\n visible: visible,\n ref: elementRef\n }, motion, {\n onAppearPrepare: onShowPrepare,\n onEnterPrepare: onShowPrepare,\n removeOnLeave: destroyPopupOnHide,\n leavedClassName: \"\".concat(prefixCls, \"-hidden\")\n }), function (_ref, motionRef) {\n var motionClassName = _ref.className,\n motionStyle = _ref.style;\n var mergedClassName = classNames(prefixCls, className, alignedClassName, motionClassName);\n return React.createElement(Align, {\n target: getAlignTarget(),\n key: \"popup\",\n ref: alignRef,\n monitorWindowResize: true,\n disabled: alignDisabled,\n align: align,\n onAlign: onInternalAlign\n }, React.createElement(\"div\", {\n ref: motionRef,\n className: mergedClassName,\n onMouseEnter: onMouseEnter,\n onMouseLeave: onMouseLeave,\n onMouseDown: onMouseDown,\n onTouchStart: onTouchStart,\n style: _objectSpread(_objectSpread({}, motionStyle), mergedStyle)\n }, childNode));\n });\n});\nPopupInner.displayName = 'PopupInner';\nexport default PopupInner;","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport React from 'react';\nexport default (function (stretch) {\n var _React$useState = React.useState({\n width: 0,\n height: 0\n }),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n targetSize = _React$useState2[0],\n setTargetSize = _React$useState2[1];\n\n function measureStretch(element) {\n setTargetSize({\n width: element.offsetWidth,\n height: element.offsetHeight\n });\n } // Merge stretch style\n\n\n var style = React.useMemo(function () {\n var sizeStyle = {};\n\n if (stretch) {\n var width = targetSize.width,\n height = targetSize.height; // Stretch with target\n\n if (stretch.indexOf('height') !== -1 && height) {\n sizeStyle.height = height;\n } else if (stretch.indexOf('minHeight') !== -1 && height) {\n sizeStyle.minHeight = height;\n }\n\n if (stretch.indexOf('width') !== -1 && width) {\n sizeStyle.width = width;\n } else if (stretch.indexOf('minWidth') !== -1 && width) {\n sizeStyle.minWidth = width;\n }\n }\n\n return sizeStyle;\n }, [stretch, targetSize]);\n return [style, measureStretch];\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport Mask from './Mask';\nimport PopupInner from './PopupInner';\nvar Popup = React.forwardRef(function (props, ref) {\n var cloneProps = _extends({}, props); // We can use fragment directly but this may failed some selector usage. Keep as origin logic\n\n\n return React.createElement(\"div\", null, React.createElement(Mask, Object.assign({}, cloneProps)), React.createElement(PopupInner, Object.assign({}, cloneProps, {\n ref: ref\n })));\n});\nPopup.displayName = 'Popup';\nexport default Popup;","import * as React from 'react';\nvar TriggerContext = React.createContext(null);\nexport default TriggerContext;","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _createSuper from \"@babel/runtime/helpers/esm/createSuper\";\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport raf from \"rc-util/es/raf\";\nimport contains from \"rc-util/es/Dom/contains\";\nimport findDOMNode from \"rc-util/es/Dom/findDOMNode\";\nimport { composeRef, supportRef } from \"rc-util/es/ref\";\nimport addEventListener from \"rc-util/es/Dom/addEventListener\";\nimport Portal from \"rc-util/es/Portal\";\nimport classNames from 'classnames';\nimport { getAlignFromPlacement, getAlignPopupClassName } from './utils/alignUtil';\nimport Popup from './Popup';\nimport TriggerContext from './context';\n\nfunction noop() {}\n\nfunction returnEmptyString() {\n return '';\n}\n\nfunction returnDocument() {\n return window.document;\n}\n\nvar ALL_HANDLERS = ['onClick', 'onMouseDown', 'onTouchStart', 'onMouseEnter', 'onMouseLeave', 'onFocus', 'onBlur', 'onContextMenu'];\n/**\n * Internal usage. Do not use in your code since this will be removed.\n */\n\nexport function generateTrigger(PortalComponent) {\n var Trigger = /*#__PURE__*/function (_React$Component) {\n _inherits(Trigger, _React$Component);\n\n var _super = _createSuper(Trigger);\n\n function Trigger(props) {\n var _this;\n\n _classCallCheck(this, Trigger);\n\n _this = _super.call(this, props);\n _this.popupRef = React.createRef();\n _this.triggerRef = React.createRef();\n\n _this.onMouseEnter = function (e) {\n var mouseEnterDelay = _this.props.mouseEnterDelay;\n\n _this.fireEvents('onMouseEnter', e);\n\n _this.delaySetPopupVisible(true, mouseEnterDelay, mouseEnterDelay ? null : e);\n };\n\n _this.onMouseMove = function (e) {\n _this.fireEvents('onMouseMove', e);\n\n _this.setPoint(e);\n };\n\n _this.onMouseLeave = function (e) {\n _this.fireEvents('onMouseLeave', e);\n\n _this.delaySetPopupVisible(false, _this.props.mouseLeaveDelay);\n };\n\n _this.onPopupMouseEnter = function () {\n _this.clearDelayTimer();\n };\n\n _this.onPopupMouseLeave = function (e) {\n var _this$popupRef$curren;\n\n // https://github.com/react-component/trigger/pull/13\n // react bug?\n if (e.relatedTarget && !e.relatedTarget.setTimeout && contains((_this$popupRef$curren = _this.popupRef.current) === null || _this$popupRef$curren === void 0 ? void 0 : _this$popupRef$curren.getElement(), e.relatedTarget)) {\n return;\n }\n\n _this.delaySetPopupVisible(false, _this.props.mouseLeaveDelay);\n };\n\n _this.onFocus = function (e) {\n _this.fireEvents('onFocus', e); // incase focusin and focusout\n\n\n _this.clearDelayTimer();\n\n if (_this.isFocusToShow()) {\n _this.focusTime = Date.now();\n\n _this.delaySetPopupVisible(true, _this.props.focusDelay);\n }\n };\n\n _this.onMouseDown = function (e) {\n _this.fireEvents('onMouseDown', e);\n\n _this.preClickTime = Date.now();\n };\n\n _this.onTouchStart = function (e) {\n _this.fireEvents('onTouchStart', e);\n\n _this.preTouchTime = Date.now();\n };\n\n _this.onBlur = function (e) {\n _this.fireEvents('onBlur', e);\n\n _this.clearDelayTimer();\n\n if (_this.isBlurToHide()) {\n _this.delaySetPopupVisible(false, _this.props.blurDelay);\n }\n };\n\n _this.onContextMenu = function (e) {\n e.preventDefault();\n\n _this.fireEvents('onContextMenu', e);\n\n _this.setPopupVisible(true, e);\n };\n\n _this.onContextMenuClose = function () {\n if (_this.isContextMenuToShow()) {\n _this.close();\n }\n };\n\n _this.onClick = function (event) {\n _this.fireEvents('onClick', event); // focus will trigger click\n\n\n if (_this.focusTime) {\n var preTime;\n\n if (_this.preClickTime && _this.preTouchTime) {\n preTime = Math.min(_this.preClickTime, _this.preTouchTime);\n } else if (_this.preClickTime) {\n preTime = _this.preClickTime;\n } else if (_this.preTouchTime) {\n preTime = _this.preTouchTime;\n }\n\n if (Math.abs(preTime - _this.focusTime) < 20) {\n return;\n }\n\n _this.focusTime = 0;\n }\n\n _this.preClickTime = 0;\n _this.preTouchTime = 0; // Only prevent default when all the action is click.\n // https://github.com/ant-design/ant-design/issues/17043\n // https://github.com/ant-design/ant-design/issues/17291\n\n if (_this.isClickToShow() && (_this.isClickToHide() || _this.isBlurToHide()) && event && event.preventDefault) {\n event.preventDefault();\n }\n\n var nextVisible = !_this.state.popupVisible;\n\n if (_this.isClickToHide() && !nextVisible || nextVisible && _this.isClickToShow()) {\n _this.setPopupVisible(!_this.state.popupVisible, event);\n }\n };\n\n _this.onPopupMouseDown = function () {\n _this.hasPopupMouseDown = true;\n clearTimeout(_this.mouseDownTimeout);\n _this.mouseDownTimeout = window.setTimeout(function () {\n _this.hasPopupMouseDown = false;\n }, 0);\n\n if (_this.context) {\n var _this$context;\n\n (_this$context = _this.context).onPopupMouseDown.apply(_this$context, arguments);\n }\n };\n\n _this.onDocumentClick = function (event) {\n if (_this.props.mask && !_this.props.maskClosable) {\n return;\n }\n\n var target = event.target;\n\n var root = _this.getRootDomNode();\n\n var popupNode = _this.getPopupDomNode();\n\n if (!contains(root, target) && !contains(popupNode, target) && !_this.hasPopupMouseDown) {\n _this.close();\n }\n };\n\n _this.getRootDomNode = function () {\n var getTriggerDOMNode = _this.props.getTriggerDOMNode;\n\n if (getTriggerDOMNode) {\n return getTriggerDOMNode(_this.triggerRef.current);\n }\n\n try {\n var domNode = findDOMNode(_this.triggerRef.current);\n\n if (domNode) {\n return domNode;\n }\n } catch (err) {// Do nothing\n }\n\n return ReactDOM.findDOMNode(_assertThisInitialized(_this));\n };\n\n _this.getPopupClassNameFromAlign = function (align) {\n var className = [];\n var _this$props = _this.props,\n popupPlacement = _this$props.popupPlacement,\n builtinPlacements = _this$props.builtinPlacements,\n prefixCls = _this$props.prefixCls,\n alignPoint = _this$props.alignPoint,\n getPopupClassNameFromAlign = _this$props.getPopupClassNameFromAlign;\n\n if (popupPlacement && builtinPlacements) {\n className.push(getAlignPopupClassName(builtinPlacements, prefixCls, align, alignPoint));\n }\n\n if (getPopupClassNameFromAlign) {\n className.push(getPopupClassNameFromAlign(align));\n }\n\n return className.join(' ');\n };\n\n _this.getComponent = function () {\n var _this$props2 = _this.props,\n prefixCls = _this$props2.prefixCls,\n destroyPopupOnHide = _this$props2.destroyPopupOnHide,\n popupClassName = _this$props2.popupClassName,\n onPopupAlign = _this$props2.onPopupAlign,\n popupMotion = _this$props2.popupMotion,\n popupAnimation = _this$props2.popupAnimation,\n popupTransitionName = _this$props2.popupTransitionName,\n popupStyle = _this$props2.popupStyle,\n mask = _this$props2.mask,\n maskAnimation = _this$props2.maskAnimation,\n maskTransitionName = _this$props2.maskTransitionName,\n maskMotion = _this$props2.maskMotion,\n zIndex = _this$props2.zIndex,\n popup = _this$props2.popup,\n stretch = _this$props2.stretch,\n alignPoint = _this$props2.alignPoint;\n var _this$state = _this.state,\n popupVisible = _this$state.popupVisible,\n point = _this$state.point;\n\n var align = _this.getPopupAlign();\n\n var mouseProps = {};\n\n if (_this.isMouseEnterToShow()) {\n mouseProps.onMouseEnter = _this.onPopupMouseEnter;\n }\n\n if (_this.isMouseLeaveToHide()) {\n mouseProps.onMouseLeave = _this.onPopupMouseLeave;\n }\n\n mouseProps.onMouseDown = _this.onPopupMouseDown;\n mouseProps.onTouchStart = _this.onPopupMouseDown;\n return React.createElement(Popup, Object.assign({\n prefixCls: prefixCls,\n destroyPopupOnHide: destroyPopupOnHide,\n visible: popupVisible,\n point: alignPoint && point,\n className: popupClassName,\n align: align,\n onAlign: onPopupAlign,\n animation: popupAnimation,\n getClassNameFromAlign: _this.getPopupClassNameFromAlign\n }, mouseProps, {\n stretch: stretch,\n getRootDomNode: _this.getRootDomNode,\n style: popupStyle,\n mask: mask,\n zIndex: zIndex,\n transitionName: popupTransitionName,\n maskAnimation: maskAnimation,\n maskTransitionName: maskTransitionName,\n maskMotion: maskMotion,\n ref: _this.popupRef,\n motion: popupMotion\n }), typeof popup === 'function' ? popup() : popup);\n };\n\n _this.attachParent = function (popupContainer) {\n raf.cancel(_this.attachId);\n var _this$props3 = _this.props,\n getPopupContainer = _this$props3.getPopupContainer,\n getDocument = _this$props3.getDocument;\n\n var domNode = _this.getRootDomNode();\n\n var mountNode;\n\n if (!getPopupContainer) {\n mountNode = getDocument().body;\n } else if (domNode || getPopupContainer.length === 0) {\n // Compatible for legacy getPopupContainer with domNode argument.\n // If no need `domNode` argument, will call directly.\n // https://codesandbox.io/s/eloquent-mclean-ss93m?file=/src/App.js\n mountNode = getPopupContainer(domNode);\n }\n\n if (mountNode) {\n mountNode.appendChild(popupContainer);\n } else {\n // Retry after frame render in case parent not ready\n _this.attachId = raf(function () {\n _this.attachParent(popupContainer);\n });\n }\n };\n\n _this.getContainer = function () {\n var popupContainer = document.createElement('div'); // Make sure default popup container will never cause scrollbar appearing\n // https://github.com/react-component/trigger/issues/41\n\n popupContainer.style.position = 'absolute';\n popupContainer.style.top = '0';\n popupContainer.style.left = '0';\n popupContainer.style.width = '100%';\n\n _this.attachParent(popupContainer);\n\n return popupContainer;\n };\n\n _this.setPoint = function (point) {\n var alignPoint = _this.props.alignPoint;\n if (!alignPoint || !point) return;\n\n _this.setState({\n point: {\n pageX: point.pageX,\n pageY: point.pageY\n }\n });\n };\n\n _this.handlePortalUpdate = function () {\n if (_this.state.prevPopupVisible !== _this.state.popupVisible) {\n _this.props.afterPopupVisibleChange(_this.state.popupVisible);\n }\n };\n\n var popupVisible;\n\n if ('popupVisible' in props) {\n popupVisible = !!props.popupVisible;\n } else {\n popupVisible = !!props.defaultPopupVisible;\n }\n\n _this.state = {\n prevPopupVisible: popupVisible,\n popupVisible: popupVisible\n };\n ALL_HANDLERS.forEach(function (h) {\n _this[\"fire\".concat(h)] = function (e) {\n _this.fireEvents(h, e);\n };\n });\n return _this;\n }\n\n _createClass(Trigger, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.componentDidUpdate();\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate() {\n var props = this.props;\n var state = this.state; // We must listen to `mousedown` or `touchstart`, edge case:\n // https://github.com/ant-design/ant-design/issues/5804\n // https://github.com/react-component/calendar/issues/250\n // https://github.com/react-component/trigger/issues/50\n\n if (state.popupVisible) {\n var currentDocument;\n\n if (!this.clickOutsideHandler && (this.isClickToHide() || this.isContextMenuToShow())) {\n currentDocument = props.getDocument();\n this.clickOutsideHandler = addEventListener(currentDocument, 'mousedown', this.onDocumentClick);\n } // always hide on mobile\n\n\n if (!this.touchOutsideHandler) {\n currentDocument = currentDocument || props.getDocument();\n this.touchOutsideHandler = addEventListener(currentDocument, 'touchstart', this.onDocumentClick);\n } // close popup when trigger type contains 'onContextMenu' and document is scrolling.\n\n\n if (!this.contextMenuOutsideHandler1 && this.isContextMenuToShow()) {\n currentDocument = currentDocument || props.getDocument();\n this.contextMenuOutsideHandler1 = addEventListener(currentDocument, 'scroll', this.onContextMenuClose);\n } // close popup when trigger type contains 'onContextMenu' and window is blur.\n\n\n if (!this.contextMenuOutsideHandler2 && this.isContextMenuToShow()) {\n this.contextMenuOutsideHandler2 = addEventListener(window, 'blur', this.onContextMenuClose);\n }\n\n return;\n }\n\n this.clearOutsideHandler();\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.clearDelayTimer();\n this.clearOutsideHandler();\n clearTimeout(this.mouseDownTimeout);\n raf.cancel(this.attachId);\n }\n }, {\n key: \"getPopupDomNode\",\n value: function getPopupDomNode() {\n var _this$popupRef$curren2;\n\n // for test\n return ((_this$popupRef$curren2 = this.popupRef.current) === null || _this$popupRef$curren2 === void 0 ? void 0 : _this$popupRef$curren2.getElement()) || null;\n }\n }, {\n key: \"getPopupAlign\",\n value: function getPopupAlign() {\n var props = this.props;\n var popupPlacement = props.popupPlacement,\n popupAlign = props.popupAlign,\n builtinPlacements = props.builtinPlacements;\n\n if (popupPlacement && builtinPlacements) {\n return getAlignFromPlacement(builtinPlacements, popupPlacement, popupAlign);\n }\n\n return popupAlign;\n }\n /**\n * @param popupVisible Show or not the popup element\n * @param event SyntheticEvent, used for `pointAlign`\n */\n\n }, {\n key: \"setPopupVisible\",\n value: function setPopupVisible(popupVisible, event) {\n var alignPoint = this.props.alignPoint;\n var prevPopupVisible = this.state.popupVisible;\n this.clearDelayTimer();\n\n if (prevPopupVisible !== popupVisible) {\n if (!('popupVisible' in this.props)) {\n this.setState({\n popupVisible: popupVisible,\n prevPopupVisible: prevPopupVisible\n });\n }\n\n this.props.onPopupVisibleChange(popupVisible);\n } // Always record the point position since mouseEnterDelay will delay the show\n\n\n if (alignPoint && event && popupVisible) {\n this.setPoint(event);\n }\n }\n }, {\n key: \"delaySetPopupVisible\",\n value: function delaySetPopupVisible(visible, delayS, event) {\n var _this2 = this;\n\n var delay = delayS * 1000;\n this.clearDelayTimer();\n\n if (delay) {\n var point = event ? {\n pageX: event.pageX,\n pageY: event.pageY\n } : null;\n this.delayTimer = window.setTimeout(function () {\n _this2.setPopupVisible(visible, point);\n\n _this2.clearDelayTimer();\n }, delay);\n } else {\n this.setPopupVisible(visible, event);\n }\n }\n }, {\n key: \"clearDelayTimer\",\n value: function clearDelayTimer() {\n if (this.delayTimer) {\n clearTimeout(this.delayTimer);\n this.delayTimer = null;\n }\n }\n }, {\n key: \"clearOutsideHandler\",\n value: function clearOutsideHandler() {\n if (this.clickOutsideHandler) {\n this.clickOutsideHandler.remove();\n this.clickOutsideHandler = null;\n }\n\n if (this.contextMenuOutsideHandler1) {\n this.contextMenuOutsideHandler1.remove();\n this.contextMenuOutsideHandler1 = null;\n }\n\n if (this.contextMenuOutsideHandler2) {\n this.contextMenuOutsideHandler2.remove();\n this.contextMenuOutsideHandler2 = null;\n }\n\n if (this.touchOutsideHandler) {\n this.touchOutsideHandler.remove();\n this.touchOutsideHandler = null;\n }\n }\n }, {\n key: \"createTwoChains\",\n value: function createTwoChains(event) {\n var childPros = this.props.children.props;\n var props = this.props;\n\n if (childPros[event] && props[event]) {\n return this[\"fire\".concat(event)];\n }\n\n return childPros[event] || props[event];\n }\n }, {\n key: \"isClickToShow\",\n value: function isClickToShow() {\n var _this$props4 = this.props,\n action = _this$props4.action,\n showAction = _this$props4.showAction;\n return action.indexOf('click') !== -1 || showAction.indexOf('click') !== -1;\n }\n }, {\n key: \"isContextMenuToShow\",\n value: function isContextMenuToShow() {\n var _this$props5 = this.props,\n action = _this$props5.action,\n showAction = _this$props5.showAction;\n return action.indexOf('contextMenu') !== -1 || showAction.indexOf('contextMenu') !== -1;\n }\n }, {\n key: \"isClickToHide\",\n value: function isClickToHide() {\n var _this$props6 = this.props,\n action = _this$props6.action,\n hideAction = _this$props6.hideAction;\n return action.indexOf('click') !== -1 || hideAction.indexOf('click') !== -1;\n }\n }, {\n key: \"isMouseEnterToShow\",\n value: function isMouseEnterToShow() {\n var _this$props7 = this.props,\n action = _this$props7.action,\n showAction = _this$props7.showAction;\n return action.indexOf('hover') !== -1 || showAction.indexOf('mouseEnter') !== -1;\n }\n }, {\n key: \"isMouseLeaveToHide\",\n value: function isMouseLeaveToHide() {\n var _this$props8 = this.props,\n action = _this$props8.action,\n hideAction = _this$props8.hideAction;\n return action.indexOf('hover') !== -1 || hideAction.indexOf('mouseLeave') !== -1;\n }\n }, {\n key: \"isFocusToShow\",\n value: function isFocusToShow() {\n var _this$props9 = this.props,\n action = _this$props9.action,\n showAction = _this$props9.showAction;\n return action.indexOf('focus') !== -1 || showAction.indexOf('focus') !== -1;\n }\n }, {\n key: \"isBlurToHide\",\n value: function isBlurToHide() {\n var _this$props10 = this.props,\n action = _this$props10.action,\n hideAction = _this$props10.hideAction;\n return action.indexOf('focus') !== -1 || hideAction.indexOf('blur') !== -1;\n }\n }, {\n key: \"forcePopupAlign\",\n value: function forcePopupAlign() {\n if (this.state.popupVisible) {\n var _this$popupRef$curren3;\n\n (_this$popupRef$curren3 = this.popupRef.current) === null || _this$popupRef$curren3 === void 0 ? void 0 : _this$popupRef$curren3.forceAlign();\n }\n }\n }, {\n key: \"fireEvents\",\n value: function fireEvents(type, e) {\n var childCallback = this.props.children.props[type];\n\n if (childCallback) {\n childCallback(e);\n }\n\n var callback = this.props[type];\n\n if (callback) {\n callback(e);\n }\n }\n }, {\n key: \"close\",\n value: function close() {\n this.setPopupVisible(false);\n }\n }, {\n key: \"render\",\n value: function render() {\n var popupVisible = this.state.popupVisible;\n var _this$props11 = this.props,\n children = _this$props11.children,\n forceRender = _this$props11.forceRender,\n alignPoint = _this$props11.alignPoint,\n className = _this$props11.className,\n autoDestroy = _this$props11.autoDestroy;\n var child = React.Children.only(children);\n var newChildProps = {\n key: 'trigger'\n };\n\n if (this.isContextMenuToShow()) {\n newChildProps.onContextMenu = this.onContextMenu;\n } else {\n newChildProps.onContextMenu = this.createTwoChains('onContextMenu');\n }\n\n if (this.isClickToHide() || this.isClickToShow()) {\n newChildProps.onClick = this.onClick;\n newChildProps.onMouseDown = this.onMouseDown;\n newChildProps.onTouchStart = this.onTouchStart;\n } else {\n newChildProps.onClick = this.createTwoChains('onClick');\n newChildProps.onMouseDown = this.createTwoChains('onMouseDown');\n newChildProps.onTouchStart = this.createTwoChains('onTouchStart');\n }\n\n if (this.isMouseEnterToShow()) {\n newChildProps.onMouseEnter = this.onMouseEnter;\n\n if (alignPoint) {\n newChildProps.onMouseMove = this.onMouseMove;\n }\n } else {\n newChildProps.onMouseEnter = this.createTwoChains('onMouseEnter');\n }\n\n if (this.isMouseLeaveToHide()) {\n newChildProps.onMouseLeave = this.onMouseLeave;\n } else {\n newChildProps.onMouseLeave = this.createTwoChains('onMouseLeave');\n }\n\n if (this.isFocusToShow() || this.isBlurToHide()) {\n newChildProps.onFocus = this.onFocus;\n newChildProps.onBlur = this.onBlur;\n } else {\n newChildProps.onFocus = this.createTwoChains('onFocus');\n newChildProps.onBlur = this.createTwoChains('onBlur');\n }\n\n var childrenClassName = classNames(child && child.props && child.props.className, className);\n\n if (childrenClassName) {\n newChildProps.className = childrenClassName;\n }\n\n var cloneProps = _objectSpread({}, newChildProps);\n\n if (supportRef(child)) {\n cloneProps.ref = composeRef(this.triggerRef, child.ref);\n }\n\n var trigger = React.cloneElement(child, cloneProps);\n var portal; // prevent unmounting after it's rendered\n\n if (popupVisible || this.popupRef.current || forceRender) {\n portal = React.createElement(PortalComponent, {\n key: \"portal\",\n getContainer: this.getContainer,\n didUpdate: this.handlePortalUpdate\n }, this.getComponent());\n }\n\n if (!popupVisible && autoDestroy) {\n portal = null;\n }\n\n return React.createElement(TriggerContext.Provider, {\n value: {\n onPopupMouseDown: this.onPopupMouseDown\n }\n }, trigger, portal);\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(_ref, prevState) {\n var popupVisible = _ref.popupVisible;\n var newState = {};\n\n if (popupVisible !== undefined && prevState.popupVisible !== popupVisible) {\n newState.popupVisible = popupVisible;\n newState.prevPopupVisible = prevState.popupVisible;\n }\n\n return newState;\n }\n }]);\n\n return Trigger;\n }(React.Component);\n\n Trigger.contextType = TriggerContext;\n Trigger.defaultProps = {\n prefixCls: 'rc-trigger-popup',\n getPopupClassNameFromAlign: returnEmptyString,\n getDocument: returnDocument,\n onPopupVisibleChange: noop,\n afterPopupVisibleChange: noop,\n onPopupAlign: noop,\n popupClassName: '',\n mouseEnterDelay: 0,\n mouseLeaveDelay: 0.1,\n focusDelay: 0,\n blurDelay: 0.15,\n popupStyle: {},\n destroyPopupOnHide: false,\n popupAlign: {},\n defaultPopupVisible: false,\n mask: false,\n maskClosable: true,\n action: [],\n showAction: [],\n hideAction: [],\n autoDestroy: false\n };\n return Trigger;\n}\nexport default generateTrigger(Portal);","var autoAdjustOverflow = {\n adjustX: 1,\n adjustY: 1\n};\nvar targetOffset = [0, 0];\nexport var placements = {\n left: {\n points: ['cr', 'cl'],\n overflow: autoAdjustOverflow,\n offset: [-4, 0],\n targetOffset: targetOffset\n },\n right: {\n points: ['cl', 'cr'],\n overflow: autoAdjustOverflow,\n offset: [4, 0],\n targetOffset: targetOffset\n },\n top: {\n points: ['bc', 'tc'],\n overflow: autoAdjustOverflow,\n offset: [0, -4],\n targetOffset: targetOffset\n },\n bottom: {\n points: ['tc', 'bc'],\n overflow: autoAdjustOverflow,\n offset: [0, 4],\n targetOffset: targetOffset\n },\n topLeft: {\n points: ['bl', 'tl'],\n overflow: autoAdjustOverflow,\n offset: [0, -4],\n targetOffset: targetOffset\n },\n leftTop: {\n points: ['tr', 'tl'],\n overflow: autoAdjustOverflow,\n offset: [-4, 0],\n targetOffset: targetOffset\n },\n topRight: {\n points: ['br', 'tr'],\n overflow: autoAdjustOverflow,\n offset: [0, -4],\n targetOffset: targetOffset\n },\n rightTop: {\n points: ['tl', 'tr'],\n overflow: autoAdjustOverflow,\n offset: [4, 0],\n targetOffset: targetOffset\n },\n bottomRight: {\n points: ['tr', 'br'],\n overflow: autoAdjustOverflow,\n offset: [0, 4],\n targetOffset: targetOffset\n },\n rightBottom: {\n points: ['bl', 'br'],\n overflow: autoAdjustOverflow,\n offset: [4, 0],\n targetOffset: targetOffset\n },\n bottomLeft: {\n points: ['tl', 'bl'],\n overflow: autoAdjustOverflow,\n offset: [0, 4],\n targetOffset: targetOffset\n },\n leftBottom: {\n points: ['br', 'bl'],\n overflow: autoAdjustOverflow,\n offset: [-4, 0],\n targetOffset: targetOffset\n }\n};\nexport default placements;","import * as React from 'react';\n\nvar Content = function Content(props) {\n var overlay = props.overlay,\n prefixCls = props.prefixCls,\n id = props.id,\n overlayInnerStyle = props.overlayInnerStyle;\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-inner\"),\n id: id,\n role: \"tooltip\",\n style: overlayInnerStyle\n }, typeof overlay === 'function' ? overlay() : overlay);\n};\n\nexport default Content;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport * as React from 'react';\nimport { useRef, useImperativeHandle, forwardRef } from 'react';\nimport Trigger from 'rc-trigger';\nimport { placements } from './placements';\nimport Content from './Content';\n\nvar Tooltip = function Tooltip(props, ref) {\n var overlayClassName = props.overlayClassName,\n _props$trigger = props.trigger,\n trigger = _props$trigger === void 0 ? ['hover'] : _props$trigger,\n _props$mouseEnterDela = props.mouseEnterDelay,\n mouseEnterDelay = _props$mouseEnterDela === void 0 ? 0 : _props$mouseEnterDela,\n _props$mouseLeaveDela = props.mouseLeaveDelay,\n mouseLeaveDelay = _props$mouseLeaveDela === void 0 ? 0.1 : _props$mouseLeaveDela,\n overlayStyle = props.overlayStyle,\n _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? 'rc-tooltip' : _props$prefixCls,\n children = props.children,\n onVisibleChange = props.onVisibleChange,\n afterVisibleChange = props.afterVisibleChange,\n transitionName = props.transitionName,\n animation = props.animation,\n motion = props.motion,\n _props$placement = props.placement,\n placement = _props$placement === void 0 ? 'right' : _props$placement,\n _props$align = props.align,\n align = _props$align === void 0 ? {} : _props$align,\n _props$destroyTooltip = props.destroyTooltipOnHide,\n destroyTooltipOnHide = _props$destroyTooltip === void 0 ? false : _props$destroyTooltip,\n defaultVisible = props.defaultVisible,\n getTooltipContainer = props.getTooltipContainer,\n overlayInnerStyle = props.overlayInnerStyle,\n restProps = _objectWithoutProperties(props, [\"overlayClassName\", \"trigger\", \"mouseEnterDelay\", \"mouseLeaveDelay\", \"overlayStyle\", \"prefixCls\", \"children\", \"onVisibleChange\", \"afterVisibleChange\", \"transitionName\", \"animation\", \"motion\", \"placement\", \"align\", \"destroyTooltipOnHide\", \"defaultVisible\", \"getTooltipContainer\", \"overlayInnerStyle\"]);\n\n var domRef = useRef(null);\n useImperativeHandle(ref, function () {\n return domRef.current;\n });\n\n var extraProps = _objectSpread({}, restProps);\n\n if ('visible' in props) {\n extraProps.popupVisible = props.visible;\n }\n\n var getPopupElement = function getPopupElement() {\n var _props$arrowContent = props.arrowContent,\n arrowContent = _props$arrowContent === void 0 ? null : _props$arrowContent,\n overlay = props.overlay,\n id = props.id;\n return [/*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-arrow\"),\n key: \"arrow\"\n }, arrowContent), /*#__PURE__*/React.createElement(Content, {\n key: \"content\",\n prefixCls: prefixCls,\n id: id,\n overlay: overlay,\n overlayInnerStyle: overlayInnerStyle\n })];\n };\n\n var destroyTooltip = false;\n var autoDestroy = false;\n\n if (typeof destroyTooltipOnHide === 'boolean') {\n destroyTooltip = destroyTooltipOnHide;\n } else if (destroyTooltipOnHide && _typeof(destroyTooltipOnHide) === 'object') {\n var keepParent = destroyTooltipOnHide.keepParent;\n destroyTooltip = keepParent === true;\n autoDestroy = keepParent === false;\n }\n\n return /*#__PURE__*/React.createElement(Trigger, _extends({\n popupClassName: overlayClassName,\n prefixCls: prefixCls,\n popup: getPopupElement,\n action: trigger,\n builtinPlacements: placements,\n popupPlacement: placement,\n ref: domRef,\n popupAlign: align,\n getPopupContainer: getTooltipContainer,\n onPopupVisibleChange: onVisibleChange,\n afterPopupVisibleChange: afterVisibleChange,\n popupTransitionName: transitionName,\n popupAnimation: animation,\n popupMotion: motion,\n defaultPopupVisible: defaultVisible,\n destroyPopupOnHide: destroyTooltip,\n autoDestroy: autoDestroy,\n mouseLeaveDelay: mouseLeaveDelay,\n popupStyle: overlayStyle,\n mouseEnterDelay: mouseEnterDelay\n }, extraProps), children);\n};\n\nexport default /*#__PURE__*/forwardRef(Tooltip);","import Tooltip from './Tooltip';\nexport default Tooltip;","import { createElement, Component, Fragment, useEffect } from 'react';\nimport { createPortal } from 'react-dom';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\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\nfunction __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\nvar __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};\n\nfunction styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nvar css = \"/*\\n code is extracted from Calendly's embed stylesheet: https://assets.calendly.com/assets/external/widget.css\\n*/\\n\\n.calendly-inline-widget,\\n.calendly-inline-widget *,\\n.calendly-badge-widget,\\n.calendly-badge-widget *,\\n.calendly-overlay,\\n.calendly-overlay * {\\n font-size:16px;\\n line-height:1.2em\\n}\\n\\n.calendly-inline-widget iframe,\\n.calendly-badge-widget iframe,\\n.calendly-overlay iframe {\\n display:inline;\\n width:100%;\\n height:100%\\n}\\n\\n.calendly-popup-content {\\n position:relative\\n}\\n\\n.calendly-popup-content.calendly-mobile {\\n -webkit-overflow-scrolling:touch;\\n overflow-y:auto\\n}\\n\\n.calendly-overlay {\\n position:fixed;\\n top:0;\\n left:0;\\n right:0;\\n bottom:0;\\n overflow:hidden;\\n z-index:9999;\\n background-color:#a5a5a5;\\n background-color:rgba(31,31,31,0.4)\\n}\\n\\n.calendly-overlay .calendly-close-overlay {\\n position:absolute;\\n top:0;\\n left:0;\\n right:0;\\n bottom:0\\n}\\n\\n.calendly-overlay .calendly-popup {\\n box-sizing:border-box;\\n position:absolute;\\n top:50%;\\n left:50%;\\n -webkit-transform:translateY(-50%) translateX(-50%);\\n transform:translateY(-50%) translateX(-50%);\\n width:80%;\\n min-width:900px;\\n max-width:1000px;\\n height:90%;\\n max-height:680px\\n}\\n\\n@media (max-width: 975px) {\\n .calendly-overlay .calendly-popup {\\n position:fixed;\\n top:50px;\\n left:0;\\n right:0;\\n bottom:0;\\n -webkit-transform:none;\\n transform:none;\\n width:100%;\\n height:auto;\\n min-width:0;\\n max-height:none\\n }\\n}\\n\\n.calendly-overlay .calendly-popup .calendly-popup-content {\\n height:100%;\\n}\\n\\n.calendly-overlay .calendly-popup-close {\\n position:absolute;\\n top:25px;\\n right:25px;\\n color:#fff;\\n width:19px;\\n height:19px;\\n cursor:pointer;\\n background:url(https://assets.calendly.com/assets/external/close-icon.svg) no-repeat;\\n background-size:contain\\n}\\n\\n@media (max-width: 975px) {\\n .calendly-overlay .calendly-popup-close {\\n top:15px;\\n right:15px\\n }\\n}\\n\\n.calendly-badge-widget {\\n position:fixed;\\n right:20px;\\n bottom:15px;\\n z-index:9998\\n}\\n\\n.calendly-badge-widget .calendly-badge-content {\\n display:table-cell;\\n width:auto;\\n height:45px;\\n padding:0 30px;\\n border-radius:25px;\\n box-shadow:rgba(0,0,0,0.25) 0 2px 5px;\\n font-family:sans-serif;\\n text-align:center;\\n vertical-align:middle;\\n font-weight:bold;\\n font-size:14px;\\n color:#fff;\\n cursor:pointer\\n}\\n\\n.calendly-badge-widget .calendly-badge-content.calendly-white {\\n color:#666a73\\n}\\n\\n.calendly-badge-widget .calendly-badge-content span {\\n display:block;\\n font-size:12px\\n}\\n\\n.calendly-spinner {\\n position:absolute;\\n top:50%;\\n left:0;\\n right:0;\\n -webkit-transform:translateY(-50%);\\n transform:translateY(-50%);\\n text-align:center;\\n z-index:-1\\n}\\n\\n.calendly-spinner>div {\\n display:inline-block;\\n width:18px;\\n height:18px;\\n background-color:#e1e1e1;\\n border-radius:50%;\\n vertical-align:middle;\\n -webkit-animation:calendly-bouncedelay 1.4s infinite ease-in-out;\\n animation:calendly-bouncedelay 1.4s infinite ease-in-out;\\n -webkit-animation-fill-mode:both;\\n animation-fill-mode:both\\n}\\n\\n.calendly-spinner .calendly-bounce1 {\\n -webkit-animation-delay:-0.32s;\\n animation-delay:-0.32s\\n}\\n\\n.calendly-spinner .calendly-bounce2 {\\n -webkit-animation-delay:-0.16s;\\n animation-delay:-0.16s\\n}\\n\\n@-webkit-keyframes calendly-bouncedelay {\\n 0%,80%,100% {\\n -webkit-transform:scale(0);\\n transform:scale(0)\\n } \\n \\n 40%{\\n -webkit-transform:scale(1);\\n transform:scale(1)\\n }\\n}\\n\\n@keyframes calendly-bouncedelay{ \\n 0%,80%,100% {\\n -webkit-transform:scale(0);\\n transform:scale(0)\\n }\\n \\n 40% {\\n -webkit-transform:scale(1);\\n transform:scale(1)\\n }\\n}\";\nstyleInject(css);\n\nvar CalendlyEvent;\n(function (CalendlyEvent) {\n CalendlyEvent[\"PROFILE_PAGE_VIEWED\"] = \"calendly.profile_page_viewed\";\n CalendlyEvent[\"EVENT_TYPE_VIEWED\"] = \"calendly.event_type_viewed\";\n CalendlyEvent[\"DATE_AND_TIME_SELECTED\"] = \"calendly.date_and_time_selected\";\n CalendlyEvent[\"EVENT_SCHEDULED\"] = \"calendly.event_scheduled\";\n})(CalendlyEvent || (CalendlyEvent = {}));\nvar formatCalendlyUrl = function (_a) {\n var url = _a.url, _b = _a.prefill, prefill = _b === void 0 ? {} : _b, _c = _a.pageSettings, pageSettings = _c === void 0 ? {} : _c, _d = _a.utm, utm = _d === void 0 ? {} : _d, embedType = _a.embedType;\n var backgroundColor = pageSettings.backgroundColor, hideEventTypeDetails = pageSettings.hideEventTypeDetails, hideLandingPageDetails = pageSettings.hideLandingPageDetails, primaryColor = pageSettings.primaryColor, textColor = pageSettings.textColor, hideGdprBanner = pageSettings.hideGdprBanner;\n var customAnswers = prefill.customAnswers, date = prefill.date, email = prefill.email, firstName = prefill.firstName, guests = prefill.guests, lastName = prefill.lastName, location = prefill.location, name = prefill.name;\n var utmCampaign = utm.utmCampaign, utmContent = utm.utmContent, utmMedium = utm.utmMedium, utmSource = utm.utmSource, utmTerm = utm.utmTerm, salesforce_uuid = utm.salesforce_uuid;\n var queryStringIndex = url.indexOf(\"?\");\n var hasQueryString = queryStringIndex > -1;\n var queryString = url.slice(queryStringIndex + 1);\n var baseUrl = hasQueryString ? url.slice(0, queryStringIndex) : url;\n var updatedQueryString = [\n hasQueryString ? queryString : null,\n backgroundColor ? \"background_color=\" + backgroundColor : null,\n hideEventTypeDetails ? \"hide_event_type_details=1\" : null,\n hideLandingPageDetails ? \"hide_landing_page_details=1\" : null,\n primaryColor ? \"primary_color=\" + primaryColor : null,\n textColor ? \"text_color=\" + textColor : null,\n hideGdprBanner ? \"hide_gdpr_banner=1\" : null,\n name ? \"name=\" + encodeURIComponent(name) : null,\n location ? \"location=\" + encodeURIComponent(location) : null,\n firstName ? \"first_name=\" + encodeURIComponent(firstName) : null,\n lastName ? \"last_name=\" + encodeURIComponent(lastName) : null,\n guests ? \"guests=\" + guests.map(encodeURIComponent).join(\",\") : null,\n email ? \"email=\" + encodeURIComponent(email) : null,\n date && date instanceof Date ? \"date=\" + formatDate(date) : null,\n utmCampaign ? \"utm_campaign=\" + encodeURIComponent(utmCampaign) : null,\n utmContent ? \"utm_content=\" + encodeURIComponent(utmContent) : null,\n utmMedium ? \"utm_medium=\" + encodeURIComponent(utmMedium) : null,\n utmSource ? \"utm_source=\" + encodeURIComponent(utmSource) : null,\n utmTerm ? \"utm_term=\" + encodeURIComponent(utmTerm) : null,\n salesforce_uuid ? \"salesforce_uuid=\" + encodeURIComponent(salesforce_uuid) : null,\n embedType ? \"embed_type=\" + embedType : null,\n /*\n * https://github.com/tcampb/react-calendly/pull/31\n * embed_domain must be defined to receive messages from the Calendly iframe.\n */\n \"embed_domain=1\",\n ]\n .concat(customAnswers ? formatCustomAnswers(customAnswers) : [])\n .filter(function (item) { return item !== null; })\n .join(\"&\");\n return baseUrl + \"?\" + updatedQueryString;\n};\nvar formatDate = function (d) {\n var month = d.getMonth() + 1;\n var day = d.getDate();\n var year = d.getFullYear();\n return [\n year,\n month < 10 ? \"0\" + month : month,\n day < 10 ? \"0\" + day : day,\n ].join(\"-\");\n};\nvar CUSTOM_ANSWER_PATTERN = /^a\\d{1,2}$/;\nvar formatCustomAnswers = function (customAnswers) {\n var customAnswersFiltered = Object.keys(customAnswers).filter(function (key) {\n return key.match(CUSTOM_ANSWER_PATTERN);\n });\n if (!customAnswersFiltered.length)\n return [];\n return customAnswersFiltered.map(function (key) { return key + \"=\" + encodeURIComponent(customAnswers[key]); });\n};\n\nvar LoadingSpinner = /** @class */ (function (_super) {\n __extends(LoadingSpinner, _super);\n function LoadingSpinner() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n LoadingSpinner.prototype.render = function () {\n return (createElement(\"div\", { className: \"calendly-spinner\" },\n createElement(\"div\", { className: \"calendly-bounce1\" }),\n createElement(\"div\", { className: \"calendly-bounce2\" }),\n createElement(\"div\", { className: \"calendly-bounce3\" })));\n };\n return LoadingSpinner;\n}(Component));\n\nvar defaultStyles = {\n minWidth: \"320px\",\n height: \"630px\",\n};\nvar InlineWidget = /** @class */ (function (_super) {\n __extends(InlineWidget, _super);\n function InlineWidget(props) {\n var _this = _super.call(this, props) || this;\n _this.state = {\n isLoading: true,\n };\n _this.onLoad = _this.onLoad.bind(_this);\n return _this;\n }\n InlineWidget.prototype.onLoad = function () {\n this.setState({\n isLoading: false,\n });\n };\n InlineWidget.prototype.render = function () {\n var src = formatCalendlyUrl({\n url: this.props.url,\n pageSettings: this.props.pageSettings,\n prefill: this.props.prefill,\n utm: this.props.utm,\n embedType: \"Inline\",\n });\n return (createElement(\"div\", { className: \"calendly-inline-widget\", style: this.props.styles || defaultStyles },\n this.state.isLoading && createElement(LoadingSpinner, null),\n createElement(\"iframe\", { width: \"100%\", height: \"100%\", frameBorder: \"0\", title: this.props.iframeTitle || \"Calendly Scheduling Page\", onLoad: this.onLoad, src: src })));\n };\n return InlineWidget;\n}(Component));\n\nvar ModalContent = /** @class */ (function (_super) {\n __extends(ModalContent, _super);\n function ModalContent(props) {\n var _this = _super.call(this, props) || this;\n _this.state = {\n isLoading: true,\n };\n _this.onLoad = _this.onLoad.bind(_this);\n return _this;\n }\n ModalContent.prototype.onLoad = function () {\n this.setState({\n isLoading: false,\n });\n };\n ModalContent.prototype.render = function () {\n var src = formatCalendlyUrl({\n url: this.props.url,\n pageSettings: this.props.pageSettings,\n prefill: this.props.prefill,\n utm: this.props.utm,\n embedType: \"PopupWidget\",\n });\n return (createElement(Fragment, null,\n this.state.isLoading && createElement(LoadingSpinner, null),\n createElement(\"iframe\", { width: \"100%\", height: \"100%\", frameBorder: \"0\", title: this.props.iframeTitle || \"Calendly Scheduling Page\", onLoad: this.onLoad, src: src })));\n };\n return ModalContent;\n}(Component));\n\nvar Modal = (function (props) {\n if (!props.open)\n return null;\n return createPortal(createElement(\"div\", { className: \"calendly-overlay\" },\n createElement(\"div\", { onClick: props.onModalClose, className: \"calendly-close-overlay\" }),\n createElement(\"div\", { className: \"calendly-popup\" },\n createElement(\"div\", { className: \"calendly-popup-content\" },\n createElement(ModalContent, __assign({}, props)))),\n createElement(\"button\", { className: \"calendly-popup-close\", onClick: props.onModalClose, \"aria-label\": \"Close modal\", style: {\n display: \"block\",\n border: \"none\",\n padding: 0,\n } })), props.rootElement);\n});\n\nvar PopupButton = /** @class */ (function (_super) {\n __extends(PopupButton, _super);\n function PopupButton(props) {\n var _this = _super.call(this, props) || this;\n _this.state = {\n isOpen: false,\n };\n _this.onClick = _this.onClick.bind(_this);\n _this.onClose = _this.onClose.bind(_this);\n return _this;\n }\n PopupButton.prototype.onClick = function (e) {\n e.preventDefault();\n this.setState({\n isOpen: true,\n });\n };\n PopupButton.prototype.onClose = function (e) {\n e.stopPropagation();\n this.setState({\n isOpen: false,\n });\n };\n PopupButton.prototype.render = function () {\n return (createElement(Fragment, null,\n createElement(\"button\", { onClick: this.onClick, style: this.props.styles || {}, className: this.props.className || \"\" }, this.props.text),\n createElement(Modal, __assign({}, this.props, { open: this.state.isOpen, onModalClose: this.onClose, rootElement: this.props.rootElement }))));\n };\n return PopupButton;\n}(Component));\n\nvar PopupWidget = /** @class */ (function (_super) {\n __extends(PopupWidget, _super);\n function PopupWidget(props) {\n var _this = _super.call(this, props) || this;\n _this.state = {\n isOpen: false,\n };\n _this.onClick = _this.onClick.bind(_this);\n _this.onClose = _this.onClose.bind(_this);\n return _this;\n }\n PopupWidget.prototype.onClick = function () {\n this.setState({\n isOpen: true,\n });\n };\n PopupWidget.prototype.onClose = function (e) {\n e.stopPropagation();\n this.setState({\n isOpen: false,\n });\n };\n PopupWidget.prototype.render = function () {\n return (createElement(\"div\", { className: \"calendly-badge-widget\", onClick: this.onClick },\n createElement(\"div\", { className: \"calendly-badge-content\", style: {\n background: this.props.color || \"#00a2ff\",\n color: this.props.textColor || \"#ffffff\",\n } },\n this.props.text || \"Schedule time with me\",\n this.props.branding && createElement(\"span\", null, \"powered by Calendly\")),\n createElement(Modal, __assign({}, this.props, { open: this.state.isOpen, onModalClose: this.onClose, rootElement: this.props.rootElement }))));\n };\n return PopupWidget;\n}(Component));\n\nvar EVENT_NAME = \"message\";\nfunction useCalendlyEventListener(eventHandlers) {\n var _a = eventHandlers || {}, onDateAndTimeSelected = _a.onDateAndTimeSelected, onEventScheduled = _a.onEventScheduled, onEventTypeViewed = _a.onEventTypeViewed, onProfilePageViewed = _a.onProfilePageViewed;\n useEffect(function () {\n var onMessage = function (e) {\n var eventName = e.data.event;\n if (eventName === CalendlyEvent.DATE_AND_TIME_SELECTED) {\n onDateAndTimeSelected && onDateAndTimeSelected(e);\n }\n else if (eventName === CalendlyEvent.EVENT_SCHEDULED) {\n onEventScheduled && onEventScheduled(e);\n }\n else if (eventName === CalendlyEvent.EVENT_TYPE_VIEWED) {\n onEventTypeViewed && onEventTypeViewed(e);\n }\n else if (eventName === CalendlyEvent.PROFILE_PAGE_VIEWED) {\n onProfilePageViewed && onProfilePageViewed(e);\n }\n };\n window.addEventListener(EVENT_NAME, onMessage);\n return function cleanup() {\n window.removeEventListener(EVENT_NAME, onMessage);\n };\n }, [eventHandlers]);\n}\n\nexport { InlineWidget, PopupButton, PopupWidget, Modal as PopupModal, useCalendlyEventListener };\n//# sourceMappingURL=index.es.js.map\n","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :\n typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) :\n (global = global || self, factory(global.PlaidLink = {}, global.React));\n}(this, (function (exports, react) { 'use strict';\n\n var react__default = 'default' in react ? react['default'] : react;\n\n function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n }\n\n function ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n }\n\n function _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n }\n\n function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n }\n\n function _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n }\n\n function _slicedToArray(arr, i) {\n return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();\n }\n\n function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n }\n\n function _iterableToArrayLimit(arr, i) {\n if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \"[object Arguments]\")) {\n return;\n }\n\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n }\n\n function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n }\n\n var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\n function unwrapExports (x) {\n \treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n }\n\n function createCommonjsModule(fn, module) {\n \treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n }\n\n var useScript_1 = createCommonjsModule(function (module, exports) {\n\n var __rest = commonjsGlobal && commonjsGlobal.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n };\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n\n\n\n function useScript(_a) {\n var src = _a.src,\n _b = _a.checkForExisting,\n checkForExisting = _b === void 0 ? false : _b,\n attributes = __rest(_a, [\"src\", \"checkForExisting\"]);\n\n var _c = react__default.useState(true),\n loading = _c[0],\n setLoading = _c[1];\n\n var _d = react__default.useState(null),\n error = _d[0],\n setError = _d[1];\n\n react__default.useEffect(function () {\n if (!isBrowser) return;\n\n if (checkForExisting) {\n var existing = document.querySelectorAll(\"script[src=\\\"\" + src + \"\\\"]\");\n\n if (existing.length > 0) {\n setLoading(false);\n return;\n }\n }\n\n var scriptEl = document.createElement('script');\n scriptEl.setAttribute('src', src);\n Object.keys(attributes).forEach(function (key) {\n if (scriptEl[key] === undefined) {\n scriptEl.setAttribute(key, attributes[key]);\n } else {\n scriptEl[key] = attributes[key];\n }\n });\n\n var handleLoad = function () {\n setLoading(false);\n };\n\n var handleError = function (error) {\n setError(error);\n };\n\n scriptEl.addEventListener('load', handleLoad);\n scriptEl.addEventListener('error', handleError);\n document.body.appendChild(scriptEl);\n return function () {\n scriptEl.removeEventListener('load', handleLoad);\n scriptEl.removeEventListener('error', handleError);\n }; // we need to ignore the attributes as they're a new object per call, so we'd never skip an effect call\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [src]);\n return [loading, error];\n }\n\n exports.default = useScript;\n var isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';\n });\n\n unwrapExports(useScript_1);\n\n var lib = createCommonjsModule(function (module, exports) {\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n\n\n\n exports.default = useScript_1.default;\n });\n\n var useScript = unwrapExports(lib);\n\n var renameKeyInObject = function renameKeyInObject(o, oldKey, newKey) {\n var newObject = {};\n delete Object.assign(newObject, o, _defineProperty({}, newKey, o[oldKey]))[oldKey];\n return newObject;\n };\n /**\n * Wrap link handler creation and instance to clean up iframe via destroy() method\n */\n\n\n var createPlaid = function createPlaid(options) {\n var state = {\n plaid: null,\n open: false,\n onExitCallback: null\n }; // If Plaid is not available, throw an Error\n\n if (typeof window === 'undefined' || !window.Plaid) {\n throw new Error('Plaid not loaded');\n }\n\n var config = renameKeyInObject(options, 'publicKey', 'key');\n state.plaid = window.Plaid.create(_objectSpread2({}, config, {\n onExit: function onExit() {\n config.onExit && config.onExit.apply(config, arguments);\n state.onExitCallback && state.onExitCallback();\n }\n }));\n\n var open = function open() {\n if (!state.plaid) {\n return;\n }\n\n state.open = true;\n state.onExitCallback = null;\n state.plaid.open();\n };\n\n var exit = function exit(exitOptions, callback) {\n if (!state.open || !state.plaid) {\n callback && callback();\n return;\n }\n\n state.onExitCallback = callback;\n state.plaid.exit(exitOptions);\n\n if (exitOptions && exitOptions.force) {\n state.open = false;\n }\n };\n\n var destroy = function destroy() {\n if (!state.plaid) {\n return;\n }\n\n state.plaid.destroy();\n state.plaid = null;\n };\n\n return {\n open: open,\n exit: exit,\n destroy: destroy\n };\n };\n\n var PLAID_LINK_STABLE_URL = 'https://cdn.plaid.com/link/v2/stable/link-initialize.js';\n\n var noop = function noop() {};\n /**\n * This hook loads Plaid script and manages the Plaid Link creation for you.\n * You get easy open & exit methods to call and loading & error states.\n *\n * This will destroy the Plaid UI on un-mounting so it's up to you to be\n * graceful to the user.\n *\n * A new Plaid instance is created every time the token and products options change.\n * It's up to you to prevent unnecessary re-creations on re-render.\n */\n\n\n var usePlaidLink = function usePlaidLink(options) {\n // Asynchronously load the plaid/link/stable url into the DOM\n var _useScript = useScript({\n src: PLAID_LINK_STABLE_URL,\n checkForExisting: true\n }),\n _useScript2 = _slicedToArray(_useScript, 2),\n loading = _useScript2[0],\n error = _useScript2[1]; // internal state\n\n\n var _useState = react.useState(null),\n _useState2 = _slicedToArray(_useState, 2),\n plaid = _useState2[0],\n setPlaid = _useState2[1];\n\n var _useState3 = react.useState(false),\n _useState4 = _slicedToArray(_useState3, 2),\n iframeLoaded = _useState4[0],\n setIframeLoaded = _useState4[1];\n\n var products = (options.product || []).slice().sort().join(',');\n react.useEffect(function () {\n // If the link.js script is still loading, return prematurely\n if (loading) {\n return;\n }\n\n if (error || !window.Plaid) {\n // eslint-disable-next-line no-console\n console.error('Error loading Plaid', error);\n return;\n } // if an old plaid instance exists, destroy it before\n // creating a new one\n\n\n if (plaid != null) {\n plaid.exit({\n force: true\n }, function () {\n return plaid.destroy();\n });\n }\n\n var next = createPlaid(_objectSpread2({}, options, {\n onLoad: function onLoad() {\n setIframeLoaded(true);\n options.onLoad && options.onLoad();\n }\n }));\n setPlaid(next); // destroy the Plaid iframe factory\n\n return function () {\n return next.exit({\n force: true\n }, function () {\n return next.destroy();\n });\n };\n }, [loading, error, options.token, products]);\n return {\n error: error,\n ready: !loading || iframeLoaded,\n exit: plaid ? plaid.exit : noop,\n open: plaid ? plaid.open : noop\n };\n };\n\n var PlaidLink = function PlaidLink(props) {\n var children = props.children,\n style = props.style,\n className = props.className,\n config = _objectWithoutProperties(props, [\"children\", \"style\", \"className\"]);\n\n var _usePlaidLink = usePlaidLink(_objectSpread2({}, config)),\n error = _usePlaidLink.error,\n open = _usePlaidLink.open;\n\n return react__default.createElement(\"button\", {\n disabled: Boolean(error),\n type: \"button\",\n className: className,\n style: _objectSpread2({\n padding: '6px 4px',\n outline: 'none',\n background: '#FFFFFF',\n border: '2px solid #F1F1F1',\n borderRadius: '4px'\n }, style),\n onClick: function onClick() {\n return open();\n }\n }, children);\n };\n PlaidLink.displayName = 'PlaidLink';\n\n exports.PlaidLink = PlaidLink;\n exports.usePlaidLink = usePlaidLink;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n","!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t(require(\"react\")):\"function\"==typeof define&&define.amd?define([\"react\"],t):\"object\"==typeof exports?exports.reactTextMask=t(require(\"react\")):e.reactTextMask=t(e.React)}(this,function(e){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p=\"\",t(0)}([function(e,t,r){\"use strict\";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}function i(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}function a(e,t){if(!e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!t||\"object\"!=typeof t&&\"function\"!=typeof t?e:t}function u(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,\"__esModule\",{value:!0}),t.conformToMask=void 0;var s=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:f,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.placeholderChar;if(!o(e))throw new Error(\"Text-mask:convertMaskToPlaceholder; The mask property must be an array.\");if(e.indexOf(t)!==-1)throw new Error(\"Placeholder character must not be used as part of the mask. Please specify a character that is not present in your mask as your placeholder character.\\n\\n\"+(\"The placeholder character that was received is: \"+JSON.stringify(t)+\"\\n\\n\")+(\"The mask that was received is: \"+JSON.stringify(e)));return e.map(function(e){return e instanceof RegExp?t:e}).join(\"\")}function o(e){return Array.isArray&&Array.isArray(e)||e instanceof Array}function i(e){return\"string\"==typeof e||e instanceof String}function a(e){return\"number\"==typeof e&&void 0===e.length&&!isNaN(e)}function u(e){return\"undefined\"==typeof e||null===e}function s(e){for(var t=[],r=void 0;r=e.indexOf(c),r!==-1;)t.push(r),e.splice(r,1);return{maskWithoutCaretTraps:e,indexes:t}}Object.defineProperty(t,\"__esModule\",{value:!0}),t.convertMaskToPlaceholder=n,t.isArray=o,t.isString=i,t.isNumber=a,t.isNil=u,t.processCaretTraps=s;var l=r(1),f=[],c=\"[]\"},function(e,t,r){\"use strict\";function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!(0,i.isArray)(t)){if((\"undefined\"==typeof t?\"undefined\":o(t))!==a.strFunction)throw new Error(\"Text-mask:conformToMask; The mask property must be an array.\");t=t(e,r),t=(0,i.processCaretTraps)(t).maskWithoutCaretTraps}var n=r.guide,l=void 0===n||n,f=r.previousConformedValue,c=void 0===f?s:f,p=r.placeholderChar,d=void 0===p?a.placeholderChar:p,h=r.placeholder,v=void 0===h?(0,i.convertMaskToPlaceholder)(t,d):h,y=r.currentCaretPosition,m=r.keepCharPositions,b=l===!1&&void 0!==c,g=e.length,k=c.length,C=v.length,O=t.length,T=g-k,P=T>0,x=y+(P?-T:0),w=x+Math.abs(T);if(m===!0&&!P){for(var S=s,_=x;_=x&&t=0;j--){var E=M[j].char;if(E!==d){var R=j>=x&&k===O;E===v[R?j-T:j]&&M.splice(j,1)}}var V=s,N=!1;e:for(var A=0;A0)for(;M.length>0;){var I=M.shift(),F=I.char,q=I.isNew;if(F===d&&b!==!0){V+=d;continue e}if(t[A].test(F)){if(m===!0&&q!==!1&&c!==s&&l!==!1&&P){for(var D=M.length,L=null,W=0;W0,T=0===b,P=C>1&&!O&&!T;if(P)return s;var x=O&&(r===l||l===p),w=0,S=void 0,_=void 0;if(x)w=s-C;else{var M=l.toLowerCase(),j=f.toLowerCase(),E=j.substr(0,s).split(o),R=E.filter(function(e){return M.indexOf(e)!==-1});_=R[R.length-1];var V=a.substr(0,R.length).split(o).filter(function(e){return e!==c}).length,N=p.substr(0,R.length).split(o).filter(function(e){return e!==c}).length,A=N!==V,B=void 0!==a[R.length-1]&&void 0!==p[R.length-2]&&a[R.length-1]!==c&&a[R.length-1]!==p[R.length-1]&&a[R.length-1]===p[R.length-2];!O&&(A||B)&&V>0&&p.indexOf(_)>-1&&void 0!==f[s]&&(S=!0,_=f[s]);for(var I=h.map(function(e){return M[e]}),F=I.filter(function(e){return e===_}).length,q=R.filter(function(e){return e===_}).length,D=p.substr(0,p.indexOf(c)).split(o).filter(function(e,t){return e===_&&f[t]!==e}).length,L=D+q+F+(S?1:0),W=0,J=0;J=L)break}}if(O){for(var H=w,Y=w;Y<=g;Y++)if(p[Y]===c&&(H=Y),p[Y]===c||y.indexOf(Y)!==-1||Y===g)return H}else if(S){for(var z=w-1;z>=0;z--)if(l[z]===_||y.indexOf(z)!==-1||0===z)return z}else for(var G=w;G>=0;G--)if(p[G-1]===c||y.indexOf(G)!==-1||0===G)return G}Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=r;var n=[],o=\"\"},function(e,t,r){\"use strict\";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){var t={previousConformedValue:void 0,previousPlaceholder:void 0};return{state:t,update:function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,o=n.inputElement,l=n.mask,c=n.guide,y=n.pipe,b=n.placeholderChar,g=void 0===b?h.placeholderChar:b,k=n.keepCharPositions,C=void 0!==k&&k,O=n.showMask,T=void 0!==O&&O;if(\"undefined\"==typeof r&&(r=o.value),r!==t.previousConformedValue){(\"undefined\"==typeof l?\"undefined\":s(l))===m&&void 0!==l.pipe&&void 0!==l.mask&&(y=l.pipe,l=l.mask);var P=void 0,x=void 0;if(l instanceof Array&&(P=(0,d.convertMaskToPlaceholder)(l,g)),l!==!1){var w=a(r),S=o.selectionEnd,_=t.previousConformedValue,M=t.previousPlaceholder,j=void 0;if((\"undefined\"==typeof l?\"undefined\":s(l))===h.strFunction){if(x=l(w,{currentCaretPosition:S,previousConformedValue:_,placeholderChar:g}),x===!1)return;var E=(0,d.processCaretTraps)(x),R=E.maskWithoutCaretTraps,V=E.indexes;x=R,j=V,P=(0,d.convertMaskToPlaceholder)(x,g)}else x=l;var N={previousConformedValue:_,guide:c,placeholderChar:g,pipe:y,placeholder:P,currentCaretPosition:S,keepCharPositions:C},A=(0,p.default)(w,x,N),B=A.conformedValue,I=(\"undefined\"==typeof y?\"undefined\":s(y))===h.strFunction,F={};I&&(F=y(B,u({rawValue:w},N)),F===!1?F={value:_,rejected:!0}:(0,d.isString)(F)&&(F={value:F}));var q=I?F.value:B,D=(0,f.default)({previousConformedValue:_,previousPlaceholder:M,conformedValue:q,placeholder:P,rawValue:w,currentCaretPosition:S,placeholderChar:g,indexesOfPipedChars:F.indexesOfPipedChars,caretTrapIndexes:j}),L=q===P&&0===D,W=T?P:v,J=L?W:q;t.previousConformedValue=J,t.previousPlaceholder=P,o.value!==J&&(o.value=J,i(o,D))}}}}}function i(e,t){document.activeElement===e&&(b?g(function(){return e.setSelectionRange(t,t,y)},0):e.setSelectionRange(t,t,y))}function a(e){if((0,d.isString)(e))return e;if((0,d.isNumber)(e))return String(e);if(void 0===e||null===e)return v;throw new Error(\"The 'value' provided to Text Mask needs to be a string or a number. The value received was:\\n\\n \"+JSON.stringify(e))}Object.defineProperty(t,\"__esModule\",{value:!0});var u=Object.assign||function(e){for(var t=1;t windowWidth;\n };\n\n var outsideTop = function outsideTop(p) {\n return getTipOffsetTop(p) < 0;\n };\n\n var outsideBottom = function outsideBottom(p) {\n return getTipOffsetBottom(p) > windowHeight;\n }; // Check whether the tooltip with orientation p is completely inside the client window\n\n\n var outside = function outside(p) {\n return outsideLeft(p) || outsideRight(p) || outsideTop(p) || outsideBottom(p);\n };\n\n var inside = function inside(p) {\n return !outside(p);\n };\n\n var placesList = ['top', 'bottom', 'left', 'right'];\n var insideList = [];\n\n for (var i = 0; i < 4; i++) {\n var p = placesList[i];\n\n if (inside(p)) {\n insideList.push(p);\n }\n }\n\n var isNewState = false;\n var newPlace;\n var shouldUpdatePlace = desiredPlace !== place;\n\n if (inside(desiredPlace) && shouldUpdatePlace) {\n isNewState = true;\n newPlace = desiredPlace;\n } else if (insideList.length > 0 && outside(desiredPlace) && outside(place)) {\n isNewState = true;\n newPlace = insideList[0];\n }\n\n if (isNewState) {\n return {\n isNewState: true,\n newState: {\n place: newPlace\n }\n };\n }\n\n return {\n isNewState: false,\n position: {\n left: parseInt(getTipOffsetLeft(place) - parentLeft, 10),\n top: parseInt(getTipOffsetTop(place) - parentTop, 10)\n }\n };\n}\n\nvar getDimensions = function getDimensions(node) {\n var _node$getBoundingClie = node.getBoundingClientRect(),\n height = _node$getBoundingClie.height,\n width = _node$getBoundingClie.width;\n\n return {\n height: parseInt(height, 10),\n width: parseInt(width, 10)\n };\n}; // Get current mouse offset\n\n\nvar getCurrentOffset = function getCurrentOffset(e, currentTarget, effect) {\n var boundingClientRect = currentTarget.getBoundingClientRect();\n var targetTop = boundingClientRect.top;\n var targetLeft = boundingClientRect.left;\n\n var _getDimensions3 = getDimensions(currentTarget),\n targetWidth = _getDimensions3.width,\n targetHeight = _getDimensions3.height;\n\n if (effect === 'float') {\n return {\n mouseX: e.clientX,\n mouseY: e.clientY\n };\n }\n\n return {\n mouseX: targetLeft + targetWidth / 2,\n mouseY: targetTop + targetHeight / 2\n };\n}; // List all possibility of tooltip final offset\n// This is useful in judging if it is necessary for tooltip to switch position when out of window\n\n\nvar getDefaultPosition = function getDefaultPosition(effect, targetWidth, targetHeight, tipWidth, tipHeight) {\n var top;\n var right;\n var bottom;\n var left;\n var disToMouse = 3;\n var triangleHeight = 2;\n var cursorHeight = 12; // Optimize for float bottom only, cause the cursor will hide the tooltip\n\n if (effect === 'float') {\n top = {\n l: -(tipWidth / 2),\n r: tipWidth / 2,\n t: -(tipHeight + disToMouse + triangleHeight),\n b: -disToMouse\n };\n bottom = {\n l: -(tipWidth / 2),\n r: tipWidth / 2,\n t: disToMouse + cursorHeight,\n b: tipHeight + disToMouse + triangleHeight + cursorHeight\n };\n left = {\n l: -(tipWidth + disToMouse + triangleHeight),\n r: -disToMouse,\n t: -(tipHeight / 2),\n b: tipHeight / 2\n };\n right = {\n l: disToMouse,\n r: tipWidth + disToMouse + triangleHeight,\n t: -(tipHeight / 2),\n b: tipHeight / 2\n };\n } else if (effect === 'solid') {\n top = {\n l: -(tipWidth / 2),\n r: tipWidth / 2,\n t: -(targetHeight / 2 + tipHeight + triangleHeight),\n b: -(targetHeight / 2)\n };\n bottom = {\n l: -(tipWidth / 2),\n r: tipWidth / 2,\n t: targetHeight / 2,\n b: targetHeight / 2 + tipHeight + triangleHeight\n };\n left = {\n l: -(tipWidth + targetWidth / 2 + triangleHeight),\n r: -(targetWidth / 2),\n t: -(tipHeight / 2),\n b: tipHeight / 2\n };\n right = {\n l: targetWidth / 2,\n r: tipWidth + targetWidth / 2 + triangleHeight,\n t: -(tipHeight / 2),\n b: tipHeight / 2\n };\n }\n\n return {\n top: top,\n bottom: bottom,\n left: left,\n right: right\n };\n}; // Consider additional offset into position calculation\n\n\nvar calculateOffset = function calculateOffset(offset) {\n var extraOffsetX = 0;\n var extraOffsetY = 0;\n\n if (Object.prototype.toString.apply(offset) === '[object String]') {\n offset = JSON.parse(offset.toString().replace(/'/g, '\"'));\n }\n\n for (var key in offset) {\n if (key === 'top') {\n extraOffsetY -= parseInt(offset[key], 10);\n } else if (key === 'bottom') {\n extraOffsetY += parseInt(offset[key], 10);\n } else if (key === 'left') {\n extraOffsetX -= parseInt(offset[key], 10);\n } else if (key === 'right') {\n extraOffsetX += parseInt(offset[key], 10);\n }\n }\n\n return {\n extraOffsetX: extraOffsetX,\n extraOffsetY: extraOffsetY\n };\n}; // Get the offset of the parent elements\n\n\nvar getParent = function getParent(currentTarget) {\n var currentParent = currentTarget;\n\n while (currentParent) {\n var computedStyle = window.getComputedStyle(currentParent); // transform and will-change: transform change the containing block\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_Block\n\n if (computedStyle.getPropertyValue('transform') !== 'none' || computedStyle.getPropertyValue('will-change') === 'transform') break;\n currentParent = currentParent.parentElement;\n }\n\n var parentTop = currentParent && currentParent.getBoundingClientRect().top || 0;\n var parentLeft = currentParent && currentParent.getBoundingClientRect().left || 0;\n return {\n parentTop: parentTop,\n parentLeft: parentLeft\n };\n};\n\n/**\n * To get the tooltip content\n * it may comes from data-tip or this.props.children\n * it should support multiline\n *\n * @params\n * - `tip` {String} value of data-tip\n * - `children` {ReactElement} this.props.children\n * - `multiline` {Any} could be Bool(true/false) or String('true'/'false')\n *\n * @return\n * - String or react component\n */\nfunction getTipContent (tip, children, getContent, multiline) {\n if (children) return children;\n if (getContent !== undefined && getContent !== null) return getContent; // getContent can be 0, '', etc.\n\n if (getContent === null) return null; // Tip not exist and children is null or undefined\n\n var regexp = //;\n\n if (!multiline || multiline === 'false' || !regexp.test(tip)) {\n // No trim(), so that user can keep their input\n return tip;\n } // Multiline tooltip content\n\n\n return tip.split(regexp).map(function (d, i) {\n return React.createElement(\"span\", {\n key: i,\n className: \"multi-line\"\n }, d);\n });\n}\n\n/**\n * Support aria- and role in ReactTooltip\n *\n * @params props {Object}\n * @return {Object}\n */\nfunction parseAria(props) {\n var ariaObj = {};\n Object.keys(props).filter(function (prop) {\n // aria-xxx and role is acceptable\n return /(^aria-\\w+$|^role$)/.test(prop);\n }).forEach(function (prop) {\n ariaObj[prop] = props[prop];\n });\n return ariaObj;\n}\n\n/**\n * Convert nodelist to array\n * @see https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/core/createArrayFromMixed.js#L24\n * NodeLists are functions in Safari\n */\nfunction nodeListToArray (nodeList) {\n var length = nodeList.length;\n\n if (nodeList.hasOwnProperty) {\n return Array.prototype.slice.call(nodeList);\n }\n\n return new Array(length).fill().map(function (index) {\n return nodeList[index];\n });\n}\n\nfunction generateUUID() {\n return 't' + v4();\n}\n\n___$insertStyle(\".__react_component_tooltip {\\n border-radius: 3px;\\n display: inline-block;\\n font-size: 13px;\\n left: -999em;\\n opacity: 0;\\n padding: 8px 21px;\\n position: fixed;\\n pointer-events: none;\\n transition: opacity 0.3s ease-out;\\n top: -999em;\\n visibility: hidden;\\n z-index: 999;\\n}\\n.__react_component_tooltip.allow_hover, .__react_component_tooltip.allow_click {\\n pointer-events: auto;\\n}\\n.__react_component_tooltip::before, .__react_component_tooltip::after {\\n content: \\\"\\\";\\n width: 0;\\n height: 0;\\n position: absolute;\\n}\\n.__react_component_tooltip.show {\\n opacity: 0.9;\\n margin-top: 0;\\n margin-left: 0;\\n visibility: visible;\\n}\\n.__react_component_tooltip.place-top::before {\\n border-left: 10px solid transparent;\\n border-right: 10px solid transparent;\\n bottom: -8px;\\n left: 50%;\\n margin-left: -10px;\\n}\\n.__react_component_tooltip.place-bottom::before {\\n border-left: 10px solid transparent;\\n border-right: 10px solid transparent;\\n top: -8px;\\n left: 50%;\\n margin-left: -10px;\\n}\\n.__react_component_tooltip.place-left::before {\\n border-top: 6px solid transparent;\\n border-bottom: 6px solid transparent;\\n right: -8px;\\n top: 50%;\\n margin-top: -5px;\\n}\\n.__react_component_tooltip.place-right::before {\\n border-top: 6px solid transparent;\\n border-bottom: 6px solid transparent;\\n left: -8px;\\n top: 50%;\\n margin-top: -5px;\\n}\\n.__react_component_tooltip .multi-line {\\n display: block;\\n padding: 2px 0;\\n text-align: center;\\n}\");\n\n/**\n * Default pop-up style values (text color, background color).\n */\nvar defaultColors = {\n dark: {\n text: '#fff',\n background: '#222',\n border: 'transparent',\n arrow: '#222'\n },\n success: {\n text: '#fff',\n background: '#8DC572',\n border: 'transparent',\n arrow: '#8DC572'\n },\n warning: {\n text: '#fff',\n background: '#F0AD4E',\n border: 'transparent',\n arrow: '#F0AD4E'\n },\n error: {\n text: '#fff',\n background: '#BE6464',\n border: 'transparent',\n arrow: '#BE6464'\n },\n info: {\n text: '#fff',\n background: '#337AB7',\n border: 'transparent',\n arrow: '#337AB7'\n },\n light: {\n text: '#222',\n background: '#fff',\n border: 'transparent',\n arrow: '#fff'\n }\n};\nfunction getDefaultPopupColors(type) {\n return defaultColors[type] ? _objectSpread2({}, defaultColors[type]) : undefined;\n}\n\n/**\n * Generates the specific tooltip style for use on render.\n */\n\nfunction generateTooltipStyle(uuid, customColors, type, hasBorder) {\n return generateStyle(uuid, getPopupColors(customColors, type, hasBorder));\n}\n/**\n * Generates the tooltip style rules based on the element-specified \"data-type\" property.\n */\n\nfunction generateStyle(uuid, colors) {\n var textColor = colors.text;\n var backgroundColor = colors.background;\n var borderColor = colors.border;\n var arrowColor = colors.arrow;\n return \"\\n \\t.\".concat(uuid, \" {\\n\\t color: \").concat(textColor, \";\\n\\t background: \").concat(backgroundColor, \";\\n\\t border: 1px solid \").concat(borderColor, \";\\n \\t}\\n\\n \\t.\").concat(uuid, \".place-top {\\n margin-top: -10px;\\n }\\n .\").concat(uuid, \".place-top::before {\\n border-top: 8px solid \").concat(borderColor, \";\\n }\\n .\").concat(uuid, \".place-top::after {\\n border-left: 8px solid transparent;\\n border-right: 8px solid transparent;\\n bottom: -6px;\\n left: 50%;\\n margin-left: -8px;\\n border-top-color: \").concat(arrowColor, \";\\n border-top-style: solid;\\n border-top-width: 6px;\\n }\\n\\n .\").concat(uuid, \".place-bottom {\\n margin-top: 10px;\\n }\\n .\").concat(uuid, \".place-bottom::before {\\n border-bottom: 8px solid \").concat(borderColor, \";\\n }\\n .\").concat(uuid, \".place-bottom::after {\\n border-left: 8px solid transparent;\\n border-right: 8px solid transparent;\\n top: -6px;\\n left: 50%;\\n margin-left: -8px;\\n border-bottom-color: \").concat(arrowColor, \";\\n border-bottom-style: solid;\\n border-bottom-width: 6px;\\n }\\n\\n .\").concat(uuid, \".place-left {\\n margin-left: -10px;\\n }\\n .\").concat(uuid, \".place-left::before {\\n border-left: 8px solid \").concat(borderColor, \";\\n }\\n .\").concat(uuid, \".place-left::after {\\n border-top: 5px solid transparent;\\n border-bottom: 5px solid transparent;\\n right: -6px;\\n top: 50%;\\n margin-top: -4px;\\n border-left-color: \").concat(arrowColor, \";\\n border-left-style: solid;\\n border-left-width: 6px;\\n }\\n\\n .\").concat(uuid, \".place-right {\\n margin-left: 10px;\\n }\\n .\").concat(uuid, \".place-right::before {\\n border-right: 8px solid \").concat(borderColor, \";\\n }\\n .\").concat(uuid, \".place-right::after {\\n border-top: 5px solid transparent;\\n border-bottom: 5px solid transparent;\\n left: -6px;\\n top: 50%;\\n margin-top: -4px;\\n border-right-color: \").concat(arrowColor, \";\\n border-right-style: solid;\\n border-right-width: 6px;\\n }\\n \");\n}\n\nfunction getPopupColors(customColors, type, hasBorder) {\n var textColor = customColors.text;\n var backgroundColor = customColors.background;\n var borderColor = customColors.border;\n var arrowColor = customColors.arrow ? customColors.arrow : customColors.background;\n var colors = getDefaultPopupColors(type);\n\n if (textColor) {\n colors.text = textColor;\n }\n\n if (backgroundColor) {\n colors.background = backgroundColor;\n }\n\n if (hasBorder) {\n if (borderColor) {\n colors.border = borderColor;\n } else {\n colors.border = type === 'light' ? 'black' : 'white';\n }\n }\n\n if (arrowColor) {\n colors.arrow = arrowColor;\n }\n\n return colors;\n}\n\nvar _class, _class2, _temp;\n\nvar ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_class = isCapture(_class = getEffect(_class = bodyMode(_class = trackRemoval(_class = (_temp = _class2 =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inherits(ReactTooltip, _React$Component);\n\n _createClass(ReactTooltip, null, [{\n key: \"propTypes\",\n get: function get() {\n return {\n uuid: PropTypes.string,\n children: PropTypes.any,\n place: PropTypes.string,\n type: PropTypes.string,\n effect: PropTypes.string,\n offset: PropTypes.object,\n multiline: PropTypes.bool,\n border: PropTypes.bool,\n textColor: PropTypes.string,\n backgroundColor: PropTypes.string,\n borderColor: PropTypes.string,\n arrowColor: PropTypes.string,\n insecure: PropTypes.bool,\n \"class\": PropTypes.string,\n className: PropTypes.string,\n id: PropTypes.string,\n html: PropTypes.bool,\n delayHide: PropTypes.number,\n delayUpdate: PropTypes.number,\n delayShow: PropTypes.number,\n event: PropTypes.string,\n eventOff: PropTypes.string,\n isCapture: PropTypes.bool,\n globalEventOff: PropTypes.string,\n getContent: PropTypes.any,\n afterShow: PropTypes.func,\n afterHide: PropTypes.func,\n overridePosition: PropTypes.func,\n disable: PropTypes.bool,\n scrollHide: PropTypes.bool,\n resizeHide: PropTypes.bool,\n wrapper: PropTypes.string,\n bodyMode: PropTypes.bool,\n possibleCustomEvents: PropTypes.string,\n possibleCustomEventsOff: PropTypes.string,\n clickable: PropTypes.bool\n };\n }\n }]);\n\n function ReactTooltip(props) {\n var _this;\n\n _classCallCheck(this, ReactTooltip);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(ReactTooltip).call(this, props));\n _this.state = {\n uuid: props.uuid || generateUUID(),\n place: props.place || 'top',\n // Direction of tooltip\n desiredPlace: props.place || 'top',\n type: 'dark',\n // Color theme of tooltip\n effect: 'float',\n // float or fixed\n show: false,\n border: false,\n customColors: {},\n offset: {},\n extraClass: '',\n html: false,\n delayHide: 0,\n delayShow: 0,\n event: props.event || null,\n eventOff: props.eventOff || null,\n currentEvent: null,\n // Current mouse event\n currentTarget: null,\n // Current target of mouse event\n ariaProps: parseAria(props),\n // aria- and role attributes\n isEmptyTip: false,\n disable: false,\n possibleCustomEvents: props.possibleCustomEvents || '',\n possibleCustomEventsOff: props.possibleCustomEventsOff || '',\n originTooltip: null,\n isMultiline: false\n };\n\n _this.bind(['showTooltip', 'updateTooltip', 'hideTooltip', 'hideTooltipOnScroll', 'getTooltipContent', 'globalRebuild', 'globalShow', 'globalHide', 'onWindowResize', 'mouseOnToolTip']);\n\n _this.mount = true;\n _this.delayShowLoop = null;\n _this.delayHideLoop = null;\n _this.delayReshow = null;\n _this.intervalUpdateContent = null;\n return _this;\n }\n /**\n * For unify the bind and unbind listener\n */\n\n\n _createClass(ReactTooltip, [{\n key: \"bind\",\n value: function bind(methodArray) {\n var _this2 = this;\n\n methodArray.forEach(function (method) {\n _this2[method] = _this2[method].bind(_this2);\n });\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this$props = this.props,\n insecure = _this$props.insecure,\n resizeHide = _this$props.resizeHide;\n this.bindListener(); // Bind listener for tooltip\n\n this.bindWindowEvents(resizeHide); // Bind global event for static method\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.mount = false;\n this.clearTimer();\n this.unbindListener();\n this.removeScrollListener(this.state.currentTarget);\n this.unbindWindowEvents();\n }\n /**\n * Return if the mouse is on the tooltip.\n * @returns {boolean} true - mouse is on the tooltip\n */\n\n }, {\n key: \"mouseOnToolTip\",\n value: function mouseOnToolTip() {\n var show = this.state.show;\n\n if (show && this.tooltipRef) {\n /* old IE or Firefox work around */\n if (!this.tooltipRef.matches) {\n /* old IE work around */\n if (this.tooltipRef.msMatchesSelector) {\n this.tooltipRef.matches = this.tooltipRef.msMatchesSelector;\n } else {\n /* old Firefox work around */\n this.tooltipRef.matches = this.tooltipRef.mozMatchesSelector;\n }\n }\n\n return this.tooltipRef.matches(':hover');\n }\n\n return false;\n }\n /**\n * Pick out corresponded target elements\n */\n\n }, {\n key: \"getTargetArray\",\n value: function getTargetArray(id) {\n var targetArray = [];\n var selector;\n\n if (!id) {\n selector = '[data-tip]:not([data-for])';\n } else {\n var escaped = id.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"');\n selector = \"[data-tip][data-for=\\\"\".concat(escaped, \"\\\"]\");\n } // Scan document for shadow DOM elements\n\n\n nodeListToArray(document.getElementsByTagName('*')).filter(function (element) {\n return element.shadowRoot;\n }).forEach(function (element) {\n targetArray = targetArray.concat(nodeListToArray(element.shadowRoot.querySelectorAll(selector)));\n });\n return targetArray.concat(nodeListToArray(document.querySelectorAll(selector)));\n }\n /**\n * Bind listener to the target elements\n * These listeners used to trigger showing or hiding the tooltip\n */\n\n }, {\n key: \"bindListener\",\n value: function bindListener() {\n var _this3 = this;\n\n var _this$props2 = this.props,\n id = _this$props2.id,\n globalEventOff = _this$props2.globalEventOff,\n isCapture = _this$props2.isCapture;\n var targetArray = this.getTargetArray(id);\n targetArray.forEach(function (target) {\n if (target.getAttribute('currentItem') === null) {\n target.setAttribute('currentItem', 'false');\n }\n\n _this3.unbindBasicListener(target);\n\n if (_this3.isCustomEvent(target)) {\n _this3.customUnbindListener(target);\n }\n });\n\n if (this.isBodyMode()) {\n this.bindBodyListener(targetArray);\n } else {\n targetArray.forEach(function (target) {\n var isCaptureMode = _this3.isCapture(target);\n\n var effect = _this3.getEffect(target);\n\n if (_this3.isCustomEvent(target)) {\n _this3.customBindListener(target);\n\n return;\n }\n\n target.addEventListener('mouseenter', _this3.showTooltip, isCaptureMode);\n\n if (effect === 'float') {\n target.addEventListener('mousemove', _this3.updateTooltip, isCaptureMode);\n }\n\n target.addEventListener('mouseleave', _this3.hideTooltip, isCaptureMode);\n });\n } // Global event to hide tooltip\n\n\n if (globalEventOff) {\n window.removeEventListener(globalEventOff, this.hideTooltip);\n window.addEventListener(globalEventOff, this.hideTooltip, isCapture);\n } // Track removal of targetArray elements from DOM\n\n\n this.bindRemovalTracker();\n }\n /**\n * Unbind listeners on target elements\n */\n\n }, {\n key: \"unbindListener\",\n value: function unbindListener() {\n var _this4 = this;\n\n var _this$props3 = this.props,\n id = _this$props3.id,\n globalEventOff = _this$props3.globalEventOff;\n\n if (this.isBodyMode()) {\n this.unbindBodyListener();\n } else {\n var targetArray = this.getTargetArray(id);\n targetArray.forEach(function (target) {\n _this4.unbindBasicListener(target);\n\n if (_this4.isCustomEvent(target)) _this4.customUnbindListener(target);\n });\n }\n\n if (globalEventOff) window.removeEventListener(globalEventOff, this.hideTooltip);\n this.unbindRemovalTracker();\n }\n /**\n * Invoke this before bind listener and unmount the component\n * it is necessary to invoke this even when binding custom event\n * so that the tooltip can switch between custom and default listener\n */\n\n }, {\n key: \"unbindBasicListener\",\n value: function unbindBasicListener(target) {\n var isCaptureMode = this.isCapture(target);\n target.removeEventListener('mouseenter', this.showTooltip, isCaptureMode);\n target.removeEventListener('mousemove', this.updateTooltip, isCaptureMode);\n target.removeEventListener('mouseleave', this.hideTooltip, isCaptureMode);\n }\n }, {\n key: \"getTooltipContent\",\n value: function getTooltipContent() {\n var _this$props4 = this.props,\n getContent = _this$props4.getContent,\n children = _this$props4.children; // Generate tooltip content\n\n var content;\n\n if (getContent) {\n if (Array.isArray(getContent)) {\n content = getContent[0] && getContent[0](this.state.originTooltip);\n } else {\n content = getContent(this.state.originTooltip);\n }\n }\n\n return getTipContent(this.state.originTooltip, children, content, this.state.isMultiline);\n }\n }, {\n key: \"isEmptyTip\",\n value: function isEmptyTip(placeholder) {\n return typeof placeholder === 'string' && placeholder === '' || placeholder === null;\n }\n /**\n * When mouse enter, show the tooltip\n */\n\n }, {\n key: \"showTooltip\",\n value: function showTooltip(e, isGlobalCall) {\n if (!this.tooltipRef) {\n return;\n }\n\n if (isGlobalCall) {\n // Don't trigger other elements belongs to other ReactTooltip\n var targetArray = this.getTargetArray(this.props.id);\n var isMyElement = targetArray.some(function (ele) {\n return ele === e.currentTarget;\n });\n if (!isMyElement) return;\n } // Get the tooltip content\n // calculate in this phrase so that tip width height can be detected\n\n\n var _this$props5 = this.props,\n multiline = _this$props5.multiline,\n getContent = _this$props5.getContent;\n var originTooltip = e.currentTarget.getAttribute('data-tip');\n var isMultiline = e.currentTarget.getAttribute('data-multiline') || multiline || false; // If it is focus event or called by ReactTooltip.show, switch to `solid` effect\n\n var switchToSolid = e instanceof window.FocusEvent || isGlobalCall; // if it needs to skip adding hide listener to scroll\n\n var scrollHide = true;\n\n if (e.currentTarget.getAttribute('data-scroll-hide')) {\n scrollHide = e.currentTarget.getAttribute('data-scroll-hide') === 'true';\n } else if (this.props.scrollHide != null) {\n scrollHide = this.props.scrollHide;\n } // Make sure the correct place is set\n\n\n var desiredPlace = e.currentTarget.getAttribute('data-place') || this.props.place || 'top';\n var effect = switchToSolid && 'solid' || this.getEffect(e.currentTarget);\n var offset = e.currentTarget.getAttribute('data-offset') || this.props.offset || {};\n var result = getPosition(e, e.currentTarget, this.tooltipRef, desiredPlace, desiredPlace, effect, offset);\n\n if (result.position && this.props.overridePosition) {\n result.position = this.props.overridePosition(result.position, e, e.currentTarget, this.tooltipRef, desiredPlace, desiredPlace, effect, offset);\n }\n\n var place = result.isNewState ? result.newState.place : desiredPlace; // To prevent previously created timers from triggering\n\n this.clearTimer();\n var target = e.currentTarget;\n var reshowDelay = this.state.show ? target.getAttribute('data-delay-update') || this.props.delayUpdate : 0;\n var self = this;\n\n var updateState = function updateState() {\n self.setState({\n originTooltip: originTooltip,\n isMultiline: isMultiline,\n desiredPlace: desiredPlace,\n place: place,\n type: target.getAttribute('data-type') || self.props.type || 'dark',\n customColors: {\n text: target.getAttribute('data-text-color') || self.props.textColor || null,\n background: target.getAttribute('data-background-color') || self.props.backgroundColor || null,\n border: target.getAttribute('data-border-color') || self.props.borderColor || null,\n arrow: target.getAttribute('data-arrow-color') || self.props.arrowColor || null\n },\n effect: effect,\n offset: offset,\n html: (target.getAttribute('data-html') ? target.getAttribute('data-html') === 'true' : self.props.html) || false,\n delayShow: target.getAttribute('data-delay-show') || self.props.delayShow || 0,\n delayHide: target.getAttribute('data-delay-hide') || self.props.delayHide || 0,\n delayUpdate: target.getAttribute('data-delay-update') || self.props.delayUpdate || 0,\n border: (target.getAttribute('data-border') ? target.getAttribute('data-border') === 'true' : self.props.border) || false,\n extraClass: target.getAttribute('data-class') || self.props[\"class\"] || self.props.className || '',\n disable: (target.getAttribute('data-tip-disable') ? target.getAttribute('data-tip-disable') === 'true' : self.props.disable) || false,\n currentTarget: target\n }, function () {\n if (scrollHide) {\n self.addScrollListener(self.state.currentTarget);\n }\n\n self.updateTooltip(e);\n\n if (getContent && Array.isArray(getContent)) {\n self.intervalUpdateContent = setInterval(function () {\n if (self.mount) {\n var _getContent = self.props.getContent;\n var placeholder = getTipContent(originTooltip, '', _getContent[0](), isMultiline);\n var isEmptyTip = self.isEmptyTip(placeholder);\n self.setState({\n isEmptyTip: isEmptyTip\n });\n self.updatePosition();\n }\n }, getContent[1]);\n }\n });\n }; // If there is no delay call immediately, don't allow events to get in first.\n\n\n if (reshowDelay) {\n this.delayReshow = setTimeout(updateState, reshowDelay);\n } else {\n updateState();\n }\n }\n /**\n * When mouse hover, update tool tip\n */\n\n }, {\n key: \"updateTooltip\",\n value: function updateTooltip(e) {\n var _this5 = this;\n\n var _this$state = this.state,\n delayShow = _this$state.delayShow,\n disable = _this$state.disable;\n var afterShow = this.props.afterShow;\n var placeholder = this.getTooltipContent();\n var delayTime = parseInt(delayShow, 10);\n var eventTarget = e.currentTarget || e.target; // Check if the mouse is actually over the tooltip, if so don't hide the tooltip\n\n if (this.mouseOnToolTip()) {\n return;\n } // if the tooltip is empty, disable the tooltip\n\n\n if (this.isEmptyTip(placeholder) || disable) {\n return;\n }\n\n var updateState = function updateState() {\n if (Array.isArray(placeholder) && placeholder.length > 0 || placeholder) {\n var isInvisible = !_this5.state.show;\n\n _this5.setState({\n currentEvent: e,\n currentTarget: eventTarget,\n show: true\n }, function () {\n _this5.updatePosition();\n\n if (isInvisible && afterShow) {\n afterShow(e);\n }\n });\n }\n };\n\n clearTimeout(this.delayShowLoop);\n\n if (delayShow) {\n this.delayShowLoop = setTimeout(updateState, delayTime);\n } else {\n updateState();\n }\n }\n /*\n * If we're mousing over the tooltip remove it when we leave.\n */\n\n }, {\n key: \"listenForTooltipExit\",\n value: function listenForTooltipExit() {\n var show = this.state.show;\n\n if (show && this.tooltipRef) {\n this.tooltipRef.addEventListener('mouseleave', this.hideTooltip);\n }\n }\n }, {\n key: \"removeListenerForTooltipExit\",\n value: function removeListenerForTooltipExit() {\n var show = this.state.show;\n\n if (show && this.tooltipRef) {\n this.tooltipRef.removeEventListener('mouseleave', this.hideTooltip);\n }\n }\n /**\n * When mouse leave, hide tooltip\n */\n\n }, {\n key: \"hideTooltip\",\n value: function hideTooltip(e, hasTarget) {\n var _this6 = this;\n\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {\n isScroll: false\n };\n var disable = this.state.disable;\n var isScroll = options.isScroll;\n var delayHide = isScroll ? 0 : this.state.delayHide;\n var afterHide = this.props.afterHide;\n var placeholder = this.getTooltipContent();\n if (!this.mount) return;\n if (this.isEmptyTip(placeholder) || disable) return; // if the tooltip is empty, disable the tooltip\n\n if (hasTarget) {\n // Don't trigger other elements belongs to other ReactTooltip\n var targetArray = this.getTargetArray(this.props.id);\n var isMyElement = targetArray.some(function (ele) {\n return ele === e.currentTarget;\n });\n if (!isMyElement || !this.state.show) return;\n }\n\n var resetState = function resetState() {\n var isVisible = _this6.state.show; // Check if the mouse is actually over the tooltip, if so don't hide the tooltip\n\n if (_this6.mouseOnToolTip()) {\n _this6.listenForTooltipExit();\n\n return;\n }\n\n _this6.removeListenerForTooltipExit();\n\n _this6.setState({\n show: false\n }, function () {\n _this6.removeScrollListener(_this6.state.currentTarget);\n\n if (isVisible && afterHide) {\n afterHide(e);\n }\n });\n };\n\n this.clearTimer();\n\n if (delayHide) {\n this.delayHideLoop = setTimeout(resetState, parseInt(delayHide, 10));\n } else {\n resetState();\n }\n }\n /**\n * When scroll, hide tooltip\n */\n\n }, {\n key: \"hideTooltipOnScroll\",\n value: function hideTooltipOnScroll(event, hasTarget) {\n this.hideTooltip(event, hasTarget, {\n isScroll: true\n });\n }\n /**\n * Add scroll event listener when tooltip show\n * automatically hide the tooltip when scrolling\n */\n\n }, {\n key: \"addScrollListener\",\n value: function addScrollListener(currentTarget) {\n var isCaptureMode = this.isCapture(currentTarget);\n window.addEventListener('scroll', this.hideTooltipOnScroll, isCaptureMode);\n }\n }, {\n key: \"removeScrollListener\",\n value: function removeScrollListener(currentTarget) {\n var isCaptureMode = this.isCapture(currentTarget);\n window.removeEventListener('scroll', this.hideTooltipOnScroll, isCaptureMode);\n } // Calculation the position\n\n }, {\n key: \"updatePosition\",\n value: function updatePosition() {\n var _this7 = this;\n\n var _this$state2 = this.state,\n currentEvent = _this$state2.currentEvent,\n currentTarget = _this$state2.currentTarget,\n place = _this$state2.place,\n desiredPlace = _this$state2.desiredPlace,\n effect = _this$state2.effect,\n offset = _this$state2.offset;\n var node = this.tooltipRef;\n var result = getPosition(currentEvent, currentTarget, node, place, desiredPlace, effect, offset);\n\n if (result.position && this.props.overridePosition) {\n result.position = this.props.overridePosition(result.position, currentEvent, currentTarget, node, place, desiredPlace, effect, offset);\n }\n\n if (result.isNewState) {\n // Switch to reverse placement\n return this.setState(result.newState, function () {\n _this7.updatePosition();\n });\n } // Set tooltip position\n\n\n node.style.left = result.position.left + 'px';\n node.style.top = result.position.top + 'px';\n }\n /**\n * CLear all kinds of timeout of interval\n */\n\n }, {\n key: \"clearTimer\",\n value: function clearTimer() {\n clearTimeout(this.delayShowLoop);\n clearTimeout(this.delayHideLoop);\n clearTimeout(this.delayReshow);\n clearInterval(this.intervalUpdateContent);\n }\n }, {\n key: \"hasCustomColors\",\n value: function hasCustomColors() {\n var _this8 = this;\n\n return Boolean(Object.keys(this.state.customColors).find(function (color) {\n return color !== 'border' && _this8.state.customColors[color];\n }) || this.state.border && this.state.customColors['border']);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this9 = this;\n\n var _this$state3 = this.state,\n extraClass = _this$state3.extraClass,\n html = _this$state3.html,\n ariaProps = _this$state3.ariaProps,\n disable = _this$state3.disable;\n var content = this.getTooltipContent();\n var isEmptyTip = this.isEmptyTip(content);\n var style = generateTooltipStyle(this.state.uuid, this.state.customColors, this.state.type, this.state.border);\n var tooltipClass = '__react_component_tooltip' + \" \".concat(this.state.uuid) + (this.state.show && !disable && !isEmptyTip ? ' show' : '') + (this.state.border ? ' border' : '') + \" place-\".concat(this.state.place) + // top, bottom, left, right\n \" type-\".concat(this.hasCustomColors() ? 'custom' : this.state.type) + ( // dark, success, warning, error, info, light, custom\n this.props.delayUpdate ? ' allow_hover' : '') + (this.props.clickable ? ' allow_click' : '');\n var Wrapper = this.props.wrapper;\n\n if (ReactTooltip.supportedWrappers.indexOf(Wrapper) < 0) {\n Wrapper = ReactTooltip.defaultProps.wrapper;\n }\n\n var wrapperClassName = [tooltipClass, extraClass].filter(Boolean).join(' ');\n\n if (html) {\n var htmlContent = \"\".concat(content, \"\\n\");\n return React.createElement(Wrapper, _extends({\n className: \"\".concat(wrapperClassName),\n id: this.props.id,\n ref: function ref(_ref) {\n return _this9.tooltipRef = _ref;\n }\n }, ariaProps, {\n \"data-id\": \"tooltip\",\n dangerouslySetInnerHTML: {\n __html: htmlContent\n }\n }));\n } else {\n return React.createElement(Wrapper, _extends({\n className: \"\".concat(wrapperClassName),\n id: this.props.id\n }, ariaProps, {\n ref: function ref(_ref2) {\n return _this9.tooltipRef = _ref2;\n },\n \"data-id\": \"tooltip\"\n }), React.createElement(\"style\", {\n dangerouslySetInnerHTML: {\n __html: style\n }\n }), content);\n }\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps, prevState) {\n var ariaProps = prevState.ariaProps;\n var newAriaProps = parseAria(nextProps);\n var isChanged = Object.keys(newAriaProps).some(function (props) {\n return newAriaProps[props] !== ariaProps[props];\n });\n\n if (!isChanged) {\n return null;\n }\n\n return _objectSpread2({}, prevState, {\n ariaProps: newAriaProps\n });\n }\n }]);\n\n return ReactTooltip;\n}(React.Component), _defineProperty(_class2, \"defaultProps\", {\n insecure: true,\n resizeHide: true,\n wrapper: 'div',\n clickable: false\n}), _defineProperty(_class2, \"supportedWrappers\", ['div', 'span']), _defineProperty(_class2, \"displayName\", 'ReactTooltip'), _temp)) || _class) || _class) || _class) || _class) || _class) || _class) || _class;\n\nexport default ReactTooltip;\n//# sourceMappingURL=index.es.js.map\n","function replaceClassName(origClass, classToRemove) {\n return origClass.replace(new RegExp(\"(^|\\\\s)\" + classToRemove + \"(?:\\\\s|$)\", 'g'), '$1').replace(/\\s+/g, ' ').replace(/^\\s*|\\s*$/g, '');\n}\n/**\n * Removes a CSS class from a given element.\n * \n * @param element the element\n * @param className the CSS class name\n */\n\n\nexport default function removeClass(element, className) {\n if (element.classList) {\n element.classList.remove(className);\n } else if (typeof element.className === 'string') {\n element.className = replaceClassName(element.className, className);\n } else {\n element.setAttribute('class', replaceClassName(element.className && element.className.baseVal || '', className));\n }\n}","export default {\n disabled: false\n};","export var forceReflow = function forceReflow(node) {\n return node.scrollTop;\n};","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport config from './config';\nimport { timeoutsShape } from './utils/PropTypes';\nimport TransitionGroupContext from './TransitionGroupContext';\nimport { forceReflow } from './utils/reflow';\nexport var UNMOUNTED = 'unmounted';\nexport var EXITED = 'exited';\nexport var ENTERING = 'entering';\nexport var ENTERED = 'entered';\nexport var EXITING = 'exiting';\n/**\n * The Transition component lets you describe a transition from one component\n * state to another _over time_ with a simple declarative API. Most commonly\n * it's used to animate the mounting and unmounting of a component, but can also\n * be used to describe in-place transition states as well.\n *\n * ---\n *\n * **Note**: `Transition` is a platform-agnostic base component. If you're using\n * transitions in CSS, you'll probably want to use\n * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)\n * instead. It inherits all the features of `Transition`, but contains\n * additional features necessary to play nice with CSS transitions (hence the\n * name of the component).\n *\n * ---\n *\n * By default the `Transition` component does not alter the behavior of the\n * component it renders, it only tracks \"enter\" and \"exit\" states for the\n * components. It's up to you to give meaning and effect to those states. For\n * example we can add styles to a component when it enters or exits:\n *\n * ```jsx\n * import { Transition } from 'react-transition-group';\n *\n * const duration = 300;\n *\n * const defaultStyle = {\n * transition: `opacity ${duration}ms ease-in-out`,\n * opacity: 0,\n * }\n *\n * const transitionStyles = {\n * entering: { opacity: 1 },\n * entered: { opacity: 1 },\n * exiting: { opacity: 0 },\n * exited: { opacity: 0 },\n * };\n *\n * const Fade = ({ in: inProp }) => (\n * \n * {state => (\n *
\n * I'm a fade Transition!\n *
\n * )}\n *
\n * );\n * ```\n *\n * There are 4 main states a Transition can be in:\n * - `'entering'`\n * - `'entered'`\n * - `'exiting'`\n * - `'exited'`\n *\n * Transition state is toggled via the `in` prop. When `true` the component\n * begins the \"Enter\" stage. During this stage, the component will shift from\n * its current transition state, to `'entering'` for the duration of the\n * transition and then to the `'entered'` stage once it's complete. Let's take\n * the following example (we'll use the\n * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):\n *\n * ```jsx\n * function App() {\n * const [inProp, setInProp] = useState(false);\n * return (\n *
\n * \n * {state => (\n * // ...\n * )}\n * \n * \n *
\n * );\n * }\n * ```\n *\n * When the button is clicked the component will shift to the `'entering'` state\n * and stay there for 500ms (the value of `timeout`) before it finally switches\n * to `'entered'`.\n *\n * When `in` is `false` the same thing happens except the state moves from\n * `'exiting'` to `'exited'`.\n */\n\nvar Transition = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(Transition, _React$Component);\n\n function Transition(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n var parentGroup = context; // In the context of a TransitionGroup all enters are really appears\n\n var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;\n var initialStatus;\n _this.appearStatus = null;\n\n if (props.in) {\n if (appear) {\n initialStatus = EXITED;\n _this.appearStatus = ENTERING;\n } else {\n initialStatus = ENTERED;\n }\n } else {\n if (props.unmountOnExit || props.mountOnEnter) {\n initialStatus = UNMOUNTED;\n } else {\n initialStatus = EXITED;\n }\n }\n\n _this.state = {\n status: initialStatus\n };\n _this.nextCallback = null;\n return _this;\n }\n\n Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {\n var nextIn = _ref.in;\n\n if (nextIn && prevState.status === UNMOUNTED) {\n return {\n status: EXITED\n };\n }\n\n return null;\n } // getSnapshotBeforeUpdate(prevProps) {\n // let nextStatus = null\n // if (prevProps !== this.props) {\n // const { status } = this.state\n // if (this.props.in) {\n // if (status !== ENTERING && status !== ENTERED) {\n // nextStatus = ENTERING\n // }\n // } else {\n // if (status === ENTERING || status === ENTERED) {\n // nextStatus = EXITING\n // }\n // }\n // }\n // return { nextStatus }\n // }\n ;\n\n var _proto = Transition.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.updateStatus(true, this.appearStatus);\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n var nextStatus = null;\n\n if (prevProps !== this.props) {\n var status = this.state.status;\n\n if (this.props.in) {\n if (status !== ENTERING && status !== ENTERED) {\n nextStatus = ENTERING;\n }\n } else {\n if (status === ENTERING || status === ENTERED) {\n nextStatus = EXITING;\n }\n }\n }\n\n this.updateStatus(false, nextStatus);\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.cancelNextCallback();\n };\n\n _proto.getTimeouts = function getTimeouts() {\n var timeout = this.props.timeout;\n var exit, enter, appear;\n exit = enter = appear = timeout;\n\n if (timeout != null && typeof timeout !== 'number') {\n exit = timeout.exit;\n enter = timeout.enter; // TODO: remove fallback for next major\n\n appear = timeout.appear !== undefined ? timeout.appear : enter;\n }\n\n return {\n exit: exit,\n enter: enter,\n appear: appear\n };\n };\n\n _proto.updateStatus = function updateStatus(mounting, nextStatus) {\n if (mounting === void 0) {\n mounting = false;\n }\n\n if (nextStatus !== null) {\n // nextStatus will always be ENTERING or EXITING.\n this.cancelNextCallback();\n\n if (nextStatus === ENTERING) {\n if (this.props.unmountOnExit || this.props.mountOnEnter) {\n var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this); // https://github.com/reactjs/react-transition-group/pull/749\n // With unmountOnExit or mountOnEnter, the enter animation should happen at the transition between `exited` and `entering`.\n // To make the animation happen, we have to separate each rendering and avoid being processed as batched.\n\n if (node) forceReflow(node);\n }\n\n this.performEnter(mounting);\n } else {\n this.performExit();\n }\n } else if (this.props.unmountOnExit && this.state.status === EXITED) {\n this.setState({\n status: UNMOUNTED\n });\n }\n };\n\n _proto.performEnter = function performEnter(mounting) {\n var _this2 = this;\n\n var enter = this.props.enter;\n var appearing = this.context ? this.context.isMounting : mounting;\n\n var _ref2 = this.props.nodeRef ? [appearing] : [ReactDOM.findDOMNode(this), appearing],\n maybeNode = _ref2[0],\n maybeAppearing = _ref2[1];\n\n var timeouts = this.getTimeouts();\n var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED\n // if we are mounting and running this it means appear _must_ be set\n\n if (!mounting && !enter || config.disabled) {\n this.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(maybeNode);\n });\n return;\n }\n\n this.props.onEnter(maybeNode, maybeAppearing);\n this.safeSetState({\n status: ENTERING\n }, function () {\n _this2.props.onEntering(maybeNode, maybeAppearing);\n\n _this2.onTransitionEnd(enterTimeout, function () {\n _this2.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(maybeNode, maybeAppearing);\n });\n });\n });\n };\n\n _proto.performExit = function performExit() {\n var _this3 = this;\n\n var exit = this.props.exit;\n var timeouts = this.getTimeouts();\n var maybeNode = this.props.nodeRef ? undefined : ReactDOM.findDOMNode(this); // no exit animation skip right to EXITED\n\n if (!exit || config.disabled) {\n this.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(maybeNode);\n });\n return;\n }\n\n this.props.onExit(maybeNode);\n this.safeSetState({\n status: EXITING\n }, function () {\n _this3.props.onExiting(maybeNode);\n\n _this3.onTransitionEnd(timeouts.exit, function () {\n _this3.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(maybeNode);\n });\n });\n });\n };\n\n _proto.cancelNextCallback = function cancelNextCallback() {\n if (this.nextCallback !== null) {\n this.nextCallback.cancel();\n this.nextCallback = null;\n }\n };\n\n _proto.safeSetState = function safeSetState(nextState, callback) {\n // This shouldn't be necessary, but there are weird race conditions with\n // setState callbacks and unmounting in testing, so always make sure that\n // we can cancel any pending setState callbacks after we unmount.\n callback = this.setNextCallback(callback);\n this.setState(nextState, callback);\n };\n\n _proto.setNextCallback = function setNextCallback(callback) {\n var _this4 = this;\n\n var active = true;\n\n this.nextCallback = function (event) {\n if (active) {\n active = false;\n _this4.nextCallback = null;\n callback(event);\n }\n };\n\n this.nextCallback.cancel = function () {\n active = false;\n };\n\n return this.nextCallback;\n };\n\n _proto.onTransitionEnd = function onTransitionEnd(timeout, handler) {\n this.setNextCallback(handler);\n var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this);\n var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;\n\n if (!node || doesNotHaveTimeoutOrListener) {\n setTimeout(this.nextCallback, 0);\n return;\n }\n\n if (this.props.addEndListener) {\n var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback],\n maybeNode = _ref3[0],\n maybeNextCallback = _ref3[1];\n\n this.props.addEndListener(maybeNode, maybeNextCallback);\n }\n\n if (timeout != null) {\n setTimeout(this.nextCallback, timeout);\n }\n };\n\n _proto.render = function render() {\n var status = this.state.status;\n\n if (status === UNMOUNTED) {\n return null;\n }\n\n var _this$props = this.props,\n children = _this$props.children,\n _in = _this$props.in,\n _mountOnEnter = _this$props.mountOnEnter,\n _unmountOnExit = _this$props.unmountOnExit,\n _appear = _this$props.appear,\n _enter = _this$props.enter,\n _exit = _this$props.exit,\n _timeout = _this$props.timeout,\n _addEndListener = _this$props.addEndListener,\n _onEnter = _this$props.onEnter,\n _onEntering = _this$props.onEntering,\n _onEntered = _this$props.onEntered,\n _onExit = _this$props.onExit,\n _onExiting = _this$props.onExiting,\n _onExited = _this$props.onExited,\n _nodeRef = _this$props.nodeRef,\n childProps = _objectWithoutPropertiesLoose(_this$props, [\"children\", \"in\", \"mountOnEnter\", \"unmountOnExit\", \"appear\", \"enter\", \"exit\", \"timeout\", \"addEndListener\", \"onEnter\", \"onEntering\", \"onEntered\", \"onExit\", \"onExiting\", \"onExited\", \"nodeRef\"]);\n\n return (\n /*#__PURE__*/\n // allows for nested Transitions\n React.createElement(TransitionGroupContext.Provider, {\n value: null\n }, typeof children === 'function' ? children(status, childProps) : React.cloneElement(React.Children.only(children), childProps))\n );\n };\n\n return Transition;\n}(React.Component);\n\nTransition.contextType = TransitionGroupContext;\nTransition.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * A React reference to DOM element that need to transition:\n * https://stackoverflow.com/a/51127130/4671932\n *\n * - When `nodeRef` prop is used, `node` is not passed to callback functions\n * (e.g. `onEnter`) because user already has direct access to the node.\n * - When changing `key` prop of `Transition` in a `TransitionGroup` a new\n * `nodeRef` need to be provided to `Transition` with changed `key` prop\n * (see\n * [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).\n */\n nodeRef: PropTypes.shape({\n current: typeof Element === 'undefined' ? PropTypes.any : function (propValue, key, componentName, location, propFullName, secret) {\n var value = propValue[key];\n return PropTypes.instanceOf(value && 'ownerDocument' in value ? value.ownerDocument.defaultView.Element : Element)(propValue, key, componentName, location, propFullName, secret);\n }\n }),\n\n /**\n * A `function` child can be used instead of a React element. This function is\n * called with the current transition status (`'entering'`, `'entered'`,\n * `'exiting'`, `'exited'`), which can be used to apply context\n * specific props to a component.\n *\n * ```jsx\n * \n * {state => (\n * \n * )}\n * \n * ```\n */\n children: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]).isRequired,\n\n /**\n * Show the component; triggers the enter or exit states\n */\n in: PropTypes.bool,\n\n /**\n * By default the child component is mounted immediately along with\n * the parent `Transition` component. If you want to \"lazy mount\" the component on the\n * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay\n * mounted, even on \"exited\", unless you also specify `unmountOnExit`.\n */\n mountOnEnter: PropTypes.bool,\n\n /**\n * By default the child component stays mounted after it reaches the `'exited'` state.\n * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.\n */\n unmountOnExit: PropTypes.bool,\n\n /**\n * By default the child component does not perform the enter transition when\n * it first mounts, regardless of the value of `in`. If you want this\n * behavior, set both `appear` and `in` to `true`.\n *\n * > **Note**: there are no special appear states like `appearing`/`appeared`, this prop\n * > only adds an additional enter transition. However, in the\n * > `` component that first enter transition does result in\n * > additional `.appear-*` classes, that way you can choose to style it\n * > differently.\n */\n appear: PropTypes.bool,\n\n /**\n * Enable or disable enter transitions.\n */\n enter: PropTypes.bool,\n\n /**\n * Enable or disable exit transitions.\n */\n exit: PropTypes.bool,\n\n /**\n * The duration of the transition, in milliseconds.\n * Required unless `addEndListener` is provided.\n *\n * You may specify a single timeout for all transitions:\n *\n * ```jsx\n * timeout={500}\n * ```\n *\n * or individually:\n *\n * ```jsx\n * timeout={{\n * appear: 500,\n * enter: 300,\n * exit: 500,\n * }}\n * ```\n *\n * - `appear` defaults to the value of `enter`\n * - `enter` defaults to `0`\n * - `exit` defaults to `0`\n *\n * @type {number | { enter?: number, exit?: number, appear?: number }}\n */\n timeout: function timeout(props) {\n var pt = timeoutsShape;\n if (!props.addEndListener) pt = pt.isRequired;\n\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return pt.apply(void 0, [props].concat(args));\n },\n\n /**\n * Add a custom transition end trigger. Called with the transitioning\n * DOM node and a `done` callback. Allows for more fine grained transition end\n * logic. Timeouts are still used as a fallback if provided.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * ```jsx\n * addEndListener={(node, done) => {\n * // use the css transitionend event to mark the finish of a transition\n * node.addEventListener('transitionend', done, false);\n * }}\n * ```\n */\n addEndListener: PropTypes.func,\n\n /**\n * Callback fired before the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEnter: PropTypes.func,\n\n /**\n * Callback fired after the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntering: PropTypes.func,\n\n /**\n * Callback fired after the \"entered\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEntered: PropTypes.func,\n\n /**\n * Callback fired before the \"exiting\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExit: PropTypes.func,\n\n /**\n * Callback fired after the \"exiting\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExiting: PropTypes.func,\n\n /**\n * Callback fired after the \"exited\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExited: PropTypes.func\n} : {}; // Name the function so it is clearer in the documentation\n\nfunction noop() {}\n\nTransition.defaultProps = {\n in: false,\n mountOnEnter: false,\n unmountOnExit: false,\n appear: false,\n enter: true,\n exit: true,\n onEnter: noop,\n onEntering: noop,\n onEntered: noop,\n onExit: noop,\n onExiting: noop,\n onExited: noop\n};\nTransition.UNMOUNTED = UNMOUNTED;\nTransition.EXITED = EXITED;\nTransition.ENTERING = ENTERING;\nTransition.ENTERED = ENTERED;\nTransition.EXITING = EXITING;\nexport default Transition;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport addOneClass from 'dom-helpers/addClass';\nimport removeOneClass from 'dom-helpers/removeClass';\nimport React from 'react';\nimport Transition from './Transition';\nimport { classNamesShape } from './utils/PropTypes';\nimport { forceReflow } from './utils/reflow';\n\nvar _addClass = function addClass(node, classes) {\n return node && classes && classes.split(' ').forEach(function (c) {\n return addOneClass(node, c);\n });\n};\n\nvar removeClass = function removeClass(node, classes) {\n return node && classes && classes.split(' ').forEach(function (c) {\n return removeOneClass(node, c);\n });\n};\n/**\n * A transition component inspired by the excellent\n * [ng-animate](https://docs.angularjs.org/api/ngAnimate) library, you should\n * use it if you're using CSS transitions or animations. It's built upon the\n * [`Transition`](https://reactcommunity.org/react-transition-group/transition)\n * component, so it inherits all of its props.\n *\n * `CSSTransition` applies a pair of class names during the `appear`, `enter`,\n * and `exit` states of the transition. The first class is applied and then a\n * second `*-active` class in order to activate the CSS transition. After the\n * transition, matching `*-done` class names are applied to persist the\n * transition state.\n *\n * ```jsx\n * function App() {\n * const [inProp, setInProp] = useState(false);\n * return (\n *
\n * \n *
\n * {\"I'll receive my-node-* classes\"}\n *
\n *
\n * \n *
\n * );\n * }\n * ```\n *\n * When the `in` prop is set to `true`, the child component will first receive\n * the class `example-enter`, then the `example-enter-active` will be added in\n * the next tick. `CSSTransition` [forces a\n * reflow](https://github.com/reactjs/react-transition-group/blob/5007303e729a74be66a21c3e2205e4916821524b/src/CSSTransition.js#L208-L215)\n * between before adding the `example-enter-active`. This is an important trick\n * because it allows us to transition between `example-enter` and\n * `example-enter-active` even though they were added immediately one after\n * another. Most notably, this is what makes it possible for us to animate\n * _appearance_.\n *\n * ```css\n * .my-node-enter {\n * opacity: 0;\n * }\n * .my-node-enter-active {\n * opacity: 1;\n * transition: opacity 200ms;\n * }\n * .my-node-exit {\n * opacity: 1;\n * }\n * .my-node-exit-active {\n * opacity: 0;\n * transition: opacity 200ms;\n * }\n * ```\n *\n * `*-active` classes represent which styles you want to animate **to**, so it's\n * important to add `transition` declaration only to them, otherwise transitions\n * might not behave as intended! This might not be obvious when the transitions\n * are symmetrical, i.e. when `*-enter-active` is the same as `*-exit`, like in\n * the example above (minus `transition`), but it becomes apparent in more\n * complex transitions.\n *\n * **Note**: If you're using the\n * [`appear`](http://reactcommunity.org/react-transition-group/transition#Transition-prop-appear)\n * prop, make sure to define styles for `.appear-*` classes as well.\n */\n\n\nvar CSSTransition = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(CSSTransition, _React$Component);\n\n function CSSTransition() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.appliedClasses = {\n appear: {},\n enter: {},\n exit: {}\n };\n\n _this.onEnter = function (maybeNode, maybeAppearing) {\n var _this$resolveArgument = _this.resolveArguments(maybeNode, maybeAppearing),\n node = _this$resolveArgument[0],\n appearing = _this$resolveArgument[1];\n\n _this.removeClasses(node, 'exit');\n\n _this.addClass(node, appearing ? 'appear' : 'enter', 'base');\n\n if (_this.props.onEnter) {\n _this.props.onEnter(maybeNode, maybeAppearing);\n }\n };\n\n _this.onEntering = function (maybeNode, maybeAppearing) {\n var _this$resolveArgument2 = _this.resolveArguments(maybeNode, maybeAppearing),\n node = _this$resolveArgument2[0],\n appearing = _this$resolveArgument2[1];\n\n var type = appearing ? 'appear' : 'enter';\n\n _this.addClass(node, type, 'active');\n\n if (_this.props.onEntering) {\n _this.props.onEntering(maybeNode, maybeAppearing);\n }\n };\n\n _this.onEntered = function (maybeNode, maybeAppearing) {\n var _this$resolveArgument3 = _this.resolveArguments(maybeNode, maybeAppearing),\n node = _this$resolveArgument3[0],\n appearing = _this$resolveArgument3[1];\n\n var type = appearing ? 'appear' : 'enter';\n\n _this.removeClasses(node, type);\n\n _this.addClass(node, type, 'done');\n\n if (_this.props.onEntered) {\n _this.props.onEntered(maybeNode, maybeAppearing);\n }\n };\n\n _this.onExit = function (maybeNode) {\n var _this$resolveArgument4 = _this.resolveArguments(maybeNode),\n node = _this$resolveArgument4[0];\n\n _this.removeClasses(node, 'appear');\n\n _this.removeClasses(node, 'enter');\n\n _this.addClass(node, 'exit', 'base');\n\n if (_this.props.onExit) {\n _this.props.onExit(maybeNode);\n }\n };\n\n _this.onExiting = function (maybeNode) {\n var _this$resolveArgument5 = _this.resolveArguments(maybeNode),\n node = _this$resolveArgument5[0];\n\n _this.addClass(node, 'exit', 'active');\n\n if (_this.props.onExiting) {\n _this.props.onExiting(maybeNode);\n }\n };\n\n _this.onExited = function (maybeNode) {\n var _this$resolveArgument6 = _this.resolveArguments(maybeNode),\n node = _this$resolveArgument6[0];\n\n _this.removeClasses(node, 'exit');\n\n _this.addClass(node, 'exit', 'done');\n\n if (_this.props.onExited) {\n _this.props.onExited(maybeNode);\n }\n };\n\n _this.resolveArguments = function (maybeNode, maybeAppearing) {\n return _this.props.nodeRef ? [_this.props.nodeRef.current, maybeNode] // here `maybeNode` is actually `appearing`\n : [maybeNode, maybeAppearing];\n };\n\n _this.getClassNames = function (type) {\n var classNames = _this.props.classNames;\n var isStringClassNames = typeof classNames === 'string';\n var prefix = isStringClassNames && classNames ? classNames + \"-\" : '';\n var baseClassName = isStringClassNames ? \"\" + prefix + type : classNames[type];\n var activeClassName = isStringClassNames ? baseClassName + \"-active\" : classNames[type + \"Active\"];\n var doneClassName = isStringClassNames ? baseClassName + \"-done\" : classNames[type + \"Done\"];\n return {\n baseClassName: baseClassName,\n activeClassName: activeClassName,\n doneClassName: doneClassName\n };\n };\n\n return _this;\n }\n\n var _proto = CSSTransition.prototype;\n\n _proto.addClass = function addClass(node, type, phase) {\n var className = this.getClassNames(type)[phase + \"ClassName\"];\n\n var _this$getClassNames = this.getClassNames('enter'),\n doneClassName = _this$getClassNames.doneClassName;\n\n if (type === 'appear' && phase === 'done' && doneClassName) {\n className += \" \" + doneClassName;\n } // This is to force a repaint,\n // which is necessary in order to transition styles when adding a class name.\n\n\n if (phase === 'active') {\n if (node) forceReflow(node);\n }\n\n if (className) {\n this.appliedClasses[type][phase] = className;\n\n _addClass(node, className);\n }\n };\n\n _proto.removeClasses = function removeClasses(node, type) {\n var _this$appliedClasses$ = this.appliedClasses[type],\n baseClassName = _this$appliedClasses$.base,\n activeClassName = _this$appliedClasses$.active,\n doneClassName = _this$appliedClasses$.done;\n this.appliedClasses[type] = {};\n\n if (baseClassName) {\n removeClass(node, baseClassName);\n }\n\n if (activeClassName) {\n removeClass(node, activeClassName);\n }\n\n if (doneClassName) {\n removeClass(node, doneClassName);\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n _ = _this$props.classNames,\n props = _objectWithoutPropertiesLoose(_this$props, [\"classNames\"]);\n\n return /*#__PURE__*/React.createElement(Transition, _extends({}, props, {\n onEnter: this.onEnter,\n onEntered: this.onEntered,\n onEntering: this.onEntering,\n onExit: this.onExit,\n onExiting: this.onExiting,\n onExited: this.onExited\n }));\n };\n\n return CSSTransition;\n}(React.Component);\n\nCSSTransition.defaultProps = {\n classNames: ''\n};\nCSSTransition.propTypes = process.env.NODE_ENV !== \"production\" ? _extends({}, Transition.propTypes, {\n /**\n * The animation classNames applied to the component as it appears, enters,\n * exits or has finished the transition. A single name can be provided, which\n * will be suffixed for each stage, e.g. `classNames=\"fade\"` applies:\n *\n * - `fade-appear`, `fade-appear-active`, `fade-appear-done`\n * - `fade-enter`, `fade-enter-active`, `fade-enter-done`\n * - `fade-exit`, `fade-exit-active`, `fade-exit-done`\n *\n * A few details to note about how these classes are applied:\n *\n * 1. They are _joined_ with the ones that are already defined on the child\n * component, so if you want to add some base styles, you can use\n * `className` without worrying that it will be overridden.\n *\n * 2. If the transition component mounts with `in={false}`, no classes are\n * applied yet. You might be expecting `*-exit-done`, but if you think\n * about it, a component cannot finish exiting if it hasn't entered yet.\n *\n * 2. `fade-appear-done` and `fade-enter-done` will _both_ be applied. This\n * allows you to define different behavior for when appearing is done and\n * when regular entering is done, using selectors like\n * `.fade-enter-done:not(.fade-appear-done)`. For example, you could apply\n * an epic entrance animation when element first appears in the DOM using\n * [Animate.css](https://daneden.github.io/animate.css/). Otherwise you can\n * simply use `fade-enter-done` for defining both cases.\n *\n * Each individual classNames can also be specified independently like:\n *\n * ```js\n * classNames={{\n * appear: 'my-appear',\n * appearActive: 'my-active-appear',\n * appearDone: 'my-done-appear',\n * enter: 'my-enter',\n * enterActive: 'my-active-enter',\n * enterDone: 'my-done-enter',\n * exit: 'my-exit',\n * exitActive: 'my-active-exit',\n * exitDone: 'my-done-exit',\n * }}\n * ```\n *\n * If you want to set these classes using CSS Modules:\n *\n * ```js\n * import styles from './styles.css';\n * ```\n *\n * you might want to use camelCase in your CSS file, that way could simply\n * spread them instead of listing them one by one:\n *\n * ```js\n * classNames={{ ...styles }}\n * ```\n *\n * @type {string | {\n * appear?: string,\n * appearActive?: string,\n * appearDone?: string,\n * enter?: string,\n * enterActive?: string,\n * enterDone?: string,\n * exit?: string,\n * exitActive?: string,\n * exitDone?: string,\n * }}\n */\n classNames: classNamesShape,\n\n /**\n * A `` callback fired immediately after the 'enter' or 'appear' class is\n * applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEnter: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'enter-active' or\n * 'appear-active' class is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntering: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'enter' or\n * 'appear' classes are **removed** and the `done` class is added to the DOM node.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntered: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'exit' class is\n * applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement)\n */\n onExit: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'exit-active' is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement)\n */\n onExiting: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'exit' classes\n * are **removed** and the `exit-done` class is added to the DOM node.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement)\n */\n onExited: PropTypes.func\n}) : {};\nexport default CSSTransition;","import hasClass from './hasClass';\n/**\n * Adds a CSS class to a given element.\n * \n * @param element the element\n * @param className the CSS class name\n */\n\nexport default function addClass(element, className) {\n if (element.classList) element.classList.add(className);else if (!hasClass(element, className)) if (typeof element.className === 'string') element.className = element.className + \" \" + className;else element.setAttribute('class', (element.className && element.className.baseVal || '') + \" \" + className);\n}","/**\n * Checks if a given element has a CSS class.\n * \n * @param element the element\n * @param className the CSS class name\n */\nexport default function hasClass(element, className) {\n if (element.classList) return !!className && element.classList.contains(className);\n return (\" \" + (element.className.baseVal || element.className) + \" \").indexOf(\" \" + className + \" \") !== -1;\n}","import { Children, cloneElement, isValidElement } from 'react';\n/**\n * Given `this.props.children`, return an object mapping key to child.\n *\n * @param {*} children `this.props.children`\n * @return {object} Mapping of key to child\n */\n\nexport function getChildMapping(children, mapFn) {\n var mapper = function mapper(child) {\n return mapFn && isValidElement(child) ? mapFn(child) : child;\n };\n\n var result = Object.create(null);\n if (children) Children.map(children, function (c) {\n return c;\n }).forEach(function (child) {\n // run the map function here instead so that the key is the computed one\n result[child.key] = mapper(child);\n });\n return result;\n}\n/**\n * When you're adding or removing children some may be added or removed in the\n * same render pass. We want to show *both* since we want to simultaneously\n * animate elements in and out. This function takes a previous set of keys\n * and a new set of keys and merges them with its best guess of the correct\n * ordering. In the future we may expose some of the utilities in\n * ReactMultiChild to make this easy, but for now React itself does not\n * directly have this concept of the union of prevChildren and nextChildren\n * so we implement it here.\n *\n * @param {object} prev prev children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @param {object} next next children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @return {object} a key set that contains all keys in `prev` and all keys\n * in `next` in a reasonable order.\n */\n\nexport function mergeChildMappings(prev, next) {\n prev = prev || {};\n next = next || {};\n\n function getValueForKey(key) {\n return key in next ? next[key] : prev[key];\n } // For each key of `next`, the list of keys to insert before that key in\n // the combined list\n\n\n var nextKeysPending = Object.create(null);\n var pendingKeys = [];\n\n for (var prevKey in prev) {\n if (prevKey in next) {\n if (pendingKeys.length) {\n nextKeysPending[prevKey] = pendingKeys;\n pendingKeys = [];\n }\n } else {\n pendingKeys.push(prevKey);\n }\n }\n\n var i;\n var childMapping = {};\n\n for (var nextKey in next) {\n if (nextKeysPending[nextKey]) {\n for (i = 0; i < nextKeysPending[nextKey].length; i++) {\n var pendingNextKey = nextKeysPending[nextKey][i];\n childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);\n }\n }\n\n childMapping[nextKey] = getValueForKey(nextKey);\n } // Finally, add the keys which didn't appear before any key in `next`\n\n\n for (i = 0; i < pendingKeys.length; i++) {\n childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);\n }\n\n return childMapping;\n}\n\nfunction getProp(child, prop, props) {\n return props[prop] != null ? props[prop] : child.props[prop];\n}\n\nexport function getInitialChildMapping(props, onExited) {\n return getChildMapping(props.children, function (child) {\n return cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: true,\n appear: getProp(child, 'appear', props),\n enter: getProp(child, 'enter', props),\n exit: getProp(child, 'exit', props)\n });\n });\n}\nexport function getNextChildMapping(nextProps, prevChildMapping, onExited) {\n var nextChildMapping = getChildMapping(nextProps.children);\n var children = mergeChildMappings(prevChildMapping, nextChildMapping);\n Object.keys(children).forEach(function (key) {\n var child = children[key];\n if (!isValidElement(child)) return;\n var hasPrev = (key in prevChildMapping);\n var hasNext = (key in nextChildMapping);\n var prevChild = prevChildMapping[key];\n var isLeaving = isValidElement(prevChild) && !prevChild.props.in; // item is new (entering)\n\n if (hasNext && (!hasPrev || isLeaving)) {\n // console.log('entering', key)\n children[key] = cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: true,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\n });\n } else if (!hasNext && hasPrev && !isLeaving) {\n // item is old (exiting)\n // console.log('leaving', key)\n children[key] = cloneElement(child, {\n in: false\n });\n } else if (hasNext && hasPrev && isValidElement(prevChild)) {\n // item hasn't changed transition states\n // copy over the last transition props;\n // console.log('unchanged', key)\n children[key] = cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: prevChild.props.in,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\n });\n }\n });\n return children;\n}","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport TransitionGroupContext from './TransitionGroupContext';\nimport { getChildMapping, getInitialChildMapping, getNextChildMapping } from './utils/ChildMapping';\n\nvar values = Object.values || function (obj) {\n return Object.keys(obj).map(function (k) {\n return obj[k];\n });\n};\n\nvar defaultProps = {\n component: 'div',\n childFactory: function childFactory(child) {\n return child;\n }\n};\n/**\n * The `` component manages a set of transition components\n * (`` and ``) in a list. Like with the transition\n * components, `` is a state machine for managing the mounting\n * and unmounting of components over time.\n *\n * Consider the example below. As items are removed or added to the TodoList the\n * `in` prop is toggled automatically by the ``.\n *\n * Note that `` does not define any animation behavior!\n * Exactly _how_ a list item animates is up to the individual transition\n * component. This means you can mix and match animations across different list\n * items.\n */\n\nvar TransitionGroup = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(TransitionGroup, _React$Component);\n\n function TransitionGroup(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n\n var handleExited = _this.handleExited.bind(_assertThisInitialized(_this)); // Initial children should all be entering, dependent on appear\n\n\n _this.state = {\n contextValue: {\n isMounting: true\n },\n handleExited: handleExited,\n firstRender: true\n };\n return _this;\n }\n\n var _proto = TransitionGroup.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.mounted = true;\n this.setState({\n contextValue: {\n isMounting: false\n }\n });\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.mounted = false;\n };\n\n TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {\n var prevChildMapping = _ref.children,\n handleExited = _ref.handleExited,\n firstRender = _ref.firstRender;\n return {\n children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),\n firstRender: false\n };\n } // node is `undefined` when user provided `nodeRef` prop\n ;\n\n _proto.handleExited = function handleExited(child, node) {\n var currentChildMapping = getChildMapping(this.props.children);\n if (child.key in currentChildMapping) return;\n\n if (child.props.onExited) {\n child.props.onExited(node);\n }\n\n if (this.mounted) {\n this.setState(function (state) {\n var children = _extends({}, state.children);\n\n delete children[child.key];\n return {\n children: children\n };\n });\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n Component = _this$props.component,\n childFactory = _this$props.childFactory,\n props = _objectWithoutPropertiesLoose(_this$props, [\"component\", \"childFactory\"]);\n\n var contextValue = this.state.contextValue;\n var children = values(this.state.children).map(childFactory);\n delete props.appear;\n delete props.enter;\n delete props.exit;\n\n if (Component === null) {\n return /*#__PURE__*/React.createElement(TransitionGroupContext.Provider, {\n value: contextValue\n }, children);\n }\n\n return /*#__PURE__*/React.createElement(TransitionGroupContext.Provider, {\n value: contextValue\n }, /*#__PURE__*/React.createElement(Component, props, children));\n };\n\n return TransitionGroup;\n}(React.Component);\n\nTransitionGroup.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * `` renders a `
` by default. You can change this\n * behavior by providing a `component` prop.\n * If you use React v16+ and would like to avoid a wrapping `
` element\n * you can pass in `component={null}`. This is useful if the wrapping div\n * borks your css styles.\n */\n component: PropTypes.any,\n\n /**\n * A set of `` components, that are toggled `in` and out as they\n * leave. the `` will inject specific transition props, so\n * remember to spread them through if you are wrapping the `` as\n * with our `` example.\n *\n * While this component is meant for multiple `Transition` or `CSSTransition`\n * children, sometimes you may want to have a single transition child with\n * content that you want to be transitioned out and in when you change it\n * (e.g. routes, images etc.) In that case you can change the `key` prop of\n * the transition child as you change its content, this will cause\n * `TransitionGroup` to transition the child out and back in.\n */\n children: PropTypes.node,\n\n /**\n * A convenience prop that enables or disables appear animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n appear: PropTypes.bool,\n\n /**\n * A convenience prop that enables or disables enter animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n enter: PropTypes.bool,\n\n /**\n * A convenience prop that enables or disables exit animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n exit: PropTypes.bool,\n\n /**\n * You may need to apply reactive updates to a child as it is exiting.\n * This is generally done by using `cloneElement` however in the case of an exiting\n * child the element has already been removed and not accessible to the consumer.\n *\n * If you do need to update a child as it leaves you can provide a `childFactory`\n * to wrap every child, even the ones that are leaving.\n *\n * @type Function(child: ReactElement) -> ReactElement\n */\n childFactory: PropTypes.func\n} : {};\nTransitionGroup.defaultProps = defaultProps;\nexport default TransitionGroup;","import React from 'react';\nexport default React.createContext(null);","!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define([],t):\"object\"==typeof exports?exports.createNumberMask=t():e.createNumberMask=t()}(this,function(){return function(e){function t(n){if(o[n])return o[n].exports;var i=o[n]={exports:{},id:n,loaded:!1};return e[n].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var o={};return t.m=e,t.c=o,t.p=\"\",t(0)}([function(e,t,o){e.exports=o(2)},,function(e,t){\"use strict\";function o(){function e(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=e.length;if(e===l||e[0]===y[0]&&1===t)return y.split(l).concat([v]).concat(g.split(l));if(e===k&&M)return y.split(l).concat([\"0\",k,v]).concat(g.split(l));var o=e[0]===s&&q;o&&(e=e.toString().substr(1));var c=e.lastIndexOf(k),u=c!==-1,a=void 0,b=void 0,h=void 0;if(e.slice(T*-1)===g&&(e=e.slice(0,T*-1)),u&&(M||$)?(a=e.slice(e.slice(0,R)===y?R:0,c),b=e.slice(c+1,t),b=n(b.replace(f,l))):a=e.slice(0,R)===y?e.slice(R):e,P&&(\"undefined\"==typeof P?\"undefined\":r(P))===p){var S=\".\"===j?\"[.]\":\"\"+j,w=(a.match(new RegExp(S,\"g\"))||[]).length;a=a.slice(0,P+w*Z)}return a=a.replace(f,l),E||(a=a.replace(/^0+(0$|[^0])/,\"$1\")),a=x?i(a,j):a,h=n(a),(u&&M||$===!0)&&(e[c-1]!==k&&h.push(m),h.push(k,m),b&&((\"undefined\"==typeof L?\"undefined\":r(L))===p&&(b=b.slice(0,L)),h=h.concat(b)),$===!0&&e[c-1]===k&&h.push(v)),R>0&&(h=y.split(l).concat(h)),o&&(h.length===R&&h.push(v),h=[d].concat(h)),g.length>0&&(h=h.concat(g.split(l))),h}var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=t.prefix,y=void 0===o?c:o,b=t.suffix,g=void 0===b?l:b,h=t.includeThousandsSeparator,x=void 0===h||h,S=t.thousandsSeparatorSymbol,j=void 0===S?u:S,w=t.allowDecimal,M=void 0!==w&&w,N=t.decimalSymbol,k=void 0===N?a:N,D=t.decimalLimit,L=void 0===D?2:D,O=t.requireDecimal,$=void 0!==O&&O,_=t.allowNegative,q=void 0!==_&&_,B=t.allowLeadingZeroes,E=void 0!==B&&B,I=t.integerLimit,P=void 0===I?null:I,R=y&&y.length||0,T=g&&g.length||0,Z=j&&j.length||0;return e.instanceOf=\"createNumberMask\",e}function n(e){return e.split(l).map(function(e){return v.test(e)?v:e})}function i(e,t){return e.replace(/\\B(?=(\\d{3})+(?!\\d))/g,t)}Object.defineProperty(t,\"__esModule\",{value:!0});var r=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e};t.default=o;var c=\"$\",l=\"\",u=\",\",a=\".\",s=\"-\",d=/-/,f=/\\D+/g,p=\"number\",v=/\\d/,m=\"[]\"}])});","\nmodule.exports = function () {\n var selection = document.getSelection();\n if (!selection.rangeCount) {\n return function () {};\n }\n var active = document.activeElement;\n\n var ranges = [];\n for (var i = 0; i < selection.rangeCount; i++) {\n ranges.push(selection.getRangeAt(i));\n }\n\n switch (active.tagName.toUpperCase()) { // .toUpperCase handles XHTML\n case 'INPUT':\n case 'TEXTAREA':\n active.blur();\n break;\n\n default:\n active = null;\n break;\n }\n\n selection.removeAllRanges();\n return function () {\n selection.type === 'Caret' &&\n selection.removeAllRanges();\n\n if (!selection.rangeCount) {\n ranges.forEach(function(range) {\n selection.addRange(range);\n });\n }\n\n active &&\n active.focus();\n };\n};\n","var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction _regeneratorRuntime() {\n \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */\n module.exports = _regeneratorRuntime = function _regeneratorRuntime() {\n return e;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n var t,\n e = {},\n r = Object.prototype,\n n = r.hasOwnProperty,\n o = Object.defineProperty || function (t, e, r) {\n t[e] = r.value;\n },\n i = \"function\" == typeof Symbol ? Symbol : {},\n a = i.iterator || \"@@iterator\",\n c = i.asyncIterator || \"@@asyncIterator\",\n u = i.toStringTag || \"@@toStringTag\";\n function define(t, e, r) {\n return Object.defineProperty(t, e, {\n value: r,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }), t[e];\n }\n try {\n define({}, \"\");\n } catch (t) {\n define = function define(t, e, r) {\n return t[e] = r;\n };\n }\n function wrap(t, e, r, n) {\n var i = e && e.prototype instanceof Generator ? e : Generator,\n a = Object.create(i.prototype),\n c = new Context(n || []);\n return o(a, \"_invoke\", {\n value: makeInvokeMethod(t, r, c)\n }), a;\n }\n function tryCatch(t, e, r) {\n try {\n return {\n type: \"normal\",\n arg: t.call(e, r)\n };\n } catch (t) {\n return {\n type: \"throw\",\n arg: t\n };\n }\n }\n e.wrap = wrap;\n var h = \"suspendedStart\",\n l = \"suspendedYield\",\n f = \"executing\",\n s = \"completed\",\n y = {};\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n var p = {};\n define(p, a, function () {\n return this;\n });\n var d = Object.getPrototypeOf,\n v = d && d(d(values([])));\n v && v !== r && n.call(v, a) && (p = v);\n var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);\n function defineIteratorMethods(t) {\n [\"next\", \"throw\", \"return\"].forEach(function (e) {\n define(t, e, function (t) {\n return this._invoke(e, t);\n });\n });\n }\n function AsyncIterator(t, e) {\n function invoke(r, o, i, a) {\n var c = tryCatch(t[r], t, o);\n if (\"throw\" !== c.type) {\n var u = c.arg,\n h = u.value;\n return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) {\n invoke(\"next\", t, i, a);\n }, function (t) {\n invoke(\"throw\", t, i, a);\n }) : e.resolve(h).then(function (t) {\n u.value = t, i(u);\n }, function (t) {\n return invoke(\"throw\", t, i, a);\n });\n }\n a(c.arg);\n }\n var r;\n o(this, \"_invoke\", {\n value: function value(t, n) {\n function callInvokeWithMethodAndArg() {\n return new e(function (e, r) {\n invoke(t, n, e, r);\n });\n }\n return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n }\n });\n }\n function makeInvokeMethod(e, r, n) {\n var o = h;\n return function (i, a) {\n if (o === f) throw Error(\"Generator is already running\");\n if (o === s) {\n if (\"throw\" === i) throw a;\n return {\n value: t,\n done: !0\n };\n }\n for (n.method = i, n.arg = a;;) {\n var c = n.delegate;\n if (c) {\n var u = maybeInvokeDelegate(c, n);\n if (u) {\n if (u === y) continue;\n return u;\n }\n }\n if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) {\n if (o === h) throw o = s, n.arg;\n n.dispatchException(n.arg);\n } else \"return\" === n.method && n.abrupt(\"return\", n.arg);\n o = f;\n var p = tryCatch(e, r, n);\n if (\"normal\" === p.type) {\n if (o = n.done ? s : l, p.arg === y) continue;\n return {\n value: p.arg,\n done: n.done\n };\n }\n \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg);\n }\n };\n }\n function maybeInvokeDelegate(e, r) {\n var n = r.method,\n o = e.iterator[n];\n if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y;\n var i = tryCatch(o, e.iterator, r.arg);\n if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y;\n var a = i.arg;\n return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y);\n }\n function pushTryEntry(t) {\n var e = {\n tryLoc: t[0]\n };\n 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);\n }\n function resetTryEntry(t) {\n var e = t.completion || {};\n e.type = \"normal\", delete e.arg, t.completion = e;\n }\n function Context(t) {\n this.tryEntries = [{\n tryLoc: \"root\"\n }], t.forEach(pushTryEntry, this), this.reset(!0);\n }\n function values(e) {\n if (e || \"\" === e) {\n var r = e[a];\n if (r) return r.call(e);\n if (\"function\" == typeof e.next) return e;\n if (!isNaN(e.length)) {\n var o = -1,\n i = function next() {\n for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;\n return next.value = t, next.done = !0, next;\n };\n return i.next = i;\n }\n }\n throw new TypeError(_typeof(e) + \" is not iterable\");\n }\n return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", {\n value: GeneratorFunctionPrototype,\n configurable: !0\n }), o(GeneratorFunctionPrototype, \"constructor\", {\n value: GeneratorFunction,\n configurable: !0\n }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) {\n var e = \"function\" == typeof t && t.constructor;\n return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name));\n }, e.mark = function (t) {\n return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t;\n }, e.awrap = function (t) {\n return {\n __await: t\n };\n }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {\n return this;\n }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {\n void 0 === i && (i = Promise);\n var a = new AsyncIterator(wrap(t, r, n, o), i);\n return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {\n return t.done ? t.value : a.next();\n });\n }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () {\n return this;\n }), define(g, \"toString\", function () {\n return \"[object Generator]\";\n }), e.keys = function (t) {\n var e = Object(t),\n r = [];\n for (var n in e) r.push(n);\n return r.reverse(), function next() {\n for (; r.length;) {\n var t = r.pop();\n if (t in e) return next.value = t, next.done = !1, next;\n }\n return next.done = !0, next;\n };\n }, e.values = values, Context.prototype = {\n constructor: Context,\n reset: function reset(e) {\n if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);\n },\n stop: function stop() {\n this.done = !0;\n var t = this.tryEntries[0].completion;\n if (\"throw\" === t.type) throw t.arg;\n return this.rval;\n },\n dispatchException: function dispatchException(e) {\n if (this.done) throw e;\n var r = this;\n function handle(n, o) {\n return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o;\n }\n for (var o = this.tryEntries.length - 1; o >= 0; --o) {\n var i = this.tryEntries[o],\n a = i.completion;\n if (\"root\" === i.tryLoc) return handle(\"end\");\n if (i.tryLoc <= this.prev) {\n var c = n.call(i, \"catchLoc\"),\n u = n.call(i, \"finallyLoc\");\n if (c && u) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n } else if (c) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n } else {\n if (!u) throw Error(\"try statement without catch or finally\");\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n }\n }\n }\n },\n abrupt: function abrupt(t, e) {\n for (var r = this.tryEntries.length - 1; r >= 0; --r) {\n var o = this.tryEntries[r];\n if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) {\n var i = o;\n break;\n }\n }\n i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);\n var a = i ? i.completion : {};\n return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a);\n },\n complete: function complete(t, e) {\n if (\"throw\" === t.type) throw t.arg;\n return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y;\n },\n finish: function finish(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;\n }\n },\n \"catch\": function _catch(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.tryLoc === t) {\n var n = r.completion;\n if (\"throw\" === n.type) {\n var o = n.arg;\n resetTryEntry(r);\n }\n return o;\n }\n }\n throw Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(e, r, n) {\n return this.delegate = {\n iterator: values(e),\n resultName: r,\n nextLoc: n\n }, \"next\" === this.method && (this.arg = t), y;\n }\n }, e;\n}\nmodule.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports, _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","// TODO(Babel 8): Remove this file.\n\nvar runtime = require(\"../helpers/regeneratorRuntime\")();\nmodule.exports = runtime;\n\n// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","function _assertThisInitialized(e) {\n if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return e;\n}\nexport { _assertThisInitialized as default };","import { Component, ComponentContainer } from '@firebase/component';\nimport { Logger, setUserLogHandler, setLogLevel as setLogLevel$1 } from '@firebase/logger';\nimport { ErrorFactory, getDefaultAppConfig, deepEqual, FirebaseError, base64urlEncodeWithoutPadding, isIndexedDBAvailable, validateIndexedDBOpenable } from '@firebase/util';\nexport { FirebaseError } from '@firebase/util';\nimport { openDB } from 'idb';\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nclass PlatformLoggerServiceImpl {\r\n constructor(container) {\r\n this.container = container;\r\n }\r\n // In initial implementation, this will be called by installations on\r\n // auth token refresh, and installations will send this string.\r\n getPlatformInfoString() {\r\n const providers = this.container.getProviders();\r\n // Loop through providers and get library/version pairs from any that are\r\n // version components.\r\n return providers\r\n .map(provider => {\r\n if (isVersionServiceProvider(provider)) {\r\n const service = provider.getImmediate();\r\n return `${service.library}/${service.version}`;\r\n }\r\n else {\r\n return null;\r\n }\r\n })\r\n .filter(logString => logString)\r\n .join(' ');\r\n }\r\n}\r\n/**\r\n *\r\n * @param provider check if this provider provides a VersionService\r\n *\r\n * NOTE: Using Provider<'app-version'> is a hack to indicate that the provider\r\n * provides VersionService. The provider is not necessarily a 'app-version'\r\n * provider.\r\n */\r\nfunction isVersionServiceProvider(provider) {\r\n const component = provider.getComponent();\r\n return (component === null || component === void 0 ? void 0 : component.type) === \"VERSION\" /* ComponentType.VERSION */;\r\n}\n\nconst name$o = \"@firebase/app\";\nconst version$1 = \"0.9.29\";\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst logger = new Logger('@firebase/app');\n\nconst name$n = \"@firebase/app-compat\";\n\nconst name$m = \"@firebase/analytics-compat\";\n\nconst name$l = \"@firebase/analytics\";\n\nconst name$k = \"@firebase/app-check-compat\";\n\nconst name$j = \"@firebase/app-check\";\n\nconst name$i = \"@firebase/auth\";\n\nconst name$h = \"@firebase/auth-compat\";\n\nconst name$g = \"@firebase/database\";\n\nconst name$f = \"@firebase/database-compat\";\n\nconst name$e = \"@firebase/functions\";\n\nconst name$d = \"@firebase/functions-compat\";\n\nconst name$c = \"@firebase/installations\";\n\nconst name$b = \"@firebase/installations-compat\";\n\nconst name$a = \"@firebase/messaging\";\n\nconst name$9 = \"@firebase/messaging-compat\";\n\nconst name$8 = \"@firebase/performance\";\n\nconst name$7 = \"@firebase/performance-compat\";\n\nconst name$6 = \"@firebase/remote-config\";\n\nconst name$5 = \"@firebase/remote-config-compat\";\n\nconst name$4 = \"@firebase/storage\";\n\nconst name$3 = \"@firebase/storage-compat\";\n\nconst name$2 = \"@firebase/firestore\";\n\nconst name$1 = \"@firebase/firestore-compat\";\n\nconst name = \"firebase\";\nconst version = \"10.9.0\";\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * The default app name\r\n *\r\n * @internal\r\n */\r\nconst DEFAULT_ENTRY_NAME = '[DEFAULT]';\r\nconst PLATFORM_LOG_STRING = {\r\n [name$o]: 'fire-core',\r\n [name$n]: 'fire-core-compat',\r\n [name$l]: 'fire-analytics',\r\n [name$m]: 'fire-analytics-compat',\r\n [name$j]: 'fire-app-check',\r\n [name$k]: 'fire-app-check-compat',\r\n [name$i]: 'fire-auth',\r\n [name$h]: 'fire-auth-compat',\r\n [name$g]: 'fire-rtdb',\r\n [name$f]: 'fire-rtdb-compat',\r\n [name$e]: 'fire-fn',\r\n [name$d]: 'fire-fn-compat',\r\n [name$c]: 'fire-iid',\r\n [name$b]: 'fire-iid-compat',\r\n [name$a]: 'fire-fcm',\r\n [name$9]: 'fire-fcm-compat',\r\n [name$8]: 'fire-perf',\r\n [name$7]: 'fire-perf-compat',\r\n [name$6]: 'fire-rc',\r\n [name$5]: 'fire-rc-compat',\r\n [name$4]: 'fire-gcs',\r\n [name$3]: 'fire-gcs-compat',\r\n [name$2]: 'fire-fst',\r\n [name$1]: 'fire-fst-compat',\r\n 'fire-js': 'fire-js',\r\n [name]: 'fire-js-all'\r\n};\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @internal\r\n */\r\nconst _apps = new Map();\r\n/**\r\n * Registered components.\r\n *\r\n * @internal\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nconst _components = new Map();\r\n/**\r\n * @param component - the component being added to this app's container\r\n *\r\n * @internal\r\n */\r\nfunction _addComponent(app, component) {\r\n try {\r\n app.container.addComponent(component);\r\n }\r\n catch (e) {\r\n logger.debug(`Component ${component.name} failed to register with FirebaseApp ${app.name}`, e);\r\n }\r\n}\r\n/**\r\n *\r\n * @internal\r\n */\r\nfunction _addOrOverwriteComponent(app, component) {\r\n app.container.addOrOverwriteComponent(component);\r\n}\r\n/**\r\n *\r\n * @param component - the component to register\r\n * @returns whether or not the component is registered successfully\r\n *\r\n * @internal\r\n */\r\nfunction _registerComponent(component) {\r\n const componentName = component.name;\r\n if (_components.has(componentName)) {\r\n logger.debug(`There were multiple attempts to register component ${componentName}.`);\r\n return false;\r\n }\r\n _components.set(componentName, component);\r\n // add the component to existing app instances\r\n for (const app of _apps.values()) {\r\n _addComponent(app, component);\r\n }\r\n return true;\r\n}\r\n/**\r\n *\r\n * @param app - FirebaseApp instance\r\n * @param name - service name\r\n *\r\n * @returns the provider for the service with the matching name\r\n *\r\n * @internal\r\n */\r\nfunction _getProvider(app, name) {\r\n const heartbeatController = app.container\r\n .getProvider('heartbeat')\r\n .getImmediate({ optional: true });\r\n if (heartbeatController) {\r\n void heartbeatController.triggerHeartbeat();\r\n }\r\n return app.container.getProvider(name);\r\n}\r\n/**\r\n *\r\n * @param app - FirebaseApp instance\r\n * @param name - service name\r\n * @param instanceIdentifier - service instance identifier in case the service supports multiple instances\r\n *\r\n * @internal\r\n */\r\nfunction _removeServiceInstance(app, name, instanceIdentifier = DEFAULT_ENTRY_NAME) {\r\n _getProvider(app, name).clearInstance(instanceIdentifier);\r\n}\r\n/**\r\n * Test only\r\n *\r\n * @internal\r\n */\r\nfunction _clearComponents() {\r\n _components.clear();\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst ERRORS = {\r\n [\"no-app\" /* AppError.NO_APP */]: \"No Firebase App '{$appName}' has been created - \" +\r\n 'call initializeApp() first',\r\n [\"bad-app-name\" /* AppError.BAD_APP_NAME */]: \"Illegal App name: '{$appName}\",\r\n [\"duplicate-app\" /* AppError.DUPLICATE_APP */]: \"Firebase App named '{$appName}' already exists with different options or config\",\r\n [\"app-deleted\" /* AppError.APP_DELETED */]: \"Firebase App named '{$appName}' already deleted\",\r\n [\"no-options\" /* AppError.NO_OPTIONS */]: 'Need to provide options, when not being deployed to hosting via source.',\r\n [\"invalid-app-argument\" /* AppError.INVALID_APP_ARGUMENT */]: 'firebase.{$appName}() takes either no argument or a ' +\r\n 'Firebase App instance.',\r\n [\"invalid-log-argument\" /* AppError.INVALID_LOG_ARGUMENT */]: 'First argument to `onLog` must be null or a function.',\r\n [\"idb-open\" /* AppError.IDB_OPEN */]: 'Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.',\r\n [\"idb-get\" /* AppError.IDB_GET */]: 'Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.',\r\n [\"idb-set\" /* AppError.IDB_WRITE */]: 'Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.',\r\n [\"idb-delete\" /* AppError.IDB_DELETE */]: 'Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.'\r\n};\r\nconst ERROR_FACTORY = new ErrorFactory('app', 'Firebase', ERRORS);\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nclass FirebaseAppImpl {\r\n constructor(options, config, container) {\r\n this._isDeleted = false;\r\n this._options = Object.assign({}, options);\r\n this._config = Object.assign({}, config);\r\n this._name = config.name;\r\n this._automaticDataCollectionEnabled =\r\n config.automaticDataCollectionEnabled;\r\n this._container = container;\r\n this.container.addComponent(new Component('app', () => this, \"PUBLIC\" /* ComponentType.PUBLIC */));\r\n }\r\n get automaticDataCollectionEnabled() {\r\n this.checkDestroyed();\r\n return this._automaticDataCollectionEnabled;\r\n }\r\n set automaticDataCollectionEnabled(val) {\r\n this.checkDestroyed();\r\n this._automaticDataCollectionEnabled = val;\r\n }\r\n get name() {\r\n this.checkDestroyed();\r\n return this._name;\r\n }\r\n get options() {\r\n this.checkDestroyed();\r\n return this._options;\r\n }\r\n get config() {\r\n this.checkDestroyed();\r\n return this._config;\r\n }\r\n get container() {\r\n return this._container;\r\n }\r\n get isDeleted() {\r\n return this._isDeleted;\r\n }\r\n set isDeleted(val) {\r\n this._isDeleted = val;\r\n }\r\n /**\r\n * This function will throw an Error if the App has already been deleted -\r\n * use before performing API actions on the App.\r\n */\r\n checkDestroyed() {\r\n if (this.isDeleted) {\r\n throw ERROR_FACTORY.create(\"app-deleted\" /* AppError.APP_DELETED */, { appName: this._name });\r\n }\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * The current SDK version.\r\n *\r\n * @public\r\n */\r\nconst SDK_VERSION = version;\r\nfunction initializeApp(_options, rawConfig = {}) {\r\n let options = _options;\r\n if (typeof rawConfig !== 'object') {\r\n const name = rawConfig;\r\n rawConfig = { name };\r\n }\r\n const config = Object.assign({ name: DEFAULT_ENTRY_NAME, automaticDataCollectionEnabled: false }, rawConfig);\r\n const name = config.name;\r\n if (typeof name !== 'string' || !name) {\r\n throw ERROR_FACTORY.create(\"bad-app-name\" /* AppError.BAD_APP_NAME */, {\r\n appName: String(name)\r\n });\r\n }\r\n options || (options = getDefaultAppConfig());\r\n if (!options) {\r\n throw ERROR_FACTORY.create(\"no-options\" /* AppError.NO_OPTIONS */);\r\n }\r\n const existingApp = _apps.get(name);\r\n if (existingApp) {\r\n // return the existing app if options and config deep equal the ones in the existing app.\r\n if (deepEqual(options, existingApp.options) &&\r\n deepEqual(config, existingApp.config)) {\r\n return existingApp;\r\n }\r\n else {\r\n throw ERROR_FACTORY.create(\"duplicate-app\" /* AppError.DUPLICATE_APP */, { appName: name });\r\n }\r\n }\r\n const container = new ComponentContainer(name);\r\n for (const component of _components.values()) {\r\n container.addComponent(component);\r\n }\r\n const newApp = new FirebaseAppImpl(options, config, container);\r\n _apps.set(name, newApp);\r\n return newApp;\r\n}\r\n/**\r\n * Retrieves a {@link @firebase/app#FirebaseApp} instance.\r\n *\r\n * When called with no arguments, the default app is returned. When an app name\r\n * is provided, the app corresponding to that name is returned.\r\n *\r\n * An exception is thrown if the app being retrieved has not yet been\r\n * initialized.\r\n *\r\n * @example\r\n * ```javascript\r\n * // Return the default app\r\n * const app = getApp();\r\n * ```\r\n *\r\n * @example\r\n * ```javascript\r\n * // Return a named app\r\n * const otherApp = getApp(\"otherApp\");\r\n * ```\r\n *\r\n * @param name - Optional name of the app to return. If no name is\r\n * provided, the default is `\"[DEFAULT]\"`.\r\n *\r\n * @returns The app corresponding to the provided app name.\r\n * If no app name is provided, the default app is returned.\r\n *\r\n * @public\r\n */\r\nfunction getApp(name = DEFAULT_ENTRY_NAME) {\r\n const app = _apps.get(name);\r\n if (!app && name === DEFAULT_ENTRY_NAME && getDefaultAppConfig()) {\r\n return initializeApp();\r\n }\r\n if (!app) {\r\n throw ERROR_FACTORY.create(\"no-app\" /* AppError.NO_APP */, { appName: name });\r\n }\r\n return app;\r\n}\r\n/**\r\n * A (read-only) array of all initialized apps.\r\n * @public\r\n */\r\nfunction getApps() {\r\n return Array.from(_apps.values());\r\n}\r\n/**\r\n * Renders this app unusable and frees the resources of all associated\r\n * services.\r\n *\r\n * @example\r\n * ```javascript\r\n * deleteApp(app)\r\n * .then(function() {\r\n * console.log(\"App deleted successfully\");\r\n * })\r\n * .catch(function(error) {\r\n * console.log(\"Error deleting app:\", error);\r\n * });\r\n * ```\r\n *\r\n * @public\r\n */\r\nasync function deleteApp(app) {\r\n const name = app.name;\r\n if (_apps.has(name)) {\r\n _apps.delete(name);\r\n await Promise.all(app.container\r\n .getProviders()\r\n .map(provider => provider.delete()));\r\n app.isDeleted = true;\r\n }\r\n}\r\n/**\r\n * Registers a library's name and version for platform logging purposes.\r\n * @param library - Name of 1p or 3p library (e.g. firestore, angularfire)\r\n * @param version - Current version of that library.\r\n * @param variant - Bundle variant, e.g., node, rn, etc.\r\n *\r\n * @public\r\n */\r\nfunction registerVersion(libraryKeyOrName, version, variant) {\r\n var _a;\r\n // TODO: We can use this check to whitelist strings when/if we set up\r\n // a good whitelist system.\r\n let library = (_a = PLATFORM_LOG_STRING[libraryKeyOrName]) !== null && _a !== void 0 ? _a : libraryKeyOrName;\r\n if (variant) {\r\n library += `-${variant}`;\r\n }\r\n const libraryMismatch = library.match(/\\s|\\//);\r\n const versionMismatch = version.match(/\\s|\\//);\r\n if (libraryMismatch || versionMismatch) {\r\n const warning = [\r\n `Unable to register library \"${library}\" with version \"${version}\":`\r\n ];\r\n if (libraryMismatch) {\r\n warning.push(`library name \"${library}\" contains illegal characters (whitespace or \"/\")`);\r\n }\r\n if (libraryMismatch && versionMismatch) {\r\n warning.push('and');\r\n }\r\n if (versionMismatch) {\r\n warning.push(`version name \"${version}\" contains illegal characters (whitespace or \"/\")`);\r\n }\r\n logger.warn(warning.join(' '));\r\n return;\r\n }\r\n _registerComponent(new Component(`${library}-version`, () => ({ library, version }), \"VERSION\" /* ComponentType.VERSION */));\r\n}\r\n/**\r\n * Sets log handler for all Firebase SDKs.\r\n * @param logCallback - An optional custom log handler that executes user code whenever\r\n * the Firebase SDK makes a logging call.\r\n *\r\n * @public\r\n */\r\nfunction onLog(logCallback, options) {\r\n if (logCallback !== null && typeof logCallback !== 'function') {\r\n throw ERROR_FACTORY.create(\"invalid-log-argument\" /* AppError.INVALID_LOG_ARGUMENT */);\r\n }\r\n setUserLogHandler(logCallback, options);\r\n}\r\n/**\r\n * Sets log level for all Firebase SDKs.\r\n *\r\n * All of the log types above the current log level are captured (i.e. if\r\n * you set the log level to `info`, errors are logged, but `debug` and\r\n * `verbose` logs are not).\r\n *\r\n * @public\r\n */\r\nfunction setLogLevel(logLevel) {\r\n setLogLevel$1(logLevel);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2021 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst DB_NAME = 'firebase-heartbeat-database';\r\nconst DB_VERSION = 1;\r\nconst STORE_NAME = 'firebase-heartbeat-store';\r\nlet dbPromise = null;\r\nfunction getDbPromise() {\r\n if (!dbPromise) {\r\n dbPromise = openDB(DB_NAME, DB_VERSION, {\r\n upgrade: (db, oldVersion) => {\r\n // We don't use 'break' in this switch statement, the fall-through\r\n // behavior is what we want, because if there are multiple versions between\r\n // the old version and the current version, we want ALL the migrations\r\n // that correspond to those versions to run, not only the last one.\r\n // eslint-disable-next-line default-case\r\n switch (oldVersion) {\r\n case 0:\r\n try {\r\n db.createObjectStore(STORE_NAME);\r\n }\r\n catch (e) {\r\n // Safari/iOS browsers throw occasional exceptions on\r\n // db.createObjectStore() that may be a bug. Avoid blocking\r\n // the rest of the app functionality.\r\n console.warn(e);\r\n }\r\n }\r\n }\r\n }).catch(e => {\r\n throw ERROR_FACTORY.create(\"idb-open\" /* AppError.IDB_OPEN */, {\r\n originalErrorMessage: e.message\r\n });\r\n });\r\n }\r\n return dbPromise;\r\n}\r\nasync function readHeartbeatsFromIndexedDB(app) {\r\n try {\r\n const db = await getDbPromise();\r\n const tx = db.transaction(STORE_NAME);\r\n const result = await tx.objectStore(STORE_NAME).get(computeKey(app));\r\n // We already have the value but tx.done can throw,\r\n // so we need to await it here to catch errors\r\n await tx.done;\r\n return result;\r\n }\r\n catch (e) {\r\n if (e instanceof FirebaseError) {\r\n logger.warn(e.message);\r\n }\r\n else {\r\n const idbGetError = ERROR_FACTORY.create(\"idb-get\" /* AppError.IDB_GET */, {\r\n originalErrorMessage: e === null || e === void 0 ? void 0 : e.message\r\n });\r\n logger.warn(idbGetError.message);\r\n }\r\n }\r\n}\r\nasync function writeHeartbeatsToIndexedDB(app, heartbeatObject) {\r\n try {\r\n const db = await getDbPromise();\r\n const tx = db.transaction(STORE_NAME, 'readwrite');\r\n const objectStore = tx.objectStore(STORE_NAME);\r\n await objectStore.put(heartbeatObject, computeKey(app));\r\n await tx.done;\r\n }\r\n catch (e) {\r\n if (e instanceof FirebaseError) {\r\n logger.warn(e.message);\r\n }\r\n else {\r\n const idbGetError = ERROR_FACTORY.create(\"idb-set\" /* AppError.IDB_WRITE */, {\r\n originalErrorMessage: e === null || e === void 0 ? void 0 : e.message\r\n });\r\n logger.warn(idbGetError.message);\r\n }\r\n }\r\n}\r\nfunction computeKey(app) {\r\n return `${app.name}!${app.options.appId}`;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2021 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst MAX_HEADER_BYTES = 1024;\r\n// 30 days\r\nconst STORED_HEARTBEAT_RETENTION_MAX_MILLIS = 30 * 24 * 60 * 60 * 1000;\r\nclass HeartbeatServiceImpl {\r\n constructor(container) {\r\n this.container = container;\r\n /**\r\n * In-memory cache for heartbeats, used by getHeartbeatsHeader() to generate\r\n * the header string.\r\n * Stores one record per date. This will be consolidated into the standard\r\n * format of one record per user agent string before being sent as a header.\r\n * Populated from indexedDB when the controller is instantiated and should\r\n * be kept in sync with indexedDB.\r\n * Leave public for easier testing.\r\n */\r\n this._heartbeatsCache = null;\r\n const app = this.container.getProvider('app').getImmediate();\r\n this._storage = new HeartbeatStorageImpl(app);\r\n this._heartbeatsCachePromise = this._storage.read().then(result => {\r\n this._heartbeatsCache = result;\r\n return result;\r\n });\r\n }\r\n /**\r\n * Called to report a heartbeat. The function will generate\r\n * a HeartbeatsByUserAgent object, update heartbeatsCache, and persist it\r\n * to IndexedDB.\r\n * Note that we only store one heartbeat per day. So if a heartbeat for today is\r\n * already logged, subsequent calls to this function in the same day will be ignored.\r\n */\r\n async triggerHeartbeat() {\r\n var _a, _b;\r\n const platformLogger = this.container\r\n .getProvider('platform-logger')\r\n .getImmediate();\r\n // This is the \"Firebase user agent\" string from the platform logger\r\n // service, not the browser user agent.\r\n const agent = platformLogger.getPlatformInfoString();\r\n const date = getUTCDateString();\r\n if (((_a = this._heartbeatsCache) === null || _a === void 0 ? void 0 : _a.heartbeats) == null) {\r\n this._heartbeatsCache = await this._heartbeatsCachePromise;\r\n // If we failed to construct a heartbeats cache, then return immediately.\r\n if (((_b = this._heartbeatsCache) === null || _b === void 0 ? void 0 : _b.heartbeats) == null) {\r\n return;\r\n }\r\n }\r\n // Do not store a heartbeat if one is already stored for this day\r\n // or if a header has already been sent today.\r\n if (this._heartbeatsCache.lastSentHeartbeatDate === date ||\r\n this._heartbeatsCache.heartbeats.some(singleDateHeartbeat => singleDateHeartbeat.date === date)) {\r\n return;\r\n }\r\n else {\r\n // There is no entry for this date. Create one.\r\n this._heartbeatsCache.heartbeats.push({ date, agent });\r\n }\r\n // Remove entries older than 30 days.\r\n this._heartbeatsCache.heartbeats = this._heartbeatsCache.heartbeats.filter(singleDateHeartbeat => {\r\n const hbTimestamp = new Date(singleDateHeartbeat.date).valueOf();\r\n const now = Date.now();\r\n return now - hbTimestamp <= STORED_HEARTBEAT_RETENTION_MAX_MILLIS;\r\n });\r\n return this._storage.overwrite(this._heartbeatsCache);\r\n }\r\n /**\r\n * Returns a base64 encoded string which can be attached to the heartbeat-specific header directly.\r\n * It also clears all heartbeats from memory as well as in IndexedDB.\r\n *\r\n * NOTE: Consuming product SDKs should not send the header if this method\r\n * returns an empty string.\r\n */\r\n async getHeartbeatsHeader() {\r\n var _a;\r\n if (this._heartbeatsCache === null) {\r\n await this._heartbeatsCachePromise;\r\n }\r\n // If it's still null or the array is empty, there is no data to send.\r\n if (((_a = this._heartbeatsCache) === null || _a === void 0 ? void 0 : _a.heartbeats) == null ||\r\n this._heartbeatsCache.heartbeats.length === 0) {\r\n return '';\r\n }\r\n const date = getUTCDateString();\r\n // Extract as many heartbeats from the cache as will fit under the size limit.\r\n const { heartbeatsToSend, unsentEntries } = extractHeartbeatsForHeader(this._heartbeatsCache.heartbeats);\r\n const headerString = base64urlEncodeWithoutPadding(JSON.stringify({ version: 2, heartbeats: heartbeatsToSend }));\r\n // Store last sent date to prevent another being logged/sent for the same day.\r\n this._heartbeatsCache.lastSentHeartbeatDate = date;\r\n if (unsentEntries.length > 0) {\r\n // Store any unsent entries if they exist.\r\n this._heartbeatsCache.heartbeats = unsentEntries;\r\n // This seems more likely than emptying the array (below) to lead to some odd state\r\n // since the cache isn't empty and this will be called again on the next request,\r\n // and is probably safest if we await it.\r\n await this._storage.overwrite(this._heartbeatsCache);\r\n }\r\n else {\r\n this._heartbeatsCache.heartbeats = [];\r\n // Do not wait for this, to reduce latency.\r\n void this._storage.overwrite(this._heartbeatsCache);\r\n }\r\n return headerString;\r\n }\r\n}\r\nfunction getUTCDateString() {\r\n const today = new Date();\r\n // Returns date format 'YYYY-MM-DD'\r\n return today.toISOString().substring(0, 10);\r\n}\r\nfunction extractHeartbeatsForHeader(heartbeatsCache, maxSize = MAX_HEADER_BYTES) {\r\n // Heartbeats grouped by user agent in the standard format to be sent in\r\n // the header.\r\n const heartbeatsToSend = [];\r\n // Single date format heartbeats that are not sent.\r\n let unsentEntries = heartbeatsCache.slice();\r\n for (const singleDateHeartbeat of heartbeatsCache) {\r\n // Look for an existing entry with the same user agent.\r\n const heartbeatEntry = heartbeatsToSend.find(hb => hb.agent === singleDateHeartbeat.agent);\r\n if (!heartbeatEntry) {\r\n // If no entry for this user agent exists, create one.\r\n heartbeatsToSend.push({\r\n agent: singleDateHeartbeat.agent,\r\n dates: [singleDateHeartbeat.date]\r\n });\r\n if (countBytes(heartbeatsToSend) > maxSize) {\r\n // If the header would exceed max size, remove the added heartbeat\r\n // entry and stop adding to the header.\r\n heartbeatsToSend.pop();\r\n break;\r\n }\r\n }\r\n else {\r\n heartbeatEntry.dates.push(singleDateHeartbeat.date);\r\n // If the header would exceed max size, remove the added date\r\n // and stop adding to the header.\r\n if (countBytes(heartbeatsToSend) > maxSize) {\r\n heartbeatEntry.dates.pop();\r\n break;\r\n }\r\n }\r\n // Pop unsent entry from queue. (Skipped if adding the entry exceeded\r\n // quota and the loop breaks early.)\r\n unsentEntries = unsentEntries.slice(1);\r\n }\r\n return {\r\n heartbeatsToSend,\r\n unsentEntries\r\n };\r\n}\r\nclass HeartbeatStorageImpl {\r\n constructor(app) {\r\n this.app = app;\r\n this._canUseIndexedDBPromise = this.runIndexedDBEnvironmentCheck();\r\n }\r\n async runIndexedDBEnvironmentCheck() {\r\n if (!isIndexedDBAvailable()) {\r\n return false;\r\n }\r\n else {\r\n return validateIndexedDBOpenable()\r\n .then(() => true)\r\n .catch(() => false);\r\n }\r\n }\r\n /**\r\n * Read all heartbeats.\r\n */\r\n async read() {\r\n const canUseIndexedDB = await this._canUseIndexedDBPromise;\r\n if (!canUseIndexedDB) {\r\n return { heartbeats: [] };\r\n }\r\n else {\r\n const idbHeartbeatObject = await readHeartbeatsFromIndexedDB(this.app);\r\n if (idbHeartbeatObject === null || idbHeartbeatObject === void 0 ? void 0 : idbHeartbeatObject.heartbeats) {\r\n return idbHeartbeatObject;\r\n }\r\n else {\r\n return { heartbeats: [] };\r\n }\r\n }\r\n }\r\n // overwrite the storage with the provided heartbeats\r\n async overwrite(heartbeatsObject) {\r\n var _a;\r\n const canUseIndexedDB = await this._canUseIndexedDBPromise;\r\n if (!canUseIndexedDB) {\r\n return;\r\n }\r\n else {\r\n const existingHeartbeatsObject = await this.read();\r\n return writeHeartbeatsToIndexedDB(this.app, {\r\n lastSentHeartbeatDate: (_a = heartbeatsObject.lastSentHeartbeatDate) !== null && _a !== void 0 ? _a : existingHeartbeatsObject.lastSentHeartbeatDate,\r\n heartbeats: heartbeatsObject.heartbeats\r\n });\r\n }\r\n }\r\n // add heartbeats\r\n async add(heartbeatsObject) {\r\n var _a;\r\n const canUseIndexedDB = await this._canUseIndexedDBPromise;\r\n if (!canUseIndexedDB) {\r\n return;\r\n }\r\n else {\r\n const existingHeartbeatsObject = await this.read();\r\n return writeHeartbeatsToIndexedDB(this.app, {\r\n lastSentHeartbeatDate: (_a = heartbeatsObject.lastSentHeartbeatDate) !== null && _a !== void 0 ? _a : existingHeartbeatsObject.lastSentHeartbeatDate,\r\n heartbeats: [\r\n ...existingHeartbeatsObject.heartbeats,\r\n ...heartbeatsObject.heartbeats\r\n ]\r\n });\r\n }\r\n }\r\n}\r\n/**\r\n * Calculate bytes of a HeartbeatsByUserAgent array after being wrapped\r\n * in a platform logging header JSON object, stringified, and converted\r\n * to base 64.\r\n */\r\nfunction countBytes(heartbeatsCache) {\r\n // base64 has a restricted set of characters, all of which should be 1 byte.\r\n return base64urlEncodeWithoutPadding(\r\n // heartbeatsCache wrapper properties\r\n JSON.stringify({ version: 2, heartbeats: heartbeatsCache })).length;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction registerCoreComponents(variant) {\r\n _registerComponent(new Component('platform-logger', container => new PlatformLoggerServiceImpl(container), \"PRIVATE\" /* ComponentType.PRIVATE */));\r\n _registerComponent(new Component('heartbeat', container => new HeartbeatServiceImpl(container), \"PRIVATE\" /* ComponentType.PRIVATE */));\r\n // Register `app` package.\r\n registerVersion(name$o, version$1, variant);\r\n // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation\r\n registerVersion(name$o, version$1, 'esm2017');\r\n // Register platform SDK identifier (no version).\r\n registerVersion('fire-js', '');\r\n}\n\n/**\r\n * Firebase App\r\n *\r\n * @remarks This package coordinates the communication between the different Firebase components\r\n * @packageDocumentation\r\n */\r\nregisterCoreComponents('');\n\nexport { SDK_VERSION, DEFAULT_ENTRY_NAME as _DEFAULT_ENTRY_NAME, _addComponent, _addOrOverwriteComponent, _apps, _clearComponents, _components, _getProvider, _registerComponent, _removeServiceInstance, deleteApp, getApp, getApps, initializeApp, onLog, registerVersion, setLogLevel };\n//# sourceMappingURL=index.esm2017.js.map\n","import { Deferred } from '@firebase/util';\n\n/**\r\n * Component for service name T, e.g. `auth`, `auth-internal`\r\n */\r\nclass Component {\r\n /**\r\n *\r\n * @param name The public service name, e.g. app, auth, firestore, database\r\n * @param instanceFactory Service factory responsible for creating the public interface\r\n * @param type whether the service provided by the component is public or private\r\n */\r\n constructor(name, instanceFactory, type) {\r\n this.name = name;\r\n this.instanceFactory = instanceFactory;\r\n this.type = type;\r\n this.multipleInstances = false;\r\n /**\r\n * Properties to be added to the service namespace\r\n */\r\n this.serviceProps = {};\r\n this.instantiationMode = \"LAZY\" /* InstantiationMode.LAZY */;\r\n this.onInstanceCreated = null;\r\n }\r\n setInstantiationMode(mode) {\r\n this.instantiationMode = mode;\r\n return this;\r\n }\r\n setMultipleInstances(multipleInstances) {\r\n this.multipleInstances = multipleInstances;\r\n return this;\r\n }\r\n setServiceProps(props) {\r\n this.serviceProps = props;\r\n return this;\r\n }\r\n setInstanceCreatedCallback(callback) {\r\n this.onInstanceCreated = callback;\r\n return this;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst DEFAULT_ENTRY_NAME = '[DEFAULT]';\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Provider for instance for service name T, e.g. 'auth', 'auth-internal'\r\n * NameServiceMapping[T] is an alias for the type of the instance\r\n */\r\nclass Provider {\r\n constructor(name, container) {\r\n this.name = name;\r\n this.container = container;\r\n this.component = null;\r\n this.instances = new Map();\r\n this.instancesDeferred = new Map();\r\n this.instancesOptions = new Map();\r\n this.onInitCallbacks = new Map();\r\n }\r\n /**\r\n * @param identifier A provider can provide mulitple instances of a service\r\n * if this.component.multipleInstances is true.\r\n */\r\n get(identifier) {\r\n // if multipleInstances is not supported, use the default name\r\n const normalizedIdentifier = this.normalizeInstanceIdentifier(identifier);\r\n if (!this.instancesDeferred.has(normalizedIdentifier)) {\r\n const deferred = new Deferred();\r\n this.instancesDeferred.set(normalizedIdentifier, deferred);\r\n if (this.isInitialized(normalizedIdentifier) ||\r\n this.shouldAutoInitialize()) {\r\n // initialize the service if it can be auto-initialized\r\n try {\r\n const instance = this.getOrInitializeService({\r\n instanceIdentifier: normalizedIdentifier\r\n });\r\n if (instance) {\r\n deferred.resolve(instance);\r\n }\r\n }\r\n catch (e) {\r\n // when the instance factory throws an exception during get(), it should not cause\r\n // a fatal error. We just return the unresolved promise in this case.\r\n }\r\n }\r\n }\r\n return this.instancesDeferred.get(normalizedIdentifier).promise;\r\n }\r\n getImmediate(options) {\r\n var _a;\r\n // if multipleInstances is not supported, use the default name\r\n const normalizedIdentifier = this.normalizeInstanceIdentifier(options === null || options === void 0 ? void 0 : options.identifier);\r\n const optional = (_a = options === null || options === void 0 ? void 0 : options.optional) !== null && _a !== void 0 ? _a : false;\r\n if (this.isInitialized(normalizedIdentifier) ||\r\n this.shouldAutoInitialize()) {\r\n try {\r\n return this.getOrInitializeService({\r\n instanceIdentifier: normalizedIdentifier\r\n });\r\n }\r\n catch (e) {\r\n if (optional) {\r\n return null;\r\n }\r\n else {\r\n throw e;\r\n }\r\n }\r\n }\r\n else {\r\n // In case a component is not initialized and should/can not be auto-initialized at the moment, return null if the optional flag is set, or throw\r\n if (optional) {\r\n return null;\r\n }\r\n else {\r\n throw Error(`Service ${this.name} is not available`);\r\n }\r\n }\r\n }\r\n getComponent() {\r\n return this.component;\r\n }\r\n setComponent(component) {\r\n if (component.name !== this.name) {\r\n throw Error(`Mismatching Component ${component.name} for Provider ${this.name}.`);\r\n }\r\n if (this.component) {\r\n throw Error(`Component for ${this.name} has already been provided`);\r\n }\r\n this.component = component;\r\n // return early without attempting to initialize the component if the component requires explicit initialization (calling `Provider.initialize()`)\r\n if (!this.shouldAutoInitialize()) {\r\n return;\r\n }\r\n // if the service is eager, initialize the default instance\r\n if (isComponentEager(component)) {\r\n try {\r\n this.getOrInitializeService({ instanceIdentifier: DEFAULT_ENTRY_NAME });\r\n }\r\n catch (e) {\r\n // when the instance factory for an eager Component throws an exception during the eager\r\n // initialization, it should not cause a fatal error.\r\n // TODO: Investigate if we need to make it configurable, because some component may want to cause\r\n // a fatal error in this case?\r\n }\r\n }\r\n // Create service instances for the pending promises and resolve them\r\n // NOTE: if this.multipleInstances is false, only the default instance will be created\r\n // and all promises with resolve with it regardless of the identifier.\r\n for (const [instanceIdentifier, instanceDeferred] of this.instancesDeferred.entries()) {\r\n const normalizedIdentifier = this.normalizeInstanceIdentifier(instanceIdentifier);\r\n try {\r\n // `getOrInitializeService()` should always return a valid instance since a component is guaranteed. use ! to make typescript happy.\r\n const instance = this.getOrInitializeService({\r\n instanceIdentifier: normalizedIdentifier\r\n });\r\n instanceDeferred.resolve(instance);\r\n }\r\n catch (e) {\r\n // when the instance factory throws an exception, it should not cause\r\n // a fatal error. We just leave the promise unresolved.\r\n }\r\n }\r\n }\r\n clearInstance(identifier = DEFAULT_ENTRY_NAME) {\r\n this.instancesDeferred.delete(identifier);\r\n this.instancesOptions.delete(identifier);\r\n this.instances.delete(identifier);\r\n }\r\n // app.delete() will call this method on every provider to delete the services\r\n // TODO: should we mark the provider as deleted?\r\n async delete() {\r\n const services = Array.from(this.instances.values());\r\n await Promise.all([\r\n ...services\r\n .filter(service => 'INTERNAL' in service) // legacy services\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n .map(service => service.INTERNAL.delete()),\r\n ...services\r\n .filter(service => '_delete' in service) // modularized services\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n .map(service => service._delete())\r\n ]);\r\n }\r\n isComponentSet() {\r\n return this.component != null;\r\n }\r\n isInitialized(identifier = DEFAULT_ENTRY_NAME) {\r\n return this.instances.has(identifier);\r\n }\r\n getOptions(identifier = DEFAULT_ENTRY_NAME) {\r\n return this.instancesOptions.get(identifier) || {};\r\n }\r\n initialize(opts = {}) {\r\n const { options = {} } = opts;\r\n const normalizedIdentifier = this.normalizeInstanceIdentifier(opts.instanceIdentifier);\r\n if (this.isInitialized(normalizedIdentifier)) {\r\n throw Error(`${this.name}(${normalizedIdentifier}) has already been initialized`);\r\n }\r\n if (!this.isComponentSet()) {\r\n throw Error(`Component ${this.name} has not been registered yet`);\r\n }\r\n const instance = this.getOrInitializeService({\r\n instanceIdentifier: normalizedIdentifier,\r\n options\r\n });\r\n // resolve any pending promise waiting for the service instance\r\n for (const [instanceIdentifier, instanceDeferred] of this.instancesDeferred.entries()) {\r\n const normalizedDeferredIdentifier = this.normalizeInstanceIdentifier(instanceIdentifier);\r\n if (normalizedIdentifier === normalizedDeferredIdentifier) {\r\n instanceDeferred.resolve(instance);\r\n }\r\n }\r\n return instance;\r\n }\r\n /**\r\n *\r\n * @param callback - a function that will be invoked after the provider has been initialized by calling provider.initialize().\r\n * The function is invoked SYNCHRONOUSLY, so it should not execute any longrunning tasks in order to not block the program.\r\n *\r\n * @param identifier An optional instance identifier\r\n * @returns a function to unregister the callback\r\n */\r\n onInit(callback, identifier) {\r\n var _a;\r\n const normalizedIdentifier = this.normalizeInstanceIdentifier(identifier);\r\n const existingCallbacks = (_a = this.onInitCallbacks.get(normalizedIdentifier)) !== null && _a !== void 0 ? _a : new Set();\r\n existingCallbacks.add(callback);\r\n this.onInitCallbacks.set(normalizedIdentifier, existingCallbacks);\r\n const existingInstance = this.instances.get(normalizedIdentifier);\r\n if (existingInstance) {\r\n callback(existingInstance, normalizedIdentifier);\r\n }\r\n return () => {\r\n existingCallbacks.delete(callback);\r\n };\r\n }\r\n /**\r\n * Invoke onInit callbacks synchronously\r\n * @param instance the service instance`\r\n */\r\n invokeOnInitCallbacks(instance, identifier) {\r\n const callbacks = this.onInitCallbacks.get(identifier);\r\n if (!callbacks) {\r\n return;\r\n }\r\n for (const callback of callbacks) {\r\n try {\r\n callback(instance, identifier);\r\n }\r\n catch (_a) {\r\n // ignore errors in the onInit callback\r\n }\r\n }\r\n }\r\n getOrInitializeService({ instanceIdentifier, options = {} }) {\r\n let instance = this.instances.get(instanceIdentifier);\r\n if (!instance && this.component) {\r\n instance = this.component.instanceFactory(this.container, {\r\n instanceIdentifier: normalizeIdentifierForFactory(instanceIdentifier),\r\n options\r\n });\r\n this.instances.set(instanceIdentifier, instance);\r\n this.instancesOptions.set(instanceIdentifier, options);\r\n /**\r\n * Invoke onInit listeners.\r\n * Note this.component.onInstanceCreated is different, which is used by the component creator,\r\n * while onInit listeners are registered by consumers of the provider.\r\n */\r\n this.invokeOnInitCallbacks(instance, instanceIdentifier);\r\n /**\r\n * Order is important\r\n * onInstanceCreated() should be called after this.instances.set(instanceIdentifier, instance); which\r\n * makes `isInitialized()` return true.\r\n */\r\n if (this.component.onInstanceCreated) {\r\n try {\r\n this.component.onInstanceCreated(this.container, instanceIdentifier, instance);\r\n }\r\n catch (_a) {\r\n // ignore errors in the onInstanceCreatedCallback\r\n }\r\n }\r\n }\r\n return instance || null;\r\n }\r\n normalizeInstanceIdentifier(identifier = DEFAULT_ENTRY_NAME) {\r\n if (this.component) {\r\n return this.component.multipleInstances ? identifier : DEFAULT_ENTRY_NAME;\r\n }\r\n else {\r\n return identifier; // assume multiple instances are supported before the component is provided.\r\n }\r\n }\r\n shouldAutoInitialize() {\r\n return (!!this.component &&\r\n this.component.instantiationMode !== \"EXPLICIT\" /* InstantiationMode.EXPLICIT */);\r\n }\r\n}\r\n// undefined should be passed to the service factory for the default instance\r\nfunction normalizeIdentifierForFactory(identifier) {\r\n return identifier === DEFAULT_ENTRY_NAME ? undefined : identifier;\r\n}\r\nfunction isComponentEager(component) {\r\n return component.instantiationMode === \"EAGER\" /* InstantiationMode.EAGER */;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * ComponentContainer that provides Providers for service name T, e.g. `auth`, `auth-internal`\r\n */\r\nclass ComponentContainer {\r\n constructor(name) {\r\n this.name = name;\r\n this.providers = new Map();\r\n }\r\n /**\r\n *\r\n * @param component Component being added\r\n * @param overwrite When a component with the same name has already been registered,\r\n * if overwrite is true: overwrite the existing component with the new component and create a new\r\n * provider with the new component. It can be useful in tests where you want to use different mocks\r\n * for different tests.\r\n * if overwrite is false: throw an exception\r\n */\r\n addComponent(component) {\r\n const provider = this.getProvider(component.name);\r\n if (provider.isComponentSet()) {\r\n throw new Error(`Component ${component.name} has already been registered with ${this.name}`);\r\n }\r\n provider.setComponent(component);\r\n }\r\n addOrOverwriteComponent(component) {\r\n const provider = this.getProvider(component.name);\r\n if (provider.isComponentSet()) {\r\n // delete the existing provider from the container, so we can register the new component\r\n this.providers.delete(component.name);\r\n }\r\n this.addComponent(component);\r\n }\r\n /**\r\n * getProvider provides a type safe interface where it can only be called with a field name\r\n * present in NameServiceMapping interface.\r\n *\r\n * Firebase SDKs providing services should extend NameServiceMapping interface to register\r\n * themselves.\r\n */\r\n getProvider(name) {\r\n if (this.providers.has(name)) {\r\n return this.providers.get(name);\r\n }\r\n // create a Provider for a service that hasn't registered with Firebase\r\n const provider = new Provider(name, this);\r\n this.providers.set(name, provider);\r\n return provider;\r\n }\r\n getProviders() {\r\n return Array.from(this.providers.values());\r\n }\r\n}\n\nexport { Component, ComponentContainer, Provider };\n//# sourceMappingURL=index.esm2017.js.map\n","/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * A container for all of the Logger instances\r\n */\r\nconst instances = [];\r\n/**\r\n * The JS SDK supports 5 log levels and also allows a user the ability to\r\n * silence the logs altogether.\r\n *\r\n * The order is a follows:\r\n * DEBUG < VERBOSE < INFO < WARN < ERROR\r\n *\r\n * All of the log types above the current log level will be captured (i.e. if\r\n * you set the log level to `INFO`, errors will still be logged, but `DEBUG` and\r\n * `VERBOSE` logs will not)\r\n */\r\nvar LogLevel;\r\n(function (LogLevel) {\r\n LogLevel[LogLevel[\"DEBUG\"] = 0] = \"DEBUG\";\r\n LogLevel[LogLevel[\"VERBOSE\"] = 1] = \"VERBOSE\";\r\n LogLevel[LogLevel[\"INFO\"] = 2] = \"INFO\";\r\n LogLevel[LogLevel[\"WARN\"] = 3] = \"WARN\";\r\n LogLevel[LogLevel[\"ERROR\"] = 4] = \"ERROR\";\r\n LogLevel[LogLevel[\"SILENT\"] = 5] = \"SILENT\";\r\n})(LogLevel || (LogLevel = {}));\r\nconst levelStringToEnum = {\r\n 'debug': LogLevel.DEBUG,\r\n 'verbose': LogLevel.VERBOSE,\r\n 'info': LogLevel.INFO,\r\n 'warn': LogLevel.WARN,\r\n 'error': LogLevel.ERROR,\r\n 'silent': LogLevel.SILENT\r\n};\r\n/**\r\n * The default log level\r\n */\r\nconst defaultLogLevel = LogLevel.INFO;\r\n/**\r\n * By default, `console.debug` is not displayed in the developer console (in\r\n * chrome). To avoid forcing users to have to opt-in to these logs twice\r\n * (i.e. once for firebase, and once in the console), we are sending `DEBUG`\r\n * logs to the `console.log` function.\r\n */\r\nconst ConsoleMethod = {\r\n [LogLevel.DEBUG]: 'log',\r\n [LogLevel.VERBOSE]: 'log',\r\n [LogLevel.INFO]: 'info',\r\n [LogLevel.WARN]: 'warn',\r\n [LogLevel.ERROR]: 'error'\r\n};\r\n/**\r\n * The default log handler will forward DEBUG, VERBOSE, INFO, WARN, and ERROR\r\n * messages on to their corresponding console counterparts (if the log method\r\n * is supported by the current log level)\r\n */\r\nconst defaultLogHandler = (instance, logType, ...args) => {\r\n if (logType < instance.logLevel) {\r\n return;\r\n }\r\n const now = new Date().toISOString();\r\n const method = ConsoleMethod[logType];\r\n if (method) {\r\n console[method](`[${now}] ${instance.name}:`, ...args);\r\n }\r\n else {\r\n throw new Error(`Attempted to log a message with an invalid logType (value: ${logType})`);\r\n }\r\n};\r\nclass Logger {\r\n /**\r\n * Gives you an instance of a Logger to capture messages according to\r\n * Firebase's logging scheme.\r\n *\r\n * @param name The name that the logs will be associated with\r\n */\r\n constructor(name) {\r\n this.name = name;\r\n /**\r\n * The log level of the given Logger instance.\r\n */\r\n this._logLevel = defaultLogLevel;\r\n /**\r\n * The main (internal) log handler for the Logger instance.\r\n * Can be set to a new function in internal package code but not by user.\r\n */\r\n this._logHandler = defaultLogHandler;\r\n /**\r\n * The optional, additional, user-defined log handler for the Logger instance.\r\n */\r\n this._userLogHandler = null;\r\n /**\r\n * Capture the current instance for later use\r\n */\r\n instances.push(this);\r\n }\r\n get logLevel() {\r\n return this._logLevel;\r\n }\r\n set logLevel(val) {\r\n if (!(val in LogLevel)) {\r\n throw new TypeError(`Invalid value \"${val}\" assigned to \\`logLevel\\``);\r\n }\r\n this._logLevel = val;\r\n }\r\n // Workaround for setter/getter having to be the same type.\r\n setLogLevel(val) {\r\n this._logLevel = typeof val === 'string' ? levelStringToEnum[val] : val;\r\n }\r\n get logHandler() {\r\n return this._logHandler;\r\n }\r\n set logHandler(val) {\r\n if (typeof val !== 'function') {\r\n throw new TypeError('Value assigned to `logHandler` must be a function');\r\n }\r\n this._logHandler = val;\r\n }\r\n get userLogHandler() {\r\n return this._userLogHandler;\r\n }\r\n set userLogHandler(val) {\r\n this._userLogHandler = val;\r\n }\r\n /**\r\n * The functions below are all based on the `console` interface\r\n */\r\n debug(...args) {\r\n this._userLogHandler && this._userLogHandler(this, LogLevel.DEBUG, ...args);\r\n this._logHandler(this, LogLevel.DEBUG, ...args);\r\n }\r\n log(...args) {\r\n this._userLogHandler &&\r\n this._userLogHandler(this, LogLevel.VERBOSE, ...args);\r\n this._logHandler(this, LogLevel.VERBOSE, ...args);\r\n }\r\n info(...args) {\r\n this._userLogHandler && this._userLogHandler(this, LogLevel.INFO, ...args);\r\n this._logHandler(this, LogLevel.INFO, ...args);\r\n }\r\n warn(...args) {\r\n this._userLogHandler && this._userLogHandler(this, LogLevel.WARN, ...args);\r\n this._logHandler(this, LogLevel.WARN, ...args);\r\n }\r\n error(...args) {\r\n this._userLogHandler && this._userLogHandler(this, LogLevel.ERROR, ...args);\r\n this._logHandler(this, LogLevel.ERROR, ...args);\r\n }\r\n}\r\nfunction setLogLevel(level) {\r\n instances.forEach(inst => {\r\n inst.setLogLevel(level);\r\n });\r\n}\r\nfunction setUserLogHandler(logCallback, options) {\r\n for (const instance of instances) {\r\n let customLogLevel = null;\r\n if (options && options.level) {\r\n customLogLevel = levelStringToEnum[options.level];\r\n }\r\n if (logCallback === null) {\r\n instance.userLogHandler = null;\r\n }\r\n else {\r\n instance.userLogHandler = (instance, level, ...args) => {\r\n const message = args\r\n .map(arg => {\r\n if (arg == null) {\r\n return null;\r\n }\r\n else if (typeof arg === 'string') {\r\n return arg;\r\n }\r\n else if (typeof arg === 'number' || typeof arg === 'boolean') {\r\n return arg.toString();\r\n }\r\n else if (arg instanceof Error) {\r\n return arg.message;\r\n }\r\n else {\r\n try {\r\n return JSON.stringify(arg);\r\n }\r\n catch (ignored) {\r\n return null;\r\n }\r\n }\r\n })\r\n .filter(arg => arg)\r\n .join(' ');\r\n if (level >= (customLogLevel !== null && customLogLevel !== void 0 ? customLogLevel : instance.logLevel)) {\r\n logCallback({\r\n level: LogLevel[level].toLowerCase(),\r\n message,\r\n args,\r\n type: instance.name\r\n });\r\n }\r\n };\r\n }\r\n }\r\n}\n\nexport { LogLevel, Logger, setLogLevel, setUserLogHandler };\n//# sourceMappingURL=index.esm2017.js.map\n","import { registerVersion } from '@firebase/app';\nexport * from '@firebase/app';\n\nvar name = \"firebase\";\nvar version = \"10.9.0\";\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nregisterVersion(name, version, 'app');\n//# sourceMappingURL=index.esm.js.map\n","import { _getProvider, getApp, _registerComponent, registerVersion } from '@firebase/app';\nimport { Component } from '@firebase/component';\nimport { ErrorFactory, FirebaseError } from '@firebase/util';\nimport { openDB } from 'idb';\n\nconst name = \"@firebase/installations\";\nconst version = \"0.6.5\";\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst PENDING_TIMEOUT_MS = 10000;\r\nconst PACKAGE_VERSION = `w:${version}`;\r\nconst INTERNAL_AUTH_VERSION = 'FIS_v2';\r\nconst INSTALLATIONS_API_URL = 'https://firebaseinstallations.googleapis.com/v1';\r\nconst TOKEN_EXPIRATION_BUFFER = 60 * 60 * 1000; // One hour\r\nconst SERVICE = 'installations';\r\nconst SERVICE_NAME = 'Installations';\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst ERROR_DESCRIPTION_MAP = {\r\n [\"missing-app-config-values\" /* ErrorCode.MISSING_APP_CONFIG_VALUES */]: 'Missing App configuration value: \"{$valueName}\"',\r\n [\"not-registered\" /* ErrorCode.NOT_REGISTERED */]: 'Firebase Installation is not registered.',\r\n [\"installation-not-found\" /* ErrorCode.INSTALLATION_NOT_FOUND */]: 'Firebase Installation not found.',\r\n [\"request-failed\" /* ErrorCode.REQUEST_FAILED */]: '{$requestName} request failed with error \"{$serverCode} {$serverStatus}: {$serverMessage}\"',\r\n [\"app-offline\" /* ErrorCode.APP_OFFLINE */]: 'Could not process request. Application offline.',\r\n [\"delete-pending-registration\" /* ErrorCode.DELETE_PENDING_REGISTRATION */]: \"Can't delete installation while there is a pending registration request.\"\r\n};\r\nconst ERROR_FACTORY = new ErrorFactory(SERVICE, SERVICE_NAME, ERROR_DESCRIPTION_MAP);\r\n/** Returns true if error is a FirebaseError that is based on an error from the server. */\r\nfunction isServerError(error) {\r\n return (error instanceof FirebaseError &&\r\n error.code.includes(\"request-failed\" /* ErrorCode.REQUEST_FAILED */));\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction getInstallationsEndpoint({ projectId }) {\r\n return `${INSTALLATIONS_API_URL}/projects/${projectId}/installations`;\r\n}\r\nfunction extractAuthTokenInfoFromResponse(response) {\r\n return {\r\n token: response.token,\r\n requestStatus: 2 /* RequestStatus.COMPLETED */,\r\n expiresIn: getExpiresInFromResponseExpiresIn(response.expiresIn),\r\n creationTime: Date.now()\r\n };\r\n}\r\nasync function getErrorFromResponse(requestName, response) {\r\n const responseJson = await response.json();\r\n const errorData = responseJson.error;\r\n return ERROR_FACTORY.create(\"request-failed\" /* ErrorCode.REQUEST_FAILED */, {\r\n requestName,\r\n serverCode: errorData.code,\r\n serverMessage: errorData.message,\r\n serverStatus: errorData.status\r\n });\r\n}\r\nfunction getHeaders({ apiKey }) {\r\n return new Headers({\r\n 'Content-Type': 'application/json',\r\n Accept: 'application/json',\r\n 'x-goog-api-key': apiKey\r\n });\r\n}\r\nfunction getHeadersWithAuth(appConfig, { refreshToken }) {\r\n const headers = getHeaders(appConfig);\r\n headers.append('Authorization', getAuthorizationHeader(refreshToken));\r\n return headers;\r\n}\r\n/**\r\n * Calls the passed in fetch wrapper and returns the response.\r\n * If the returned response has a status of 5xx, re-runs the function once and\r\n * returns the response.\r\n */\r\nasync function retryIfServerError(fn) {\r\n const result = await fn();\r\n if (result.status >= 500 && result.status < 600) {\r\n // Internal Server Error. Retry request.\r\n return fn();\r\n }\r\n return result;\r\n}\r\nfunction getExpiresInFromResponseExpiresIn(responseExpiresIn) {\r\n // This works because the server will never respond with fractions of a second.\r\n return Number(responseExpiresIn.replace('s', '000'));\r\n}\r\nfunction getAuthorizationHeader(refreshToken) {\r\n return `${INTERNAL_AUTH_VERSION} ${refreshToken}`;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nasync function createInstallationRequest({ appConfig, heartbeatServiceProvider }, { fid }) {\r\n const endpoint = getInstallationsEndpoint(appConfig);\r\n const headers = getHeaders(appConfig);\r\n // If heartbeat service exists, add the heartbeat string to the header.\r\n const heartbeatService = heartbeatServiceProvider.getImmediate({\r\n optional: true\r\n });\r\n if (heartbeatService) {\r\n const heartbeatsHeader = await heartbeatService.getHeartbeatsHeader();\r\n if (heartbeatsHeader) {\r\n headers.append('x-firebase-client', heartbeatsHeader);\r\n }\r\n }\r\n const body = {\r\n fid,\r\n authVersion: INTERNAL_AUTH_VERSION,\r\n appId: appConfig.appId,\r\n sdkVersion: PACKAGE_VERSION\r\n };\r\n const request = {\r\n method: 'POST',\r\n headers,\r\n body: JSON.stringify(body)\r\n };\r\n const response = await retryIfServerError(() => fetch(endpoint, request));\r\n if (response.ok) {\r\n const responseValue = await response.json();\r\n const registeredInstallationEntry = {\r\n fid: responseValue.fid || fid,\r\n registrationStatus: 2 /* RequestStatus.COMPLETED */,\r\n refreshToken: responseValue.refreshToken,\r\n authToken: extractAuthTokenInfoFromResponse(responseValue.authToken)\r\n };\r\n return registeredInstallationEntry;\r\n }\r\n else {\r\n throw await getErrorFromResponse('Create Installation', response);\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/** Returns a promise that resolves after given time passes. */\r\nfunction sleep(ms) {\r\n return new Promise(resolve => {\r\n setTimeout(resolve, ms);\r\n });\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction bufferToBase64UrlSafe(array) {\r\n const b64 = btoa(String.fromCharCode(...array));\r\n return b64.replace(/\\+/g, '-').replace(/\\//g, '_');\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst VALID_FID_PATTERN = /^[cdef][\\w-]{21}$/;\r\nconst INVALID_FID = '';\r\n/**\r\n * Generates a new FID using random values from Web Crypto API.\r\n * Returns an empty string if FID generation fails for any reason.\r\n */\r\nfunction generateFid() {\r\n try {\r\n // A valid FID has exactly 22 base64 characters, which is 132 bits, or 16.5\r\n // bytes. our implementation generates a 17 byte array instead.\r\n const fidByteArray = new Uint8Array(17);\r\n const crypto = self.crypto || self.msCrypto;\r\n crypto.getRandomValues(fidByteArray);\r\n // Replace the first 4 random bits with the constant FID header of 0b0111.\r\n fidByteArray[0] = 0b01110000 + (fidByteArray[0] % 0b00010000);\r\n const fid = encode(fidByteArray);\r\n return VALID_FID_PATTERN.test(fid) ? fid : INVALID_FID;\r\n }\r\n catch (_a) {\r\n // FID generation errored\r\n return INVALID_FID;\r\n }\r\n}\r\n/** Converts a FID Uint8Array to a base64 string representation. */\r\nfunction encode(fidByteArray) {\r\n const b64String = bufferToBase64UrlSafe(fidByteArray);\r\n // Remove the 23rd character that was added because of the extra 4 bits at the\r\n // end of our 17 byte array, and the '=' padding.\r\n return b64String.substr(0, 22);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/** Returns a string key that can be used to identify the app. */\r\nfunction getKey(appConfig) {\r\n return `${appConfig.appName}!${appConfig.appId}`;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst fidChangeCallbacks = new Map();\r\n/**\r\n * Calls the onIdChange callbacks with the new FID value, and broadcasts the\r\n * change to other tabs.\r\n */\r\nfunction fidChanged(appConfig, fid) {\r\n const key = getKey(appConfig);\r\n callFidChangeCallbacks(key, fid);\r\n broadcastFidChange(key, fid);\r\n}\r\nfunction addCallback(appConfig, callback) {\r\n // Open the broadcast channel if it's not already open,\r\n // to be able to listen to change events from other tabs.\r\n getBroadcastChannel();\r\n const key = getKey(appConfig);\r\n let callbackSet = fidChangeCallbacks.get(key);\r\n if (!callbackSet) {\r\n callbackSet = new Set();\r\n fidChangeCallbacks.set(key, callbackSet);\r\n }\r\n callbackSet.add(callback);\r\n}\r\nfunction removeCallback(appConfig, callback) {\r\n const key = getKey(appConfig);\r\n const callbackSet = fidChangeCallbacks.get(key);\r\n if (!callbackSet) {\r\n return;\r\n }\r\n callbackSet.delete(callback);\r\n if (callbackSet.size === 0) {\r\n fidChangeCallbacks.delete(key);\r\n }\r\n // Close broadcast channel if there are no more callbacks.\r\n closeBroadcastChannel();\r\n}\r\nfunction callFidChangeCallbacks(key, fid) {\r\n const callbacks = fidChangeCallbacks.get(key);\r\n if (!callbacks) {\r\n return;\r\n }\r\n for (const callback of callbacks) {\r\n callback(fid);\r\n }\r\n}\r\nfunction broadcastFidChange(key, fid) {\r\n const channel = getBroadcastChannel();\r\n if (channel) {\r\n channel.postMessage({ key, fid });\r\n }\r\n closeBroadcastChannel();\r\n}\r\nlet broadcastChannel = null;\r\n/** Opens and returns a BroadcastChannel if it is supported by the browser. */\r\nfunction getBroadcastChannel() {\r\n if (!broadcastChannel && 'BroadcastChannel' in self) {\r\n broadcastChannel = new BroadcastChannel('[Firebase] FID Change');\r\n broadcastChannel.onmessage = e => {\r\n callFidChangeCallbacks(e.data.key, e.data.fid);\r\n };\r\n }\r\n return broadcastChannel;\r\n}\r\nfunction closeBroadcastChannel() {\r\n if (fidChangeCallbacks.size === 0 && broadcastChannel) {\r\n broadcastChannel.close();\r\n broadcastChannel = null;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst DATABASE_NAME = 'firebase-installations-database';\r\nconst DATABASE_VERSION = 1;\r\nconst OBJECT_STORE_NAME = 'firebase-installations-store';\r\nlet dbPromise = null;\r\nfunction getDbPromise() {\r\n if (!dbPromise) {\r\n dbPromise = openDB(DATABASE_NAME, DATABASE_VERSION, {\r\n upgrade: (db, oldVersion) => {\r\n // We don't use 'break' in this switch statement, the fall-through\r\n // behavior is what we want, because if there are multiple versions between\r\n // the old version and the current version, we want ALL the migrations\r\n // that correspond to those versions to run, not only the last one.\r\n // eslint-disable-next-line default-case\r\n switch (oldVersion) {\r\n case 0:\r\n db.createObjectStore(OBJECT_STORE_NAME);\r\n }\r\n }\r\n });\r\n }\r\n return dbPromise;\r\n}\r\n/** Assigns or overwrites the record for the given key with the given value. */\r\nasync function set(appConfig, value) {\r\n const key = getKey(appConfig);\r\n const db = await getDbPromise();\r\n const tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\r\n const objectStore = tx.objectStore(OBJECT_STORE_NAME);\r\n const oldValue = (await objectStore.get(key));\r\n await objectStore.put(value, key);\r\n await tx.done;\r\n if (!oldValue || oldValue.fid !== value.fid) {\r\n fidChanged(appConfig, value.fid);\r\n }\r\n return value;\r\n}\r\n/** Removes record(s) from the objectStore that match the given key. */\r\nasync function remove(appConfig) {\r\n const key = getKey(appConfig);\r\n const db = await getDbPromise();\r\n const tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\r\n await tx.objectStore(OBJECT_STORE_NAME).delete(key);\r\n await tx.done;\r\n}\r\n/**\r\n * Atomically updates a record with the result of updateFn, which gets\r\n * called with the current value. If newValue is undefined, the record is\r\n * deleted instead.\r\n * @return Updated value\r\n */\r\nasync function update(appConfig, updateFn) {\r\n const key = getKey(appConfig);\r\n const db = await getDbPromise();\r\n const tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\r\n const store = tx.objectStore(OBJECT_STORE_NAME);\r\n const oldValue = (await store.get(key));\r\n const newValue = updateFn(oldValue);\r\n if (newValue === undefined) {\r\n await store.delete(key);\r\n }\r\n else {\r\n await store.put(newValue, key);\r\n }\r\n await tx.done;\r\n if (newValue && (!oldValue || oldValue.fid !== newValue.fid)) {\r\n fidChanged(appConfig, newValue.fid);\r\n }\r\n return newValue;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Updates and returns the InstallationEntry from the database.\r\n * Also triggers a registration request if it is necessary and possible.\r\n */\r\nasync function getInstallationEntry(installations) {\r\n let registrationPromise;\r\n const installationEntry = await update(installations.appConfig, oldEntry => {\r\n const installationEntry = updateOrCreateInstallationEntry(oldEntry);\r\n const entryWithPromise = triggerRegistrationIfNecessary(installations, installationEntry);\r\n registrationPromise = entryWithPromise.registrationPromise;\r\n return entryWithPromise.installationEntry;\r\n });\r\n if (installationEntry.fid === INVALID_FID) {\r\n // FID generation failed. Waiting for the FID from the server.\r\n return { installationEntry: await registrationPromise };\r\n }\r\n return {\r\n installationEntry,\r\n registrationPromise\r\n };\r\n}\r\n/**\r\n * Creates a new Installation Entry if one does not exist.\r\n * Also clears timed out pending requests.\r\n */\r\nfunction updateOrCreateInstallationEntry(oldEntry) {\r\n const entry = oldEntry || {\r\n fid: generateFid(),\r\n registrationStatus: 0 /* RequestStatus.NOT_STARTED */\r\n };\r\n return clearTimedOutRequest(entry);\r\n}\r\n/**\r\n * If the Firebase Installation is not registered yet, this will trigger the\r\n * registration and return an InProgressInstallationEntry.\r\n *\r\n * If registrationPromise does not exist, the installationEntry is guaranteed\r\n * to be registered.\r\n */\r\nfunction triggerRegistrationIfNecessary(installations, installationEntry) {\r\n if (installationEntry.registrationStatus === 0 /* RequestStatus.NOT_STARTED */) {\r\n if (!navigator.onLine) {\r\n // Registration required but app is offline.\r\n const registrationPromiseWithError = Promise.reject(ERROR_FACTORY.create(\"app-offline\" /* ErrorCode.APP_OFFLINE */));\r\n return {\r\n installationEntry,\r\n registrationPromise: registrationPromiseWithError\r\n };\r\n }\r\n // Try registering. Change status to IN_PROGRESS.\r\n const inProgressEntry = {\r\n fid: installationEntry.fid,\r\n registrationStatus: 1 /* RequestStatus.IN_PROGRESS */,\r\n registrationTime: Date.now()\r\n };\r\n const registrationPromise = registerInstallation(installations, inProgressEntry);\r\n return { installationEntry: inProgressEntry, registrationPromise };\r\n }\r\n else if (installationEntry.registrationStatus === 1 /* RequestStatus.IN_PROGRESS */) {\r\n return {\r\n installationEntry,\r\n registrationPromise: waitUntilFidRegistration(installations)\r\n };\r\n }\r\n else {\r\n return { installationEntry };\r\n }\r\n}\r\n/** This will be executed only once for each new Firebase Installation. */\r\nasync function registerInstallation(installations, installationEntry) {\r\n try {\r\n const registeredInstallationEntry = await createInstallationRequest(installations, installationEntry);\r\n return set(installations.appConfig, registeredInstallationEntry);\r\n }\r\n catch (e) {\r\n if (isServerError(e) && e.customData.serverCode === 409) {\r\n // Server returned a \"FID can not be used\" error.\r\n // Generate a new ID next time.\r\n await remove(installations.appConfig);\r\n }\r\n else {\r\n // Registration failed. Set FID as not registered.\r\n await set(installations.appConfig, {\r\n fid: installationEntry.fid,\r\n registrationStatus: 0 /* RequestStatus.NOT_STARTED */\r\n });\r\n }\r\n throw e;\r\n }\r\n}\r\n/** Call if FID registration is pending in another request. */\r\nasync function waitUntilFidRegistration(installations) {\r\n // Unfortunately, there is no way of reliably observing when a value in\r\n // IndexedDB changes (yet, see https://github.com/WICG/indexed-db-observers),\r\n // so we need to poll.\r\n let entry = await updateInstallationRequest(installations.appConfig);\r\n while (entry.registrationStatus === 1 /* RequestStatus.IN_PROGRESS */) {\r\n // createInstallation request still in progress.\r\n await sleep(100);\r\n entry = await updateInstallationRequest(installations.appConfig);\r\n }\r\n if (entry.registrationStatus === 0 /* RequestStatus.NOT_STARTED */) {\r\n // The request timed out or failed in a different call. Try again.\r\n const { installationEntry, registrationPromise } = await getInstallationEntry(installations);\r\n if (registrationPromise) {\r\n return registrationPromise;\r\n }\r\n else {\r\n // if there is no registrationPromise, entry is registered.\r\n return installationEntry;\r\n }\r\n }\r\n return entry;\r\n}\r\n/**\r\n * Called only if there is a CreateInstallation request in progress.\r\n *\r\n * Updates the InstallationEntry in the DB based on the status of the\r\n * CreateInstallation request.\r\n *\r\n * Returns the updated InstallationEntry.\r\n */\r\nfunction updateInstallationRequest(appConfig) {\r\n return update(appConfig, oldEntry => {\r\n if (!oldEntry) {\r\n throw ERROR_FACTORY.create(\"installation-not-found\" /* ErrorCode.INSTALLATION_NOT_FOUND */);\r\n }\r\n return clearTimedOutRequest(oldEntry);\r\n });\r\n}\r\nfunction clearTimedOutRequest(entry) {\r\n if (hasInstallationRequestTimedOut(entry)) {\r\n return {\r\n fid: entry.fid,\r\n registrationStatus: 0 /* RequestStatus.NOT_STARTED */\r\n };\r\n }\r\n return entry;\r\n}\r\nfunction hasInstallationRequestTimedOut(installationEntry) {\r\n return (installationEntry.registrationStatus === 1 /* RequestStatus.IN_PROGRESS */ &&\r\n installationEntry.registrationTime + PENDING_TIMEOUT_MS < Date.now());\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nasync function generateAuthTokenRequest({ appConfig, heartbeatServiceProvider }, installationEntry) {\r\n const endpoint = getGenerateAuthTokenEndpoint(appConfig, installationEntry);\r\n const headers = getHeadersWithAuth(appConfig, installationEntry);\r\n // If heartbeat service exists, add the heartbeat string to the header.\r\n const heartbeatService = heartbeatServiceProvider.getImmediate({\r\n optional: true\r\n });\r\n if (heartbeatService) {\r\n const heartbeatsHeader = await heartbeatService.getHeartbeatsHeader();\r\n if (heartbeatsHeader) {\r\n headers.append('x-firebase-client', heartbeatsHeader);\r\n }\r\n }\r\n const body = {\r\n installation: {\r\n sdkVersion: PACKAGE_VERSION,\r\n appId: appConfig.appId\r\n }\r\n };\r\n const request = {\r\n method: 'POST',\r\n headers,\r\n body: JSON.stringify(body)\r\n };\r\n const response = await retryIfServerError(() => fetch(endpoint, request));\r\n if (response.ok) {\r\n const responseValue = await response.json();\r\n const completedAuthToken = extractAuthTokenInfoFromResponse(responseValue);\r\n return completedAuthToken;\r\n }\r\n else {\r\n throw await getErrorFromResponse('Generate Auth Token', response);\r\n }\r\n}\r\nfunction getGenerateAuthTokenEndpoint(appConfig, { fid }) {\r\n return `${getInstallationsEndpoint(appConfig)}/${fid}/authTokens:generate`;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Returns a valid authentication token for the installation. Generates a new\r\n * token if one doesn't exist, is expired or about to expire.\r\n *\r\n * Should only be called if the Firebase Installation is registered.\r\n */\r\nasync function refreshAuthToken(installations, forceRefresh = false) {\r\n let tokenPromise;\r\n const entry = await update(installations.appConfig, oldEntry => {\r\n if (!isEntryRegistered(oldEntry)) {\r\n throw ERROR_FACTORY.create(\"not-registered\" /* ErrorCode.NOT_REGISTERED */);\r\n }\r\n const oldAuthToken = oldEntry.authToken;\r\n if (!forceRefresh && isAuthTokenValid(oldAuthToken)) {\r\n // There is a valid token in the DB.\r\n return oldEntry;\r\n }\r\n else if (oldAuthToken.requestStatus === 1 /* RequestStatus.IN_PROGRESS */) {\r\n // There already is a token request in progress.\r\n tokenPromise = waitUntilAuthTokenRequest(installations, forceRefresh);\r\n return oldEntry;\r\n }\r\n else {\r\n // No token or token expired.\r\n if (!navigator.onLine) {\r\n throw ERROR_FACTORY.create(\"app-offline\" /* ErrorCode.APP_OFFLINE */);\r\n }\r\n const inProgressEntry = makeAuthTokenRequestInProgressEntry(oldEntry);\r\n tokenPromise = fetchAuthTokenFromServer(installations, inProgressEntry);\r\n return inProgressEntry;\r\n }\r\n });\r\n const authToken = tokenPromise\r\n ? await tokenPromise\r\n : entry.authToken;\r\n return authToken;\r\n}\r\n/**\r\n * Call only if FID is registered and Auth Token request is in progress.\r\n *\r\n * Waits until the current pending request finishes. If the request times out,\r\n * tries once in this thread as well.\r\n */\r\nasync function waitUntilAuthTokenRequest(installations, forceRefresh) {\r\n // Unfortunately, there is no way of reliably observing when a value in\r\n // IndexedDB changes (yet, see https://github.com/WICG/indexed-db-observers),\r\n // so we need to poll.\r\n let entry = await updateAuthTokenRequest(installations.appConfig);\r\n while (entry.authToken.requestStatus === 1 /* RequestStatus.IN_PROGRESS */) {\r\n // generateAuthToken still in progress.\r\n await sleep(100);\r\n entry = await updateAuthTokenRequest(installations.appConfig);\r\n }\r\n const authToken = entry.authToken;\r\n if (authToken.requestStatus === 0 /* RequestStatus.NOT_STARTED */) {\r\n // The request timed out or failed in a different call. Try again.\r\n return refreshAuthToken(installations, forceRefresh);\r\n }\r\n else {\r\n return authToken;\r\n }\r\n}\r\n/**\r\n * Called only if there is a GenerateAuthToken request in progress.\r\n *\r\n * Updates the InstallationEntry in the DB based on the status of the\r\n * GenerateAuthToken request.\r\n *\r\n * Returns the updated InstallationEntry.\r\n */\r\nfunction updateAuthTokenRequest(appConfig) {\r\n return update(appConfig, oldEntry => {\r\n if (!isEntryRegistered(oldEntry)) {\r\n throw ERROR_FACTORY.create(\"not-registered\" /* ErrorCode.NOT_REGISTERED */);\r\n }\r\n const oldAuthToken = oldEntry.authToken;\r\n if (hasAuthTokenRequestTimedOut(oldAuthToken)) {\r\n return Object.assign(Object.assign({}, oldEntry), { authToken: { requestStatus: 0 /* RequestStatus.NOT_STARTED */ } });\r\n }\r\n return oldEntry;\r\n });\r\n}\r\nasync function fetchAuthTokenFromServer(installations, installationEntry) {\r\n try {\r\n const authToken = await generateAuthTokenRequest(installations, installationEntry);\r\n const updatedInstallationEntry = Object.assign(Object.assign({}, installationEntry), { authToken });\r\n await set(installations.appConfig, updatedInstallationEntry);\r\n return authToken;\r\n }\r\n catch (e) {\r\n if (isServerError(e) &&\r\n (e.customData.serverCode === 401 || e.customData.serverCode === 404)) {\r\n // Server returned a \"FID not found\" or a \"Invalid authentication\" error.\r\n // Generate a new ID next time.\r\n await remove(installations.appConfig);\r\n }\r\n else {\r\n const updatedInstallationEntry = Object.assign(Object.assign({}, installationEntry), { authToken: { requestStatus: 0 /* RequestStatus.NOT_STARTED */ } });\r\n await set(installations.appConfig, updatedInstallationEntry);\r\n }\r\n throw e;\r\n }\r\n}\r\nfunction isEntryRegistered(installationEntry) {\r\n return (installationEntry !== undefined &&\r\n installationEntry.registrationStatus === 2 /* RequestStatus.COMPLETED */);\r\n}\r\nfunction isAuthTokenValid(authToken) {\r\n return (authToken.requestStatus === 2 /* RequestStatus.COMPLETED */ &&\r\n !isAuthTokenExpired(authToken));\r\n}\r\nfunction isAuthTokenExpired(authToken) {\r\n const now = Date.now();\r\n return (now < authToken.creationTime ||\r\n authToken.creationTime + authToken.expiresIn < now + TOKEN_EXPIRATION_BUFFER);\r\n}\r\n/** Returns an updated InstallationEntry with an InProgressAuthToken. */\r\nfunction makeAuthTokenRequestInProgressEntry(oldEntry) {\r\n const inProgressAuthToken = {\r\n requestStatus: 1 /* RequestStatus.IN_PROGRESS */,\r\n requestTime: Date.now()\r\n };\r\n return Object.assign(Object.assign({}, oldEntry), { authToken: inProgressAuthToken });\r\n}\r\nfunction hasAuthTokenRequestTimedOut(authToken) {\r\n return (authToken.requestStatus === 1 /* RequestStatus.IN_PROGRESS */ &&\r\n authToken.requestTime + PENDING_TIMEOUT_MS < Date.now());\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Creates a Firebase Installation if there isn't one for the app and\r\n * returns the Installation ID.\r\n * @param installations - The `Installations` instance.\r\n *\r\n * @public\r\n */\r\nasync function getId(installations) {\r\n const installationsImpl = installations;\r\n const { installationEntry, registrationPromise } = await getInstallationEntry(installationsImpl);\r\n if (registrationPromise) {\r\n registrationPromise.catch(console.error);\r\n }\r\n else {\r\n // If the installation is already registered, update the authentication\r\n // token if needed.\r\n refreshAuthToken(installationsImpl).catch(console.error);\r\n }\r\n return installationEntry.fid;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Returns a Firebase Installations auth token, identifying the current\r\n * Firebase Installation.\r\n * @param installations - The `Installations` instance.\r\n * @param forceRefresh - Force refresh regardless of token expiration.\r\n *\r\n * @public\r\n */\r\nasync function getToken(installations, forceRefresh = false) {\r\n const installationsImpl = installations;\r\n await completeInstallationRegistration(installationsImpl);\r\n // At this point we either have a Registered Installation in the DB, or we've\r\n // already thrown an error.\r\n const authToken = await refreshAuthToken(installationsImpl, forceRefresh);\r\n return authToken.token;\r\n}\r\nasync function completeInstallationRegistration(installations) {\r\n const { registrationPromise } = await getInstallationEntry(installations);\r\n if (registrationPromise) {\r\n // A createInstallation request is in progress. Wait until it finishes.\r\n await registrationPromise;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nasync function deleteInstallationRequest(appConfig, installationEntry) {\r\n const endpoint = getDeleteEndpoint(appConfig, installationEntry);\r\n const headers = getHeadersWithAuth(appConfig, installationEntry);\r\n const request = {\r\n method: 'DELETE',\r\n headers\r\n };\r\n const response = await retryIfServerError(() => fetch(endpoint, request));\r\n if (!response.ok) {\r\n throw await getErrorFromResponse('Delete Installation', response);\r\n }\r\n}\r\nfunction getDeleteEndpoint(appConfig, { fid }) {\r\n return `${getInstallationsEndpoint(appConfig)}/${fid}`;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Deletes the Firebase Installation and all associated data.\r\n * @param installations - The `Installations` instance.\r\n *\r\n * @public\r\n */\r\nasync function deleteInstallations(installations) {\r\n const { appConfig } = installations;\r\n const entry = await update(appConfig, oldEntry => {\r\n if (oldEntry && oldEntry.registrationStatus === 0 /* RequestStatus.NOT_STARTED */) {\r\n // Delete the unregistered entry without sending a deleteInstallation request.\r\n return undefined;\r\n }\r\n return oldEntry;\r\n });\r\n if (entry) {\r\n if (entry.registrationStatus === 1 /* RequestStatus.IN_PROGRESS */) {\r\n // Can't delete while trying to register.\r\n throw ERROR_FACTORY.create(\"delete-pending-registration\" /* ErrorCode.DELETE_PENDING_REGISTRATION */);\r\n }\r\n else if (entry.registrationStatus === 2 /* RequestStatus.COMPLETED */) {\r\n if (!navigator.onLine) {\r\n throw ERROR_FACTORY.create(\"app-offline\" /* ErrorCode.APP_OFFLINE */);\r\n }\r\n else {\r\n await deleteInstallationRequest(appConfig, entry);\r\n await remove(appConfig);\r\n }\r\n }\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Sets a new callback that will get called when Installation ID changes.\r\n * Returns an unsubscribe function that will remove the callback when called.\r\n * @param installations - The `Installations` instance.\r\n * @param callback - The callback function that is invoked when FID changes.\r\n * @returns A function that can be called to unsubscribe.\r\n *\r\n * @public\r\n */\r\nfunction onIdChange(installations, callback) {\r\n const { appConfig } = installations;\r\n addCallback(appConfig, callback);\r\n return () => {\r\n removeCallback(appConfig, callback);\r\n };\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Returns an instance of {@link Installations} associated with the given\r\n * {@link @firebase/app#FirebaseApp} instance.\r\n * @param app - The {@link @firebase/app#FirebaseApp} instance.\r\n *\r\n * @public\r\n */\r\nfunction getInstallations(app = getApp()) {\r\n const installationsImpl = _getProvider(app, 'installations').getImmediate();\r\n return installationsImpl;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction extractAppConfig(app) {\r\n if (!app || !app.options) {\r\n throw getMissingValueError('App Configuration');\r\n }\r\n if (!app.name) {\r\n throw getMissingValueError('App Name');\r\n }\r\n // Required app config keys\r\n const configKeys = [\r\n 'projectId',\r\n 'apiKey',\r\n 'appId'\r\n ];\r\n for (const keyName of configKeys) {\r\n if (!app.options[keyName]) {\r\n throw getMissingValueError(keyName);\r\n }\r\n }\r\n return {\r\n appName: app.name,\r\n projectId: app.options.projectId,\r\n apiKey: app.options.apiKey,\r\n appId: app.options.appId\r\n };\r\n}\r\nfunction getMissingValueError(valueName) {\r\n return ERROR_FACTORY.create(\"missing-app-config-values\" /* ErrorCode.MISSING_APP_CONFIG_VALUES */, {\r\n valueName\r\n });\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst INSTALLATIONS_NAME = 'installations';\r\nconst INSTALLATIONS_NAME_INTERNAL = 'installations-internal';\r\nconst publicFactory = (container) => {\r\n const app = container.getProvider('app').getImmediate();\r\n // Throws if app isn't configured properly.\r\n const appConfig = extractAppConfig(app);\r\n const heartbeatServiceProvider = _getProvider(app, 'heartbeat');\r\n const installationsImpl = {\r\n app,\r\n appConfig,\r\n heartbeatServiceProvider,\r\n _delete: () => Promise.resolve()\r\n };\r\n return installationsImpl;\r\n};\r\nconst internalFactory = (container) => {\r\n const app = container.getProvider('app').getImmediate();\r\n // Internal FIS instance relies on public FIS instance.\r\n const installations = _getProvider(app, INSTALLATIONS_NAME).getImmediate();\r\n const installationsInternal = {\r\n getId: () => getId(installations),\r\n getToken: (forceRefresh) => getToken(installations, forceRefresh)\r\n };\r\n return installationsInternal;\r\n};\r\nfunction registerInstallations() {\r\n _registerComponent(new Component(INSTALLATIONS_NAME, publicFactory, \"PUBLIC\" /* ComponentType.PUBLIC */));\r\n _registerComponent(new Component(INSTALLATIONS_NAME_INTERNAL, internalFactory, \"PRIVATE\" /* ComponentType.PRIVATE */));\r\n}\n\n/**\r\n * The Firebase Installations Web SDK.\r\n * This SDK does not work in a Node.js environment.\r\n *\r\n * @packageDocumentation\r\n */\r\nregisterInstallations();\r\nregisterVersion(name, version);\r\n// BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation\r\nregisterVersion(name, version, 'esm2017');\n\nexport { deleteInstallations, getId, getInstallations, getToken, onIdChange };\n//# sourceMappingURL=index.esm2017.js.map\n","import { _getProvider, getApp, _registerComponent, registerVersion, SDK_VERSION } from '@firebase/app';\nimport { ErrorFactory, FirebaseError, getModularInstance, calculateBackoffMillis, isIndexedDBAvailable, validateIndexedDBOpenable } from '@firebase/util';\nimport { Component } from '@firebase/component';\nimport { LogLevel, Logger } from '@firebase/logger';\nimport '@firebase/installations';\n\nconst name = \"@firebase/remote-config\";\nconst version = \"0.4.5\";\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Shims a minimal AbortSignal.\r\n *\r\n *

AbortController's AbortSignal conveniently decouples fetch timeout logic from other aspects\r\n * of networking, such as retries. Firebase doesn't use AbortController enough to justify a\r\n * polyfill recommendation, like we do with the Fetch API, but this minimal shim can easily be\r\n * swapped out if/when we do.\r\n */\r\nclass RemoteConfigAbortSignal {\r\n constructor() {\r\n this.listeners = [];\r\n }\r\n addEventListener(listener) {\r\n this.listeners.push(listener);\r\n }\r\n abort() {\r\n this.listeners.forEach(listener => listener());\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst RC_COMPONENT_NAME = 'remote-config';\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst ERROR_DESCRIPTION_MAP = {\r\n [\"registration-window\" /* ErrorCode.REGISTRATION_WINDOW */]: 'Undefined window object. This SDK only supports usage in a browser environment.',\r\n [\"registration-project-id\" /* ErrorCode.REGISTRATION_PROJECT_ID */]: 'Undefined project identifier. Check Firebase app initialization.',\r\n [\"registration-api-key\" /* ErrorCode.REGISTRATION_API_KEY */]: 'Undefined API key. Check Firebase app initialization.',\r\n [\"registration-app-id\" /* ErrorCode.REGISTRATION_APP_ID */]: 'Undefined app identifier. Check Firebase app initialization.',\r\n [\"storage-open\" /* ErrorCode.STORAGE_OPEN */]: 'Error thrown when opening storage. Original error: {$originalErrorMessage}.',\r\n [\"storage-get\" /* ErrorCode.STORAGE_GET */]: 'Error thrown when reading from storage. Original error: {$originalErrorMessage}.',\r\n [\"storage-set\" /* ErrorCode.STORAGE_SET */]: 'Error thrown when writing to storage. Original error: {$originalErrorMessage}.',\r\n [\"storage-delete\" /* ErrorCode.STORAGE_DELETE */]: 'Error thrown when deleting from storage. Original error: {$originalErrorMessage}.',\r\n [\"fetch-client-network\" /* ErrorCode.FETCH_NETWORK */]: 'Fetch client failed to connect to a network. Check Internet connection.' +\r\n ' Original error: {$originalErrorMessage}.',\r\n [\"fetch-timeout\" /* ErrorCode.FETCH_TIMEOUT */]: 'The config fetch request timed out. ' +\r\n ' Configure timeout using \"fetchTimeoutMillis\" SDK setting.',\r\n [\"fetch-throttle\" /* ErrorCode.FETCH_THROTTLE */]: 'The config fetch request timed out while in an exponential backoff state.' +\r\n ' Configure timeout using \"fetchTimeoutMillis\" SDK setting.' +\r\n ' Unix timestamp in milliseconds when fetch request throttling ends: {$throttleEndTimeMillis}.',\r\n [\"fetch-client-parse\" /* ErrorCode.FETCH_PARSE */]: 'Fetch client could not parse response.' +\r\n ' Original error: {$originalErrorMessage}.',\r\n [\"fetch-status\" /* ErrorCode.FETCH_STATUS */]: 'Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.',\r\n [\"indexed-db-unavailable\" /* ErrorCode.INDEXED_DB_UNAVAILABLE */]: 'Indexed DB is not supported by current browser'\r\n};\r\nconst ERROR_FACTORY = new ErrorFactory('remoteconfig' /* service */, 'Remote Config' /* service name */, ERROR_DESCRIPTION_MAP);\r\n// Note how this is like typeof/instanceof, but for ErrorCode.\r\nfunction hasErrorCode(e, errorCode) {\r\n return e instanceof FirebaseError && e.code.indexOf(errorCode) !== -1;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst DEFAULT_VALUE_FOR_BOOLEAN = false;\r\nconst DEFAULT_VALUE_FOR_STRING = '';\r\nconst DEFAULT_VALUE_FOR_NUMBER = 0;\r\nconst BOOLEAN_TRUTHY_VALUES = ['1', 'true', 't', 'yes', 'y', 'on'];\r\nclass Value {\r\n constructor(_source, _value = DEFAULT_VALUE_FOR_STRING) {\r\n this._source = _source;\r\n this._value = _value;\r\n }\r\n asString() {\r\n return this._value;\r\n }\r\n asBoolean() {\r\n if (this._source === 'static') {\r\n return DEFAULT_VALUE_FOR_BOOLEAN;\r\n }\r\n return BOOLEAN_TRUTHY_VALUES.indexOf(this._value.toLowerCase()) >= 0;\r\n }\r\n asNumber() {\r\n if (this._source === 'static') {\r\n return DEFAULT_VALUE_FOR_NUMBER;\r\n }\r\n let num = Number(this._value);\r\n if (isNaN(num)) {\r\n num = DEFAULT_VALUE_FOR_NUMBER;\r\n }\r\n return num;\r\n }\r\n getSource() {\r\n return this._source;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n *\r\n * @param app - The {@link @firebase/app#FirebaseApp} instance.\r\n * @returns A {@link RemoteConfig} instance.\r\n *\r\n * @public\r\n */\r\nfunction getRemoteConfig(app = getApp()) {\r\n app = getModularInstance(app);\r\n const rcProvider = _getProvider(app, RC_COMPONENT_NAME);\r\n return rcProvider.getImmediate();\r\n}\r\n/**\r\n * Makes the last fetched config available to the getters.\r\n * @param remoteConfig - The {@link RemoteConfig} instance.\r\n * @returns A `Promise` which resolves to true if the current call activated the fetched configs.\r\n * If the fetched configs were already activated, the `Promise` will resolve to false.\r\n *\r\n * @public\r\n */\r\nasync function activate(remoteConfig) {\r\n const rc = getModularInstance(remoteConfig);\r\n const [lastSuccessfulFetchResponse, activeConfigEtag] = await Promise.all([\r\n rc._storage.getLastSuccessfulFetchResponse(),\r\n rc._storage.getActiveConfigEtag()\r\n ]);\r\n if (!lastSuccessfulFetchResponse ||\r\n !lastSuccessfulFetchResponse.config ||\r\n !lastSuccessfulFetchResponse.eTag ||\r\n lastSuccessfulFetchResponse.eTag === activeConfigEtag) {\r\n // Either there is no successful fetched config, or is the same as current active\r\n // config.\r\n return false;\r\n }\r\n await Promise.all([\r\n rc._storageCache.setActiveConfig(lastSuccessfulFetchResponse.config),\r\n rc._storage.setActiveConfigEtag(lastSuccessfulFetchResponse.eTag)\r\n ]);\r\n return true;\r\n}\r\n/**\r\n * Ensures the last activated config are available to the getters.\r\n * @param remoteConfig - The {@link RemoteConfig} instance.\r\n *\r\n * @returns A `Promise` that resolves when the last activated config is available to the getters.\r\n * @public\r\n */\r\nfunction ensureInitialized(remoteConfig) {\r\n const rc = getModularInstance(remoteConfig);\r\n if (!rc._initializePromise) {\r\n rc._initializePromise = rc._storageCache.loadFromStorage().then(() => {\r\n rc._isInitializationComplete = true;\r\n });\r\n }\r\n return rc._initializePromise;\r\n}\r\n/**\r\n * Fetches and caches configuration from the Remote Config service.\r\n * @param remoteConfig - The {@link RemoteConfig} instance.\r\n * @public\r\n */\r\nasync function fetchConfig(remoteConfig) {\r\n const rc = getModularInstance(remoteConfig);\r\n // Aborts the request after the given timeout, causing the fetch call to\r\n // reject with an `AbortError`.\r\n //\r\n //

Aborting after the request completes is a no-op, so we don't need a\r\n // corresponding `clearTimeout`.\r\n //\r\n // Locating abort logic here because:\r\n // * it uses a developer setting (timeout)\r\n // * it applies to all retries (like curl's max-time arg)\r\n // * it is consistent with the Fetch API's signal input\r\n const abortSignal = new RemoteConfigAbortSignal();\r\n setTimeout(async () => {\r\n // Note a very low delay, eg < 10ms, can elapse before listeners are initialized.\r\n abortSignal.abort();\r\n }, rc.settings.fetchTimeoutMillis);\r\n // Catches *all* errors thrown by client so status can be set consistently.\r\n try {\r\n await rc._client.fetch({\r\n cacheMaxAgeMillis: rc.settings.minimumFetchIntervalMillis,\r\n signal: abortSignal\r\n });\r\n await rc._storageCache.setLastFetchStatus('success');\r\n }\r\n catch (e) {\r\n const lastFetchStatus = hasErrorCode(e, \"fetch-throttle\" /* ErrorCode.FETCH_THROTTLE */)\r\n ? 'throttle'\r\n : 'failure';\r\n await rc._storageCache.setLastFetchStatus(lastFetchStatus);\r\n throw e;\r\n }\r\n}\r\n/**\r\n * Gets all config.\r\n *\r\n * @param remoteConfig - The {@link RemoteConfig} instance.\r\n * @returns All config.\r\n *\r\n * @public\r\n */\r\nfunction getAll(remoteConfig) {\r\n const rc = getModularInstance(remoteConfig);\r\n return getAllKeys(rc._storageCache.getActiveConfig(), rc.defaultConfig).reduce((allConfigs, key) => {\r\n allConfigs[key] = getValue(remoteConfig, key);\r\n return allConfigs;\r\n }, {});\r\n}\r\n/**\r\n * Gets the value for the given key as a boolean.\r\n *\r\n * Convenience method for calling remoteConfig.getValue(key).asBoolean().\r\n *\r\n * @param remoteConfig - The {@link RemoteConfig} instance.\r\n * @param key - The name of the parameter.\r\n *\r\n * @returns The value for the given key as a boolean.\r\n * @public\r\n */\r\nfunction getBoolean(remoteConfig, key) {\r\n return getValue(getModularInstance(remoteConfig), key).asBoolean();\r\n}\r\n/**\r\n * Gets the value for the given key as a number.\r\n *\r\n * Convenience method for calling remoteConfig.getValue(key).asNumber().\r\n *\r\n * @param remoteConfig - The {@link RemoteConfig} instance.\r\n * @param key - The name of the parameter.\r\n *\r\n * @returns The value for the given key as a number.\r\n *\r\n * @public\r\n */\r\nfunction getNumber(remoteConfig, key) {\r\n return getValue(getModularInstance(remoteConfig), key).asNumber();\r\n}\r\n/**\r\n * Gets the value for the given key as a string.\r\n * Convenience method for calling remoteConfig.getValue(key).asString().\r\n *\r\n * @param remoteConfig - The {@link RemoteConfig} instance.\r\n * @param key - The name of the parameter.\r\n *\r\n * @returns The value for the given key as a string.\r\n *\r\n * @public\r\n */\r\nfunction getString(remoteConfig, key) {\r\n return getValue(getModularInstance(remoteConfig), key).asString();\r\n}\r\n/**\r\n * Gets the {@link Value} for the given key.\r\n *\r\n * @param remoteConfig - The {@link RemoteConfig} instance.\r\n * @param key - The name of the parameter.\r\n *\r\n * @returns The value for the given key.\r\n *\r\n * @public\r\n */\r\nfunction getValue(remoteConfig, key) {\r\n const rc = getModularInstance(remoteConfig);\r\n if (!rc._isInitializationComplete) {\r\n rc._logger.debug(`A value was requested for key \"${key}\" before SDK initialization completed.` +\r\n ' Await on ensureInitialized if the intent was to get a previously activated value.');\r\n }\r\n const activeConfig = rc._storageCache.getActiveConfig();\r\n if (activeConfig && activeConfig[key] !== undefined) {\r\n return new Value('remote', activeConfig[key]);\r\n }\r\n else if (rc.defaultConfig && rc.defaultConfig[key] !== undefined) {\r\n return new Value('default', String(rc.defaultConfig[key]));\r\n }\r\n rc._logger.debug(`Returning static value for key \"${key}\".` +\r\n ' Define a default or remote value if this is unintentional.');\r\n return new Value('static');\r\n}\r\n/**\r\n * Defines the log level to use.\r\n *\r\n * @param remoteConfig - The {@link RemoteConfig} instance.\r\n * @param logLevel - The log level to set.\r\n *\r\n * @public\r\n */\r\nfunction setLogLevel(remoteConfig, logLevel) {\r\n const rc = getModularInstance(remoteConfig);\r\n switch (logLevel) {\r\n case 'debug':\r\n rc._logger.logLevel = LogLevel.DEBUG;\r\n break;\r\n case 'silent':\r\n rc._logger.logLevel = LogLevel.SILENT;\r\n break;\r\n default:\r\n rc._logger.logLevel = LogLevel.ERROR;\r\n }\r\n}\r\n/**\r\n * Dedupes and returns an array of all the keys of the received objects.\r\n */\r\nfunction getAllKeys(obj1 = {}, obj2 = {}) {\r\n return Object.keys(Object.assign(Object.assign({}, obj1), obj2));\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Implements the {@link RemoteConfigClient} abstraction with success response caching.\r\n *\r\n *

Comparable to the browser's Cache API for responses, but the Cache API requires a Service\r\n * Worker, which requires HTTPS, which would significantly complicate SDK installation. Also, the\r\n * Cache API doesn't support matching entries by time.\r\n */\r\nclass CachingClient {\r\n constructor(client, storage, storageCache, logger) {\r\n this.client = client;\r\n this.storage = storage;\r\n this.storageCache = storageCache;\r\n this.logger = logger;\r\n }\r\n /**\r\n * Returns true if the age of the cached fetched configs is less than or equal to\r\n * {@link Settings#minimumFetchIntervalInSeconds}.\r\n *\r\n *

This is comparable to passing `headers = { 'Cache-Control': max-age }` to the\r\n * native Fetch API.\r\n *\r\n *

Visible for testing.\r\n */\r\n isCachedDataFresh(cacheMaxAgeMillis, lastSuccessfulFetchTimestampMillis) {\r\n // Cache can only be fresh if it's populated.\r\n if (!lastSuccessfulFetchTimestampMillis) {\r\n this.logger.debug('Config fetch cache check. Cache unpopulated.');\r\n return false;\r\n }\r\n // Calculates age of cache entry.\r\n const cacheAgeMillis = Date.now() - lastSuccessfulFetchTimestampMillis;\r\n const isCachedDataFresh = cacheAgeMillis <= cacheMaxAgeMillis;\r\n this.logger.debug('Config fetch cache check.' +\r\n ` Cache age millis: ${cacheAgeMillis}.` +\r\n ` Cache max age millis (minimumFetchIntervalMillis setting): ${cacheMaxAgeMillis}.` +\r\n ` Is cache hit: ${isCachedDataFresh}.`);\r\n return isCachedDataFresh;\r\n }\r\n async fetch(request) {\r\n // Reads from persisted storage to avoid cache miss if callers don't wait on initialization.\r\n const [lastSuccessfulFetchTimestampMillis, lastSuccessfulFetchResponse] = await Promise.all([\r\n this.storage.getLastSuccessfulFetchTimestampMillis(),\r\n this.storage.getLastSuccessfulFetchResponse()\r\n ]);\r\n // Exits early on cache hit.\r\n if (lastSuccessfulFetchResponse &&\r\n this.isCachedDataFresh(request.cacheMaxAgeMillis, lastSuccessfulFetchTimestampMillis)) {\r\n return lastSuccessfulFetchResponse;\r\n }\r\n // Deviates from pure decorator by not honoring a passed ETag since we don't have a public API\r\n // that allows the caller to pass an ETag.\r\n request.eTag =\r\n lastSuccessfulFetchResponse && lastSuccessfulFetchResponse.eTag;\r\n // Falls back to service on cache miss.\r\n const response = await this.client.fetch(request);\r\n // Fetch throws for non-success responses, so success is guaranteed here.\r\n const storageOperations = [\r\n // Uses write-through cache for consistency with synchronous public API.\r\n this.storageCache.setLastSuccessfulFetchTimestampMillis(Date.now())\r\n ];\r\n if (response.status === 200) {\r\n // Caches response only if it has changed, ie non-304 responses.\r\n storageOperations.push(this.storage.setLastSuccessfulFetchResponse(response));\r\n }\r\n await Promise.all(storageOperations);\r\n return response;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Attempts to get the most accurate browser language setting.\r\n *\r\n *

Adapted from getUserLanguage in packages/auth/src/utils.js for TypeScript.\r\n *\r\n *

Defers default language specification to server logic for consistency.\r\n *\r\n * @param navigatorLanguage Enables tests to override read-only {@link NavigatorLanguage}.\r\n */\r\nfunction getUserLanguage(navigatorLanguage = navigator) {\r\n return (\r\n // Most reliable, but only supported in Chrome/Firefox.\r\n (navigatorLanguage.languages && navigatorLanguage.languages[0]) ||\r\n // Supported in most browsers, but returns the language of the browser\r\n // UI, not the language set in browser settings.\r\n navigatorLanguage.language\r\n // Polyfill otherwise.\r\n );\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Implements the Client abstraction for the Remote Config REST API.\r\n */\r\nclass RestClient {\r\n constructor(firebaseInstallations, sdkVersion, namespace, projectId, apiKey, appId) {\r\n this.firebaseInstallations = firebaseInstallations;\r\n this.sdkVersion = sdkVersion;\r\n this.namespace = namespace;\r\n this.projectId = projectId;\r\n this.apiKey = apiKey;\r\n this.appId = appId;\r\n }\r\n /**\r\n * Fetches from the Remote Config REST API.\r\n *\r\n * @throws a {@link ErrorCode.FETCH_NETWORK} error if {@link GlobalFetch#fetch} can't\r\n * connect to the network.\r\n * @throws a {@link ErrorCode.FETCH_PARSE} error if {@link Response#json} can't parse the\r\n * fetch response.\r\n * @throws a {@link ErrorCode.FETCH_STATUS} error if the service returns an HTTP error status.\r\n */\r\n async fetch(request) {\r\n const [installationId, installationToken] = await Promise.all([\r\n this.firebaseInstallations.getId(),\r\n this.firebaseInstallations.getToken()\r\n ]);\r\n const urlBase = window.FIREBASE_REMOTE_CONFIG_URL_BASE ||\r\n 'https://firebaseremoteconfig.googleapis.com';\r\n const url = `${urlBase}/v1/projects/${this.projectId}/namespaces/${this.namespace}:fetch?key=${this.apiKey}`;\r\n const headers = {\r\n 'Content-Type': 'application/json',\r\n 'Content-Encoding': 'gzip',\r\n // Deviates from pure decorator by not passing max-age header since we don't currently have\r\n // service behavior using that header.\r\n 'If-None-Match': request.eTag || '*'\r\n };\r\n const requestBody = {\r\n /* eslint-disable camelcase */\r\n sdk_version: this.sdkVersion,\r\n app_instance_id: installationId,\r\n app_instance_id_token: installationToken,\r\n app_id: this.appId,\r\n language_code: getUserLanguage()\r\n /* eslint-enable camelcase */\r\n };\r\n const options = {\r\n method: 'POST',\r\n headers,\r\n body: JSON.stringify(requestBody)\r\n };\r\n // This logic isn't REST-specific, but shimming abort logic isn't worth another decorator.\r\n const fetchPromise = fetch(url, options);\r\n const timeoutPromise = new Promise((_resolve, reject) => {\r\n // Maps async event listener to Promise API.\r\n request.signal.addEventListener(() => {\r\n // Emulates https://heycam.github.io/webidl/#aborterror\r\n const error = new Error('The operation was aborted.');\r\n error.name = 'AbortError';\r\n reject(error);\r\n });\r\n });\r\n let response;\r\n try {\r\n await Promise.race([fetchPromise, timeoutPromise]);\r\n response = await fetchPromise;\r\n }\r\n catch (originalError) {\r\n let errorCode = \"fetch-client-network\" /* ErrorCode.FETCH_NETWORK */;\r\n if ((originalError === null || originalError === void 0 ? void 0 : originalError.name) === 'AbortError') {\r\n errorCode = \"fetch-timeout\" /* ErrorCode.FETCH_TIMEOUT */;\r\n }\r\n throw ERROR_FACTORY.create(errorCode, {\r\n originalErrorMessage: originalError === null || originalError === void 0 ? void 0 : originalError.message\r\n });\r\n }\r\n let status = response.status;\r\n // Normalizes nullable header to optional.\r\n const responseEtag = response.headers.get('ETag') || undefined;\r\n let config;\r\n let state;\r\n // JSON parsing throws SyntaxError if the response body isn't a JSON string.\r\n // Requesting application/json and checking for a 200 ensures there's JSON data.\r\n if (response.status === 200) {\r\n let responseBody;\r\n try {\r\n responseBody = await response.json();\r\n }\r\n catch (originalError) {\r\n throw ERROR_FACTORY.create(\"fetch-client-parse\" /* ErrorCode.FETCH_PARSE */, {\r\n originalErrorMessage: originalError === null || originalError === void 0 ? void 0 : originalError.message\r\n });\r\n }\r\n config = responseBody['entries'];\r\n state = responseBody['state'];\r\n }\r\n // Normalizes based on legacy state.\r\n if (state === 'INSTANCE_STATE_UNSPECIFIED') {\r\n status = 500;\r\n }\r\n else if (state === 'NO_CHANGE') {\r\n status = 304;\r\n }\r\n else if (state === 'NO_TEMPLATE' || state === 'EMPTY_CONFIG') {\r\n // These cases can be fixed remotely, so normalize to safe value.\r\n config = {};\r\n }\r\n // Normalize to exception-based control flow for non-success cases.\r\n // Encapsulates HTTP specifics in this class as much as possible. Status is still the best for\r\n // differentiating success states (200 from 304; the state body param is undefined in a\r\n // standard 304).\r\n if (status !== 304 && status !== 200) {\r\n throw ERROR_FACTORY.create(\"fetch-status\" /* ErrorCode.FETCH_STATUS */, {\r\n httpStatus: status\r\n });\r\n }\r\n return { status, eTag: responseEtag, config };\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Supports waiting on a backoff by:\r\n *\r\n *

    \r\n *
  • Promisifying setTimeout, so we can set a timeout in our Promise chain
  • \r\n *
  • Listening on a signal bus for abort events, just like the Fetch API
  • \r\n *
  • Failing in the same way the Fetch API fails, so timing out a live request and a throttled\r\n * request appear the same.
  • \r\n *
\r\n *\r\n *

Visible for testing.\r\n */\r\nfunction setAbortableTimeout(signal, throttleEndTimeMillis) {\r\n return new Promise((resolve, reject) => {\r\n // Derives backoff from given end time, normalizing negative numbers to zero.\r\n const backoffMillis = Math.max(throttleEndTimeMillis - Date.now(), 0);\r\n const timeout = setTimeout(resolve, backoffMillis);\r\n // Adds listener, rather than sets onabort, because signal is a shared object.\r\n signal.addEventListener(() => {\r\n clearTimeout(timeout);\r\n // If the request completes before this timeout, the rejection has no effect.\r\n reject(ERROR_FACTORY.create(\"fetch-throttle\" /* ErrorCode.FETCH_THROTTLE */, {\r\n throttleEndTimeMillis\r\n }));\r\n });\r\n });\r\n}\r\n/**\r\n * Returns true if the {@link Error} indicates a fetch request may succeed later.\r\n */\r\nfunction isRetriableError(e) {\r\n if (!(e instanceof FirebaseError) || !e.customData) {\r\n return false;\r\n }\r\n // Uses string index defined by ErrorData, which FirebaseError implements.\r\n const httpStatus = Number(e.customData['httpStatus']);\r\n return (httpStatus === 429 ||\r\n httpStatus === 500 ||\r\n httpStatus === 503 ||\r\n httpStatus === 504);\r\n}\r\n/**\r\n * Decorates a Client with retry logic.\r\n *\r\n *

Comparable to CachingClient, but uses backoff logic instead of cache max age and doesn't cache\r\n * responses (because the SDK has no use for error responses).\r\n */\r\nclass RetryingClient {\r\n constructor(client, storage) {\r\n this.client = client;\r\n this.storage = storage;\r\n }\r\n async fetch(request) {\r\n const throttleMetadata = (await this.storage.getThrottleMetadata()) || {\r\n backoffCount: 0,\r\n throttleEndTimeMillis: Date.now()\r\n };\r\n return this.attemptFetch(request, throttleMetadata);\r\n }\r\n /**\r\n * A recursive helper for attempting a fetch request repeatedly.\r\n *\r\n * @throws any non-retriable errors.\r\n */\r\n async attemptFetch(request, { throttleEndTimeMillis, backoffCount }) {\r\n // Starts with a (potentially zero) timeout to support resumption from stored state.\r\n // Ensures the throttle end time is honored if the last attempt timed out.\r\n // Note the SDK will never make a request if the fetch timeout expires at this point.\r\n await setAbortableTimeout(request.signal, throttleEndTimeMillis);\r\n try {\r\n const response = await this.client.fetch(request);\r\n // Note the SDK only clears throttle state if response is success or non-retriable.\r\n await this.storage.deleteThrottleMetadata();\r\n return response;\r\n }\r\n catch (e) {\r\n if (!isRetriableError(e)) {\r\n throw e;\r\n }\r\n // Increments backoff state.\r\n const throttleMetadata = {\r\n throttleEndTimeMillis: Date.now() + calculateBackoffMillis(backoffCount),\r\n backoffCount: backoffCount + 1\r\n };\r\n // Persists state.\r\n await this.storage.setThrottleMetadata(throttleMetadata);\r\n return this.attemptFetch(request, throttleMetadata);\r\n }\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst DEFAULT_FETCH_TIMEOUT_MILLIS = 60 * 1000; // One minute\r\nconst DEFAULT_CACHE_MAX_AGE_MILLIS = 12 * 60 * 60 * 1000; // Twelve hours.\r\n/**\r\n * Encapsulates business logic mapping network and storage dependencies to the public SDK API.\r\n *\r\n * See {@link https://github.com/FirebasePrivate/firebase-js-sdk/blob/master/packages/firebase/index.d.ts|interface documentation} for method descriptions.\r\n */\r\nclass RemoteConfig {\r\n constructor(\r\n // Required by FirebaseServiceFactory interface.\r\n app, \r\n // JS doesn't support private yet\r\n // (https://github.com/tc39/proposal-class-fields#private-fields), so we hint using an\r\n // underscore prefix.\r\n /**\r\n * @internal\r\n */\r\n _client, \r\n /**\r\n * @internal\r\n */\r\n _storageCache, \r\n /**\r\n * @internal\r\n */\r\n _storage, \r\n /**\r\n * @internal\r\n */\r\n _logger) {\r\n this.app = app;\r\n this._client = _client;\r\n this._storageCache = _storageCache;\r\n this._storage = _storage;\r\n this._logger = _logger;\r\n /**\r\n * Tracks completion of initialization promise.\r\n * @internal\r\n */\r\n this._isInitializationComplete = false;\r\n this.settings = {\r\n fetchTimeoutMillis: DEFAULT_FETCH_TIMEOUT_MILLIS,\r\n minimumFetchIntervalMillis: DEFAULT_CACHE_MAX_AGE_MILLIS\r\n };\r\n this.defaultConfig = {};\r\n }\r\n get fetchTimeMillis() {\r\n return this._storageCache.getLastSuccessfulFetchTimestampMillis() || -1;\r\n }\r\n get lastFetchStatus() {\r\n return this._storageCache.getLastFetchStatus() || 'no-fetch-yet';\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Converts an error event associated with a {@link IDBRequest} to a {@link FirebaseError}.\r\n */\r\nfunction toFirebaseError(event, errorCode) {\r\n const originalError = event.target.error || undefined;\r\n return ERROR_FACTORY.create(errorCode, {\r\n originalErrorMessage: originalError && (originalError === null || originalError === void 0 ? void 0 : originalError.message)\r\n });\r\n}\r\n/**\r\n * A general-purpose store keyed by app + namespace + {@link\r\n * ProjectNamespaceKeyFieldValue}.\r\n *\r\n *

The Remote Config SDK can be used with multiple app installations, and each app can interact\r\n * with multiple namespaces, so this store uses app (ID + name) and namespace as common parent keys\r\n * for a set of key-value pairs. See {@link Storage#createCompositeKey}.\r\n *\r\n *

Visible for testing.\r\n */\r\nconst APP_NAMESPACE_STORE = 'app_namespace_store';\r\nconst DB_NAME = 'firebase_remote_config';\r\nconst DB_VERSION = 1;\r\n// Visible for testing.\r\nfunction openDatabase() {\r\n return new Promise((resolve, reject) => {\r\n try {\r\n const request = indexedDB.open(DB_NAME, DB_VERSION);\r\n request.onerror = event => {\r\n reject(toFirebaseError(event, \"storage-open\" /* ErrorCode.STORAGE_OPEN */));\r\n };\r\n request.onsuccess = event => {\r\n resolve(event.target.result);\r\n };\r\n request.onupgradeneeded = event => {\r\n const db = event.target.result;\r\n // We don't use 'break' in this switch statement, the fall-through\r\n // behavior is what we want, because if there are multiple versions between\r\n // the old version and the current version, we want ALL the migrations\r\n // that correspond to those versions to run, not only the last one.\r\n // eslint-disable-next-line default-case\r\n switch (event.oldVersion) {\r\n case 0:\r\n db.createObjectStore(APP_NAMESPACE_STORE, {\r\n keyPath: 'compositeKey'\r\n });\r\n }\r\n };\r\n }\r\n catch (error) {\r\n reject(ERROR_FACTORY.create(\"storage-open\" /* ErrorCode.STORAGE_OPEN */, {\r\n originalErrorMessage: error === null || error === void 0 ? void 0 : error.message\r\n }));\r\n }\r\n });\r\n}\r\n/**\r\n * Abstracts data persistence.\r\n */\r\nclass Storage {\r\n /**\r\n * @param appId enables storage segmentation by app (ID + name).\r\n * @param appName enables storage segmentation by app (ID + name).\r\n * @param namespace enables storage segmentation by namespace.\r\n */\r\n constructor(appId, appName, namespace, openDbPromise = openDatabase()) {\r\n this.appId = appId;\r\n this.appName = appName;\r\n this.namespace = namespace;\r\n this.openDbPromise = openDbPromise;\r\n }\r\n getLastFetchStatus() {\r\n return this.get('last_fetch_status');\r\n }\r\n setLastFetchStatus(status) {\r\n return this.set('last_fetch_status', status);\r\n }\r\n // This is comparable to a cache entry timestamp. If we need to expire other data, we could\r\n // consider adding timestamp to all storage records and an optional max age arg to getters.\r\n getLastSuccessfulFetchTimestampMillis() {\r\n return this.get('last_successful_fetch_timestamp_millis');\r\n }\r\n setLastSuccessfulFetchTimestampMillis(timestamp) {\r\n return this.set('last_successful_fetch_timestamp_millis', timestamp);\r\n }\r\n getLastSuccessfulFetchResponse() {\r\n return this.get('last_successful_fetch_response');\r\n }\r\n setLastSuccessfulFetchResponse(response) {\r\n return this.set('last_successful_fetch_response', response);\r\n }\r\n getActiveConfig() {\r\n return this.get('active_config');\r\n }\r\n setActiveConfig(config) {\r\n return this.set('active_config', config);\r\n }\r\n getActiveConfigEtag() {\r\n return this.get('active_config_etag');\r\n }\r\n setActiveConfigEtag(etag) {\r\n return this.set('active_config_etag', etag);\r\n }\r\n getThrottleMetadata() {\r\n return this.get('throttle_metadata');\r\n }\r\n setThrottleMetadata(metadata) {\r\n return this.set('throttle_metadata', metadata);\r\n }\r\n deleteThrottleMetadata() {\r\n return this.delete('throttle_metadata');\r\n }\r\n async get(key) {\r\n const db = await this.openDbPromise;\r\n return new Promise((resolve, reject) => {\r\n const transaction = db.transaction([APP_NAMESPACE_STORE], 'readonly');\r\n const objectStore = transaction.objectStore(APP_NAMESPACE_STORE);\r\n const compositeKey = this.createCompositeKey(key);\r\n try {\r\n const request = objectStore.get(compositeKey);\r\n request.onerror = event => {\r\n reject(toFirebaseError(event, \"storage-get\" /* ErrorCode.STORAGE_GET */));\r\n };\r\n request.onsuccess = event => {\r\n const result = event.target.result;\r\n if (result) {\r\n resolve(result.value);\r\n }\r\n else {\r\n resolve(undefined);\r\n }\r\n };\r\n }\r\n catch (e) {\r\n reject(ERROR_FACTORY.create(\"storage-get\" /* ErrorCode.STORAGE_GET */, {\r\n originalErrorMessage: e === null || e === void 0 ? void 0 : e.message\r\n }));\r\n }\r\n });\r\n }\r\n async set(key, value) {\r\n const db = await this.openDbPromise;\r\n return new Promise((resolve, reject) => {\r\n const transaction = db.transaction([APP_NAMESPACE_STORE], 'readwrite');\r\n const objectStore = transaction.objectStore(APP_NAMESPACE_STORE);\r\n const compositeKey = this.createCompositeKey(key);\r\n try {\r\n const request = objectStore.put({\r\n compositeKey,\r\n value\r\n });\r\n request.onerror = (event) => {\r\n reject(toFirebaseError(event, \"storage-set\" /* ErrorCode.STORAGE_SET */));\r\n };\r\n request.onsuccess = () => {\r\n resolve();\r\n };\r\n }\r\n catch (e) {\r\n reject(ERROR_FACTORY.create(\"storage-set\" /* ErrorCode.STORAGE_SET */, {\r\n originalErrorMessage: e === null || e === void 0 ? void 0 : e.message\r\n }));\r\n }\r\n });\r\n }\r\n async delete(key) {\r\n const db = await this.openDbPromise;\r\n return new Promise((resolve, reject) => {\r\n const transaction = db.transaction([APP_NAMESPACE_STORE], 'readwrite');\r\n const objectStore = transaction.objectStore(APP_NAMESPACE_STORE);\r\n const compositeKey = this.createCompositeKey(key);\r\n try {\r\n const request = objectStore.delete(compositeKey);\r\n request.onerror = (event) => {\r\n reject(toFirebaseError(event, \"storage-delete\" /* ErrorCode.STORAGE_DELETE */));\r\n };\r\n request.onsuccess = () => {\r\n resolve();\r\n };\r\n }\r\n catch (e) {\r\n reject(ERROR_FACTORY.create(\"storage-delete\" /* ErrorCode.STORAGE_DELETE */, {\r\n originalErrorMessage: e === null || e === void 0 ? void 0 : e.message\r\n }));\r\n }\r\n });\r\n }\r\n // Facilitates composite key functionality (which is unsupported in IE).\r\n createCompositeKey(key) {\r\n return [this.appId, this.appName, this.namespace, key].join();\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * A memory cache layer over storage to support the SDK's synchronous read requirements.\r\n */\r\nclass StorageCache {\r\n constructor(storage) {\r\n this.storage = storage;\r\n }\r\n /**\r\n * Memory-only getters\r\n */\r\n getLastFetchStatus() {\r\n return this.lastFetchStatus;\r\n }\r\n getLastSuccessfulFetchTimestampMillis() {\r\n return this.lastSuccessfulFetchTimestampMillis;\r\n }\r\n getActiveConfig() {\r\n return this.activeConfig;\r\n }\r\n /**\r\n * Read-ahead getter\r\n */\r\n async loadFromStorage() {\r\n const lastFetchStatusPromise = this.storage.getLastFetchStatus();\r\n const lastSuccessfulFetchTimestampMillisPromise = this.storage.getLastSuccessfulFetchTimestampMillis();\r\n const activeConfigPromise = this.storage.getActiveConfig();\r\n // Note:\r\n // 1. we consistently check for undefined to avoid clobbering defined values\r\n // in memory\r\n // 2. we defer awaiting to improve readability, as opposed to destructuring\r\n // a Promise.all result, for example\r\n const lastFetchStatus = await lastFetchStatusPromise;\r\n if (lastFetchStatus) {\r\n this.lastFetchStatus = lastFetchStatus;\r\n }\r\n const lastSuccessfulFetchTimestampMillis = await lastSuccessfulFetchTimestampMillisPromise;\r\n if (lastSuccessfulFetchTimestampMillis) {\r\n this.lastSuccessfulFetchTimestampMillis =\r\n lastSuccessfulFetchTimestampMillis;\r\n }\r\n const activeConfig = await activeConfigPromise;\r\n if (activeConfig) {\r\n this.activeConfig = activeConfig;\r\n }\r\n }\r\n /**\r\n * Write-through setters\r\n */\r\n setLastFetchStatus(status) {\r\n this.lastFetchStatus = status;\r\n return this.storage.setLastFetchStatus(status);\r\n }\r\n setLastSuccessfulFetchTimestampMillis(timestampMillis) {\r\n this.lastSuccessfulFetchTimestampMillis = timestampMillis;\r\n return this.storage.setLastSuccessfulFetchTimestampMillis(timestampMillis);\r\n }\r\n setActiveConfig(activeConfig) {\r\n this.activeConfig = activeConfig;\r\n return this.storage.setActiveConfig(activeConfig);\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction registerRemoteConfig() {\r\n _registerComponent(new Component(RC_COMPONENT_NAME, remoteConfigFactory, \"PUBLIC\" /* ComponentType.PUBLIC */).setMultipleInstances(true));\r\n registerVersion(name, version);\r\n // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation\r\n registerVersion(name, version, 'esm2017');\r\n function remoteConfigFactory(container, { instanceIdentifier: namespace }) {\r\n /* Dependencies */\r\n // getImmediate for FirebaseApp will always succeed\r\n const app = container.getProvider('app').getImmediate();\r\n // The following call will always succeed because rc has `import '@firebase/installations'`\r\n const installations = container\r\n .getProvider('installations-internal')\r\n .getImmediate();\r\n // Guards against the SDK being used in non-browser environments.\r\n if (typeof window === 'undefined') {\r\n throw ERROR_FACTORY.create(\"registration-window\" /* ErrorCode.REGISTRATION_WINDOW */);\r\n }\r\n // Guards against the SDK being used when indexedDB is not available.\r\n if (!isIndexedDBAvailable()) {\r\n throw ERROR_FACTORY.create(\"indexed-db-unavailable\" /* ErrorCode.INDEXED_DB_UNAVAILABLE */);\r\n }\r\n // Normalizes optional inputs.\r\n const { projectId, apiKey, appId } = app.options;\r\n if (!projectId) {\r\n throw ERROR_FACTORY.create(\"registration-project-id\" /* ErrorCode.REGISTRATION_PROJECT_ID */);\r\n }\r\n if (!apiKey) {\r\n throw ERROR_FACTORY.create(\"registration-api-key\" /* ErrorCode.REGISTRATION_API_KEY */);\r\n }\r\n if (!appId) {\r\n throw ERROR_FACTORY.create(\"registration-app-id\" /* ErrorCode.REGISTRATION_APP_ID */);\r\n }\r\n namespace = namespace || 'firebase';\r\n const storage = new Storage(appId, app.name, namespace);\r\n const storageCache = new StorageCache(storage);\r\n const logger = new Logger(name);\r\n // Sets ERROR as the default log level.\r\n // See RemoteConfig#setLogLevel for corresponding normalization to ERROR log level.\r\n logger.logLevel = LogLevel.ERROR;\r\n const restClient = new RestClient(installations, \r\n // Uses the JS SDK version, by which the RC package version can be deduced, if necessary.\r\n SDK_VERSION, namespace, projectId, apiKey, appId);\r\n const retryingClient = new RetryingClient(restClient, storage);\r\n const cachingClient = new CachingClient(retryingClient, storage, storageCache, logger);\r\n const remoteConfigInstance = new RemoteConfig(app, cachingClient, storageCache, storage, logger);\r\n // Starts warming cache.\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n ensureInitialized(remoteConfigInstance);\r\n return remoteConfigInstance;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// This API is put in a separate file, so we can stub fetchConfig and activate in tests.\r\n// It's not possible to stub standalone functions from the same module.\r\n/**\r\n *\r\n * Performs fetch and activate operations, as a convenience.\r\n *\r\n * @param remoteConfig - The {@link RemoteConfig} instance.\r\n *\r\n * @returns A `Promise` which resolves to true if the current call activated the fetched configs.\r\n * If the fetched configs were already activated, the `Promise` will resolve to false.\r\n *\r\n * @public\r\n */\r\nasync function fetchAndActivate(remoteConfig) {\r\n remoteConfig = getModularInstance(remoteConfig);\r\n await fetchConfig(remoteConfig);\r\n return activate(remoteConfig);\r\n}\r\n/**\r\n * This method provides two different checks:\r\n *\r\n * 1. Check if IndexedDB exists in the browser environment.\r\n * 2. Check if the current browser context allows IndexedDB `open()` calls.\r\n *\r\n * @returns A `Promise` which resolves to true if a {@link RemoteConfig} instance\r\n * can be initialized in this environment, or false if it cannot.\r\n * @public\r\n */\r\nasync function isSupported() {\r\n if (!isIndexedDBAvailable()) {\r\n return false;\r\n }\r\n try {\r\n const isDBOpenable = await validateIndexedDBOpenable();\r\n return isDBOpenable;\r\n }\r\n catch (error) {\r\n return false;\r\n }\r\n}\n\n/**\r\n * The Firebase Remote Config Web SDK.\r\n * This SDK does not work in a Node.js environment.\r\n *\r\n * @packageDocumentation\r\n */\r\n/** register component and version */\r\nregisterRemoteConfig();\n\nexport { activate, ensureInitialized, fetchAndActivate, fetchConfig, getAll, getBoolean, getNumber, getRemoteConfig, getString, getValue, isSupported, setLogLevel };\n//# sourceMappingURL=index.esm2017.js.map\n","const instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c);\n\nlet idbProxyableTypes;\nlet cursorAdvanceMethods;\n// This is a function to prevent it throwing up in node environments.\nfunction getIdbProxyableTypes() {\n return (idbProxyableTypes ||\n (idbProxyableTypes = [\n IDBDatabase,\n IDBObjectStore,\n IDBIndex,\n IDBCursor,\n IDBTransaction,\n ]));\n}\n// This is a function to prevent it throwing up in node environments.\nfunction getCursorAdvanceMethods() {\n return (cursorAdvanceMethods ||\n (cursorAdvanceMethods = [\n IDBCursor.prototype.advance,\n IDBCursor.prototype.continue,\n IDBCursor.prototype.continuePrimaryKey,\n ]));\n}\nconst cursorRequestMap = new WeakMap();\nconst transactionDoneMap = new WeakMap();\nconst transactionStoreNamesMap = new WeakMap();\nconst transformCache = new WeakMap();\nconst reverseTransformCache = new WeakMap();\nfunction promisifyRequest(request) {\n const promise = new Promise((resolve, reject) => {\n const unlisten = () => {\n request.removeEventListener('success', success);\n request.removeEventListener('error', error);\n };\n const success = () => {\n resolve(wrap(request.result));\n unlisten();\n };\n const error = () => {\n reject(request.error);\n unlisten();\n };\n request.addEventListener('success', success);\n request.addEventListener('error', error);\n });\n promise\n .then((value) => {\n // Since cursoring reuses the IDBRequest (*sigh*), we cache it for later retrieval\n // (see wrapFunction).\n if (value instanceof IDBCursor) {\n cursorRequestMap.set(value, request);\n }\n // Catching to avoid \"Uncaught Promise exceptions\"\n })\n .catch(() => { });\n // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This\n // is because we create many promises from a single IDBRequest.\n reverseTransformCache.set(promise, request);\n return promise;\n}\nfunction cacheDonePromiseForTransaction(tx) {\n // Early bail if we've already created a done promise for this transaction.\n if (transactionDoneMap.has(tx))\n return;\n const done = new Promise((resolve, reject) => {\n const unlisten = () => {\n tx.removeEventListener('complete', complete);\n tx.removeEventListener('error', error);\n tx.removeEventListener('abort', error);\n };\n const complete = () => {\n resolve();\n unlisten();\n };\n const error = () => {\n reject(tx.error || new DOMException('AbortError', 'AbortError'));\n unlisten();\n };\n tx.addEventListener('complete', complete);\n tx.addEventListener('error', error);\n tx.addEventListener('abort', error);\n });\n // Cache it for later retrieval.\n transactionDoneMap.set(tx, done);\n}\nlet idbProxyTraps = {\n get(target, prop, receiver) {\n if (target instanceof IDBTransaction) {\n // Special handling for transaction.done.\n if (prop === 'done')\n return transactionDoneMap.get(target);\n // Polyfill for objectStoreNames because of Edge.\n if (prop === 'objectStoreNames') {\n return target.objectStoreNames || transactionStoreNamesMap.get(target);\n }\n // Make tx.store return the only store in the transaction, or undefined if there are many.\n if (prop === 'store') {\n return receiver.objectStoreNames[1]\n ? undefined\n : receiver.objectStore(receiver.objectStoreNames[0]);\n }\n }\n // Else transform whatever we get back.\n return wrap(target[prop]);\n },\n set(target, prop, value) {\n target[prop] = value;\n return true;\n },\n has(target, prop) {\n if (target instanceof IDBTransaction &&\n (prop === 'done' || prop === 'store')) {\n return true;\n }\n return prop in target;\n },\n};\nfunction replaceTraps(callback) {\n idbProxyTraps = callback(idbProxyTraps);\n}\nfunction wrapFunction(func) {\n // Due to expected object equality (which is enforced by the caching in `wrap`), we\n // only create one new func per func.\n // Edge doesn't support objectStoreNames (booo), so we polyfill it here.\n if (func === IDBDatabase.prototype.transaction &&\n !('objectStoreNames' in IDBTransaction.prototype)) {\n return function (storeNames, ...args) {\n const tx = func.call(unwrap(this), storeNames, ...args);\n transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]);\n return wrap(tx);\n };\n }\n // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\n // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\n // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\n // with real promises, so each advance methods returns a new promise for the cursor object, or\n // undefined if the end of the cursor has been reached.\n if (getCursorAdvanceMethods().includes(func)) {\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n func.apply(unwrap(this), args);\n return wrap(cursorRequestMap.get(this));\n };\n }\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n return wrap(func.apply(unwrap(this), args));\n };\n}\nfunction transformCachableValue(value) {\n if (typeof value === 'function')\n return wrapFunction(value);\n // This doesn't return, it just creates a 'done' promise for the transaction,\n // which is later returned for transaction.done (see idbObjectHandler).\n if (value instanceof IDBTransaction)\n cacheDonePromiseForTransaction(value);\n if (instanceOfAny(value, getIdbProxyableTypes()))\n return new Proxy(value, idbProxyTraps);\n // Return the same value back if we're not going to transform it.\n return value;\n}\nfunction wrap(value) {\n // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\n // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\n if (value instanceof IDBRequest)\n return promisifyRequest(value);\n // If we've already transformed this value before, reuse the transformed value.\n // This is faster, but it also provides object equality.\n if (transformCache.has(value))\n return transformCache.get(value);\n const newValue = transformCachableValue(value);\n // Not all types are transformed.\n // These may be primitive types, so they can't be WeakMap keys.\n if (newValue !== value) {\n transformCache.set(value, newValue);\n reverseTransformCache.set(newValue, value);\n }\n return newValue;\n}\nconst unwrap = (value) => reverseTransformCache.get(value);\n\nexport { reverseTransformCache as a, instanceOfAny as i, replaceTraps as r, unwrap as u, wrap as w };\n","import { w as wrap, r as replaceTraps } from './wrap-idb-value.js';\nexport { u as unwrap, w as wrap } from './wrap-idb-value.js';\n\n/**\n * Open a database.\n *\n * @param name Name of the database.\n * @param version Schema version.\n * @param callbacks Additional callbacks.\n */\nfunction openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {\n const request = indexedDB.open(name, version);\n const openPromise = wrap(request);\n if (upgrade) {\n request.addEventListener('upgradeneeded', (event) => {\n upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction), event);\n });\n }\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event.newVersion, event));\n }\n openPromise\n .then((db) => {\n if (terminated)\n db.addEventListener('close', () => terminated());\n if (blocking) {\n db.addEventListener('versionchange', (event) => blocking(event.oldVersion, event.newVersion, event));\n }\n })\n .catch(() => { });\n return openPromise;\n}\n/**\n * Delete a database.\n *\n * @param name Name of the database.\n */\nfunction deleteDB(name, { blocked } = {}) {\n const request = indexedDB.deleteDatabase(name);\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event));\n }\n return wrap(request).then(() => undefined);\n}\n\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\nconst cachedMethods = new Map();\nfunction getMethod(target, prop) {\n if (!(target instanceof IDBDatabase &&\n !(prop in target) &&\n typeof prop === 'string')) {\n return;\n }\n if (cachedMethods.get(prop))\n return cachedMethods.get(prop);\n const targetFuncName = prop.replace(/FromIndex$/, '');\n const useIndex = prop !== targetFuncName;\n const isWrite = writeMethods.includes(targetFuncName);\n if (\n // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\n !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\n !(isWrite || readMethods.includes(targetFuncName))) {\n return;\n }\n const method = async function (storeName, ...args) {\n // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\n const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\n let target = tx.store;\n if (useIndex)\n target = target.index(args.shift());\n // Must reject if op rejects.\n // If it's a write operation, must reject if tx.done rejects.\n // Must reject with op rejection first.\n // Must resolve with op value.\n // Must handle both promises (no unhandled rejections)\n return (await Promise.all([\n target[targetFuncName](...args),\n isWrite && tx.done,\n ]))[0];\n };\n cachedMethods.set(prop, method);\n return method;\n}\nreplaceTraps((oldTraps) => ({\n ...oldTraps,\n get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\n has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\n}));\n\nexport { deleteDB, openDB };\n"],"names":["stringToByteArray$1","str","out","p","i","length","c","charCodeAt","base64","byteToCharMap_","charToByteMap_","byteToCharMapWebSafe_","charToByteMapWebSafe_","ENCODED_VALS_BASE","ENCODED_VALS","this","ENCODED_VALS_WEBSAFE","HAS_NATIVE_SUPPORT","atob","encodeByteArray","input","webSafe","Array","isArray","Error","init_","byteToCharMap","output","byte1","haveByte2","byte2","haveByte3","byte3","outByte1","outByte2","outByte3","outByte4","push","join","encodeString","btoa","decodeString","bytes","pos","c1","String","fromCharCode","c2","u","c3","byteArrayToString","decodeStringToByteArray","charToByteMap","charAt","byte4","DecodeBase64StringError","constructor","super","arguments","name","base64urlEncodeWithoutPadding","utf8Bytes","base64Encode","replace","base64Decode","e","console","error","getDefaultsFromGlobal","self","window","g","getGlobal","__FIREBASE_DEFAULTS__","getDefaults","process","env","defaultsJsonString","JSON","parse","getDefaultsFromEnvVariable","document","match","cookie","decoded","getDefaultsFromCookie","info","getDefaultAppConfig","_a","config","Deferred","reject","resolve","promise","Promise","wrapCallback","callback","value","catch","isIndexedDBAvailable","indexedDB","validateIndexedDBOpenable","preExist","DB_CHECK_NAME","request","open","onsuccess","result","close","deleteDatabase","onupgradeneeded","onerror","message","FirebaseError","code","customData","Object","setPrototypeOf","prototype","captureStackTrace","ErrorFactory","create","service","serviceName","errors","data","fullCode","template","PATTERN","_","key","replaceTemplate","fullMessage","deepEqual","a","b","aKeys","keys","bKeys","k","includes","aProp","bProp","isObject","thing","DEFAULT_INTERVAL_MILLIS","DEFAULT_BACKOFF_FACTOR","MAX_VALUE_MILLIS","RANDOM_FACTOR","calculateBackoffMillis","backoffCount","intervalMillis","backoffFactor","currBaseValue","Math","pow","randomWait","round","random","min","getModularInstance","_delegate","_interopRequireDefault","exports","_createSvgIcon","_jsxRuntime","default","jsx","d","_typeof","obj","Symbol","iterator","loadParams","V3_URL","V3_URL_REGEX","EXISTING_SCRIPT_MESSAGE","injectScript","params","queryString","advancedFraudSignals","script","createElement","src","concat","headOrBody","head","body","appendChild","stripePromise","onErrorListener","onLoadListener","loadScript","Stripe","warn","scripts","querySelectorAll","test","findScript","_script$parentNode","removeEventListener","parentNode","removeChild","onLoad","onError","addEventListener","validateLoadParams","errorMessage","stringify","loadStripeCalled","loadStripe","_len","args","_key","startTime","Date","now","then","maybeStripe","stripe","apply","undefined","_registerWrapper","version","registerWrapper","initStripe","setLoadParameters","validatedParams","reduce","previousValue","currentValue","_loadParams","module","deselectCurrent","clipboardToIE11Formatting","text","options","debug","reselectPrevious","range","selection","mark","success","createRange","getSelection","textContent","style","all","position","top","clip","whiteSpace","webkitUserSelect","MozUserSelect","msUserSelect","userSelect","stopPropagation","format","preventDefault","clipboardData","clearData","setData","onCopy","selectNodeContents","addRange","execCommand","err","copyKey","navigator","userAgent","prompt","removeRange","removeAllRanges","o","toPropertyKey","t","r","toPrimitive","call","TypeError","Number","_defineProperty","defineProperty","enumerable","configurable","writable","ownKeys","getOwnPropertySymbols","filter","getOwnPropertyDescriptor","_objectSpread2","forEach","getOwnPropertyDescriptors","defineProperties","_objectWithoutProperties","objectWithoutPropertiesLoose","n","indexOf","propertyIsEnumerable","_classCallCheck","_defineProperties","_createClass","_inherits","_getPrototypeOf","getPrototypeOf","bind","__proto__","_isNativeReflectConstruct","Boolean","valueOf","Reflect","construct","_createSuper","s","assertThisInitialized","raf","setTimeout","caf","num","clearTimeout","wrapperRaf","contains","root","findDOMNode","node","HTMLElement","requestAnimationFrame","handle","cancelAnimationFrame","cancel","fillRef","ref","current","composeRef","refs","addEventListenerWrap","target","eventType","cb","option","remove","canUseDom","forwardRef","props","didUpdate","getContainer","children","containerRef","useRef","useImperativeHandle","initRef","useEffect","_containerRef$current","_containerRef$current2","isPointsEq","a1","a2","isAlignPoint","_arrayLikeToArray","_slicedToArray","l","f","next","done","toString","slice","from","makePrefixMap","styleProp","eventName","prefixes","toLowerCase","domSupport","win","vendorPrefixes","animationend","transitionend","animation","transition","_document$createEleme","prefixedEventNames","getVendorPrefixedEventName","prefixMap","stylePropList","len","hasOwnProperty","internalAnimationEndName","internalTransitionEndName","supportTransition","animationEndName","transitionEndName","getTransitionName","transitionName","transitionType","toUpperCase","STATUS_NONE","STATUS_APPEAR","STATUS_ENTER","STATUS_LEAVE","STEP_NONE","STEP_PREPARE","STEP_START","STEP_ACTIVE","STEP_ACTIVATED","useMountStatus","defaultValue","destroyRef","_useState2","useState","val","setVal","useLayoutEffect","STEP_QUEUE","SkipStep","DoStep","isActive","step","_React$useState2","setStep","_useNextFrame","nextFrameRef","cancelNextFrame","nextFrame","delay","nextFrameId","isCanceled","useNextFrame","_useNextFrame2","index","nextStep","doNext","cacheElementRef","callbackRef","onInternalMotionEnd","event","removeMotionEvents","element","DomWrapper","_React$Component","_super","transitionSupport","isSupportTransition","motionName","CSSMotion","_props$visible","visible","_props$removeOnLeave","removeOnLeave","forceRender","leavedClassName","eventProps","supportMotion","nodeRef","wrapperNodeRef","_useStatus","getElement","_ref","_ref$motionEnter","motionEnter","_ref$motionAppear","motionAppear","_ref$motionLeave","motionLeave","motionDeadline","motionLeaveImmediately","onAppearPrepare","onEnterPrepare","onLeavePrepare","onAppearStart","onEnterStart","onLeaveStart","onAppearActive","onEnterActive","onLeaveActive","onAppearEnd","onEnterEnd","onLeaveEnd","onVisibleChanged","asyncVisible","setAsyncVisible","_useState4","status","setStatus","_useState6","setStyle","mountedRef","deadlineRef","destroyedRef","getDomElement","activeRef","canEnd","deadline","patchMotionEvents","useDomMotionEvents","eventHandlers","_ref2","_ref3","_ref4","_useStepQueue2","useStepQueue","newStep","onPrepare","_eventHandlers$step","startStep","active","nextStatus","isMounted","mergedStyle","useStatus","_useStatus2","statusStep","statusStyle","mergedVisible","originRef","motionChildren","setNodeRef","_classNames","statusSuffix","className","display","displayName","STATUS_ADD","STATUS_KEEP","STATUS_REMOVE","STATUS_REMOVED","wrapKeyToObject","keyObj","parseKeys","map","MOTION_PROP_NAMES","CSSMotionList","_this","state","keyEntities","removeKey","setState","entity","_this2","_this$props","component","_onVisibleChanged","restProps","Component","motionProps","prop","assign","changedVisible","parsedKeyObjects","mixedKeyEntities","prevKeys","currentKeys","list","currentIndex","currentLen","prevKeyObjects","currentKeyObjects","hit","currentKeyObj","matchKey","diffKeys","prevEntity","find","_ref5","defaultProps","getMotion","prefixCls","motion","Mask","zIndex","mask","maskMotion","maskAnimation","maskTransitionName","vendorPrefix","object","enumerableOnly","symbols","sym","jsCssMap","Webkit","Moz","ms","O","getVendorPrefix","getTransformName","setTransitionProperty","transitionProperty","setTransform","transform","getComputedStyleX","matrix2d","matrix3d","forceRelayout","elem","originalStyle","offsetHeight","css","el","v","getScroll","w","ret","method","documentElement","getScrollLeft","getScrollTop","getOffset","box","x","y","doc","ownerDocument","docElem","getBoundingClientRect","left","clientLeft","clientTop","getClientPosition","defaultView","parentWindow","isWindow","getDocument","nodeType","_RE_NUM_NO_PX","RegExp","source","RE_POS","CURRENT_STYLE","RUNTIME_STYLE","LEFT","getOffsetDirection","dir","useCssRight","useCssBottom","oppositeOffsetDirection","setLeftTop","offset","presetH","presetV","horizontalProperty","verticalProperty","oppositeHorizontalProperty","oppositeVerticalProperty","originalTransition","originalOffset","old","preset","off","_dir","_off","setTransform$1","originalXY","getComputedStyle","getPropertyValue","matrix","split","parseFloat","getTransformXY","resultXY","xy","arr","match2d","item","setTransformXY","each","fn","isBorderBoxFn","cs","computedStyle","rsLeft","pixelLeft","BOX_MODELS","CONTENT_INDEX","PADDING_INDEX","BORDER_INDEX","getPBMWidth","which","j","cssProp","domUtils","getParent","parent","host","getWH","ex","extra","viewportWidth","viewportHeight","docWidth","docHeight","borderBoxValue","width","height","isBorderBox","cssBoxValue","borderBoxValueOrIsBorderBox","refWin","max","documentElementProp","compatMode","cssShow","visibility","getWHIgnoreDisplay","_key2","offsetWidth","swap","mix","to","first","includeMargin","utils","getWindow","ignoreShake","oriOffset","oLeft","toFixed","oTop","tLeft","tTop","useCssTransform","setOffset","clone","overflow","getWindowScrollLeft","getWindowScrollTop","merge","getOffsetParent","positionStyle","nodeName","getParent$1","getVisibleRectForElement","alwaysByViewport","visibleRect","right","Infinity","bottom","clientWidth","clientHeight","originalPosition","scrollX","scrollY","documentWidth","scrollWidth","documentHeight","scrollHeight","bodyStyle","overflowX","innerWidth","overflowY","innerHeight","isAncestorFixed","maxVisibleWidth","maxVisibleHeight","getRegion","h","outerWidth","outerHeight","getAlignOffset","region","align","V","H","getElFuturePos","elRegion","refNodeRegion","points","targetOffset","p1","p2","diff","isFailX","elFuturePos","isFailY","flip","reg","m","flipOffset","convertOffset","offsetLen","parseInt","substring","normalizeOffset","doAlign","tgtRegion","isTgtRegionVisible","newOverflowCfg","fail","newElRegion","adjustX","adjustY","newPoints","newOffset","newTargetOffset","isCompleteFailX","_newPoints","_newOffset","_newTargetOffset","isCompleteFailY","isStillFailX","isStillFailY","_newPoints2","size","resizeWidth","resizeHeight","adjustForViewport","alignElement","refNode","isTargetNotOutOfVisible","targetRegion","isOutOfVisibleRect","alignPoint","tgtPoint","pageX","pageY","clientX","clientY","pointInView","__getOffsetParent","__getVisibleRectForElement","monitorResize","prevWidth","prevHeight","resizeObserver","_target$getBoundingCl","fixedWidth","floor","fixedHeight","observe","disconnect","func","getPoint","point","RefAlign","disabled","onAlign","monitorWindowResize","_ref$monitorBufferTim","monitorBufferTime","cacheRef","childNode","only","forceAlignPropsRef","_useBuffer2","buffer","calledRef","timeoutRef","cancelTrigger","trigger","force","useBuffer","_forceAlignPropsRef$c","latestDisabled","latestTarget","activeElement","offsetParent","getBBox","_box","isVisible","container","focus","restoreFocus","_forceAlign","cancelForceAlign","resizeMonitor","sourceResizeMonitor","prev","winResizeRef","forceAlign","asyncGeneratorStep","_asyncToGenerator","_next","_throw","StatusQueue","PopupInner","stretch","destroyPopupOnHide","getRootDomNode","getClassNameFromAlign","onMouseEnter","onMouseLeave","onMouseDown","onTouchStart","alignRef","elementRef","alignedClassName","setAlignedClassName","_useStretchStyle","targetSize","setTargetSize","sizeStyle","minHeight","minWidth","useStretchStyle","_useStretchStyle2","stretchStyle","measureStretchStyle","_useVisibleStatus","doMeasure","rafRef","cancelRaf","_callee","_context","stop","useVisibleStatus","_useVisibleStatus2","goNextStatus","prepareResolveRef","_alignRef$current","onInternalAlign","popupDomNode","matchAlign","nextAlignedClassName","_prepareResolveRef$cu","onShowPrepare","originHandler","opacity","pointerEvents","alignDisabled","count","motionRef","motionClassName","motionStyle","mergedClassName","Popup","cloneProps","noop","returnEmptyString","returnDocument","ALL_HANDLERS","PortalComponent","Trigger","popupVisible","popupRef","triggerRef","mouseEnterDelay","fireEvents","delaySetPopupVisible","onMouseMove","setPoint","mouseLeaveDelay","onPopupMouseEnter","clearDelayTimer","onPopupMouseLeave","_this$popupRef$curren","relatedTarget","onFocus","isFocusToShow","focusTime","focusDelay","preClickTime","preTouchTime","onBlur","isBlurToHide","blurDelay","onContextMenu","setPopupVisible","onContextMenuClose","isContextMenuToShow","onClick","preTime","abs","isClickToShow","isClickToHide","nextVisible","onPopupMouseDown","_this$context","hasPopupMouseDown","mouseDownTimeout","context","onDocumentClick","maskClosable","popupNode","getPopupDomNode","getTriggerDOMNode","domNode","getPopupClassNameFromAlign","popupPlacement","builtinPlacements","placements","placement","getAlignPopupClassName","getComponent","_this$props2","popupClassName","onPopupAlign","popupMotion","popupAnimation","popupTransitionName","popupStyle","popup","_this$state","getPopupAlign","mouseProps","isMouseEnterToShow","isMouseLeaveToHide","attachParent","popupContainer","attachId","mountNode","_this$props3","getPopupContainer","handlePortalUpdate","prevPopupVisible","afterPopupVisibleChange","defaultPopupVisible","componentDidUpdate","currentDocument","clickOutsideHandler","touchOutsideHandler","contextMenuOutsideHandler1","contextMenuOutsideHandler2","clearOutsideHandler","_this$popupRef$curren2","popupAlign","placementStr","getAlignFromPlacement","onPopupVisibleChange","delayS","delayTimer","childPros","_this$props4","action","showAction","_this$props5","_this$props6","hideAction","_this$props7","_this$props8","_this$props9","_this$props10","_this$popupRef$curren3","type","childCallback","_this$props11","autoDestroy","child","newChildProps","createTwoChains","childrenClassName","nodeOrComponent","_type$prototype","_nodeOrComponent$prot","isMemo","render","portal","Provider","prevState","newState","contextType","autoAdjustOverflow","topLeft","leftTop","topRight","rightTop","bottomRight","rightBottom","bottomLeft","leftBottom","overlay","id","overlayInnerStyle","role","Tooltip","overlayClassName","_props$trigger","_props$mouseEnterDela","_props$mouseLeaveDela","overlayStyle","_props$prefixCls","onVisibleChange","afterVisibleChange","_props$placement","_props$align","_props$destroyTooltip","destroyTooltipOnHide","defaultVisible","getTooltipContainer","domRef","extraProps","destroyTooltip","keepParent","_props$arrowContent","arrowContent","extendStatics","__extends","__","__assign","CalendlyEvent","insertAt","getElementsByTagName","firstChild","insertBefore","styleSheet","cssText","createTextNode","styleInject","formatCalendlyUrl","url","_b","prefill","_c","pageSettings","_d","utm","embedType","backgroundColor","hideEventTypeDetails","hideLandingPageDetails","primaryColor","textColor","hideGdprBanner","customAnswers","date","email","firstName","guests","lastName","location","utmCampaign","utmContent","utmMedium","utmSource","utmTerm","salesforce_uuid","queryStringIndex","hasQueryString","encodeURIComponent","formatDate","formatCustomAnswers","month","getMonth","day","getDate","getFullYear","CUSTOM_ANSWER_PATTERN","customAnswersFiltered","LoadingSpinner","defaultStyles","InlineWidget","isLoading","styles","frameBorder","title","iframeTitle","ModalContent","Fragment","Modal","createPortal","onModalClose","border","padding","rootElement","EVENT_NAME","PopupButton","isOpen","onClose","PopupWidget","background","color","branding","useCalendlyEventListener","onDateAndTimeSelected","onEventScheduled","onEventTypeViewed","onProfilePageViewed","onMessage","DATE_AND_TIME_SELECTED","EVENT_SCHEDULED","EVENT_TYPE_VIEWED","PROFILE_PAGE_VIEWED","react","react__default","_objectWithoutPropertiesLoose","excluded","sourceKeys","sourceSymbolKeys","_arrayWithHoles","_iterableToArrayLimit","_nonIterableRest","_arr","_n","_e","_s","_i","commonjsGlobal","globalThis","unwrapExports","__esModule","createCommonjsModule","useScript_1","__rest","useScript","checkForExisting","attributes","loading","setLoading","setError","isBrowser","scriptEl","setAttribute","handleLoad","handleError","lib","renameKeyInObject","oldKey","newKey","newObject","createPlaid","plaid","onExitCallback","Plaid","onExit","exit","exitOptions","destroy","PLAID_LINK_STABLE_URL","usePlaidLink","_useScript2","setPlaid","iframeLoaded","setIframeLoaded","products","product","sort","token","ready","PlaidLink","_usePlaidLink","outline","borderRadius","factory","loaded","ReferenceError","conformToMask","get","setRef","onChange","inputElement","textMaskInputElement","update","initTextMask","pipe","guide","placeholderChar","showMask","isNil","some","keepCharPositions","PureComponent","propTypes","oneOfType","array","bool","shape","isRequired","string","number","strFunction","isNaN","splice","maskWithoutCaretTraps","indexes","convertMaskToPlaceholder","isString","isNumber","processCaretTraps","previousConformedValue","placeholder","currentCaretPosition","C","T","P","S","M","char","isNew","E","N","A","B","I","shift","F","q","D","L","W","J","substr","U","conformedValue","meta","someCharsRejected","previousPlaceholder","rawValue","indexesOfPipedChars","caretTrapIndexes","R","Y","z","G","selectionEnd","rejected","setSelectionRange","thatReturns","thatReturnsFalse","thatReturnsTrue","thatReturnsNull","thatReturnsThis","thatReturnsArgument","framesToPop","symbol","any","arrayOf","instanceOf","objectOf","oneOf","exact","checkPropTypes","PropTypes","getRandomValues","crypto","msCrypto","rnds8","Uint8Array","rng","byteToHex","buf","bth","rnds","ii","descriptor","Constructor","protoProps","staticProps","_extends","_setPrototypeOf","_possibleConstructorReturn","_assertThisInitialized","CONSTANT","HIDE","REBUILD","SHOW","dispatchGlobalEvent","opts","CustomEvent","detail","createEvent","initEvent","dispatchEvent","checkStatus","dataEventOff","show","isCapture","currentTarget","currentItem","getAttribute","hideTooltip","setUntargetItems","getTargetArray","showTooltip","targetArray","customListeners","set","listener","bodyListener","_options$respectEffec","respectEffect","_options$customEvent","customEvent","tip","forId","isCustomEvent","isTargetBelongsToTooltip","getEffect","proxy","makeProxy","findCustomEvents","dataAttribute","events","getBody","getPosition","place","desiredPlace","effect","_getDimensions","getDimensions","tipWidth","tipHeight","_getDimensions2","targetWidth","targetHeight","_getCurrentOffset","getCurrentOffset","mouseX","mouseY","defaultOffset","getDefaultPosition","_calculateOffset","calculateOffset","extraOffsetX","extraOffsetY","windowWidth","windowHeight","_getParent","parentTop","parentLeft","getTipOffsetLeft","offsetX","getTipOffsetTop","offsetY","outsideRight","getTipOffsetRight","outsideBottom","getTipOffsetBottom","outside","outsideLeft","outsideTop","inside","placesList","insideList","newPlace","isNewState","shouldUpdatePlace","_node$getBoundingClie","boundingClientRect","targetTop","targetLeft","_getDimensions3","disToMouse","currentParent","parentElement","getTipContent","getContent","multiline","regexp","parseAria","ariaObj","nodeListToArray","nodeList","fill","innerHTML","___$insertStyle","_class","_class2","_temp","defaultColors","dark","arrow","warning","light","generateTooltipStyle","uuid","customColors","hasBorder","colors","borderColor","arrowColor","generateStyle","getDefaultPopupColors","getPopupColors","ReactTooltip","hide","rebuild","globalRebuild","mount","unbindListener","bindListener","globalShow","hasTarget","globalHide","staticMethods","bindWindowEvents","resizeHide","onWindowResize","unbindWindowEvents","windowListener","ele","customBindListener","eventOff","dataEvent","customListener","customUnbindListener","_this$state2","isBodyMode","bodyMode","bindBodyListener","possibleCustomEvents","possibleCustomEventsOff","customEvents","customEventsOff","unbindBodyListener","listeners","bodyModeListeners","_event","mouseover","mousemove","updateTooltip","mouseout","targetEventOff","_event2","_event3","instance","extraClass","html","delayHide","delayShow","currentEvent","ariaProps","isEmptyTip","disable","originTooltip","isMultiline","delayShowLoop","delayHideLoop","delayReshow","intervalUpdateContent","subClass","superClass","insecure","delayUpdate","globalEventOff","afterShow","afterHide","overridePosition","scrollHide","wrapper","clickable","methodArray","clearTimer","removeScrollListener","tooltipRef","matches","msMatchesSelector","mozMatchesSelector","selector","escaped","shadowRoot","_this3","unbindBasicListener","isCaptureMode","bindRemovalTracker","_this4","unbindRemovalTracker","content","isGlobalCall","switchToSolid","FocusEvent","reshowDelay","updateState","addScrollListener","setInterval","_getContent","updatePosition","_this5","getTooltipContent","delayTime","eventTarget","mouseOnToolTip","isInvisible","_this6","isScroll","resetState","listenForTooltipExit","removeListenerForTooltipExit","hideTooltipOnScroll","_this7","clearInterval","_this8","_this9","_this$state3","tooltipClass","hasCustomColors","Wrapper","supportedWrappers","wrapperClassName","htmlContent","dangerouslySetInnerHTML","__html","nextProps","newAriaProps","MutationObserver","WebKitMutationObserver","MozMutationObserver","observer","mutations","m1","mutation","m2","removedNodes","childList","subtree","removalTracker","replaceClassName","origClass","classToRemove","forceReflow","scrollTop","UNMOUNTED","EXITED","ENTERING","ENTERED","EXITING","Transition","initialStatus","appear","isMounting","enter","appearStatus","in","unmountOnExit","mountOnEnter","nextCallback","getDerivedStateFromProps","_proto","componentDidMount","updateStatus","prevProps","componentWillUnmount","cancelNextCallback","getTimeouts","timeout","mounting","performEnter","performExit","appearing","maybeNode","maybeAppearing","timeouts","enterTimeout","safeSetState","onEntered","onEnter","onEntering","onTransitionEnd","onExiting","onExited","nextState","setNextCallback","handler","doesNotHaveTimeoutOrListener","addEndListener","maybeNextCallback","childProps","TransitionGroupContext","removeClass","classes","classList","baseVal","CSSTransition","appliedClasses","_this$resolveArgument","resolveArguments","removeClasses","addClass","_this$resolveArgument2","_this$resolveArgument3","getClassNames","classNames","isStringClassNames","baseClassName","activeClassName","doneClassName","phase","add","hasClass","_addClass","_this$appliedClasses$","base","getChildMapping","mapFn","Children","isValidElement","mapper","getProp","getNextChildMapping","prevChildMapping","nextChildMapping","getValueForKey","nextKeysPending","pendingKeys","prevKey","childMapping","nextKey","pendingNextKey","mergeChildMappings","hasPrev","hasNext","prevChild","isLeaving","cloneElement","values","TransitionGroup","handleExited","contextValue","firstRender","mounted","currentChildMapping","childFactory","lastIndexOf","$","Z","prefix","suffix","includeThousandsSeparator","thousandsSeparatorSymbol","allowDecimal","decimalSymbol","decimalLimit","requireDecimal","allowNegative","allowLeadingZeroes","integerLimit","rangeCount","ranges","getRangeAt","tagName","blur","_regeneratorRuntime","asyncIterator","toStringTag","define","wrap","Generator","Context","makeInvokeMethod","tryCatch","arg","GeneratorFunction","GeneratorFunctionPrototype","defineIteratorMethods","_invoke","AsyncIterator","invoke","__await","callInvokeWithMethodAndArg","delegate","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","resultName","nextLoc","pushTryEntry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","reset","isGeneratorFunction","awrap","async","reverse","pop","rval","complete","finish","delegateYield","runtime","regeneratorRuntime","accidentalStrictMode","Function","PlatformLoggerServiceImpl","getPlatformInfoString","getProviders","provider","isVersionServiceProvider","getImmediate","library","logString","name$o","version$1","logger","name$n","name$m","name$l","name$k","name$j","name$i","name$h","name$g","name$f","name$e","name$d","name$c","name$b","name$a","name$9","name$8","name$7","name$6","name$5","name$4","name$3","name$2","name$1","DEFAULT_ENTRY_NAME","PLATFORM_LOG_STRING","_apps","Map","_components","_addComponent","app","addComponent","_registerComponent","componentName","has","_getProvider","heartbeatController","getProvider","optional","triggerHeartbeat","ERRORS","ERROR_FACTORY","FirebaseAppImpl","_isDeleted","_options","_config","_name","_automaticDataCollectionEnabled","automaticDataCollectionEnabled","_container","checkDestroyed","isDeleted","appName","SDK_VERSION","initializeApp","rawConfig","existingApp","newApp","getApp","registerVersion","libraryKeyOrName","variant","libraryMismatch","versionMismatch","DB_NAME","DB_VERSION","STORE_NAME","dbPromise","getDbPromise","upgrade","db","oldVersion","createObjectStore","originalErrorMessage","writeHeartbeatsToIndexedDB","heartbeatObject","tx","transaction","objectStore","put","computeKey","idbGetError","appId","HeartbeatServiceImpl","_heartbeatsCache","_storage","HeartbeatStorageImpl","_heartbeatsCachePromise","read","agent","getUTCDateString","heartbeats","lastSentHeartbeatDate","singleDateHeartbeat","hbTimestamp","overwrite","getHeartbeatsHeader","heartbeatsToSend","unsentEntries","heartbeatsCache","maxSize","heartbeatEntry","hb","dates","countBytes","extractHeartbeatsForHeader","headerString","toISOString","_canUseIndexedDBPromise","runIndexedDBEnvironmentCheck","idbHeartbeatObject","readHeartbeatsFromIndexedDB","heartbeatsObject","existingHeartbeatsObject","instanceFactory","multipleInstances","serviceProps","instantiationMode","onInstanceCreated","setInstantiationMode","mode","setMultipleInstances","setServiceProps","setInstanceCreatedCallback","instances","instancesDeferred","instancesOptions","onInitCallbacks","identifier","normalizedIdentifier","normalizeInstanceIdentifier","deferred","isInitialized","shouldAutoInitialize","getOrInitializeService","instanceIdentifier","setComponent","isComponentEager","instanceDeferred","entries","clearInstance","delete","services","INTERNAL","_delete","isComponentSet","getOptions","initialize","onInit","existingCallbacks","Set","existingInstance","invokeOnInitCallbacks","callbacks","ComponentContainer","providers","addOrOverwriteComponent","LogLevel","levelStringToEnum","DEBUG","VERBOSE","INFO","WARN","ERROR","SILENT","defaultLogLevel","ConsoleMethod","defaultLogHandler","logType","logLevel","Logger","_logLevel","_logHandler","_userLogHandler","setLogLevel","logHandler","userLogHandler","log","PENDING_TIMEOUT_MS","PACKAGE_VERSION","INTERNAL_AUTH_VERSION","INSTALLATIONS_API_URL","TOKEN_EXPIRATION_BUFFER","ERROR_DESCRIPTION_MAP","isServerError","getInstallationsEndpoint","projectId","extractAuthTokenInfoFromResponse","response","requestStatus","expiresIn","responseExpiresIn","creationTime","getErrorFromResponse","requestName","errorData","json","serverCode","serverMessage","serverStatus","getHeaders","apiKey","Headers","Accept","getHeadersWithAuth","appConfig","refreshToken","headers","append","getAuthorizationHeader","retryIfServerError","sleep","VALID_FID_PATTERN","INVALID_FID","generateFid","fidByteArray","fid","b64String","encode","getKey","fidChangeCallbacks","fidChanged","callFidChangeCallbacks","channel","getBroadcastChannel","postMessage","closeBroadcastChannel","broadcastFidChange","broadcastChannel","BroadcastChannel","onmessage","DATABASE_NAME","DATABASE_VERSION","OBJECT_STORE_NAME","oldValue","updateFn","store","newValue","getInstallationEntry","installations","registrationPromise","installationEntry","oldEntry","entry","registrationStatus","clearTimedOutRequest","updateOrCreateInstallationEntry","entryWithPromise","onLine","inProgressEntry","registrationTime","registeredInstallationEntry","heartbeatServiceProvider","endpoint","heartbeatService","heartbeatsHeader","authVersion","sdkVersion","fetch","ok","responseValue","authToken","createInstallationRequest","registerInstallation","waitUntilFidRegistration","triggerRegistrationIfNecessary","updateInstallationRequest","generateAuthTokenRequest","getGenerateAuthTokenEndpoint","installation","refreshAuthToken","forceRefresh","tokenPromise","isEntryRegistered","oldAuthToken","isAuthTokenExpired","isAuthTokenValid","updateAuthTokenRequest","waitUntilAuthTokenRequest","inProgressAuthToken","requestTime","makeAuthTokenRequestInProgressEntry","updatedInstallationEntry","fetchAuthTokenFromServer","getToken","installationsImpl","completeInstallationRegistration","getMissingValueError","valueName","INSTALLATIONS_NAME","publicFactory","configKeys","keyName","extractAppConfig","internalFactory","getId","RemoteConfigAbortSignal","abort","RC_COMPONENT_NAME","BOOLEAN_TRUTHY_VALUES","Value","_source","_value","asString","asBoolean","asNumber","getSource","getRemoteConfig","fetchConfig","remoteConfig","rc","abortSignal","settings","fetchTimeoutMillis","_client","cacheMaxAgeMillis","minimumFetchIntervalMillis","signal","_storageCache","setLastFetchStatus","lastFetchStatus","errorCode","hasErrorCode","getAll","obj1","obj2","getAllKeys","getActiveConfig","defaultConfig","allConfigs","getValue","_isInitializationComplete","_logger","activeConfig","CachingClient","client","storage","storageCache","isCachedDataFresh","lastSuccessfulFetchTimestampMillis","cacheAgeMillis","lastSuccessfulFetchResponse","getLastSuccessfulFetchTimestampMillis","getLastSuccessfulFetchResponse","eTag","storageOperations","setLastSuccessfulFetchTimestampMillis","setLastSuccessfulFetchResponse","getUserLanguage","navigatorLanguage","languages","language","RestClient","firebaseInstallations","namespace","installationId","installationToken","FIREBASE_REMOTE_CONFIG_URL_BASE","requestBody","sdk_version","app_instance_id","app_instance_id_token","app_id","language_code","fetchPromise","timeoutPromise","_resolve","race","originalError","responseEtag","responseBody","httpStatus","RetryingClient","throttleMetadata","getThrottleMetadata","throttleEndTimeMillis","attemptFetch","backoffMillis","setAbortableTimeout","deleteThrottleMetadata","isRetriableError","setThrottleMetadata","RemoteConfig","fetchTimeMillis","getLastFetchStatus","toFirebaseError","APP_NAMESPACE_STORE","Storage","openDbPromise","keyPath","openDatabase","timestamp","setActiveConfig","getActiveConfigEtag","setActiveConfigEtag","etag","metadata","compositeKey","createCompositeKey","StorageCache","loadFromStorage","lastFetchStatusPromise","lastSuccessfulFetchTimestampMillisPromise","activeConfigPromise","timestampMillis","fetchAndActivate","activeConfigEtag","activate","restClient","retryingClient","cachingClient","remoteConfigInstance","_initializePromise","ensureInitialized","instanceOfAny","constructors","idbProxyableTypes","cursorAdvanceMethods","cursorRequestMap","WeakMap","transactionDoneMap","transactionStoreNamesMap","transformCache","reverseTransformCache","idbProxyTraps","receiver","IDBTransaction","objectStoreNames","wrapFunction","IDBDatabase","IDBCursor","advance","continue","continuePrimaryKey","unwrap","storeNames","transformCachableValue","unlisten","DOMException","cacheDonePromiseForTransaction","IDBObjectStore","IDBIndex","Proxy","IDBRequest","promisifyRequest","openDB","blocked","blocking","terminated","openPromise","newVersion","readMethods","writeMethods","cachedMethods","getMethod","targetFuncName","useIndex","isWrite","storeName","oldTraps"],"sourceRoot":""}