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C,CACAE,SAASF,GACL6E,KAAK66M,iBAAmB76M,KAAK66M,gBAAgB76M,KAAM+5M,EAASv7I,SAAUrjE,GACtE6E,KAAK46M,YAAY56M,KAAM+5M,EAASv7I,SAAUrjE,EAC9C,EAEJ,SAAS+kE,EAAY8rC,GACjByzD,EAAU5nI,SAAQmjL,IACdA,EAAK96I,YAAY8rC,EAAM,GAE/B,CACA,SAASivG,EAAkB/E,EAAa93M,GACpC,IAAK,MAAM7B,KAAYkjK,EAAW,CAC9B,IAAIy7C,EAAiB,KACjB98M,GAAWA,EAAQ4tG,QACnBkvG,EAAiBlB,EAAkB57M,EAAQ4tG,QAG3CzvG,EAASw+M,eADO,OAAhB7E,EAC0B,KAGA,CAAC35M,EAAUyvG,KAAU7wG,KAC3C,MAAMY,EAAUZ,EACXuD,KAAIu1C,IACL,GAAW,MAAPA,EACA,OAAO,KAEN,GAAmB,kBAARA,EACZ,OAAOA,EAEN,GAAmB,kBAARA,GAAmC,mBAARA,EACvC,OAAOA,EAAIjtC,WAEV,GAAIitC,aAAeh3C,MACpB,OAAOg3C,EAAIl4C,QAGX,IACI,OAAO+F,KAAKC,UAAUkyC,EAI1B,CAFA,MAAOknK,GACH,OAAO,IACX,CACJ,IAECxwM,QAAOspC,GAAOA,IACdhiC,KAAK,KACN+5F,IAA6B,OAAnBkvG,QAA8C,IAAnBA,EAA4BA,EAAiB3+M,EAASnB,WAC3F86M,EAAY,CACRlqG,MAAO+tG,EAAS/tG,GAAOtoG,cACvB3H,UACAZ,OACA4S,KAAMxR,EAASH,MAEvB,CAGZ,CACJ,C","sources":["webpack://tonicosta-vuetify/./node_modules/tslib/tslib.es6.js","webpack://tonicosta-vuetify/./node_modules/@firebase/auth/dist/esm2017/index-90ebcfae.js","webpack://tonicosta-vuetify/./node_modules/@firebase/util/dist/index.esm2017.js","webpack://tonicosta-vuetify/./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/a-callable.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/a-possible-prototype.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/an-object.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/array-includes.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/classof-raw.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/classof.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/clear-error-stack.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/copy-constructor-properties.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/create-non-enumerable-property.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/create-property-descriptor.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/define-built-in.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/define-global-property.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/descriptors.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/document-create-element.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/engine-user-agent.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/engine-v8-version.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/enum-bug-keys.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/error-stack-installable.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/export.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/fails.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/function-apply.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/function-bind-native.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/function-call.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/function-name.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/function-uncurry-this.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/get-built-in.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/get-method.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/global.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/has-own-property.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/hidden-keys.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/ie8-dom-define.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/indexed-object.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/inherit-if-required.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/inspect-source.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/install-error-cause.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/internal-state.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/is-callable.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/is-forced.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/is-object.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/is-pure.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/is-symbol.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/length-of-array-like.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/make-built-in.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/math-trunc.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/native-symbol.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/native-weak-map.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/normalize-string-argument.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/object-define-property.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/object-get-own-property-descriptor.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/object-get-own-property-names.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/object-get-own-property-symbols.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/object-is-prototype-of.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/object-keys-internal.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/object-property-is-enumerable.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/object-set-prototype-of.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/ordinary-to-primitive.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/own-keys.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/proxy-accessor.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/require-object-coercible.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/shared-key.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/shared-store.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/shared.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/to-absolute-index.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/to-indexed-object.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/to-integer-or-infinity.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/to-length.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/to-object.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/to-primitive.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/to-property-key.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/to-string-tag-support.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/to-string.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/try-to-string.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/uid.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/use-symbol-as-uid.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/v8-prototype-define-bug.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/well-known-symbol.js","webpack://tonicosta-vuetify/./node_modules/core-js/internals/wrap-error-constructor-with-cause.js","webpack://tonicosta-vuetify/./node_modules/core-js/modules/es.error.cause.js","webpack://tonicosta-vuetify/./node_modules/firebase/compat/app/dist/index.esm.js","webpack://tonicosta-vuetify/./node_modules/@firebase/auth/dist/esm2017/internal.js","webpack://tonicosta-vuetify/./node_modules/@firebase/auth-compat/dist/index.esm2017.js","webpack://tonicosta-vuetify/./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js","webpack://tonicosta-vuetify/./node_modules/@firebase/firestore/dist/index.esm2017.js","webpack://tonicosta-vuetify/./node_modules/@firebase/firestore-compat/dist/index.esm2017.js","webpack://tonicosta-vuetify/./node_modules/@firebase/storage/dist/index.esm2017.js","webpack://tonicosta-vuetify/./node_modules/@firebase/storage-compat/dist/esm/index.esm2017.js","webpack://tonicosta-vuetify/../../../src/components/VApp/VApp.ts","webpack://tonicosta-vuetify/../../../src/directives/scroll/index.ts","webpack://tonicosta-vuetify/../../../src/mixins/scrollable/index.ts","webpack://tonicosta-vuetify/../../../src/components/VAppBar/VAppBar.ts","webpack://tonicosta-vuetify/../../../src/components/VAppBar/VAppBarNavIcon.ts","webpack://tonicosta-vuetify/../../../src/components/VProgressCircular/index.ts","webpack://tonicosta-vuetify/../../../src/components/VBtn/VBtn.ts","webpack://tonicosta-vuetify/../../../src/components/VBtnToggle/VBtnToggle.ts","webpack://tonicosta-vuetify/../../../src/components/VCard/VCard.ts","webpack://tonicosta-vuetify/../../../src/components/VCard/index.ts","webpack://tonicosta-vuetify/../../../src/components/VBtn/index.ts","webpack://tonicosta-vuetify/../../../src/components/VWindow/VWindow.ts","webpack://tonicosta-vuetify/../../../src/components/VCarousel/VCarousel.ts","webpack://tonicosta-vuetify/../../../src/components/VWindow/VWindowItem.ts","webpack://tonicosta-vuetify/../../../src/components/VCarousel/VCarouselItem.ts","webpack://tonicosta-vuetify/../../../src/components/VFooter/VFooter.ts","webpack://tonicosta-vuetify/../../../src/components/VGrid/VCol.ts","webpack://tonicosta-vuetify/../../../src/components/VGrid/grid.ts","webpack://tonicosta-vuetify/../../../src/components/VGrid/VContainer.ts","webpack://tonicosta-vuetify/../../../src/components/VGrid/VRow.ts","webpack://tonicosta-vuetify/../../../src/components/VGrid/VSpacer.ts","webpack://tonicosta-vuetify/../../../src/components/VIcon/VIcon.ts","webpack://tonicosta-vuetify/../../../src/components/VIcon/index.ts","webpack://tonicosta-vuetify/../../../src/components/VResponsive/VResponsive.ts","webpack://tonicosta-vuetify/../../../src/components/VResponsive/index.ts","webpack://tonicosta-vuetify/../../../src/components/VImg/VImg.ts","webpack://tonicosta-vuetify/../../../src/components/VItemGroup/VItemGroup.ts","webpack://tonicosta-vuetify/../../../src/components/VList/VList.ts","webpack://tonicosta-vuetify/../../../src/components/VList/VListItem.ts","webpack://tonicosta-vuetify/../../../src/components/VList/VListItemAction.ts","webpack://tonicosta-vuetify/../../../src/components/VList/VListItemGroup.ts","webpack://tonicosta-vuetify/../../../src/components/VList/VListItemIcon.ts","webpack://tonicosta-vuetify/../../../src/components/VList/VListGroup.ts","webpack://tonicosta-vuetify/../../../src/components/VAvatar/VAvatar.ts","webpack://tonicosta-vuetify/../../../src/components/VAvatar/index.ts","webpack://tonicosta-vuetify/../../../src/components/VList/VListItemAvatar.ts","webpack://tonicosta-vuetify/../../../src/components/VList/index.ts","webpack://tonicosta-vuetify/../../../src/components/VMain/VMain.ts","webpack://tonicosta-vuetify/../../../src/mixins/mobile/index.ts","webpack://tonicosta-vuetify/../../../src/components/VNavigationDrawer/VNavigationDrawer.ts","webpack://tonicosta-vuetify/../../../src/mixins/translatable/index.ts","webpack://tonicosta-vuetify/../../../src/components/VParallax/VParallax.ts","webpack://tonicosta-vuetify/../../../src/components/VProgressCircular/VProgressCircular.ts","webpack://tonicosta-vuetify/../../../src/components/VProgressLinear/VProgressLinear.ts","webpack://tonicosta-vuetify/../../../src/components/VProgressLinear/index.ts","webpack://tonicosta-vuetify/../../../src/components/VSheet/VSheet.ts","webpack://tonicosta-vuetify/../../../src/components/VSheet/index.ts","webpack://tonicosta-vuetify/../../../src/components/VToolbar/VToolbar.ts","webpack://tonicosta-vuetify/../../../src/components/VToolbar/index.ts","webpack://tonicosta-vuetify/../../../src/components/transitions/createTransition.ts","webpack://tonicosta-vuetify/../../../src/components/transitions/expand-transition.ts","webpack://tonicosta-vuetify/../../../src/components/transitions/index.ts","webpack://tonicosta-vuetify/../../../src/directives/click-outside/index.ts","webpack://tonicosta-vuetify/../../../src/directives/intersect/index.ts","webpack://tonicosta-vuetify/../../../src/directives/resize/index.ts","webpack://tonicosta-vuetify/../../../src/directives/ripple/index.ts","webpack://tonicosta-vuetify/../../../src/directives/touch/index.ts","webpack://tonicosta-vuetify/../src/install.ts","webpack://tonicosta-vuetify/../locale/en.ts","webpack://tonicosta-vuetify/../../../src/presets/default/index.ts","webpack://tonicosta-vuetify/../../../src/services/presets/index.ts","webpack://tonicosta-vuetify/../../../src/services/application/index.ts","webpack://tonicosta-vuetify/../../../src/services/breakpoint/index.ts","webpack://tonicosta-vuetify/../../../../src/services/icons/presets/mdi-svg.ts","webpack://tonicosta-vuetify/../../../../src/services/icons/presets/md.ts","webpack://tonicosta-vuetify/../../../../src/services/icons/presets/mdi.ts","webpack://tonicosta-vuetify/../../../../src/services/icons/presets/fa.ts","webpack://tonicosta-vuetify/../../../../src/services/icons/presets/fa4.ts","webpack://tonicosta-vuetify/../../../../src/services/icons/presets/fa-svg.ts","webpack://tonicosta-vuetify/../../../../src/services/icons/presets/index.ts","webpack://tonicosta-vuetify/../../../src/services/icons/index.ts","webpack://tonicosta-vuetify/../../../src/services/lang/index.ts","webpack://tonicosta-vuetify/../../../src/util/color/transformSRGB.ts","webpack://tonicosta-vuetify/../../../src/util/color/transformCIELAB.ts","webpack://tonicosta-vuetify/../../../src/services/theme/utils.ts","webpack://tonicosta-vuetify/../../../src/services/theme/index.ts","webpack://tonicosta-vuetify/../src/framework.ts","webpack://tonicosta-vuetify/../locale/es.ts","webpack://tonicosta-vuetify/../../../src/mixins/applicationable/index.ts","webpack://tonicosta-vuetify/../../../src/mixins/binds-attrs/index.ts","webpack://tonicosta-vuetify/../../../src/mixins/bootable/index.ts","webpack://tonicosta-vuetify/../../../src/mixins/button-group/index.ts","webpack://tonicosta-vuetify/../../../src/mixins/colorable/index.ts","webpack://tonicosta-vuetify/../../../src/mixins/comparable/index.ts","webpack://tonicosta-vuetify/../../../src/mixins/dependent/index.ts","webpack://tonicosta-vuetify/../../../src/mixins/elevatable/index.ts","webpack://tonicosta-vuetify/../../../src/mixins/groupable/index.ts","webpack://tonicosta-vuetify/../../../src/mixins/loadable/index.ts","webpack://tonicosta-vuetify/../../../src/mixins/measurable/index.ts","webpack://tonicosta-vuetify/../../../src/components/VOverlay/VOverlay.ts","webpack://tonicosta-vuetify/../../../src/components/VOverlay/index.ts","webpack://tonicosta-vuetify/../../../src/mixins/overlayable/index.ts","webpack://tonicosta-vuetify/../../../src/mixins/positionable/index.ts","webpack://tonicosta-vuetify/../../../src/mixins/proxyable/index.ts","webpack://tonicosta-vuetify/../../../src/mixins/registrable/index.ts","webpack://tonicosta-vuetify/../../../src/mixins/roundable/index.ts","webpack://tonicosta-vuetify/../../../src/mixins/routable/index.ts","webpack://tonicosta-vuetify/../../../src/mixins/sizeable/index.ts","webpack://tonicosta-vuetify/../../../src/mixins/ssr-bootable/index.ts","webpack://tonicosta-vuetify/../../../src/mixins/themeable/index.ts","webpack://tonicosta-vuetify/../../../src/mixins/toggleable/index.ts","webpack://tonicosta-vuetify/../../../src/services/goto/easing-patterns.ts","webpack://tonicosta-vuetify/../../../src/services/goto/util.ts","webpack://tonicosta-vuetify/../../../src/services/goto/index.ts","webpack://tonicosta-vuetify/../../../src/services/service/index.ts","webpack://tonicosta-vuetify/../util/colorUtils.ts","webpack://tonicosta-vuetify/../util/console.ts","webpack://tonicosta-vuetify/../util/dom.ts","webpack://tonicosta-vuetify/../util/helpers.ts","webpack://tonicosta-vuetify/../util/mergeData.ts","webpack://tonicosta-vuetify/../util/mixins.ts","webpack://tonicosta-vuetify/./node_modules/vue-i18n/dist/vue-i18n.esm.js","webpack://tonicosta-vuetify/./node_modules/vue-router/dist/vue-router.esm.js","webpack://tonicosta-vuetify/./node_modules/vue/dist/vue.runtime.esm.js","webpack://tonicosta-vuetify/./node_modules/vuex/dist/vuex.esm.js","webpack://tonicosta-vuetify/./node_modules/@firebase/app-compat/dist/esm/index.esm2017.js","webpack://tonicosta-vuetify/./node_modules/idb/build/wrap-idb-value.js","webpack://tonicosta-vuetify/./node_modules/idb/build/index.js","webpack://tonicosta-vuetify/./node_modules/@firebase/app/dist/esm/index.esm2017.js","webpack://tonicosta-vuetify/./node_modules/@firebase/component/dist/esm/index.esm2017.js","webpack://tonicosta-vuetify/./node_modules/@firebase/logger/dist/esm/index.esm2017.js"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n","import { ErrorFactory, deepEqual, isBrowserExtension, isMobileCordova, isReactNative, FirebaseError, querystring, getModularInstance, base64Decode, getUA, isIE, createSubscribe, querystringDecode, extractQuerystring, isEmpty } from '@firebase/util';\nimport { SDK_VERSION, _getProvider, _registerComponent, registerVersion, getApp } from '@firebase/app';\nimport { __rest } from 'tslib';\nimport { Logger, LogLevel } from '@firebase/logger';\nimport { Component } from '@firebase/component';\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\n/**\r\n * An enum of factors that may be used for multifactor authentication.\r\n *\r\n * @public\r\n */\r\nconst FactorId = {\r\n /** Phone as second factor */\r\n PHONE: 'phone'\r\n};\r\n/**\r\n * Enumeration of supported providers.\r\n *\r\n * @public\r\n */\r\nconst ProviderId = {\r\n /** Facebook provider ID */\r\n FACEBOOK: 'facebook.com',\r\n /** GitHub provider ID */\r\n GITHUB: 'github.com',\r\n /** Google provider ID */\r\n GOOGLE: 'google.com',\r\n /** Password provider */\r\n PASSWORD: 'password',\r\n /** Phone provider */\r\n PHONE: 'phone',\r\n /** Twitter provider ID */\r\n TWITTER: 'twitter.com'\r\n};\r\n/**\r\n * Enumeration of supported sign-in methods.\r\n *\r\n * @public\r\n */\r\nconst SignInMethod = {\r\n /** Email link sign in method */\r\n EMAIL_LINK: 'emailLink',\r\n /** Email/password sign in method */\r\n EMAIL_PASSWORD: 'password',\r\n /** Facebook sign in method */\r\n FACEBOOK: 'facebook.com',\r\n /** GitHub sign in method */\r\n GITHUB: 'github.com',\r\n /** Google sign in method */\r\n GOOGLE: 'google.com',\r\n /** Phone sign in method */\r\n PHONE: 'phone',\r\n /** Twitter sign in method */\r\n TWITTER: 'twitter.com'\r\n};\r\n/**\r\n * Enumeration of supported operation types.\r\n *\r\n * @public\r\n */\r\nconst OperationType = {\r\n /** Operation involving linking an additional provider to an already signed-in user. */\r\n LINK: 'link',\r\n /** Operation involving using a provider to reauthenticate an already signed-in user. */\r\n REAUTHENTICATE: 'reauthenticate',\r\n /** Operation involving signing in a user. */\r\n SIGN_IN: 'signIn'\r\n};\r\n/**\r\n * An enumeration of the possible email action types.\r\n *\r\n * @public\r\n */\r\nconst ActionCodeOperation = {\r\n /** The email link sign-in action. */\r\n EMAIL_SIGNIN: 'EMAIL_SIGNIN',\r\n /** The password reset action. */\r\n PASSWORD_RESET: 'PASSWORD_RESET',\r\n /** The email revocation action. */\r\n RECOVER_EMAIL: 'RECOVER_EMAIL',\r\n /** The revert second factor addition email action. */\r\n REVERT_SECOND_FACTOR_ADDITION: 'REVERT_SECOND_FACTOR_ADDITION',\r\n /** The revert second factor addition email action. */\r\n VERIFY_AND_CHANGE_EMAIL: 'VERIFY_AND_CHANGE_EMAIL',\r\n /** The email verification action. */\r\n VERIFY_EMAIL: 'VERIFY_EMAIL'\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 _debugErrorMap() {\r\n return {\r\n [\"admin-restricted-operation\" /* ADMIN_ONLY_OPERATION */]: 'This operation is restricted to administrators only.',\r\n [\"argument-error\" /* ARGUMENT_ERROR */]: '',\r\n [\"app-not-authorized\" /* APP_NOT_AUTHORIZED */]: \"This app, identified by the domain where it's hosted, is not \" +\r\n 'authorized to use Firebase Authentication with the provided API key. ' +\r\n 'Review your key configuration in the Google API console.',\r\n [\"app-not-installed\" /* APP_NOT_INSTALLED */]: 'The requested mobile application corresponding to the identifier (' +\r\n 'Android package name or iOS bundle ID) provided is not installed on ' +\r\n 'this device.',\r\n [\"captcha-check-failed\" /* CAPTCHA_CHECK_FAILED */]: 'The reCAPTCHA response token provided is either invalid, expired, ' +\r\n 'already used or the domain associated with it does not match the list ' +\r\n 'of whitelisted domains.',\r\n [\"code-expired\" /* CODE_EXPIRED */]: 'The SMS code has expired. Please re-send the verification code to try ' +\r\n 'again.',\r\n [\"cordova-not-ready\" /* CORDOVA_NOT_READY */]: 'Cordova framework is not ready.',\r\n [\"cors-unsupported\" /* CORS_UNSUPPORTED */]: 'This browser is not supported.',\r\n [\"credential-already-in-use\" /* CREDENTIAL_ALREADY_IN_USE */]: 'This credential is already associated with a different user account.',\r\n [\"custom-token-mismatch\" /* CREDENTIAL_MISMATCH */]: 'The custom token corresponds to a different audience.',\r\n [\"requires-recent-login\" /* CREDENTIAL_TOO_OLD_LOGIN_AGAIN */]: 'This operation is sensitive and requires recent authentication. Log in ' +\r\n 'again before retrying this request.',\r\n [\"dependent-sdk-initialized-before-auth\" /* DEPENDENT_SDK_INIT_BEFORE_AUTH */]: 'Another Firebase SDK was initialized and is trying to use Auth before Auth is ' +\r\n 'initialized. Please be sure to call `initializeAuth` or `getAuth` before ' +\r\n 'starting any other Firebase SDK.',\r\n [\"dynamic-link-not-activated\" /* DYNAMIC_LINK_NOT_ACTIVATED */]: 'Please activate Dynamic Links in the Firebase Console and agree to the terms and ' +\r\n 'conditions.',\r\n [\"email-change-needs-verification\" /* EMAIL_CHANGE_NEEDS_VERIFICATION */]: 'Multi-factor users must always have a verified email.',\r\n [\"email-already-in-use\" /* EMAIL_EXISTS */]: 'The email address is already in use by another account.',\r\n [\"emulator-config-failed\" /* EMULATOR_CONFIG_FAILED */]: 'Auth instance has already been used to make a network call. Auth can ' +\r\n 'no longer be configured to use the emulator. Try calling ' +\r\n '\"connectAuthEmulator()\" sooner.',\r\n [\"expired-action-code\" /* EXPIRED_OOB_CODE */]: 'The action code has expired.',\r\n [\"cancelled-popup-request\" /* EXPIRED_POPUP_REQUEST */]: 'This operation has been cancelled due to another conflicting popup being opened.',\r\n [\"internal-error\" /* INTERNAL_ERROR */]: 'An internal AuthError has occurred.',\r\n [\"invalid-app-credential\" /* INVALID_APP_CREDENTIAL */]: 'The phone verification request contains an invalid application verifier.' +\r\n ' The reCAPTCHA token response is either invalid or expired.',\r\n [\"invalid-app-id\" /* INVALID_APP_ID */]: 'The mobile app identifier is not registed for the current project.',\r\n [\"invalid-user-token\" /* INVALID_AUTH */]: \"This user's credential isn't valid for this project. This can happen \" +\r\n \"if the user's token has been tampered with, or if the user isn't for \" +\r\n 'the project associated with this API key.',\r\n [\"invalid-auth-event\" /* INVALID_AUTH_EVENT */]: 'An internal AuthError has occurred.',\r\n [\"invalid-verification-code\" /* INVALID_CODE */]: 'The SMS verification code used to create the phone auth credential is ' +\r\n 'invalid. Please resend the verification code sms and be sure to use the ' +\r\n 'verification code provided by the user.',\r\n [\"invalid-continue-uri\" /* INVALID_CONTINUE_URI */]: 'The continue URL provided in the request is invalid.',\r\n [\"invalid-cordova-configuration\" /* INVALID_CORDOVA_CONFIGURATION */]: 'The following Cordova plugins must be installed to enable OAuth sign-in: ' +\r\n 'cordova-plugin-buildinfo, cordova-universal-links-plugin, ' +\r\n 'cordova-plugin-browsertab, cordova-plugin-inappbrowser and ' +\r\n 'cordova-plugin-customurlscheme.',\r\n [\"invalid-custom-token\" /* INVALID_CUSTOM_TOKEN */]: 'The custom token format is incorrect. Please check the documentation.',\r\n [\"invalid-dynamic-link-domain\" /* INVALID_DYNAMIC_LINK_DOMAIN */]: 'The provided dynamic link domain is not configured or authorized for the current project.',\r\n [\"invalid-email\" /* INVALID_EMAIL */]: 'The email address is badly formatted.',\r\n [\"invalid-emulator-scheme\" /* INVALID_EMULATOR_SCHEME */]: 'Emulator URL must start with a valid scheme (http:// or https://).',\r\n [\"invalid-api-key\" /* INVALID_API_KEY */]: 'Your API key is invalid, please check you have copied it correctly.',\r\n [\"invalid-cert-hash\" /* INVALID_CERT_HASH */]: 'The SHA-1 certificate hash provided is invalid.',\r\n [\"invalid-credential\" /* INVALID_IDP_RESPONSE */]: 'The supplied auth credential is malformed or has expired.',\r\n [\"invalid-message-payload\" /* INVALID_MESSAGE_PAYLOAD */]: 'The email template corresponding to this action contains invalid characters in its message. ' +\r\n 'Please fix by going to the Auth email templates section in the Firebase Console.',\r\n [\"invalid-multi-factor-session\" /* INVALID_MFA_SESSION */]: 'The request does not contain a valid proof of first factor successful sign-in.',\r\n [\"invalid-oauth-provider\" /* INVALID_OAUTH_PROVIDER */]: 'EmailAuthProvider is not supported for this operation. This operation ' +\r\n 'only supports OAuth providers.',\r\n [\"invalid-oauth-client-id\" /* INVALID_OAUTH_CLIENT_ID */]: 'The OAuth client ID provided is either invalid or does not match the ' +\r\n 'specified API key.',\r\n [\"unauthorized-domain\" /* INVALID_ORIGIN */]: 'This domain is not authorized for OAuth operations for your Firebase ' +\r\n 'project. Edit the list of authorized domains from the Firebase console.',\r\n [\"invalid-action-code\" /* INVALID_OOB_CODE */]: 'The action code is invalid. This can happen if the code is malformed, ' +\r\n 'expired, or has already been used.',\r\n [\"wrong-password\" /* INVALID_PASSWORD */]: 'The password is invalid or the user does not have a password.',\r\n [\"invalid-persistence-type\" /* INVALID_PERSISTENCE */]: 'The specified persistence type is invalid. It can only be local, session or none.',\r\n [\"invalid-phone-number\" /* INVALID_PHONE_NUMBER */]: 'The format of the phone number provided is incorrect. Please enter the ' +\r\n 'phone number in a format that can be parsed into E.164 format. E.164 ' +\r\n 'phone numbers are written in the format [+][country code][subscriber ' +\r\n 'number including area code].',\r\n [\"invalid-provider-id\" /* INVALID_PROVIDER_ID */]: 'The specified provider ID is invalid.',\r\n [\"invalid-recipient-email\" /* INVALID_RECIPIENT_EMAIL */]: 'The email corresponding to this action failed to send as the provided ' +\r\n 'recipient email address is invalid.',\r\n [\"invalid-sender\" /* INVALID_SENDER */]: 'The email template corresponding to this action contains an invalid sender email or name. ' +\r\n 'Please fix by going to the Auth email templates section in the Firebase Console.',\r\n [\"invalid-verification-id\" /* INVALID_SESSION_INFO */]: 'The verification ID used to create the phone auth credential is invalid.',\r\n [\"invalid-tenant-id\" /* INVALID_TENANT_ID */]: \"The Auth instance's tenant ID is invalid.\",\r\n [\"login-blocked\" /* LOGIN_BLOCKED */]: \"Login blocked by user-provided method: {$originalMessage}\",\r\n [\"missing-android-pkg-name\" /* MISSING_ANDROID_PACKAGE_NAME */]: 'An Android Package Name must be provided if the Android App is required to be installed.',\r\n [\"auth-domain-config-required\" /* MISSING_AUTH_DOMAIN */]: 'Be sure to include authDomain when calling firebase.initializeApp(), ' +\r\n 'by following the instructions in the Firebase console.',\r\n [\"missing-app-credential\" /* MISSING_APP_CREDENTIAL */]: 'The phone verification request is missing an application verifier ' +\r\n 'assertion. A reCAPTCHA response token needs to be provided.',\r\n [\"missing-verification-code\" /* MISSING_CODE */]: 'The phone auth credential was created with an empty SMS verification code.',\r\n [\"missing-continue-uri\" /* MISSING_CONTINUE_URI */]: 'A continue URL must be provided in the request.',\r\n [\"missing-iframe-start\" /* MISSING_IFRAME_START */]: 'An internal AuthError has occurred.',\r\n [\"missing-ios-bundle-id\" /* MISSING_IOS_BUNDLE_ID */]: 'An iOS Bundle ID must be provided if an App Store ID is provided.',\r\n [\"missing-or-invalid-nonce\" /* MISSING_OR_INVALID_NONCE */]: 'The request does not contain a valid nonce. This can occur if the ' +\r\n 'SHA-256 hash of the provided raw nonce does not match the hashed nonce ' +\r\n 'in the ID token payload.',\r\n [\"missing-multi-factor-info\" /* MISSING_MFA_INFO */]: 'No second factor identifier is provided.',\r\n [\"missing-multi-factor-session\" /* MISSING_MFA_SESSION */]: 'The request is missing proof of first factor successful sign-in.',\r\n [\"missing-phone-number\" /* MISSING_PHONE_NUMBER */]: 'To send verification codes, provide a phone number for the recipient.',\r\n [\"missing-verification-id\" /* MISSING_SESSION_INFO */]: 'The phone auth credential was created with an empty verification ID.',\r\n [\"app-deleted\" /* MODULE_DESTROYED */]: 'This instance of FirebaseApp has been deleted.',\r\n [\"multi-factor-info-not-found\" /* MFA_INFO_NOT_FOUND */]: 'The user does not have a second factor matching the identifier provided.',\r\n [\"multi-factor-auth-required\" /* MFA_REQUIRED */]: 'Proof of ownership of a second factor is required to complete sign-in.',\r\n [\"account-exists-with-different-credential\" /* NEED_CONFIRMATION */]: 'An account already exists with the same email address but different ' +\r\n 'sign-in credentials. Sign in using a provider associated with this ' +\r\n 'email address.',\r\n [\"network-request-failed\" /* NETWORK_REQUEST_FAILED */]: 'A network AuthError (such as timeout, interrupted connection or unreachable host) has occurred.',\r\n [\"no-auth-event\" /* NO_AUTH_EVENT */]: 'An internal AuthError has occurred.',\r\n [\"no-such-provider\" /* NO_SUCH_PROVIDER */]: 'User was not linked to an account with the given provider.',\r\n [\"null-user\" /* NULL_USER */]: 'A null user object was provided as the argument for an operation which ' +\r\n 'requires a non-null user object.',\r\n [\"operation-not-allowed\" /* OPERATION_NOT_ALLOWED */]: 'The given sign-in provider is disabled for this Firebase project. ' +\r\n 'Enable it in the Firebase console, under the sign-in method tab of the ' +\r\n 'Auth section.',\r\n [\"operation-not-supported-in-this-environment\" /* OPERATION_NOT_SUPPORTED */]: 'This operation is not supported in the environment this application is ' +\r\n 'running on. \"location.protocol\" must be http, https or chrome-extension' +\r\n ' and web storage must be enabled.',\r\n [\"popup-blocked\" /* POPUP_BLOCKED */]: 'Unable to establish a connection with the popup. It may have been blocked by the browser.',\r\n [\"popup-closed-by-user\" /* POPUP_CLOSED_BY_USER */]: 'The popup has been closed by the user before finalizing the operation.',\r\n [\"provider-already-linked\" /* PROVIDER_ALREADY_LINKED */]: 'User can only be linked to one identity for the given provider.',\r\n [\"quota-exceeded\" /* QUOTA_EXCEEDED */]: \"The project's quota for this operation has been exceeded.\",\r\n [\"redirect-cancelled-by-user\" /* REDIRECT_CANCELLED_BY_USER */]: 'The redirect operation has been cancelled by the user before finalizing.',\r\n [\"redirect-operation-pending\" /* REDIRECT_OPERATION_PENDING */]: 'A redirect sign-in operation is already pending.',\r\n [\"rejected-credential\" /* REJECTED_CREDENTIAL */]: 'The request contains malformed or mismatching credentials.',\r\n [\"second-factor-already-in-use\" /* SECOND_FACTOR_ALREADY_ENROLLED */]: 'The second factor is already enrolled on this account.',\r\n [\"maximum-second-factor-count-exceeded\" /* SECOND_FACTOR_LIMIT_EXCEEDED */]: 'The maximum allowed number of second factors on a user has been exceeded.',\r\n [\"tenant-id-mismatch\" /* TENANT_ID_MISMATCH */]: \"The provided tenant ID does not match the Auth instance's tenant ID\",\r\n [\"timeout\" /* TIMEOUT */]: 'The operation has timed out.',\r\n [\"user-token-expired\" /* TOKEN_EXPIRED */]: \"The user's credential is no longer valid. The user must sign in again.\",\r\n [\"too-many-requests\" /* TOO_MANY_ATTEMPTS_TRY_LATER */]: 'We have blocked all requests from this device due to unusual activity. ' +\r\n 'Try again later.',\r\n [\"unauthorized-continue-uri\" /* UNAUTHORIZED_DOMAIN */]: 'The domain of the continue URL is not whitelisted. Please whitelist ' +\r\n 'the domain in the Firebase console.',\r\n [\"unsupported-first-factor\" /* UNSUPPORTED_FIRST_FACTOR */]: 'Enrolling a second factor or signing in with a multi-factor account requires sign-in with a supported first factor.',\r\n [\"unsupported-persistence-type\" /* UNSUPPORTED_PERSISTENCE */]: 'The current environment does not support the specified persistence type.',\r\n [\"unsupported-tenant-operation\" /* UNSUPPORTED_TENANT_OPERATION */]: 'This operation is not supported in a multi-tenant context.',\r\n [\"unverified-email\" /* UNVERIFIED_EMAIL */]: 'The operation requires a verified email.',\r\n [\"user-cancelled\" /* USER_CANCELLED */]: 'The user did not grant your application the permissions it requested.',\r\n [\"user-not-found\" /* USER_DELETED */]: 'There is no user record corresponding to this identifier. The user may ' +\r\n 'have been deleted.',\r\n [\"user-disabled\" /* USER_DISABLED */]: 'The user account has been disabled by an administrator.',\r\n [\"user-mismatch\" /* USER_MISMATCH */]: 'The supplied credentials do not correspond to the previously signed in user.',\r\n [\"user-signed-out\" /* USER_SIGNED_OUT */]: '',\r\n [\"weak-password\" /* WEAK_PASSWORD */]: 'The password must be 6 characters long or more.',\r\n [\"web-storage-unsupported\" /* WEB_STORAGE_UNSUPPORTED */]: 'This browser is not supported or 3rd party cookies and data may be disabled.',\r\n [\"already-initialized\" /* ALREADY_INITIALIZED */]: 'initializeAuth() has already been called with ' +\r\n 'different options. To avoid this error, call initializeAuth() with the ' +\r\n 'same options as when it was originally called, or call getAuth() to return the' +\r\n ' already initialized instance.'\r\n };\r\n}\r\nfunction _prodErrorMap() {\r\n // We will include this one message in the prod error map since by the very\r\n // nature of this error, developers will never be able to see the message\r\n // using the debugErrorMap (which is installed during auth initialization).\r\n return {\r\n [\"dependent-sdk-initialized-before-auth\" /* DEPENDENT_SDK_INIT_BEFORE_AUTH */]: 'Another Firebase SDK was initialized and is trying to use Auth before Auth is ' +\r\n 'initialized. Please be sure to call `initializeAuth` or `getAuth` before ' +\r\n 'starting any other Firebase SDK.'\r\n };\r\n}\r\n/**\r\n * A verbose error map with detailed descriptions for most error codes.\r\n *\r\n * See discussion at {@link AuthErrorMap}\r\n *\r\n * @public\r\n */\r\nconst debugErrorMap = _debugErrorMap;\r\n/**\r\n * A minimal error map with all verbose error messages stripped.\r\n *\r\n * See discussion at {@link AuthErrorMap}\r\n *\r\n * @public\r\n */\r\nconst prodErrorMap = _prodErrorMap;\r\nconst _DEFAULT_AUTH_ERROR_FACTORY = new ErrorFactory('auth', 'Firebase', _prodErrorMap());\r\n/**\r\n * A map of potential `Auth` error codes, for easier comparison with errors\r\n * thrown by the SDK.\r\n *\r\n * @remarks\r\n * Note that you can't tree-shake individual keys\r\n * in the map, so by using the map you might substantially increase your\r\n * bundle size.\r\n *\r\n * @public\r\n */\r\nconst AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY = {\r\n ADMIN_ONLY_OPERATION: 'auth/admin-restricted-operation',\r\n ARGUMENT_ERROR: 'auth/argument-error',\r\n APP_NOT_AUTHORIZED: 'auth/app-not-authorized',\r\n APP_NOT_INSTALLED: 'auth/app-not-installed',\r\n CAPTCHA_CHECK_FAILED: 'auth/captcha-check-failed',\r\n CODE_EXPIRED: 'auth/code-expired',\r\n CORDOVA_NOT_READY: 'auth/cordova-not-ready',\r\n CORS_UNSUPPORTED: 'auth/cors-unsupported',\r\n CREDENTIAL_ALREADY_IN_USE: 'auth/credential-already-in-use',\r\n CREDENTIAL_MISMATCH: 'auth/custom-token-mismatch',\r\n CREDENTIAL_TOO_OLD_LOGIN_AGAIN: 'auth/requires-recent-login',\r\n DEPENDENT_SDK_INIT_BEFORE_AUTH: 'auth/dependent-sdk-initialized-before-auth',\r\n DYNAMIC_LINK_NOT_ACTIVATED: 'auth/dynamic-link-not-activated',\r\n EMAIL_CHANGE_NEEDS_VERIFICATION: 'auth/email-change-needs-verification',\r\n EMAIL_EXISTS: 'auth/email-already-in-use',\r\n EMULATOR_CONFIG_FAILED: 'auth/emulator-config-failed',\r\n EXPIRED_OOB_CODE: 'auth/expired-action-code',\r\n EXPIRED_POPUP_REQUEST: 'auth/cancelled-popup-request',\r\n INTERNAL_ERROR: 'auth/internal-error',\r\n INVALID_API_KEY: 'auth/invalid-api-key',\r\n INVALID_APP_CREDENTIAL: 'auth/invalid-app-credential',\r\n INVALID_APP_ID: 'auth/invalid-app-id',\r\n INVALID_AUTH: 'auth/invalid-user-token',\r\n INVALID_AUTH_EVENT: 'auth/invalid-auth-event',\r\n INVALID_CERT_HASH: 'auth/invalid-cert-hash',\r\n INVALID_CODE: 'auth/invalid-verification-code',\r\n INVALID_CONTINUE_URI: 'auth/invalid-continue-uri',\r\n INVALID_CORDOVA_CONFIGURATION: 'auth/invalid-cordova-configuration',\r\n INVALID_CUSTOM_TOKEN: 'auth/invalid-custom-token',\r\n INVALID_DYNAMIC_LINK_DOMAIN: 'auth/invalid-dynamic-link-domain',\r\n INVALID_EMAIL: 'auth/invalid-email',\r\n INVALID_EMULATOR_SCHEME: 'auth/invalid-emulator-scheme',\r\n INVALID_IDP_RESPONSE: 'auth/invalid-credential',\r\n INVALID_MESSAGE_PAYLOAD: 'auth/invalid-message-payload',\r\n INVALID_MFA_SESSION: 'auth/invalid-multi-factor-session',\r\n INVALID_OAUTH_CLIENT_ID: 'auth/invalid-oauth-client-id',\r\n INVALID_OAUTH_PROVIDER: 'auth/invalid-oauth-provider',\r\n INVALID_OOB_CODE: 'auth/invalid-action-code',\r\n INVALID_ORIGIN: 'auth/unauthorized-domain',\r\n INVALID_PASSWORD: 'auth/wrong-password',\r\n INVALID_PERSISTENCE: 'auth/invalid-persistence-type',\r\n INVALID_PHONE_NUMBER: 'auth/invalid-phone-number',\r\n INVALID_PROVIDER_ID: 'auth/invalid-provider-id',\r\n INVALID_RECIPIENT_EMAIL: 'auth/invalid-recipient-email',\r\n INVALID_SENDER: 'auth/invalid-sender',\r\n INVALID_SESSION_INFO: 'auth/invalid-verification-id',\r\n INVALID_TENANT_ID: 'auth/invalid-tenant-id',\r\n MFA_INFO_NOT_FOUND: 'auth/multi-factor-info-not-found',\r\n MFA_REQUIRED: 'auth/multi-factor-auth-required',\r\n MISSING_ANDROID_PACKAGE_NAME: 'auth/missing-android-pkg-name',\r\n MISSING_APP_CREDENTIAL: 'auth/missing-app-credential',\r\n MISSING_AUTH_DOMAIN: 'auth/auth-domain-config-required',\r\n MISSING_CODE: 'auth/missing-verification-code',\r\n MISSING_CONTINUE_URI: 'auth/missing-continue-uri',\r\n MISSING_IFRAME_START: 'auth/missing-iframe-start',\r\n MISSING_IOS_BUNDLE_ID: 'auth/missing-ios-bundle-id',\r\n MISSING_OR_INVALID_NONCE: 'auth/missing-or-invalid-nonce',\r\n MISSING_MFA_INFO: 'auth/missing-multi-factor-info',\r\n MISSING_MFA_SESSION: 'auth/missing-multi-factor-session',\r\n MISSING_PHONE_NUMBER: 'auth/missing-phone-number',\r\n MISSING_SESSION_INFO: 'auth/missing-verification-id',\r\n MODULE_DESTROYED: 'auth/app-deleted',\r\n NEED_CONFIRMATION: 'auth/account-exists-with-different-credential',\r\n NETWORK_REQUEST_FAILED: 'auth/network-request-failed',\r\n NULL_USER: 'auth/null-user',\r\n NO_AUTH_EVENT: 'auth/no-auth-event',\r\n NO_SUCH_PROVIDER: 'auth/no-such-provider',\r\n OPERATION_NOT_ALLOWED: 'auth/operation-not-allowed',\r\n OPERATION_NOT_SUPPORTED: 'auth/operation-not-supported-in-this-environment',\r\n POPUP_BLOCKED: 'auth/popup-blocked',\r\n POPUP_CLOSED_BY_USER: 'auth/popup-closed-by-user',\r\n PROVIDER_ALREADY_LINKED: 'auth/provider-already-linked',\r\n QUOTA_EXCEEDED: 'auth/quota-exceeded',\r\n REDIRECT_CANCELLED_BY_USER: 'auth/redirect-cancelled-by-user',\r\n REDIRECT_OPERATION_PENDING: 'auth/redirect-operation-pending',\r\n REJECTED_CREDENTIAL: 'auth/rejected-credential',\r\n SECOND_FACTOR_ALREADY_ENROLLED: 'auth/second-factor-already-in-use',\r\n SECOND_FACTOR_LIMIT_EXCEEDED: 'auth/maximum-second-factor-count-exceeded',\r\n TENANT_ID_MISMATCH: 'auth/tenant-id-mismatch',\r\n TIMEOUT: 'auth/timeout',\r\n TOKEN_EXPIRED: 'auth/user-token-expired',\r\n TOO_MANY_ATTEMPTS_TRY_LATER: 'auth/too-many-requests',\r\n UNAUTHORIZED_DOMAIN: 'auth/unauthorized-continue-uri',\r\n UNSUPPORTED_FIRST_FACTOR: 'auth/unsupported-first-factor',\r\n UNSUPPORTED_PERSISTENCE: 'auth/unsupported-persistence-type',\r\n UNSUPPORTED_TENANT_OPERATION: 'auth/unsupported-tenant-operation',\r\n UNVERIFIED_EMAIL: 'auth/unverified-email',\r\n USER_CANCELLED: 'auth/user-cancelled',\r\n USER_DELETED: 'auth/user-not-found',\r\n USER_DISABLED: 'auth/user-disabled',\r\n USER_MISMATCH: 'auth/user-mismatch',\r\n USER_SIGNED_OUT: 'auth/user-signed-out',\r\n WEAK_PASSWORD: 'auth/weak-password',\r\n WEB_STORAGE_UNSUPPORTED: 'auth/web-storage-unsupported',\r\n ALREADY_INITIALIZED: 'auth/already-initialized'\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 logClient = new Logger('@firebase/auth');\r\nfunction _logError(msg, ...args) {\r\n if (logClient.logLevel <= LogLevel.ERROR) {\r\n logClient.error(`Auth (${SDK_VERSION}): ${msg}`, ...args);\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 _fail(authOrCode, ...rest) {\r\n throw createErrorInternal(authOrCode, ...rest);\r\n}\r\nfunction _createError(authOrCode, ...rest) {\r\n return createErrorInternal(authOrCode, ...rest);\r\n}\r\nfunction _errorWithCustomMessage(auth, code, message) {\r\n const errorMap = Object.assign(Object.assign({}, prodErrorMap()), { [code]: message });\r\n const factory = new ErrorFactory('auth', 'Firebase', errorMap);\r\n return factory.create(code, {\r\n appName: auth.name,\r\n });\r\n}\r\nfunction _assertInstanceOf(auth, object, instance) {\r\n const constructorInstance = instance;\r\n if (!(object instanceof constructorInstance)) {\r\n if (constructorInstance.name !== object.constructor.name) {\r\n _fail(auth, \"argument-error\" /* ARGUMENT_ERROR */);\r\n }\r\n throw _errorWithCustomMessage(auth, \"argument-error\" /* ARGUMENT_ERROR */, `Type of ${object.constructor.name} does not match expected instance.` +\r\n `Did you pass a reference from a different Auth SDK?`);\r\n }\r\n}\r\nfunction createErrorInternal(authOrCode, ...rest) {\r\n if (typeof authOrCode !== 'string') {\r\n const code = rest[0];\r\n const fullParams = [...rest.slice(1)];\r\n if (fullParams[0]) {\r\n fullParams[0].appName = authOrCode.name;\r\n }\r\n return authOrCode._errorFactory.create(code, ...fullParams);\r\n }\r\n return _DEFAULT_AUTH_ERROR_FACTORY.create(authOrCode, ...rest);\r\n}\r\nfunction _assert(assertion, authOrCode, ...rest) {\r\n if (!assertion) {\r\n throw createErrorInternal(authOrCode, ...rest);\r\n }\r\n}\r\n/**\r\n * Unconditionally fails, throwing an internal error with the given message.\r\n *\r\n * @param failure type of failure encountered\r\n * @throws Error\r\n */\r\nfunction debugFail(failure) {\r\n // Log the failure in addition to throw an exception, just in case the\r\n // exception is swallowed.\r\n const message = `INTERNAL ASSERTION FAILED: ` + failure;\r\n _logError(message);\r\n // NOTE: We don't use FirebaseError here because these are internal failures\r\n // that cannot be handled by the user. (Also it would create a circular\r\n // dependency between the error and assert modules which doesn't work.)\r\n throw new Error(message);\r\n}\r\n/**\r\n * Fails if the given assertion condition is false, throwing an Error with the\r\n * given message if it did.\r\n *\r\n * @param assertion\r\n * @param message\r\n */\r\nfunction debugAssert(assertion, message) {\r\n if (!assertion) {\r\n debugFail(message);\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 instanceCache = new Map();\r\nfunction _getInstance(cls) {\r\n debugAssert(cls instanceof Function, 'Expected a class definition');\r\n let instance = instanceCache.get(cls);\r\n if (instance) {\r\n debugAssert(instance instanceof cls, 'Instance stored in cache mismatched with class');\r\n return instance;\r\n }\r\n instance = new cls();\r\n instanceCache.set(cls, instance);\r\n return instance;\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 * Initializes an {@link Auth} instance with fine-grained control over\r\n * {@link Dependencies}.\r\n *\r\n * @remarks\r\n *\r\n * This function allows more control over the {@link Auth} instance than\r\n * {@link getAuth}. `getAuth` uses platform-specific defaults to supply\r\n * the {@link Dependencies}. In general, `getAuth` is the easiest way to\r\n * initialize Auth and works for most use cases. Use `initializeAuth` if you\r\n * need control over which persistence layer is used, or to minimize bundle\r\n * size if you're not using either `signInWithPopup` or `signInWithRedirect`.\r\n *\r\n * For example, if your app only uses anonymous accounts and you only want\r\n * accounts saved for the current session, initialize `Auth` with:\r\n *\r\n * ```js\r\n * const auth = initializeAuth(app, {\r\n * persistence: browserSessionPersistence,\r\n * popupRedirectResolver: undefined,\r\n * });\r\n * ```\r\n *\r\n * @public\r\n */\r\nfunction initializeAuth(app, deps) {\r\n const provider = _getProvider(app, 'auth');\r\n if (provider.isInitialized()) {\r\n const auth = provider.getImmediate();\r\n const initialOptions = provider.getOptions();\r\n if (deepEqual(initialOptions, deps !== null && deps !== void 0 ? deps : {})) {\r\n return auth;\r\n }\r\n else {\r\n _fail(auth, \"already-initialized\" /* ALREADY_INITIALIZED */);\r\n }\r\n }\r\n const auth = provider.initialize({ options: deps });\r\n return auth;\r\n}\r\nfunction _initializeAuthInstance(auth, deps) {\r\n const persistence = (deps === null || deps === void 0 ? void 0 : deps.persistence) || [];\r\n const hierarchy = (Array.isArray(persistence) ? persistence : [persistence]).map(_getInstance);\r\n if (deps === null || deps === void 0 ? void 0 : deps.errorMap) {\r\n auth._updateErrorMap(deps.errorMap);\r\n }\r\n // This promise is intended to float; auth initialization happens in the\r\n // background, meanwhile the auth object may be used by the app.\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n auth._initializeWithPersistence(hierarchy, deps === null || deps === void 0 ? void 0 : deps.popupRedirectResolver);\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 _getCurrentUrl() {\r\n var _a;\r\n return (typeof self !== 'undefined' && ((_a = self.location) === null || _a === void 0 ? void 0 : _a.href)) || '';\r\n}\r\nfunction _isHttpOrHttps() {\r\n return _getCurrentScheme() === 'http:' || _getCurrentScheme() === 'https:';\r\n}\r\nfunction _getCurrentScheme() {\r\n var _a;\r\n return (typeof self !== 'undefined' && ((_a = self.location) === null || _a === void 0 ? void 0 : _a.protocol)) || null;\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 * Determine whether the browser is working online\r\n */\r\nfunction _isOnline() {\r\n if (typeof navigator !== 'undefined' &&\r\n navigator &&\r\n 'onLine' in navigator &&\r\n typeof navigator.onLine === 'boolean' &&\r\n // Apply only for traditional web apps and Chrome extensions.\r\n // This is especially true for Cordova apps which have unreliable\r\n // navigator.onLine behavior unless cordova-plugin-network-information is\r\n // installed which overwrites the native navigator.onLine value and\r\n // defines navigator.connection.\r\n (_isHttpOrHttps() || isBrowserExtension() || 'connection' in navigator)) {\r\n return navigator.onLine;\r\n }\r\n // If we can't determine the state, assume it is online.\r\n return true;\r\n}\r\nfunction _getUserLanguage() {\r\n if (typeof navigator === 'undefined') {\r\n return null;\r\n }\r\n const 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 // Couldn't determine language.\r\n null);\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 * A structure to help pick between a range of long and short delay durations\r\n * depending on the current environment. In general, the long delay is used for\r\n * mobile environments whereas short delays are used for desktop environments.\r\n */\r\nclass Delay {\r\n constructor(shortDelay, longDelay) {\r\n this.shortDelay = shortDelay;\r\n this.longDelay = longDelay;\r\n // Internal error when improperly initialized.\r\n debugAssert(longDelay > shortDelay, 'Short delay should be less than long delay!');\r\n this.isMobile = isMobileCordova() || isReactNative();\r\n }\r\n get() {\r\n if (!_isOnline()) {\r\n // Pick the shorter timeout.\r\n return Math.min(5000 /* OFFLINE */, this.shortDelay);\r\n }\r\n // If running in a mobile environment, return the long delay, otherwise\r\n // return the short delay.\r\n // This could be improved in the future to dynamically change based on other\r\n // variables instead of just reading the current environment.\r\n return this.isMobile ? this.longDelay : this.shortDelay;\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 _emulatorUrl(config, path) {\r\n debugAssert(config.emulator, 'Emulator should always be set here');\r\n const { url } = config.emulator;\r\n if (!path) {\r\n return url;\r\n }\r\n return `${url}${path.startsWith('/') ? path.slice(1) : path}`;\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\nclass FetchProvider {\r\n static initialize(fetchImpl, headersImpl, responseImpl) {\r\n this.fetchImpl = fetchImpl;\r\n if (headersImpl) {\r\n this.headersImpl = headersImpl;\r\n }\r\n if (responseImpl) {\r\n this.responseImpl = responseImpl;\r\n }\r\n }\r\n static fetch() {\r\n if (this.fetchImpl) {\r\n return this.fetchImpl;\r\n }\r\n if (typeof self !== 'undefined' && 'fetch' in self) {\r\n return self.fetch;\r\n }\r\n debugFail('Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill');\r\n }\r\n static headers() {\r\n if (this.headersImpl) {\r\n return this.headersImpl;\r\n }\r\n if (typeof self !== 'undefined' && 'Headers' in self) {\r\n return self.Headers;\r\n }\r\n debugFail('Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill');\r\n }\r\n static response() {\r\n if (this.responseImpl) {\r\n return this.responseImpl;\r\n }\r\n if (typeof self !== 'undefined' && 'Response' in self) {\r\n return self.Response;\r\n }\r\n debugFail('Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill');\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 * Map from errors returned by the server to errors to developer visible errors\r\n */\r\nconst SERVER_ERROR_MAP = {\r\n // Custom token errors.\r\n [\"CREDENTIAL_MISMATCH\" /* CREDENTIAL_MISMATCH */]: \"custom-token-mismatch\" /* CREDENTIAL_MISMATCH */,\r\n // This can only happen if the SDK sends a bad request.\r\n [\"MISSING_CUSTOM_TOKEN\" /* MISSING_CUSTOM_TOKEN */]: \"internal-error\" /* INTERNAL_ERROR */,\r\n // Create Auth URI errors.\r\n [\"INVALID_IDENTIFIER\" /* INVALID_IDENTIFIER */]: \"invalid-email\" /* INVALID_EMAIL */,\r\n // This can only happen if the SDK sends a bad request.\r\n [\"MISSING_CONTINUE_URI\" /* MISSING_CONTINUE_URI */]: \"internal-error\" /* INTERNAL_ERROR */,\r\n // Sign in with email and password errors (some apply to sign up too).\r\n [\"INVALID_PASSWORD\" /* INVALID_PASSWORD */]: \"wrong-password\" /* INVALID_PASSWORD */,\r\n // This can only happen if the SDK sends a bad request.\r\n [\"MISSING_PASSWORD\" /* MISSING_PASSWORD */]: \"internal-error\" /* INTERNAL_ERROR */,\r\n // Sign up with email and password errors.\r\n [\"EMAIL_EXISTS\" /* EMAIL_EXISTS */]: \"email-already-in-use\" /* EMAIL_EXISTS */,\r\n [\"PASSWORD_LOGIN_DISABLED\" /* PASSWORD_LOGIN_DISABLED */]: \"operation-not-allowed\" /* OPERATION_NOT_ALLOWED */,\r\n // Verify assertion for sign in with credential errors:\r\n [\"INVALID_IDP_RESPONSE\" /* INVALID_IDP_RESPONSE */]: \"invalid-credential\" /* INVALID_IDP_RESPONSE */,\r\n [\"INVALID_PENDING_TOKEN\" /* INVALID_PENDING_TOKEN */]: \"invalid-credential\" /* INVALID_IDP_RESPONSE */,\r\n [\"FEDERATED_USER_ID_ALREADY_LINKED\" /* FEDERATED_USER_ID_ALREADY_LINKED */]: \"credential-already-in-use\" /* CREDENTIAL_ALREADY_IN_USE */,\r\n // This can only happen if the SDK sends a bad request.\r\n [\"MISSING_REQ_TYPE\" /* MISSING_REQ_TYPE */]: \"internal-error\" /* INTERNAL_ERROR */,\r\n // Send Password reset email errors:\r\n [\"EMAIL_NOT_FOUND\" /* EMAIL_NOT_FOUND */]: \"user-not-found\" /* USER_DELETED */,\r\n [\"RESET_PASSWORD_EXCEED_LIMIT\" /* RESET_PASSWORD_EXCEED_LIMIT */]: \"too-many-requests\" /* TOO_MANY_ATTEMPTS_TRY_LATER */,\r\n [\"EXPIRED_OOB_CODE\" /* EXPIRED_OOB_CODE */]: \"expired-action-code\" /* EXPIRED_OOB_CODE */,\r\n [\"INVALID_OOB_CODE\" /* INVALID_OOB_CODE */]: \"invalid-action-code\" /* INVALID_OOB_CODE */,\r\n // This can only happen if the SDK sends a bad request.\r\n [\"MISSING_OOB_CODE\" /* MISSING_OOB_CODE */]: \"internal-error\" /* INTERNAL_ERROR */,\r\n // Operations that require ID token in request:\r\n [\"CREDENTIAL_TOO_OLD_LOGIN_AGAIN\" /* CREDENTIAL_TOO_OLD_LOGIN_AGAIN */]: \"requires-recent-login\" /* CREDENTIAL_TOO_OLD_LOGIN_AGAIN */,\r\n [\"INVALID_ID_TOKEN\" /* INVALID_ID_TOKEN */]: \"invalid-user-token\" /* INVALID_AUTH */,\r\n [\"TOKEN_EXPIRED\" /* TOKEN_EXPIRED */]: \"user-token-expired\" /* TOKEN_EXPIRED */,\r\n [\"USER_NOT_FOUND\" /* USER_NOT_FOUND */]: \"user-token-expired\" /* TOKEN_EXPIRED */,\r\n // Other errors.\r\n [\"TOO_MANY_ATTEMPTS_TRY_LATER\" /* TOO_MANY_ATTEMPTS_TRY_LATER */]: \"too-many-requests\" /* TOO_MANY_ATTEMPTS_TRY_LATER */,\r\n // Phone Auth related errors.\r\n [\"INVALID_CODE\" /* INVALID_CODE */]: \"invalid-verification-code\" /* INVALID_CODE */,\r\n [\"INVALID_SESSION_INFO\" /* INVALID_SESSION_INFO */]: \"invalid-verification-id\" /* INVALID_SESSION_INFO */,\r\n [\"INVALID_TEMPORARY_PROOF\" /* INVALID_TEMPORARY_PROOF */]: \"invalid-credential\" /* INVALID_IDP_RESPONSE */,\r\n [\"MISSING_SESSION_INFO\" /* MISSING_SESSION_INFO */]: \"missing-verification-id\" /* MISSING_SESSION_INFO */,\r\n [\"SESSION_EXPIRED\" /* SESSION_EXPIRED */]: \"code-expired\" /* CODE_EXPIRED */,\r\n // Other action code errors when additional settings passed.\r\n // MISSING_CONTINUE_URI is getting mapped to INTERNAL_ERROR above.\r\n // This is OK as this error will be caught by client side validation.\r\n [\"MISSING_ANDROID_PACKAGE_NAME\" /* MISSING_ANDROID_PACKAGE_NAME */]: \"missing-android-pkg-name\" /* MISSING_ANDROID_PACKAGE_NAME */,\r\n [\"UNAUTHORIZED_DOMAIN\" /* UNAUTHORIZED_DOMAIN */]: \"unauthorized-continue-uri\" /* UNAUTHORIZED_DOMAIN */,\r\n // getProjectConfig errors when clientId is passed.\r\n [\"INVALID_OAUTH_CLIENT_ID\" /* INVALID_OAUTH_CLIENT_ID */]: \"invalid-oauth-client-id\" /* INVALID_OAUTH_CLIENT_ID */,\r\n // User actions (sign-up or deletion) disabled errors.\r\n [\"ADMIN_ONLY_OPERATION\" /* ADMIN_ONLY_OPERATION */]: \"admin-restricted-operation\" /* ADMIN_ONLY_OPERATION */,\r\n // Multi factor related errors.\r\n [\"INVALID_MFA_PENDING_CREDENTIAL\" /* INVALID_MFA_PENDING_CREDENTIAL */]: \"invalid-multi-factor-session\" /* INVALID_MFA_SESSION */,\r\n [\"MFA_ENROLLMENT_NOT_FOUND\" /* MFA_ENROLLMENT_NOT_FOUND */]: \"multi-factor-info-not-found\" /* MFA_INFO_NOT_FOUND */,\r\n [\"MISSING_MFA_ENROLLMENT_ID\" /* MISSING_MFA_ENROLLMENT_ID */]: \"missing-multi-factor-info\" /* MISSING_MFA_INFO */,\r\n [\"MISSING_MFA_PENDING_CREDENTIAL\" /* MISSING_MFA_PENDING_CREDENTIAL */]: \"missing-multi-factor-session\" /* MISSING_MFA_SESSION */,\r\n [\"SECOND_FACTOR_EXISTS\" /* SECOND_FACTOR_EXISTS */]: \"second-factor-already-in-use\" /* SECOND_FACTOR_ALREADY_ENROLLED */,\r\n [\"SECOND_FACTOR_LIMIT_EXCEEDED\" /* SECOND_FACTOR_LIMIT_EXCEEDED */]: \"maximum-second-factor-count-exceeded\" /* SECOND_FACTOR_LIMIT_EXCEEDED */,\r\n // Blocking functions related errors.\r\n [\"BLOCKING_FUNCTION_ERROR_RESPONSE\" /* BLOCKING_FUNCTION_ERROR_RESPONSE */]: \"internal-error\" /* INTERNAL_ERROR */,\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 DEFAULT_API_TIMEOUT_MS = new Delay(30000, 60000);\r\nfunction _addTidIfNecessary(auth, request) {\r\n if (auth.tenantId && !request.tenantId) {\r\n return Object.assign(Object.assign({}, request), { tenantId: auth.tenantId });\r\n }\r\n return request;\r\n}\r\nasync function _performApiRequest(auth, method, path, request, customErrorMap = {}) {\r\n return _performFetchWithErrorHandling(auth, customErrorMap, async () => {\r\n let body = {};\r\n let params = {};\r\n if (request) {\r\n if (method === \"GET\" /* GET */) {\r\n params = request;\r\n }\r\n else {\r\n body = {\r\n body: JSON.stringify(request)\r\n };\r\n }\r\n }\r\n const query = querystring(Object.assign({ key: auth.config.apiKey }, params)).slice(1);\r\n const headers = await auth._getAdditionalHeaders();\r\n headers[\"Content-Type\" /* CONTENT_TYPE */] = 'application/json';\r\n if (auth.languageCode) {\r\n headers[\"X-Firebase-Locale\" /* X_FIREBASE_LOCALE */] = auth.languageCode;\r\n }\r\n return FetchProvider.fetch()(_getFinalTarget(auth, auth.config.apiHost, path, query), Object.assign({ method,\r\n headers, referrerPolicy: 'no-referrer' }, body));\r\n });\r\n}\r\nasync function _performFetchWithErrorHandling(auth, customErrorMap, fetchFn) {\r\n auth._canInitEmulator = false;\r\n const errorMap = Object.assign(Object.assign({}, SERVER_ERROR_MAP), customErrorMap);\r\n try {\r\n const networkTimeout = new NetworkTimeout(auth);\r\n const response = await Promise.race([\r\n fetchFn(),\r\n networkTimeout.promise\r\n ]);\r\n // If we've reached this point, the fetch succeeded and the networkTimeout\r\n // didn't throw; clear the network timeout delay so that Node won't hang\r\n networkTimeout.clearNetworkTimeout();\r\n const json = await response.json();\r\n if ('needConfirmation' in json) {\r\n throw _makeTaggedError(auth, \"account-exists-with-different-credential\" /* NEED_CONFIRMATION */, json);\r\n }\r\n if (response.ok && !('errorMessage' in json)) {\r\n return json;\r\n }\r\n else {\r\n const errorMessage = response.ok ? json.errorMessage : json.error.message;\r\n const [serverErrorCode, serverErrorMessage] = errorMessage.split(' : ');\r\n if (serverErrorCode === \"FEDERATED_USER_ID_ALREADY_LINKED\" /* FEDERATED_USER_ID_ALREADY_LINKED */) {\r\n throw _makeTaggedError(auth, \"credential-already-in-use\" /* CREDENTIAL_ALREADY_IN_USE */, json);\r\n }\r\n else if (serverErrorCode === \"EMAIL_EXISTS\" /* EMAIL_EXISTS */) {\r\n throw _makeTaggedError(auth, \"email-already-in-use\" /* EMAIL_EXISTS */, json);\r\n }\r\n else if (serverErrorCode === \"USER_DISABLED\" /* USER_DISABLED */) {\r\n throw _makeTaggedError(auth, \"user-disabled\" /* USER_DISABLED */, json);\r\n }\r\n const authError = errorMap[serverErrorCode] ||\r\n serverErrorCode\r\n .toLowerCase()\r\n .replace(/[_\\s]+/g, '-');\r\n if (serverErrorMessage) {\r\n throw _errorWithCustomMessage(auth, authError, serverErrorMessage);\r\n }\r\n else {\r\n _fail(auth, authError);\r\n }\r\n }\r\n }\r\n catch (e) {\r\n if (e instanceof FirebaseError) {\r\n throw e;\r\n }\r\n _fail(auth, \"network-request-failed\" /* NETWORK_REQUEST_FAILED */);\r\n }\r\n}\r\nasync function _performSignInRequest(auth, method, path, request, customErrorMap = {}) {\r\n const serverResponse = (await _performApiRequest(auth, method, path, request, customErrorMap));\r\n if ('mfaPendingCredential' in serverResponse) {\r\n _fail(auth, \"multi-factor-auth-required\" /* MFA_REQUIRED */, {\r\n _serverResponse: serverResponse\r\n });\r\n }\r\n return serverResponse;\r\n}\r\nfunction _getFinalTarget(auth, host, path, query) {\r\n const base = `${host}${path}?${query}`;\r\n if (!auth.config.emulator) {\r\n return `${auth.config.apiScheme}://${base}`;\r\n }\r\n return _emulatorUrl(auth.config, base);\r\n}\r\nclass NetworkTimeout {\r\n constructor(auth) {\r\n this.auth = auth;\r\n // Node timers and browser timers are fundamentally incompatible, but we\r\n // don't care about the value here\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n this.timer = null;\r\n this.promise = new Promise((_, reject) => {\r\n this.timer = setTimeout(() => {\r\n return reject(_createError(this.auth, \"network-request-failed\" /* NETWORK_REQUEST_FAILED */));\r\n }, DEFAULT_API_TIMEOUT_MS.get());\r\n });\r\n }\r\n clearNetworkTimeout() {\r\n clearTimeout(this.timer);\r\n }\r\n}\r\nfunction _makeTaggedError(auth, code, response) {\r\n const errorParams = {\r\n appName: auth.name\r\n };\r\n if (response.email) {\r\n errorParams.email = response.email;\r\n }\r\n if (response.phoneNumber) {\r\n errorParams.phoneNumber = response.phoneNumber;\r\n }\r\n const error = _createError(auth, code, errorParams);\r\n // We know customData is defined on error because errorParams is defined\r\n error.customData._tokenResponse = response;\r\n return error;\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\nasync function deleteAccount(auth, request) {\r\n return _performApiRequest(auth, \"POST\" /* POST */, \"/v1/accounts:delete\" /* DELETE_ACCOUNT */, request);\r\n}\r\nasync function deleteLinkedAccounts(auth, request) {\r\n return _performApiRequest(auth, \"POST\" /* POST */, \"/v1/accounts:update\" /* SET_ACCOUNT_INFO */, request);\r\n}\r\nasync function getAccountInfo(auth, request) {\r\n return _performApiRequest(auth, \"POST\" /* POST */, \"/v1/accounts:lookup\" /* GET_ACCOUNT_INFO */, request);\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 utcTimestampToDateString(utcTimestamp) {\r\n if (!utcTimestamp) {\r\n return undefined;\r\n }\r\n try {\r\n // Convert to date object.\r\n const date = new Date(Number(utcTimestamp));\r\n // Test date is valid.\r\n if (!isNaN(date.getTime())) {\r\n // Convert to UTC date string.\r\n return date.toUTCString();\r\n }\r\n }\r\n catch (e) {\r\n // Do nothing. undefined will be returned.\r\n }\r\n return undefined;\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 a JSON Web Token (JWT) used to identify the user to a Firebase service.\r\n *\r\n * @remarks\r\n * Returns the current token if it has not expired or if it will not expire in the next five\r\n * minutes. Otherwise, this will refresh the token and return a new one.\r\n *\r\n * @param user - The user.\r\n * @param forceRefresh - Force refresh regardless of token expiration.\r\n *\r\n * @public\r\n */\r\nfunction getIdToken(user, forceRefresh = false) {\r\n return getModularInstance(user).getIdToken(forceRefresh);\r\n}\r\n/**\r\n * Returns a deserialized JSON Web Token (JWT) used to identitfy the user to a Firebase service.\r\n *\r\n * @remarks\r\n * Returns the current token if it has not expired or if it will not expire in the next five\r\n * minutes. Otherwise, this will refresh the token and return a new one.\r\n *\r\n * @param user - The user.\r\n * @param forceRefresh - Force refresh regardless of token expiration.\r\n *\r\n * @public\r\n */\r\nasync function getIdTokenResult(user, forceRefresh = false) {\r\n const userInternal = getModularInstance(user);\r\n const token = await userInternal.getIdToken(forceRefresh);\r\n const claims = _parseToken(token);\r\n _assert(claims && claims.exp && claims.auth_time && claims.iat, userInternal.auth, \"internal-error\" /* INTERNAL_ERROR */);\r\n const firebase = typeof claims.firebase === 'object' ? claims.firebase : undefined;\r\n const signInProvider = firebase === null || firebase === void 0 ? void 0 : firebase['sign_in_provider'];\r\n return {\r\n claims,\r\n token,\r\n authTime: utcTimestampToDateString(secondsStringToMilliseconds(claims.auth_time)),\r\n issuedAtTime: utcTimestampToDateString(secondsStringToMilliseconds(claims.iat)),\r\n expirationTime: utcTimestampToDateString(secondsStringToMilliseconds(claims.exp)),\r\n signInProvider: signInProvider || null,\r\n signInSecondFactor: (firebase === null || firebase === void 0 ? void 0 : firebase['sign_in_second_factor']) || null\r\n };\r\n}\r\nfunction secondsStringToMilliseconds(seconds) {\r\n return Number(seconds) * 1000;\r\n}\r\nfunction _parseToken(token) {\r\n var _a;\r\n const [algorithm, payload, signature] = token.split('.');\r\n if (algorithm === undefined ||\r\n payload === undefined ||\r\n signature === undefined) {\r\n _logError('JWT malformed, contained fewer than 3 sections');\r\n return null;\r\n }\r\n try {\r\n const decoded = base64Decode(payload);\r\n if (!decoded) {\r\n _logError('Failed to decode base64 JWT payload');\r\n return null;\r\n }\r\n return JSON.parse(decoded);\r\n }\r\n catch (e) {\r\n _logError('Caught error parsing JWT payload as JSON', (_a = e) === null || _a === void 0 ? void 0 : _a.toString());\r\n return null;\r\n }\r\n}\r\n/**\r\n * Extract expiresIn TTL from a token by subtracting the expiration from the issuance.\r\n */\r\nfunction _tokenExpiresIn(token) {\r\n const parsedToken = _parseToken(token);\r\n _assert(parsedToken, \"internal-error\" /* INTERNAL_ERROR */);\r\n _assert(typeof parsedToken.exp !== 'undefined', \"internal-error\" /* INTERNAL_ERROR */);\r\n _assert(typeof parsedToken.iat !== 'undefined', \"internal-error\" /* INTERNAL_ERROR */);\r\n return Number(parsedToken.exp) - Number(parsedToken.iat);\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\nasync function _logoutIfInvalidated(user, promise, bypassAuthState = false) {\r\n if (bypassAuthState) {\r\n return promise;\r\n }\r\n try {\r\n return await promise;\r\n }\r\n catch (e) {\r\n if (e instanceof FirebaseError && isUserInvalidated(e)) {\r\n if (user.auth.currentUser === user) {\r\n await user.auth.signOut();\r\n }\r\n }\r\n throw e;\r\n }\r\n}\r\nfunction isUserInvalidated({ code }) {\r\n return (code === `auth/${\"user-disabled\" /* USER_DISABLED */}` ||\r\n code === `auth/${\"user-token-expired\" /* TOKEN_EXPIRED */}`);\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\nclass ProactiveRefresh {\r\n constructor(user) {\r\n this.user = user;\r\n this.isRunning = false;\r\n // Node timers and browser timers return fundamentally different types.\r\n // We don't actually care what the value is but TS won't accept unknown and\r\n // we can't cast properly in both environments.\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n this.timerId = null;\r\n this.errorBackoff = 30000 /* RETRY_BACKOFF_MIN */;\r\n }\r\n _start() {\r\n if (this.isRunning) {\r\n return;\r\n }\r\n this.isRunning = true;\r\n this.schedule();\r\n }\r\n _stop() {\r\n if (!this.isRunning) {\r\n return;\r\n }\r\n this.isRunning = false;\r\n if (this.timerId !== null) {\r\n clearTimeout(this.timerId);\r\n }\r\n }\r\n getInterval(wasError) {\r\n var _a;\r\n if (wasError) {\r\n const interval = this.errorBackoff;\r\n this.errorBackoff = Math.min(this.errorBackoff * 2, 960000 /* RETRY_BACKOFF_MAX */);\r\n return interval;\r\n }\r\n else {\r\n // Reset the error backoff\r\n this.errorBackoff = 30000 /* RETRY_BACKOFF_MIN */;\r\n const expTime = (_a = this.user.stsTokenManager.expirationTime) !== null && _a !== void 0 ? _a : 0;\r\n const interval = expTime - Date.now() - 300000 /* OFFSET */;\r\n return Math.max(0, interval);\r\n }\r\n }\r\n schedule(wasError = false) {\r\n if (!this.isRunning) {\r\n // Just in case...\r\n return;\r\n }\r\n const interval = this.getInterval(wasError);\r\n this.timerId = setTimeout(async () => {\r\n await this.iteration();\r\n }, interval);\r\n }\r\n async iteration() {\r\n var _a;\r\n try {\r\n await this.user.getIdToken(true);\r\n }\r\n catch (e) {\r\n // Only retry on network errors\r\n if (((_a = e) === null || _a === void 0 ? void 0 : _a.code) === `auth/${\"network-request-failed\" /* NETWORK_REQUEST_FAILED */}`) {\r\n this.schedule(/* wasError */ true);\r\n }\r\n return;\r\n }\r\n this.schedule();\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\nclass UserMetadata {\r\n constructor(createdAt, lastLoginAt) {\r\n this.createdAt = createdAt;\r\n this.lastLoginAt = lastLoginAt;\r\n this._initializeTime();\r\n }\r\n _initializeTime() {\r\n this.lastSignInTime = utcTimestampToDateString(this.lastLoginAt);\r\n this.creationTime = utcTimestampToDateString(this.createdAt);\r\n }\r\n _copy(metadata) {\r\n this.createdAt = metadata.createdAt;\r\n this.lastLoginAt = metadata.lastLoginAt;\r\n this._initializeTime();\r\n }\r\n toJSON() {\r\n return {\r\n createdAt: this.createdAt,\r\n lastLoginAt: this.lastLoginAt\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\nasync function _reloadWithoutSaving(user) {\r\n var _a;\r\n const auth = user.auth;\r\n const idToken = await user.getIdToken();\r\n const response = await _logoutIfInvalidated(user, getAccountInfo(auth, { idToken }));\r\n _assert(response === null || response === void 0 ? void 0 : response.users.length, auth, \"internal-error\" /* INTERNAL_ERROR */);\r\n const coreAccount = response.users[0];\r\n user._notifyReloadListener(coreAccount);\r\n const newProviderData = ((_a = coreAccount.providerUserInfo) === null || _a === void 0 ? void 0 : _a.length)\r\n ? extractProviderData(coreAccount.providerUserInfo)\r\n : [];\r\n const providerData = mergeProviderData(user.providerData, newProviderData);\r\n // Preserves the non-nonymous status of the stored user, even if no more\r\n // credentials (federated or email/password) are linked to the user. If\r\n // the user was previously anonymous, then use provider data to update.\r\n // On the other hand, if it was not anonymous before, it should never be\r\n // considered anonymous now.\r\n const oldIsAnonymous = user.isAnonymous;\r\n const newIsAnonymous = !(user.email && coreAccount.passwordHash) && !(providerData === null || providerData === void 0 ? void 0 : providerData.length);\r\n const isAnonymous = !oldIsAnonymous ? false : newIsAnonymous;\r\n const updates = {\r\n uid: coreAccount.localId,\r\n displayName: coreAccount.displayName || null,\r\n photoURL: coreAccount.photoUrl || null,\r\n email: coreAccount.email || null,\r\n emailVerified: coreAccount.emailVerified || false,\r\n phoneNumber: coreAccount.phoneNumber || null,\r\n tenantId: coreAccount.tenantId || null,\r\n providerData,\r\n metadata: new UserMetadata(coreAccount.createdAt, coreAccount.lastLoginAt),\r\n isAnonymous\r\n };\r\n Object.assign(user, updates);\r\n}\r\n/**\r\n * Reloads user account data, if signed in.\r\n *\r\n * @param user - The user.\r\n *\r\n * @public\r\n */\r\nasync function reload(user) {\r\n const userInternal = getModularInstance(user);\r\n await _reloadWithoutSaving(userInternal);\r\n // Even though the current user hasn't changed, update\r\n // current user will trigger a persistence update w/ the\r\n // new info.\r\n await userInternal.auth._persistUserIfCurrent(userInternal);\r\n userInternal.auth._notifyListenersIfCurrent(userInternal);\r\n}\r\nfunction mergeProviderData(original, newData) {\r\n const deduped = original.filter(o => !newData.some(n => n.providerId === o.providerId));\r\n return [...deduped, ...newData];\r\n}\r\nfunction extractProviderData(providers) {\r\n return providers.map((_a) => {\r\n var { providerId } = _a, provider = __rest(_a, [\"providerId\"]);\r\n return {\r\n providerId,\r\n uid: provider.rawId || '',\r\n displayName: provider.displayName || null,\r\n email: provider.email || null,\r\n phoneNumber: provider.phoneNumber || null,\r\n photoURL: provider.photoUrl || null\r\n };\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\nasync function requestStsToken(auth, refreshToken) {\r\n const response = await _performFetchWithErrorHandling(auth, {}, async () => {\r\n const body = querystring({\r\n 'grant_type': 'refresh_token',\r\n 'refresh_token': refreshToken\r\n }).slice(1);\r\n const { tokenApiHost, apiKey } = auth.config;\r\n const url = _getFinalTarget(auth, tokenApiHost, \"/v1/token\" /* TOKEN */, `key=${apiKey}`);\r\n const headers = await auth._getAdditionalHeaders();\r\n headers[\"Content-Type\" /* CONTENT_TYPE */] = 'application/x-www-form-urlencoded';\r\n return FetchProvider.fetch()(url, {\r\n method: \"POST\" /* POST */,\r\n headers,\r\n body\r\n });\r\n });\r\n // The response comes back in snake_case. Convert to camel:\r\n return {\r\n accessToken: response.access_token,\r\n expiresIn: response.expires_in,\r\n refreshToken: response.refresh_token\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 * We need to mark this class as internal explicitly to exclude it in the public typings, because\r\n * it references AuthInternal which has a circular dependency with UserInternal.\r\n *\r\n * @internal\r\n */\r\nclass StsTokenManager {\r\n constructor() {\r\n this.refreshToken = null;\r\n this.accessToken = null;\r\n this.expirationTime = null;\r\n }\r\n get isExpired() {\r\n return (!this.expirationTime ||\r\n Date.now() > this.expirationTime - 30000 /* TOKEN_REFRESH */);\r\n }\r\n updateFromServerResponse(response) {\r\n _assert(response.idToken, \"internal-error\" /* INTERNAL_ERROR */);\r\n _assert(typeof response.idToken !== 'undefined', \"internal-error\" /* INTERNAL_ERROR */);\r\n _assert(typeof response.refreshToken !== 'undefined', \"internal-error\" /* INTERNAL_ERROR */);\r\n const expiresIn = 'expiresIn' in response && typeof response.expiresIn !== 'undefined'\r\n ? Number(response.expiresIn)\r\n : _tokenExpiresIn(response.idToken);\r\n this.updateTokensAndExpiration(response.idToken, response.refreshToken, expiresIn);\r\n }\r\n async getToken(auth, forceRefresh = false) {\r\n _assert(!this.accessToken || this.refreshToken, auth, \"user-token-expired\" /* TOKEN_EXPIRED */);\r\n if (!forceRefresh && this.accessToken && !this.isExpired) {\r\n return this.accessToken;\r\n }\r\n if (this.refreshToken) {\r\n await this.refresh(auth, this.refreshToken);\r\n return this.accessToken;\r\n }\r\n return null;\r\n }\r\n clearRefreshToken() {\r\n this.refreshToken = null;\r\n }\r\n async refresh(auth, oldToken) {\r\n const { accessToken, refreshToken, expiresIn } = await requestStsToken(auth, oldToken);\r\n this.updateTokensAndExpiration(accessToken, refreshToken, Number(expiresIn));\r\n }\r\n updateTokensAndExpiration(accessToken, refreshToken, expiresInSec) {\r\n this.refreshToken = refreshToken || null;\r\n this.accessToken = accessToken || null;\r\n this.expirationTime = Date.now() + expiresInSec * 1000;\r\n }\r\n static fromJSON(appName, object) {\r\n const { refreshToken, accessToken, expirationTime } = object;\r\n const manager = new StsTokenManager();\r\n if (refreshToken) {\r\n _assert(typeof refreshToken === 'string', \"internal-error\" /* INTERNAL_ERROR */, {\r\n appName\r\n });\r\n manager.refreshToken = refreshToken;\r\n }\r\n if (accessToken) {\r\n _assert(typeof accessToken === 'string', \"internal-error\" /* INTERNAL_ERROR */, {\r\n appName\r\n });\r\n manager.accessToken = accessToken;\r\n }\r\n if (expirationTime) {\r\n _assert(typeof expirationTime === 'number', \"internal-error\" /* INTERNAL_ERROR */, {\r\n appName\r\n });\r\n manager.expirationTime = expirationTime;\r\n }\r\n return manager;\r\n }\r\n toJSON() {\r\n return {\r\n refreshToken: this.refreshToken,\r\n accessToken: this.accessToken,\r\n expirationTime: this.expirationTime\r\n };\r\n }\r\n _assign(stsTokenManager) {\r\n this.accessToken = stsTokenManager.accessToken;\r\n this.refreshToken = stsTokenManager.refreshToken;\r\n this.expirationTime = stsTokenManager.expirationTime;\r\n }\r\n _clone() {\r\n return Object.assign(new StsTokenManager(), this.toJSON());\r\n }\r\n _performRefresh() {\r\n return debugFail('not implemented');\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 assertStringOrUndefined(assertion, appName) {\r\n _assert(typeof assertion === 'string' || typeof assertion === 'undefined', \"internal-error\" /* INTERNAL_ERROR */, { appName });\r\n}\r\nclass UserImpl {\r\n constructor(_a) {\r\n var { uid, auth, stsTokenManager } = _a, opt = __rest(_a, [\"uid\", \"auth\", \"stsTokenManager\"]);\r\n // For the user object, provider is always Firebase.\r\n this.providerId = \"firebase\" /* FIREBASE */;\r\n this.proactiveRefresh = new ProactiveRefresh(this);\r\n this.reloadUserInfo = null;\r\n this.reloadListener = null;\r\n this.uid = uid;\r\n this.auth = auth;\r\n this.stsTokenManager = stsTokenManager;\r\n this.accessToken = stsTokenManager.accessToken;\r\n this.displayName = opt.displayName || null;\r\n this.email = opt.email || null;\r\n this.emailVerified = opt.emailVerified || false;\r\n this.phoneNumber = opt.phoneNumber || null;\r\n this.photoURL = opt.photoURL || null;\r\n this.isAnonymous = opt.isAnonymous || false;\r\n this.tenantId = opt.tenantId || null;\r\n this.providerData = opt.providerData ? [...opt.providerData] : [];\r\n this.metadata = new UserMetadata(opt.createdAt || undefined, opt.lastLoginAt || undefined);\r\n }\r\n async getIdToken(forceRefresh) {\r\n const accessToken = await _logoutIfInvalidated(this, this.stsTokenManager.getToken(this.auth, forceRefresh));\r\n _assert(accessToken, this.auth, \"internal-error\" /* INTERNAL_ERROR */);\r\n if (this.accessToken !== accessToken) {\r\n this.accessToken = accessToken;\r\n await this.auth._persistUserIfCurrent(this);\r\n this.auth._notifyListenersIfCurrent(this);\r\n }\r\n return accessToken;\r\n }\r\n getIdTokenResult(forceRefresh) {\r\n return getIdTokenResult(this, forceRefresh);\r\n }\r\n reload() {\r\n return reload(this);\r\n }\r\n _assign(user) {\r\n if (this === user) {\r\n return;\r\n }\r\n _assert(this.uid === user.uid, this.auth, \"internal-error\" /* INTERNAL_ERROR */);\r\n this.displayName = user.displayName;\r\n this.photoURL = user.photoURL;\r\n this.email = user.email;\r\n this.emailVerified = user.emailVerified;\r\n this.phoneNumber = user.phoneNumber;\r\n this.isAnonymous = user.isAnonymous;\r\n this.tenantId = user.tenantId;\r\n this.providerData = user.providerData.map(userInfo => (Object.assign({}, userInfo)));\r\n this.metadata._copy(user.metadata);\r\n this.stsTokenManager._assign(user.stsTokenManager);\r\n }\r\n _clone(auth) {\r\n return new UserImpl(Object.assign(Object.assign({}, this), { auth, stsTokenManager: this.stsTokenManager._clone() }));\r\n }\r\n _onReload(callback) {\r\n // There should only ever be one listener, and that is a single instance of MultiFactorUser\r\n _assert(!this.reloadListener, this.auth, \"internal-error\" /* INTERNAL_ERROR */);\r\n this.reloadListener = callback;\r\n if (this.reloadUserInfo) {\r\n this._notifyReloadListener(this.reloadUserInfo);\r\n this.reloadUserInfo = null;\r\n }\r\n }\r\n _notifyReloadListener(userInfo) {\r\n if (this.reloadListener) {\r\n this.reloadListener(userInfo);\r\n }\r\n else {\r\n // If no listener is subscribed yet, save the result so it's available when they do subscribe\r\n this.reloadUserInfo = userInfo;\r\n }\r\n }\r\n _startProactiveRefresh() {\r\n this.proactiveRefresh._start();\r\n }\r\n _stopProactiveRefresh() {\r\n this.proactiveRefresh._stop();\r\n }\r\n async _updateTokensIfNecessary(response, reload = false) {\r\n let tokensRefreshed = false;\r\n if (response.idToken &&\r\n response.idToken !== this.stsTokenManager.accessToken) {\r\n this.stsTokenManager.updateFromServerResponse(response);\r\n tokensRefreshed = true;\r\n }\r\n if (reload) {\r\n await _reloadWithoutSaving(this);\r\n }\r\n await this.auth._persistUserIfCurrent(this);\r\n if (tokensRefreshed) {\r\n this.auth._notifyListenersIfCurrent(this);\r\n }\r\n }\r\n async delete() {\r\n const idToken = await this.getIdToken();\r\n await _logoutIfInvalidated(this, deleteAccount(this.auth, { idToken }));\r\n this.stsTokenManager.clearRefreshToken();\r\n // TODO: Determine if cancellable-promises are necessary to use in this class so that delete()\r\n // cancels pending actions...\r\n return this.auth.signOut();\r\n }\r\n toJSON() {\r\n return Object.assign(Object.assign({ uid: this.uid, email: this.email || undefined, emailVerified: this.emailVerified, displayName: this.displayName || undefined, isAnonymous: this.isAnonymous, photoURL: this.photoURL || undefined, phoneNumber: this.phoneNumber || undefined, tenantId: this.tenantId || undefined, providerData: this.providerData.map(userInfo => (Object.assign({}, userInfo))), stsTokenManager: this.stsTokenManager.toJSON(), \r\n // Redirect event ID must be maintained in case there is a pending\r\n // redirect event.\r\n _redirectEventId: this._redirectEventId }, this.metadata.toJSON()), { \r\n // Required for compatibility with the legacy SDK (go/firebase-auth-sdk-persistence-parsing):\r\n apiKey: this.auth.config.apiKey, appName: this.auth.name });\r\n }\r\n get refreshToken() {\r\n return this.stsTokenManager.refreshToken || '';\r\n }\r\n static _fromJSON(auth, object) {\r\n var _a, _b, _c, _d, _e, _f, _g, _h;\r\n const displayName = (_a = object.displayName) !== null && _a !== void 0 ? _a : undefined;\r\n const email = (_b = object.email) !== null && _b !== void 0 ? _b : undefined;\r\n const phoneNumber = (_c = object.phoneNumber) !== null && _c !== void 0 ? _c : undefined;\r\n const photoURL = (_d = object.photoURL) !== null && _d !== void 0 ? _d : undefined;\r\n const tenantId = (_e = object.tenantId) !== null && _e !== void 0 ? _e : undefined;\r\n const _redirectEventId = (_f = object._redirectEventId) !== null && _f !== void 0 ? _f : undefined;\r\n const createdAt = (_g = object.createdAt) !== null && _g !== void 0 ? _g : undefined;\r\n const lastLoginAt = (_h = object.lastLoginAt) !== null && _h !== void 0 ? _h : undefined;\r\n const { uid, emailVerified, isAnonymous, providerData, stsTokenManager: plainObjectTokenManager } = object;\r\n _assert(uid && plainObjectTokenManager, auth, \"internal-error\" /* INTERNAL_ERROR */);\r\n const stsTokenManager = StsTokenManager.fromJSON(this.name, plainObjectTokenManager);\r\n _assert(typeof uid === 'string', auth, \"internal-error\" /* INTERNAL_ERROR */);\r\n assertStringOrUndefined(displayName, auth.name);\r\n assertStringOrUndefined(email, auth.name);\r\n _assert(typeof emailVerified === 'boolean', auth, \"internal-error\" /* INTERNAL_ERROR */);\r\n _assert(typeof isAnonymous === 'boolean', auth, \"internal-error\" /* INTERNAL_ERROR */);\r\n assertStringOrUndefined(phoneNumber, auth.name);\r\n assertStringOrUndefined(photoURL, auth.name);\r\n assertStringOrUndefined(tenantId, auth.name);\r\n assertStringOrUndefined(_redirectEventId, auth.name);\r\n assertStringOrUndefined(createdAt, auth.name);\r\n assertStringOrUndefined(lastLoginAt, auth.name);\r\n const user = new UserImpl({\r\n uid,\r\n auth,\r\n email,\r\n emailVerified,\r\n displayName,\r\n isAnonymous,\r\n photoURL,\r\n phoneNumber,\r\n tenantId,\r\n stsTokenManager,\r\n createdAt,\r\n lastLoginAt\r\n });\r\n if (providerData && Array.isArray(providerData)) {\r\n user.providerData = providerData.map(userInfo => (Object.assign({}, userInfo)));\r\n }\r\n if (_redirectEventId) {\r\n user._redirectEventId = _redirectEventId;\r\n }\r\n return user;\r\n }\r\n /**\r\n * Initialize a User from an idToken server response\r\n * @param auth\r\n * @param idTokenResponse\r\n */\r\n static async _fromIdTokenResponse(auth, idTokenResponse, isAnonymous = false) {\r\n const stsTokenManager = new StsTokenManager();\r\n stsTokenManager.updateFromServerResponse(idTokenResponse);\r\n // Initialize the Firebase Auth user.\r\n const user = new UserImpl({\r\n uid: idTokenResponse.localId,\r\n auth,\r\n stsTokenManager,\r\n isAnonymous\r\n });\r\n // Updates the user info and data and resolves with a user instance.\r\n await _reloadWithoutSaving(user);\r\n return user;\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\nclass InMemoryPersistence {\r\n constructor() {\r\n this.type = \"NONE\" /* NONE */;\r\n this.storage = {};\r\n }\r\n async _isAvailable() {\r\n return true;\r\n }\r\n async _set(key, value) {\r\n this.storage[key] = value;\r\n }\r\n async _get(key) {\r\n const value = this.storage[key];\r\n return value === undefined ? null : value;\r\n }\r\n async _remove(key) {\r\n delete this.storage[key];\r\n }\r\n _addListener(_key, _listener) {\r\n // Listeners are not supported for in-memory storage since it cannot be shared across windows/workers\r\n return;\r\n }\r\n _removeListener(_key, _listener) {\r\n // Listeners are not supported for in-memory storage since it cannot be shared across windows/workers\r\n return;\r\n }\r\n}\r\nInMemoryPersistence.type = 'NONE';\r\n/**\r\n * An implementation of {@link Persistence} of type 'NONE'.\r\n *\r\n * @public\r\n */\r\nconst inMemoryPersistence = InMemoryPersistence;\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 _persistenceKeyName(key, apiKey, appName) {\r\n return `${\"firebase\" /* PERSISTENCE */}:${key}:${apiKey}:${appName}`;\r\n}\r\nclass PersistenceUserManager {\r\n constructor(persistence, auth, userKey) {\r\n this.persistence = persistence;\r\n this.auth = auth;\r\n this.userKey = userKey;\r\n const { config, name } = this.auth;\r\n this.fullUserKey = _persistenceKeyName(this.userKey, config.apiKey, name);\r\n this.fullPersistenceKey = _persistenceKeyName(\"persistence\" /* PERSISTENCE_USER */, config.apiKey, name);\r\n this.boundEventHandler = auth._onStorageEvent.bind(auth);\r\n this.persistence._addListener(this.fullUserKey, this.boundEventHandler);\r\n }\r\n setCurrentUser(user) {\r\n return this.persistence._set(this.fullUserKey, user.toJSON());\r\n }\r\n async getCurrentUser() {\r\n const blob = await this.persistence._get(this.fullUserKey);\r\n return blob ? UserImpl._fromJSON(this.auth, blob) : null;\r\n }\r\n removeCurrentUser() {\r\n return this.persistence._remove(this.fullUserKey);\r\n }\r\n savePersistenceForRedirect() {\r\n return this.persistence._set(this.fullPersistenceKey, this.persistence.type);\r\n }\r\n async setPersistence(newPersistence) {\r\n if (this.persistence === newPersistence) {\r\n return;\r\n }\r\n const currentUser = await this.getCurrentUser();\r\n await this.removeCurrentUser();\r\n this.persistence = newPersistence;\r\n if (currentUser) {\r\n return this.setCurrentUser(currentUser);\r\n }\r\n }\r\n delete() {\r\n this.persistence._removeListener(this.fullUserKey, this.boundEventHandler);\r\n }\r\n static async create(auth, persistenceHierarchy, userKey = \"authUser\" /* AUTH_USER */) {\r\n if (!persistenceHierarchy.length) {\r\n return new PersistenceUserManager(_getInstance(inMemoryPersistence), auth, userKey);\r\n }\r\n // Eliminate any persistences that are not available\r\n const availablePersistences = (await Promise.all(persistenceHierarchy.map(async (persistence) => {\r\n if (await persistence._isAvailable()) {\r\n return persistence;\r\n }\r\n return undefined;\r\n }))).filter(persistence => persistence);\r\n // Fall back to the first persistence listed, or in memory if none available\r\n let selectedPersistence = availablePersistences[0] ||\r\n _getInstance(inMemoryPersistence);\r\n const key = _persistenceKeyName(userKey, auth.config.apiKey, auth.name);\r\n // Pull out the existing user, setting the chosen persistence to that\r\n // persistence if the user exists.\r\n let userToMigrate = null;\r\n // Note, here we check for a user in _all_ persistences, not just the\r\n // ones deemed available. If we can migrate a user out of a broken\r\n // persistence, we will (but only if that persistence supports migration).\r\n for (const persistence of persistenceHierarchy) {\r\n try {\r\n const blob = await persistence._get(key);\r\n if (blob) {\r\n const user = UserImpl._fromJSON(auth, blob); // throws for unparsable blob (wrong format)\r\n if (persistence !== selectedPersistence) {\r\n userToMigrate = user;\r\n }\r\n selectedPersistence = persistence;\r\n break;\r\n }\r\n }\r\n catch (_a) { }\r\n }\r\n // If we find the user in a persistence that does support migration, use\r\n // that migration path (of only persistences that support migration)\r\n const migrationHierarchy = availablePersistences.filter(p => p._shouldAllowMigration);\r\n // If the persistence does _not_ allow migration, just finish off here\r\n if (!selectedPersistence._shouldAllowMigration ||\r\n !migrationHierarchy.length) {\r\n return new PersistenceUserManager(selectedPersistence, auth, userKey);\r\n }\r\n selectedPersistence = migrationHierarchy[0];\r\n if (userToMigrate) {\r\n // This normally shouldn't throw since chosenPersistence.isAvailable() is true, but if it does\r\n // we'll just let it bubble to surface the error.\r\n await selectedPersistence._set(key, userToMigrate.toJSON());\r\n }\r\n // Attempt to clear the key in other persistences but ignore errors. This helps prevent issues\r\n // such as users getting stuck with a previous account after signing out and refreshing the tab.\r\n await Promise.all(persistenceHierarchy.map(async (persistence) => {\r\n if (persistence !== selectedPersistence) {\r\n try {\r\n await persistence._remove(key);\r\n }\r\n catch (_a) { }\r\n }\r\n }));\r\n return new PersistenceUserManager(selectedPersistence, auth, userKey);\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 * Determine the browser for the purposes of reporting usage to the API\r\n */\r\nfunction _getBrowserName(userAgent) {\r\n const ua = userAgent.toLowerCase();\r\n if (ua.includes('opera/') || ua.includes('opr/') || ua.includes('opios/')) {\r\n return \"Opera\" /* OPERA */;\r\n }\r\n else if (_isIEMobile(ua)) {\r\n // Windows phone IEMobile browser.\r\n return \"IEMobile\" /* IEMOBILE */;\r\n }\r\n else if (ua.includes('msie') || ua.includes('trident/')) {\r\n return \"IE\" /* IE */;\r\n }\r\n else if (ua.includes('edge/')) {\r\n return \"Edge\" /* EDGE */;\r\n }\r\n else if (_isFirefox(ua)) {\r\n return \"Firefox\" /* FIREFOX */;\r\n }\r\n else if (ua.includes('silk/')) {\r\n return \"Silk\" /* SILK */;\r\n }\r\n else if (_isBlackBerry(ua)) {\r\n // Blackberry browser.\r\n return \"Blackberry\" /* BLACKBERRY */;\r\n }\r\n else if (_isWebOS(ua)) {\r\n // WebOS default browser.\r\n return \"Webos\" /* WEBOS */;\r\n }\r\n else if (_isSafari(ua)) {\r\n return \"Safari\" /* SAFARI */;\r\n }\r\n else if ((ua.includes('chrome/') || _isChromeIOS(ua)) &&\r\n !ua.includes('edge/')) {\r\n return \"Chrome\" /* CHROME */;\r\n }\r\n else if (_isAndroid(ua)) {\r\n // Android stock browser.\r\n return \"Android\" /* ANDROID */;\r\n }\r\n else {\r\n // Most modern browsers have name/version at end of user agent string.\r\n const re = /([a-zA-Z\\d\\.]+)\\/[a-zA-Z\\d\\.]*$/;\r\n const matches = userAgent.match(re);\r\n if ((matches === null || matches === void 0 ? void 0 : matches.length) === 2) {\r\n return matches[1];\r\n }\r\n }\r\n return \"Other\" /* OTHER */;\r\n}\r\nfunction _isFirefox(ua = getUA()) {\r\n return /firefox\\//i.test(ua);\r\n}\r\nfunction _isSafari(userAgent = getUA()) {\r\n const ua = userAgent.toLowerCase();\r\n return (ua.includes('safari/') &&\r\n !ua.includes('chrome/') &&\r\n !ua.includes('crios/') &&\r\n !ua.includes('android'));\r\n}\r\nfunction _isChromeIOS(ua = getUA()) {\r\n return /crios\\//i.test(ua);\r\n}\r\nfunction _isIEMobile(ua = getUA()) {\r\n return /iemobile/i.test(ua);\r\n}\r\nfunction _isAndroid(ua = getUA()) {\r\n return /android/i.test(ua);\r\n}\r\nfunction _isBlackBerry(ua = getUA()) {\r\n return /blackberry/i.test(ua);\r\n}\r\nfunction _isWebOS(ua = getUA()) {\r\n return /webos/i.test(ua);\r\n}\r\nfunction _isIOS(ua = getUA()) {\r\n return /iphone|ipad|ipod/i.test(ua) ||\r\n (/macintosh/i.test(ua) && /mobile/i.test(ua));\r\n}\r\nfunction _isIOS7Or8(ua = getUA()) {\r\n return (/(iPad|iPhone|iPod).*OS 7_\\d/i.test(ua) ||\r\n /(iPad|iPhone|iPod).*OS 8_\\d/i.test(ua));\r\n}\r\nfunction _isIOSStandalone(ua = getUA()) {\r\n var _a;\r\n return _isIOS(ua) && !!((_a = window.navigator) === null || _a === void 0 ? void 0 : _a.standalone);\r\n}\r\nfunction _isIE10() {\r\n return isIE() && document.documentMode === 10;\r\n}\r\nfunction _isMobileBrowser(ua = getUA()) {\r\n // TODO: implement getBrowserName equivalent for OS.\r\n return (_isIOS(ua) ||\r\n _isAndroid(ua) ||\r\n _isWebOS(ua) ||\r\n _isBlackBerry(ua) ||\r\n /windows phone/i.test(ua) ||\r\n _isIEMobile(ua));\r\n}\r\nfunction _isIframe() {\r\n try {\r\n // Check that the current window is not the top window.\r\n // If so, return true.\r\n return !!(window && window !== window.top);\r\n }\r\n catch (e) {\r\n return false;\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 * Determine the SDK version string\r\n */\r\nfunction _getClientVersion(clientPlatform, frameworks = []) {\r\n let reportedPlatform;\r\n switch (clientPlatform) {\r\n case \"Browser\" /* BROWSER */:\r\n // In a browser environment, report the browser name.\r\n reportedPlatform = _getBrowserName(getUA());\r\n break;\r\n case \"Worker\" /* WORKER */:\r\n // Technically a worker runs from a browser but we need to differentiate a\r\n // worker from a browser.\r\n // For example: Chrome-Worker/JsCore/4.9.1/FirebaseCore-web.\r\n reportedPlatform = `${_getBrowserName(getUA())}-${clientPlatform}`;\r\n break;\r\n default:\r\n reportedPlatform = clientPlatform;\r\n }\r\n const reportedFrameworks = frameworks.length\r\n ? frameworks.join(',')\r\n : 'FirebaseCore-web'; /* default value if no other framework is used */\r\n return `${reportedPlatform}/${\"JsCore\" /* CORE */}/${SDK_VERSION}/${reportedFrameworks}`;\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\nclass AuthMiddlewareQueue {\r\n constructor(auth) {\r\n this.auth = auth;\r\n this.queue = [];\r\n }\r\n pushCallback(callback, onAbort) {\r\n // The callback could be sync or async. Wrap it into a\r\n // function that is always async.\r\n const wrappedCallback = (user) => new Promise((resolve, reject) => {\r\n try {\r\n const result = callback(user);\r\n // Either resolve with existing promise or wrap a non-promise\r\n // return value into a promise.\r\n resolve(result);\r\n }\r\n catch (e) {\r\n // Sync callback throws.\r\n reject(e);\r\n }\r\n });\r\n // Attach the onAbort if present\r\n wrappedCallback.onAbort = onAbort;\r\n this.queue.push(wrappedCallback);\r\n const index = this.queue.length - 1;\r\n return () => {\r\n // Unsubscribe. Replace with no-op. Do not remove from array, or it will disturb\r\n // indexing of other elements.\r\n this.queue[index] = () => Promise.resolve();\r\n };\r\n }\r\n async runMiddleware(nextUser) {\r\n var _a;\r\n if (this.auth.currentUser === nextUser) {\r\n return;\r\n }\r\n // While running the middleware, build a temporary stack of onAbort\r\n // callbacks to call if one middleware callback rejects.\r\n const onAbortStack = [];\r\n try {\r\n for (const beforeStateCallback of this.queue) {\r\n await beforeStateCallback(nextUser);\r\n // Only push the onAbort if the callback succeeds\r\n if (beforeStateCallback.onAbort) {\r\n onAbortStack.push(beforeStateCallback.onAbort);\r\n }\r\n }\r\n }\r\n catch (e) {\r\n // Run all onAbort, with separate try/catch to ignore any errors and\r\n // continue\r\n onAbortStack.reverse();\r\n for (const onAbort of onAbortStack) {\r\n try {\r\n onAbort();\r\n }\r\n catch (_) { /* swallow error */ }\r\n }\r\n throw this.auth._errorFactory.create(\"login-blocked\" /* LOGIN_BLOCKED */, { originalMessage: (_a = e) === null || _a === void 0 ? void 0 : _a.message });\r\n }\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\nclass AuthImpl {\r\n constructor(app, heartbeatServiceProvider, config) {\r\n this.app = app;\r\n this.heartbeatServiceProvider = heartbeatServiceProvider;\r\n this.config = config;\r\n this.currentUser = null;\r\n this.emulatorConfig = null;\r\n this.operations = Promise.resolve();\r\n this.authStateSubscription = new Subscription(this);\r\n this.idTokenSubscription = new Subscription(this);\r\n this.beforeStateQueue = new AuthMiddlewareQueue(this);\r\n this.redirectUser = null;\r\n this.isProactiveRefreshEnabled = false;\r\n // Any network calls will set this to true and prevent subsequent emulator\r\n // initialization\r\n this._canInitEmulator = true;\r\n this._isInitialized = false;\r\n this._deleted = false;\r\n this._initializationPromise = null;\r\n this._popupRedirectResolver = null;\r\n this._errorFactory = _DEFAULT_AUTH_ERROR_FACTORY;\r\n // Tracks the last notified UID for state change listeners to prevent\r\n // repeated calls to the callbacks. Undefined means it's never been\r\n // called, whereas null means it's been called with a signed out user\r\n this.lastNotifiedUid = undefined;\r\n this.languageCode = null;\r\n this.tenantId = null;\r\n this.settings = { appVerificationDisabledForTesting: false };\r\n this.frameworks = [];\r\n this.name = app.name;\r\n this.clientVersion = config.sdkClientVersion;\r\n }\r\n _initializeWithPersistence(persistenceHierarchy, popupRedirectResolver) {\r\n if (popupRedirectResolver) {\r\n this._popupRedirectResolver = _getInstance(popupRedirectResolver);\r\n }\r\n // Have to check for app deletion throughout initialization (after each\r\n // promise resolution)\r\n this._initializationPromise = this.queue(async () => {\r\n var _a, _b;\r\n if (this._deleted) {\r\n return;\r\n }\r\n this.persistenceManager = await PersistenceUserManager.create(this, persistenceHierarchy);\r\n if (this._deleted) {\r\n return;\r\n }\r\n // Initialize the resolver early if necessary (only applicable to web:\r\n // this will cause the iframe to load immediately in certain cases)\r\n if ((_a = this._popupRedirectResolver) === null || _a === void 0 ? void 0 : _a._shouldInitProactively) {\r\n // If this fails, don't halt auth loading\r\n try {\r\n await this._popupRedirectResolver._initialize(this);\r\n }\r\n catch (e) { /* Ignore the error */ }\r\n }\r\n await this.initializeCurrentUser(popupRedirectResolver);\r\n this.lastNotifiedUid = ((_b = this.currentUser) === null || _b === void 0 ? void 0 : _b.uid) || null;\r\n if (this._deleted) {\r\n return;\r\n }\r\n this._isInitialized = true;\r\n });\r\n return this._initializationPromise;\r\n }\r\n /**\r\n * If the persistence is changed in another window, the user manager will let us know\r\n */\r\n async _onStorageEvent() {\r\n if (this._deleted) {\r\n return;\r\n }\r\n const user = await this.assertedPersistence.getCurrentUser();\r\n if (!this.currentUser && !user) {\r\n // No change, do nothing (was signed out and remained signed out).\r\n return;\r\n }\r\n // If the same user is to be synchronized.\r\n if (this.currentUser && user && this.currentUser.uid === user.uid) {\r\n // Data update, simply copy data changes.\r\n this._currentUser._assign(user);\r\n // If tokens changed from previous user tokens, this will trigger\r\n // notifyAuthListeners_.\r\n await this.currentUser.getIdToken();\r\n return;\r\n }\r\n // Update current Auth state. Either a new login or logout.\r\n // Skip blocking callbacks, they should not apply to a change in another tab.\r\n await this._updateCurrentUser(user, /* skipBeforeStateCallbacks */ true);\r\n }\r\n async initializeCurrentUser(popupRedirectResolver) {\r\n var _a;\r\n // First check to see if we have a pending redirect event.\r\n const previouslyStoredUser = (await this.assertedPersistence.getCurrentUser());\r\n let futureCurrentUser = previouslyStoredUser;\r\n let needsTocheckMiddleware = false;\r\n if (popupRedirectResolver && this.config.authDomain) {\r\n await this.getOrInitRedirectPersistenceManager();\r\n const redirectUserEventId = (_a = this.redirectUser) === null || _a === void 0 ? void 0 : _a._redirectEventId;\r\n const storedUserEventId = futureCurrentUser === null || futureCurrentUser === void 0 ? void 0 : futureCurrentUser._redirectEventId;\r\n const result = await this.tryRedirectSignIn(popupRedirectResolver);\r\n // If the stored user (i.e. the old \"currentUser\") has a redirectId that\r\n // matches the redirect user, then we want to initially sign in with the\r\n // new user object from result.\r\n // TODO(samgho): More thoroughly test all of this\r\n if ((!redirectUserEventId || redirectUserEventId === storedUserEventId) &&\r\n (result === null || result === void 0 ? void 0 : result.user)) {\r\n futureCurrentUser = result.user;\r\n needsTocheckMiddleware = true;\r\n }\r\n }\r\n // If no user in persistence, there is no current user. Set to null.\r\n if (!futureCurrentUser) {\r\n return this.directlySetCurrentUser(null);\r\n }\r\n if (!futureCurrentUser._redirectEventId) {\r\n // This isn't a redirect link operation, we can reload and bail.\r\n // First though, ensure that we check the middleware is happy.\r\n if (needsTocheckMiddleware) {\r\n try {\r\n await this.beforeStateQueue.runMiddleware(futureCurrentUser);\r\n }\r\n catch (e) {\r\n futureCurrentUser = previouslyStoredUser;\r\n // We know this is available since the bit is only set when the\r\n // resolver is available\r\n this._popupRedirectResolver._overrideRedirectResult(this, () => Promise.reject(e));\r\n }\r\n }\r\n if (futureCurrentUser) {\r\n return this.reloadAndSetCurrentUserOrClear(futureCurrentUser);\r\n }\r\n else {\r\n return this.directlySetCurrentUser(null);\r\n }\r\n }\r\n _assert(this._popupRedirectResolver, this, \"argument-error\" /* ARGUMENT_ERROR */);\r\n await this.getOrInitRedirectPersistenceManager();\r\n // If the redirect user's event ID matches the current user's event ID,\r\n // DO NOT reload the current user, otherwise they'll be cleared from storage.\r\n // This is important for the reauthenticateWithRedirect() flow.\r\n if (this.redirectUser &&\r\n this.redirectUser._redirectEventId === futureCurrentUser._redirectEventId) {\r\n return this.directlySetCurrentUser(futureCurrentUser);\r\n }\r\n return this.reloadAndSetCurrentUserOrClear(futureCurrentUser);\r\n }\r\n async tryRedirectSignIn(redirectResolver) {\r\n // The redirect user needs to be checked (and signed in if available)\r\n // during auth initialization. All of the normal sign in and link/reauth\r\n // flows call back into auth and push things onto the promise queue. We\r\n // need to await the result of the redirect sign in *inside the promise\r\n // queue*. This presents a problem: we run into deadlock. See:\r\n // ┌> [Initialization] ─────â”\r\n // ┌> [<other queue tasks>] │\r\n // └─ [getRedirectResult] <─┘\r\n // where [] are tasks on the queue and arrows denote awaits\r\n // Initialization will never complete because it's waiting on something\r\n // that's waiting for initialization to complete!\r\n //\r\n // Instead, this method calls getRedirectResult() (stored in\r\n // _completeRedirectFn) with an optional parameter that instructs all of\r\n // the underlying auth operations to skip anything that mutates auth state.\r\n let result = null;\r\n try {\r\n // We know this._popupRedirectResolver is set since redirectResolver\r\n // is passed in. The _completeRedirectFn expects the unwrapped extern.\r\n result = await this._popupRedirectResolver._completeRedirectFn(this, redirectResolver, true);\r\n }\r\n catch (e) {\r\n // Swallow any errors here; the code can retrieve them in\r\n // getRedirectResult().\r\n await this._setRedirectUser(null);\r\n }\r\n return result;\r\n }\r\n async reloadAndSetCurrentUserOrClear(user) {\r\n var _a;\r\n try {\r\n await _reloadWithoutSaving(user);\r\n }\r\n catch (e) {\r\n if (((_a = e) === null || _a === void 0 ? void 0 : _a.code) !== `auth/${\"network-request-failed\" /* NETWORK_REQUEST_FAILED */}`) {\r\n // Something's wrong with the user's token. Log them out and remove\r\n // them from storage\r\n return this.directlySetCurrentUser(null);\r\n }\r\n }\r\n return this.directlySetCurrentUser(user);\r\n }\r\n useDeviceLanguage() {\r\n this.languageCode = _getUserLanguage();\r\n }\r\n async _delete() {\r\n this._deleted = true;\r\n }\r\n async updateCurrentUser(userExtern) {\r\n // The public updateCurrentUser method needs to make a copy of the user,\r\n // and also check that the project matches\r\n const user = userExtern\r\n ? getModularInstance(userExtern)\r\n : null;\r\n if (user) {\r\n _assert(user.auth.config.apiKey === this.config.apiKey, this, \"invalid-user-token\" /* INVALID_AUTH */);\r\n }\r\n return this._updateCurrentUser(user && user._clone(this));\r\n }\r\n async _updateCurrentUser(user, skipBeforeStateCallbacks = false) {\r\n if (this._deleted) {\r\n return;\r\n }\r\n if (user) {\r\n _assert(this.tenantId === user.tenantId, this, \"tenant-id-mismatch\" /* TENANT_ID_MISMATCH */);\r\n }\r\n if (!skipBeforeStateCallbacks) {\r\n await this.beforeStateQueue.runMiddleware(user);\r\n }\r\n return this.queue(async () => {\r\n await this.directlySetCurrentUser(user);\r\n this.notifyAuthListeners();\r\n });\r\n }\r\n async signOut() {\r\n // Run first, to block _setRedirectUser() if any callbacks fail.\r\n await this.beforeStateQueue.runMiddleware(null);\r\n // Clear the redirect user when signOut is called\r\n if (this.redirectPersistenceManager || this._popupRedirectResolver) {\r\n await this._setRedirectUser(null);\r\n }\r\n // Prevent callbacks from being called again in _updateCurrentUser, as\r\n // they were already called in the first line.\r\n return this._updateCurrentUser(null, /* skipBeforeStateCallbacks */ true);\r\n }\r\n setPersistence(persistence) {\r\n return this.queue(async () => {\r\n await this.assertedPersistence.setPersistence(_getInstance(persistence));\r\n });\r\n }\r\n _getPersistence() {\r\n return this.assertedPersistence.persistence.type;\r\n }\r\n _updateErrorMap(errorMap) {\r\n this._errorFactory = new ErrorFactory('auth', 'Firebase', errorMap());\r\n }\r\n onAuthStateChanged(nextOrObserver, error, completed) {\r\n return this.registerStateListener(this.authStateSubscription, nextOrObserver, error, completed);\r\n }\r\n beforeAuthStateChanged(callback, onAbort) {\r\n return this.beforeStateQueue.pushCallback(callback, onAbort);\r\n }\r\n onIdTokenChanged(nextOrObserver, error, completed) {\r\n return this.registerStateListener(this.idTokenSubscription, nextOrObserver, error, completed);\r\n }\r\n toJSON() {\r\n var _a;\r\n return {\r\n apiKey: this.config.apiKey,\r\n authDomain: this.config.authDomain,\r\n appName: this.name,\r\n currentUser: (_a = this._currentUser) === null || _a === void 0 ? void 0 : _a.toJSON()\r\n };\r\n }\r\n async _setRedirectUser(user, popupRedirectResolver) {\r\n const redirectManager = await this.getOrInitRedirectPersistenceManager(popupRedirectResolver);\r\n return user === null\r\n ? redirectManager.removeCurrentUser()\r\n : redirectManager.setCurrentUser(user);\r\n }\r\n async getOrInitRedirectPersistenceManager(popupRedirectResolver) {\r\n if (!this.redirectPersistenceManager) {\r\n const resolver = (popupRedirectResolver && _getInstance(popupRedirectResolver)) ||\r\n this._popupRedirectResolver;\r\n _assert(resolver, this, \"argument-error\" /* ARGUMENT_ERROR */);\r\n this.redirectPersistenceManager = await PersistenceUserManager.create(this, [_getInstance(resolver._redirectPersistence)], \"redirectUser\" /* REDIRECT_USER */);\r\n this.redirectUser =\r\n await this.redirectPersistenceManager.getCurrentUser();\r\n }\r\n return this.redirectPersistenceManager;\r\n }\r\n async _redirectUserForId(id) {\r\n var _a, _b;\r\n // Make sure we've cleared any pending persistence actions if we're not in\r\n // the initializer\r\n if (this._isInitialized) {\r\n await this.queue(async () => { });\r\n }\r\n if (((_a = this._currentUser) === null || _a === void 0 ? void 0 : _a._redirectEventId) === id) {\r\n return this._currentUser;\r\n }\r\n if (((_b = this.redirectUser) === null || _b === void 0 ? void 0 : _b._redirectEventId) === id) {\r\n return this.redirectUser;\r\n }\r\n return null;\r\n }\r\n async _persistUserIfCurrent(user) {\r\n if (user === this.currentUser) {\r\n return this.queue(async () => this.directlySetCurrentUser(user));\r\n }\r\n }\r\n /** Notifies listeners only if the user is current */\r\n _notifyListenersIfCurrent(user) {\r\n if (user === this.currentUser) {\r\n this.notifyAuthListeners();\r\n }\r\n }\r\n _key() {\r\n return `${this.config.authDomain}:${this.config.apiKey}:${this.name}`;\r\n }\r\n _startProactiveRefresh() {\r\n this.isProactiveRefreshEnabled = true;\r\n if (this.currentUser) {\r\n this._currentUser._startProactiveRefresh();\r\n }\r\n }\r\n _stopProactiveRefresh() {\r\n this.isProactiveRefreshEnabled = false;\r\n if (this.currentUser) {\r\n this._currentUser._stopProactiveRefresh();\r\n }\r\n }\r\n /** Returns the current user cast as the internal type */\r\n get _currentUser() {\r\n return this.currentUser;\r\n }\r\n notifyAuthListeners() {\r\n var _a, _b;\r\n if (!this._isInitialized) {\r\n return;\r\n }\r\n this.idTokenSubscription.next(this.currentUser);\r\n const currentUid = (_b = (_a = this.currentUser) === null || _a === void 0 ? void 0 : _a.uid) !== null && _b !== void 0 ? _b : null;\r\n if (this.lastNotifiedUid !== currentUid) {\r\n this.lastNotifiedUid = currentUid;\r\n this.authStateSubscription.next(this.currentUser);\r\n }\r\n }\r\n registerStateListener(subscription, nextOrObserver, error, completed) {\r\n if (this._deleted) {\r\n return () => { };\r\n }\r\n const cb = typeof nextOrObserver === 'function'\r\n ? nextOrObserver\r\n : nextOrObserver.next.bind(nextOrObserver);\r\n const promise = this._isInitialized\r\n ? Promise.resolve()\r\n : this._initializationPromise;\r\n _assert(promise, this, \"internal-error\" /* INTERNAL_ERROR */);\r\n // The callback needs to be called asynchronously per the spec.\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n promise.then(() => cb(this.currentUser));\r\n if (typeof nextOrObserver === 'function') {\r\n return subscription.addObserver(nextOrObserver, error, completed);\r\n }\r\n else {\r\n return subscription.addObserver(nextOrObserver);\r\n }\r\n }\r\n /**\r\n * Unprotected (from race conditions) method to set the current user. This\r\n * should only be called from within a queued callback. This is necessary\r\n * because the queue shouldn't rely on another queued callback.\r\n */\r\n async directlySetCurrentUser(user) {\r\n if (this.currentUser && this.currentUser !== user) {\r\n this._currentUser._stopProactiveRefresh();\r\n if (user && this.isProactiveRefreshEnabled) {\r\n user._startProactiveRefresh();\r\n }\r\n }\r\n this.currentUser = user;\r\n if (user) {\r\n await this.assertedPersistence.setCurrentUser(user);\r\n }\r\n else {\r\n await this.assertedPersistence.removeCurrentUser();\r\n }\r\n }\r\n queue(action) {\r\n // In case something errors, the callback still should be called in order\r\n // to keep the promise chain alive\r\n this.operations = this.operations.then(action, action);\r\n return this.operations;\r\n }\r\n get assertedPersistence() {\r\n _assert(this.persistenceManager, this, \"internal-error\" /* INTERNAL_ERROR */);\r\n return this.persistenceManager;\r\n }\r\n _logFramework(framework) {\r\n if (!framework || this.frameworks.includes(framework)) {\r\n return;\r\n }\r\n this.frameworks.push(framework);\r\n // Sort alphabetically so that \"FirebaseCore-web,FirebaseUI-web\" and\r\n // \"FirebaseUI-web,FirebaseCore-web\" aren't viewed as different.\r\n this.frameworks.sort();\r\n this.clientVersion = _getClientVersion(this.config.clientPlatform, this._getFrameworks());\r\n }\r\n _getFrameworks() {\r\n return this.frameworks;\r\n }\r\n async _getAdditionalHeaders() {\r\n var _a;\r\n // Additional headers on every request\r\n const headers = {\r\n [\"X-Client-Version\" /* X_CLIENT_VERSION */]: this.clientVersion,\r\n };\r\n if (this.app.options.appId) {\r\n headers[\"X-Firebase-gmpid\" /* X_FIREBASE_GMPID */] = this.app.options.appId;\r\n }\r\n // If the heartbeat service exists, add the heartbeat string\r\n const heartbeatsHeader = await ((_a = this.heartbeatServiceProvider.getImmediate({\r\n optional: true,\r\n })) === null || _a === void 0 ? void 0 : _a.getHeartbeatsHeader());\r\n if (heartbeatsHeader) {\r\n headers[\"X-Firebase-Client\" /* X_FIREBASE_CLIENT */] = heartbeatsHeader;\r\n }\r\n return headers;\r\n }\r\n}\r\n/**\r\n * Method to be used to cast down to our private implmentation of Auth.\r\n * It will also handle unwrapping from the compat type if necessary\r\n *\r\n * @param auth Auth object passed in from developer\r\n */\r\nfunction _castAuth(auth) {\r\n return getModularInstance(auth);\r\n}\r\n/** Helper class to wrap subscriber logic */\r\nclass Subscription {\r\n constructor(auth) {\r\n this.auth = auth;\r\n this.observer = null;\r\n this.addObserver = createSubscribe(observer => (this.observer = observer));\r\n }\r\n get next() {\r\n _assert(this.observer, this.auth, \"internal-error\" /* INTERNAL_ERROR */);\r\n return this.observer.next.bind(this.observer);\r\n }\r\n}\n\n/**\r\n * Changes the {@link Auth} instance to communicate with the Firebase Auth Emulator, instead of production\r\n * Firebase Auth services.\r\n *\r\n * @remarks\r\n * This must be called synchronously immediately following the first call to\r\n * {@link initializeAuth}. Do not use with production credentials as emulator\r\n * traffic is not encrypted.\r\n *\r\n *\r\n * @example\r\n * ```javascript\r\n * connectAuthEmulator(auth, 'http://127.0.0.1:9099', { disableWarnings: true });\r\n * ```\r\n *\r\n * @param auth - The {@link Auth} instance.\r\n * @param url - The URL at which the emulator is running (eg, 'http://localhost:9099').\r\n * @param options - Optional. `options.disableWarnings` defaults to `false`. Set it to\r\n * `true` to disable the warning banner attached to the DOM.\r\n *\r\n * @public\r\n */\r\nfunction connectAuthEmulator(auth, url, options) {\r\n const authInternal = _castAuth(auth);\r\n _assert(authInternal._canInitEmulator, authInternal, \"emulator-config-failed\" /* EMULATOR_CONFIG_FAILED */);\r\n _assert(/^https?:\\/\\//.test(url), authInternal, \"invalid-emulator-scheme\" /* INVALID_EMULATOR_SCHEME */);\r\n const disableWarnings = !!(options === null || options === void 0 ? void 0 : options.disableWarnings);\r\n const protocol = extractProtocol(url);\r\n const { host, port } = extractHostAndPort(url);\r\n const portStr = port === null ? '' : `:${port}`;\r\n // Always replace path with \"/\" (even if input url had no path at all, or had a different one).\r\n authInternal.config.emulator = { url: `${protocol}//${host}${portStr}/` };\r\n authInternal.settings.appVerificationDisabledForTesting = true;\r\n authInternal.emulatorConfig = Object.freeze({\r\n host,\r\n port,\r\n protocol: protocol.replace(':', ''),\r\n options: Object.freeze({ disableWarnings })\r\n });\r\n if (!disableWarnings) {\r\n emitEmulatorWarning();\r\n }\r\n}\r\nfunction extractProtocol(url) {\r\n const protocolEnd = url.indexOf(':');\r\n return protocolEnd < 0 ? '' : url.substr(0, protocolEnd + 1);\r\n}\r\nfunction extractHostAndPort(url) {\r\n const protocol = extractProtocol(url);\r\n const authority = /(\\/\\/)?([^?#/]+)/.exec(url.substr(protocol.length)); // Between // and /, ? or #.\r\n if (!authority) {\r\n return { host: '', port: null };\r\n }\r\n const hostAndPort = authority[2].split('@').pop() || ''; // Strip out \"username:password@\".\r\n const bracketedIPv6 = /^(\\[[^\\]]+\\])(:|$)/.exec(hostAndPort);\r\n if (bracketedIPv6) {\r\n const host = bracketedIPv6[1];\r\n return { host, port: parsePort(hostAndPort.substr(host.length + 1)) };\r\n }\r\n else {\r\n const [host, port] = hostAndPort.split(':');\r\n return { host, port: parsePort(port) };\r\n }\r\n}\r\nfunction parsePort(portStr) {\r\n if (!portStr) {\r\n return null;\r\n }\r\n const port = Number(portStr);\r\n if (isNaN(port)) {\r\n return null;\r\n }\r\n return port;\r\n}\r\nfunction emitEmulatorWarning() {\r\n function attachBanner() {\r\n const el = document.createElement('p');\r\n const sty = el.style;\r\n el.innerText =\r\n 'Running in emulator mode. Do not use with production credentials.';\r\n sty.position = 'fixed';\r\n sty.width = '100%';\r\n sty.backgroundColor = '#ffffff';\r\n sty.border = '.1em solid #000000';\r\n sty.color = '#b50000';\r\n sty.bottom = '0px';\r\n sty.left = '0px';\r\n sty.margin = '0px';\r\n sty.zIndex = '10000';\r\n sty.textAlign = 'center';\r\n el.classList.add('firebase-emulator-warning');\r\n document.body.appendChild(el);\r\n }\r\n if (typeof console !== 'undefined' && typeof console.info === 'function') {\r\n console.info('WARNING: You are using the Auth Emulator,' +\r\n ' which is intended for local testing only. Do not use with' +\r\n ' production credentials.');\r\n }\r\n if (typeof window !== 'undefined' &&\r\n typeof document !== 'undefined') {\r\n if (document.readyState === 'loading') {\r\n window.addEventListener('DOMContentLoaded', attachBanner);\r\n }\r\n else {\r\n attachBanner();\r\n }\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 * Interface that represents the credentials returned by an {@link AuthProvider}.\r\n *\r\n * @remarks\r\n * Implementations specify the details about each auth provider's credential requirements.\r\n *\r\n * @public\r\n */\r\nclass AuthCredential {\r\n /** @internal */\r\n constructor(\r\n /**\r\n * The authentication provider ID for the credential.\r\n *\r\n * @remarks\r\n * For example, 'facebook.com', or 'google.com'.\r\n */\r\n providerId, \r\n /**\r\n * The authentication sign in method for the credential.\r\n *\r\n * @remarks\r\n * For example, {@link SignInMethod}.EMAIL_PASSWORD, or\r\n * {@link SignInMethod}.EMAIL_LINK. This corresponds to the sign-in method\r\n * identifier as returned in {@link fetchSignInMethodsForEmail}.\r\n */\r\n signInMethod) {\r\n this.providerId = providerId;\r\n this.signInMethod = signInMethod;\r\n }\r\n /**\r\n * Returns a JSON-serializable representation of this object.\r\n *\r\n * @returns a JSON-serializable representation of this object.\r\n */\r\n toJSON() {\r\n return debugFail('not implemented');\r\n }\r\n /** @internal */\r\n _getIdTokenResponse(_auth) {\r\n return debugFail('not implemented');\r\n }\r\n /** @internal */\r\n _linkToIdToken(_auth, _idToken) {\r\n return debugFail('not implemented');\r\n }\r\n /** @internal */\r\n _getReauthenticationResolver(_auth) {\r\n return debugFail('not implemented');\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\nasync function resetPassword(auth, request) {\r\n return _performApiRequest(auth, \"POST\" /* POST */, \"/v1/accounts:resetPassword\" /* RESET_PASSWORD */, _addTidIfNecessary(auth, request));\r\n}\r\nasync function updateEmailPassword(auth, request) {\r\n return _performApiRequest(auth, \"POST\" /* POST */, \"/v1/accounts:update\" /* SET_ACCOUNT_INFO */, request);\r\n}\r\nasync function applyActionCode$1(auth, request) {\r\n return _performApiRequest(auth, \"POST\" /* POST */, \"/v1/accounts:update\" /* SET_ACCOUNT_INFO */, _addTidIfNecessary(auth, request));\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\nasync function signInWithPassword(auth, request) {\r\n return _performSignInRequest(auth, \"POST\" /* POST */, \"/v1/accounts:signInWithPassword\" /* SIGN_IN_WITH_PASSWORD */, _addTidIfNecessary(auth, request));\r\n}\r\nasync function sendOobCode(auth, request) {\r\n return _performApiRequest(auth, \"POST\" /* POST */, \"/v1/accounts:sendOobCode\" /* SEND_OOB_CODE */, _addTidIfNecessary(auth, request));\r\n}\r\nasync function sendEmailVerification$1(auth, request) {\r\n return sendOobCode(auth, request);\r\n}\r\nasync function sendPasswordResetEmail$1(auth, request) {\r\n return sendOobCode(auth, request);\r\n}\r\nasync function sendSignInLinkToEmail$1(auth, request) {\r\n return sendOobCode(auth, request);\r\n}\r\nasync function verifyAndChangeEmail(auth, request) {\r\n return sendOobCode(auth, request);\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\nasync function signInWithEmailLink$1(auth, request) {\r\n return _performSignInRequest(auth, \"POST\" /* POST */, \"/v1/accounts:signInWithEmailLink\" /* SIGN_IN_WITH_EMAIL_LINK */, _addTidIfNecessary(auth, request));\r\n}\r\nasync function signInWithEmailLinkForLinking(auth, request) {\r\n return _performSignInRequest(auth, \"POST\" /* POST */, \"/v1/accounts:signInWithEmailLink\" /* SIGN_IN_WITH_EMAIL_LINK */, _addTidIfNecessary(auth, request));\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 * Interface that represents the credentials returned by {@link EmailAuthProvider} for\r\n * {@link ProviderId}.PASSWORD\r\n *\r\n * @remarks\r\n * Covers both {@link SignInMethod}.EMAIL_PASSWORD and\r\n * {@link SignInMethod}.EMAIL_LINK.\r\n *\r\n * @public\r\n */\r\nclass EmailAuthCredential extends AuthCredential {\r\n /** @internal */\r\n constructor(\r\n /** @internal */\r\n _email, \r\n /** @internal */\r\n _password, signInMethod, \r\n /** @internal */\r\n _tenantId = null) {\r\n super(\"password\" /* PASSWORD */, signInMethod);\r\n this._email = _email;\r\n this._password = _password;\r\n this._tenantId = _tenantId;\r\n }\r\n /** @internal */\r\n static _fromEmailAndPassword(email, password) {\r\n return new EmailAuthCredential(email, password, \"password\" /* EMAIL_PASSWORD */);\r\n }\r\n /** @internal */\r\n static _fromEmailAndCode(email, oobCode, tenantId = null) {\r\n return new EmailAuthCredential(email, oobCode, \"emailLink\" /* EMAIL_LINK */, tenantId);\r\n }\r\n /** {@inheritdoc AuthCredential.toJSON} */\r\n toJSON() {\r\n return {\r\n email: this._email,\r\n password: this._password,\r\n signInMethod: this.signInMethod,\r\n tenantId: this._tenantId\r\n };\r\n }\r\n /**\r\n * Static method to deserialize a JSON representation of an object into an {@link AuthCredential}.\r\n *\r\n * @param json - Either `object` or the stringified representation of the object. When string is\r\n * provided, `JSON.parse` would be called first.\r\n *\r\n * @returns If the JSON input does not represent an {@link AuthCredential}, null is returned.\r\n */\r\n static fromJSON(json) {\r\n const obj = typeof json === 'string' ? JSON.parse(json) : json;\r\n if ((obj === null || obj === void 0 ? void 0 : obj.email) && (obj === null || obj === void 0 ? void 0 : obj.password)) {\r\n if (obj.signInMethod === \"password\" /* EMAIL_PASSWORD */) {\r\n return this._fromEmailAndPassword(obj.email, obj.password);\r\n }\r\n else if (obj.signInMethod === \"emailLink\" /* EMAIL_LINK */) {\r\n return this._fromEmailAndCode(obj.email, obj.password, obj.tenantId);\r\n }\r\n }\r\n return null;\r\n }\r\n /** @internal */\r\n async _getIdTokenResponse(auth) {\r\n switch (this.signInMethod) {\r\n case \"password\" /* EMAIL_PASSWORD */:\r\n return signInWithPassword(auth, {\r\n returnSecureToken: true,\r\n email: this._email,\r\n password: this._password\r\n });\r\n case \"emailLink\" /* EMAIL_LINK */:\r\n return signInWithEmailLink$1(auth, {\r\n email: this._email,\r\n oobCode: this._password\r\n });\r\n default:\r\n _fail(auth, \"internal-error\" /* INTERNAL_ERROR */);\r\n }\r\n }\r\n /** @internal */\r\n async _linkToIdToken(auth, idToken) {\r\n switch (this.signInMethod) {\r\n case \"password\" /* EMAIL_PASSWORD */:\r\n return updateEmailPassword(auth, {\r\n idToken,\r\n returnSecureToken: true,\r\n email: this._email,\r\n password: this._password\r\n });\r\n case \"emailLink\" /* EMAIL_LINK */:\r\n return signInWithEmailLinkForLinking(auth, {\r\n idToken,\r\n email: this._email,\r\n oobCode: this._password\r\n });\r\n default:\r\n _fail(auth, \"internal-error\" /* INTERNAL_ERROR */);\r\n }\r\n }\r\n /** @internal */\r\n _getReauthenticationResolver(auth) {\r\n return this._getIdTokenResponse(auth);\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\nasync function signInWithIdp(auth, request) {\r\n return _performSignInRequest(auth, \"POST\" /* POST */, \"/v1/accounts:signInWithIdp\" /* SIGN_IN_WITH_IDP */, _addTidIfNecessary(auth, request));\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 IDP_REQUEST_URI$1 = 'http://localhost';\r\n/**\r\n * Represents the OAuth credentials returned by an {@link OAuthProvider}.\r\n *\r\n * @remarks\r\n * Implementations specify the details about each auth provider's credential requirements.\r\n *\r\n * @public\r\n */\r\nclass OAuthCredential extends AuthCredential {\r\n constructor() {\r\n super(...arguments);\r\n this.pendingToken = null;\r\n }\r\n /** @internal */\r\n static _fromParams(params) {\r\n const cred = new OAuthCredential(params.providerId, params.signInMethod);\r\n if (params.idToken || params.accessToken) {\r\n // OAuth 2 and either ID token or access token.\r\n if (params.idToken) {\r\n cred.idToken = params.idToken;\r\n }\r\n if (params.accessToken) {\r\n cred.accessToken = params.accessToken;\r\n }\r\n // Add nonce if available and no pendingToken is present.\r\n if (params.nonce && !params.pendingToken) {\r\n cred.nonce = params.nonce;\r\n }\r\n if (params.pendingToken) {\r\n cred.pendingToken = params.pendingToken;\r\n }\r\n }\r\n else if (params.oauthToken && params.oauthTokenSecret) {\r\n // OAuth 1 and OAuth token with token secret\r\n cred.accessToken = params.oauthToken;\r\n cred.secret = params.oauthTokenSecret;\r\n }\r\n else {\r\n _fail(\"argument-error\" /* ARGUMENT_ERROR */);\r\n }\r\n return cred;\r\n }\r\n /** {@inheritdoc AuthCredential.toJSON} */\r\n toJSON() {\r\n return {\r\n idToken: this.idToken,\r\n accessToken: this.accessToken,\r\n secret: this.secret,\r\n nonce: this.nonce,\r\n pendingToken: this.pendingToken,\r\n providerId: this.providerId,\r\n signInMethod: this.signInMethod\r\n };\r\n }\r\n /**\r\n * Static method to deserialize a JSON representation of an object into an\r\n * {@link AuthCredential}.\r\n *\r\n * @param json - Input can be either Object or the stringified representation of the object.\r\n * When string is provided, JSON.parse would be called first.\r\n *\r\n * @returns If the JSON input does not represent an {@link AuthCredential}, null is returned.\r\n */\r\n static fromJSON(json) {\r\n const obj = typeof json === 'string' ? JSON.parse(json) : json;\r\n const { providerId, signInMethod } = obj, rest = __rest(obj, [\"providerId\", \"signInMethod\"]);\r\n if (!providerId || !signInMethod) {\r\n return null;\r\n }\r\n const cred = new OAuthCredential(providerId, signInMethod);\r\n cred.idToken = rest.idToken || undefined;\r\n cred.accessToken = rest.accessToken || undefined;\r\n cred.secret = rest.secret;\r\n cred.nonce = rest.nonce;\r\n cred.pendingToken = rest.pendingToken || null;\r\n return cred;\r\n }\r\n /** @internal */\r\n _getIdTokenResponse(auth) {\r\n const request = this.buildRequest();\r\n return signInWithIdp(auth, request);\r\n }\r\n /** @internal */\r\n _linkToIdToken(auth, idToken) {\r\n const request = this.buildRequest();\r\n request.idToken = idToken;\r\n return signInWithIdp(auth, request);\r\n }\r\n /** @internal */\r\n _getReauthenticationResolver(auth) {\r\n const request = this.buildRequest();\r\n request.autoCreate = false;\r\n return signInWithIdp(auth, request);\r\n }\r\n buildRequest() {\r\n const request = {\r\n requestUri: IDP_REQUEST_URI$1,\r\n returnSecureToken: true\r\n };\r\n if (this.pendingToken) {\r\n request.pendingToken = this.pendingToken;\r\n }\r\n else {\r\n const postBody = {};\r\n if (this.idToken) {\r\n postBody['id_token'] = this.idToken;\r\n }\r\n if (this.accessToken) {\r\n postBody['access_token'] = this.accessToken;\r\n }\r\n if (this.secret) {\r\n postBody['oauth_token_secret'] = this.secret;\r\n }\r\n postBody['providerId'] = this.providerId;\r\n if (this.nonce && !this.pendingToken) {\r\n postBody['nonce'] = this.nonce;\r\n }\r\n request.postBody = querystring(postBody);\r\n }\r\n return request;\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\nasync function sendPhoneVerificationCode(auth, request) {\r\n return _performApiRequest(auth, \"POST\" /* POST */, \"/v1/accounts:sendVerificationCode\" /* SEND_VERIFICATION_CODE */, _addTidIfNecessary(auth, request));\r\n}\r\nasync function signInWithPhoneNumber$1(auth, request) {\r\n return _performSignInRequest(auth, \"POST\" /* POST */, \"/v1/accounts:signInWithPhoneNumber\" /* SIGN_IN_WITH_PHONE_NUMBER */, _addTidIfNecessary(auth, request));\r\n}\r\nasync function linkWithPhoneNumber$1(auth, request) {\r\n const response = await _performSignInRequest(auth, \"POST\" /* POST */, \"/v1/accounts:signInWithPhoneNumber\" /* SIGN_IN_WITH_PHONE_NUMBER */, _addTidIfNecessary(auth, request));\r\n if (response.temporaryProof) {\r\n throw _makeTaggedError(auth, \"account-exists-with-different-credential\" /* NEED_CONFIRMATION */, response);\r\n }\r\n return response;\r\n}\r\nconst VERIFY_PHONE_NUMBER_FOR_EXISTING_ERROR_MAP_ = {\r\n [\"USER_NOT_FOUND\" /* USER_NOT_FOUND */]: \"user-not-found\" /* USER_DELETED */\r\n};\r\nasync function verifyPhoneNumberForExisting(auth, request) {\r\n const apiRequest = Object.assign(Object.assign({}, request), { operation: 'REAUTH' });\r\n return _performSignInRequest(auth, \"POST\" /* POST */, \"/v1/accounts:signInWithPhoneNumber\" /* SIGN_IN_WITH_PHONE_NUMBER */, _addTidIfNecessary(auth, apiRequest), VERIFY_PHONE_NUMBER_FOR_EXISTING_ERROR_MAP_);\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 * Represents the credentials returned by {@link PhoneAuthProvider}.\r\n *\r\n * @public\r\n */\r\nclass PhoneAuthCredential extends AuthCredential {\r\n constructor(params) {\r\n super(\"phone\" /* PHONE */, \"phone\" /* PHONE */);\r\n this.params = params;\r\n }\r\n /** @internal */\r\n static _fromVerification(verificationId, verificationCode) {\r\n return new PhoneAuthCredential({ verificationId, verificationCode });\r\n }\r\n /** @internal */\r\n static _fromTokenResponse(phoneNumber, temporaryProof) {\r\n return new PhoneAuthCredential({ phoneNumber, temporaryProof });\r\n }\r\n /** @internal */\r\n _getIdTokenResponse(auth) {\r\n return signInWithPhoneNumber$1(auth, this._makeVerificationRequest());\r\n }\r\n /** @internal */\r\n _linkToIdToken(auth, idToken) {\r\n return linkWithPhoneNumber$1(auth, Object.assign({ idToken }, this._makeVerificationRequest()));\r\n }\r\n /** @internal */\r\n _getReauthenticationResolver(auth) {\r\n return verifyPhoneNumberForExisting(auth, this._makeVerificationRequest());\r\n }\r\n /** @internal */\r\n _makeVerificationRequest() {\r\n const { temporaryProof, phoneNumber, verificationId, verificationCode } = this.params;\r\n if (temporaryProof && phoneNumber) {\r\n return { temporaryProof, phoneNumber };\r\n }\r\n return {\r\n sessionInfo: verificationId,\r\n code: verificationCode\r\n };\r\n }\r\n /** {@inheritdoc AuthCredential.toJSON} */\r\n toJSON() {\r\n const obj = {\r\n providerId: this.providerId\r\n };\r\n if (this.params.phoneNumber) {\r\n obj.phoneNumber = this.params.phoneNumber;\r\n }\r\n if (this.params.temporaryProof) {\r\n obj.temporaryProof = this.params.temporaryProof;\r\n }\r\n if (this.params.verificationCode) {\r\n obj.verificationCode = this.params.verificationCode;\r\n }\r\n if (this.params.verificationId) {\r\n obj.verificationId = this.params.verificationId;\r\n }\r\n return obj;\r\n }\r\n /** Generates a phone credential based on a plain object or a JSON string. */\r\n static fromJSON(json) {\r\n if (typeof json === 'string') {\r\n json = JSON.parse(json);\r\n }\r\n const { verificationId, verificationCode, phoneNumber, temporaryProof } = json;\r\n if (!verificationCode &&\r\n !verificationId &&\r\n !phoneNumber &&\r\n !temporaryProof) {\r\n return null;\r\n }\r\n return new PhoneAuthCredential({\r\n verificationId,\r\n verificationCode,\r\n phoneNumber,\r\n temporaryProof\r\n });\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 * Maps the mode string in action code URL to Action Code Info operation.\r\n *\r\n * @param mode\r\n */\r\nfunction parseMode(mode) {\r\n switch (mode) {\r\n case 'recoverEmail':\r\n return \"RECOVER_EMAIL\" /* RECOVER_EMAIL */;\r\n case 'resetPassword':\r\n return \"PASSWORD_RESET\" /* PASSWORD_RESET */;\r\n case 'signIn':\r\n return \"EMAIL_SIGNIN\" /* EMAIL_SIGNIN */;\r\n case 'verifyEmail':\r\n return \"VERIFY_EMAIL\" /* VERIFY_EMAIL */;\r\n case 'verifyAndChangeEmail':\r\n return \"VERIFY_AND_CHANGE_EMAIL\" /* VERIFY_AND_CHANGE_EMAIL */;\r\n case 'revertSecondFactorAddition':\r\n return \"REVERT_SECOND_FACTOR_ADDITION\" /* REVERT_SECOND_FACTOR_ADDITION */;\r\n default:\r\n return null;\r\n }\r\n}\r\n/**\r\n * Helper to parse FDL links\r\n *\r\n * @param url\r\n */\r\nfunction parseDeepLink(url) {\r\n const link = querystringDecode(extractQuerystring(url))['link'];\r\n // Double link case (automatic redirect).\r\n const doubleDeepLink = link\r\n ? querystringDecode(extractQuerystring(link))['deep_link_id']\r\n : null;\r\n // iOS custom scheme links.\r\n const iOSDeepLink = querystringDecode(extractQuerystring(url))['deep_link_id'];\r\n const iOSDoubleDeepLink = iOSDeepLink\r\n ? querystringDecode(extractQuerystring(iOSDeepLink))['link']\r\n : null;\r\n return iOSDoubleDeepLink || iOSDeepLink || doubleDeepLink || link || url;\r\n}\r\n/**\r\n * A utility class to parse email action URLs such as password reset, email verification,\r\n * email link sign in, etc.\r\n *\r\n * @public\r\n */\r\nclass ActionCodeURL {\r\n /**\r\n * @param actionLink - The link from which to extract the URL.\r\n * @returns The {@link ActionCodeURL} object, or null if the link is invalid.\r\n *\r\n * @internal\r\n */\r\n constructor(actionLink) {\r\n var _a, _b, _c, _d, _e, _f;\r\n const searchParams = querystringDecode(extractQuerystring(actionLink));\r\n const apiKey = (_a = searchParams[\"apiKey\" /* API_KEY */]) !== null && _a !== void 0 ? _a : null;\r\n const code = (_b = searchParams[\"oobCode\" /* CODE */]) !== null && _b !== void 0 ? _b : null;\r\n const operation = parseMode((_c = searchParams[\"mode\" /* MODE */]) !== null && _c !== void 0 ? _c : null);\r\n // Validate API key, code and mode.\r\n _assert(apiKey && code && operation, \"argument-error\" /* ARGUMENT_ERROR */);\r\n this.apiKey = apiKey;\r\n this.operation = operation;\r\n this.code = code;\r\n this.continueUrl = (_d = searchParams[\"continueUrl\" /* CONTINUE_URL */]) !== null && _d !== void 0 ? _d : null;\r\n this.languageCode = (_e = searchParams[\"languageCode\" /* LANGUAGE_CODE */]) !== null && _e !== void 0 ? _e : null;\r\n this.tenantId = (_f = searchParams[\"tenantId\" /* TENANT_ID */]) !== null && _f !== void 0 ? _f : null;\r\n }\r\n /**\r\n * Parses the email action link string and returns an {@link ActionCodeURL} if the link is valid,\r\n * otherwise returns null.\r\n *\r\n * @param link - The email action link string.\r\n * @returns The {@link ActionCodeURL} object, or null if the link is invalid.\r\n *\r\n * @public\r\n */\r\n static parseLink(link) {\r\n const actionLink = parseDeepLink(link);\r\n try {\r\n return new ActionCodeURL(actionLink);\r\n }\r\n catch (_a) {\r\n return null;\r\n }\r\n }\r\n}\r\n/**\r\n * Parses the email action link string and returns an {@link ActionCodeURL} if\r\n * the link is valid, otherwise returns null.\r\n *\r\n * @public\r\n */\r\nfunction parseActionCodeURL(link) {\r\n return ActionCodeURL.parseLink(link);\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 * Provider for generating {@link EmailAuthCredential}.\r\n *\r\n * @public\r\n */\r\nclass EmailAuthProvider {\r\n constructor() {\r\n /**\r\n * Always set to {@link ProviderId}.PASSWORD, even for email link.\r\n */\r\n this.providerId = EmailAuthProvider.PROVIDER_ID;\r\n }\r\n /**\r\n * Initialize an {@link AuthCredential} using an email and password.\r\n *\r\n * @example\r\n * ```javascript\r\n * const authCredential = EmailAuthProvider.credential(email, password);\r\n * const userCredential = await signInWithCredential(auth, authCredential);\r\n * ```\r\n *\r\n * @example\r\n * ```javascript\r\n * const userCredential = await signInWithEmailAndPassword(auth, email, password);\r\n * ```\r\n *\r\n * @param email - Email address.\r\n * @param password - User account password.\r\n * @returns The auth provider credential.\r\n */\r\n static credential(email, password) {\r\n return EmailAuthCredential._fromEmailAndPassword(email, password);\r\n }\r\n /**\r\n * Initialize an {@link AuthCredential} using an email and an email link after a sign in with\r\n * email link operation.\r\n *\r\n * @example\r\n * ```javascript\r\n * const authCredential = EmailAuthProvider.credentialWithLink(auth, email, emailLink);\r\n * const userCredential = await signInWithCredential(auth, authCredential);\r\n * ```\r\n *\r\n * @example\r\n * ```javascript\r\n * await sendSignInLinkToEmail(auth, email);\r\n * // Obtain emailLink from user.\r\n * const userCredential = await signInWithEmailLink(auth, email, emailLink);\r\n * ```\r\n *\r\n * @param auth - The {@link Auth} instance used to verify the link.\r\n * @param email - Email address.\r\n * @param emailLink - Sign-in email link.\r\n * @returns - The auth provider credential.\r\n */\r\n static credentialWithLink(email, emailLink) {\r\n const actionCodeUrl = ActionCodeURL.parseLink(emailLink);\r\n _assert(actionCodeUrl, \"argument-error\" /* ARGUMENT_ERROR */);\r\n return EmailAuthCredential._fromEmailAndCode(email, actionCodeUrl.code, actionCodeUrl.tenantId);\r\n }\r\n}\r\n/**\r\n * Always set to {@link ProviderId}.PASSWORD, even for email link.\r\n */\r\nEmailAuthProvider.PROVIDER_ID = \"password\" /* PASSWORD */;\r\n/**\r\n * Always set to {@link SignInMethod}.EMAIL_PASSWORD.\r\n */\r\nEmailAuthProvider.EMAIL_PASSWORD_SIGN_IN_METHOD = \"password\" /* EMAIL_PASSWORD */;\r\n/**\r\n * Always set to {@link SignInMethod}.EMAIL_LINK.\r\n */\r\nEmailAuthProvider.EMAIL_LINK_SIGN_IN_METHOD = \"emailLink\" /* EMAIL_LINK */;\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 * The base class for all Federated providers (OAuth (including OIDC), SAML).\r\n *\r\n * This class is not meant to be instantiated directly.\r\n *\r\n * @public\r\n */\r\nclass FederatedAuthProvider {\r\n /**\r\n * Constructor for generic OAuth providers.\r\n *\r\n * @param providerId - Provider for which credentials should be generated.\r\n */\r\n constructor(providerId) {\r\n this.providerId = providerId;\r\n /** @internal */\r\n this.defaultLanguageCode = null;\r\n /** @internal */\r\n this.customParameters = {};\r\n }\r\n /**\r\n * Set the language gode.\r\n *\r\n * @param languageCode - language code\r\n */\r\n setDefaultLanguage(languageCode) {\r\n this.defaultLanguageCode = languageCode;\r\n }\r\n /**\r\n * Sets the OAuth custom parameters to pass in an OAuth request for popup and redirect sign-in\r\n * operations.\r\n *\r\n * @remarks\r\n * For a detailed list, check the reserved required OAuth 2.0 parameters such as `client_id`,\r\n * `redirect_uri`, `scope`, `response_type`, and `state` are not allowed and will be ignored.\r\n *\r\n * @param customOAuthParameters - The custom OAuth parameters to pass in the OAuth request.\r\n */\r\n setCustomParameters(customOAuthParameters) {\r\n this.customParameters = customOAuthParameters;\r\n return this;\r\n }\r\n /**\r\n * Retrieve the current list of {@link CustomParameters}.\r\n */\r\n getCustomParameters() {\r\n return this.customParameters;\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 * Common code to all OAuth providers. This is separate from the\r\n * {@link OAuthProvider} so that child providers (like\r\n * {@link GoogleAuthProvider}) don't inherit the `credential` instance method.\r\n * Instead, they rely on a static `credential` method.\r\n */\r\nclass BaseOAuthProvider extends FederatedAuthProvider {\r\n constructor() {\r\n super(...arguments);\r\n /** @internal */\r\n this.scopes = [];\r\n }\r\n /**\r\n * Add an OAuth scope to the credential.\r\n *\r\n * @param scope - Provider OAuth scope to add.\r\n */\r\n addScope(scope) {\r\n // If not already added, add scope to list.\r\n if (!this.scopes.includes(scope)) {\r\n this.scopes.push(scope);\r\n }\r\n return this;\r\n }\r\n /**\r\n * Retrieve the current list of OAuth scopes.\r\n */\r\n getScopes() {\r\n return [...this.scopes];\r\n }\r\n}\r\n/**\r\n * Provider for generating generic {@link OAuthCredential}.\r\n *\r\n * @example\r\n * ```javascript\r\n * // Sign in using a redirect.\r\n * const provider = new OAuthProvider('google.com');\r\n * // Start a sign in process for an unauthenticated user.\r\n * provider.addScope('profile');\r\n * provider.addScope('email');\r\n * await signInWithRedirect(auth, provider);\r\n * // This will trigger a full page redirect away from your app\r\n *\r\n * // After returning from the redirect when your app initializes you can obtain the result\r\n * const result = await getRedirectResult(auth);\r\n * if (result) {\r\n * // This is the signed-in user\r\n * const user = result.user;\r\n * // This gives you a OAuth Access Token for the provider.\r\n * const credential = provider.credentialFromResult(auth, result);\r\n * const token = credential.accessToken;\r\n * }\r\n * ```\r\n *\r\n * @example\r\n * ```javascript\r\n * // Sign in using a popup.\r\n * const provider = new OAuthProvider('google.com');\r\n * provider.addScope('profile');\r\n * provider.addScope('email');\r\n * const result = await signInWithPopup(auth, provider);\r\n *\r\n * // The signed-in user info.\r\n * const user = result.user;\r\n * // This gives you a OAuth Access Token for the provider.\r\n * const credential = provider.credentialFromResult(auth, result);\r\n * const token = credential.accessToken;\r\n * ```\r\n * @public\r\n */\r\nclass OAuthProvider extends BaseOAuthProvider {\r\n /**\r\n * Creates an {@link OAuthCredential} from a JSON string or a plain object.\r\n * @param json - A plain object or a JSON string\r\n */\r\n static credentialFromJSON(json) {\r\n const obj = typeof json === 'string' ? JSON.parse(json) : json;\r\n _assert('providerId' in obj && 'signInMethod' in obj, \"argument-error\" /* ARGUMENT_ERROR */);\r\n return OAuthCredential._fromParams(obj);\r\n }\r\n /**\r\n * Creates a {@link OAuthCredential} from a generic OAuth provider's access token or ID token.\r\n *\r\n * @remarks\r\n * The raw nonce is required when an ID token with a nonce field is provided. The SHA-256 hash of\r\n * the raw nonce must match the nonce field in the ID token.\r\n *\r\n * @example\r\n * ```javascript\r\n * // `googleUser` from the onsuccess Google Sign In callback.\r\n * // Initialize a generate OAuth provider with a `google.com` providerId.\r\n * const provider = new OAuthProvider('google.com');\r\n * const credential = provider.credential({\r\n * idToken: googleUser.getAuthResponse().id_token,\r\n * });\r\n * const result = await signInWithCredential(credential);\r\n * ```\r\n *\r\n * @param params - Either the options object containing the ID token, access token and raw nonce\r\n * or the ID token string.\r\n */\r\n credential(params) {\r\n return this._credential(Object.assign(Object.assign({}, params), { nonce: params.rawNonce }));\r\n }\r\n /** An internal credential method that accepts more permissive options */\r\n _credential(params) {\r\n _assert(params.idToken || params.accessToken, \"argument-error\" /* ARGUMENT_ERROR */);\r\n // For OAuthCredential, sign in method is same as providerId.\r\n return OAuthCredential._fromParams(Object.assign(Object.assign({}, params), { providerId: this.providerId, signInMethod: this.providerId }));\r\n }\r\n /**\r\n * Used to extract the underlying {@link OAuthCredential} from a {@link UserCredential}.\r\n *\r\n * @param userCredential - The user credential.\r\n */\r\n static credentialFromResult(userCredential) {\r\n return OAuthProvider.oauthCredentialFromTaggedObject(userCredential);\r\n }\r\n /**\r\n * Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was\r\n * thrown during a sign-in, link, or reauthenticate operation.\r\n *\r\n * @param userCredential - The user credential.\r\n */\r\n static credentialFromError(error) {\r\n return OAuthProvider.oauthCredentialFromTaggedObject((error.customData || {}));\r\n }\r\n static oauthCredentialFromTaggedObject({ _tokenResponse: tokenResponse }) {\r\n if (!tokenResponse) {\r\n return null;\r\n }\r\n const { oauthIdToken, oauthAccessToken, oauthTokenSecret, pendingToken, nonce, providerId } = tokenResponse;\r\n if (!oauthAccessToken &&\r\n !oauthTokenSecret &&\r\n !oauthIdToken &&\r\n !pendingToken) {\r\n return null;\r\n }\r\n if (!providerId) {\r\n return null;\r\n }\r\n try {\r\n return new OAuthProvider(providerId)._credential({\r\n idToken: oauthIdToken,\r\n accessToken: oauthAccessToken,\r\n nonce,\r\n pendingToken\r\n });\r\n }\r\n catch (e) {\r\n return null;\r\n }\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 * Provider for generating an {@link OAuthCredential} for {@link ProviderId}.FACEBOOK.\r\n *\r\n * @example\r\n * ```javascript\r\n * // Sign in using a redirect.\r\n * const provider = new FacebookAuthProvider();\r\n * // Start a sign in process for an unauthenticated user.\r\n * provider.addScope('user_birthday');\r\n * await signInWithRedirect(auth, provider);\r\n * // This will trigger a full page redirect away from your app\r\n *\r\n * // After returning from the redirect when your app initializes you can obtain the result\r\n * const result = await getRedirectResult(auth);\r\n * if (result) {\r\n * // This is the signed-in user\r\n * const user = result.user;\r\n * // This gives you a Facebook Access Token.\r\n * const credential = FacebookAuthProvider.credentialFromResult(result);\r\n * const token = credential.accessToken;\r\n * }\r\n * ```\r\n *\r\n * @example\r\n * ```javascript\r\n * // Sign in using a popup.\r\n * const provider = new FacebookAuthProvider();\r\n * provider.addScope('user_birthday');\r\n * const result = await signInWithPopup(auth, provider);\r\n *\r\n * // The signed-in user info.\r\n * const user = result.user;\r\n * // This gives you a Facebook Access Token.\r\n * const credential = FacebookAuthProvider.credentialFromResult(result);\r\n * const token = credential.accessToken;\r\n * ```\r\n *\r\n * @public\r\n */\r\nclass FacebookAuthProvider extends BaseOAuthProvider {\r\n constructor() {\r\n super(\"facebook.com\" /* FACEBOOK */);\r\n }\r\n /**\r\n * Creates a credential for Facebook.\r\n *\r\n * @example\r\n * ```javascript\r\n * // `event` from the Facebook auth.authResponseChange callback.\r\n * const credential = FacebookAuthProvider.credential(event.authResponse.accessToken);\r\n * const result = await signInWithCredential(credential);\r\n * ```\r\n *\r\n * @param accessToken - Facebook access token.\r\n */\r\n static credential(accessToken) {\r\n return OAuthCredential._fromParams({\r\n providerId: FacebookAuthProvider.PROVIDER_ID,\r\n signInMethod: FacebookAuthProvider.FACEBOOK_SIGN_IN_METHOD,\r\n accessToken\r\n });\r\n }\r\n /**\r\n * Used to extract the underlying {@link OAuthCredential} from a {@link UserCredential}.\r\n *\r\n * @param userCredential - The user credential.\r\n */\r\n static credentialFromResult(userCredential) {\r\n return FacebookAuthProvider.credentialFromTaggedObject(userCredential);\r\n }\r\n /**\r\n * Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was\r\n * thrown during a sign-in, link, or reauthenticate operation.\r\n *\r\n * @param userCredential - The user credential.\r\n */\r\n static credentialFromError(error) {\r\n return FacebookAuthProvider.credentialFromTaggedObject((error.customData || {}));\r\n }\r\n static credentialFromTaggedObject({ _tokenResponse: tokenResponse }) {\r\n if (!tokenResponse || !('oauthAccessToken' in tokenResponse)) {\r\n return null;\r\n }\r\n if (!tokenResponse.oauthAccessToken) {\r\n return null;\r\n }\r\n try {\r\n return FacebookAuthProvider.credential(tokenResponse.oauthAccessToken);\r\n }\r\n catch (_a) {\r\n return null;\r\n }\r\n }\r\n}\r\n/** Always set to {@link SignInMethod}.FACEBOOK. */\r\nFacebookAuthProvider.FACEBOOK_SIGN_IN_METHOD = \"facebook.com\" /* FACEBOOK */;\r\n/** Always set to {@link ProviderId}.FACEBOOK. */\r\nFacebookAuthProvider.PROVIDER_ID = \"facebook.com\" /* FACEBOOK */;\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 * Provider for generating an an {@link OAuthCredential} for {@link ProviderId}.GOOGLE.\r\n *\r\n * @example\r\n * ```javascript\r\n * // Sign in using a redirect.\r\n * const provider = new GoogleAuthProvider();\r\n * // Start a sign in process for an unauthenticated user.\r\n * provider.addScope('profile');\r\n * provider.addScope('email');\r\n * await signInWithRedirect(auth, provider);\r\n * // This will trigger a full page redirect away from your app\r\n *\r\n * // After returning from the redirect when your app initializes you can obtain the result\r\n * const result = await getRedirectResult(auth);\r\n * if (result) {\r\n * // This is the signed-in user\r\n * const user = result.user;\r\n * // This gives you a Google Access Token.\r\n * const credential = GoogleAuthProvider.credentialFromResult(result);\r\n * const token = credential.accessToken;\r\n * }\r\n * ```\r\n *\r\n * @example\r\n * ```javascript\r\n * // Sign in using a popup.\r\n * const provider = new GoogleAuthProvider();\r\n * provider.addScope('profile');\r\n * provider.addScope('email');\r\n * const result = await signInWithPopup(auth, provider);\r\n *\r\n * // The signed-in user info.\r\n * const user = result.user;\r\n * // This gives you a Google Access Token.\r\n * const credential = GoogleAuthProvider.credentialFromResult(result);\r\n * const token = credential.accessToken;\r\n * ```\r\n *\r\n * @public\r\n */\r\nclass GoogleAuthProvider extends BaseOAuthProvider {\r\n constructor() {\r\n super(\"google.com\" /* GOOGLE */);\r\n this.addScope('profile');\r\n }\r\n /**\r\n * Creates a credential for Google. At least one of ID token and access token is required.\r\n *\r\n * @example\r\n * ```javascript\r\n * // \\`googleUser\\` from the onsuccess Google Sign In callback.\r\n * const credential = GoogleAuthProvider.credential(googleUser.getAuthResponse().id_token);\r\n * const result = await signInWithCredential(credential);\r\n * ```\r\n *\r\n * @param idToken - Google ID token.\r\n * @param accessToken - Google access token.\r\n */\r\n static credential(idToken, accessToken) {\r\n return OAuthCredential._fromParams({\r\n providerId: GoogleAuthProvider.PROVIDER_ID,\r\n signInMethod: GoogleAuthProvider.GOOGLE_SIGN_IN_METHOD,\r\n idToken,\r\n accessToken\r\n });\r\n }\r\n /**\r\n * Used to extract the underlying {@link OAuthCredential} from a {@link UserCredential}.\r\n *\r\n * @param userCredential - The user credential.\r\n */\r\n static credentialFromResult(userCredential) {\r\n return GoogleAuthProvider.credentialFromTaggedObject(userCredential);\r\n }\r\n /**\r\n * Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was\r\n * thrown during a sign-in, link, or reauthenticate operation.\r\n *\r\n * @param userCredential - The user credential.\r\n */\r\n static credentialFromError(error) {\r\n return GoogleAuthProvider.credentialFromTaggedObject((error.customData || {}));\r\n }\r\n static credentialFromTaggedObject({ _tokenResponse: tokenResponse }) {\r\n if (!tokenResponse) {\r\n return null;\r\n }\r\n const { oauthIdToken, oauthAccessToken } = tokenResponse;\r\n if (!oauthIdToken && !oauthAccessToken) {\r\n // This could be an oauth 1 credential or a phone credential\r\n return null;\r\n }\r\n try {\r\n return GoogleAuthProvider.credential(oauthIdToken, oauthAccessToken);\r\n }\r\n catch (_a) {\r\n return null;\r\n }\r\n }\r\n}\r\n/** Always set to {@link SignInMethod}.GOOGLE. */\r\nGoogleAuthProvider.GOOGLE_SIGN_IN_METHOD = \"google.com\" /* GOOGLE */;\r\n/** Always set to {@link ProviderId}.GOOGLE. */\r\nGoogleAuthProvider.PROVIDER_ID = \"google.com\" /* GOOGLE */;\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 * Provider for generating an {@link OAuthCredential} for {@link ProviderId}.GITHUB.\r\n *\r\n * @remarks\r\n * GitHub requires an OAuth 2.0 redirect, so you can either handle the redirect directly, or use\r\n * the {@link signInWithPopup} handler:\r\n *\r\n * @example\r\n * ```javascript\r\n * // Sign in using a redirect.\r\n * const provider = new GithubAuthProvider();\r\n * // Start a sign in process for an unauthenticated user.\r\n * provider.addScope('repo');\r\n * await signInWithRedirect(auth, provider);\r\n * // This will trigger a full page redirect away from your app\r\n *\r\n * // After returning from the redirect when your app initializes you can obtain the result\r\n * const result = await getRedirectResult(auth);\r\n * if (result) {\r\n * // This is the signed-in user\r\n * const user = result.user;\r\n * // This gives you a Github Access Token.\r\n * const credential = GithubAuthProvider.credentialFromResult(result);\r\n * const token = credential.accessToken;\r\n * }\r\n * ```\r\n *\r\n * @example\r\n * ```javascript\r\n * // Sign in using a popup.\r\n * const provider = new GithubAuthProvider();\r\n * provider.addScope('repo');\r\n * const result = await signInWithPopup(auth, provider);\r\n *\r\n * // The signed-in user info.\r\n * const user = result.user;\r\n * // This gives you a Github Access Token.\r\n * const credential = GithubAuthProvider.credentialFromResult(result);\r\n * const token = credential.accessToken;\r\n * ```\r\n * @public\r\n */\r\nclass GithubAuthProvider extends BaseOAuthProvider {\r\n constructor() {\r\n super(\"github.com\" /* GITHUB */);\r\n }\r\n /**\r\n * Creates a credential for Github.\r\n *\r\n * @param accessToken - Github access token.\r\n */\r\n static credential(accessToken) {\r\n return OAuthCredential._fromParams({\r\n providerId: GithubAuthProvider.PROVIDER_ID,\r\n signInMethod: GithubAuthProvider.GITHUB_SIGN_IN_METHOD,\r\n accessToken\r\n });\r\n }\r\n /**\r\n * Used to extract the underlying {@link OAuthCredential} from a {@link UserCredential}.\r\n *\r\n * @param userCredential - The user credential.\r\n */\r\n static credentialFromResult(userCredential) {\r\n return GithubAuthProvider.credentialFromTaggedObject(userCredential);\r\n }\r\n /**\r\n * Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was\r\n * thrown during a sign-in, link, or reauthenticate operation.\r\n *\r\n * @param userCredential - The user credential.\r\n */\r\n static credentialFromError(error) {\r\n return GithubAuthProvider.credentialFromTaggedObject((error.customData || {}));\r\n }\r\n static credentialFromTaggedObject({ _tokenResponse: tokenResponse }) {\r\n if (!tokenResponse || !('oauthAccessToken' in tokenResponse)) {\r\n return null;\r\n }\r\n if (!tokenResponse.oauthAccessToken) {\r\n return null;\r\n }\r\n try {\r\n return GithubAuthProvider.credential(tokenResponse.oauthAccessToken);\r\n }\r\n catch (_a) {\r\n return null;\r\n }\r\n }\r\n}\r\n/** Always set to {@link SignInMethod}.GITHUB. */\r\nGithubAuthProvider.GITHUB_SIGN_IN_METHOD = \"github.com\" /* GITHUB */;\r\n/** Always set to {@link ProviderId}.GITHUB. */\r\nGithubAuthProvider.PROVIDER_ID = \"github.com\" /* GITHUB */;\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 IDP_REQUEST_URI = 'http://localhost';\r\n/**\r\n * @public\r\n */\r\nclass SAMLAuthCredential extends AuthCredential {\r\n /** @internal */\r\n constructor(providerId, pendingToken) {\r\n super(providerId, providerId);\r\n this.pendingToken = pendingToken;\r\n }\r\n /** @internal */\r\n _getIdTokenResponse(auth) {\r\n const request = this.buildRequest();\r\n return signInWithIdp(auth, request);\r\n }\r\n /** @internal */\r\n _linkToIdToken(auth, idToken) {\r\n const request = this.buildRequest();\r\n request.idToken = idToken;\r\n return signInWithIdp(auth, request);\r\n }\r\n /** @internal */\r\n _getReauthenticationResolver(auth) {\r\n const request = this.buildRequest();\r\n request.autoCreate = false;\r\n return signInWithIdp(auth, request);\r\n }\r\n /** {@inheritdoc AuthCredential.toJSON} */\r\n toJSON() {\r\n return {\r\n signInMethod: this.signInMethod,\r\n providerId: this.providerId,\r\n pendingToken: this.pendingToken\r\n };\r\n }\r\n /**\r\n * Static method to deserialize a JSON representation of an object into an\r\n * {@link AuthCredential}.\r\n *\r\n * @param json - Input can be either Object or the stringified representation of the object.\r\n * When string is provided, JSON.parse would be called first.\r\n *\r\n * @returns If the JSON input does not represent an {@link AuthCredential}, null is returned.\r\n */\r\n static fromJSON(json) {\r\n const obj = typeof json === 'string' ? JSON.parse(json) : json;\r\n const { providerId, signInMethod, pendingToken } = obj;\r\n if (!providerId ||\r\n !signInMethod ||\r\n !pendingToken ||\r\n providerId !== signInMethod) {\r\n return null;\r\n }\r\n return new SAMLAuthCredential(providerId, pendingToken);\r\n }\r\n /**\r\n * Helper static method to avoid exposing the constructor to end users.\r\n *\r\n * @internal\r\n */\r\n static _create(providerId, pendingToken) {\r\n return new SAMLAuthCredential(providerId, pendingToken);\r\n }\r\n buildRequest() {\r\n return {\r\n requestUri: IDP_REQUEST_URI,\r\n returnSecureToken: true,\r\n pendingToken: this.pendingToken\r\n };\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 SAML_PROVIDER_PREFIX = 'saml.';\r\n/**\r\n * An {@link AuthProvider} for SAML.\r\n *\r\n * @public\r\n */\r\nclass SAMLAuthProvider extends FederatedAuthProvider {\r\n /**\r\n * Constructor. The providerId must start with \"saml.\"\r\n * @param providerId - SAML provider ID.\r\n */\r\n constructor(providerId) {\r\n _assert(providerId.startsWith(SAML_PROVIDER_PREFIX), \"argument-error\" /* ARGUMENT_ERROR */);\r\n super(providerId);\r\n }\r\n /**\r\n * Generates an {@link AuthCredential} from a {@link UserCredential} after a\r\n * successful SAML flow completes.\r\n *\r\n * @remarks\r\n *\r\n * For example, to get an {@link AuthCredential}, you could write the\r\n * following code:\r\n *\r\n * ```js\r\n * const userCredential = await signInWithPopup(auth, samlProvider);\r\n * const credential = SAMLAuthProvider.credentialFromResult(userCredential);\r\n * ```\r\n *\r\n * @param userCredential - The user credential.\r\n */\r\n static credentialFromResult(userCredential) {\r\n return SAMLAuthProvider.samlCredentialFromTaggedObject(userCredential);\r\n }\r\n /**\r\n * Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was\r\n * thrown during a sign-in, link, or reauthenticate operation.\r\n *\r\n * @param userCredential - The user credential.\r\n */\r\n static credentialFromError(error) {\r\n return SAMLAuthProvider.samlCredentialFromTaggedObject((error.customData || {}));\r\n }\r\n /**\r\n * Creates an {@link AuthCredential} from a JSON string or a plain object.\r\n * @param json - A plain object or a JSON string\r\n */\r\n static credentialFromJSON(json) {\r\n const credential = SAMLAuthCredential.fromJSON(json);\r\n _assert(credential, \"argument-error\" /* ARGUMENT_ERROR */);\r\n return credential;\r\n }\r\n static samlCredentialFromTaggedObject({ _tokenResponse: tokenResponse }) {\r\n if (!tokenResponse) {\r\n return null;\r\n }\r\n const { pendingToken, providerId } = tokenResponse;\r\n if (!pendingToken || !providerId) {\r\n return null;\r\n }\r\n try {\r\n return SAMLAuthCredential._create(providerId, pendingToken);\r\n }\r\n catch (e) {\r\n return null;\r\n }\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 * Provider for generating an {@link OAuthCredential} for {@link ProviderId}.TWITTER.\r\n *\r\n * @example\r\n * ```javascript\r\n * // Sign in using a redirect.\r\n * const provider = new TwitterAuthProvider();\r\n * // Start a sign in process for an unauthenticated user.\r\n * await signInWithRedirect(auth, provider);\r\n * // This will trigger a full page redirect away from your app\r\n *\r\n * // After returning from the redirect when your app initializes you can obtain the result\r\n * const result = await getRedirectResult(auth);\r\n * if (result) {\r\n * // This is the signed-in user\r\n * const user = result.user;\r\n * // This gives you a Twitter Access Token and Secret.\r\n * const credential = TwitterAuthProvider.credentialFromResult(result);\r\n * const token = credential.accessToken;\r\n * const secret = credential.secret;\r\n * }\r\n * ```\r\n *\r\n * @example\r\n * ```javascript\r\n * // Sign in using a popup.\r\n * const provider = new TwitterAuthProvider();\r\n * const result = await signInWithPopup(auth, provider);\r\n *\r\n * // The signed-in user info.\r\n * const user = result.user;\r\n * // This gives you a Twitter Access Token and Secret.\r\n * const credential = TwitterAuthProvider.credentialFromResult(result);\r\n * const token = credential.accessToken;\r\n * const secret = credential.secret;\r\n * ```\r\n *\r\n * @public\r\n */\r\nclass TwitterAuthProvider extends BaseOAuthProvider {\r\n constructor() {\r\n super(\"twitter.com\" /* TWITTER */);\r\n }\r\n /**\r\n * Creates a credential for Twitter.\r\n *\r\n * @param token - Twitter access token.\r\n * @param secret - Twitter secret.\r\n */\r\n static credential(token, secret) {\r\n return OAuthCredential._fromParams({\r\n providerId: TwitterAuthProvider.PROVIDER_ID,\r\n signInMethod: TwitterAuthProvider.TWITTER_SIGN_IN_METHOD,\r\n oauthToken: token,\r\n oauthTokenSecret: secret\r\n });\r\n }\r\n /**\r\n * Used to extract the underlying {@link OAuthCredential} from a {@link UserCredential}.\r\n *\r\n * @param userCredential - The user credential.\r\n */\r\n static credentialFromResult(userCredential) {\r\n return TwitterAuthProvider.credentialFromTaggedObject(userCredential);\r\n }\r\n /**\r\n * Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was\r\n * thrown during a sign-in, link, or reauthenticate operation.\r\n *\r\n * @param userCredential - The user credential.\r\n */\r\n static credentialFromError(error) {\r\n return TwitterAuthProvider.credentialFromTaggedObject((error.customData || {}));\r\n }\r\n static credentialFromTaggedObject({ _tokenResponse: tokenResponse }) {\r\n if (!tokenResponse) {\r\n return null;\r\n }\r\n const { oauthAccessToken, oauthTokenSecret } = tokenResponse;\r\n if (!oauthAccessToken || !oauthTokenSecret) {\r\n return null;\r\n }\r\n try {\r\n return TwitterAuthProvider.credential(oauthAccessToken, oauthTokenSecret);\r\n }\r\n catch (_a) {\r\n return null;\r\n }\r\n }\r\n}\r\n/** Always set to {@link SignInMethod}.TWITTER. */\r\nTwitterAuthProvider.TWITTER_SIGN_IN_METHOD = \"twitter.com\" /* TWITTER */;\r\n/** Always set to {@link ProviderId}.TWITTER. */\r\nTwitterAuthProvider.PROVIDER_ID = \"twitter.com\" /* TWITTER */;\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\nasync function signUp(auth, request) {\r\n return _performSignInRequest(auth, \"POST\" /* POST */, \"/v1/accounts:signUp\" /* SIGN_UP */, _addTidIfNecessary(auth, request));\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\nclass UserCredentialImpl {\r\n constructor(params) {\r\n this.user = params.user;\r\n this.providerId = params.providerId;\r\n this._tokenResponse = params._tokenResponse;\r\n this.operationType = params.operationType;\r\n }\r\n static async _fromIdTokenResponse(auth, operationType, idTokenResponse, isAnonymous = false) {\r\n const user = await UserImpl._fromIdTokenResponse(auth, idTokenResponse, isAnonymous);\r\n const providerId = providerIdForResponse(idTokenResponse);\r\n const userCred = new UserCredentialImpl({\r\n user,\r\n providerId,\r\n _tokenResponse: idTokenResponse,\r\n operationType\r\n });\r\n return userCred;\r\n }\r\n static async _forOperation(user, operationType, response) {\r\n await user._updateTokensIfNecessary(response, /* reload */ true);\r\n const providerId = providerIdForResponse(response);\r\n return new UserCredentialImpl({\r\n user,\r\n providerId,\r\n _tokenResponse: response,\r\n operationType\r\n });\r\n }\r\n}\r\nfunction providerIdForResponse(response) {\r\n if (response.providerId) {\r\n return response.providerId;\r\n }\r\n if ('phoneNumber' in response) {\r\n return \"phone\" /* PHONE */;\r\n }\r\n return null;\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 * Asynchronously signs in as an anonymous user.\r\n *\r\n * @remarks\r\n * If there is already an anonymous user signed in, that user will be returned; otherwise, a\r\n * new anonymous user identity will be created and returned.\r\n *\r\n * @param auth - The {@link Auth} instance.\r\n *\r\n * @public\r\n */\r\nasync function signInAnonymously(auth) {\r\n var _a;\r\n const authInternal = _castAuth(auth);\r\n await authInternal._initializationPromise;\r\n if ((_a = authInternal.currentUser) === null || _a === void 0 ? void 0 : _a.isAnonymous) {\r\n // If an anonymous user is already signed in, no need to sign them in again.\r\n return new UserCredentialImpl({\r\n user: authInternal.currentUser,\r\n providerId: null,\r\n operationType: \"signIn\" /* SIGN_IN */\r\n });\r\n }\r\n const response = await signUp(authInternal, {\r\n returnSecureToken: true\r\n });\r\n const userCredential = await UserCredentialImpl._fromIdTokenResponse(authInternal, \"signIn\" /* SIGN_IN */, response, true);\r\n await authInternal._updateCurrentUser(userCredential.user);\r\n return userCredential;\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\nclass MultiFactorError extends FirebaseError {\r\n constructor(auth, error, operationType, user) {\r\n var _a;\r\n super(error.code, error.message);\r\n this.operationType = operationType;\r\n this.user = user;\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, MultiFactorError.prototype);\r\n this.customData = {\r\n appName: auth.name,\r\n tenantId: (_a = auth.tenantId) !== null && _a !== void 0 ? _a : undefined,\r\n _serverResponse: error.customData._serverResponse,\r\n operationType,\r\n };\r\n }\r\n static _fromErrorAndOperation(auth, error, operationType, user) {\r\n return new MultiFactorError(auth, error, operationType, user);\r\n }\r\n}\r\nfunction _processCredentialSavingMfaContextIfNecessary(auth, operationType, credential, user) {\r\n const idTokenProvider = operationType === \"reauthenticate\" /* REAUTHENTICATE */\r\n ? credential._getReauthenticationResolver(auth)\r\n : credential._getIdTokenResponse(auth);\r\n return idTokenProvider.catch(error => {\r\n if (error.code === `auth/${\"multi-factor-auth-required\" /* MFA_REQUIRED */}`) {\r\n throw MultiFactorError._fromErrorAndOperation(auth, error, operationType, user);\r\n }\r\n throw error;\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 * Takes a set of UserInfo provider data and converts it to a set of names\r\n */\r\nfunction providerDataAsNames(providerData) {\r\n return new Set(providerData\r\n .map(({ providerId }) => providerId)\r\n .filter(pid => !!pid));\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 * Unlinks a provider from a user account.\r\n *\r\n * @param user - The user.\r\n * @param providerId - The provider to unlink.\r\n *\r\n * @public\r\n */\r\nasync function unlink(user, providerId) {\r\n const userInternal = getModularInstance(user);\r\n await _assertLinkedStatus(true, userInternal, providerId);\r\n const { providerUserInfo } = await deleteLinkedAccounts(userInternal.auth, {\r\n idToken: await userInternal.getIdToken(),\r\n deleteProvider: [providerId]\r\n });\r\n const providersLeft = providerDataAsNames(providerUserInfo || []);\r\n userInternal.providerData = userInternal.providerData.filter(pd => providersLeft.has(pd.providerId));\r\n if (!providersLeft.has(\"phone\" /* PHONE */)) {\r\n userInternal.phoneNumber = null;\r\n }\r\n await userInternal.auth._persistUserIfCurrent(userInternal);\r\n return userInternal;\r\n}\r\nasync function _link$1(user, credential, bypassAuthState = false) {\r\n const response = await _logoutIfInvalidated(user, credential._linkToIdToken(user.auth, await user.getIdToken()), bypassAuthState);\r\n return UserCredentialImpl._forOperation(user, \"link\" /* LINK */, response);\r\n}\r\nasync function _assertLinkedStatus(expected, user, provider) {\r\n await _reloadWithoutSaving(user);\r\n const providerIds = providerDataAsNames(user.providerData);\r\n const code = expected === false\r\n ? \"provider-already-linked\" /* PROVIDER_ALREADY_LINKED */\r\n : \"no-such-provider\" /* NO_SUCH_PROVIDER */;\r\n _assert(providerIds.has(provider) === expected, user.auth, code);\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 _reauthenticate(user, credential, bypassAuthState = false) {\r\n var _a;\r\n const { auth } = user;\r\n const operationType = \"reauthenticate\" /* REAUTHENTICATE */;\r\n try {\r\n const response = await _logoutIfInvalidated(user, _processCredentialSavingMfaContextIfNecessary(auth, operationType, credential, user), bypassAuthState);\r\n _assert(response.idToken, auth, \"internal-error\" /* INTERNAL_ERROR */);\r\n const parsed = _parseToken(response.idToken);\r\n _assert(parsed, auth, \"internal-error\" /* INTERNAL_ERROR */);\r\n const { sub: localId } = parsed;\r\n _assert(user.uid === localId, auth, \"user-mismatch\" /* USER_MISMATCH */);\r\n return UserCredentialImpl._forOperation(user, operationType, response);\r\n }\r\n catch (e) {\r\n // Convert user deleted error into user mismatch\r\n if (((_a = e) === null || _a === void 0 ? void 0 : _a.code) === `auth/${\"user-not-found\" /* USER_DELETED */}`) {\r\n _fail(auth, \"user-mismatch\" /* USER_MISMATCH */);\r\n }\r\n throw e;\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\nasync function _signInWithCredential(auth, credential, bypassAuthState = false) {\r\n const operationType = \"signIn\" /* SIGN_IN */;\r\n const response = await _processCredentialSavingMfaContextIfNecessary(auth, operationType, credential);\r\n const userCredential = await UserCredentialImpl._fromIdTokenResponse(auth, operationType, response);\r\n if (!bypassAuthState) {\r\n await auth._updateCurrentUser(userCredential.user);\r\n }\r\n return userCredential;\r\n}\r\n/**\r\n * Asynchronously signs in with the given credentials.\r\n *\r\n * @remarks\r\n * An {@link AuthProvider} can be used to generate the credential.\r\n *\r\n * @param auth - The {@link Auth} instance.\r\n * @param credential - The auth credential.\r\n *\r\n * @public\r\n */\r\nasync function signInWithCredential(auth, credential) {\r\n return _signInWithCredential(_castAuth(auth), credential);\r\n}\r\n/**\r\n * Links the user account with the given credentials.\r\n *\r\n * @remarks\r\n * An {@link AuthProvider} can be used to generate the credential.\r\n *\r\n * @param user - The user.\r\n * @param credential - The auth credential.\r\n *\r\n * @public\r\n */\r\nasync function linkWithCredential(user, credential) {\r\n const userInternal = getModularInstance(user);\r\n await _assertLinkedStatus(false, userInternal, credential.providerId);\r\n return _link$1(userInternal, credential);\r\n}\r\n/**\r\n * Re-authenticates a user using a fresh credential.\r\n *\r\n * @remarks\r\n * Use before operations such as {@link updatePassword} that require tokens from recent sign-in\r\n * attempts. This method can be used to recover from a `CREDENTIAL_TOO_OLD_LOGIN_AGAIN` error.\r\n *\r\n * @param user - The user.\r\n * @param credential - The auth credential.\r\n *\r\n * @public\r\n */\r\nasync function reauthenticateWithCredential(user, credential) {\r\n return _reauthenticate(getModularInstance(user), credential);\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\nasync function signInWithCustomToken$1(auth, request) {\r\n return _performSignInRequest(auth, \"POST\" /* POST */, \"/v1/accounts:signInWithCustomToken\" /* SIGN_IN_WITH_CUSTOM_TOKEN */, _addTidIfNecessary(auth, request));\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 * Asynchronously signs in using a custom token.\r\n *\r\n * @remarks\r\n * Custom tokens are used to integrate Firebase Auth with existing auth systems, and must\r\n * be generated by an auth backend using the\r\n * {@link https://firebase.google.com/docs/reference/admin/node/admin.auth.Auth#createcustomtoken | createCustomToken}\r\n * method in the {@link https://firebase.google.com/docs/auth/admin | Admin SDK} .\r\n *\r\n * Fails with an error if the token is invalid, expired, or not accepted by the Firebase Auth service.\r\n *\r\n * @param auth - The {@link Auth} instance.\r\n * @param customToken - The custom token to sign in with.\r\n *\r\n * @public\r\n */\r\nasync function signInWithCustomToken(auth, customToken) {\r\n const authInternal = _castAuth(auth);\r\n const response = await signInWithCustomToken$1(authInternal, {\r\n token: customToken,\r\n returnSecureToken: true\r\n });\r\n const cred = await UserCredentialImpl._fromIdTokenResponse(authInternal, \"signIn\" /* SIGN_IN */, response);\r\n await authInternal._updateCurrentUser(cred.user);\r\n return cred;\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\nclass MultiFactorInfoImpl {\r\n constructor(factorId, response) {\r\n this.factorId = factorId;\r\n this.uid = response.mfaEnrollmentId;\r\n this.enrollmentTime = new Date(response.enrolledAt).toUTCString();\r\n this.displayName = response.displayName;\r\n }\r\n static _fromServerResponse(auth, enrollment) {\r\n if ('phoneInfo' in enrollment) {\r\n return PhoneMultiFactorInfoImpl._fromServerResponse(auth, enrollment);\r\n }\r\n return _fail(auth, \"internal-error\" /* INTERNAL_ERROR */);\r\n }\r\n}\r\nclass PhoneMultiFactorInfoImpl extends MultiFactorInfoImpl {\r\n constructor(response) {\r\n super(\"phone\" /* PHONE */, response);\r\n this.phoneNumber = response.phoneInfo;\r\n }\r\n static _fromServerResponse(_auth, enrollment) {\r\n return new PhoneMultiFactorInfoImpl(enrollment);\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 _setActionCodeSettingsOnRequest(auth, request, actionCodeSettings) {\r\n var _a;\r\n _assert(((_a = actionCodeSettings.url) === null || _a === void 0 ? void 0 : _a.length) > 0, auth, \"invalid-continue-uri\" /* INVALID_CONTINUE_URI */);\r\n _assert(typeof actionCodeSettings.dynamicLinkDomain === 'undefined' ||\r\n actionCodeSettings.dynamicLinkDomain.length > 0, auth, \"invalid-dynamic-link-domain\" /* INVALID_DYNAMIC_LINK_DOMAIN */);\r\n request.continueUrl = actionCodeSettings.url;\r\n request.dynamicLinkDomain = actionCodeSettings.dynamicLinkDomain;\r\n request.canHandleCodeInApp = actionCodeSettings.handleCodeInApp;\r\n if (actionCodeSettings.iOS) {\r\n _assert(actionCodeSettings.iOS.bundleId.length > 0, auth, \"missing-ios-bundle-id\" /* MISSING_IOS_BUNDLE_ID */);\r\n request.iOSBundleId = actionCodeSettings.iOS.bundleId;\r\n }\r\n if (actionCodeSettings.android) {\r\n _assert(actionCodeSettings.android.packageName.length > 0, auth, \"missing-android-pkg-name\" /* MISSING_ANDROID_PACKAGE_NAME */);\r\n request.androidInstallApp = actionCodeSettings.android.installApp;\r\n request.androidMinimumVersionCode =\r\n actionCodeSettings.android.minimumVersion;\r\n request.androidPackageName = actionCodeSettings.android.packageName;\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 * Sends a password reset email to the given email address.\r\n *\r\n * @remarks\r\n * To complete the password reset, call {@link confirmPasswordReset} with the code supplied in\r\n * the email sent to the user, along with the new password specified by the user.\r\n *\r\n * @example\r\n * ```javascript\r\n * const actionCodeSettings = {\r\n * url: 'https://www.example.com/?email=user@example.com',\r\n * iOS: {\r\n * bundleId: 'com.example.ios'\r\n * },\r\n * android: {\r\n * packageName: 'com.example.android',\r\n * installApp: true,\r\n * minimumVersion: '12'\r\n * },\r\n * handleCodeInApp: true\r\n * };\r\n * await sendPasswordResetEmail(auth, 'user@example.com', actionCodeSettings);\r\n * // Obtain code from user.\r\n * await confirmPasswordReset('user@example.com', code);\r\n * ```\r\n *\r\n * @param auth - The {@link Auth} instance.\r\n * @param email - The user's email address.\r\n * @param actionCodeSettings - The {@link ActionCodeSettings}.\r\n *\r\n * @public\r\n */\r\nasync function sendPasswordResetEmail(auth, email, actionCodeSettings) {\r\n const authModular = getModularInstance(auth);\r\n const request = {\r\n requestType: \"PASSWORD_RESET\" /* PASSWORD_RESET */,\r\n email\r\n };\r\n if (actionCodeSettings) {\r\n _setActionCodeSettingsOnRequest(authModular, request, actionCodeSettings);\r\n }\r\n await sendPasswordResetEmail$1(authModular, request);\r\n}\r\n/**\r\n * Completes the password reset process, given a confirmation code and new password.\r\n *\r\n * @param auth - The {@link Auth} instance.\r\n * @param oobCode - A confirmation code sent to the user.\r\n * @param newPassword - The new password.\r\n *\r\n * @public\r\n */\r\nasync function confirmPasswordReset(auth, oobCode, newPassword) {\r\n await resetPassword(getModularInstance(auth), {\r\n oobCode,\r\n newPassword\r\n });\r\n // Do not return the email.\r\n}\r\n/**\r\n * Applies a verification code sent to the user by email or other out-of-band mechanism.\r\n *\r\n * @param auth - The {@link Auth} instance.\r\n * @param oobCode - A verification code sent to the user.\r\n *\r\n * @public\r\n */\r\nasync function applyActionCode(auth, oobCode) {\r\n await applyActionCode$1(getModularInstance(auth), { oobCode });\r\n}\r\n/**\r\n * Checks a verification code sent to the user by email or other out-of-band mechanism.\r\n *\r\n * @returns metadata about the code.\r\n *\r\n * @param auth - The {@link Auth} instance.\r\n * @param oobCode - A verification code sent to the user.\r\n *\r\n * @public\r\n */\r\nasync function checkActionCode(auth, oobCode) {\r\n const authModular = getModularInstance(auth);\r\n const response = await resetPassword(authModular, { oobCode });\r\n // Email could be empty only if the request type is EMAIL_SIGNIN or\r\n // VERIFY_AND_CHANGE_EMAIL.\r\n // New email should not be empty if the request type is\r\n // VERIFY_AND_CHANGE_EMAIL.\r\n // Multi-factor info could not be empty if the request type is\r\n // REVERT_SECOND_FACTOR_ADDITION.\r\n const operation = response.requestType;\r\n _assert(operation, authModular, \"internal-error\" /* INTERNAL_ERROR */);\r\n switch (operation) {\r\n case \"EMAIL_SIGNIN\" /* EMAIL_SIGNIN */:\r\n break;\r\n case \"VERIFY_AND_CHANGE_EMAIL\" /* VERIFY_AND_CHANGE_EMAIL */:\r\n _assert(response.newEmail, authModular, \"internal-error\" /* INTERNAL_ERROR */);\r\n break;\r\n case \"REVERT_SECOND_FACTOR_ADDITION\" /* REVERT_SECOND_FACTOR_ADDITION */:\r\n _assert(response.mfaInfo, authModular, \"internal-error\" /* INTERNAL_ERROR */);\r\n // fall through\r\n default:\r\n _assert(response.email, authModular, \"internal-error\" /* INTERNAL_ERROR */);\r\n }\r\n // The multi-factor info for revert second factor addition\r\n let multiFactorInfo = null;\r\n if (response.mfaInfo) {\r\n multiFactorInfo = MultiFactorInfoImpl._fromServerResponse(_castAuth(authModular), response.mfaInfo);\r\n }\r\n return {\r\n data: {\r\n email: (response.requestType === \"VERIFY_AND_CHANGE_EMAIL\" /* VERIFY_AND_CHANGE_EMAIL */\r\n ? response.newEmail\r\n : response.email) || null,\r\n previousEmail: (response.requestType === \"VERIFY_AND_CHANGE_EMAIL\" /* VERIFY_AND_CHANGE_EMAIL */\r\n ? response.email\r\n : response.newEmail) || null,\r\n multiFactorInfo\r\n },\r\n operation\r\n };\r\n}\r\n/**\r\n * Checks a password reset code sent to the user by email or other out-of-band mechanism.\r\n *\r\n * @returns the user's email address if valid.\r\n *\r\n * @param auth - The {@link Auth} instance.\r\n * @param code - A verification code sent to the user.\r\n *\r\n * @public\r\n */\r\nasync function verifyPasswordResetCode(auth, code) {\r\n const { data } = await checkActionCode(getModularInstance(auth), code);\r\n // Email should always be present since a code was sent to it\r\n return data.email;\r\n}\r\n/**\r\n * Creates a new user account associated with the specified email address and password.\r\n *\r\n * @remarks\r\n * On successful creation of the user account, this user will also be signed in to your application.\r\n *\r\n * User account creation can fail if the account already exists or the password is invalid.\r\n *\r\n * Note: The email address acts as a unique identifier for the user and enables an email-based\r\n * password reset. This function will create a new user account and set the initial user password.\r\n *\r\n * @param auth - The {@link Auth} instance.\r\n * @param email - The user's email address.\r\n * @param password - The user's chosen password.\r\n *\r\n * @public\r\n */\r\nasync function createUserWithEmailAndPassword(auth, email, password) {\r\n const authInternal = _castAuth(auth);\r\n const response = await signUp(authInternal, {\r\n returnSecureToken: true,\r\n email,\r\n password\r\n });\r\n const userCredential = await UserCredentialImpl._fromIdTokenResponse(authInternal, \"signIn\" /* SIGN_IN */, response);\r\n await authInternal._updateCurrentUser(userCredential.user);\r\n return userCredential;\r\n}\r\n/**\r\n * Asynchronously signs in using an email and password.\r\n *\r\n * @remarks\r\n * Fails with an error if the email address and password do not match.\r\n *\r\n * Note: The user's password is NOT the password used to access the user's email account. The\r\n * email address serves as a unique identifier for the user, and the password is used to access\r\n * the user's account in your Firebase project. See also: {@link createUserWithEmailAndPassword}.\r\n *\r\n * @param auth - The {@link Auth} instance.\r\n * @param email - The users email address.\r\n * @param password - The users password.\r\n *\r\n * @public\r\n */\r\nfunction signInWithEmailAndPassword(auth, email, password) {\r\n return signInWithCredential(getModularInstance(auth), EmailAuthProvider.credential(email, password));\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 * Sends a sign-in email link to the user with the specified email.\r\n *\r\n * @remarks\r\n * The sign-in operation has to always be completed in the app unlike other out of band email\r\n * actions (password reset and email verifications). This is because, at the end of the flow,\r\n * the user is expected to be signed in and their Auth state persisted within the app.\r\n *\r\n * To complete sign in with the email link, call {@link signInWithEmailLink} with the email\r\n * address and the email link supplied in the email sent to the user.\r\n *\r\n * @example\r\n * ```javascript\r\n * const actionCodeSettings = {\r\n * url: 'https://www.example.com/?email=user@example.com',\r\n * iOS: {\r\n * bundleId: 'com.example.ios'\r\n * },\r\n * android: {\r\n * packageName: 'com.example.android',\r\n * installApp: true,\r\n * minimumVersion: '12'\r\n * },\r\n * handleCodeInApp: true\r\n * };\r\n * await sendSignInLinkToEmail(auth, 'user@example.com', actionCodeSettings);\r\n * // Obtain emailLink from the user.\r\n * if(isSignInWithEmailLink(auth, emailLink)) {\r\n * await signInWithEmailLink(auth, 'user@example.com', emailLink);\r\n * }\r\n * ```\r\n *\r\n * @param authInternal - The {@link Auth} instance.\r\n * @param email - The user's email address.\r\n * @param actionCodeSettings - The {@link ActionCodeSettings}.\r\n *\r\n * @public\r\n */\r\nasync function sendSignInLinkToEmail(auth, email, actionCodeSettings) {\r\n const authModular = getModularInstance(auth);\r\n const request = {\r\n requestType: \"EMAIL_SIGNIN\" /* EMAIL_SIGNIN */,\r\n email\r\n };\r\n _assert(actionCodeSettings.handleCodeInApp, authModular, \"argument-error\" /* ARGUMENT_ERROR */);\r\n if (actionCodeSettings) {\r\n _setActionCodeSettingsOnRequest(authModular, request, actionCodeSettings);\r\n }\r\n await sendSignInLinkToEmail$1(authModular, request);\r\n}\r\n/**\r\n * Checks if an incoming link is a sign-in with email link suitable for {@link signInWithEmailLink}.\r\n *\r\n * @param auth - The {@link Auth} instance.\r\n * @param emailLink - The link sent to the user's email address.\r\n *\r\n * @public\r\n */\r\nfunction isSignInWithEmailLink(auth, emailLink) {\r\n const actionCodeUrl = ActionCodeURL.parseLink(emailLink);\r\n return (actionCodeUrl === null || actionCodeUrl === void 0 ? void 0 : actionCodeUrl.operation) === \"EMAIL_SIGNIN\" /* EMAIL_SIGNIN */;\r\n}\r\n/**\r\n * Asynchronously signs in using an email and sign-in email link.\r\n *\r\n * @remarks\r\n * If no link is passed, the link is inferred from the current URL.\r\n *\r\n * Fails with an error if the email address is invalid or OTP in email link expires.\r\n *\r\n * Note: Confirm the link is a sign-in email link before calling this method firebase.auth.Auth.isSignInWithEmailLink.\r\n *\r\n * @example\r\n * ```javascript\r\n * const actionCodeSettings = {\r\n * url: 'https://www.example.com/?email=user@example.com',\r\n * iOS: {\r\n * bundleId: 'com.example.ios'\r\n * },\r\n * android: {\r\n * packageName: 'com.example.android',\r\n * installApp: true,\r\n * minimumVersion: '12'\r\n * },\r\n * handleCodeInApp: true\r\n * };\r\n * await sendSignInLinkToEmail(auth, 'user@example.com', actionCodeSettings);\r\n * // Obtain emailLink from the user.\r\n * if(isSignInWithEmailLink(auth, emailLink)) {\r\n * await signInWithEmailLink(auth, 'user@example.com', emailLink);\r\n * }\r\n * ```\r\n *\r\n * @param auth - The {@link Auth} instance.\r\n * @param email - The user's email address.\r\n * @param emailLink - The link sent to the user's email address.\r\n *\r\n * @public\r\n */\r\nasync function signInWithEmailLink(auth, email, emailLink) {\r\n const authModular = getModularInstance(auth);\r\n const credential = EmailAuthProvider.credentialWithLink(email, emailLink || _getCurrentUrl());\r\n // Check if the tenant ID in the email link matches the tenant ID on Auth\r\n // instance.\r\n _assert(credential._tenantId === (authModular.tenantId || null), authModular, \"tenant-id-mismatch\" /* TENANT_ID_MISMATCH */);\r\n return signInWithCredential(authModular, credential);\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\nasync function createAuthUri(auth, request) {\r\n return _performApiRequest(auth, \"POST\" /* POST */, \"/v1/accounts:createAuthUri\" /* CREATE_AUTH_URI */, _addTidIfNecessary(auth, request));\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 * Gets the list of possible sign in methods for the given email address.\r\n *\r\n * @remarks\r\n * This is useful to differentiate methods of sign-in for the same provider, eg.\r\n * {@link EmailAuthProvider} which has 2 methods of sign-in,\r\n * {@link SignInMethod}.EMAIL_PASSWORD and\r\n * {@link SignInMethod}.EMAIL_LINK.\r\n *\r\n * @param auth - The {@link Auth} instance.\r\n * @param email - The user's email address.\r\n *\r\n * @public\r\n */\r\nasync function fetchSignInMethodsForEmail(auth, email) {\r\n // createAuthUri returns an error if continue URI is not http or https.\r\n // For environments like Cordova, Chrome extensions, native frameworks, file\r\n // systems, etc, use http://localhost as continue URL.\r\n const continueUri = _isHttpOrHttps() ? _getCurrentUrl() : 'http://localhost';\r\n const request = {\r\n identifier: email,\r\n continueUri\r\n };\r\n const { signinMethods } = await createAuthUri(getModularInstance(auth), request);\r\n return signinMethods || [];\r\n}\r\n/**\r\n * Sends a verification email to a user.\r\n *\r\n * @remarks\r\n * The verification process is completed by calling {@link applyActionCode}.\r\n *\r\n * @example\r\n * ```javascript\r\n * const actionCodeSettings = {\r\n * url: 'https://www.example.com/?email=user@example.com',\r\n * iOS: {\r\n * bundleId: 'com.example.ios'\r\n * },\r\n * android: {\r\n * packageName: 'com.example.android',\r\n * installApp: true,\r\n * minimumVersion: '12'\r\n * },\r\n * handleCodeInApp: true\r\n * };\r\n * await sendEmailVerification(user, actionCodeSettings);\r\n * // Obtain code from the user.\r\n * await applyActionCode(auth, code);\r\n * ```\r\n *\r\n * @param user - The user.\r\n * @param actionCodeSettings - The {@link ActionCodeSettings}.\r\n *\r\n * @public\r\n */\r\nasync function sendEmailVerification(user, actionCodeSettings) {\r\n const userInternal = getModularInstance(user);\r\n const idToken = await user.getIdToken();\r\n const request = {\r\n requestType: \"VERIFY_EMAIL\" /* VERIFY_EMAIL */,\r\n idToken\r\n };\r\n if (actionCodeSettings) {\r\n _setActionCodeSettingsOnRequest(userInternal.auth, request, actionCodeSettings);\r\n }\r\n const { email } = await sendEmailVerification$1(userInternal.auth, request);\r\n if (email !== user.email) {\r\n await user.reload();\r\n }\r\n}\r\n/**\r\n * Sends a verification email to a new email address.\r\n *\r\n * @remarks\r\n * The user's email will be updated to the new one after being verified.\r\n *\r\n * If you have a custom email action handler, you can complete the verification process by calling\r\n * {@link applyActionCode}.\r\n *\r\n * @example\r\n * ```javascript\r\n * const actionCodeSettings = {\r\n * url: 'https://www.example.com/?email=user@example.com',\r\n * iOS: {\r\n * bundleId: 'com.example.ios'\r\n * },\r\n * android: {\r\n * packageName: 'com.example.android',\r\n * installApp: true,\r\n * minimumVersion: '12'\r\n * },\r\n * handleCodeInApp: true\r\n * };\r\n * await verifyBeforeUpdateEmail(user, 'newemail@example.com', actionCodeSettings);\r\n * // Obtain code from the user.\r\n * await applyActionCode(auth, code);\r\n * ```\r\n *\r\n * @param user - The user.\r\n * @param newEmail - The new email address to be verified before update.\r\n * @param actionCodeSettings - The {@link ActionCodeSettings}.\r\n *\r\n * @public\r\n */\r\nasync function verifyBeforeUpdateEmail(user, newEmail, actionCodeSettings) {\r\n const userInternal = getModularInstance(user);\r\n const idToken = await user.getIdToken();\r\n const request = {\r\n requestType: \"VERIFY_AND_CHANGE_EMAIL\" /* VERIFY_AND_CHANGE_EMAIL */,\r\n idToken,\r\n newEmail\r\n };\r\n if (actionCodeSettings) {\r\n _setActionCodeSettingsOnRequest(userInternal.auth, request, actionCodeSettings);\r\n }\r\n const { email } = await verifyAndChangeEmail(userInternal.auth, request);\r\n if (email !== user.email) {\r\n // If the local copy of the email on user is outdated, reload the\r\n // user.\r\n await user.reload();\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\nasync function updateProfile$1(auth, request) {\r\n return _performApiRequest(auth, \"POST\" /* POST */, \"/v1/accounts:update\" /* SET_ACCOUNT_INFO */, request);\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 * Updates a user's profile data.\r\n *\r\n * @param user - The user.\r\n * @param profile - The profile's `displayName` and `photoURL` to update.\r\n *\r\n * @public\r\n */\r\nasync function updateProfile(user, { displayName, photoURL: photoUrl }) {\r\n if (displayName === undefined && photoUrl === undefined) {\r\n return;\r\n }\r\n const userInternal = getModularInstance(user);\r\n const idToken = await userInternal.getIdToken();\r\n const profileRequest = {\r\n idToken,\r\n displayName,\r\n photoUrl,\r\n returnSecureToken: true\r\n };\r\n const response = await _logoutIfInvalidated(userInternal, updateProfile$1(userInternal.auth, profileRequest));\r\n userInternal.displayName = response.displayName || null;\r\n userInternal.photoURL = response.photoUrl || null;\r\n // Update the password provider as well\r\n const passwordProvider = userInternal.providerData.find(({ providerId }) => providerId === \"password\" /* PASSWORD */);\r\n if (passwordProvider) {\r\n passwordProvider.displayName = userInternal.displayName;\r\n passwordProvider.photoURL = userInternal.photoURL;\r\n }\r\n await userInternal._updateTokensIfNecessary(response);\r\n}\r\n/**\r\n * Updates the user's email address.\r\n *\r\n * @remarks\r\n * An email will be sent to the original email address (if it was set) that allows to revoke the\r\n * email address change, in order to protect them from account hijacking.\r\n *\r\n * Important: this is a security sensitive operation that requires the user to have recently signed\r\n * in. If this requirement isn't met, ask the user to authenticate again and then call\r\n * {@link reauthenticateWithCredential}.\r\n *\r\n * @param user - The user.\r\n * @param newEmail - The new email address.\r\n *\r\n * @public\r\n */\r\nfunction updateEmail(user, newEmail) {\r\n return updateEmailOrPassword(getModularInstance(user), newEmail, null);\r\n}\r\n/**\r\n * Updates the user's password.\r\n *\r\n * @remarks\r\n * Important: this is a security sensitive operation that requires the user to have recently signed\r\n * in. If this requirement isn't met, ask the user to authenticate again and then call\r\n * {@link reauthenticateWithCredential}.\r\n *\r\n * @param user - The user.\r\n * @param newPassword - The new password.\r\n *\r\n * @public\r\n */\r\nfunction updatePassword(user, newPassword) {\r\n return updateEmailOrPassword(getModularInstance(user), null, newPassword);\r\n}\r\nasync function updateEmailOrPassword(user, email, password) {\r\n const { auth } = user;\r\n const idToken = await user.getIdToken();\r\n const request = {\r\n idToken,\r\n returnSecureToken: true\r\n };\r\n if (email) {\r\n request.email = email;\r\n }\r\n if (password) {\r\n request.password = password;\r\n }\r\n const response = await _logoutIfInvalidated(user, updateEmailPassword(auth, request));\r\n await user._updateTokensIfNecessary(response, /* reload */ true);\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 * Parse the `AdditionalUserInfo` from the ID token response.\r\n *\r\n */\r\nfunction _fromIdTokenResponse(idTokenResponse) {\r\n var _a, _b;\r\n if (!idTokenResponse) {\r\n return null;\r\n }\r\n const { providerId } = idTokenResponse;\r\n const profile = idTokenResponse.rawUserInfo\r\n ? JSON.parse(idTokenResponse.rawUserInfo)\r\n : {};\r\n const isNewUser = idTokenResponse.isNewUser ||\r\n idTokenResponse.kind === \"identitytoolkit#SignupNewUserResponse\" /* SignupNewUser */;\r\n if (!providerId && (idTokenResponse === null || idTokenResponse === void 0 ? void 0 : idTokenResponse.idToken)) {\r\n const signInProvider = (_b = (_a = _parseToken(idTokenResponse.idToken)) === null || _a === void 0 ? void 0 : _a.firebase) === null || _b === void 0 ? void 0 : _b['sign_in_provider'];\r\n if (signInProvider) {\r\n const filteredProviderId = signInProvider !== \"anonymous\" /* ANONYMOUS */ &&\r\n signInProvider !== \"custom\" /* CUSTOM */\r\n ? signInProvider\r\n : null;\r\n // Uses generic class in accordance with the legacy SDK.\r\n return new GenericAdditionalUserInfo(isNewUser, filteredProviderId);\r\n }\r\n }\r\n if (!providerId) {\r\n return null;\r\n }\r\n switch (providerId) {\r\n case \"facebook.com\" /* FACEBOOK */:\r\n return new FacebookAdditionalUserInfo(isNewUser, profile);\r\n case \"github.com\" /* GITHUB */:\r\n return new GithubAdditionalUserInfo(isNewUser, profile);\r\n case \"google.com\" /* GOOGLE */:\r\n return new GoogleAdditionalUserInfo(isNewUser, profile);\r\n case \"twitter.com\" /* TWITTER */:\r\n return new TwitterAdditionalUserInfo(isNewUser, profile, idTokenResponse.screenName || null);\r\n case \"custom\" /* CUSTOM */:\r\n case \"anonymous\" /* ANONYMOUS */:\r\n return new GenericAdditionalUserInfo(isNewUser, null);\r\n default:\r\n return new GenericAdditionalUserInfo(isNewUser, providerId, profile);\r\n }\r\n}\r\nclass GenericAdditionalUserInfo {\r\n constructor(isNewUser, providerId, profile = {}) {\r\n this.isNewUser = isNewUser;\r\n this.providerId = providerId;\r\n this.profile = profile;\r\n }\r\n}\r\nclass FederatedAdditionalUserInfoWithUsername extends GenericAdditionalUserInfo {\r\n constructor(isNewUser, providerId, profile, username) {\r\n super(isNewUser, providerId, profile);\r\n this.username = username;\r\n }\r\n}\r\nclass FacebookAdditionalUserInfo extends GenericAdditionalUserInfo {\r\n constructor(isNewUser, profile) {\r\n super(isNewUser, \"facebook.com\" /* FACEBOOK */, profile);\r\n }\r\n}\r\nclass GithubAdditionalUserInfo extends FederatedAdditionalUserInfoWithUsername {\r\n constructor(isNewUser, profile) {\r\n super(isNewUser, \"github.com\" /* GITHUB */, profile, typeof (profile === null || profile === void 0 ? void 0 : profile.login) === 'string' ? profile === null || profile === void 0 ? void 0 : profile.login : null);\r\n }\r\n}\r\nclass GoogleAdditionalUserInfo extends GenericAdditionalUserInfo {\r\n constructor(isNewUser, profile) {\r\n super(isNewUser, \"google.com\" /* GOOGLE */, profile);\r\n }\r\n}\r\nclass TwitterAdditionalUserInfo extends FederatedAdditionalUserInfoWithUsername {\r\n constructor(isNewUser, profile, screenName) {\r\n super(isNewUser, \"twitter.com\" /* TWITTER */, profile, screenName);\r\n }\r\n}\r\n/**\r\n * Extracts provider specific {@link AdditionalUserInfo} for the given credential.\r\n *\r\n * @param userCredential - The user credential.\r\n *\r\n * @public\r\n */\r\nfunction getAdditionalUserInfo(userCredential) {\r\n const { user, _tokenResponse } = userCredential;\r\n if (user.isAnonymous && !_tokenResponse) {\r\n // Handle the special case where signInAnonymously() gets called twice.\r\n // No network call is made so there's nothing to actually fill this in\r\n return {\r\n providerId: null,\r\n isNewUser: false,\r\n profile: null\r\n };\r\n }\r\n return _fromIdTokenResponse(_tokenResponse);\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// Non-optional auth methods.\r\n/**\r\n * Changes the type of persistence on the {@link Auth} instance for the currently saved\r\n * `Auth` session and applies this type of persistence for future sign-in requests, including\r\n * sign-in with redirect requests.\r\n *\r\n * @remarks\r\n * This makes it easy for a user signing in to specify whether their session should be\r\n * remembered or not. It also makes it easier to never persist the `Auth` state for applications\r\n * that are shared by other users or have sensitive data.\r\n *\r\n * @example\r\n * ```javascript\r\n * setPersistence(auth, browserSessionPersistence);\r\n * ```\r\n *\r\n * @param auth - The {@link Auth} instance.\r\n * @param persistence - The {@link Persistence} to use.\r\n * @returns A `Promise` that resolves once the persistence change has completed\r\n *\r\n * @public\r\n */\r\nfunction setPersistence(auth, persistence) {\r\n return getModularInstance(auth).setPersistence(persistence);\r\n}\r\n/**\r\n * Adds an observer for changes to the signed-in user's ID token.\r\n *\r\n * @remarks\r\n * This includes sign-in, sign-out, and token refresh events.\r\n *\r\n * @param auth - The {@link Auth} instance.\r\n * @param nextOrObserver - callback triggered on change.\r\n * @param error - Deprecated. This callback is never triggered. Errors\r\n * on signing in/out can be caught in promises returned from\r\n * sign-in/sign-out functions.\r\n * @param completed - Deprecated. This callback is never triggered.\r\n *\r\n * @public\r\n */\r\nfunction onIdTokenChanged(auth, nextOrObserver, error, completed) {\r\n return getModularInstance(auth).onIdTokenChanged(nextOrObserver, error, completed);\r\n}\r\n/**\r\n * Adds a blocking callback that runs before an auth state change\r\n * sets a new user.\r\n *\r\n * @param auth - The {@link Auth} instance.\r\n * @param callback - callback triggered before new user value is set.\r\n * If this throws, it blocks the user from being set.\r\n * @param onAbort - callback triggered if a later `beforeAuthStateChanged()`\r\n * callback throws, allowing you to undo any side effects.\r\n */\r\nfunction beforeAuthStateChanged(auth, callback, onAbort) {\r\n return getModularInstance(auth).beforeAuthStateChanged(callback, onAbort);\r\n}\r\n/**\r\n * Adds an observer for changes to the user's sign-in state.\r\n *\r\n * @remarks\r\n * To keep the old behavior, see {@link onIdTokenChanged}.\r\n *\r\n * @param auth - The {@link Auth} instance.\r\n * @param nextOrObserver - callback triggered on change.\r\n * @param error - Deprecated. This callback is never triggered. Errors\r\n * on signing in/out can be caught in promises returned from\r\n * sign-in/sign-out functions.\r\n * @param completed - Deprecated. This callback is never triggered.\r\n *\r\n * @public\r\n */\r\nfunction onAuthStateChanged(auth, nextOrObserver, error, completed) {\r\n return getModularInstance(auth).onAuthStateChanged(nextOrObserver, error, completed);\r\n}\r\n/**\r\n * Sets the current language to the default device/browser preference.\r\n *\r\n * @param auth - The {@link Auth} instance.\r\n *\r\n * @public\r\n */\r\nfunction useDeviceLanguage(auth) {\r\n getModularInstance(auth).useDeviceLanguage();\r\n}\r\n/**\r\n * Asynchronously sets the provided user as {@link Auth.currentUser} on the\r\n * {@link Auth} instance.\r\n *\r\n * @remarks\r\n * A new instance copy of the user provided will be made and set as currentUser.\r\n *\r\n * This will trigger {@link onAuthStateChanged} and {@link onIdTokenChanged} listeners\r\n * like other sign in methods.\r\n *\r\n * The operation fails with an error if the user to be updated belongs to a different Firebase\r\n * project.\r\n *\r\n * @param auth - The {@link Auth} instance.\r\n * @param user - The new {@link User}.\r\n *\r\n * @public\r\n */\r\nfunction updateCurrentUser(auth, user) {\r\n return getModularInstance(auth).updateCurrentUser(user);\r\n}\r\n/**\r\n * Signs out the current user.\r\n *\r\n * @param auth - The {@link Auth} instance.\r\n *\r\n * @public\r\n */\r\nfunction signOut(auth) {\r\n return getModularInstance(auth).signOut();\r\n}\r\n/**\r\n * Deletes and signs out the user.\r\n *\r\n * @remarks\r\n * Important: this is a security-sensitive operation that requires the user to have recently\r\n * signed in. If this requirement isn't met, ask the user to authenticate again and then call\r\n * {@link reauthenticateWithCredential}.\r\n *\r\n * @param user - The user.\r\n *\r\n * @public\r\n */\r\nasync function deleteUser(user) {\r\n return getModularInstance(user).delete();\r\n}\n\nclass MultiFactorSessionImpl {\r\n constructor(type, credential) {\r\n this.type = type;\r\n this.credential = credential;\r\n }\r\n static _fromIdtoken(idToken) {\r\n return new MultiFactorSessionImpl(\"enroll\" /* ENROLL */, idToken);\r\n }\r\n static _fromMfaPendingCredential(mfaPendingCredential) {\r\n return new MultiFactorSessionImpl(\"signin\" /* SIGN_IN */, mfaPendingCredential);\r\n }\r\n toJSON() {\r\n const key = this.type === \"enroll\" /* ENROLL */\r\n ? 'idToken'\r\n : 'pendingCredential';\r\n return {\r\n multiFactorSession: {\r\n [key]: this.credential\r\n }\r\n };\r\n }\r\n static fromJSON(obj) {\r\n var _a, _b;\r\n if (obj === null || obj === void 0 ? void 0 : obj.multiFactorSession) {\r\n if ((_a = obj.multiFactorSession) === null || _a === void 0 ? void 0 : _a.pendingCredential) {\r\n return MultiFactorSessionImpl._fromMfaPendingCredential(obj.multiFactorSession.pendingCredential);\r\n }\r\n else if ((_b = obj.multiFactorSession) === null || _b === void 0 ? void 0 : _b.idToken) {\r\n return MultiFactorSessionImpl._fromIdtoken(obj.multiFactorSession.idToken);\r\n }\r\n }\r\n return null;\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\nclass MultiFactorResolverImpl {\r\n constructor(session, hints, signInResolver) {\r\n this.session = session;\r\n this.hints = hints;\r\n this.signInResolver = signInResolver;\r\n }\r\n /** @internal */\r\n static _fromError(authExtern, error) {\r\n const auth = _castAuth(authExtern);\r\n const serverResponse = error.customData._serverResponse;\r\n const hints = (serverResponse.mfaInfo || []).map(enrollment => MultiFactorInfoImpl._fromServerResponse(auth, enrollment));\r\n _assert(serverResponse.mfaPendingCredential, auth, \"internal-error\" /* INTERNAL_ERROR */);\r\n const session = MultiFactorSessionImpl._fromMfaPendingCredential(serverResponse.mfaPendingCredential);\r\n return new MultiFactorResolverImpl(session, hints, async (assertion) => {\r\n const mfaResponse = await assertion._process(auth, session);\r\n // Clear out the unneeded fields from the old login response\r\n delete serverResponse.mfaInfo;\r\n delete serverResponse.mfaPendingCredential;\r\n // Use in the new token & refresh token in the old response\r\n const idTokenResponse = Object.assign(Object.assign({}, serverResponse), { idToken: mfaResponse.idToken, refreshToken: mfaResponse.refreshToken });\r\n // TODO: we should collapse this switch statement into UserCredentialImpl._forOperation and have it support the SIGN_IN case\r\n switch (error.operationType) {\r\n case \"signIn\" /* SIGN_IN */:\r\n const userCredential = await UserCredentialImpl._fromIdTokenResponse(auth, error.operationType, idTokenResponse);\r\n await auth._updateCurrentUser(userCredential.user);\r\n return userCredential;\r\n case \"reauthenticate\" /* REAUTHENTICATE */:\r\n _assert(error.user, auth, \"internal-error\" /* INTERNAL_ERROR */);\r\n return UserCredentialImpl._forOperation(error.user, error.operationType, idTokenResponse);\r\n default:\r\n _fail(auth, \"internal-error\" /* INTERNAL_ERROR */);\r\n }\r\n });\r\n }\r\n async resolveSignIn(assertionExtern) {\r\n const assertion = assertionExtern;\r\n return this.signInResolver(assertion);\r\n }\r\n}\r\n/**\r\n * Provides a {@link MultiFactorResolver} suitable for completion of a\r\n * multi-factor flow.\r\n *\r\n * @param auth - The {@link Auth} instance.\r\n * @param error - The {@link MultiFactorError} raised during a sign-in, or\r\n * reauthentication operation.\r\n *\r\n * @public\r\n */\r\nfunction getMultiFactorResolver(auth, error) {\r\n var _a;\r\n const authModular = getModularInstance(auth);\r\n const errorInternal = error;\r\n _assert(error.customData.operationType, authModular, \"argument-error\" /* ARGUMENT_ERROR */);\r\n _assert((_a = errorInternal.customData._serverResponse) === null || _a === void 0 ? void 0 : _a.mfaPendingCredential, authModular, \"argument-error\" /* ARGUMENT_ERROR */);\r\n return MultiFactorResolverImpl._fromError(authModular, errorInternal);\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 startEnrollPhoneMfa(auth, request) {\r\n return _performApiRequest(auth, \"POST\" /* POST */, \"/v2/accounts/mfaEnrollment:start\" /* START_PHONE_MFA_ENROLLMENT */, _addTidIfNecessary(auth, request));\r\n}\r\nfunction finalizeEnrollPhoneMfa(auth, request) {\r\n return _performApiRequest(auth, \"POST\" /* POST */, \"/v2/accounts/mfaEnrollment:finalize\" /* FINALIZE_PHONE_MFA_ENROLLMENT */, _addTidIfNecessary(auth, request));\r\n}\r\nfunction withdrawMfa(auth, request) {\r\n return _performApiRequest(auth, \"POST\" /* POST */, \"/v2/accounts/mfaEnrollment:withdraw\" /* WITHDRAW_MFA */, _addTidIfNecessary(auth, request));\r\n}\n\nclass MultiFactorUserImpl {\r\n constructor(user) {\r\n this.user = user;\r\n this.enrolledFactors = [];\r\n user._onReload(userInfo => {\r\n if (userInfo.mfaInfo) {\r\n this.enrolledFactors = userInfo.mfaInfo.map(enrollment => MultiFactorInfoImpl._fromServerResponse(user.auth, enrollment));\r\n }\r\n });\r\n }\r\n static _fromUser(user) {\r\n return new MultiFactorUserImpl(user);\r\n }\r\n async getSession() {\r\n return MultiFactorSessionImpl._fromIdtoken(await this.user.getIdToken());\r\n }\r\n async enroll(assertionExtern, displayName) {\r\n const assertion = assertionExtern;\r\n const session = (await this.getSession());\r\n const finalizeMfaResponse = await _logoutIfInvalidated(this.user, assertion._process(this.user.auth, session, displayName));\r\n // New tokens will be issued after enrollment of the new second factors.\r\n // They need to be updated on the user.\r\n await this.user._updateTokensIfNecessary(finalizeMfaResponse);\r\n // The user needs to be reloaded to get the new multi-factor information\r\n // from server. USER_RELOADED event will be triggered and `enrolledFactors`\r\n // will be updated.\r\n return this.user.reload();\r\n }\r\n async unenroll(infoOrUid) {\r\n var _a;\r\n const mfaEnrollmentId = typeof infoOrUid === 'string' ? infoOrUid : infoOrUid.uid;\r\n const idToken = await this.user.getIdToken();\r\n const idTokenResponse = await _logoutIfInvalidated(this.user, withdrawMfa(this.user.auth, {\r\n idToken,\r\n mfaEnrollmentId\r\n }));\r\n // Remove the second factor from the user's list.\r\n this.enrolledFactors = this.enrolledFactors.filter(({ uid }) => uid !== mfaEnrollmentId);\r\n // Depending on whether the backend decided to revoke the user's session,\r\n // the tokenResponse may be empty. If the tokens were not updated (and they\r\n // are now invalid), reloading the user will discover this and invalidate\r\n // the user's state accordingly.\r\n await this.user._updateTokensIfNecessary(idTokenResponse);\r\n try {\r\n await this.user.reload();\r\n }\r\n catch (e) {\r\n if (((_a = e) === null || _a === void 0 ? void 0 : _a.code) !== `auth/${\"user-token-expired\" /* TOKEN_EXPIRED */}`) {\r\n throw e;\r\n }\r\n }\r\n }\r\n}\r\nconst multiFactorUserCache = new WeakMap();\r\n/**\r\n * The {@link MultiFactorUser} corresponding to the user.\r\n *\r\n * @remarks\r\n * This is used to access all multi-factor properties and operations related to the user.\r\n *\r\n * @param user - The user.\r\n *\r\n * @public\r\n */\r\nfunction multiFactor(user) {\r\n const userModular = getModularInstance(user);\r\n if (!multiFactorUserCache.has(userModular)) {\r\n multiFactorUserCache.set(userModular, MultiFactorUserImpl._fromUser(userModular));\r\n }\r\n return multiFactorUserCache.get(userModular);\r\n}\n\nconst STORAGE_AVAILABLE_KEY = '__sak';\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// There are two different browser persistence types: local and session.\r\n// Both have the same implementation but use a different underlying storage\r\n// object.\r\nclass BrowserPersistenceClass {\r\n constructor(storageRetriever, type) {\r\n this.storageRetriever = storageRetriever;\r\n this.type = type;\r\n }\r\n _isAvailable() {\r\n try {\r\n if (!this.storage) {\r\n return Promise.resolve(false);\r\n }\r\n this.storage.setItem(STORAGE_AVAILABLE_KEY, '1');\r\n this.storage.removeItem(STORAGE_AVAILABLE_KEY);\r\n return Promise.resolve(true);\r\n }\r\n catch (_a) {\r\n return Promise.resolve(false);\r\n }\r\n }\r\n _set(key, value) {\r\n this.storage.setItem(key, JSON.stringify(value));\r\n return Promise.resolve();\r\n }\r\n _get(key) {\r\n const json = this.storage.getItem(key);\r\n return Promise.resolve(json ? JSON.parse(json) : null);\r\n }\r\n _remove(key) {\r\n this.storage.removeItem(key);\r\n return Promise.resolve();\r\n }\r\n get storage() {\r\n return this.storageRetriever();\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 _iframeCannotSyncWebStorage() {\r\n const ua = getUA();\r\n return _isSafari(ua) || _isIOS(ua);\r\n}\r\n// The polling period in case events are not supported\r\nconst _POLLING_INTERVAL_MS$1 = 1000;\r\n// The IE 10 localStorage cross tab synchronization delay in milliseconds\r\nconst IE10_LOCAL_STORAGE_SYNC_DELAY = 10;\r\nclass BrowserLocalPersistence extends BrowserPersistenceClass {\r\n constructor() {\r\n super(() => window.localStorage, \"LOCAL\" /* LOCAL */);\r\n this.boundEventHandler = (event, poll) => this.onStorageEvent(event, poll);\r\n this.listeners = {};\r\n this.localCache = {};\r\n // setTimeout return value is platform specific\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n this.pollTimer = null;\r\n // Safari or iOS browser and embedded in an iframe.\r\n this.safariLocalStorageNotSynced = _iframeCannotSyncWebStorage() && _isIframe();\r\n // Whether to use polling instead of depending on window events\r\n this.fallbackToPolling = _isMobileBrowser();\r\n this._shouldAllowMigration = true;\r\n }\r\n forAllChangedKeys(cb) {\r\n // Check all keys with listeners on them.\r\n for (const key of Object.keys(this.listeners)) {\r\n // Get value from localStorage.\r\n const newValue = this.storage.getItem(key);\r\n const oldValue = this.localCache[key];\r\n // If local map value does not match, trigger listener with storage event.\r\n // Differentiate this simulated event from the real storage event.\r\n if (newValue !== oldValue) {\r\n cb(key, oldValue, newValue);\r\n }\r\n }\r\n }\r\n onStorageEvent(event, poll = false) {\r\n // Key would be null in some situations, like when localStorage is cleared\r\n if (!event.key) {\r\n this.forAllChangedKeys((key, _oldValue, newValue) => {\r\n this.notifyListeners(key, newValue);\r\n });\r\n return;\r\n }\r\n const key = event.key;\r\n // Check the mechanism how this event was detected.\r\n // The first event will dictate the mechanism to be used.\r\n if (poll) {\r\n // Environment detects storage changes via polling.\r\n // Remove storage event listener to prevent possible event duplication.\r\n this.detachListener();\r\n }\r\n else {\r\n // Environment detects storage changes via storage event listener.\r\n // Remove polling listener to prevent possible event duplication.\r\n this.stopPolling();\r\n }\r\n // Safari embedded iframe. Storage event will trigger with the delta\r\n // changes but no changes will be applied to the iframe localStorage.\r\n if (this.safariLocalStorageNotSynced) {\r\n // Get current iframe page value.\r\n const storedValue = this.storage.getItem(key);\r\n // Value not synchronized, synchronize manually.\r\n if (event.newValue !== storedValue) {\r\n if (event.newValue !== null) {\r\n // Value changed from current value.\r\n this.storage.setItem(key, event.newValue);\r\n }\r\n else {\r\n // Current value deleted.\r\n this.storage.removeItem(key);\r\n }\r\n }\r\n else if (this.localCache[key] === event.newValue && !poll) {\r\n // Already detected and processed, do not trigger listeners again.\r\n return;\r\n }\r\n }\r\n const triggerListeners = () => {\r\n // Keep local map up to date in case storage event is triggered before\r\n // poll.\r\n const storedValue = this.storage.getItem(key);\r\n if (!poll && this.localCache[key] === storedValue) {\r\n // Real storage event which has already been detected, do nothing.\r\n // This seems to trigger in some IE browsers for some reason.\r\n return;\r\n }\r\n this.notifyListeners(key, storedValue);\r\n };\r\n const storedValue = this.storage.getItem(key);\r\n if (_isIE10() &&\r\n storedValue !== event.newValue &&\r\n event.newValue !== event.oldValue) {\r\n // IE 10 has this weird bug where a storage event would trigger with the\r\n // correct key, oldValue and newValue but localStorage.getItem(key) does\r\n // not yield the updated value until a few milliseconds. This ensures\r\n // this recovers from that situation.\r\n setTimeout(triggerListeners, IE10_LOCAL_STORAGE_SYNC_DELAY);\r\n }\r\n else {\r\n triggerListeners();\r\n }\r\n }\r\n notifyListeners(key, value) {\r\n this.localCache[key] = value;\r\n const listeners = this.listeners[key];\r\n if (listeners) {\r\n for (const listener of Array.from(listeners)) {\r\n listener(value ? JSON.parse(value) : value);\r\n }\r\n }\r\n }\r\n startPolling() {\r\n this.stopPolling();\r\n this.pollTimer = setInterval(() => {\r\n this.forAllChangedKeys((key, oldValue, newValue) => {\r\n this.onStorageEvent(new StorageEvent('storage', {\r\n key,\r\n oldValue,\r\n newValue\r\n }), \r\n /* poll */ true);\r\n });\r\n }, _POLLING_INTERVAL_MS$1);\r\n }\r\n stopPolling() {\r\n if (this.pollTimer) {\r\n clearInterval(this.pollTimer);\r\n this.pollTimer = null;\r\n }\r\n }\r\n attachListener() {\r\n window.addEventListener('storage', this.boundEventHandler);\r\n }\r\n detachListener() {\r\n window.removeEventListener('storage', this.boundEventHandler);\r\n }\r\n _addListener(key, listener) {\r\n if (Object.keys(this.listeners).length === 0) {\r\n // Whether browser can detect storage event when it had already been pushed to the background.\r\n // This may happen in some mobile browsers. A localStorage change in the foreground window\r\n // will not be detected in the background window via the storage event.\r\n // This was detected in iOS 7.x mobile browsers\r\n if (this.fallbackToPolling) {\r\n this.startPolling();\r\n }\r\n else {\r\n this.attachListener();\r\n }\r\n }\r\n if (!this.listeners[key]) {\r\n this.listeners[key] = new Set();\r\n // Populate the cache to avoid spuriously triggering on first poll.\r\n this.localCache[key] = this.storage.getItem(key);\r\n }\r\n this.listeners[key].add(listener);\r\n }\r\n _removeListener(key, listener) {\r\n if (this.listeners[key]) {\r\n this.listeners[key].delete(listener);\r\n if (this.listeners[key].size === 0) {\r\n delete this.listeners[key];\r\n }\r\n }\r\n if (Object.keys(this.listeners).length === 0) {\r\n this.detachListener();\r\n this.stopPolling();\r\n }\r\n }\r\n // Update local cache on base operations:\r\n async _set(key, value) {\r\n await super._set(key, value);\r\n this.localCache[key] = JSON.stringify(value);\r\n }\r\n async _get(key) {\r\n const value = await super._get(key);\r\n this.localCache[key] = JSON.stringify(value);\r\n return value;\r\n }\r\n async _remove(key) {\r\n await super._remove(key);\r\n delete this.localCache[key];\r\n }\r\n}\r\nBrowserLocalPersistence.type = 'LOCAL';\r\n/**\r\n * An implementation of {@link Persistence} of type `LOCAL` using `localStorage`\r\n * for the underlying storage.\r\n *\r\n * @public\r\n */\r\nconst browserLocalPersistence = BrowserLocalPersistence;\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\nclass BrowserSessionPersistence extends BrowserPersistenceClass {\r\n constructor() {\r\n super(() => window.sessionStorage, \"SESSION\" /* SESSION */);\r\n }\r\n _addListener(_key, _listener) {\r\n // Listeners are not supported for session storage since it cannot be shared across windows\r\n return;\r\n }\r\n _removeListener(_key, _listener) {\r\n // Listeners are not supported for session storage since it cannot be shared across windows\r\n return;\r\n }\r\n}\r\nBrowserSessionPersistence.type = 'SESSION';\r\n/**\r\n * An implementation of {@link Persistence} of `SESSION` using `sessionStorage`\r\n * for the underlying storage.\r\n *\r\n * @public\r\n */\r\nconst browserSessionPersistence = BrowserSessionPersistence;\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 * Shim for Promise.allSettled, note the slightly different format of `fulfilled` vs `status`.\r\n *\r\n * @param promises - Array of promises to wait on.\r\n */\r\nfunction _allSettled(promises) {\r\n return Promise.all(promises.map(async (promise) => {\r\n try {\r\n const value = await promise;\r\n return {\r\n fulfilled: true,\r\n value\r\n };\r\n }\r\n catch (reason) {\r\n return {\r\n fulfilled: false,\r\n reason\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 * Interface class for receiving messages.\r\n *\r\n */\r\nclass Receiver {\r\n constructor(eventTarget) {\r\n this.eventTarget = eventTarget;\r\n this.handlersMap = {};\r\n this.boundEventHandler = this.handleEvent.bind(this);\r\n }\r\n /**\r\n * Obtain an instance of a Receiver for a given event target, if none exists it will be created.\r\n *\r\n * @param eventTarget - An event target (such as window or self) through which the underlying\r\n * messages will be received.\r\n */\r\n static _getInstance(eventTarget) {\r\n // The results are stored in an array since objects can't be keys for other\r\n // objects. In addition, setting a unique property on an event target as a\r\n // hash map key may not be allowed due to CORS restrictions.\r\n const existingInstance = this.receivers.find(receiver => receiver.isListeningto(eventTarget));\r\n if (existingInstance) {\r\n return existingInstance;\r\n }\r\n const newInstance = new Receiver(eventTarget);\r\n this.receivers.push(newInstance);\r\n return newInstance;\r\n }\r\n isListeningto(eventTarget) {\r\n return this.eventTarget === eventTarget;\r\n }\r\n /**\r\n * Fans out a MessageEvent to the appropriate listeners.\r\n *\r\n * @remarks\r\n * Sends an {@link Status.ACK} upon receipt and a {@link Status.DONE} once all handlers have\r\n * finished processing.\r\n *\r\n * @param event - The MessageEvent.\r\n *\r\n */\r\n async handleEvent(event) {\r\n const messageEvent = event;\r\n const { eventId, eventType, data } = messageEvent.data;\r\n const handlers = this.handlersMap[eventType];\r\n if (!(handlers === null || handlers === void 0 ? void 0 : handlers.size)) {\r\n return;\r\n }\r\n messageEvent.ports[0].postMessage({\r\n status: \"ack\" /* ACK */,\r\n eventId,\r\n eventType\r\n });\r\n const promises = Array.from(handlers).map(async (handler) => handler(messageEvent.origin, data));\r\n const response = await _allSettled(promises);\r\n messageEvent.ports[0].postMessage({\r\n status: \"done\" /* DONE */,\r\n eventId,\r\n eventType,\r\n response\r\n });\r\n }\r\n /**\r\n * Subscribe an event handler for a particular event.\r\n *\r\n * @param eventType - Event name to subscribe to.\r\n * @param eventHandler - The event handler which should receive the events.\r\n *\r\n */\r\n _subscribe(eventType, eventHandler) {\r\n if (Object.keys(this.handlersMap).length === 0) {\r\n this.eventTarget.addEventListener('message', this.boundEventHandler);\r\n }\r\n if (!this.handlersMap[eventType]) {\r\n this.handlersMap[eventType] = new Set();\r\n }\r\n this.handlersMap[eventType].add(eventHandler);\r\n }\r\n /**\r\n * Unsubscribe an event handler from a particular event.\r\n *\r\n * @param eventType - Event name to unsubscribe from.\r\n * @param eventHandler - Optinoal event handler, if none provided, unsubscribe all handlers on this event.\r\n *\r\n */\r\n _unsubscribe(eventType, eventHandler) {\r\n if (this.handlersMap[eventType] && eventHandler) {\r\n this.handlersMap[eventType].delete(eventHandler);\r\n }\r\n if (!eventHandler || this.handlersMap[eventType].size === 0) {\r\n delete this.handlersMap[eventType];\r\n }\r\n if (Object.keys(this.handlersMap).length === 0) {\r\n this.eventTarget.removeEventListener('message', this.boundEventHandler);\r\n }\r\n }\r\n}\r\nReceiver.receivers = [];\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 _generateEventId(prefix = '', digits = 10) {\r\n let random = '';\r\n for (let i = 0; i < digits; i++) {\r\n random += Math.floor(Math.random() * 10);\r\n }\r\n return prefix + random;\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 * Interface for sending messages and waiting for a completion response.\r\n *\r\n */\r\nclass Sender {\r\n constructor(target) {\r\n this.target = target;\r\n this.handlers = new Set();\r\n }\r\n /**\r\n * Unsubscribe the handler and remove it from our tracking Set.\r\n *\r\n * @param handler - The handler to unsubscribe.\r\n */\r\n removeMessageHandler(handler) {\r\n if (handler.messageChannel) {\r\n handler.messageChannel.port1.removeEventListener('message', handler.onMessage);\r\n handler.messageChannel.port1.close();\r\n }\r\n this.handlers.delete(handler);\r\n }\r\n /**\r\n * Send a message to the Receiver located at {@link target}.\r\n *\r\n * @remarks\r\n * We'll first wait a bit for an ACK , if we get one we will wait significantly longer until the\r\n * receiver has had a chance to fully process the event.\r\n *\r\n * @param eventType - Type of event to send.\r\n * @param data - The payload of the event.\r\n * @param timeout - Timeout for waiting on an ACK from the receiver.\r\n *\r\n * @returns An array of settled promises from all the handlers that were listening on the receiver.\r\n */\r\n async _send(eventType, data, timeout = 50 /* ACK */) {\r\n const messageChannel = typeof MessageChannel !== 'undefined' ? new MessageChannel() : null;\r\n if (!messageChannel) {\r\n throw new Error(\"connection_unavailable\" /* CONNECTION_UNAVAILABLE */);\r\n }\r\n // Node timers and browser timers return fundamentally different types.\r\n // We don't actually care what the value is but TS won't accept unknown and\r\n // we can't cast properly in both environments.\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n let completionTimer;\r\n let handler;\r\n return new Promise((resolve, reject) => {\r\n const eventId = _generateEventId('', 20);\r\n messageChannel.port1.start();\r\n const ackTimer = setTimeout(() => {\r\n reject(new Error(\"unsupported_event\" /* UNSUPPORTED_EVENT */));\r\n }, timeout);\r\n handler = {\r\n messageChannel,\r\n onMessage(event) {\r\n const messageEvent = event;\r\n if (messageEvent.data.eventId !== eventId) {\r\n return;\r\n }\r\n switch (messageEvent.data.status) {\r\n case \"ack\" /* ACK */:\r\n // The receiver should ACK first.\r\n clearTimeout(ackTimer);\r\n completionTimer = setTimeout(() => {\r\n reject(new Error(\"timeout\" /* TIMEOUT */));\r\n }, 3000 /* COMPLETION */);\r\n break;\r\n case \"done\" /* DONE */:\r\n // Once the receiver's handlers are finished we will get the results.\r\n clearTimeout(completionTimer);\r\n resolve(messageEvent.data.response);\r\n break;\r\n default:\r\n clearTimeout(ackTimer);\r\n clearTimeout(completionTimer);\r\n reject(new Error(\"invalid_response\" /* INVALID_RESPONSE */));\r\n break;\r\n }\r\n }\r\n };\r\n this.handlers.add(handler);\r\n messageChannel.port1.addEventListener('message', handler.onMessage);\r\n this.target.postMessage({\r\n eventType,\r\n eventId,\r\n data\r\n }, [messageChannel.port2]);\r\n }).finally(() => {\r\n if (handler) {\r\n this.removeMessageHandler(handler);\r\n }\r\n });\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 * Lazy accessor for window, since the compat layer won't tree shake this out,\r\n * we need to make sure not to mess with window unless we have to\r\n */\r\nfunction _window() {\r\n return window;\r\n}\r\nfunction _setWindowLocation(url) {\r\n _window().location.href = url;\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 _isWorker() {\r\n return (typeof _window()['WorkerGlobalScope'] !== 'undefined' &&\r\n typeof _window()['importScripts'] === 'function');\r\n}\r\nasync function _getActiveServiceWorker() {\r\n if (!(navigator === null || navigator === void 0 ? void 0 : navigator.serviceWorker)) {\r\n return null;\r\n }\r\n try {\r\n const registration = await navigator.serviceWorker.ready;\r\n return registration.active;\r\n }\r\n catch (_a) {\r\n return null;\r\n }\r\n}\r\nfunction _getServiceWorkerController() {\r\n var _a;\r\n return ((_a = navigator === null || navigator === void 0 ? void 0 : navigator.serviceWorker) === null || _a === void 0 ? void 0 : _a.controller) || null;\r\n}\r\nfunction _getWorkerGlobalScope() {\r\n return _isWorker() ? self : null;\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 DB_NAME = 'firebaseLocalStorageDb';\r\nconst DB_VERSION = 1;\r\nconst DB_OBJECTSTORE_NAME = 'firebaseLocalStorage';\r\nconst DB_DATA_KEYPATH = 'fbase_key';\r\n/**\r\n * Promise wrapper for IDBRequest\r\n *\r\n * Unfortunately we can't cleanly extend Promise<T> since promises are not callable in ES6\r\n *\r\n */\r\nclass DBPromise {\r\n constructor(request) {\r\n this.request = request;\r\n }\r\n toPromise() {\r\n return new Promise((resolve, reject) => {\r\n this.request.addEventListener('success', () => {\r\n resolve(this.request.result);\r\n });\r\n this.request.addEventListener('error', () => {\r\n reject(this.request.error);\r\n });\r\n });\r\n }\r\n}\r\nfunction getObjectStore(db, isReadWrite) {\r\n return db\r\n .transaction([DB_OBJECTSTORE_NAME], isReadWrite ? 'readwrite' : 'readonly')\r\n .objectStore(DB_OBJECTSTORE_NAME);\r\n}\r\nfunction _deleteDatabase() {\r\n const request = indexedDB.deleteDatabase(DB_NAME);\r\n return new DBPromise(request).toPromise();\r\n}\r\nfunction _openDatabase() {\r\n const request = indexedDB.open(DB_NAME, DB_VERSION);\r\n return new Promise((resolve, reject) => {\r\n request.addEventListener('error', () => {\r\n reject(request.error);\r\n });\r\n request.addEventListener('upgradeneeded', () => {\r\n const db = request.result;\r\n try {\r\n db.createObjectStore(DB_OBJECTSTORE_NAME, { keyPath: DB_DATA_KEYPATH });\r\n }\r\n catch (e) {\r\n reject(e);\r\n }\r\n });\r\n request.addEventListener('success', async () => {\r\n const db = request.result;\r\n // Strange bug that occurs in Firefox when multiple tabs are opened at the\r\n // same time. The only way to recover seems to be deleting the database\r\n // and re-initializing it.\r\n // https://github.com/firebase/firebase-js-sdk/issues/634\r\n if (!db.objectStoreNames.contains(DB_OBJECTSTORE_NAME)) {\r\n // Need to close the database or else you get a `blocked` event\r\n db.close();\r\n await _deleteDatabase();\r\n resolve(await _openDatabase());\r\n }\r\n else {\r\n resolve(db);\r\n }\r\n });\r\n });\r\n}\r\nasync function _putObject(db, key, value) {\r\n const request = getObjectStore(db, true).put({\r\n [DB_DATA_KEYPATH]: key,\r\n value\r\n });\r\n return new DBPromise(request).toPromise();\r\n}\r\nasync function getObject(db, key) {\r\n const request = getObjectStore(db, false).get(key);\r\n const data = await new DBPromise(request).toPromise();\r\n return data === undefined ? null : data.value;\r\n}\r\nfunction _deleteObject(db, key) {\r\n const request = getObjectStore(db, true).delete(key);\r\n return new DBPromise(request).toPromise();\r\n}\r\nconst _POLLING_INTERVAL_MS = 800;\r\nconst _TRANSACTION_RETRY_COUNT = 3;\r\nclass IndexedDBLocalPersistence {\r\n constructor() {\r\n this.type = \"LOCAL\" /* LOCAL */;\r\n this._shouldAllowMigration = true;\r\n this.listeners = {};\r\n this.localCache = {};\r\n // setTimeout return value is platform specific\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n this.pollTimer = null;\r\n this.pendingWrites = 0;\r\n this.receiver = null;\r\n this.sender = null;\r\n this.serviceWorkerReceiverAvailable = false;\r\n this.activeServiceWorker = null;\r\n // Fire & forget the service worker registration as it may never resolve\r\n this._workerInitializationPromise =\r\n this.initializeServiceWorkerMessaging().then(() => { }, () => { });\r\n }\r\n async _openDb() {\r\n if (this.db) {\r\n return this.db;\r\n }\r\n this.db = await _openDatabase();\r\n return this.db;\r\n }\r\n async _withRetries(op) {\r\n let numAttempts = 0;\r\n while (true) {\r\n try {\r\n const db = await this._openDb();\r\n return await op(db);\r\n }\r\n catch (e) {\r\n if (numAttempts++ > _TRANSACTION_RETRY_COUNT) {\r\n throw e;\r\n }\r\n if (this.db) {\r\n this.db.close();\r\n this.db = undefined;\r\n }\r\n // TODO: consider adding exponential backoff\r\n }\r\n }\r\n }\r\n /**\r\n * IndexedDB events do not propagate from the main window to the worker context. We rely on a\r\n * postMessage interface to send these events to the worker ourselves.\r\n */\r\n async initializeServiceWorkerMessaging() {\r\n return _isWorker() ? this.initializeReceiver() : this.initializeSender();\r\n }\r\n /**\r\n * As the worker we should listen to events from the main window.\r\n */\r\n async initializeReceiver() {\r\n this.receiver = Receiver._getInstance(_getWorkerGlobalScope());\r\n // Refresh from persistence if we receive a KeyChanged message.\r\n this.receiver._subscribe(\"keyChanged\" /* KEY_CHANGED */, async (_origin, data) => {\r\n const keys = await this._poll();\r\n return {\r\n keyProcessed: keys.includes(data.key)\r\n };\r\n });\r\n // Let the sender know that we are listening so they give us more timeout.\r\n this.receiver._subscribe(\"ping\" /* PING */, async (_origin, _data) => {\r\n return [\"keyChanged\" /* KEY_CHANGED */];\r\n });\r\n }\r\n /**\r\n * As the main window, we should let the worker know when keys change (set and remove).\r\n *\r\n * @remarks\r\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/ready | ServiceWorkerContainer.ready}\r\n * may not resolve.\r\n */\r\n async initializeSender() {\r\n var _a, _b;\r\n // Check to see if there's an active service worker.\r\n this.activeServiceWorker = await _getActiveServiceWorker();\r\n if (!this.activeServiceWorker) {\r\n return;\r\n }\r\n this.sender = new Sender(this.activeServiceWorker);\r\n // Ping the service worker to check what events they can handle.\r\n const results = await this.sender._send(\"ping\" /* PING */, {}, 800 /* LONG_ACK */);\r\n if (!results) {\r\n return;\r\n }\r\n if (((_a = results[0]) === null || _a === void 0 ? void 0 : _a.fulfilled) &&\r\n ((_b = results[0]) === null || _b === void 0 ? void 0 : _b.value.includes(\"keyChanged\" /* KEY_CHANGED */))) {\r\n this.serviceWorkerReceiverAvailable = true;\r\n }\r\n }\r\n /**\r\n * Let the worker know about a changed key, the exact key doesn't technically matter since the\r\n * worker will just trigger a full sync anyway.\r\n *\r\n * @remarks\r\n * For now, we only support one service worker per page.\r\n *\r\n * @param key - Storage key which changed.\r\n */\r\n async notifyServiceWorker(key) {\r\n if (!this.sender ||\r\n !this.activeServiceWorker ||\r\n _getServiceWorkerController() !== this.activeServiceWorker) {\r\n return;\r\n }\r\n try {\r\n await this.sender._send(\"keyChanged\" /* KEY_CHANGED */, { key }, \r\n // Use long timeout if receiver has previously responded to a ping from us.\r\n this.serviceWorkerReceiverAvailable\r\n ? 800 /* LONG_ACK */\r\n : 50 /* ACK */);\r\n }\r\n catch (_a) {\r\n // This is a best effort approach. Ignore errors.\r\n }\r\n }\r\n async _isAvailable() {\r\n try {\r\n if (!indexedDB) {\r\n return false;\r\n }\r\n const db = await _openDatabase();\r\n await _putObject(db, STORAGE_AVAILABLE_KEY, '1');\r\n await _deleteObject(db, STORAGE_AVAILABLE_KEY);\r\n return true;\r\n }\r\n catch (_a) { }\r\n return false;\r\n }\r\n async _withPendingWrite(write) {\r\n this.pendingWrites++;\r\n try {\r\n await write();\r\n }\r\n finally {\r\n this.pendingWrites--;\r\n }\r\n }\r\n async _set(key, value) {\r\n return this._withPendingWrite(async () => {\r\n await this._withRetries((db) => _putObject(db, key, value));\r\n this.localCache[key] = value;\r\n return this.notifyServiceWorker(key);\r\n });\r\n }\r\n async _get(key) {\r\n const obj = (await this._withRetries((db) => getObject(db, key)));\r\n this.localCache[key] = obj;\r\n return obj;\r\n }\r\n async _remove(key) {\r\n return this._withPendingWrite(async () => {\r\n await this._withRetries((db) => _deleteObject(db, key));\r\n delete this.localCache[key];\r\n return this.notifyServiceWorker(key);\r\n });\r\n }\r\n async _poll() {\r\n // TODO: check if we need to fallback if getAll is not supported\r\n const result = await this._withRetries((db) => {\r\n const getAllRequest = getObjectStore(db, false).getAll();\r\n return new DBPromise(getAllRequest).toPromise();\r\n });\r\n if (!result) {\r\n return [];\r\n }\r\n // If we have pending writes in progress abort, we'll get picked up on the next poll\r\n if (this.pendingWrites !== 0) {\r\n return [];\r\n }\r\n const keys = [];\r\n const keysInResult = new Set();\r\n for (const { fbase_key: key, value } of result) {\r\n keysInResult.add(key);\r\n if (JSON.stringify(this.localCache[key]) !== JSON.stringify(value)) {\r\n this.notifyListeners(key, value);\r\n keys.push(key);\r\n }\r\n }\r\n for (const localKey of Object.keys(this.localCache)) {\r\n if (this.localCache[localKey] && !keysInResult.has(localKey)) {\r\n // Deleted\r\n this.notifyListeners(localKey, null);\r\n keys.push(localKey);\r\n }\r\n }\r\n return keys;\r\n }\r\n notifyListeners(key, newValue) {\r\n this.localCache[key] = newValue;\r\n const listeners = this.listeners[key];\r\n if (listeners) {\r\n for (const listener of Array.from(listeners)) {\r\n listener(newValue);\r\n }\r\n }\r\n }\r\n startPolling() {\r\n this.stopPolling();\r\n this.pollTimer = setInterval(async () => this._poll(), _POLLING_INTERVAL_MS);\r\n }\r\n stopPolling() {\r\n if (this.pollTimer) {\r\n clearInterval(this.pollTimer);\r\n this.pollTimer = null;\r\n }\r\n }\r\n _addListener(key, listener) {\r\n if (Object.keys(this.listeners).length === 0) {\r\n this.startPolling();\r\n }\r\n if (!this.listeners[key]) {\r\n this.listeners[key] = new Set();\r\n // Populate the cache to avoid spuriously triggering on first poll.\r\n void this._get(key); // This can happen in the background async and we can return immediately.\r\n }\r\n this.listeners[key].add(listener);\r\n }\r\n _removeListener(key, listener) {\r\n if (this.listeners[key]) {\r\n this.listeners[key].delete(listener);\r\n if (this.listeners[key].size === 0) {\r\n delete this.listeners[key];\r\n }\r\n }\r\n if (Object.keys(this.listeners).length === 0) {\r\n this.stopPolling();\r\n }\r\n }\r\n}\r\nIndexedDBLocalPersistence.type = 'LOCAL';\r\n/**\r\n * An implementation of {@link Persistence} of type `LOCAL` using `indexedDB`\r\n * for the underlying storage.\r\n *\r\n * @public\r\n */\r\nconst indexedDBLocalPersistence = IndexedDBLocalPersistence;\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 startSignInPhoneMfa(auth, request) {\r\n return _performApiRequest(auth, \"POST\" /* POST */, \"/v2/accounts/mfaSignIn:start\" /* START_PHONE_MFA_SIGN_IN */, _addTidIfNecessary(auth, request));\r\n}\r\nfunction finalizeSignInPhoneMfa(auth, request) {\r\n return _performApiRequest(auth, \"POST\" /* POST */, \"/v2/accounts/mfaSignIn:finalize\" /* FINALIZE_PHONE_MFA_SIGN_IN */, _addTidIfNecessary(auth, request));\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\nasync function getRecaptchaParams(auth) {\r\n return ((await _performApiRequest(auth, \"GET\" /* GET */, \"/v1/recaptchaParams\" /* GET_RECAPTCHA_PARAM */)).recaptchaSiteKey || '');\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 getScriptParentElement() {\r\n var _a, _b;\r\n return (_b = (_a = document.getElementsByTagName('head')) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : document;\r\n}\r\nfunction _loadJS(url) {\r\n // TODO: consider adding timeout support & cancellation\r\n return new Promise((resolve, reject) => {\r\n const el = document.createElement('script');\r\n el.setAttribute('src', url);\r\n el.onload = resolve;\r\n el.onerror = e => {\r\n const error = _createError(\"internal-error\" /* INTERNAL_ERROR */);\r\n error.customData = e;\r\n reject(error);\r\n };\r\n el.type = 'text/javascript';\r\n el.charset = 'UTF-8';\r\n getScriptParentElement().appendChild(el);\r\n });\r\n}\r\nfunction _generateCallbackName(prefix) {\r\n return `__${prefix}${Math.floor(Math.random() * 1000000)}`;\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 _SOLVE_TIME_MS = 500;\r\nconst _EXPIRATION_TIME_MS = 60000;\r\nconst _WIDGET_ID_START = 1000000000000;\r\nclass MockReCaptcha {\r\n constructor(auth) {\r\n this.auth = auth;\r\n this.counter = _WIDGET_ID_START;\r\n this._widgets = new Map();\r\n }\r\n render(container, parameters) {\r\n const id = this.counter;\r\n this._widgets.set(id, new MockWidget(container, this.auth.name, parameters || {}));\r\n this.counter++;\r\n return id;\r\n }\r\n reset(optWidgetId) {\r\n var _a;\r\n const id = optWidgetId || _WIDGET_ID_START;\r\n void ((_a = this._widgets.get(id)) === null || _a === void 0 ? void 0 : _a.delete());\r\n this._widgets.delete(id);\r\n }\r\n getResponse(optWidgetId) {\r\n var _a;\r\n const id = optWidgetId || _WIDGET_ID_START;\r\n return ((_a = this._widgets.get(id)) === null || _a === void 0 ? void 0 : _a.getResponse()) || '';\r\n }\r\n async execute(optWidgetId) {\r\n var _a;\r\n const id = optWidgetId || _WIDGET_ID_START;\r\n void ((_a = this._widgets.get(id)) === null || _a === void 0 ? void 0 : _a.execute());\r\n return '';\r\n }\r\n}\r\nclass MockWidget {\r\n constructor(containerOrId, appName, params) {\r\n this.params = params;\r\n this.timerId = null;\r\n this.deleted = false;\r\n this.responseToken = null;\r\n this.clickHandler = () => {\r\n this.execute();\r\n };\r\n const container = typeof containerOrId === 'string'\r\n ? document.getElementById(containerOrId)\r\n : containerOrId;\r\n _assert(container, \"argument-error\" /* ARGUMENT_ERROR */, { appName });\r\n this.container = container;\r\n this.isVisible = this.params.size !== 'invisible';\r\n if (this.isVisible) {\r\n this.execute();\r\n }\r\n else {\r\n this.container.addEventListener('click', this.clickHandler);\r\n }\r\n }\r\n getResponse() {\r\n this.checkIfDeleted();\r\n return this.responseToken;\r\n }\r\n delete() {\r\n this.checkIfDeleted();\r\n this.deleted = true;\r\n if (this.timerId) {\r\n clearTimeout(this.timerId);\r\n this.timerId = null;\r\n }\r\n this.container.removeEventListener('click', this.clickHandler);\r\n }\r\n execute() {\r\n this.checkIfDeleted();\r\n if (this.timerId) {\r\n return;\r\n }\r\n this.timerId = window.setTimeout(() => {\r\n this.responseToken = generateRandomAlphaNumericString(50);\r\n const { callback, 'expired-callback': expiredCallback } = this.params;\r\n if (callback) {\r\n try {\r\n callback(this.responseToken);\r\n }\r\n catch (e) { }\r\n }\r\n this.timerId = window.setTimeout(() => {\r\n this.timerId = null;\r\n this.responseToken = null;\r\n if (expiredCallback) {\r\n try {\r\n expiredCallback();\r\n }\r\n catch (e) { }\r\n }\r\n if (this.isVisible) {\r\n this.execute();\r\n }\r\n }, _EXPIRATION_TIME_MS);\r\n }, _SOLVE_TIME_MS);\r\n }\r\n checkIfDeleted() {\r\n if (this.deleted) {\r\n throw new Error('reCAPTCHA mock was already deleted!');\r\n }\r\n }\r\n}\r\nfunction generateRandomAlphaNumericString(len) {\r\n const chars = [];\r\n const allowedChars = '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\r\n for (let i = 0; i < len; i++) {\r\n chars.push(allowedChars.charAt(Math.floor(Math.random() * allowedChars.length)));\r\n }\r\n return chars.join('');\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// ReCaptcha will load using the same callback, so the callback function needs\r\n// to be kept around\r\nconst _JSLOAD_CALLBACK = _generateCallbackName('rcb');\r\nconst NETWORK_TIMEOUT_DELAY = new Delay(30000, 60000);\r\nconst RECAPTCHA_BASE = 'https://www.google.com/recaptcha/api.js?';\r\n/**\r\n * Loader for the GReCaptcha library. There should only ever be one of this.\r\n */\r\nclass ReCaptchaLoaderImpl {\r\n constructor() {\r\n var _a;\r\n this.hostLanguage = '';\r\n this.counter = 0;\r\n /**\r\n * Check for `render()` method. `window.grecaptcha` will exist if the Enterprise\r\n * version of the ReCAPTCHA script was loaded by someone else (e.g. App Check) but\r\n * `window.grecaptcha.render()` will not. Another load will add it.\r\n */\r\n this.librarySeparatelyLoaded = !!((_a = _window().grecaptcha) === null || _a === void 0 ? void 0 : _a.render);\r\n }\r\n load(auth, hl = '') {\r\n _assert(isHostLanguageValid(hl), auth, \"argument-error\" /* ARGUMENT_ERROR */);\r\n if (this.shouldResolveImmediately(hl)) {\r\n return Promise.resolve(_window().grecaptcha);\r\n }\r\n return new Promise((resolve, reject) => {\r\n const networkTimeout = _window().setTimeout(() => {\r\n reject(_createError(auth, \"network-request-failed\" /* NETWORK_REQUEST_FAILED */));\r\n }, NETWORK_TIMEOUT_DELAY.get());\r\n _window()[_JSLOAD_CALLBACK] = () => {\r\n _window().clearTimeout(networkTimeout);\r\n delete _window()[_JSLOAD_CALLBACK];\r\n const recaptcha = _window().grecaptcha;\r\n if (!recaptcha) {\r\n reject(_createError(auth, \"internal-error\" /* INTERNAL_ERROR */));\r\n return;\r\n }\r\n // Wrap the greptcha render function so that we know if the developer has\r\n // called it separately\r\n const render = recaptcha.render;\r\n recaptcha.render = (container, params) => {\r\n const widgetId = render(container, params);\r\n this.counter++;\r\n return widgetId;\r\n };\r\n this.hostLanguage = hl;\r\n resolve(recaptcha);\r\n };\r\n const url = `${RECAPTCHA_BASE}?${querystring({\r\n onload: _JSLOAD_CALLBACK,\r\n render: 'explicit',\r\n hl\r\n })}`;\r\n _loadJS(url).catch(() => {\r\n clearTimeout(networkTimeout);\r\n reject(_createError(auth, \"internal-error\" /* INTERNAL_ERROR */));\r\n });\r\n });\r\n }\r\n clearedOneInstance() {\r\n this.counter--;\r\n }\r\n shouldResolveImmediately(hl) {\r\n var _a;\r\n // We can resolve immediately if:\r\n // • grecaptcha is already defined AND (\r\n // 1. the requested language codes are the same OR\r\n // 2. there exists already a ReCaptcha on the page\r\n // 3. the library was already loaded by the app\r\n // In cases (2) and (3), we _can't_ reload as it would break the recaptchas\r\n // that are already in the page\r\n return (!!((_a = _window().grecaptcha) === null || _a === void 0 ? void 0 : _a.render) &&\r\n (hl === this.hostLanguage ||\r\n this.counter > 0 ||\r\n this.librarySeparatelyLoaded));\r\n }\r\n}\r\nfunction isHostLanguageValid(hl) {\r\n return hl.length <= 6 && /^\\s*[a-zA-Z0-9\\-]*\\s*$/.test(hl);\r\n}\r\nclass MockReCaptchaLoaderImpl {\r\n async load(auth) {\r\n return new MockReCaptcha(auth);\r\n }\r\n clearedOneInstance() { }\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 RECAPTCHA_VERIFIER_TYPE = 'recaptcha';\r\nconst DEFAULT_PARAMS = {\r\n theme: 'light',\r\n type: 'image'\r\n};\r\n/**\r\n * An {@link https://www.google.com/recaptcha/ | reCAPTCHA}-based application verifier.\r\n *\r\n * @public\r\n */\r\nclass RecaptchaVerifier {\r\n /**\r\n *\r\n * @param containerOrId - The reCAPTCHA container parameter.\r\n *\r\n * @remarks\r\n * This has different meaning depending on whether the reCAPTCHA is hidden or visible. For a\r\n * visible reCAPTCHA the container must be empty. If a string is used, it has to correspond to\r\n * an element ID. The corresponding element must also must be in the DOM at the time of\r\n * initialization.\r\n *\r\n * @param parameters - The optional reCAPTCHA parameters.\r\n *\r\n * @remarks\r\n * Check the reCAPTCHA docs for a comprehensive list. All parameters are accepted except for\r\n * the sitekey. Firebase Auth backend provisions a reCAPTCHA for each project and will\r\n * configure this upon rendering. For an invisible reCAPTCHA, a size key must have the value\r\n * 'invisible'.\r\n *\r\n * @param authExtern - The corresponding Firebase {@link Auth} instance.\r\n *\r\n * @remarks\r\n * If none is provided, the default Firebase {@link Auth} instance is used. A Firebase {@link Auth} instance\r\n * must be initialized with an API key, otherwise an error will be thrown.\r\n */\r\n constructor(containerOrId, parameters = Object.assign({}, DEFAULT_PARAMS), authExtern) {\r\n this.parameters = parameters;\r\n /**\r\n * The application verifier type.\r\n *\r\n * @remarks\r\n * For a reCAPTCHA verifier, this is 'recaptcha'.\r\n */\r\n this.type = RECAPTCHA_VERIFIER_TYPE;\r\n this.destroyed = false;\r\n this.widgetId = null;\r\n this.tokenChangeListeners = new Set();\r\n this.renderPromise = null;\r\n this.recaptcha = null;\r\n this.auth = _castAuth(authExtern);\r\n this.isInvisible = this.parameters.size === 'invisible';\r\n _assert(typeof document !== 'undefined', this.auth, \"operation-not-supported-in-this-environment\" /* OPERATION_NOT_SUPPORTED */);\r\n const container = typeof containerOrId === 'string'\r\n ? document.getElementById(containerOrId)\r\n : containerOrId;\r\n _assert(container, this.auth, \"argument-error\" /* ARGUMENT_ERROR */);\r\n this.container = container;\r\n this.parameters.callback = this.makeTokenCallback(this.parameters.callback);\r\n this._recaptchaLoader = this.auth.settings.appVerificationDisabledForTesting\r\n ? new MockReCaptchaLoaderImpl()\r\n : new ReCaptchaLoaderImpl();\r\n this.validateStartingState();\r\n // TODO: Figure out if sdk version is needed\r\n }\r\n /**\r\n * Waits for the user to solve the reCAPTCHA and resolves with the reCAPTCHA token.\r\n *\r\n * @returns A Promise for the reCAPTCHA token.\r\n */\r\n async verify() {\r\n this.assertNotDestroyed();\r\n const id = await this.render();\r\n const recaptcha = this.getAssertedRecaptcha();\r\n const response = recaptcha.getResponse(id);\r\n if (response) {\r\n return response;\r\n }\r\n return new Promise(resolve => {\r\n const tokenChange = (token) => {\r\n if (!token) {\r\n return; // Ignore token expirations.\r\n }\r\n this.tokenChangeListeners.delete(tokenChange);\r\n resolve(token);\r\n };\r\n this.tokenChangeListeners.add(tokenChange);\r\n if (this.isInvisible) {\r\n recaptcha.execute(id);\r\n }\r\n });\r\n }\r\n /**\r\n * Renders the reCAPTCHA widget on the page.\r\n *\r\n * @returns A Promise that resolves with the reCAPTCHA widget ID.\r\n */\r\n render() {\r\n try {\r\n this.assertNotDestroyed();\r\n }\r\n catch (e) {\r\n // This method returns a promise. Since it's not async (we want to return the\r\n // _same_ promise if rendering is still occurring), the API surface should\r\n // reject with the error rather than just throw\r\n return Promise.reject(e);\r\n }\r\n if (this.renderPromise) {\r\n return this.renderPromise;\r\n }\r\n this.renderPromise = this.makeRenderPromise().catch(e => {\r\n this.renderPromise = null;\r\n throw e;\r\n });\r\n return this.renderPromise;\r\n }\r\n /** @internal */\r\n _reset() {\r\n this.assertNotDestroyed();\r\n if (this.widgetId !== null) {\r\n this.getAssertedRecaptcha().reset(this.widgetId);\r\n }\r\n }\r\n /**\r\n * Clears the reCAPTCHA widget from the page and destroys the instance.\r\n */\r\n clear() {\r\n this.assertNotDestroyed();\r\n this.destroyed = true;\r\n this._recaptchaLoader.clearedOneInstance();\r\n if (!this.isInvisible) {\r\n this.container.childNodes.forEach(node => {\r\n this.container.removeChild(node);\r\n });\r\n }\r\n }\r\n validateStartingState() {\r\n _assert(!this.parameters.sitekey, this.auth, \"argument-error\" /* ARGUMENT_ERROR */);\r\n _assert(this.isInvisible || !this.container.hasChildNodes(), this.auth, \"argument-error\" /* ARGUMENT_ERROR */);\r\n _assert(typeof document !== 'undefined', this.auth, \"operation-not-supported-in-this-environment\" /* OPERATION_NOT_SUPPORTED */);\r\n }\r\n makeTokenCallback(existing) {\r\n return token => {\r\n this.tokenChangeListeners.forEach(listener => listener(token));\r\n if (typeof existing === 'function') {\r\n existing(token);\r\n }\r\n else if (typeof existing === 'string') {\r\n const globalFunc = _window()[existing];\r\n if (typeof globalFunc === 'function') {\r\n globalFunc(token);\r\n }\r\n }\r\n };\r\n }\r\n assertNotDestroyed() {\r\n _assert(!this.destroyed, this.auth, \"internal-error\" /* INTERNAL_ERROR */);\r\n }\r\n async makeRenderPromise() {\r\n await this.init();\r\n if (!this.widgetId) {\r\n let container = this.container;\r\n if (!this.isInvisible) {\r\n const guaranteedEmpty = document.createElement('div');\r\n container.appendChild(guaranteedEmpty);\r\n container = guaranteedEmpty;\r\n }\r\n this.widgetId = this.getAssertedRecaptcha().render(container, this.parameters);\r\n }\r\n return this.widgetId;\r\n }\r\n async init() {\r\n _assert(_isHttpOrHttps() && !_isWorker(), this.auth, \"internal-error\" /* INTERNAL_ERROR */);\r\n await domReady();\r\n this.recaptcha = await this._recaptchaLoader.load(this.auth, this.auth.languageCode || undefined);\r\n const siteKey = await getRecaptchaParams(this.auth);\r\n _assert(siteKey, this.auth, \"internal-error\" /* INTERNAL_ERROR */);\r\n this.parameters.sitekey = siteKey;\r\n }\r\n getAssertedRecaptcha() {\r\n _assert(this.recaptcha, this.auth, \"internal-error\" /* INTERNAL_ERROR */);\r\n return this.recaptcha;\r\n }\r\n}\r\nfunction domReady() {\r\n let resolver = null;\r\n return new Promise(resolve => {\r\n if (document.readyState === 'complete') {\r\n resolve();\r\n return;\r\n }\r\n // Document not ready, wait for load before resolving.\r\n // Save resolver, so we can remove listener in case it was externally\r\n // cancelled.\r\n resolver = () => resolve();\r\n window.addEventListener('load', resolver);\r\n }).catch(e => {\r\n if (resolver) {\r\n window.removeEventListener('load', resolver);\r\n }\r\n throw e;\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\nclass ConfirmationResultImpl {\r\n constructor(verificationId, onConfirmation) {\r\n this.verificationId = verificationId;\r\n this.onConfirmation = onConfirmation;\r\n }\r\n confirm(verificationCode) {\r\n const authCredential = PhoneAuthCredential._fromVerification(this.verificationId, verificationCode);\r\n return this.onConfirmation(authCredential);\r\n }\r\n}\r\n/**\r\n * Asynchronously signs in using a phone number.\r\n *\r\n * @remarks\r\n * This method sends a code via SMS to the given\r\n * phone number, and returns a {@link ConfirmationResult}. After the user\r\n * provides the code sent to their phone, call {@link ConfirmationResult.confirm}\r\n * with the code to sign the user in.\r\n *\r\n * For abuse prevention, this method also requires a {@link ApplicationVerifier}.\r\n * This SDK includes a reCAPTCHA-based implementation, {@link RecaptchaVerifier}.\r\n * This function can work on other platforms that do not support the\r\n * {@link RecaptchaVerifier} (like React Native), but you need to use a\r\n * third-party {@link ApplicationVerifier} implementation.\r\n *\r\n * @example\r\n * ```javascript\r\n * // 'recaptcha-container' is the ID of an element in the DOM.\r\n * const applicationVerifier = new firebase.auth.RecaptchaVerifier('recaptcha-container');\r\n * const confirmationResult = await signInWithPhoneNumber(auth, phoneNumber, applicationVerifier);\r\n * // Obtain a verificationCode from the user.\r\n * const credential = await confirmationResult.confirm(verificationCode);\r\n * ```\r\n *\r\n * @param auth - The {@link Auth} instance.\r\n * @param phoneNumber - The user's phone number in E.164 format (e.g. +16505550101).\r\n * @param appVerifier - The {@link ApplicationVerifier}.\r\n *\r\n * @public\r\n */\r\nasync function signInWithPhoneNumber(auth, phoneNumber, appVerifier) {\r\n const authInternal = _castAuth(auth);\r\n const verificationId = await _verifyPhoneNumber(authInternal, phoneNumber, getModularInstance(appVerifier));\r\n return new ConfirmationResultImpl(verificationId, cred => signInWithCredential(authInternal, cred));\r\n}\r\n/**\r\n * Links the user account with the given phone number.\r\n *\r\n * @param user - The user.\r\n * @param phoneNumber - The user's phone number in E.164 format (e.g. +16505550101).\r\n * @param appVerifier - The {@link ApplicationVerifier}.\r\n *\r\n * @public\r\n */\r\nasync function linkWithPhoneNumber(user, phoneNumber, appVerifier) {\r\n const userInternal = getModularInstance(user);\r\n await _assertLinkedStatus(false, userInternal, \"phone\" /* PHONE */);\r\n const verificationId = await _verifyPhoneNumber(userInternal.auth, phoneNumber, getModularInstance(appVerifier));\r\n return new ConfirmationResultImpl(verificationId, cred => linkWithCredential(userInternal, cred));\r\n}\r\n/**\r\n * Re-authenticates a user using a fresh phone credential.\r\n *\r\n * @remarks Use before operations such as {@link updatePassword} that require tokens from recent sign-in attempts.\r\n *\r\n * @param user - The user.\r\n * @param phoneNumber - The user's phone number in E.164 format (e.g. +16505550101).\r\n * @param appVerifier - The {@link ApplicationVerifier}.\r\n *\r\n * @public\r\n */\r\nasync function reauthenticateWithPhoneNumber(user, phoneNumber, appVerifier) {\r\n const userInternal = getModularInstance(user);\r\n const verificationId = await _verifyPhoneNumber(userInternal.auth, phoneNumber, getModularInstance(appVerifier));\r\n return new ConfirmationResultImpl(verificationId, cred => reauthenticateWithCredential(userInternal, cred));\r\n}\r\n/**\r\n * Returns a verification ID to be used in conjunction with the SMS code that is sent.\r\n *\r\n */\r\nasync function _verifyPhoneNumber(auth, options, verifier) {\r\n var _a;\r\n const recaptchaToken = await verifier.verify();\r\n try {\r\n _assert(typeof recaptchaToken === 'string', auth, \"argument-error\" /* ARGUMENT_ERROR */);\r\n _assert(verifier.type === RECAPTCHA_VERIFIER_TYPE, auth, \"argument-error\" /* ARGUMENT_ERROR */);\r\n let phoneInfoOptions;\r\n if (typeof options === 'string') {\r\n phoneInfoOptions = {\r\n phoneNumber: options\r\n };\r\n }\r\n else {\r\n phoneInfoOptions = options;\r\n }\r\n if ('session' in phoneInfoOptions) {\r\n const session = phoneInfoOptions.session;\r\n if ('phoneNumber' in phoneInfoOptions) {\r\n _assert(session.type === \"enroll\" /* ENROLL */, auth, \"internal-error\" /* INTERNAL_ERROR */);\r\n const response = await startEnrollPhoneMfa(auth, {\r\n idToken: session.credential,\r\n phoneEnrollmentInfo: {\r\n phoneNumber: phoneInfoOptions.phoneNumber,\r\n recaptchaToken\r\n }\r\n });\r\n return response.phoneSessionInfo.sessionInfo;\r\n }\r\n else {\r\n _assert(session.type === \"signin\" /* SIGN_IN */, auth, \"internal-error\" /* INTERNAL_ERROR */);\r\n const mfaEnrollmentId = ((_a = phoneInfoOptions.multiFactorHint) === null || _a === void 0 ? void 0 : _a.uid) ||\r\n phoneInfoOptions.multiFactorUid;\r\n _assert(mfaEnrollmentId, auth, \"missing-multi-factor-info\" /* MISSING_MFA_INFO */);\r\n const response = await startSignInPhoneMfa(auth, {\r\n mfaPendingCredential: session.credential,\r\n mfaEnrollmentId,\r\n phoneSignInInfo: {\r\n recaptchaToken\r\n }\r\n });\r\n return response.phoneResponseInfo.sessionInfo;\r\n }\r\n }\r\n else {\r\n const { sessionInfo } = await sendPhoneVerificationCode(auth, {\r\n phoneNumber: phoneInfoOptions.phoneNumber,\r\n recaptchaToken\r\n });\r\n return sessionInfo;\r\n }\r\n }\r\n finally {\r\n verifier._reset();\r\n }\r\n}\r\n/**\r\n * Updates the user's phone number.\r\n *\r\n * @example\r\n * ```\r\n * // 'recaptcha-container' is the ID of an element in the DOM.\r\n * const applicationVerifier = new RecaptchaVerifier('recaptcha-container');\r\n * const provider = new PhoneAuthProvider(auth);\r\n * const verificationId = await provider.verifyPhoneNumber('+16505550101', applicationVerifier);\r\n * // Obtain the verificationCode from the user.\r\n * const phoneCredential = PhoneAuthProvider.credential(verificationId, verificationCode);\r\n * await updatePhoneNumber(user, phoneCredential);\r\n * ```\r\n *\r\n * @param user - The user.\r\n * @param credential - A credential authenticating the new phone number.\r\n *\r\n * @public\r\n */\r\nasync function updatePhoneNumber(user, credential) {\r\n await _link$1(getModularInstance(user), credential);\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 * Provider for generating an {@link PhoneAuthCredential}.\r\n *\r\n * @example\r\n * ```javascript\r\n * // 'recaptcha-container' is the ID of an element in the DOM.\r\n * const applicationVerifier = new RecaptchaVerifier('recaptcha-container');\r\n * const provider = new PhoneAuthProvider(auth);\r\n * const verificationId = await provider.verifyPhoneNumber('+16505550101', applicationVerifier);\r\n * // Obtain the verificationCode from the user.\r\n * const phoneCredential = PhoneAuthProvider.credential(verificationId, verificationCode);\r\n * const userCredential = await signInWithCredential(auth, phoneCredential);\r\n * ```\r\n *\r\n * @public\r\n */\r\nclass PhoneAuthProvider {\r\n /**\r\n * @param auth - The Firebase {@link Auth} instance in which sign-ins should occur.\r\n *\r\n */\r\n constructor(auth) {\r\n /** Always set to {@link ProviderId}.PHONE. */\r\n this.providerId = PhoneAuthProvider.PROVIDER_ID;\r\n this.auth = _castAuth(auth);\r\n }\r\n /**\r\n *\r\n * Starts a phone number authentication flow by sending a verification code to the given phone\r\n * number.\r\n *\r\n * @example\r\n * ```javascript\r\n * const provider = new PhoneAuthProvider(auth);\r\n * const verificationId = await provider.verifyPhoneNumber(phoneNumber, applicationVerifier);\r\n * // Obtain verificationCode from the user.\r\n * const authCredential = PhoneAuthProvider.credential(verificationId, verificationCode);\r\n * const userCredential = await signInWithCredential(auth, authCredential);\r\n * ```\r\n *\r\n * @example\r\n * An alternative flow is provided using the `signInWithPhoneNumber` method.\r\n * ```javascript\r\n * const confirmationResult = signInWithPhoneNumber(auth, phoneNumber, applicationVerifier);\r\n * // Obtain verificationCode from the user.\r\n * const userCredential = confirmationResult.confirm(verificationCode);\r\n * ```\r\n *\r\n * @param phoneInfoOptions - The user's {@link PhoneInfoOptions}. The phone number should be in\r\n * E.164 format (e.g. +16505550101).\r\n * @param applicationVerifier - For abuse prevention, this method also requires a\r\n * {@link ApplicationVerifier}. This SDK includes a reCAPTCHA-based implementation,\r\n * {@link RecaptchaVerifier}.\r\n *\r\n * @returns A Promise for a verification ID that can be passed to\r\n * {@link PhoneAuthProvider.credential} to identify this flow..\r\n */\r\n verifyPhoneNumber(phoneOptions, applicationVerifier) {\r\n return _verifyPhoneNumber(this.auth, phoneOptions, getModularInstance(applicationVerifier));\r\n }\r\n /**\r\n * Creates a phone auth credential, given the verification ID from\r\n * {@link PhoneAuthProvider.verifyPhoneNumber} and the code that was sent to the user's\r\n * mobile device.\r\n *\r\n * @example\r\n * ```javascript\r\n * const provider = new PhoneAuthProvider(auth);\r\n * const verificationId = provider.verifyPhoneNumber(phoneNumber, applicationVerifier);\r\n * // Obtain verificationCode from the user.\r\n * const authCredential = PhoneAuthProvider.credential(verificationId, verificationCode);\r\n * const userCredential = signInWithCredential(auth, authCredential);\r\n * ```\r\n *\r\n * @example\r\n * An alternative flow is provided using the `signInWithPhoneNumber` method.\r\n * ```javascript\r\n * const confirmationResult = await signInWithPhoneNumber(auth, phoneNumber, applicationVerifier);\r\n * // Obtain verificationCode from the user.\r\n * const userCredential = await confirmationResult.confirm(verificationCode);\r\n * ```\r\n *\r\n * @param verificationId - The verification ID returned from {@link PhoneAuthProvider.verifyPhoneNumber}.\r\n * @param verificationCode - The verification code sent to the user's mobile device.\r\n *\r\n * @returns The auth provider credential.\r\n */\r\n static credential(verificationId, verificationCode) {\r\n return PhoneAuthCredential._fromVerification(verificationId, verificationCode);\r\n }\r\n /**\r\n * Generates an {@link AuthCredential} from a {@link UserCredential}.\r\n * @param userCredential - The user credential.\r\n */\r\n static credentialFromResult(userCredential) {\r\n const credential = userCredential;\r\n return PhoneAuthProvider.credentialFromTaggedObject(credential);\r\n }\r\n /**\r\n * Returns an {@link AuthCredential} when passed an error.\r\n *\r\n * @remarks\r\n *\r\n * This method works for errors like\r\n * `auth/account-exists-with-different-credentials`. This is useful for\r\n * recovering when attempting to set a user's phone number but the number\r\n * in question is already tied to another account. For example, the following\r\n * code tries to update the current user's phone number, and if that\r\n * fails, links the user with the account associated with that number:\r\n *\r\n * ```js\r\n * const provider = new PhoneAuthProvider(auth);\r\n * const verificationId = await provider.verifyPhoneNumber(number, verifier);\r\n * try {\r\n * const code = ''; // Prompt the user for the verification code\r\n * await updatePhoneNumber(\r\n * auth.currentUser,\r\n * PhoneAuthProvider.credential(verificationId, code));\r\n * } catch (e) {\r\n * if ((e as FirebaseError)?.code === 'auth/account-exists-with-different-credential') {\r\n * const cred = PhoneAuthProvider.credentialFromError(e);\r\n * await linkWithCredential(auth.currentUser, cred);\r\n * }\r\n * }\r\n *\r\n * // At this point, auth.currentUser.phoneNumber === number.\r\n * ```\r\n *\r\n * @param error - The error to generate a credential from.\r\n */\r\n static credentialFromError(error) {\r\n return PhoneAuthProvider.credentialFromTaggedObject((error.customData || {}));\r\n }\r\n static credentialFromTaggedObject({ _tokenResponse: tokenResponse }) {\r\n if (!tokenResponse) {\r\n return null;\r\n }\r\n const { phoneNumber, temporaryProof } = tokenResponse;\r\n if (phoneNumber && temporaryProof) {\r\n return PhoneAuthCredential._fromTokenResponse(phoneNumber, temporaryProof);\r\n }\r\n return null;\r\n }\r\n}\r\n/** Always set to {@link ProviderId}.PHONE. */\r\nPhoneAuthProvider.PROVIDER_ID = \"phone\" /* PHONE */;\r\n/** Always set to {@link SignInMethod}.PHONE. */\r\nPhoneAuthProvider.PHONE_SIGN_IN_METHOD = \"phone\" /* PHONE */;\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\n/**\r\n * Chooses a popup/redirect resolver to use. This prefers the override (which\r\n * is directly passed in), and falls back to the property set on the auth\r\n * object. If neither are available, this function errors w/ an argument error.\r\n */\r\nfunction _withDefaultResolver(auth, resolverOverride) {\r\n if (resolverOverride) {\r\n return _getInstance(resolverOverride);\r\n }\r\n _assert(auth._popupRedirectResolver, auth, \"argument-error\" /* ARGUMENT_ERROR */);\r\n return auth._popupRedirectResolver;\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\nclass IdpCredential extends AuthCredential {\r\n constructor(params) {\r\n super(\"custom\" /* CUSTOM */, \"custom\" /* CUSTOM */);\r\n this.params = params;\r\n }\r\n _getIdTokenResponse(auth) {\r\n return signInWithIdp(auth, this._buildIdpRequest());\r\n }\r\n _linkToIdToken(auth, idToken) {\r\n return signInWithIdp(auth, this._buildIdpRequest(idToken));\r\n }\r\n _getReauthenticationResolver(auth) {\r\n return signInWithIdp(auth, this._buildIdpRequest());\r\n }\r\n _buildIdpRequest(idToken) {\r\n const request = {\r\n requestUri: this.params.requestUri,\r\n sessionId: this.params.sessionId,\r\n postBody: this.params.postBody,\r\n tenantId: this.params.tenantId,\r\n pendingToken: this.params.pendingToken,\r\n returnSecureToken: true,\r\n returnIdpCredential: true\r\n };\r\n if (idToken) {\r\n request.idToken = idToken;\r\n }\r\n return request;\r\n }\r\n}\r\nfunction _signIn(params) {\r\n return _signInWithCredential(params.auth, new IdpCredential(params), params.bypassAuthState);\r\n}\r\nfunction _reauth(params) {\r\n const { auth, user } = params;\r\n _assert(user, auth, \"internal-error\" /* INTERNAL_ERROR */);\r\n return _reauthenticate(user, new IdpCredential(params), params.bypassAuthState);\r\n}\r\nasync function _link(params) {\r\n const { auth, user } = params;\r\n _assert(user, auth, \"internal-error\" /* INTERNAL_ERROR */);\r\n return _link$1(user, new IdpCredential(params), params.bypassAuthState);\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 * Popup event manager. Handles the popup's entire lifecycle; listens to auth\r\n * events\r\n */\r\nclass AbstractPopupRedirectOperation {\r\n constructor(auth, filter, resolver, user, bypassAuthState = false) {\r\n this.auth = auth;\r\n this.resolver = resolver;\r\n this.user = user;\r\n this.bypassAuthState = bypassAuthState;\r\n this.pendingPromise = null;\r\n this.eventManager = null;\r\n this.filter = Array.isArray(filter) ? filter : [filter];\r\n }\r\n execute() {\r\n return new Promise(async (resolve, reject) => {\r\n this.pendingPromise = { resolve, reject };\r\n try {\r\n this.eventManager = await this.resolver._initialize(this.auth);\r\n await this.onExecution();\r\n this.eventManager.registerConsumer(this);\r\n }\r\n catch (e) {\r\n this.reject(e);\r\n }\r\n });\r\n }\r\n async onAuthEvent(event) {\r\n const { urlResponse, sessionId, postBody, tenantId, error, type } = event;\r\n if (error) {\r\n this.reject(error);\r\n return;\r\n }\r\n const params = {\r\n auth: this.auth,\r\n requestUri: urlResponse,\r\n sessionId: sessionId,\r\n tenantId: tenantId || undefined,\r\n postBody: postBody || undefined,\r\n user: this.user,\r\n bypassAuthState: this.bypassAuthState\r\n };\r\n try {\r\n this.resolve(await this.getIdpTask(type)(params));\r\n }\r\n catch (e) {\r\n this.reject(e);\r\n }\r\n }\r\n onError(error) {\r\n this.reject(error);\r\n }\r\n getIdpTask(type) {\r\n switch (type) {\r\n case \"signInViaPopup\" /* SIGN_IN_VIA_POPUP */:\r\n case \"signInViaRedirect\" /* SIGN_IN_VIA_REDIRECT */:\r\n return _signIn;\r\n case \"linkViaPopup\" /* LINK_VIA_POPUP */:\r\n case \"linkViaRedirect\" /* LINK_VIA_REDIRECT */:\r\n return _link;\r\n case \"reauthViaPopup\" /* REAUTH_VIA_POPUP */:\r\n case \"reauthViaRedirect\" /* REAUTH_VIA_REDIRECT */:\r\n return _reauth;\r\n default:\r\n _fail(this.auth, \"internal-error\" /* INTERNAL_ERROR */);\r\n }\r\n }\r\n resolve(cred) {\r\n debugAssert(this.pendingPromise, 'Pending promise was never set');\r\n this.pendingPromise.resolve(cred);\r\n this.unregisterAndCleanUp();\r\n }\r\n reject(error) {\r\n debugAssert(this.pendingPromise, 'Pending promise was never set');\r\n this.pendingPromise.reject(error);\r\n this.unregisterAndCleanUp();\r\n }\r\n unregisterAndCleanUp() {\r\n if (this.eventManager) {\r\n this.eventManager.unregisterConsumer(this);\r\n }\r\n this.pendingPromise = null;\r\n this.cleanUp();\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 _POLL_WINDOW_CLOSE_TIMEOUT = new Delay(2000, 10000);\r\n/**\r\n * Authenticates a Firebase client using a popup-based OAuth authentication flow.\r\n *\r\n * @remarks\r\n * If succeeds, returns the signed in user along with the provider's credential. If sign in was\r\n * unsuccessful, returns an error object containing additional information about the error.\r\n *\r\n * @example\r\n * ```javascript\r\n * // Sign in using a popup.\r\n * const provider = new FacebookAuthProvider();\r\n * const result = await signInWithPopup(auth, provider);\r\n *\r\n * // The signed-in user info.\r\n * const user = result.user;\r\n * // This gives you a Facebook Access Token.\r\n * const credential = provider.credentialFromResult(auth, result);\r\n * const token = credential.accessToken;\r\n * ```\r\n *\r\n * @param auth - The {@link Auth} instance.\r\n * @param provider - The provider to authenticate. The provider has to be an {@link OAuthProvider}.\r\n * Non-OAuth providers like {@link EmailAuthProvider} will throw an error.\r\n * @param resolver - An instance of {@link PopupRedirectResolver}, optional\r\n * if already supplied to {@link initializeAuth} or provided by {@link getAuth}.\r\n *\r\n *\r\n * @public\r\n */\r\nasync function signInWithPopup(auth, provider, resolver) {\r\n const authInternal = _castAuth(auth);\r\n _assertInstanceOf(auth, provider, FederatedAuthProvider);\r\n const resolverInternal = _withDefaultResolver(authInternal, resolver);\r\n const action = new PopupOperation(authInternal, \"signInViaPopup\" /* SIGN_IN_VIA_POPUP */, provider, resolverInternal);\r\n return action.executeNotNull();\r\n}\r\n/**\r\n * Reauthenticates the current user with the specified {@link OAuthProvider} using a pop-up based\r\n * OAuth flow.\r\n *\r\n * @remarks\r\n * If the reauthentication is successful, the returned result will contain the user and the\r\n * provider's credential.\r\n *\r\n * @example\r\n * ```javascript\r\n * // Sign in using a popup.\r\n * const provider = new FacebookAuthProvider();\r\n * const result = await signInWithPopup(auth, provider);\r\n * // Reauthenticate using a popup.\r\n * await reauthenticateWithPopup(result.user, provider);\r\n * ```\r\n *\r\n * @param user - The user.\r\n * @param provider - The provider to authenticate. The provider has to be an {@link OAuthProvider}.\r\n * Non-OAuth providers like {@link EmailAuthProvider} will throw an error.\r\n * @param resolver - An instance of {@link PopupRedirectResolver}, optional\r\n * if already supplied to {@link initializeAuth} or provided by {@link getAuth}.\r\n *\r\n * @public\r\n */\r\nasync function reauthenticateWithPopup(user, provider, resolver) {\r\n const userInternal = getModularInstance(user);\r\n _assertInstanceOf(userInternal.auth, provider, FederatedAuthProvider);\r\n const resolverInternal = _withDefaultResolver(userInternal.auth, resolver);\r\n const action = new PopupOperation(userInternal.auth, \"reauthViaPopup\" /* REAUTH_VIA_POPUP */, provider, resolverInternal, userInternal);\r\n return action.executeNotNull();\r\n}\r\n/**\r\n * Links the authenticated provider to the user account using a pop-up based OAuth flow.\r\n *\r\n * @remarks\r\n * If the linking is successful, the returned result will contain the user and the provider's credential.\r\n *\r\n *\r\n * @example\r\n * ```javascript\r\n * // Sign in using some other provider.\r\n * const result = await signInWithEmailAndPassword(auth, email, password);\r\n * // Link using a popup.\r\n * const provider = new FacebookAuthProvider();\r\n * await linkWithPopup(result.user, provider);\r\n * ```\r\n *\r\n * @param user - The user.\r\n * @param provider - The provider to authenticate. The provider has to be an {@link OAuthProvider}.\r\n * Non-OAuth providers like {@link EmailAuthProvider} will throw an error.\r\n * @param resolver - An instance of {@link PopupRedirectResolver}, optional\r\n * if already supplied to {@link initializeAuth} or provided by {@link getAuth}.\r\n *\r\n * @public\r\n */\r\nasync function linkWithPopup(user, provider, resolver) {\r\n const userInternal = getModularInstance(user);\r\n _assertInstanceOf(userInternal.auth, provider, FederatedAuthProvider);\r\n const resolverInternal = _withDefaultResolver(userInternal.auth, resolver);\r\n const action = new PopupOperation(userInternal.auth, \"linkViaPopup\" /* LINK_VIA_POPUP */, provider, resolverInternal, userInternal);\r\n return action.executeNotNull();\r\n}\r\n/**\r\n * Popup event manager. Handles the popup's entire lifecycle; listens to auth\r\n * events\r\n *\r\n */\r\nclass PopupOperation extends AbstractPopupRedirectOperation {\r\n constructor(auth, filter, provider, resolver, user) {\r\n super(auth, filter, resolver, user);\r\n this.provider = provider;\r\n this.authWindow = null;\r\n this.pollId = null;\r\n if (PopupOperation.currentPopupAction) {\r\n PopupOperation.currentPopupAction.cancel();\r\n }\r\n PopupOperation.currentPopupAction = this;\r\n }\r\n async executeNotNull() {\r\n const result = await this.execute();\r\n _assert(result, this.auth, \"internal-error\" /* INTERNAL_ERROR */);\r\n return result;\r\n }\r\n async onExecution() {\r\n debugAssert(this.filter.length === 1, 'Popup operations only handle one event');\r\n const eventId = _generateEventId();\r\n this.authWindow = await this.resolver._openPopup(this.auth, this.provider, this.filter[0], // There's always one, see constructor\r\n eventId);\r\n this.authWindow.associatedEvent = eventId;\r\n // Check for web storage support and origin validation _after_ the popup is\r\n // loaded. These operations are slow (~1 second or so) Rather than\r\n // waiting on them before opening the window, optimistically open the popup\r\n // and check for storage support at the same time. If storage support is\r\n // not available, this will cause the whole thing to reject properly. It\r\n // will also close the popup, but since the promise has already rejected,\r\n // the popup closed by user poll will reject into the void.\r\n this.resolver._originValidation(this.auth).catch(e => {\r\n this.reject(e);\r\n });\r\n this.resolver._isIframeWebStorageSupported(this.auth, isSupported => {\r\n if (!isSupported) {\r\n this.reject(_createError(this.auth, \"web-storage-unsupported\" /* WEB_STORAGE_UNSUPPORTED */));\r\n }\r\n });\r\n // Handle user closure. Notice this does *not* use await\r\n this.pollUserCancellation();\r\n }\r\n get eventId() {\r\n var _a;\r\n return ((_a = this.authWindow) === null || _a === void 0 ? void 0 : _a.associatedEvent) || null;\r\n }\r\n cancel() {\r\n this.reject(_createError(this.auth, \"cancelled-popup-request\" /* EXPIRED_POPUP_REQUEST */));\r\n }\r\n cleanUp() {\r\n if (this.authWindow) {\r\n this.authWindow.close();\r\n }\r\n if (this.pollId) {\r\n window.clearTimeout(this.pollId);\r\n }\r\n this.authWindow = null;\r\n this.pollId = null;\r\n PopupOperation.currentPopupAction = null;\r\n }\r\n pollUserCancellation() {\r\n const poll = () => {\r\n var _a, _b;\r\n if ((_b = (_a = this.authWindow) === null || _a === void 0 ? void 0 : _a.window) === null || _b === void 0 ? void 0 : _b.closed) {\r\n // Make sure that there is sufficient time for whatever action to\r\n // complete. The window could have closed but the sign in network\r\n // call could still be in flight.\r\n this.pollId = window.setTimeout(() => {\r\n this.pollId = null;\r\n this.reject(_createError(this.auth, \"popup-closed-by-user\" /* POPUP_CLOSED_BY_USER */));\r\n }, 2000 /* AUTH_EVENT */);\r\n return;\r\n }\r\n this.pollId = window.setTimeout(poll, _POLL_WINDOW_CLOSE_TIMEOUT.get());\r\n };\r\n poll();\r\n }\r\n}\r\n// Only one popup is ever shown at once. The lifecycle of the current popup\r\n// can be managed / cancelled by the constructor.\r\nPopupOperation.currentPopupAction = null;\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 PENDING_REDIRECT_KEY = 'pendingRedirect';\r\n// We only get one redirect outcome for any one auth, so just store it\r\n// in here.\r\nconst redirectOutcomeMap = new Map();\r\nclass RedirectAction extends AbstractPopupRedirectOperation {\r\n constructor(auth, resolver, bypassAuthState = false) {\r\n super(auth, [\r\n \"signInViaRedirect\" /* SIGN_IN_VIA_REDIRECT */,\r\n \"linkViaRedirect\" /* LINK_VIA_REDIRECT */,\r\n \"reauthViaRedirect\" /* REAUTH_VIA_REDIRECT */,\r\n \"unknown\" /* UNKNOWN */\r\n ], resolver, undefined, bypassAuthState);\r\n this.eventId = null;\r\n }\r\n /**\r\n * Override the execute function; if we already have a redirect result, then\r\n * just return it.\r\n */\r\n async execute() {\r\n let readyOutcome = redirectOutcomeMap.get(this.auth._key());\r\n if (!readyOutcome) {\r\n try {\r\n const hasPendingRedirect = await _getAndClearPendingRedirectStatus(this.resolver, this.auth);\r\n const result = hasPendingRedirect ? await super.execute() : null;\r\n readyOutcome = () => Promise.resolve(result);\r\n }\r\n catch (e) {\r\n readyOutcome = () => Promise.reject(e);\r\n }\r\n redirectOutcomeMap.set(this.auth._key(), readyOutcome);\r\n }\r\n // If we're not bypassing auth state, the ready outcome should be set to\r\n // null.\r\n if (!this.bypassAuthState) {\r\n redirectOutcomeMap.set(this.auth._key(), () => Promise.resolve(null));\r\n }\r\n return readyOutcome();\r\n }\r\n async onAuthEvent(event) {\r\n if (event.type === \"signInViaRedirect\" /* SIGN_IN_VIA_REDIRECT */) {\r\n return super.onAuthEvent(event);\r\n }\r\n else if (event.type === \"unknown\" /* UNKNOWN */) {\r\n // This is a sentinel value indicating there's no pending redirect\r\n this.resolve(null);\r\n return;\r\n }\r\n if (event.eventId) {\r\n const user = await this.auth._redirectUserForId(event.eventId);\r\n if (user) {\r\n this.user = user;\r\n return super.onAuthEvent(event);\r\n }\r\n else {\r\n this.resolve(null);\r\n }\r\n }\r\n }\r\n async onExecution() { }\r\n cleanUp() { }\r\n}\r\nasync function _getAndClearPendingRedirectStatus(resolver, auth) {\r\n const key = pendingRedirectKey(auth);\r\n const persistence = resolverPersistence(resolver);\r\n if (!(await persistence._isAvailable())) {\r\n return false;\r\n }\r\n const hasPendingRedirect = (await persistence._get(key)) === 'true';\r\n await persistence._remove(key);\r\n return hasPendingRedirect;\r\n}\r\nasync function _setPendingRedirectStatus(resolver, auth) {\r\n return resolverPersistence(resolver)._set(pendingRedirectKey(auth), 'true');\r\n}\r\nfunction _clearRedirectOutcomes() {\r\n redirectOutcomeMap.clear();\r\n}\r\nfunction _overrideRedirectResult(auth, result) {\r\n redirectOutcomeMap.set(auth._key(), result);\r\n}\r\nfunction resolverPersistence(resolver) {\r\n return _getInstance(resolver._redirectPersistence);\r\n}\r\nfunction pendingRedirectKey(auth) {\r\n return _persistenceKeyName(PENDING_REDIRECT_KEY, auth.config.apiKey, auth.name);\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 * Authenticates a Firebase client using a full-page redirect flow.\r\n *\r\n * @remarks\r\n * To handle the results and errors for this operation, refer to {@link getRedirectResult}.\r\n *\r\n * @example\r\n * ```javascript\r\n * // Sign in using a redirect.\r\n * const provider = new FacebookAuthProvider();\r\n * // You can add additional scopes to the provider:\r\n * provider.addScope('user_birthday');\r\n * // Start a sign in process for an unauthenticated user.\r\n * await signInWithRedirect(auth, provider);\r\n * // This will trigger a full page redirect away from your app\r\n *\r\n * // After returning from the redirect when your app initializes you can obtain the result\r\n * const result = await getRedirectResult(auth);\r\n * if (result) {\r\n * // This is the signed-in user\r\n * const user = result.user;\r\n * // This gives you a Facebook Access Token.\r\n * const credential = provider.credentialFromResult(auth, result);\r\n * const token = credential.accessToken;\r\n * }\r\n * // As this API can be used for sign-in, linking and reauthentication,\r\n * // check the operationType to determine what triggered this redirect\r\n * // operation.\r\n * const operationType = result.operationType;\r\n * ```\r\n *\r\n * @param auth - The {@link Auth} instance.\r\n * @param provider - The provider to authenticate. The provider has to be an {@link OAuthProvider}.\r\n * Non-OAuth providers like {@link EmailAuthProvider} will throw an error.\r\n * @param resolver - An instance of {@link PopupRedirectResolver}, optional\r\n * if already supplied to {@link initializeAuth} or provided by {@link getAuth}.\r\n *\r\n * @public\r\n */\r\nfunction signInWithRedirect(auth, provider, resolver) {\r\n return _signInWithRedirect(auth, provider, resolver);\r\n}\r\nasync function _signInWithRedirect(auth, provider, resolver) {\r\n const authInternal = _castAuth(auth);\r\n _assertInstanceOf(auth, provider, FederatedAuthProvider);\r\n const resolverInternal = _withDefaultResolver(authInternal, resolver);\r\n await _setPendingRedirectStatus(resolverInternal, authInternal);\r\n return resolverInternal._openRedirect(authInternal, provider, \"signInViaRedirect\" /* SIGN_IN_VIA_REDIRECT */);\r\n}\r\n/**\r\n * Reauthenticates the current user with the specified {@link OAuthProvider} using a full-page redirect flow.\r\n *\r\n * @example\r\n * ```javascript\r\n * // Sign in using a redirect.\r\n * const provider = new FacebookAuthProvider();\r\n * const result = await signInWithRedirect(auth, provider);\r\n * // This will trigger a full page redirect away from your app\r\n *\r\n * // After returning from the redirect when your app initializes you can obtain the result\r\n * const result = await getRedirectResult(auth);\r\n * // Link using a redirect.\r\n * await linkWithRedirect(result.user, provider);\r\n * // This will again trigger a full page redirect away from your app\r\n *\r\n * // After returning from the redirect when your app initializes you can obtain the result\r\n * const result = await getRedirectResult(auth);\r\n * ```\r\n *\r\n * @param user - The user.\r\n * @param provider - The provider to authenticate. The provider has to be an {@link OAuthProvider}.\r\n * Non-OAuth providers like {@link EmailAuthProvider} will throw an error.\r\n * @param resolver - An instance of {@link PopupRedirectResolver}, optional\r\n * if already supplied to {@link initializeAuth} or provided by {@link getAuth}.\r\n *\r\n * @public\r\n */\r\nfunction reauthenticateWithRedirect(user, provider, resolver) {\r\n return _reauthenticateWithRedirect(user, provider, resolver);\r\n}\r\nasync function _reauthenticateWithRedirect(user, provider, resolver) {\r\n const userInternal = getModularInstance(user);\r\n _assertInstanceOf(userInternal.auth, provider, FederatedAuthProvider);\r\n // Allow the resolver to error before persisting the redirect user\r\n const resolverInternal = _withDefaultResolver(userInternal.auth, resolver);\r\n await _setPendingRedirectStatus(resolverInternal, userInternal.auth);\r\n const eventId = await prepareUserForRedirect(userInternal);\r\n return resolverInternal._openRedirect(userInternal.auth, provider, \"reauthViaRedirect\" /* REAUTH_VIA_REDIRECT */, eventId);\r\n}\r\n/**\r\n * Links the {@link OAuthProvider} to the user account using a full-page redirect flow.\r\n *\r\n * @example\r\n * ```javascript\r\n * // Sign in using some other provider.\r\n * const result = await signInWithEmailAndPassword(auth, email, password);\r\n * // Link using a redirect.\r\n * const provider = new FacebookAuthProvider();\r\n * await linkWithRedirect(result.user, provider);\r\n * // This will trigger a full page redirect away from your app\r\n *\r\n * // After returning from the redirect when your app initializes you can obtain the result\r\n * const result = await getRedirectResult(auth);\r\n * ```\r\n *\r\n * @param user - The user.\r\n * @param provider - The provider to authenticate. The provider has to be an {@link OAuthProvider}.\r\n * Non-OAuth providers like {@link EmailAuthProvider} will throw an error.\r\n * @param resolver - An instance of {@link PopupRedirectResolver}, optional\r\n * if already supplied to {@link initializeAuth} or provided by {@link getAuth}.\r\n *\r\n *\r\n * @public\r\n */\r\nfunction linkWithRedirect(user, provider, resolver) {\r\n return _linkWithRedirect(user, provider, resolver);\r\n}\r\nasync function _linkWithRedirect(user, provider, resolver) {\r\n const userInternal = getModularInstance(user);\r\n _assertInstanceOf(userInternal.auth, provider, FederatedAuthProvider);\r\n // Allow the resolver to error before persisting the redirect user\r\n const resolverInternal = _withDefaultResolver(userInternal.auth, resolver);\r\n await _assertLinkedStatus(false, userInternal, provider.providerId);\r\n await _setPendingRedirectStatus(resolverInternal, userInternal.auth);\r\n const eventId = await prepareUserForRedirect(userInternal);\r\n return resolverInternal._openRedirect(userInternal.auth, provider, \"linkViaRedirect\" /* LINK_VIA_REDIRECT */, eventId);\r\n}\r\n/**\r\n * Returns a {@link UserCredential} from the redirect-based sign-in flow.\r\n *\r\n * @remarks\r\n * If sign-in succeeded, returns the signed in user. If sign-in was unsuccessful, fails with an\r\n * error. If no redirect operation was called, returns a {@link UserCredential}\r\n * with a null `user`.\r\n *\r\n * @example\r\n * ```javascript\r\n * // Sign in using a redirect.\r\n * const provider = new FacebookAuthProvider();\r\n * // You can add additional scopes to the provider:\r\n * provider.addScope('user_birthday');\r\n * // Start a sign in process for an unauthenticated user.\r\n * await signInWithRedirect(auth, provider);\r\n * // This will trigger a full page redirect away from your app\r\n *\r\n * // After returning from the redirect when your app initializes you can obtain the result\r\n * const result = await getRedirectResult(auth);\r\n * if (result) {\r\n * // This is the signed-in user\r\n * const user = result.user;\r\n * // This gives you a Facebook Access Token.\r\n * const credential = provider.credentialFromResult(auth, result);\r\n * const token = credential.accessToken;\r\n * }\r\n * // As this API can be used for sign-in, linking and reauthentication,\r\n * // check the operationType to determine what triggered this redirect\r\n * // operation.\r\n * const operationType = result.operationType;\r\n * ```\r\n *\r\n * @param auth - The {@link Auth} instance.\r\n * @param resolver - An instance of {@link PopupRedirectResolver}, optional\r\n * if already supplied to {@link initializeAuth} or provided by {@link getAuth}.\r\n *\r\n * @public\r\n */\r\nasync function getRedirectResult(auth, resolver) {\r\n await _castAuth(auth)._initializationPromise;\r\n return _getRedirectResult(auth, resolver, false);\r\n}\r\nasync function _getRedirectResult(auth, resolverExtern, bypassAuthState = false) {\r\n const authInternal = _castAuth(auth);\r\n const resolver = _withDefaultResolver(authInternal, resolverExtern);\r\n const action = new RedirectAction(authInternal, resolver, bypassAuthState);\r\n const result = await action.execute();\r\n if (result && !bypassAuthState) {\r\n delete result.user._redirectEventId;\r\n await authInternal._persistUserIfCurrent(result.user);\r\n await authInternal._setRedirectUser(null, resolverExtern);\r\n }\r\n return result;\r\n}\r\nasync function prepareUserForRedirect(user) {\r\n const eventId = _generateEventId(`${user.uid}:::`);\r\n user._redirectEventId = eventId;\r\n await user.auth._setRedirectUser(user);\r\n await user.auth._persistUserIfCurrent(user);\r\n return eventId;\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// The amount of time to store the UIDs of seen events; this is\r\n// set to 10 min by default\r\nconst EVENT_DUPLICATION_CACHE_DURATION_MS = 10 * 60 * 1000;\r\nclass AuthEventManager {\r\n constructor(auth) {\r\n this.auth = auth;\r\n this.cachedEventUids = new Set();\r\n this.consumers = new Set();\r\n this.queuedRedirectEvent = null;\r\n this.hasHandledPotentialRedirect = false;\r\n this.lastProcessedEventTime = Date.now();\r\n }\r\n registerConsumer(authEventConsumer) {\r\n this.consumers.add(authEventConsumer);\r\n if (this.queuedRedirectEvent &&\r\n this.isEventForConsumer(this.queuedRedirectEvent, authEventConsumer)) {\r\n this.sendToConsumer(this.queuedRedirectEvent, authEventConsumer);\r\n this.saveEventToCache(this.queuedRedirectEvent);\r\n this.queuedRedirectEvent = null;\r\n }\r\n }\r\n unregisterConsumer(authEventConsumer) {\r\n this.consumers.delete(authEventConsumer);\r\n }\r\n onEvent(event) {\r\n // Check if the event has already been handled\r\n if (this.hasEventBeenHandled(event)) {\r\n return false;\r\n }\r\n let handled = false;\r\n this.consumers.forEach(consumer => {\r\n if (this.isEventForConsumer(event, consumer)) {\r\n handled = true;\r\n this.sendToConsumer(event, consumer);\r\n this.saveEventToCache(event);\r\n }\r\n });\r\n if (this.hasHandledPotentialRedirect || !isRedirectEvent(event)) {\r\n // If we've already seen a redirect before, or this is a popup event,\r\n // bail now\r\n return handled;\r\n }\r\n this.hasHandledPotentialRedirect = true;\r\n // If the redirect wasn't handled, hang on to it\r\n if (!handled) {\r\n this.queuedRedirectEvent = event;\r\n handled = true;\r\n }\r\n return handled;\r\n }\r\n sendToConsumer(event, consumer) {\r\n var _a;\r\n if (event.error && !isNullRedirectEvent(event)) {\r\n const code = ((_a = event.error.code) === null || _a === void 0 ? void 0 : _a.split('auth/')[1]) ||\r\n \"internal-error\" /* INTERNAL_ERROR */;\r\n consumer.onError(_createError(this.auth, code));\r\n }\r\n else {\r\n consumer.onAuthEvent(event);\r\n }\r\n }\r\n isEventForConsumer(event, consumer) {\r\n const eventIdMatches = consumer.eventId === null ||\r\n (!!event.eventId && event.eventId === consumer.eventId);\r\n return consumer.filter.includes(event.type) && eventIdMatches;\r\n }\r\n hasEventBeenHandled(event) {\r\n if (Date.now() - this.lastProcessedEventTime >=\r\n EVENT_DUPLICATION_CACHE_DURATION_MS) {\r\n this.cachedEventUids.clear();\r\n }\r\n return this.cachedEventUids.has(eventUid(event));\r\n }\r\n saveEventToCache(event) {\r\n this.cachedEventUids.add(eventUid(event));\r\n this.lastProcessedEventTime = Date.now();\r\n }\r\n}\r\nfunction eventUid(e) {\r\n return [e.type, e.eventId, e.sessionId, e.tenantId].filter(v => v).join('-');\r\n}\r\nfunction isNullRedirectEvent({ type, error }) {\r\n return (type === \"unknown\" /* UNKNOWN */ &&\r\n (error === null || error === void 0 ? void 0 : error.code) === `auth/${\"no-auth-event\" /* NO_AUTH_EVENT */}`);\r\n}\r\nfunction isRedirectEvent(event) {\r\n switch (event.type) {\r\n case \"signInViaRedirect\" /* SIGN_IN_VIA_REDIRECT */:\r\n case \"linkViaRedirect\" /* LINK_VIA_REDIRECT */:\r\n case \"reauthViaRedirect\" /* REAUTH_VIA_REDIRECT */:\r\n return true;\r\n case \"unknown\" /* UNKNOWN */:\r\n return isNullRedirectEvent(event);\r\n default:\r\n return false;\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\nasync function _getProjectConfig(auth, request = {}) {\r\n return _performApiRequest(auth, \"GET\" /* GET */, \"/v1/projects\" /* GET_PROJECT_CONFIG */, request);\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 IP_ADDRESS_REGEX = /^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/;\r\nconst HTTP_REGEX = /^https?/;\r\nasync function _validateOrigin(auth) {\r\n // Skip origin validation if we are in an emulated environment\r\n if (auth.config.emulator) {\r\n return;\r\n }\r\n const { authorizedDomains } = await _getProjectConfig(auth);\r\n for (const domain of authorizedDomains) {\r\n try {\r\n if (matchDomain(domain)) {\r\n return;\r\n }\r\n }\r\n catch (_a) {\r\n // Do nothing if there's a URL error; just continue searching\r\n }\r\n }\r\n // In the old SDK, this error also provides helpful messages.\r\n _fail(auth, \"unauthorized-domain\" /* INVALID_ORIGIN */);\r\n}\r\nfunction matchDomain(expected) {\r\n const currentUrl = _getCurrentUrl();\r\n const { protocol, hostname } = new URL(currentUrl);\r\n if (expected.startsWith('chrome-extension://')) {\r\n const ceUrl = new URL(expected);\r\n if (ceUrl.hostname === '' && hostname === '') {\r\n // For some reason we're not parsing chrome URLs properly\r\n return (protocol === 'chrome-extension:' &&\r\n expected.replace('chrome-extension://', '') ===\r\n currentUrl.replace('chrome-extension://', ''));\r\n }\r\n return protocol === 'chrome-extension:' && ceUrl.hostname === hostname;\r\n }\r\n if (!HTTP_REGEX.test(protocol)) {\r\n return false;\r\n }\r\n if (IP_ADDRESS_REGEX.test(expected)) {\r\n // The domain has to be exactly equal to the pattern, as an IP domain will\r\n // only contain the IP, no extra character.\r\n return hostname === expected;\r\n }\r\n // Dots in pattern should be escaped.\r\n const escapedDomainPattern = expected.replace(/\\./g, '\\\\.');\r\n // Non ip address domains.\r\n // domain.com = *.domain.com OR domain.com\r\n const re = new RegExp('^(.+\\\\.' + escapedDomainPattern + '|' + escapedDomainPattern + ')$', 'i');\r\n return re.test(hostname);\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 NETWORK_TIMEOUT = new Delay(30000, 60000);\r\n/**\r\n * Reset unlaoded GApi modules. If gapi.load fails due to a network error,\r\n * it will stop working after a retrial. This is a hack to fix this issue.\r\n */\r\nfunction resetUnloadedGapiModules() {\r\n // Clear last failed gapi.load state to force next gapi.load to first\r\n // load the failed gapi.iframes module.\r\n // Get gapix.beacon context.\r\n const beacon = _window().___jsl;\r\n // Get current hint.\r\n if (beacon === null || beacon === void 0 ? void 0 : beacon.H) {\r\n // Get gapi hint.\r\n for (const hint of Object.keys(beacon.H)) {\r\n // Requested modules.\r\n beacon.H[hint].r = beacon.H[hint].r || [];\r\n // Loaded modules.\r\n beacon.H[hint].L = beacon.H[hint].L || [];\r\n // Set requested modules to a copy of the loaded modules.\r\n beacon.H[hint].r = [...beacon.H[hint].L];\r\n // Clear pending callbacks.\r\n if (beacon.CP) {\r\n for (let i = 0; i < beacon.CP.length; i++) {\r\n // Remove all failed pending callbacks.\r\n beacon.CP[i] = null;\r\n }\r\n }\r\n }\r\n }\r\n}\r\nfunction loadGapi(auth) {\r\n return new Promise((resolve, reject) => {\r\n var _a, _b, _c;\r\n // Function to run when gapi.load is ready.\r\n function loadGapiIframe() {\r\n // The developer may have tried to previously run gapi.load and failed.\r\n // Run this to fix that.\r\n resetUnloadedGapiModules();\r\n gapi.load('gapi.iframes', {\r\n callback: () => {\r\n resolve(gapi.iframes.getContext());\r\n },\r\n ontimeout: () => {\r\n // The above reset may be sufficient, but having this reset after\r\n // failure ensures that if the developer calls gapi.load after the\r\n // connection is re-established and before another attempt to embed\r\n // the iframe, it would work and would not be broken because of our\r\n // failed attempt.\r\n // Timeout when gapi.iframes.Iframe not loaded.\r\n resetUnloadedGapiModules();\r\n reject(_createError(auth, \"network-request-failed\" /* NETWORK_REQUEST_FAILED */));\r\n },\r\n timeout: NETWORK_TIMEOUT.get()\r\n });\r\n }\r\n if ((_b = (_a = _window().gapi) === null || _a === void 0 ? void 0 : _a.iframes) === null || _b === void 0 ? void 0 : _b.Iframe) {\r\n // If gapi.iframes.Iframe available, resolve.\r\n resolve(gapi.iframes.getContext());\r\n }\r\n else if (!!((_c = _window().gapi) === null || _c === void 0 ? void 0 : _c.load)) {\r\n // Gapi loader ready, load gapi.iframes.\r\n loadGapiIframe();\r\n }\r\n else {\r\n // Create a new iframe callback when this is called so as not to overwrite\r\n // any previous defined callback. This happens if this method is called\r\n // multiple times in parallel and could result in the later callback\r\n // overwriting the previous one. This would end up with a iframe\r\n // timeout.\r\n const cbName = _generateCallbackName('iframefcb');\r\n // GApi loader not available, dynamically load platform.js.\r\n _window()[cbName] = () => {\r\n // GApi loader should be ready.\r\n if (!!gapi.load) {\r\n loadGapiIframe();\r\n }\r\n else {\r\n // Gapi loader failed, throw error.\r\n reject(_createError(auth, \"network-request-failed\" /* NETWORK_REQUEST_FAILED */));\r\n }\r\n };\r\n // Load GApi loader.\r\n return _loadJS(`https://apis.google.com/js/api.js?onload=${cbName}`).catch(e => reject(e));\r\n }\r\n }).catch(error => {\r\n // Reset cached promise to allow for retrial.\r\n cachedGApiLoader = null;\r\n throw error;\r\n });\r\n}\r\nlet cachedGApiLoader = null;\r\nfunction _loadGapi(auth) {\r\n cachedGApiLoader = cachedGApiLoader || loadGapi(auth);\r\n return cachedGApiLoader;\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 PING_TIMEOUT = new Delay(5000, 15000);\r\nconst IFRAME_PATH = '__/auth/iframe';\r\nconst EMULATED_IFRAME_PATH = 'emulator/auth/iframe';\r\nconst IFRAME_ATTRIBUTES = {\r\n style: {\r\n position: 'absolute',\r\n top: '-100px',\r\n width: '1px',\r\n height: '1px'\r\n },\r\n 'aria-hidden': 'true',\r\n tabindex: '-1'\r\n};\r\n// Map from apiHost to endpoint ID for passing into iframe. In current SDK, apiHost can be set to\r\n// anything (not from a list of endpoints with IDs as in legacy), so this is the closest we can get.\r\nconst EID_FROM_APIHOST = new Map([\r\n [\"identitytoolkit.googleapis.com\" /* API_HOST */, 'p'],\r\n ['staging-identitytoolkit.sandbox.googleapis.com', 's'],\r\n ['test-identitytoolkit.sandbox.googleapis.com', 't'] // test\r\n]);\r\nfunction getIframeUrl(auth) {\r\n const config = auth.config;\r\n _assert(config.authDomain, auth, \"auth-domain-config-required\" /* MISSING_AUTH_DOMAIN */);\r\n const url = config.emulator\r\n ? _emulatorUrl(config, EMULATED_IFRAME_PATH)\r\n : `https://${auth.config.authDomain}/${IFRAME_PATH}`;\r\n const params = {\r\n apiKey: config.apiKey,\r\n appName: auth.name,\r\n v: SDK_VERSION\r\n };\r\n const eid = EID_FROM_APIHOST.get(auth.config.apiHost);\r\n if (eid) {\r\n params.eid = eid;\r\n }\r\n const frameworks = auth._getFrameworks();\r\n if (frameworks.length) {\r\n params.fw = frameworks.join(',');\r\n }\r\n return `${url}?${querystring(params).slice(1)}`;\r\n}\r\nasync function _openIframe(auth) {\r\n const context = await _loadGapi(auth);\r\n const gapi = _window().gapi;\r\n _assert(gapi, auth, \"internal-error\" /* INTERNAL_ERROR */);\r\n return context.open({\r\n where: document.body,\r\n url: getIframeUrl(auth),\r\n messageHandlersFilter: gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER,\r\n attributes: IFRAME_ATTRIBUTES,\r\n dontclear: true\r\n }, (iframe) => new Promise(async (resolve, reject) => {\r\n await iframe.restyle({\r\n // Prevent iframe from closing on mouse out.\r\n setHideOnLeave: false\r\n });\r\n const networkError = _createError(auth, \"network-request-failed\" /* NETWORK_REQUEST_FAILED */);\r\n // Confirm iframe is correctly loaded.\r\n // To fallback on failure, set a timeout.\r\n const networkErrorTimer = _window().setTimeout(() => {\r\n reject(networkError);\r\n }, PING_TIMEOUT.get());\r\n // Clear timer and resolve pending iframe ready promise.\r\n function clearTimerAndResolve() {\r\n _window().clearTimeout(networkErrorTimer);\r\n resolve(iframe);\r\n }\r\n // This returns an IThenable. However the reject part does not call\r\n // when the iframe is not loaded.\r\n iframe.ping(clearTimerAndResolve).then(clearTimerAndResolve, () => {\r\n reject(networkError);\r\n });\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 BASE_POPUP_OPTIONS = {\r\n location: 'yes',\r\n resizable: 'yes',\r\n statusbar: 'yes',\r\n toolbar: 'no'\r\n};\r\nconst DEFAULT_WIDTH = 500;\r\nconst DEFAULT_HEIGHT = 600;\r\nconst TARGET_BLANK = '_blank';\r\nconst FIREFOX_EMPTY_URL = 'http://localhost';\r\nclass AuthPopup {\r\n constructor(window) {\r\n this.window = window;\r\n this.associatedEvent = null;\r\n }\r\n close() {\r\n if (this.window) {\r\n try {\r\n this.window.close();\r\n }\r\n catch (e) { }\r\n }\r\n }\r\n}\r\nfunction _open(auth, url, name, width = DEFAULT_WIDTH, height = DEFAULT_HEIGHT) {\r\n const top = Math.max((window.screen.availHeight - height) / 2, 0).toString();\r\n const left = Math.max((window.screen.availWidth - width) / 2, 0).toString();\r\n let target = '';\r\n const options = Object.assign(Object.assign({}, BASE_POPUP_OPTIONS), { width: width.toString(), height: height.toString(), top,\r\n left });\r\n // Chrome iOS 7 and 8 is returning an undefined popup win when target is\r\n // specified, even though the popup is not necessarily blocked.\r\n const ua = getUA().toLowerCase();\r\n if (name) {\r\n target = _isChromeIOS(ua) ? TARGET_BLANK : name;\r\n }\r\n if (_isFirefox(ua)) {\r\n // Firefox complains when invalid URLs are popped out. Hacky way to bypass.\r\n url = url || FIREFOX_EMPTY_URL;\r\n // Firefox disables by default scrolling on popup windows, which can create\r\n // issues when the user has many Google accounts, for instance.\r\n options.scrollbars = 'yes';\r\n }\r\n const optionsString = Object.entries(options).reduce((accum, [key, value]) => `${accum}${key}=${value},`, '');\r\n if (_isIOSStandalone(ua) && target !== '_self') {\r\n openAsNewWindowIOS(url || '', target);\r\n return new AuthPopup(null);\r\n }\r\n // about:blank getting sanitized causing browsers like IE/Edge to display\r\n // brief error message before redirecting to handler.\r\n const newWin = window.open(url || '', target, optionsString);\r\n _assert(newWin, auth, \"popup-blocked\" /* POPUP_BLOCKED */);\r\n // Flaky on IE edge, encapsulate with a try and catch.\r\n try {\r\n newWin.focus();\r\n }\r\n catch (e) { }\r\n return new AuthPopup(newWin);\r\n}\r\nfunction openAsNewWindowIOS(url, target) {\r\n const el = document.createElement('a');\r\n el.href = url;\r\n el.target = target;\r\n const click = document.createEvent('MouseEvent');\r\n click.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 1, null);\r\n el.dispatchEvent(click);\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\n/**\r\n * URL for Authentication widget which will initiate the OAuth handshake\r\n *\r\n * @internal\r\n */\r\nconst WIDGET_PATH = '__/auth/handler';\r\n/**\r\n * URL for emulated environment\r\n *\r\n * @internal\r\n */\r\nconst EMULATOR_WIDGET_PATH = 'emulator/auth/handler';\r\nfunction _getRedirectUrl(auth, provider, authType, redirectUrl, eventId, additionalParams) {\r\n _assert(auth.config.authDomain, auth, \"auth-domain-config-required\" /* MISSING_AUTH_DOMAIN */);\r\n _assert(auth.config.apiKey, auth, \"invalid-api-key\" /* INVALID_API_KEY */);\r\n const params = {\r\n apiKey: auth.config.apiKey,\r\n appName: auth.name,\r\n authType,\r\n redirectUrl,\r\n v: SDK_VERSION,\r\n eventId\r\n };\r\n if (provider instanceof FederatedAuthProvider) {\r\n provider.setDefaultLanguage(auth.languageCode);\r\n params.providerId = provider.providerId || '';\r\n if (!isEmpty(provider.getCustomParameters())) {\r\n params.customParameters = JSON.stringify(provider.getCustomParameters());\r\n }\r\n // TODO set additionalParams from the provider as well?\r\n for (const [key, value] of Object.entries(additionalParams || {})) {\r\n params[key] = value;\r\n }\r\n }\r\n if (provider instanceof BaseOAuthProvider) {\r\n const scopes = provider.getScopes().filter(scope => scope !== '');\r\n if (scopes.length > 0) {\r\n params.scopes = scopes.join(',');\r\n }\r\n }\r\n if (auth.tenantId) {\r\n params.tid = auth.tenantId;\r\n }\r\n // TODO: maybe set eid as endipointId\r\n // TODO: maybe set fw as Frameworks.join(\",\")\r\n const paramsDict = params;\r\n for (const key of Object.keys(paramsDict)) {\r\n if (paramsDict[key] === undefined) {\r\n delete paramsDict[key];\r\n }\r\n }\r\n return `${getHandlerBase(auth)}?${querystring(paramsDict).slice(1)}`;\r\n}\r\nfunction getHandlerBase({ config }) {\r\n if (!config.emulator) {\r\n return `https://${config.authDomain}/${WIDGET_PATH}`;\r\n }\r\n return _emulatorUrl(config, EMULATOR_WIDGET_PATH);\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 * The special web storage event\r\n *\r\n */\r\nconst WEB_STORAGE_SUPPORT_KEY = 'webStorageSupport';\r\nclass BrowserPopupRedirectResolver {\r\n constructor() {\r\n this.eventManagers = {};\r\n this.iframes = {};\r\n this.originValidationPromises = {};\r\n this._redirectPersistence = browserSessionPersistence;\r\n this._completeRedirectFn = _getRedirectResult;\r\n this._overrideRedirectResult = _overrideRedirectResult;\r\n }\r\n // Wrapping in async even though we don't await anywhere in order\r\n // to make sure errors are raised as promise rejections\r\n async _openPopup(auth, provider, authType, eventId) {\r\n var _a;\r\n debugAssert((_a = this.eventManagers[auth._key()]) === null || _a === void 0 ? void 0 : _a.manager, '_initialize() not called before _openPopup()');\r\n const url = _getRedirectUrl(auth, provider, authType, _getCurrentUrl(), eventId);\r\n return _open(auth, url, _generateEventId());\r\n }\r\n async _openRedirect(auth, provider, authType, eventId) {\r\n await this._originValidation(auth);\r\n _setWindowLocation(_getRedirectUrl(auth, provider, authType, _getCurrentUrl(), eventId));\r\n return new Promise(() => { });\r\n }\r\n _initialize(auth) {\r\n const key = auth._key();\r\n if (this.eventManagers[key]) {\r\n const { manager, promise } = this.eventManagers[key];\r\n if (manager) {\r\n return Promise.resolve(manager);\r\n }\r\n else {\r\n debugAssert(promise, 'If manager is not set, promise should be');\r\n return promise;\r\n }\r\n }\r\n const promise = this.initAndGetManager(auth);\r\n this.eventManagers[key] = { promise };\r\n // If the promise is rejected, the key should be removed so that the\r\n // operation can be retried later.\r\n promise.catch(() => {\r\n delete this.eventManagers[key];\r\n });\r\n return promise;\r\n }\r\n async initAndGetManager(auth) {\r\n const iframe = await _openIframe(auth);\r\n const manager = new AuthEventManager(auth);\r\n iframe.register('authEvent', (iframeEvent) => {\r\n _assert(iframeEvent === null || iframeEvent === void 0 ? void 0 : iframeEvent.authEvent, auth, \"invalid-auth-event\" /* INVALID_AUTH_EVENT */);\r\n // TODO: Consider splitting redirect and popup events earlier on\r\n const handled = manager.onEvent(iframeEvent.authEvent);\r\n return { status: handled ? \"ACK\" /* ACK */ : \"ERROR\" /* ERROR */ };\r\n }, gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER);\r\n this.eventManagers[auth._key()] = { manager };\r\n this.iframes[auth._key()] = iframe;\r\n return manager;\r\n }\r\n _isIframeWebStorageSupported(auth, cb) {\r\n const iframe = this.iframes[auth._key()];\r\n iframe.send(WEB_STORAGE_SUPPORT_KEY, { type: WEB_STORAGE_SUPPORT_KEY }, result => {\r\n var _a;\r\n const isSupported = (_a = result === null || result === void 0 ? void 0 : result[0]) === null || _a === void 0 ? void 0 : _a[WEB_STORAGE_SUPPORT_KEY];\r\n if (isSupported !== undefined) {\r\n cb(!!isSupported);\r\n }\r\n _fail(auth, \"internal-error\" /* INTERNAL_ERROR */);\r\n }, gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER);\r\n }\r\n _originValidation(auth) {\r\n const key = auth._key();\r\n if (!this.originValidationPromises[key]) {\r\n this.originValidationPromises[key] = _validateOrigin(auth);\r\n }\r\n return this.originValidationPromises[key];\r\n }\r\n get _shouldInitProactively() {\r\n // Mobile browsers and Safari need to optimistically initialize\r\n return _isMobileBrowser() || _isSafari() || _isIOS();\r\n }\r\n}\r\n/**\r\n * An implementation of {@link PopupRedirectResolver} suitable for browser\r\n * based applications.\r\n *\r\n * @public\r\n */\r\nconst browserPopupRedirectResolver = BrowserPopupRedirectResolver;\n\nclass MultiFactorAssertionImpl {\r\n constructor(factorId) {\r\n this.factorId = factorId;\r\n }\r\n _process(auth, session, displayName) {\r\n switch (session.type) {\r\n case \"enroll\" /* ENROLL */:\r\n return this._finalizeEnroll(auth, session.credential, displayName);\r\n case \"signin\" /* SIGN_IN */:\r\n return this._finalizeSignIn(auth, session.credential);\r\n default:\r\n return debugFail('unexpected MultiFactorSessionType');\r\n }\r\n }\r\n}\n\n/**\r\n * {@inheritdoc PhoneMultiFactorAssertion}\r\n *\r\n * @public\r\n */\r\nclass PhoneMultiFactorAssertionImpl extends MultiFactorAssertionImpl {\r\n constructor(credential) {\r\n super(\"phone\" /* PHONE */);\r\n this.credential = credential;\r\n }\r\n /** @internal */\r\n static _fromCredential(credential) {\r\n return new PhoneMultiFactorAssertionImpl(credential);\r\n }\r\n /** @internal */\r\n _finalizeEnroll(auth, idToken, displayName) {\r\n return finalizeEnrollPhoneMfa(auth, {\r\n idToken,\r\n displayName,\r\n phoneVerificationInfo: this.credential._makeVerificationRequest()\r\n });\r\n }\r\n /** @internal */\r\n _finalizeSignIn(auth, mfaPendingCredential) {\r\n return finalizeSignInPhoneMfa(auth, {\r\n mfaPendingCredential,\r\n phoneVerificationInfo: this.credential._makeVerificationRequest()\r\n });\r\n }\r\n}\r\n/**\r\n * Provider for generating a {@link PhoneMultiFactorAssertion}.\r\n *\r\n * @public\r\n */\r\nclass PhoneMultiFactorGenerator {\r\n constructor() { }\r\n /**\r\n * Provides a {@link PhoneMultiFactorAssertion} to confirm ownership of the phone second factor.\r\n *\r\n * @param phoneAuthCredential - A credential provided by {@link PhoneAuthProvider.credential}.\r\n * @returns A {@link PhoneMultiFactorAssertion} which can be used with\r\n * {@link MultiFactorResolver.resolveSignIn}\r\n */\r\n static assertion(credential) {\r\n return PhoneMultiFactorAssertionImpl._fromCredential(credential);\r\n }\r\n}\r\n/**\r\n * The identifier of the phone second factor: `phone`.\r\n */\r\nPhoneMultiFactorGenerator.FACTOR_ID = 'phone';\n\nvar name = \"@firebase/auth\";\nvar version = \"0.20.5\";\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\nclass AuthInterop {\r\n constructor(auth) {\r\n this.auth = auth;\r\n this.internalListeners = new Map();\r\n }\r\n getUid() {\r\n var _a;\r\n this.assertAuthConfigured();\r\n return ((_a = this.auth.currentUser) === null || _a === void 0 ? void 0 : _a.uid) || null;\r\n }\r\n async getToken(forceRefresh) {\r\n this.assertAuthConfigured();\r\n await this.auth._initializationPromise;\r\n if (!this.auth.currentUser) {\r\n return null;\r\n }\r\n const accessToken = await this.auth.currentUser.getIdToken(forceRefresh);\r\n return { accessToken };\r\n }\r\n addAuthTokenListener(listener) {\r\n this.assertAuthConfigured();\r\n if (this.internalListeners.has(listener)) {\r\n return;\r\n }\r\n const unsubscribe = this.auth.onIdTokenChanged(user => {\r\n var _a;\r\n listener(((_a = user) === null || _a === void 0 ? void 0 : _a.stsTokenManager.accessToken) || null);\r\n });\r\n this.internalListeners.set(listener, unsubscribe);\r\n this.updateProactiveRefresh();\r\n }\r\n removeAuthTokenListener(listener) {\r\n this.assertAuthConfigured();\r\n const unsubscribe = this.internalListeners.get(listener);\r\n if (!unsubscribe) {\r\n return;\r\n }\r\n this.internalListeners.delete(listener);\r\n unsubscribe();\r\n this.updateProactiveRefresh();\r\n }\r\n assertAuthConfigured() {\r\n _assert(this.auth._initializationPromise, \"dependent-sdk-initialized-before-auth\" /* DEPENDENT_SDK_INIT_BEFORE_AUTH */);\r\n }\r\n updateProactiveRefresh() {\r\n if (this.internalListeners.size > 0) {\r\n this.auth._startProactiveRefresh();\r\n }\r\n else {\r\n this.auth._stopProactiveRefresh();\r\n }\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 getVersionForPlatform(clientPlatform) {\r\n switch (clientPlatform) {\r\n case \"Node\" /* NODE */:\r\n return 'node';\r\n case \"ReactNative\" /* REACT_NATIVE */:\r\n return 'rn';\r\n case \"Worker\" /* WORKER */:\r\n return 'webworker';\r\n case \"Cordova\" /* CORDOVA */:\r\n return 'cordova';\r\n default:\r\n return undefined;\r\n }\r\n}\r\n/** @internal */\r\nfunction registerAuth(clientPlatform) {\r\n _registerComponent(new Component(\"auth\" /* AUTH */, (container, { options: deps }) => {\r\n const app = container.getProvider('app').getImmediate();\r\n const heartbeatServiceProvider = container.getProvider('heartbeat');\r\n const { apiKey, authDomain } = app.options;\r\n return ((app, heartbeatServiceProvider) => {\r\n _assert(apiKey && !apiKey.includes(':'), \"invalid-api-key\" /* INVALID_API_KEY */, { appName: app.name });\r\n // Auth domain is optional if IdP sign in isn't being used\r\n _assert(!(authDomain === null || authDomain === void 0 ? void 0 : authDomain.includes(':')), \"argument-error\" /* ARGUMENT_ERROR */, {\r\n appName: app.name\r\n });\r\n const config = {\r\n apiKey,\r\n authDomain,\r\n clientPlatform,\r\n apiHost: \"identitytoolkit.googleapis.com\" /* API_HOST */,\r\n tokenApiHost: \"securetoken.googleapis.com\" /* TOKEN_API_HOST */,\r\n apiScheme: \"https\" /* API_SCHEME */,\r\n sdkClientVersion: _getClientVersion(clientPlatform)\r\n };\r\n const authInstance = new AuthImpl(app, heartbeatServiceProvider, config);\r\n _initializeAuthInstance(authInstance, deps);\r\n return authInstance;\r\n })(app, heartbeatServiceProvider);\r\n }, \"PUBLIC\" /* PUBLIC */)\r\n /**\r\n * Auth can only be initialized by explicitly calling getAuth() or initializeAuth()\r\n * For why we do this, See go/firebase-next-auth-init\r\n */\r\n .setInstantiationMode(\"EXPLICIT\" /* EXPLICIT */)\r\n /**\r\n * Because all firebase products that depend on auth depend on auth-internal directly,\r\n * we need to initialize auth-internal after auth is initialized to make it available to other firebase products.\r\n */\r\n .setInstanceCreatedCallback((container, _instanceIdentifier, _instance) => {\r\n const authInternalProvider = container.getProvider(\"auth-internal\" /* AUTH_INTERNAL */);\r\n authInternalProvider.initialize();\r\n }));\r\n _registerComponent(new Component(\"auth-internal\" /* AUTH_INTERNAL */, container => {\r\n const auth = _castAuth(container.getProvider(\"auth\" /* AUTH */).getImmediate());\r\n return (auth => new AuthInterop(auth))(auth);\r\n }, \"PRIVATE\" /* PRIVATE */).setInstantiationMode(\"EXPLICIT\" /* EXPLICIT */));\r\n registerVersion(name, version, getVersionForPlatform(clientPlatform));\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}\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\n/**\r\n * Returns the Auth instance associated with the provided {@link @firebase/app#FirebaseApp}.\r\n * If no instance exists, initializes an Auth instance with platform-specific default dependencies.\r\n *\r\n * @param app - The Firebase App.\r\n *\r\n * @public\r\n */\r\nfunction getAuth(app = getApp()) {\r\n const provider = _getProvider(app, 'auth');\r\n if (provider.isInitialized()) {\r\n return provider.getImmediate();\r\n }\r\n return initializeAuth(app, {\r\n popupRedirectResolver: browserPopupRedirectResolver,\r\n persistence: [\r\n indexedDBLocalPersistence,\r\n browserLocalPersistence,\r\n browserSessionPersistence\r\n ]\r\n });\r\n}\r\nregisterAuth(\"Browser\" /* BROWSER */);\n\nexport { signInWithCustomToken as $, ActionCodeOperation as A, debugErrorMap as B, prodErrorMap as C, AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY as D, initializeAuth as E, FactorId as F, connectAuthEmulator as G, AuthCredential as H, EmailAuthCredential as I, OAuthCredential as J, PhoneAuthCredential as K, inMemoryPersistence as L, EmailAuthProvider as M, FacebookAuthProvider as N, OperationType as O, PhoneAuthProvider as P, GoogleAuthProvider as Q, RecaptchaVerifier as R, SignInMethod as S, GithubAuthProvider as T, OAuthProvider as U, SAMLAuthProvider as V, TwitterAuthProvider as W, signInAnonymously as X, signInWithCredential as Y, linkWithCredential as Z, reauthenticateWithCredential as _, browserSessionPersistence as a, sendPasswordResetEmail as a0, confirmPasswordReset as a1, applyActionCode as a2, checkActionCode as a3, verifyPasswordResetCode as a4, createUserWithEmailAndPassword as a5, signInWithEmailAndPassword as a6, sendSignInLinkToEmail as a7, isSignInWithEmailLink as a8, signInWithEmailLink as a9, AuthEventManager as aA, _getRedirectResult as aB, _overrideRedirectResult as aC, _clearRedirectOutcomes as aD, _castAuth as aE, UserImpl as aF, AuthImpl as aG, _getClientVersion as aH, _generateEventId as aI, AuthPopup as aJ, FetchProvider as aK, SAMLAuthCredential as aL, fetchSignInMethodsForEmail as aa, sendEmailVerification as ab, verifyBeforeUpdateEmail as ac, ActionCodeURL as ad, parseActionCodeURL as ae, updateProfile as af, updateEmail as ag, updatePassword as ah, getIdToken as ai, getIdTokenResult as aj, unlink as ak, getAdditionalUserInfo as al, reload as am, getMultiFactorResolver as an, multiFactor as ao, _isIOS7Or8 as ap, debugAssert as aq, _isIOS as ar, _isAndroid as as, _fail as at, _getRedirectUrl as au, _getProjectConfig as av, _createError as aw, _assert as ax, _getInstance as ay, _persistenceKeyName as az, browserLocalPersistence as b, signInWithPopup as c, linkWithPopup as d, reauthenticateWithPopup as e, signInWithRedirect as f, linkWithRedirect as g, reauthenticateWithRedirect as h, indexedDBLocalPersistence as i, getRedirectResult as j, browserPopupRedirectResolver as k, linkWithPhoneNumber as l, PhoneMultiFactorGenerator as m, getAuth as n, ProviderId as o, setPersistence as p, onIdTokenChanged as q, reauthenticateWithPhoneNumber as r, signInWithPhoneNumber as s, beforeAuthStateChanged as t, updatePhoneNumber as u, onAuthStateChanged as v, useDeviceLanguage as w, updateCurrentUser as x, signOut as y, deleteUser as z };\n//# sourceMappingURL=index-90ebcfae.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 * @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 Error();\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 * 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 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.\r\n */\r\n// Node detection logic from: https://github.com/iliakan/detect-node/\r\nfunction isNode() {\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.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 return typeof indexedDB === 'object';\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}\r\n/**\r\n * Polyfill for `globalThis` object.\r\n * @returns the `globalThis` object for the given environment.\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 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<Err, string> = {\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<Err>('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 * <p>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 * <p>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, 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, 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","/* globals __VUE_SSR_CONTEXT__ */\n\n// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).\n// This module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle.\n\nexport default function normalizeComponent(\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier /* server only */,\n shadowMode /* vue-cli only */\n) {\n // Vue.extend constructor export interop\n var options =\n typeof scriptExports === 'function' ? scriptExports.options : scriptExports\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) {\n // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () {\n injectStyles.call(\n this,\n (options.functional ? this.parent : this).$root.$options.shadowRoot\n )\n }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functional component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection(h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing ? [].concat(existing, hook) : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}\n","var isCallable = require('../internals/is-callable');\nvar tryToString = require('../internals/try-to-string');\n\nvar $TypeError = TypeError;\n\n// `Assert: IsCallable(argument) is true`\nmodule.exports = function (argument) {\n if (isCallable(argument)) return argument;\n throw $TypeError(tryToString(argument) + ' is not a function');\n};\n","var isCallable = require('../internals/is-callable');\n\nvar $String = String;\nvar $TypeError = TypeError;\n\nmodule.exports = function (argument) {\n if (typeof argument == 'object' || isCallable(argument)) return argument;\n throw $TypeError(\"Can't set \" + $String(argument) + ' as a prototype');\n};\n","var isObject = require('../internals/is-object');\n\nvar $String = String;\nvar $TypeError = TypeError;\n\n// `Assert: Type(argument) is Object`\nmodule.exports = function (argument) {\n if (isObject(argument)) return argument;\n throw $TypeError($String(argument) + ' is not an object');\n};\n","var toIndexedObject = require('../internals/to-indexed-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\n\n// `Array.prototype.{ indexOf, includes }` methods implementation\nvar createMethod = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIndexedObject($this);\n var length = lengthOfArrayLike(O);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare -- NaN check\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare -- NaN check\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) {\n if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.includes` method\n // https://tc39.es/ecma262/#sec-array.prototype.includes\n includes: createMethod(true),\n // `Array.prototype.indexOf` method\n // https://tc39.es/ecma262/#sec-array.prototype.indexof\n indexOf: createMethod(false)\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nvar toString = uncurryThis({}.toString);\nvar stringSlice = uncurryThis(''.slice);\n\nmodule.exports = function (it) {\n return stringSlice(toString(it), 8, -1);\n};\n","var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar isCallable = require('../internals/is-callable');\nvar classofRaw = require('../internals/classof-raw');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar $Object = Object;\n\n// ES3 wrong here\nvar CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (error) { /* empty */ }\n};\n\n// getting tag from ES6+ `Object.prototype.toString`\nmodule.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {\n var O, tag, result;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag\n // builtinTag case\n : CORRECT_ARGUMENTS ? classofRaw(O)\n // ES3 arguments fallback\n : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nvar $Error = Error;\nvar replace = uncurryThis(''.replace);\n\nvar TEST = (function (arg) { return String($Error(arg).stack); })('zxcasd');\nvar V8_OR_CHAKRA_STACK_ENTRY = /\\n\\s*at [^:]*:[^\\n]*/;\nvar IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);\n\nmodule.exports = function (stack, dropEntries) {\n if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) {\n while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, '');\n } return stack;\n};\n","var hasOwn = require('../internals/has-own-property');\nvar ownKeys = require('../internals/own-keys');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\nvar definePropertyModule = require('../internals/object-define-property');\n\nmodule.exports = function (target, source, exceptions) {\n var keys = ownKeys(source);\n var defineProperty = definePropertyModule.f;\n var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {\n defineProperty(target, key, getOwnPropertyDescriptor(source, key));\n }\n }\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = DESCRIPTORS ? function (object, key, value) {\n return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","var isCallable = require('../internals/is-callable');\nvar definePropertyModule = require('../internals/object-define-property');\nvar makeBuiltIn = require('../internals/make-built-in');\nvar defineGlobalProperty = require('../internals/define-global-property');\n\nmodule.exports = function (O, key, value, options) {\n if (!options) options = {};\n var simple = options.enumerable;\n var name = options.name !== undefined ? options.name : key;\n if (isCallable(value)) makeBuiltIn(value, name, options);\n if (options.global) {\n if (simple) O[key] = value;\n else defineGlobalProperty(key, value);\n } else {\n try {\n if (!options.unsafe) delete O[key];\n else if (O[key]) simple = true;\n } catch (error) { /* empty */ }\n if (simple) O[key] = value;\n else definePropertyModule.f(O, key, {\n value: value,\n enumerable: false,\n configurable: !options.nonConfigurable,\n writable: !options.nonWritable\n });\n } return O;\n};\n","var global = require('../internals/global');\n\n// eslint-disable-next-line es-x/no-object-defineproperty -- safe\nvar defineProperty = Object.defineProperty;\n\nmodule.exports = function (key, value) {\n try {\n defineProperty(global, key, { value: value, configurable: true, writable: true });\n } catch (error) {\n global[key] = value;\n } return value;\n};\n","var fails = require('../internals/fails');\n\n// Detect IE8's incomplete defineProperty implementation\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing\n return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;\n});\n","var global = require('../internals/global');\nvar isObject = require('../internals/is-object');\n\nvar document = global.document;\n// typeof document.createElement is 'object' in old IE\nvar EXISTS = isObject(document) && isObject(document.createElement);\n\nmodule.exports = function (it) {\n return EXISTS ? document.createElement(it) : {};\n};\n","var getBuiltIn = require('../internals/get-built-in');\n\nmodule.exports = getBuiltIn('navigator', 'userAgent') || '';\n","var global = require('../internals/global');\nvar userAgent = require('../internals/engine-user-agent');\n\nvar process = global.process;\nvar Deno = global.Deno;\nvar versions = process && process.versions || Deno && Deno.version;\nvar v8 = versions && versions.v8;\nvar match, version;\n\nif (v8) {\n match = v8.split('.');\n // in old Chrome, versions of V8 isn't V8 = Chrome / 10\n // but their correct versions are not interesting for us\n version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);\n}\n\n// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`\n// so check `userAgent` even if `.v8` exists, but 0\nif (!version && userAgent) {\n match = userAgent.match(/Edge\\/(\\d+)/);\n if (!match || match[1] >= 74) {\n match = userAgent.match(/Chrome\\/(\\d+)/);\n if (match) version = +match[1];\n }\n}\n\nmodule.exports = version;\n","// IE8- don't enum bug keys\nmodule.exports = [\n 'constructor',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'toLocaleString',\n 'toString',\n 'valueOf'\n];\n","var fails = require('../internals/fails');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = !fails(function () {\n var error = Error('a');\n if (!('stack' in error)) return true;\n // eslint-disable-next-line es-x/no-object-defineproperty -- safe\n Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7));\n return error.stack !== 7;\n});\n","var global = require('../internals/global');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar defineGlobalProperty = require('../internals/define-global-property');\nvar copyConstructorProperties = require('../internals/copy-constructor-properties');\nvar isForced = require('../internals/is-forced');\n\n/*\n options.target - name of the target object\n options.global - target is the global object\n options.stat - export as static methods of target\n options.proto - export as prototype methods of target\n options.real - real prototype method for the `pure` version\n options.forced - export even if the native feature is available\n options.bind - bind methods to the target, required for the `pure` version\n options.wrap - wrap constructors to preventing global pollution, required for the `pure` version\n options.unsafe - use the simple assignment of property instead of delete + defineProperty\n options.sham - add a flag to not completely full polyfills\n options.enumerable - export as enumerable property\n options.dontCallGetSet - prevent calling a getter on target\n options.name - the .name of the function if it does not match the key\n*/\nmodule.exports = function (options, source) {\n var TARGET = options.target;\n var GLOBAL = options.global;\n var STATIC = options.stat;\n var FORCED, target, key, targetProperty, sourceProperty, descriptor;\n if (GLOBAL) {\n target = global;\n } else if (STATIC) {\n target = global[TARGET] || defineGlobalProperty(TARGET, {});\n } else {\n target = (global[TARGET] || {}).prototype;\n }\n if (target) for (key in source) {\n sourceProperty = source[key];\n if (options.dontCallGetSet) {\n descriptor = getOwnPropertyDescriptor(target, key);\n targetProperty = descriptor && descriptor.value;\n } else targetProperty = target[key];\n FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);\n // contained in target\n if (!FORCED && targetProperty !== undefined) {\n if (typeof sourceProperty == typeof targetProperty) continue;\n copyConstructorProperties(sourceProperty, targetProperty);\n }\n // add a flag to not completely full polyfills\n if (options.sham || (targetProperty && targetProperty.sham)) {\n createNonEnumerableProperty(sourceProperty, 'sham', true);\n }\n defineBuiltIn(target, key, sourceProperty, options);\n }\n};\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (error) {\n return true;\n }\n};\n","var NATIVE_BIND = require('../internals/function-bind-native');\n\nvar FunctionPrototype = Function.prototype;\nvar apply = FunctionPrototype.apply;\nvar call = FunctionPrototype.call;\n\n// eslint-disable-next-line es-x/no-reflect -- safe\nmodule.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () {\n return call.apply(apply, arguments);\n});\n","var fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es-x/no-function-prototype-bind -- safe\n var test = (function () { /* empty */ }).bind();\n // eslint-disable-next-line no-prototype-builtins -- safe\n return typeof test != 'function' || test.hasOwnProperty('prototype');\n});\n","var NATIVE_BIND = require('../internals/function-bind-native');\n\nvar call = Function.prototype.call;\n\nmodule.exports = NATIVE_BIND ? call.bind(call) : function () {\n return call.apply(call, arguments);\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar hasOwn = require('../internals/has-own-property');\n\nvar FunctionPrototype = Function.prototype;\n// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe\nvar getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;\n\nvar EXISTS = hasOwn(FunctionPrototype, 'name');\n// additional protection from minified / mangled / dropped function names\nvar PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';\nvar CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));\n\nmodule.exports = {\n EXISTS: EXISTS,\n PROPER: PROPER,\n CONFIGURABLE: CONFIGURABLE\n};\n","var NATIVE_BIND = require('../internals/function-bind-native');\n\nvar FunctionPrototype = Function.prototype;\nvar bind = FunctionPrototype.bind;\nvar call = FunctionPrototype.call;\nvar uncurryThis = NATIVE_BIND && bind.bind(call, call);\n\nmodule.exports = NATIVE_BIND ? function (fn) {\n return fn && uncurryThis(fn);\n} : function (fn) {\n return fn && function () {\n return call.apply(fn, arguments);\n };\n};\n","var global = require('../internals/global');\nvar isCallable = require('../internals/is-callable');\n\nvar aFunction = function (argument) {\n return isCallable(argument) ? argument : undefined;\n};\n\nmodule.exports = function (namespace, method) {\n return arguments.length < 2 ? aFunction(global[namespace]) : global[namespace] && global[namespace][method];\n};\n","var aCallable = require('../internals/a-callable');\n\n// `GetMethod` abstract operation\n// https://tc39.es/ecma262/#sec-getmethod\nmodule.exports = function (V, P) {\n var func = V[P];\n return func == null ? undefined : aCallable(func);\n};\n","var check = function (it) {\n return it && it.Math == Math && it;\n};\n\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nmodule.exports =\n // eslint-disable-next-line es-x/no-global-this -- safe\n check(typeof globalThis == 'object' && globalThis) ||\n check(typeof window == 'object' && window) ||\n // eslint-disable-next-line no-restricted-globals -- safe\n check(typeof self == 'object' && self) ||\n check(typeof global == 'object' && global) ||\n // eslint-disable-next-line no-new-func -- fallback\n (function () { return this; })() || Function('return this')();\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar toObject = require('../internals/to-object');\n\nvar hasOwnProperty = uncurryThis({}.hasOwnProperty);\n\n// `HasOwnProperty` abstract operation\n// https://tc39.es/ecma262/#sec-hasownproperty\n// eslint-disable-next-line es-x/no-object-hasown -- safe\nmodule.exports = Object.hasOwn || function hasOwn(it, key) {\n return hasOwnProperty(toObject(it), key);\n};\n","module.exports = {};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar createElement = require('../internals/document-create-element');\n\n// Thanks to IE8 for its funny defineProperty\nmodule.exports = !DESCRIPTORS && !fails(function () {\n // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing\n return Object.defineProperty(createElement('div'), 'a', {\n get: function () { return 7; }\n }).a != 7;\n});\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar classof = require('../internals/classof-raw');\n\nvar $Object = Object;\nvar split = uncurryThis(''.split);\n\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\nmodule.exports = fails(function () {\n // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346\n // eslint-disable-next-line no-prototype-builtins -- safe\n return !$Object('z').propertyIsEnumerable(0);\n}) ? function (it) {\n return classof(it) == 'String' ? split(it, '') : $Object(it);\n} : $Object;\n","var isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\n\n// makes subclassing work correct for wrapped built-ins\nmodule.exports = function ($this, dummy, Wrapper) {\n var NewTarget, NewTargetPrototype;\n if (\n // it can work only with native `setPrototypeOf`\n setPrototypeOf &&\n // we haven't completely correct pre-ES6 way for getting `new.target`, so use this\n isCallable(NewTarget = dummy.constructor) &&\n NewTarget !== Wrapper &&\n isObject(NewTargetPrototype = NewTarget.prototype) &&\n NewTargetPrototype !== Wrapper.prototype\n ) setPrototypeOf($this, NewTargetPrototype);\n return $this;\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar isCallable = require('../internals/is-callable');\nvar store = require('../internals/shared-store');\n\nvar functionToString = uncurryThis(Function.toString);\n\n// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper\nif (!isCallable(store.inspectSource)) {\n store.inspectSource = function (it) {\n return functionToString(it);\n };\n}\n\nmodule.exports = store.inspectSource;\n","var isObject = require('../internals/is-object');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\n\n// `InstallErrorCause` abstract operation\n// https://tc39.es/proposal-error-cause/#sec-errorobjects-install-error-cause\nmodule.exports = function (O, options) {\n if (isObject(options) && 'cause' in options) {\n createNonEnumerableProperty(O, 'cause', options.cause);\n }\n};\n","var NATIVE_WEAK_MAP = require('../internals/native-weak-map');\nvar global = require('../internals/global');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar isObject = require('../internals/is-object');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar hasOwn = require('../internals/has-own-property');\nvar shared = require('../internals/shared-store');\nvar sharedKey = require('../internals/shared-key');\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar OBJECT_ALREADY_INITIALIZED = 'Object already initialized';\nvar TypeError = global.TypeError;\nvar WeakMap = global.WeakMap;\nvar set, get, has;\n\nvar enforce = function (it) {\n return has(it) ? get(it) : set(it, {});\n};\n\nvar getterFor = function (TYPE) {\n return function (it) {\n var state;\n if (!isObject(it) || (state = get(it)).type !== TYPE) {\n throw TypeError('Incompatible receiver, ' + TYPE + ' required');\n } return state;\n };\n};\n\nif (NATIVE_WEAK_MAP || shared.state) {\n var store = shared.state || (shared.state = new WeakMap());\n var wmget = uncurryThis(store.get);\n var wmhas = uncurryThis(store.has);\n var wmset = uncurryThis(store.set);\n set = function (it, metadata) {\n if (wmhas(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n wmset(store, it, metadata);\n return metadata;\n };\n get = function (it) {\n return wmget(store, it) || {};\n };\n has = function (it) {\n return wmhas(store, it);\n };\n} else {\n var STATE = sharedKey('state');\n hiddenKeys[STATE] = true;\n set = function (it, metadata) {\n if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n createNonEnumerableProperty(it, STATE, metadata);\n return metadata;\n };\n get = function (it) {\n return hasOwn(it, STATE) ? it[STATE] : {};\n };\n has = function (it) {\n return hasOwn(it, STATE);\n };\n}\n\nmodule.exports = {\n set: set,\n get: get,\n has: has,\n enforce: enforce,\n getterFor: getterFor\n};\n","// `IsCallable` abstract operation\n// https://tc39.es/ecma262/#sec-iscallable\nmodule.exports = function (argument) {\n return typeof argument == 'function';\n};\n","var fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\n\nvar replacement = /#|\\.prototype\\./;\n\nvar isForced = function (feature, detection) {\n var value = data[normalize(feature)];\n return value == POLYFILL ? true\n : value == NATIVE ? false\n : isCallable(detection) ? fails(detection)\n : !!detection;\n};\n\nvar normalize = isForced.normalize = function (string) {\n return String(string).replace(replacement, '.').toLowerCase();\n};\n\nvar data = isForced.data = {};\nvar NATIVE = isForced.NATIVE = 'N';\nvar POLYFILL = isForced.POLYFILL = 'P';\n\nmodule.exports = isForced;\n","var isCallable = require('../internals/is-callable');\n\nmodule.exports = function (it) {\n return typeof it == 'object' ? it !== null : isCallable(it);\n};\n","module.exports = false;\n","var getBuiltIn = require('../internals/get-built-in');\nvar isCallable = require('../internals/is-callable');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar $Object = Object;\n\nmodule.exports = USE_SYMBOL_AS_UID ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n var $Symbol = getBuiltIn('Symbol');\n return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));\n};\n","var toLength = require('../internals/to-length');\n\n// `LengthOfArrayLike` abstract operation\n// https://tc39.es/ecma262/#sec-lengthofarraylike\nmodule.exports = function (obj) {\n return toLength(obj.length);\n};\n","var fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\nvar hasOwn = require('../internals/has-own-property');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar CONFIGURABLE_FUNCTION_NAME = require('../internals/function-name').CONFIGURABLE;\nvar inspectSource = require('../internals/inspect-source');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar enforceInternalState = InternalStateModule.enforce;\nvar getInternalState = InternalStateModule.get;\n// eslint-disable-next-line es-x/no-object-defineproperty -- safe\nvar defineProperty = Object.defineProperty;\n\nvar CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function () {\n return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;\n});\n\nvar TEMPLATE = String(String).split('String');\n\nvar makeBuiltIn = module.exports = function (value, name, options) {\n if (String(name).slice(0, 7) === 'Symbol(') {\n name = '[' + String(name).replace(/^Symbol\\(([^)]*)\\)/, '$1') + ']';\n }\n if (options && options.getter) name = 'get ' + name;\n if (options && options.setter) name = 'set ' + name;\n if (!hasOwn(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {\n if (DESCRIPTORS) defineProperty(value, 'name', { value: name, configurable: true });\n else value.name = name;\n }\n if (CONFIGURABLE_LENGTH && options && hasOwn(options, 'arity') && value.length !== options.arity) {\n defineProperty(value, 'length', { value: options.arity });\n }\n try {\n if (options && hasOwn(options, 'constructor') && options.constructor) {\n if (DESCRIPTORS) defineProperty(value, 'prototype', { writable: false });\n // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable\n } else if (value.prototype) value.prototype = undefined;\n } catch (error) { /* empty */ }\n var state = enforceInternalState(value);\n if (!hasOwn(state, 'source')) {\n state.source = TEMPLATE.join(typeof name == 'string' ? name : '');\n } return value;\n};\n\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n// eslint-disable-next-line no-extend-native -- required\nFunction.prototype.toString = makeBuiltIn(function toString() {\n return isCallable(this) && getInternalState(this).source || inspectSource(this);\n}, 'toString');\n","var ceil = Math.ceil;\nvar floor = Math.floor;\n\n// `Math.trunc` method\n// https://tc39.es/ecma262/#sec-math.trunc\n// eslint-disable-next-line es-x/no-math-trunc -- safe\nmodule.exports = Math.trunc || function trunc(x) {\n var n = +x;\n return (n > 0 ? floor : ceil)(n);\n};\n","/* eslint-disable es-x/no-symbol -- required for testing */\nvar V8_VERSION = require('../internals/engine-v8-version');\nvar fails = require('../internals/fails');\n\n// eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing\nmodule.exports = !!Object.getOwnPropertySymbols && !fails(function () {\n var symbol = Symbol();\n // Chrome 38 Symbol has incorrect toString conversion\n // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances\n return !String(symbol) || !(Object(symbol) instanceof Symbol) ||\n // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances\n !Symbol.sham && V8_VERSION && V8_VERSION < 41;\n});\n","var global = require('../internals/global');\nvar isCallable = require('../internals/is-callable');\nvar inspectSource = require('../internals/inspect-source');\n\nvar WeakMap = global.WeakMap;\n\nmodule.exports = isCallable(WeakMap) && /native code/.test(inspectSource(WeakMap));\n","var toString = require('../internals/to-string');\n\nmodule.exports = function (argument, $default) {\n return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument);\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\nvar V8_PROTOTYPE_DEFINE_BUG = require('../internals/v8-prototype-define-bug');\nvar anObject = require('../internals/an-object');\nvar toPropertyKey = require('../internals/to-property-key');\n\nvar $TypeError = TypeError;\n// eslint-disable-next-line es-x/no-object-defineproperty -- safe\nvar $defineProperty = Object.defineProperty;\n// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar ENUMERABLE = 'enumerable';\nvar CONFIGURABLE = 'configurable';\nvar WRITABLE = 'writable';\n\n// `Object.defineProperty` method\n// https://tc39.es/ecma262/#sec-object.defineproperty\nexports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {\n var current = $getOwnPropertyDescriptor(O, P);\n if (current && current[WRITABLE]) {\n O[P] = Attributes.value;\n Attributes = {\n configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],\n enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],\n writable: false\n };\n }\n } return $defineProperty(O, P, Attributes);\n} : $defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return $defineProperty(O, P, Attributes);\n } catch (error) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar call = require('../internals/function-call');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toPropertyKey = require('../internals/to-property-key');\nvar hasOwn = require('../internals/has-own-property');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\n\n// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// `Object.getOwnPropertyDescriptor` method\n// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor\nexports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {\n O = toIndexedObject(O);\n P = toPropertyKey(P);\n if (IE8_DOM_DEFINE) try {\n return $getOwnPropertyDescriptor(O, P);\n } catch (error) { /* empty */ }\n if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);\n};\n","var internalObjectKeys = require('../internals/object-keys-internal');\nvar enumBugKeys = require('../internals/enum-bug-keys');\n\nvar hiddenKeys = enumBugKeys.concat('length', 'prototype');\n\n// `Object.getOwnPropertyNames` method\n// https://tc39.es/ecma262/#sec-object.getownpropertynames\n// eslint-disable-next-line es-x/no-object-getownpropertynames -- safe\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return internalObjectKeys(O, hiddenKeys);\n};\n","// eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe\nexports.f = Object.getOwnPropertySymbols;\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nmodule.exports = uncurryThis({}.isPrototypeOf);\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar hasOwn = require('../internals/has-own-property');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar indexOf = require('../internals/array-includes').indexOf;\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar push = uncurryThis([].push);\n\nmodule.exports = function (object, names) {\n var O = toIndexedObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (hasOwn(O, key = names[i++])) {\n ~indexOf(result, key) || push(result, key);\n }\n return result;\n};\n","'use strict';\nvar $propertyIsEnumerable = {}.propertyIsEnumerable;\n// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// Nashorn ~ JDK8 bug\nvar NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);\n\n// `Object.prototype.propertyIsEnumerable` method implementation\n// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable\nexports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {\n var descriptor = getOwnPropertyDescriptor(this, V);\n return !!descriptor && descriptor.enumerable;\n} : $propertyIsEnumerable;\n","/* eslint-disable no-proto -- safe */\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar anObject = require('../internals/an-object');\nvar aPossiblePrototype = require('../internals/a-possible-prototype');\n\n// `Object.setPrototypeOf` method\n// https://tc39.es/ecma262/#sec-object.setprototypeof\n// Works with __proto__ only. Old v8 can't work with null proto objects.\n// eslint-disable-next-line es-x/no-object-setprototypeof -- safe\nmodule.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {\n var CORRECT_SETTER = false;\n var test = {};\n var setter;\n try {\n // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe\n setter = uncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);\n setter(test, []);\n CORRECT_SETTER = test instanceof Array;\n } catch (error) { /* empty */ }\n return function setPrototypeOf(O, proto) {\n anObject(O);\n aPossiblePrototype(proto);\n if (CORRECT_SETTER) setter(O, proto);\n else O.__proto__ = proto;\n return O;\n };\n}() : undefined);\n","var call = require('../internals/function-call');\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\n\nvar $TypeError = TypeError;\n\n// `OrdinaryToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-ordinarytoprimitive\nmodule.exports = function (input, pref) {\n var fn, val;\n if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;\n if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n throw $TypeError(\"Can't convert object to primitive value\");\n};\n","var getBuiltIn = require('../internals/get-built-in');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar getOwnPropertyNamesModule = require('../internals/object-get-own-property-names');\nvar getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');\nvar anObject = require('../internals/an-object');\n\nvar concat = uncurryThis([].concat);\n\n// all object keys, includes non-enumerable and symbols\nmodule.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {\n var keys = getOwnPropertyNamesModule.f(anObject(it));\n var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;\n return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;\n};\n","var defineProperty = require('../internals/object-define-property').f;\n\nmodule.exports = function (Target, Source, key) {\n key in Target || defineProperty(Target, key, {\n configurable: true,\n get: function () { return Source[key]; },\n set: function (it) { Source[key] = it; }\n });\n};\n","var $TypeError = TypeError;\n\n// `RequireObjectCoercible` abstract operation\n// https://tc39.es/ecma262/#sec-requireobjectcoercible\nmodule.exports = function (it) {\n if (it == undefined) throw $TypeError(\"Can't call method on \" + it);\n return it;\n};\n","var shared = require('../internals/shared');\nvar uid = require('../internals/uid');\n\nvar keys = shared('keys');\n\nmodule.exports = function (key) {\n return keys[key] || (keys[key] = uid(key));\n};\n","var global = require('../internals/global');\nvar defineGlobalProperty = require('../internals/define-global-property');\n\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || defineGlobalProperty(SHARED, {});\n\nmodule.exports = store;\n","var IS_PURE = require('../internals/is-pure');\nvar store = require('../internals/shared-store');\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: '3.24.1',\n mode: IS_PURE ? 'pure' : 'global',\n copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',\n license: 'https://github.com/zloirock/core-js/blob/v3.24.1/LICENSE',\n source: 'https://github.com/zloirock/core-js'\n});\n","var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\n\nvar max = Math.max;\nvar min = Math.min;\n\n// Helper for a popular repeating case of the spec:\n// Let integer be ? ToInteger(index).\n// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).\nmodule.exports = function (index, length) {\n var integer = toIntegerOrInfinity(index);\n return integer < 0 ? max(integer + length, 0) : min(integer, length);\n};\n","// toObject with fallback for non-array-like ES3 strings\nvar IndexedObject = require('../internals/indexed-object');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nmodule.exports = function (it) {\n return IndexedObject(requireObjectCoercible(it));\n};\n","var trunc = require('../internals/math-trunc');\n\n// `ToIntegerOrInfinity` abstract operation\n// https://tc39.es/ecma262/#sec-tointegerorinfinity\nmodule.exports = function (argument) {\n var number = +argument;\n // eslint-disable-next-line no-self-compare -- NaN check\n return number !== number || number === 0 ? 0 : trunc(number);\n};\n","var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\n\nvar min = Math.min;\n\n// `ToLength` abstract operation\n// https://tc39.es/ecma262/#sec-tolength\nmodule.exports = function (argument) {\n return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991\n};\n","var requireObjectCoercible = require('../internals/require-object-coercible');\n\nvar $Object = Object;\n\n// `ToObject` abstract operation\n// https://tc39.es/ecma262/#sec-toobject\nmodule.exports = function (argument) {\n return $Object(requireObjectCoercible(argument));\n};\n","var call = require('../internals/function-call');\nvar isObject = require('../internals/is-object');\nvar isSymbol = require('../internals/is-symbol');\nvar getMethod = require('../internals/get-method');\nvar ordinaryToPrimitive = require('../internals/ordinary-to-primitive');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar $TypeError = TypeError;\nvar TO_PRIMITIVE = wellKnownSymbol('toPrimitive');\n\n// `ToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-toprimitive\nmodule.exports = function (input, pref) {\n if (!isObject(input) || isSymbol(input)) return input;\n var exoticToPrim = getMethod(input, TO_PRIMITIVE);\n var result;\n if (exoticToPrim) {\n if (pref === undefined) pref = 'default';\n result = call(exoticToPrim, input, pref);\n if (!isObject(result) || isSymbol(result)) return result;\n throw $TypeError(\"Can't convert object to primitive value\");\n }\n if (pref === undefined) pref = 'number';\n return ordinaryToPrimitive(input, pref);\n};\n","var toPrimitive = require('../internals/to-primitive');\nvar isSymbol = require('../internals/is-symbol');\n\n// `ToPropertyKey` abstract operation\n// https://tc39.es/ecma262/#sec-topropertykey\nmodule.exports = function (argument) {\n var key = toPrimitive(argument, 'string');\n return isSymbol(key) ? key : key + '';\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar test = {};\n\ntest[TO_STRING_TAG] = 'z';\n\nmodule.exports = String(test) === '[object z]';\n","var classof = require('../internals/classof');\n\nvar $String = String;\n\nmodule.exports = function (argument) {\n if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');\n return $String(argument);\n};\n","var $String = String;\n\nmodule.exports = function (argument) {\n try {\n return $String(argument);\n } catch (error) {\n return 'Object';\n }\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nvar id = 0;\nvar postfix = Math.random();\nvar toString = uncurryThis(1.0.toString);\n\nmodule.exports = function (key) {\n return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);\n};\n","/* eslint-disable es-x/no-symbol -- required for testing */\nvar NATIVE_SYMBOL = require('../internals/native-symbol');\n\nmodule.exports = NATIVE_SYMBOL\n && !Symbol.sham\n && typeof Symbol.iterator == 'symbol';\n","var DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\n\n// V8 ~ Chrome 36-\n// https://bugs.chromium.org/p/v8/issues/detail?id=3334\nmodule.exports = DESCRIPTORS && fails(function () {\n // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing\n return Object.defineProperty(function () { /* empty */ }, 'prototype', {\n value: 42,\n writable: false\n }).prototype != 42;\n});\n","var global = require('../internals/global');\nvar shared = require('../internals/shared');\nvar hasOwn = require('../internals/has-own-property');\nvar uid = require('../internals/uid');\nvar NATIVE_SYMBOL = require('../internals/native-symbol');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar WellKnownSymbolsStore = shared('wks');\nvar Symbol = global.Symbol;\nvar symbolFor = Symbol && Symbol['for'];\nvar createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;\n\nmodule.exports = function (name) {\n if (!hasOwn(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {\n var description = 'Symbol.' + name;\n if (NATIVE_SYMBOL && hasOwn(Symbol, name)) {\n WellKnownSymbolsStore[name] = Symbol[name];\n } else if (USE_SYMBOL_AS_UID && symbolFor) {\n WellKnownSymbolsStore[name] = symbolFor(description);\n } else {\n WellKnownSymbolsStore[name] = createWellKnownSymbol(description);\n }\n } return WellKnownSymbolsStore[name];\n};\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\nvar hasOwn = require('../internals/has-own-property');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar copyConstructorProperties = require('../internals/copy-constructor-properties');\nvar proxyAccessor = require('../internals/proxy-accessor');\nvar inheritIfRequired = require('../internals/inherit-if-required');\nvar normalizeStringArgument = require('../internals/normalize-string-argument');\nvar installErrorCause = require('../internals/install-error-cause');\nvar clearErrorStack = require('../internals/clear-error-stack');\nvar ERROR_STACK_INSTALLABLE = require('../internals/error-stack-installable');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar IS_PURE = require('../internals/is-pure');\n\nmodule.exports = function (FULL_NAME, wrapper, FORCED, IS_AGGREGATE_ERROR) {\n var STACK_TRACE_LIMIT = 'stackTraceLimit';\n var OPTIONS_POSITION = IS_AGGREGATE_ERROR ? 2 : 1;\n var path = FULL_NAME.split('.');\n var ERROR_NAME = path[path.length - 1];\n var OriginalError = getBuiltIn.apply(null, path);\n\n if (!OriginalError) return;\n\n var OriginalErrorPrototype = OriginalError.prototype;\n\n // V8 9.3- bug https://bugs.chromium.org/p/v8/issues/detail?id=12006\n if (!IS_PURE && hasOwn(OriginalErrorPrototype, 'cause')) delete OriginalErrorPrototype.cause;\n\n if (!FORCED) return OriginalError;\n\n var BaseError = getBuiltIn('Error');\n\n var WrappedError = wrapper(function (a, b) {\n var message = normalizeStringArgument(IS_AGGREGATE_ERROR ? b : a, undefined);\n var result = IS_AGGREGATE_ERROR ? new OriginalError(a) : new OriginalError();\n if (message !== undefined) createNonEnumerableProperty(result, 'message', message);\n if (ERROR_STACK_INSTALLABLE) createNonEnumerableProperty(result, 'stack', clearErrorStack(result.stack, 2));\n if (this && isPrototypeOf(OriginalErrorPrototype, this)) inheritIfRequired(result, this, WrappedError);\n if (arguments.length > OPTIONS_POSITION) installErrorCause(result, arguments[OPTIONS_POSITION]);\n return result;\n });\n\n WrappedError.prototype = OriginalErrorPrototype;\n\n if (ERROR_NAME !== 'Error') {\n if (setPrototypeOf) setPrototypeOf(WrappedError, BaseError);\n else copyConstructorProperties(WrappedError, BaseError, { name: true });\n } else if (DESCRIPTORS && STACK_TRACE_LIMIT in OriginalError) {\n proxyAccessor(WrappedError, OriginalError, STACK_TRACE_LIMIT);\n proxyAccessor(WrappedError, OriginalError, 'prepareStackTrace');\n }\n\n copyConstructorProperties(WrappedError, OriginalError);\n\n if (!IS_PURE) try {\n // Safari 13- bug: WebAssembly errors does not have a proper `.name`\n if (OriginalErrorPrototype.name !== ERROR_NAME) {\n createNonEnumerableProperty(OriginalErrorPrototype, 'name', ERROR_NAME);\n }\n OriginalErrorPrototype.constructor = WrappedError;\n } catch (error) { /* empty */ }\n\n return WrappedError;\n};\n","/* eslint-disable no-unused-vars -- required for functions `.length` */\nvar $ = require('../internals/export');\nvar global = require('../internals/global');\nvar apply = require('../internals/function-apply');\nvar wrapErrorConstructorWithCause = require('../internals/wrap-error-constructor-with-cause');\n\nvar WEB_ASSEMBLY = 'WebAssembly';\nvar WebAssembly = global[WEB_ASSEMBLY];\n\nvar FORCED = Error('e', { cause: 7 }).cause !== 7;\n\nvar exportGlobalErrorCauseWrapper = function (ERROR_NAME, wrapper) {\n var O = {};\n O[ERROR_NAME] = wrapErrorConstructorWithCause(ERROR_NAME, wrapper, FORCED);\n $({ global: true, constructor: true, arity: 1, forced: FORCED }, O);\n};\n\nvar exportWebAssemblyErrorCauseWrapper = function (ERROR_NAME, wrapper) {\n if (WebAssembly && WebAssembly[ERROR_NAME]) {\n var O = {};\n O[ERROR_NAME] = wrapErrorConstructorWithCause(WEB_ASSEMBLY + '.' + ERROR_NAME, wrapper, FORCED);\n $({ target: WEB_ASSEMBLY, stat: true, constructor: true, arity: 1, forced: FORCED }, O);\n }\n};\n\n// https://github.com/tc39/proposal-error-cause\nexportGlobalErrorCauseWrapper('Error', function (init) {\n return function Error(message) { return apply(init, this, arguments); };\n});\nexportGlobalErrorCauseWrapper('EvalError', function (init) {\n return function EvalError(message) { return apply(init, this, arguments); };\n});\nexportGlobalErrorCauseWrapper('RangeError', function (init) {\n return function RangeError(message) { return apply(init, this, arguments); };\n});\nexportGlobalErrorCauseWrapper('ReferenceError', function (init) {\n return function ReferenceError(message) { return apply(init, this, arguments); };\n});\nexportGlobalErrorCauseWrapper('SyntaxError', function (init) {\n return function SyntaxError(message) { return apply(init, this, arguments); };\n});\nexportGlobalErrorCauseWrapper('TypeError', function (init) {\n return function TypeError(message) { return apply(init, this, arguments); };\n});\nexportGlobalErrorCauseWrapper('URIError', function (init) {\n return function URIError(message) { return apply(init, this, arguments); };\n});\nexportWebAssemblyErrorCauseWrapper('CompileError', function (init) {\n return function CompileError(message) { return apply(init, this, arguments); };\n});\nexportWebAssemblyErrorCauseWrapper('LinkError', function (init) {\n return function LinkError(message) { return apply(init, this, arguments); };\n});\nexportWebAssemblyErrorCauseWrapper('RuntimeError', function (init) {\n return function RuntimeError(message) { return apply(init, this, arguments); };\n});\n","import firebase from '@firebase/app-compat';\nexport { default } from '@firebase/app-compat';\n\nvar name = \"firebase\";\nvar version = \"9.9.3\";\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\nfirebase.registerVersion(name, version, 'app-compat');\n//# sourceMappingURL=index.esm.js.map\n","import { ap as _isIOS7Or8, aq as debugAssert, ar as _isIOS, as as _isAndroid, at as _fail, au as _getRedirectUrl, av as _getProjectConfig, aw as _createError, ax as _assert, ay as _getInstance, b as browserLocalPersistence, az as _persistenceKeyName, aA as AuthEventManager, a as browserSessionPersistence, aB as _getRedirectResult, aC as _overrideRedirectResult, aD as _clearRedirectOutcomes, aE as _castAuth } from './index-90ebcfae.js';\nexport { A as ActionCodeOperation, ad as ActionCodeURL, H as AuthCredential, D as AuthErrorCodes, aG as AuthImpl, aJ as AuthPopup, I as EmailAuthCredential, M as EmailAuthProvider, N as FacebookAuthProvider, F as FactorId, aK as FetchProvider, T as GithubAuthProvider, Q as GoogleAuthProvider, J as OAuthCredential, U as OAuthProvider, O as OperationType, K as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, o as ProviderId, R as RecaptchaVerifier, aL as SAMLAuthCredential, V as SAMLAuthProvider, S as SignInMethod, W as TwitterAuthProvider, aF as UserImpl, ax as _assert, aE as _castAuth, at as _fail, aI as _generateEventId, aH as _getClientVersion, ay as _getInstance, aB as _getRedirectResult, aC as _overrideRedirectResult, az as _persistenceKeyName, a2 as applyActionCode, t as beforeAuthStateChanged, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a3 as checkActionCode, a1 as confirmPasswordReset, G as connectAuthEmulator, a5 as createUserWithEmailAndPassword, B as debugErrorMap, z as deleteUser, aa as fetchSignInMethodsForEmail, al as getAdditionalUserInfo, n as getAuth, ai as getIdToken, aj as getIdTokenResult, an as getMultiFactorResolver, j as getRedirectResult, L as inMemoryPersistence, i as indexedDBLocalPersistence, E as initializeAuth, a8 as isSignInWithEmailLink, Z as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, ao as multiFactor, v as onAuthStateChanged, q as onIdTokenChanged, ae as parseActionCodeURL, C as prodErrorMap, _ as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, am as reload, ab as sendEmailVerification, a0 as sendPasswordResetEmail, a7 as sendSignInLinkToEmail, p as setPersistence, X as signInAnonymously, Y as signInWithCredential, $ as signInWithCustomToken, a6 as signInWithEmailAndPassword, a9 as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, y as signOut, ak as unlink, x as updateCurrentUser, ag as updateEmail, ah as updatePassword, u as updatePhoneNumber, af as updateProfile, w as useDeviceLanguage, ac as verifyBeforeUpdateEmail, a4 as verifyPasswordResetCode } from './index-90ebcfae.js';\nimport { querystringDecode } from '@firebase/util';\nimport '@firebase/app';\nimport 'tslib';\nimport '@firebase/logger';\nimport '@firebase/component';\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 _cordovaWindow() {\r\n return window;\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 * How long to wait after the app comes back into focus before concluding that\r\n * the user closed the sign in tab.\r\n */\r\nconst REDIRECT_TIMEOUT_MS = 2000;\r\n/**\r\n * Generates the URL for the OAuth handler.\r\n */\r\nasync function _generateHandlerUrl(auth, event, provider) {\r\n var _a;\r\n // Get the cordova plugins\r\n const { BuildInfo } = _cordovaWindow();\r\n debugAssert(event.sessionId, 'AuthEvent did not contain a session ID');\r\n const sessionDigest = await computeSha256(event.sessionId);\r\n const additionalParams = {};\r\n if (_isIOS()) {\r\n // iOS app identifier\r\n additionalParams['ibi'] = BuildInfo.packageName;\r\n }\r\n else if (_isAndroid()) {\r\n // Android app identifier\r\n additionalParams['apn'] = BuildInfo.packageName;\r\n }\r\n else {\r\n _fail(auth, \"operation-not-supported-in-this-environment\" /* OPERATION_NOT_SUPPORTED */);\r\n }\r\n // Add the display name if available\r\n if (BuildInfo.displayName) {\r\n additionalParams['appDisplayName'] = BuildInfo.displayName;\r\n }\r\n // Attached the hashed session ID\r\n additionalParams['sessionId'] = sessionDigest;\r\n return _getRedirectUrl(auth, provider, event.type, undefined, (_a = event.eventId) !== null && _a !== void 0 ? _a : undefined, additionalParams);\r\n}\r\n/**\r\n * Validates that this app is valid for this project configuration\r\n */\r\nasync function _validateOrigin(auth) {\r\n const { BuildInfo } = _cordovaWindow();\r\n const request = {};\r\n if (_isIOS()) {\r\n request.iosBundleId = BuildInfo.packageName;\r\n }\r\n else if (_isAndroid()) {\r\n request.androidPackageName = BuildInfo.packageName;\r\n }\r\n else {\r\n _fail(auth, \"operation-not-supported-in-this-environment\" /* OPERATION_NOT_SUPPORTED */);\r\n }\r\n // Will fail automatically if package name is not authorized\r\n await _getProjectConfig(auth, request);\r\n}\r\nfunction _performRedirect(handlerUrl) {\r\n // Get the cordova plugins\r\n const { cordova } = _cordovaWindow();\r\n return new Promise(resolve => {\r\n cordova.plugins.browsertab.isAvailable(browserTabIsAvailable => {\r\n let iabRef = null;\r\n if (browserTabIsAvailable) {\r\n cordova.plugins.browsertab.openUrl(handlerUrl);\r\n }\r\n else {\r\n // TODO: Return the inappbrowser ref that's returned from the open call\r\n iabRef = cordova.InAppBrowser.open(handlerUrl, _isIOS7Or8() ? '_blank' : '_system', 'location=yes');\r\n }\r\n resolve(iabRef);\r\n });\r\n });\r\n}\r\n/**\r\n * This function waits for app activity to be seen before resolving. It does\r\n * this by attaching listeners to various dom events. Once the app is determined\r\n * to be visible, this promise resolves. AFTER that resolution, the listeners\r\n * are detached and any browser tabs left open will be closed.\r\n */\r\nasync function _waitForAppResume(auth, eventListener, iabRef) {\r\n // Get the cordova plugins\r\n const { cordova } = _cordovaWindow();\r\n let cleanup = () => { };\r\n try {\r\n await new Promise((resolve, reject) => {\r\n let onCloseTimer = null;\r\n // DEFINE ALL THE CALLBACKS =====\r\n function authEventSeen() {\r\n var _a;\r\n // Auth event was detected. Resolve this promise and close the extra\r\n // window if it's still open.\r\n resolve();\r\n const closeBrowserTab = (_a = cordova.plugins.browsertab) === null || _a === void 0 ? void 0 : _a.close;\r\n if (typeof closeBrowserTab === 'function') {\r\n closeBrowserTab();\r\n }\r\n // Close inappbrowser emebedded webview in iOS7 and 8 case if still\r\n // open.\r\n if (typeof (iabRef === null || iabRef === void 0 ? void 0 : iabRef.close) === 'function') {\r\n iabRef.close();\r\n }\r\n }\r\n function resumed() {\r\n if (onCloseTimer) {\r\n // This code already ran; do not rerun.\r\n return;\r\n }\r\n onCloseTimer = window.setTimeout(() => {\r\n // Wait two seeconds after resume then reject.\r\n reject(_createError(auth, \"redirect-cancelled-by-user\" /* REDIRECT_CANCELLED_BY_USER */));\r\n }, REDIRECT_TIMEOUT_MS);\r\n }\r\n function visibilityChanged() {\r\n if ((document === null || document === void 0 ? void 0 : document.visibilityState) === 'visible') {\r\n resumed();\r\n }\r\n }\r\n // ATTACH ALL THE LISTENERS =====\r\n // Listen for the auth event\r\n eventListener.addPassiveListener(authEventSeen);\r\n // Listen for resume and visibility events\r\n document.addEventListener('resume', resumed, false);\r\n if (_isAndroid()) {\r\n document.addEventListener('visibilitychange', visibilityChanged, false);\r\n }\r\n // SETUP THE CLEANUP FUNCTION =====\r\n cleanup = () => {\r\n eventListener.removePassiveListener(authEventSeen);\r\n document.removeEventListener('resume', resumed, false);\r\n document.removeEventListener('visibilitychange', visibilityChanged, false);\r\n if (onCloseTimer) {\r\n window.clearTimeout(onCloseTimer);\r\n }\r\n };\r\n });\r\n }\r\n finally {\r\n cleanup();\r\n }\r\n}\r\n/**\r\n * Checks the configuration of the Cordova environment. This has no side effect\r\n * if the configuration is correct; otherwise it throws an error with the\r\n * missing plugin.\r\n */\r\nfunction _checkCordovaConfiguration(auth) {\r\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;\r\n const win = _cordovaWindow();\r\n // Check all dependencies installed.\r\n // https://github.com/nordnet/cordova-universal-links-plugin\r\n // Note that cordova-universal-links-plugin has been abandoned.\r\n // A fork with latest fixes is available at:\r\n // https://www.npmjs.com/package/cordova-universal-links-plugin-fix\r\n _assert(typeof ((_a = win === null || win === void 0 ? void 0 : win.universalLinks) === null || _a === void 0 ? void 0 : _a.subscribe) === 'function', auth, \"invalid-cordova-configuration\" /* INVALID_CORDOVA_CONFIGURATION */, {\r\n missingPlugin: 'cordova-universal-links-plugin-fix'\r\n });\r\n // https://www.npmjs.com/package/cordova-plugin-buildinfo\r\n _assert(typeof ((_b = win === null || win === void 0 ? void 0 : win.BuildInfo) === null || _b === void 0 ? void 0 : _b.packageName) !== 'undefined', auth, \"invalid-cordova-configuration\" /* INVALID_CORDOVA_CONFIGURATION */, {\r\n missingPlugin: 'cordova-plugin-buildInfo'\r\n });\r\n // https://github.com/google/cordova-plugin-browsertab\r\n _assert(typeof ((_e = (_d = (_c = win === null || win === void 0 ? void 0 : win.cordova) === null || _c === void 0 ? void 0 : _c.plugins) === null || _d === void 0 ? void 0 : _d.browsertab) === null || _e === void 0 ? void 0 : _e.openUrl) === 'function', auth, \"invalid-cordova-configuration\" /* INVALID_CORDOVA_CONFIGURATION */, {\r\n missingPlugin: 'cordova-plugin-browsertab'\r\n });\r\n _assert(typeof ((_h = (_g = (_f = win === null || win === void 0 ? void 0 : win.cordova) === null || _f === void 0 ? void 0 : _f.plugins) === null || _g === void 0 ? void 0 : _g.browsertab) === null || _h === void 0 ? void 0 : _h.isAvailable) === 'function', auth, \"invalid-cordova-configuration\" /* INVALID_CORDOVA_CONFIGURATION */, {\r\n missingPlugin: 'cordova-plugin-browsertab'\r\n });\r\n // https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-inappbrowser/\r\n _assert(typeof ((_k = (_j = win === null || win === void 0 ? void 0 : win.cordova) === null || _j === void 0 ? void 0 : _j.InAppBrowser) === null || _k === void 0 ? void 0 : _k.open) === 'function', auth, \"invalid-cordova-configuration\" /* INVALID_CORDOVA_CONFIGURATION */, {\r\n missingPlugin: 'cordova-plugin-inappbrowser'\r\n });\r\n}\r\n/**\r\n * Computes the SHA-256 of a session ID. The SubtleCrypto interface is only\r\n * available in \"secure\" contexts, which covers Cordova (which is served on a file\r\n * protocol).\r\n */\r\nasync function computeSha256(sessionId) {\r\n const bytes = stringToArrayBuffer(sessionId);\r\n // TODO: For IE11 crypto has a different name and this operation comes back\r\n // as an object, not a promise. This is the old proposed standard that\r\n // is used by IE11:\r\n // https://www.w3.org/TR/2013/WD-WebCryptoAPI-20130108/#cryptooperation-interface\r\n const buf = await crypto.subtle.digest('SHA-256', bytes);\r\n const arr = Array.from(new Uint8Array(buf));\r\n return arr.map(num => num.toString(16).padStart(2, '0')).join('');\r\n}\r\nfunction stringToArrayBuffer(str) {\r\n // This function is only meant to deal with an ASCII charset and makes\r\n // certain simplifying assumptions.\r\n debugAssert(/[0-9a-zA-Z]+/.test(str), 'Can only convert alpha-numeric strings');\r\n if (typeof TextEncoder !== 'undefined') {\r\n return new TextEncoder().encode(str);\r\n }\r\n const buff = new ArrayBuffer(str.length);\r\n const view = new Uint8Array(buff);\r\n for (let i = 0; i < str.length; i++) {\r\n view[i] = str.charCodeAt(i);\r\n }\r\n return view;\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 SESSION_ID_LENGTH = 20;\r\n/** Custom AuthEventManager that adds passive listeners to events */\r\nclass CordovaAuthEventManager extends AuthEventManager {\r\n constructor() {\r\n super(...arguments);\r\n this.passiveListeners = new Set();\r\n this.initPromise = new Promise(resolve => {\r\n this.resolveInialized = resolve;\r\n });\r\n }\r\n addPassiveListener(cb) {\r\n this.passiveListeners.add(cb);\r\n }\r\n removePassiveListener(cb) {\r\n this.passiveListeners.delete(cb);\r\n }\r\n // In a Cordova environment, this manager can live through multiple redirect\r\n // operations\r\n resetRedirect() {\r\n this.queuedRedirectEvent = null;\r\n this.hasHandledPotentialRedirect = false;\r\n }\r\n /** Override the onEvent method */\r\n onEvent(event) {\r\n this.resolveInialized();\r\n this.passiveListeners.forEach(cb => cb(event));\r\n return super.onEvent(event);\r\n }\r\n async initialized() {\r\n await this.initPromise;\r\n }\r\n}\r\n/**\r\n * Generates a (partial) {@link AuthEvent}.\r\n */\r\nfunction _generateNewEvent(auth, type, eventId = null) {\r\n return {\r\n type,\r\n eventId,\r\n urlResponse: null,\r\n sessionId: generateSessionId(),\r\n postBody: null,\r\n tenantId: auth.tenantId,\r\n error: _createError(auth, \"no-auth-event\" /* NO_AUTH_EVENT */)\r\n };\r\n}\r\nfunction _savePartialEvent(auth, event) {\r\n return storage()._set(persistenceKey(auth), event);\r\n}\r\nasync function _getAndRemoveEvent(auth) {\r\n const event = (await storage()._get(persistenceKey(auth)));\r\n if (event) {\r\n await storage()._remove(persistenceKey(auth));\r\n }\r\n return event;\r\n}\r\nfunction _eventFromPartialAndUrl(partialEvent, url) {\r\n var _a, _b;\r\n // Parse the deep link within the dynamic link URL.\r\n const callbackUrl = _getDeepLinkFromCallback(url);\r\n // Confirm it is actually a callback URL.\r\n // Currently the universal link will be of this format:\r\n // https://<AUTH_DOMAIN>/__/auth/callback<OAUTH_RESPONSE>\r\n // This is a fake URL but is not intended to take the user anywhere\r\n // and just redirect to the app.\r\n if (callbackUrl.includes('/__/auth/callback')) {\r\n // Check if there is an error in the URL.\r\n // This mechanism is also used to pass errors back to the app:\r\n // https://<AUTH_DOMAIN>/__/auth/callback?firebaseError=<STRINGIFIED_ERROR>\r\n const params = searchParamsOrEmpty(callbackUrl);\r\n // Get the error object corresponding to the stringified error if found.\r\n const errorObject = params['firebaseError']\r\n ? parseJsonOrNull(decodeURIComponent(params['firebaseError']))\r\n : null;\r\n const code = (_b = (_a = errorObject === null || errorObject === void 0 ? void 0 : errorObject['code']) === null || _a === void 0 ? void 0 : _a.split('auth/')) === null || _b === void 0 ? void 0 : _b[1];\r\n const error = code ? _createError(code) : null;\r\n if (error) {\r\n return {\r\n type: partialEvent.type,\r\n eventId: partialEvent.eventId,\r\n tenantId: partialEvent.tenantId,\r\n error,\r\n urlResponse: null,\r\n sessionId: null,\r\n postBody: null\r\n };\r\n }\r\n else {\r\n return {\r\n type: partialEvent.type,\r\n eventId: partialEvent.eventId,\r\n tenantId: partialEvent.tenantId,\r\n sessionId: partialEvent.sessionId,\r\n urlResponse: callbackUrl,\r\n postBody: null\r\n };\r\n }\r\n }\r\n return null;\r\n}\r\nfunction generateSessionId() {\r\n const chars = [];\r\n const allowedChars = '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\r\n for (let i = 0; i < SESSION_ID_LENGTH; i++) {\r\n const idx = Math.floor(Math.random() * allowedChars.length);\r\n chars.push(allowedChars.charAt(idx));\r\n }\r\n return chars.join('');\r\n}\r\nfunction storage() {\r\n return _getInstance(browserLocalPersistence);\r\n}\r\nfunction persistenceKey(auth) {\r\n return _persistenceKeyName(\"authEvent\" /* AUTH_EVENT */, auth.config.apiKey, auth.name);\r\n}\r\nfunction parseJsonOrNull(json) {\r\n try {\r\n return JSON.parse(json);\r\n }\r\n catch (e) {\r\n return null;\r\n }\r\n}\r\n// Exported for testing\r\nfunction _getDeepLinkFromCallback(url) {\r\n const params = searchParamsOrEmpty(url);\r\n const link = params['link'] ? decodeURIComponent(params['link']) : undefined;\r\n // Double link case (automatic redirect)\r\n const doubleDeepLink = searchParamsOrEmpty(link)['link'];\r\n // iOS custom scheme links.\r\n const iOSDeepLink = params['deep_link_id']\r\n ? decodeURIComponent(params['deep_link_id'])\r\n : undefined;\r\n const iOSDoubleDeepLink = searchParamsOrEmpty(iOSDeepLink)['link'];\r\n return iOSDoubleDeepLink || iOSDeepLink || doubleDeepLink || link || url;\r\n}\r\n/**\r\n * Optimistically tries to get search params from a string, or else returns an\r\n * empty search params object.\r\n */\r\nfunction searchParamsOrEmpty(url) {\r\n if (!(url === null || url === void 0 ? void 0 : url.includes('?'))) {\r\n return {};\r\n }\r\n const [_, ...rest] = url.split('?');\r\n return querystringDecode(rest.join('?'));\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\n/**\r\n * How long to wait for the initial auth event before concluding no\r\n * redirect pending\r\n */\r\nconst INITIAL_EVENT_TIMEOUT_MS = 500;\r\nclass CordovaPopupRedirectResolver {\r\n constructor() {\r\n this._redirectPersistence = browserSessionPersistence;\r\n this._shouldInitProactively = true; // This is lightweight for Cordova\r\n this.eventManagers = new Map();\r\n this.originValidationPromises = {};\r\n this._completeRedirectFn = _getRedirectResult;\r\n this._overrideRedirectResult = _overrideRedirectResult;\r\n }\r\n async _initialize(auth) {\r\n const key = auth._key();\r\n let manager = this.eventManagers.get(key);\r\n if (!manager) {\r\n manager = new CordovaAuthEventManager(auth);\r\n this.eventManagers.set(key, manager);\r\n this.attachCallbackListeners(auth, manager);\r\n }\r\n return manager;\r\n }\r\n _openPopup(auth) {\r\n _fail(auth, \"operation-not-supported-in-this-environment\" /* OPERATION_NOT_SUPPORTED */);\r\n }\r\n async _openRedirect(auth, provider, authType, eventId) {\r\n _checkCordovaConfiguration(auth);\r\n const manager = await this._initialize(auth);\r\n await manager.initialized();\r\n // Reset the persisted redirect states. This does not matter on Web where\r\n // the redirect always blows away application state entirely. On Cordova,\r\n // the app maintains control flow through the redirect.\r\n manager.resetRedirect();\r\n _clearRedirectOutcomes();\r\n await this._originValidation(auth);\r\n const event = _generateNewEvent(auth, authType, eventId);\r\n await _savePartialEvent(auth, event);\r\n const url = await _generateHandlerUrl(auth, event, provider);\r\n const iabRef = await _performRedirect(url);\r\n return _waitForAppResume(auth, manager, iabRef);\r\n }\r\n _isIframeWebStorageSupported(_auth, _cb) {\r\n throw new Error('Method not implemented.');\r\n }\r\n _originValidation(auth) {\r\n const key = auth._key();\r\n if (!this.originValidationPromises[key]) {\r\n this.originValidationPromises[key] = _validateOrigin(auth);\r\n }\r\n return this.originValidationPromises[key];\r\n }\r\n attachCallbackListeners(auth, manager) {\r\n // Get the global plugins\r\n const { universalLinks, handleOpenURL, BuildInfo } = _cordovaWindow();\r\n const noEventTimeout = setTimeout(async () => {\r\n // We didn't see that initial event. Clear any pending object and\r\n // dispatch no event\r\n await _getAndRemoveEvent(auth);\r\n manager.onEvent(generateNoEvent());\r\n }, INITIAL_EVENT_TIMEOUT_MS);\r\n const universalLinksCb = async (eventData) => {\r\n // We have an event so we can clear the no event timeout\r\n clearTimeout(noEventTimeout);\r\n const partialEvent = await _getAndRemoveEvent(auth);\r\n let finalEvent = null;\r\n if (partialEvent && (eventData === null || eventData === void 0 ? void 0 : eventData['url'])) {\r\n finalEvent = _eventFromPartialAndUrl(partialEvent, eventData['url']);\r\n }\r\n // If finalEvent is never filled, trigger with no event\r\n manager.onEvent(finalEvent || generateNoEvent());\r\n };\r\n // Universal links subscriber doesn't exist for iOS, so we need to check\r\n if (typeof universalLinks !== 'undefined' &&\r\n typeof universalLinks.subscribe === 'function') {\r\n universalLinks.subscribe(null, universalLinksCb);\r\n }\r\n // iOS 7 or 8 custom URL schemes.\r\n // This is also the current default behavior for iOS 9+.\r\n // For this to work, cordova-plugin-customurlscheme needs to be installed.\r\n // https://github.com/EddyVerbruggen/Custom-URL-scheme\r\n // Do not overwrite the existing developer's URL handler.\r\n const existingHandleOpenURL = handleOpenURL;\r\n const packagePrefix = `${BuildInfo.packageName.toLowerCase()}://`;\r\n _cordovaWindow().handleOpenURL = async (url) => {\r\n if (url.toLowerCase().startsWith(packagePrefix)) {\r\n // We want this intentionally to float\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n universalLinksCb({ url });\r\n }\r\n // Call the developer's handler if it is present.\r\n if (typeof existingHandleOpenURL === 'function') {\r\n try {\r\n existingHandleOpenURL(url);\r\n }\r\n catch (e) {\r\n // This is a developer error. Don't stop the flow of the SDK.\r\n console.error(e);\r\n }\r\n }\r\n };\r\n }\r\n}\r\n/**\r\n * An implementation of {@link PopupRedirectResolver} suitable for Cordova\r\n * based applications.\r\n *\r\n * @public\r\n */\r\nconst cordovaPopupRedirectResolver = CordovaPopupRedirectResolver;\r\nfunction generateNoEvent() {\r\n return {\r\n type: \"unknown\" /* UNKNOWN */,\r\n eventId: null,\r\n sessionId: null,\r\n urlResponse: null,\r\n postBody: null,\r\n tenantId: null,\r\n error: _createError(\"no-auth-event\" /* NO_AUTH_EVENT */)\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// This function should only be called by frameworks (e.g. FirebaseUI-web) to log their usage.\r\n// It is not intended for direct use by developer apps. NO jsdoc here to intentionally leave it out\r\n// of autogenerated documentation pages to reduce accidental misuse.\r\nfunction addFrameworkForLogging(auth, framework) {\r\n _castAuth(auth)._logFramework(framework);\r\n}\n\nexport { addFrameworkForLogging, cordovaPopupRedirectResolver };\n//# sourceMappingURL=internal.js.map\n","import firebase from '@firebase/app-compat';\nimport * as exp from '@firebase/auth/internal';\nimport { Component } from '@firebase/component';\nimport { isBrowserExtension, isReactNative, isNode, getUA, isIE, isIndexedDBAvailable, FirebaseError } from '@firebase/util';\n\nvar name = \"@firebase/auth-compat\";\nvar version = \"0.2.18\";\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 CORDOVA_ONDEVICEREADY_TIMEOUT_MS = 1000;\r\nfunction _getCurrentScheme() {\r\n var _a;\r\n return ((_a = self === null || self === void 0 ? void 0 : self.location) === null || _a === void 0 ? void 0 : _a.protocol) || null;\r\n}\r\n/**\r\n * @return {boolean} Whether the current environment is http or https.\r\n */\r\nfunction _isHttpOrHttps() {\r\n return _getCurrentScheme() === 'http:' || _getCurrentScheme() === 'https:';\r\n}\r\n/**\r\n * @param {?string=} ua The user agent.\r\n * @return {boolean} Whether the app is rendered in a mobile iOS or Android\r\n * Cordova environment.\r\n */\r\nfunction _isAndroidOrIosCordovaScheme(ua = getUA()) {\r\n return !!((_getCurrentScheme() === 'file:' ||\r\n _getCurrentScheme() === 'ionic:' ||\r\n _getCurrentScheme() === 'capacitor:') &&\r\n ua.toLowerCase().match(/iphone|ipad|ipod|android/));\r\n}\r\n/**\r\n * @return {boolean} Whether the environment is a native environment, where\r\n * CORS checks do not apply.\r\n */\r\nfunction _isNativeEnvironment() {\r\n return isReactNative() || isNode();\r\n}\r\n/**\r\n * Checks whether the user agent is IE11.\r\n * @return {boolean} True if it is IE11.\r\n */\r\nfunction _isIe11() {\r\n return isIE() && (document === null || document === void 0 ? void 0 : document.documentMode) === 11;\r\n}\r\n/**\r\n * Checks whether the user agent is Edge.\r\n * @param {string} userAgent The browser user agent string.\r\n * @return {boolean} True if it is Edge.\r\n */\r\nfunction _isEdge(ua = getUA()) {\r\n return /Edge\\/\\d+/.test(ua);\r\n}\r\n/**\r\n * @param {?string=} opt_userAgent The navigator user agent.\r\n * @return {boolean} Whether local storage is not synchronized between an iframe\r\n * and a popup of the same domain.\r\n */\r\nfunction _isLocalStorageNotSynchronized(ua = getUA()) {\r\n return _isIe11() || _isEdge(ua);\r\n}\r\n/** @return {boolean} Whether web storage is supported. */\r\nfunction _isWebStorageSupported() {\r\n try {\r\n const storage = self.localStorage;\r\n const key = exp._generateEventId();\r\n if (storage) {\r\n // setItem will throw an exception if we cannot access WebStorage (e.g.,\r\n // Safari in private mode).\r\n storage['setItem'](key, '1');\r\n storage['removeItem'](key);\r\n // For browsers where iframe web storage does not synchronize with a popup\r\n // of the same domain, indexedDB is used for persistent storage. These\r\n // browsers include IE11 and Edge.\r\n // Make sure it is supported (IE11 and Edge private mode does not support\r\n // that).\r\n if (_isLocalStorageNotSynchronized()) {\r\n // In such browsers, if indexedDB is not supported, an iframe cannot be\r\n // notified of the popup sign in result.\r\n return isIndexedDBAvailable();\r\n }\r\n return true;\r\n }\r\n }\r\n catch (e) {\r\n // localStorage is not available from a worker. Test availability of\r\n // indexedDB.\r\n return _isWorker() && isIndexedDBAvailable();\r\n }\r\n return false;\r\n}\r\n/**\r\n * @param {?Object=} global The optional global scope.\r\n * @return {boolean} Whether current environment is a worker.\r\n */\r\nfunction _isWorker() {\r\n // WorkerGlobalScope only defined in worker environment.\r\n return (typeof global !== 'undefined' &&\r\n 'WorkerGlobalScope' in global &&\r\n 'importScripts' in global);\r\n}\r\nfunction _isPopupRedirectSupported() {\r\n return ((_isHttpOrHttps() ||\r\n isBrowserExtension() ||\r\n _isAndroidOrIosCordovaScheme()) &&\r\n // React Native with remote debugging reports its location.protocol as\r\n // http.\r\n !_isNativeEnvironment() &&\r\n // Local storage has to be supported for browser popup and redirect\r\n // operations to work.\r\n _isWebStorageSupported() &&\r\n // DOM, popups and redirects are not supported within a worker.\r\n !_isWorker());\r\n}\r\n/** Quick check that indicates the platform *may* be Cordova */\r\nfunction _isLikelyCordova() {\r\n return _isAndroidOrIosCordovaScheme() && typeof document !== 'undefined';\r\n}\r\nasync function _isCordova() {\r\n if (!_isLikelyCordova()) {\r\n return false;\r\n }\r\n return new Promise(resolve => {\r\n const timeoutId = setTimeout(() => {\r\n // We've waited long enough; the telltale Cordova event didn't happen\r\n resolve(false);\r\n }, CORDOVA_ONDEVICEREADY_TIMEOUT_MS);\r\n document.addEventListener('deviceready', () => {\r\n clearTimeout(timeoutId);\r\n resolve(true);\r\n });\r\n });\r\n}\r\nfunction _getSelfWindow() {\r\n return typeof window !== 'undefined' ? window : null;\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 Persistence = {\r\n LOCAL: 'local',\r\n NONE: 'none',\r\n SESSION: 'session'\r\n};\r\nconst _assert$3 = exp._assert;\r\nconst PERSISTENCE_KEY = 'persistence';\r\n/**\r\n * Validates that an argument is a valid persistence value. If an invalid type\r\n * is specified, an error is thrown synchronously.\r\n */\r\nfunction _validatePersistenceArgument(auth, persistence) {\r\n _assert$3(Object.values(Persistence).includes(persistence), auth, \"invalid-persistence-type\" /* INVALID_PERSISTENCE */);\r\n // Validate if the specified type is supported in the current environment.\r\n if (isReactNative()) {\r\n // This is only supported in a browser.\r\n _assert$3(persistence !== Persistence.SESSION, auth, \"unsupported-persistence-type\" /* UNSUPPORTED_PERSISTENCE */);\r\n return;\r\n }\r\n if (isNode()) {\r\n // Only none is supported in Node.js.\r\n _assert$3(persistence === Persistence.NONE, auth, \"unsupported-persistence-type\" /* UNSUPPORTED_PERSISTENCE */);\r\n return;\r\n }\r\n if (_isWorker()) {\r\n // In a worker environment, either LOCAL or NONE are supported.\r\n // If indexedDB not supported and LOCAL provided, throw an error\r\n _assert$3(persistence === Persistence.NONE ||\r\n (persistence === Persistence.LOCAL && isIndexedDBAvailable()), auth, \"unsupported-persistence-type\" /* UNSUPPORTED_PERSISTENCE */);\r\n return;\r\n }\r\n // This is restricted by what the browser supports.\r\n _assert$3(persistence === Persistence.NONE || _isWebStorageSupported(), auth, \"unsupported-persistence-type\" /* UNSUPPORTED_PERSISTENCE */);\r\n}\r\nasync function _savePersistenceForRedirect(auth) {\r\n await auth._initializationPromise;\r\n const session = getSessionStorageIfAvailable();\r\n const key = exp._persistenceKeyName(PERSISTENCE_KEY, auth.config.apiKey, auth.name);\r\n if (session) {\r\n session.setItem(key, auth._getPersistence());\r\n }\r\n}\r\nfunction _getPersistencesFromRedirect(apiKey, appName) {\r\n const session = getSessionStorageIfAvailable();\r\n if (!session) {\r\n return [];\r\n }\r\n const key = exp._persistenceKeyName(PERSISTENCE_KEY, apiKey, appName);\r\n const persistence = session.getItem(key);\r\n switch (persistence) {\r\n case Persistence.NONE:\r\n return [exp.inMemoryPersistence];\r\n case Persistence.LOCAL:\r\n return [exp.indexedDBLocalPersistence, exp.browserSessionPersistence];\r\n case Persistence.SESSION:\r\n return [exp.browserSessionPersistence];\r\n default:\r\n return [];\r\n }\r\n}\r\n/** Returns session storage, or null if the property access errors */\r\nfunction getSessionStorageIfAvailable() {\r\n var _a;\r\n try {\r\n return ((_a = _getSelfWindow()) === null || _a === void 0 ? void 0 : _a.sessionStorage) || null;\r\n }\r\n catch (e) {\r\n return null;\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 _assert$2 = exp._assert;\r\n/** Platform-agnostic popup-redirect resolver */\r\nclass CompatPopupRedirectResolver {\r\n constructor() {\r\n // Create both resolvers for dynamic resolution later\r\n this.browserResolver = exp._getInstance(exp.browserPopupRedirectResolver);\r\n this.cordovaResolver = exp._getInstance(exp.cordovaPopupRedirectResolver);\r\n // The actual resolver in use: either browserResolver or cordovaResolver.\r\n this.underlyingResolver = null;\r\n this._redirectPersistence = exp.browserSessionPersistence;\r\n this._completeRedirectFn = exp._getRedirectResult;\r\n this._overrideRedirectResult = exp._overrideRedirectResult;\r\n }\r\n async _initialize(auth) {\r\n await this.selectUnderlyingResolver();\r\n return this.assertedUnderlyingResolver._initialize(auth);\r\n }\r\n async _openPopup(auth, provider, authType, eventId) {\r\n await this.selectUnderlyingResolver();\r\n return this.assertedUnderlyingResolver._openPopup(auth, provider, authType, eventId);\r\n }\r\n async _openRedirect(auth, provider, authType, eventId) {\r\n await this.selectUnderlyingResolver();\r\n return this.assertedUnderlyingResolver._openRedirect(auth, provider, authType, eventId);\r\n }\r\n _isIframeWebStorageSupported(auth, cb) {\r\n this.assertedUnderlyingResolver._isIframeWebStorageSupported(auth, cb);\r\n }\r\n _originValidation(auth) {\r\n return this.assertedUnderlyingResolver._originValidation(auth);\r\n }\r\n get _shouldInitProactively() {\r\n return _isLikelyCordova() || this.browserResolver._shouldInitProactively;\r\n }\r\n get assertedUnderlyingResolver() {\r\n _assert$2(this.underlyingResolver, \"internal-error\" /* INTERNAL_ERROR */);\r\n return this.underlyingResolver;\r\n }\r\n async selectUnderlyingResolver() {\r\n if (this.underlyingResolver) {\r\n return;\r\n }\r\n // We haven't yet determined whether or not we're in Cordova; go ahead\r\n // and determine that state now.\r\n const isCordova = await _isCordova();\r\n this.underlyingResolver = isCordova\r\n ? this.cordovaResolver\r\n : this.browserResolver;\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 unwrap(object) {\r\n return object.unwrap();\r\n}\r\nfunction wrapped(object) {\r\n return object.wrapped();\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 credentialFromResponse(userCredential) {\r\n return credentialFromObject(userCredential);\r\n}\r\nfunction attachExtraErrorFields(auth, e) {\r\n var _a, _b;\r\n // The response contains all fields from the server which may or may not\r\n // actually match the underlying type\r\n const response = (_a = e.customData) === null || _a === void 0 ? void 0 : _a._tokenResponse;\r\n if (((_b = e) === null || _b === void 0 ? void 0 : _b.code) === 'auth/multi-factor-auth-required') {\r\n const mfaErr = e;\r\n mfaErr.resolver = new MultiFactorResolver(auth, exp.getMultiFactorResolver(auth, e));\r\n }\r\n else if (response) {\r\n const credential = credentialFromObject(e);\r\n const credErr = e;\r\n if (credential) {\r\n credErr.credential = credential;\r\n credErr.tenantId = response.tenantId || undefined;\r\n credErr.email = response.email || undefined;\r\n credErr.phoneNumber = response.phoneNumber || undefined;\r\n }\r\n }\r\n}\r\nfunction credentialFromObject(object) {\r\n const { _tokenResponse } = (object instanceof FirebaseError ? object.customData : object);\r\n if (!_tokenResponse) {\r\n return null;\r\n }\r\n // Handle phone Auth credential responses, as they have a different format\r\n // from other backend responses (i.e. no providerId). This is also only the\r\n // case for user credentials (does not work for errors).\r\n if (!(object instanceof FirebaseError)) {\r\n if ('temporaryProof' in _tokenResponse && 'phoneNumber' in _tokenResponse) {\r\n return exp.PhoneAuthProvider.credentialFromResult(object);\r\n }\r\n }\r\n const providerId = _tokenResponse.providerId;\r\n // Email and password is not supported as there is no situation where the\r\n // server would return the password to the client.\r\n if (!providerId || providerId === exp.ProviderId.PASSWORD) {\r\n return null;\r\n }\r\n let provider;\r\n switch (providerId) {\r\n case exp.ProviderId.GOOGLE:\r\n provider = exp.GoogleAuthProvider;\r\n break;\r\n case exp.ProviderId.FACEBOOK:\r\n provider = exp.FacebookAuthProvider;\r\n break;\r\n case exp.ProviderId.GITHUB:\r\n provider = exp.GithubAuthProvider;\r\n break;\r\n case exp.ProviderId.TWITTER:\r\n provider = exp.TwitterAuthProvider;\r\n break;\r\n default:\r\n const { oauthIdToken, oauthAccessToken, oauthTokenSecret, pendingToken, nonce } = _tokenResponse;\r\n if (!oauthAccessToken &&\r\n !oauthTokenSecret &&\r\n !oauthIdToken &&\r\n !pendingToken) {\r\n return null;\r\n }\r\n // TODO(avolkovi): uncomment this and get it working with SAML & OIDC\r\n if (pendingToken) {\r\n if (providerId.startsWith('saml.')) {\r\n return exp.SAMLAuthCredential._create(providerId, pendingToken);\r\n }\r\n else {\r\n // OIDC and non-default providers excluding Twitter.\r\n return exp.OAuthCredential._fromParams({\r\n providerId,\r\n signInMethod: providerId,\r\n pendingToken,\r\n idToken: oauthIdToken,\r\n accessToken: oauthAccessToken\r\n });\r\n }\r\n }\r\n return new exp.OAuthProvider(providerId).credential({\r\n idToken: oauthIdToken,\r\n accessToken: oauthAccessToken,\r\n rawNonce: nonce\r\n });\r\n }\r\n return object instanceof FirebaseError\r\n ? provider.credentialFromError(object)\r\n : provider.credentialFromResult(object);\r\n}\r\nfunction convertCredential(auth, credentialPromise) {\r\n return credentialPromise\r\n .catch(e => {\r\n if (e instanceof FirebaseError) {\r\n attachExtraErrorFields(auth, e);\r\n }\r\n throw e;\r\n })\r\n .then(credential => {\r\n const operationType = credential.operationType;\r\n const user = credential.user;\r\n return {\r\n operationType,\r\n credential: credentialFromResponse(credential),\r\n additionalUserInfo: exp.getAdditionalUserInfo(credential),\r\n user: User.getOrCreate(user)\r\n };\r\n });\r\n}\r\nasync function convertConfirmationResult(auth, confirmationResultPromise) {\r\n const confirmationResultExp = await confirmationResultPromise;\r\n return {\r\n verificationId: confirmationResultExp.verificationId,\r\n confirm: (verificationCode) => convertCredential(auth, confirmationResultExp.confirm(verificationCode))\r\n };\r\n}\r\nclass MultiFactorResolver {\r\n constructor(auth, resolver) {\r\n this.resolver = resolver;\r\n this.auth = wrapped(auth);\r\n }\r\n get session() {\r\n return this.resolver.session;\r\n }\r\n get hints() {\r\n return this.resolver.hints;\r\n }\r\n resolveSignIn(assertion) {\r\n return convertCredential(unwrap(this.auth), this.resolver.resolveSignIn(assertion));\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\nclass User {\r\n constructor(_delegate) {\r\n this._delegate = _delegate;\r\n this.multiFactor = exp.multiFactor(_delegate);\r\n }\r\n static getOrCreate(user) {\r\n if (!User.USER_MAP.has(user)) {\r\n User.USER_MAP.set(user, new User(user));\r\n }\r\n return User.USER_MAP.get(user);\r\n }\r\n delete() {\r\n return this._delegate.delete();\r\n }\r\n reload() {\r\n return this._delegate.reload();\r\n }\r\n toJSON() {\r\n return this._delegate.toJSON();\r\n }\r\n getIdTokenResult(forceRefresh) {\r\n return this._delegate.getIdTokenResult(forceRefresh);\r\n }\r\n getIdToken(forceRefresh) {\r\n return this._delegate.getIdToken(forceRefresh);\r\n }\r\n linkAndRetrieveDataWithCredential(credential) {\r\n return this.linkWithCredential(credential);\r\n }\r\n async linkWithCredential(credential) {\r\n return convertCredential(this.auth, exp.linkWithCredential(this._delegate, credential));\r\n }\r\n async linkWithPhoneNumber(phoneNumber, applicationVerifier) {\r\n return convertConfirmationResult(this.auth, exp.linkWithPhoneNumber(this._delegate, phoneNumber, applicationVerifier));\r\n }\r\n async linkWithPopup(provider) {\r\n return convertCredential(this.auth, exp.linkWithPopup(this._delegate, provider, CompatPopupRedirectResolver));\r\n }\r\n async linkWithRedirect(provider) {\r\n await _savePersistenceForRedirect(exp._castAuth(this.auth));\r\n return exp.linkWithRedirect(this._delegate, provider, CompatPopupRedirectResolver);\r\n }\r\n reauthenticateAndRetrieveDataWithCredential(credential) {\r\n return this.reauthenticateWithCredential(credential);\r\n }\r\n async reauthenticateWithCredential(credential) {\r\n return convertCredential(this.auth, exp.reauthenticateWithCredential(this._delegate, credential));\r\n }\r\n reauthenticateWithPhoneNumber(phoneNumber, applicationVerifier) {\r\n return convertConfirmationResult(this.auth, exp.reauthenticateWithPhoneNumber(this._delegate, phoneNumber, applicationVerifier));\r\n }\r\n reauthenticateWithPopup(provider) {\r\n return convertCredential(this.auth, exp.reauthenticateWithPopup(this._delegate, provider, CompatPopupRedirectResolver));\r\n }\r\n async reauthenticateWithRedirect(provider) {\r\n await _savePersistenceForRedirect(exp._castAuth(this.auth));\r\n return exp.reauthenticateWithRedirect(this._delegate, provider, CompatPopupRedirectResolver);\r\n }\r\n sendEmailVerification(actionCodeSettings) {\r\n return exp.sendEmailVerification(this._delegate, actionCodeSettings);\r\n }\r\n async unlink(providerId) {\r\n await exp.unlink(this._delegate, providerId);\r\n return this;\r\n }\r\n updateEmail(newEmail) {\r\n return exp.updateEmail(this._delegate, newEmail);\r\n }\r\n updatePassword(newPassword) {\r\n return exp.updatePassword(this._delegate, newPassword);\r\n }\r\n updatePhoneNumber(phoneCredential) {\r\n return exp.updatePhoneNumber(this._delegate, phoneCredential);\r\n }\r\n updateProfile(profile) {\r\n return exp.updateProfile(this._delegate, profile);\r\n }\r\n verifyBeforeUpdateEmail(newEmail, actionCodeSettings) {\r\n return exp.verifyBeforeUpdateEmail(this._delegate, newEmail, actionCodeSettings);\r\n }\r\n get emailVerified() {\r\n return this._delegate.emailVerified;\r\n }\r\n get isAnonymous() {\r\n return this._delegate.isAnonymous;\r\n }\r\n get metadata() {\r\n return this._delegate.metadata;\r\n }\r\n get phoneNumber() {\r\n return this._delegate.phoneNumber;\r\n }\r\n get providerData() {\r\n return this._delegate.providerData;\r\n }\r\n get refreshToken() {\r\n return this._delegate.refreshToken;\r\n }\r\n get tenantId() {\r\n return this._delegate.tenantId;\r\n }\r\n get displayName() {\r\n return this._delegate.displayName;\r\n }\r\n get email() {\r\n return this._delegate.email;\r\n }\r\n get photoURL() {\r\n return this._delegate.photoURL;\r\n }\r\n get providerId() {\r\n return this._delegate.providerId;\r\n }\r\n get uid() {\r\n return this._delegate.uid;\r\n }\r\n get auth() {\r\n return this._delegate.auth;\r\n }\r\n}\r\n// Maintain a map so that there's always a 1:1 mapping between new User and\r\n// legacy compat users\r\nUser.USER_MAP = new WeakMap();\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 _assert$1 = exp._assert;\r\nclass Auth {\r\n constructor(app, provider) {\r\n this.app = app;\r\n if (provider.isInitialized()) {\r\n this._delegate = provider.getImmediate();\r\n this.linkUnderlyingAuth();\r\n return;\r\n }\r\n const { apiKey } = app.options;\r\n // TODO: platform needs to be determined using heuristics\r\n _assert$1(apiKey, \"invalid-api-key\" /* INVALID_API_KEY */, {\r\n appName: app.name\r\n });\r\n // TODO: platform needs to be determined using heuristics\r\n _assert$1(apiKey, \"invalid-api-key\" /* INVALID_API_KEY */, {\r\n appName: app.name\r\n });\r\n // Only use a popup/redirect resolver in browser environments\r\n const resolver = typeof window !== 'undefined' ? CompatPopupRedirectResolver : undefined;\r\n this._delegate = provider.initialize({\r\n options: {\r\n persistence: buildPersistenceHierarchy(apiKey, app.name),\r\n popupRedirectResolver: resolver\r\n }\r\n });\r\n this._delegate._updateErrorMap(exp.debugErrorMap);\r\n this.linkUnderlyingAuth();\r\n }\r\n get emulatorConfig() {\r\n return this._delegate.emulatorConfig;\r\n }\r\n get currentUser() {\r\n if (!this._delegate.currentUser) {\r\n return null;\r\n }\r\n return User.getOrCreate(this._delegate.currentUser);\r\n }\r\n get languageCode() {\r\n return this._delegate.languageCode;\r\n }\r\n set languageCode(languageCode) {\r\n this._delegate.languageCode = languageCode;\r\n }\r\n get settings() {\r\n return this._delegate.settings;\r\n }\r\n get tenantId() {\r\n return this._delegate.tenantId;\r\n }\r\n set tenantId(tid) {\r\n this._delegate.tenantId = tid;\r\n }\r\n useDeviceLanguage() {\r\n this._delegate.useDeviceLanguage();\r\n }\r\n signOut() {\r\n return this._delegate.signOut();\r\n }\r\n useEmulator(url, options) {\r\n exp.connectAuthEmulator(this._delegate, url, options);\r\n }\r\n applyActionCode(code) {\r\n return exp.applyActionCode(this._delegate, code);\r\n }\r\n checkActionCode(code) {\r\n return exp.checkActionCode(this._delegate, code);\r\n }\r\n confirmPasswordReset(code, newPassword) {\r\n return exp.confirmPasswordReset(this._delegate, code, newPassword);\r\n }\r\n async createUserWithEmailAndPassword(email, password) {\r\n return convertCredential(this._delegate, exp.createUserWithEmailAndPassword(this._delegate, email, password));\r\n }\r\n fetchProvidersForEmail(email) {\r\n return this.fetchSignInMethodsForEmail(email);\r\n }\r\n fetchSignInMethodsForEmail(email) {\r\n return exp.fetchSignInMethodsForEmail(this._delegate, email);\r\n }\r\n isSignInWithEmailLink(emailLink) {\r\n return exp.isSignInWithEmailLink(this._delegate, emailLink);\r\n }\r\n async getRedirectResult() {\r\n _assert$1(_isPopupRedirectSupported(), this._delegate, \"operation-not-supported-in-this-environment\" /* OPERATION_NOT_SUPPORTED */);\r\n const credential = await exp.getRedirectResult(this._delegate, CompatPopupRedirectResolver);\r\n if (!credential) {\r\n return {\r\n credential: null,\r\n user: null\r\n };\r\n }\r\n return convertCredential(this._delegate, Promise.resolve(credential));\r\n }\r\n // This function should only be called by frameworks (e.g. FirebaseUI-web) to log their usage.\r\n // It is not intended for direct use by developer apps. NO jsdoc here to intentionally leave it\r\n // out of autogenerated documentation pages to reduce accidental misuse.\r\n addFrameworkForLogging(framework) {\r\n exp.addFrameworkForLogging(this._delegate, framework);\r\n }\r\n onAuthStateChanged(nextOrObserver, errorFn, completed) {\r\n const { next, error, complete } = wrapObservers(nextOrObserver, errorFn, completed);\r\n return this._delegate.onAuthStateChanged(next, error, complete);\r\n }\r\n onIdTokenChanged(nextOrObserver, errorFn, completed) {\r\n const { next, error, complete } = wrapObservers(nextOrObserver, errorFn, completed);\r\n return this._delegate.onIdTokenChanged(next, error, complete);\r\n }\r\n sendSignInLinkToEmail(email, actionCodeSettings) {\r\n return exp.sendSignInLinkToEmail(this._delegate, email, actionCodeSettings);\r\n }\r\n sendPasswordResetEmail(email, actionCodeSettings) {\r\n return exp.sendPasswordResetEmail(this._delegate, email, actionCodeSettings || undefined);\r\n }\r\n async setPersistence(persistence) {\r\n _validatePersistenceArgument(this._delegate, persistence);\r\n let converted;\r\n switch (persistence) {\r\n case Persistence.SESSION:\r\n converted = exp.browserSessionPersistence;\r\n break;\r\n case Persistence.LOCAL:\r\n // Not using isIndexedDBAvailable() since it only checks if indexedDB is defined.\r\n const isIndexedDBFullySupported = await exp\r\n ._getInstance(exp.indexedDBLocalPersistence)\r\n ._isAvailable();\r\n converted = isIndexedDBFullySupported\r\n ? exp.indexedDBLocalPersistence\r\n : exp.browserLocalPersistence;\r\n break;\r\n case Persistence.NONE:\r\n converted = exp.inMemoryPersistence;\r\n break;\r\n default:\r\n return exp._fail(\"argument-error\" /* ARGUMENT_ERROR */, {\r\n appName: this._delegate.name\r\n });\r\n }\r\n return this._delegate.setPersistence(converted);\r\n }\r\n signInAndRetrieveDataWithCredential(credential) {\r\n return this.signInWithCredential(credential);\r\n }\r\n signInAnonymously() {\r\n return convertCredential(this._delegate, exp.signInAnonymously(this._delegate));\r\n }\r\n signInWithCredential(credential) {\r\n return convertCredential(this._delegate, exp.signInWithCredential(this._delegate, credential));\r\n }\r\n signInWithCustomToken(token) {\r\n return convertCredential(this._delegate, exp.signInWithCustomToken(this._delegate, token));\r\n }\r\n signInWithEmailAndPassword(email, password) {\r\n return convertCredential(this._delegate, exp.signInWithEmailAndPassword(this._delegate, email, password));\r\n }\r\n signInWithEmailLink(email, emailLink) {\r\n return convertCredential(this._delegate, exp.signInWithEmailLink(this._delegate, email, emailLink));\r\n }\r\n signInWithPhoneNumber(phoneNumber, applicationVerifier) {\r\n return convertConfirmationResult(this._delegate, exp.signInWithPhoneNumber(this._delegate, phoneNumber, applicationVerifier));\r\n }\r\n async signInWithPopup(provider) {\r\n _assert$1(_isPopupRedirectSupported(), this._delegate, \"operation-not-supported-in-this-environment\" /* OPERATION_NOT_SUPPORTED */);\r\n return convertCredential(this._delegate, exp.signInWithPopup(this._delegate, provider, CompatPopupRedirectResolver));\r\n }\r\n async signInWithRedirect(provider) {\r\n _assert$1(_isPopupRedirectSupported(), this._delegate, \"operation-not-supported-in-this-environment\" /* OPERATION_NOT_SUPPORTED */);\r\n await _savePersistenceForRedirect(this._delegate);\r\n return exp.signInWithRedirect(this._delegate, provider, CompatPopupRedirectResolver);\r\n }\r\n updateCurrentUser(user) {\r\n // remove ts-ignore once overloads are defined for exp functions to accept compat objects\r\n // @ts-ignore\r\n return this._delegate.updateCurrentUser(user);\r\n }\r\n verifyPasswordResetCode(code) {\r\n return exp.verifyPasswordResetCode(this._delegate, code);\r\n }\r\n unwrap() {\r\n return this._delegate;\r\n }\r\n _delete() {\r\n return this._delegate._delete();\r\n }\r\n linkUnderlyingAuth() {\r\n this._delegate.wrapped = () => this;\r\n }\r\n}\r\nAuth.Persistence = Persistence;\r\nfunction wrapObservers(nextOrObserver, error, complete) {\r\n let next = nextOrObserver;\r\n if (typeof nextOrObserver !== 'function') {\r\n ({ next, error, complete } = nextOrObserver);\r\n }\r\n // We know 'next' is now a function\r\n const oldNext = next;\r\n const newNext = (user) => oldNext(user && User.getOrCreate(user));\r\n return {\r\n next: newNext,\r\n error: error,\r\n complete\r\n };\r\n}\r\nfunction buildPersistenceHierarchy(apiKey, appName) {\r\n // Note this is slightly different behavior: in this case, the stored\r\n // persistence is checked *first* rather than last. This is because we want\r\n // to prefer stored persistence type in the hierarchy. This is an empty\r\n // array if window is not available or there is no pending redirect\r\n const persistences = _getPersistencesFromRedirect(apiKey, appName);\r\n // If \"self\" is available, add indexedDB\r\n if (typeof self !== 'undefined' &&\r\n !persistences.includes(exp.indexedDBLocalPersistence)) {\r\n persistences.push(exp.indexedDBLocalPersistence);\r\n }\r\n // If \"window\" is available, add HTML Storage persistences\r\n if (typeof window !== 'undefined') {\r\n for (const persistence of [\r\n exp.browserLocalPersistence,\r\n exp.browserSessionPersistence\r\n ]) {\r\n if (!persistences.includes(persistence)) {\r\n persistences.push(persistence);\r\n }\r\n }\r\n }\r\n // Add in-memory as a final fallback\r\n if (!persistences.includes(exp.inMemoryPersistence)) {\r\n persistences.push(exp.inMemoryPersistence);\r\n }\r\n return persistences;\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\nclass PhoneAuthProvider {\r\n constructor() {\r\n this.providerId = 'phone';\r\n // TODO: remove ts-ignore when moving types from auth-types to auth-compat\r\n // @ts-ignore\r\n this._delegate = new exp.PhoneAuthProvider(unwrap(firebase.auth()));\r\n }\r\n static credential(verificationId, verificationCode) {\r\n return exp.PhoneAuthProvider.credential(verificationId, verificationCode);\r\n }\r\n verifyPhoneNumber(phoneInfoOptions, applicationVerifier) {\r\n return this._delegate.verifyPhoneNumber(\r\n // The implementation matches but the types are subtly incompatible\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n phoneInfoOptions, applicationVerifier);\r\n }\r\n unwrap() {\r\n return this._delegate;\r\n }\r\n}\r\nPhoneAuthProvider.PHONE_SIGN_IN_METHOD = exp.PhoneAuthProvider.PHONE_SIGN_IN_METHOD;\r\nPhoneAuthProvider.PROVIDER_ID = exp.PhoneAuthProvider.PROVIDER_ID;\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 _assert = exp._assert;\r\nclass RecaptchaVerifier {\r\n constructor(container, parameters, app = firebase.app()) {\r\n var _a;\r\n // API key is required for web client RPC calls.\r\n _assert((_a = app.options) === null || _a === void 0 ? void 0 : _a.apiKey, \"invalid-api-key\" /* INVALID_API_KEY */, {\r\n appName: app.name\r\n });\r\n this._delegate = new exp.RecaptchaVerifier(container, \r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n parameters, \r\n // TODO: remove ts-ignore when moving types from auth-types to auth-compat\r\n // @ts-ignore\r\n app.auth());\r\n this.type = this._delegate.type;\r\n }\r\n clear() {\r\n this._delegate.clear();\r\n }\r\n render() {\r\n return this._delegate.render();\r\n }\r\n verify() {\r\n return this._delegate.verify();\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 AUTH_TYPE = 'auth-compat';\r\n// Create auth components to register with firebase.\r\n// Provides Auth public APIs.\r\nfunction registerAuthCompat(instance) {\r\n instance.INTERNAL.registerComponent(new Component(AUTH_TYPE, container => {\r\n // getImmediate for FirebaseApp will always succeed\r\n const app = container.getProvider('app-compat').getImmediate();\r\n const authProvider = container.getProvider('auth');\r\n return new Auth(app, authProvider);\r\n }, \"PUBLIC\" /* PUBLIC */)\r\n .setServiceProps({\r\n ActionCodeInfo: {\r\n Operation: {\r\n EMAIL_SIGNIN: exp.ActionCodeOperation.EMAIL_SIGNIN,\r\n PASSWORD_RESET: exp.ActionCodeOperation.PASSWORD_RESET,\r\n RECOVER_EMAIL: exp.ActionCodeOperation.RECOVER_EMAIL,\r\n REVERT_SECOND_FACTOR_ADDITION: exp.ActionCodeOperation.REVERT_SECOND_FACTOR_ADDITION,\r\n VERIFY_AND_CHANGE_EMAIL: exp.ActionCodeOperation.VERIFY_AND_CHANGE_EMAIL,\r\n VERIFY_EMAIL: exp.ActionCodeOperation.VERIFY_EMAIL\r\n }\r\n },\r\n EmailAuthProvider: exp.EmailAuthProvider,\r\n FacebookAuthProvider: exp.FacebookAuthProvider,\r\n GithubAuthProvider: exp.GithubAuthProvider,\r\n GoogleAuthProvider: exp.GoogleAuthProvider,\r\n OAuthProvider: exp.OAuthProvider,\r\n SAMLAuthProvider: exp.SAMLAuthProvider,\r\n PhoneAuthProvider: PhoneAuthProvider,\r\n PhoneMultiFactorGenerator: exp.PhoneMultiFactorGenerator,\r\n RecaptchaVerifier: RecaptchaVerifier,\r\n TwitterAuthProvider: exp.TwitterAuthProvider,\r\n Auth,\r\n AuthCredential: exp.AuthCredential,\r\n Error: FirebaseError\r\n })\r\n .setInstantiationMode(\"LAZY\" /* LAZY */)\r\n .setMultipleInstances(false));\r\n instance.registerVersion(name, version);\r\n}\r\nregisterAuthCompat(firebase);\n//# sourceMappingURL=index.esm2017.js.map\n","var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nvar esm = {};\n\n/*\n\n Copyright The Closure Library Authors.\n SPDX-License-Identifier: Apache-2.0\n*/\nvar k,goog=goog||{},l=commonjsGlobal||self;function aa(){}function ba(a){var b=typeof a;b=\"object\"!=b?b:a?Array.isArray(a)?\"array\":b:\"null\";return \"array\"==b||\"object\"==b&&\"number\"==typeof a.length}function p(a){var b=typeof a;return \"object\"==b&&null!=a||\"function\"==b}function da(a){return Object.prototype.hasOwnProperty.call(a,ea)&&a[ea]||(a[ea]=++fa)}var ea=\"closure_uid_\"+(1E9*Math.random()>>>0),fa=0;function ha(a,b,c){return a.call.apply(a.bind,arguments)}\nfunction ia(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var e=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(e,d);return a.apply(b,e)}}return function(){return a.apply(b,arguments)}}function q(a,b,c){Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf(\"native code\")?q=ha:q=ia;return q.apply(null,arguments)}\nfunction ja(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var d=c.slice();d.push.apply(d,arguments);return a.apply(this,d)}}function t(a,b){function c(){}c.prototype=b.prototype;a.Z=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.Vb=function(d,e,f){for(var h=Array(arguments.length-2),n=2;n<arguments.length;n++)h[n-2]=arguments[n];return b.prototype[e].apply(d,h)};}function v(){this.s=this.s;this.o=this.o;}var ka=0,la={};v.prototype.s=!1;v.prototype.na=function(){if(!this.s&&(this.s=!0,this.M(),0!=ka)){var a=da(this);delete la[a];}};v.prototype.M=function(){if(this.o)for(;this.o.length;)this.o.shift()();};const ma=Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b,void 0)}:function(a,b){if(\"string\"===typeof a)return \"string\"!==typeof b||1!=b.length?-1:a.indexOf(b,0);for(let c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return -1},na=Array.prototype.forEach?function(a,b,c){Array.prototype.forEach.call(a,b,c);}:function(a,b,c){const d=a.length,e=\"string\"===typeof a?a.split(\"\"):a;for(let f=0;f<d;f++)f in e&&b.call(c,e[f],f,a);};\nfunction oa(a){a:{var b=pa;const c=a.length,d=\"string\"===typeof a?a.split(\"\"):a;for(let e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){b=e;break a}b=-1;}return 0>b?null:\"string\"===typeof a?a.charAt(b):a[b]}function qa(a){return Array.prototype.concat.apply([],arguments)}function ra(a){const b=a.length;if(0<b){const c=Array(b);for(let d=0;d<b;d++)c[d]=a[d];return c}return []}function sa(a){return /^[\\s\\xa0]*$/.test(a)}var ta=String.prototype.trim?function(a){return a.trim()}:function(a){return /^[\\s\\xa0]*([\\s\\S]*?)[\\s\\xa0]*$/.exec(a)[1]};function w(a,b){return -1!=a.indexOf(b)}function ua(a,b){return a<b?-1:a>b?1:0}var x;a:{var va=l.navigator;if(va){var wa=va.userAgent;if(wa){x=wa;break a}}x=\"\";}function xa(a,b,c){for(const d in a)b.call(c,a[d],d,a);}function ya(a){const b={};for(const c in a)b[c]=a[c];return b}var za=\"constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf\".split(\" \");function Aa(a,b){let c,d;for(let e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(let f=0;f<za.length;f++)c=za[f],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c]);}}function Ca(a){Ca[\" \"](a);return a}Ca[\" \"]=aa;function Fa(a){var b=Ga;return Object.prototype.hasOwnProperty.call(b,9)?b[9]:b[9]=a(9)}var Ha=w(x,\"Opera\"),y=w(x,\"Trident\")||w(x,\"MSIE\"),Ia=w(x,\"Edge\"),Ja=Ia||y,Ka=w(x,\"Gecko\")&&!(w(x.toLowerCase(),\"webkit\")&&!w(x,\"Edge\"))&&!(w(x,\"Trident\")||w(x,\"MSIE\"))&&!w(x,\"Edge\"),La=w(x.toLowerCase(),\"webkit\")&&!w(x,\"Edge\");function Ma(){var a=l.document;return a?a.documentMode:void 0}var Na;\na:{var Oa=\"\",Pa=function(){var a=x;if(Ka)return /rv:([^\\);]+)(\\)|;)/.exec(a);if(Ia)return /Edge\\/([\\d\\.]+)/.exec(a);if(y)return /\\b(?:MSIE|rv)[: ]([^\\);]+)(\\)|;)/.exec(a);if(La)return /WebKit\\/(\\S+)/.exec(a);if(Ha)return /(?:Version)[ \\/]?(\\S+)/.exec(a)}();Pa&&(Oa=Pa?Pa[1]:\"\");if(y){var Qa=Ma();if(null!=Qa&&Qa>parseFloat(Oa)){Na=String(Qa);break a}}Na=Oa;}var Ga={};\nfunction Ra(){return Fa(function(){let a=0;const b=ta(String(Na)).split(\".\"),c=ta(\"9\").split(\".\"),d=Math.max(b.length,c.length);for(let h=0;0==a&&h<d;h++){var e=b[h]||\"\",f=c[h]||\"\";do{e=/(\\d*)(\\D*)(.*)/.exec(e)||[\"\",\"\",\"\",\"\"];f=/(\\d*)(\\D*)(.*)/.exec(f)||[\"\",\"\",\"\",\"\"];if(0==e[0].length&&0==f[0].length)break;a=ua(0==e[1].length?0:parseInt(e[1],10),0==f[1].length?0:parseInt(f[1],10))||ua(0==e[2].length,0==f[2].length)||ua(e[2],f[2]);e=e[3];f=f[3];}while(0==a)}return 0<=a})}var Sa;\nif(l.document&&y){var Ta=Ma();Sa=Ta?Ta:parseInt(Na,10)||void 0;}else Sa=void 0;var Ua=Sa;var Va=function(){if(!l.addEventListener||!Object.defineProperty)return !1;var a=!1,b=Object.defineProperty({},\"passive\",{get:function(){a=!0;}});try{l.addEventListener(\"test\",aa,b),l.removeEventListener(\"test\",aa,b);}catch(c){}return a}();function z(a,b){this.type=a;this.g=this.target=b;this.defaultPrevented=!1;}z.prototype.h=function(){this.defaultPrevented=!0;};function A(a,b){z.call(this,a?a.type:\"\");this.relatedTarget=this.g=this.target=null;this.button=this.screenY=this.screenX=this.clientY=this.clientX=0;this.key=\"\";this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1;this.state=null;this.pointerId=0;this.pointerType=\"\";this.i=null;if(a){var c=this.type=a.type,d=a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:null;this.target=a.target||a.srcElement;this.g=b;if(b=a.relatedTarget){if(Ka){a:{try{Ca(b.nodeName);var e=!0;break a}catch(f){}e=\n!1;}e||(b=null);}}else \"mouseover\"==c?b=a.fromElement:\"mouseout\"==c&&(b=a.toElement);this.relatedTarget=b;d?(this.clientX=void 0!==d.clientX?d.clientX:d.pageX,this.clientY=void 0!==d.clientY?d.clientY:d.pageY,this.screenX=d.screenX||0,this.screenY=d.screenY||0):(this.clientX=void 0!==a.clientX?a.clientX:a.pageX,this.clientY=void 0!==a.clientY?a.clientY:a.pageY,this.screenX=a.screenX||0,this.screenY=a.screenY||0);this.button=a.button;this.key=a.key||\"\";this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=\na.shiftKey;this.metaKey=a.metaKey;this.pointerId=a.pointerId||0;this.pointerType=\"string\"===typeof a.pointerType?a.pointerType:Wa[a.pointerType]||\"\";this.state=a.state;this.i=a;a.defaultPrevented&&A.Z.h.call(this);}}t(A,z);var Wa={2:\"touch\",3:\"pen\",4:\"mouse\"};A.prototype.h=function(){A.Z.h.call(this);var a=this.i;a.preventDefault?a.preventDefault():a.returnValue=!1;};var B=\"closure_listenable_\"+(1E6*Math.random()|0);var Xa=0;function Ya(a,b,c,d,e){this.listener=a;this.proxy=null;this.src=b;this.type=c;this.capture=!!d;this.ia=e;this.key=++Xa;this.ca=this.fa=!1;}function Za(a){a.ca=!0;a.listener=null;a.proxy=null;a.src=null;a.ia=null;}function $a(a){this.src=a;this.g={};this.h=0;}$a.prototype.add=function(a,b,c,d,e){var f=a.toString();a=this.g[f];a||(a=this.g[f]=[],this.h++);var h=ab(a,b,d,e);-1<h?(b=a[h],c||(b.fa=!1)):(b=new Ya(b,this.src,f,!!d,e),b.fa=c,a.push(b));return b};function bb(a,b){var c=b.type;if(c in a.g){var d=a.g[c],e=ma(d,b),f;(f=0<=e)&&Array.prototype.splice.call(d,e,1);f&&(Za(b),0==a.g[c].length&&(delete a.g[c],a.h--));}}\nfunction ab(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e];if(!f.ca&&f.listener==b&&f.capture==!!c&&f.ia==d)return e}return -1}var cb=\"closure_lm_\"+(1E6*Math.random()|0),db={};function fb(a,b,c,d,e){if(d&&d.once)return gb(a,b,c,d,e);if(Array.isArray(b)){for(var f=0;f<b.length;f++)fb(a,b[f],c,d,e);return null}c=hb(c);return a&&a[B]?a.N(b,c,p(d)?!!d.capture:!!d,e):ib(a,b,c,!1,d,e)}\nfunction ib(a,b,c,d,e,f){if(!b)throw Error(\"Invalid event type\");var h=p(e)?!!e.capture:!!e,n=jb(a);n||(a[cb]=n=new $a(a));c=n.add(b,c,d,h,f);if(c.proxy)return c;d=kb();c.proxy=d;d.src=a;d.listener=c;if(a.addEventListener)Va||(e=h),void 0===e&&(e=!1),a.addEventListener(b.toString(),d,e);else if(a.attachEvent)a.attachEvent(lb(b.toString()),d);else if(a.addListener&&a.removeListener)a.addListener(d);else throw Error(\"addEventListener and attachEvent are unavailable.\");return c}\nfunction kb(){function a(c){return b.call(a.src,a.listener,c)}var b=mb;return a}function gb(a,b,c,d,e){if(Array.isArray(b)){for(var f=0;f<b.length;f++)gb(a,b[f],c,d,e);return null}c=hb(c);return a&&a[B]?a.O(b,c,p(d)?!!d.capture:!!d,e):ib(a,b,c,!0,d,e)}\nfunction nb(a,b,c,d,e){if(Array.isArray(b))for(var f=0;f<b.length;f++)nb(a,b[f],c,d,e);else (d=p(d)?!!d.capture:!!d,c=hb(c),a&&a[B])?(a=a.i,b=String(b).toString(),b in a.g&&(f=a.g[b],c=ab(f,c,d,e),-1<c&&(Za(f[c]),Array.prototype.splice.call(f,c,1),0==f.length&&(delete a.g[b],a.h--)))):a&&(a=jb(a))&&(b=a.g[b.toString()],a=-1,b&&(a=ab(b,c,d,e)),(c=-1<a?b[a]:null)&&ob(c));}\nfunction ob(a){if(\"number\"!==typeof a&&a&&!a.ca){var b=a.src;if(b&&b[B])bb(b.i,a);else {var c=a.type,d=a.proxy;b.removeEventListener?b.removeEventListener(c,d,a.capture):b.detachEvent?b.detachEvent(lb(c),d):b.addListener&&b.removeListener&&b.removeListener(d);(c=jb(b))?(bb(c,a),0==c.h&&(c.src=null,b[cb]=null)):Za(a);}}}function lb(a){return a in db?db[a]:db[a]=\"on\"+a}function mb(a,b){if(a.ca)a=!0;else {b=new A(b,this);var c=a.listener,d=a.ia||a.src;a.fa&&ob(a);a=c.call(d,b);}return a}\nfunction jb(a){a=a[cb];return a instanceof $a?a:null}var pb=\"__closure_events_fn_\"+(1E9*Math.random()>>>0);function hb(a){if(\"function\"===typeof a)return a;a[pb]||(a[pb]=function(b){return a.handleEvent(b)});return a[pb]}function C(){v.call(this);this.i=new $a(this);this.P=this;this.I=null;}t(C,v);C.prototype[B]=!0;C.prototype.removeEventListener=function(a,b,c,d){nb(this,a,b,c,d);};\nfunction D(a,b){var c,d=a.I;if(d)for(c=[];d;d=d.I)c.push(d);a=a.P;d=b.type||b;if(\"string\"===typeof b)b=new z(b,a);else if(b instanceof z)b.target=b.target||a;else {var e=b;b=new z(d,a);Aa(b,e);}e=!0;if(c)for(var f=c.length-1;0<=f;f--){var h=b.g=c[f];e=qb(h,d,!0,b)&&e;}h=b.g=a;e=qb(h,d,!0,b)&&e;e=qb(h,d,!1,b)&&e;if(c)for(f=0;f<c.length;f++)h=b.g=c[f],e=qb(h,d,!1,b)&&e;}\nC.prototype.M=function(){C.Z.M.call(this);if(this.i){var a=this.i,c;for(c in a.g){for(var d=a.g[c],e=0;e<d.length;e++)Za(d[e]);delete a.g[c];a.h--;}}this.I=null;};C.prototype.N=function(a,b,c,d){return this.i.add(String(a),b,!1,c,d)};C.prototype.O=function(a,b,c,d){return this.i.add(String(a),b,!0,c,d)};\nfunction qb(a,b,c,d){b=a.i.g[String(b)];if(!b)return !0;b=b.concat();for(var e=!0,f=0;f<b.length;++f){var h=b[f];if(h&&!h.ca&&h.capture==c){var n=h.listener,u=h.ia||h.src;h.fa&&bb(a.i,h);e=!1!==n.call(u,d)&&e;}}return e&&!d.defaultPrevented}var rb=l.JSON.stringify;function sb(){var a=tb;let b=null;a.g&&(b=a.g,a.g=a.g.next,a.g||(a.h=null),b.next=null);return b}class ub{constructor(){this.h=this.g=null;}add(a,b){const c=vb.get();c.set(a,b);this.h?this.h.next=c:this.g=c;this.h=c;}}var vb=new class{constructor(a,b){this.i=a;this.j=b;this.h=0;this.g=null;}get(){let a;0<this.h?(this.h--,a=this.g,this.g=a.next,a.next=null):a=this.i();return a}}(()=>new wb,a=>a.reset());\nclass wb{constructor(){this.next=this.g=this.h=null;}set(a,b){this.h=a;this.g=b;this.next=null;}reset(){this.next=this.g=this.h=null;}}function yb(a){l.setTimeout(()=>{throw a;},0);}function zb(a,b){Ab||Bb();Cb||(Ab(),Cb=!0);tb.add(a,b);}var Ab;function Bb(){var a=l.Promise.resolve(void 0);Ab=function(){a.then(Db);};}var Cb=!1,tb=new ub;function Db(){for(var a;a=sb();){try{a.h.call(a.g);}catch(c){yb(c);}var b=vb;b.j(a);100>b.h&&(b.h++,a.next=b.g,b.g=a);}Cb=!1;}function Eb(a,b){C.call(this);this.h=a||1;this.g=b||l;this.j=q(this.kb,this);this.l=Date.now();}t(Eb,C);k=Eb.prototype;k.da=!1;k.S=null;k.kb=function(){if(this.da){var a=Date.now()-this.l;0<a&&a<.8*this.h?this.S=this.g.setTimeout(this.j,this.h-a):(this.S&&(this.g.clearTimeout(this.S),this.S=null),D(this,\"tick\"),this.da&&(Fb(this),this.start()));}};k.start=function(){this.da=!0;this.S||(this.S=this.g.setTimeout(this.j,this.h),this.l=Date.now());};\nfunction Fb(a){a.da=!1;a.S&&(a.g.clearTimeout(a.S),a.S=null);}k.M=function(){Eb.Z.M.call(this);Fb(this);delete this.g;};function Gb(a,b,c){if(\"function\"===typeof a)c&&(a=q(a,c));else if(a&&\"function\"==typeof a.handleEvent)a=q(a.handleEvent,a);else throw Error(\"Invalid listener argument\");return 2147483647<Number(b)?-1:l.setTimeout(a,b||0)}function Hb(a){a.g=Gb(()=>{a.g=null;a.i&&(a.i=!1,Hb(a));},a.j);const b=a.h;a.h=null;a.m.apply(null,b);}class Ib extends v{constructor(a,b){super();this.m=a;this.j=b;this.h=null;this.i=!1;this.g=null;}l(a){this.h=arguments;this.g?this.i=!0:Hb(this);}M(){super.M();this.g&&(l.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null);}}function E(a){v.call(this);this.h=a;this.g={};}t(E,v);var Jb=[];function Kb(a,b,c,d){Array.isArray(c)||(c&&(Jb[0]=c.toString()),c=Jb);for(var e=0;e<c.length;e++){var f=fb(b,c[e],d||a.handleEvent,!1,a.h||a);if(!f)break;a.g[f.key]=f;}}function Lb(a){xa(a.g,function(b,c){this.g.hasOwnProperty(c)&&ob(b);},a);a.g={};}E.prototype.M=function(){E.Z.M.call(this);Lb(this);};E.prototype.handleEvent=function(){throw Error(\"EventHandler.handleEvent not implemented\");};function Mb(){this.g=!0;}Mb.prototype.Aa=function(){this.g=!1;};function Nb(a,b,c,d,e,f){a.info(function(){if(a.g)if(f){var h=\"\";for(var n=f.split(\"&\"),u=0;u<n.length;u++){var m=n[u].split(\"=\");if(1<m.length){var r=m[0];m=m[1];var G=r.split(\"_\");h=2<=G.length&&\"type\"==G[1]?h+(r+\"=\"+m+\"&\"):h+(r+\"=redacted&\");}}}else h=null;else h=f;return \"XMLHTTP REQ (\"+d+\") [attempt \"+e+\"]: \"+b+\"\\n\"+c+\"\\n\"+h});}\nfunction Ob(a,b,c,d,e,f,h){a.info(function(){return \"XMLHTTP RESP (\"+d+\") [ attempt \"+e+\"]: \"+b+\"\\n\"+c+\"\\n\"+f+\" \"+h});}function F(a,b,c,d){a.info(function(){return \"XMLHTTP TEXT (\"+b+\"): \"+Pb(a,c)+(d?\" \"+d:\"\")});}function Qb(a,b){a.info(function(){return \"TIMEOUT: \"+b});}Mb.prototype.info=function(){};\nfunction Pb(a,b){if(!a.g)return b;if(!b)return null;try{var c=JSON.parse(b);if(c)for(a=0;a<c.length;a++)if(Array.isArray(c[a])){var d=c[a];if(!(2>d.length)){var e=d[1];if(Array.isArray(e)&&!(1>e.length)){var f=e[0];if(\"noop\"!=f&&\"stop\"!=f&&\"close\"!=f)for(var h=1;h<e.length;h++)e[h]=\"\";}}}return rb(c)}catch(n){return b}}var H={},Rb=null;function Sb(){return Rb=Rb||new C}H.Ma=\"serverreachability\";function Tb(a){z.call(this,H.Ma,a);}t(Tb,z);function I(a){const b=Sb();D(b,new Tb(b,a));}H.STAT_EVENT=\"statevent\";function Ub(a,b){z.call(this,H.STAT_EVENT,a);this.stat=b;}t(Ub,z);function J(a){const b=Sb();D(b,new Ub(b,a));}H.Na=\"timingevent\";function Vb(a,b){z.call(this,H.Na,a);this.size=b;}t(Vb,z);\nfunction K(a,b){if(\"function\"!==typeof a)throw Error(\"Fn must not be null and must be a function\");return l.setTimeout(function(){a();},b)}var Wb={NO_ERROR:0,lb:1,yb:2,xb:3,sb:4,wb:5,zb:6,Ja:7,TIMEOUT:8,Cb:9};var Xb={qb:\"complete\",Mb:\"success\",Ka:\"error\",Ja:\"abort\",Eb:\"ready\",Fb:\"readystatechange\",TIMEOUT:\"timeout\",Ab:\"incrementaldata\",Db:\"progress\",tb:\"downloadprogress\",Ub:\"uploadprogress\"};function Yb(){}Yb.prototype.h=null;function Zb(a){return a.h||(a.h=a.i())}function $b(){}var L={OPEN:\"a\",pb:\"b\",Ka:\"c\",Bb:\"d\"};function ac(){z.call(this,\"d\");}t(ac,z);function bc(){z.call(this,\"c\");}t(bc,z);var cc;function dc(){}t(dc,Yb);dc.prototype.g=function(){return new XMLHttpRequest};dc.prototype.i=function(){return {}};cc=new dc;function M(a,b,c,d){this.l=a;this.j=b;this.m=c;this.X=d||1;this.V=new E(this);this.P=ec;a=Ja?125:void 0;this.W=new Eb(a);this.H=null;this.i=!1;this.s=this.A=this.v=this.K=this.F=this.Y=this.B=null;this.D=[];this.g=null;this.C=0;this.o=this.u=null;this.N=-1;this.I=!1;this.O=0;this.L=null;this.aa=this.J=this.$=this.U=!1;this.h=new fc;}function fc(){this.i=null;this.g=\"\";this.h=!1;}var ec=45E3,gc={},hc={};k=M.prototype;k.setTimeout=function(a){this.P=a;};\nfunction ic(a,b,c){a.K=1;a.v=jc(N(b));a.s=c;a.U=!0;kc(a,null);}function kc(a,b){a.F=Date.now();lc(a);a.A=N(a.v);var c=a.A,d=a.X;Array.isArray(d)||(d=[String(d)]);mc(c.h,\"t\",d);a.C=0;c=a.l.H;a.h=new fc;a.g=nc(a.l,c?b:null,!a.s);0<a.O&&(a.L=new Ib(q(a.Ia,a,a.g),a.O));Kb(a.V,a.g,\"readystatechange\",a.gb);b=a.H?ya(a.H):{};a.s?(a.u||(a.u=\"POST\"),b[\"Content-Type\"]=\"application/x-www-form-urlencoded\",a.g.ea(a.A,a.u,a.s,b)):(a.u=\"GET\",a.g.ea(a.A,a.u,null,b));I(1);Nb(a.j,a.u,a.A,a.m,a.X,a.s);}\nk.gb=function(a){a=a.target;const b=this.L;b&&3==O(a)?b.l():this.Ia(a);};\nk.Ia=function(a){try{if(a==this.g)a:{const r=O(this.g);var b=this.g.Da();const G=this.g.ba();if(!(3>r)&&(3!=r||Ja||this.g&&(this.h.h||this.g.ga()||oc(this.g)))){this.I||4!=r||7==b||(8==b||0>=G?I(3):I(2));pc(this);var c=this.g.ba();this.N=c;b:if(qc(this)){var d=oc(this.g);a=\"\";var e=d.length,f=4==O(this.g);if(!this.h.i){if(\"undefined\"===typeof TextDecoder){P(this);rc(this);var h=\"\";break b}this.h.i=new l.TextDecoder;}for(b=0;b<e;b++)this.h.h=!0,a+=this.h.i.decode(d[b],{stream:f&&b==e-1});d.splice(0,\ne);this.h.g+=a;this.C=0;h=this.h.g;}else h=this.g.ga();this.i=200==c;Ob(this.j,this.u,this.A,this.m,this.X,r,c);if(this.i){if(this.$&&!this.J){b:{if(this.g){var n,u=this.g;if((n=u.g?u.g.getResponseHeader(\"X-HTTP-Initial-Response\"):null)&&!sa(n)){var m=n;break b}}m=null;}if(c=m)F(this.j,this.m,c,\"Initial handshake response via X-HTTP-Initial-Response\"),this.J=!0,sc(this,c);else {this.i=!1;this.o=3;J(12);P(this);rc(this);break a}}this.U?(tc(this,r,h),Ja&&this.i&&3==r&&(Kb(this.V,this.W,\"tick\",this.fb),\nthis.W.start())):(F(this.j,this.m,h,null),sc(this,h));4==r&&P(this);this.i&&!this.I&&(4==r?uc(this.l,this):(this.i=!1,lc(this)));}else 400==c&&0<h.indexOf(\"Unknown SID\")?(this.o=3,J(12)):(this.o=0,J(13)),P(this),rc(this);}}}catch(r){}finally{}};function qc(a){return a.g?\"GET\"==a.u&&2!=a.K&&a.l.Ba:!1}\nfunction tc(a,b,c){let d=!0,e;for(;!a.I&&a.C<c.length;)if(e=vc(a,c),e==hc){4==b&&(a.o=4,J(14),d=!1);F(a.j,a.m,null,\"[Incomplete Response]\");break}else if(e==gc){a.o=4;J(15);F(a.j,a.m,c,\"[Invalid Chunk]\");d=!1;break}else F(a.j,a.m,e,null),sc(a,e);qc(a)&&e!=hc&&e!=gc&&(a.h.g=\"\",a.C=0);4!=b||0!=c.length||a.h.h||(a.o=1,J(16),d=!1);a.i=a.i&&d;d?0<c.length&&!a.aa&&(a.aa=!0,b=a.l,b.g==a&&b.$&&!b.L&&(b.h.info(\"Great, no buffering proxy detected. Bytes received: \"+c.length),wc(b),b.L=!0,J(11))):(F(a.j,a.m,\nc,\"[Invalid Chunked Response]\"),P(a),rc(a));}k.fb=function(){if(this.g){var a=O(this.g),b=this.g.ga();this.C<b.length&&(pc(this),tc(this,a,b),this.i&&4!=a&&lc(this));}};function vc(a,b){var c=a.C,d=b.indexOf(\"\\n\",c);if(-1==d)return hc;c=Number(b.substring(c,d));if(isNaN(c))return gc;d+=1;if(d+c>b.length)return hc;b=b.substr(d,c);a.C=d+c;return b}k.cancel=function(){this.I=!0;P(this);};function lc(a){a.Y=Date.now()+a.P;xc(a,a.P);}\nfunction xc(a,b){if(null!=a.B)throw Error(\"WatchDog timer not null\");a.B=K(q(a.eb,a),b);}function pc(a){a.B&&(l.clearTimeout(a.B),a.B=null);}k.eb=function(){this.B=null;const a=Date.now();0<=a-this.Y?(Qb(this.j,this.A),2!=this.K&&(I(3),J(17)),P(this),this.o=2,rc(this)):xc(this,this.Y-a);};function rc(a){0==a.l.G||a.I||uc(a.l,a);}function P(a){pc(a);var b=a.L;b&&\"function\"==typeof b.na&&b.na();a.L=null;Fb(a.W);Lb(a.V);a.g&&(b=a.g,a.g=null,b.abort(),b.na());}\nfunction sc(a,b){try{var c=a.l;if(0!=c.G&&(c.g==a||yc(c.i,a)))if(c.I=a.N,!a.J&&yc(c.i,a)&&3==c.G){try{var d=c.Ca.g.parse(b);}catch(m){d=null;}if(Array.isArray(d)&&3==d.length){var e=d;if(0==e[0])a:{if(!c.u){if(c.g)if(c.g.F+3E3<a.F)zc(c),Ac(c);else break a;Bc(c);J(18);}}else c.ta=e[1],0<c.ta-c.U&&37500>e[2]&&c.N&&0==c.A&&!c.v&&(c.v=K(q(c.ab,c),6E3));if(1>=Cc(c.i)&&c.ka){try{c.ka();}catch(m){}c.ka=void 0;}}else Q(c,11);}else if((a.J||c.g==a)&&zc(c),!sa(b))for(e=c.Ca.g.parse(b),b=0;b<e.length;b++){let m=e[b];\nc.U=m[0];m=m[1];if(2==c.G)if(\"c\"==m[0]){c.J=m[1];c.la=m[2];const r=m[3];null!=r&&(c.ma=r,c.h.info(\"VER=\"+c.ma));const G=m[4];null!=G&&(c.za=G,c.h.info(\"SVER=\"+c.za));const Da=m[5];null!=Da&&\"number\"===typeof Da&&0<Da&&(d=1.5*Da,c.K=d,c.h.info(\"backChannelRequestTimeoutMs_=\"+d));d=c;const ca=a.g;if(ca){const Ea=ca.g?ca.g.getResponseHeader(\"X-Client-Wire-Protocol\"):null;if(Ea){var f=d.i;!f.g&&(w(Ea,\"spdy\")||w(Ea,\"quic\")||w(Ea,\"h2\"))&&(f.j=f.l,f.g=new Set,f.h&&(Dc(f,f.h),f.h=null));}if(d.D){const xb=\nca.g?ca.g.getResponseHeader(\"X-HTTP-Session-Id\"):null;xb&&(d.sa=xb,R(d.F,d.D,xb));}}c.G=3;c.j&&c.j.xa();c.$&&(c.O=Date.now()-a.F,c.h.info(\"Handshake RTT: \"+c.O+\"ms\"));d=c;var h=a;d.oa=Ec(d,d.H?d.la:null,d.W);if(h.J){Fc(d.i,h);var n=h,u=d.K;u&&n.setTimeout(u);n.B&&(pc(n),lc(n));d.g=h;}else Gc(d);0<c.l.length&&Hc(c);}else \"stop\"!=m[0]&&\"close\"!=m[0]||Q(c,7);else 3==c.G&&(\"stop\"==m[0]||\"close\"==m[0]?\"stop\"==m[0]?Q(c,7):Ic(c):\"noop\"!=m[0]&&c.j&&c.j.wa(m),c.A=0);}I(4);}catch(m){}}function Jc(a){if(a.R&&\"function\"==typeof a.R)return a.R();if(\"string\"===typeof a)return a.split(\"\");if(ba(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}b=[];c=0;for(d in a)b[c++]=a[d];return b}\nfunction Kc(a,b){if(a.forEach&&\"function\"==typeof a.forEach)a.forEach(b,void 0);else if(ba(a)||\"string\"===typeof a)na(a,b,void 0);else {if(a.T&&\"function\"==typeof a.T)var c=a.T();else if(a.R&&\"function\"==typeof a.R)c=void 0;else if(ba(a)||\"string\"===typeof a){c=[];for(var d=a.length,e=0;e<d;e++)c.push(e);}else for(e in c=[],d=0,a)c[d++]=e;d=Jc(a);e=d.length;for(var f=0;f<e;f++)b.call(void 0,d[f],c&&c[f],a);}}function S(a,b){this.h={};this.g=[];this.i=0;var c=arguments.length;if(1<c){if(c%2)throw Error(\"Uneven number of arguments\");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1]);}else if(a)if(a instanceof S)for(c=a.T(),d=0;d<c.length;d++)this.set(c[d],a.get(c[d]));else for(d in a)this.set(d,a[d]);}k=S.prototype;k.R=function(){Lc(this);for(var a=[],b=0;b<this.g.length;b++)a.push(this.h[this.g[b]]);return a};k.T=function(){Lc(this);return this.g.concat()};\nfunction Lc(a){if(a.i!=a.g.length){for(var b=0,c=0;b<a.g.length;){var d=a.g[b];T(a.h,d)&&(a.g[c++]=d);b++;}a.g.length=c;}if(a.i!=a.g.length){var e={};for(c=b=0;b<a.g.length;)d=a.g[b],T(e,d)||(a.g[c++]=d,e[d]=1),b++;a.g.length=c;}}k.get=function(a,b){return T(this.h,a)?this.h[a]:b};k.set=function(a,b){T(this.h,a)||(this.i++,this.g.push(a));this.h[a]=b;};k.forEach=function(a,b){for(var c=this.T(),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this);}};\nfunction T(a,b){return Object.prototype.hasOwnProperty.call(a,b)}var Mc=/^(?:([^:/?#.]+):)?(?:\\/\\/(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$/;function Nc(a,b){if(a){a=a.split(\"&\");for(var c=0;c<a.length;c++){var d=a[c].indexOf(\"=\"),e=null;if(0<=d){var f=a[c].substring(0,d);e=a[c].substring(d+1);}else f=a[c];b(f,e?decodeURIComponent(e.replace(/\\+/g,\" \")):\"\");}}}function U(a,b){this.i=this.s=this.j=\"\";this.m=null;this.o=this.l=\"\";this.g=!1;if(a instanceof U){this.g=void 0!==b?b:a.g;Oc(this,a.j);this.s=a.s;Pc(this,a.i);Qc(this,a.m);this.l=a.l;b=a.h;var c=new Rc;c.i=b.i;b.g&&(c.g=new S(b.g),c.h=b.h);Sc(this,c);this.o=a.o;}else a&&(c=String(a).match(Mc))?(this.g=!!b,Oc(this,c[1]||\"\",!0),this.s=Tc(c[2]||\"\"),Pc(this,c[3]||\"\",!0),Qc(this,c[4]),this.l=Tc(c[5]||\"\",!0),Sc(this,c[6]||\"\",!0),this.o=Tc(c[7]||\"\")):(this.g=!!b,this.h=new Rc(null,this.g));}\nU.prototype.toString=function(){var a=[],b=this.j;b&&a.push(Uc(b,Vc,!0),\":\");var c=this.i;if(c||\"file\"==b)a.push(\"//\"),(b=this.s)&&a.push(Uc(b,Vc,!0),\"@\"),a.push(encodeURIComponent(String(c)).replace(/%25([0-9a-fA-F]{2})/g,\"%$1\")),c=this.m,null!=c&&a.push(\":\",String(c));if(c=this.l)this.i&&\"/\"!=c.charAt(0)&&a.push(\"/\"),a.push(Uc(c,\"/\"==c.charAt(0)?Wc:Xc,!0));(c=this.h.toString())&&a.push(\"?\",c);(c=this.o)&&a.push(\"#\",Uc(c,Yc));return a.join(\"\")};function N(a){return new U(a)}\nfunction Oc(a,b,c){a.j=c?Tc(b,!0):b;a.j&&(a.j=a.j.replace(/:$/,\"\"));}function Pc(a,b,c){a.i=c?Tc(b,!0):b;}function Qc(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error(\"Bad port number \"+b);a.m=b;}else a.m=null;}function Sc(a,b,c){b instanceof Rc?(a.h=b,Zc(a.h,a.g)):(c||(b=Uc(b,$c)),a.h=new Rc(b,a.g));}function R(a,b,c){a.h.set(b,c);}function jc(a){R(a,\"zx\",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36));return a}\nfunction ad(a){return a instanceof U?N(a):new U(a,void 0)}function bd(a,b,c,d){var e=new U(null,void 0);a&&Oc(e,a);b&&Pc(e,b);c&&Qc(e,c);d&&(e.l=d);return e}function Tc(a,b){return a?b?decodeURI(a.replace(/%25/g,\"%2525\")):decodeURIComponent(a):\"\"}function Uc(a,b,c){return \"string\"===typeof a?(a=encodeURI(a).replace(b,cd),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,\"%$1\")),a):null}function cd(a){a=a.charCodeAt(0);return \"%\"+(a>>4&15).toString(16)+(a&15).toString(16)}\nvar Vc=/[#\\/\\?@]/g,Xc=/[#\\?:]/g,Wc=/[#\\?]/g,$c=/[#\\?@]/g,Yc=/#/g;function Rc(a,b){this.h=this.g=null;this.i=a||null;this.j=!!b;}function V(a){a.g||(a.g=new S,a.h=0,a.i&&Nc(a.i,function(b,c){a.add(decodeURIComponent(b.replace(/\\+/g,\" \")),c);}));}k=Rc.prototype;k.add=function(a,b){V(this);this.i=null;a=W(this,a);var c=this.g.get(a);c||this.g.set(a,c=[]);c.push(b);this.h+=1;return this};\nfunction dd(a,b){V(a);b=W(a,b);T(a.g.h,b)&&(a.i=null,a.h-=a.g.get(b).length,a=a.g,T(a.h,b)&&(delete a.h[b],a.i--,a.g.length>2*a.i&&Lc(a)));}function ed(a,b){V(a);b=W(a,b);return T(a.g.h,b)}k.forEach=function(a,b){V(this);this.g.forEach(function(c,d){na(c,function(e){a.call(b,e,d,this);},this);},this);};k.T=function(){V(this);for(var a=this.g.R(),b=this.g.T(),c=[],d=0;d<b.length;d++)for(var e=a[d],f=0;f<e.length;f++)c.push(b[d]);return c};\nk.R=function(a){V(this);var b=[];if(\"string\"===typeof a)ed(this,a)&&(b=qa(b,this.g.get(W(this,a))));else {a=this.g.R();for(var c=0;c<a.length;c++)b=qa(b,a[c]);}return b};k.set=function(a,b){V(this);this.i=null;a=W(this,a);ed(this,a)&&(this.h-=this.g.get(a).length);this.g.set(a,[b]);this.h+=1;return this};k.get=function(a,b){if(!a)return b;a=this.R(a);return 0<a.length?String(a[0]):b};function mc(a,b,c){dd(a,b);0<c.length&&(a.i=null,a.g.set(W(a,b),ra(c)),a.h+=c.length);}\nk.toString=function(){if(this.i)return this.i;if(!this.g)return \"\";for(var a=[],b=this.g.T(),c=0;c<b.length;c++){var d=b[c],e=encodeURIComponent(String(d));d=this.R(d);for(var f=0;f<d.length;f++){var h=e;\"\"!==d[f]&&(h+=\"=\"+encodeURIComponent(String(d[f])));a.push(h);}}return this.i=a.join(\"&\")};function W(a,b){b=String(b);a.j&&(b=b.toLowerCase());return b}function Zc(a,b){b&&!a.j&&(V(a),a.i=null,a.g.forEach(function(c,d){var e=d.toLowerCase();d!=e&&(dd(this,d),mc(this,e,c));},a));a.j=b;}var fd=class{constructor(a,b){this.h=a;this.g=b;}};function gd(a){this.l=a||hd;l.PerformanceNavigationTiming?(a=l.performance.getEntriesByType(\"navigation\"),a=0<a.length&&(\"hq\"==a[0].nextHopProtocol||\"h2\"==a[0].nextHopProtocol)):a=!!(l.g&&l.g.Ea&&l.g.Ea()&&l.g.Ea().Zb);this.j=a?this.l:1;this.g=null;1<this.j&&(this.g=new Set);this.h=null;this.i=[];}var hd=10;function id(a){return a.h?!0:a.g?a.g.size>=a.j:!1}function Cc(a){return a.h?1:a.g?a.g.size:0}function yc(a,b){return a.h?a.h==b:a.g?a.g.has(b):!1}function Dc(a,b){a.g?a.g.add(b):a.h=b;}\nfunction Fc(a,b){a.h&&a.h==b?a.h=null:a.g&&a.g.has(b)&&a.g.delete(b);}gd.prototype.cancel=function(){this.i=jd(this);if(this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){for(const a of this.g.values())a.cancel();this.g.clear();}};function jd(a){if(null!=a.h)return a.i.concat(a.h.D);if(null!=a.g&&0!==a.g.size){let b=a.i;for(const c of a.g.values())b=b.concat(c.D);return b}return ra(a.i)}function kd(){}kd.prototype.stringify=function(a){return l.JSON.stringify(a,void 0)};kd.prototype.parse=function(a){return l.JSON.parse(a,void 0)};function ld(){this.g=new kd;}function md(a,b,c){const d=c||\"\";try{Kc(a,function(e,f){let h=e;p(e)&&(h=rb(e));b.push(d+f+\"=\"+encodeURIComponent(h));});}catch(e){throw b.push(d+\"type=\"+encodeURIComponent(\"_badmap\")),e;}}function nd(a,b){const c=new Mb;if(l.Image){const d=new Image;d.onload=ja(od,c,d,\"TestLoadImage: loaded\",!0,b);d.onerror=ja(od,c,d,\"TestLoadImage: error\",!1,b);d.onabort=ja(od,c,d,\"TestLoadImage: abort\",!1,b);d.ontimeout=ja(od,c,d,\"TestLoadImage: timeout\",!1,b);l.setTimeout(function(){if(d.ontimeout)d.ontimeout();},1E4);d.src=a;}else b(!1);}function od(a,b,c,d,e){try{b.onload=null,b.onerror=null,b.onabort=null,b.ontimeout=null,e(d);}catch(f){}}function pd(a){this.l=a.$b||null;this.j=a.ib||!1;}t(pd,Yb);pd.prototype.g=function(){return new qd(this.l,this.j)};pd.prototype.i=function(a){return function(){return a}}({});function qd(a,b){C.call(this);this.D=a;this.u=b;this.m=void 0;this.readyState=rd;this.status=0;this.responseType=this.responseText=this.response=this.statusText=\"\";this.onreadystatechange=null;this.v=new Headers;this.h=null;this.C=\"GET\";this.B=\"\";this.g=!1;this.A=this.j=this.l=null;}t(qd,C);var rd=0;k=qd.prototype;\nk.open=function(a,b){if(this.readyState!=rd)throw this.abort(),Error(\"Error reopening a connection\");this.C=a;this.B=b;this.readyState=1;sd(this);};k.send=function(a){if(1!=this.readyState)throw this.abort(),Error(\"need to call open() first. \");this.g=!0;const b={headers:this.v,method:this.C,credentials:this.m,cache:void 0};a&&(b.body=a);(this.D||l).fetch(new Request(this.B,b)).then(this.Va.bind(this),this.ha.bind(this));};\nk.abort=function(){this.response=this.responseText=\"\";this.v=new Headers;this.status=0;this.j&&this.j.cancel(\"Request was aborted.\");1<=this.readyState&&this.g&&4!=this.readyState&&(this.g=!1,td(this));this.readyState=rd;};\nk.Va=function(a){if(this.g&&(this.l=a,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=a.headers,this.readyState=2,sd(this)),this.g&&(this.readyState=3,sd(this),this.g)))if(\"arraybuffer\"===this.responseType)a.arrayBuffer().then(this.Ta.bind(this),this.ha.bind(this));else if(\"undefined\"!==typeof l.ReadableStream&&\"body\"in a){this.j=a.body.getReader();if(this.u){if(this.responseType)throw Error('responseType must be empty for \"streamBinaryChunks\" mode responses.');this.response=\n[];}else this.response=this.responseText=\"\",this.A=new TextDecoder;ud(this);}else a.text().then(this.Ua.bind(this),this.ha.bind(this));};function ud(a){a.j.read().then(a.Sa.bind(a)).catch(a.ha.bind(a));}k.Sa=function(a){if(this.g){if(this.u&&a.value)this.response.push(a.value);else if(!this.u){var b=a.value?a.value:new Uint8Array(0);if(b=this.A.decode(b,{stream:!a.done}))this.response=this.responseText+=b;}a.done?td(this):sd(this);3==this.readyState&&ud(this);}};\nk.Ua=function(a){this.g&&(this.response=this.responseText=a,td(this));};k.Ta=function(a){this.g&&(this.response=a,td(this));};k.ha=function(){this.g&&td(this);};function td(a){a.readyState=4;a.l=null;a.j=null;a.A=null;sd(a);}k.setRequestHeader=function(a,b){this.v.append(a,b);};k.getResponseHeader=function(a){return this.h?this.h.get(a.toLowerCase())||\"\":\"\"};\nk.getAllResponseHeaders=function(){if(!this.h)return \"\";const a=[],b=this.h.entries();for(var c=b.next();!c.done;)c=c.value,a.push(c[0]+\": \"+c[1]),c=b.next();return a.join(\"\\r\\n\")};function sd(a){a.onreadystatechange&&a.onreadystatechange.call(a);}Object.defineProperty(qd.prototype,\"withCredentials\",{get:function(){return \"include\"===this.m},set:function(a){this.m=a?\"include\":\"same-origin\";}});var vd=l.JSON.parse;function X(a){C.call(this);this.headers=new S;this.u=a||null;this.h=!1;this.C=this.g=null;this.H=\"\";this.m=0;this.j=\"\";this.l=this.F=this.v=this.D=!1;this.B=0;this.A=null;this.J=wd;this.K=this.L=!1;}t(X,C);var wd=\"\",xd=/^https?$/i,yd=[\"POST\",\"PUT\"];k=X.prototype;\nk.ea=function(a,b,c,d){if(this.g)throw Error(\"[goog.net.XhrIo] Object is active with another request=\"+this.H+\"; newUri=\"+a);b=b?b.toUpperCase():\"GET\";this.H=a;this.j=\"\";this.m=0;this.D=!1;this.h=!0;this.g=this.u?this.u.g():cc.g();this.C=this.u?Zb(this.u):Zb(cc);this.g.onreadystatechange=q(this.Fa,this);try{this.F=!0,this.g.open(b,String(a),!0),this.F=!1;}catch(f){zd(this,f);return}a=c||\"\";const e=new S(this.headers);d&&Kc(d,function(f,h){e.set(h,f);});d=oa(e.T());c=l.FormData&&a instanceof l.FormData;\n!(0<=ma(yd,b))||d||c||e.set(\"Content-Type\",\"application/x-www-form-urlencoded;charset=utf-8\");e.forEach(function(f,h){this.g.setRequestHeader(h,f);},this);this.J&&(this.g.responseType=this.J);\"withCredentials\"in this.g&&this.g.withCredentials!==this.L&&(this.g.withCredentials=this.L);try{Ad(this),0<this.B&&((this.K=Bd(this.g))?(this.g.timeout=this.B,this.g.ontimeout=q(this.pa,this)):this.A=Gb(this.pa,this.B,this)),this.v=!0,this.g.send(a),this.v=!1;}catch(f){zd(this,f);}};\nfunction Bd(a){return y&&Ra()&&\"number\"===typeof a.timeout&&void 0!==a.ontimeout}function pa(a){return \"content-type\"==a.toLowerCase()}k.pa=function(){\"undefined\"!=typeof goog&&this.g&&(this.j=\"Timed out after \"+this.B+\"ms, aborting\",this.m=8,D(this,\"timeout\"),this.abort(8));};function zd(a,b){a.h=!1;a.g&&(a.l=!0,a.g.abort(),a.l=!1);a.j=b;a.m=5;Cd(a);Dd(a);}function Cd(a){a.D||(a.D=!0,D(a,\"complete\"),D(a,\"error\"));}\nk.abort=function(a){this.g&&this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1,this.m=a||7,D(this,\"complete\"),D(this,\"abort\"),Dd(this));};k.M=function(){this.g&&(this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1),Dd(this,!0));X.Z.M.call(this);};k.Fa=function(){this.s||(this.F||this.v||this.l?Ed(this):this.cb());};k.cb=function(){Ed(this);};\nfunction Ed(a){if(a.h&&\"undefined\"!=typeof goog&&(!a.C[1]||4!=O(a)||2!=a.ba()))if(a.v&&4==O(a))Gb(a.Fa,0,a);else if(D(a,\"readystatechange\"),4==O(a)){a.h=!1;try{const n=a.ba();a:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var b=!0;break a;default:b=!1;}var c;if(!(c=b)){var d;if(d=0===n){var e=String(a.H).match(Mc)[1]||null;if(!e&&l.self&&l.self.location){var f=l.self.location.protocol;e=f.substr(0,f.length-1);}d=!xd.test(e?e.toLowerCase():\"\");}c=d;}if(c)D(a,\"complete\"),D(a,\n\"success\");else {a.m=6;try{var h=2<O(a)?a.g.statusText:\"\";}catch(u){h=\"\";}a.j=h+\" [\"+a.ba()+\"]\";Cd(a);}}finally{Dd(a);}}}function Dd(a,b){if(a.g){Ad(a);const c=a.g,d=a.C[0]?aa:null;a.g=null;a.C=null;b||D(a,\"ready\");try{c.onreadystatechange=d;}catch(e){}}}function Ad(a){a.g&&a.K&&(a.g.ontimeout=null);a.A&&(l.clearTimeout(a.A),a.A=null);}function O(a){return a.g?a.g.readyState:0}k.ba=function(){try{return 2<O(this)?this.g.status:-1}catch(a){return -1}};\nk.ga=function(){try{return this.g?this.g.responseText:\"\"}catch(a){return \"\"}};k.Qa=function(a){if(this.g){var b=this.g.responseText;a&&0==b.indexOf(a)&&(b=b.substring(a.length));return vd(b)}};function oc(a){try{if(!a.g)return null;if(\"response\"in a.g)return a.g.response;switch(a.J){case wd:case \"text\":return a.g.responseText;case \"arraybuffer\":if(\"mozResponseArrayBuffer\"in a.g)return a.g.mozResponseArrayBuffer}return null}catch(b){return null}}k.Da=function(){return this.m};\nk.La=function(){return \"string\"===typeof this.j?this.j:String(this.j)};function Fd(a){let b=\"\";xa(a,function(c,d){b+=d;b+=\":\";b+=c;b+=\"\\r\\n\";});return b}function Gd(a,b,c){a:{for(d in c){var d=!1;break a}d=!0;}d||(c=Fd(c),\"string\"===typeof a?(null!=c&&encodeURIComponent(String(c))):R(a,b,c));}function Hd(a,b,c){return c&&c.internalChannelParams?c.internalChannelParams[a]||b:b}\nfunction Id(a){this.za=0;this.l=[];this.h=new Mb;this.la=this.oa=this.F=this.W=this.g=this.sa=this.D=this.aa=this.o=this.P=this.s=null;this.Za=this.V=0;this.Xa=Hd(\"failFast\",!1,a);this.N=this.v=this.u=this.m=this.j=null;this.X=!0;this.I=this.ta=this.U=-1;this.Y=this.A=this.C=0;this.Pa=Hd(\"baseRetryDelayMs\",5E3,a);this.$a=Hd(\"retryDelaySeedMs\",1E4,a);this.Ya=Hd(\"forwardChannelMaxRetries\",2,a);this.ra=Hd(\"forwardChannelRequestTimeoutMs\",2E4,a);this.qa=a&&a.xmlHttpFactory||void 0;this.Ba=a&&a.Yb||!1;\nthis.K=void 0;this.H=a&&a.supportsCrossDomainXhr||!1;this.J=\"\";this.i=new gd(a&&a.concurrentRequestLimit);this.Ca=new ld;this.ja=a&&a.fastHandshake||!1;this.Ra=a&&a.Wb||!1;a&&a.Aa&&this.h.Aa();a&&a.forceLongPolling&&(this.X=!1);this.$=!this.ja&&this.X&&a&&a.detectBufferingProxy||!1;this.ka=void 0;this.O=0;this.L=!1;this.B=null;this.Wa=!a||!1!==a.Xb;}k=Id.prototype;k.ma=8;k.G=1;\nfunction Ic(a){Jd(a);if(3==a.G){var b=a.V++,c=N(a.F);R(c,\"SID\",a.J);R(c,\"RID\",b);R(c,\"TYPE\",\"terminate\");Kd(a,c);b=new M(a,a.h,b,void 0);b.K=2;b.v=jc(N(c));c=!1;l.navigator&&l.navigator.sendBeacon&&(c=l.navigator.sendBeacon(b.v.toString(),\"\"));!c&&l.Image&&((new Image).src=b.v,c=!0);c||(b.g=nc(b.l,null),b.g.ea(b.v));b.F=Date.now();lc(b);}Ld(a);}k.hb=function(a){try{this.h.info(\"Origin Trials invoked: \"+a);}catch(b){}};function Ac(a){a.g&&(wc(a),a.g.cancel(),a.g=null);}\nfunction Jd(a){Ac(a);a.u&&(l.clearTimeout(a.u),a.u=null);zc(a);a.i.cancel();a.m&&(\"number\"===typeof a.m&&l.clearTimeout(a.m),a.m=null);}function Md(a,b){a.l.push(new fd(a.Za++,b));3==a.G&&Hc(a);}function Hc(a){id(a.i)||a.m||(a.m=!0,zb(a.Ha,a),a.C=0);}function Nd(a,b){if(Cc(a.i)>=a.i.j-(a.m?1:0))return !1;if(a.m)return a.l=b.D.concat(a.l),!0;if(1==a.G||2==a.G||a.C>=(a.Xa?0:a.Ya))return !1;a.m=K(q(a.Ha,a,b),Od(a,a.C));a.C++;return !0}\nk.Ha=function(a){if(this.m)if(this.m=null,1==this.G){if(!a){this.V=Math.floor(1E5*Math.random());a=this.V++;const e=new M(this,this.h,a,void 0);let f=this.s;this.P&&(f?(f=ya(f),Aa(f,this.P)):f=this.P);null===this.o&&(e.H=f);if(this.ja)a:{var b=0;for(var c=0;c<this.l.length;c++){b:{var d=this.l[c];if(\"__data__\"in d.g&&(d=d.g.__data__,\"string\"===typeof d)){d=d.length;break b}d=void 0;}if(void 0===d)break;b+=d;if(4096<b){b=c;break a}if(4096===b||c===this.l.length-1){b=c+1;break a}}b=1E3;}else b=1E3;b=\nPd(this,e,b);c=N(this.F);R(c,\"RID\",a);R(c,\"CVER\",22);this.D&&R(c,\"X-HTTP-Session-Id\",this.D);Kd(this,c);this.o&&f&&Gd(c,this.o,f);Dc(this.i,e);this.Ra&&R(c,\"TYPE\",\"init\");this.ja?(R(c,\"$req\",b),R(c,\"SID\",\"null\"),e.$=!0,ic(e,c,null)):ic(e,c,b);this.G=2;}}else 3==this.G&&(a?Qd(this,a):0==this.l.length||id(this.i)||Qd(this));};\nfunction Qd(a,b){var c;b?c=b.m:c=a.V++;const d=N(a.F);R(d,\"SID\",a.J);R(d,\"RID\",c);R(d,\"AID\",a.U);Kd(a,d);a.o&&a.s&&Gd(d,a.o,a.s);c=new M(a,a.h,c,a.C+1);null===a.o&&(c.H=a.s);b&&(a.l=b.D.concat(a.l));b=Pd(a,c,1E3);c.setTimeout(Math.round(.5*a.ra)+Math.round(.5*a.ra*Math.random()));Dc(a.i,c);ic(c,d,b);}function Kd(a,b){a.j&&Kc({},function(c,d){R(b,d,c);});}\nfunction Pd(a,b,c){c=Math.min(a.l.length,c);var d=a.j?q(a.j.Oa,a.j,a):null;a:{var e=a.l;let f=-1;for(;;){const h=[\"count=\"+c];-1==f?0<c?(f=e[0].h,h.push(\"ofs=\"+f)):f=0:h.push(\"ofs=\"+f);let n=!0;for(let u=0;u<c;u++){let m=e[u].h;const r=e[u].g;m-=f;if(0>m)f=Math.max(0,e[u].h-100),n=!1;else try{md(r,h,\"req\"+m+\"_\");}catch(G){d&&d(r);}}if(n){d=h.join(\"&\");break a}}}a=a.l.splice(0,c);b.D=a;return d}function Gc(a){a.g||a.u||(a.Y=1,zb(a.Ga,a),a.A=0);}\nfunction Bc(a){if(a.g||a.u||3<=a.A)return !1;a.Y++;a.u=K(q(a.Ga,a),Od(a,a.A));a.A++;return !0}k.Ga=function(){this.u=null;Rd(this);if(this.$&&!(this.L||null==this.g||0>=this.O)){var a=2*this.O;this.h.info(\"BP detection timer enabled: \"+a);this.B=K(q(this.bb,this),a);}};k.bb=function(){this.B&&(this.B=null,this.h.info(\"BP detection timeout reached.\"),this.h.info(\"Buffering proxy detected and switch to long-polling!\"),this.N=!1,this.L=!0,J(10),Ac(this),Rd(this));};\nfunction wc(a){null!=a.B&&(l.clearTimeout(a.B),a.B=null);}function Rd(a){a.g=new M(a,a.h,\"rpc\",a.Y);null===a.o&&(a.g.H=a.s);a.g.O=0;var b=N(a.oa);R(b,\"RID\",\"rpc\");R(b,\"SID\",a.J);R(b,\"CI\",a.N?\"0\":\"1\");R(b,\"AID\",a.U);Kd(a,b);R(b,\"TYPE\",\"xmlhttp\");a.o&&a.s&&Gd(b,a.o,a.s);a.K&&a.g.setTimeout(a.K);var c=a.g;a=a.la;c.K=1;c.v=jc(N(b));c.s=null;c.U=!0;kc(c,a);}k.ab=function(){null!=this.v&&(this.v=null,Ac(this),Bc(this),J(19));};function zc(a){null!=a.v&&(l.clearTimeout(a.v),a.v=null);}\nfunction uc(a,b){var c=null;if(a.g==b){zc(a);wc(a);a.g=null;var d=2;}else if(yc(a.i,b))c=b.D,Fc(a.i,b),d=1;else return;a.I=b.N;if(0!=a.G)if(b.i)if(1==d){c=b.s?b.s.length:0;b=Date.now()-b.F;var e=a.C;d=Sb();D(d,new Vb(d,c,b,e));Hc(a);}else Gc(a);else if(e=b.o,3==e||0==e&&0<a.I||!(1==d&&Nd(a,b)||2==d&&Bc(a)))switch(c&&0<c.length&&(b=a.i,b.i=b.i.concat(c)),e){case 1:Q(a,5);break;case 4:Q(a,10);break;case 3:Q(a,6);break;default:Q(a,2);}}\nfunction Od(a,b){let c=a.Pa+Math.floor(Math.random()*a.$a);a.j||(c*=2);return c*b}function Q(a,b){a.h.info(\"Error code \"+b);if(2==b){var c=null;a.j&&(c=null);var d=q(a.jb,a);c||(c=new U(\"//www.google.com/images/cleardot.gif\"),l.location&&\"http\"==l.location.protocol||Oc(c,\"https\"),jc(c));nd(c.toString(),d);}else J(2);a.G=0;a.j&&a.j.va(b);Ld(a);Jd(a);}k.jb=function(a){a?(this.h.info(\"Successfully pinged google.com\"),J(2)):(this.h.info(\"Failed to ping google.com\"),J(1));};\nfunction Ld(a){a.G=0;a.I=-1;if(a.j){if(0!=jd(a.i).length||0!=a.l.length)a.i.i.length=0,ra(a.l),a.l.length=0;a.j.ua();}}function Ec(a,b,c){let d=ad(c);if(\"\"!=d.i)b&&Pc(d,b+\".\"+d.i),Qc(d,d.m);else {const e=l.location;d=bd(e.protocol,b?b+\".\"+e.hostname:e.hostname,+e.port,c);}a.aa&&xa(a.aa,function(e,f){R(d,f,e);});b=a.D;c=a.sa;b&&c&&R(d,b,c);R(d,\"VER\",a.ma);Kd(a,d);return d}\nfunction nc(a,b,c){if(b&&!a.H)throw Error(\"Can't create secondary domain capable XhrIo object.\");b=c&&a.Ba&&!a.qa?new X(new pd({ib:!0})):new X(a.qa);b.L=a.H;return b}function Sd(){}k=Sd.prototype;k.xa=function(){};k.wa=function(){};k.va=function(){};k.ua=function(){};k.Oa=function(){};function Td(){if(y&&!(10<=Number(Ua)))throw Error(\"Environmental error: no available transport.\");}Td.prototype.g=function(a,b){return new Y(a,b)};\nfunction Y(a,b){C.call(this);this.g=new Id(b);this.l=a;this.h=b&&b.messageUrlParams||null;a=b&&b.messageHeaders||null;b&&b.clientProtocolHeaderRequired&&(a?a[\"X-Client-Protocol\"]=\"webchannel\":a={\"X-Client-Protocol\":\"webchannel\"});this.g.s=a;a=b&&b.initMessageHeaders||null;b&&b.messageContentType&&(a?a[\"X-WebChannel-Content-Type\"]=b.messageContentType:a={\"X-WebChannel-Content-Type\":b.messageContentType});b&&b.ya&&(a?a[\"X-WebChannel-Client-Profile\"]=b.ya:a={\"X-WebChannel-Client-Profile\":b.ya});this.g.P=\na;(a=b&&b.httpHeadersOverwriteParam)&&!sa(a)&&(this.g.o=a);this.A=b&&b.supportsCrossDomainXhr||!1;this.v=b&&b.sendRawJson||!1;(b=b&&b.httpSessionIdParam)&&!sa(b)&&(this.g.D=b,a=this.h,null!==a&&b in a&&(a=this.h,b in a&&delete a[b]));this.j=new Z(this);}t(Y,C);Y.prototype.m=function(){this.g.j=this.j;this.A&&(this.g.H=!0);var a=this.g,b=this.l,c=this.h||void 0;a.Wa&&(a.h.info(\"Origin Trials enabled.\"),zb(q(a.hb,a,b)));J(0);a.W=b;a.aa=c||{};a.N=a.X;a.F=Ec(a,null,a.W);Hc(a);};Y.prototype.close=function(){Ic(this.g);};\nY.prototype.u=function(a){if(\"string\"===typeof a){var b={};b.__data__=a;Md(this.g,b);}else this.v?(b={},b.__data__=rb(a),Md(this.g,b)):Md(this.g,a);};Y.prototype.M=function(){this.g.j=null;delete this.j;Ic(this.g);delete this.g;Y.Z.M.call(this);};function Ud(a){ac.call(this);var b=a.__sm__;if(b){a:{for(const c in b){a=c;break a}a=void 0;}if(this.i=a)a=this.i,b=null!==b&&a in b?b[a]:void 0;this.data=b;}else this.data=a;}t(Ud,ac);function Vd(){bc.call(this);this.status=1;}t(Vd,bc);function Z(a){this.g=a;}\nt(Z,Sd);Z.prototype.xa=function(){D(this.g,\"a\");};Z.prototype.wa=function(a){D(this.g,new Ud(a));};Z.prototype.va=function(a){D(this.g,new Vd(a));};Z.prototype.ua=function(){D(this.g,\"b\");};/*\n\n Copyright 2017 Google LLC\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\nTd.prototype.createWebChannel=Td.prototype.g;Y.prototype.send=Y.prototype.u;Y.prototype.open=Y.prototype.m;Y.prototype.close=Y.prototype.close;Wb.NO_ERROR=0;Wb.TIMEOUT=8;Wb.HTTP_ERROR=6;Xb.COMPLETE=\"complete\";$b.EventType=L;L.OPEN=\"a\";L.CLOSE=\"b\";L.ERROR=\"c\";L.MESSAGE=\"d\";C.prototype.listen=C.prototype.N;X.prototype.listenOnce=X.prototype.O;X.prototype.getLastError=X.prototype.La;X.prototype.getLastErrorCode=X.prototype.Da;X.prototype.getStatus=X.prototype.ba;X.prototype.getResponseJson=X.prototype.Qa;\nX.prototype.getResponseText=X.prototype.ga;X.prototype.send=X.prototype.ea;var createWebChannelTransport = esm.createWebChannelTransport=function(){return new Td};var getStatEventTarget = esm.getStatEventTarget=function(){return Sb()};var ErrorCode = esm.ErrorCode=Wb;var EventType = esm.EventType=Xb;var Event = esm.Event=H;var Stat = esm.Stat={rb:0,ub:1,vb:2,Ob:3,Tb:4,Qb:5,Rb:6,Pb:7,Nb:8,Sb:9,PROXY:10,NOPROXY:11,Lb:12,Hb:13,Ib:14,Gb:15,Jb:16,Kb:17,nb:18,mb:19,ob:20};var FetchXmlHttpFactory = esm.FetchXmlHttpFactory=pd;var WebChannel = esm.WebChannel=$b;\nvar XhrIo = esm.XhrIo=X;\n\nexport { ErrorCode, Event, EventType, FetchXmlHttpFactory, Stat, WebChannel, XhrIo, createWebChannelTransport, esm as default, getStatEventTarget };\n//# sourceMappingURL=index.esm2017.js.map\n","import { _registerComponent, registerVersion, _getProvider, getApp, _removeServiceInstance, SDK_VERSION } from '@firebase/app';\nimport { Component } from '@firebase/component';\nimport { Logger, LogLevel } from '@firebase/logger';\nimport { FirebaseError, createMockUserToken, getModularInstance, deepEqual, getUA, isIndexedDBAvailable, isSafari, isMobileCordova, isReactNative, isElectron, isIE, isUWP, isBrowserExtension } from '@firebase/util';\nimport { XhrIo, EventType, ErrorCode, createWebChannelTransport, getStatEventTarget, FetchXmlHttpFactory, WebChannel, Event, Stat } from '@firebase/webchannel-wrapper';\n\nconst D = \"@firebase/firestore\";\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Simple wrapper around a nullable UID. Mostly exists to make code more\n * readable.\n */\nclass C {\n constructor(t) {\n this.uid = t;\n }\n isAuthenticated() {\n return null != this.uid;\n }\n /**\n * Returns a key representing this user, suitable for inclusion in a\n * dictionary.\n */ toKey() {\n return this.isAuthenticated() ? \"uid:\" + this.uid : \"anonymous-user\";\n }\n isEqual(t) {\n return t.uid === this.uid;\n }\n}\n\n/** A user with a null UID. */ C.UNAUTHENTICATED = new C(null), \n// TODO(mikelehen): Look into getting a proper uid-equivalent for\n// non-FirebaseAuth providers.\nC.GOOGLE_CREDENTIALS = new C(\"google-credentials-uid\"), C.FIRST_PARTY = new C(\"first-party-uid\"), \nC.MOCK_USER = new C(\"mock-user\");\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nlet x = \"9.9.2\";\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst N = new Logger(\"@firebase/firestore\");\n\n// Helper methods are needed because variables can't be exported as read/write\nfunction k() {\n return N.logLevel;\n}\n\n/**\n * Sets the verbosity of Cloud Firestore logs (debug, error, or silent).\n *\n * @param logLevel - The verbosity you set for activity and error logging. Can\n * be any of the following values:\n *\n * <ul>\n * <li>`debug` for the most verbose logging level, primarily for\n * debugging.</li>\n * <li>`error` to log errors only.</li>\n * <li><code>`silent` to turn off logging.</li>\n * </ul>\n */ function M(t) {\n N.setLogLevel(t);\n}\n\nfunction O(t, ...e) {\n if (N.logLevel <= LogLevel.DEBUG) {\n const n = e.map(B);\n N.debug(`Firestore (${x}): ${t}`, ...n);\n }\n}\n\nfunction F(t, ...e) {\n if (N.logLevel <= LogLevel.ERROR) {\n const n = e.map(B);\n N.error(`Firestore (${x}): ${t}`, ...n);\n }\n}\n\n/**\n * @internal\n */ function $(t, ...e) {\n if (N.logLevel <= LogLevel.WARN) {\n const n = e.map(B);\n N.warn(`Firestore (${x}): ${t}`, ...n);\n }\n}\n\n/**\n * Converts an additional log parameter to a string representation.\n */ function B(t) {\n if (\"string\" == typeof t) return t;\n try {\n return e = t, JSON.stringify(e);\n } catch (e) {\n // Converting to JSON failed, just log the object directly\n return t;\n }\n /**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n /** Formats an object as a JSON string, suitable for logging. */\n var e;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Unconditionally fails, throwing an Error with the given message.\n * Messages are stripped in production builds.\n *\n * Returns `never` and can be used in expressions:\n * @example\n * let futureVar = fail('not implemented yet');\n */ function L(t = \"Unexpected state\") {\n // Log the failure in addition to throw an exception, just in case the\n // exception is swallowed.\n const e = `FIRESTORE (${x}) INTERNAL ASSERTION FAILED: ` + t;\n // NOTE: We don't use FirestoreError here because these are internal failures\n // that cannot be handled by the user. (Also it would create a circular\n // dependency between the error and assert modules which doesn't work.)\n throw F(e), new Error(e);\n}\n\n/**\n * Fails if the given assertion condition is false, throwing an Error with the\n * given message if it did.\n *\n * Messages are stripped in production builds.\n */ function U(t, e) {\n t || L();\n}\n\n/**\n * Fails if the given assertion condition is false, throwing an Error with the\n * given message if it did.\n *\n * The code of callsites invoking this function are stripped out in production\n * builds. Any side-effects of code within the debugAssert() invocation will not\n * happen in this case.\n *\n * @internal\n */ function q(t, e) {\n t || L();\n}\n\n/**\n * Casts `obj` to `T`. In non-production builds, verifies that `obj` is an\n * instance of `T` before casting.\n */ function K(t, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ne) {\n return t;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ const G = {\n // Causes are copied from:\n // https://github.com/grpc/grpc/blob/bceec94ea4fc5f0085d81235d8e1c06798dc341a/include/grpc%2B%2B/impl/codegen/status_code_enum.h\n /** Not an error; returned on success. */\n OK: \"ok\",\n /** The operation was cancelled (typically by the caller). */\n CANCELLED: \"cancelled\",\n /** Unknown error or an error from a different error domain. */\n UNKNOWN: \"unknown\",\n /**\n * Client specified an invalid argument. Note that this differs from\n * FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments that are\n * problematic regardless of the state of the system (e.g., a malformed file\n * name).\n */\n INVALID_ARGUMENT: \"invalid-argument\",\n /**\n * Deadline expired before operation could complete. For operations that\n * change the state of the system, this error may be returned even if the\n * operation has completed successfully. For example, a successful response\n * from a server could have been delayed long enough for the deadline to\n * expire.\n */\n DEADLINE_EXCEEDED: \"deadline-exceeded\",\n /** Some requested entity (e.g., file or directory) was not found. */\n NOT_FOUND: \"not-found\",\n /**\n * Some entity that we attempted to create (e.g., file or directory) already\n * exists.\n */\n ALREADY_EXISTS: \"already-exists\",\n /**\n * The caller does not have permission to execute the specified operation.\n * PERMISSION_DENIED must not be used for rejections caused by exhausting\n * some resource (use RESOURCE_EXHAUSTED instead for those errors).\n * PERMISSION_DENIED must not be used if the caller can not be identified\n * (use UNAUTHENTICATED instead for those errors).\n */\n PERMISSION_DENIED: \"permission-denied\",\n /**\n * The request does not have valid authentication credentials for the\n * operation.\n */\n UNAUTHENTICATED: \"unauthenticated\",\n /**\n * Some resource has been exhausted, perhaps a per-user quota, or perhaps the\n * entire file system is out of space.\n */\n RESOURCE_EXHAUSTED: \"resource-exhausted\",\n /**\n * Operation was rejected because the system is not in a state required for\n * the operation's execution. For example, directory to be deleted may be\n * non-empty, an rmdir operation is applied to a non-directory, etc.\n *\n * A litmus test that may help a service implementor in deciding\n * between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE:\n * (a) Use UNAVAILABLE if the client can retry just the failing call.\n * (b) Use ABORTED if the client should retry at a higher-level\n * (e.g., restarting a read-modify-write sequence).\n * (c) Use FAILED_PRECONDITION if the client should not retry until\n * the system state has been explicitly fixed. E.g., if an \"rmdir\"\n * fails because the directory is non-empty, FAILED_PRECONDITION\n * should be returned since the client should not retry unless\n * they have first fixed up the directory by deleting files from it.\n * (d) Use FAILED_PRECONDITION if the client performs conditional\n * REST Get/Update/Delete on a resource and the resource on the\n * server does not match the condition. E.g., conflicting\n * read-modify-write on the same resource.\n */\n FAILED_PRECONDITION: \"failed-precondition\",\n /**\n * The operation was aborted, typically due to a concurrency issue like\n * sequencer check failures, transaction aborts, etc.\n *\n * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,\n * and UNAVAILABLE.\n */\n ABORTED: \"aborted\",\n /**\n * Operation was attempted past the valid range. E.g., seeking or reading\n * past end of file.\n *\n * Unlike INVALID_ARGUMENT, this error indicates a problem that may be fixed\n * if the system state changes. For example, a 32-bit file system will\n * generate INVALID_ARGUMENT if asked to read at an offset that is not in the\n * range [0,2^32-1], but it will generate OUT_OF_RANGE if asked to read from\n * an offset past the current file size.\n *\n * There is a fair bit of overlap between FAILED_PRECONDITION and\n * OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific error)\n * when it applies so that callers who are iterating through a space can\n * easily look for an OUT_OF_RANGE error to detect when they are done.\n */\n OUT_OF_RANGE: \"out-of-range\",\n /** Operation is not implemented or not supported/enabled in this service. */\n UNIMPLEMENTED: \"unimplemented\",\n /**\n * Internal errors. Means some invariants expected by underlying System has\n * been broken. If you see one of these errors, Something is very broken.\n */\n INTERNAL: \"internal\",\n /**\n * The service is currently unavailable. This is a most likely a transient\n * condition and may be corrected by retrying with a backoff.\n *\n * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,\n * and UNAVAILABLE.\n */\n UNAVAILABLE: \"unavailable\",\n /** Unrecoverable data loss or corruption. */\n DATA_LOSS: \"data-loss\"\n};\n\n/** An error returned by a Firestore operation. */ class Q extends FirebaseError {\n /** @hideconstructor */\n constructor(\n /**\n * The backend error code associated with this error.\n */\n t, \n /**\n * A custom error description.\n */\n e) {\n super(t, e), this.code = t, this.message = e, \n // HACK: We write a toString property directly because Error is not a real\n // class and so inheritance does not work correctly. We could alternatively\n // do the same \"back-door inheritance\" trick that FirebaseError does.\n this.toString = () => `${this.name}: [code=${this.code}]: ${this.message}`;\n }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ class j {\n constructor() {\n this.promise = new Promise(((t, e) => {\n this.resolve = t, this.reject = e;\n }));\n }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ class W {\n constructor(t, e) {\n this.user = e, this.type = \"OAuth\", this.headers = new Map, this.headers.set(\"Authorization\", `Bearer ${t}`);\n }\n}\n\n/**\n * A CredentialsProvider that always yields an empty token.\n * @internal\n */ class z {\n getToken() {\n return Promise.resolve(null);\n }\n invalidateToken() {}\n start(t, e) {\n // Fire with initial user.\n t.enqueueRetryable((() => e(C.UNAUTHENTICATED)));\n }\n shutdown() {}\n}\n\n/**\n * A CredentialsProvider that always returns a constant token. Used for\n * emulator token mocking.\n */ class H {\n constructor(t) {\n this.token = t, \n /**\n * Stores the listener registered with setChangeListener()\n * This isn't actually necessary since the UID never changes, but we use this\n * to verify the listen contract is adhered to in tests.\n */\n this.changeListener = null;\n }\n getToken() {\n return Promise.resolve(this.token);\n }\n invalidateToken() {}\n start(t, e) {\n this.changeListener = e, \n // Fire with initial user.\n t.enqueueRetryable((() => e(this.token.user)));\n }\n shutdown() {\n this.changeListener = null;\n }\n}\n\nclass J {\n constructor(t) {\n this.t = t, \n /** Tracks the current User. */\n this.currentUser = C.UNAUTHENTICATED, \n /**\n * Counter used to detect if the token changed while a getToken request was\n * outstanding.\n */\n this.i = 0, this.forceRefresh = !1, this.auth = null;\n }\n start(t, e) {\n let n = this.i;\n // A change listener that prevents double-firing for the same token change.\n const s = t => this.i !== n ? (n = this.i, e(t)) : Promise.resolve();\n // A promise that can be waited on to block on the next token change.\n // This promise is re-created after each change.\n let i = new j;\n this.o = () => {\n this.i++, this.currentUser = this.u(), i.resolve(), i = new j, t.enqueueRetryable((() => s(this.currentUser)));\n };\n const r = () => {\n const e = i;\n t.enqueueRetryable((async () => {\n await e.promise, await s(this.currentUser);\n }));\n }, o = t => {\n O(\"FirebaseAuthCredentialsProvider\", \"Auth detected\"), this.auth = t, this.auth.addAuthTokenListener(this.o), \n r();\n };\n this.t.onInit((t => o(t))), \n // Our users can initialize Auth right after Firestore, so we give it\n // a chance to register itself with the component framework before we\n // determine whether to start up in unauthenticated mode.\n setTimeout((() => {\n if (!this.auth) {\n const t = this.t.getImmediate({\n optional: !0\n });\n t ? o(t) : (\n // If auth is still not available, proceed with `null` user\n O(\"FirebaseAuthCredentialsProvider\", \"Auth not yet detected\"), i.resolve(), i = new j);\n }\n }), 0), r();\n }\n getToken() {\n // Take note of the current value of the tokenCounter so that this method\n // can fail (with an ABORTED error) if there is a token change while the\n // request is outstanding.\n const t = this.i, e = this.forceRefresh;\n return this.forceRefresh = !1, this.auth ? this.auth.getToken(e).then((e => \n // Cancel the request since the token changed while the request was\n // outstanding so the response is potentially for a previous user (which\n // user, we can't be sure).\n this.i !== t ? (O(\"FirebaseAuthCredentialsProvider\", \"getToken aborted due to token change.\"), \n this.getToken()) : e ? (U(\"string\" == typeof e.accessToken), new W(e.accessToken, this.currentUser)) : null)) : Promise.resolve(null);\n }\n invalidateToken() {\n this.forceRefresh = !0;\n }\n shutdown() {\n this.auth && this.auth.removeAuthTokenListener(this.o);\n }\n // Auth.getUid() can return null even with a user logged in. It is because\n // getUid() is synchronous, but the auth code populating Uid is asynchronous.\n // This method should only be called in the AuthTokenListener callback\n // to guarantee to get the actual user.\n u() {\n const t = this.auth && this.auth.getUid();\n return U(null === t || \"string\" == typeof t), new C(t);\n }\n}\n\n/*\n * FirstPartyToken provides a fresh token each time its value\n * is requested, because if the token is too old, requests will be rejected.\n * Technically this may no longer be necessary since the SDK should gracefully\n * recover from unauthenticated errors (see b/33147818 for context), but it's\n * safer to keep the implementation as-is.\n */ class Y {\n constructor(t, e, n) {\n this.type = \"FirstParty\", this.user = C.FIRST_PARTY, this.headers = new Map, this.headers.set(\"X-Goog-AuthUser\", e);\n const s = t.auth.getAuthHeaderValueForFirstParty([]);\n s && this.headers.set(\"Authorization\", s), n && this.headers.set(\"X-Goog-Iam-Authorization-Token\", n);\n }\n}\n\n/*\n * Provides user credentials required for the Firestore JavaScript SDK\n * to authenticate the user, using technique that is only available\n * to applications hosted by Google.\n */ class X {\n constructor(t, e, n) {\n this.h = t, this.l = e, this.m = n;\n }\n getToken() {\n return Promise.resolve(new Y(this.h, this.l, this.m));\n }\n start(t, e) {\n // Fire with initial uid.\n t.enqueueRetryable((() => e(C.FIRST_PARTY)));\n }\n shutdown() {}\n invalidateToken() {}\n}\n\nclass Z {\n constructor(t) {\n this.value = t, this.type = \"AppCheck\", this.headers = new Map, t && t.length > 0 && this.headers.set(\"x-firebase-appcheck\", this.value);\n }\n}\n\nclass tt {\n constructor(t) {\n this.g = t, this.forceRefresh = !1, this.appCheck = null, this.p = null;\n }\n start(t, e) {\n const n = t => {\n null != t.error && O(\"FirebaseAppCheckTokenProvider\", `Error getting App Check token; using placeholder token instead. Error: ${t.error.message}`);\n const n = t.token !== this.p;\n return this.p = t.token, O(\"FirebaseAppCheckTokenProvider\", `Received ${n ? \"new\" : \"existing\"} token.`), \n n ? e(t.token) : Promise.resolve();\n };\n this.o = e => {\n t.enqueueRetryable((() => n(e)));\n };\n const s = t => {\n O(\"FirebaseAppCheckTokenProvider\", \"AppCheck detected\"), this.appCheck = t, this.appCheck.addTokenListener(this.o);\n };\n this.g.onInit((t => s(t))), \n // Our users can initialize AppCheck after Firestore, so we give it\n // a chance to register itself with the component framework.\n setTimeout((() => {\n if (!this.appCheck) {\n const t = this.g.getImmediate({\n optional: !0\n });\n t ? s(t) : \n // If AppCheck is still not available, proceed without it.\n O(\"FirebaseAppCheckTokenProvider\", \"AppCheck not yet detected\");\n }\n }), 0);\n }\n getToken() {\n const t = this.forceRefresh;\n return this.forceRefresh = !1, this.appCheck ? this.appCheck.getToken(t).then((t => t ? (U(\"string\" == typeof t.token), \n this.p = t.token, new Z(t.token)) : null)) : Promise.resolve(null);\n }\n invalidateToken() {\n this.forceRefresh = !0;\n }\n shutdown() {\n this.appCheck && this.appCheck.removeTokenListener(this.o);\n }\n}\n\n/**\n * An AppCheck token provider that always yields an empty token.\n * @internal\n */ class et {\n getToken() {\n return Promise.resolve(new Z(\"\"));\n }\n invalidateToken() {}\n start(t, e) {}\n shutdown() {}\n}\n\n/**\n * Builds a CredentialsProvider depending on the type of\n * the credentials passed in.\n */\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Generates `nBytes` of random bytes.\n *\n * If `nBytes < 0` , an error will be thrown.\n */\nfunction nt(t) {\n // Polyfills for IE and WebWorker by using `self` and `msCrypto` when `crypto` is not available.\n const e = \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n \"undefined\" != typeof self && (self.crypto || self.msCrypto), n = new Uint8Array(t);\n if (e && \"function\" == typeof e.getRandomValues) e.getRandomValues(n); else \n // Falls back to Math.random\n for (let e = 0; e < t; e++) n[e] = Math.floor(256 * Math.random());\n return n;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ class st {\n static I() {\n // Alphanumeric characters\n const t = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\", e = Math.floor(256 / t.length) * t.length;\n // The largest byte value that is a multiple of `char.length`.\n let n = \"\";\n for (;n.length < 20; ) {\n const s = nt(40);\n for (let i = 0; i < s.length; ++i) \n // Only accept values that are [0, maxMultiple), this ensures they can\n // be evenly mapped to indices of `chars` via a modulo operation.\n n.length < 20 && s[i] < e && (n += t.charAt(s[i] % t.length));\n }\n return n;\n }\n}\n\nfunction it(t, e) {\n return t < e ? -1 : t > e ? 1 : 0;\n}\n\n/** Helper to compare arrays using isEqual(). */ function rt(t, e, n) {\n return t.length === e.length && t.every(((t, s) => n(t, e[s])));\n}\n\n/**\n * Returns the immediate lexicographically-following string. This is useful to\n * construct an inclusive range for indexeddb iterators.\n */ function ot(t) {\n // Return the input string, with an additional NUL byte appended.\n return t + \"\\0\";\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// The earliest date supported by Firestore timestamps (0001-01-01T00:00:00Z).\n/**\n * A `Timestamp` represents a point in time independent of any time zone or\n * calendar, represented as seconds and fractions of seconds at nanosecond\n * resolution in UTC Epoch time.\n *\n * It is encoded using the Proleptic Gregorian Calendar which extends the\n * Gregorian calendar backwards to year one. It is encoded assuming all minutes\n * are 60 seconds long, i.e. leap seconds are \"smeared\" so that no leap second\n * table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to\n * 9999-12-31T23:59:59.999999999Z.\n *\n * For examples and further specifications, refer to the\n * {@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto | Timestamp definition}.\n */\nclass ut {\n /**\n * Creates a new timestamp.\n *\n * @param seconds - The number of seconds of UTC time since Unix epoch\n * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to\n * 9999-12-31T23:59:59Z inclusive.\n * @param nanoseconds - The non-negative fractions of a second at nanosecond\n * resolution. Negative second values with fractions must still have\n * non-negative nanoseconds values that count forward in time. Must be\n * from 0 to 999,999,999 inclusive.\n */\n constructor(\n /**\n * The number of seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z.\n */\n t, \n /**\n * The fractions of a second at nanosecond resolution.*\n */\n e) {\n if (this.seconds = t, this.nanoseconds = e, e < 0) throw new Q(G.INVALID_ARGUMENT, \"Timestamp nanoseconds out of range: \" + e);\n if (e >= 1e9) throw new Q(G.INVALID_ARGUMENT, \"Timestamp nanoseconds out of range: \" + e);\n if (t < -62135596800) throw new Q(G.INVALID_ARGUMENT, \"Timestamp seconds out of range: \" + t);\n // This will break in the year 10,000.\n if (t >= 253402300800) throw new Q(G.INVALID_ARGUMENT, \"Timestamp seconds out of range: \" + t);\n }\n /**\n * Creates a new timestamp with the current date, with millisecond precision.\n *\n * @returns a new timestamp representing the current date.\n */ static now() {\n return ut.fromMillis(Date.now());\n }\n /**\n * Creates a new timestamp from the given date.\n *\n * @param date - The date to initialize the `Timestamp` from.\n * @returns A new `Timestamp` representing the same point in time as the given\n * date.\n */ static fromDate(t) {\n return ut.fromMillis(t.getTime());\n }\n /**\n * Creates a new timestamp from the given number of milliseconds.\n *\n * @param milliseconds - Number of milliseconds since Unix epoch\n * 1970-01-01T00:00:00Z.\n * @returns A new `Timestamp` representing the same point in time as the given\n * number of milliseconds.\n */ static fromMillis(t) {\n const e = Math.floor(t / 1e3), n = Math.floor(1e6 * (t - 1e3 * e));\n return new ut(e, n);\n }\n /**\n * Converts a `Timestamp` to a JavaScript `Date` object. This conversion\n * causes a loss of precision since `Date` objects only support millisecond\n * precision.\n *\n * @returns JavaScript `Date` object representing the same point in time as\n * this `Timestamp`, with millisecond precision.\n */ toDate() {\n return new Date(this.toMillis());\n }\n /**\n * Converts a `Timestamp` to a numeric timestamp (in milliseconds since\n * epoch). This operation causes a loss of precision.\n *\n * @returns The point in time corresponding to this timestamp, represented as\n * the number of milliseconds since Unix epoch 1970-01-01T00:00:00Z.\n */ toMillis() {\n return 1e3 * this.seconds + this.nanoseconds / 1e6;\n }\n _compareTo(t) {\n return this.seconds === t.seconds ? it(this.nanoseconds, t.nanoseconds) : it(this.seconds, t.seconds);\n }\n /**\n * Returns true if this `Timestamp` is equal to the provided one.\n *\n * @param other - The `Timestamp` to compare against.\n * @returns true if this `Timestamp` is equal to the provided one.\n */ isEqual(t) {\n return t.seconds === this.seconds && t.nanoseconds === this.nanoseconds;\n }\n /** Returns a textual representation of this `Timestamp`. */ toString() {\n return \"Timestamp(seconds=\" + this.seconds + \", nanoseconds=\" + this.nanoseconds + \")\";\n }\n /** Returns a JSON-serializable representation of this `Timestamp`. */ toJSON() {\n return {\n seconds: this.seconds,\n nanoseconds: this.nanoseconds\n };\n }\n /**\n * Converts this object to a primitive string, which allows `Timestamp` objects\n * to be compared using the `>`, `<=`, `>=` and `>` operators.\n */ valueOf() {\n // This method returns a string of the form <seconds>.<nanoseconds> where\n // <seconds> is translated to have a non-negative value and both <seconds>\n // and <nanoseconds> are left-padded with zeroes to be a consistent length.\n // Strings with this format then have a lexiographical ordering that matches\n // the expected ordering. The <seconds> translation is done to avoid having\n // a leading negative sign (i.e. a leading '-' character) in its string\n // representation, which would affect its lexiographical ordering.\n const t = this.seconds - -62135596800;\n // Note: Up to 12 decimal digits are required to represent all valid\n // 'seconds' values.\n return String(t).padStart(12, \"0\") + \".\" + String(this.nanoseconds).padStart(9, \"0\");\n }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A version of a document in Firestore. This corresponds to the version\n * timestamp, such as update_time or read_time.\n */ class ct {\n constructor(t) {\n this.timestamp = t;\n }\n static fromTimestamp(t) {\n return new ct(t);\n }\n static min() {\n return new ct(new ut(0, 0));\n }\n static max() {\n return new ct(new ut(253402300799, 999999999));\n }\n compareTo(t) {\n return this.timestamp._compareTo(t.timestamp);\n }\n isEqual(t) {\n return this.timestamp.isEqual(t.timestamp);\n }\n /** Returns a number representation of the version for use in spec tests. */ toMicroseconds() {\n // Convert to microseconds.\n return 1e6 * this.timestamp.seconds + this.timestamp.nanoseconds / 1e3;\n }\n toString() {\n return \"SnapshotVersion(\" + this.timestamp.toString() + \")\";\n }\n toTimestamp() {\n return this.timestamp;\n }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Path represents an ordered sequence of string segments.\n */\nclass at {\n constructor(t, e, n) {\n void 0 === e ? e = 0 : e > t.length && L(), void 0 === n ? n = t.length - e : n > t.length - e && L(), \n this.segments = t, this.offset = e, this.len = n;\n }\n get length() {\n return this.len;\n }\n isEqual(t) {\n return 0 === at.comparator(this, t);\n }\n child(t) {\n const e = this.segments.slice(this.offset, this.limit());\n return t instanceof at ? t.forEach((t => {\n e.push(t);\n })) : e.push(t), this.construct(e);\n }\n /** The index of one past the last segment of the path. */ limit() {\n return this.offset + this.length;\n }\n popFirst(t) {\n return t = void 0 === t ? 1 : t, this.construct(this.segments, this.offset + t, this.length - t);\n }\n popLast() {\n return this.construct(this.segments, this.offset, this.length - 1);\n }\n firstSegment() {\n return this.segments[this.offset];\n }\n lastSegment() {\n return this.get(this.length - 1);\n }\n get(t) {\n return this.segments[this.offset + t];\n }\n isEmpty() {\n return 0 === this.length;\n }\n isPrefixOf(t) {\n if (t.length < this.length) return !1;\n for (let e = 0; e < this.length; e++) if (this.get(e) !== t.get(e)) return !1;\n return !0;\n }\n isImmediateParentOf(t) {\n if (this.length + 1 !== t.length) return !1;\n for (let e = 0; e < this.length; e++) if (this.get(e) !== t.get(e)) return !1;\n return !0;\n }\n forEach(t) {\n for (let e = this.offset, n = this.limit(); e < n; e++) t(this.segments[e]);\n }\n toArray() {\n return this.segments.slice(this.offset, this.limit());\n }\n static comparator(t, e) {\n const n = Math.min(t.length, e.length);\n for (let s = 0; s < n; s++) {\n const n = t.get(s), i = e.get(s);\n if (n < i) return -1;\n if (n > i) return 1;\n }\n return t.length < e.length ? -1 : t.length > e.length ? 1 : 0;\n }\n}\n\n/**\n * A slash-separated path for navigating resources (documents and collections)\n * within Firestore.\n *\n * @internal\n */ class ht extends at {\n construct(t, e, n) {\n return new ht(t, e, n);\n }\n canonicalString() {\n // NOTE: The client is ignorant of any path segments containing escape\n // sequences (e.g. __id123__) and just passes them through raw (they exist\n // for legacy reasons and should not be used frequently).\n return this.toArray().join(\"/\");\n }\n toString() {\n return this.canonicalString();\n }\n /**\n * Creates a resource path from the given slash-delimited string. If multiple\n * arguments are provided, all components are combined. Leading and trailing\n * slashes from all components are ignored.\n */ static fromString(...t) {\n // NOTE: The client is ignorant of any path segments containing escape\n // sequences (e.g. __id123__) and just passes them through raw (they exist\n // for legacy reasons and should not be used frequently).\n const e = [];\n for (const n of t) {\n if (n.indexOf(\"//\") >= 0) throw new Q(G.INVALID_ARGUMENT, `Invalid segment (${n}). Paths must not contain // in them.`);\n // Strip leading and traling slashed.\n e.push(...n.split(\"/\").filter((t => t.length > 0)));\n }\n return new ht(e);\n }\n static emptyPath() {\n return new ht([]);\n }\n}\n\nconst lt = /^[_a-zA-Z][_a-zA-Z0-9]*$/;\n\n/**\n * A dot-separated path for navigating sub-objects within a document.\n * @internal\n */ class ft extends at {\n construct(t, e, n) {\n return new ft(t, e, n);\n }\n /**\n * Returns true if the string could be used as a segment in a field path\n * without escaping.\n */ static isValidIdentifier(t) {\n return lt.test(t);\n }\n canonicalString() {\n return this.toArray().map((t => (t = t.replace(/\\\\/g, \"\\\\\\\\\").replace(/`/g, \"\\\\`\"), \n ft.isValidIdentifier(t) || (t = \"`\" + t + \"`\"), t))).join(\".\");\n }\n toString() {\n return this.canonicalString();\n }\n /**\n * Returns true if this field references the key of a document.\n */ isKeyField() {\n return 1 === this.length && \"__name__\" === this.get(0);\n }\n /**\n * The field designating the key of a document.\n */ static keyField() {\n return new ft([ \"__name__\" ]);\n }\n /**\n * Parses a field string from the given server-formatted string.\n *\n * - Splitting the empty string is not allowed (for now at least).\n * - Empty segments within the string (e.g. if there are two consecutive\n * separators) are not allowed.\n *\n * TODO(b/37244157): we should make this more strict. Right now, it allows\n * non-identifier path components, even if they aren't escaped.\n */ static fromServerFormat(t) {\n const e = [];\n let n = \"\", s = 0;\n const i = () => {\n if (0 === n.length) throw new Q(G.INVALID_ARGUMENT, `Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);\n e.push(n), n = \"\";\n };\n let r = !1;\n for (;s < t.length; ) {\n const e = t[s];\n if (\"\\\\\" === e) {\n if (s + 1 === t.length) throw new Q(G.INVALID_ARGUMENT, \"Path has trailing escape character: \" + t);\n const e = t[s + 1];\n if (\"\\\\\" !== e && \".\" !== e && \"`\" !== e) throw new Q(G.INVALID_ARGUMENT, \"Path has invalid escape sequence: \" + t);\n n += e, s += 2;\n } else \"`\" === e ? (r = !r, s++) : \".\" !== e || r ? (n += e, s++) : (i(), s++);\n }\n if (i(), r) throw new Q(G.INVALID_ARGUMENT, \"Unterminated ` in path: \" + t);\n return new ft(e);\n }\n static emptyPath() {\n return new ft([]);\n }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * @internal\n */ class dt {\n constructor(t) {\n this.path = t;\n }\n static fromPath(t) {\n return new dt(ht.fromString(t));\n }\n static fromName(t) {\n return new dt(ht.fromString(t).popFirst(5));\n }\n static empty() {\n return new dt(ht.emptyPath());\n }\n get collectionGroup() {\n return this.path.popLast().lastSegment();\n }\n /** Returns true if the document is in the specified collectionId. */ hasCollectionId(t) {\n return this.path.length >= 2 && this.path.get(this.path.length - 2) === t;\n }\n /** Returns the collection group (i.e. the name of the parent collection) for this key. */ getCollectionGroup() {\n return this.path.get(this.path.length - 2);\n }\n /** Returns the fully qualified path to the parent collection. */ getCollectionPath() {\n return this.path.popLast();\n }\n isEqual(t) {\n return null !== t && 0 === ht.comparator(this.path, t.path);\n }\n toString() {\n return this.path.toString();\n }\n static comparator(t, e) {\n return ht.comparator(t.path, e.path);\n }\n static isDocumentKey(t) {\n return t.length % 2 == 0;\n }\n /**\n * Creates and returns a new document key with the given segments.\n *\n * @param segments - The segments of the path to the document\n * @returns A new instance of DocumentKey\n */ static fromSegments(t) {\n return new dt(new ht(t.slice()));\n }\n}\n\n/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * The initial mutation batch id for each index. Gets updated during index\n * backfill.\n */\n/**\n * An index definition for field indexes in Firestore.\n *\n * Every index is associated with a collection. The definition contains a list\n * of fields and their index kind (which can be `ASCENDING`, `DESCENDING` or\n * `CONTAINS` for ArrayContains/ArrayContainsAny queries).\n *\n * Unlike the backend, the SDK does not differentiate between collection or\n * collection group-scoped indices. Every index can be used for both single\n * collection and collection group queries.\n */\nclass _t {\n constructor(\n /**\n * The index ID. Returns -1 if the index ID is not available (e.g. the index\n * has not yet been persisted).\n */\n t, \n /** The collection ID this index applies to. */\n e, \n /** The field segments for this index. */\n n, \n /** Shows how up-to-date the index is for the current user. */\n s) {\n this.indexId = t, this.collectionGroup = e, this.fields = n, this.indexState = s;\n }\n}\n\n/** An ID for an index that has not yet been added to persistence. */\n/** Returns the ArrayContains/ArrayContainsAny segment for this index. */\nfunction wt(t) {\n return t.fields.find((t => 2 /* CONTAINS */ === t.kind));\n}\n\n/** Returns all directional (ascending/descending) segments for this index. */ function mt(t) {\n return t.fields.filter((t => 2 /* CONTAINS */ !== t.kind));\n}\n\n/**\n * Returns the order of the document key component for the given index.\n *\n * PORTING NOTE: This is only used in the Web IndexedDb implementation.\n */\n/**\n * Compares indexes by collection group and segments. Ignores update time and\n * index ID.\n */\nfunction gt(t, e) {\n let n = it(t.collectionGroup, e.collectionGroup);\n if (0 !== n) return n;\n for (let s = 0; s < Math.min(t.fields.length, e.fields.length); ++s) if (n = pt(t.fields[s], e.fields[s]), \n 0 !== n) return n;\n return it(t.fields.length, e.fields.length);\n}\n\n/** Returns a debug representation of the field index */ _t.UNKNOWN_ID = -1;\n\n/** An index component consisting of field path and index type. */\nclass yt {\n constructor(\n /** The field path of the component. */\n t, \n /** The fields sorting order. */\n e) {\n this.fieldPath = t, this.kind = e;\n }\n}\n\nfunction pt(t, e) {\n const n = ft.comparator(t.fieldPath, e.fieldPath);\n return 0 !== n ? n : it(t.kind, e.kind);\n}\n\n/**\n * Stores the \"high water mark\" that indicates how updated the Index is for the\n * current user.\n */ class It {\n constructor(\n /**\n * Indicates when the index was last updated (relative to other indexes).\n */\n t, \n /** The the latest indexed read time, document and batch id. */\n e) {\n this.sequenceNumber = t, this.offset = e;\n }\n /** The state of an index that has not yet been backfilled. */ static empty() {\n return new It(0, At.min());\n }\n}\n\n/**\n * Creates an offset that matches all documents with a read time higher than\n * `readTime`.\n */ function Tt(t, e) {\n // We want to create an offset that matches all documents with a read time\n // greater than the provided read time. To do so, we technically need to\n // create an offset for `(readTime, MAX_DOCUMENT_KEY)`. While we could use\n // Unicode codepoints to generate MAX_DOCUMENT_KEY, it is much easier to use\n // `(readTime + 1, DocumentKey.empty())` since `> DocumentKey.empty()` matches\n // all valid document IDs.\n const n = t.toTimestamp().seconds, s = t.toTimestamp().nanoseconds + 1, i = ct.fromTimestamp(1e9 === s ? new ut(n + 1, 0) : new ut(n, s));\n return new At(i, dt.empty(), e);\n}\n\n/** Creates a new offset based on the provided document. */ function Et(t) {\n return new At(t.readTime, t.key, -1);\n}\n\n/**\n * Stores the latest read time, document and batch ID that were processed for an\n * index.\n */ class At {\n constructor(\n /**\n * The latest read time version that has been indexed by Firestore for this\n * field index.\n */\n t, \n /**\n * The key of the last document that was indexed for this query. Use\n * `DocumentKey.empty()` if no document has been indexed.\n */\n e, \n /*\n * The largest mutation batch id that's been processed by Firestore.\n */\n n) {\n this.readTime = t, this.documentKey = e, this.largestBatchId = n;\n }\n /** Returns an offset that sorts before all regular offsets. */ static min() {\n return new At(ct.min(), dt.empty(), -1);\n }\n /** Returns an offset that sorts after all regular offsets. */ static max() {\n return new At(ct.max(), dt.empty(), -1);\n }\n}\n\nfunction Rt(t, e) {\n let n = t.readTime.compareTo(e.readTime);\n return 0 !== n ? n : (n = dt.comparator(t.documentKey, e.documentKey), 0 !== n ? n : it(t.largestBatchId, e.largestBatchId));\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ const bt = \"The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.\";\n\n/**\n * A base class representing a persistence transaction, encapsulating both the\n * transaction's sequence numbers as well as a list of onCommitted listeners.\n *\n * When you call Persistence.runTransaction(), it will create a transaction and\n * pass it to your callback. You then pass it to any method that operates\n * on persistence.\n */ class Pt {\n constructor() {\n this.onCommittedListeners = [];\n }\n addOnCommittedListener(t) {\n this.onCommittedListeners.push(t);\n }\n raiseOnCommittedEvent() {\n this.onCommittedListeners.forEach((t => t()));\n }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Verifies the error thrown by a LocalStore operation. If a LocalStore\n * operation fails because the primary lease has been taken by another client,\n * we ignore the error (the persistence layer will immediately call\n * `applyPrimaryLease` to propagate the primary state change). All other errors\n * are re-thrown.\n *\n * @param err - An error returned by a LocalStore operation.\n * @returns A Promise that resolves after we recovered, or the original error.\n */ async function vt(t) {\n if (t.code !== G.FAILED_PRECONDITION || t.message !== bt) throw t;\n O(\"LocalStore\", \"Unexpectedly lost primary lease\");\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * PersistencePromise is essentially a re-implementation of Promise except\n * it has a .next() method instead of .then() and .next() and .catch() callbacks\n * are executed synchronously when a PersistencePromise resolves rather than\n * asynchronously (Promise implementations use setImmediate() or similar).\n *\n * This is necessary to interoperate with IndexedDB which will automatically\n * commit transactions if control is returned to the event loop without\n * synchronously initiating another operation on the transaction.\n *\n * NOTE: .then() and .catch() only allow a single consumer, unlike normal\n * Promises.\n */ class Vt {\n constructor(t) {\n // NOTE: next/catchCallback will always point to our own wrapper functions,\n // not the user's raw next() or catch() callbacks.\n this.nextCallback = null, this.catchCallback = null, \n // When the operation resolves, we'll set result or error and mark isDone.\n this.result = void 0, this.error = void 0, this.isDone = !1, \n // Set to true when .then() or .catch() are called and prevents additional\n // chaining.\n this.callbackAttached = !1, t((t => {\n this.isDone = !0, this.result = t, this.nextCallback && \n // value should be defined unless T is Void, but we can't express\n // that in the type system.\n this.nextCallback(t);\n }), (t => {\n this.isDone = !0, this.error = t, this.catchCallback && this.catchCallback(t);\n }));\n }\n catch(t) {\n return this.next(void 0, t);\n }\n next(t, e) {\n return this.callbackAttached && L(), this.callbackAttached = !0, this.isDone ? this.error ? this.wrapFailure(e, this.error) : this.wrapSuccess(t, this.result) : new Vt(((n, s) => {\n this.nextCallback = e => {\n this.wrapSuccess(t, e).next(n, s);\n }, this.catchCallback = t => {\n this.wrapFailure(e, t).next(n, s);\n };\n }));\n }\n toPromise() {\n return new Promise(((t, e) => {\n this.next(t, e);\n }));\n }\n wrapUserFunction(t) {\n try {\n const e = t();\n return e instanceof Vt ? e : Vt.resolve(e);\n } catch (t) {\n return Vt.reject(t);\n }\n }\n wrapSuccess(t, e) {\n return t ? this.wrapUserFunction((() => t(e))) : Vt.resolve(e);\n }\n wrapFailure(t, e) {\n return t ? this.wrapUserFunction((() => t(e))) : Vt.reject(e);\n }\n static resolve(t) {\n return new Vt(((e, n) => {\n e(t);\n }));\n }\n static reject(t) {\n return new Vt(((e, n) => {\n n(t);\n }));\n }\n static waitFor(\n // Accept all Promise types in waitFor().\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n t) {\n return new Vt(((e, n) => {\n let s = 0, i = 0, r = !1;\n t.forEach((t => {\n ++s, t.next((() => {\n ++i, r && i === s && e();\n }), (t => n(t)));\n })), r = !0, i === s && e();\n }));\n }\n /**\n * Given an array of predicate functions that asynchronously evaluate to a\n * boolean, implements a short-circuiting `or` between the results. Predicates\n * will be evaluated until one of them returns `true`, then stop. The final\n * result will be whether any of them returned `true`.\n */ static or(t) {\n let e = Vt.resolve(!1);\n for (const n of t) e = e.next((t => t ? Vt.resolve(t) : n()));\n return e;\n }\n static forEach(t, e) {\n const n = [];\n return t.forEach(((t, s) => {\n n.push(e.call(this, t, s));\n })), this.waitFor(n);\n }\n /**\n * Concurrently map all array elements through asynchronous function.\n */ static mapArray(t, e) {\n return new Vt(((n, s) => {\n const i = t.length, r = new Array(i);\n let o = 0;\n for (let u = 0; u < i; u++) {\n const c = u;\n e(t[c]).next((t => {\n r[c] = t, ++o, o === i && n(r);\n }), (t => s(t)));\n }\n }));\n }\n /**\n * An alternative to recursive PersistencePromise calls, that avoids\n * potential memory problems from unbounded chains of promises.\n *\n * The `action` will be called repeatedly while `condition` is true.\n */ static doWhile(t, e) {\n return new Vt(((n, s) => {\n const i = () => {\n !0 === t() ? e().next((() => {\n i();\n }), s) : n();\n };\n i();\n }));\n }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// References to `window` are guarded by SimpleDb.isAvailable()\n/* eslint-disable no-restricted-globals */\n/**\n * Wraps an IDBTransaction and exposes a store() method to get a handle to a\n * specific object store.\n */\nclass St {\n constructor(t, e) {\n this.action = t, this.transaction = e, this.aborted = !1, \n /**\n * A `Promise` that resolves with the result of the IndexedDb transaction.\n */\n this.T = new j, this.transaction.oncomplete = () => {\n this.T.resolve();\n }, this.transaction.onabort = () => {\n e.error ? this.T.reject(new xt(t, e.error)) : this.T.resolve();\n }, this.transaction.onerror = e => {\n const n = Ft(e.target.error);\n this.T.reject(new xt(t, n));\n };\n }\n static open(t, e, n, s) {\n try {\n return new St(e, t.transaction(s, n));\n } catch (t) {\n throw new xt(e, t);\n }\n }\n get A() {\n return this.T.promise;\n }\n abort(t) {\n t && this.T.reject(t), this.aborted || (O(\"SimpleDb\", \"Aborting transaction:\", t ? t.message : \"Client-initiated abort\"), \n this.aborted = !0, this.transaction.abort());\n }\n R() {\n // If the browser supports V3 IndexedDB, we invoke commit() explicitly to\n // speed up index DB processing if the event loop remains blocks.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const t = this.transaction;\n this.aborted || \"function\" != typeof t.commit || t.commit();\n }\n /**\n * Returns a SimpleDbStore<KeyType, ValueType> for the specified store. All\n * operations performed on the SimpleDbStore happen within the context of this\n * transaction and it cannot be used anymore once the transaction is\n * completed.\n *\n * Note that we can't actually enforce that the KeyType and ValueType are\n * correct, but they allow type safety through the rest of the consuming code.\n */ store(t) {\n const e = this.transaction.objectStore(t);\n return new kt(e);\n }\n}\n\n/**\n * Provides a wrapper around IndexedDb with a simplified interface that uses\n * Promise-like return values to chain operations. Real promises cannot be used\n * since .then() continuations are executed asynchronously (e.g. via\n * .setImmediate), which would cause IndexedDB to end the transaction.\n * See PersistencePromise for more details.\n */ class Dt {\n /*\n * Creates a new SimpleDb wrapper for IndexedDb database `name`.\n *\n * Note that `version` must not be a downgrade. IndexedDB does not support\n * downgrading the schema version. We currently do not support any way to do\n * versioning outside of IndexedDB's versioning mechanism, as only\n * version-upgrade transactions are allowed to do things like create\n * objectstores.\n */\n constructor(t, e, n) {\n this.name = t, this.version = e, this.P = n;\n // NOTE: According to https://bugs.webkit.org/show_bug.cgi?id=197050, the\n // bug we're checking for should exist in iOS >= 12.2 and < 13, but for\n // whatever reason it's much harder to hit after 12.2 so we only proactively\n // log on 12.2.\n 12.2 === Dt.v(getUA()) && F(\"Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.\");\n }\n /** Deletes the specified database. */ static delete(t) {\n return O(\"SimpleDb\", \"Removing database:\", t), Mt(window.indexedDB.deleteDatabase(t)).toPromise();\n }\n /** Returns true if IndexedDB is available in the current environment. */ static V() {\n if (!isIndexedDBAvailable()) return !1;\n if (Dt.S()) return !0;\n // We extensively use indexed array values and compound keys,\n // which IE and Edge do not support. However, they still have indexedDB\n // defined on the window, so we need to check for them here and make sure\n // to return that persistence is not enabled for those browsers.\n // For tracking support of this feature, see here:\n // https://developer.microsoft.com/en-us/microsoft-edge/platform/status/indexeddbarraysandmultientrysupport/\n // Check the UA string to find out the browser.\n const t = getUA(), e = Dt.v(t), n = 0 < e && e < 10, s = Dt.D(t), i = 0 < s && s < 4.5;\n // IE 10\n // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\n // IE 11\n // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\n // Edge\n // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML,\n // like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\n // iOS Safari: Disable for users running iOS version < 10.\n return !(t.indexOf(\"MSIE \") > 0 || t.indexOf(\"Trident/\") > 0 || t.indexOf(\"Edge/\") > 0 || n || i);\n }\n /**\n * Returns true if the backing IndexedDB store is the Node IndexedDBShim\n * (see https://github.com/axemclion/IndexedDBShim).\n */ static S() {\n var t;\n return \"undefined\" != typeof process && \"YES\" === (null === (t = process.env) || void 0 === t ? void 0 : t.C);\n }\n /** Helper to get a typed SimpleDbStore from a transaction. */ static N(t, e) {\n return t.store(e);\n }\n // visible for testing\n /** Parse User Agent to determine iOS version. Returns -1 if not found. */\n static v(t) {\n const e = t.match(/i(?:phone|pad|pod) os ([\\d_]+)/i), n = e ? e[1].split(\"_\").slice(0, 2).join(\".\") : \"-1\";\n return Number(n);\n }\n // visible for testing\n /** Parse User Agent to determine Android version. Returns -1 if not found. */\n static D(t) {\n const e = t.match(/Android ([\\d.]+)/i), n = e ? e[1].split(\".\").slice(0, 2).join(\".\") : \"-1\";\n return Number(n);\n }\n /**\n * Opens the specified database, creating or upgrading it if necessary.\n */ async k(t) {\n return this.db || (O(\"SimpleDb\", \"Opening database:\", this.name), this.db = await new Promise(((e, n) => {\n // TODO(mikelehen): Investigate browser compatibility.\n // https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB\n // suggests IE9 and older WebKit browsers handle upgrade\n // differently. They expect setVersion, as described here:\n // https://developer.mozilla.org/en-US/docs/Web/API/IDBVersionChangeRequest/setVersion\n const s = indexedDB.open(this.name, this.version);\n s.onsuccess = t => {\n const n = t.target.result;\n e(n);\n }, s.onblocked = () => {\n n(new xt(t, \"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed.\"));\n }, s.onerror = e => {\n const s = e.target.error;\n \"VersionError\" === s.name ? n(new Q(G.FAILED_PRECONDITION, \"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.\")) : \"InvalidStateError\" === s.name ? n(new Q(G.FAILED_PRECONDITION, \"Unable to open an IndexedDB connection. This could be due to running in a private browsing session on a browser whose private browsing sessions do not support IndexedDB: \" + s)) : n(new xt(t, s));\n }, s.onupgradeneeded = t => {\n O(\"SimpleDb\", 'Database \"' + this.name + '\" requires upgrade from version:', t.oldVersion);\n const e = t.target.result;\n this.P.M(e, s.transaction, t.oldVersion, this.version).next((() => {\n O(\"SimpleDb\", \"Database upgrade to version \" + this.version + \" complete\");\n }));\n };\n }))), this.O && (this.db.onversionchange = t => this.O(t)), this.db;\n }\n F(t) {\n this.O = t, this.db && (this.db.onversionchange = e => t(e));\n }\n async runTransaction(t, e, n, s) {\n const i = \"readonly\" === e;\n let r = 0;\n for (;;) {\n ++r;\n try {\n this.db = await this.k(t);\n const e = St.open(this.db, t, i ? \"readonly\" : \"readwrite\", n), r = s(e).next((t => (e.R(), \n t))).catch((t => (\n // Abort the transaction if there was an error.\n e.abort(t), Vt.reject(t)))).toPromise();\n // As noted above, errors are propagated by aborting the transaction. So\n // we swallow any error here to avoid the browser logging it as unhandled.\n return r.catch((() => {})), \n // Wait for the transaction to complete (i.e. IndexedDb's onsuccess event to\n // fire), but still return the original transactionFnResult back to the\n // caller.\n await e.A, r;\n } catch (t) {\n const e = t, n = \"FirebaseError\" !== e.name && r < 3;\n // TODO(schmidt-sebastian): We could probably be smarter about this and\n // not retry exceptions that are likely unrecoverable (such as quota\n // exceeded errors).\n // Note: We cannot use an instanceof check for FirestoreException, since the\n // exception is wrapped in a generic error by our async/await handling.\n if (O(\"SimpleDb\", \"Transaction failed with error:\", e.message, \"Retrying:\", n), \n this.close(), !n) return Promise.reject(e);\n }\n }\n }\n close() {\n this.db && this.db.close(), this.db = void 0;\n }\n}\n\n/**\n * A controller for iterating over a key range or index. It allows an iterate\n * callback to delete the currently-referenced object, or jump to a new key\n * within the key range or index.\n */ class Ct {\n constructor(t) {\n this.$ = t, this.B = !1, this.L = null;\n }\n get isDone() {\n return this.B;\n }\n get U() {\n return this.L;\n }\n set cursor(t) {\n this.$ = t;\n }\n /**\n * This function can be called to stop iteration at any point.\n */ done() {\n this.B = !0;\n }\n /**\n * This function can be called to skip to that next key, which could be\n * an index or a primary key.\n */ q(t) {\n this.L = t;\n }\n /**\n * Delete the current cursor value from the object store.\n *\n * NOTE: You CANNOT do this with a keysOnly query.\n */ delete() {\n return Mt(this.$.delete());\n }\n}\n\n/** An error that wraps exceptions that thrown during IndexedDB execution. */ class xt extends Q {\n constructor(t, e) {\n super(G.UNAVAILABLE, `IndexedDB transaction '${t}' failed: ${e}`), this.name = \"IndexedDbTransactionError\";\n }\n}\n\n/** Verifies whether `e` is an IndexedDbTransactionError. */ function Nt(t) {\n // Use name equality, as instanceof checks on errors don't work with errors\n // that wrap other errors.\n return \"IndexedDbTransactionError\" === t.name;\n}\n\n/**\n * A wrapper around an IDBObjectStore providing an API that:\n *\n * 1) Has generic KeyType / ValueType parameters to provide strongly-typed\n * methods for acting against the object store.\n * 2) Deals with IndexedDB's onsuccess / onerror event callbacks, making every\n * method return a PersistencePromise instead.\n * 3) Provides a higher-level API to avoid needing to do excessive wrapping of\n * intermediate IndexedDB types (IDBCursorWithValue, etc.)\n */ class kt {\n constructor(t) {\n this.store = t;\n }\n put(t, e) {\n let n;\n return void 0 !== e ? (O(\"SimpleDb\", \"PUT\", this.store.name, t, e), n = this.store.put(e, t)) : (O(\"SimpleDb\", \"PUT\", this.store.name, \"<auto-key>\", t), \n n = this.store.put(t)), Mt(n);\n }\n /**\n * Adds a new value into an Object Store and returns the new key. Similar to\n * IndexedDb's `add()`, this method will fail on primary key collisions.\n *\n * @param value - The object to write.\n * @returns The key of the value to add.\n */ add(t) {\n O(\"SimpleDb\", \"ADD\", this.store.name, t, t);\n return Mt(this.store.add(t));\n }\n /**\n * Gets the object with the specified key from the specified store, or null\n * if no object exists with the specified key.\n *\n * @key The key of the object to get.\n * @returns The object with the specified key or null if no object exists.\n */ get(t) {\n // We're doing an unsafe cast to ValueType.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return Mt(this.store.get(t)).next((e => (\n // Normalize nonexistence to null.\n void 0 === e && (e = null), O(\"SimpleDb\", \"GET\", this.store.name, t, e), e)));\n }\n delete(t) {\n O(\"SimpleDb\", \"DELETE\", this.store.name, t);\n return Mt(this.store.delete(t));\n }\n /**\n * If we ever need more of the count variants, we can add overloads. For now,\n * all we need is to count everything in a store.\n *\n * Returns the number of rows in the store.\n */ count() {\n O(\"SimpleDb\", \"COUNT\", this.store.name);\n return Mt(this.store.count());\n }\n K(t, e) {\n const n = this.options(t, e);\n // Use `getAll()` if the browser supports IndexedDB v3, as it is roughly\n // 20% faster. Unfortunately, getAll() does not support custom indices.\n if (n.index || \"function\" != typeof this.store.getAll) {\n const t = this.cursor(n), e = [];\n return this.G(t, ((t, n) => {\n e.push(n);\n })).next((() => e));\n }\n {\n const t = this.store.getAll(n.range);\n return new Vt(((e, n) => {\n t.onerror = t => {\n n(t.target.error);\n }, t.onsuccess = t => {\n e(t.target.result);\n };\n }));\n }\n }\n /**\n * Loads the first `count` elements from the provided index range. Loads all\n * elements if no limit is provided.\n */ j(t, e) {\n const n = this.store.getAll(t, null === e ? void 0 : e);\n return new Vt(((t, e) => {\n n.onerror = t => {\n e(t.target.error);\n }, n.onsuccess = e => {\n t(e.target.result);\n };\n }));\n }\n W(t, e) {\n O(\"SimpleDb\", \"DELETE ALL\", this.store.name);\n const n = this.options(t, e);\n n.H = !1;\n const s = this.cursor(n);\n return this.G(s, ((t, e, n) => n.delete()));\n }\n J(t, e) {\n let n;\n e ? n = t : (n = {}, e = t);\n const s = this.cursor(n);\n return this.G(s, e);\n }\n /**\n * Iterates over a store, but waits for the given callback to complete for\n * each entry before iterating the next entry. This allows the callback to do\n * asynchronous work to determine if this iteration should continue.\n *\n * The provided callback should return `true` to continue iteration, and\n * `false` otherwise.\n */ Y(t) {\n const e = this.cursor({});\n return new Vt(((n, s) => {\n e.onerror = t => {\n const e = Ft(t.target.error);\n s(e);\n }, e.onsuccess = e => {\n const s = e.target.result;\n s ? t(s.primaryKey, s.value).next((t => {\n t ? s.continue() : n();\n })) : n();\n };\n }));\n }\n G(t, e) {\n const n = [];\n return new Vt(((s, i) => {\n t.onerror = t => {\n i(t.target.error);\n }, t.onsuccess = t => {\n const i = t.target.result;\n if (!i) return void s();\n const r = new Ct(i), o = e(i.primaryKey, i.value, r);\n if (o instanceof Vt) {\n const t = o.catch((t => (r.done(), Vt.reject(t))));\n n.push(t);\n }\n r.isDone ? s() : null === r.U ? i.continue() : i.continue(r.U);\n };\n })).next((() => Vt.waitFor(n)));\n }\n options(t, e) {\n let n;\n return void 0 !== t && (\"string\" == typeof t ? n = t : e = t), {\n index: n,\n range: e\n };\n }\n cursor(t) {\n let e = \"next\";\n if (t.reverse && (e = \"prev\"), t.index) {\n const n = this.store.index(t.index);\n return t.H ? n.openKeyCursor(t.range, e) : n.openCursor(t.range, e);\n }\n return this.store.openCursor(t.range, e);\n }\n}\n\n/**\n * Wraps an IDBRequest in a PersistencePromise, using the onsuccess / onerror\n * handlers to resolve / reject the PersistencePromise as appropriate.\n */ function Mt(t) {\n return new Vt(((e, n) => {\n t.onsuccess = t => {\n const n = t.target.result;\n e(n);\n }, t.onerror = t => {\n const e = Ft(t.target.error);\n n(e);\n };\n }));\n}\n\n// Guard so we only report the error once.\nlet Ot = !1;\n\nfunction Ft(t) {\n const e = Dt.v(getUA());\n if (e >= 12.2 && e < 13) {\n const e = \"An internal error was encountered in the Indexed Database server\";\n if (t.message.indexOf(e) >= 0) {\n // Wrap error in a more descriptive one.\n const t = new Q(\"internal\", `IOS_INDEXEDDB_BUG1: IndexedDb has thrown '${e}'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.`);\n return Ot || (Ot = !0, \n // Throw a global exception outside of this promise chain, for the user to\n // potentially catch.\n setTimeout((() => {\n throw t;\n }), 0)), t;\n }\n }\n return t;\n}\n\n/** This class is responsible for the scheduling of Index Backfiller. */\nclass $t {\n constructor(t, e) {\n this.asyncQueue = t, this.X = e, this.task = null;\n }\n start() {\n this.Z(15);\n }\n stop() {\n this.task && (this.task.cancel(), this.task = null);\n }\n get started() {\n return null !== this.task;\n }\n Z(t) {\n O(\"IndexBackiller\", `Scheduled in ${t}ms`), this.task = this.asyncQueue.enqueueAfterDelay(\"index_backfill\" /* IndexBackfill */ , t, (async () => {\n this.task = null;\n try {\n O(\"IndexBackiller\", `Documents written: ${await this.X.tt()}`);\n } catch (t) {\n Nt(t) ? O(\"IndexBackiller\", \"Ignoring IndexedDB error during index backfill: \", t) : await vt(t);\n }\n await this.Z(1);\n }));\n }\n}\n\n/** Implements the steps for backfilling indexes. */ class Bt {\n constructor(\n /**\n * LocalStore provides access to IndexManager and LocalDocumentView.\n * These properties will update when the user changes. Consequently,\n * making a local copy of IndexManager and LocalDocumentView will require\n * updates over time. The simpler solution is to rely on LocalStore to have\n * an up-to-date references to IndexManager and LocalDocumentStore.\n */\n t, e) {\n this.localStore = t, this.persistence = e;\n }\n async tt(t = 50) {\n return this.persistence.runTransaction(\"Backfill Indexes\", \"readwrite-primary\", (e => this.et(e, t)));\n }\n /** Writes index entries until the cap is reached. Returns the number of documents processed. */ et(t, e) {\n const n = new Set;\n let s = e, i = !0;\n return Vt.doWhile((() => !0 === i && s > 0), (() => this.localStore.indexManager.getNextCollectionGroupToUpdate(t).next((e => {\n if (null !== e && !n.has(e)) return O(\"IndexBackiller\", `Processing collection: ${e}`), \n this.nt(t, e, s).next((t => {\n s -= t, n.add(e);\n }));\n i = !1;\n })))).next((() => e - s));\n }\n /**\n * Writes entries for the provided collection group. Returns the number of documents processed.\n */ nt(t, e, n) {\n // Use the earliest offset of all field indexes to query the local cache.\n return this.localStore.indexManager.getMinOffsetFromCollectionGroup(t, e).next((s => this.localStore.localDocuments.getNextDocuments(t, e, s, n).next((n => {\n const i = n.changes;\n return this.localStore.indexManager.updateIndexEntries(t, i).next((() => this.st(s, n))).next((n => (O(\"IndexBackiller\", `Updating offset: ${n}`), \n this.localStore.indexManager.updateCollectionGroup(t, e, n)))).next((() => i.size));\n }))));\n }\n /** Returns the next offset based on the provided documents. */ st(t, e) {\n let n = t;\n return e.changes.forEach(((t, e) => {\n const s = Et(e);\n Rt(s, n) > 0 && (n = s);\n })), new At(n.readTime, n.documentKey, Math.max(e.batchId, t.largestBatchId));\n }\n}\n\n/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * `ListenSequence` is a monotonic sequence. It is initialized with a minimum value to\n * exceed. All subsequent calls to next will return increasing values. If provided with a\n * `SequenceNumberSyncer`, it will additionally bump its next value when told of a new value, as\n * well as write out sequence numbers that it produces via `next()`.\n */ class Lt {\n constructor(t, e) {\n this.previousValue = t, e && (e.sequenceNumberHandler = t => this.it(t), this.rt = t => e.writeSequenceNumber(t));\n }\n it(t) {\n return this.previousValue = Math.max(t, this.previousValue), this.previousValue;\n }\n next() {\n const t = ++this.previousValue;\n return this.rt && this.rt(t), t;\n }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nfunction Ut(t) {\n let e = 0;\n for (const n in t) Object.prototype.hasOwnProperty.call(t, n) && e++;\n return e;\n}\n\nfunction qt(t, e) {\n for (const n in t) Object.prototype.hasOwnProperty.call(t, n) && e(n, t[n]);\n}\n\nfunction Kt(t) {\n for (const e in t) if (Object.prototype.hasOwnProperty.call(t, e)) return !1;\n return !0;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// An immutable sorted map implementation, based on a Left-leaning Red-Black\n// tree.\nLt.ot = -1;\n\nclass Gt {\n constructor(t, e) {\n this.comparator = t, this.root = e || jt.EMPTY;\n }\n // Returns a copy of the map, with the specified key/value added or replaced.\n insert(t, e) {\n return new Gt(this.comparator, this.root.insert(t, e, this.comparator).copy(null, null, jt.BLACK, null, null));\n }\n // Returns a copy of the map, with the specified key removed.\n remove(t) {\n return new Gt(this.comparator, this.root.remove(t, this.comparator).copy(null, null, jt.BLACK, null, null));\n }\n // Returns the value of the node with the given key, or null.\n get(t) {\n let e = this.root;\n for (;!e.isEmpty(); ) {\n const n = this.comparator(t, e.key);\n if (0 === n) return e.value;\n n < 0 ? e = e.left : n > 0 && (e = e.right);\n }\n return null;\n }\n // Returns the index of the element in this sorted map, or -1 if it doesn't\n // exist.\n indexOf(t) {\n // Number of nodes that were pruned when descending right\n let e = 0, n = this.root;\n for (;!n.isEmpty(); ) {\n const s = this.comparator(t, n.key);\n if (0 === s) return e + n.left.size;\n s < 0 ? n = n.left : (\n // Count all nodes left of the node plus the node itself\n e += n.left.size + 1, n = n.right);\n }\n // Node not found\n return -1;\n }\n isEmpty() {\n return this.root.isEmpty();\n }\n // Returns the total number of nodes in the map.\n get size() {\n return this.root.size;\n }\n // Returns the minimum key in the map.\n minKey() {\n return this.root.minKey();\n }\n // Returns the maximum key in the map.\n maxKey() {\n return this.root.maxKey();\n }\n // Traverses the map in key order and calls the specified action function\n // for each key/value pair. If action returns true, traversal is aborted.\n // Returns the first truthy value returned by action, or the last falsey\n // value returned by action.\n inorderTraversal(t) {\n return this.root.inorderTraversal(t);\n }\n forEach(t) {\n this.inorderTraversal(((e, n) => (t(e, n), !1)));\n }\n toString() {\n const t = [];\n return this.inorderTraversal(((e, n) => (t.push(`${e}:${n}`), !1))), `{${t.join(\", \")}}`;\n }\n // Traverses the map in reverse key order and calls the specified action\n // function for each key/value pair. If action returns true, traversal is\n // aborted.\n // Returns the first truthy value returned by action, or the last falsey\n // value returned by action.\n reverseTraversal(t) {\n return this.root.reverseTraversal(t);\n }\n // Returns an iterator over the SortedMap.\n getIterator() {\n return new Qt(this.root, null, this.comparator, !1);\n }\n getIteratorFrom(t) {\n return new Qt(this.root, t, this.comparator, !1);\n }\n getReverseIterator() {\n return new Qt(this.root, null, this.comparator, !0);\n }\n getReverseIteratorFrom(t) {\n return new Qt(this.root, t, this.comparator, !0);\n }\n}\n\n // end SortedMap\n// An iterator over an LLRBNode.\nclass Qt {\n constructor(t, e, n, s) {\n this.isReverse = s, this.nodeStack = [];\n let i = 1;\n for (;!t.isEmpty(); ) if (i = e ? n(t.key, e) : 1, \n // flip the comparison if we're going in reverse\n e && s && (i *= -1), i < 0) \n // This node is less than our start key. ignore it\n t = this.isReverse ? t.left : t.right; else {\n if (0 === i) {\n // This node is exactly equal to our start key. Push it on the stack,\n // but stop iterating;\n this.nodeStack.push(t);\n break;\n }\n // This node is greater than our start key, add it to the stack and move\n // to the next one\n this.nodeStack.push(t), t = this.isReverse ? t.right : t.left;\n }\n }\n getNext() {\n let t = this.nodeStack.pop();\n const e = {\n key: t.key,\n value: t.value\n };\n if (this.isReverse) for (t = t.left; !t.isEmpty(); ) this.nodeStack.push(t), t = t.right; else for (t = t.right; !t.isEmpty(); ) this.nodeStack.push(t), \n t = t.left;\n return e;\n }\n hasNext() {\n return this.nodeStack.length > 0;\n }\n peek() {\n if (0 === this.nodeStack.length) return null;\n const t = this.nodeStack[this.nodeStack.length - 1];\n return {\n key: t.key,\n value: t.value\n };\n }\n}\n\n // end SortedMapIterator\n// Represents a node in a Left-leaning Red-Black tree.\nclass jt {\n constructor(t, e, n, s, i) {\n this.key = t, this.value = e, this.color = null != n ? n : jt.RED, this.left = null != s ? s : jt.EMPTY, \n this.right = null != i ? i : jt.EMPTY, this.size = this.left.size + 1 + this.right.size;\n }\n // Returns a copy of the current node, optionally replacing pieces of it.\n copy(t, e, n, s, i) {\n return new jt(null != t ? t : this.key, null != e ? e : this.value, null != n ? n : this.color, null != s ? s : this.left, null != i ? i : this.right);\n }\n isEmpty() {\n return !1;\n }\n // Traverses the tree in key order and calls the specified action function\n // for each node. If action returns true, traversal is aborted.\n // Returns the first truthy value returned by action, or the last falsey\n // value returned by action.\n inorderTraversal(t) {\n return this.left.inorderTraversal(t) || t(this.key, this.value) || this.right.inorderTraversal(t);\n }\n // Traverses the tree in reverse key order and calls the specified action\n // function for each node. If action returns true, traversal is aborted.\n // Returns the first truthy value returned by action, or the last falsey\n // value returned by action.\n reverseTraversal(t) {\n return this.right.reverseTraversal(t) || t(this.key, this.value) || this.left.reverseTraversal(t);\n }\n // Returns the minimum node in the tree.\n min() {\n return this.left.isEmpty() ? this : this.left.min();\n }\n // Returns the maximum key in the tree.\n minKey() {\n return this.min().key;\n }\n // Returns the maximum key in the tree.\n maxKey() {\n return this.right.isEmpty() ? this.key : this.right.maxKey();\n }\n // Returns new tree, with the key/value added.\n insert(t, e, n) {\n let s = this;\n const i = n(t, s.key);\n return s = i < 0 ? s.copy(null, null, null, s.left.insert(t, e, n), null) : 0 === i ? s.copy(null, e, null, null, null) : s.copy(null, null, null, null, s.right.insert(t, e, n)), \n s.fixUp();\n }\n removeMin() {\n if (this.left.isEmpty()) return jt.EMPTY;\n let t = this;\n return t.left.isRed() || t.left.left.isRed() || (t = t.moveRedLeft()), t = t.copy(null, null, null, t.left.removeMin(), null), \n t.fixUp();\n }\n // Returns new tree, with the specified item removed.\n remove(t, e) {\n let n, s = this;\n if (e(t, s.key) < 0) s.left.isEmpty() || s.left.isRed() || s.left.left.isRed() || (s = s.moveRedLeft()), \n s = s.copy(null, null, null, s.left.remove(t, e), null); else {\n if (s.left.isRed() && (s = s.rotateRight()), s.right.isEmpty() || s.right.isRed() || s.right.left.isRed() || (s = s.moveRedRight()), \n 0 === e(t, s.key)) {\n if (s.right.isEmpty()) return jt.EMPTY;\n n = s.right.min(), s = s.copy(n.key, n.value, null, null, s.right.removeMin());\n }\n s = s.copy(null, null, null, null, s.right.remove(t, e));\n }\n return s.fixUp();\n }\n isRed() {\n return this.color;\n }\n // Returns new tree after performing any needed rotations.\n fixUp() {\n let t = this;\n return t.right.isRed() && !t.left.isRed() && (t = t.rotateLeft()), t.left.isRed() && t.left.left.isRed() && (t = t.rotateRight()), \n t.left.isRed() && t.right.isRed() && (t = t.colorFlip()), t;\n }\n moveRedLeft() {\n let t = this.colorFlip();\n return t.right.left.isRed() && (t = t.copy(null, null, null, null, t.right.rotateRight()), \n t = t.rotateLeft(), t = t.colorFlip()), t;\n }\n moveRedRight() {\n let t = this.colorFlip();\n return t.left.left.isRed() && (t = t.rotateRight(), t = t.colorFlip()), t;\n }\n rotateLeft() {\n const t = this.copy(null, null, jt.RED, null, this.right.left);\n return this.right.copy(null, null, this.color, t, null);\n }\n rotateRight() {\n const t = this.copy(null, null, jt.RED, this.left.right, null);\n return this.left.copy(null, null, this.color, null, t);\n }\n colorFlip() {\n const t = this.left.copy(null, null, !this.left.color, null, null), e = this.right.copy(null, null, !this.right.color, null, null);\n return this.copy(null, null, !this.color, t, e);\n }\n // For testing.\n checkMaxDepth() {\n const t = this.check();\n return Math.pow(2, t) <= this.size + 1;\n }\n // In a balanced RB tree, the black-depth (number of black nodes) from root to\n // leaves is equal on both sides. This function verifies that or asserts.\n check() {\n if (this.isRed() && this.left.isRed()) throw L();\n if (this.right.isRed()) throw L();\n const t = this.left.check();\n if (t !== this.right.check()) throw L();\n return t + (this.isRed() ? 0 : 1);\n }\n}\n\n // end LLRBNode\n// Empty node is shared between all LLRB trees.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\njt.EMPTY = null, jt.RED = !0, jt.BLACK = !1;\n\n// end LLRBEmptyNode\njt.EMPTY = new \n// Represents an empty node (a leaf node in the Red-Black Tree).\nclass {\n constructor() {\n this.size = 0;\n }\n get key() {\n throw L();\n }\n get value() {\n throw L();\n }\n get color() {\n throw L();\n }\n get left() {\n throw L();\n }\n get right() {\n throw L();\n }\n // Returns a copy of the current node.\n copy(t, e, n, s, i) {\n return this;\n }\n // Returns a copy of the tree, with the specified key/value added.\n insert(t, e, n) {\n return new jt(t, e);\n }\n // Returns a copy of the tree, with the specified key removed.\n remove(t, e) {\n return this;\n }\n isEmpty() {\n return !0;\n }\n inorderTraversal(t) {\n return !1;\n }\n reverseTraversal(t) {\n return !1;\n }\n minKey() {\n return null;\n }\n maxKey() {\n return null;\n }\n isRed() {\n return !1;\n }\n // For testing.\n checkMaxDepth() {\n return !0;\n }\n check() {\n return 0;\n }\n};\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * SortedSet is an immutable (copy-on-write) collection that holds elements\n * in order specified by the provided comparator.\n *\n * NOTE: if provided comparator returns 0 for two elements, we consider them to\n * be equal!\n */\nclass Wt {\n constructor(t) {\n this.comparator = t, this.data = new Gt(this.comparator);\n }\n has(t) {\n return null !== this.data.get(t);\n }\n first() {\n return this.data.minKey();\n }\n last() {\n return this.data.maxKey();\n }\n get size() {\n return this.data.size;\n }\n indexOf(t) {\n return this.data.indexOf(t);\n }\n /** Iterates elements in order defined by \"comparator\" */ forEach(t) {\n this.data.inorderTraversal(((e, n) => (t(e), !1)));\n }\n /** Iterates over `elem`s such that: range[0] <= elem < range[1]. */ forEachInRange(t, e) {\n const n = this.data.getIteratorFrom(t[0]);\n for (;n.hasNext(); ) {\n const s = n.getNext();\n if (this.comparator(s.key, t[1]) >= 0) return;\n e(s.key);\n }\n }\n /**\n * Iterates over `elem`s such that: start <= elem until false is returned.\n */ forEachWhile(t, e) {\n let n;\n for (n = void 0 !== e ? this.data.getIteratorFrom(e) : this.data.getIterator(); n.hasNext(); ) {\n if (!t(n.getNext().key)) return;\n }\n }\n /** Finds the least element greater than or equal to `elem`. */ firstAfterOrEqual(t) {\n const e = this.data.getIteratorFrom(t);\n return e.hasNext() ? e.getNext().key : null;\n }\n getIterator() {\n return new zt(this.data.getIterator());\n }\n getIteratorFrom(t) {\n return new zt(this.data.getIteratorFrom(t));\n }\n /** Inserts or updates an element */ add(t) {\n return this.copy(this.data.remove(t).insert(t, !0));\n }\n /** Deletes an element */ delete(t) {\n return this.has(t) ? this.copy(this.data.remove(t)) : this;\n }\n isEmpty() {\n return this.data.isEmpty();\n }\n unionWith(t) {\n let e = this;\n // Make sure `result` always refers to the larger one of the two sets.\n return e.size < t.size && (e = t, t = this), t.forEach((t => {\n e = e.add(t);\n })), e;\n }\n isEqual(t) {\n if (!(t instanceof Wt)) return !1;\n if (this.size !== t.size) return !1;\n const e = this.data.getIterator(), n = t.data.getIterator();\n for (;e.hasNext(); ) {\n const t = e.getNext().key, s = n.getNext().key;\n if (0 !== this.comparator(t, s)) return !1;\n }\n return !0;\n }\n toArray() {\n const t = [];\n return this.forEach((e => {\n t.push(e);\n })), t;\n }\n toString() {\n const t = [];\n return this.forEach((e => t.push(e))), \"SortedSet(\" + t.toString() + \")\";\n }\n copy(t) {\n const e = new Wt(this.comparator);\n return e.data = t, e;\n }\n}\n\nclass zt {\n constructor(t) {\n this.iter = t;\n }\n getNext() {\n return this.iter.getNext().key;\n }\n hasNext() {\n return this.iter.hasNext();\n }\n}\n\n/**\n * Compares two sorted sets for equality using their natural ordering. The\n * method computes the intersection and invokes `onAdd` for every element that\n * is in `after` but not `before`. `onRemove` is invoked for every element in\n * `before` but missing from `after`.\n *\n * The method creates a copy of both `before` and `after` and runs in O(n log\n * n), where n is the size of the two lists.\n *\n * @param before - The elements that exist in the original set.\n * @param after - The elements to diff against the original set.\n * @param comparator - The comparator for the elements in before and after.\n * @param onAdd - A function to invoke for every element that is part of `\n * after` but not `before`.\n * @param onRemove - A function to invoke for every element that is part of\n * `before` but not `after`.\n */\n/**\n * Returns the next element from the iterator or `undefined` if none available.\n */\nfunction Ht(t) {\n return t.hasNext() ? t.getNext() : void 0;\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Provides a set of fields that can be used to partially patch a document.\n * FieldMask is used in conjunction with ObjectValue.\n * Examples:\n * foo - Overwrites foo entirely with the provided value. If foo is not\n * present in the companion ObjectValue, the field is deleted.\n * foo.bar - Overwrites only the field bar of the object foo.\n * If foo is not an object, foo is replaced with an object\n * containing foo\n */ class Jt {\n constructor(t) {\n this.fields = t, \n // TODO(dimond): validation of FieldMask\n // Sort the field mask to support `FieldMask.isEqual()` and assert below.\n t.sort(ft.comparator);\n }\n static empty() {\n return new Jt([]);\n }\n /**\n * Returns a new FieldMask object that is the result of adding all the given\n * fields paths to this field mask.\n */ unionWith(t) {\n let e = new Wt(ft.comparator);\n for (const t of this.fields) e = e.add(t);\n for (const n of t) e = e.add(n);\n return new Jt(e.toArray());\n }\n /**\n * Verifies that `fieldPath` is included by at least one field in this field\n * mask.\n *\n * This is an O(n) operation, where `n` is the size of the field mask.\n */ covers(t) {\n for (const e of this.fields) if (e.isPrefixOf(t)) return !0;\n return !1;\n }\n isEqual(t) {\n return rt(this.fields, t.fields, ((t, e) => t.isEqual(e)));\n }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** Converts a Base64 encoded string to a binary string. */\n/** True if and only if the Base64 conversion functions are available. */\nfunction Yt() {\n return \"undefined\" != typeof atob;\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Immutable class that represents a \"proto\" byte string.\n *\n * Proto byte strings can either be Base64-encoded strings or Uint8Arrays when\n * sent on the wire. This class abstracts away this differentiation by holding\n * the proto byte string in a common class that must be converted into a string\n * before being sent as a proto.\n * @internal\n */ class Xt {\n constructor(t) {\n this.binaryString = t;\n }\n static fromBase64String(t) {\n const e = atob(t);\n return new Xt(e);\n }\n static fromUint8Array(t) {\n // TODO(indexing); Remove the copy of the byte string here as this method\n // is frequently called during indexing.\n const e = \n /**\n * Helper function to convert an Uint8array to a binary string.\n */\n function(t) {\n let e = \"\";\n for (let n = 0; n < t.length; ++n) e += String.fromCharCode(t[n]);\n return e;\n }\n /**\n * Helper function to convert a binary string to an Uint8Array.\n */ (t);\n return new Xt(e);\n }\n [Symbol.iterator]() {\n let t = 0;\n return {\n next: () => t < this.binaryString.length ? {\n value: this.binaryString.charCodeAt(t++),\n done: !1\n } : {\n value: void 0,\n done: !0\n }\n };\n }\n toBase64() {\n return t = this.binaryString, btoa(t);\n /** Converts a binary string to a Base64 encoded string. */\n var t;\n }\n toUint8Array() {\n return function(t) {\n const e = new Uint8Array(t.length);\n for (let n = 0; n < t.length; n++) e[n] = t.charCodeAt(n);\n return e;\n }\n /**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n // A RegExp matching ISO 8601 UTC timestamps with optional fraction.\n (this.binaryString);\n }\n approximateByteSize() {\n return 2 * this.binaryString.length;\n }\n compareTo(t) {\n return it(this.binaryString, t.binaryString);\n }\n isEqual(t) {\n return this.binaryString === t.binaryString;\n }\n}\n\nXt.EMPTY_BYTE_STRING = new Xt(\"\");\n\nconst Zt = new RegExp(/^\\d{4}-\\d\\d-\\d\\dT\\d\\d:\\d\\d:\\d\\d(?:\\.(\\d+))?Z$/);\n\n/**\n * Converts the possible Proto values for a timestamp value into a \"seconds and\n * nanos\" representation.\n */ function te(t) {\n // The json interface (for the browser) will return an iso timestamp string,\n // while the proto js library (for node) will return a\n // google.protobuf.Timestamp instance.\n if (U(!!t), \"string\" == typeof t) {\n // The date string can have higher precision (nanos) than the Date class\n // (millis), so we do some custom parsing here.\n // Parse the nanos right out of the string.\n let e = 0;\n const n = Zt.exec(t);\n if (U(!!n), n[1]) {\n // Pad the fraction out to 9 digits (nanos).\n let t = n[1];\n t = (t + \"000000000\").substr(0, 9), e = Number(t);\n }\n // Parse the date to get the seconds.\n const s = new Date(t);\n return {\n seconds: Math.floor(s.getTime() / 1e3),\n nanos: e\n };\n }\n return {\n seconds: ee(t.seconds),\n nanos: ee(t.nanos)\n };\n}\n\n/**\n * Converts the possible Proto types for numbers into a JavaScript number.\n * Returns 0 if the value is not numeric.\n */ function ee(t) {\n // TODO(bjornick): Handle int64 greater than 53 bits.\n return \"number\" == typeof t ? t : \"string\" == typeof t ? Number(t) : 0;\n}\n\n/** Converts the possible Proto types for Blobs into a ByteString. */ function ne(t) {\n return \"string\" == typeof t ? Xt.fromBase64String(t) : Xt.fromUint8Array(t);\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Represents a locally-applied ServerTimestamp.\n *\n * Server Timestamps are backed by MapValues that contain an internal field\n * `__type__` with a value of `server_timestamp`. The previous value and local\n * write time are stored in its `__previous_value__` and `__local_write_time__`\n * fields respectively.\n *\n * Notes:\n * - ServerTimestampValue instances are created as the result of applying a\n * transform. They can only exist in the local view of a document. Therefore\n * they do not need to be parsed or serialized.\n * - When evaluated locally (e.g. for snapshot.data()), they by default\n * evaluate to `null`. This behavior can be configured by passing custom\n * FieldValueOptions to value().\n * - With respect to other ServerTimestampValues, they sort by their\n * localWriteTime.\n */ function se(t) {\n var e, n;\n return \"server_timestamp\" === (null === (n = ((null === (e = null == t ? void 0 : t.mapValue) || void 0 === e ? void 0 : e.fields) || {}).__type__) || void 0 === n ? void 0 : n.stringValue);\n}\n\n/**\n * Creates a new ServerTimestamp proto value (using the internal format).\n */\n/**\n * Returns the value of the field before this ServerTimestamp was set.\n *\n * Preserving the previous values allows the user to display the last resoled\n * value until the backend responds with the timestamp.\n */\nfunction ie(t) {\n const e = t.mapValue.fields.__previous_value__;\n return se(e) ? ie(e) : e;\n}\n\n/**\n * Returns the local time at which this timestamp was first set.\n */ function re(t) {\n const e = te(t.mapValue.fields.__local_write_time__.timestampValue);\n return new ut(e.seconds, e.nanos);\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ class oe {\n /**\n * Constructs a DatabaseInfo using the provided host, databaseId and\n * persistenceKey.\n *\n * @param databaseId - The database to use.\n * @param appId - The Firebase App Id.\n * @param persistenceKey - A unique identifier for this Firestore's local\n * storage (used in conjunction with the databaseId).\n * @param host - The Firestore backend host to connect to.\n * @param ssl - Whether to use SSL when connecting.\n * @param forceLongPolling - Whether to use the forceLongPolling option\n * when using WebChannel as the network transport.\n * @param autoDetectLongPolling - Whether to use the detectBufferingProxy\n * option when using WebChannel as the network transport.\n * @param useFetchStreams Whether to use the Fetch API instead of\n * XMLHTTPRequest\n */\n constructor(t, e, n, s, i, r, o, u) {\n this.databaseId = t, this.appId = e, this.persistenceKey = n, this.host = s, this.ssl = i, \n this.forceLongPolling = r, this.autoDetectLongPolling = o, this.useFetchStreams = u;\n }\n}\n\n/** The default database name for a project. */\n/**\n * Represents the database ID a Firestore client is associated with.\n * @internal\n */\nclass ue {\n constructor(t, e) {\n this.projectId = t, this.database = e || \"(default)\";\n }\n static empty() {\n return new ue(\"\", \"\");\n }\n get isDefaultDatabase() {\n return \"(default)\" === this.database;\n }\n isEqual(t) {\n return t instanceof ue && t.projectId === this.projectId && t.database === this.database;\n }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** Sentinel value that sorts before any Mutation Batch ID. */\n/**\n * Returns whether a variable is either undefined or null.\n */\nfunction ce(t) {\n return null == t;\n}\n\n/** Returns whether the value represents -0. */ function ae(t) {\n // Detect if the value is -0.0. Based on polyfill from\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n return 0 === t && 1 / t == -1 / 0;\n}\n\n/**\n * Returns whether a value is an integer and in the safe integer range\n * @param value - The value to test for being an integer and in the safe range\n */ function he(t) {\n return \"number\" == typeof t && Number.isInteger(t) && !ae(t) && t <= Number.MAX_SAFE_INTEGER && t >= Number.MIN_SAFE_INTEGER;\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ const le = {\n mapValue: {\n fields: {\n __type__: {\n stringValue: \"__max__\"\n }\n }\n }\n}, fe = {\n nullValue: \"NULL_VALUE\"\n};\n\n/** Extracts the backend's type order for the provided value. */\nfunction de(t) {\n return \"nullValue\" in t ? 0 /* NullValue */ : \"booleanValue\" in t ? 1 /* BooleanValue */ : \"integerValue\" in t || \"doubleValue\" in t ? 2 /* NumberValue */ : \"timestampValue\" in t ? 3 /* TimestampValue */ : \"stringValue\" in t ? 5 /* StringValue */ : \"bytesValue\" in t ? 6 /* BlobValue */ : \"referenceValue\" in t ? 7 /* RefValue */ : \"geoPointValue\" in t ? 8 /* GeoPointValue */ : \"arrayValue\" in t ? 9 /* ArrayValue */ : \"mapValue\" in t ? se(t) ? 4 /* ServerTimestampValue */ : ve(t) ? 9007199254740991 /* MaxValue */ : 10 /* ObjectValue */ : L();\n}\n\n/** Tests `left` and `right` for equality based on the backend semantics. */ function _e(t, e) {\n if (t === e) return !0;\n const n = de(t);\n if (n !== de(e)) return !1;\n switch (n) {\n case 0 /* NullValue */ :\n case 9007199254740991 /* MaxValue */ :\n return !0;\n\n case 1 /* BooleanValue */ :\n return t.booleanValue === e.booleanValue;\n\n case 4 /* ServerTimestampValue */ :\n return re(t).isEqual(re(e));\n\n case 3 /* TimestampValue */ :\n return function(t, e) {\n if (\"string\" == typeof t.timestampValue && \"string\" == typeof e.timestampValue && t.timestampValue.length === e.timestampValue.length) \n // Use string equality for ISO 8601 timestamps\n return t.timestampValue === e.timestampValue;\n const n = te(t.timestampValue), s = te(e.timestampValue);\n return n.seconds === s.seconds && n.nanos === s.nanos;\n }(t, e);\n\n case 5 /* StringValue */ :\n return t.stringValue === e.stringValue;\n\n case 6 /* BlobValue */ :\n return function(t, e) {\n return ne(t.bytesValue).isEqual(ne(e.bytesValue));\n }(t, e);\n\n case 7 /* RefValue */ :\n return t.referenceValue === e.referenceValue;\n\n case 8 /* GeoPointValue */ :\n return function(t, e) {\n return ee(t.geoPointValue.latitude) === ee(e.geoPointValue.latitude) && ee(t.geoPointValue.longitude) === ee(e.geoPointValue.longitude);\n }(t, e);\n\n case 2 /* NumberValue */ :\n return function(t, e) {\n if (\"integerValue\" in t && \"integerValue\" in e) return ee(t.integerValue) === ee(e.integerValue);\n if (\"doubleValue\" in t && \"doubleValue\" in e) {\n const n = ee(t.doubleValue), s = ee(e.doubleValue);\n return n === s ? ae(n) === ae(s) : isNaN(n) && isNaN(s);\n }\n return !1;\n }(t, e);\n\n case 9 /* ArrayValue */ :\n return rt(t.arrayValue.values || [], e.arrayValue.values || [], _e);\n\n case 10 /* ObjectValue */ :\n return function(t, e) {\n const n = t.mapValue.fields || {}, s = e.mapValue.fields || {};\n if (Ut(n) !== Ut(s)) return !1;\n for (const t in n) if (n.hasOwnProperty(t) && (void 0 === s[t] || !_e(n[t], s[t]))) return !1;\n return !0;\n }\n /** Returns true if the ArrayValue contains the specified element. */ (t, e);\n\n default:\n return L();\n }\n}\n\nfunction we(t, e) {\n return void 0 !== (t.values || []).find((t => _e(t, e)));\n}\n\nfunction me(t, e) {\n if (t === e) return 0;\n const n = de(t), s = de(e);\n if (n !== s) return it(n, s);\n switch (n) {\n case 0 /* NullValue */ :\n case 9007199254740991 /* MaxValue */ :\n return 0;\n\n case 1 /* BooleanValue */ :\n return it(t.booleanValue, e.booleanValue);\n\n case 2 /* NumberValue */ :\n return function(t, e) {\n const n = ee(t.integerValue || t.doubleValue), s = ee(e.integerValue || e.doubleValue);\n return n < s ? -1 : n > s ? 1 : n === s ? 0 : \n // one or both are NaN.\n isNaN(n) ? isNaN(s) ? 0 : -1 : 1;\n }(t, e);\n\n case 3 /* TimestampValue */ :\n return ge(t.timestampValue, e.timestampValue);\n\n case 4 /* ServerTimestampValue */ :\n return ge(re(t), re(e));\n\n case 5 /* StringValue */ :\n return it(t.stringValue, e.stringValue);\n\n case 6 /* BlobValue */ :\n return function(t, e) {\n const n = ne(t), s = ne(e);\n return n.compareTo(s);\n }(t.bytesValue, e.bytesValue);\n\n case 7 /* RefValue */ :\n return function(t, e) {\n const n = t.split(\"/\"), s = e.split(\"/\");\n for (let t = 0; t < n.length && t < s.length; t++) {\n const e = it(n[t], s[t]);\n if (0 !== e) return e;\n }\n return it(n.length, s.length);\n }(t.referenceValue, e.referenceValue);\n\n case 8 /* GeoPointValue */ :\n return function(t, e) {\n const n = it(ee(t.latitude), ee(e.latitude));\n if (0 !== n) return n;\n return it(ee(t.longitude), ee(e.longitude));\n }(t.geoPointValue, e.geoPointValue);\n\n case 9 /* ArrayValue */ :\n return function(t, e) {\n const n = t.values || [], s = e.values || [];\n for (let t = 0; t < n.length && t < s.length; ++t) {\n const e = me(n[t], s[t]);\n if (e) return e;\n }\n return it(n.length, s.length);\n }(t.arrayValue, e.arrayValue);\n\n case 10 /* ObjectValue */ :\n return function(t, e) {\n if (t === le.mapValue && e === le.mapValue) return 0;\n if (t === le.mapValue) return 1;\n if (e === le.mapValue) return -1;\n const n = t.fields || {}, s = Object.keys(n), i = e.fields || {}, r = Object.keys(i);\n // Even though MapValues are likely sorted correctly based on their insertion\n // order (e.g. when received from the backend), local modifications can bring\n // elements out of order. We need to re-sort the elements to ensure that\n // canonical IDs are independent of insertion order.\n s.sort(), r.sort();\n for (let t = 0; t < s.length && t < r.length; ++t) {\n const e = it(s[t], r[t]);\n if (0 !== e) return e;\n const o = me(n[s[t]], i[r[t]]);\n if (0 !== o) return o;\n }\n return it(s.length, r.length);\n }\n /**\n * Generates the canonical ID for the provided field value (as used in Target\n * serialization).\n */ (t.mapValue, e.mapValue);\n\n default:\n throw L();\n }\n}\n\nfunction ge(t, e) {\n if (\"string\" == typeof t && \"string\" == typeof e && t.length === e.length) return it(t, e);\n const n = te(t), s = te(e), i = it(n.seconds, s.seconds);\n return 0 !== i ? i : it(n.nanos, s.nanos);\n}\n\nfunction ye(t) {\n return pe(t);\n}\n\nfunction pe(t) {\n return \"nullValue\" in t ? \"null\" : \"booleanValue\" in t ? \"\" + t.booleanValue : \"integerValue\" in t ? \"\" + t.integerValue : \"doubleValue\" in t ? \"\" + t.doubleValue : \"timestampValue\" in t ? function(t) {\n const e = te(t);\n return `time(${e.seconds},${e.nanos})`;\n }(t.timestampValue) : \"stringValue\" in t ? t.stringValue : \"bytesValue\" in t ? ne(t.bytesValue).toBase64() : \"referenceValue\" in t ? (n = t.referenceValue, \n dt.fromName(n).toString()) : \"geoPointValue\" in t ? `geo(${(e = t.geoPointValue).latitude},${e.longitude})` : \"arrayValue\" in t ? function(t) {\n let e = \"[\", n = !0;\n for (const s of t.values || []) n ? n = !1 : e += \",\", e += pe(s);\n return e + \"]\";\n }\n /** Returns a reference value for the provided database and key. */ (t.arrayValue) : \"mapValue\" in t ? function(t) {\n // Iteration order in JavaScript is not guaranteed. To ensure that we generate\n // matching canonical IDs for identical maps, we need to sort the keys.\n const e = Object.keys(t.fields || {}).sort();\n let n = \"{\", s = !0;\n for (const i of e) s ? s = !1 : n += \",\", n += `${i}:${pe(t.fields[i])}`;\n return n + \"}\";\n }(t.mapValue) : L();\n var e, n;\n}\n\nfunction Ie(t, e) {\n return {\n referenceValue: `projects/${t.projectId}/databases/${t.database}/documents/${e.path.canonicalString()}`\n };\n}\n\n/** Returns true if `value` is an IntegerValue . */ function Te(t) {\n return !!t && \"integerValue\" in t;\n}\n\n/** Returns true if `value` is a DoubleValue. */\n/** Returns true if `value` is an ArrayValue. */\nfunction Ee(t) {\n return !!t && \"arrayValue\" in t;\n}\n\n/** Returns true if `value` is a NullValue. */ function Ae(t) {\n return !!t && \"nullValue\" in t;\n}\n\n/** Returns true if `value` is NaN. */ function Re(t) {\n return !!t && \"doubleValue\" in t && isNaN(Number(t.doubleValue));\n}\n\n/** Returns true if `value` is a MapValue. */ function be(t) {\n return !!t && \"mapValue\" in t;\n}\n\n/** Creates a deep copy of `source`. */ function Pe(t) {\n if (t.geoPointValue) return {\n geoPointValue: Object.assign({}, t.geoPointValue)\n };\n if (t.timestampValue && \"object\" == typeof t.timestampValue) return {\n timestampValue: Object.assign({}, t.timestampValue)\n };\n if (t.mapValue) {\n const e = {\n mapValue: {\n fields: {}\n }\n };\n return qt(t.mapValue.fields, ((t, n) => e.mapValue.fields[t] = Pe(n))), e;\n }\n if (t.arrayValue) {\n const e = {\n arrayValue: {\n values: []\n }\n };\n for (let n = 0; n < (t.arrayValue.values || []).length; ++n) e.arrayValue.values[n] = Pe(t.arrayValue.values[n]);\n return e;\n }\n return Object.assign({}, t);\n}\n\n/** Returns true if the Value represents the canonical {@link #MAX_VALUE} . */ function ve(t) {\n return \"__max__\" === (((t.mapValue || {}).fields || {}).__type__ || {}).stringValue;\n}\n\n/** Returns the lowest value for the given value type (inclusive). */ function Ve(t) {\n return \"nullValue\" in t ? fe : \"booleanValue\" in t ? {\n booleanValue: !1\n } : \"integerValue\" in t || \"doubleValue\" in t ? {\n doubleValue: NaN\n } : \"timestampValue\" in t ? {\n timestampValue: {\n seconds: Number.MIN_SAFE_INTEGER\n }\n } : \"stringValue\" in t ? {\n stringValue: \"\"\n } : \"bytesValue\" in t ? {\n bytesValue: \"\"\n } : \"referenceValue\" in t ? Ie(ue.empty(), dt.empty()) : \"geoPointValue\" in t ? {\n geoPointValue: {\n latitude: -90,\n longitude: -180\n }\n } : \"arrayValue\" in t ? {\n arrayValue: {}\n } : \"mapValue\" in t ? {\n mapValue: {}\n } : L();\n}\n\n/** Returns the largest value for the given value type (exclusive). */ function Se(t) {\n return \"nullValue\" in t ? {\n booleanValue: !1\n } : \"booleanValue\" in t ? {\n doubleValue: NaN\n } : \"integerValue\" in t || \"doubleValue\" in t ? {\n timestampValue: {\n seconds: Number.MIN_SAFE_INTEGER\n }\n } : \"timestampValue\" in t ? {\n stringValue: \"\"\n } : \"stringValue\" in t ? {\n bytesValue: \"\"\n } : \"bytesValue\" in t ? Ie(ue.empty(), dt.empty()) : \"referenceValue\" in t ? {\n geoPointValue: {\n latitude: -90,\n longitude: -180\n }\n } : \"geoPointValue\" in t ? {\n arrayValue: {}\n } : \"arrayValue\" in t ? {\n mapValue: {}\n } : \"mapValue\" in t ? le : L();\n}\n\nfunction De(t, e) {\n const n = me(t.value, e.value);\n return 0 !== n ? n : t.inclusive && !e.inclusive ? -1 : !t.inclusive && e.inclusive ? 1 : 0;\n}\n\nfunction Ce(t, e) {\n const n = me(t.value, e.value);\n return 0 !== n ? n : t.inclusive && !e.inclusive ? 1 : !t.inclusive && e.inclusive ? -1 : 0;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * An ObjectValue represents a MapValue in the Firestore Proto and offers the\n * ability to add and remove fields (via the ObjectValueBuilder).\n */ class xe {\n constructor(t) {\n this.value = t;\n }\n static empty() {\n return new xe({\n mapValue: {}\n });\n }\n /**\n * Returns the value at the given path or null.\n *\n * @param path - the path to search\n * @returns The value at the path or null if the path is not set.\n */ field(t) {\n if (t.isEmpty()) return this.value;\n {\n let e = this.value;\n for (let n = 0; n < t.length - 1; ++n) if (e = (e.mapValue.fields || {})[t.get(n)], \n !be(e)) return null;\n return e = (e.mapValue.fields || {})[t.lastSegment()], e || null;\n }\n }\n /**\n * Sets the field to the provided value.\n *\n * @param path - The field path to set.\n * @param value - The value to set.\n */ set(t, e) {\n this.getFieldsMap(t.popLast())[t.lastSegment()] = Pe(e);\n }\n /**\n * Sets the provided fields to the provided values.\n *\n * @param data - A map of fields to values (or null for deletes).\n */ setAll(t) {\n let e = ft.emptyPath(), n = {}, s = [];\n t.forEach(((t, i) => {\n if (!e.isImmediateParentOf(i)) {\n // Insert the accumulated changes at this parent location\n const t = this.getFieldsMap(e);\n this.applyChanges(t, n, s), n = {}, s = [], e = i.popLast();\n }\n t ? n[i.lastSegment()] = Pe(t) : s.push(i.lastSegment());\n }));\n const i = this.getFieldsMap(e);\n this.applyChanges(i, n, s);\n }\n /**\n * Removes the field at the specified path. If there is no field at the\n * specified path, nothing is changed.\n *\n * @param path - The field path to remove.\n */ delete(t) {\n const e = this.field(t.popLast());\n be(e) && e.mapValue.fields && delete e.mapValue.fields[t.lastSegment()];\n }\n isEqual(t) {\n return _e(this.value, t.value);\n }\n /**\n * Returns the map that contains the leaf element of `path`. If the parent\n * entry does not yet exist, or if it is not a map, a new map will be created.\n */ getFieldsMap(t) {\n let e = this.value;\n e.mapValue.fields || (e.mapValue = {\n fields: {}\n });\n for (let n = 0; n < t.length; ++n) {\n let s = e.mapValue.fields[t.get(n)];\n be(s) && s.mapValue.fields || (s = {\n mapValue: {\n fields: {}\n }\n }, e.mapValue.fields[t.get(n)] = s), e = s;\n }\n return e.mapValue.fields;\n }\n /**\n * Modifies `fieldsMap` by adding, replacing or deleting the specified\n * entries.\n */ applyChanges(t, e, n) {\n qt(e, ((e, n) => t[e] = n));\n for (const e of n) delete t[e];\n }\n clone() {\n return new xe(Pe(this.value));\n }\n}\n\n/**\n * Returns a FieldMask built from all fields in a MapValue.\n */ function Ne(t) {\n const e = [];\n return qt(t.fields, ((t, n) => {\n const s = new ft([ t ]);\n if (be(n)) {\n const t = Ne(n.mapValue).fields;\n if (0 === t.length) \n // Preserve the empty map by adding it to the FieldMask.\n e.push(s); else \n // For nested and non-empty ObjectValues, add the FieldPath of the\n // leaf nodes.\n for (const n of t) e.push(s.child(n));\n } else \n // For nested and non-empty ObjectValues, add the FieldPath of the leaf\n // nodes.\n e.push(s);\n })), new Jt(e);\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Represents a document in Firestore with a key, version, data and whether it\n * has local mutations applied to it.\n *\n * Documents can transition between states via `convertToFoundDocument()`,\n * `convertToNoDocument()` and `convertToUnknownDocument()`. If a document does\n * not transition to one of these states even after all mutations have been\n * applied, `isValidDocument()` returns false and the document should be removed\n * from all views.\n */ class ke {\n constructor(t, e, n, s, i, r) {\n this.key = t, this.documentType = e, this.version = n, this.readTime = s, this.data = i, \n this.documentState = r;\n }\n /**\n * Creates a document with no known version or data, but which can serve as\n * base document for mutations.\n */ static newInvalidDocument(t) {\n return new ke(t, 0 /* INVALID */ , ct.min(), ct.min(), xe.empty(), 0 /* SYNCED */);\n }\n /**\n * Creates a new document that is known to exist with the given data at the\n * given version.\n */ static newFoundDocument(t, e, n) {\n return new ke(t, 1 /* FOUND_DOCUMENT */ , e, ct.min(), n, 0 /* SYNCED */);\n }\n /** Creates a new document that is known to not exist at the given version. */ static newNoDocument(t, e) {\n return new ke(t, 2 /* NO_DOCUMENT */ , e, ct.min(), xe.empty(), 0 /* SYNCED */);\n }\n /**\n * Creates a new document that is known to exist at the given version but\n * whose data is not known (e.g. a document that was updated without a known\n * base document).\n */ static newUnknownDocument(t, e) {\n return new ke(t, 3 /* UNKNOWN_DOCUMENT */ , e, ct.min(), xe.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);\n }\n /**\n * Changes the document type to indicate that it exists and that its version\n * and data are known.\n */ convertToFoundDocument(t, e) {\n return this.version = t, this.documentType = 1 /* FOUND_DOCUMENT */ , this.data = e, \n this.documentState = 0 /* SYNCED */ , this;\n }\n /**\n * Changes the document type to indicate that it doesn't exist at the given\n * version.\n */ convertToNoDocument(t) {\n return this.version = t, this.documentType = 2 /* NO_DOCUMENT */ , this.data = xe.empty(), \n this.documentState = 0 /* SYNCED */ , this;\n }\n /**\n * Changes the document type to indicate that it exists at a given version but\n * that its data is not known (e.g. a document that was updated without a known\n * base document).\n */ convertToUnknownDocument(t) {\n return this.version = t, this.documentType = 3 /* UNKNOWN_DOCUMENT */ , this.data = xe.empty(), \n this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;\n }\n setHasCommittedMutations() {\n return this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;\n }\n setHasLocalMutations() {\n return this.documentState = 1 /* HAS_LOCAL_MUTATIONS */ , this.version = ct.min(), \n this;\n }\n setReadTime(t) {\n return this.readTime = t, this;\n }\n get hasLocalMutations() {\n return 1 /* HAS_LOCAL_MUTATIONS */ === this.documentState;\n }\n get hasCommittedMutations() {\n return 2 /* HAS_COMMITTED_MUTATIONS */ === this.documentState;\n }\n get hasPendingWrites() {\n return this.hasLocalMutations || this.hasCommittedMutations;\n }\n isValidDocument() {\n return 0 /* INVALID */ !== this.documentType;\n }\n isFoundDocument() {\n return 1 /* FOUND_DOCUMENT */ === this.documentType;\n }\n isNoDocument() {\n return 2 /* NO_DOCUMENT */ === this.documentType;\n }\n isUnknownDocument() {\n return 3 /* UNKNOWN_DOCUMENT */ === this.documentType;\n }\n isEqual(t) {\n return t instanceof ke && this.key.isEqual(t.key) && this.version.isEqual(t.version) && this.documentType === t.documentType && this.documentState === t.documentState && this.data.isEqual(t.data);\n }\n mutableCopy() {\n return new ke(this.key, this.documentType, this.version, this.readTime, this.data.clone(), this.documentState);\n }\n toString() {\n return `Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`;\n }\n}\n\n/**\n * Compares the value for field `field` in the provided documents. Throws if\n * the field does not exist in both documents.\n */\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// Visible for testing\nclass Me {\n constructor(t, e = null, n = [], s = [], i = null, r = null, o = null) {\n this.path = t, this.collectionGroup = e, this.orderBy = n, this.filters = s, this.limit = i, \n this.startAt = r, this.endAt = o, this.ut = null;\n }\n}\n\n/**\n * Initializes a Target with a path and optional additional query constraints.\n * Path must currently be empty if this is a collection group query.\n *\n * NOTE: you should always construct `Target` from `Query.toTarget` instead of\n * using this factory method, because `Query` provides an implicit `orderBy`\n * property.\n */ function Oe(t, e = null, n = [], s = [], i = null, r = null, o = null) {\n return new Me(t, e, n, s, i, r, o);\n}\n\nfunction Fe(t) {\n const e = K(t);\n if (null === e.ut) {\n let t = e.path.canonicalString();\n null !== e.collectionGroup && (t += \"|cg:\" + e.collectionGroup), t += \"|f:\", t += e.filters.map((t => {\n return (e = t).field.canonicalString() + e.op.toString() + ye(e.value);\n var e;\n })).join(\",\"), t += \"|ob:\", t += e.orderBy.map((t => function(t) {\n // TODO(b/29183165): Make this collision robust.\n return t.field.canonicalString() + t.dir;\n }(t))).join(\",\"), ce(e.limit) || (t += \"|l:\", t += e.limit), e.startAt && (t += \"|lb:\", \n t += e.startAt.inclusive ? \"b:\" : \"a:\", t += e.startAt.position.map((t => ye(t))).join(\",\")), \n e.endAt && (t += \"|ub:\", t += e.endAt.inclusive ? \"a:\" : \"b:\", t += e.endAt.position.map((t => ye(t))).join(\",\")), \n e.ut = t;\n }\n return e.ut;\n}\n\nfunction $e(t) {\n let e = t.path.canonicalString();\n return null !== t.collectionGroup && (e += \" collectionGroup=\" + t.collectionGroup), \n t.filters.length > 0 && (e += `, filters: [${t.filters.map((t => {\n return `${(e = t).field.canonicalString()} ${e.op} ${ye(e.value)}`;\n /** Returns a debug description for `filter`. */\n var e;\n /** Filter that matches on key fields (i.e. '__name__'). */ })).join(\", \")}]`), \n ce(t.limit) || (e += \", limit: \" + t.limit), t.orderBy.length > 0 && (e += `, orderBy: [${t.orderBy.map((t => function(t) {\n return `${t.field.canonicalString()} (${t.dir})`;\n }(t))).join(\", \")}]`), t.startAt && (e += \", startAt: \", e += t.startAt.inclusive ? \"b:\" : \"a:\", \n e += t.startAt.position.map((t => ye(t))).join(\",\")), t.endAt && (e += \", endAt: \", \n e += t.endAt.inclusive ? \"a:\" : \"b:\", e += t.endAt.position.map((t => ye(t))).join(\",\")), \n `Target(${e})`;\n}\n\nfunction Be(t, e) {\n if (t.limit !== e.limit) return !1;\n if (t.orderBy.length !== e.orderBy.length) return !1;\n for (let n = 0; n < t.orderBy.length; n++) if (!en(t.orderBy[n], e.orderBy[n])) return !1;\n if (t.filters.length !== e.filters.length) return !1;\n for (let i = 0; i < t.filters.length; i++) if (n = t.filters[i], s = e.filters[i], \n n.op !== s.op || !n.field.isEqual(s.field) || !_e(n.value, s.value)) return !1;\n var n, s;\n return t.collectionGroup === e.collectionGroup && (!!t.path.isEqual(e.path) && (!!sn(t.startAt, e.startAt) && sn(t.endAt, e.endAt)));\n}\n\nfunction Le(t) {\n return dt.isDocumentKey(t.path) && null === t.collectionGroup && 0 === t.filters.length;\n}\n\n/** Returns the field filters that target the given field path. */ function Ue(t, e) {\n return t.filters.filter((t => t instanceof Ge && t.field.isEqual(e)));\n}\n\n/**\n * Returns the values that are used in ARRAY_CONTAINS or ARRAY_CONTAINS_ANY\n * filters. Returns `null` if there are no such filters.\n */\n/**\n * Returns the value to use as the lower bound for ascending index segment at\n * the provided `fieldPath` (or the upper bound for an descending segment).\n */\nfunction qe(t, e, n) {\n let s = fe, i = !0;\n // Process all filters to find a value for the current field segment\n for (const n of Ue(t, e)) {\n let t = fe, e = !0;\n switch (n.op) {\n case \"<\" /* LESS_THAN */ :\n case \"<=\" /* LESS_THAN_OR_EQUAL */ :\n t = Ve(n.value);\n break;\n\n case \"==\" /* EQUAL */ :\n case \"in\" /* IN */ :\n case \">=\" /* GREATER_THAN_OR_EQUAL */ :\n t = n.value;\n break;\n\n case \">\" /* GREATER_THAN */ :\n t = n.value, e = !1;\n break;\n\n case \"!=\" /* NOT_EQUAL */ :\n case \"not-in\" /* NOT_IN */ :\n t = fe;\n // Remaining filters cannot be used as lower bounds.\n }\n De({\n value: s,\n inclusive: i\n }, {\n value: t,\n inclusive: e\n }) < 0 && (s = t, i = e);\n }\n // If there is an additional bound, compare the values against the existing\n // range to see if we can narrow the scope.\n if (null !== n) for (let r = 0; r < t.orderBy.length; ++r) {\n if (t.orderBy[r].field.isEqual(e)) {\n const t = n.position[r];\n De({\n value: s,\n inclusive: i\n }, {\n value: t,\n inclusive: n.inclusive\n }) < 0 && (s = t, i = n.inclusive);\n break;\n }\n }\n return {\n value: s,\n inclusive: i\n };\n}\n\n/**\n * Returns the value to use as the upper bound for ascending index segment at\n * the provided `fieldPath` (or the lower bound for a descending segment).\n */ function Ke(t, e, n) {\n let s = le, i = !0;\n // Process all filters to find a value for the current field segment\n for (const n of Ue(t, e)) {\n let t = le, e = !0;\n switch (n.op) {\n case \">=\" /* GREATER_THAN_OR_EQUAL */ :\n case \">\" /* GREATER_THAN */ :\n t = Se(n.value), e = !1;\n break;\n\n case \"==\" /* EQUAL */ :\n case \"in\" /* IN */ :\n case \"<=\" /* LESS_THAN_OR_EQUAL */ :\n t = n.value;\n break;\n\n case \"<\" /* LESS_THAN */ :\n t = n.value, e = !1;\n break;\n\n case \"!=\" /* NOT_EQUAL */ :\n case \"not-in\" /* NOT_IN */ :\n t = le;\n // Remaining filters cannot be used as upper bounds.\n }\n Ce({\n value: s,\n inclusive: i\n }, {\n value: t,\n inclusive: e\n }) > 0 && (s = t, i = e);\n }\n // If there is an additional bound, compare the values against the existing\n // range to see if we can narrow the scope.\n if (null !== n) for (let r = 0; r < t.orderBy.length; ++r) {\n if (t.orderBy[r].field.isEqual(e)) {\n const t = n.position[r];\n Ce({\n value: s,\n inclusive: i\n }, {\n value: t,\n inclusive: n.inclusive\n }) > 0 && (s = t, i = n.inclusive);\n break;\n }\n }\n return {\n value: s,\n inclusive: i\n };\n}\n\n/** Returns the number of segments of a perfect index for this target. */ class Ge extends class {} {\n constructor(t, e, n) {\n super(), this.field = t, this.op = e, this.value = n;\n }\n /**\n * Creates a filter based on the provided arguments.\n */ static create(t, e, n) {\n return t.isKeyField() ? \"in\" /* IN */ === e || \"not-in\" /* NOT_IN */ === e ? this.ct(t, e, n) : new Qe(t, e, n) : \"array-contains\" /* ARRAY_CONTAINS */ === e ? new He(t, n) : \"in\" /* IN */ === e ? new Je(t, n) : \"not-in\" /* NOT_IN */ === e ? new Ye(t, n) : \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ === e ? new Xe(t, n) : new Ge(t, e, n);\n }\n static ct(t, e, n) {\n return \"in\" /* IN */ === e ? new je(t, n) : new We(t, n);\n }\n matches(t) {\n const e = t.data.field(this.field);\n // Types do not have to match in NOT_EQUAL filters.\n return \"!=\" /* NOT_EQUAL */ === this.op ? null !== e && this.at(me(e, this.value)) : null !== e && de(this.value) === de(e) && this.at(me(e, this.value));\n // Only compare types with matching backend order (such as double and int).\n }\n at(t) {\n switch (this.op) {\n case \"<\" /* LESS_THAN */ :\n return t < 0;\n\n case \"<=\" /* LESS_THAN_OR_EQUAL */ :\n return t <= 0;\n\n case \"==\" /* EQUAL */ :\n return 0 === t;\n\n case \"!=\" /* NOT_EQUAL */ :\n return 0 !== t;\n\n case \">\" /* GREATER_THAN */ :\n return t > 0;\n\n case \">=\" /* GREATER_THAN_OR_EQUAL */ :\n return t >= 0;\n\n default:\n return L();\n }\n }\n ht() {\n return [ \"<\" /* LESS_THAN */ , \"<=\" /* LESS_THAN_OR_EQUAL */ , \">\" /* GREATER_THAN */ , \">=\" /* GREATER_THAN_OR_EQUAL */ , \"!=\" /* NOT_EQUAL */ , \"not-in\" /* NOT_IN */ ].indexOf(this.op) >= 0;\n }\n}\n\nclass Qe extends Ge {\n constructor(t, e, n) {\n super(t, e, n), this.key = dt.fromName(n.referenceValue);\n }\n matches(t) {\n const e = dt.comparator(t.key, this.key);\n return this.at(e);\n }\n}\n\n/** Filter that matches on key fields within an array. */ class je extends Ge {\n constructor(t, e) {\n super(t, \"in\" /* IN */ , e), this.keys = ze(\"in\" /* IN */ , e);\n }\n matches(t) {\n return this.keys.some((e => e.isEqual(t.key)));\n }\n}\n\n/** Filter that matches on key fields not present within an array. */ class We extends Ge {\n constructor(t, e) {\n super(t, \"not-in\" /* NOT_IN */ , e), this.keys = ze(\"not-in\" /* NOT_IN */ , e);\n }\n matches(t) {\n return !this.keys.some((e => e.isEqual(t.key)));\n }\n}\n\nfunction ze(t, e) {\n var n;\n return ((null === (n = e.arrayValue) || void 0 === n ? void 0 : n.values) || []).map((t => dt.fromName(t.referenceValue)));\n}\n\n/** A Filter that implements the array-contains operator. */ class He extends Ge {\n constructor(t, e) {\n super(t, \"array-contains\" /* ARRAY_CONTAINS */ , e);\n }\n matches(t) {\n const e = t.data.field(this.field);\n return Ee(e) && we(e.arrayValue, this.value);\n }\n}\n\n/** A Filter that implements the IN operator. */ class Je extends Ge {\n constructor(t, e) {\n super(t, \"in\" /* IN */ , e);\n }\n matches(t) {\n const e = t.data.field(this.field);\n return null !== e && we(this.value.arrayValue, e);\n }\n}\n\n/** A Filter that implements the not-in operator. */ class Ye extends Ge {\n constructor(t, e) {\n super(t, \"not-in\" /* NOT_IN */ , e);\n }\n matches(t) {\n if (we(this.value.arrayValue, {\n nullValue: \"NULL_VALUE\"\n })) return !1;\n const e = t.data.field(this.field);\n return null !== e && !we(this.value.arrayValue, e);\n }\n}\n\n/** A Filter that implements the array-contains-any operator. */ class Xe extends Ge {\n constructor(t, e) {\n super(t, \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ , e);\n }\n matches(t) {\n const e = t.data.field(this.field);\n return !(!Ee(e) || !e.arrayValue.values) && e.arrayValue.values.some((t => we(this.value.arrayValue, t)));\n }\n}\n\n/**\n * Represents a bound of a query.\n *\n * The bound is specified with the given components representing a position and\n * whether it's just before or just after the position (relative to whatever the\n * query order is).\n *\n * The position represents a logical index position for a query. It's a prefix\n * of values for the (potentially implicit) order by clauses of a query.\n *\n * Bound provides a function to determine whether a document comes before or\n * after a bound. This is influenced by whether the position is just before or\n * just after the provided values.\n */ class Ze {\n constructor(t, e) {\n this.position = t, this.inclusive = e;\n }\n}\n\n/**\n * An ordering on a field, in some Direction. Direction defaults to ASCENDING.\n */ class tn {\n constructor(t, e = \"asc\" /* ASCENDING */) {\n this.field = t, this.dir = e;\n }\n}\n\nfunction en(t, e) {\n return t.dir === e.dir && t.field.isEqual(e.field);\n}\n\nfunction nn(t, e, n) {\n let s = 0;\n for (let i = 0; i < t.position.length; i++) {\n const r = e[i], o = t.position[i];\n if (r.field.isKeyField()) s = dt.comparator(dt.fromName(o.referenceValue), n.key); else {\n s = me(o, n.data.field(r.field));\n }\n if (\"desc\" /* DESCENDING */ === r.dir && (s *= -1), 0 !== s) break;\n }\n return s;\n}\n\n/**\n * Returns true if a document sorts after a bound using the provided sort\n * order.\n */ function sn(t, e) {\n if (null === t) return null === e;\n if (null === e) return !1;\n if (t.inclusive !== e.inclusive || t.position.length !== e.position.length) return !1;\n for (let n = 0; n < t.position.length; n++) {\n if (!_e(t.position[n], e.position[n])) return !1;\n }\n return !0;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Query encapsulates all the query attributes we support in the SDK. It can\n * be run against the LocalStore, as well as be converted to a `Target` to\n * query the RemoteStore results.\n *\n * Visible for testing.\n */ class rn {\n /**\n * Initializes a Query with a path and optional additional query constraints.\n * Path must currently be empty if this is a collection group query.\n */\n constructor(t, e = null, n = [], s = [], i = null, r = \"F\" /* First */ , o = null, u = null) {\n this.path = t, this.collectionGroup = e, this.explicitOrderBy = n, this.filters = s, \n this.limit = i, this.limitType = r, this.startAt = o, this.endAt = u, this.lt = null, \n // The corresponding `Target` of this `Query` instance.\n this.ft = null, this.startAt, this.endAt;\n }\n}\n\n/** Creates a new Query instance with the options provided. */ function on(t, e, n, s, i, r, o, u) {\n return new rn(t, e, n, s, i, r, o, u);\n}\n\n/** Creates a new Query for a query that matches all documents at `path` */ function un(t) {\n return new rn(t);\n}\n\n/**\n * Helper to convert a collection group query into a collection query at a\n * specific path. This is used when executing collection group queries, since\n * we have to split the query into a set of collection queries at multiple\n * paths.\n */\n/**\n * Returns true if this query does not specify any query constraints that\n * could remove results.\n */\nfunction cn(t) {\n return 0 === t.filters.length && null === t.limit && null == t.startAt && null == t.endAt && (0 === t.explicitOrderBy.length || 1 === t.explicitOrderBy.length && t.explicitOrderBy[0].field.isKeyField());\n}\n\nfunction an(t) {\n return t.explicitOrderBy.length > 0 ? t.explicitOrderBy[0].field : null;\n}\n\nfunction hn(t) {\n for (const e of t.filters) if (e.ht()) return e.field;\n return null;\n}\n\n/**\n * Checks if any of the provided Operators are included in the query and\n * returns the first one that is, or null if none are.\n */\n/**\n * Returns whether the query matches a collection group rather than a specific\n * collection.\n */\nfunction ln(t) {\n return null !== t.collectionGroup;\n}\n\n/**\n * Returns the implicit order by constraint that is used to execute the Query,\n * which can be different from the order by constraints the user provided (e.g.\n * the SDK and backend always orders by `__name__`).\n */ function fn(t) {\n const e = K(t);\n if (null === e.lt) {\n e.lt = [];\n const t = hn(e), n = an(e);\n if (null !== t && null === n) \n // In order to implicitly add key ordering, we must also add the\n // inequality filter field for it to be a valid query.\n // Note that the default inequality field and key ordering is ascending.\n t.isKeyField() || e.lt.push(new tn(t)), e.lt.push(new tn(ft.keyField(), \"asc\" /* ASCENDING */)); else {\n let t = !1;\n for (const n of e.explicitOrderBy) e.lt.push(n), n.field.isKeyField() && (t = !0);\n if (!t) {\n // The order of the implicit key ordering always matches the last\n // explicit order by\n const t = e.explicitOrderBy.length > 0 ? e.explicitOrderBy[e.explicitOrderBy.length - 1].dir : \"asc\" /* ASCENDING */;\n e.lt.push(new tn(ft.keyField(), t));\n }\n }\n }\n return e.lt;\n}\n\n/**\n * Converts this `Query` instance to it's corresponding `Target` representation.\n */ function dn(t) {\n const e = K(t);\n if (!e.ft) if (\"F\" /* First */ === e.limitType) e.ft = Oe(e.path, e.collectionGroup, fn(e), e.filters, e.limit, e.startAt, e.endAt); else {\n // Flip the orderBy directions since we want the last results\n const t = [];\n for (const n of fn(e)) {\n const e = \"desc\" /* DESCENDING */ === n.dir ? \"asc\" /* ASCENDING */ : \"desc\" /* DESCENDING */;\n t.push(new tn(n.field, e));\n }\n // We need to swap the cursors to match the now-flipped query ordering.\n const n = e.endAt ? new Ze(e.endAt.position, e.endAt.inclusive) : null, s = e.startAt ? new Ze(e.startAt.position, e.startAt.inclusive) : null;\n // Now return as a LimitType.First query.\n e.ft = Oe(e.path, e.collectionGroup, t, e.filters, e.limit, n, s);\n }\n return e.ft;\n}\n\nfunction _n(t, e, n) {\n return new rn(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), e, n, t.startAt, t.endAt);\n}\n\nfunction wn(t, e) {\n return Be(dn(t), dn(e)) && t.limitType === e.limitType;\n}\n\n// TODO(b/29183165): This is used to get a unique string from a query to, for\n// example, use as a dictionary key, but the implementation is subject to\n// collisions. Make it collision-free.\nfunction mn(t) {\n return `${Fe(dn(t))}|lt:${t.limitType}`;\n}\n\nfunction gn(t) {\n return `Query(target=${$e(dn(t))}; limitType=${t.limitType})`;\n}\n\n/** Returns whether `doc` matches the constraints of `query`. */ function yn(t, e) {\n return e.isFoundDocument() && function(t, e) {\n const n = e.key.path;\n return null !== t.collectionGroup ? e.key.hasCollectionId(t.collectionGroup) && t.path.isPrefixOf(n) : dt.isDocumentKey(t.path) ? t.path.isEqual(n) : t.path.isImmediateParentOf(n);\n }\n /**\n * A document must have a value for every ordering clause in order to show up\n * in the results.\n */ (t, e) && function(t, e) {\n for (const n of t.explicitOrderBy) \n // order by key always matches\n if (!n.field.isKeyField() && null === e.data.field(n.field)) return !1;\n return !0;\n }(t, e) && function(t, e) {\n for (const n of t.filters) if (!n.matches(e)) return !1;\n return !0;\n }\n /** Makes sure a document is within the bounds, if provided. */ (t, e) && function(t, e) {\n if (t.startAt && !\n /**\n * Returns true if a document sorts before a bound using the provided sort\n * order.\n */\n function(t, e, n) {\n const s = nn(t, e, n);\n return t.inclusive ? s <= 0 : s < 0;\n }(t.startAt, fn(t), e)) return !1;\n if (t.endAt && !function(t, e, n) {\n const s = nn(t, e, n);\n return t.inclusive ? s >= 0 : s > 0;\n }(t.endAt, fn(t), e)) return !1;\n return !0;\n }\n /**\n * Returns the collection group that this query targets.\n *\n * PORTING NOTE: This is only used in the Web SDK to facilitate multi-tab\n * synchronization for query results.\n */ (t, e);\n}\n\nfunction pn(t) {\n return t.collectionGroup || (t.path.length % 2 == 1 ? t.path.lastSegment() : t.path.get(t.path.length - 2));\n}\n\n/**\n * Returns a new comparator function that can be used to compare two documents\n * based on the Query's ordering constraint.\n */ function In(t) {\n return (e, n) => {\n let s = !1;\n for (const i of fn(t)) {\n const t = Tn(i, e, n);\n if (0 !== t) return t;\n s = s || i.field.isKeyField();\n }\n return 0;\n };\n}\n\nfunction Tn(t, e, n) {\n const s = t.field.isKeyField() ? dt.comparator(e.key, n.key) : function(t, e, n) {\n const s = e.data.field(t), i = n.data.field(t);\n return null !== s && null !== i ? me(s, i) : L();\n }(t.field, e, n);\n switch (t.dir) {\n case \"asc\" /* ASCENDING */ :\n return s;\n\n case \"desc\" /* DESCENDING */ :\n return -1 * s;\n\n default:\n return L();\n }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Returns an DoubleValue for `value` that is encoded based the serializer's\n * `useProto3Json` setting.\n */ function En(t, e) {\n if (t.dt) {\n if (isNaN(e)) return {\n doubleValue: \"NaN\"\n };\n if (e === 1 / 0) return {\n doubleValue: \"Infinity\"\n };\n if (e === -1 / 0) return {\n doubleValue: \"-Infinity\"\n };\n }\n return {\n doubleValue: ae(e) ? \"-0\" : e\n };\n}\n\n/**\n * Returns an IntegerValue for `value`.\n */ function An(t) {\n return {\n integerValue: \"\" + t\n };\n}\n\n/**\n * Returns a value for a number that's appropriate to put into a proto.\n * The return value is an IntegerValue if it can safely represent the value,\n * otherwise a DoubleValue is returned.\n */ function Rn(t, e) {\n return he(e) ? An(e) : En(t, e);\n}\n\n/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** Used to represent a field transform on a mutation. */ class bn {\n constructor() {\n // Make sure that the structural type of `TransformOperation` is unique.\n // See https://github.com/microsoft/TypeScript/issues/5451\n this._ = void 0;\n }\n}\n\n/**\n * Computes the local transform result against the provided `previousValue`,\n * optionally using the provided localWriteTime.\n */ function Pn(t, e, n) {\n return t instanceof Sn ? function(t, e) {\n const n = {\n fields: {\n __type__: {\n stringValue: \"server_timestamp\"\n },\n __local_write_time__: {\n timestampValue: {\n seconds: t.seconds,\n nanos: t.nanoseconds\n }\n }\n }\n };\n return e && (n.fields.__previous_value__ = e), {\n mapValue: n\n };\n }(n, e) : t instanceof Dn ? Cn(t, e) : t instanceof xn ? Nn(t, e) : function(t, e) {\n // PORTING NOTE: Since JavaScript's integer arithmetic is limited to 53 bit\n // precision and resolves overflows by reducing precision, we do not\n // manually cap overflows at 2^63.\n const n = Vn(t, e), s = Mn(n) + Mn(t._t);\n return Te(n) && Te(t._t) ? An(s) : En(t.wt, s);\n }(t, e);\n}\n\n/**\n * Computes a final transform result after the transform has been acknowledged\n * by the server, potentially using the server-provided transformResult.\n */ function vn(t, e, n) {\n // The server just sends null as the transform result for array operations,\n // so we have to calculate a result the same as we do for local\n // applications.\n return t instanceof Dn ? Cn(t, e) : t instanceof xn ? Nn(t, e) : n;\n}\n\n/**\n * If this transform operation is not idempotent, returns the base value to\n * persist for this transform. If a base value is returned, the transform\n * operation is always applied to this base value, even if document has\n * already been updated.\n *\n * Base values provide consistent behavior for non-idempotent transforms and\n * allow us to return the same latency-compensated value even if the backend\n * has already applied the transform operation. The base value is null for\n * idempotent transforms, as they can be re-played even if the backend has\n * already applied them.\n *\n * @returns a base value to store along with the mutation, or null for\n * idempotent transforms.\n */ function Vn(t, e) {\n return t instanceof kn ? Te(n = e) || function(t) {\n return !!t && \"doubleValue\" in t;\n }\n /** Returns true if `value` is either an IntegerValue or a DoubleValue. */ (n) ? e : {\n integerValue: 0\n } : null;\n var n;\n}\n\n/** Transforms a value into a server-generated timestamp. */\nclass Sn extends bn {}\n\n/** Transforms an array value via a union operation. */ class Dn extends bn {\n constructor(t) {\n super(), this.elements = t;\n }\n}\n\nfunction Cn(t, e) {\n const n = On(e);\n for (const e of t.elements) n.some((t => _e(t, e))) || n.push(e);\n return {\n arrayValue: {\n values: n\n }\n };\n}\n\n/** Transforms an array value via a remove operation. */ class xn extends bn {\n constructor(t) {\n super(), this.elements = t;\n }\n}\n\nfunction Nn(t, e) {\n let n = On(e);\n for (const e of t.elements) n = n.filter((t => !_e(t, e)));\n return {\n arrayValue: {\n values: n\n }\n };\n}\n\n/**\n * Implements the backend semantics for locally computed NUMERIC_ADD (increment)\n * transforms. Converts all field values to integers or doubles, but unlike the\n * backend does not cap integer values at 2^63. Instead, JavaScript number\n * arithmetic is used and precision loss can occur for values greater than 2^53.\n */ class kn extends bn {\n constructor(t, e) {\n super(), this.wt = t, this._t = e;\n }\n}\n\nfunction Mn(t) {\n return ee(t.integerValue || t.doubleValue);\n}\n\nfunction On(t) {\n return Ee(t) && t.arrayValue.values ? t.arrayValue.values.slice() : [];\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** A field path and the TransformOperation to perform upon it. */ class Fn {\n constructor(t, e) {\n this.field = t, this.transform = e;\n }\n}\n\nfunction $n(t, e) {\n return t.field.isEqual(e.field) && function(t, e) {\n return t instanceof Dn && e instanceof Dn || t instanceof xn && e instanceof xn ? rt(t.elements, e.elements, _e) : t instanceof kn && e instanceof kn ? _e(t._t, e._t) : t instanceof Sn && e instanceof Sn;\n }(t.transform, e.transform);\n}\n\n/** The result of successfully applying a mutation to the backend. */\nclass Bn {\n constructor(\n /**\n * The version at which the mutation was committed:\n *\n * - For most operations, this is the updateTime in the WriteResult.\n * - For deletes, the commitTime of the WriteResponse (because deletes are\n * not stored and have no updateTime).\n *\n * Note that these versions can be different: No-op writes will not change\n * the updateTime even though the commitTime advances.\n */\n t, \n /**\n * The resulting fields returned from the backend after a mutation\n * containing field transforms has been committed. Contains one FieldValue\n * for each FieldTransform that was in the mutation.\n *\n * Will be empty if the mutation did not contain any field transforms.\n */\n e) {\n this.version = t, this.transformResults = e;\n }\n}\n\n/**\n * Encodes a precondition for a mutation. This follows the model that the\n * backend accepts with the special case of an explicit \"empty\" precondition\n * (meaning no precondition).\n */ class Ln {\n constructor(t, e) {\n this.updateTime = t, this.exists = e;\n }\n /** Creates a new empty Precondition. */ static none() {\n return new Ln;\n }\n /** Creates a new Precondition with an exists flag. */ static exists(t) {\n return new Ln(void 0, t);\n }\n /** Creates a new Precondition based on a version a document exists at. */ static updateTime(t) {\n return new Ln(t);\n }\n /** Returns whether this Precondition is empty. */ get isNone() {\n return void 0 === this.updateTime && void 0 === this.exists;\n }\n isEqual(t) {\n return this.exists === t.exists && (this.updateTime ? !!t.updateTime && this.updateTime.isEqual(t.updateTime) : !t.updateTime);\n }\n}\n\n/** Returns true if the preconditions is valid for the given document. */ function Un(t, e) {\n return void 0 !== t.updateTime ? e.isFoundDocument() && e.version.isEqual(t.updateTime) : void 0 === t.exists || t.exists === e.isFoundDocument();\n}\n\n/**\n * A mutation describes a self-contained change to a document. Mutations can\n * create, replace, delete, and update subsets of documents.\n *\n * Mutations not only act on the value of the document but also its version.\n *\n * For local mutations (mutations that haven't been committed yet), we preserve\n * the existing version for Set and Patch mutations. For Delete mutations, we\n * reset the version to 0.\n *\n * Here's the expected transition table.\n *\n * MUTATION APPLIED TO RESULTS IN\n *\n * SetMutation Document(v3) Document(v3)\n * SetMutation NoDocument(v3) Document(v0)\n * SetMutation InvalidDocument(v0) Document(v0)\n * PatchMutation Document(v3) Document(v3)\n * PatchMutation NoDocument(v3) NoDocument(v3)\n * PatchMutation InvalidDocument(v0) UnknownDocument(v3)\n * DeleteMutation Document(v3) NoDocument(v0)\n * DeleteMutation NoDocument(v3) NoDocument(v0)\n * DeleteMutation InvalidDocument(v0) NoDocument(v0)\n *\n * For acknowledged mutations, we use the updateTime of the WriteResponse as\n * the resulting version for Set and Patch mutations. As deletes have no\n * explicit update time, we use the commitTime of the WriteResponse for\n * Delete mutations.\n *\n * If a mutation is acknowledged by the backend but fails the precondition check\n * locally, we transition to an `UnknownDocument` and rely on Watch to send us\n * the updated version.\n *\n * Field transforms are used only with Patch and Set Mutations. We use the\n * `updateTransforms` message to store transforms, rather than the `transforms`s\n * messages.\n *\n * ## Subclassing Notes\n *\n * Every type of mutation needs to implement its own applyToRemoteDocument() and\n * applyToLocalView() to implement the actual behavior of applying the mutation\n * to some source document (see `setMutationApplyToRemoteDocument()` for an\n * example).\n */ class qn {}\n\n/**\n * A utility method to calculate a `Mutation` representing the overlay from the\n * final state of the document, and a `FieldMask` representing the fields that\n * are mutated by the local mutations.\n */ function Kn(t, e) {\n if (!t.hasLocalMutations || e && 0 === e.fields.length) return null;\n // mask is null when sets or deletes are applied to the current document.\n if (null === e) return t.isNoDocument() ? new Zn(t.key, Ln.none()) : new zn(t.key, t.data, Ln.none());\n {\n const n = t.data, s = xe.empty();\n let i = new Wt(ft.comparator);\n for (let t of e.fields) if (!i.has(t)) {\n let e = n.field(t);\n // If we are deleting a nested field, we take the immediate parent as\n // the mask used to construct the resulting mutation.\n // Justification: Nested fields can create parent fields implicitly. If\n // only a leaf entry is deleted in later mutations, the parent field\n // should still remain, but we may have lost this information.\n // Consider mutation (foo.bar 1), then mutation (foo.bar delete()).\n // This leaves the final result (foo, {}). Despite the fact that `doc`\n // has the correct result, `foo` is not in `mask`, and the resulting\n // mutation would miss `foo`.\n null === e && t.length > 1 && (t = t.popLast(), e = n.field(t)), null === e ? s.delete(t) : s.set(t, e), \n i = i.add(t);\n }\n return new Hn(t.key, s, new Jt(i.toArray()), Ln.none());\n }\n}\n\n/**\n * Applies this mutation to the given document for the purposes of computing a\n * new remote document. If the input document doesn't match the expected state\n * (e.g. it is invalid or outdated), the document type may transition to\n * unknown.\n *\n * @param mutation - The mutation to apply.\n * @param document - The document to mutate. The input document can be an\n * invalid document if the client has no knowledge of the pre-mutation state\n * of the document.\n * @param mutationResult - The result of applying the mutation from the backend.\n */ function Gn(t, e, n) {\n t instanceof zn ? function(t, e, n) {\n // Unlike setMutationApplyToLocalView, if we're applying a mutation to a\n // remote document the server has accepted the mutation so the precondition\n // must have held.\n const s = t.value.clone(), i = Yn(t.fieldTransforms, e, n.transformResults);\n s.setAll(i), e.convertToFoundDocument(n.version, s).setHasCommittedMutations();\n }(t, e, n) : t instanceof Hn ? function(t, e, n) {\n if (!Un(t.precondition, e)) \n // Since the mutation was not rejected, we know that the precondition\n // matched on the backend. We therefore must not have the expected version\n // of the document in our cache and convert to an UnknownDocument with a\n // known updateTime.\n return void e.convertToUnknownDocument(n.version);\n const s = Yn(t.fieldTransforms, e, n.transformResults), i = e.data;\n i.setAll(Jn(t)), i.setAll(s), e.convertToFoundDocument(n.version, i).setHasCommittedMutations();\n }(t, e, n) : function(t, e, n) {\n // Unlike applyToLocalView, if we're applying a mutation to a remote\n // document the server has accepted the mutation so the precondition must\n // have held.\n e.convertToNoDocument(n.version).setHasCommittedMutations();\n }(0, e, n);\n}\n\n/**\n * Applies this mutation to the given document for the purposes of computing\n * the new local view of a document. If the input document doesn't match the\n * expected state, the document is not modified.\n *\n * @param mutation - The mutation to apply.\n * @param document - The document to mutate. The input document can be an\n * invalid document if the client has no knowledge of the pre-mutation state\n * of the document.\n * @param previousMask - The fields that have been updated before applying this mutation.\n * @param localWriteTime - A timestamp indicating the local write time of the\n * batch this mutation is a part of.\n * @returns A `FieldMask` representing the fields that are changed by applying this mutation.\n */ function Qn(t, e, n, s) {\n return t instanceof zn ? function(t, e, n, s) {\n if (!Un(t.precondition, e)) \n // The mutation failed to apply (e.g. a document ID created with add()\n // caused a name collision).\n return n;\n const i = t.value.clone(), r = Xn(t.fieldTransforms, s, e);\n return i.setAll(r), e.convertToFoundDocument(e.version, i).setHasLocalMutations(), \n null;\n // SetMutation overwrites all fields.\n }\n /**\n * A mutation that modifies fields of the document at the given key with the\n * given values. The values are applied through a field mask:\n *\n * * When a field is in both the mask and the values, the corresponding field\n * is updated.\n * * When a field is in neither the mask nor the values, the corresponding\n * field is unmodified.\n * * When a field is in the mask but not in the values, the corresponding field\n * is deleted.\n * * When a field is not in the mask but is in the values, the values map is\n * ignored.\n */ (t, e, n, s) : t instanceof Hn ? function(t, e, n, s) {\n if (!Un(t.precondition, e)) return n;\n const i = Xn(t.fieldTransforms, s, e), r = e.data;\n if (r.setAll(Jn(t)), r.setAll(i), e.convertToFoundDocument(e.version, r).setHasLocalMutations(), \n null === n) return null;\n return n.unionWith(t.fieldMask.fields).unionWith(t.fieldTransforms.map((t => t.field)));\n }\n /**\n * Returns a FieldPath/Value map with the content of the PatchMutation.\n */ (t, e, n, s) : function(t, e, n) {\n if (Un(t.precondition, e)) return e.convertToNoDocument(e.version).setHasLocalMutations(), \n null;\n return n;\n }\n /**\n * A mutation that verifies the existence of the document at the given key with\n * the provided precondition.\n *\n * The `verify` operation is only used in Transactions, and this class serves\n * primarily to facilitate serialization into protos.\n */ (t, e, n);\n}\n\n/**\n * If this mutation is not idempotent, returns the base value to persist with\n * this mutation. If a base value is returned, the mutation is always applied\n * to this base value, even if document has already been updated.\n *\n * The base value is a sparse object that consists of only the document\n * fields for which this mutation contains a non-idempotent transformation\n * (e.g. a numeric increment). The provided value guarantees consistent\n * behavior for non-idempotent transforms and allow us to return the same\n * latency-compensated value even if the backend has already applied the\n * mutation. The base value is null for idempotent mutations, as they can be\n * re-played even if the backend has already applied them.\n *\n * @returns a base value to store along with the mutation, or null for\n * idempotent mutations.\n */ function jn(t, e) {\n let n = null;\n for (const s of t.fieldTransforms) {\n const t = e.data.field(s.field), i = Vn(s.transform, t || null);\n null != i && (null === n && (n = xe.empty()), n.set(s.field, i));\n }\n return n || null;\n}\n\nfunction Wn(t, e) {\n return t.type === e.type && (!!t.key.isEqual(e.key) && (!!t.precondition.isEqual(e.precondition) && (!!function(t, e) {\n return void 0 === t && void 0 === e || !(!t || !e) && rt(t, e, ((t, e) => $n(t, e)));\n }(t.fieldTransforms, e.fieldTransforms) && (0 /* Set */ === t.type ? t.value.isEqual(e.value) : 1 /* Patch */ !== t.type || t.data.isEqual(e.data) && t.fieldMask.isEqual(e.fieldMask)))));\n}\n\n/**\n * A mutation that creates or replaces the document at the given key with the\n * object value contents.\n */ class zn extends qn {\n constructor(t, e, n, s = []) {\n super(), this.key = t, this.value = e, this.precondition = n, this.fieldTransforms = s, \n this.type = 0 /* Set */;\n }\n getFieldMask() {\n return null;\n }\n}\n\nclass Hn extends qn {\n constructor(t, e, n, s, i = []) {\n super(), this.key = t, this.data = e, this.fieldMask = n, this.precondition = s, \n this.fieldTransforms = i, this.type = 1 /* Patch */;\n }\n getFieldMask() {\n return this.fieldMask;\n }\n}\n\nfunction Jn(t) {\n const e = new Map;\n return t.fieldMask.fields.forEach((n => {\n if (!n.isEmpty()) {\n const s = t.data.field(n);\n e.set(n, s);\n }\n })), e;\n}\n\n/**\n * Creates a list of \"transform results\" (a transform result is a field value\n * representing the result of applying a transform) for use after a mutation\n * containing transforms has been acknowledged by the server.\n *\n * @param fieldTransforms - The field transforms to apply the result to.\n * @param mutableDocument - The current state of the document after applying all\n * previous mutations.\n * @param serverTransformResults - The transform results received by the server.\n * @returns The transform results list.\n */ function Yn(t, e, n) {\n const s = new Map;\n U(t.length === n.length);\n for (let i = 0; i < n.length; i++) {\n const r = t[i], o = r.transform, u = e.data.field(r.field);\n s.set(r.field, vn(o, u, n[i]));\n }\n return s;\n}\n\n/**\n * Creates a list of \"transform results\" (a transform result is a field value\n * representing the result of applying a transform) for use when applying a\n * transform locally.\n *\n * @param fieldTransforms - The field transforms to apply the result to.\n * @param localWriteTime - The local time of the mutation (used to\n * generate ServerTimestampValues).\n * @param mutableDocument - The document to apply transforms on.\n * @returns The transform results list.\n */ function Xn(t, e, n) {\n const s = new Map;\n for (const i of t) {\n const t = i.transform, r = n.data.field(i.field);\n s.set(i.field, Pn(t, r, e));\n }\n return s;\n}\n\n/** A mutation that deletes the document at the given key. */ class Zn extends qn {\n constructor(t, e) {\n super(), this.key = t, this.precondition = e, this.type = 2 /* Delete */ , this.fieldTransforms = [];\n }\n getFieldMask() {\n return null;\n }\n}\n\nclass ts extends qn {\n constructor(t, e) {\n super(), this.key = t, this.precondition = e, this.type = 3 /* Verify */ , this.fieldTransforms = [];\n }\n getFieldMask() {\n return null;\n }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ class es {\n // TODO(b/33078163): just use simplest form of existence filter for now\n constructor(t) {\n this.count = t;\n }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Error Codes describing the different ways GRPC can fail. These are copied\n * directly from GRPC's sources here:\n *\n * https://github.com/grpc/grpc/blob/bceec94ea4fc5f0085d81235d8e1c06798dc341a/include/grpc%2B%2B/impl/codegen/status_code_enum.h\n *\n * Important! The names of these identifiers matter because the string forms\n * are used for reverse lookups from the webchannel stream. Do NOT change the\n * names of these identifiers or change this into a const enum.\n */ var ns, ss;\n\n/**\n * Determines whether an error code represents a permanent error when received\n * in response to a non-write operation.\n *\n * See isPermanentWriteError for classifying write errors.\n */\nfunction is(t) {\n switch (t) {\n default:\n return L();\n\n case G.CANCELLED:\n case G.UNKNOWN:\n case G.DEADLINE_EXCEEDED:\n case G.RESOURCE_EXHAUSTED:\n case G.INTERNAL:\n case G.UNAVAILABLE:\n // Unauthenticated means something went wrong with our token and we need\n // to retry with new credentials which will happen automatically.\n case G.UNAUTHENTICATED:\n return !1;\n\n case G.INVALID_ARGUMENT:\n case G.NOT_FOUND:\n case G.ALREADY_EXISTS:\n case G.PERMISSION_DENIED:\n case G.FAILED_PRECONDITION:\n // Aborted might be retried in some scenarios, but that is dependant on\n // the context and should handled individually by the calling code.\n // See https://cloud.google.com/apis/design/errors.\n case G.ABORTED:\n case G.OUT_OF_RANGE:\n case G.UNIMPLEMENTED:\n case G.DATA_LOSS:\n return !0;\n }\n}\n\n/**\n * Determines whether an error code represents a permanent error when received\n * in response to a write operation.\n *\n * Write operations must be handled specially because as of b/119437764, ABORTED\n * errors on the write stream should be retried too (even though ABORTED errors\n * are not generally retryable).\n *\n * Note that during the initial handshake on the write stream an ABORTED error\n * signals that we should discard our stream token (i.e. it is permanent). This\n * means a handshake error should be classified with isPermanentError, above.\n */\n/**\n * Maps an error Code from GRPC status code number, like 0, 1, or 14. These\n * are not the same as HTTP status codes.\n *\n * @returns The Code equivalent to the given GRPC status code. Fails if there\n * is no match.\n */\nfunction rs(t) {\n if (void 0 === t) \n // This shouldn't normally happen, but in certain error cases (like trying\n // to send invalid proto messages) we may get an error with no GRPC code.\n return F(\"GRPC error has no .code\"), G.UNKNOWN;\n switch (t) {\n case ns.OK:\n return G.OK;\n\n case ns.CANCELLED:\n return G.CANCELLED;\n\n case ns.UNKNOWN:\n return G.UNKNOWN;\n\n case ns.DEADLINE_EXCEEDED:\n return G.DEADLINE_EXCEEDED;\n\n case ns.RESOURCE_EXHAUSTED:\n return G.RESOURCE_EXHAUSTED;\n\n case ns.INTERNAL:\n return G.INTERNAL;\n\n case ns.UNAVAILABLE:\n return G.UNAVAILABLE;\n\n case ns.UNAUTHENTICATED:\n return G.UNAUTHENTICATED;\n\n case ns.INVALID_ARGUMENT:\n return G.INVALID_ARGUMENT;\n\n case ns.NOT_FOUND:\n return G.NOT_FOUND;\n\n case ns.ALREADY_EXISTS:\n return G.ALREADY_EXISTS;\n\n case ns.PERMISSION_DENIED:\n return G.PERMISSION_DENIED;\n\n case ns.FAILED_PRECONDITION:\n return G.FAILED_PRECONDITION;\n\n case ns.ABORTED:\n return G.ABORTED;\n\n case ns.OUT_OF_RANGE:\n return G.OUT_OF_RANGE;\n\n case ns.UNIMPLEMENTED:\n return G.UNIMPLEMENTED;\n\n case ns.DATA_LOSS:\n return G.DATA_LOSS;\n\n default:\n return L();\n }\n}\n\n/**\n * Converts an HTTP response's error status to the equivalent error code.\n *\n * @param status - An HTTP error response status (\"FAILED_PRECONDITION\",\n * \"UNKNOWN\", etc.)\n * @returns The equivalent Code. Non-matching responses are mapped to\n * Code.UNKNOWN.\n */ (ss = ns || (ns = {}))[ss.OK = 0] = \"OK\", ss[ss.CANCELLED = 1] = \"CANCELLED\", \nss[ss.UNKNOWN = 2] = \"UNKNOWN\", ss[ss.INVALID_ARGUMENT = 3] = \"INVALID_ARGUMENT\", \nss[ss.DEADLINE_EXCEEDED = 4] = \"DEADLINE_EXCEEDED\", ss[ss.NOT_FOUND = 5] = \"NOT_FOUND\", \nss[ss.ALREADY_EXISTS = 6] = \"ALREADY_EXISTS\", ss[ss.PERMISSION_DENIED = 7] = \"PERMISSION_DENIED\", \nss[ss.UNAUTHENTICATED = 16] = \"UNAUTHENTICATED\", ss[ss.RESOURCE_EXHAUSTED = 8] = \"RESOURCE_EXHAUSTED\", \nss[ss.FAILED_PRECONDITION = 9] = \"FAILED_PRECONDITION\", ss[ss.ABORTED = 10] = \"ABORTED\", \nss[ss.OUT_OF_RANGE = 11] = \"OUT_OF_RANGE\", ss[ss.UNIMPLEMENTED = 12] = \"UNIMPLEMENTED\", \nss[ss.INTERNAL = 13] = \"INTERNAL\", ss[ss.UNAVAILABLE = 14] = \"UNAVAILABLE\", ss[ss.DATA_LOSS = 15] = \"DATA_LOSS\";\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A map implementation that uses objects as keys. Objects must have an\n * associated equals function and must be immutable. Entries in the map are\n * stored together with the key being produced from the mapKeyFn. This map\n * automatically handles collisions of keys.\n */\nclass os {\n constructor(t, e) {\n this.mapKeyFn = t, this.equalsFn = e, \n /**\n * The inner map for a key/value pair. Due to the possibility of collisions we\n * keep a list of entries that we do a linear search through to find an actual\n * match. Note that collisions should be rare, so we still expect near\n * constant time lookups in practice.\n */\n this.inner = {}, \n /** The number of entries stored in the map */\n this.innerSize = 0;\n }\n /** Get a value for this key, or undefined if it does not exist. */ get(t) {\n const e = this.mapKeyFn(t), n = this.inner[e];\n if (void 0 !== n) for (const [e, s] of n) if (this.equalsFn(e, t)) return s;\n }\n has(t) {\n return void 0 !== this.get(t);\n }\n /** Put this key and value in the map. */ set(t, e) {\n const n = this.mapKeyFn(t), s = this.inner[n];\n if (void 0 === s) return this.inner[n] = [ [ t, e ] ], void this.innerSize++;\n for (let n = 0; n < s.length; n++) if (this.equalsFn(s[n][0], t)) \n // This is updating an existing entry and does not increase `innerSize`.\n return void (s[n] = [ t, e ]);\n s.push([ t, e ]), this.innerSize++;\n }\n /**\n * Remove this key from the map. Returns a boolean if anything was deleted.\n */ delete(t) {\n const e = this.mapKeyFn(t), n = this.inner[e];\n if (void 0 === n) return !1;\n for (let s = 0; s < n.length; s++) if (this.equalsFn(n[s][0], t)) return 1 === n.length ? delete this.inner[e] : n.splice(s, 1), \n this.innerSize--, !0;\n return !1;\n }\n forEach(t) {\n qt(this.inner, ((e, n) => {\n for (const [e, s] of n) t(e, s);\n }));\n }\n isEmpty() {\n return Kt(this.inner);\n }\n size() {\n return this.innerSize;\n }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ const us = new Gt(dt.comparator);\n\nfunction cs() {\n return us;\n}\n\nconst as = new Gt(dt.comparator);\n\nfunction hs(...t) {\n let e = as;\n for (const n of t) e = e.insert(n.key, n);\n return e;\n}\n\nfunction ls(t) {\n let e = as;\n return t.forEach(((t, n) => e = e.insert(t, n.overlayedDocument))), e;\n}\n\nfunction fs() {\n return _s();\n}\n\nfunction ds() {\n return _s();\n}\n\nfunction _s() {\n return new os((t => t.toString()), ((t, e) => t.isEqual(e)));\n}\n\nconst ws = new Gt(dt.comparator);\n\nconst ms = new Wt(dt.comparator);\n\nfunction gs(...t) {\n let e = ms;\n for (const n of t) e = e.add(n);\n return e;\n}\n\nconst ys = new Wt(it);\n\nfunction ps() {\n return ys;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * An event from the RemoteStore. It is split into targetChanges (changes to the\n * state or the set of documents in our watched targets) and documentUpdates\n * (changes to the actual documents).\n */ class Is {\n constructor(\n /**\n * The snapshot version this event brings us up to, or MIN if not set.\n */\n t, \n /**\n * A map from target to changes to the target. See TargetChange.\n */\n e, \n /**\n * A set of targets that is known to be inconsistent. Listens for these\n * targets should be re-established without resume tokens.\n */\n n, \n /**\n * A set of which documents have changed or been deleted, along with the\n * doc's new values (if not deleted).\n */\n s, \n /**\n * A set of which document updates are due only to limbo resolution targets.\n */\n i) {\n this.snapshotVersion = t, this.targetChanges = e, this.targetMismatches = n, this.documentUpdates = s, \n this.resolvedLimboDocuments = i;\n }\n /**\n * HACK: Views require RemoteEvents in order to determine whether the view is\n * CURRENT, but secondary tabs don't receive remote events. So this method is\n * used to create a synthesized RemoteEvent that can be used to apply a\n * CURRENT status change to a View, for queries executed in a different tab.\n */\n // PORTING NOTE: Multi-tab only\n static createSynthesizedRemoteEventForCurrentChange(t, e) {\n const n = new Map;\n return n.set(t, Ts.createSynthesizedTargetChangeForCurrentChange(t, e)), new Is(ct.min(), n, ps(), cs(), gs());\n }\n}\n\n/**\n * A TargetChange specifies the set of changes for a specific target as part of\n * a RemoteEvent. These changes track which documents are added, modified or\n * removed, as well as the target's resume token and whether the target is\n * marked CURRENT.\n * The actual changes *to* documents are not part of the TargetChange since\n * documents may be part of multiple targets.\n */ class Ts {\n constructor(\n /**\n * An opaque, server-assigned token that allows watching a query to be resumed\n * after disconnecting without retransmitting all the data that matches the\n * query. The resume token essentially identifies a point in time from which\n * the server should resume sending results.\n */\n t, \n /**\n * The \"current\" (synced) status of this target. Note that \"current\"\n * has special meaning in the RPC protocol that implies that a target is\n * both up-to-date and consistent with the rest of the watch stream.\n */\n e, \n /**\n * The set of documents that were newly assigned to this target as part of\n * this remote event.\n */\n n, \n /**\n * The set of documents that were already assigned to this target but received\n * an update during this remote event.\n */\n s, \n /**\n * The set of documents that were removed from this target as part of this\n * remote event.\n */\n i) {\n this.resumeToken = t, this.current = e, this.addedDocuments = n, this.modifiedDocuments = s, \n this.removedDocuments = i;\n }\n /**\n * This method is used to create a synthesized TargetChanges that can be used to\n * apply a CURRENT status change to a View (for queries executed in a different\n * tab) or for new queries (to raise snapshots with correct CURRENT status).\n */ static createSynthesizedTargetChangeForCurrentChange(t, e) {\n return new Ts(Xt.EMPTY_BYTE_STRING, e, gs(), gs(), gs());\n }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Represents a changed document and a list of target ids to which this change\n * applies.\n *\n * If document has been deleted NoDocument will be provided.\n */ class Es {\n constructor(\n /** The new document applies to all of these targets. */\n t, \n /** The new document is removed from all of these targets. */\n e, \n /** The key of the document for this change. */\n n, \n /**\n * The new document or NoDocument if it was deleted. Is null if the\n * document went out of view without the server sending a new document.\n */\n s) {\n this.gt = t, this.removedTargetIds = e, this.key = n, this.yt = s;\n }\n}\n\nclass As {\n constructor(t, e) {\n this.targetId = t, this.It = e;\n }\n}\n\nclass Rs {\n constructor(\n /** What kind of change occurred to the watch target. */\n t, \n /** The target IDs that were added/removed/set. */\n e, \n /**\n * An opaque, server-assigned token that allows watching a target to be\n * resumed after disconnecting without retransmitting all the data that\n * matches the target. The resume token essentially identifies a point in\n * time from which the server should resume sending results.\n */\n n = Xt.EMPTY_BYTE_STRING\n /** An RPC error indicating why the watch failed. */ , s = null) {\n this.state = t, this.targetIds = e, this.resumeToken = n, this.cause = s;\n }\n}\n\n/** Tracks the internal state of a Watch target. */ class bs {\n constructor() {\n /**\n * The number of pending responses (adds or removes) that we are waiting on.\n * We only consider targets active that have no pending responses.\n */\n this.Tt = 0, \n /**\n * Keeps track of the document changes since the last raised snapshot.\n *\n * These changes are continuously updated as we receive document updates and\n * always reflect the current set of changes against the last issued snapshot.\n */\n this.Et = Vs(), \n /** See public getters for explanations of these fields. */\n this.At = Xt.EMPTY_BYTE_STRING, this.Rt = !1, \n /**\n * Whether this target state should be included in the next snapshot. We\n * initialize to true so that newly-added targets are included in the next\n * RemoteEvent.\n */\n this.bt = !0;\n }\n /**\n * Whether this target has been marked 'current'.\n *\n * 'Current' has special meaning in the RPC protocol: It implies that the\n * Watch backend has sent us all changes up to the point at which the target\n * was added and that the target is consistent with the rest of the watch\n * stream.\n */ get current() {\n return this.Rt;\n }\n /** The last resume token sent to us for this target. */ get resumeToken() {\n return this.At;\n }\n /** Whether this target has pending target adds or target removes. */ get Pt() {\n return 0 !== this.Tt;\n }\n /** Whether we have modified any state that should trigger a snapshot. */ get vt() {\n return this.bt;\n }\n /**\n * Applies the resume token to the TargetChange, but only when it has a new\n * value. Empty resumeTokens are discarded.\n */ Vt(t) {\n t.approximateByteSize() > 0 && (this.bt = !0, this.At = t);\n }\n /**\n * Creates a target change from the current set of changes.\n *\n * To reset the document changes after raising this snapshot, call\n * `clearPendingChanges()`.\n */ St() {\n let t = gs(), e = gs(), n = gs();\n return this.Et.forEach(((s, i) => {\n switch (i) {\n case 0 /* Added */ :\n t = t.add(s);\n break;\n\n case 2 /* Modified */ :\n e = e.add(s);\n break;\n\n case 1 /* Removed */ :\n n = n.add(s);\n break;\n\n default:\n L();\n }\n })), new Ts(this.At, this.Rt, t, e, n);\n }\n /**\n * Resets the document changes and sets `hasPendingChanges` to false.\n */ Dt() {\n this.bt = !1, this.Et = Vs();\n }\n Ct(t, e) {\n this.bt = !0, this.Et = this.Et.insert(t, e);\n }\n xt(t) {\n this.bt = !0, this.Et = this.Et.remove(t);\n }\n Nt() {\n this.Tt += 1;\n }\n kt() {\n this.Tt -= 1;\n }\n Mt() {\n this.bt = !0, this.Rt = !0;\n }\n}\n\n/**\n * A helper class to accumulate watch changes into a RemoteEvent.\n */\nclass Ps {\n constructor(t) {\n this.Ot = t, \n /** The internal state of all tracked targets. */\n this.Ft = new Map, \n /** Keeps track of the documents to update since the last raised snapshot. */\n this.$t = cs(), \n /** A mapping of document keys to their set of target IDs. */\n this.Bt = vs(), \n /**\n * A list of targets with existence filter mismatches. These targets are\n * known to be inconsistent and their listens needs to be re-established by\n * RemoteStore.\n */\n this.Lt = new Wt(it);\n }\n /**\n * Processes and adds the DocumentWatchChange to the current set of changes.\n */ Ut(t) {\n for (const e of t.gt) t.yt && t.yt.isFoundDocument() ? this.qt(e, t.yt) : this.Kt(e, t.key, t.yt);\n for (const e of t.removedTargetIds) this.Kt(e, t.key, t.yt);\n }\n /** Processes and adds the WatchTargetChange to the current set of changes. */ Gt(t) {\n this.forEachTarget(t, (e => {\n const n = this.Qt(e);\n switch (t.state) {\n case 0 /* NoChange */ :\n this.jt(e) && n.Vt(t.resumeToken);\n break;\n\n case 1 /* Added */ :\n // We need to decrement the number of pending acks needed from watch\n // for this targetId.\n n.kt(), n.Pt || \n // We have a freshly added target, so we need to reset any state\n // that we had previously. This can happen e.g. when remove and add\n // back a target for existence filter mismatches.\n n.Dt(), n.Vt(t.resumeToken);\n break;\n\n case 2 /* Removed */ :\n // We need to keep track of removed targets to we can post-filter and\n // remove any target changes.\n // We need to decrement the number of pending acks needed from watch\n // for this targetId.\n n.kt(), n.Pt || this.removeTarget(e);\n break;\n\n case 3 /* Current */ :\n this.jt(e) && (n.Mt(), n.Vt(t.resumeToken));\n break;\n\n case 4 /* Reset */ :\n this.jt(e) && (\n // Reset the target and synthesizes removes for all existing\n // documents. The backend will re-add any documents that still\n // match the target before it sends the next global snapshot.\n this.Wt(e), n.Vt(t.resumeToken));\n break;\n\n default:\n L();\n }\n }));\n }\n /**\n * Iterates over all targetIds that the watch change applies to: either the\n * targetIds explicitly listed in the change or the targetIds of all currently\n * active targets.\n */ forEachTarget(t, e) {\n t.targetIds.length > 0 ? t.targetIds.forEach(e) : this.Ft.forEach(((t, n) => {\n this.jt(n) && e(n);\n }));\n }\n /**\n * Handles existence filters and synthesizes deletes for filter mismatches.\n * Targets that are invalidated by filter mismatches are added to\n * `pendingTargetResets`.\n */ zt(t) {\n const e = t.targetId, n = t.It.count, s = this.Ht(e);\n if (s) {\n const t = s.target;\n if (Le(t)) if (0 === n) {\n // The existence filter told us the document does not exist. We deduce\n // that this document does not exist and apply a deleted document to\n // our updates. Without applying this deleted document there might be\n // another query that will raise this document as part of a snapshot\n // until it is resolved, essentially exposing inconsistency between\n // queries.\n const n = new dt(t.path);\n this.Kt(e, n, ke.newNoDocument(n, ct.min()));\n } else U(1 === n); else {\n this.Jt(e) !== n && (\n // Existence filter mismatch: We reset the mapping and raise a new\n // snapshot with `isFromCache:true`.\n this.Wt(e), this.Lt = this.Lt.add(e));\n }\n }\n }\n /**\n * Converts the currently accumulated state into a remote event at the\n * provided snapshot version. Resets the accumulated changes before returning.\n */ Yt(t) {\n const e = new Map;\n this.Ft.forEach(((n, s) => {\n const i = this.Ht(s);\n if (i) {\n if (n.current && Le(i.target)) {\n // Document queries for document that don't exist can produce an empty\n // result set. To update our local cache, we synthesize a document\n // delete if we have not previously received the document. This\n // resolves the limbo state of the document, removing it from\n // limboDocumentRefs.\n // TODO(dimond): Ideally we would have an explicit lookup target\n // instead resulting in an explicit delete message and we could\n // remove this special logic.\n const e = new dt(i.target.path);\n null !== this.$t.get(e) || this.Xt(s, e) || this.Kt(s, e, ke.newNoDocument(e, t));\n }\n n.vt && (e.set(s, n.St()), n.Dt());\n }\n }));\n let n = gs();\n // We extract the set of limbo-only document updates as the GC logic\n // special-cases documents that do not appear in the target cache.\n \n // TODO(gsoltis): Expand on this comment once GC is available in the JS\n // client.\n this.Bt.forEach(((t, e) => {\n let s = !0;\n e.forEachWhile((t => {\n const e = this.Ht(t);\n return !e || 2 /* LimboResolution */ === e.purpose || (s = !1, !1);\n })), s && (n = n.add(t));\n })), this.$t.forEach(((e, n) => n.setReadTime(t)));\n const s = new Is(t, e, this.Lt, this.$t, n);\n return this.$t = cs(), this.Bt = vs(), this.Lt = new Wt(it), s;\n }\n /**\n * Adds the provided document to the internal list of document updates and\n * its document key to the given target's mapping.\n */\n // Visible for testing.\n qt(t, e) {\n if (!this.jt(t)) return;\n const n = this.Xt(t, e.key) ? 2 /* Modified */ : 0 /* Added */;\n this.Qt(t).Ct(e.key, n), this.$t = this.$t.insert(e.key, e), this.Bt = this.Bt.insert(e.key, this.Zt(e.key).add(t));\n }\n /**\n * Removes the provided document from the target mapping. If the\n * document no longer matches the target, but the document's state is still\n * known (e.g. we know that the document was deleted or we received the change\n * that caused the filter mismatch), the new document can be provided\n * to update the remote document cache.\n */\n // Visible for testing.\n Kt(t, e, n) {\n if (!this.jt(t)) return;\n const s = this.Qt(t);\n this.Xt(t, e) ? s.Ct(e, 1 /* Removed */) : \n // The document may have entered and left the target before we raised a\n // snapshot, so we can just ignore the change.\n s.xt(e), this.Bt = this.Bt.insert(e, this.Zt(e).delete(t)), n && (this.$t = this.$t.insert(e, n));\n }\n removeTarget(t) {\n this.Ft.delete(t);\n }\n /**\n * Returns the current count of documents in the target. This includes both\n * the number of documents that the LocalStore considers to be part of the\n * target as well as any accumulated changes.\n */ Jt(t) {\n const e = this.Qt(t).St();\n return this.Ot.getRemoteKeysForTarget(t).size + e.addedDocuments.size - e.removedDocuments.size;\n }\n /**\n * Increment the number of acks needed from watch before we can consider the\n * server to be 'in-sync' with the client's active targets.\n */ Nt(t) {\n this.Qt(t).Nt();\n }\n Qt(t) {\n let e = this.Ft.get(t);\n return e || (e = new bs, this.Ft.set(t, e)), e;\n }\n Zt(t) {\n let e = this.Bt.get(t);\n return e || (e = new Wt(it), this.Bt = this.Bt.insert(t, e)), e;\n }\n /**\n * Verifies that the user is still interested in this target (by calling\n * `getTargetDataForTarget()`) and that we are not waiting for pending ADDs\n * from watch.\n */ jt(t) {\n const e = null !== this.Ht(t);\n return e || O(\"WatchChangeAggregator\", \"Detected inactive target\", t), e;\n }\n /**\n * Returns the TargetData for an active target (i.e. a target that the user\n * is still interested in that has no outstanding target change requests).\n */ Ht(t) {\n const e = this.Ft.get(t);\n return e && e.Pt ? null : this.Ot.te(t);\n }\n /**\n * Resets the state of a Watch target to its initial state (e.g. sets\n * 'current' to false, clears the resume token and removes its target mapping\n * from all documents).\n */ Wt(t) {\n this.Ft.set(t, new bs);\n this.Ot.getRemoteKeysForTarget(t).forEach((e => {\n this.Kt(t, e, /*updatedDocument=*/ null);\n }));\n }\n /**\n * Returns whether the LocalStore considers the document to be part of the\n * specified target.\n */ Xt(t, e) {\n return this.Ot.getRemoteKeysForTarget(t).has(e);\n }\n}\n\nfunction vs() {\n return new Gt(dt.comparator);\n}\n\nfunction Vs() {\n return new Gt(dt.comparator);\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ const Ss = (() => {\n const t = {\n asc: \"ASCENDING\",\n desc: \"DESCENDING\"\n };\n return t;\n})(), Ds = (() => {\n const t = {\n \"<\": \"LESS_THAN\",\n \"<=\": \"LESS_THAN_OR_EQUAL\",\n \">\": \"GREATER_THAN\",\n \">=\": \"GREATER_THAN_OR_EQUAL\",\n \"==\": \"EQUAL\",\n \"!=\": \"NOT_EQUAL\",\n \"array-contains\": \"ARRAY_CONTAINS\",\n in: \"IN\",\n \"not-in\": \"NOT_IN\",\n \"array-contains-any\": \"ARRAY_CONTAINS_ANY\"\n };\n return t;\n})();\n\n/**\n * This class generates JsonObject values for the Datastore API suitable for\n * sending to either GRPC stub methods or via the JSON/HTTP REST API.\n *\n * The serializer supports both Protobuf.js and Proto3 JSON formats. By\n * setting `useProto3Json` to true, the serializer will use the Proto3 JSON\n * format.\n *\n * For a description of the Proto3 JSON format check\n * https://developers.google.com/protocol-buffers/docs/proto3#json\n *\n * TODO(klimt): We can remove the databaseId argument if we keep the full\n * resource name in documents.\n */\nclass Cs {\n constructor(t, e) {\n this.databaseId = t, this.dt = e;\n }\n}\n\n/**\n * Returns a value for a Date that's appropriate to put into a proto.\n */\nfunction xs(t, e) {\n if (t.dt) {\n return `${new Date(1e3 * e.seconds).toISOString().replace(/\\.\\d*/, \"\").replace(\"Z\", \"\")}.${(\"000000000\" + e.nanoseconds).slice(-9)}Z`;\n }\n return {\n seconds: \"\" + e.seconds,\n nanos: e.nanoseconds\n };\n}\n\n/**\n * Returns a value for bytes that's appropriate to put in a proto.\n *\n * Visible for testing.\n */\nfunction Ns(t, e) {\n return t.dt ? e.toBase64() : e.toUint8Array();\n}\n\n/**\n * Returns a ByteString based on the proto string value.\n */ function ks(t, e) {\n return xs(t, e.toTimestamp());\n}\n\nfunction Ms(t) {\n return U(!!t), ct.fromTimestamp(function(t) {\n const e = te(t);\n return new ut(e.seconds, e.nanos);\n }(t));\n}\n\nfunction Os(t, e) {\n return function(t) {\n return new ht([ \"projects\", t.projectId, \"databases\", t.database ]);\n }(t).child(\"documents\").child(e).canonicalString();\n}\n\nfunction Fs(t) {\n const e = ht.fromString(t);\n return U(ai(e)), e;\n}\n\nfunction $s(t, e) {\n return Os(t.databaseId, e.path);\n}\n\nfunction Bs(t, e) {\n const n = Fs(e);\n if (n.get(1) !== t.databaseId.projectId) throw new Q(G.INVALID_ARGUMENT, \"Tried to deserialize key from different project: \" + n.get(1) + \" vs \" + t.databaseId.projectId);\n if (n.get(3) !== t.databaseId.database) throw new Q(G.INVALID_ARGUMENT, \"Tried to deserialize key from different database: \" + n.get(3) + \" vs \" + t.databaseId.database);\n return new dt(Ks(n));\n}\n\nfunction Ls(t, e) {\n return Os(t.databaseId, e);\n}\n\nfunction Us(t) {\n const e = Fs(t);\n // In v1beta1 queries for collections at the root did not have a trailing\n // \"/documents\". In v1 all resource paths contain \"/documents\". Preserve the\n // ability to read the v1beta1 form for compatibility with queries persisted\n // in the local target cache.\n return 4 === e.length ? ht.emptyPath() : Ks(e);\n}\n\nfunction qs(t) {\n return new ht([ \"projects\", t.databaseId.projectId, \"databases\", t.databaseId.database ]).canonicalString();\n}\n\nfunction Ks(t) {\n return U(t.length > 4 && \"documents\" === t.get(4)), t.popFirst(5);\n}\n\n/** Creates a Document proto from key and fields (but no create/update time) */ function Gs(t, e, n) {\n return {\n name: $s(t, e),\n fields: n.value.mapValue.fields\n };\n}\n\nfunction Qs(t, e, n) {\n const s = Bs(t, e.name), i = Ms(e.updateTime), r = new xe({\n mapValue: {\n fields: e.fields\n }\n }), o = ke.newFoundDocument(s, i, r);\n return n && o.setHasCommittedMutations(), n ? o.setHasCommittedMutations() : o;\n}\n\nfunction js(t, e) {\n return \"found\" in e ? function(t, e) {\n U(!!e.found), e.found.name, e.found.updateTime;\n const n = Bs(t, e.found.name), s = Ms(e.found.updateTime), i = new xe({\n mapValue: {\n fields: e.found.fields\n }\n });\n return ke.newFoundDocument(n, s, i);\n }(t, e) : \"missing\" in e ? function(t, e) {\n U(!!e.missing), U(!!e.readTime);\n const n = Bs(t, e.missing), s = Ms(e.readTime);\n return ke.newNoDocument(n, s);\n }(t, e) : L();\n}\n\nfunction Ws(t, e) {\n let n;\n if (\"targetChange\" in e) {\n e.targetChange;\n // proto3 default value is unset in JSON (undefined), so use 'NO_CHANGE'\n // if unset\n const s = function(t) {\n return \"NO_CHANGE\" === t ? 0 /* NoChange */ : \"ADD\" === t ? 1 /* Added */ : \"REMOVE\" === t ? 2 /* Removed */ : \"CURRENT\" === t ? 3 /* Current */ : \"RESET\" === t ? 4 /* Reset */ : L();\n }(e.targetChange.targetChangeType || \"NO_CHANGE\"), i = e.targetChange.targetIds || [], r = function(t, e) {\n return t.dt ? (U(void 0 === e || \"string\" == typeof e), Xt.fromBase64String(e || \"\")) : (U(void 0 === e || e instanceof Uint8Array), \n Xt.fromUint8Array(e || new Uint8Array));\n }(t, e.targetChange.resumeToken), o = e.targetChange.cause, u = o && function(t) {\n const e = void 0 === t.code ? G.UNKNOWN : rs(t.code);\n return new Q(e, t.message || \"\");\n }\n /**\n * Returns a value for a number (or null) that's appropriate to put into\n * a google.protobuf.Int32Value proto.\n * DO NOT USE THIS FOR ANYTHING ELSE.\n * This method cheats. It's typed as returning \"number\" because that's what\n * our generated proto interfaces say Int32Value must be. But GRPC actually\n * expects a { value: <number> } struct.\n */ (o);\n n = new Rs(s, i, r, u || null);\n } else if (\"documentChange\" in e) {\n e.documentChange;\n const s = e.documentChange;\n s.document, s.document.name, s.document.updateTime;\n const i = Bs(t, s.document.name), r = Ms(s.document.updateTime), o = new xe({\n mapValue: {\n fields: s.document.fields\n }\n }), u = ke.newFoundDocument(i, r, o), c = s.targetIds || [], a = s.removedTargetIds || [];\n n = new Es(c, a, u.key, u);\n } else if (\"documentDelete\" in e) {\n e.documentDelete;\n const s = e.documentDelete;\n s.document;\n const i = Bs(t, s.document), r = s.readTime ? Ms(s.readTime) : ct.min(), o = ke.newNoDocument(i, r), u = s.removedTargetIds || [];\n n = new Es([], u, o.key, o);\n } else if (\"documentRemove\" in e) {\n e.documentRemove;\n const s = e.documentRemove;\n s.document;\n const i = Bs(t, s.document), r = s.removedTargetIds || [];\n n = new Es([], r, i, null);\n } else {\n if (!(\"filter\" in e)) return L();\n {\n e.filter;\n const t = e.filter;\n t.targetId;\n const s = t.count || 0, i = new es(s), r = t.targetId;\n n = new As(r, i);\n }\n }\n return n;\n}\n\nfunction zs(t, e) {\n let n;\n if (e instanceof zn) n = {\n update: Gs(t, e.key, e.value)\n }; else if (e instanceof Zn) n = {\n delete: $s(t, e.key)\n }; else if (e instanceof Hn) n = {\n update: Gs(t, e.key, e.data),\n updateMask: ci(e.fieldMask)\n }; else {\n if (!(e instanceof ts)) return L();\n n = {\n verify: $s(t, e.key)\n };\n }\n return e.fieldTransforms.length > 0 && (n.updateTransforms = e.fieldTransforms.map((t => function(t, e) {\n const n = e.transform;\n if (n instanceof Sn) return {\n fieldPath: e.field.canonicalString(),\n setToServerValue: \"REQUEST_TIME\"\n };\n if (n instanceof Dn) return {\n fieldPath: e.field.canonicalString(),\n appendMissingElements: {\n values: n.elements\n }\n };\n if (n instanceof xn) return {\n fieldPath: e.field.canonicalString(),\n removeAllFromArray: {\n values: n.elements\n }\n };\n if (n instanceof kn) return {\n fieldPath: e.field.canonicalString(),\n increment: n._t\n };\n throw L();\n }(0, t)))), e.precondition.isNone || (n.currentDocument = function(t, e) {\n return void 0 !== e.updateTime ? {\n updateTime: ks(t, e.updateTime)\n } : void 0 !== e.exists ? {\n exists: e.exists\n } : L();\n }(t, e.precondition)), n;\n}\n\nfunction Hs(t, e) {\n const n = e.currentDocument ? function(t) {\n return void 0 !== t.updateTime ? Ln.updateTime(Ms(t.updateTime)) : void 0 !== t.exists ? Ln.exists(t.exists) : Ln.none();\n }(e.currentDocument) : Ln.none(), s = e.updateTransforms ? e.updateTransforms.map((e => function(t, e) {\n let n = null;\n if (\"setToServerValue\" in e) U(\"REQUEST_TIME\" === e.setToServerValue), n = new Sn; else if (\"appendMissingElements\" in e) {\n const t = e.appendMissingElements.values || [];\n n = new Dn(t);\n } else if (\"removeAllFromArray\" in e) {\n const t = e.removeAllFromArray.values || [];\n n = new xn(t);\n } else \"increment\" in e ? n = new kn(t, e.increment) : L();\n const s = ft.fromServerFormat(e.fieldPath);\n return new Fn(s, n);\n }(t, e))) : [];\n if (e.update) {\n e.update.name;\n const i = Bs(t, e.update.name), r = new xe({\n mapValue: {\n fields: e.update.fields\n }\n });\n if (e.updateMask) {\n const t = function(t) {\n const e = t.fieldPaths || [];\n return new Jt(e.map((t => ft.fromServerFormat(t))));\n }(e.updateMask);\n return new Hn(i, r, t, n, s);\n }\n return new zn(i, r, n, s);\n }\n if (e.delete) {\n const s = Bs(t, e.delete);\n return new Zn(s, n);\n }\n if (e.verify) {\n const s = Bs(t, e.verify);\n return new ts(s, n);\n }\n return L();\n}\n\nfunction Js(t, e) {\n return t && t.length > 0 ? (U(void 0 !== e), t.map((t => function(t, e) {\n // NOTE: Deletes don't have an updateTime.\n let n = t.updateTime ? Ms(t.updateTime) : Ms(e);\n return n.isEqual(ct.min()) && (\n // The Firestore Emulator currently returns an update time of 0 for\n // deletes of non-existing documents (rather than null). This breaks the\n // test \"get deleted doc while offline with source=cache\" as NoDocuments\n // with version 0 are filtered by IndexedDb's RemoteDocumentCache.\n // TODO(#2149): Remove this when Emulator is fixed\n n = Ms(e)), new Bn(n, t.transformResults || []);\n }(t, e)))) : [];\n}\n\nfunction Ys(t, e) {\n return {\n documents: [ Ls(t, e.path) ]\n };\n}\n\nfunction Xs(t, e) {\n // Dissect the path into parent, collectionId, and optional key filter.\n const n = {\n structuredQuery: {}\n }, s = e.path;\n null !== e.collectionGroup ? (n.parent = Ls(t, s), n.structuredQuery.from = [ {\n collectionId: e.collectionGroup,\n allDescendants: !0\n } ]) : (n.parent = Ls(t, s.popLast()), n.structuredQuery.from = [ {\n collectionId: s.lastSegment()\n } ]);\n const i = function(t) {\n if (0 === t.length) return;\n const e = t.map((t => \n // visible for testing\n function(t) {\n if (\"==\" /* EQUAL */ === t.op) {\n if (Re(t.value)) return {\n unaryFilter: {\n field: ii(t.field),\n op: \"IS_NAN\"\n }\n };\n if (Ae(t.value)) return {\n unaryFilter: {\n field: ii(t.field),\n op: \"IS_NULL\"\n }\n };\n } else if (\"!=\" /* NOT_EQUAL */ === t.op) {\n if (Re(t.value)) return {\n unaryFilter: {\n field: ii(t.field),\n op: \"IS_NOT_NAN\"\n }\n };\n if (Ae(t.value)) return {\n unaryFilter: {\n field: ii(t.field),\n op: \"IS_NOT_NULL\"\n }\n };\n }\n return {\n fieldFilter: {\n field: ii(t.field),\n op: si(t.op),\n value: t.value\n }\n };\n }(t)));\n if (1 === e.length) return e[0];\n return {\n compositeFilter: {\n op: \"AND\",\n filters: e\n }\n };\n }(e.filters);\n i && (n.structuredQuery.where = i);\n const r = function(t) {\n if (0 === t.length) return;\n return t.map((t => \n // visible for testing\n function(t) {\n return {\n field: ii(t.field),\n direction: ni(t.dir)\n };\n }(t)));\n }(e.orderBy);\n r && (n.structuredQuery.orderBy = r);\n const o = function(t, e) {\n return t.dt || ce(e) ? e : {\n value: e\n };\n }\n /**\n * Returns a number (or null) from a google.protobuf.Int32Value proto.\n */ (t, e.limit);\n var u;\n return null !== o && (n.structuredQuery.limit = o), e.startAt && (n.structuredQuery.startAt = {\n before: (u = e.startAt).inclusive,\n values: u.position\n }), e.endAt && (n.structuredQuery.endAt = function(t) {\n return {\n before: !t.inclusive,\n values: t.position\n };\n }(e.endAt)), n;\n}\n\nfunction Zs(t) {\n let e = Us(t.parent);\n const n = t.structuredQuery, s = n.from ? n.from.length : 0;\n let i = null;\n if (s > 0) {\n U(1 === s);\n const t = n.from[0];\n t.allDescendants ? i = t.collectionId : e = e.child(t.collectionId);\n }\n let r = [];\n n.where && (r = ei(n.where));\n let o = [];\n n.orderBy && (o = n.orderBy.map((t => function(t) {\n return new tn(ri(t.field), \n // visible for testing\n function(t) {\n switch (t) {\n case \"ASCENDING\":\n return \"asc\" /* ASCENDING */;\n\n case \"DESCENDING\":\n return \"desc\" /* DESCENDING */;\n\n default:\n return;\n }\n }\n // visible for testing\n (t.direction));\n }(t))));\n let u = null;\n n.limit && (u = function(t) {\n let e;\n return e = \"object\" == typeof t ? t.value : t, ce(e) ? null : e;\n }(n.limit));\n let c = null;\n n.startAt && (c = function(t) {\n const e = !!t.before, n = t.values || [];\n return new Ze(n, e);\n }(n.startAt));\n let a = null;\n return n.endAt && (a = function(t) {\n const e = !t.before, n = t.values || [];\n return new Ze(n, e);\n }\n // visible for testing\n (n.endAt)), on(e, i, o, r, u, \"F\" /* First */ , c, a);\n}\n\nfunction ti(t, e) {\n const n = function(t, e) {\n switch (e) {\n case 0 /* Listen */ :\n return null;\n\n case 1 /* ExistenceFilterMismatch */ :\n return \"existence-filter-mismatch\";\n\n case 2 /* LimboResolution */ :\n return \"limbo-document\";\n\n default:\n return L();\n }\n }(0, e.purpose);\n return null == n ? null : {\n \"goog-listen-tags\": n\n };\n}\n\nfunction ei(t) {\n return t ? void 0 !== t.unaryFilter ? [ ui(t) ] : void 0 !== t.fieldFilter ? [ oi(t) ] : void 0 !== t.compositeFilter ? t.compositeFilter.filters.map((t => ei(t))).reduce(((t, e) => t.concat(e))) : L() : [];\n}\n\nfunction ni(t) {\n return Ss[t];\n}\n\nfunction si(t) {\n return Ds[t];\n}\n\nfunction ii(t) {\n return {\n fieldPath: t.canonicalString()\n };\n}\n\nfunction ri(t) {\n return ft.fromServerFormat(t.fieldPath);\n}\n\nfunction oi(t) {\n return Ge.create(ri(t.fieldFilter.field), function(t) {\n switch (t) {\n case \"EQUAL\":\n return \"==\" /* EQUAL */;\n\n case \"NOT_EQUAL\":\n return \"!=\" /* NOT_EQUAL */;\n\n case \"GREATER_THAN\":\n return \">\" /* GREATER_THAN */;\n\n case \"GREATER_THAN_OR_EQUAL\":\n return \">=\" /* GREATER_THAN_OR_EQUAL */;\n\n case \"LESS_THAN\":\n return \"<\" /* LESS_THAN */;\n\n case \"LESS_THAN_OR_EQUAL\":\n return \"<=\" /* LESS_THAN_OR_EQUAL */;\n\n case \"ARRAY_CONTAINS\":\n return \"array-contains\" /* ARRAY_CONTAINS */;\n\n case \"IN\":\n return \"in\" /* IN */;\n\n case \"NOT_IN\":\n return \"not-in\" /* NOT_IN */;\n\n case \"ARRAY_CONTAINS_ANY\":\n return \"array-contains-any\" /* ARRAY_CONTAINS_ANY */;\n\n default:\n return L();\n }\n }(t.fieldFilter.op), t.fieldFilter.value);\n}\n\nfunction ui(t) {\n switch (t.unaryFilter.op) {\n case \"IS_NAN\":\n const e = ri(t.unaryFilter.field);\n return Ge.create(e, \"==\" /* EQUAL */ , {\n doubleValue: NaN\n });\n\n case \"IS_NULL\":\n const n = ri(t.unaryFilter.field);\n return Ge.create(n, \"==\" /* EQUAL */ , {\n nullValue: \"NULL_VALUE\"\n });\n\n case \"IS_NOT_NAN\":\n const s = ri(t.unaryFilter.field);\n return Ge.create(s, \"!=\" /* NOT_EQUAL */ , {\n doubleValue: NaN\n });\n\n case \"IS_NOT_NULL\":\n const i = ri(t.unaryFilter.field);\n return Ge.create(i, \"!=\" /* NOT_EQUAL */ , {\n nullValue: \"NULL_VALUE\"\n });\n\n default:\n return L();\n }\n}\n\nfunction ci(t) {\n const e = [];\n return t.fields.forEach((t => e.push(t.canonicalString()))), {\n fieldPaths: e\n };\n}\n\nfunction ai(t) {\n // Resource names have at least 4 components (project ID, database ID)\n return t.length >= 4 && \"projects\" === t.get(0) && \"databases\" === t.get(2);\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Encodes a resource path into a IndexedDb-compatible string form.\n */\nfunction hi(t) {\n let e = \"\";\n for (let n = 0; n < t.length; n++) e.length > 0 && (e = fi(e)), e = li(t.get(n), e);\n return fi(e);\n}\n\n/** Encodes a single segment of a resource path into the given result */ function li(t, e) {\n let n = e;\n const s = t.length;\n for (let e = 0; e < s; e++) {\n const s = t.charAt(e);\n switch (s) {\n case \"\\0\":\n n += \"\u0001\u0010\";\n break;\n\n case \"\u0001\":\n n += \"\u0001\u0011\";\n break;\n\n default:\n n += s;\n }\n }\n return n;\n}\n\n/** Encodes a path separator into the given result */ function fi(t) {\n return t + \"\u0001\u0001\";\n}\n\n/**\n * Decodes the given IndexedDb-compatible string form of a resource path into\n * a ResourcePath instance. Note that this method is not suitable for use with\n * decoding resource names from the server; those are One Platform format\n * strings.\n */ function di(t) {\n // Event the empty path must encode as a path of at least length 2. A path\n // with exactly 2 must be the empty path.\n const e = t.length;\n if (U(e >= 2), 2 === e) return U(\"\u0001\" === t.charAt(0) && \"\u0001\" === t.charAt(1)), ht.emptyPath();\n // Escape characters cannot exist past the second-to-last position in the\n // source value.\n const n = e - 2, s = [];\n let i = \"\";\n for (let r = 0; r < e; ) {\n // The last two characters of a valid encoded path must be a separator, so\n // there must be an end to this segment.\n const e = t.indexOf(\"\u0001\", r);\n (e < 0 || e > n) && L();\n switch (t.charAt(e + 1)) {\n case \"\u0001\":\n const n = t.substring(r, e);\n let o;\n 0 === i.length ? \n // Avoid copying for the common case of a segment that excludes \\0\n // and \\001\n o = n : (i += n, o = i, i = \"\"), s.push(o);\n break;\n\n case \"\u0010\":\n i += t.substring(r, e), i += \"\\0\";\n break;\n\n case \"\u0011\":\n // The escape character can be used in the output to encode itself.\n i += t.substring(r, e + 1);\n break;\n\n default:\n L();\n }\n r = e + 2;\n }\n return new ht(s);\n}\n\n/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ const _i = [ \"userId\", \"batchId\" ];\n\n/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Name of the IndexedDb object store.\n *\n * Note that the name 'owner' is chosen to ensure backwards compatibility with\n * older clients that only supported single locked access to the persistence\n * layer.\n */\n/**\n * Creates a [userId, encodedPath] key for use in the DbDocumentMutations\n * index to iterate over all at document mutations for a given path or lower.\n */\nfunction wi(t, e) {\n return [ t, hi(e) ];\n}\n\n/**\n * Creates a full index key of [userId, encodedPath, batchId] for inserting\n * and deleting into the DbDocumentMutations index.\n */ function mi(t, e, n) {\n return [ t, hi(e), n ];\n}\n\n/**\n * Because we store all the useful information for this store in the key,\n * there is no useful information to store as the value. The raw (unencoded)\n * path cannot be stored because IndexedDb doesn't store prototype\n * information.\n */ const gi = {}, yi = [ \"prefixPath\", \"collectionGroup\", \"readTime\", \"documentId\" ], pi = [ \"prefixPath\", \"collectionGroup\", \"documentId\" ], Ii = [ \"collectionGroup\", \"readTime\", \"prefixPath\", \"documentId\" ], Ti = [ \"canonicalId\", \"targetId\" ], Ei = [ \"targetId\", \"path\" ], Ai = [ \"path\", \"targetId\" ], Ri = [ \"collectionId\", \"parent\" ], bi = [ \"indexId\", \"uid\" ], Pi = [ \"uid\", \"sequenceNumber\" ], vi = [ \"indexId\", \"uid\", \"arrayValue\", \"directionalValue\", \"orderedDocumentKey\", \"documentKey\" ], Vi = [ \"indexId\", \"uid\", \"orderedDocumentKey\" ], Si = [ \"userId\", \"collectionPath\", \"documentId\" ], Di = [ \"userId\", \"collectionPath\", \"largestBatchId\" ], Ci = [ \"userId\", \"collectionGroup\", \"largestBatchId\" ], xi = [ ...[ ...[ ...[ ...[ \"mutationQueues\", \"mutations\", \"documentMutations\", \"remoteDocuments\", \"targets\", \"owner\", \"targetGlobal\", \"targetDocuments\" ], \"clientMetadata\" ], \"remoteDocumentGlobal\" ], \"collectionParents\" ], \"bundles\", \"namedQueries\" ], Ni = [ ...xi, \"documentOverlays\" ], ki = [ \"mutationQueues\", \"mutations\", \"documentMutations\", \"remoteDocumentsV14\", \"targets\", \"owner\", \"targetGlobal\", \"targetDocuments\", \"clientMetadata\", \"remoteDocumentGlobal\", \"collectionParents\", \"bundles\", \"namedQueries\", \"documentOverlays\" ], Mi = ki, Oi = [ ...Mi, \"indexConfiguration\", \"indexState\", \"indexEntries\" ];\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nclass Fi extends Pt {\n constructor(t, e) {\n super(), this.ee = t, this.currentSequenceNumber = e;\n }\n}\n\nfunction $i(t, e) {\n const n = K(t);\n return Dt.N(n.ee, e);\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A batch of mutations that will be sent as one unit to the backend.\n */ class Bi {\n /**\n * @param batchId - The unique ID of this mutation batch.\n * @param localWriteTime - The original write time of this mutation.\n * @param baseMutations - Mutations that are used to populate the base\n * values when this mutation is applied locally. This can be used to locally\n * overwrite values that are persisted in the remote document cache. Base\n * mutations are never sent to the backend.\n * @param mutations - The user-provided mutations in this mutation batch.\n * User-provided mutations are applied both locally and remotely on the\n * backend.\n */\n constructor(t, e, n, s) {\n this.batchId = t, this.localWriteTime = e, this.baseMutations = n, this.mutations = s;\n }\n /**\n * Applies all the mutations in this MutationBatch to the specified document\n * to compute the state of the remote document\n *\n * @param document - The document to apply mutations to.\n * @param batchResult - The result of applying the MutationBatch to the\n * backend.\n */ applyToRemoteDocument(t, e) {\n const n = e.mutationResults;\n for (let e = 0; e < this.mutations.length; e++) {\n const s = this.mutations[e];\n if (s.key.isEqual(t.key)) {\n Gn(s, t, n[e]);\n }\n }\n }\n /**\n * Computes the local view of a document given all the mutations in this\n * batch.\n *\n * @param document - The document to apply mutations to.\n * @param mutatedFields - Fields that have been updated before applying this mutation batch.\n * @returns A `FieldMask` representing all the fields that are mutated.\n */ applyToLocalView(t, e) {\n // First, apply the base state. This allows us to apply non-idempotent\n // transform against a consistent set of values.\n for (const n of this.baseMutations) n.key.isEqual(t.key) && (e = Qn(n, t, e, this.localWriteTime));\n // Second, apply all user-provided mutations.\n for (const n of this.mutations) n.key.isEqual(t.key) && (e = Qn(n, t, e, this.localWriteTime));\n return e;\n }\n /**\n * Computes the local view for all provided documents given the mutations in\n * this batch. Returns a `DocumentKey` to `Mutation` map which can be used to\n * replace all the mutation applications.\n */ applyToLocalDocumentSet(t, e) {\n // TODO(mrschmidt): This implementation is O(n^2). If we apply the mutations\n // directly (as done in `applyToLocalView()`), we can reduce the complexity\n // to O(n).\n const n = ds();\n return this.mutations.forEach((s => {\n const i = t.get(s.key), r = i.overlayedDocument;\n // TODO(mutabledocuments): This method should take a MutableDocumentMap\n // and we should remove this cast.\n let o = this.applyToLocalView(r, i.mutatedFields);\n // Set mutatedFields to null if the document is only from local mutations.\n // This creates a Set or Delete mutation, instead of trying to create a\n // patch mutation as the overlay.\n o = e.has(s.key) ? null : o;\n const u = Kn(r, o);\n null !== u && n.set(s.key, u), r.isValidDocument() || r.convertToNoDocument(ct.min());\n })), n;\n }\n keys() {\n return this.mutations.reduce(((t, e) => t.add(e.key)), gs());\n }\n isEqual(t) {\n return this.batchId === t.batchId && rt(this.mutations, t.mutations, ((t, e) => Wn(t, e))) && rt(this.baseMutations, t.baseMutations, ((t, e) => Wn(t, e)));\n }\n}\n\n/** The result of applying a mutation batch to the backend. */ class Li {\n constructor(t, e, n, \n /**\n * A pre-computed mapping from each mutated document to the resulting\n * version.\n */\n s) {\n this.batch = t, this.commitVersion = e, this.mutationResults = n, this.docVersions = s;\n }\n /**\n * Creates a new MutationBatchResult for the given batch and results. There\n * must be one result for each mutation in the batch. This static factory\n * caches a document=>version mapping (docVersions).\n */ static from(t, e, n) {\n U(t.mutations.length === n.length);\n let s = ws;\n const i = t.mutations;\n for (let t = 0; t < i.length; t++) s = s.insert(i[t].key, n[t].version);\n return new Li(t, e, n, s);\n }\n}\n\n/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Representation of an overlay computed by Firestore.\n *\n * Holds information about a mutation and the largest batch id in Firestore when\n * the mutation was created.\n */ class Ui {\n constructor(t, e) {\n this.largestBatchId = t, this.mutation = e;\n }\n getKey() {\n return this.mutation.key;\n }\n isEqual(t) {\n return null !== t && this.mutation === t.mutation;\n }\n toString() {\n return `Overlay{\\n largestBatchId: ${this.largestBatchId},\\n mutation: ${this.mutation.toString()}\\n }`;\n }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * An immutable set of metadata that the local store tracks for each target.\n */ class qi {\n constructor(\n /** The target being listened to. */\n t, \n /**\n * The target ID to which the target corresponds; Assigned by the\n * LocalStore for user listens and by the SyncEngine for limbo watches.\n */\n e, \n /** The purpose of the target. */\n n, \n /**\n * The sequence number of the last transaction during which this target data\n * was modified.\n */\n s, \n /** The latest snapshot version seen for this target. */\n i = ct.min()\n /**\n * The maximum snapshot version at which the associated view\n * contained no limbo documents.\n */ , r = ct.min()\n /**\n * An opaque, server-assigned token that allows watching a target to be\n * resumed after disconnecting without retransmitting all the data that\n * matches the target. The resume token essentially identifies a point in\n * time from which the server should resume sending results.\n */ , o = Xt.EMPTY_BYTE_STRING) {\n this.target = t, this.targetId = e, this.purpose = n, this.sequenceNumber = s, this.snapshotVersion = i, \n this.lastLimboFreeSnapshotVersion = r, this.resumeToken = o;\n }\n /** Creates a new target data instance with an updated sequence number. */ withSequenceNumber(t) {\n return new qi(this.target, this.targetId, this.purpose, t, this.snapshotVersion, this.lastLimboFreeSnapshotVersion, this.resumeToken);\n }\n /**\n * Creates a new target data instance with an updated resume token and\n * snapshot version.\n */ withResumeToken(t, e) {\n return new qi(this.target, this.targetId, this.purpose, this.sequenceNumber, e, this.lastLimboFreeSnapshotVersion, t);\n }\n /**\n * Creates a new target data instance with an updated last limbo free\n * snapshot version number.\n */ withLastLimboFreeSnapshotVersion(t) {\n return new qi(this.target, this.targetId, this.purpose, this.sequenceNumber, this.snapshotVersion, t, this.resumeToken);\n }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** Serializer for values stored in the LocalStore. */ class Ki {\n constructor(t) {\n this.ne = t;\n }\n}\n\n/** Decodes a remote document from storage locally to a Document. */ function Gi(t, e) {\n let n;\n if (e.document) n = Qs(t.ne, e.document, !!e.hasCommittedMutations); else if (e.noDocument) {\n const t = dt.fromSegments(e.noDocument.path), s = zi(e.noDocument.readTime);\n n = ke.newNoDocument(t, s), e.hasCommittedMutations && n.setHasCommittedMutations();\n } else {\n if (!e.unknownDocument) return L();\n {\n const t = dt.fromSegments(e.unknownDocument.path), s = zi(e.unknownDocument.version);\n n = ke.newUnknownDocument(t, s);\n }\n }\n return e.readTime && n.setReadTime(function(t) {\n const e = new ut(t[0], t[1]);\n return ct.fromTimestamp(e);\n }(e.readTime)), n;\n}\n\n/** Encodes a document for storage locally. */ function Qi(t, e) {\n const n = e.key, s = {\n prefixPath: n.getCollectionPath().popLast().toArray(),\n collectionGroup: n.collectionGroup,\n documentId: n.path.lastSegment(),\n readTime: ji(e.readTime),\n hasCommittedMutations: e.hasCommittedMutations\n };\n if (e.isFoundDocument()) s.document = function(t, e) {\n return {\n name: $s(t, e.key),\n fields: e.data.value.mapValue.fields,\n updateTime: xs(t, e.version.toTimestamp())\n };\n }(t.ne, e); else if (e.isNoDocument()) s.noDocument = {\n path: n.path.toArray(),\n readTime: Wi(e.version)\n }; else {\n if (!e.isUnknownDocument()) return L();\n s.unknownDocument = {\n path: n.path.toArray(),\n version: Wi(e.version)\n };\n }\n return s;\n}\n\nfunction ji(t) {\n const e = t.toTimestamp();\n return [ e.seconds, e.nanoseconds ];\n}\n\nfunction Wi(t) {\n const e = t.toTimestamp();\n return {\n seconds: e.seconds,\n nanoseconds: e.nanoseconds\n };\n}\n\nfunction zi(t) {\n const e = new ut(t.seconds, t.nanoseconds);\n return ct.fromTimestamp(e);\n}\n\n/** Encodes a batch of mutations into a DbMutationBatch for local storage. */\n/** Decodes a DbMutationBatch into a MutationBatch */\nfunction Hi(t, e) {\n const n = (e.baseMutations || []).map((e => Hs(t.ne, e)));\n // Squash old transform mutations into existing patch or set mutations.\n // The replacement of representing `transforms` with `update_transforms`\n // on the SDK means that old `transform` mutations stored in IndexedDB need\n // to be updated to `update_transforms`.\n // TODO(b/174608374): Remove this code once we perform a schema migration.\n for (let t = 0; t < e.mutations.length - 1; ++t) {\n const n = e.mutations[t];\n if (t + 1 < e.mutations.length && void 0 !== e.mutations[t + 1].transform) {\n const s = e.mutations[t + 1];\n n.updateTransforms = s.transform.fieldTransforms, e.mutations.splice(t + 1, 1), \n ++t;\n }\n }\n const s = e.mutations.map((e => Hs(t.ne, e))), i = ut.fromMillis(e.localWriteTimeMs);\n return new Bi(e.batchId, i, n, s);\n}\n\n/** Decodes a DbTarget into TargetData */ function Ji(t) {\n const e = zi(t.readTime), n = void 0 !== t.lastLimboFreeSnapshotVersion ? zi(t.lastLimboFreeSnapshotVersion) : ct.min();\n let s;\n var i;\n return void 0 !== t.query.documents ? (U(1 === (i = t.query).documents.length), \n s = dn(un(Us(i.documents[0])))) : s = function(t) {\n return dn(Zs(t));\n }(t.query), new qi(s, t.targetId, 0 /* Listen */ , t.lastListenSequenceNumber, e, n, Xt.fromBase64String(t.resumeToken));\n}\n\n/** Encodes TargetData into a DbTarget for storage locally. */ function Yi(t, e) {\n const n = Wi(e.snapshotVersion), s = Wi(e.lastLimboFreeSnapshotVersion);\n let i;\n i = Le(e.target) ? Ys(t.ne, e.target) : Xs(t.ne, e.target);\n // We can't store the resumeToken as a ByteString in IndexedDb, so we\n // convert it to a base64 string for storage.\n const r = e.resumeToken.toBase64();\n // lastListenSequenceNumber is always 0 until we do real GC.\n return {\n targetId: e.targetId,\n canonicalId: Fe(e.target),\n readTime: n,\n resumeToken: r,\n lastListenSequenceNumber: e.sequenceNumber,\n lastLimboFreeSnapshotVersion: s,\n query: i\n };\n}\n\n/**\n * A helper function for figuring out what kind of query has been stored.\n */\n/**\n * Encodes a `BundledQuery` from bundle proto to a Query object.\n *\n * This reconstructs the original query used to build the bundle being loaded,\n * including features exists only in SDKs (for example: limit-to-last).\n */\nfunction Xi(t) {\n const e = Zs({\n parent: t.parent,\n structuredQuery: t.structuredQuery\n });\n return \"LAST\" === t.limitType ? _n(e, e.limit, \"L\" /* Last */) : e;\n}\n\n/** Encodes a NamedQuery proto object to a NamedQuery model object. */\n/** Encodes a DbDocumentOverlay object to an Overlay model object. */\nfunction Zi(t, e) {\n return new Ui(e.largestBatchId, Hs(t.ne, e.overlayMutation));\n}\n\n/** Decodes an Overlay model object into a DbDocumentOverlay object. */\n/**\n * Returns the DbDocumentOverlayKey corresponding to the given user and\n * document key.\n */\nfunction tr(t, e) {\n const n = e.path.lastSegment();\n return [ t, hi(e.path.popLast()), n ];\n}\n\nfunction er(t, e, n, s) {\n return {\n indexId: t,\n uid: e.uid || \"\",\n sequenceNumber: n,\n readTime: Wi(s.readTime),\n documentKey: hi(s.documentKey.path),\n largestBatchId: s.largestBatchId\n };\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ class nr {\n getBundleMetadata(t, e) {\n return sr(t).get(e).next((t => {\n if (t) return {\n id: (e = t).bundleId,\n createTime: zi(e.createTime),\n version: e.version\n };\n /** Encodes a DbBundle to a BundleMetadata object. */\n var e;\n /** Encodes a BundleMetadata to a DbBundle. */ }));\n }\n saveBundleMetadata(t, e) {\n return sr(t).put({\n bundleId: (n = e).id,\n createTime: Wi(Ms(n.createTime)),\n version: n.version\n });\n var n;\n /** Encodes a DbNamedQuery to a NamedQuery. */ }\n getNamedQuery(t, e) {\n return ir(t).get(e).next((t => {\n if (t) return {\n name: (e = t).name,\n query: Xi(e.bundledQuery),\n readTime: zi(e.readTime)\n };\n var e;\n /** Encodes a NamedQuery from a bundle proto to a DbNamedQuery. */ }));\n }\n saveNamedQuery(t, e) {\n return ir(t).put(function(t) {\n return {\n name: t.name,\n readTime: Wi(Ms(t.readTime)),\n bundledQuery: t.bundledQuery\n };\n }(e));\n }\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the bundles object store.\n */ function sr(t) {\n return $i(t, \"bundles\");\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the namedQueries object store.\n */ function ir(t) {\n return $i(t, \"namedQueries\");\n}\n\n/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Implementation of DocumentOverlayCache using IndexedDb.\n */ class rr {\n /**\n * @param serializer - The document serializer.\n * @param userId - The userId for which we are accessing overlays.\n */\n constructor(t, e) {\n this.wt = t, this.userId = e;\n }\n static se(t, e) {\n const n = e.uid || \"\";\n return new rr(t, n);\n }\n getOverlay(t, e) {\n return or(t).get(tr(this.userId, e)).next((t => t ? Zi(this.wt, t) : null));\n }\n getOverlays(t, e) {\n const n = fs();\n return Vt.forEach(e, (e => this.getOverlay(t, e).next((t => {\n null !== t && n.set(e, t);\n })))).next((() => n));\n }\n saveOverlays(t, e, n) {\n const s = [];\n return n.forEach(((n, i) => {\n const r = new Ui(e, i);\n s.push(this.ie(t, r));\n })), Vt.waitFor(s);\n }\n removeOverlaysForBatchId(t, e, n) {\n const s = new Set;\n // Get the set of unique collection paths.\n e.forEach((t => s.add(hi(t.getCollectionPath()))));\n const i = [];\n return s.forEach((e => {\n const s = IDBKeyRange.bound([ this.userId, e, n ], [ this.userId, e, n + 1 ], \n /*lowerOpen=*/ !1, \n /*upperOpen=*/ !0);\n i.push(or(t).W(\"collectionPathOverlayIndex\", s));\n })), Vt.waitFor(i);\n }\n getOverlaysForCollection(t, e, n) {\n const s = fs(), i = hi(e), r = IDBKeyRange.bound([ this.userId, i, n ], [ this.userId, i, Number.POSITIVE_INFINITY ], \n /*lowerOpen=*/ !0);\n return or(t).K(\"collectionPathOverlayIndex\", r).next((t => {\n for (const e of t) {\n const t = Zi(this.wt, e);\n s.set(t.getKey(), t);\n }\n return s;\n }));\n }\n getOverlaysForCollectionGroup(t, e, n, s) {\n const i = fs();\n let r;\n // We want batch IDs larger than `sinceBatchId`, and so the lower bound\n // is not inclusive.\n const o = IDBKeyRange.bound([ this.userId, e, n ], [ this.userId, e, Number.POSITIVE_INFINITY ], \n /*lowerOpen=*/ !0);\n return or(t).J({\n index: \"collectionGroupOverlayIndex\",\n range: o\n }, ((t, e, n) => {\n // We do not want to return partial batch overlays, even if the size\n // of the result set exceeds the given `count` argument. Therefore, we\n // continue to aggregate results even after the result size exceeds\n // `count` if there are more overlays from the `currentBatchId`.\n const o = Zi(this.wt, e);\n i.size() < s || o.largestBatchId === r ? (i.set(o.getKey(), o), r = o.largestBatchId) : n.done();\n })).next((() => i));\n }\n ie(t, e) {\n return or(t).put(function(t, e, n) {\n const [s, i, r] = tr(e, n.mutation.key);\n return {\n userId: e,\n collectionPath: i,\n documentId: r,\n collectionGroup: n.mutation.key.getCollectionGroup(),\n largestBatchId: n.largestBatchId,\n overlayMutation: zs(t.ne, n.mutation)\n };\n }(this.wt, this.userId, e));\n }\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the document overlay object store.\n */ function or(t) {\n return $i(t, \"documentOverlays\");\n}\n\n/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// Note: This code is copied from the backend. Code that is not used by\n// Firestore was removed.\n/** Firestore index value writer. */\nclass ur {\n constructor() {}\n // The write methods below short-circuit writing terminators for values\n // containing a (terminating) truncated value.\n // As an example, consider the resulting encoding for:\n // [\"bar\", [2, \"foo\"]] -> (STRING, \"bar\", TERM, ARRAY, NUMBER, 2, STRING, \"foo\", TERM, TERM, TERM)\n // [\"bar\", [2, truncated(\"foo\")]] -> (STRING, \"bar\", TERM, ARRAY, NUMBER, 2, STRING, \"foo\", TRUNC)\n // [\"bar\", truncated([\"foo\"])] -> (STRING, \"bar\", TERM, ARRAY. STRING, \"foo\", TERM, TRUNC)\n /** Writes an index value. */\n re(t, e) {\n this.oe(t, e), \n // Write separator to split index values\n // (see go/firestore-storage-format#encodings).\n e.ue();\n }\n oe(t, e) {\n if (\"nullValue\" in t) this.ce(e, 5); else if (\"booleanValue\" in t) this.ce(e, 10), \n e.ae(t.booleanValue ? 1 : 0); else if (\"integerValue\" in t) this.ce(e, 15), e.ae(ee(t.integerValue)); else if (\"doubleValue\" in t) {\n const n = ee(t.doubleValue);\n isNaN(n) ? this.ce(e, 13) : (this.ce(e, 15), ae(n) ? \n // -0.0, 0 and 0.0 are all considered the same\n e.ae(0) : e.ae(n));\n } else if (\"timestampValue\" in t) {\n const n = t.timestampValue;\n this.ce(e, 20), \"string\" == typeof n ? e.he(n) : (e.he(`${n.seconds || \"\"}`), e.ae(n.nanos || 0));\n } else if (\"stringValue\" in t) this.le(t.stringValue, e), this.fe(e); else if (\"bytesValue\" in t) this.ce(e, 30), \n e.de(ne(t.bytesValue)), this.fe(e); else if (\"referenceValue\" in t) this._e(t.referenceValue, e); else if (\"geoPointValue\" in t) {\n const n = t.geoPointValue;\n this.ce(e, 45), e.ae(n.latitude || 0), e.ae(n.longitude || 0);\n } else \"mapValue\" in t ? ve(t) ? this.ce(e, Number.MAX_SAFE_INTEGER) : (this.we(t.mapValue, e), \n this.fe(e)) : \"arrayValue\" in t ? (this.me(t.arrayValue, e), this.fe(e)) : L();\n }\n le(t, e) {\n this.ce(e, 25), this.ge(t, e);\n }\n ge(t, e) {\n e.he(t);\n }\n we(t, e) {\n const n = t.fields || {};\n this.ce(e, 55);\n for (const t of Object.keys(n)) this.le(t, e), this.oe(n[t], e);\n }\n me(t, e) {\n const n = t.values || [];\n this.ce(e, 50);\n for (const t of n) this.oe(t, e);\n }\n _e(t, e) {\n this.ce(e, 37);\n dt.fromName(t).path.forEach((t => {\n this.ce(e, 60), this.ge(t, e);\n }));\n }\n ce(t, e) {\n t.ae(e);\n }\n fe(t) {\n // While the SDK does not implement truncation, the truncation marker is\n // used to terminate all variable length values (which are strings, bytes,\n // references, arrays and maps).\n t.ae(2);\n }\n}\n\nur.ye = new ur;\n\n/**\n * Counts the number of zeros in a byte.\n *\n * Visible for testing.\n */\nfunction cr(t) {\n if (0 === t) return 8;\n let e = 0;\n return t >> 4 == 0 && (\n // Test if the first four bits are zero.\n e += 4, t <<= 4), t >> 6 == 0 && (\n // Test if the first two (or next two) bits are zero.\n e += 2, t <<= 2), t >> 7 == 0 && (\n // Test if the remaining bit is zero.\n e += 1), e;\n}\n\n/** Counts the number of leading zeros in the given byte array. */\n/**\n * Returns the number of bytes required to store \"value\". Leading zero bytes\n * are skipped.\n */\nfunction ar(t) {\n // This is just the number of bytes for the unsigned representation of the number.\n const e = 64 - function(t) {\n let e = 0;\n for (let n = 0; n < 8; ++n) {\n const s = cr(255 & t[n]);\n if (e += s, 8 !== s) break;\n }\n return e;\n }(t);\n return Math.ceil(e / 8);\n}\n\n/**\n * OrderedCodeWriter is a minimal-allocation implementation of the writing\n * behavior defined by the backend.\n *\n * The code is ported from its Java counterpart.\n */ class hr {\n constructor() {\n this.buffer = new Uint8Array(1024), this.position = 0;\n }\n pe(t) {\n const e = t[Symbol.iterator]();\n let n = e.next();\n for (;!n.done; ) this.Ie(n.value), n = e.next();\n this.Te();\n }\n Ee(t) {\n const e = t[Symbol.iterator]();\n let n = e.next();\n for (;!n.done; ) this.Ae(n.value), n = e.next();\n this.Re();\n }\n /** Writes utf8 bytes into this byte sequence, ascending. */ be(t) {\n for (const e of t) {\n const t = e.charCodeAt(0);\n if (t < 128) this.Ie(t); else if (t < 2048) this.Ie(960 | t >>> 6), this.Ie(128 | 63 & t); else if (e < \"\\ud800\" || \"\\udbff\" < e) this.Ie(480 | t >>> 12), \n this.Ie(128 | 63 & t >>> 6), this.Ie(128 | 63 & t); else {\n const t = e.codePointAt(0);\n this.Ie(240 | t >>> 18), this.Ie(128 | 63 & t >>> 12), this.Ie(128 | 63 & t >>> 6), \n this.Ie(128 | 63 & t);\n }\n }\n this.Te();\n }\n /** Writes utf8 bytes into this byte sequence, descending */ Pe(t) {\n for (const e of t) {\n const t = e.charCodeAt(0);\n if (t < 128) this.Ae(t); else if (t < 2048) this.Ae(960 | t >>> 6), this.Ae(128 | 63 & t); else if (e < \"\\ud800\" || \"\\udbff\" < e) this.Ae(480 | t >>> 12), \n this.Ae(128 | 63 & t >>> 6), this.Ae(128 | 63 & t); else {\n const t = e.codePointAt(0);\n this.Ae(240 | t >>> 18), this.Ae(128 | 63 & t >>> 12), this.Ae(128 | 63 & t >>> 6), \n this.Ae(128 | 63 & t);\n }\n }\n this.Re();\n }\n ve(t) {\n // Values are encoded with a single byte length prefix, followed by the\n // actual value in big-endian format with leading 0 bytes dropped.\n const e = this.Ve(t), n = ar(e);\n this.Se(1 + n), this.buffer[this.position++] = 255 & n;\n // Write the length\n for (let t = e.length - n; t < e.length; ++t) this.buffer[this.position++] = 255 & e[t];\n }\n De(t) {\n // Values are encoded with a single byte length prefix, followed by the\n // inverted value in big-endian format with leading 0 bytes dropped.\n const e = this.Ve(t), n = ar(e);\n this.Se(1 + n), this.buffer[this.position++] = ~(255 & n);\n // Write the length\n for (let t = e.length - n; t < e.length; ++t) this.buffer[this.position++] = ~(255 & e[t]);\n }\n /**\n * Writes the \"infinity\" byte sequence that sorts after all other byte\n * sequences written in ascending order.\n */ Ce() {\n this.xe(255), this.xe(255);\n }\n /**\n * Writes the \"infinity\" byte sequence that sorts before all other byte\n * sequences written in descending order.\n */ Ne() {\n this.ke(255), this.ke(255);\n }\n /**\n * Resets the buffer such that it is the same as when it was newly\n * constructed.\n */ reset() {\n this.position = 0;\n }\n seed(t) {\n this.Se(t.length), this.buffer.set(t, this.position), this.position += t.length;\n }\n /** Makes a copy of the encoded bytes in this buffer. */ Me() {\n return this.buffer.slice(0, this.position);\n }\n /**\n * Encodes `val` into an encoding so that the order matches the IEEE 754\n * floating-point comparison results with the following exceptions:\n * -0.0 < 0.0\n * all non-NaN < NaN\n * NaN = NaN\n */ Ve(t) {\n const e = \n /** Converts a JavaScript number to a byte array (using big endian encoding). */\n function(t) {\n const e = new DataView(new ArrayBuffer(8));\n return e.setFloat64(0, t, /* littleEndian= */ !1), new Uint8Array(e.buffer);\n }(t), n = 0 != (128 & e[0]);\n // Check if the first bit is set. We use a bit mask since value[0] is\n // encoded as a number from 0 to 255.\n // Revert the two complement to get natural ordering\n e[0] ^= n ? 255 : 128;\n for (let t = 1; t < e.length; ++t) e[t] ^= n ? 255 : 0;\n return e;\n }\n /** Writes a single byte ascending to the buffer. */ Ie(t) {\n const e = 255 & t;\n 0 === e ? (this.xe(0), this.xe(255)) : 255 === e ? (this.xe(255), this.xe(0)) : this.xe(e);\n }\n /** Writes a single byte descending to the buffer. */ Ae(t) {\n const e = 255 & t;\n 0 === e ? (this.ke(0), this.ke(255)) : 255 === e ? (this.ke(255), this.ke(0)) : this.ke(t);\n }\n Te() {\n this.xe(0), this.xe(1);\n }\n Re() {\n this.ke(0), this.ke(1);\n }\n xe(t) {\n this.Se(1), this.buffer[this.position++] = t;\n }\n ke(t) {\n this.Se(1), this.buffer[this.position++] = ~t;\n }\n Se(t) {\n const e = t + this.position;\n if (e <= this.buffer.length) return;\n // Try doubling.\n let n = 2 * this.buffer.length;\n // Still not big enough? Just allocate the right size.\n n < e && (n = e);\n // Create the new buffer.\n const s = new Uint8Array(n);\n s.set(this.buffer), // copy old data\n this.buffer = s;\n }\n}\n\nclass lr {\n constructor(t) {\n this.Oe = t;\n }\n de(t) {\n this.Oe.pe(t);\n }\n he(t) {\n this.Oe.be(t);\n }\n ae(t) {\n this.Oe.ve(t);\n }\n ue() {\n this.Oe.Ce();\n }\n}\n\nclass fr {\n constructor(t) {\n this.Oe = t;\n }\n de(t) {\n this.Oe.Ee(t);\n }\n he(t) {\n this.Oe.Pe(t);\n }\n ae(t) {\n this.Oe.De(t);\n }\n ue() {\n this.Oe.Ne();\n }\n}\n\n/**\n * Implements `DirectionalIndexByteEncoder` using `OrderedCodeWriter` for the\n * actual encoding.\n */ class dr {\n constructor() {\n this.Oe = new hr, this.Fe = new lr(this.Oe), this.$e = new fr(this.Oe);\n }\n seed(t) {\n this.Oe.seed(t);\n }\n Be(t) {\n return 0 /* ASCENDING */ === t ? this.Fe : this.$e;\n }\n Me() {\n return this.Oe.Me();\n }\n reset() {\n this.Oe.reset();\n }\n}\n\n/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** Represents an index entry saved by the SDK in persisted storage. */ class _r {\n constructor(t, e, n, s) {\n this.indexId = t, this.documentKey = e, this.arrayValue = n, this.directionalValue = s;\n }\n /**\n * Returns an IndexEntry entry that sorts immediately after the current\n * directional value.\n */ Le() {\n const t = this.directionalValue.length, e = 0 === t || 255 === this.directionalValue[t - 1] ? t + 1 : t, n = new Uint8Array(e);\n return n.set(this.directionalValue, 0), e !== t ? n.set([ 0 ], this.directionalValue.length) : ++n[n.length - 1], \n new _r(this.indexId, this.documentKey, this.arrayValue, n);\n }\n}\n\nfunction wr(t, e) {\n let n = t.indexId - e.indexId;\n return 0 !== n ? n : (n = mr(t.arrayValue, e.arrayValue), 0 !== n ? n : (n = mr(t.directionalValue, e.directionalValue), \n 0 !== n ? n : dt.comparator(t.documentKey, e.documentKey)));\n}\n\nfunction mr(t, e) {\n for (let n = 0; n < t.length && n < e.length; ++n) {\n const s = t[n] - e[n];\n if (0 !== s) return s;\n }\n return t.length - e.length;\n}\n\n/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A light query planner for Firestore.\n *\n * This class matches a `FieldIndex` against a Firestore Query `Target`. It\n * determines whether a given index can be used to serve the specified target.\n *\n * The following table showcases some possible index configurations:\n *\n * Query | Index\n * -----------------------------------------------------------------------------\n * where('a', '==', 'a').where('b', '==', 'b') | a ASC, b DESC\n * where('a', '==', 'a').where('b', '==', 'b') | a ASC\n * where('a', '==', 'a').where('b', '==', 'b') | b DESC\n * where('a', '>=', 'a').orderBy('a') | a ASC\n * where('a', '>=', 'a').orderBy('a', 'desc') | a DESC\n * where('a', '>=', 'a').orderBy('a').orderBy('b') | a ASC, b ASC\n * where('a', '>=', 'a').orderBy('a').orderBy('b') | a ASC\n * where('a', 'array-contains', 'a').orderBy('b') | a CONTAINS, b ASCENDING\n * where('a', 'array-contains', 'a').orderBy('b') | a CONTAINS\n */ class gr {\n constructor(t) {\n this.collectionId = null != t.collectionGroup ? t.collectionGroup : t.path.lastSegment(), \n this.Ue = t.orderBy, this.qe = [];\n for (const e of t.filters) {\n const t = e;\n t.ht() ? this.Ke = t : this.qe.push(t);\n }\n }\n /**\n * Returns whether the index can be used to serve the TargetIndexMatcher's\n * target.\n *\n * An index is considered capable of serving the target when:\n * - The target uses all index segments for its filters and orderBy clauses.\n * The target can have additional filter and orderBy clauses, but not\n * fewer.\n * - If an ArrayContains/ArrayContainsAnyfilter is used, the index must also\n * have a corresponding `CONTAINS` segment.\n * - All directional index segments can be mapped to the target as a series of\n * equality filters, a single inequality filter and a series of orderBy\n * clauses.\n * - The segments that represent the equality filters may appear out of order.\n * - The optional segment for the inequality filter must appear after all\n * equality segments.\n * - The segments that represent that orderBy clause of the target must appear\n * in order after all equality and inequality segments. Single orderBy\n * clauses cannot be skipped, but a continuous orderBy suffix may be\n * omitted.\n */ Ge(t) {\n // If there is an array element, find a matching filter.\n const e = wt(t);\n if (void 0 !== e && !this.Qe(e)) return !1;\n const n = mt(t);\n let s = 0, i = 0;\n // Process all equalities first. Equalities can appear out of order.\n for (;s < n.length && this.Qe(n[s]); ++s) ;\n // If we already have processed all segments, all segments are used to serve\n // the equality filters and we do not need to map any segments to the\n // target's inequality and orderBy clauses.\n if (s === n.length) return !0;\n // If there is an inequality filter, the next segment must match both the\n // filter and the first orderBy clause.\n if (void 0 !== this.Ke) {\n const t = n[s];\n if (!this.je(this.Ke, t) || !this.We(this.Ue[i++], t)) return !1;\n ++s;\n }\n // All remaining segments need to represent the prefix of the target's\n // orderBy.\n for (;s < n.length; ++s) {\n const t = n[s];\n if (i >= this.Ue.length || !this.We(this.Ue[i++], t)) return !1;\n }\n return !0;\n }\n Qe(t) {\n for (const e of this.qe) if (this.je(e, t)) return !0;\n return !1;\n }\n je(t, e) {\n if (void 0 === t || !t.field.isEqual(e.fieldPath)) return !1;\n const n = \"array-contains\" /* ARRAY_CONTAINS */ === t.op || \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ === t.op;\n return 2 /* CONTAINS */ === e.kind === n;\n }\n We(t, e) {\n return !!t.field.isEqual(e.fieldPath) && (0 /* ASCENDING */ === e.kind && \"asc\" /* ASCENDING */ === t.dir || 1 /* DESCENDING */ === e.kind && \"desc\" /* DESCENDING */ === t.dir);\n }\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * An in-memory implementation of IndexManager.\n */ class yr {\n constructor() {\n this.ze = new pr;\n }\n addToCollectionParentIndex(t, e) {\n return this.ze.add(e), Vt.resolve();\n }\n getCollectionParents(t, e) {\n return Vt.resolve(this.ze.getEntries(e));\n }\n addFieldIndex(t, e) {\n // Field indices are not supported with memory persistence.\n return Vt.resolve();\n }\n deleteFieldIndex(t, e) {\n // Field indices are not supported with memory persistence.\n return Vt.resolve();\n }\n getDocumentsMatchingTarget(t, e) {\n // Field indices are not supported with memory persistence.\n return Vt.resolve(null);\n }\n getIndexType(t, e) {\n // Field indices are not supported with memory persistence.\n return Vt.resolve(0 /* NONE */);\n }\n getFieldIndexes(t, e) {\n // Field indices are not supported with memory persistence.\n return Vt.resolve([]);\n }\n getNextCollectionGroupToUpdate(t) {\n // Field indices are not supported with memory persistence.\n return Vt.resolve(null);\n }\n getMinOffset(t, e) {\n return Vt.resolve(At.min());\n }\n getMinOffsetFromCollectionGroup(t, e) {\n return Vt.resolve(At.min());\n }\n updateCollectionGroup(t, e, n) {\n // Field indices are not supported with memory persistence.\n return Vt.resolve();\n }\n updateIndexEntries(t, e) {\n // Field indices are not supported with memory persistence.\n return Vt.resolve();\n }\n}\n\n/**\n * Internal implementation of the collection-parent index exposed by MemoryIndexManager.\n * Also used for in-memory caching by IndexedDbIndexManager and initial index population\n * in indexeddb_schema.ts\n */ class pr {\n constructor() {\n this.index = {};\n }\n // Returns false if the entry already existed.\n add(t) {\n const e = t.lastSegment(), n = t.popLast(), s = this.index[e] || new Wt(ht.comparator), i = !s.has(n);\n return this.index[e] = s.add(n), i;\n }\n has(t) {\n const e = t.lastSegment(), n = t.popLast(), s = this.index[e];\n return s && s.has(n);\n }\n getEntries(t) {\n return (this.index[t] || new Wt(ht.comparator)).toArray();\n }\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ const Ir = new Uint8Array(0);\n\n/**\n * A persisted implementation of IndexManager.\n *\n * PORTING NOTE: Unlike iOS and Android, the Web SDK does not memoize index\n * data as it supports multi-tab access.\n */\nclass Tr {\n constructor(t, e) {\n this.user = t, this.databaseId = e, \n /**\n * An in-memory copy of the index entries we've already written since the SDK\n * launched. Used to avoid re-writing the same entry repeatedly.\n *\n * This is *NOT* a complete cache of what's in persistence and so can never be\n * used to satisfy reads.\n */\n this.He = new pr, \n /**\n * Maps from a target to its equivalent list of sub-targets. Each sub-target\n * contains only one term from the target's disjunctive normal form (DNF).\n */\n this.Je = new os((t => Fe(t)), ((t, e) => Be(t, e))), this.uid = t.uid || \"\";\n }\n /**\n * Adds a new entry to the collection parent index.\n *\n * Repeated calls for the same collectionPath should be avoided within a\n * transaction as IndexedDbIndexManager only caches writes once a transaction\n * has been committed.\n */ addToCollectionParentIndex(t, e) {\n if (!this.He.has(e)) {\n const n = e.lastSegment(), s = e.popLast();\n t.addOnCommittedListener((() => {\n // Add the collection to the in memory cache only if the transaction was\n // successfully committed.\n this.He.add(e);\n }));\n const i = {\n collectionId: n,\n parent: hi(s)\n };\n return Er(t).put(i);\n }\n return Vt.resolve();\n }\n getCollectionParents(t, e) {\n const n = [], s = IDBKeyRange.bound([ e, \"\" ], [ ot(e), \"\" ], \n /*lowerOpen=*/ !1, \n /*upperOpen=*/ !0);\n return Er(t).K(s).next((t => {\n for (const s of t) {\n // This collectionId guard shouldn't be necessary (and isn't as long\n // as we're running in a real browser), but there's a bug in\n // indexeddbshim that breaks our range in our tests running in node:\n // https://github.com/axemclion/IndexedDBShim/issues/334\n if (s.collectionId !== e) break;\n n.push(di(s.parent));\n }\n return n;\n }));\n }\n addFieldIndex(t, e) {\n // TODO(indexing): Verify that the auto-incrementing index ID works in\n // Safari & Firefox.\n const n = Rr(t), s = function(t) {\n return {\n indexId: t.indexId,\n collectionGroup: t.collectionGroup,\n fields: t.fields.map((t => [ t.fieldPath.canonicalString(), t.kind ]))\n };\n }(e);\n delete s.indexId;\n // `indexId` is auto-populated by IndexedDb\n const i = n.add(s);\n if (e.indexState) {\n const n = br(t);\n return i.next((t => {\n n.put(er(t, this.user, e.indexState.sequenceNumber, e.indexState.offset));\n }));\n }\n return i.next();\n }\n deleteFieldIndex(t, e) {\n const n = Rr(t), s = br(t), i = Ar(t);\n return n.delete(e.indexId).next((() => s.delete(IDBKeyRange.bound([ e.indexId ], [ e.indexId + 1 ], \n /*lowerOpen=*/ !1, \n /*upperOpen=*/ !0)))).next((() => i.delete(IDBKeyRange.bound([ e.indexId ], [ e.indexId + 1 ], \n /*lowerOpen=*/ !1, \n /*upperOpen=*/ !0))));\n }\n getDocumentsMatchingTarget(t, e) {\n const n = Ar(t);\n let s = !0;\n const i = new Map;\n return Vt.forEach(this.Ye(e), (e => this.Xe(t, e).next((t => {\n s && (s = !!t), i.set(e, t);\n })))).next((() => {\n if (s) {\n let t = gs();\n const s = [];\n return Vt.forEach(i, ((i, r) => {\n var o;\n O(\"IndexedDbIndexManager\", `Using index ${o = i, `id=${o.indexId}|cg=${o.collectionGroup}|f=${o.fields.map((t => `${t.fieldPath}:${t.kind}`)).join(\",\")}`} to execute ${Fe(e)}`);\n const u = function(t, e) {\n const n = wt(e);\n if (void 0 === n) return null;\n for (const e of Ue(t, n.fieldPath)) switch (e.op) {\n case \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ :\n return e.value.arrayValue.values || [];\n\n case \"array-contains\" /* ARRAY_CONTAINS */ :\n return [ e.value ];\n // Remaining filters are not array filters.\n }\n return null;\n }\n /**\n * Returns the list of values that are used in != or NOT_IN filters. Returns\n * `null` if there are no such filters.\n */ (r, i), c = function(t, e) {\n const n = new Map;\n for (const s of mt(e)) for (const e of Ue(t, s.fieldPath)) switch (e.op) {\n case \"==\" /* EQUAL */ :\n case \"in\" /* IN */ :\n // Encode equality prefix, which is encoded in the index value before\n // the inequality (e.g. `a == 'a' && b != 'b'` is encoded to\n // `value != 'ab'`).\n n.set(s.fieldPath.canonicalString(), e.value);\n break;\n\n case \"not-in\" /* NOT_IN */ :\n case \"!=\" /* NOT_EQUAL */ :\n // NotIn/NotEqual is always a suffix. There cannot be any remaining\n // segments and hence we can return early here.\n return n.set(s.fieldPath.canonicalString(), e.value), Array.from(n.values());\n // Remaining filters cannot be used as notIn bounds.\n }\n return null;\n }\n /**\n * Returns a lower bound of field values that can be used as a starting point to\n * scan the index defined by `fieldIndex`. Returns `MIN_VALUE` if no lower bound\n * exists.\n */ (r, i), a = function(t, e) {\n const n = [];\n let s = !0;\n // For each segment, retrieve a lower bound if there is a suitable filter or\n // startAt.\n for (const i of mt(e)) {\n const e = 0 /* ASCENDING */ === i.kind ? qe(t, i.fieldPath, t.startAt) : Ke(t, i.fieldPath, t.startAt);\n n.push(e.value), s && (s = e.inclusive);\n }\n return new Ze(n, s);\n }\n /**\n * Returns an upper bound of field values that can be used as an ending point\n * when scanning the index defined by `fieldIndex`. Returns `MAX_VALUE` if no\n * upper bound exists.\n */ (r, i), h = function(t, e) {\n const n = [];\n let s = !0;\n // For each segment, retrieve an upper bound if there is a suitable filter or\n // endAt.\n for (const i of mt(e)) {\n const e = 0 /* ASCENDING */ === i.kind ? Ke(t, i.fieldPath, t.endAt) : qe(t, i.fieldPath, t.endAt);\n n.push(e.value), s && (s = e.inclusive);\n }\n return new Ze(n, s);\n }(r, i), l = this.Ze(i, r, a), f = this.Ze(i, r, h), d = this.tn(i, r, c), _ = this.en(i.indexId, u, l, a.inclusive, f, h.inclusive, d);\n return Vt.forEach(_, (i => n.j(i, e.limit).next((e => {\n e.forEach((e => {\n const n = dt.fromSegments(e.documentKey);\n t.has(n) || (t = t.add(n), s.push(n));\n }));\n }))));\n })).next((() => s));\n }\n return Vt.resolve(null);\n }));\n }\n Ye(t) {\n let e = this.Je.get(t);\n return e || (\n // TODO(orquery): Implement DNF transform\n e = [ t ], this.Je.set(t, e), e);\n }\n /**\n * Constructs a key range query on `DbIndexEntryStore` that unions all\n * bounds.\n */ en(t, e, n, s, i, r, o) {\n // The number of total index scans we union together. This is similar to a\n // distributed normal form, but adapted for array values. We create a single\n // index range per value in an ARRAY_CONTAINS or ARRAY_CONTAINS_ANY filter\n // combined with the values from the query bounds.\n const u = (null != e ? e.length : 1) * Math.max(n.length, i.length), c = u / (null != e ? e.length : 1), a = [];\n for (let h = 0; h < u; ++h) {\n const u = e ? this.nn(e[h / c]) : Ir, l = this.sn(t, u, n[h % c], s), f = this.rn(t, u, i[h % c], r), d = o.map((e => this.sn(t, u, e, \n /* inclusive= */ !0)));\n a.push(...this.createRange(l, f, d));\n }\n return a;\n }\n /** Generates the lower bound for `arrayValue` and `directionalValue`. */ sn(t, e, n, s) {\n const i = new _r(t, dt.empty(), e, n);\n return s ? i : i.Le();\n }\n /** Generates the upper bound for `arrayValue` and `directionalValue`. */ rn(t, e, n, s) {\n const i = new _r(t, dt.empty(), e, n);\n return s ? i.Le() : i;\n }\n Xe(t, e) {\n const n = new gr(e), s = null != e.collectionGroup ? e.collectionGroup : e.path.lastSegment();\n return this.getFieldIndexes(t, s).next((t => {\n // Return the index with the most number of segments.\n let e = null;\n for (const s of t) {\n n.Ge(s) && (!e || s.fields.length > e.fields.length) && (e = s);\n }\n return e;\n }));\n }\n getIndexType(t, e) {\n let n = 2 /* FULL */;\n return Vt.forEach(this.Ye(e), (e => this.Xe(t, e).next((t => {\n t ? 0 /* NONE */ !== n && t.fields.length < function(t) {\n let e = new Wt(ft.comparator), n = !1;\n for (const s of t.filters) {\n // TODO(orquery): Use the flattened filters here\n const t = s;\n // __name__ is not an explicit segment of any index, so we don't need to\n // count it.\n t.field.isKeyField() || (\n // ARRAY_CONTAINS or ARRAY_CONTAINS_ANY filters must be counted separately.\n // For instance, it is possible to have an index for \"a ARRAY a ASC\". Even\n // though these are on the same field, they should be counted as two\n // separate segments in an index.\n \"array-contains\" /* ARRAY_CONTAINS */ === t.op || \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ === t.op ? n = !0 : e = e.add(t.field));\n }\n for (const n of t.orderBy) \n // __name__ is not an explicit segment of any index, so we don't need to\n // count it.\n n.field.isKeyField() || (e = e.add(n.field));\n return e.size + (n ? 1 : 0);\n }(e) && (n = 1 /* PARTIAL */) : n = 0 /* NONE */;\n })))).next((() => n));\n }\n /**\n * Returns the byte encoded form of the directional values in the field index.\n * Returns `null` if the document does not have all fields specified in the\n * index.\n */ on(t, e) {\n const n = new dr;\n for (const s of mt(t)) {\n const t = e.data.field(s.fieldPath);\n if (null == t) return null;\n const i = n.Be(s.kind);\n ur.ye.re(t, i);\n }\n return n.Me();\n }\n /** Encodes a single value to the ascending index format. */ nn(t) {\n const e = new dr;\n return ur.ye.re(t, e.Be(0 /* ASCENDING */)), e.Me();\n }\n /**\n * Returns an encoded form of the document key that sorts based on the key\n * ordering of the field index.\n */ un(t, e) {\n const n = new dr;\n return ur.ye.re(Ie(this.databaseId, e), n.Be(function(t) {\n const e = mt(t);\n return 0 === e.length ? 0 /* ASCENDING */ : e[e.length - 1].kind;\n }(t))), n.Me();\n }\n /**\n * Encodes the given field values according to the specification in `target`.\n * For IN queries, a list of possible values is returned.\n */ tn(t, e, n) {\n if (null === n) return [];\n let s = [];\n s.push(new dr);\n let i = 0;\n for (const r of mt(t)) {\n const t = n[i++];\n for (const n of s) if (this.cn(e, r.fieldPath) && Ee(t)) s = this.an(s, r, t); else {\n const e = n.Be(r.kind);\n ur.ye.re(t, e);\n }\n }\n return this.hn(s);\n }\n /**\n * Encodes the given bounds according to the specification in `target`. For IN\n * queries, a list of possible values is returned.\n */ Ze(t, e, n) {\n return this.tn(t, e, n.position);\n }\n /** Returns the byte representation for the provided encoders. */ hn(t) {\n const e = [];\n for (let n = 0; n < t.length; ++n) e[n] = t[n].Me();\n return e;\n }\n /**\n * Creates a separate encoder for each element of an array.\n *\n * The method appends each value to all existing encoders (e.g. filter(\"a\",\n * \"==\", \"a1\").filter(\"b\", \"in\", [\"b1\", \"b2\"]) becomes [\"a1,b1\", \"a1,b2\"]). A\n * list of new encoders is returned.\n */ an(t, e, n) {\n const s = [ ...t ], i = [];\n for (const t of n.arrayValue.values || []) for (const n of s) {\n const s = new dr;\n s.seed(n.Me()), ur.ye.re(t, s.Be(e.kind)), i.push(s);\n }\n return i;\n }\n cn(t, e) {\n return !!t.filters.find((t => t instanceof Ge && t.field.isEqual(e) && (\"in\" /* IN */ === t.op || \"not-in\" /* NOT_IN */ === t.op)));\n }\n getFieldIndexes(t, e) {\n const n = Rr(t), s = br(t);\n return (e ? n.K(\"collectionGroupIndex\", IDBKeyRange.bound(e, e)) : n.K()).next((t => {\n const e = [];\n return Vt.forEach(t, (t => s.get([ t.indexId, this.uid ]).next((n => {\n e.push(function(t, e) {\n const n = e ? new It(e.sequenceNumber, new At(zi(e.readTime), new dt(di(e.documentKey)), e.largestBatchId)) : It.empty(), s = t.fields.map((([t, e]) => new yt(ft.fromServerFormat(t), e)));\n return new _t(t.indexId, t.collectionGroup, s, n);\n }(t, n));\n })))).next((() => e));\n }));\n }\n getNextCollectionGroupToUpdate(t) {\n return this.getFieldIndexes(t).next((t => 0 === t.length ? null : (t.sort(((t, e) => {\n const n = t.indexState.sequenceNumber - e.indexState.sequenceNumber;\n return 0 !== n ? n : it(t.collectionGroup, e.collectionGroup);\n })), t[0].collectionGroup)));\n }\n updateCollectionGroup(t, e, n) {\n const s = Rr(t), i = br(t);\n return this.ln(t).next((t => s.K(\"collectionGroupIndex\", IDBKeyRange.bound(e, e)).next((e => Vt.forEach(e, (e => i.put(er(e.indexId, this.user, t, n))))))));\n }\n updateIndexEntries(t, e) {\n // Porting Note: `getFieldIndexes()` on Web does not cache index lookups as\n // it could be used across different IndexedDB transactions. As any cached\n // data might be invalidated by other multi-tab clients, we can only trust\n // data within a single IndexedDB transaction. We therefore add a cache\n // here.\n const n = new Map;\n return Vt.forEach(e, ((e, s) => {\n const i = n.get(e.collectionGroup);\n return (i ? Vt.resolve(i) : this.getFieldIndexes(t, e.collectionGroup)).next((i => (n.set(e.collectionGroup, i), \n Vt.forEach(i, (n => this.fn(t, e, n).next((e => {\n const i = this.dn(s, n);\n return e.isEqual(i) ? Vt.resolve() : this._n(t, s, n, e, i);\n })))))));\n }));\n }\n wn(t, e, n, s) {\n return Ar(t).put({\n indexId: s.indexId,\n uid: this.uid,\n arrayValue: s.arrayValue,\n directionalValue: s.directionalValue,\n orderedDocumentKey: this.un(n, e.key),\n documentKey: e.key.path.toArray()\n });\n }\n mn(t, e, n, s) {\n return Ar(t).delete([ s.indexId, this.uid, s.arrayValue, s.directionalValue, this.un(n, e.key), e.key.path.toArray() ]);\n }\n fn(t, e, n) {\n const s = Ar(t);\n let i = new Wt(wr);\n return s.J({\n index: \"documentKeyIndex\",\n range: IDBKeyRange.only([ n.indexId, this.uid, this.un(n, e) ])\n }, ((t, s) => {\n i = i.add(new _r(n.indexId, e, s.arrayValue, s.directionalValue));\n })).next((() => i));\n }\n /** Creates the index entries for the given document. */ dn(t, e) {\n let n = new Wt(wr);\n const s = this.on(e, t);\n if (null == s) return n;\n const i = wt(e);\n if (null != i) {\n const r = t.data.field(i.fieldPath);\n if (Ee(r)) for (const i of r.arrayValue.values || []) n = n.add(new _r(e.indexId, t.key, this.nn(i), s));\n } else n = n.add(new _r(e.indexId, t.key, Ir, s));\n return n;\n }\n /**\n * Updates the index entries for the provided document by deleting entries\n * that are no longer referenced in `newEntries` and adding all newly added\n * entries.\n */ _n(t, e, n, s, i) {\n O(\"IndexedDbIndexManager\", \"Updating index entries for document '%s'\", e.key);\n const r = [];\n return function(t, e, n, s, i) {\n const r = t.getIterator(), o = e.getIterator();\n let u = Ht(r), c = Ht(o);\n // Walk through the two sets at the same time, using the ordering defined by\n // `comparator`.\n for (;u || c; ) {\n let t = !1, e = !1;\n if (u && c) {\n const s = n(u, c);\n s < 0 ? \n // The element was removed if the next element in our ordered\n // walkthrough is only in `before`.\n e = !0 : s > 0 && (\n // The element was added if the next element in our ordered walkthrough\n // is only in `after`.\n t = !0);\n } else null != u ? e = !0 : t = !0;\n t ? (s(c), c = Ht(o)) : e ? (i(u), u = Ht(r)) : (u = Ht(r), c = Ht(o));\n }\n }(s, i, wr, (\n /* onAdd= */ s => {\n r.push(this.wn(t, e, n, s));\n }), (\n /* onRemove= */ s => {\n r.push(this.mn(t, e, n, s));\n })), Vt.waitFor(r);\n }\n ln(t) {\n let e = 1;\n return br(t).J({\n index: \"sequenceNumberIndex\",\n reverse: !0,\n range: IDBKeyRange.upperBound([ this.uid, Number.MAX_SAFE_INTEGER ])\n }, ((t, n, s) => {\n s.done(), e = n.sequenceNumber + 1;\n })).next((() => e));\n }\n /**\n * Returns a new set of IDB ranges that splits the existing range and excludes\n * any values that match the `notInValue` from these ranges. As an example,\n * '[foo > 2 && foo != 3]` becomes `[foo > 2 && < 3, foo > 3]`.\n */ createRange(t, e, n) {\n // The notIn values need to be sorted and unique so that we can return a\n // sorted set of non-overlapping ranges.\n n = n.sort(((t, e) => wr(t, e))).filter(((t, e, n) => !e || 0 !== wr(t, n[e - 1])));\n const s = [];\n s.push(t);\n for (const i of n) {\n const n = wr(i, t), r = wr(i, e);\n if (0 === n) \n // `notInValue` is the lower bound. We therefore need to raise the bound\n // to the next value.\n s[0] = t.Le(); else if (n > 0 && r < 0) \n // `notInValue` is in the middle of the range\n s.push(i), s.push(i.Le()); else if (r > 0) \n // `notInValue` (and all following values) are out of the range\n break;\n }\n s.push(e);\n const i = [];\n for (let t = 0; t < s.length; t += 2) i.push(IDBKeyRange.bound([ s[t].indexId, this.uid, s[t].arrayValue, s[t].directionalValue, Ir, [] ], [ s[t + 1].indexId, this.uid, s[t + 1].arrayValue, s[t + 1].directionalValue, Ir, [] ]));\n return i;\n }\n getMinOffsetFromCollectionGroup(t, e) {\n return this.getFieldIndexes(t, e).next(Pr);\n }\n getMinOffset(t, e) {\n return Vt.mapArray(this.Ye(e), (e => this.Xe(t, e).next((t => t || L())))).next(Pr);\n }\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the collectionParents\n * document store.\n */ function Er(t) {\n return $i(t, \"collectionParents\");\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the index entry object store.\n */ function Ar(t) {\n return $i(t, \"indexEntries\");\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the index configuration object store.\n */ function Rr(t) {\n return $i(t, \"indexConfiguration\");\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the index state object store.\n */ function br(t) {\n return $i(t, \"indexState\");\n}\n\nfunction Pr(t) {\n U(0 !== t.length);\n let e = t[0].indexState.offset, n = e.largestBatchId;\n for (let s = 1; s < t.length; s++) {\n const i = t[s].indexState.offset;\n Rt(i, e) < 0 && (e = i), n < i.largestBatchId && (n = i.largestBatchId);\n }\n return new At(e.readTime, e.documentKey, n);\n}\n\n/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ const vr = {\n didRun: !1,\n sequenceNumbersCollected: 0,\n targetsRemoved: 0,\n documentsRemoved: 0\n};\n\nclass Vr {\n constructor(\n // When we attempt to collect, we will only do so if the cache size is greater than this\n // threshold. Passing `COLLECTION_DISABLED` here will cause collection to always be skipped.\n t, \n // The percentage of sequence numbers that we will attempt to collect\n e, \n // A cap on the total number of sequence numbers that will be collected. This prevents\n // us from collecting a huge number of sequence numbers if the cache has grown very large.\n n) {\n this.cacheSizeCollectionThreshold = t, this.percentileToCollect = e, this.maximumSequenceNumbersToCollect = n;\n }\n static withCacheSize(t) {\n return new Vr(t, Vr.DEFAULT_COLLECTION_PERCENTILE, Vr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT);\n }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Delete a mutation batch and the associated document mutations.\n * @returns A PersistencePromise of the document mutations that were removed.\n */\nfunction Sr(t, e, n) {\n const s = t.store(\"mutations\"), i = t.store(\"documentMutations\"), r = [], o = IDBKeyRange.only(n.batchId);\n let u = 0;\n const c = s.J({\n range: o\n }, ((t, e, n) => (u++, n.delete())));\n r.push(c.next((() => {\n U(1 === u);\n })));\n const a = [];\n for (const t of n.mutations) {\n const s = mi(e, t.key.path, n.batchId);\n r.push(i.delete(s)), a.push(t.key);\n }\n return Vt.waitFor(r).next((() => a));\n}\n\n/**\n * Returns an approximate size for the given document.\n */ function Dr(t) {\n if (!t) return 0;\n let e;\n if (t.document) e = t.document; else if (t.unknownDocument) e = t.unknownDocument; else {\n if (!t.noDocument) throw L();\n e = t.noDocument;\n }\n return JSON.stringify(e).length;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** A mutation queue for a specific user, backed by IndexedDB. */ Vr.DEFAULT_COLLECTION_PERCENTILE = 10, \nVr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT = 1e3, Vr.DEFAULT = new Vr(41943040, Vr.DEFAULT_COLLECTION_PERCENTILE, Vr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT), \nVr.DISABLED = new Vr(-1, 0, 0);\n\nclass Cr {\n constructor(\n /**\n * The normalized userId (e.g. null UID => \"\" userId) used to store /\n * retrieve mutations.\n */\n t, e, n, s) {\n this.userId = t, this.wt = e, this.indexManager = n, this.referenceDelegate = s, \n /**\n * Caches the document keys for pending mutation batches. If the mutation\n * has been removed from IndexedDb, the cached value may continue to\n * be used to retrieve the batch's document keys. To remove a cached value\n * locally, `removeCachedMutationKeys()` should be invoked either directly\n * or through `removeMutationBatches()`.\n *\n * With multi-tab, when the primary client acknowledges or rejects a mutation,\n * this cache is used by secondary clients to invalidate the local\n * view of the documents that were previously affected by the mutation.\n */\n // PORTING NOTE: Multi-tab only.\n this.gn = {};\n }\n /**\n * Creates a new mutation queue for the given user.\n * @param user - The user for which to create a mutation queue.\n * @param serializer - The serializer to use when persisting to IndexedDb.\n */ static se(t, e, n, s) {\n // TODO(mcg): Figure out what constraints there are on userIDs\n // In particular, are there any reserved characters? are empty ids allowed?\n // For the moment store these together in the same mutations table assuming\n // that empty userIDs aren't allowed.\n U(\"\" !== t.uid);\n const i = t.isAuthenticated() ? t.uid : \"\";\n return new Cr(i, e, n, s);\n }\n checkEmpty(t) {\n let e = !0;\n const n = IDBKeyRange.bound([ this.userId, Number.NEGATIVE_INFINITY ], [ this.userId, Number.POSITIVE_INFINITY ]);\n return Nr(t).J({\n index: \"userMutationsIndex\",\n range: n\n }, ((t, n, s) => {\n e = !1, s.done();\n })).next((() => e));\n }\n addMutationBatch(t, e, n, s) {\n const i = kr(t), r = Nr(t);\n // The IndexedDb implementation in Chrome (and Firefox) does not handle\n // compound indices that include auto-generated keys correctly. To ensure\n // that the index entry is added correctly in all browsers, we perform two\n // writes: The first write is used to retrieve the next auto-generated Batch\n // ID, and the second write populates the index and stores the actual\n // mutation batch.\n // See: https://bugs.chromium.org/p/chromium/issues/detail?id=701972\n // We write an empty object to obtain key\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return r.add({}).next((o => {\n U(\"number\" == typeof o);\n const u = new Bi(o, e, n, s), c = function(t, e, n) {\n const s = n.baseMutations.map((e => zs(t.ne, e))), i = n.mutations.map((e => zs(t.ne, e)));\n return {\n userId: e,\n batchId: n.batchId,\n localWriteTimeMs: n.localWriteTime.toMillis(),\n baseMutations: s,\n mutations: i\n };\n }(this.wt, this.userId, u), a = [];\n let h = new Wt(((t, e) => it(t.canonicalString(), e.canonicalString())));\n for (const t of s) {\n const e = mi(this.userId, t.key.path, o);\n h = h.add(t.key.path.popLast()), a.push(r.put(c)), a.push(i.put(e, gi));\n }\n return h.forEach((e => {\n a.push(this.indexManager.addToCollectionParentIndex(t, e));\n })), t.addOnCommittedListener((() => {\n this.gn[o] = u.keys();\n })), Vt.waitFor(a).next((() => u));\n }));\n }\n lookupMutationBatch(t, e) {\n return Nr(t).get(e).next((t => t ? (U(t.userId === this.userId), Hi(this.wt, t)) : null));\n }\n /**\n * Returns the document keys for the mutation batch with the given batchId.\n * For primary clients, this method returns `null` after\n * `removeMutationBatches()` has been called. Secondary clients return a\n * cached result until `removeCachedMutationKeys()` is invoked.\n */\n // PORTING NOTE: Multi-tab only.\n yn(t, e) {\n return this.gn[e] ? Vt.resolve(this.gn[e]) : this.lookupMutationBatch(t, e).next((t => {\n if (t) {\n const n = t.keys();\n return this.gn[e] = n, n;\n }\n return null;\n }));\n }\n getNextMutationBatchAfterBatchId(t, e) {\n const n = e + 1, s = IDBKeyRange.lowerBound([ this.userId, n ]);\n let i = null;\n return Nr(t).J({\n index: \"userMutationsIndex\",\n range: s\n }, ((t, e, s) => {\n e.userId === this.userId && (U(e.batchId >= n), i = Hi(this.wt, e)), s.done();\n })).next((() => i));\n }\n getHighestUnacknowledgedBatchId(t) {\n const e = IDBKeyRange.upperBound([ this.userId, Number.POSITIVE_INFINITY ]);\n let n = -1;\n return Nr(t).J({\n index: \"userMutationsIndex\",\n range: e,\n reverse: !0\n }, ((t, e, s) => {\n n = e.batchId, s.done();\n })).next((() => n));\n }\n getAllMutationBatches(t) {\n const e = IDBKeyRange.bound([ this.userId, -1 ], [ this.userId, Number.POSITIVE_INFINITY ]);\n return Nr(t).K(\"userMutationsIndex\", e).next((t => t.map((t => Hi(this.wt, t)))));\n }\n getAllMutationBatchesAffectingDocumentKey(t, e) {\n // Scan the document-mutation index starting with a prefix starting with\n // the given documentKey.\n const n = wi(this.userId, e.path), s = IDBKeyRange.lowerBound(n), i = [];\n return kr(t).J({\n range: s\n }, ((n, s, r) => {\n const [o, u, c] = n, a = di(u);\n // Only consider rows matching exactly the specific key of\n // interest. Note that because we order by path first, and we\n // order terminators before path separators, we'll encounter all\n // the index rows for documentKey contiguously. In particular, all\n // the rows for documentKey will occur before any rows for\n // documents nested in a subcollection beneath documentKey so we\n // can stop as soon as we hit any such row.\n if (o === this.userId && e.path.isEqual(a)) \n // Look up the mutation batch in the store.\n return Nr(t).get(c).next((t => {\n if (!t) throw L();\n U(t.userId === this.userId), i.push(Hi(this.wt, t));\n }));\n r.done();\n })).next((() => i));\n }\n getAllMutationBatchesAffectingDocumentKeys(t, e) {\n let n = new Wt(it);\n const s = [];\n return e.forEach((e => {\n const i = wi(this.userId, e.path), r = IDBKeyRange.lowerBound(i), o = kr(t).J({\n range: r\n }, ((t, s, i) => {\n const [r, o, u] = t, c = di(o);\n // Only consider rows matching exactly the specific key of\n // interest. Note that because we order by path first, and we\n // order terminators before path separators, we'll encounter all\n // the index rows for documentKey contiguously. In particular, all\n // the rows for documentKey will occur before any rows for\n // documents nested in a subcollection beneath documentKey so we\n // can stop as soon as we hit any such row.\n r === this.userId && e.path.isEqual(c) ? n = n.add(u) : i.done();\n }));\n s.push(o);\n })), Vt.waitFor(s).next((() => this.pn(t, n)));\n }\n getAllMutationBatchesAffectingQuery(t, e) {\n const n = e.path, s = n.length + 1, i = wi(this.userId, n), r = IDBKeyRange.lowerBound(i);\n // Collect up unique batchIDs encountered during a scan of the index. Use a\n // SortedSet to accumulate batch IDs so they can be traversed in order in a\n // scan of the main table.\n let o = new Wt(it);\n return kr(t).J({\n range: r\n }, ((t, e, i) => {\n const [r, u, c] = t, a = di(u);\n r === this.userId && n.isPrefixOf(a) ? \n // Rows with document keys more than one segment longer than the\n // query path can't be matches. For example, a query on 'rooms'\n // can't match the document /rooms/abc/messages/xyx.\n // TODO(mcg): we'll need a different scanner when we implement\n // ancestor queries.\n a.length === s && (o = o.add(c)) : i.done();\n })).next((() => this.pn(t, o)));\n }\n pn(t, e) {\n const n = [], s = [];\n // TODO(rockwood): Implement this using iterate.\n return e.forEach((e => {\n s.push(Nr(t).get(e).next((t => {\n if (null === t) throw L();\n U(t.userId === this.userId), n.push(Hi(this.wt, t));\n })));\n })), Vt.waitFor(s).next((() => n));\n }\n removeMutationBatch(t, e) {\n return Sr(t.ee, this.userId, e).next((n => (t.addOnCommittedListener((() => {\n this.In(e.batchId);\n })), Vt.forEach(n, (e => this.referenceDelegate.markPotentiallyOrphaned(t, e))))));\n }\n /**\n * Clears the cached keys for a mutation batch. This method should be\n * called by secondary clients after they process mutation updates.\n *\n * Note that this method does not have to be called from primary clients as\n * the corresponding cache entries are cleared when an acknowledged or\n * rejected batch is removed from the mutation queue.\n */\n // PORTING NOTE: Multi-tab only\n In(t) {\n delete this.gn[t];\n }\n performConsistencyCheck(t) {\n return this.checkEmpty(t).next((e => {\n if (!e) return Vt.resolve();\n // Verify that there are no entries in the documentMutations index if\n // the queue is empty.\n const n = IDBKeyRange.lowerBound([ this.userId ]);\n const s = [];\n return kr(t).J({\n range: n\n }, ((t, e, n) => {\n if (t[0] === this.userId) {\n const e = di(t[1]);\n s.push(e);\n } else n.done();\n })).next((() => {\n U(0 === s.length);\n }));\n }));\n }\n containsKey(t, e) {\n return xr(t, this.userId, e);\n }\n // PORTING NOTE: Multi-tab only (state is held in memory in other clients).\n /** Returns the mutation queue's metadata from IndexedDb. */\n Tn(t) {\n return Mr(t).get(this.userId).next((t => t || {\n userId: this.userId,\n lastAcknowledgedBatchId: -1,\n lastStreamToken: \"\"\n }));\n }\n}\n\n/**\n * @returns true if the mutation queue for the given user contains a pending\n * mutation for the given key.\n */ function xr(t, e, n) {\n const s = wi(e, n.path), i = s[1], r = IDBKeyRange.lowerBound(s);\n let o = !1;\n return kr(t).J({\n range: r,\n H: !0\n }, ((t, n, s) => {\n const [r, u, /*batchID*/ c] = t;\n r === e && u === i && (o = !0), s.done();\n })).next((() => o));\n}\n\n/** Returns true if any mutation queue contains the given document. */\n/**\n * Helper to get a typed SimpleDbStore for the mutations object store.\n */\nfunction Nr(t) {\n return $i(t, \"mutations\");\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the mutationQueues object store.\n */ function kr(t) {\n return $i(t, \"documentMutations\");\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the mutationQueues object store.\n */ function Mr(t) {\n return $i(t, \"mutationQueues\");\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** Offset to ensure non-overlapping target ids. */\n/**\n * Generates monotonically increasing target IDs for sending targets to the\n * watch stream.\n *\n * The client constructs two generators, one for the target cache, and one for\n * for the sync engine (to generate limbo documents targets). These\n * generators produce non-overlapping IDs (by using even and odd IDs\n * respectively).\n *\n * By separating the target ID space, the query cache can generate target IDs\n * that persist across client restarts, while sync engine can independently\n * generate in-memory target IDs that are transient and can be reused after a\n * restart.\n */\nclass Or {\n constructor(t) {\n this.En = t;\n }\n next() {\n return this.En += 2, this.En;\n }\n static An() {\n // The target cache generator must return '2' in its first call to `next()`\n // as there is no differentiation in the protocol layer between an unset\n // number and the number '0'. If we were to sent a target with target ID\n // '0', the backend would consider it unset and replace it with its own ID.\n return new Or(0);\n }\n static Rn() {\n // Sync engine assigns target IDs for limbo document detection.\n return new Or(-1);\n }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ class Fr {\n constructor(t, e) {\n this.referenceDelegate = t, this.wt = e;\n }\n // PORTING NOTE: We don't cache global metadata for the target cache, since\n // some of it (in particular `highestTargetId`) can be modified by secondary\n // tabs. We could perhaps be more granular (and e.g. still cache\n // `lastRemoteSnapshotVersion` in memory) but for simplicity we currently go\n // to IndexedDb whenever we need to read metadata. We can revisit if it turns\n // out to have a meaningful performance impact.\n allocateTargetId(t) {\n return this.bn(t).next((e => {\n const n = new Or(e.highestTargetId);\n return e.highestTargetId = n.next(), this.Pn(t, e).next((() => e.highestTargetId));\n }));\n }\n getLastRemoteSnapshotVersion(t) {\n return this.bn(t).next((t => ct.fromTimestamp(new ut(t.lastRemoteSnapshotVersion.seconds, t.lastRemoteSnapshotVersion.nanoseconds))));\n }\n getHighestSequenceNumber(t) {\n return this.bn(t).next((t => t.highestListenSequenceNumber));\n }\n setTargetsMetadata(t, e, n) {\n return this.bn(t).next((s => (s.highestListenSequenceNumber = e, n && (s.lastRemoteSnapshotVersion = n.toTimestamp()), \n e > s.highestListenSequenceNumber && (s.highestListenSequenceNumber = e), this.Pn(t, s))));\n }\n addTargetData(t, e) {\n return this.vn(t, e).next((() => this.bn(t).next((n => (n.targetCount += 1, this.Vn(e, n), \n this.Pn(t, n))))));\n }\n updateTargetData(t, e) {\n return this.vn(t, e);\n }\n removeTargetData(t, e) {\n return this.removeMatchingKeysForTargetId(t, e.targetId).next((() => $r(t).delete(e.targetId))).next((() => this.bn(t))).next((e => (U(e.targetCount > 0), \n e.targetCount -= 1, this.Pn(t, e))));\n }\n /**\n * Drops any targets with sequence number less than or equal to the upper bound, excepting those\n * present in `activeTargetIds`. Document associations for the removed targets are also removed.\n * Returns the number of targets removed.\n */ removeTargets(t, e, n) {\n let s = 0;\n const i = [];\n return $r(t).J(((r, o) => {\n const u = Ji(o);\n u.sequenceNumber <= e && null === n.get(u.targetId) && (s++, i.push(this.removeTargetData(t, u)));\n })).next((() => Vt.waitFor(i))).next((() => s));\n }\n /**\n * Call provided function with each `TargetData` that we have cached.\n */ forEachTarget(t, e) {\n return $r(t).J(((t, n) => {\n const s = Ji(n);\n e(s);\n }));\n }\n bn(t) {\n return Br(t).get(\"targetGlobalKey\").next((t => (U(null !== t), t)));\n }\n Pn(t, e) {\n return Br(t).put(\"targetGlobalKey\", e);\n }\n vn(t, e) {\n return $r(t).put(Yi(this.wt, e));\n }\n /**\n * In-place updates the provided metadata to account for values in the given\n * TargetData. Saving is done separately. Returns true if there were any\n * changes to the metadata.\n */ Vn(t, e) {\n let n = !1;\n return t.targetId > e.highestTargetId && (e.highestTargetId = t.targetId, n = !0), \n t.sequenceNumber > e.highestListenSequenceNumber && (e.highestListenSequenceNumber = t.sequenceNumber, \n n = !0), n;\n }\n getTargetCount(t) {\n return this.bn(t).next((t => t.targetCount));\n }\n getTargetData(t, e) {\n // Iterating by the canonicalId may yield more than one result because\n // canonicalId values are not required to be unique per target. This query\n // depends on the queryTargets index to be efficient.\n const n = Fe(e), s = IDBKeyRange.bound([ n, Number.NEGATIVE_INFINITY ], [ n, Number.POSITIVE_INFINITY ]);\n let i = null;\n return $r(t).J({\n range: s,\n index: \"queryTargetsIndex\"\n }, ((t, n, s) => {\n const r = Ji(n);\n // After finding a potential match, check that the target is\n // actually equal to the requested target.\n Be(e, r.target) && (i = r, s.done());\n })).next((() => i));\n }\n addMatchingKeys(t, e, n) {\n // PORTING NOTE: The reverse index (documentsTargets) is maintained by\n // IndexedDb.\n const s = [], i = Lr(t);\n return e.forEach((e => {\n const r = hi(e.path);\n s.push(i.put({\n targetId: n,\n path: r\n })), s.push(this.referenceDelegate.addReference(t, n, e));\n })), Vt.waitFor(s);\n }\n removeMatchingKeys(t, e, n) {\n // PORTING NOTE: The reverse index (documentsTargets) is maintained by\n // IndexedDb.\n const s = Lr(t);\n return Vt.forEach(e, (e => {\n const i = hi(e.path);\n return Vt.waitFor([ s.delete([ n, i ]), this.referenceDelegate.removeReference(t, n, e) ]);\n }));\n }\n removeMatchingKeysForTargetId(t, e) {\n const n = Lr(t), s = IDBKeyRange.bound([ e ], [ e + 1 ], \n /*lowerOpen=*/ !1, \n /*upperOpen=*/ !0);\n return n.delete(s);\n }\n getMatchingKeysForTargetId(t, e) {\n const n = IDBKeyRange.bound([ e ], [ e + 1 ], \n /*lowerOpen=*/ !1, \n /*upperOpen=*/ !0), s = Lr(t);\n let i = gs();\n return s.J({\n range: n,\n H: !0\n }, ((t, e, n) => {\n const s = di(t[1]), r = new dt(s);\n i = i.add(r);\n })).next((() => i));\n }\n containsKey(t, e) {\n const n = hi(e.path), s = IDBKeyRange.bound([ n ], [ ot(n) ], \n /*lowerOpen=*/ !1, \n /*upperOpen=*/ !0);\n let i = 0;\n return Lr(t).J({\n index: \"documentTargetsIndex\",\n H: !0,\n range: s\n }, (([t, e], n, s) => {\n // Having a sentinel row for a document does not count as containing that document;\n // For the target cache, containing the document means the document is part of some\n // target.\n 0 !== t && (i++, s.done());\n })).next((() => i > 0));\n }\n /**\n * Looks up a TargetData entry by target ID.\n *\n * @param targetId - The target ID of the TargetData entry to look up.\n * @returns The cached TargetData entry, or null if the cache has no entry for\n * the target.\n */\n // PORTING NOTE: Multi-tab only.\n te(t, e) {\n return $r(t).get(e).next((t => t ? Ji(t) : null));\n }\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the queries object store.\n */ function $r(t) {\n return $i(t, \"targets\");\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the target globals object store.\n */ function Br(t) {\n return $i(t, \"targetGlobal\");\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the document target object store.\n */ function Lr(t) {\n return $i(t, \"targetDocuments\");\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ function Ur([t, e], [n, s]) {\n const i = it(t, n);\n return 0 === i ? it(e, s) : i;\n}\n\n/**\n * Used to calculate the nth sequence number. Keeps a rolling buffer of the\n * lowest n values passed to `addElement`, and finally reports the largest of\n * them in `maxValue`.\n */ class qr {\n constructor(t) {\n this.Sn = t, this.buffer = new Wt(Ur), this.Dn = 0;\n }\n Cn() {\n return ++this.Dn;\n }\n xn(t) {\n const e = [ t, this.Cn() ];\n if (this.buffer.size < this.Sn) this.buffer = this.buffer.add(e); else {\n const t = this.buffer.last();\n Ur(e, t) < 0 && (this.buffer = this.buffer.delete(t).add(e));\n }\n }\n get maxValue() {\n // Guaranteed to be non-empty. If we decide we are not collecting any\n // sequence numbers, nthSequenceNumber below short-circuits. If we have\n // decided that we are collecting n sequence numbers, it's because n is some\n // percentage of the existing sequence numbers. That means we should never\n // be in a situation where we are collecting sequence numbers but don't\n // actually have any.\n return this.buffer.last()[0];\n }\n}\n\n/**\n * This class is responsible for the scheduling of LRU garbage collection. It handles checking\n * whether or not GC is enabled, as well as which delay to use before the next run.\n */ class Kr {\n constructor(t, e, n) {\n this.garbageCollector = t, this.asyncQueue = e, this.localStore = n, this.Nn = null;\n }\n start() {\n -1 !== this.garbageCollector.params.cacheSizeCollectionThreshold && this.kn(6e4);\n }\n stop() {\n this.Nn && (this.Nn.cancel(), this.Nn = null);\n }\n get started() {\n return null !== this.Nn;\n }\n kn(t) {\n O(\"LruGarbageCollector\", `Garbage collection scheduled in ${t}ms`), this.Nn = this.asyncQueue.enqueueAfterDelay(\"lru_garbage_collection\" /* LruGarbageCollection */ , t, (async () => {\n this.Nn = null;\n try {\n await this.localStore.collectGarbage(this.garbageCollector);\n } catch (t) {\n Nt(t) ? O(\"LruGarbageCollector\", \"Ignoring IndexedDB error during garbage collection: \", t) : await vt(t);\n }\n await this.kn(3e5);\n }));\n }\n}\n\n/** Implements the steps for LRU garbage collection. */ class Gr {\n constructor(t, e) {\n this.Mn = t, this.params = e;\n }\n calculateTargetCount(t, e) {\n return this.Mn.On(t).next((t => Math.floor(e / 100 * t)));\n }\n nthSequenceNumber(t, e) {\n if (0 === e) return Vt.resolve(Lt.ot);\n const n = new qr(e);\n return this.Mn.forEachTarget(t, (t => n.xn(t.sequenceNumber))).next((() => this.Mn.Fn(t, (t => n.xn(t))))).next((() => n.maxValue));\n }\n removeTargets(t, e, n) {\n return this.Mn.removeTargets(t, e, n);\n }\n removeOrphanedDocuments(t, e) {\n return this.Mn.removeOrphanedDocuments(t, e);\n }\n collect(t, e) {\n return -1 === this.params.cacheSizeCollectionThreshold ? (O(\"LruGarbageCollector\", \"Garbage collection skipped; disabled\"), \n Vt.resolve(vr)) : this.getCacheSize(t).next((n => n < this.params.cacheSizeCollectionThreshold ? (O(\"LruGarbageCollector\", `Garbage collection skipped; Cache size ${n} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`), \n vr) : this.$n(t, e)));\n }\n getCacheSize(t) {\n return this.Mn.getCacheSize(t);\n }\n $n(t, e) {\n let n, s, i, r, o, c, a;\n const h = Date.now();\n return this.calculateTargetCount(t, this.params.percentileToCollect).next((e => (\n // Cap at the configured max\n e > this.params.maximumSequenceNumbersToCollect ? (O(\"LruGarbageCollector\", `Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${e}`), \n s = this.params.maximumSequenceNumbersToCollect) : s = e, r = Date.now(), this.nthSequenceNumber(t, s)))).next((s => (n = s, \n o = Date.now(), this.removeTargets(t, n, e)))).next((e => (i = e, c = Date.now(), \n this.removeOrphanedDocuments(t, n)))).next((t => {\n if (a = Date.now(), k() <= LogLevel.DEBUG) {\n O(\"LruGarbageCollector\", `LRU Garbage Collection\\n\\tCounted targets in ${r - h}ms\\n\\tDetermined least recently used ${s} in ` + (o - r) + \"ms\\n\" + `\\tRemoved ${i} targets in ` + (c - o) + \"ms\\n\" + `\\tRemoved ${t} documents in ` + (a - c) + \"ms\\n\" + `Total Duration: ${a - h}ms`);\n }\n return Vt.resolve({\n didRun: !0,\n sequenceNumbersCollected: s,\n targetsRemoved: i,\n documentsRemoved: t\n });\n }));\n }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** Provides LRU functionality for IndexedDB persistence. */\nclass Qr {\n constructor(t, e) {\n this.db = t, this.garbageCollector = function(t, e) {\n return new Gr(t, e);\n }(this, e);\n }\n On(t) {\n const e = this.Bn(t);\n return this.db.getTargetCache().getTargetCount(t).next((t => e.next((e => t + e))));\n }\n Bn(t) {\n let e = 0;\n return this.Fn(t, (t => {\n e++;\n })).next((() => e));\n }\n forEachTarget(t, e) {\n return this.db.getTargetCache().forEachTarget(t, e);\n }\n Fn(t, e) {\n return this.Ln(t, ((t, n) => e(n)));\n }\n addReference(t, e, n) {\n return jr(t, n);\n }\n removeReference(t, e, n) {\n return jr(t, n);\n }\n removeTargets(t, e, n) {\n return this.db.getTargetCache().removeTargets(t, e, n);\n }\n markPotentiallyOrphaned(t, e) {\n return jr(t, e);\n }\n /**\n * Returns true if anything would prevent this document from being garbage\n * collected, given that the document in question is not present in any\n * targets and has a sequence number less than or equal to the upper bound for\n * the collection run.\n */ Un(t, e) {\n return function(t, e) {\n let n = !1;\n return Mr(t).Y((s => xr(t, s, e).next((t => (t && (n = !0), Vt.resolve(!t)))))).next((() => n));\n }(t, e);\n }\n removeOrphanedDocuments(t, e) {\n const n = this.db.getRemoteDocumentCache().newChangeBuffer(), s = [];\n let i = 0;\n return this.Ln(t, ((r, o) => {\n if (o <= e) {\n const e = this.Un(t, r).next((e => {\n if (!e) \n // Our size accounting requires us to read all documents before\n // removing them.\n return i++, n.getEntry(t, r).next((() => (n.removeEntry(r, ct.min()), Lr(t).delete([ 0, hi(r.path) ]))));\n }));\n s.push(e);\n }\n })).next((() => Vt.waitFor(s))).next((() => n.apply(t))).next((() => i));\n }\n removeTarget(t, e) {\n const n = e.withSequenceNumber(t.currentSequenceNumber);\n return this.db.getTargetCache().updateTargetData(t, n);\n }\n updateLimboDocument(t, e) {\n return jr(t, e);\n }\n /**\n * Call provided function for each document in the cache that is 'orphaned'. Orphaned\n * means not a part of any target, so the only entry in the target-document index for\n * that document will be the sentinel row (targetId 0), which will also have the sequence\n * number for the last time the document was accessed.\n */ Ln(t, e) {\n const n = Lr(t);\n let s, i = Lt.ot;\n return n.J({\n index: \"documentTargetsIndex\"\n }, (([t, n], {path: r, sequenceNumber: o}) => {\n 0 === t ? (\n // if nextToReport is valid, report it, this is a new key so the\n // last one must not be a member of any targets.\n i !== Lt.ot && e(new dt(di(s)), i), \n // set nextToReport to be this sequence number. It's the next one we\n // might report, if we don't find any targets for this document.\n // Note that the sequence number must be defined when the targetId\n // is 0.\n i = o, s = r) : \n // set nextToReport to be invalid, we know we don't need to report\n // this one since we found a target for it.\n i = Lt.ot;\n })).next((() => {\n // Since we report sequence numbers after getting to the next key, we\n // need to check if the last key we iterated over was an orphaned\n // document and report it.\n i !== Lt.ot && e(new dt(di(s)), i);\n }));\n }\n getCacheSize(t) {\n return this.db.getRemoteDocumentCache().getSize(t);\n }\n}\n\nfunction jr(t, e) {\n return Lr(t).put(\n /**\n * @returns A value suitable for writing a sentinel row in the target-document\n * store.\n */\n function(t, e) {\n return {\n targetId: 0,\n path: hi(t.path),\n sequenceNumber: e\n };\n }(e, t.currentSequenceNumber));\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * An in-memory buffer of entries to be written to a RemoteDocumentCache.\n * It can be used to batch up a set of changes to be written to the cache, but\n * additionally supports reading entries back with the `getEntry()` method,\n * falling back to the underlying RemoteDocumentCache if no entry is\n * buffered.\n *\n * Entries added to the cache *must* be read first. This is to facilitate\n * calculating the size delta of the pending changes.\n *\n * PORTING NOTE: This class was implemented then removed from other platforms.\n * If byte-counting ends up being needed on the other platforms, consider\n * porting this class as part of that implementation work.\n */ class Wr {\n constructor() {\n // A mapping of document key to the new cache entry that should be written.\n this.changes = new os((t => t.toString()), ((t, e) => t.isEqual(e))), this.changesApplied = !1;\n }\n /**\n * Buffers a `RemoteDocumentCache.addEntry()` call.\n *\n * You can only modify documents that have already been retrieved via\n * `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).\n */ addEntry(t) {\n this.assertNotApplied(), this.changes.set(t.key, t);\n }\n /**\n * Buffers a `RemoteDocumentCache.removeEntry()` call.\n *\n * You can only remove documents that have already been retrieved via\n * `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).\n */ removeEntry(t, e) {\n this.assertNotApplied(), this.changes.set(t, ke.newInvalidDocument(t).setReadTime(e));\n }\n /**\n * Looks up an entry in the cache. The buffered changes will first be checked,\n * and if no buffered change applies, this will forward to\n * `RemoteDocumentCache.getEntry()`.\n *\n * @param transaction - The transaction in which to perform any persistence\n * operations.\n * @param documentKey - The key of the entry to look up.\n * @returns The cached document or an invalid document if we have nothing\n * cached.\n */ getEntry(t, e) {\n this.assertNotApplied();\n const n = this.changes.get(e);\n return void 0 !== n ? Vt.resolve(n) : this.getFromCache(t, e);\n }\n /**\n * Looks up several entries in the cache, forwarding to\n * `RemoteDocumentCache.getEntry()`.\n *\n * @param transaction - The transaction in which to perform any persistence\n * operations.\n * @param documentKeys - The keys of the entries to look up.\n * @returns A map of cached documents, indexed by key. If an entry cannot be\n * found, the corresponding key will be mapped to an invalid document.\n */ getEntries(t, e) {\n return this.getAllFromCache(t, e);\n }\n /**\n * Applies buffered changes to the underlying RemoteDocumentCache, using\n * the provided transaction.\n */ apply(t) {\n return this.assertNotApplied(), this.changesApplied = !0, this.applyChanges(t);\n }\n /** Helper to assert this.changes is not null */ assertNotApplied() {}\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * The RemoteDocumentCache for IndexedDb. To construct, invoke\n * `newIndexedDbRemoteDocumentCache()`.\n */ class zr {\n constructor(t) {\n this.wt = t;\n }\n setIndexManager(t) {\n this.indexManager = t;\n }\n /**\n * Adds the supplied entries to the cache.\n *\n * All calls of `addEntry` are required to go through the RemoteDocumentChangeBuffer\n * returned by `newChangeBuffer()` to ensure proper accounting of metadata.\n */ addEntry(t, e, n) {\n return Xr(t).put(n);\n }\n /**\n * Removes a document from the cache.\n *\n * All calls of `removeEntry` are required to go through the RemoteDocumentChangeBuffer\n * returned by `newChangeBuffer()` to ensure proper accounting of metadata.\n */ removeEntry(t, e, n) {\n return Xr(t).delete(\n /**\n * Returns a key that can be used for document lookups via the primary key of\n * the DbRemoteDocument object store.\n */\n function(t, e) {\n const n = t.path.toArray();\n return [ \n /* prefix path */ n.slice(0, n.length - 2), \n /* collection id */ n[n.length - 2], ji(e), \n /* document id */ n[n.length - 1] ];\n }\n /**\n * Returns a key that can be used for document lookups on the\n * `DbRemoteDocumentDocumentCollectionGroupIndex` index.\n */ (e, n));\n }\n /**\n * Updates the current cache size.\n *\n * Callers to `addEntry()` and `removeEntry()` *must* call this afterwards to update the\n * cache's metadata.\n */ updateMetadata(t, e) {\n return this.getMetadata(t).next((n => (n.byteSize += e, this.qn(t, n))));\n }\n getEntry(t, e) {\n let n = ke.newInvalidDocument(e);\n return Xr(t).J({\n index: \"documentKeyIndex\",\n range: IDBKeyRange.only(Zr(e))\n }, ((t, s) => {\n n = this.Kn(e, s);\n })).next((() => n));\n }\n /**\n * Looks up an entry in the cache.\n *\n * @param documentKey - The key of the entry to look up.\n * @returns The cached document entry and its size.\n */ Gn(t, e) {\n let n = {\n size: 0,\n document: ke.newInvalidDocument(e)\n };\n return Xr(t).J({\n index: \"documentKeyIndex\",\n range: IDBKeyRange.only(Zr(e))\n }, ((t, s) => {\n n = {\n document: this.Kn(e, s),\n size: Dr(s)\n };\n })).next((() => n));\n }\n getEntries(t, e) {\n let n = cs();\n return this.Qn(t, e, ((t, e) => {\n const s = this.Kn(t, e);\n n = n.insert(t, s);\n })).next((() => n));\n }\n /**\n * Looks up several entries in the cache.\n *\n * @param documentKeys - The set of keys entries to look up.\n * @returns A map of documents indexed by key and a map of sizes indexed by\n * key (zero if the document does not exist).\n */ jn(t, e) {\n let n = cs(), s = new Gt(dt.comparator);\n return this.Qn(t, e, ((t, e) => {\n const i = this.Kn(t, e);\n n = n.insert(t, i), s = s.insert(t, Dr(e));\n })).next((() => ({\n documents: n,\n Wn: s\n })));\n }\n Qn(t, e, n) {\n if (e.isEmpty()) return Vt.resolve();\n let s = new Wt(eo);\n e.forEach((t => s = s.add(t)));\n const i = IDBKeyRange.bound(Zr(s.first()), Zr(s.last())), r = s.getIterator();\n let o = r.getNext();\n return Xr(t).J({\n index: \"documentKeyIndex\",\n range: i\n }, ((t, e, s) => {\n const i = dt.fromSegments([ ...e.prefixPath, e.collectionGroup, e.documentId ]);\n // Go through keys not found in cache.\n for (;o && eo(o, i) < 0; ) n(o, null), o = r.getNext();\n o && o.isEqual(i) && (\n // Key found in cache.\n n(o, e), o = r.hasNext() ? r.getNext() : null), \n // Skip to the next key (if there is one).\n o ? s.q(Zr(o)) : s.done();\n })).next((() => {\n // The rest of the keys are not in the cache. One case where `iterate`\n // above won't go through them is when the cache is empty.\n for (;o; ) n(o, null), o = r.hasNext() ? r.getNext() : null;\n }));\n }\n getAllFromCollection(t, e, n) {\n const s = [ e.popLast().toArray(), e.lastSegment(), ji(n.readTime), n.documentKey.path.isEmpty() ? \"\" : n.documentKey.path.lastSegment() ], i = [ e.popLast().toArray(), e.lastSegment(), [ Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER ], \"\" ];\n return Xr(t).K(IDBKeyRange.bound(s, i, !0)).next((t => {\n let e = cs();\n for (const n of t) {\n const t = this.Kn(dt.fromSegments(n.prefixPath.concat(n.collectionGroup, n.documentId)), n);\n e = e.insert(t.key, t);\n }\n return e;\n }));\n }\n getAllFromCollectionGroup(t, e, n, s) {\n let i = cs();\n const r = to(e, n), o = to(e, At.max());\n return Xr(t).J({\n index: \"collectionGroupIndex\",\n range: IDBKeyRange.bound(r, o, !0)\n }, ((t, e, n) => {\n const r = this.Kn(dt.fromSegments(e.prefixPath.concat(e.collectionGroup, e.documentId)), e);\n i = i.insert(r.key, r), i.size === s && n.done();\n })).next((() => i));\n }\n newChangeBuffer(t) {\n return new Jr(this, !!t && t.trackRemovals);\n }\n getSize(t) {\n return this.getMetadata(t).next((t => t.byteSize));\n }\n getMetadata(t) {\n return Yr(t).get(\"remoteDocumentGlobalKey\").next((t => (U(!!t), t)));\n }\n qn(t, e) {\n return Yr(t).put(\"remoteDocumentGlobalKey\", e);\n }\n /**\n * Decodes `dbRemoteDoc` and returns the document (or an invalid document if\n * the document corresponds to the format used for sentinel deletes).\n */ Kn(t, e) {\n if (e) {\n const t = Gi(this.wt, e);\n // Whether the document is a sentinel removal and should only be used in the\n // `getNewDocumentChanges()`\n if (!(t.isNoDocument() && t.version.isEqual(ct.min()))) return t;\n }\n return ke.newInvalidDocument(t);\n }\n}\n\n/** Creates a new IndexedDbRemoteDocumentCache. */ function Hr(t) {\n return new zr(t);\n}\n\n/**\n * Handles the details of adding and updating documents in the IndexedDbRemoteDocumentCache.\n *\n * Unlike the MemoryRemoteDocumentChangeBuffer, the IndexedDb implementation computes the size\n * delta for all submitted changes. This avoids having to re-read all documents from IndexedDb\n * when we apply the changes.\n */ class Jr extends Wr {\n /**\n * @param documentCache - The IndexedDbRemoteDocumentCache to apply the changes to.\n * @param trackRemovals - Whether to create sentinel deletes that can be tracked by\n * `getNewDocumentChanges()`.\n */\n constructor(t, e) {\n super(), this.zn = t, this.trackRemovals = e, \n // A map of document sizes and read times prior to applying the changes in\n // this buffer.\n this.Hn = new os((t => t.toString()), ((t, e) => t.isEqual(e)));\n }\n applyChanges(t) {\n const e = [];\n let n = 0, s = new Wt(((t, e) => it(t.canonicalString(), e.canonicalString())));\n return this.changes.forEach(((i, r) => {\n const o = this.Hn.get(i);\n if (e.push(this.zn.removeEntry(t, i, o.readTime)), r.isValidDocument()) {\n const u = Qi(this.zn.wt, r);\n s = s.add(i.path.popLast());\n const c = Dr(u);\n n += c - o.size, e.push(this.zn.addEntry(t, i, u));\n } else if (n -= o.size, this.trackRemovals) {\n // In order to track removals, we store a \"sentinel delete\" in the\n // RemoteDocumentCache. This entry is represented by a NoDocument\n // with a version of 0 and ignored by `maybeDecodeDocument()` but\n // preserved in `getNewDocumentChanges()`.\n const n = Qi(this.zn.wt, r.convertToNoDocument(ct.min()));\n e.push(this.zn.addEntry(t, i, n));\n }\n })), s.forEach((n => {\n e.push(this.zn.indexManager.addToCollectionParentIndex(t, n));\n })), e.push(this.zn.updateMetadata(t, n)), Vt.waitFor(e);\n }\n getFromCache(t, e) {\n // Record the size of everything we load from the cache so we can compute a delta later.\n return this.zn.Gn(t, e).next((t => (this.Hn.set(e, {\n size: t.size,\n readTime: t.document.readTime\n }), t.document)));\n }\n getAllFromCache(t, e) {\n // Record the size of everything we load from the cache so we can compute\n // a delta later.\n return this.zn.jn(t, e).next((({documents: t, Wn: e}) => (\n // Note: `getAllFromCache` returns two maps instead of a single map from\n // keys to `DocumentSizeEntry`s. This is to allow returning the\n // `MutableDocumentMap` directly, without a conversion.\n e.forEach(((e, n) => {\n this.Hn.set(e, {\n size: n,\n readTime: t.get(e).readTime\n });\n })), t)));\n }\n}\n\nfunction Yr(t) {\n return $i(t, \"remoteDocumentGlobal\");\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the remoteDocuments object store.\n */ function Xr(t) {\n return $i(t, \"remoteDocumentsV14\");\n}\n\n/**\n * Returns a key that can be used for document lookups on the\n * `DbRemoteDocumentDocumentKeyIndex` index.\n */ function Zr(t) {\n const e = t.path.toArray();\n return [ \n /* prefix path */ e.slice(0, e.length - 2), \n /* collection id */ e[e.length - 2], \n /* document id */ e[e.length - 1] ];\n}\n\nfunction to(t, e) {\n const n = e.documentKey.path.toArray();\n return [ \n /* collection id */ t, ji(e.readTime), \n /* prefix path */ n.slice(0, n.length - 2), \n /* document id */ n.length > 0 ? n[n.length - 1] : \"\" ];\n}\n\n/**\n * Comparator that compares document keys according to the primary key sorting\n * used by the `DbRemoteDocumentDocument` store (by prefix path, collection id\n * and then document ID).\n *\n * Visible for testing.\n */ function eo(t, e) {\n const n = t.path.toArray(), s = e.path.toArray();\n // The ordering is based on https://chromium.googlesource.com/chromium/blink/+/fe5c21fef94dae71c1c3344775b8d8a7f7e6d9ec/Source/modules/indexeddb/IDBKey.cpp#74\n let i = 0;\n for (let t = 0; t < n.length - 2 && t < s.length - 2; ++t) if (i = it(n[t], s[t]), \n i) return i;\n return i = it(n.length, s.length), i || (i = it(n[n.length - 2], s[s.length - 2]), \n i || it(n[n.length - 1], s[s.length - 1]));\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Schema Version for the Web client:\n * 1. Initial version including Mutation Queue, Query Cache, and Remote\n * Document Cache\n * 2. Used to ensure a targetGlobal object exists and add targetCount to it. No\n * longer required because migration 3 unconditionally clears it.\n * 3. Dropped and re-created Query Cache to deal with cache corruption related\n * to limbo resolution. Addresses\n * https://github.com/firebase/firebase-ios-sdk/issues/1548\n * 4. Multi-Tab Support.\n * 5. Removal of held write acks.\n * 6. Create document global for tracking document cache size.\n * 7. Ensure every cached document has a sentinel row with a sequence number.\n * 8. Add collection-parent index for Collection Group queries.\n * 9. Change RemoteDocumentChanges store to be keyed by readTime rather than\n * an auto-incrementing ID. This is required for Index-Free queries.\n * 10. Rewrite the canonical IDs to the explicit Protobuf-based format.\n * 11. Add bundles and named_queries for bundle support.\n * 12. Add document overlays.\n * 13. Rewrite the keys of the remote document cache to allow for efficient\n * document lookup via `getAll()`.\n * 14. Add overlays.\n * 15. Add indexing support.\n */\n/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Represents a local view (overlay) of a document, and the fields that are\n * locally mutated.\n */\nclass no {\n constructor(t, \n /**\n * The fields that are locally mutated by patch mutations. If the overlayed\n * document is from set or delete mutations, this returns null.\n */\n e) {\n this.overlayedDocument = t, this.mutatedFields = e;\n }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A readonly view of the local state of all documents we're tracking (i.e. we\n * have a cached version in remoteDocumentCache or local mutations for the\n * document). The view is computed by applying the mutations in the\n * MutationQueue to the RemoteDocumentCache.\n */ class so {\n constructor(t, e, n, s) {\n this.remoteDocumentCache = t, this.mutationQueue = e, this.documentOverlayCache = n, \n this.indexManager = s;\n }\n /**\n * Get the local view of the document identified by `key`.\n *\n * @returns Local view of the document or null if we don't have any cached\n * state for it.\n */ getDocument(t, e) {\n let n = null;\n return this.documentOverlayCache.getOverlay(t, e).next((s => (n = s, this.getBaseDocument(t, e, n)))).next((t => (null !== n && Qn(n.mutation, t, Jt.empty(), ut.now()), \n t)));\n }\n /**\n * Gets the local view of the documents identified by `keys`.\n *\n * If we don't have cached state for a document in `keys`, a NoDocument will\n * be stored for that key in the resulting set.\n */ getDocuments(t, e) {\n return this.remoteDocumentCache.getEntries(t, e).next((e => this.getLocalViewOfDocuments(t, e, gs()).next((() => e))));\n }\n /**\n * Similar to `getDocuments`, but creates the local view from the given\n * `baseDocs` without retrieving documents from the local store.\n *\n * @param transaction - The transaction this operation is scoped to.\n * @param docs - The documents to apply local mutations to get the local views.\n * @param existenceStateChanged - The set of document keys whose existence state\n * is changed. This is useful to determine if some documents overlay needs\n * to be recalculated.\n */ getLocalViewOfDocuments(t, e, n = gs()) {\n const s = fs();\n return this.populateOverlays(t, s, e).next((() => this.computeViews(t, e, s, n).next((t => {\n let e = hs();\n return t.forEach(((t, n) => {\n e = e.insert(t, n.overlayedDocument);\n })), e;\n }))));\n }\n /**\n * Gets the overlayed documents for the given document map, which will include\n * the local view of those documents and a `FieldMask` indicating which fields\n * are mutated locally, `null` if overlay is a Set or Delete mutation.\n */ getOverlayedDocuments(t, e) {\n const n = fs();\n return this.populateOverlays(t, n, e).next((() => this.computeViews(t, e, n, gs())));\n }\n /**\n * Fetches the overlays for {@code docs} and adds them to provided overlay map\n * if the map does not already contain an entry for the given document key.\n */ populateOverlays(t, e, n) {\n const s = [];\n return n.forEach((t => {\n e.has(t) || s.push(t);\n })), this.documentOverlayCache.getOverlays(t, s).next((t => {\n t.forEach(((t, n) => {\n e.set(t, n);\n }));\n }));\n }\n /**\n * Computes the local view for the given documents.\n *\n * @param docs - The documents to compute views for. It also has the base\n * version of the documents.\n * @param overlays - The overlays that need to be applied to the given base\n * version of the documents.\n * @param existenceStateChanged - A set of documents whose existence states\n * might have changed. This is used to determine if we need to re-calculate\n * overlays from mutation queues.\n * @return A map represents the local documents view.\n */ computeViews(t, e, n, s) {\n let i = cs();\n const r = _s(), o = _s();\n return e.forEach(((t, e) => {\n const o = n.get(e.key);\n // Recalculate an overlay if the document's existence state changed due to\n // a remote event *and* the overlay is a PatchMutation. This is because\n // document existence state can change if some patch mutation's\n // preconditions are met.\n // NOTE: we recalculate when `overlay` is undefined as well, because there\n // might be a patch mutation whose precondition does not match before the\n // change (hence overlay is undefined), but would now match.\n s.has(e.key) && (void 0 === o || o.mutation instanceof Hn) ? i = i.insert(e.key, e) : void 0 !== o && (r.set(e.key, o.mutation.getFieldMask()), \n Qn(o.mutation, e, o.mutation.getFieldMask(), ut.now()));\n })), this.recalculateAndSaveOverlays(t, i).next((t => (t.forEach(((t, e) => r.set(t, e))), \n e.forEach(((t, e) => {\n var n;\n return o.set(t, new no(e, null !== (n = r.get(t)) && void 0 !== n ? n : null));\n })), o)));\n }\n recalculateAndSaveOverlays(t, e) {\n const n = _s();\n // A reverse lookup map from batch id to the documents within that batch.\n let s = new Gt(((t, e) => t - e)), i = gs();\n return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(t, e).next((t => {\n for (const i of t) i.keys().forEach((t => {\n const r = e.get(t);\n if (null === r) return;\n let o = n.get(t) || Jt.empty();\n o = i.applyToLocalView(r, o), n.set(t, o);\n const u = (s.get(i.batchId) || gs()).add(t);\n s = s.insert(i.batchId, u);\n }));\n })).next((() => {\n const r = [], o = s.getReverseIterator();\n // Iterate in descending order of batch IDs, and skip documents that are\n // already saved.\n for (;o.hasNext(); ) {\n const s = o.getNext(), u = s.key, c = s.value, a = ds();\n c.forEach((t => {\n if (!i.has(t)) {\n const s = Kn(e.get(t), n.get(t));\n null !== s && a.set(t, s), i = i.add(t);\n }\n })), r.push(this.documentOverlayCache.saveOverlays(t, u, a));\n }\n return Vt.waitFor(r);\n })).next((() => n));\n }\n /**\n * Recalculates overlays by reading the documents from remote document cache\n * first, and saves them after they are calculated.\n */ recalculateAndSaveOverlaysForDocumentKeys(t, e) {\n return this.remoteDocumentCache.getEntries(t, e).next((e => this.recalculateAndSaveOverlays(t, e)));\n }\n /**\n * Performs a query against the local view of all documents.\n *\n * @param transaction - The persistence transaction.\n * @param query - The query to match documents against.\n * @param offset - Read time and key to start scanning by (exclusive).\n */ getDocumentsMatchingQuery(t, e, n) {\n /**\n * Returns whether the query matches a single document by path (rather than a\n * collection).\n */\n return function(t) {\n return dt.isDocumentKey(t.path) && null === t.collectionGroup && 0 === t.filters.length;\n }(e) ? this.getDocumentsMatchingDocumentQuery(t, e.path) : ln(e) ? this.getDocumentsMatchingCollectionGroupQuery(t, e, n) : this.getDocumentsMatchingCollectionQuery(t, e, n);\n }\n /**\n * Given a collection group, returns the next documents that follow the provided offset, along\n * with an updated batch ID.\n *\n * <p>The documents returned by this method are ordered by remote version from the provided\n * offset. If there are no more remote documents after the provided offset, documents with\n * mutations in order of batch id from the offset are returned. Since all documents in a batch are\n * returned together, the total number of documents returned can exceed {@code count}.\n *\n * @param transaction\n * @param collectionGroup The collection group for the documents.\n * @param offset The offset to index into.\n * @param count The number of documents to return\n * @return A LocalWriteResult with the documents that follow the provided offset and the last processed batch id.\n */ getNextDocuments(t, e, n, s) {\n return this.remoteDocumentCache.getAllFromCollectionGroup(t, e, n, s).next((i => {\n const r = s - i.size > 0 ? this.documentOverlayCache.getOverlaysForCollectionGroup(t, e, n.largestBatchId, s - i.size) : Vt.resolve(fs());\n // The callsite will use the largest batch ID together with the latest read time to create\n // a new index offset. Since we only process batch IDs if all remote documents have been read,\n // no overlay will increase the overall read time. This is why we only need to special case\n // the batch id.\n let o = -1, u = i;\n return r.next((e => Vt.forEach(e, ((e, n) => (o < n.largestBatchId && (o = n.largestBatchId), \n i.get(e) ? Vt.resolve() : this.getBaseDocument(t, e, n).next((t => {\n u = u.insert(e, t);\n }))))).next((() => this.populateOverlays(t, e, i))).next((() => this.computeViews(t, u, e, gs()))).next((t => ({\n batchId: o,\n changes: ls(t)\n })))));\n }));\n }\n getDocumentsMatchingDocumentQuery(t, e) {\n // Just do a simple document lookup.\n return this.getDocument(t, new dt(e)).next((t => {\n let e = hs();\n return t.isFoundDocument() && (e = e.insert(t.key, t)), e;\n }));\n }\n getDocumentsMatchingCollectionGroupQuery(t, e, n) {\n const s = e.collectionGroup;\n let i = hs();\n return this.indexManager.getCollectionParents(t, s).next((r => Vt.forEach(r, (r => {\n const o = function(t, e) {\n return new rn(e, \n /*collectionGroup=*/ null, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);\n }(e, r.child(s));\n return this.getDocumentsMatchingCollectionQuery(t, o, n).next((t => {\n t.forEach(((t, e) => {\n i = i.insert(t, e);\n }));\n }));\n })).next((() => i))));\n }\n getDocumentsMatchingCollectionQuery(t, e, n) {\n // Query the remote documents and overlay mutations.\n let s;\n return this.remoteDocumentCache.getAllFromCollection(t, e.path, n).next((i => (s = i, \n this.documentOverlayCache.getOverlaysForCollection(t, e.path, n.largestBatchId)))).next((t => {\n // As documents might match the query because of their overlay we need to\n // include documents for all overlays in the initial document set.\n t.forEach(((t, e) => {\n const n = e.getKey();\n null === s.get(n) && (s = s.insert(n, ke.newInvalidDocument(n)));\n }));\n // Apply the overlays and match against the query.\n let n = hs();\n return s.forEach(((s, i) => {\n const r = t.get(s);\n void 0 !== r && Qn(r.mutation, i, Jt.empty(), ut.now()), \n // Finally, insert the documents that still match the query\n yn(e, i) && (n = n.insert(s, i));\n })), n;\n }));\n }\n /** Returns a base document that can be used to apply `overlay`. */ getBaseDocument(t, e, n) {\n return null === n || 1 /* Patch */ === n.mutation.type ? this.remoteDocumentCache.getEntry(t, e) : Vt.resolve(ke.newInvalidDocument(e));\n }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ class io {\n constructor(t) {\n this.wt = t, this.Jn = new Map, this.Yn = new Map;\n }\n getBundleMetadata(t, e) {\n return Vt.resolve(this.Jn.get(e));\n }\n saveBundleMetadata(t, e) {\n /** Decodes a BundleMetadata proto into a BundleMetadata object. */\n var n;\n return this.Jn.set(e.id, {\n id: (n = e).id,\n version: n.version,\n createTime: Ms(n.createTime)\n }), Vt.resolve();\n }\n getNamedQuery(t, e) {\n return Vt.resolve(this.Yn.get(e));\n }\n saveNamedQuery(t, e) {\n return this.Yn.set(e.name, function(t) {\n return {\n name: t.name,\n query: Xi(t.bundledQuery),\n readTime: Ms(t.readTime)\n };\n }(e)), Vt.resolve();\n }\n}\n\n/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * An in-memory implementation of DocumentOverlayCache.\n */ class ro {\n constructor() {\n // A map sorted by DocumentKey, whose value is a pair of the largest batch id\n // for the overlay and the overlay itself.\n this.overlays = new Gt(dt.comparator), this.Xn = new Map;\n }\n getOverlay(t, e) {\n return Vt.resolve(this.overlays.get(e));\n }\n getOverlays(t, e) {\n const n = fs();\n return Vt.forEach(e, (e => this.getOverlay(t, e).next((t => {\n null !== t && n.set(e, t);\n })))).next((() => n));\n }\n saveOverlays(t, e, n) {\n return n.forEach(((n, s) => {\n this.ie(t, e, s);\n })), Vt.resolve();\n }\n removeOverlaysForBatchId(t, e, n) {\n const s = this.Xn.get(n);\n return void 0 !== s && (s.forEach((t => this.overlays = this.overlays.remove(t))), \n this.Xn.delete(n)), Vt.resolve();\n }\n getOverlaysForCollection(t, e, n) {\n const s = fs(), i = e.length + 1, r = new dt(e.child(\"\")), o = this.overlays.getIteratorFrom(r);\n for (;o.hasNext(); ) {\n const t = o.getNext().value, r = t.getKey();\n if (!e.isPrefixOf(r.path)) break;\n // Documents from sub-collections\n r.path.length === i && (t.largestBatchId > n && s.set(t.getKey(), t));\n }\n return Vt.resolve(s);\n }\n getOverlaysForCollectionGroup(t, e, n, s) {\n let i = new Gt(((t, e) => t - e));\n const r = this.overlays.getIterator();\n for (;r.hasNext(); ) {\n const t = r.getNext().value;\n if (t.getKey().getCollectionGroup() === e && t.largestBatchId > n) {\n let e = i.get(t.largestBatchId);\n null === e && (e = fs(), i = i.insert(t.largestBatchId, e)), e.set(t.getKey(), t);\n }\n }\n const o = fs(), u = i.getIterator();\n for (;u.hasNext(); ) {\n if (u.getNext().value.forEach(((t, e) => o.set(t, e))), o.size() >= s) break;\n }\n return Vt.resolve(o);\n }\n ie(t, e, n) {\n // Remove the association of the overlay to its batch id.\n const s = this.overlays.get(n.key);\n if (null !== s) {\n const t = this.Xn.get(s.largestBatchId).delete(n.key);\n this.Xn.set(s.largestBatchId, t);\n }\n this.overlays = this.overlays.insert(n.key, new Ui(e, n));\n // Create the association of this overlay to the given largestBatchId.\n let i = this.Xn.get(e);\n void 0 === i && (i = gs(), this.Xn.set(e, i)), this.Xn.set(e, i.add(n.key));\n }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A collection of references to a document from some kind of numbered entity\n * (either a target ID or batch ID). As references are added to or removed from\n * the set corresponding events are emitted to a registered garbage collector.\n *\n * Each reference is represented by a DocumentReference object. Each of them\n * contains enough information to uniquely identify the reference. They are all\n * stored primarily in a set sorted by key. A document is considered garbage if\n * there's no references in that set (this can be efficiently checked thanks to\n * sorting by key).\n *\n * ReferenceSet also keeps a secondary set that contains references sorted by\n * IDs. This one is used to efficiently implement removal of all references by\n * some target ID.\n */ class oo {\n constructor() {\n // A set of outstanding references to a document sorted by key.\n this.Zn = new Wt(uo.ts), \n // A set of outstanding references to a document sorted by target id.\n this.es = new Wt(uo.ns);\n }\n /** Returns true if the reference set contains no references. */ isEmpty() {\n return this.Zn.isEmpty();\n }\n /** Adds a reference to the given document key for the given ID. */ addReference(t, e) {\n const n = new uo(t, e);\n this.Zn = this.Zn.add(n), this.es = this.es.add(n);\n }\n /** Add references to the given document keys for the given ID. */ ss(t, e) {\n t.forEach((t => this.addReference(t, e)));\n }\n /**\n * Removes a reference to the given document key for the given\n * ID.\n */ removeReference(t, e) {\n this.rs(new uo(t, e));\n }\n os(t, e) {\n t.forEach((t => this.removeReference(t, e)));\n }\n /**\n * Clears all references with a given ID. Calls removeRef() for each key\n * removed.\n */ us(t) {\n const e = new dt(new ht([])), n = new uo(e, t), s = new uo(e, t + 1), i = [];\n return this.es.forEachInRange([ n, s ], (t => {\n this.rs(t), i.push(t.key);\n })), i;\n }\n cs() {\n this.Zn.forEach((t => this.rs(t)));\n }\n rs(t) {\n this.Zn = this.Zn.delete(t), this.es = this.es.delete(t);\n }\n hs(t) {\n const e = new dt(new ht([])), n = new uo(e, t), s = new uo(e, t + 1);\n let i = gs();\n return this.es.forEachInRange([ n, s ], (t => {\n i = i.add(t.key);\n })), i;\n }\n containsKey(t) {\n const e = new uo(t, 0), n = this.Zn.firstAfterOrEqual(e);\n return null !== n && t.isEqual(n.key);\n }\n}\n\nclass uo {\n constructor(t, e) {\n this.key = t, this.ls = e;\n }\n /** Compare by key then by ID */ static ts(t, e) {\n return dt.comparator(t.key, e.key) || it(t.ls, e.ls);\n }\n /** Compare by ID then by key */ static ns(t, e) {\n return it(t.ls, e.ls) || dt.comparator(t.key, e.key);\n }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ class co {\n constructor(t, e) {\n this.indexManager = t, this.referenceDelegate = e, \n /**\n * The set of all mutations that have been sent but not yet been applied to\n * the backend.\n */\n this.mutationQueue = [], \n /** Next value to use when assigning sequential IDs to each mutation batch. */\n this.fs = 1, \n /** An ordered mapping between documents and the mutations batch IDs. */\n this.ds = new Wt(uo.ts);\n }\n checkEmpty(t) {\n return Vt.resolve(0 === this.mutationQueue.length);\n }\n addMutationBatch(t, e, n, s) {\n const i = this.fs;\n this.fs++, this.mutationQueue.length > 0 && this.mutationQueue[this.mutationQueue.length - 1];\n const r = new Bi(i, e, n, s);\n this.mutationQueue.push(r);\n // Track references by document key and index collection parents.\n for (const e of s) this.ds = this.ds.add(new uo(e.key, i)), this.indexManager.addToCollectionParentIndex(t, e.key.path.popLast());\n return Vt.resolve(r);\n }\n lookupMutationBatch(t, e) {\n return Vt.resolve(this._s(e));\n }\n getNextMutationBatchAfterBatchId(t, e) {\n const n = e + 1, s = this.ws(n), i = s < 0 ? 0 : s;\n // The requested batchId may still be out of range so normalize it to the\n // start of the queue.\n return Vt.resolve(this.mutationQueue.length > i ? this.mutationQueue[i] : null);\n }\n getHighestUnacknowledgedBatchId() {\n return Vt.resolve(0 === this.mutationQueue.length ? -1 : this.fs - 1);\n }\n getAllMutationBatches(t) {\n return Vt.resolve(this.mutationQueue.slice());\n }\n getAllMutationBatchesAffectingDocumentKey(t, e) {\n const n = new uo(e, 0), s = new uo(e, Number.POSITIVE_INFINITY), i = [];\n return this.ds.forEachInRange([ n, s ], (t => {\n const e = this._s(t.ls);\n i.push(e);\n })), Vt.resolve(i);\n }\n getAllMutationBatchesAffectingDocumentKeys(t, e) {\n let n = new Wt(it);\n return e.forEach((t => {\n const e = new uo(t, 0), s = new uo(t, Number.POSITIVE_INFINITY);\n this.ds.forEachInRange([ e, s ], (t => {\n n = n.add(t.ls);\n }));\n })), Vt.resolve(this.gs(n));\n }\n getAllMutationBatchesAffectingQuery(t, e) {\n // Use the query path as a prefix for testing if a document matches the\n // query.\n const n = e.path, s = n.length + 1;\n // Construct a document reference for actually scanning the index. Unlike\n // the prefix the document key in this reference must have an even number of\n // segments. The empty segment can be used a suffix of the query path\n // because it precedes all other segments in an ordered traversal.\n let i = n;\n dt.isDocumentKey(i) || (i = i.child(\"\"));\n const r = new uo(new dt(i), 0);\n // Find unique batchIDs referenced by all documents potentially matching the\n // query.\n let o = new Wt(it);\n return this.ds.forEachWhile((t => {\n const e = t.key.path;\n return !!n.isPrefixOf(e) && (\n // Rows with document keys more than one segment longer than the query\n // path can't be matches. For example, a query on 'rooms' can't match\n // the document /rooms/abc/messages/xyx.\n // TODO(mcg): we'll need a different scanner when we implement\n // ancestor queries.\n e.length === s && (o = o.add(t.ls)), !0);\n }), r), Vt.resolve(this.gs(o));\n }\n gs(t) {\n // Construct an array of matching batches, sorted by batchID to ensure that\n // multiple mutations affecting the same document key are applied in order.\n const e = [];\n return t.forEach((t => {\n const n = this._s(t);\n null !== n && e.push(n);\n })), e;\n }\n removeMutationBatch(t, e) {\n U(0 === this.ys(e.batchId, \"removed\")), this.mutationQueue.shift();\n let n = this.ds;\n return Vt.forEach(e.mutations, (s => {\n const i = new uo(s.key, e.batchId);\n return n = n.delete(i), this.referenceDelegate.markPotentiallyOrphaned(t, s.key);\n })).next((() => {\n this.ds = n;\n }));\n }\n In(t) {\n // No-op since the memory mutation queue does not maintain a separate cache.\n }\n containsKey(t, e) {\n const n = new uo(e, 0), s = this.ds.firstAfterOrEqual(n);\n return Vt.resolve(e.isEqual(s && s.key));\n }\n performConsistencyCheck(t) {\n return this.mutationQueue.length, Vt.resolve();\n }\n /**\n * Finds the index of the given batchId in the mutation queue and asserts that\n * the resulting index is within the bounds of the queue.\n *\n * @param batchId - The batchId to search for\n * @param action - A description of what the caller is doing, phrased in passive\n * form (e.g. \"acknowledged\" in a routine that acknowledges batches).\n */ ys(t, e) {\n return this.ws(t);\n }\n /**\n * Finds the index of the given batchId in the mutation queue. This operation\n * is O(1).\n *\n * @returns The computed index of the batch with the given batchId, based on\n * the state of the queue. Note this index can be negative if the requested\n * batchId has already been remvoed from the queue or past the end of the\n * queue if the batchId is larger than the last added batch.\n */ ws(t) {\n if (0 === this.mutationQueue.length) \n // As an index this is past the end of the queue\n return 0;\n // Examine the front of the queue to figure out the difference between the\n // batchId and indexes in the array. Note that since the queue is ordered\n // by batchId, if the first batch has a larger batchId then the requested\n // batchId doesn't exist in the queue.\n return t - this.mutationQueue[0].batchId;\n }\n /**\n * A version of lookupMutationBatch that doesn't return a promise, this makes\n * other functions that uses this code easier to read and more efficent.\n */ _s(t) {\n const e = this.ws(t);\n if (e < 0 || e >= this.mutationQueue.length) return null;\n return this.mutationQueue[e];\n }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * The memory-only RemoteDocumentCache for IndexedDb. To construct, invoke\n * `newMemoryRemoteDocumentCache()`.\n */\nclass ao {\n /**\n * @param sizer - Used to assess the size of a document. For eager GC, this is\n * expected to just return 0 to avoid unnecessarily doing the work of\n * calculating the size.\n */\n constructor(t) {\n this.ps = t, \n /** Underlying cache of documents and their read times. */\n this.docs = new Gt(dt.comparator), \n /** Size of all cached documents. */\n this.size = 0;\n }\n setIndexManager(t) {\n this.indexManager = t;\n }\n /**\n * Adds the supplied entry to the cache and updates the cache size as appropriate.\n *\n * All calls of `addEntry` are required to go through the RemoteDocumentChangeBuffer\n * returned by `newChangeBuffer()`.\n */ addEntry(t, e) {\n const n = e.key, s = this.docs.get(n), i = s ? s.size : 0, r = this.ps(e);\n return this.docs = this.docs.insert(n, {\n document: e.mutableCopy(),\n size: r\n }), this.size += r - i, this.indexManager.addToCollectionParentIndex(t, n.path.popLast());\n }\n /**\n * Removes the specified entry from the cache and updates the cache size as appropriate.\n *\n * All calls of `removeEntry` are required to go through the RemoteDocumentChangeBuffer\n * returned by `newChangeBuffer()`.\n */ removeEntry(t) {\n const e = this.docs.get(t);\n e && (this.docs = this.docs.remove(t), this.size -= e.size);\n }\n getEntry(t, e) {\n const n = this.docs.get(e);\n return Vt.resolve(n ? n.document.mutableCopy() : ke.newInvalidDocument(e));\n }\n getEntries(t, e) {\n let n = cs();\n return e.forEach((t => {\n const e = this.docs.get(t);\n n = n.insert(t, e ? e.document.mutableCopy() : ke.newInvalidDocument(t));\n })), Vt.resolve(n);\n }\n getAllFromCollection(t, e, n) {\n let s = cs();\n // Documents are ordered by key, so we can use a prefix scan to narrow down\n // the documents we need to match the query against.\n const i = new dt(e.child(\"\")), r = this.docs.getIteratorFrom(i);\n for (;r.hasNext(); ) {\n const {key: t, value: {document: i}} = r.getNext();\n if (!e.isPrefixOf(t.path)) break;\n t.path.length > e.length + 1 || (Rt(Et(i), n) <= 0 || (s = s.insert(i.key, i.mutableCopy())));\n }\n return Vt.resolve(s);\n }\n getAllFromCollectionGroup(t, e, n, s) {\n // This method should only be called from the IndexBackfiller if persistence\n // is enabled.\n L();\n }\n Is(t, e) {\n return Vt.forEach(this.docs, (t => e(t)));\n }\n newChangeBuffer(t) {\n // `trackRemovals` is ignores since the MemoryRemoteDocumentCache keeps\n // a separate changelog and does not need special handling for removals.\n return new ho(this);\n }\n getSize(t) {\n return Vt.resolve(this.size);\n }\n}\n\n/**\n * Creates a new memory-only RemoteDocumentCache.\n *\n * @param sizer - Used to assess the size of a document. For eager GC, this is\n * expected to just return 0 to avoid unnecessarily doing the work of\n * calculating the size.\n */\n/**\n * Handles the details of adding and updating documents in the MemoryRemoteDocumentCache.\n */\nclass ho extends Wr {\n constructor(t) {\n super(), this.zn = t;\n }\n applyChanges(t) {\n const e = [];\n return this.changes.forEach(((n, s) => {\n s.isValidDocument() ? e.push(this.zn.addEntry(t, s)) : this.zn.removeEntry(n);\n })), Vt.waitFor(e);\n }\n getFromCache(t, e) {\n return this.zn.getEntry(t, e);\n }\n getAllFromCache(t, e) {\n return this.zn.getEntries(t, e);\n }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ class lo {\n constructor(t) {\n this.persistence = t, \n /**\n * Maps a target to the data about that target\n */\n this.Ts = new os((t => Fe(t)), Be), \n /** The last received snapshot version. */\n this.lastRemoteSnapshotVersion = ct.min(), \n /** The highest numbered target ID encountered. */\n this.highestTargetId = 0, \n /** The highest sequence number encountered. */\n this.Es = 0, \n /**\n * A ordered bidirectional mapping between documents and the remote target\n * IDs.\n */\n this.As = new oo, this.targetCount = 0, this.Rs = Or.An();\n }\n forEachTarget(t, e) {\n return this.Ts.forEach(((t, n) => e(n))), Vt.resolve();\n }\n getLastRemoteSnapshotVersion(t) {\n return Vt.resolve(this.lastRemoteSnapshotVersion);\n }\n getHighestSequenceNumber(t) {\n return Vt.resolve(this.Es);\n }\n allocateTargetId(t) {\n return this.highestTargetId = this.Rs.next(), Vt.resolve(this.highestTargetId);\n }\n setTargetsMetadata(t, e, n) {\n return n && (this.lastRemoteSnapshotVersion = n), e > this.Es && (this.Es = e), \n Vt.resolve();\n }\n vn(t) {\n this.Ts.set(t.target, t);\n const e = t.targetId;\n e > this.highestTargetId && (this.Rs = new Or(e), this.highestTargetId = e), t.sequenceNumber > this.Es && (this.Es = t.sequenceNumber);\n }\n addTargetData(t, e) {\n return this.vn(e), this.targetCount += 1, Vt.resolve();\n }\n updateTargetData(t, e) {\n return this.vn(e), Vt.resolve();\n }\n removeTargetData(t, e) {\n return this.Ts.delete(e.target), this.As.us(e.targetId), this.targetCount -= 1, \n Vt.resolve();\n }\n removeTargets(t, e, n) {\n let s = 0;\n const i = [];\n return this.Ts.forEach(((r, o) => {\n o.sequenceNumber <= e && null === n.get(o.targetId) && (this.Ts.delete(r), i.push(this.removeMatchingKeysForTargetId(t, o.targetId)), \n s++);\n })), Vt.waitFor(i).next((() => s));\n }\n getTargetCount(t) {\n return Vt.resolve(this.targetCount);\n }\n getTargetData(t, e) {\n const n = this.Ts.get(e) || null;\n return Vt.resolve(n);\n }\n addMatchingKeys(t, e, n) {\n return this.As.ss(e, n), Vt.resolve();\n }\n removeMatchingKeys(t, e, n) {\n this.As.os(e, n);\n const s = this.persistence.referenceDelegate, i = [];\n return s && e.forEach((e => {\n i.push(s.markPotentiallyOrphaned(t, e));\n })), Vt.waitFor(i);\n }\n removeMatchingKeysForTargetId(t, e) {\n return this.As.us(e), Vt.resolve();\n }\n getMatchingKeysForTargetId(t, e) {\n const n = this.As.hs(e);\n return Vt.resolve(n);\n }\n containsKey(t, e) {\n return Vt.resolve(this.As.containsKey(e));\n }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A memory-backed instance of Persistence. Data is stored only in RAM and\n * not persisted across sessions.\n */\nclass fo {\n /**\n * The constructor accepts a factory for creating a reference delegate. This\n * allows both the delegate and this instance to have strong references to\n * each other without having nullable fields that would then need to be\n * checked or asserted on every access.\n */\n constructor(t, e) {\n this.bs = {}, this.overlays = {}, this.Ps = new Lt(0), this.vs = !1, this.vs = !0, \n this.referenceDelegate = t(this), this.Vs = new lo(this);\n this.indexManager = new yr, this.remoteDocumentCache = function(t) {\n return new ao(t);\n }((t => this.referenceDelegate.Ss(t))), this.wt = new Ki(e), this.Ds = new io(this.wt);\n }\n start() {\n return Promise.resolve();\n }\n shutdown() {\n // No durable state to ensure is closed on shutdown.\n return this.vs = !1, Promise.resolve();\n }\n get started() {\n return this.vs;\n }\n setDatabaseDeletedListener() {\n // No op.\n }\n setNetworkEnabled() {\n // No op.\n }\n getIndexManager(t) {\n // We do not currently support indices for memory persistence, so we can\n // return the same shared instance of the memory index manager.\n return this.indexManager;\n }\n getDocumentOverlayCache(t) {\n let e = this.overlays[t.toKey()];\n return e || (e = new ro, this.overlays[t.toKey()] = e), e;\n }\n getMutationQueue(t, e) {\n let n = this.bs[t.toKey()];\n return n || (n = new co(e, this.referenceDelegate), this.bs[t.toKey()] = n), n;\n }\n getTargetCache() {\n return this.Vs;\n }\n getRemoteDocumentCache() {\n return this.remoteDocumentCache;\n }\n getBundleCache() {\n return this.Ds;\n }\n runTransaction(t, e, n) {\n O(\"MemoryPersistence\", \"Starting transaction:\", t);\n const s = new _o(this.Ps.next());\n return this.referenceDelegate.Cs(), n(s).next((t => this.referenceDelegate.xs(s).next((() => t)))).toPromise().then((t => (s.raiseOnCommittedEvent(), \n t)));\n }\n Ns(t, e) {\n return Vt.or(Object.values(this.bs).map((n => () => n.containsKey(t, e))));\n }\n}\n\n/**\n * Memory persistence is not actually transactional, but future implementations\n * may have transaction-scoped state.\n */ class _o extends Pt {\n constructor(t) {\n super(), this.currentSequenceNumber = t;\n }\n}\n\nclass wo {\n constructor(t) {\n this.persistence = t, \n /** Tracks all documents that are active in Query views. */\n this.ks = new oo, \n /** The list of documents that are potentially GCed after each transaction. */\n this.Ms = null;\n }\n static Os(t) {\n return new wo(t);\n }\n get Fs() {\n if (this.Ms) return this.Ms;\n throw L();\n }\n addReference(t, e, n) {\n return this.ks.addReference(n, e), this.Fs.delete(n.toString()), Vt.resolve();\n }\n removeReference(t, e, n) {\n return this.ks.removeReference(n, e), this.Fs.add(n.toString()), Vt.resolve();\n }\n markPotentiallyOrphaned(t, e) {\n return this.Fs.add(e.toString()), Vt.resolve();\n }\n removeTarget(t, e) {\n this.ks.us(e.targetId).forEach((t => this.Fs.add(t.toString())));\n const n = this.persistence.getTargetCache();\n return n.getMatchingKeysForTargetId(t, e.targetId).next((t => {\n t.forEach((t => this.Fs.add(t.toString())));\n })).next((() => n.removeTargetData(t, e)));\n }\n Cs() {\n this.Ms = new Set;\n }\n xs(t) {\n // Remove newly orphaned documents.\n const e = this.persistence.getRemoteDocumentCache().newChangeBuffer();\n return Vt.forEach(this.Fs, (n => {\n const s = dt.fromPath(n);\n return this.$s(t, s).next((t => {\n t || e.removeEntry(s, ct.min());\n }));\n })).next((() => (this.Ms = null, e.apply(t))));\n }\n updateLimboDocument(t, e) {\n return this.$s(t, e).next((t => {\n t ? this.Fs.delete(e.toString()) : this.Fs.add(e.toString());\n }));\n }\n Ss(t) {\n // For eager GC, we don't care about the document size, there are no size thresholds.\n return 0;\n }\n $s(t, e) {\n return Vt.or([ () => Vt.resolve(this.ks.containsKey(e)), () => this.persistence.getTargetCache().containsKey(t, e), () => this.persistence.Ns(t, e) ]);\n }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** Performs database creation and schema upgrades. */ class mo {\n constructor(t) {\n this.wt = t;\n }\n /**\n * Performs database creation and schema upgrades.\n *\n * Note that in production, this method is only ever used to upgrade the schema\n * to SCHEMA_VERSION. Different values of toVersion are only used for testing\n * and local feature development.\n */ M(t, e, n, s) {\n const i = new St(\"createOrUpgrade\", e);\n n < 1 && s >= 1 && (function(t) {\n t.createObjectStore(\"owner\");\n }(t), function(t) {\n t.createObjectStore(\"mutationQueues\", {\n keyPath: \"userId\"\n });\n t.createObjectStore(\"mutations\", {\n keyPath: \"batchId\",\n autoIncrement: !0\n }).createIndex(\"userMutationsIndex\", _i, {\n unique: !0\n }), t.createObjectStore(\"documentMutations\");\n }\n /**\n * Upgrade function to migrate the 'mutations' store from V1 to V3. Loads\n * and rewrites all data.\n */ (t), go(t), function(t) {\n t.createObjectStore(\"remoteDocuments\");\n }(t));\n // Migration 2 to populate the targetGlobal object no longer needed since\n // migration 3 unconditionally clears it.\n let r = Vt.resolve();\n return n < 3 && s >= 3 && (\n // Brand new clients don't need to drop and recreate--only clients that\n // potentially have corrupt data.\n 0 !== n && (!function(t) {\n t.deleteObjectStore(\"targetDocuments\"), t.deleteObjectStore(\"targets\"), t.deleteObjectStore(\"targetGlobal\");\n }(t), go(t)), r = r.next((() => \n /**\n * Creates the target global singleton row.\n *\n * @param txn - The version upgrade transaction for indexeddb\n */\n function(t) {\n const e = t.store(\"targetGlobal\"), n = {\n highestTargetId: 0,\n highestListenSequenceNumber: 0,\n lastRemoteSnapshotVersion: ct.min().toTimestamp(),\n targetCount: 0\n };\n return e.put(\"targetGlobalKey\", n);\n }(i)))), n < 4 && s >= 4 && (0 !== n && (\n // Schema version 3 uses auto-generated keys to generate globally unique\n // mutation batch IDs (this was previously ensured internally by the\n // client). To migrate to the new schema, we have to read all mutations\n // and write them back out. We preserve the existing batch IDs to guarantee\n // consistency with other object stores. Any further mutation batch IDs will\n // be auto-generated.\n r = r.next((() => function(t, e) {\n return e.store(\"mutations\").K().next((n => {\n t.deleteObjectStore(\"mutations\");\n t.createObjectStore(\"mutations\", {\n keyPath: \"batchId\",\n autoIncrement: !0\n }).createIndex(\"userMutationsIndex\", _i, {\n unique: !0\n });\n const s = e.store(\"mutations\"), i = n.map((t => s.put(t)));\n return Vt.waitFor(i);\n }));\n }(t, i)))), r = r.next((() => {\n !function(t) {\n t.createObjectStore(\"clientMetadata\", {\n keyPath: \"clientId\"\n });\n }(t);\n }))), n < 5 && s >= 5 && (r = r.next((() => this.Bs(i)))), n < 6 && s >= 6 && (r = r.next((() => (function(t) {\n t.createObjectStore(\"remoteDocumentGlobal\");\n }(t), this.Ls(i))))), n < 7 && s >= 7 && (r = r.next((() => this.Us(i)))), n < 8 && s >= 8 && (r = r.next((() => this.qs(t, i)))), \n n < 9 && s >= 9 && (r = r.next((() => {\n // Multi-Tab used to manage its own changelog, but this has been moved\n // to the DbRemoteDocument object store itself. Since the previous change\n // log only contained transient data, we can drop its object store.\n !function(t) {\n t.objectStoreNames.contains(\"remoteDocumentChanges\") && t.deleteObjectStore(\"remoteDocumentChanges\");\n }(t);\n // Note: Schema version 9 used to create a read time index for the\n // RemoteDocumentCache. This is now done with schema version 13.\n }))), n < 10 && s >= 10 && (r = r.next((() => this.Ks(i)))), n < 11 && s >= 11 && (r = r.next((() => {\n !function(t) {\n t.createObjectStore(\"bundles\", {\n keyPath: \"bundleId\"\n });\n }(t), function(t) {\n t.createObjectStore(\"namedQueries\", {\n keyPath: \"name\"\n });\n }(t);\n }))), n < 12 && s >= 12 && (r = r.next((() => {\n !function(t) {\n const e = t.createObjectStore(\"documentOverlays\", {\n keyPath: Si\n });\n e.createIndex(\"collectionPathOverlayIndex\", Di, {\n unique: !1\n }), e.createIndex(\"collectionGroupOverlayIndex\", Ci, {\n unique: !1\n });\n }(t);\n }))), n < 13 && s >= 13 && (r = r.next((() => function(t) {\n const e = t.createObjectStore(\"remoteDocumentsV14\", {\n keyPath: yi\n });\n e.createIndex(\"documentKeyIndex\", pi), e.createIndex(\"collectionGroupIndex\", Ii);\n }(t))).next((() => this.Gs(t, i))).next((() => t.deleteObjectStore(\"remoteDocuments\")))), \n n < 14 && s >= 14 && (r = r.next((() => this.Qs(t, i)))), n < 15 && s >= 15 && (r = r.next((() => function(t) {\n t.createObjectStore(\"indexConfiguration\", {\n keyPath: \"indexId\",\n autoIncrement: !0\n }).createIndex(\"collectionGroupIndex\", \"collectionGroup\", {\n unique: !1\n });\n t.createObjectStore(\"indexState\", {\n keyPath: bi\n }).createIndex(\"sequenceNumberIndex\", Pi, {\n unique: !1\n });\n t.createObjectStore(\"indexEntries\", {\n keyPath: vi\n }).createIndex(\"documentKeyIndex\", Vi, {\n unique: !1\n });\n }(t)))), r;\n }\n Ls(t) {\n let e = 0;\n return t.store(\"remoteDocuments\").J(((t, n) => {\n e += Dr(n);\n })).next((() => {\n const n = {\n byteSize: e\n };\n return t.store(\"remoteDocumentGlobal\").put(\"remoteDocumentGlobalKey\", n);\n }));\n }\n Bs(t) {\n const e = t.store(\"mutationQueues\"), n = t.store(\"mutations\");\n return e.K().next((e => Vt.forEach(e, (e => {\n const s = IDBKeyRange.bound([ e.userId, -1 ], [ e.userId, e.lastAcknowledgedBatchId ]);\n return n.K(\"userMutationsIndex\", s).next((n => Vt.forEach(n, (n => {\n U(n.userId === e.userId);\n const s = Hi(this.wt, n);\n return Sr(t, e.userId, s).next((() => {}));\n }))));\n }))));\n }\n /**\n * Ensures that every document in the remote document cache has a corresponding sentinel row\n * with a sequence number. Missing rows are given the most recently used sequence number.\n */ Us(t) {\n const e = t.store(\"targetDocuments\"), n = t.store(\"remoteDocuments\");\n return t.store(\"targetGlobal\").get(\"targetGlobalKey\").next((t => {\n const s = [];\n return n.J(((n, i) => {\n const r = new ht(n), o = function(t) {\n return [ 0, hi(t) ];\n }(r);\n s.push(e.get(o).next((n => n ? Vt.resolve() : (n => e.put({\n targetId: 0,\n path: hi(n),\n sequenceNumber: t.highestListenSequenceNumber\n }))(r))));\n })).next((() => Vt.waitFor(s)));\n }));\n }\n qs(t, e) {\n // Create the index.\n t.createObjectStore(\"collectionParents\", {\n keyPath: Ri\n });\n const n = e.store(\"collectionParents\"), s = new pr, i = t => {\n if (s.add(t)) {\n const e = t.lastSegment(), s = t.popLast();\n return n.put({\n collectionId: e,\n parent: hi(s)\n });\n }\n };\n // Helper to add an index entry iff we haven't already written it.\n // Index existing remote documents.\n return e.store(\"remoteDocuments\").J({\n H: !0\n }, ((t, e) => {\n const n = new ht(t);\n return i(n.popLast());\n })).next((() => e.store(\"documentMutations\").J({\n H: !0\n }, (([t, e, n], s) => {\n const r = di(e);\n return i(r.popLast());\n }))));\n }\n Ks(t) {\n const e = t.store(\"targets\");\n return e.J(((t, n) => {\n const s = Ji(n), i = Yi(this.wt, s);\n return e.put(i);\n }));\n }\n Gs(t, e) {\n const n = e.store(\"remoteDocuments\"), s = [];\n return n.J(((t, n) => {\n const i = e.store(\"remoteDocumentsV14\"), r = (o = n, o.document ? new dt(ht.fromString(o.document.name).popFirst(5)) : o.noDocument ? dt.fromSegments(o.noDocument.path) : o.unknownDocument ? dt.fromSegments(o.unknownDocument.path) : L()).path.toArray();\n var o;\n /**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ const u = {\n prefixPath: r.slice(0, r.length - 2),\n collectionGroup: r[r.length - 2],\n documentId: r[r.length - 1],\n readTime: n.readTime || [ 0, 0 ],\n unknownDocument: n.unknownDocument,\n noDocument: n.noDocument,\n document: n.document,\n hasCommittedMutations: !!n.hasCommittedMutations\n };\n s.push(i.put(u));\n })).next((() => Vt.waitFor(s)));\n }\n Qs(t, e) {\n const n = e.store(\"mutations\"), s = Hr(this.wt), i = new fo(wo.Os, this.wt.ne);\n return n.K().next((t => {\n const n = new Map;\n return t.forEach((t => {\n var e;\n let s = null !== (e = n.get(t.userId)) && void 0 !== e ? e : gs();\n Hi(this.wt, t).keys().forEach((t => s = s.add(t))), n.set(t.userId, s);\n })), Vt.forEach(n, ((t, n) => {\n const r = new C(n), o = rr.se(this.wt, r), u = i.getIndexManager(r), c = Cr.se(r, this.wt, u, i.referenceDelegate);\n return new so(s, c, o, u).recalculateAndSaveOverlaysForDocumentKeys(new Fi(e, Lt.ot), t).next();\n }));\n }));\n }\n}\n\nfunction go(t) {\n t.createObjectStore(\"targetDocuments\", {\n keyPath: Ei\n }).createIndex(\"documentTargetsIndex\", Ai, {\n unique: !0\n });\n // NOTE: This is unique only because the TargetId is the suffix.\n t.createObjectStore(\"targets\", {\n keyPath: \"targetId\"\n }).createIndex(\"queryTargetsIndex\", Ti, {\n unique: !0\n }), t.createObjectStore(\"targetGlobal\");\n}\n\nconst yo = \"Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.\";\n\n/**\n * Oldest acceptable age in milliseconds for client metadata before the client\n * is considered inactive and its associated data is garbage collected.\n */\n/**\n * An IndexedDB-backed instance of Persistence. Data is stored persistently\n * across sessions.\n *\n * On Web only, the Firestore SDKs support shared access to its persistence\n * layer. This allows multiple browser tabs to read and write to IndexedDb and\n * to synchronize state even without network connectivity. Shared access is\n * currently optional and not enabled unless all clients invoke\n * `enablePersistence()` with `{synchronizeTabs:true}`.\n *\n * In multi-tab mode, if multiple clients are active at the same time, the SDK\n * will designate one client as the “primary clientâ€. An effort is made to pick\n * a visible, network-connected and active client, and this client is\n * responsible for letting other clients know about its presence. The primary\n * client writes a unique client-generated identifier (the client ID) to\n * IndexedDb’s “owner†store every 4 seconds. If the primary client fails to\n * update this entry, another client can acquire the lease and take over as\n * primary.\n *\n * Some persistence operations in the SDK are designated as primary-client only\n * operations. This includes the acknowledgment of mutations and all updates of\n * remote documents. The effects of these operations are written to persistence\n * and then broadcast to other tabs via LocalStorage (see\n * `WebStorageSharedClientState`), which then refresh their state from\n * persistence.\n *\n * Similarly, the primary client listens to notifications sent by secondary\n * clients to discover persistence changes written by secondary clients, such as\n * the addition of new mutations and query targets.\n *\n * If multi-tab is not enabled and another tab already obtained the primary\n * lease, IndexedDbPersistence enters a failed state and all subsequent\n * operations will automatically fail.\n *\n * Additionally, there is an optimization so that when a tab is closed, the\n * primary lease is released immediately (this is especially important to make\n * sure that a refreshed tab is able to immediately re-acquire the primary\n * lease). Unfortunately, IndexedDB cannot be reliably used in window.unload\n * since it is an asynchronous API. So in addition to attempting to give up the\n * lease, the leaseholder writes its client ID to a \"zombiedClient\" entry in\n * LocalStorage which acts as an indicator that another tab should go ahead and\n * take the primary lease immediately regardless of the current lease timestamp.\n *\n * TODO(b/114226234): Remove `synchronizeTabs` section when multi-tab is no\n * longer optional.\n */\nclass po {\n constructor(\n /**\n * Whether to synchronize the in-memory state of multiple tabs and share\n * access to local persistence.\n */\n t, e, n, s, i, r, o, u, c, \n /**\n * If set to true, forcefully obtains database access. Existing tabs will\n * no longer be able to access IndexedDB.\n */\n a, h = 15) {\n if (this.allowTabSynchronization = t, this.persistenceKey = e, this.clientId = n, \n this.js = i, this.window = r, this.document = o, this.Ws = c, this.zs = a, this.Hs = h, \n this.Ps = null, this.vs = !1, this.isPrimary = !1, this.networkEnabled = !0, \n /** Our window.unload handler, if registered. */\n this.Js = null, this.inForeground = !1, \n /** Our 'visibilitychange' listener if registered. */\n this.Ys = null, \n /** The client metadata refresh task. */\n this.Xs = null, \n /** The last time we garbage collected the client metadata object store. */\n this.Zs = Number.NEGATIVE_INFINITY, \n /** A listener to notify on primary state changes. */\n this.ti = t => Promise.resolve(), !po.V()) throw new Q(G.UNIMPLEMENTED, \"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.\");\n this.referenceDelegate = new Qr(this, s), this.ei = e + \"main\", this.wt = new Ki(u), \n this.ni = new Dt(this.ei, this.Hs, new mo(this.wt)), this.Vs = new Fr(this.referenceDelegate, this.wt), \n this.remoteDocumentCache = Hr(this.wt), this.Ds = new nr, this.window && this.window.localStorage ? this.si = this.window.localStorage : (this.si = null, \n !1 === a && F(\"IndexedDbPersistence\", \"LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page.\"));\n }\n /**\n * Attempt to start IndexedDb persistence.\n *\n * @returns Whether persistence was enabled.\n */ start() {\n // NOTE: This is expected to fail sometimes (in the case of another tab\n // already having the persistence lock), so it's the first thing we should\n // do.\n return this.ii().then((() => {\n if (!this.isPrimary && !this.allowTabSynchronization) \n // Fail `start()` if `synchronizeTabs` is disabled and we cannot\n // obtain the primary lease.\n throw new Q(G.FAILED_PRECONDITION, yo);\n return this.ri(), this.oi(), this.ui(), this.runTransaction(\"getHighestListenSequenceNumber\", \"readonly\", (t => this.Vs.getHighestSequenceNumber(t)));\n })).then((t => {\n this.Ps = new Lt(t, this.Ws);\n })).then((() => {\n this.vs = !0;\n })).catch((t => (this.ni && this.ni.close(), Promise.reject(t))));\n }\n /**\n * Registers a listener that gets called when the primary state of the\n * instance changes. Upon registering, this listener is invoked immediately\n * with the current primary state.\n *\n * PORTING NOTE: This is only used for Web multi-tab.\n */ ci(t) {\n return this.ti = async e => {\n if (this.started) return t(e);\n }, t(this.isPrimary);\n }\n /**\n * Registers a listener that gets called when the database receives a\n * version change event indicating that it has deleted.\n *\n * PORTING NOTE: This is only used for Web multi-tab.\n */ setDatabaseDeletedListener(t) {\n this.ni.F((async e => {\n // Check if an attempt is made to delete IndexedDB.\n null === e.newVersion && await t();\n }));\n }\n /**\n * Adjusts the current network state in the client's metadata, potentially\n * affecting the primary lease.\n *\n * PORTING NOTE: This is only used for Web multi-tab.\n */ setNetworkEnabled(t) {\n this.networkEnabled !== t && (this.networkEnabled = t, \n // Schedule a primary lease refresh for immediate execution. The eventual\n // lease update will be propagated via `primaryStateListener`.\n this.js.enqueueAndForget((async () => {\n this.started && await this.ii();\n })));\n }\n /**\n * Updates the client metadata in IndexedDb and attempts to either obtain or\n * extend the primary lease for the local client. Asynchronously notifies the\n * primary state listener if the client either newly obtained or released its\n * primary lease.\n */ ii() {\n return this.runTransaction(\"updateClientMetadataAndTryBecomePrimary\", \"readwrite\", (t => To(t).put({\n clientId: this.clientId,\n updateTimeMs: Date.now(),\n networkEnabled: this.networkEnabled,\n inForeground: this.inForeground\n }).next((() => {\n if (this.isPrimary) return this.ai(t).next((t => {\n t || (this.isPrimary = !1, this.js.enqueueRetryable((() => this.ti(!1))));\n }));\n })).next((() => this.hi(t))).next((e => this.isPrimary && !e ? this.li(t).next((() => !1)) : !!e && this.fi(t).next((() => !0)))))).catch((t => {\n if (Nt(t)) \n // Proceed with the existing state. Any subsequent access to\n // IndexedDB will verify the lease.\n return O(\"IndexedDbPersistence\", \"Failed to extend owner lease: \", t), this.isPrimary;\n if (!this.allowTabSynchronization) throw t;\n return O(\"IndexedDbPersistence\", \"Releasing owner lease after error during lease refresh\", t), \n /* isPrimary= */ !1;\n })).then((t => {\n this.isPrimary !== t && this.js.enqueueRetryable((() => this.ti(t))), this.isPrimary = t;\n }));\n }\n ai(t) {\n return Io(t).get(\"owner\").next((t => Vt.resolve(this.di(t))));\n }\n _i(t) {\n return To(t).delete(this.clientId);\n }\n /**\n * If the garbage collection threshold has passed, prunes the\n * RemoteDocumentChanges and the ClientMetadata store based on the last update\n * time of all clients.\n */ async wi() {\n if (this.isPrimary && !this.mi(this.Zs, 18e5)) {\n this.Zs = Date.now();\n const t = await this.runTransaction(\"maybeGarbageCollectMultiClientState\", \"readwrite-primary\", (t => {\n const e = $i(t, \"clientMetadata\");\n return e.K().next((t => {\n const n = this.gi(t, 18e5), s = t.filter((t => -1 === n.indexOf(t)));\n // Delete metadata for clients that are no longer considered active.\n return Vt.forEach(s, (t => e.delete(t.clientId))).next((() => s));\n }));\n })).catch((() => []));\n // Delete potential leftover entries that may continue to mark the\n // inactive clients as zombied in LocalStorage.\n // Ideally we'd delete the IndexedDb and LocalStorage zombie entries for\n // the client atomically, but we can't. So we opt to delete the IndexedDb\n // entries first to avoid potentially reviving a zombied client.\n if (this.si) for (const e of t) this.si.removeItem(this.yi(e.clientId));\n }\n }\n /**\n * Schedules a recurring timer to update the client metadata and to either\n * extend or acquire the primary lease if the client is eligible.\n */ ui() {\n this.Xs = this.js.enqueueAfterDelay(\"client_metadata_refresh\" /* ClientMetadataRefresh */ , 4e3, (() => this.ii().then((() => this.wi())).then((() => this.ui()))));\n }\n /** Checks whether `client` is the local client. */ di(t) {\n return !!t && t.ownerId === this.clientId;\n }\n /**\n * Evaluate the state of all active clients and determine whether the local\n * client is or can act as the holder of the primary lease. Returns whether\n * the client is eligible for the lease, but does not actually acquire it.\n * May return 'false' even if there is no active leaseholder and another\n * (foreground) client should become leaseholder instead.\n */ hi(t) {\n if (this.zs) return Vt.resolve(!0);\n return Io(t).get(\"owner\").next((e => {\n // A client is eligible for the primary lease if:\n // - its network is enabled and the client's tab is in the foreground.\n // - its network is enabled and no other client's tab is in the\n // foreground.\n // - every clients network is disabled and the client's tab is in the\n // foreground.\n // - every clients network is disabled and no other client's tab is in\n // the foreground.\n // - the `forceOwningTab` setting was passed in.\n if (null !== e && this.mi(e.leaseTimestampMs, 5e3) && !this.pi(e.ownerId)) {\n if (this.di(e) && this.networkEnabled) return !0;\n if (!this.di(e)) {\n if (!e.allowTabSynchronization) \n // Fail the `canActAsPrimary` check if the current leaseholder has\n // not opted into multi-tab synchronization. If this happens at\n // client startup, we reject the Promise returned by\n // `enablePersistence()` and the user can continue to use Firestore\n // with in-memory persistence.\n // If this fails during a lease refresh, we will instead block the\n // AsyncQueue from executing further operations. Note that this is\n // acceptable since mixing & matching different `synchronizeTabs`\n // settings is not supported.\n // TODO(b/114226234): Remove this check when `synchronizeTabs` can\n // no longer be turned off.\n throw new Q(G.FAILED_PRECONDITION, yo);\n return !1;\n }\n }\n return !(!this.networkEnabled || !this.inForeground) || To(t).K().next((t => void 0 === this.gi(t, 5e3).find((t => {\n if (this.clientId !== t.clientId) {\n const e = !this.networkEnabled && t.networkEnabled, n = !this.inForeground && t.inForeground, s = this.networkEnabled === t.networkEnabled;\n if (e || n && s) return !0;\n }\n return !1;\n }))));\n })).next((t => (this.isPrimary !== t && O(\"IndexedDbPersistence\", `Client ${t ? \"is\" : \"is not\"} eligible for a primary lease.`), \n t)));\n }\n async shutdown() {\n // The shutdown() operations are idempotent and can be called even when\n // start() aborted (e.g. because it couldn't acquire the persistence lease).\n this.vs = !1, this.Ii(), this.Xs && (this.Xs.cancel(), this.Xs = null), this.Ti(), \n this.Ei(), \n // Use `SimpleDb.runTransaction` directly to avoid failing if another tab\n // has obtained the primary lease.\n await this.ni.runTransaction(\"shutdown\", \"readwrite\", [ \"owner\", \"clientMetadata\" ], (t => {\n const e = new Fi(t, Lt.ot);\n return this.li(e).next((() => this._i(e)));\n })), this.ni.close(), \n // Remove the entry marking the client as zombied from LocalStorage since\n // we successfully deleted its metadata from IndexedDb.\n this.Ai();\n }\n /**\n * Returns clients that are not zombied and have an updateTime within the\n * provided threshold.\n */ gi(t, e) {\n return t.filter((t => this.mi(t.updateTimeMs, e) && !this.pi(t.clientId)));\n }\n /**\n * Returns the IDs of the clients that are currently active. If multi-tab\n * is not supported, returns an array that only contains the local client's\n * ID.\n *\n * PORTING NOTE: This is only used for Web multi-tab.\n */ Ri() {\n return this.runTransaction(\"getActiveClients\", \"readonly\", (t => To(t).K().next((t => this.gi(t, 18e5).map((t => t.clientId))))));\n }\n get started() {\n return this.vs;\n }\n getMutationQueue(t, e) {\n return Cr.se(t, this.wt, e, this.referenceDelegate);\n }\n getTargetCache() {\n return this.Vs;\n }\n getRemoteDocumentCache() {\n return this.remoteDocumentCache;\n }\n getIndexManager(t) {\n return new Tr(t, this.wt.ne.databaseId);\n }\n getDocumentOverlayCache(t) {\n return rr.se(this.wt, t);\n }\n getBundleCache() {\n return this.Ds;\n }\n runTransaction(t, e, n) {\n O(\"IndexedDbPersistence\", \"Starting transaction:\", t);\n const s = \"readonly\" === e ? \"readonly\" : \"readwrite\", i = 15 === (r = this.Hs) ? Oi : 14 === r ? Mi : 13 === r ? ki : 12 === r ? Ni : 11 === r ? xi : void L();\n /** Returns the object stores for the provided schema. */\n var r;\n let o;\n // Do all transactions as readwrite against all object stores, since we\n // are the only reader/writer.\n return this.ni.runTransaction(t, s, i, (s => (o = new Fi(s, this.Ps ? this.Ps.next() : Lt.ot), \n \"readwrite-primary\" === e ? this.ai(o).next((t => !!t || this.hi(o))).next((e => {\n if (!e) throw F(`Failed to obtain primary lease for action '${t}'.`), this.isPrimary = !1, \n this.js.enqueueRetryable((() => this.ti(!1))), new Q(G.FAILED_PRECONDITION, bt);\n return n(o);\n })).next((t => this.fi(o).next((() => t)))) : this.bi(o).next((() => n(o)))))).then((t => (o.raiseOnCommittedEvent(), \n t)));\n }\n /**\n * Verifies that the current tab is the primary leaseholder or alternatively\n * that the leaseholder has opted into multi-tab synchronization.\n */\n // TODO(b/114226234): Remove this check when `synchronizeTabs` can no longer\n // be turned off.\n bi(t) {\n return Io(t).get(\"owner\").next((t => {\n if (null !== t && this.mi(t.leaseTimestampMs, 5e3) && !this.pi(t.ownerId) && !this.di(t) && !(this.zs || this.allowTabSynchronization && t.allowTabSynchronization)) throw new Q(G.FAILED_PRECONDITION, yo);\n }));\n }\n /**\n * Obtains or extends the new primary lease for the local client. This\n * method does not verify that the client is eligible for this lease.\n */ fi(t) {\n const e = {\n ownerId: this.clientId,\n allowTabSynchronization: this.allowTabSynchronization,\n leaseTimestampMs: Date.now()\n };\n return Io(t).put(\"owner\", e);\n }\n static V() {\n return Dt.V();\n }\n /** Checks the primary lease and removes it if we are the current primary. */ li(t) {\n const e = Io(t);\n return e.get(\"owner\").next((t => this.di(t) ? (O(\"IndexedDbPersistence\", \"Releasing primary lease.\"), \n e.delete(\"owner\")) : Vt.resolve()));\n }\n /** Verifies that `updateTimeMs` is within `maxAgeMs`. */ mi(t, e) {\n const n = Date.now();\n return !(t < n - e) && (!(t > n) || (F(`Detected an update time that is in the future: ${t} > ${n}`), \n !1));\n }\n ri() {\n null !== this.document && \"function\" == typeof this.document.addEventListener && (this.Ys = () => {\n this.js.enqueueAndForget((() => (this.inForeground = \"visible\" === this.document.visibilityState, \n this.ii())));\n }, this.document.addEventListener(\"visibilitychange\", this.Ys), this.inForeground = \"visible\" === this.document.visibilityState);\n }\n Ti() {\n this.Ys && (this.document.removeEventListener(\"visibilitychange\", this.Ys), this.Ys = null);\n }\n /**\n * Attaches a window.unload handler that will synchronously write our\n * clientId to a \"zombie client id\" location in LocalStorage. This can be used\n * by tabs trying to acquire the primary lease to determine that the lease\n * is no longer valid even if the timestamp is recent. This is particularly\n * important for the refresh case (so the tab correctly re-acquires the\n * primary lease). LocalStorage is used for this rather than IndexedDb because\n * it is a synchronous API and so can be used reliably from an unload\n * handler.\n */ oi() {\n var t;\n \"function\" == typeof (null === (t = this.window) || void 0 === t ? void 0 : t.addEventListener) && (this.Js = () => {\n // Note: In theory, this should be scheduled on the AsyncQueue since it\n // accesses internal state. We execute this code directly during shutdown\n // to make sure it gets a chance to run.\n this.Ii(), isSafari() && navigator.appVersion.match(/Version\\/1[45]/) && \n // On Safari 14 and 15, we do not run any cleanup actions as it might\n // trigger a bug that prevents Safari from re-opening IndexedDB during\n // the next page load.\n // See https://bugs.webkit.org/show_bug.cgi?id=226547\n this.js.enterRestrictedMode(/* purgeExistingTasks= */ !0), this.js.enqueueAndForget((() => this.shutdown()));\n }, this.window.addEventListener(\"pagehide\", this.Js));\n }\n Ei() {\n this.Js && (this.window.removeEventListener(\"pagehide\", this.Js), this.Js = null);\n }\n /**\n * Returns whether a client is \"zombied\" based on its LocalStorage entry.\n * Clients become zombied when their tab closes without running all of the\n * cleanup logic in `shutdown()`.\n */ pi(t) {\n var e;\n try {\n const n = null !== (null === (e = this.si) || void 0 === e ? void 0 : e.getItem(this.yi(t)));\n return O(\"IndexedDbPersistence\", `Client '${t}' ${n ? \"is\" : \"is not\"} zombied in LocalStorage`), \n n;\n } catch (t) {\n // Gracefully handle if LocalStorage isn't working.\n return F(\"IndexedDbPersistence\", \"Failed to get zombied client id.\", t), !1;\n }\n }\n /**\n * Record client as zombied (a client that had its tab closed). Zombied\n * clients are ignored during primary tab selection.\n */ Ii() {\n if (this.si) try {\n this.si.setItem(this.yi(this.clientId), String(Date.now()));\n } catch (t) {\n // Gracefully handle if LocalStorage isn't available / working.\n F(\"Failed to set zombie client id.\", t);\n }\n }\n /** Removes the zombied client entry if it exists. */ Ai() {\n if (this.si) try {\n this.si.removeItem(this.yi(this.clientId));\n } catch (t) {\n // Ignore\n }\n }\n yi(t) {\n return `firestore_zombie_${this.persistenceKey}_${t}`;\n }\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the primary client object store.\n */ function Io(t) {\n return $i(t, \"owner\");\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the client metadata object store.\n */ function To(t) {\n return $i(t, \"clientMetadata\");\n}\n\n/**\n * Generates a string used as a prefix when storing data in IndexedDB and\n * LocalStorage.\n */ function Eo(t, e) {\n // Use two different prefix formats:\n // * firestore / persistenceKey / projectID . databaseID / ...\n // * firestore / persistenceKey / projectID / ...\n // projectIDs are DNS-compatible names and cannot contain dots\n // so there's no danger of collisions.\n let n = t.projectId;\n return t.isDefaultDatabase || (n += \".\" + t.database), \"firestore/\" + e + \"/\" + n + \"/\";\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A set of changes to what documents are currently in view and out of view for\n * a given query. These changes are sent to the LocalStore by the View (via\n * the SyncEngine) and are used to pin / unpin documents as appropriate.\n */\nclass Ao {\n constructor(t, e, n, s) {\n this.targetId = t, this.fromCache = e, this.Pi = n, this.vi = s;\n }\n static Vi(t, e) {\n let n = gs(), s = gs();\n for (const t of e.docChanges) switch (t.type) {\n case 0 /* Added */ :\n n = n.add(t.doc.key);\n break;\n\n case 1 /* Removed */ :\n s = s.add(t.doc.key);\n // do nothing\n }\n return new Ao(t, e.fromCache, n, s);\n }\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * The Firestore query engine.\n *\n * Firestore queries can be executed in three modes. The Query Engine determines\n * what mode to use based on what data is persisted. The mode only determines\n * the runtime complexity of the query - the result set is equivalent across all\n * implementations.\n *\n * The Query engine will use indexed-based execution if a user has configured\n * any index that can be used to execute query (via `setIndexConfiguration()`).\n * Otherwise, the engine will try to optimize the query by re-using a previously\n * persisted query result. If that is not possible, the query will be executed\n * via a full collection scan.\n *\n * Index-based execution is the default when available. The query engine\n * supports partial indexed execution and merges the result from the index\n * lookup with documents that have not yet been indexed. The index evaluation\n * matches the backend's format and as such, the SDK can use indexing for all\n * queries that the backend supports.\n *\n * If no index exists, the query engine tries to take advantage of the target\n * document mapping in the TargetCache. These mappings exists for all queries\n * that have been synced with the backend at least once and allow the query\n * engine to only read documents that previously matched a query plus any\n * documents that were edited after the query was last listened to.\n *\n * There are some cases when this optimization is not guaranteed to produce\n * the same results as full collection scans. In these cases, query\n * processing falls back to full scans. These cases are:\n *\n * - Limit queries where a document that matched the query previously no longer\n * matches the query.\n *\n * - Limit queries where a document edit may cause the document to sort below\n * another document that is in the local cache.\n *\n * - Queries that have never been CURRENT or free of limbo documents.\n */ class Ro {\n constructor() {\n this.Si = !1;\n }\n /** Sets the document view to query against. */ initialize(t, e) {\n this.Di = t, this.indexManager = e, this.Si = !0;\n }\n /** Returns all local documents matching the specified query. */ getDocumentsMatchingQuery(t, e, n, s) {\n return this.Ci(t, e).next((i => i || this.xi(t, e, s, n))).next((n => n || this.Ni(t, e)));\n }\n /**\n * Performs an indexed query that evaluates the query based on a collection's\n * persisted index values. Returns `null` if an index is not available.\n */ Ci(t, e) {\n if (cn(e)) \n // Queries that match all documents don't benefit from using\n // key-based lookups. It is more efficient to scan all documents in a\n // collection, rather than to perform individual lookups.\n return Vt.resolve(null);\n let n = dn(e);\n return this.indexManager.getIndexType(t, n).next((s => 0 /* NONE */ === s ? null : (null !== e.limit && 1 /* PARTIAL */ === s && (\n // We cannot apply a limit for targets that are served using a partial\n // index. If a partial index will be used to serve the target, the\n // query may return a superset of documents that match the target\n // (e.g. if the index doesn't include all the target's filters), or\n // may return the correct set of documents in the wrong order (e.g. if\n // the index doesn't include a segment for one of the orderBys).\n // Therefore, a limit should not be applied in such cases.\n e = _n(e, null, \"F\" /* First */), n = dn(e)), this.indexManager.getDocumentsMatchingTarget(t, n).next((s => {\n const i = gs(...s);\n return this.Di.getDocuments(t, i).next((s => this.indexManager.getMinOffset(t, n).next((n => {\n const r = this.ki(e, s);\n return this.Mi(e, r, i, n.readTime) ? this.Ci(t, _n(e, null, \"F\" /* First */)) : this.Oi(t, r, e, n);\n }))));\n })))));\n }\n /**\n * Performs a query based on the target's persisted query mapping. Returns\n * `null` if the mapping is not available or cannot be used.\n */ xi(t, e, n, s) {\n return cn(e) || s.isEqual(ct.min()) ? this.Ni(t, e) : this.Di.getDocuments(t, n).next((i => {\n const r = this.ki(e, i);\n return this.Mi(e, r, n, s) ? this.Ni(t, e) : (k() <= LogLevel.DEBUG && O(\"QueryEngine\", \"Re-using previous result from %s to execute query: %s\", s.toString(), gn(e)), \n this.Oi(t, r, e, Tt(s, -1)));\n }));\n // Queries that have never seen a snapshot without limbo free documents\n // should also be run as a full collection scan.\n }\n /** Applies the query filter and sorting to the provided documents. */ ki(t, e) {\n // Sort the documents and re-apply the query filter since previously\n // matching documents do not necessarily still match the query.\n let n = new Wt(In(t));\n return e.forEach(((e, s) => {\n yn(t, s) && (n = n.add(s));\n })), n;\n }\n /**\n * Determines if a limit query needs to be refilled from cache, making it\n * ineligible for index-free execution.\n *\n * @param query - The query.\n * @param sortedPreviousResults - The documents that matched the query when it\n * was last synchronized, sorted by the query's comparator.\n * @param remoteKeys - The document keys that matched the query at the last\n * snapshot.\n * @param limboFreeSnapshotVersion - The version of the snapshot when the\n * query was last synchronized.\n */ Mi(t, e, n, s) {\n if (null === t.limit) \n // Queries without limits do not need to be refilled.\n return !1;\n if (n.size !== e.size) \n // The query needs to be refilled if a previously matching document no\n // longer matches.\n return !0;\n // Limit queries are not eligible for index-free query execution if there is\n // a potential that an older document from cache now sorts before a document\n // that was previously part of the limit. This, however, can only happen if\n // the document at the edge of the limit goes out of limit.\n // If a document that is not the limit boundary sorts differently,\n // the boundary of the limit itself did not change and documents from cache\n // will continue to be \"rejected\" by this boundary. Therefore, we can ignore\n // any modifications that don't affect the last document.\n const i = \"F\" /* First */ === t.limitType ? e.last() : e.first();\n return !!i && (i.hasPendingWrites || i.version.compareTo(s) > 0);\n }\n Ni(t, e) {\n return k() <= LogLevel.DEBUG && O(\"QueryEngine\", \"Using full collection scan to execute query:\", gn(e)), \n this.Di.getDocumentsMatchingQuery(t, e, At.min());\n }\n /**\n * Combines the results from an indexed execution with the remaining documents\n * that have not yet been indexed.\n */ Oi(t, e, n, s) {\n // Retrieve all results for documents that were updated since the offset.\n return this.Di.getDocumentsMatchingQuery(t, n, s).next((t => (\n // Merge with existing results\n e.forEach((e => {\n t = t.insert(e.key, e);\n })), t)));\n }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Implements `LocalStore` interface.\n *\n * Note: some field defined in this class might have public access level, but\n * the class is not exported so they are only accessible from this module.\n * This is useful to implement optional features (like bundles) in free\n * functions, such that they are tree-shakeable.\n */\nclass bo {\n constructor(\n /** Manages our in-memory or durable persistence. */\n t, e, n, s) {\n this.persistence = t, this.Fi = e, this.wt = s, \n /**\n * Maps a targetID to data about its target.\n *\n * PORTING NOTE: We are using an immutable data structure on Web to make re-runs\n * of `applyRemoteEvent()` idempotent.\n */\n this.$i = new Gt(it), \n /** Maps a target to its targetID. */\n // TODO(wuandy): Evaluate if TargetId can be part of Target.\n this.Bi = new os((t => Fe(t)), Be), \n /**\n * A per collection group index of the last read time processed by\n * `getNewDocumentChanges()`.\n *\n * PORTING NOTE: This is only used for multi-tab synchronization.\n */\n this.Li = new Map, this.Ui = t.getRemoteDocumentCache(), this.Vs = t.getTargetCache(), \n this.Ds = t.getBundleCache(), this.qi(n);\n }\n qi(t) {\n // TODO(indexing): Add spec tests that test these components change after a\n // user change\n this.documentOverlayCache = this.persistence.getDocumentOverlayCache(t), this.indexManager = this.persistence.getIndexManager(t), \n this.mutationQueue = this.persistence.getMutationQueue(t, this.indexManager), this.localDocuments = new so(this.Ui, this.mutationQueue, this.documentOverlayCache, this.indexManager), \n this.Ui.setIndexManager(this.indexManager), this.Fi.initialize(this.localDocuments, this.indexManager);\n }\n collectGarbage(t) {\n return this.persistence.runTransaction(\"Collect garbage\", \"readwrite-primary\", (e => t.collect(e, this.$i)));\n }\n}\n\nfunction Po(\n/** Manages our in-memory or durable persistence. */\nt, e, n, s) {\n return new bo(t, e, n, s);\n}\n\n/**\n * Tells the LocalStore that the currently authenticated user has changed.\n *\n * In response the local store switches the mutation queue to the new user and\n * returns any resulting document changes.\n */\n// PORTING NOTE: Android and iOS only return the documents affected by the\n// change.\nasync function vo(t, e) {\n const n = K(t);\n return await n.persistence.runTransaction(\"Handle user change\", \"readonly\", (t => {\n // Swap out the mutation queue, grabbing the pending mutation batches\n // before and after.\n let s;\n return n.mutationQueue.getAllMutationBatches(t).next((i => (s = i, n.qi(e), n.mutationQueue.getAllMutationBatches(t)))).next((e => {\n const i = [], r = [];\n // Union the old/new changed keys.\n let o = gs();\n for (const t of s) {\n i.push(t.batchId);\n for (const e of t.mutations) o = o.add(e.key);\n }\n for (const t of e) {\n r.push(t.batchId);\n for (const e of t.mutations) o = o.add(e.key);\n }\n // Return the set of all (potentially) changed documents and the list\n // of mutation batch IDs that were affected by change.\n return n.localDocuments.getDocuments(t, o).next((t => ({\n Ki: t,\n removedBatchIds: i,\n addedBatchIds: r\n })));\n }));\n }));\n}\n\n/* Accepts locally generated Mutations and commit them to storage. */\n/**\n * Acknowledges the given batch.\n *\n * On the happy path when a batch is acknowledged, the local store will\n *\n * + remove the batch from the mutation queue;\n * + apply the changes to the remote document cache;\n * + recalculate the latency compensated view implied by those changes (there\n * may be mutations in the queue that affect the documents but haven't been\n * acknowledged yet); and\n * + give the changed documents back the sync engine\n *\n * @returns The resulting (modified) documents.\n */\nfunction Vo(t, e) {\n const n = K(t);\n return n.persistence.runTransaction(\"Acknowledge batch\", \"readwrite-primary\", (t => {\n const s = e.batch.keys(), i = n.Ui.newChangeBuffer({\n trackRemovals: !0\n });\n return function(t, e, n, s) {\n const i = n.batch, r = i.keys();\n let o = Vt.resolve();\n return r.forEach((t => {\n o = o.next((() => s.getEntry(e, t))).next((e => {\n const r = n.docVersions.get(t);\n U(null !== r), e.version.compareTo(r) < 0 && (i.applyToRemoteDocument(e, n), e.isValidDocument() && (\n // We use the commitVersion as the readTime rather than the\n // document's updateTime since the updateTime is not advanced\n // for updates that do not modify the underlying document.\n e.setReadTime(n.commitVersion), s.addEntry(e)));\n }));\n })), o.next((() => t.mutationQueue.removeMutationBatch(e, i)));\n }\n /** Returns the local view of the documents affected by a mutation batch. */\n // PORTING NOTE: Multi-Tab only.\n (n, t, e, i).next((() => i.apply(t))).next((() => n.mutationQueue.performConsistencyCheck(t))).next((() => n.documentOverlayCache.removeOverlaysForBatchId(t, s, e.batch.batchId))).next((() => n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(t, function(t) {\n let e = gs();\n for (let n = 0; n < t.mutationResults.length; ++n) {\n t.mutationResults[n].transformResults.length > 0 && (e = e.add(t.batch.mutations[n].key));\n }\n return e;\n }\n /**\n * Removes mutations from the MutationQueue for the specified batch;\n * LocalDocuments will be recalculated.\n *\n * @returns The resulting modified documents.\n */ (e)))).next((() => n.localDocuments.getDocuments(t, s)));\n }));\n}\n\n/**\n * Returns the last consistent snapshot processed (used by the RemoteStore to\n * determine whether to buffer incoming snapshots from the backend).\n */\nfunction So(t) {\n const e = K(t);\n return e.persistence.runTransaction(\"Get last remote snapshot version\", \"readonly\", (t => e.Vs.getLastRemoteSnapshotVersion(t)));\n}\n\n/**\n * Updates the \"ground-state\" (remote) documents. We assume that the remote\n * event reflects any write batches that have been acknowledged or rejected\n * (i.e. we do not re-apply local mutations to updates from this event).\n *\n * LocalDocuments are re-calculated if there are remaining mutations in the\n * queue.\n */ function Do(t, e) {\n const n = K(t), s = e.snapshotVersion;\n let i = n.$i;\n return n.persistence.runTransaction(\"Apply remote event\", \"readwrite-primary\", (t => {\n const r = n.Ui.newChangeBuffer({\n trackRemovals: !0\n });\n // Reset newTargetDataByTargetMap in case this transaction gets re-run.\n i = n.$i;\n const o = [];\n e.targetChanges.forEach(((r, u) => {\n const c = i.get(u);\n if (!c) return;\n // Only update the remote keys if the target is still active. This\n // ensures that we can persist the updated target data along with\n // the updated assignment.\n o.push(n.Vs.removeMatchingKeys(t, r.removedDocuments, u).next((() => n.Vs.addMatchingKeys(t, r.addedDocuments, u))));\n let a = c.withSequenceNumber(t.currentSequenceNumber);\n e.targetMismatches.has(u) ? a = a.withResumeToken(Xt.EMPTY_BYTE_STRING, ct.min()).withLastLimboFreeSnapshotVersion(ct.min()) : r.resumeToken.approximateByteSize() > 0 && (a = a.withResumeToken(r.resumeToken, s)), \n i = i.insert(u, a), \n // Update the target data if there are target changes (or if\n // sufficient time has passed since the last update).\n /**\n * Returns true if the newTargetData should be persisted during an update of\n * an active target. TargetData should always be persisted when a target is\n * being released and should not call this function.\n *\n * While the target is active, TargetData updates can be omitted when nothing\n * about the target has changed except metadata like the resume token or\n * snapshot version. Occasionally it's worth the extra write to prevent these\n * values from getting too stale after a crash, but this doesn't have to be\n * too frequent.\n */\n function(t, e, n) {\n // Always persist target data if we don't already have a resume token.\n if (0 === t.resumeToken.approximateByteSize()) return !0;\n // Don't allow resume token changes to be buffered indefinitely. This\n // allows us to be reasonably up-to-date after a crash and avoids needing\n // to loop over all active queries on shutdown. Especially in the browser\n // we may not get time to do anything interesting while the current tab is\n // closing.\n if (e.snapshotVersion.toMicroseconds() - t.snapshotVersion.toMicroseconds() >= 3e8) return !0;\n // Otherwise if the only thing that has changed about a target is its resume\n // token it's not worth persisting. Note that the RemoteStore keeps an\n // in-memory view of the currently active targets which includes the current\n // resume token, so stream failure or user changes will still use an\n // up-to-date resume token regardless of what we do here.\n return n.addedDocuments.size + n.modifiedDocuments.size + n.removedDocuments.size > 0;\n }\n /**\n * Notifies local store of the changed views to locally pin documents.\n */ (c, a, r) && o.push(n.Vs.updateTargetData(t, a));\n }));\n let u = cs(), c = gs();\n // HACK: The only reason we allow a null snapshot version is so that we\n // can synthesize remote events when we get permission denied errors while\n // trying to resolve the state of a locally cached document that is in\n // limbo.\n if (e.documentUpdates.forEach((s => {\n e.resolvedLimboDocuments.has(s) && o.push(n.persistence.referenceDelegate.updateLimboDocument(t, s));\n })), \n // Each loop iteration only affects its \"own\" doc, so it's safe to get all\n // the remote documents in advance in a single call.\n o.push(Co(t, r, e.documentUpdates).next((t => {\n u = t.Gi, c = t.Qi;\n }))), !s.isEqual(ct.min())) {\n const e = n.Vs.getLastRemoteSnapshotVersion(t).next((e => n.Vs.setTargetsMetadata(t, t.currentSequenceNumber, s)));\n o.push(e);\n }\n return Vt.waitFor(o).next((() => r.apply(t))).next((() => n.localDocuments.getLocalViewOfDocuments(t, u, c))).next((() => u));\n })).then((t => (n.$i = i, t)));\n}\n\n/**\n * Populates document change buffer with documents from backend or a bundle.\n * Returns the document changes resulting from applying those documents, and\n * also a set of documents whose existence state are changed as a result.\n *\n * @param txn - Transaction to use to read existing documents from storage.\n * @param documentBuffer - Document buffer to collect the resulted changes to be\n * applied to storage.\n * @param documents - Documents to be applied.\n */ function Co(t, e, n) {\n let s = gs(), i = gs();\n return n.forEach((t => s = s.add(t))), e.getEntries(t, s).next((t => {\n let s = cs();\n return n.forEach(((n, r) => {\n const o = t.get(n);\n // Check if see if there is a existence state change for this document.\n r.isFoundDocument() !== o.isFoundDocument() && (i = i.add(n)), \n // Note: The order of the steps below is important, since we want\n // to ensure that rejected limbo resolutions (which fabricate\n // NoDocuments with SnapshotVersion.min()) never add documents to\n // cache.\n r.isNoDocument() && r.version.isEqual(ct.min()) ? (\n // NoDocuments with SnapshotVersion.min() are used in manufactured\n // events. We remove these documents from cache since we lost\n // access.\n e.removeEntry(n, r.readTime), s = s.insert(n, r)) : !o.isValidDocument() || r.version.compareTo(o.version) > 0 || 0 === r.version.compareTo(o.version) && o.hasPendingWrites ? (e.addEntry(r), \n s = s.insert(n, r)) : O(\"LocalStore\", \"Ignoring outdated watch update for \", n, \". Current version:\", o.version, \" Watch version:\", r.version);\n })), {\n Gi: s,\n Qi: i\n };\n }));\n}\n\n/**\n * Gets the mutation batch after the passed in batchId in the mutation queue\n * or null if empty.\n * @param afterBatchId - If provided, the batch to search after.\n * @returns The next mutation or null if there wasn't one.\n */\nfunction xo(t, e) {\n const n = K(t);\n return n.persistence.runTransaction(\"Get next mutation batch\", \"readonly\", (t => (void 0 === e && (e = -1), \n n.mutationQueue.getNextMutationBatchAfterBatchId(t, e))));\n}\n\n/**\n * Reads the current value of a Document with a given key or null if not\n * found - used for testing.\n */\n/**\n * Assigns the given target an internal ID so that its results can be pinned so\n * they don't get GC'd. A target must be allocated in the local store before\n * the store can be used to manage its view.\n *\n * Allocating an already allocated `Target` will return the existing `TargetData`\n * for that `Target`.\n */\nfunction No(t, e) {\n const n = K(t);\n return n.persistence.runTransaction(\"Allocate target\", \"readwrite\", (t => {\n let s;\n return n.Vs.getTargetData(t, e).next((i => i ? (\n // This target has been listened to previously, so reuse the\n // previous targetID.\n // TODO(mcg): freshen last accessed date?\n s = i, Vt.resolve(s)) : n.Vs.allocateTargetId(t).next((i => (s = new qi(e, i, 0 /* Listen */ , t.currentSequenceNumber), \n n.Vs.addTargetData(t, s).next((() => s)))))));\n })).then((t => {\n // If Multi-Tab is enabled, the existing target data may be newer than\n // the in-memory data\n const s = n.$i.get(t.targetId);\n return (null === s || t.snapshotVersion.compareTo(s.snapshotVersion) > 0) && (n.$i = n.$i.insert(t.targetId, t), \n n.Bi.set(e, t.targetId)), t;\n }));\n}\n\n/**\n * Returns the TargetData as seen by the LocalStore, including updates that may\n * have not yet been persisted to the TargetCache.\n */\n// Visible for testing.\n/**\n * Unpins all the documents associated with the given target. If\n * `keepPersistedTargetData` is set to false and Eager GC enabled, the method\n * directly removes the associated target data from the target cache.\n *\n * Releasing a non-existing `Target` is a no-op.\n */\n// PORTING NOTE: `keepPersistedTargetData` is multi-tab only.\nasync function ko(t, e, n) {\n const s = K(t), i = s.$i.get(e), r = n ? \"readwrite\" : \"readwrite-primary\";\n try {\n n || await s.persistence.runTransaction(\"Release target\", r, (t => s.persistence.referenceDelegate.removeTarget(t, i)));\n } catch (t) {\n if (!Nt(t)) throw t;\n // All `releaseTarget` does is record the final metadata state for the\n // target, but we've been recording this periodically during target\n // activity. If we lose this write this could cause a very slight\n // difference in the order of target deletion during GC, but we\n // don't define exact LRU semantics so this is acceptable.\n O(\"LocalStore\", `Failed to update sequence numbers for target ${e}: ${t}`);\n }\n s.$i = s.$i.remove(e), s.Bi.delete(i.target);\n}\n\n/**\n * Runs the specified query against the local store and returns the results,\n * potentially taking advantage of query data from previous executions (such\n * as the set of remote keys).\n *\n * @param usePreviousResults - Whether results from previous executions can\n * be used to optimize this query execution.\n */ function Mo(t, e, n) {\n const s = K(t);\n let i = ct.min(), r = gs();\n return s.persistence.runTransaction(\"Execute query\", \"readonly\", (t => function(t, e, n) {\n const s = K(t), i = s.Bi.get(n);\n return void 0 !== i ? Vt.resolve(s.$i.get(i)) : s.Vs.getTargetData(e, n);\n }(s, t, dn(e)).next((e => {\n if (e) return i = e.lastLimboFreeSnapshotVersion, s.Vs.getMatchingKeysForTargetId(t, e.targetId).next((t => {\n r = t;\n }));\n })).next((() => s.Fi.getDocumentsMatchingQuery(t, e, n ? i : ct.min(), n ? r : gs()))).next((t => ($o(s, pn(e), t), \n {\n documents: t,\n ji: r\n })))));\n}\n\n// PORTING NOTE: Multi-Tab only.\nfunction Oo(t, e) {\n const n = K(t), s = K(n.Vs), i = n.$i.get(e);\n return i ? Promise.resolve(i.target) : n.persistence.runTransaction(\"Get target data\", \"readonly\", (t => s.te(t, e).next((t => t ? t.target : null))));\n}\n\n/**\n * Returns the set of documents that have been updated since the last call.\n * If this is the first call, returns the set of changes since client\n * initialization. Further invocations will return document that have changed\n * since the prior call.\n */\n// PORTING NOTE: Multi-Tab only.\nfunction Fo(t, e) {\n const n = K(t), s = n.Li.get(e) || ct.min();\n // Get the current maximum read time for the collection. This should always\n // exist, but to reduce the chance for regressions we default to\n // SnapshotVersion.Min()\n // TODO(indexing): Consider removing the default value.\n return n.persistence.runTransaction(\"Get new document changes\", \"readonly\", (t => n.Ui.getAllFromCollectionGroup(t, e, Tt(s, -1), \n /* limit= */ Number.MAX_SAFE_INTEGER))).then((t => ($o(n, e, t), t)));\n}\n\n/** Sets the collection group's maximum read time from the given documents. */\n// PORTING NOTE: Multi-Tab only.\nfunction $o(t, e, n) {\n let s = ct.min();\n n.forEach(((t, e) => {\n e.readTime.compareTo(s) > 0 && (s = e.readTime);\n })), t.Li.set(e, s);\n}\n\n/**\n * Creates a new target using the given bundle name, which will be used to\n * hold the keys of all documents from the bundle in query-document mappings.\n * This ensures that the loaded documents do not get garbage collected\n * right away.\n */\n/**\n * Applies the documents from a bundle to the \"ground-state\" (remote)\n * documents.\n *\n * LocalDocuments are re-calculated if there are remaining mutations in the\n * queue.\n */\nasync function Bo(t, e, n, s) {\n const i = K(t);\n let r = gs(), o = cs();\n for (const t of n) {\n const n = e.Wi(t.metadata.name);\n t.document && (r = r.add(n));\n const s = e.zi(t);\n s.setReadTime(e.Hi(t.metadata.readTime)), o = o.insert(n, s);\n }\n const u = i.Ui.newChangeBuffer({\n trackRemovals: !0\n }), c = await No(i, function(t) {\n // It is OK that the path used for the query is not valid, because this will\n // not be read and queried.\n return dn(un(ht.fromString(`__bundle__/docs/${t}`)));\n }(s));\n // Allocates a target to hold all document keys from the bundle, such that\n // they will not get garbage collected right away.\n return i.persistence.runTransaction(\"Apply bundle documents\", \"readwrite\", (t => Co(t, u, o).next((e => (u.apply(t), \n e))).next((e => i.Vs.removeMatchingKeysForTargetId(t, c.targetId).next((() => i.Vs.addMatchingKeys(t, r, c.targetId))).next((() => i.localDocuments.getLocalViewOfDocuments(t, e.Gi, e.Qi))).next((() => e.Gi))))));\n}\n\n/**\n * Returns a promise of a boolean to indicate if the given bundle has already\n * been loaded and the create time is newer than the current loading bundle.\n */\n/**\n * Saves the given `NamedQuery` to local persistence.\n */\nasync function Lo(t, e, n = gs()) {\n // Allocate a target for the named query such that it can be resumed\n // from associated read time if users use it to listen.\n // NOTE: this also means if no corresponding target exists, the new target\n // will remain active and will not get collected, unless users happen to\n // unlisten the query somehow.\n const s = await No(t, dn(Xi(e.bundledQuery))), i = K(t);\n return i.persistence.runTransaction(\"Save named query\", \"readwrite\", (t => {\n const r = Ms(e.readTime);\n // Simply save the query itself if it is older than what the SDK already\n // has.\n if (s.snapshotVersion.compareTo(r) >= 0) return i.Ds.saveNamedQuery(t, e);\n // Update existing target data because the query from the bundle is newer.\n const o = s.withResumeToken(Xt.EMPTY_BYTE_STRING, r);\n return i.$i = i.$i.insert(o.targetId, o), i.Vs.updateTargetData(t, o).next((() => i.Vs.removeMatchingKeysForTargetId(t, s.targetId))).next((() => i.Vs.addMatchingKeys(t, n, s.targetId))).next((() => i.Ds.saveNamedQuery(t, e)));\n }));\n}\n\n/** Assembles the key for a client state in WebStorage */\nfunction Uo(t, e) {\n return `firestore_clients_${t}_${e}`;\n}\n\n// The format of the WebStorage key that stores the mutation state is:\n// firestore_mutations_<persistence_prefix>_<batch_id>\n// (for unauthenticated users)\n// or: firestore_mutations_<persistence_prefix>_<batch_id>_<user_uid>\n\n// 'user_uid' is last to avoid needing to escape '_' characters that it might\n// contain.\n/** Assembles the key for a mutation batch in WebStorage */\nfunction qo(t, e, n) {\n let s = `firestore_mutations_${t}_${n}`;\n return e.isAuthenticated() && (s += `_${e.uid}`), s;\n}\n\n// The format of the WebStorage key that stores a query target's metadata is:\n// firestore_targets_<persistence_prefix>_<target_id>\n/** Assembles the key for a query state in WebStorage */\nfunction Ko(t, e) {\n return `firestore_targets_${t}_${e}`;\n}\n\n// The WebStorage prefix that stores the primary tab's online state. The\n// format of the key is:\n// firestore_online_state_<persistence_prefix>\n/**\n * Holds the state of a mutation batch, including its user ID, batch ID and\n * whether the batch is 'pending', 'acknowledged' or 'rejected'.\n */\n// Visible for testing\nclass Go {\n constructor(t, e, n, s) {\n this.user = t, this.batchId = e, this.state = n, this.error = s;\n }\n /**\n * Parses a MutationMetadata from its JSON representation in WebStorage.\n * Logs a warning and returns null if the format of the data is not valid.\n */ static Ji(t, e, n) {\n const s = JSON.parse(n);\n let i, r = \"object\" == typeof s && -1 !== [ \"pending\", \"acknowledged\", \"rejected\" ].indexOf(s.state) && (void 0 === s.error || \"object\" == typeof s.error);\n return r && s.error && (r = \"string\" == typeof s.error.message && \"string\" == typeof s.error.code, \n r && (i = new Q(s.error.code, s.error.message))), r ? new Go(t, e, s.state, i) : (F(\"SharedClientState\", `Failed to parse mutation state for ID '${e}': ${n}`), \n null);\n }\n Yi() {\n const t = {\n state: this.state,\n updateTimeMs: Date.now()\n };\n return this.error && (t.error = {\n code: this.error.code,\n message: this.error.message\n }), JSON.stringify(t);\n }\n}\n\n/**\n * Holds the state of a query target, including its target ID and whether the\n * target is 'not-current', 'current' or 'rejected'.\n */\n// Visible for testing\nclass Qo {\n constructor(t, e, n) {\n this.targetId = t, this.state = e, this.error = n;\n }\n /**\n * Parses a QueryTargetMetadata from its JSON representation in WebStorage.\n * Logs a warning and returns null if the format of the data is not valid.\n */ static Ji(t, e) {\n const n = JSON.parse(e);\n let s, i = \"object\" == typeof n && -1 !== [ \"not-current\", \"current\", \"rejected\" ].indexOf(n.state) && (void 0 === n.error || \"object\" == typeof n.error);\n return i && n.error && (i = \"string\" == typeof n.error.message && \"string\" == typeof n.error.code, \n i && (s = new Q(n.error.code, n.error.message))), i ? new Qo(t, n.state, s) : (F(\"SharedClientState\", `Failed to parse target state for ID '${t}': ${e}`), \n null);\n }\n Yi() {\n const t = {\n state: this.state,\n updateTimeMs: Date.now()\n };\n return this.error && (t.error = {\n code: this.error.code,\n message: this.error.message\n }), JSON.stringify(t);\n }\n}\n\n/**\n * This class represents the immutable ClientState for a client read from\n * WebStorage, containing the list of active query targets.\n */ class jo {\n constructor(t, e) {\n this.clientId = t, this.activeTargetIds = e;\n }\n /**\n * Parses a RemoteClientState from the JSON representation in WebStorage.\n * Logs a warning and returns null if the format of the data is not valid.\n */ static Ji(t, e) {\n const n = JSON.parse(e);\n let s = \"object\" == typeof n && n.activeTargetIds instanceof Array, i = ps();\n for (let t = 0; s && t < n.activeTargetIds.length; ++t) s = he(n.activeTargetIds[t]), \n i = i.add(n.activeTargetIds[t]);\n return s ? new jo(t, i) : (F(\"SharedClientState\", `Failed to parse client data for instance '${t}': ${e}`), \n null);\n }\n}\n\n/**\n * This class represents the online state for all clients participating in\n * multi-tab. The online state is only written to by the primary client, and\n * used in secondary clients to update their query views.\n */ class Wo {\n constructor(t, e) {\n this.clientId = t, this.onlineState = e;\n }\n /**\n * Parses a SharedOnlineState from its JSON representation in WebStorage.\n * Logs a warning and returns null if the format of the data is not valid.\n */ static Ji(t) {\n const e = JSON.parse(t);\n return \"object\" == typeof e && -1 !== [ \"Unknown\", \"Online\", \"Offline\" ].indexOf(e.onlineState) && \"string\" == typeof e.clientId ? new Wo(e.clientId, e.onlineState) : (F(\"SharedClientState\", `Failed to parse online state: ${t}`), \n null);\n }\n}\n\n/**\n * Metadata state of the local client. Unlike `RemoteClientState`, this class is\n * mutable and keeps track of all pending mutations, which allows us to\n * update the range of pending mutation batch IDs as new mutations are added or\n * removed.\n *\n * The data in `LocalClientState` is not read from WebStorage and instead\n * updated via its instance methods. The updated state can be serialized via\n * `toWebStorageJSON()`.\n */\n// Visible for testing.\nclass zo {\n constructor() {\n this.activeTargetIds = ps();\n }\n Xi(t) {\n this.activeTargetIds = this.activeTargetIds.add(t);\n }\n Zi(t) {\n this.activeTargetIds = this.activeTargetIds.delete(t);\n }\n /**\n * Converts this entry into a JSON-encoded format we can use for WebStorage.\n * Does not encode `clientId` as it is part of the key in WebStorage.\n */ Yi() {\n const t = {\n activeTargetIds: this.activeTargetIds.toArray(),\n updateTimeMs: Date.now()\n };\n return JSON.stringify(t);\n }\n}\n\n/**\n * `WebStorageSharedClientState` uses WebStorage (window.localStorage) as the\n * backing store for the SharedClientState. It keeps track of all active\n * clients and supports modifications of the local client's data.\n */ class Ho {\n constructor(t, e, n, s, i) {\n this.window = t, this.js = e, this.persistenceKey = n, this.tr = s, this.syncEngine = null, \n this.onlineStateHandler = null, this.sequenceNumberHandler = null, this.er = this.nr.bind(this), \n this.sr = new Gt(it), this.started = !1, \n /**\n * Captures WebStorage events that occur before `start()` is called. These\n * events are replayed once `WebStorageSharedClientState` is started.\n */\n this.ir = [];\n // Escape the special characters mentioned here:\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions\n const r = n.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n this.storage = this.window.localStorage, this.currentUser = i, this.rr = Uo(this.persistenceKey, this.tr), \n this.ur = \n /** Assembles the key for the current sequence number. */\n function(t) {\n return `firestore_sequence_number_${t}`;\n }\n /**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ (this.persistenceKey), this.sr = this.sr.insert(this.tr, new zo), this.cr = new RegExp(`^firestore_clients_${r}_([^_]*)$`), \n this.ar = new RegExp(`^firestore_mutations_${r}_(\\\\d+)(?:_(.*))?$`), this.hr = new RegExp(`^firestore_targets_${r}_(\\\\d+)$`), \n this.lr = \n /** Assembles the key for the online state of the primary tab. */\n function(t) {\n return `firestore_online_state_${t}`;\n }\n // The WebStorage prefix that plays as a event to indicate the remote documents\n // might have changed due to some secondary tabs loading a bundle.\n // format of the key is:\n // firestore_bundle_loaded_v2_<persistenceKey>\n // The version ending with \"v2\" stores the list of modified collection groups.\n (this.persistenceKey), this.dr = function(t) {\n return `firestore_bundle_loaded_v2_${t}`;\n }\n // The WebStorage key prefix for the key that stores the last sequence number allocated. The key\n // looks like 'firestore_sequence_number_<persistence_prefix>'.\n (this.persistenceKey), \n // Rather than adding the storage observer during start(), we add the\n // storage observer during initialization. This ensures that we collect\n // events before other components populate their initial state (during their\n // respective start() calls). Otherwise, we might for example miss a\n // mutation that is added after LocalStore's start() processed the existing\n // mutations but before we observe WebStorage events.\n this.window.addEventListener(\"storage\", this.er);\n }\n /** Returns 'true' if WebStorage is available in the current environment. */ static V(t) {\n return !(!t || !t.localStorage);\n }\n async start() {\n // Retrieve the list of existing clients to backfill the data in\n // SharedClientState.\n const t = await this.syncEngine.Ri();\n for (const e of t) {\n if (e === this.tr) continue;\n const t = this.getItem(Uo(this.persistenceKey, e));\n if (t) {\n const n = jo.Ji(e, t);\n n && (this.sr = this.sr.insert(n.clientId, n));\n }\n }\n this._r();\n // Check if there is an existing online state and call the callback handler\n // if applicable.\n const e = this.storage.getItem(this.lr);\n if (e) {\n const t = this.wr(e);\n t && this.mr(t);\n }\n for (const t of this.ir) this.nr(t);\n this.ir = [], \n // Register a window unload hook to remove the client metadata entry from\n // WebStorage even if `shutdown()` was not called.\n this.window.addEventListener(\"pagehide\", (() => this.shutdown())), this.started = !0;\n }\n writeSequenceNumber(t) {\n this.setItem(this.ur, JSON.stringify(t));\n }\n getAllActiveQueryTargets() {\n return this.gr(this.sr);\n }\n isActiveQueryTarget(t) {\n let e = !1;\n return this.sr.forEach(((n, s) => {\n s.activeTargetIds.has(t) && (e = !0);\n })), e;\n }\n addPendingMutation(t) {\n this.yr(t, \"pending\");\n }\n updateMutationState(t, e, n) {\n this.yr(t, e, n), \n // Once a final mutation result is observed by other clients, they no longer\n // access the mutation's metadata entry. Since WebStorage replays events\n // in order, it is safe to delete the entry right after updating it.\n this.pr(t);\n }\n addLocalQueryTarget(t) {\n let e = \"not-current\";\n // Lookup an existing query state if the target ID was already registered\n // by another tab\n if (this.isActiveQueryTarget(t)) {\n const n = this.storage.getItem(Ko(this.persistenceKey, t));\n if (n) {\n const s = Qo.Ji(t, n);\n s && (e = s.state);\n }\n }\n return this.Ir.Xi(t), this._r(), e;\n }\n removeLocalQueryTarget(t) {\n this.Ir.Zi(t), this._r();\n }\n isLocalQueryTarget(t) {\n return this.Ir.activeTargetIds.has(t);\n }\n clearQueryState(t) {\n this.removeItem(Ko(this.persistenceKey, t));\n }\n updateQueryState(t, e, n) {\n this.Tr(t, e, n);\n }\n handleUserChange(t, e, n) {\n e.forEach((t => {\n this.pr(t);\n })), this.currentUser = t, n.forEach((t => {\n this.addPendingMutation(t);\n }));\n }\n setOnlineState(t) {\n this.Er(t);\n }\n notifyBundleLoaded(t) {\n this.Ar(t);\n }\n shutdown() {\n this.started && (this.window.removeEventListener(\"storage\", this.er), this.removeItem(this.rr), \n this.started = !1);\n }\n getItem(t) {\n const e = this.storage.getItem(t);\n return O(\"SharedClientState\", \"READ\", t, e), e;\n }\n setItem(t, e) {\n O(\"SharedClientState\", \"SET\", t, e), this.storage.setItem(t, e);\n }\n removeItem(t) {\n O(\"SharedClientState\", \"REMOVE\", t), this.storage.removeItem(t);\n }\n nr(t) {\n // Note: The function is typed to take Event to be interface-compatible with\n // `Window.addEventListener`.\n const e = t;\n if (e.storageArea === this.storage) {\n if (O(\"SharedClientState\", \"EVENT\", e.key, e.newValue), e.key === this.rr) return void F(\"Received WebStorage notification for local change. Another client might have garbage-collected our state\");\n this.js.enqueueRetryable((async () => {\n if (this.started) {\n if (null !== e.key) if (this.cr.test(e.key)) {\n if (null == e.newValue) {\n const t = this.Rr(e.key);\n return this.br(t, null);\n }\n {\n const t = this.Pr(e.key, e.newValue);\n if (t) return this.br(t.clientId, t);\n }\n } else if (this.ar.test(e.key)) {\n if (null !== e.newValue) {\n const t = this.vr(e.key, e.newValue);\n if (t) return this.Vr(t);\n }\n } else if (this.hr.test(e.key)) {\n if (null !== e.newValue) {\n const t = this.Sr(e.key, e.newValue);\n if (t) return this.Dr(t);\n }\n } else if (e.key === this.lr) {\n if (null !== e.newValue) {\n const t = this.wr(e.newValue);\n if (t) return this.mr(t);\n }\n } else if (e.key === this.ur) {\n const t = function(t) {\n let e = Lt.ot;\n if (null != t) try {\n const n = JSON.parse(t);\n U(\"number\" == typeof n), e = n;\n } catch (t) {\n F(\"SharedClientState\", \"Failed to read sequence number from WebStorage\", t);\n }\n return e;\n }\n /**\n * `MemorySharedClientState` is a simple implementation of SharedClientState for\n * clients using memory persistence. The state in this class remains fully\n * isolated and no synchronization is performed.\n */ (e.newValue);\n t !== Lt.ot && this.sequenceNumberHandler(t);\n } else if (e.key === this.dr) {\n const t = this.Cr(e.newValue);\n await Promise.all(t.map((t => this.syncEngine.Nr(t))));\n }\n } else this.ir.push(e);\n }));\n }\n }\n get Ir() {\n return this.sr.get(this.tr);\n }\n _r() {\n this.setItem(this.rr, this.Ir.Yi());\n }\n yr(t, e, n) {\n const s = new Go(this.currentUser, t, e, n), i = qo(this.persistenceKey, this.currentUser, t);\n this.setItem(i, s.Yi());\n }\n pr(t) {\n const e = qo(this.persistenceKey, this.currentUser, t);\n this.removeItem(e);\n }\n Er(t) {\n const e = {\n clientId: this.tr,\n onlineState: t\n };\n this.storage.setItem(this.lr, JSON.stringify(e));\n }\n Tr(t, e, n) {\n const s = Ko(this.persistenceKey, t), i = new Qo(t, e, n);\n this.setItem(s, i.Yi());\n }\n Ar(t) {\n const e = JSON.stringify(Array.from(t));\n this.setItem(this.dr, e);\n }\n /**\n * Parses a client state key in WebStorage. Returns null if the key does not\n * match the expected key format.\n */ Rr(t) {\n const e = this.cr.exec(t);\n return e ? e[1] : null;\n }\n /**\n * Parses a client state in WebStorage. Returns 'null' if the value could not\n * be parsed.\n */ Pr(t, e) {\n const n = this.Rr(t);\n return jo.Ji(n, e);\n }\n /**\n * Parses a mutation batch state in WebStorage. Returns 'null' if the value\n * could not be parsed.\n */ vr(t, e) {\n const n = this.ar.exec(t), s = Number(n[1]), i = void 0 !== n[2] ? n[2] : null;\n return Go.Ji(new C(i), s, e);\n }\n /**\n * Parses a query target state from WebStorage. Returns 'null' if the value\n * could not be parsed.\n */ Sr(t, e) {\n const n = this.hr.exec(t), s = Number(n[1]);\n return Qo.Ji(s, e);\n }\n /**\n * Parses an online state from WebStorage. Returns 'null' if the value\n * could not be parsed.\n */ wr(t) {\n return Wo.Ji(t);\n }\n Cr(t) {\n return JSON.parse(t);\n }\n async Vr(t) {\n if (t.user.uid === this.currentUser.uid) return this.syncEngine.kr(t.batchId, t.state, t.error);\n O(\"SharedClientState\", `Ignoring mutation for non-active user ${t.user.uid}`);\n }\n Dr(t) {\n return this.syncEngine.Mr(t.targetId, t.state, t.error);\n }\n br(t, e) {\n const n = e ? this.sr.insert(t, e) : this.sr.remove(t), s = this.gr(this.sr), i = this.gr(n), r = [], o = [];\n return i.forEach((t => {\n s.has(t) || r.push(t);\n })), s.forEach((t => {\n i.has(t) || o.push(t);\n })), this.syncEngine.Or(r, o).then((() => {\n this.sr = n;\n }));\n }\n mr(t) {\n // We check whether the client that wrote this online state is still active\n // by comparing its client ID to the list of clients kept active in\n // IndexedDb. If a client does not update their IndexedDb client state\n // within 5 seconds, it is considered inactive and we don't emit an online\n // state event.\n this.sr.get(t.clientId) && this.onlineStateHandler(t.onlineState);\n }\n gr(t) {\n let e = ps();\n return t.forEach(((t, n) => {\n e = e.unionWith(n.activeTargetIds);\n })), e;\n }\n}\n\nclass Jo {\n constructor() {\n this.Fr = new zo, this.$r = {}, this.onlineStateHandler = null, this.sequenceNumberHandler = null;\n }\n addPendingMutation(t) {\n // No op.\n }\n updateMutationState(t, e, n) {\n // No op.\n }\n addLocalQueryTarget(t) {\n return this.Fr.Xi(t), this.$r[t] || \"not-current\";\n }\n updateQueryState(t, e, n) {\n this.$r[t] = e;\n }\n removeLocalQueryTarget(t) {\n this.Fr.Zi(t);\n }\n isLocalQueryTarget(t) {\n return this.Fr.activeTargetIds.has(t);\n }\n clearQueryState(t) {\n delete this.$r[t];\n }\n getAllActiveQueryTargets() {\n return this.Fr.activeTargetIds;\n }\n isActiveQueryTarget(t) {\n return this.Fr.activeTargetIds.has(t);\n }\n start() {\n return this.Fr = new zo, Promise.resolve();\n }\n handleUserChange(t, e, n) {\n // No op.\n }\n setOnlineState(t) {\n // No op.\n }\n shutdown() {}\n writeSequenceNumber(t) {}\n notifyBundleLoaded(t) {\n // No op.\n }\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ class Yo {\n Br(t) {\n // No-op.\n }\n shutdown() {\n // No-op.\n }\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// References to `window` are guarded by BrowserConnectivityMonitor.isAvailable()\n/* eslint-disable no-restricted-globals */\n/**\n * Browser implementation of ConnectivityMonitor.\n */\nclass Xo {\n constructor() {\n this.Lr = () => this.Ur(), this.qr = () => this.Kr(), this.Gr = [], this.Qr();\n }\n Br(t) {\n this.Gr.push(t);\n }\n shutdown() {\n window.removeEventListener(\"online\", this.Lr), window.removeEventListener(\"offline\", this.qr);\n }\n Qr() {\n window.addEventListener(\"online\", this.Lr), window.addEventListener(\"offline\", this.qr);\n }\n Ur() {\n O(\"ConnectivityMonitor\", \"Network connectivity changed: AVAILABLE\");\n for (const t of this.Gr) t(0 /* AVAILABLE */);\n }\n Kr() {\n O(\"ConnectivityMonitor\", \"Network connectivity changed: UNAVAILABLE\");\n for (const t of this.Gr) t(1 /* UNAVAILABLE */);\n }\n // TODO(chenbrian): Consider passing in window either into this component or\n // here for testing via FakeWindow.\n /** Checks that all used attributes of window are available. */\n static V() {\n return \"undefined\" != typeof window && void 0 !== window.addEventListener && void 0 !== window.removeEventListener;\n }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ const Zo = {\n BatchGetDocuments: \"batchGet\",\n Commit: \"commit\",\n RunQuery: \"runQuery\"\n};\n\n/**\n * Maps RPC names to the corresponding REST endpoint name.\n *\n * We use array notation to avoid mangling.\n */\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Provides a simple helper class that implements the Stream interface to\n * bridge to other implementations that are streams but do not implement the\n * interface. The stream callbacks are invoked with the callOn... methods.\n */\nclass tu {\n constructor(t) {\n this.jr = t.jr, this.Wr = t.Wr;\n }\n zr(t) {\n this.Hr = t;\n }\n Jr(t) {\n this.Yr = t;\n }\n onMessage(t) {\n this.Xr = t;\n }\n close() {\n this.Wr();\n }\n send(t) {\n this.jr(t);\n }\n Zr() {\n this.Hr();\n }\n eo(t) {\n this.Yr(t);\n }\n no(t) {\n this.Xr(t);\n }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ class eu extends \n/**\n * Base class for all Rest-based connections to the backend (WebChannel and\n * HTTP).\n */\nclass {\n constructor(t) {\n this.databaseInfo = t, this.databaseId = t.databaseId;\n const e = t.ssl ? \"https\" : \"http\";\n this.so = e + \"://\" + t.host, this.io = \"projects/\" + this.databaseId.projectId + \"/databases/\" + this.databaseId.database + \"/documents\";\n }\n ro(t, e, n, s, i) {\n const r = this.oo(t, e);\n O(\"RestConnection\", \"Sending: \", r, n);\n const o = {};\n return this.uo(o, s, i), this.co(t, r, o, n).then((t => (O(\"RestConnection\", \"Received: \", t), \n t)), (e => {\n throw $(\"RestConnection\", `${t} failed with error: `, e, \"url: \", r, \"request:\", n), \n e;\n }));\n }\n ao(t, e, n, s, i, r) {\n // The REST API automatically aggregates all of the streamed results, so we\n // can just use the normal invoke() method.\n return this.ro(t, e, n, s, i);\n }\n /**\n * Modifies the headers for a request, adding any authorization token if\n * present and any additional headers for the request.\n */ uo(t, e, n) {\n t[\"X-Goog-Api-Client\"] = \"gl-js/ fire/\" + x, \n // Content-Type: text/plain will avoid preflight requests which might\n // mess with CORS and redirects by proxies. If we add custom headers\n // we will need to change this code to potentially use the $httpOverwrite\n // parameter supported by ESF to avoid triggering preflight requests.\n t[\"Content-Type\"] = \"text/plain\", this.databaseInfo.appId && (t[\"X-Firebase-GMPID\"] = this.databaseInfo.appId), \n e && e.headers.forEach(((e, n) => t[n] = e)), n && n.headers.forEach(((e, n) => t[n] = e));\n }\n oo(t, e) {\n const n = Zo[t];\n return `${this.so}/v1/${e}:${n}`;\n }\n} {\n constructor(t) {\n super(t), this.forceLongPolling = t.forceLongPolling, this.autoDetectLongPolling = t.autoDetectLongPolling, \n this.useFetchStreams = t.useFetchStreams;\n }\n co(t, e, n, s) {\n return new Promise(((i, r) => {\n const o = new XhrIo;\n o.listenOnce(EventType.COMPLETE, (() => {\n try {\n switch (o.getLastErrorCode()) {\n case ErrorCode.NO_ERROR:\n const e = o.getResponseJson();\n O(\"Connection\", \"XHR received:\", JSON.stringify(e)), i(e);\n break;\n\n case ErrorCode.TIMEOUT:\n O(\"Connection\", 'RPC \"' + t + '\" timed out'), r(new Q(G.DEADLINE_EXCEEDED, \"Request time out\"));\n break;\n\n case ErrorCode.HTTP_ERROR:\n const n = o.getStatus();\n if (O(\"Connection\", 'RPC \"' + t + '\" failed with status:', n, \"response text:\", o.getResponseText()), \n n > 0) {\n const t = o.getResponseJson().error;\n if (t && t.status && t.message) {\n const e = function(t) {\n const e = t.toLowerCase().replace(/_/g, \"-\");\n return Object.values(G).indexOf(e) >= 0 ? e : G.UNKNOWN;\n }(t.status);\n r(new Q(e, t.message));\n } else r(new Q(G.UNKNOWN, \"Server responded with status \" + o.getStatus()));\n } else \n // If we received an HTTP_ERROR but there's no status code,\n // it's most probably a connection issue\n r(new Q(G.UNAVAILABLE, \"Connection failed.\"));\n break;\n\n default:\n L();\n }\n } finally {\n O(\"Connection\", 'RPC \"' + t + '\" completed.');\n }\n }));\n const u = JSON.stringify(s);\n o.send(e, \"POST\", u, n, 15);\n }));\n }\n ho(t, e, n) {\n const s = [ this.so, \"/\", \"google.firestore.v1.Firestore\", \"/\", t, \"/channel\" ], i = createWebChannelTransport(), r = getStatEventTarget(), o = {\n // Required for backend stickiness, routing behavior is based on this\n // parameter.\n httpSessionIdParam: \"gsessionid\",\n initMessageHeaders: {},\n messageUrlParams: {\n // This param is used to improve routing and project isolation by the\n // backend and must be included in every request.\n database: `projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`\n },\n sendRawJson: !0,\n supportsCrossDomainXhr: !0,\n internalChannelParams: {\n // Override the default timeout (randomized between 10-20 seconds) since\n // a large write batch on a slow internet connection may take a long\n // time to send to the backend. Rather than have WebChannel impose a\n // tight timeout which could lead to infinite timeouts and retries, we\n // set it very large (5-10 minutes) and rely on the browser's builtin\n // timeouts to kick in if the request isn't working.\n forwardChannelRequestTimeoutMs: 6e5\n },\n forceLongPolling: this.forceLongPolling,\n detectBufferingProxy: this.autoDetectLongPolling\n };\n this.useFetchStreams && (o.xmlHttpFactory = new FetchXmlHttpFactory({})), this.uo(o.initMessageHeaders, e, n), \n // Sending the custom headers we just added to request.initMessageHeaders\n // (Authorization, etc.) will trigger the browser to make a CORS preflight\n // request because the XHR will no longer meet the criteria for a \"simple\"\n // CORS request:\n // https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Simple_requests\n // Therefore to avoid the CORS preflight request (an extra network\n // roundtrip), we use the httpHeadersOverwriteParam option to specify that\n // the headers should instead be encoded into a special \"$httpHeaders\" query\n // parameter, which is recognized by the webchannel backend. This is\n // formally defined here:\n // https://github.com/google/closure-library/blob/b0e1815b13fb92a46d7c9b3c30de5d6a396a3245/closure/goog/net/rpc/httpcors.js#L32\n // TODO(b/145624756): There is a backend bug where $httpHeaders isn't respected if the request\n // doesn't have an Origin header. So we have to exclude a few browser environments that are\n // known to (sometimes) not include an Origin. See\n // https://github.com/firebase/firebase-js-sdk/issues/1491.\n isMobileCordova() || isReactNative() || isElectron() || isIE() || isUWP() || isBrowserExtension() || (o.httpHeadersOverwriteParam = \"$httpHeaders\");\n const u = s.join(\"\");\n O(\"Connection\", \"Creating WebChannel: \" + u, o);\n const c = i.createWebChannel(u, o);\n // WebChannel supports sending the first message with the handshake - saving\n // a network round trip. However, it will have to call send in the same\n // JS event loop as open. In order to enforce this, we delay actually\n // opening the WebChannel until send is called. Whether we have called\n // open is tracked with this variable.\n let a = !1, h = !1;\n // A flag to determine whether the stream was closed (by us or through an\n // error/close event) to avoid delivering multiple close events or sending\n // on a closed stream\n const l = new tu({\n jr: t => {\n h ? O(\"Connection\", \"Not sending because WebChannel is closed:\", t) : (a || (O(\"Connection\", \"Opening WebChannel transport.\"), \n c.open(), a = !0), O(\"Connection\", \"WebChannel sending:\", t), c.send(t));\n },\n Wr: () => c.close()\n }), y = (t, e, n) => {\n // TODO(dimond): closure typing seems broken because WebChannel does\n // not implement goog.events.Listenable\n t.listen(e, (t => {\n try {\n n(t);\n } catch (t) {\n setTimeout((() => {\n throw t;\n }), 0);\n }\n }));\n };\n // Closure events are guarded and exceptions are swallowed, so catch any\n // exception and rethrow using a setTimeout so they become visible again.\n // Note that eventually this function could go away if we are confident\n // enough the code is exception free.\n return y(c, WebChannel.EventType.OPEN, (() => {\n h || O(\"Connection\", \"WebChannel transport opened.\");\n })), y(c, WebChannel.EventType.CLOSE, (() => {\n h || (h = !0, O(\"Connection\", \"WebChannel transport closed\"), l.eo());\n })), y(c, WebChannel.EventType.ERROR, (t => {\n h || (h = !0, $(\"Connection\", \"WebChannel transport errored:\", t), l.eo(new Q(G.UNAVAILABLE, \"The operation could not be completed\")));\n })), y(c, WebChannel.EventType.MESSAGE, (t => {\n var e;\n if (!h) {\n const n = t.data[0];\n U(!!n);\n // TODO(b/35143891): There is a bug in One Platform that caused errors\n // (and only errors) to be wrapped in an extra array. To be forward\n // compatible with the bug we need to check either condition. The latter\n // can be removed once the fix has been rolled out.\n // Use any because msgData.error is not typed.\n const s = n, i = s.error || (null === (e = s[0]) || void 0 === e ? void 0 : e.error);\n if (i) {\n O(\"Connection\", \"WebChannel received error:\", i);\n // error.status will be a string like 'OK' or 'NOT_FOUND'.\n const t = i.status;\n let e = \n /**\n * Maps an error Code from a GRPC status identifier like 'NOT_FOUND'.\n *\n * @returns The Code equivalent to the given status string or undefined if\n * there is no match.\n */\n function(t) {\n // lookup by string\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const e = ns[t];\n if (void 0 !== e) return rs(e);\n }(t), n = i.message;\n void 0 === e && (e = G.INTERNAL, n = \"Unknown error status: \" + t + \" with message \" + i.message), \n // Mark closed so no further events are propagated\n h = !0, l.eo(new Q(e, n)), c.close();\n } else O(\"Connection\", \"WebChannel received:\", n), l.no(n);\n }\n })), y(r, Event.STAT_EVENT, (t => {\n t.stat === Stat.PROXY ? O(\"Connection\", \"Detected buffering proxy\") : t.stat === Stat.NOPROXY && O(\"Connection\", \"Detected no buffering proxy\");\n })), setTimeout((() => {\n // Technically we could/should wait for the WebChannel opened event,\n // but because we want to send the first message with the WebChannel\n // handshake we pretend the channel opened here (asynchronously), and\n // then delay the actual open until the first message is sent.\n l.Zr();\n }), 0), l;\n }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** Initializes the WebChannelConnection for the browser. */\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** The Platform's 'window' implementation or null if not available. */\nfunction nu() {\n // `window` is not always available, e.g. in ReactNative and WebWorkers.\n // eslint-disable-next-line no-restricted-globals\n return \"undefined\" != typeof window ? window : null;\n}\n\n/** The Platform's 'document' implementation or null if not available. */ function su() {\n // `document` is not always available, e.g. in ReactNative and WebWorkers.\n // eslint-disable-next-line no-restricted-globals\n return \"undefined\" != typeof document ? document : null;\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ function iu(t) {\n return new Cs(t, /* useProto3Json= */ !0);\n}\n\n/**\n * An instance of the Platform's 'TextEncoder' implementation.\n */\n/**\n * A helper for running delayed tasks following an exponential backoff curve\n * between attempts.\n *\n * Each delay is made up of a \"base\" delay which follows the exponential\n * backoff curve, and a +/- 50% \"jitter\" that is calculated and added to the\n * base delay. This prevents clients from accidentally synchronizing their\n * delays causing spikes of load to the backend.\n */\nclass ru {\n constructor(\n /**\n * The AsyncQueue to run backoff operations on.\n */\n t, \n /**\n * The ID to use when scheduling backoff operations on the AsyncQueue.\n */\n e, \n /**\n * The initial delay (used as the base delay on the first retry attempt).\n * Note that jitter will still be applied, so the actual delay could be as\n * little as 0.5*initialDelayMs.\n */\n n = 1e3\n /**\n * The multiplier to use to determine the extended base delay after each\n * attempt.\n */ , s = 1.5\n /**\n * The maximum base delay after which no further backoff is performed.\n * Note that jitter will still be applied, so the actual delay could be as\n * much as 1.5*maxDelayMs.\n */ , i = 6e4) {\n this.js = t, this.timerId = e, this.lo = n, this.fo = s, this._o = i, this.wo = 0, \n this.mo = null, \n /** The last backoff attempt, as epoch milliseconds. */\n this.yo = Date.now(), this.reset();\n }\n /**\n * Resets the backoff delay.\n *\n * The very next backoffAndWait() will have no delay. If it is called again\n * (i.e. due to an error), initialDelayMs (plus jitter) will be used, and\n * subsequent ones will increase according to the backoffFactor.\n */ reset() {\n this.wo = 0;\n }\n /**\n * Resets the backoff delay to the maximum delay (e.g. for use after a\n * RESOURCE_EXHAUSTED error).\n */ po() {\n this.wo = this._o;\n }\n /**\n * Returns a promise that resolves after currentDelayMs, and increases the\n * delay for any subsequent attempts. If there was a pending backoff operation\n * already, it will be canceled.\n */ Io(t) {\n // Cancel any pending backoff operation.\n this.cancel();\n // First schedule using the current base (which may be 0 and should be\n // honored as such).\n const e = Math.floor(this.wo + this.To()), n = Math.max(0, Date.now() - this.yo), s = Math.max(0, e - n);\n // Guard against lastAttemptTime being in the future due to a clock change.\n s > 0 && O(\"ExponentialBackoff\", `Backing off for ${s} ms (base delay: ${this.wo} ms, delay with jitter: ${e} ms, last attempt: ${n} ms ago)`), \n this.mo = this.js.enqueueAfterDelay(this.timerId, s, (() => (this.yo = Date.now(), \n t()))), \n // Apply backoff factor to determine next delay and ensure it is within\n // bounds.\n this.wo *= this.fo, this.wo < this.lo && (this.wo = this.lo), this.wo > this._o && (this.wo = this._o);\n }\n Eo() {\n null !== this.mo && (this.mo.skipDelay(), this.mo = null);\n }\n cancel() {\n null !== this.mo && (this.mo.cancel(), this.mo = null);\n }\n /** Returns a random value in the range [-currentBaseMs/2, currentBaseMs/2] */ To() {\n return (Math.random() - .5) * this.wo;\n }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A PersistentStream is an abstract base class that represents a streaming RPC\n * to the Firestore backend. It's built on top of the connections own support\n * for streaming RPCs, and adds several critical features for our clients:\n *\n * - Exponential backoff on failure\n * - Authentication via CredentialsProvider\n * - Dispatching all callbacks into the shared worker queue\n * - Closing idle streams after 60 seconds of inactivity\n *\n * Subclasses of PersistentStream implement serialization of models to and\n * from the JSON representation of the protocol buffers for a specific\n * streaming RPC.\n *\n * ## Starting and Stopping\n *\n * Streaming RPCs are stateful and need to be start()ed before messages can\n * be sent and received. The PersistentStream will call the onOpen() function\n * of the listener once the stream is ready to accept requests.\n *\n * Should a start() fail, PersistentStream will call the registered onClose()\n * listener with a FirestoreError indicating what went wrong.\n *\n * A PersistentStream can be started and stopped repeatedly.\n *\n * Generic types:\n * SendType: The type of the outgoing message of the underlying\n * connection stream\n * ReceiveType: The type of the incoming message of the underlying\n * connection stream\n * ListenerType: The type of the listener that will be used for callbacks\n */\nclass ou {\n constructor(t, e, n, s, i, r, o, u) {\n this.js = t, this.Ao = n, this.Ro = s, this.bo = i, this.authCredentialsProvider = r, \n this.appCheckCredentialsProvider = o, this.listener = u, this.state = 0 /* Initial */ , \n /**\n * A close count that's incremented every time the stream is closed; used by\n * getCloseGuardedDispatcher() to invalidate callbacks that happen after\n * close.\n */\n this.Po = 0, this.vo = null, this.Vo = null, this.stream = null, this.So = new ru(t, e);\n }\n /**\n * Returns true if start() has been called and no error has occurred. True\n * indicates the stream is open or in the process of opening (which\n * encompasses respecting backoff, getting auth tokens, and starting the\n * actual RPC). Use isOpen() to determine if the stream is open and ready for\n * outbound requests.\n */ Do() {\n return 1 /* Starting */ === this.state || 5 /* Backoff */ === this.state || this.Co();\n }\n /**\n * Returns true if the underlying RPC is open (the onOpen() listener has been\n * called) and the stream is ready for outbound requests.\n */ Co() {\n return 2 /* Open */ === this.state || 3 /* Healthy */ === this.state;\n }\n /**\n * Starts the RPC. Only allowed if isStarted() returns false. The stream is\n * not immediately ready for use: onOpen() will be invoked when the RPC is\n * ready for outbound requests, at which point isOpen() will return true.\n *\n * When start returns, isStarted() will return true.\n */ start() {\n 4 /* Error */ !== this.state ? this.auth() : this.xo();\n }\n /**\n * Stops the RPC. This call is idempotent and allowed regardless of the\n * current isStarted() state.\n *\n * When stop returns, isStarted() and isOpen() will both return false.\n */ async stop() {\n this.Do() && await this.close(0 /* Initial */);\n }\n /**\n * After an error the stream will usually back off on the next attempt to\n * start it. If the error warrants an immediate restart of the stream, the\n * sender can use this to indicate that the receiver should not back off.\n *\n * Each error will call the onClose() listener. That function can decide to\n * inhibit backoff if required.\n */ No() {\n this.state = 0 /* Initial */ , this.So.reset();\n }\n /**\n * Marks this stream as idle. If no further actions are performed on the\n * stream for one minute, the stream will automatically close itself and\n * notify the stream's onClose() handler with Status.OK. The stream will then\n * be in a !isStarted() state, requiring the caller to start the stream again\n * before further use.\n *\n * Only streams that are in state 'Open' can be marked idle, as all other\n * states imply pending network operations.\n */ ko() {\n // Starts the idle time if we are in state 'Open' and are not yet already\n // running a timer (in which case the previous idle timeout still applies).\n this.Co() && null === this.vo && (this.vo = this.js.enqueueAfterDelay(this.Ao, 6e4, (() => this.Mo())));\n }\n /** Sends a message to the underlying stream. */ Oo(t) {\n this.Fo(), this.stream.send(t);\n }\n /** Called by the idle timer when the stream should close due to inactivity. */ async Mo() {\n if (this.Co()) \n // When timing out an idle stream there's no reason to force the stream into backoff when\n // it restarts so set the stream state to Initial instead of Error.\n return this.close(0 /* Initial */);\n }\n /** Marks the stream as active again. */ Fo() {\n this.vo && (this.vo.cancel(), this.vo = null);\n }\n /** Cancels the health check delayed operation. */ $o() {\n this.Vo && (this.Vo.cancel(), this.Vo = null);\n }\n /**\n * Closes the stream and cleans up as necessary:\n *\n * * closes the underlying GRPC stream;\n * * calls the onClose handler with the given 'error';\n * * sets internal stream state to 'finalState';\n * * adjusts the backoff timer based on the error\n *\n * A new stream can be opened by calling start().\n *\n * @param finalState - the intended state of the stream after closing.\n * @param error - the error the connection was closed with.\n */ async close(t, e) {\n // Cancel any outstanding timers (they're guaranteed not to execute).\n this.Fo(), this.$o(), this.So.cancel(), \n // Invalidates any stream-related callbacks (e.g. from auth or the\n // underlying stream), guaranteeing they won't execute.\n this.Po++, 4 /* Error */ !== t ? \n // If this is an intentional close ensure we don't delay our next connection attempt.\n this.So.reset() : e && e.code === G.RESOURCE_EXHAUSTED ? (\n // Log the error. (Probably either 'quota exceeded' or 'max queue length reached'.)\n F(e.toString()), F(\"Using maximum backoff delay to prevent overloading the backend.\"), \n this.So.po()) : e && e.code === G.UNAUTHENTICATED && 3 /* Healthy */ !== this.state && (\n // \"unauthenticated\" error means the token was rejected. This should rarely\n // happen since both Auth and AppCheck ensure a sufficient TTL when we\n // request a token. If a user manually resets their system clock this can\n // fail, however. In this case, we should get a Code.UNAUTHENTICATED error\n // before we received the first message and we need to invalidate the token\n // to ensure that we fetch a new token.\n this.authCredentialsProvider.invalidateToken(), this.appCheckCredentialsProvider.invalidateToken()), \n // Clean up the underlying stream because we are no longer interested in events.\n null !== this.stream && (this.Bo(), this.stream.close(), this.stream = null), \n // This state must be assigned before calling onClose() to allow the callback to\n // inhibit backoff or otherwise manipulate the state in its non-started state.\n this.state = t, \n // Notify the listener that the stream closed.\n await this.listener.Jr(e);\n }\n /**\n * Can be overridden to perform additional cleanup before the stream is closed.\n * Calling super.tearDown() is not required.\n */ Bo() {}\n auth() {\n this.state = 1 /* Starting */;\n const t = this.Lo(this.Po), e = this.Po;\n // TODO(mikelehen): Just use dispatchIfNotClosed, but see TODO below.\n Promise.all([ this.authCredentialsProvider.getToken(), this.appCheckCredentialsProvider.getToken() ]).then((([t, n]) => {\n // Stream can be stopped while waiting for authentication.\n // TODO(mikelehen): We really should just use dispatchIfNotClosed\n // and let this dispatch onto the queue, but that opened a spec test can\n // of worms that I don't want to deal with in this PR.\n this.Po === e && \n // Normally we'd have to schedule the callback on the AsyncQueue.\n // However, the following calls are safe to be called outside the\n // AsyncQueue since they don't chain asynchronous calls\n this.Uo(t, n);\n }), (e => {\n t((() => {\n const t = new Q(G.UNKNOWN, \"Fetching auth token failed: \" + e.message);\n return this.qo(t);\n }));\n }));\n }\n Uo(t, e) {\n const n = this.Lo(this.Po);\n this.stream = this.Ko(t, e), this.stream.zr((() => {\n n((() => (this.state = 2 /* Open */ , this.Vo = this.js.enqueueAfterDelay(this.Ro, 1e4, (() => (this.Co() && (this.state = 3 /* Healthy */), \n Promise.resolve()))), this.listener.zr())));\n })), this.stream.Jr((t => {\n n((() => this.qo(t)));\n })), this.stream.onMessage((t => {\n n((() => this.onMessage(t)));\n }));\n }\n xo() {\n this.state = 5 /* Backoff */ , this.So.Io((async () => {\n this.state = 0 /* Initial */ , this.start();\n }));\n }\n // Visible for tests\n qo(t) {\n // In theory the stream could close cleanly, however, in our current model\n // we never expect this to happen because if we stop a stream ourselves,\n // this callback will never be called. To prevent cases where we retry\n // without a backoff accidentally, we set the stream to error in all cases.\n return O(\"PersistentStream\", `close with error: ${t}`), this.stream = null, this.close(4 /* Error */ , t);\n }\n /**\n * Returns a \"dispatcher\" function that dispatches operations onto the\n * AsyncQueue but only runs them if closeCount remains unchanged. This allows\n * us to turn auth / stream callbacks into no-ops if the stream is closed /\n * re-opened, etc.\n */ Lo(t) {\n return e => {\n this.js.enqueueAndForget((() => this.Po === t ? e() : (O(\"PersistentStream\", \"stream callback skipped by getCloseGuardedDispatcher.\"), \n Promise.resolve())));\n };\n }\n}\n\n/**\n * A PersistentStream that implements the Listen RPC.\n *\n * Once the Listen stream has called the onOpen() listener, any number of\n * listen() and unlisten() calls can be made to control what changes will be\n * sent from the server for ListenResponses.\n */ class uu extends ou {\n constructor(t, e, n, s, i, r) {\n super(t, \"listen_stream_connection_backoff\" /* ListenStreamConnectionBackoff */ , \"listen_stream_idle\" /* ListenStreamIdle */ , \"health_check_timeout\" /* HealthCheckTimeout */ , e, n, s, r), \n this.wt = i;\n }\n Ko(t, e) {\n return this.bo.ho(\"Listen\", t, e);\n }\n onMessage(t) {\n // A successful response means the stream is healthy\n this.So.reset();\n const e = Ws(this.wt, t), n = function(t) {\n // We have only reached a consistent snapshot for the entire stream if there\n // is a read_time set and it applies to all targets (i.e. the list of\n // targets is empty). The backend is guaranteed to send such responses.\n if (!(\"targetChange\" in t)) return ct.min();\n const e = t.targetChange;\n return e.targetIds && e.targetIds.length ? ct.min() : e.readTime ? Ms(e.readTime) : ct.min();\n }(t);\n return this.listener.Go(e, n);\n }\n /**\n * Registers interest in the results of the given target. If the target\n * includes a resumeToken it will be included in the request. Results that\n * affect the target will be streamed back as WatchChange messages that\n * reference the targetId.\n */ Qo(t) {\n const e = {};\n e.database = qs(this.wt), e.addTarget = function(t, e) {\n let n;\n const s = e.target;\n return n = Le(s) ? {\n documents: Ys(t, s)\n } : {\n query: Xs(t, s)\n }, n.targetId = e.targetId, e.resumeToken.approximateByteSize() > 0 ? n.resumeToken = Ns(t, e.resumeToken) : e.snapshotVersion.compareTo(ct.min()) > 0 && (\n // TODO(wuandy): Consider removing above check because it is most likely true.\n // Right now, many tests depend on this behaviour though (leaving min() out\n // of serialization).\n n.readTime = xs(t, e.snapshotVersion.toTimestamp())), n;\n }(this.wt, t);\n const n = ti(this.wt, t);\n n && (e.labels = n), this.Oo(e);\n }\n /**\n * Unregisters interest in the results of the target associated with the\n * given targetId.\n */ jo(t) {\n const e = {};\n e.database = qs(this.wt), e.removeTarget = t, this.Oo(e);\n }\n}\n\n/**\n * A Stream that implements the Write RPC.\n *\n * The Write RPC requires the caller to maintain special streamToken\n * state in between calls, to help the server understand which responses the\n * client has processed by the time the next request is made. Every response\n * will contain a streamToken; this value must be passed to the next\n * request.\n *\n * After calling start() on this stream, the next request must be a handshake,\n * containing whatever streamToken is on hand. Once a response to this\n * request is received, all pending mutations may be submitted. When\n * submitting multiple batches of mutations at the same time, it's\n * okay to use the same streamToken for the calls to writeMutations.\n *\n * TODO(b/33271235): Use proto types\n */ class cu extends ou {\n constructor(t, e, n, s, i, r) {\n super(t, \"write_stream_connection_backoff\" /* WriteStreamConnectionBackoff */ , \"write_stream_idle\" /* WriteStreamIdle */ , \"health_check_timeout\" /* HealthCheckTimeout */ , e, n, s, r), \n this.wt = i, this.Wo = !1;\n }\n /**\n * Tracks whether or not a handshake has been successfully exchanged and\n * the stream is ready to accept mutations.\n */ get zo() {\n return this.Wo;\n }\n // Override of PersistentStream.start\n start() {\n this.Wo = !1, this.lastStreamToken = void 0, super.start();\n }\n Bo() {\n this.Wo && this.Ho([]);\n }\n Ko(t, e) {\n return this.bo.ho(\"Write\", t, e);\n }\n onMessage(t) {\n if (\n // Always capture the last stream token.\n U(!!t.streamToken), this.lastStreamToken = t.streamToken, this.Wo) {\n // A successful first write response means the stream is healthy,\n // Note, that we could consider a successful handshake healthy, however,\n // the write itself might be causing an error we want to back off from.\n this.So.reset();\n const e = Js(t.writeResults, t.commitTime), n = Ms(t.commitTime);\n return this.listener.Jo(n, e);\n }\n // The first response is always the handshake response\n return U(!t.writeResults || 0 === t.writeResults.length), this.Wo = !0, this.listener.Yo();\n }\n /**\n * Sends an initial streamToken to the server, performing the handshake\n * required to make the StreamingWrite RPC work. Subsequent\n * calls should wait until onHandshakeComplete was called.\n */ Xo() {\n // TODO(dimond): Support stream resumption. We intentionally do not set the\n // stream token on the handshake, ignoring any stream token we might have.\n const t = {};\n t.database = qs(this.wt), this.Oo(t);\n }\n /** Sends a group of mutations to the Firestore backend to apply. */ Ho(t) {\n const e = {\n streamToken: this.lastStreamToken,\n writes: t.map((t => zs(this.wt, t)))\n };\n this.Oo(e);\n }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Datastore and its related methods are a wrapper around the external Google\n * Cloud Datastore grpc API, which provides an interface that is more convenient\n * for the rest of the client SDK architecture to consume.\n */\n/**\n * An implementation of Datastore that exposes additional state for internal\n * consumption.\n */\nclass au extends class {} {\n constructor(t, e, n, s) {\n super(), this.authCredentials = t, this.appCheckCredentials = e, this.bo = n, this.wt = s, \n this.Zo = !1;\n }\n tu() {\n if (this.Zo) throw new Q(G.FAILED_PRECONDITION, \"The client has already been terminated.\");\n }\n /** Invokes the provided RPC with auth and AppCheck tokens. */ ro(t, e, n) {\n return this.tu(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, i]) => this.bo.ro(t, e, n, s, i))).catch((t => {\n throw \"FirebaseError\" === t.name ? (t.code === G.UNAUTHENTICATED && (this.authCredentials.invalidateToken(), \n this.appCheckCredentials.invalidateToken()), t) : new Q(G.UNKNOWN, t.toString());\n }));\n }\n /** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */ ao(t, e, n, s) {\n return this.tu(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([i, r]) => this.bo.ao(t, e, n, i, r, s))).catch((t => {\n throw \"FirebaseError\" === t.name ? (t.code === G.UNAUTHENTICATED && (this.authCredentials.invalidateToken(), \n this.appCheckCredentials.invalidateToken()), t) : new Q(G.UNKNOWN, t.toString());\n }));\n }\n terminate() {\n this.Zo = !0;\n }\n}\n\n// TODO(firestorexp): Make sure there is only one Datastore instance per\n// firestore-exp client.\n/**\n * A component used by the RemoteStore to track the OnlineState (that is,\n * whether or not the client as a whole should be considered to be online or\n * offline), implementing the appropriate heuristics.\n *\n * In particular, when the client is trying to connect to the backend, we\n * allow up to MAX_WATCH_STREAM_FAILURES within ONLINE_STATE_TIMEOUT_MS for\n * a connection to succeed. If we have too many failures or the timeout elapses,\n * then we set the OnlineState to Offline, and the client will behave as if\n * it is offline (get()s will return cached data, etc.).\n */\nclass hu {\n constructor(t, e) {\n this.asyncQueue = t, this.onlineStateHandler = e, \n /** The current OnlineState. */\n this.state = \"Unknown\" /* Unknown */ , \n /**\n * A count of consecutive failures to open the stream. If it reaches the\n * maximum defined by MAX_WATCH_STREAM_FAILURES, we'll set the OnlineState to\n * Offline.\n */\n this.eu = 0, \n /**\n * A timer that elapses after ONLINE_STATE_TIMEOUT_MS, at which point we\n * transition from OnlineState.Unknown to OnlineState.Offline without waiting\n * for the stream to actually fail (MAX_WATCH_STREAM_FAILURES times).\n */\n this.nu = null, \n /**\n * Whether the client should log a warning message if it fails to connect to\n * the backend (initially true, cleared after a successful stream, or if we've\n * logged the message already).\n */\n this.su = !0;\n }\n /**\n * Called by RemoteStore when a watch stream is started (including on each\n * backoff attempt).\n *\n * If this is the first attempt, it sets the OnlineState to Unknown and starts\n * the onlineStateTimer.\n */ iu() {\n 0 === this.eu && (this.ru(\"Unknown\" /* Unknown */), this.nu = this.asyncQueue.enqueueAfterDelay(\"online_state_timeout\" /* OnlineStateTimeout */ , 1e4, (() => (this.nu = null, \n this.ou(\"Backend didn't respond within 10 seconds.\"), this.ru(\"Offline\" /* Offline */), \n Promise.resolve()))));\n }\n /**\n * Updates our OnlineState as appropriate after the watch stream reports a\n * failure. The first failure moves us to the 'Unknown' state. We then may\n * allow multiple failures (based on MAX_WATCH_STREAM_FAILURES) before we\n * actually transition to the 'Offline' state.\n */ uu(t) {\n \"Online\" /* Online */ === this.state ? this.ru(\"Unknown\" /* Unknown */) : (this.eu++, \n this.eu >= 1 && (this.cu(), this.ou(`Connection failed 1 times. Most recent error: ${t.toString()}`), \n this.ru(\"Offline\" /* Offline */)));\n }\n /**\n * Explicitly sets the OnlineState to the specified state.\n *\n * Note that this resets our timers / failure counters, etc. used by our\n * Offline heuristics, so must not be used in place of\n * handleWatchStreamStart() and handleWatchStreamFailure().\n */ set(t) {\n this.cu(), this.eu = 0, \"Online\" /* Online */ === t && (\n // We've connected to watch at least once. Don't warn the developer\n // about being offline going forward.\n this.su = !1), this.ru(t);\n }\n ru(t) {\n t !== this.state && (this.state = t, this.onlineStateHandler(t));\n }\n ou(t) {\n const e = `Could not reach Cloud Firestore backend. ${t}\\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;\n this.su ? (F(e), this.su = !1) : O(\"OnlineStateTracker\", e);\n }\n cu() {\n null !== this.nu && (this.nu.cancel(), this.nu = null);\n }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ class lu {\n constructor(\n /**\n * The local store, used to fill the write pipeline with outbound mutations.\n */\n t, \n /** The client-side proxy for interacting with the backend. */\n e, n, s, i) {\n this.localStore = t, this.datastore = e, this.asyncQueue = n, this.remoteSyncer = {}, \n /**\n * A list of up to MAX_PENDING_WRITES writes that we have fetched from the\n * LocalStore via fillWritePipeline() and have or will send to the write\n * stream.\n *\n * Whenever writePipeline.length > 0 the RemoteStore will attempt to start or\n * restart the write stream. When the stream is established the writes in the\n * pipeline will be sent in order.\n *\n * Writes remain in writePipeline until they are acknowledged by the backend\n * and thus will automatically be re-sent if the stream is interrupted /\n * restarted before they're acknowledged.\n *\n * Write responses from the backend are linked to their originating request\n * purely based on order, and so we can just shift() writes from the front of\n * the writePipeline as we receive responses.\n */\n this.au = [], \n /**\n * A mapping of watched targets that the client cares about tracking and the\n * user has explicitly called a 'listen' for this target.\n *\n * These targets may or may not have been sent to or acknowledged by the\n * server. On re-establishing the listen stream, these targets should be sent\n * to the server. The targets removed with unlistens are removed eagerly\n * without waiting for confirmation from the listen stream.\n */\n this.hu = new Map, \n /**\n * A set of reasons for why the RemoteStore may be offline. If empty, the\n * RemoteStore may start its network connections.\n */\n this.lu = new Set, \n /**\n * Event handlers that get called when the network is disabled or enabled.\n *\n * PORTING NOTE: These functions are used on the Web client to create the\n * underlying streams (to support tree-shakeable streams). On Android and iOS,\n * the streams are created during construction of RemoteStore.\n */\n this.fu = [], this.du = i, this.du.Br((t => {\n n.enqueueAndForget((async () => {\n // Porting Note: Unlike iOS, `restartNetwork()` is called even when the\n // network becomes unreachable as we don't have any other way to tear\n // down our streams.\n Iu(this) && (O(\"RemoteStore\", \"Restarting streams for network reachability change.\"), \n await async function(t) {\n const e = K(t);\n e.lu.add(4 /* ConnectivityChange */), await du(e), e._u.set(\"Unknown\" /* Unknown */), \n e.lu.delete(4 /* ConnectivityChange */), await fu(e);\n }(this));\n }));\n })), this._u = new hu(n, s);\n }\n}\n\nasync function fu(t) {\n if (Iu(t)) for (const e of t.fu) await e(/* enabled= */ !0);\n}\n\n/**\n * Temporarily disables the network. The network can be re-enabled using\n * enableNetwork().\n */ async function du(t) {\n for (const e of t.fu) await e(/* enabled= */ !1);\n}\n\n/**\n * Starts new listen for the given target. Uses resume token if provided. It\n * is a no-op if the target of given `TargetData` is already being listened to.\n */\nfunction _u(t, e) {\n const n = K(t);\n n.hu.has(e.targetId) || (\n // Mark this as something the client is currently listening for.\n n.hu.set(e.targetId, e), pu(n) ? \n // The listen will be sent in onWatchStreamOpen\n yu(n) : $u(n).Co() && mu(n, e));\n}\n\n/**\n * Removes the listen from server. It is a no-op if the given target id is\n * not being listened to.\n */ function wu(t, e) {\n const n = K(t), s = $u(n);\n n.hu.delete(e), s.Co() && gu(n, e), 0 === n.hu.size && (s.Co() ? s.ko() : Iu(n) && \n // Revert to OnlineState.Unknown if the watch stream is not open and we\n // have no listeners, since without any listens to send we cannot\n // confirm if the stream is healthy and upgrade to OnlineState.Online.\n n._u.set(\"Unknown\" /* Unknown */));\n}\n\n/**\n * We need to increment the the expected number of pending responses we're due\n * from watch so we wait for the ack to process any messages from this target.\n */ function mu(t, e) {\n t.wu.Nt(e.targetId), $u(t).Qo(e);\n}\n\n/**\n * We need to increment the expected number of pending responses we're due\n * from watch so we wait for the removal on the server before we process any\n * messages from this target.\n */ function gu(t, e) {\n t.wu.Nt(e), $u(t).jo(e);\n}\n\nfunction yu(t) {\n t.wu = new Ps({\n getRemoteKeysForTarget: e => t.remoteSyncer.getRemoteKeysForTarget(e),\n te: e => t.hu.get(e) || null\n }), $u(t).start(), t._u.iu();\n}\n\n/**\n * Returns whether the watch stream should be started because it's necessary\n * and has not yet been started.\n */ function pu(t) {\n return Iu(t) && !$u(t).Do() && t.hu.size > 0;\n}\n\nfunction Iu(t) {\n return 0 === K(t).lu.size;\n}\n\nfunction Tu(t) {\n t.wu = void 0;\n}\n\nasync function Eu(t) {\n t.hu.forEach(((e, n) => {\n mu(t, e);\n }));\n}\n\nasync function Au(t, e) {\n Tu(t), \n // If we still need the watch stream, retry the connection.\n pu(t) ? (t._u.uu(e), yu(t)) : \n // No need to restart watch stream because there are no active targets.\n // The online state is set to unknown because there is no active attempt\n // at establishing a connection\n t._u.set(\"Unknown\" /* Unknown */);\n}\n\nasync function Ru(t, e, n) {\n if (\n // Mark the client as online since we got a message from the server\n t._u.set(\"Online\" /* Online */), e instanceof Rs && 2 /* Removed */ === e.state && e.cause) \n // There was an error on a target, don't wait for a consistent snapshot\n // to raise events\n try {\n await \n /** Handles an error on a target */\n async function(t, e) {\n const n = e.cause;\n for (const s of e.targetIds) \n // A watched target might have been removed already.\n t.hu.has(s) && (await t.remoteSyncer.rejectListen(s, n), t.hu.delete(s), t.wu.removeTarget(s));\n }\n /**\n * Attempts to fill our write pipeline with writes from the LocalStore.\n *\n * Called internally to bootstrap or refill the write pipeline and by\n * SyncEngine whenever there are new mutations to process.\n *\n * Starts the write stream if necessary.\n */ (t, e);\n } catch (n) {\n O(\"RemoteStore\", \"Failed to remove targets %s: %s \", e.targetIds.join(\",\"), n), \n await bu(t, n);\n } else if (e instanceof Es ? t.wu.Ut(e) : e instanceof As ? t.wu.zt(e) : t.wu.Gt(e), \n !n.isEqual(ct.min())) try {\n const e = await So(t.localStore);\n n.compareTo(e) >= 0 && \n // We have received a target change with a global snapshot if the snapshot\n // version is not equal to SnapshotVersion.min().\n await \n /**\n * Takes a batch of changes from the Datastore, repackages them as a\n * RemoteEvent, and passes that on to the listener, which is typically the\n * SyncEngine.\n */\n function(t, e) {\n const n = t.wu.Yt(e);\n // Update in-memory resume tokens. LocalStore will update the\n // persistent view of these when applying the completed RemoteEvent.\n return n.targetChanges.forEach(((n, s) => {\n if (n.resumeToken.approximateByteSize() > 0) {\n const i = t.hu.get(s);\n // A watched target might have been removed already.\n i && t.hu.set(s, i.withResumeToken(n.resumeToken, e));\n }\n })), \n // Re-establish listens for the targets that have been invalidated by\n // existence filter mismatches.\n n.targetMismatches.forEach((e => {\n const n = t.hu.get(e);\n if (!n) \n // A watched target might have been removed already.\n return;\n // Clear the resume token for the target, since we're in a known mismatch\n // state.\n t.hu.set(e, n.withResumeToken(Xt.EMPTY_BYTE_STRING, n.snapshotVersion)), \n // Cause a hard reset by unwatching and rewatching immediately, but\n // deliberately don't send a resume token so that we get a full update.\n gu(t, e);\n // Mark the target we send as being on behalf of an existence filter\n // mismatch, but don't actually retain that in listenTargets. This ensures\n // that we flag the first re-listen this way without impacting future\n // listens of this target (that might happen e.g. on reconnect).\n const s = new qi(n.target, e, 1 /* ExistenceFilterMismatch */ , n.sequenceNumber);\n mu(t, s);\n })), t.remoteSyncer.applyRemoteEvent(n);\n }(t, n);\n } catch (e) {\n O(\"RemoteStore\", \"Failed to raise snapshot:\", e), await bu(t, e);\n }\n}\n\n/**\n * Recovery logic for IndexedDB errors that takes the network offline until\n * `op` succeeds. Retries are scheduled with backoff using\n * `enqueueRetryable()`. If `op()` is not provided, IndexedDB access is\n * validated via a generic operation.\n *\n * The returned Promise is resolved once the network is disabled and before\n * any retry attempt.\n */ async function bu(t, e, n) {\n if (!Nt(e)) throw e;\n t.lu.add(1 /* IndexedDbFailed */), \n // Disable network and raise offline snapshots\n await du(t), t._u.set(\"Offline\" /* Offline */), n || (\n // Use a simple read operation to determine if IndexedDB recovered.\n // Ideally, we would expose a health check directly on SimpleDb, but\n // RemoteStore only has access to persistence through LocalStore.\n n = () => So(t.localStore)), \n // Probe IndexedDB periodically and re-enable network\n t.asyncQueue.enqueueRetryable((async () => {\n O(\"RemoteStore\", \"Retrying IndexedDB access\"), await n(), t.lu.delete(1 /* IndexedDbFailed */), \n await fu(t);\n }));\n}\n\n/**\n * Executes `op`. If `op` fails, takes the network offline until `op`\n * succeeds. Returns after the first attempt.\n */ function Pu(t, e) {\n return e().catch((n => bu(t, n, e)));\n}\n\nasync function vu(t) {\n const e = K(t), n = Bu(e);\n let s = e.au.length > 0 ? e.au[e.au.length - 1].batchId : -1;\n for (;Vu(e); ) try {\n const t = await xo(e.localStore, s);\n if (null === t) {\n 0 === e.au.length && n.ko();\n break;\n }\n s = t.batchId, Su(e, t);\n } catch (t) {\n await bu(e, t);\n }\n Du(e) && Cu(e);\n}\n\n/**\n * Returns true if we can add to the write pipeline (i.e. the network is\n * enabled and the write pipeline is not full).\n */ function Vu(t) {\n return Iu(t) && t.au.length < 10;\n}\n\n/**\n * Queues additional writes to be sent to the write stream, sending them\n * immediately if the write stream is established.\n */ function Su(t, e) {\n t.au.push(e);\n const n = Bu(t);\n n.Co() && n.zo && n.Ho(e.mutations);\n}\n\nfunction Du(t) {\n return Iu(t) && !Bu(t).Do() && t.au.length > 0;\n}\n\nfunction Cu(t) {\n Bu(t).start();\n}\n\nasync function xu(t) {\n Bu(t).Xo();\n}\n\nasync function Nu(t) {\n const e = Bu(t);\n // Send the write pipeline now that the stream is established.\n for (const n of t.au) e.Ho(n.mutations);\n}\n\nasync function ku(t, e, n) {\n const s = t.au.shift(), i = Li.from(s, e, n);\n await Pu(t, (() => t.remoteSyncer.applySuccessfulWrite(i))), \n // It's possible that with the completion of this mutation another\n // slot has freed up.\n await vu(t);\n}\n\nasync function Mu(t, e) {\n // If the write stream closed after the write handshake completes, a write\n // operation failed and we fail the pending operation.\n e && Bu(t).zo && \n // This error affects the actual write.\n await async function(t, e) {\n // Only handle permanent errors here. If it's transient, just let the retry\n // logic kick in.\n if (n = e.code, is(n) && n !== G.ABORTED) {\n // This was a permanent error, the request itself was the problem\n // so it's not going to succeed if we resend it.\n const n = t.au.shift();\n // In this case it's also unlikely that the server itself is melting\n // down -- this was just a bad request so inhibit backoff on the next\n // restart.\n Bu(t).No(), await Pu(t, (() => t.remoteSyncer.rejectFailedWrite(n.batchId, e))), \n // It's possible that with the completion of this mutation\n // another slot has freed up.\n await vu(t);\n }\n var n;\n }(t, e), \n // The write stream might have been started by refilling the write\n // pipeline for failed writes\n Du(t) && Cu(t);\n}\n\nasync function Ou(t, e) {\n const n = K(t);\n n.asyncQueue.verifyOperationInProgress(), O(\"RemoteStore\", \"RemoteStore received new credentials\");\n const s = Iu(n);\n // Tear down and re-create our network streams. This will ensure we get a\n // fresh auth token for the new user and re-fill the write pipeline with\n // new mutations from the LocalStore (since mutations are per-user).\n n.lu.add(3 /* CredentialChange */), await du(n), s && \n // Don't set the network status to Unknown if we are offline.\n n._u.set(\"Unknown\" /* Unknown */), await n.remoteSyncer.handleCredentialChange(e), \n n.lu.delete(3 /* CredentialChange */), await fu(n);\n}\n\n/**\n * Toggles the network state when the client gains or loses its primary lease.\n */ async function Fu(t, e) {\n const n = K(t);\n e ? (n.lu.delete(2 /* IsSecondary */), await fu(n)) : e || (n.lu.add(2 /* IsSecondary */), \n await du(n), n._u.set(\"Unknown\" /* Unknown */));\n}\n\n/**\n * If not yet initialized, registers the WatchStream and its network state\n * callback with `remoteStoreImpl`. Returns the existing stream if one is\n * already available.\n *\n * PORTING NOTE: On iOS and Android, the WatchStream gets registered on startup.\n * This is not done on Web to allow it to be tree-shaken.\n */ function $u(t) {\n return t.mu || (\n // Create stream (but note that it is not started yet).\n t.mu = function(t, e, n) {\n const s = K(t);\n return s.tu(), new uu(e, s.bo, s.authCredentials, s.appCheckCredentials, s.wt, n);\n }\n /**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ (t.datastore, t.asyncQueue, {\n zr: Eu.bind(null, t),\n Jr: Au.bind(null, t),\n Go: Ru.bind(null, t)\n }), t.fu.push((async e => {\n e ? (t.mu.No(), pu(t) ? yu(t) : t._u.set(\"Unknown\" /* Unknown */)) : (await t.mu.stop(), \n Tu(t));\n }))), t.mu;\n}\n\n/**\n * If not yet initialized, registers the WriteStream and its network state\n * callback with `remoteStoreImpl`. Returns the existing stream if one is\n * already available.\n *\n * PORTING NOTE: On iOS and Android, the WriteStream gets registered on startup.\n * This is not done on Web to allow it to be tree-shaken.\n */ function Bu(t) {\n return t.gu || (\n // Create stream (but note that it is not started yet).\n t.gu = function(t, e, n) {\n const s = K(t);\n return s.tu(), new cu(e, s.bo, s.authCredentials, s.appCheckCredentials, s.wt, n);\n }(t.datastore, t.asyncQueue, {\n zr: xu.bind(null, t),\n Jr: Mu.bind(null, t),\n Yo: Nu.bind(null, t),\n Jo: ku.bind(null, t)\n }), t.fu.push((async e => {\n e ? (t.gu.No(), \n // This will start the write stream if necessary.\n await vu(t)) : (await t.gu.stop(), t.au.length > 0 && (O(\"RemoteStore\", `Stopping write stream with ${t.au.length} pending writes`), \n t.au = []));\n }))), t.gu;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Represents an operation scheduled to be run in the future on an AsyncQueue.\n *\n * It is created via DelayedOperation.createAndSchedule().\n *\n * Supports cancellation (via cancel()) and early execution (via skipDelay()).\n *\n * Note: We implement `PromiseLike` instead of `Promise`, as the `Promise` type\n * in newer versions of TypeScript defines `finally`, which is not available in\n * IE.\n */\nclass Lu {\n constructor(t, e, n, s, i) {\n this.asyncQueue = t, this.timerId = e, this.targetTimeMs = n, this.op = s, this.removalCallback = i, \n this.deferred = new j, this.then = this.deferred.promise.then.bind(this.deferred.promise), \n // It's normal for the deferred promise to be canceled (due to cancellation)\n // and so we attach a dummy catch callback to avoid\n // 'UnhandledPromiseRejectionWarning' log spam.\n this.deferred.promise.catch((t => {}));\n }\n /**\n * Creates and returns a DelayedOperation that has been scheduled to be\n * executed on the provided asyncQueue after the provided delayMs.\n *\n * @param asyncQueue - The queue to schedule the operation on.\n * @param id - A Timer ID identifying the type of operation this is.\n * @param delayMs - The delay (ms) before the operation should be scheduled.\n * @param op - The operation to run.\n * @param removalCallback - A callback to be called synchronously once the\n * operation is executed or canceled, notifying the AsyncQueue to remove it\n * from its delayedOperations list.\n * PORTING NOTE: This exists to prevent making removeDelayedOperation() and\n * the DelayedOperation class public.\n */ static createAndSchedule(t, e, n, s, i) {\n const r = Date.now() + n, o = new Lu(t, e, r, s, i);\n return o.start(n), o;\n }\n /**\n * Starts the timer. This is called immediately after construction by\n * createAndSchedule().\n */ start(t) {\n this.timerHandle = setTimeout((() => this.handleDelayElapsed()), t);\n }\n /**\n * Queues the operation to run immediately (if it hasn't already been run or\n * canceled).\n */ skipDelay() {\n return this.handleDelayElapsed();\n }\n /**\n * Cancels the operation if it hasn't already been executed or canceled. The\n * promise will be rejected.\n *\n * As long as the operation has not yet been run, calling cancel() provides a\n * guarantee that the operation will not be run.\n */ cancel(t) {\n null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new Q(G.CANCELLED, \"Operation cancelled\" + (t ? \": \" + t : \"\"))));\n }\n handleDelayElapsed() {\n this.asyncQueue.enqueueAndForget((() => null !== this.timerHandle ? (this.clearTimeout(), \n this.op().then((t => this.deferred.resolve(t)))) : Promise.resolve()));\n }\n clearTimeout() {\n null !== this.timerHandle && (this.removalCallback(this), clearTimeout(this.timerHandle), \n this.timerHandle = null);\n }\n}\n\n/**\n * Returns a FirestoreError that can be surfaced to the user if the provided\n * error is an IndexedDbTransactionError. Re-throws the error otherwise.\n */ function Uu(t, e) {\n if (F(\"AsyncQueue\", `${e}: ${t}`), Nt(t)) return new Q(G.UNAVAILABLE, `${e}: ${t}`);\n throw t;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * DocumentSet is an immutable (copy-on-write) collection that holds documents\n * in order specified by the provided comparator. We always add a document key\n * comparator on top of what is provided to guarantee document equality based on\n * the key.\n */ class qu {\n /** The default ordering is by key if the comparator is omitted */\n constructor(t) {\n // We are adding document key comparator to the end as it's the only\n // guaranteed unique property of a document.\n this.comparator = t ? (e, n) => t(e, n) || dt.comparator(e.key, n.key) : (t, e) => dt.comparator(t.key, e.key), \n this.keyedMap = hs(), this.sortedSet = new Gt(this.comparator);\n }\n /**\n * Returns an empty copy of the existing DocumentSet, using the same\n * comparator.\n */ static emptySet(t) {\n return new qu(t.comparator);\n }\n has(t) {\n return null != this.keyedMap.get(t);\n }\n get(t) {\n return this.keyedMap.get(t);\n }\n first() {\n return this.sortedSet.minKey();\n }\n last() {\n return this.sortedSet.maxKey();\n }\n isEmpty() {\n return this.sortedSet.isEmpty();\n }\n /**\n * Returns the index of the provided key in the document set, or -1 if the\n * document key is not present in the set;\n */ indexOf(t) {\n const e = this.keyedMap.get(t);\n return e ? this.sortedSet.indexOf(e) : -1;\n }\n get size() {\n return this.sortedSet.size;\n }\n /** Iterates documents in order defined by \"comparator\" */ forEach(t) {\n this.sortedSet.inorderTraversal(((e, n) => (t(e), !1)));\n }\n /** Inserts or updates a document with the same key */ add(t) {\n // First remove the element if we have it.\n const e = this.delete(t.key);\n return e.copy(e.keyedMap.insert(t.key, t), e.sortedSet.insert(t, null));\n }\n /** Deletes a document with a given key */ delete(t) {\n const e = this.get(t);\n return e ? this.copy(this.keyedMap.remove(t), this.sortedSet.remove(e)) : this;\n }\n isEqual(t) {\n if (!(t instanceof qu)) return !1;\n if (this.size !== t.size) return !1;\n const e = this.sortedSet.getIterator(), n = t.sortedSet.getIterator();\n for (;e.hasNext(); ) {\n const t = e.getNext().key, s = n.getNext().key;\n if (!t.isEqual(s)) return !1;\n }\n return !0;\n }\n toString() {\n const t = [];\n return this.forEach((e => {\n t.push(e.toString());\n })), 0 === t.length ? \"DocumentSet ()\" : \"DocumentSet (\\n \" + t.join(\" \\n\") + \"\\n)\";\n }\n copy(t, e) {\n const n = new qu;\n return n.comparator = this.comparator, n.keyedMap = t, n.sortedSet = e, n;\n }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * DocumentChangeSet keeps track of a set of changes to docs in a query, merging\n * duplicate events for the same doc.\n */ class Ku {\n constructor() {\n this.yu = new Gt(dt.comparator);\n }\n track(t) {\n const e = t.doc.key, n = this.yu.get(e);\n n ? \n // Merge the new change with the existing change.\n 0 /* Added */ !== t.type && 3 /* Metadata */ === n.type ? this.yu = this.yu.insert(e, t) : 3 /* Metadata */ === t.type && 1 /* Removed */ !== n.type ? this.yu = this.yu.insert(e, {\n type: n.type,\n doc: t.doc\n }) : 2 /* Modified */ === t.type && 2 /* Modified */ === n.type ? this.yu = this.yu.insert(e, {\n type: 2 /* Modified */ ,\n doc: t.doc\n }) : 2 /* Modified */ === t.type && 0 /* Added */ === n.type ? this.yu = this.yu.insert(e, {\n type: 0 /* Added */ ,\n doc: t.doc\n }) : 1 /* Removed */ === t.type && 0 /* Added */ === n.type ? this.yu = this.yu.remove(e) : 1 /* Removed */ === t.type && 2 /* Modified */ === n.type ? this.yu = this.yu.insert(e, {\n type: 1 /* Removed */ ,\n doc: n.doc\n }) : 0 /* Added */ === t.type && 1 /* Removed */ === n.type ? this.yu = this.yu.insert(e, {\n type: 2 /* Modified */ ,\n doc: t.doc\n }) : \n // This includes these cases, which don't make sense:\n // Added->Added\n // Removed->Removed\n // Modified->Added\n // Removed->Modified\n // Metadata->Added\n // Removed->Metadata\n L() : this.yu = this.yu.insert(e, t);\n }\n pu() {\n const t = [];\n return this.yu.inorderTraversal(((e, n) => {\n t.push(n);\n })), t;\n }\n}\n\nclass Gu {\n constructor(t, e, n, s, i, r, o, u) {\n this.query = t, this.docs = e, this.oldDocs = n, this.docChanges = s, this.mutatedKeys = i, \n this.fromCache = r, this.syncStateChanged = o, this.excludesMetadataChanges = u;\n }\n /** Returns a view snapshot as if all documents in the snapshot were added. */ static fromInitialDocuments(t, e, n, s) {\n const i = [];\n return e.forEach((t => {\n i.push({\n type: 0 /* Added */ ,\n doc: t\n });\n })), new Gu(t, e, qu.emptySet(e), i, n, s, \n /* syncStateChanged= */ !0, \n /* excludesMetadataChanges= */ !1);\n }\n get hasPendingWrites() {\n return !this.mutatedKeys.isEmpty();\n }\n isEqual(t) {\n if (!(this.fromCache === t.fromCache && this.syncStateChanged === t.syncStateChanged && this.mutatedKeys.isEqual(t.mutatedKeys) && wn(this.query, t.query) && this.docs.isEqual(t.docs) && this.oldDocs.isEqual(t.oldDocs))) return !1;\n const e = this.docChanges, n = t.docChanges;\n if (e.length !== n.length) return !1;\n for (let t = 0; t < e.length; t++) if (e[t].type !== n[t].type || !e[t].doc.isEqual(n[t].doc)) return !1;\n return !0;\n }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Holds the listeners and the last received ViewSnapshot for a query being\n * tracked by EventManager.\n */ class Qu {\n constructor() {\n this.Iu = void 0, this.listeners = [];\n }\n}\n\nclass ju {\n constructor() {\n this.queries = new os((t => mn(t)), wn), this.onlineState = \"Unknown\" /* Unknown */ , \n this.Tu = new Set;\n }\n}\n\nasync function Wu(t, e) {\n const n = K(t), s = e.query;\n let i = !1, r = n.queries.get(s);\n if (r || (i = !0, r = new Qu), i) try {\n r.Iu = await n.onListen(s);\n } catch (t) {\n const n = Uu(t, `Initialization of query '${gn(e.query)}' failed`);\n return void e.onError(n);\n }\n if (n.queries.set(s, r), r.listeners.push(e), \n // Run global snapshot listeners if a consistent snapshot has been emitted.\n e.Eu(n.onlineState), r.Iu) {\n e.Au(r.Iu) && Yu(n);\n }\n}\n\nasync function zu(t, e) {\n const n = K(t), s = e.query;\n let i = !1;\n const r = n.queries.get(s);\n if (r) {\n const t = r.listeners.indexOf(e);\n t >= 0 && (r.listeners.splice(t, 1), i = 0 === r.listeners.length);\n }\n if (i) return n.queries.delete(s), n.onUnlisten(s);\n}\n\nfunction Hu(t, e) {\n const n = K(t);\n let s = !1;\n for (const t of e) {\n const e = t.query, i = n.queries.get(e);\n if (i) {\n for (const e of i.listeners) e.Au(t) && (s = !0);\n i.Iu = t;\n }\n }\n s && Yu(n);\n}\n\nfunction Ju(t, e, n) {\n const s = K(t), i = s.queries.get(e);\n if (i) for (const t of i.listeners) t.onError(n);\n // Remove all listeners. NOTE: We don't need to call syncEngine.unlisten()\n // after an error.\n s.queries.delete(e);\n}\n\n// Call all global snapshot listeners that have been set.\nfunction Yu(t) {\n t.Tu.forEach((t => {\n t.next();\n }));\n}\n\n/**\n * QueryListener takes a series of internal view snapshots and determines\n * when to raise the event.\n *\n * It uses an Observer to dispatch events.\n */ class Xu {\n constructor(t, e, n) {\n this.query = t, this.Ru = e, \n /**\n * Initial snapshots (e.g. from cache) may not be propagated to the wrapped\n * observer. This flag is set to true once we've actually raised an event.\n */\n this.bu = !1, this.Pu = null, this.onlineState = \"Unknown\" /* Unknown */ , this.options = n || {};\n }\n /**\n * Applies the new ViewSnapshot to this listener, raising a user-facing event\n * if applicable (depending on what changed, whether the user has opted into\n * metadata-only changes, etc.). Returns true if a user-facing event was\n * indeed raised.\n */ Au(t) {\n if (!this.options.includeMetadataChanges) {\n // Remove the metadata only changes.\n const e = [];\n for (const n of t.docChanges) 3 /* Metadata */ !== n.type && e.push(n);\n t = new Gu(t.query, t.docs, t.oldDocs, e, t.mutatedKeys, t.fromCache, t.syncStateChanged, \n /* excludesMetadataChanges= */ !0);\n }\n let e = !1;\n return this.bu ? this.vu(t) && (this.Ru.next(t), e = !0) : this.Vu(t, this.onlineState) && (this.Su(t), \n e = !0), this.Pu = t, e;\n }\n onError(t) {\n this.Ru.error(t);\n }\n /** Returns whether a snapshot was raised. */ Eu(t) {\n this.onlineState = t;\n let e = !1;\n return this.Pu && !this.bu && this.Vu(this.Pu, t) && (this.Su(this.Pu), e = !0), \n e;\n }\n Vu(t, e) {\n // Always raise the first event when we're synced\n if (!t.fromCache) return !0;\n // NOTE: We consider OnlineState.Unknown as online (it should become Offline\n // or Online if we wait long enough).\n const n = \"Offline\" /* Offline */ !== e;\n // Don't raise the event if we're online, aren't synced yet (checked\n // above) and are waiting for a sync.\n return (!this.options.Du || !n) && (!t.docs.isEmpty() || \"Offline\" /* Offline */ === e);\n // Raise data from cache if we have any documents or we are offline\n }\n vu(t) {\n // We don't need to handle includeDocumentMetadataChanges here because\n // the Metadata only changes have already been stripped out if needed.\n // At this point the only changes we will see are the ones we should\n // propagate.\n if (t.docChanges.length > 0) return !0;\n const e = this.Pu && this.Pu.hasPendingWrites !== t.hasPendingWrites;\n return !(!t.syncStateChanged && !e) && !0 === this.options.includeMetadataChanges;\n // Generally we should have hit one of the cases above, but it's possible\n // to get here if there were only metadata docChanges and they got\n // stripped out.\n }\n Su(t) {\n t = Gu.fromInitialDocuments(t.query, t.docs, t.mutatedKeys, t.fromCache), this.bu = !0, \n this.Ru.next(t);\n }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A complete element in the bundle stream, together with the byte length it\n * occupies in the stream.\n */ class Zu {\n constructor(t, \n // How many bytes this element takes to store in the bundle.\n e) {\n this.payload = t, this.byteLength = e;\n }\n Cu() {\n return \"metadata\" in this.payload;\n }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Helper to convert objects from bundles to model objects in the SDK.\n */ class tc {\n constructor(t) {\n this.wt = t;\n }\n Wi(t) {\n return Bs(this.wt, t);\n }\n /**\n * Converts a BundleDocument to a MutableDocument.\n */ zi(t) {\n return t.metadata.exists ? Qs(this.wt, t.document, !1) : ke.newNoDocument(this.Wi(t.metadata.name), this.Hi(t.metadata.readTime));\n }\n Hi(t) {\n return Ms(t);\n }\n}\n\n/**\n * A class to process the elements from a bundle, load them into local\n * storage and provide progress update while loading.\n */ class ec {\n constructor(t, e, n) {\n this.xu = t, this.localStore = e, this.wt = n, \n /** Batched queries to be saved into storage */\n this.queries = [], \n /** Batched documents to be saved into storage */\n this.documents = [], \n /** The collection groups affected by this bundle. */\n this.collectionGroups = new Set, this.progress = nc(t);\n }\n /**\n * Adds an element from the bundle to the loader.\n *\n * Returns a new progress if adding the element leads to a new progress,\n * otherwise returns null.\n */ Nu(t) {\n this.progress.bytesLoaded += t.byteLength;\n let e = this.progress.documentsLoaded;\n if (t.payload.namedQuery) this.queries.push(t.payload.namedQuery); else if (t.payload.documentMetadata) {\n this.documents.push({\n metadata: t.payload.documentMetadata\n }), t.payload.documentMetadata.exists || ++e;\n const n = ht.fromString(t.payload.documentMetadata.name);\n this.collectionGroups.add(n.get(n.length - 2));\n } else t.payload.document && (this.documents[this.documents.length - 1].document = t.payload.document, \n ++e);\n return e !== this.progress.documentsLoaded ? (this.progress.documentsLoaded = e, \n Object.assign({}, this.progress)) : null;\n }\n ku(t) {\n const e = new Map, n = new tc(this.wt);\n for (const s of t) if (s.metadata.queries) {\n const t = n.Wi(s.metadata.name);\n for (const n of s.metadata.queries) {\n const s = (e.get(n) || gs()).add(t);\n e.set(n, s);\n }\n }\n return e;\n }\n /**\n * Update the progress to 'Success' and return the updated progress.\n */ async complete() {\n const t = await Bo(this.localStore, new tc(this.wt), this.documents, this.xu.id), e = this.ku(this.documents);\n for (const t of this.queries) await Lo(this.localStore, t, e.get(t.name));\n return this.progress.taskState = \"Success\", {\n progress: this.progress,\n Mu: this.collectionGroups,\n Ou: t\n };\n }\n}\n\n/**\n * Returns a `LoadBundleTaskProgress` representing the initial progress of\n * loading a bundle.\n */ function nc(t) {\n return {\n taskState: \"Running\",\n documentsLoaded: 0,\n bytesLoaded: 0,\n totalDocuments: t.totalDocuments,\n totalBytes: t.totalBytes\n };\n}\n\n/**\n * Returns a `LoadBundleTaskProgress` representing the progress that the loading\n * has succeeded.\n */\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nclass sc {\n constructor(t) {\n this.key = t;\n }\n}\n\nclass ic {\n constructor(t) {\n this.key = t;\n }\n}\n\n/**\n * View is responsible for computing the final merged truth of what docs are in\n * a query. It gets notified of local and remote changes to docs, and applies\n * the query filters and limits to determine the most correct possible results.\n */ class rc {\n constructor(t, \n /** Documents included in the remote target */\n e) {\n this.query = t, this.Fu = e, this.$u = null, \n /**\n * A flag whether the view is current with the backend. A view is considered\n * current after it has seen the current flag from the backend and did not\n * lose consistency within the watch stream (e.g. because of an existence\n * filter mismatch).\n */\n this.current = !1, \n /** Documents in the view but not in the remote target */\n this.Bu = gs(), \n /** Document Keys that have local changes */\n this.mutatedKeys = gs(), this.Lu = In(t), this.Uu = new qu(this.Lu);\n }\n /**\n * The set of remote documents that the server has told us belongs to the target associated with\n * this view.\n */ get qu() {\n return this.Fu;\n }\n /**\n * Iterates over a set of doc changes, applies the query limit, and computes\n * what the new results should be, what the changes were, and whether we may\n * need to go back to the local cache for more results. Does not make any\n * changes to the view.\n * @param docChanges - The doc changes to apply to this view.\n * @param previousChanges - If this is being called with a refill, then start\n * with this set of docs and changes instead of the current view.\n * @returns a new set of docs, changes, and refill flag.\n */ Ku(t, e) {\n const n = e ? e.Gu : new Ku, s = e ? e.Uu : this.Uu;\n let i = e ? e.mutatedKeys : this.mutatedKeys, r = s, o = !1;\n // Track the last doc in a (full) limit. This is necessary, because some\n // update (a delete, or an update moving a doc past the old limit) might\n // mean there is some other document in the local cache that either should\n // come (1) between the old last limit doc and the new last document, in the\n // case of updates, or (2) after the new last document, in the case of\n // deletes. So we keep this doc at the old limit to compare the updates to.\n // Note that this should never get used in a refill (when previousChanges is\n // set), because there will only be adds -- no deletes or updates.\n const u = \"F\" /* First */ === this.query.limitType && s.size === this.query.limit ? s.last() : null, c = \"L\" /* Last */ === this.query.limitType && s.size === this.query.limit ? s.first() : null;\n // Drop documents out to meet limit/limitToLast requirement.\n if (t.inorderTraversal(((t, e) => {\n const a = s.get(t), h = yn(this.query, e) ? e : null, l = !!a && this.mutatedKeys.has(a.key), f = !!h && (h.hasLocalMutations || \n // We only consider committed mutations for documents that were\n // mutated during the lifetime of the view.\n this.mutatedKeys.has(h.key) && h.hasCommittedMutations);\n let d = !1;\n // Calculate change\n if (a && h) {\n a.data.isEqual(h.data) ? l !== f && (n.track({\n type: 3 /* Metadata */ ,\n doc: h\n }), d = !0) : this.Qu(a, h) || (n.track({\n type: 2 /* Modified */ ,\n doc: h\n }), d = !0, (u && this.Lu(h, u) > 0 || c && this.Lu(h, c) < 0) && (\n // This doc moved from inside the limit to outside the limit.\n // That means there may be some other doc in the local cache\n // that should be included instead.\n o = !0));\n } else !a && h ? (n.track({\n type: 0 /* Added */ ,\n doc: h\n }), d = !0) : a && !h && (n.track({\n type: 1 /* Removed */ ,\n doc: a\n }), d = !0, (u || c) && (\n // A doc was removed from a full limit query. We'll need to\n // requery from the local cache to see if we know about some other\n // doc that should be in the results.\n o = !0));\n d && (h ? (r = r.add(h), i = f ? i.add(t) : i.delete(t)) : (r = r.delete(t), i = i.delete(t)));\n })), null !== this.query.limit) for (;r.size > this.query.limit; ) {\n const t = \"F\" /* First */ === this.query.limitType ? r.last() : r.first();\n r = r.delete(t.key), i = i.delete(t.key), n.track({\n type: 1 /* Removed */ ,\n doc: t\n });\n }\n return {\n Uu: r,\n Gu: n,\n Mi: o,\n mutatedKeys: i\n };\n }\n Qu(t, e) {\n // We suppress the initial change event for documents that were modified as\n // part of a write acknowledgment (e.g. when the value of a server transform\n // is applied) as Watch will send us the same document again.\n // By suppressing the event, we only raise two user visible events (one with\n // `hasPendingWrites` and the final state of the document) instead of three\n // (one with `hasPendingWrites`, the modified document with\n // `hasPendingWrites` and the final state of the document).\n return t.hasLocalMutations && e.hasCommittedMutations && !e.hasLocalMutations;\n }\n /**\n * Updates the view with the given ViewDocumentChanges and optionally updates\n * limbo docs and sync state from the provided target change.\n * @param docChanges - The set of changes to make to the view's docs.\n * @param updateLimboDocuments - Whether to update limbo documents based on\n * this change.\n * @param targetChange - A target change to apply for computing limbo docs and\n * sync state.\n * @returns A new ViewChange with the given docs, changes, and sync state.\n */\n // PORTING NOTE: The iOS/Android clients always compute limbo document changes.\n applyChanges(t, e, n) {\n const s = this.Uu;\n this.Uu = t.Uu, this.mutatedKeys = t.mutatedKeys;\n // Sort changes based on type and query comparator\n const i = t.Gu.pu();\n i.sort(((t, e) => function(t, e) {\n const n = t => {\n switch (t) {\n case 0 /* Added */ :\n return 1;\n\n case 2 /* Modified */ :\n case 3 /* Metadata */ :\n // A metadata change is converted to a modified change at the public\n // api layer. Since we sort by document key and then change type,\n // metadata and modified changes must be sorted equivalently.\n return 2;\n\n case 1 /* Removed */ :\n return 0;\n\n default:\n return L();\n }\n };\n return n(t) - n(e);\n }\n /**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ (t.type, e.type) || this.Lu(t.doc, e.doc))), this.ju(n);\n const r = e ? this.Wu() : [], o = 0 === this.Bu.size && this.current ? 1 /* Synced */ : 0 /* Local */ , u = o !== this.$u;\n if (this.$u = o, 0 !== i.length || u) {\n return {\n snapshot: new Gu(this.query, t.Uu, s, i, t.mutatedKeys, 0 /* Local */ === o, u, \n /* excludesMetadataChanges= */ !1),\n zu: r\n };\n }\n // no changes\n return {\n zu: r\n };\n }\n /**\n * Applies an OnlineState change to the view, potentially generating a\n * ViewChange if the view's syncState changes as a result.\n */ Eu(t) {\n return this.current && \"Offline\" /* Offline */ === t ? (\n // If we're offline, set `current` to false and then call applyChanges()\n // to refresh our syncState and generate a ViewChange as appropriate. We\n // are guaranteed to get a new TargetChange that sets `current` back to\n // true once the client is back online.\n this.current = !1, this.applyChanges({\n Uu: this.Uu,\n Gu: new Ku,\n mutatedKeys: this.mutatedKeys,\n Mi: !1\n }, \n /* updateLimboDocuments= */ !1)) : {\n zu: []\n };\n }\n /**\n * Returns whether the doc for the given key should be in limbo.\n */ Hu(t) {\n // If the remote end says it's part of this query, it's not in limbo.\n return !this.Fu.has(t) && (\n // The local store doesn't think it's a result, so it shouldn't be in limbo.\n !!this.Uu.has(t) && !this.Uu.get(t).hasLocalMutations);\n }\n /**\n * Updates syncedDocuments, current, and limbo docs based on the given change.\n * Returns the list of changes to which docs are in limbo.\n */ ju(t) {\n t && (t.addedDocuments.forEach((t => this.Fu = this.Fu.add(t))), t.modifiedDocuments.forEach((t => {})), \n t.removedDocuments.forEach((t => this.Fu = this.Fu.delete(t))), this.current = t.current);\n }\n Wu() {\n // We can only determine limbo documents when we're in-sync with the server.\n if (!this.current) return [];\n // TODO(klimt): Do this incrementally so that it's not quadratic when\n // updating many documents.\n const t = this.Bu;\n this.Bu = gs(), this.Uu.forEach((t => {\n this.Hu(t.key) && (this.Bu = this.Bu.add(t.key));\n }));\n // Diff the new limbo docs with the old limbo docs.\n const e = [];\n return t.forEach((t => {\n this.Bu.has(t) || e.push(new ic(t));\n })), this.Bu.forEach((n => {\n t.has(n) || e.push(new sc(n));\n })), e;\n }\n /**\n * Update the in-memory state of the current view with the state read from\n * persistence.\n *\n * We update the query view whenever a client's primary status changes:\n * - When a client transitions from primary to secondary, it can miss\n * LocalStorage updates and its query views may temporarily not be\n * synchronized with the state on disk.\n * - For secondary to primary transitions, the client needs to update the list\n * of `syncedDocuments` since secondary clients update their query views\n * based purely on synthesized RemoteEvents.\n *\n * @param queryResult.documents - The documents that match the query according\n * to the LocalStore.\n * @param queryResult.remoteKeys - The keys of the documents that match the\n * query according to the backend.\n *\n * @returns The ViewChange that resulted from this synchronization.\n */\n // PORTING NOTE: Multi-tab only.\n Ju(t) {\n this.Fu = t.ji, this.Bu = gs();\n const e = this.Ku(t.documents);\n return this.applyChanges(e, /*updateLimboDocuments=*/ !0);\n }\n /**\n * Returns a view snapshot as if this query was just listened to. Contains\n * a document add for every existing document and the `fromCache` and\n * `hasPendingWrites` status of the already established view.\n */\n // PORTING NOTE: Multi-tab only.\n Yu() {\n return Gu.fromInitialDocuments(this.query, this.Uu, this.mutatedKeys, 0 /* Local */ === this.$u);\n }\n}\n\n/**\n * QueryView contains all of the data that SyncEngine needs to keep track of for\n * a particular query.\n */\nclass oc {\n constructor(\n /**\n * The query itself.\n */\n t, \n /**\n * The target number created by the client that is used in the watch\n * stream to identify this query.\n */\n e, \n /**\n * The view is responsible for computing the final merged truth of what\n * docs are in the query. It gets notified of local and remote changes,\n * and applies the query filters and limits to determine the most correct\n * possible results.\n */\n n) {\n this.query = t, this.targetId = e, this.view = n;\n }\n}\n\n/** Tracks a limbo resolution. */ class uc {\n constructor(t) {\n this.key = t, \n /**\n * Set to true once we've received a document. This is used in\n * getRemoteKeysForTarget() and ultimately used by WatchChangeAggregator to\n * decide whether it needs to manufacture a delete event for the target once\n * the target is CURRENT.\n */\n this.Xu = !1;\n }\n}\n\n/**\n * An implementation of `SyncEngine` coordinating with other parts of SDK.\n *\n * The parts of SyncEngine that act as a callback to RemoteStore need to be\n * registered individually. This is done in `syncEngineWrite()` and\n * `syncEngineListen()` (as well as `applyPrimaryState()`) as these methods\n * serve as entry points to RemoteStore's functionality.\n *\n * Note: some field defined in this class might have public access level, but\n * the class is not exported so they are only accessible from this module.\n * This is useful to implement optional features (like bundles) in free\n * functions, such that they are tree-shakeable.\n */ class cc {\n constructor(t, e, n, \n // PORTING NOTE: Manages state synchronization in multi-tab environments.\n s, i, r) {\n this.localStore = t, this.remoteStore = e, this.eventManager = n, this.sharedClientState = s, \n this.currentUser = i, this.maxConcurrentLimboResolutions = r, this.Zu = {}, this.tc = new os((t => mn(t)), wn), \n this.ec = new Map, \n /**\n * The keys of documents that are in limbo for which we haven't yet started a\n * limbo resolution query. The strings in this set are the result of calling\n * `key.path.canonicalString()` where `key` is a `DocumentKey` object.\n *\n * The `Set` type was chosen because it provides efficient lookup and removal\n * of arbitrary elements and it also maintains insertion order, providing the\n * desired queue-like FIFO semantics.\n */\n this.nc = new Set, \n /**\n * Keeps track of the target ID for each document that is in limbo with an\n * active target.\n */\n this.sc = new Gt(dt.comparator), \n /**\n * Keeps track of the information about an active limbo resolution for each\n * active target ID that was started for the purpose of limbo resolution.\n */\n this.ic = new Map, this.rc = new oo, \n /** Stores user completion handlers, indexed by User and BatchId. */\n this.oc = {}, \n /** Stores user callbacks waiting for all pending writes to be acknowledged. */\n this.uc = new Map, this.cc = Or.Rn(), this.onlineState = \"Unknown\" /* Unknown */ , \n // The primary state is set to `true` or `false` immediately after Firestore\n // startup. In the interim, a client should only be considered primary if\n // `isPrimary` is true.\n this.ac = void 0;\n }\n get isPrimaryClient() {\n return !0 === this.ac;\n }\n}\n\n/**\n * Initiates the new listen, resolves promise when listen enqueued to the\n * server. All the subsequent view snapshots or errors are sent to the\n * subscribed handlers. Returns the initial snapshot.\n */\nasync function ac(t, e) {\n const n = $c(t);\n let s, i;\n const r = n.tc.get(e);\n if (r) \n // PORTING NOTE: With Multi-Tab Web, it is possible that a query view\n // already exists when EventManager calls us for the first time. This\n // happens when the primary tab is already listening to this query on\n // behalf of another tab and the user of the primary also starts listening\n // to the query. EventManager will not have an assigned target ID in this\n // case and calls `listen` to obtain this ID.\n s = r.targetId, n.sharedClientState.addLocalQueryTarget(s), i = r.view.Yu(); else {\n const t = await No(n.localStore, dn(e));\n n.isPrimaryClient && _u(n.remoteStore, t);\n const r = n.sharedClientState.addLocalQueryTarget(t.targetId);\n s = t.targetId, i = await hc(n, e, s, \"current\" === r);\n }\n return i;\n}\n\n/**\n * Registers a view for a previously unknown query and computes its initial\n * snapshot.\n */ async function hc(t, e, n, s) {\n // PORTING NOTE: On Web only, we inject the code that registers new Limbo\n // targets based on view changes. This allows us to only depend on Limbo\n // changes when user code includes queries.\n t.hc = (e, n, s) => async function(t, e, n, s) {\n let i = e.view.Ku(n);\n i.Mi && (\n // The query has a limit and some docs were removed, so we need\n // to re-run the query against the local store to make sure we\n // didn't lose any good docs that had been past the limit.\n i = await Mo(t.localStore, e.query, \n /* usePreviousResults= */ !1).then((({documents: t}) => e.view.Ku(t, i))));\n const r = s && s.targetChanges.get(e.targetId), o = e.view.applyChanges(i, \n /* updateLimboDocuments= */ t.isPrimaryClient, r);\n return Ac(t, e.targetId, o.zu), o.snapshot;\n }(t, e, n, s);\n const i = await Mo(t.localStore, e, \n /* usePreviousResults= */ !0), r = new rc(e, i.ji), o = r.Ku(i.documents), u = Ts.createSynthesizedTargetChangeForCurrentChange(n, s && \"Offline\" /* Offline */ !== t.onlineState), c = r.applyChanges(o, \n /* updateLimboDocuments= */ t.isPrimaryClient, u);\n Ac(t, n, c.zu);\n const a = new oc(e, n, r);\n return t.tc.set(e, a), t.ec.has(n) ? t.ec.get(n).push(e) : t.ec.set(n, [ e ]), c.snapshot;\n}\n\n/** Stops listening to the query. */ async function lc(t, e) {\n const n = K(t), s = n.tc.get(e), i = n.ec.get(s.targetId);\n if (i.length > 1) return n.ec.set(s.targetId, i.filter((t => !wn(t, e)))), void n.tc.delete(e);\n // No other queries are mapped to the target, clean up the query and the target.\n if (n.isPrimaryClient) {\n // We need to remove the local query target first to allow us to verify\n // whether any other client is still interested in this target.\n n.sharedClientState.removeLocalQueryTarget(s.targetId);\n n.sharedClientState.isActiveQueryTarget(s.targetId) || await ko(n.localStore, s.targetId, \n /*keepPersistedTargetData=*/ !1).then((() => {\n n.sharedClientState.clearQueryState(s.targetId), wu(n.remoteStore, s.targetId), \n Tc(n, s.targetId);\n })).catch(vt);\n } else Tc(n, s.targetId), await ko(n.localStore, s.targetId, \n /*keepPersistedTargetData=*/ !0);\n}\n\n/**\n * Initiates the write of local mutation batch which involves adding the\n * writes to the mutation queue, notifying the remote store about new\n * mutations and raising events for any changes this write caused.\n *\n * The promise returned by this call is resolved when the above steps\n * have completed, *not* when the write was acked by the backend. The\n * userCallback is resolved once the write was acked/rejected by the\n * backend (or failed locally for any other reason).\n */ async function fc(t, e, n) {\n const s = Bc(t);\n try {\n const t = await function(t, e) {\n const n = K(t), s = ut.now(), i = e.reduce(((t, e) => t.add(e.key)), gs());\n let r, o;\n return n.persistence.runTransaction(\"Locally write mutations\", \"readwrite\", (t => {\n // Figure out which keys do not have a remote version in the cache, this\n // is needed to create the right overlay mutation: if no remote version\n // presents, we do not need to create overlays as patch mutations.\n // TODO(Overlay): Is there a better way to determine this? Using the\n // document version does not work because local mutations set them back\n // to 0.\n let u = cs(), c = gs();\n return n.Ui.getEntries(t, i).next((t => {\n u = t, u.forEach(((t, e) => {\n e.isValidDocument() || (c = c.add(t));\n }));\n })).next((() => n.localDocuments.getOverlayedDocuments(t, u))).next((i => {\n r = i;\n // For non-idempotent mutations (such as `FieldValue.increment()`),\n // we record the base state in a separate patch mutation. This is\n // later used to guarantee consistent values and prevents flicker\n // even if the backend sends us an update that already includes our\n // transform.\n const o = [];\n for (const t of e) {\n const e = jn(t, r.get(t.key).overlayedDocument);\n null != e && \n // NOTE: The base state should only be applied if there's some\n // existing document to override, so use a Precondition of\n // exists=true\n o.push(new Hn(t.key, e, Ne(e.value.mapValue), Ln.exists(!0)));\n }\n return n.mutationQueue.addMutationBatch(t, s, o, e);\n })).next((e => {\n o = e;\n const s = e.applyToLocalDocumentSet(r, c);\n return n.documentOverlayCache.saveOverlays(t, e.batchId, s);\n }));\n })).then((() => ({\n batchId: o.batchId,\n changes: ls(r)\n })));\n }(s.localStore, e);\n s.sharedClientState.addPendingMutation(t.batchId), function(t, e, n) {\n let s = t.oc[t.currentUser.toKey()];\n s || (s = new Gt(it));\n s = s.insert(e, n), t.oc[t.currentUser.toKey()] = s;\n }\n /**\n * Resolves or rejects the user callback for the given batch and then discards\n * it.\n */ (s, t.batchId, n), await Pc(s, t.changes), await vu(s.remoteStore);\n } catch (t) {\n // If we can't persist the mutation, we reject the user callback and\n // don't send the mutation. The user can then retry the write.\n const e = Uu(t, \"Failed to persist write\");\n n.reject(e);\n }\n}\n\n/**\n * Applies one remote event to the sync engine, notifying any views of the\n * changes, and releasing any pending mutation batches that would become\n * visible because of the snapshot version the remote event contains.\n */ async function dc(t, e) {\n const n = K(t);\n try {\n const t = await Do(n.localStore, e);\n // Update `receivedDocument` as appropriate for any limbo targets.\n e.targetChanges.forEach(((t, e) => {\n const s = n.ic.get(e);\n s && (\n // Since this is a limbo resolution lookup, it's for a single document\n // and it could be added, modified, or removed, but not a combination.\n U(t.addedDocuments.size + t.modifiedDocuments.size + t.removedDocuments.size <= 1), \n t.addedDocuments.size > 0 ? s.Xu = !0 : t.modifiedDocuments.size > 0 ? U(s.Xu) : t.removedDocuments.size > 0 && (U(s.Xu), \n s.Xu = !1));\n })), await Pc(n, t, e);\n } catch (t) {\n await vt(t);\n }\n}\n\n/**\n * Applies an OnlineState change to the sync engine and notifies any views of\n * the change.\n */ function _c(t, e, n) {\n const s = K(t);\n // If we are the secondary client, we explicitly ignore the remote store's\n // online state (the local client may go offline, even though the primary\n // tab remains online) and only apply the primary tab's online state from\n // SharedClientState.\n if (s.isPrimaryClient && 0 /* RemoteStore */ === n || !s.isPrimaryClient && 1 /* SharedClientState */ === n) {\n const t = [];\n s.tc.forEach(((n, s) => {\n const i = s.view.Eu(e);\n i.snapshot && t.push(i.snapshot);\n })), function(t, e) {\n const n = K(t);\n n.onlineState = e;\n let s = !1;\n n.queries.forEach(((t, n) => {\n for (const t of n.listeners) \n // Run global snapshot listeners if a consistent snapshot has been emitted.\n t.Eu(e) && (s = !0);\n })), s && Yu(n);\n }(s.eventManager, e), t.length && s.Zu.Go(t), s.onlineState = e, s.isPrimaryClient && s.sharedClientState.setOnlineState(e);\n }\n}\n\n/**\n * Rejects the listen for the given targetID. This can be triggered by the\n * backend for any active target.\n *\n * @param syncEngine - The sync engine implementation.\n * @param targetId - The targetID corresponds to one previously initiated by the\n * user as part of TargetData passed to listen() on RemoteStore.\n * @param err - A description of the condition that has forced the rejection.\n * Nearly always this will be an indication that the user is no longer\n * authorized to see the data matching the target.\n */ async function wc(t, e, n) {\n const s = K(t);\n // PORTING NOTE: Multi-tab only.\n s.sharedClientState.updateQueryState(e, \"rejected\", n);\n const i = s.ic.get(e), r = i && i.key;\n if (r) {\n // TODO(klimt): We really only should do the following on permission\n // denied errors, but we don't have the cause code here.\n // It's a limbo doc. Create a synthetic event saying it was deleted.\n // This is kind of a hack. Ideally, we would have a method in the local\n // store to purge a document. However, it would be tricky to keep all of\n // the local store's invariants with another method.\n let t = new Gt(dt.comparator);\n // TODO(b/217189216): This limbo document should ideally have a read time,\n // so that it is picked up by any read-time based scans. The backend,\n // however, does not send a read time for target removals.\n t = t.insert(r, ke.newNoDocument(r, ct.min()));\n const n = gs().add(r), i = new Is(ct.min(), \n /* targetChanges= */ new Map, \n /* targetMismatches= */ new Wt(it), t, n);\n await dc(s, i), \n // Since this query failed, we won't want to manually unlisten to it.\n // We only remove it from bookkeeping after we successfully applied the\n // RemoteEvent. If `applyRemoteEvent()` throws, we want to re-listen to\n // this query when the RemoteStore restarts the Watch stream, which should\n // re-trigger the target failure.\n s.sc = s.sc.remove(r), s.ic.delete(e), bc(s);\n } else await ko(s.localStore, e, \n /* keepPersistedTargetData */ !1).then((() => Tc(s, e, n))).catch(vt);\n}\n\nasync function mc(t, e) {\n const n = K(t), s = e.batch.batchId;\n try {\n const t = await Vo(n.localStore, e);\n // The local store may or may not be able to apply the write result and\n // raise events immediately (depending on whether the watcher is caught\n // up), so we raise user callbacks first so that they consistently happen\n // before listen events.\n Ic(n, s, /*error=*/ null), pc(n, s), n.sharedClientState.updateMutationState(s, \"acknowledged\"), \n await Pc(n, t);\n } catch (t) {\n await vt(t);\n }\n}\n\nasync function gc(t, e, n) {\n const s = K(t);\n try {\n const t = await function(t, e) {\n const n = K(t);\n return n.persistence.runTransaction(\"Reject batch\", \"readwrite-primary\", (t => {\n let s;\n return n.mutationQueue.lookupMutationBatch(t, e).next((e => (U(null !== e), s = e.keys(), \n n.mutationQueue.removeMutationBatch(t, e)))).next((() => n.mutationQueue.performConsistencyCheck(t))).next((() => n.documentOverlayCache.removeOverlaysForBatchId(t, s, e))).next((() => n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(t, s))).next((() => n.localDocuments.getDocuments(t, s)));\n }));\n }\n /**\n * Returns the largest (latest) batch id in mutation queue that is pending\n * server response.\n *\n * Returns `BATCHID_UNKNOWN` if the queue is empty.\n */ (s.localStore, e);\n // The local store may or may not be able to apply the write result and\n // raise events immediately (depending on whether the watcher is caught up),\n // so we raise user callbacks first so that they consistently happen before\n // listen events.\n Ic(s, e, n), pc(s, e), s.sharedClientState.updateMutationState(e, \"rejected\", n), \n await Pc(s, t);\n } catch (n) {\n await vt(n);\n }\n}\n\n/**\n * Registers a user callback that resolves when all pending mutations at the moment of calling\n * are acknowledged .\n */ async function yc(t, e) {\n const n = K(t);\n Iu(n.remoteStore) || O(\"SyncEngine\", \"The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled.\");\n try {\n const t = await function(t) {\n const e = K(t);\n return e.persistence.runTransaction(\"Get highest unacknowledged batch id\", \"readonly\", (t => e.mutationQueue.getHighestUnacknowledgedBatchId(t)));\n }(n.localStore);\n if (-1 === t) \n // Trigger the callback right away if there is no pending writes at the moment.\n return void e.resolve();\n const s = n.uc.get(t) || [];\n s.push(e), n.uc.set(t, s);\n } catch (t) {\n const n = Uu(t, \"Initialization of waitForPendingWrites() operation failed\");\n e.reject(n);\n }\n}\n\n/**\n * Triggers the callbacks that are waiting for this batch id to get acknowledged by server,\n * if there are any.\n */ function pc(t, e) {\n (t.uc.get(e) || []).forEach((t => {\n t.resolve();\n })), t.uc.delete(e);\n}\n\n/** Reject all outstanding callbacks waiting for pending writes to complete. */ function Ic(t, e, n) {\n const s = K(t);\n let i = s.oc[s.currentUser.toKey()];\n // NOTE: Mutations restored from persistence won't have callbacks, so it's\n // okay for there to be no callback for this ID.\n if (i) {\n const t = i.get(e);\n t && (n ? t.reject(n) : t.resolve(), i = i.remove(e)), s.oc[s.currentUser.toKey()] = i;\n }\n}\n\nfunction Tc(t, e, n = null) {\n t.sharedClientState.removeLocalQueryTarget(e);\n for (const s of t.ec.get(e)) t.tc.delete(s), n && t.Zu.lc(s, n);\n if (t.ec.delete(e), t.isPrimaryClient) {\n t.rc.us(e).forEach((e => {\n t.rc.containsKey(e) || \n // We removed the last reference for this key\n Ec(t, e);\n }));\n }\n}\n\nfunction Ec(t, e) {\n t.nc.delete(e.path.canonicalString());\n // It's possible that the target already got removed because the query failed. In that case,\n // the key won't exist in `limboTargetsByKey`. Only do the cleanup if we still have the target.\n const n = t.sc.get(e);\n null !== n && (wu(t.remoteStore, n), t.sc = t.sc.remove(e), t.ic.delete(n), bc(t));\n}\n\nfunction Ac(t, e, n) {\n for (const s of n) if (s instanceof sc) t.rc.addReference(s.key, e), Rc(t, s); else if (s instanceof ic) {\n O(\"SyncEngine\", \"Document no longer in limbo: \" + s.key), t.rc.removeReference(s.key, e);\n t.rc.containsKey(s.key) || \n // We removed the last reference for this key\n Ec(t, s.key);\n } else L();\n}\n\nfunction Rc(t, e) {\n const n = e.key, s = n.path.canonicalString();\n t.sc.get(n) || t.nc.has(s) || (O(\"SyncEngine\", \"New document in limbo: \" + n), t.nc.add(s), \n bc(t));\n}\n\n/**\n * Starts listens for documents in limbo that are enqueued for resolution,\n * subject to a maximum number of concurrent resolutions.\n *\n * Without bounding the number of concurrent resolutions, the server can fail\n * with \"resource exhausted\" errors which can lead to pathological client\n * behavior as seen in https://github.com/firebase/firebase-js-sdk/issues/2683.\n */ function bc(t) {\n for (;t.nc.size > 0 && t.sc.size < t.maxConcurrentLimboResolutions; ) {\n const e = t.nc.values().next().value;\n t.nc.delete(e);\n const n = new dt(ht.fromString(e)), s = t.cc.next();\n t.ic.set(s, new uc(n)), t.sc = t.sc.insert(n, s), _u(t.remoteStore, new qi(dn(un(n.path)), s, 2 /* LimboResolution */ , Lt.ot));\n }\n}\n\nasync function Pc(t, e, n) {\n const s = K(t), i = [], r = [], o = [];\n s.tc.isEmpty() || (s.tc.forEach(((t, u) => {\n o.push(s.hc(u, e, n).then((t => {\n if (t) {\n s.isPrimaryClient && s.sharedClientState.updateQueryState(u.targetId, t.fromCache ? \"not-current\" : \"current\"), \n i.push(t);\n const e = Ao.Vi(u.targetId, t);\n r.push(e);\n }\n })));\n })), await Promise.all(o), s.Zu.Go(i), await async function(t, e) {\n const n = K(t);\n try {\n await n.persistence.runTransaction(\"notifyLocalViewChanges\", \"readwrite\", (t => Vt.forEach(e, (e => Vt.forEach(e.Pi, (s => n.persistence.referenceDelegate.addReference(t, e.targetId, s))).next((() => Vt.forEach(e.vi, (s => n.persistence.referenceDelegate.removeReference(t, e.targetId, s)))))))));\n } catch (t) {\n if (!Nt(t)) throw t;\n // If `notifyLocalViewChanges` fails, we did not advance the sequence\n // number for the documents that were included in this transaction.\n // This might trigger them to be deleted earlier than they otherwise\n // would have, but it should not invalidate the integrity of the data.\n O(\"LocalStore\", \"Failed to update sequence numbers: \" + t);\n }\n for (const t of e) {\n const e = t.targetId;\n if (!t.fromCache) {\n const t = n.$i.get(e), s = t.snapshotVersion, i = t.withLastLimboFreeSnapshotVersion(s);\n // Advance the last limbo free snapshot version\n n.$i = n.$i.insert(e, i);\n }\n }\n }(s.localStore, r));\n}\n\nasync function vc(t, e) {\n const n = K(t);\n if (!n.currentUser.isEqual(e)) {\n O(\"SyncEngine\", \"User change. New user:\", e.toKey());\n const t = await vo(n.localStore, e);\n n.currentUser = e, \n // Fails tasks waiting for pending writes requested by previous user.\n function(t, e) {\n t.uc.forEach((t => {\n t.forEach((t => {\n t.reject(new Q(G.CANCELLED, e));\n }));\n })), t.uc.clear();\n }(n, \"'waitForPendingWrites' promise is rejected due to a user change.\"), \n // TODO(b/114226417): Consider calling this only in the primary tab.\n n.sharedClientState.handleUserChange(e, t.removedBatchIds, t.addedBatchIds), await Pc(n, t.Ki);\n }\n}\n\nfunction Vc(t, e) {\n const n = K(t), s = n.ic.get(e);\n if (s && s.Xu) return gs().add(s.key);\n {\n let t = gs();\n const s = n.ec.get(e);\n if (!s) return t;\n for (const e of s) {\n const s = n.tc.get(e);\n t = t.unionWith(s.view.qu);\n }\n return t;\n }\n}\n\n/**\n * Reconcile the list of synced documents in an existing view with those\n * from persistence.\n */ async function Sc(t, e) {\n const n = K(t), s = await Mo(n.localStore, e.query, \n /* usePreviousResults= */ !0), i = e.view.Ju(s);\n return n.isPrimaryClient && Ac(n, e.targetId, i.zu), i;\n}\n\n/**\n * Retrieves newly changed documents from remote document cache and raises\n * snapshots if needed.\n */\n// PORTING NOTE: Multi-Tab only.\nasync function Dc(t, e) {\n const n = K(t);\n return Fo(n.localStore, e).then((t => Pc(n, t)));\n}\n\n/** Applies a mutation state to an existing batch. */\n// PORTING NOTE: Multi-Tab only.\nasync function Cc(t, e, n, s) {\n const i = K(t), r = await function(t, e) {\n const n = K(t), s = K(n.mutationQueue);\n return n.persistence.runTransaction(\"Lookup mutation documents\", \"readonly\", (t => s.yn(t, e).next((e => e ? n.localDocuments.getDocuments(t, e) : Vt.resolve(null)))));\n }\n // PORTING NOTE: Multi-Tab only.\n (i.localStore, e);\n null !== r ? (\"pending\" === n ? \n // If we are the primary client, we need to send this write to the\n // backend. Secondary clients will ignore these writes since their remote\n // connection is disabled.\n await vu(i.remoteStore) : \"acknowledged\" === n || \"rejected\" === n ? (\n // NOTE: Both these methods are no-ops for batches that originated from\n // other clients.\n Ic(i, e, s || null), pc(i, e), function(t, e) {\n K(K(t).mutationQueue).In(e);\n }\n // PORTING NOTE: Multi-Tab only.\n (i.localStore, e)) : L(), await Pc(i, r)) : \n // A throttled tab may not have seen the mutation before it was completed\n // and removed from the mutation queue, in which case we won't have cached\n // the affected documents. In this case we can safely ignore the update\n // since that means we didn't apply the mutation locally at all (if we\n // had, we would have cached the affected documents), and so we will just\n // see any resulting document changes via normal remote document updates\n // as applicable.\n O(\"SyncEngine\", \"Cannot apply mutation batch with id: \" + e);\n}\n\n/** Applies a query target change from a different tab. */\n// PORTING NOTE: Multi-Tab only.\nasync function xc(t, e) {\n const n = K(t);\n if ($c(n), Bc(n), !0 === e && !0 !== n.ac) {\n // Secondary tabs only maintain Views for their local listeners and the\n // Views internal state may not be 100% populated (in particular\n // secondary tabs don't track syncedDocuments, the set of documents the\n // server considers to be in the target). So when a secondary becomes\n // primary, we need to need to make sure that all views for all targets\n // match the state on disk.\n const t = n.sharedClientState.getAllActiveQueryTargets(), e = await Nc(n, t.toArray());\n n.ac = !0, await Fu(n.remoteStore, !0);\n for (const t of e) _u(n.remoteStore, t);\n } else if (!1 === e && !1 !== n.ac) {\n const t = [];\n let e = Promise.resolve();\n n.ec.forEach(((s, i) => {\n n.sharedClientState.isLocalQueryTarget(i) ? t.push(i) : e = e.then((() => (Tc(n, i), \n ko(n.localStore, i, \n /*keepPersistedTargetData=*/ !0)))), wu(n.remoteStore, i);\n })), await e, await Nc(n, t), \n // PORTING NOTE: Multi-Tab only.\n function(t) {\n const e = K(t);\n e.ic.forEach(((t, n) => {\n wu(e.remoteStore, n);\n })), e.rc.cs(), e.ic = new Map, e.sc = new Gt(dt.comparator);\n }\n /**\n * Reconcile the query views of the provided query targets with the state from\n * persistence. Raises snapshots for any changes that affect the local\n * client and returns the updated state of all target's query data.\n *\n * @param syncEngine - The sync engine implementation\n * @param targets - the list of targets with views that need to be recomputed\n * @param transitionToPrimary - `true` iff the tab transitions from a secondary\n * tab to a primary tab\n */\n // PORTING NOTE: Multi-Tab only.\n (n), n.ac = !1, await Fu(n.remoteStore, !1);\n }\n}\n\nasync function Nc(t, e, n) {\n const s = K(t), i = [], r = [];\n for (const t of e) {\n let e;\n const n = s.ec.get(t);\n if (n && 0 !== n.length) {\n // For queries that have a local View, we fetch their current state\n // from LocalStore (as the resume token and the snapshot version\n // might have changed) and reconcile their views with the persisted\n // state (the list of syncedDocuments may have gotten out of sync).\n e = await No(s.localStore, dn(n[0]));\n for (const t of n) {\n const e = s.tc.get(t), n = await Sc(s, e);\n n.snapshot && r.push(n.snapshot);\n }\n } else {\n // For queries that never executed on this client, we need to\n // allocate the target in LocalStore and initialize a new View.\n const n = await Oo(s.localStore, t);\n e = await No(s.localStore, n), await hc(s, kc(n), t, \n /*current=*/ !1);\n }\n i.push(e);\n }\n return s.Zu.Go(r), i;\n}\n\n/**\n * Creates a `Query` object from the specified `Target`. There is no way to\n * obtain the original `Query`, so we synthesize a `Query` from the `Target`\n * object.\n *\n * The synthesized result might be different from the original `Query`, but\n * since the synthesized `Query` should return the same results as the\n * original one (only the presentation of results might differ), the potential\n * difference will not cause issues.\n */\n// PORTING NOTE: Multi-Tab only.\nfunction kc(t) {\n return on(t.path, t.collectionGroup, t.orderBy, t.filters, t.limit, \"F\" /* First */ , t.startAt, t.endAt);\n}\n\n/** Returns the IDs of the clients that are currently active. */\n// PORTING NOTE: Multi-Tab only.\nfunction Mc(t) {\n const e = K(t);\n return K(K(e.localStore).persistence).Ri();\n}\n\n/** Applies a query target change from a different tab. */\n// PORTING NOTE: Multi-Tab only.\nasync function Oc(t, e, n, s) {\n const i = K(t);\n if (i.ac) \n // If we receive a target state notification via WebStorage, we are\n // either already secondary or another tab has taken the primary lease.\n return void O(\"SyncEngine\", \"Ignoring unexpected query state notification.\");\n const r = i.ec.get(e);\n if (r && r.length > 0) switch (n) {\n case \"current\":\n case \"not-current\":\n {\n const t = await Fo(i.localStore, pn(r[0])), s = Is.createSynthesizedRemoteEventForCurrentChange(e, \"current\" === n);\n await Pc(i, t, s);\n break;\n }\n\n case \"rejected\":\n await ko(i.localStore, e, \n /* keepPersistedTargetData */ !0), Tc(i, e, s);\n break;\n\n default:\n L();\n }\n}\n\n/** Adds or removes Watch targets for queries from different tabs. */ async function Fc(t, e, n) {\n const s = $c(t);\n if (s.ac) {\n for (const t of e) {\n if (s.ec.has(t)) {\n // A target might have been added in a previous attempt\n O(\"SyncEngine\", \"Adding an already active target \" + t);\n continue;\n }\n const e = await Oo(s.localStore, t), n = await No(s.localStore, e);\n await hc(s, kc(e), n.targetId, \n /*current=*/ !1), _u(s.remoteStore, n);\n }\n for (const t of n) \n // Check that the target is still active since the target might have been\n // removed if it has been rejected by the backend.\n s.ec.has(t) && \n // Release queries that are still active.\n await ko(s.localStore, t, \n /* keepPersistedTargetData */ !1).then((() => {\n wu(s.remoteStore, t), Tc(s, t);\n })).catch(vt);\n }\n}\n\nfunction $c(t) {\n const e = K(t);\n return e.remoteStore.remoteSyncer.applyRemoteEvent = dc.bind(null, e), e.remoteStore.remoteSyncer.getRemoteKeysForTarget = Vc.bind(null, e), \n e.remoteStore.remoteSyncer.rejectListen = wc.bind(null, e), e.Zu.Go = Hu.bind(null, e.eventManager), \n e.Zu.lc = Ju.bind(null, e.eventManager), e;\n}\n\nfunction Bc(t) {\n const e = K(t);\n return e.remoteStore.remoteSyncer.applySuccessfulWrite = mc.bind(null, e), e.remoteStore.remoteSyncer.rejectFailedWrite = gc.bind(null, e), \n e;\n}\n\n/**\n * Loads a Firestore bundle into the SDK. The returned promise resolves when\n * the bundle finished loading.\n *\n * @param syncEngine - SyncEngine to use.\n * @param bundleReader - Bundle to load into the SDK.\n * @param task - LoadBundleTask used to update the loading progress to public API.\n */ function Lc(t, e, n) {\n const s = K(t);\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n (\n /** Loads a bundle and returns the list of affected collection groups. */\n async function(t, e, n) {\n try {\n const s = await e.getMetadata();\n if (await function(t, e) {\n const n = K(t), s = Ms(e.createTime);\n return n.persistence.runTransaction(\"hasNewerBundle\", \"readonly\", (t => n.Ds.getBundleMetadata(t, e.id))).then((t => !!t && t.createTime.compareTo(s) >= 0));\n }\n /**\n * Saves the given `BundleMetadata` to local persistence.\n */ (t.localStore, s)) return await e.close(), n._completeWith(function(t) {\n return {\n taskState: \"Success\",\n documentsLoaded: t.totalDocuments,\n bytesLoaded: t.totalBytes,\n totalDocuments: t.totalDocuments,\n totalBytes: t.totalBytes\n };\n }(s)), Promise.resolve(new Set);\n n._updateProgress(nc(s));\n const i = new ec(s, t.localStore, e.wt);\n let r = await e.fc();\n for (;r; ) {\n const t = await i.Nu(r);\n t && n._updateProgress(t), r = await e.fc();\n }\n const o = await i.complete();\n return await Pc(t, o.Ou, \n /* remoteEvent */ void 0), \n // Save metadata, so loading the same bundle will skip.\n await function(t, e) {\n const n = K(t);\n return n.persistence.runTransaction(\"Save bundle\", \"readwrite\", (t => n.Ds.saveBundleMetadata(t, e)));\n }\n /**\n * Returns a promise of a `NamedQuery` associated with given query name. Promise\n * resolves to undefined if no persisted data can be found.\n */ (t.localStore, s), n._completeWith(o.progress), Promise.resolve(o.Mu);\n } catch (t) {\n return $(\"SyncEngine\", `Loading bundle failed with ${t}`), n._failWith(t), Promise.resolve(new Set);\n }\n }\n /**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n /**\n * Provides all components needed for Firestore with in-memory persistence.\n * Uses EagerGC garbage collection.\n */)(s, e, n).then((t => {\n s.sharedClientState.notifyBundleLoaded(t);\n }));\n}\n\nclass Uc {\n constructor() {\n this.synchronizeTabs = !1;\n }\n async initialize(t) {\n this.wt = iu(t.databaseInfo.databaseId), this.sharedClientState = this.dc(t), this.persistence = this._c(t), \n await this.persistence.start(), this.localStore = this.wc(t), this.gcScheduler = this.mc(t, this.localStore), \n this.indexBackfillerScheduler = this.gc(t, this.localStore);\n }\n mc(t, e) {\n return null;\n }\n gc(t, e) {\n return null;\n }\n wc(t) {\n return Po(this.persistence, new Ro, t.initialUser, this.wt);\n }\n _c(t) {\n return new fo(wo.Os, this.wt);\n }\n dc(t) {\n return new Jo;\n }\n async terminate() {\n this.gcScheduler && this.gcScheduler.stop(), await this.sharedClientState.shutdown(), \n await this.persistence.shutdown();\n }\n}\n\n/**\n * Provides all components needed for Firestore with IndexedDB persistence.\n */ class qc extends Uc {\n constructor(t, e, n) {\n super(), this.yc = t, this.cacheSizeBytes = e, this.forceOwnership = n, this.synchronizeTabs = !1;\n }\n async initialize(t) {\n await super.initialize(t), await this.yc.initialize(this, t), \n // Enqueue writes from a previous session\n await Bc(this.yc.syncEngine), await vu(this.yc.remoteStore), \n // NOTE: This will immediately call the listener, so we make sure to\n // set it after localStore / remoteStore are started.\n await this.persistence.ci((() => (this.gcScheduler && !this.gcScheduler.started && this.gcScheduler.start(), \n this.indexBackfillerScheduler && !this.indexBackfillerScheduler.started && this.indexBackfillerScheduler.start(), \n Promise.resolve())));\n }\n wc(t) {\n return Po(this.persistence, new Ro, t.initialUser, this.wt);\n }\n mc(t, e) {\n const n = this.persistence.referenceDelegate.garbageCollector;\n return new Kr(n, t.asyncQueue, e);\n }\n gc(t, e) {\n const n = new Bt(e, this.persistence);\n return new $t(t.asyncQueue, n);\n }\n _c(t) {\n const e = Eo(t.databaseInfo.databaseId, t.databaseInfo.persistenceKey), n = void 0 !== this.cacheSizeBytes ? Vr.withCacheSize(this.cacheSizeBytes) : Vr.DEFAULT;\n return new po(this.synchronizeTabs, e, t.clientId, n, t.asyncQueue, nu(), su(), this.wt, this.sharedClientState, !!this.forceOwnership);\n }\n dc(t) {\n return new Jo;\n }\n}\n\n/**\n * Provides all components needed for Firestore with multi-tab IndexedDB\n * persistence.\n *\n * In the legacy client, this provider is used to provide both multi-tab and\n * non-multi-tab persistence since we cannot tell at build time whether\n * `synchronizeTabs` will be enabled.\n */ class Kc extends qc {\n constructor(t, e) {\n super(t, e, /* forceOwnership= */ !1), this.yc = t, this.cacheSizeBytes = e, this.synchronizeTabs = !0;\n }\n async initialize(t) {\n await super.initialize(t);\n const e = this.yc.syncEngine;\n this.sharedClientState instanceof Ho && (this.sharedClientState.syncEngine = {\n kr: Cc.bind(null, e),\n Mr: Oc.bind(null, e),\n Or: Fc.bind(null, e),\n Ri: Mc.bind(null, e),\n Nr: Dc.bind(null, e)\n }, await this.sharedClientState.start()), \n // NOTE: This will immediately call the listener, so we make sure to\n // set it after localStore / remoteStore are started.\n await this.persistence.ci((async t => {\n await xc(this.yc.syncEngine, t), this.gcScheduler && (t && !this.gcScheduler.started ? this.gcScheduler.start() : t || this.gcScheduler.stop()), \n this.indexBackfillerScheduler && (t && !this.indexBackfillerScheduler.started ? this.indexBackfillerScheduler.start() : t || this.indexBackfillerScheduler.stop());\n }));\n }\n dc(t) {\n const e = nu();\n if (!Ho.V(e)) throw new Q(G.UNIMPLEMENTED, \"IndexedDB persistence is only available on platforms that support LocalStorage.\");\n const n = Eo(t.databaseInfo.databaseId, t.databaseInfo.persistenceKey);\n return new Ho(e, t.asyncQueue, n, t.clientId, t.initialUser);\n }\n}\n\n/**\n * Initializes and wires the components that are needed to interface with the\n * network.\n */ class Gc {\n async initialize(t, e) {\n this.localStore || (this.localStore = t.localStore, this.sharedClientState = t.sharedClientState, \n this.datastore = this.createDatastore(e), this.remoteStore = this.createRemoteStore(e), \n this.eventManager = this.createEventManager(e), this.syncEngine = this.createSyncEngine(e, \n /* startAsPrimary=*/ !t.synchronizeTabs), this.sharedClientState.onlineStateHandler = t => _c(this.syncEngine, t, 1 /* SharedClientState */), \n this.remoteStore.remoteSyncer.handleCredentialChange = vc.bind(null, this.syncEngine), \n await Fu(this.remoteStore, this.syncEngine.isPrimaryClient));\n }\n createEventManager(t) {\n return new ju;\n }\n createDatastore(t) {\n const e = iu(t.databaseInfo.databaseId), n = (s = t.databaseInfo, new eu(s));\n var s;\n /** Return the Platform-specific connectivity monitor. */ return function(t, e, n, s) {\n return new au(t, e, n, s);\n }(t.authCredentials, t.appCheckCredentials, n, e);\n }\n createRemoteStore(t) {\n return e = this.localStore, n = this.datastore, s = t.asyncQueue, i = t => _c(this.syncEngine, t, 0 /* RemoteStore */), \n r = Xo.V() ? new Xo : new Yo, new lu(e, n, s, i, r);\n var e, n, s, i, r;\n /** Re-enables the network. Idempotent. */ }\n createSyncEngine(t, e) {\n return function(t, e, n, \n // PORTING NOTE: Manages state synchronization in multi-tab environments.\n s, i, r, o) {\n const u = new cc(t, e, n, s, i, r);\n return o && (u.ac = !0), u;\n }(this.localStore, this.remoteStore, this.eventManager, this.sharedClientState, t.initialUser, t.maxConcurrentLimboResolutions, e);\n }\n terminate() {\n return async function(t) {\n const e = K(t);\n O(\"RemoteStore\", \"RemoteStore shutting down.\"), e.lu.add(5 /* Shutdown */), await du(e), \n e.du.shutdown(), \n // Set the OnlineState to Unknown (rather than Offline) to avoid potentially\n // triggering spurious listener events with cached data, etc.\n e._u.set(\"Unknown\" /* Unknown */);\n }(this.remoteStore);\n }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * How many bytes to read each time when `ReadableStreamReader.read()` is\n * called. Only applicable for byte streams that we control (e.g. those backed\n * by an UInt8Array).\n */\n/**\n * Builds a `ByteStreamReader` from a UInt8Array.\n * @param source - The data source to use.\n * @param bytesPerRead - How many bytes each `read()` from the returned reader\n * will read.\n */\nfunction Qc(t, e = 10240) {\n let n = 0;\n // The TypeScript definition for ReadableStreamReader changed. We use\n // `any` here to allow this code to compile with different versions.\n // See https://github.com/microsoft/TypeScript/issues/42970\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n async read() {\n if (n < t.byteLength) {\n const s = {\n value: t.slice(n, n + e),\n done: !1\n };\n return n += e, s;\n }\n return {\n done: !0\n };\n },\n async cancel() {},\n releaseLock() {},\n closed: Promise.reject(\"unimplemented\")\n };\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * On web, a `ReadableStream` is wrapped around by a `ByteStreamReader`.\n */\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/*\n * A wrapper implementation of Observer<T> that will dispatch events\n * asynchronously. To allow immediate silencing, a mute call is added which\n * causes events scheduled to no longer be raised.\n */\nclass jc {\n constructor(t) {\n this.observer = t, \n /**\n * When set to true, will not raise future events. Necessary to deal with\n * async detachment of listener.\n */\n this.muted = !1;\n }\n next(t) {\n this.observer.next && this.Ic(this.observer.next, t);\n }\n error(t) {\n this.observer.error ? this.Ic(this.observer.error, t) : F(\"Uncaught Error in snapshot listener:\", t);\n }\n Tc() {\n this.muted = !0;\n }\n Ic(t, e) {\n this.muted || setTimeout((() => {\n this.muted || t(e);\n }), 0);\n }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A class representing a bundle.\n *\n * Takes a bundle stream or buffer, and presents abstractions to read bundled\n * elements out of the underlying content.\n */ class Wc {\n constructor(\n /** The reader to read from underlying binary bundle data source. */\n t, e) {\n this.Ec = t, this.wt = e, \n /** Cached bundle metadata. */\n this.metadata = new j, \n /**\n * Internal buffer to hold bundle content, accumulating incomplete element\n * content.\n */\n this.buffer = new Uint8Array, this.Ac = new TextDecoder(\"utf-8\"), \n // Read the metadata (which is the first element).\n this.Rc().then((t => {\n t && t.Cu() ? this.metadata.resolve(t.payload.metadata) : this.metadata.reject(new Error(`The first element of the bundle is not a metadata, it is\\n ${JSON.stringify(null == t ? void 0 : t.payload)}`));\n }), (t => this.metadata.reject(t)));\n }\n close() {\n return this.Ec.cancel();\n }\n async getMetadata() {\n return this.metadata.promise;\n }\n async fc() {\n // Makes sure metadata is read before proceeding.\n return await this.getMetadata(), this.Rc();\n }\n /**\n * Reads from the head of internal buffer, and pulling more data from\n * underlying stream if a complete element cannot be found, until an\n * element(including the prefixed length and the JSON string) is found.\n *\n * Once a complete element is read, it is dropped from internal buffer.\n *\n * Returns either the bundled element, or null if we have reached the end of\n * the stream.\n */ async Rc() {\n const t = await this.bc();\n if (null === t) return null;\n const e = this.Ac.decode(t), n = Number(e);\n isNaN(n) && this.Pc(`length string (${e}) is not valid number`);\n const s = await this.vc(n);\n return new Zu(JSON.parse(s), t.length + n);\n }\n /** First index of '{' from the underlying buffer. */ Vc() {\n return this.buffer.findIndex((t => t === \"{\".charCodeAt(0)));\n }\n /**\n * Reads from the beginning of the internal buffer, until the first '{', and\n * return the content.\n *\n * If reached end of the stream, returns a null.\n */ async bc() {\n for (;this.Vc() < 0; ) {\n if (await this.Sc()) break;\n }\n // Broke out of the loop because underlying stream is closed, and there\n // happens to be no more data to process.\n if (0 === this.buffer.length) return null;\n const t = this.Vc();\n // Broke out of the loop because underlying stream is closed, but still\n // cannot find an open bracket.\n t < 0 && this.Pc(\"Reached the end of bundle when a length string is expected.\");\n const e = this.buffer.slice(0, t);\n // Update the internal buffer to drop the read length.\n return this.buffer = this.buffer.slice(t), e;\n }\n /**\n * Reads from a specified position from the internal buffer, for a specified\n * number of bytes, pulling more data from the underlying stream if needed.\n *\n * Returns a string decoded from the read bytes.\n */ async vc(t) {\n for (;this.buffer.length < t; ) {\n await this.Sc() && this.Pc(\"Reached the end of bundle when more is expected.\");\n }\n const e = this.Ac.decode(this.buffer.slice(0, t));\n // Update the internal buffer to drop the read json string.\n return this.buffer = this.buffer.slice(t), e;\n }\n Pc(t) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n throw this.Ec.cancel(), new Error(`Invalid bundle format: ${t}`);\n }\n /**\n * Pulls more data from underlying stream to internal buffer.\n * Returns a boolean indicating whether the stream is finished.\n */ async Sc() {\n const t = await this.Ec.read();\n if (!t.done) {\n const e = new Uint8Array(this.buffer.length + t.value.length);\n e.set(this.buffer), e.set(t.value, this.buffer.length), this.buffer = e;\n }\n return t.done;\n }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Internal transaction object responsible for accumulating the mutations to\n * perform and the base versions for any documents read.\n */\nclass zc {\n constructor(t) {\n this.datastore = t, \n // The version of each document that was read during this transaction.\n this.readVersions = new Map, this.mutations = [], this.committed = !1, \n /**\n * A deferred usage error that occurred previously in this transaction that\n * will cause the transaction to fail once it actually commits.\n */\n this.lastWriteError = null, \n /**\n * Set of documents that have been written in the transaction.\n *\n * When there's more than one write to the same key in a transaction, any\n * writes after the first are handled differently.\n */\n this.writtenDocs = new Set;\n }\n async lookup(t) {\n if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw new Q(G.INVALID_ARGUMENT, \"Firestore transactions require all reads to be executed before all writes.\");\n const e = await async function(t, e) {\n const n = K(t), s = qs(n.wt) + \"/documents\", i = {\n documents: e.map((t => $s(n.wt, t)))\n }, r = await n.ao(\"BatchGetDocuments\", s, i, e.length), o = new Map;\n r.forEach((t => {\n const e = js(n.wt, t);\n o.set(e.key.toString(), e);\n }));\n const u = [];\n return e.forEach((t => {\n const e = o.get(t.toString());\n U(!!e), u.push(e);\n })), u;\n }(this.datastore, t);\n return e.forEach((t => this.recordVersion(t))), e;\n }\n set(t, e) {\n this.write(e.toMutation(t, this.precondition(t))), this.writtenDocs.add(t.toString());\n }\n update(t, e) {\n try {\n this.write(e.toMutation(t, this.preconditionForUpdate(t)));\n } catch (t) {\n this.lastWriteError = t;\n }\n this.writtenDocs.add(t.toString());\n }\n delete(t) {\n this.write(new Zn(t, this.precondition(t))), this.writtenDocs.add(t.toString());\n }\n async commit() {\n if (this.ensureCommitNotCalled(), this.lastWriteError) throw this.lastWriteError;\n const t = this.readVersions;\n // For each mutation, note that the doc was written.\n this.mutations.forEach((e => {\n t.delete(e.key.toString());\n })), \n // For each document that was read but not written to, we want to perform\n // a `verify` operation.\n t.forEach(((t, e) => {\n const n = dt.fromPath(e);\n this.mutations.push(new ts(n, this.precondition(n)));\n })), await async function(t, e) {\n const n = K(t), s = qs(n.wt) + \"/documents\", i = {\n writes: e.map((t => zs(n.wt, t)))\n };\n await n.ro(\"Commit\", s, i);\n }(this.datastore, this.mutations), this.committed = !0;\n }\n recordVersion(t) {\n let e;\n if (t.isFoundDocument()) e = t.version; else {\n if (!t.isNoDocument()) throw L();\n // For deleted docs, we must use baseVersion 0 when we overwrite them.\n e = ct.min();\n }\n const n = this.readVersions.get(t.key.toString());\n if (n) {\n if (!e.isEqual(n)) \n // This transaction will fail no matter what.\n throw new Q(G.ABORTED, \"Document version changed between two reads.\");\n } else this.readVersions.set(t.key.toString(), e);\n }\n /**\n * Returns the version of this document when it was read in this transaction,\n * as a precondition, or no precondition if it was not read.\n */ precondition(t) {\n const e = this.readVersions.get(t.toString());\n return !this.writtenDocs.has(t.toString()) && e ? Ln.updateTime(e) : Ln.none();\n }\n /**\n * Returns the precondition for a document if the operation is an update.\n */ preconditionForUpdate(t) {\n const e = this.readVersions.get(t.toString());\n // The first time a document is written, we want to take into account the\n // read time and existence\n if (!this.writtenDocs.has(t.toString()) && e) {\n if (e.isEqual(ct.min())) \n // The document doesn't exist, so fail the transaction.\n // This has to be validated locally because you can't send a\n // precondition that a document does not exist without changing the\n // semantics of the backend write to be an insert. This is the reverse\n // of what we want, since we want to assert that the document doesn't\n // exist but then send the update and have it fail. Since we can't\n // express that to the backend, we have to validate locally.\n // Note: this can change once we can send separate verify writes in the\n // transaction.\n throw new Q(G.INVALID_ARGUMENT, \"Can't update a document that doesn't exist.\");\n // Document exists, base precondition on document update time.\n return Ln.updateTime(e);\n }\n // Document was not read, so we just use the preconditions for a blind\n // update.\n return Ln.exists(!0);\n }\n write(t) {\n this.ensureCommitNotCalled(), this.mutations.push(t);\n }\n ensureCommitNotCalled() {}\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * TransactionRunner encapsulates the logic needed to run and retry transactions\n * with backoff.\n */ class Hc {\n constructor(t, e, n, s, i) {\n this.asyncQueue = t, this.datastore = e, this.options = n, this.updateFunction = s, \n this.deferred = i, this.Dc = n.maxAttempts, this.So = new ru(this.asyncQueue, \"transaction_retry\" /* TransactionRetry */);\n }\n /** Runs the transaction and sets the result on deferred. */ run() {\n this.Dc -= 1, this.Cc();\n }\n Cc() {\n this.So.Io((async () => {\n const t = new zc(this.datastore), e = this.xc(t);\n e && e.then((e => {\n this.asyncQueue.enqueueAndForget((() => t.commit().then((() => {\n this.deferred.resolve(e);\n })).catch((t => {\n this.Nc(t);\n }))));\n })).catch((t => {\n this.Nc(t);\n }));\n }));\n }\n xc(t) {\n try {\n const e = this.updateFunction(t);\n return !ce(e) && e.catch && e.then ? e : (this.deferred.reject(Error(\"Transaction callback must return a Promise\")), \n null);\n } catch (t) {\n // Do not retry errors thrown by user provided updateFunction.\n return this.deferred.reject(t), null;\n }\n }\n Nc(t) {\n this.Dc > 0 && this.kc(t) ? (this.Dc -= 1, this.asyncQueue.enqueueAndForget((() => (this.Cc(), \n Promise.resolve())))) : this.deferred.reject(t);\n }\n kc(t) {\n if (\"FirebaseError\" === t.name) {\n // In transactions, the backend will fail outdated reads with FAILED_PRECONDITION and\n // non-matching document versions with ABORTED. These errors should be retried.\n const e = t.code;\n return \"aborted\" === e || \"failed-precondition\" === e || !is(e);\n }\n return !1;\n }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * FirestoreClient is a top-level class that constructs and owns all of the\n * pieces of the client SDK architecture. It is responsible for creating the\n * async queue that is shared by all of the other components in the system.\n */\nclass Jc {\n constructor(t, e, \n /**\n * Asynchronous queue responsible for all of our internal processing. When\n * we get incoming work from the user (via public API) or the network\n * (incoming GRPC messages), we should always schedule onto this queue.\n * This ensures all of our work is properly serialized (e.g. we don't\n * start processing a new operation while the previous one is waiting for\n * an async I/O to complete).\n */\n n, s) {\n this.authCredentials = t, this.appCheckCredentials = e, this.asyncQueue = n, this.databaseInfo = s, \n this.user = C.UNAUTHENTICATED, this.clientId = st.I(), this.authCredentialListener = () => Promise.resolve(), \n this.appCheckCredentialListener = () => Promise.resolve(), this.authCredentials.start(n, (async t => {\n O(\"FirestoreClient\", \"Received user=\", t.uid), await this.authCredentialListener(t), \n this.user = t;\n })), this.appCheckCredentials.start(n, (t => (O(\"FirestoreClient\", \"Received new app check token=\", t), \n this.appCheckCredentialListener(t, this.user))));\n }\n async getConfiguration() {\n return {\n asyncQueue: this.asyncQueue,\n databaseInfo: this.databaseInfo,\n clientId: this.clientId,\n authCredentials: this.authCredentials,\n appCheckCredentials: this.appCheckCredentials,\n initialUser: this.user,\n maxConcurrentLimboResolutions: 100\n };\n }\n setCredentialChangeListener(t) {\n this.authCredentialListener = t;\n }\n setAppCheckTokenChangeListener(t) {\n this.appCheckCredentialListener = t;\n }\n /**\n * Checks that the client has not been terminated. Ensures that other methods on\n * this class cannot be called after the client is terminated.\n */ verifyNotTerminated() {\n if (this.asyncQueue.isShuttingDown) throw new Q(G.FAILED_PRECONDITION, \"The client has already been terminated.\");\n }\n terminate() {\n this.asyncQueue.enterRestrictedMode();\n const t = new j;\n return this.asyncQueue.enqueueAndForgetEvenWhileRestricted((async () => {\n try {\n this.onlineComponents && await this.onlineComponents.terminate(), this.offlineComponents && await this.offlineComponents.terminate(), \n // The credentials provider must be terminated after shutting down the\n // RemoteStore as it will prevent the RemoteStore from retrieving auth\n // tokens.\n this.authCredentials.shutdown(), this.appCheckCredentials.shutdown(), t.resolve();\n } catch (e) {\n const n = Uu(e, \"Failed to shutdown persistence\");\n t.reject(n);\n }\n })), t.promise;\n }\n}\n\nasync function Yc(t, e) {\n t.asyncQueue.verifyOperationInProgress(), O(\"FirestoreClient\", \"Initializing OfflineComponentProvider\");\n const n = await t.getConfiguration();\n await e.initialize(n);\n let s = n.initialUser;\n t.setCredentialChangeListener((async t => {\n s.isEqual(t) || (await vo(e.localStore, t), s = t);\n })), \n // When a user calls clearPersistence() in one client, all other clients\n // need to be terminated to allow the delete to succeed.\n e.persistence.setDatabaseDeletedListener((() => t.terminate())), t.offlineComponents = e;\n}\n\nasync function Xc(t, e) {\n t.asyncQueue.verifyOperationInProgress();\n const n = await Zc(t);\n O(\"FirestoreClient\", \"Initializing OnlineComponentProvider\");\n const s = await t.getConfiguration();\n await e.initialize(n, s), \n // The CredentialChangeListener of the online component provider takes\n // precedence over the offline component provider.\n t.setCredentialChangeListener((t => Ou(e.remoteStore, t))), t.setAppCheckTokenChangeListener(((t, n) => Ou(e.remoteStore, n))), \n t.onlineComponents = e;\n}\n\nasync function Zc(t) {\n return t.offlineComponents || (O(\"FirestoreClient\", \"Using default OfflineComponentProvider\"), \n await Yc(t, new Uc)), t.offlineComponents;\n}\n\nasync function ta(t) {\n return t.onlineComponents || (O(\"FirestoreClient\", \"Using default OnlineComponentProvider\"), \n await Xc(t, new Gc)), t.onlineComponents;\n}\n\nfunction ea(t) {\n return Zc(t).then((t => t.persistence));\n}\n\nfunction na(t) {\n return Zc(t).then((t => t.localStore));\n}\n\nfunction sa(t) {\n return ta(t).then((t => t.remoteStore));\n}\n\nfunction ia(t) {\n return ta(t).then((t => t.syncEngine));\n}\n\nasync function ra(t) {\n const e = await ta(t), n = e.eventManager;\n return n.onListen = ac.bind(null, e.syncEngine), n.onUnlisten = lc.bind(null, e.syncEngine), \n n;\n}\n\n/** Enables the network connection and re-enqueues all pending operations. */ function oa(t) {\n return t.asyncQueue.enqueue((async () => {\n const e = await ea(t), n = await sa(t);\n return e.setNetworkEnabled(!0), function(t) {\n const e = K(t);\n return e.lu.delete(0 /* UserDisabled */), fu(e);\n }(n);\n }));\n}\n\n/** Disables the network connection. Pending operations will not complete. */ function ua(t) {\n return t.asyncQueue.enqueue((async () => {\n const e = await ea(t), n = await sa(t);\n return e.setNetworkEnabled(!1), async function(t) {\n const e = K(t);\n e.lu.add(0 /* UserDisabled */), await du(e), \n // Set the OnlineState to Offline so get()s return from cache, etc.\n e._u.set(\"Offline\" /* Offline */);\n }(n);\n }));\n}\n\n/**\n * Returns a Promise that resolves when all writes that were pending at the time\n * this method was called received server acknowledgement. An acknowledgement\n * can be either acceptance or rejection.\n */ function ca(t, e) {\n const n = new j;\n return t.asyncQueue.enqueueAndForget((async () => async function(t, e, n) {\n try {\n const s = await function(t, e) {\n const n = K(t);\n return n.persistence.runTransaction(\"read document\", \"readonly\", (t => n.localDocuments.getDocument(t, e)));\n }(t, e);\n s.isFoundDocument() ? n.resolve(s) : s.isNoDocument() ? n.resolve(null) : n.reject(new Q(G.UNAVAILABLE, \"Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)\"));\n } catch (t) {\n const s = Uu(t, `Failed to get document '${e} from cache`);\n n.reject(s);\n }\n }\n /**\n * Retrieves a latency-compensated document from the backend via a\n * SnapshotListener.\n */ (await na(t), e, n))), n.promise;\n}\n\nfunction aa(t, e, n = {}) {\n const s = new j;\n return t.asyncQueue.enqueueAndForget((async () => function(t, e, n, s, i) {\n const r = new jc({\n next: r => {\n // Remove query first before passing event to user to avoid\n // user actions affecting the now stale query.\n e.enqueueAndForget((() => zu(t, o)));\n const u = r.docs.has(n);\n !u && r.fromCache ? \n // TODO(dimond): If we're online and the document doesn't\n // exist then we resolve with a doc.exists set to false. If\n // we're offline however, we reject the Promise in this\n // case. Two options: 1) Cache the negative response from\n // the server so we can deliver that even when you're\n // offline 2) Actually reject the Promise in the online case\n // if the document doesn't exist.\n i.reject(new Q(G.UNAVAILABLE, \"Failed to get document because the client is offline.\")) : u && r.fromCache && s && \"server\" === s.source ? i.reject(new Q(G.UNAVAILABLE, 'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to \"server\" to retrieve the cached document.)')) : i.resolve(r);\n },\n error: t => i.reject(t)\n }), o = new Xu(un(n.path), r, {\n includeMetadataChanges: !0,\n Du: !0\n });\n return Wu(t, o);\n }(await ra(t), t.asyncQueue, e, n, s))), s.promise;\n}\n\nfunction ha(t, e) {\n const n = new j;\n return t.asyncQueue.enqueueAndForget((async () => async function(t, e, n) {\n try {\n const s = await Mo(t, e, \n /* usePreviousResults= */ !0), i = new rc(e, s.ji), r = i.Ku(s.documents), o = i.applyChanges(r, \n /* updateLimboDocuments= */ !1);\n n.resolve(o.snapshot);\n } catch (t) {\n const s = Uu(t, `Failed to execute query '${e} against cache`);\n n.reject(s);\n }\n }\n /**\n * Retrieves a latency-compensated query snapshot from the backend via a\n * SnapshotListener.\n */ (await na(t), e, n))), n.promise;\n}\n\nfunction la(t, e, n = {}) {\n const s = new j;\n return t.asyncQueue.enqueueAndForget((async () => function(t, e, n, s, i) {\n const r = new jc({\n next: n => {\n // Remove query first before passing event to user to avoid\n // user actions affecting the now stale query.\n e.enqueueAndForget((() => zu(t, o))), n.fromCache && \"server\" === s.source ? i.reject(new Q(G.UNAVAILABLE, 'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to \"server\" to retrieve the cached documents.)')) : i.resolve(n);\n },\n error: t => i.reject(t)\n }), o = new Xu(n, r, {\n includeMetadataChanges: !0,\n Du: !0\n });\n return Wu(t, o);\n }(await ra(t), t.asyncQueue, e, n, s))), s.promise;\n}\n\nfunction fa(t, e) {\n const n = new jc(e);\n return t.asyncQueue.enqueueAndForget((async () => function(t, e) {\n K(t).Tu.add(e), \n // Immediately fire an initial event, indicating all existing listeners\n // are in-sync.\n e.next();\n }(await ra(t), n))), () => {\n n.Tc(), t.asyncQueue.enqueueAndForget((async () => function(t, e) {\n K(t).Tu.delete(e);\n }(await ra(t), n)));\n };\n}\n\n/**\n * Takes an updateFunction in which a set of reads and writes can be performed\n * atomically. In the updateFunction, the client can read and write values\n * using the supplied transaction object. After the updateFunction, all\n * changes will be committed. If a retryable error occurs (ex: some other\n * client has changed any of the data referenced), then the updateFunction\n * will be called again after a backoff. If the updateFunction still fails\n * after all retries, then the transaction will be rejected.\n *\n * The transaction object passed to the updateFunction contains methods for\n * accessing documents and collections. Unlike other datastore access, data\n * accessed with the transaction will not reflect local changes that have not\n * been committed. For this reason, it is required that all reads are\n * performed before any writes. Transactions must be performed while online.\n */ function da(t, e, n) {\n const s = new j;\n return t.asyncQueue.enqueueAndForget((async () => {\n const i = await function(t) {\n return ta(t).then((t => t.datastore));\n }(t);\n new Hc(t.asyncQueue, i, n, e, s).run();\n })), s.promise;\n}\n\nfunction _a(t, e, n, s) {\n const i = function(t, e) {\n let n;\n n = \"string\" == typeof t ? (new TextEncoder).encode(t) : t;\n return function(t, e) {\n return new Wc(t, e);\n }(function(t, e) {\n if (t instanceof Uint8Array) return Qc(t, e);\n if (t instanceof ArrayBuffer) return Qc(new Uint8Array(t), e);\n if (t instanceof ReadableStream) return t.getReader();\n throw new Error(\"Source of `toByteStreamReader` has to be a ArrayBuffer or ReadableStream\");\n }(n), e);\n }\n /**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ (n, iu(e));\n t.asyncQueue.enqueueAndForget((async () => {\n Lc(await ia(t), i, s);\n }));\n}\n\nfunction wa(t, e) {\n return t.asyncQueue.enqueue((async () => function(t, e) {\n const n = K(t);\n return n.persistence.runTransaction(\"Get named query\", \"readonly\", (t => n.Ds.getNamedQuery(t, e)));\n }(await na(t), e)));\n}\n\nconst ma = new Map;\n\n/**\n * An instance map that ensures only one Datastore exists per Firestore\n * instance.\n */\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nfunction ga(t, e, n) {\n if (!n) throw new Q(G.INVALID_ARGUMENT, `Function ${t}() cannot be called with an empty ${e}.`);\n}\n\n/**\n * Validates that two boolean options are not set at the same time.\n * @internal\n */ function ya(t, e, n, s) {\n if (!0 === e && !0 === s) throw new Q(G.INVALID_ARGUMENT, `${t} and ${n} cannot be used together.`);\n}\n\n/**\n * Validates that `path` refers to a document (indicated by the fact it contains\n * an even numbers of segments).\n */ function pa(t) {\n if (!dt.isDocumentKey(t)) throw new Q(G.INVALID_ARGUMENT, `Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`);\n}\n\n/**\n * Validates that `path` refers to a collection (indicated by the fact it\n * contains an odd numbers of segments).\n */ function Ia(t) {\n if (dt.isDocumentKey(t)) throw new Q(G.INVALID_ARGUMENT, `Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`);\n}\n\n/**\n * Returns true if it's a non-null object without a custom prototype\n * (i.e. excludes Array, Date, etc.).\n */\n/** Returns a string describing the type / value of the provided input. */\nfunction Ta(t) {\n if (void 0 === t) return \"undefined\";\n if (null === t) return \"null\";\n if (\"string\" == typeof t) return t.length > 20 && (t = `${t.substring(0, 20)}...`), \n JSON.stringify(t);\n if (\"number\" == typeof t || \"boolean\" == typeof t) return \"\" + t;\n if (\"object\" == typeof t) {\n if (t instanceof Array) return \"an array\";\n {\n const e = \n /** try to get the constructor name for an object. */\n function(t) {\n if (t.constructor) return t.constructor.name;\n return null;\n }\n /**\n * Casts `obj` to `T`, optionally unwrapping Compat types to expose the\n * underlying instance. Throws if `obj` is not an instance of `T`.\n *\n * This cast is used in the Lite and Full SDK to verify instance types for\n * arguments passed to the public API.\n * @internal\n */ (t);\n return e ? `a custom ${e} object` : \"an object\";\n }\n }\n return \"function\" == typeof t ? \"a function\" : L();\n}\n\nfunction Ea(t, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ne) {\n if (\"_delegate\" in t && (\n // Unwrap Compat types\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n t = t._delegate), !(t instanceof e)) {\n if (e.name === t.constructor.name) throw new Q(G.INVALID_ARGUMENT, \"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?\");\n {\n const n = Ta(t);\n throw new Q(G.INVALID_ARGUMENT, `Expected type '${e.name}', but it was: ${n}`);\n }\n }\n return t;\n}\n\nfunction Aa(t, e) {\n if (e <= 0) throw new Q(G.INVALID_ARGUMENT, `Function ${t}() requires a positive number, but it was: ${e}.`);\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// settings() defaults:\n/**\n * A concrete type describing all the values that can be applied via a\n * user-supplied `FirestoreSettings` object. This is a separate type so that\n * defaults can be supplied and the value can be checked for equality.\n */\nclass Ra {\n constructor(t) {\n var e;\n if (void 0 === t.host) {\n if (void 0 !== t.ssl) throw new Q(G.INVALID_ARGUMENT, \"Can't provide ssl option if host option is not set\");\n this.host = \"firestore.googleapis.com\", this.ssl = true;\n } else this.host = t.host, this.ssl = null === (e = t.ssl) || void 0 === e || e;\n if (this.credentials = t.credentials, this.ignoreUndefinedProperties = !!t.ignoreUndefinedProperties, \n void 0 === t.cacheSizeBytes) this.cacheSizeBytes = 41943040; else {\n if (-1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new Q(G.INVALID_ARGUMENT, \"cacheSizeBytes must be at least 1048576\");\n this.cacheSizeBytes = t.cacheSizeBytes;\n }\n this.experimentalForceLongPolling = !!t.experimentalForceLongPolling, this.experimentalAutoDetectLongPolling = !!t.experimentalAutoDetectLongPolling, \n this.useFetchStreams = !!t.useFetchStreams, ya(\"experimentalForceLongPolling\", t.experimentalForceLongPolling, \"experimentalAutoDetectLongPolling\", t.experimentalAutoDetectLongPolling);\n }\n isEqual(t) {\n return this.host === t.host && this.ssl === t.ssl && this.credentials === t.credentials && this.cacheSizeBytes === t.cacheSizeBytes && this.experimentalForceLongPolling === t.experimentalForceLongPolling && this.experimentalAutoDetectLongPolling === t.experimentalAutoDetectLongPolling && this.ignoreUndefinedProperties === t.ignoreUndefinedProperties && this.useFetchStreams === t.useFetchStreams;\n }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * The Cloud Firestore service interface.\n *\n * Do not call this constructor directly. Instead, use {@link getFirestore}.\n */ class ba {\n /** @hideconstructor */\n constructor(t, e, n) {\n this._authCredentials = e, this._appCheckCredentials = n, \n /**\n * Whether it's a Firestore or Firestore Lite instance.\n */\n this.type = \"firestore-lite\", this._persistenceKey = \"(lite)\", this._settings = new Ra({}), \n this._settingsFrozen = !1, t instanceof ue ? this._databaseId = t : (this._app = t, \n this._databaseId = function(t) {\n if (!Object.prototype.hasOwnProperty.apply(t.options, [ \"projectId\" ])) throw new Q(G.INVALID_ARGUMENT, '\"projectId\" not provided in firebase.initializeApp.');\n return new ue(t.options.projectId);\n }\n /**\n * Modify this instance to communicate with the Cloud Firestore emulator.\n *\n * Note: This must be called before this instance has been used to do any\n * operations.\n *\n * @param firestore - The `Firestore` instance to configure to connect to the\n * emulator.\n * @param host - the emulator host (ex: localhost).\n * @param port - the emulator port (ex: 9000).\n * @param options.mockUserToken - the mock auth token to use for unit testing\n * Security Rules.\n */ (t));\n }\n /**\n * The {@link @firebase/app#FirebaseApp} associated with this `Firestore` service\n * instance.\n */ get app() {\n if (!this._app) throw new Q(G.FAILED_PRECONDITION, \"Firestore was not initialized using the Firebase SDK. 'app' is not available\");\n return this._app;\n }\n get _initialized() {\n return this._settingsFrozen;\n }\n get _terminated() {\n return void 0 !== this._terminateTask;\n }\n _setSettings(t) {\n if (this._settingsFrozen) throw new Q(G.FAILED_PRECONDITION, \"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.\");\n this._settings = new Ra(t), void 0 !== t.credentials && (this._authCredentials = function(t) {\n if (!t) return new z;\n switch (t.type) {\n case \"gapi\":\n const e = t.client;\n // Make sure this really is a Gapi client.\n return U(!(\"object\" != typeof e || null === e || !e.auth || !e.auth.getAuthHeaderValueForFirstParty)), \n new X(e, t.sessionIndex || \"0\", t.iamToken || null);\n\n case \"provider\":\n return t.client;\n\n default:\n throw new Q(G.INVALID_ARGUMENT, \"makeAuthCredentialsProvider failed due to invalid credential type\");\n }\n }(t.credentials));\n }\n _getSettings() {\n return this._settings;\n }\n _freezeSettings() {\n return this._settingsFrozen = !0, this._settings;\n }\n _delete() {\n return this._terminateTask || (this._terminateTask = this._terminate()), this._terminateTask;\n }\n /** Returns a JSON-serializable representation of this `Firestore` instance. */ toJSON() {\n return {\n app: this._app,\n databaseId: this._databaseId,\n settings: this._settings\n };\n }\n /**\n * Terminates all components used by this client. Subclasses can override\n * this method to clean up their own dependencies, but must also call this\n * method.\n *\n * Only ever called once.\n */ _terminate() {\n /**\n * Removes all components associated with the provided instance. Must be called\n * when the `Firestore` instance is terminated.\n */\n return function(t) {\n const e = ma.get(t);\n e && (O(\"ComponentProvider\", \"Removing Datastore\"), ma.delete(t), e.terminate());\n }(this), Promise.resolve();\n }\n}\n\nfunction Pa(t, e, n, s = {}) {\n var i;\n const r = (t = Ea(t, ba))._getSettings();\n if (\"firestore.googleapis.com\" !== r.host && r.host !== e && $(\"Host has been set in both settings() and useEmulator(), emulator host will be used\"), \n t._setSettings(Object.assign(Object.assign({}, r), {\n host: `${e}:${n}`,\n ssl: !1\n })), s.mockUserToken) {\n let e, n;\n if (\"string\" == typeof s.mockUserToken) e = s.mockUserToken, n = C.MOCK_USER; else {\n // Let createMockUserToken validate first (catches common mistakes like\n // invalid field \"uid\" and missing field \"sub\" / \"user_id\".)\n e = createMockUserToken(s.mockUserToken, null === (i = t._app) || void 0 === i ? void 0 : i.options.projectId);\n const r = s.mockUserToken.sub || s.mockUserToken.user_id;\n if (!r) throw new Q(G.INVALID_ARGUMENT, \"mockUserToken must contain 'sub' or 'user_id' field!\");\n n = new C(r);\n }\n t._authCredentials = new H(new W(e, n));\n }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A `DocumentReference` refers to a document location in a Firestore database\n * and can be used to write, read, or listen to the location. The document at\n * the referenced location may or may not exist.\n */ class va {\n /** @hideconstructor */\n constructor(t, \n /**\n * If provided, the `FirestoreDataConverter` associated with this instance.\n */\n e, n) {\n this.converter = e, this._key = n, \n /** The type of this Firestore reference. */\n this.type = \"document\", this.firestore = t;\n }\n get _path() {\n return this._key.path;\n }\n /**\n * The document's identifier within its collection.\n */ get id() {\n return this._key.path.lastSegment();\n }\n /**\n * A string representing the path of the referenced document (relative\n * to the root of the database).\n */ get path() {\n return this._key.path.canonicalString();\n }\n /**\n * The collection this `DocumentReference` belongs to.\n */ get parent() {\n return new Sa(this.firestore, this.converter, this._key.path.popLast());\n }\n withConverter(t) {\n return new va(this.firestore, t, this._key);\n }\n}\n\n/**\n * A `Query` refers to a query which you can read or listen to. You can also\n * construct refined `Query` objects by adding filters and ordering.\n */ class Va {\n // This is the lite version of the Query class in the main SDK.\n /** @hideconstructor protected */\n constructor(t, \n /**\n * If provided, the `FirestoreDataConverter` associated with this instance.\n */\n e, n) {\n this.converter = e, this._query = n, \n /** The type of this Firestore reference. */\n this.type = \"query\", this.firestore = t;\n }\n withConverter(t) {\n return new Va(this.firestore, t, this._query);\n }\n}\n\n/**\n * A `CollectionReference` object can be used for adding documents, getting\n * document references, and querying for documents (using {@link query}).\n */ class Sa extends Va {\n /** @hideconstructor */\n constructor(t, e, n) {\n super(t, e, un(n)), this._path = n, \n /** The type of this Firestore reference. */\n this.type = \"collection\";\n }\n /** The collection's identifier. */ get id() {\n return this._query.path.lastSegment();\n }\n /**\n * A string representing the path of the referenced collection (relative\n * to the root of the database).\n */ get path() {\n return this._query.path.canonicalString();\n }\n /**\n * A reference to the containing `DocumentReference` if this is a\n * subcollection. If this isn't a subcollection, the reference is null.\n */ get parent() {\n const t = this._path.popLast();\n return t.isEmpty() ? null : new va(this.firestore, \n /* converter= */ null, new dt(t));\n }\n withConverter(t) {\n return new Sa(this.firestore, t, this._path);\n }\n}\n\nfunction Da(t, e, ...n) {\n if (t = getModularInstance(t), ga(\"collection\", \"path\", e), t instanceof ba) {\n const s = ht.fromString(e, ...n);\n return Ia(s), new Sa(t, /* converter= */ null, s);\n }\n {\n if (!(t instanceof va || t instanceof Sa)) throw new Q(G.INVALID_ARGUMENT, \"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore\");\n const s = t._path.child(ht.fromString(e, ...n));\n return Ia(s), new Sa(t.firestore, \n /* converter= */ null, s);\n }\n}\n\n// TODO(firestorelite): Consider using ErrorFactory -\n// https://github.com/firebase/firebase-js-sdk/blob/0131e1f/packages/util/src/errors.ts#L106\n/**\n * Creates and returns a new `Query` instance that includes all documents in the\n * database that are contained in a collection or subcollection with the\n * given `collectionId`.\n *\n * @param firestore - A reference to the root `Firestore` instance.\n * @param collectionId - Identifies the collections to query over. Every\n * collection or subcollection with this ID as the last segment of its path\n * will be included. Cannot contain a slash.\n * @returns The created `Query`.\n */ function Ca(t, e) {\n if (t = Ea(t, ba), ga(\"collectionGroup\", \"collection id\", e), e.indexOf(\"/\") >= 0) throw new Q(G.INVALID_ARGUMENT, `Invalid collection ID '${e}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);\n return new Va(t, \n /* converter= */ null, \n /**\n * Creates a new Query for a collection group query that matches all documents\n * within the provided collection group.\n */\n function(t) {\n return new rn(ht.emptyPath(), t);\n }(e));\n}\n\nfunction xa(t, e, ...n) {\n if (t = getModularInstance(t), \n // We allow omission of 'pathString' but explicitly prohibit passing in both\n // 'undefined' and 'null'.\n 1 === arguments.length && (e = st.I()), ga(\"doc\", \"path\", e), t instanceof ba) {\n const s = ht.fromString(e, ...n);\n return pa(s), new va(t, \n /* converter= */ null, new dt(s));\n }\n {\n if (!(t instanceof va || t instanceof Sa)) throw new Q(G.INVALID_ARGUMENT, \"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore\");\n const s = t._path.child(ht.fromString(e, ...n));\n return pa(s), new va(t.firestore, t instanceof Sa ? t.converter : null, new dt(s));\n }\n}\n\n/**\n * Returns true if the provided references are equal.\n *\n * @param left - A reference to compare.\n * @param right - A reference to compare.\n * @returns true if the references point to the same location in the same\n * Firestore database.\n */ function Na(t, e) {\n return t = getModularInstance(t), e = getModularInstance(e), (t instanceof va || t instanceof Sa) && (e instanceof va || e instanceof Sa) && (t.firestore === e.firestore && t.path === e.path && t.converter === e.converter);\n}\n\n/**\n * Returns true if the provided queries point to the same collection and apply\n * the same constraints.\n *\n * @param left - A `Query` to compare.\n * @param right - A `Query` to compare.\n * @returns true if the references point to the same location in the same\n * Firestore database.\n */ function ka(t, e) {\n return t = getModularInstance(t), e = getModularInstance(e), t instanceof Va && e instanceof Va && (t.firestore === e.firestore && wn(t._query, e._query) && t.converter === e.converter);\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ class Ma {\n constructor() {\n // The last promise in the queue.\n this.Mc = Promise.resolve(), \n // A list of retryable operations. Retryable operations are run in order and\n // retried with backoff.\n this.Oc = [], \n // Is this AsyncQueue being shut down? Once it is set to true, it will not\n // be changed again.\n this.Fc = !1, \n // Operations scheduled to be queued in the future. Operations are\n // automatically removed after they are run or canceled.\n this.$c = [], \n // visible for testing\n this.Bc = null, \n // Flag set while there's an outstanding AsyncQueue operation, used for\n // assertion sanity-checks.\n this.Lc = !1, \n // Enabled during shutdown on Safari to prevent future access to IndexedDB.\n this.Uc = !1, \n // List of TimerIds to fast-forward delays for.\n this.qc = [], \n // Backoff timer used to schedule retries for retryable operations\n this.So = new ru(this, \"async_queue_retry\" /* AsyncQueueRetry */), \n // Visibility handler that triggers an immediate retry of all retryable\n // operations. Meant to speed up recovery when we regain file system access\n // after page comes into foreground.\n this.Kc = () => {\n const t = su();\n t && O(\"AsyncQueue\", \"Visibility state changed to \" + t.visibilityState), this.So.Eo();\n };\n const t = su();\n t && \"function\" == typeof t.addEventListener && t.addEventListener(\"visibilitychange\", this.Kc);\n }\n get isShuttingDown() {\n return this.Fc;\n }\n /**\n * Adds a new operation to the queue without waiting for it to complete (i.e.\n * we ignore the Promise result).\n */ enqueueAndForget(t) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.enqueue(t);\n }\n enqueueAndForgetEvenWhileRestricted(t) {\n this.Gc(), \n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.Qc(t);\n }\n enterRestrictedMode(t) {\n if (!this.Fc) {\n this.Fc = !0, this.Uc = t || !1;\n const e = su();\n e && \"function\" == typeof e.removeEventListener && e.removeEventListener(\"visibilitychange\", this.Kc);\n }\n }\n enqueue(t) {\n if (this.Gc(), this.Fc) \n // Return a Promise which never resolves.\n return new Promise((() => {}));\n // Create a deferred Promise that we can return to the callee. This\n // allows us to return a \"hanging Promise\" only to the callee and still\n // advance the queue even when the operation is not run.\n const e = new j;\n return this.Qc((() => this.Fc && this.Uc ? Promise.resolve() : (t().then(e.resolve, e.reject), \n e.promise))).then((() => e.promise));\n }\n enqueueRetryable(t) {\n this.enqueueAndForget((() => (this.Oc.push(t), this.jc())));\n }\n /**\n * Runs the next operation from the retryable queue. If the operation fails,\n * reschedules with backoff.\n */ async jc() {\n if (0 !== this.Oc.length) {\n try {\n await this.Oc[0](), this.Oc.shift(), this.So.reset();\n } catch (t) {\n if (!Nt(t)) throw t;\n // Failure will be handled by AsyncQueue\n O(\"AsyncQueue\", \"Operation failed with retryable error: \" + t);\n }\n this.Oc.length > 0 && \n // If there are additional operations, we re-schedule `retryNextOp()`.\n // This is necessary to run retryable operations that failed during\n // their initial attempt since we don't know whether they are already\n // enqueued. If, for example, `op1`, `op2`, `op3` are enqueued and `op1`\n // needs to be re-run, we will run `op1`, `op1`, `op2` using the\n // already enqueued calls to `retryNextOp()`. `op3()` will then run in the\n // call scheduled here.\n // Since `backoffAndRun()` cancels an existing backoff and schedules a\n // new backoff on every call, there is only ever a single additional\n // operation in the queue.\n this.So.Io((() => this.jc()));\n }\n }\n Qc(t) {\n const e = this.Mc.then((() => (this.Lc = !0, t().catch((t => {\n this.Bc = t, this.Lc = !1;\n const e = \n /**\n * Chrome includes Error.message in Error.stack. Other browsers do not.\n * This returns expected output of message + stack when available.\n * @param error - Error or FirestoreError\n */\n function(t) {\n let e = t.message || \"\";\n t.stack && (e = t.stack.includes(t.message) ? t.stack : t.message + \"\\n\" + t.stack);\n return e;\n }\n /**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ (t);\n // Re-throw the error so that this.tail becomes a rejected Promise and\n // all further attempts to chain (via .then) will just short-circuit\n // and return the rejected Promise.\n throw F(\"INTERNAL UNHANDLED ERROR: \", e), t;\n })).then((t => (this.Lc = !1, t))))));\n return this.Mc = e, e;\n }\n enqueueAfterDelay(t, e, n) {\n this.Gc(), \n // Fast-forward delays for timerIds that have been overriden.\n this.qc.indexOf(t) > -1 && (e = 0);\n const s = Lu.createAndSchedule(this, t, e, n, (t => this.Wc(t)));\n return this.$c.push(s), s;\n }\n Gc() {\n this.Bc && L();\n }\n verifyOperationInProgress() {}\n /**\n * Waits until all currently queued tasks are finished executing. Delayed\n * operations are not run.\n */ async zc() {\n // Operations in the queue prior to draining may have enqueued additional\n // operations. Keep draining the queue until the tail is no longer advanced,\n // which indicates that no more new operations were enqueued and that all\n // operations were executed.\n let t;\n do {\n t = this.Mc, await t;\n } while (t !== this.Mc);\n }\n /**\n * For Tests: Determine if a delayed operation with a particular TimerId\n * exists.\n */ Hc(t) {\n for (const e of this.$c) if (e.timerId === t) return !0;\n return !1;\n }\n /**\n * For Tests: Runs some or all delayed operations early.\n *\n * @param lastTimerId - Delayed operations up to and including this TimerId\n * will be drained. Pass TimerId.All to run all delayed operations.\n * @returns a Promise that resolves once all operations have been run.\n */ Jc(t) {\n // Note that draining may generate more delayed ops, so we do that first.\n return this.zc().then((() => {\n // Run ops in the same order they'd run if they ran naturally.\n this.$c.sort(((t, e) => t.targetTimeMs - e.targetTimeMs));\n for (const e of this.$c) if (e.skipDelay(), \"all\" /* All */ !== t && e.timerId === t) break;\n return this.zc();\n }));\n }\n /**\n * For Tests: Skip all subsequent delays for a timer id.\n */ Yc(t) {\n this.qc.push(t);\n }\n /** Called once a DelayedOperation is run or canceled. */ Wc(t) {\n // NOTE: indexOf / slice are O(n), but delayedOperations is expected to be small.\n const e = this.$c.indexOf(t);\n this.$c.splice(e, 1);\n }\n}\n\nfunction Oa(t) {\n /**\n * Returns true if obj is an object and contains at least one of the specified\n * methods.\n */\n return function(t, e) {\n if (\"object\" != typeof t || null === t) return !1;\n const n = t;\n for (const t of e) if (t in n && \"function\" == typeof n[t]) return !0;\n return !1;\n }\n /**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n /**\n * Represents the task of loading a Firestore bundle. It provides progress of bundle\n * loading, as well as task completion and error events.\n *\n * The API is compatible with `Promise<LoadBundleTaskProgress>`.\n */ (t, [ \"next\", \"error\", \"complete\" ]);\n}\n\nclass Fa {\n constructor() {\n this._progressObserver = {}, this._taskCompletionResolver = new j, this._lastProgress = {\n taskState: \"Running\",\n totalBytes: 0,\n totalDocuments: 0,\n bytesLoaded: 0,\n documentsLoaded: 0\n };\n }\n /**\n * Registers functions to listen to bundle loading progress events.\n * @param next - Called when there is a progress update from bundle loading. Typically `next` calls occur\n * each time a Firestore document is loaded from the bundle.\n * @param error - Called when an error occurs during bundle loading. The task aborts after reporting the\n * error, and there should be no more updates after this.\n * @param complete - Called when the loading task is complete.\n */ onProgress(t, e, n) {\n this._progressObserver = {\n next: t,\n error: e,\n complete: n\n };\n }\n /**\n * Implements the `Promise<LoadBundleTaskProgress>.catch` interface.\n *\n * @param onRejected - Called when an error occurs during bundle loading.\n */ catch(t) {\n return this._taskCompletionResolver.promise.catch(t);\n }\n /**\n * Implements the `Promise<LoadBundleTaskProgress>.then` interface.\n *\n * @param onFulfilled - Called on the completion of the loading task with a final `LoadBundleTaskProgress` update.\n * The update will always have its `taskState` set to `\"Success\"`.\n * @param onRejected - Called when an error occurs during bundle loading.\n */ then(t, e) {\n return this._taskCompletionResolver.promise.then(t, e);\n }\n /**\n * Notifies all observers that bundle loading has completed, with a provided\n * `LoadBundleTaskProgress` object.\n *\n * @private\n */ _completeWith(t) {\n this._updateProgress(t), this._progressObserver.complete && this._progressObserver.complete(), \n this._taskCompletionResolver.resolve(t);\n }\n /**\n * Notifies all observers that bundle loading has failed, with a provided\n * `Error` as the reason.\n *\n * @private\n */ _failWith(t) {\n this._lastProgress.taskState = \"Error\", this._progressObserver.next && this._progressObserver.next(this._lastProgress), \n this._progressObserver.error && this._progressObserver.error(t), this._taskCompletionResolver.reject(t);\n }\n /**\n * Notifies a progress update of loading a bundle.\n * @param progress - The new progress.\n *\n * @private\n */ _updateProgress(t) {\n this._lastProgress = t, this._progressObserver.next && this._progressObserver.next(t);\n }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** DOMException error code constants. */ const $a = -1;\n\n/**\n * The Cloud Firestore service interface.\n *\n * Do not call this constructor directly. Instead, use {@link getFirestore}.\n */\nclass Ba extends ba {\n /** @hideconstructor */\n constructor(t, e, n) {\n super(t, e, n), \n /**\n * Whether it's a {@link Firestore} or Firestore Lite instance.\n */\n this.type = \"firestore\", this._queue = new Ma, this._persistenceKey = \"name\" in t ? t.name : \"[DEFAULT]\";\n }\n _terminate() {\n return this._firestoreClient || \n // The client must be initialized to ensure that all subsequent API\n // usage throws an exception.\n Ka(this), this._firestoreClient.terminate();\n }\n}\n\n/**\n * Initializes a new instance of {@link Firestore} with the provided settings.\n * Can only be called before any other function, including\n * {@link getFirestore}. If the custom settings are empty, this function is\n * equivalent to calling {@link getFirestore}.\n *\n * @param app - The {@link @firebase/app#FirebaseApp} with which the {@link Firestore} instance will\n * be associated.\n * @param settings - A settings object to configure the {@link Firestore} instance.\n * @returns A newly initialized {@link Firestore} instance.\n */ function La(t, e) {\n const n = _getProvider(t, \"firestore\");\n if (n.isInitialized()) {\n const t = n.getImmediate(), s = n.getOptions();\n if (deepEqual(s, e)) return t;\n throw new Q(G.FAILED_PRECONDITION, \"initializeFirestore() has already been called with different options. To avoid this error, call initializeFirestore() with the same options as when it was originally called, or call getFirestore() to return the already initialized instance.\");\n }\n if (void 0 !== e.cacheSizeBytes && -1 !== e.cacheSizeBytes && e.cacheSizeBytes < 1048576) throw new Q(G.INVALID_ARGUMENT, \"cacheSizeBytes must be at least 1048576\");\n return n.initialize({\n options: e\n });\n}\n\n/**\n * Returns the existing {@link Firestore} instance that is associated with the\n * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new\n * instance with default settings.\n *\n * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore}\n * instance is associated with.\n * @returns The {@link Firestore} instance of the provided app.\n */ function Ua(e = getApp()) {\n return _getProvider(e, \"firestore\").getImmediate();\n}\n\n/**\n * @internal\n */ function qa(t) {\n return t._firestoreClient || Ka(t), t._firestoreClient.verifyNotTerminated(), t._firestoreClient;\n}\n\nfunction Ka(t) {\n var e;\n const n = t._freezeSettings(), s = function(t, e, n, s) {\n return new oe(t, e, n, s.host, s.ssl, s.experimentalForceLongPolling, s.experimentalAutoDetectLongPolling, s.useFetchStreams);\n }(t._databaseId, (null === (e = t._app) || void 0 === e ? void 0 : e.options.appId) || \"\", t._persistenceKey, n);\n t._firestoreClient = new Jc(t._authCredentials, t._appCheckCredentials, t._queue, s);\n}\n\n/**\n * Attempts to enable persistent storage, if possible.\n *\n * Must be called before any other functions (other than\n * {@link initializeFirestore}, {@link getFirestore} or\n * {@link clearIndexedDbPersistence}.\n *\n * If this fails, `enableIndexedDbPersistence()` will reject the promise it\n * returns. Note that even after this failure, the {@link Firestore} instance will\n * remain usable, however offline persistence will be disabled.\n *\n * There are several reasons why this can fail, which can be identified by\n * the `code` on the error.\n *\n * * failed-precondition: The app is already open in another browser tab.\n * * unimplemented: The browser is incompatible with the offline\n * persistence implementation.\n *\n * @param firestore - The {@link Firestore} instance to enable persistence for.\n * @param persistenceSettings - Optional settings object to configure\n * persistence.\n * @returns A `Promise` that represents successfully enabling persistent storage.\n */ function Ga(t, e) {\n th(t = Ea(t, Ba));\n const n = qa(t), s = t._freezeSettings(), i = new Gc;\n return ja(n, i, new qc(i, s.cacheSizeBytes, null == e ? void 0 : e.forceOwnership));\n}\n\n/**\n * Attempts to enable multi-tab persistent storage, if possible. If enabled\n * across all tabs, all operations share access to local persistence, including\n * shared execution of queries and latency-compensated local document updates\n * across all connected instances.\n *\n * If this fails, `enableMultiTabIndexedDbPersistence()` will reject the promise\n * it returns. Note that even after this failure, the {@link Firestore} instance will\n * remain usable, however offline persistence will be disabled.\n *\n * There are several reasons why this can fail, which can be identified by\n * the `code` on the error.\n *\n * * failed-precondition: The app is already open in another browser tab and\n * multi-tab is not enabled.\n * * unimplemented: The browser is incompatible with the offline\n * persistence implementation.\n *\n * @param firestore - The {@link Firestore} instance to enable persistence for.\n * @returns A `Promise` that represents successfully enabling persistent\n * storage.\n */ function Qa(t) {\n th(t = Ea(t, Ba));\n const e = qa(t), n = t._freezeSettings(), s = new Gc;\n return ja(e, s, new Kc(s, n.cacheSizeBytes));\n}\n\n/**\n * Registers both the `OfflineComponentProvider` and `OnlineComponentProvider`.\n * If the operation fails with a recoverable error (see\n * `canRecoverFromIndexedDbError()` below), the returned Promise is rejected\n * but the client remains usable.\n */ function ja(t, e, n) {\n const s = new j;\n return t.asyncQueue.enqueue((async () => {\n try {\n await Yc(t, n), await Xc(t, e), s.resolve();\n } catch (t) {\n const e = t;\n if (!\n /**\n * Decides whether the provided error allows us to gracefully disable\n * persistence (as opposed to crashing the client).\n */\n function(t) {\n if (\"FirebaseError\" === t.name) return t.code === G.FAILED_PRECONDITION || t.code === G.UNIMPLEMENTED;\n if (\"undefined\" != typeof DOMException && t instanceof DOMException) \n // There are a few known circumstances where we can open IndexedDb but\n // trying to read/write will fail (e.g. quota exceeded). For\n // well-understood cases, we attempt to detect these and then gracefully\n // fall back to memory persistence.\n // NOTE: Rather than continue to add to this list, we could decide to\n // always fall back, with the risk that we might accidentally hide errors\n // representing actual SDK bugs.\n // When the browser is out of quota we could get either quota exceeded\n // or an aborted error depending on whether the error happened during\n // schema migration.\n return 22 === t.code || 20 === t.code || \n // Firefox Private Browsing mode disables IndexedDb and returns\n // INVALID_STATE for any usage.\n 11 === t.code;\n return !0;\n }\n /**\n * Clears the persistent storage. This includes pending writes and cached\n * documents.\n *\n * Must be called while the {@link Firestore} instance is not started (after the app is\n * terminated or when the app is first initialized). On startup, this function\n * must be called before other functions (other than {@link\n * initializeFirestore} or {@link getFirestore})). If the {@link Firestore}\n * instance is still running, the promise will be rejected with the error code\n * of `failed-precondition`.\n *\n * Note: `clearIndexedDbPersistence()` is primarily intended to help write\n * reliable tests that use Cloud Firestore. It uses an efficient mechanism for\n * dropping existing data but does not attempt to securely overwrite or\n * otherwise make cached data unrecoverable. For applications that are sensitive\n * to the disclosure of cached data in between user sessions, we strongly\n * recommend not enabling persistence at all.\n *\n * @param firestore - The {@link Firestore} instance to clear persistence for.\n * @returns A `Promise` that is resolved when the persistent storage is\n * cleared. Otherwise, the promise is rejected with an error.\n */ (e)) throw e;\n $(\"Error enabling offline persistence. Falling back to persistence disabled: \" + e), \n s.reject(e);\n }\n })).then((() => s.promise));\n}\n\nfunction Wa(t) {\n if (t._initialized && !t._terminated) throw new Q(G.FAILED_PRECONDITION, \"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.\");\n const e = new j;\n return t._queue.enqueueAndForgetEvenWhileRestricted((async () => {\n try {\n await async function(t) {\n if (!Dt.V()) return Promise.resolve();\n const e = t + \"main\";\n await Dt.delete(e);\n }\n /**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n /**\n * Compares two array for equality using comparator. The method computes the\n * intersection and invokes `onAdd` for every element that is in `after` but not\n * `before`. `onRemove` is invoked for every element in `before` but missing\n * from `after`.\n *\n * The method creates a copy of both `before` and `after` and runs in O(n log\n * n), where n is the size of the two lists.\n *\n * @param before - The elements that exist in the original array.\n * @param after - The elements to diff against the original array.\n * @param comparator - The comparator for the elements in before and after.\n * @param onAdd - A function to invoke for every element that is part of `\n * after` but not `before`.\n * @param onRemove - A function to invoke for every element that is part of\n * `before` but not `after`.\n */ (Eo(t._databaseId, t._persistenceKey)), e.resolve();\n } catch (t) {\n e.reject(t);\n }\n })), e.promise;\n}\n\n/**\n * Waits until all currently pending writes for the active user have been\n * acknowledged by the backend.\n *\n * The returned promise resolves immediately if there are no outstanding writes.\n * Otherwise, the promise waits for all previously issued writes (including\n * those written in a previous app session), but it does not wait for writes\n * that were added after the function is called. If you want to wait for\n * additional writes, call `waitForPendingWrites()` again.\n *\n * Any outstanding `waitForPendingWrites()` promises are rejected during user\n * changes.\n *\n * @returns A `Promise` which resolves when all currently pending writes have been\n * acknowledged by the backend.\n */ function za(t) {\n return function(t) {\n const e = new j;\n return t.asyncQueue.enqueueAndForget((async () => yc(await ia(t), e))), e.promise;\n }(qa(t = Ea(t, Ba)));\n}\n\n/**\n * Re-enables use of the network for this {@link Firestore} instance after a prior\n * call to {@link disableNetwork}.\n *\n * @returns A `Promise` that is resolved once the network has been enabled.\n */ function Ha(t) {\n return oa(qa(t = Ea(t, Ba)));\n}\n\n/**\n * Disables network usage for this instance. It can be re-enabled via {@link\n * enableNetwork}. While the network is disabled, any snapshot listeners,\n * `getDoc()` or `getDocs()` calls will return results from cache, and any write\n * operations will be queued until the network is restored.\n *\n * @returns A `Promise` that is resolved once the network has been disabled.\n */ function Ja(t) {\n return ua(qa(t = Ea(t, Ba)));\n}\n\n/**\n * Terminates the provided {@link Firestore} instance.\n *\n * After calling `terminate()` only the `clearIndexedDbPersistence()` function\n * may be used. Any other function will throw a `FirestoreError`.\n *\n * To restart after termination, create a new instance of FirebaseFirestore with\n * {@link getFirestore}.\n *\n * Termination does not cancel any pending writes, and any promises that are\n * awaiting a response from the server will not be resolved. If you have\n * persistence enabled, the next time you start this instance, it will resume\n * sending these writes to the server.\n *\n * Note: Under normal circumstances, calling `terminate()` is not required. This\n * function is useful only when you want to force this instance to release all\n * of its resources or in combination with `clearIndexedDbPersistence()` to\n * ensure that all local state is destroyed between test runs.\n *\n * @returns A `Promise` that is resolved when the instance has been successfully\n * terminated.\n */ function Ya(t) {\n return _removeServiceInstance(t.app, \"firestore\"), t._delete();\n}\n\n/**\n * Loads a Firestore bundle into the local cache.\n *\n * @param firestore - The {@link Firestore} instance to load bundles for.\n * @param bundleData - An object representing the bundle to be loaded. Valid\n * objects are `ArrayBuffer`, `ReadableStream<Uint8Array>` or `string`.\n *\n * @returns A `LoadBundleTask` object, which notifies callers with progress\n * updates, and completion or error events. It can be used as a\n * `Promise<LoadBundleTaskProgress>`.\n */ function Xa(t, e) {\n const n = qa(t = Ea(t, Ba)), s = new Fa;\n return _a(n, t._databaseId, e, s), s;\n}\n\n/**\n * Reads a Firestore {@link Query} from local cache, identified by the given\n * name.\n *\n * The named queries are packaged into bundles on the server side (along\n * with resulting documents), and loaded to local cache using `loadBundle`. Once\n * in local cache, use this method to extract a {@link Query} by name.\n *\n * @param firestore - The {@link Firestore} instance to read the query from.\n * @param name - The name of the query.\n * @returns A `Promise` that is resolved with the Query or `null`.\n */ function Za(t, e) {\n return wa(qa(t = Ea(t, Ba)), e).then((e => e ? new Va(t, null, e.query) : null));\n}\n\nfunction th(t) {\n if (t._initialized || t._terminated) throw new Q(G.FAILED_PRECONDITION, \"Firestore has already been started and persistence can no longer be enabled. You can only enable persistence before calling any other methods on a Firestore object.\");\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A `FieldPath` refers to a field in a document. The path may consist of a\n * single field name (referring to a top-level field in the document), or a\n * list of field names (referring to a nested field in the document).\n *\n * Create a `FieldPath` by providing field names. If more than one field\n * name is provided, the path will point to a nested field in a document.\n */\nclass eh {\n /**\n * Creates a `FieldPath` from the provided field names. If more than one field\n * name is provided, the path will point to a nested field in a document.\n *\n * @param fieldNames - A list of field names.\n */\n constructor(...t) {\n for (let e = 0; e < t.length; ++e) if (0 === t[e].length) throw new Q(G.INVALID_ARGUMENT, \"Invalid field name at argument $(i + 1). Field names must not be empty.\");\n this._internalPath = new ft(t);\n }\n /**\n * Returns true if this `FieldPath` is equal to the provided one.\n *\n * @param other - The `FieldPath` to compare against.\n * @returns true if this `FieldPath` is equal to the provided one.\n */ isEqual(t) {\n return this._internalPath.isEqual(t._internalPath);\n }\n}\n\n/**\n * Returns a special sentinel `FieldPath` to refer to the ID of a document.\n * It can be used in queries to sort or filter by the document ID.\n */ function nh() {\n return new eh(\"__name__\");\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * An immutable object representing an array of bytes.\n */ class sh {\n /** @hideconstructor */\n constructor(t) {\n this._byteString = t;\n }\n /**\n * Creates a new `Bytes` object from the given Base64 string, converting it to\n * bytes.\n *\n * @param base64 - The Base64 string used to create the `Bytes` object.\n */ static fromBase64String(t) {\n try {\n return new sh(Xt.fromBase64String(t));\n } catch (t) {\n throw new Q(G.INVALID_ARGUMENT, \"Failed to construct data from Base64 string: \" + t);\n }\n }\n /**\n * Creates a new `Bytes` object from the given Uint8Array.\n *\n * @param array - The Uint8Array used to create the `Bytes` object.\n */ static fromUint8Array(t) {\n return new sh(Xt.fromUint8Array(t));\n }\n /**\n * Returns the underlying bytes as a Base64-encoded string.\n *\n * @returns The Base64-encoded string created from the `Bytes` object.\n */ toBase64() {\n return this._byteString.toBase64();\n }\n /**\n * Returns the underlying bytes in a new `Uint8Array`.\n *\n * @returns The Uint8Array created from the `Bytes` object.\n */ toUint8Array() {\n return this._byteString.toUint8Array();\n }\n /**\n * Returns a string representation of the `Bytes` object.\n *\n * @returns A string representation of the `Bytes` object.\n */ toString() {\n return \"Bytes(base64: \" + this.toBase64() + \")\";\n }\n /**\n * Returns true if this `Bytes` object is equal to the provided one.\n *\n * @param other - The `Bytes` object to compare against.\n * @returns true if this `Bytes` object is equal to the provided one.\n */ isEqual(t) {\n return this._byteString.isEqual(t._byteString);\n }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Sentinel values that can be used when writing document fields with `set()`\n * or `update()`.\n */ class ih {\n /**\n * @param _methodName - The public API endpoint that returns this class.\n * @hideconstructor\n */\n constructor(t) {\n this._methodName = t;\n }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * An immutable object representing a geographic location in Firestore. The\n * location is represented as latitude/longitude pair.\n *\n * Latitude values are in the range of [-90, 90].\n * Longitude values are in the range of [-180, 180].\n */ class rh {\n /**\n * Creates a new immutable `GeoPoint` object with the provided latitude and\n * longitude values.\n * @param latitude - The latitude as number between -90 and 90.\n * @param longitude - The longitude as number between -180 and 180.\n */\n constructor(t, e) {\n if (!isFinite(t) || t < -90 || t > 90) throw new Q(G.INVALID_ARGUMENT, \"Latitude must be a number between -90 and 90, but was: \" + t);\n if (!isFinite(e) || e < -180 || e > 180) throw new Q(G.INVALID_ARGUMENT, \"Longitude must be a number between -180 and 180, but was: \" + e);\n this._lat = t, this._long = e;\n }\n /**\n * The latitude of this `GeoPoint` instance.\n */ get latitude() {\n return this._lat;\n }\n /**\n * The longitude of this `GeoPoint` instance.\n */ get longitude() {\n return this._long;\n }\n /**\n * Returns true if this `GeoPoint` is equal to the provided one.\n *\n * @param other - The `GeoPoint` to compare against.\n * @returns true if this `GeoPoint` is equal to the provided one.\n */ isEqual(t) {\n return this._lat === t._lat && this._long === t._long;\n }\n /** Returns a JSON-serializable representation of this GeoPoint. */ toJSON() {\n return {\n latitude: this._lat,\n longitude: this._long\n };\n }\n /**\n * Actually private to JS consumers of our API, so this function is prefixed\n * with an underscore.\n */ _compareTo(t) {\n return it(this._lat, t._lat) || it(this._long, t._long);\n }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ const oh = /^__.*__$/;\n\n/** The result of parsing document data (e.g. for a setData call). */ class uh {\n constructor(t, e, n) {\n this.data = t, this.fieldMask = e, this.fieldTransforms = n;\n }\n toMutation(t, e) {\n return null !== this.fieldMask ? new Hn(t, this.data, this.fieldMask, e, this.fieldTransforms) : new zn(t, this.data, e, this.fieldTransforms);\n }\n}\n\n/** The result of parsing \"update\" data (i.e. for an updateData call). */ class ch {\n constructor(t, \n // The fieldMask does not include document transforms.\n e, n) {\n this.data = t, this.fieldMask = e, this.fieldTransforms = n;\n }\n toMutation(t, e) {\n return new Hn(t, this.data, this.fieldMask, e, this.fieldTransforms);\n }\n}\n\nfunction ah(t) {\n switch (t) {\n case 0 /* Set */ :\n // fall through\n case 2 /* MergeSet */ :\n // fall through\n case 1 /* Update */ :\n return !0;\n\n case 3 /* Argument */ :\n case 4 /* ArrayArgument */ :\n return !1;\n\n default:\n throw L();\n }\n}\n\n/** A \"context\" object passed around while parsing user data. */ class hh {\n /**\n * Initializes a ParseContext with the given source and path.\n *\n * @param settings - The settings for the parser.\n * @param databaseId - The database ID of the Firestore instance.\n * @param serializer - The serializer to use to generate the Value proto.\n * @param ignoreUndefinedProperties - Whether to ignore undefined properties\n * rather than throw.\n * @param fieldTransforms - A mutable list of field transforms encountered\n * while parsing the data.\n * @param fieldMask - A mutable list of field paths encountered while parsing\n * the data.\n *\n * TODO(b/34871131): We don't support array paths right now, so path can be\n * null to indicate the context represents any location within an array (in\n * which case certain features will not work and errors will be somewhat\n * compromised).\n */\n constructor(t, e, n, s, i, r) {\n this.settings = t, this.databaseId = e, this.wt = n, this.ignoreUndefinedProperties = s, \n // Minor hack: If fieldTransforms is undefined, we assume this is an\n // external call and we need to validate the entire path.\n void 0 === i && this.Xc(), this.fieldTransforms = i || [], this.fieldMask = r || [];\n }\n get path() {\n return this.settings.path;\n }\n get Zc() {\n return this.settings.Zc;\n }\n /** Returns a new context with the specified settings overwritten. */ ta(t) {\n return new hh(Object.assign(Object.assign({}, this.settings), t), this.databaseId, this.wt, this.ignoreUndefinedProperties, this.fieldTransforms, this.fieldMask);\n }\n ea(t) {\n var e;\n const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), s = this.ta({\n path: n,\n na: !1\n });\n return s.sa(t), s;\n }\n ia(t) {\n var e;\n const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), s = this.ta({\n path: n,\n na: !1\n });\n return s.Xc(), s;\n }\n ra(t) {\n // TODO(b/34871131): We don't support array paths right now; so make path\n // undefined.\n return this.ta({\n path: void 0,\n na: !0\n });\n }\n oa(t) {\n return Dh(t, this.settings.methodName, this.settings.ua || !1, this.path, this.settings.ca);\n }\n /** Returns 'true' if 'fieldPath' was traversed when creating this context. */ contains(t) {\n return void 0 !== this.fieldMask.find((e => t.isPrefixOf(e))) || void 0 !== this.fieldTransforms.find((e => t.isPrefixOf(e.field)));\n }\n Xc() {\n // TODO(b/34871131): Remove null check once we have proper paths for fields\n // within arrays.\n if (this.path) for (let t = 0; t < this.path.length; t++) this.sa(this.path.get(t));\n }\n sa(t) {\n if (0 === t.length) throw this.oa(\"Document fields must not be empty\");\n if (ah(this.Zc) && oh.test(t)) throw this.oa('Document fields cannot begin and end with \"__\"');\n }\n}\n\n/**\n * Helper for parsing raw user input (provided via the API) into internal model\n * classes.\n */ class lh {\n constructor(t, e, n) {\n this.databaseId = t, this.ignoreUndefinedProperties = e, this.wt = n || iu(t);\n }\n /** Creates a new top-level parse context. */ aa(t, e, n, s = !1) {\n return new hh({\n Zc: t,\n methodName: e,\n ca: n,\n path: ft.emptyPath(),\n na: !1,\n ua: s\n }, this.databaseId, this.wt, this.ignoreUndefinedProperties);\n }\n}\n\nfunction fh(t) {\n const e = t._freezeSettings(), n = iu(t._databaseId);\n return new lh(t._databaseId, !!e.ignoreUndefinedProperties, n);\n}\n\n/** Parse document data from a set() call. */ function dh(t, e, n, s, i, r = {}) {\n const o = t.aa(r.merge || r.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, i);\n Ph(\"Data must be an object, but it was:\", o, s);\n const u = Rh(s, o);\n let c, a;\n if (r.merge) c = new Jt(o.fieldMask), a = o.fieldTransforms; else if (r.mergeFields) {\n const t = [];\n for (const s of r.mergeFields) {\n const i = vh(e, s, n);\n if (!o.contains(i)) throw new Q(G.INVALID_ARGUMENT, `Field '${i}' is specified in your field mask but missing from your input data.`);\n Ch(t, i) || t.push(i);\n }\n c = new Jt(t), a = o.fieldTransforms.filter((t => c.covers(t.field)));\n } else c = null, a = o.fieldTransforms;\n return new uh(new xe(u), c, a);\n}\n\nclass _h extends ih {\n _toFieldTransform(t) {\n if (2 /* MergeSet */ !== t.Zc) throw 1 /* Update */ === t.Zc ? t.oa(`${this._methodName}() can only appear at the top level of your update data`) : t.oa(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);\n // No transform to add for a delete, but we need to add it to our\n // fieldMask so it gets deleted.\n return t.fieldMask.push(t.path), null;\n }\n isEqual(t) {\n return t instanceof _h;\n }\n}\n\n/**\n * Creates a child context for parsing SerializableFieldValues.\n *\n * This is different than calling `ParseContext.contextWith` because it keeps\n * the fieldTransforms and fieldMask separate.\n *\n * The created context has its `dataSource` set to `UserDataSource.Argument`.\n * Although these values are used with writes, any elements in these FieldValues\n * are not considered writes since they cannot contain any FieldValue sentinels,\n * etc.\n *\n * @param fieldValue - The sentinel FieldValue for which to create a child\n * context.\n * @param context - The parent context.\n * @param arrayElement - Whether or not the FieldValue has an array.\n */ function wh(t, e, n) {\n return new hh({\n Zc: 3 /* Argument */ ,\n ca: e.settings.ca,\n methodName: t._methodName,\n na: n\n }, e.databaseId, e.wt, e.ignoreUndefinedProperties);\n}\n\nclass mh extends ih {\n _toFieldTransform(t) {\n return new Fn(t.path, new Sn);\n }\n isEqual(t) {\n return t instanceof mh;\n }\n}\n\nclass gh extends ih {\n constructor(t, e) {\n super(t), this.ha = e;\n }\n _toFieldTransform(t) {\n const e = wh(this, t, \n /*array=*/ !0), n = this.ha.map((t => Ah(t, e))), s = new Dn(n);\n return new Fn(t.path, s);\n }\n isEqual(t) {\n // TODO(mrschmidt): Implement isEquals\n return this === t;\n }\n}\n\nclass yh extends ih {\n constructor(t, e) {\n super(t), this.ha = e;\n }\n _toFieldTransform(t) {\n const e = wh(this, t, \n /*array=*/ !0), n = this.ha.map((t => Ah(t, e))), s = new xn(n);\n return new Fn(t.path, s);\n }\n isEqual(t) {\n // TODO(mrschmidt): Implement isEquals\n return this === t;\n }\n}\n\nclass ph extends ih {\n constructor(t, e) {\n super(t), this.la = e;\n }\n _toFieldTransform(t) {\n const e = new kn(t.wt, Rn(t.wt, this.la));\n return new Fn(t.path, e);\n }\n isEqual(t) {\n // TODO(mrschmidt): Implement isEquals\n return this === t;\n }\n}\n\n/** Parse update data from an update() call. */ function Ih(t, e, n, s) {\n const i = t.aa(1 /* Update */ , e, n);\n Ph(\"Data must be an object, but it was:\", i, s);\n const r = [], o = xe.empty();\n qt(s, ((t, s) => {\n const u = Sh(e, t, n);\n // For Compat types, we have to \"extract\" the underlying types before\n // performing validation.\n s = getModularInstance(s);\n const c = i.ia(u);\n if (s instanceof _h) \n // Add it to the field mask, but don't add anything to updateData.\n r.push(u); else {\n const t = Ah(s, c);\n null != t && (r.push(u), o.set(u, t));\n }\n }));\n const u = new Jt(r);\n return new ch(o, u, i.fieldTransforms);\n}\n\n/** Parse update data from a list of field/value arguments. */ function Th(t, e, n, s, i, r) {\n const o = t.aa(1 /* Update */ , e, n), u = [ vh(e, s, n) ], c = [ i ];\n if (r.length % 2 != 0) throw new Q(G.INVALID_ARGUMENT, `Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);\n for (let t = 0; t < r.length; t += 2) u.push(vh(e, r[t])), c.push(r[t + 1]);\n const a = [], h = xe.empty();\n // We iterate in reverse order to pick the last value for a field if the\n // user specified the field multiple times.\n for (let t = u.length - 1; t >= 0; --t) if (!Ch(a, u[t])) {\n const e = u[t];\n let n = c[t];\n // For Compat types, we have to \"extract\" the underlying types before\n // performing validation.\n n = getModularInstance(n);\n const s = o.ia(e);\n if (n instanceof _h) \n // Add it to the field mask, but don't add anything to updateData.\n a.push(e); else {\n const t = Ah(n, s);\n null != t && (a.push(e), h.set(e, t));\n }\n }\n const l = new Jt(a);\n return new ch(h, l, o.fieldTransforms);\n}\n\n/**\n * Parse a \"query value\" (e.g. value in a where filter or a value in a cursor\n * bound).\n *\n * @param allowArrays - Whether the query value is an array that may directly\n * contain additional arrays (e.g. the operand of an `in` query).\n */ function Eh(t, e, n, s = !1) {\n return Ah(n, t.aa(s ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));\n}\n\n/**\n * Parses user data to Protobuf Values.\n *\n * @param input - Data to be parsed.\n * @param context - A context object representing the current path being parsed,\n * the source of the data being parsed, etc.\n * @returns The parsed value, or null if the value was a FieldValue sentinel\n * that should not be included in the resulting parsed data.\n */ function Ah(t, e) {\n if (bh(\n // Unwrap the API type from the Compat SDK. This will return the API type\n // from firestore-exp.\n t = getModularInstance(t))) return Ph(\"Unsupported field value:\", e, t), Rh(t, e);\n if (t instanceof ih) \n // FieldValues usually parse into transforms (except deleteField())\n // in which case we do not want to include this field in our parsed data\n // (as doing so will overwrite the field directly prior to the transform\n // trying to transform it). So we don't add this location to\n // context.fieldMask and we return null as our parsing result.\n /**\n * \"Parses\" the provided FieldValueImpl, adding any necessary transforms to\n * context.fieldTransforms.\n */\n return function(t, e) {\n // Sentinels are only supported with writes, and not within arrays.\n if (!ah(e.Zc)) throw e.oa(`${t._methodName}() can only be used with update() and set()`);\n if (!e.path) throw e.oa(`${t._methodName}() is not currently supported inside arrays`);\n const n = t._toFieldTransform(e);\n n && e.fieldTransforms.push(n);\n }\n /**\n * Helper to parse a scalar value (i.e. not an Object, Array, or FieldValue)\n *\n * @returns The parsed value\n */ (t, e), null;\n if (void 0 === t && e.ignoreUndefinedProperties) \n // If the input is undefined it can never participate in the fieldMask, so\n // don't handle this below. If `ignoreUndefinedProperties` is false,\n // `parseScalarValue` will reject an undefined value.\n return null;\n if (\n // If context.path is null we are inside an array and we don't support\n // field mask paths more granular than the top-level array.\n e.path && e.fieldMask.push(e.path), t instanceof Array) {\n // TODO(b/34871131): Include the path containing the array in the error\n // message.\n // In the case of IN queries, the parsed data is an array (representing\n // the set of values to be included for the IN query) that may directly\n // contain additional arrays (each representing an individual field\n // value), so we disable this validation.\n if (e.settings.na && 4 /* ArrayArgument */ !== e.Zc) throw e.oa(\"Nested arrays are not supported\");\n return function(t, e) {\n const n = [];\n let s = 0;\n for (const i of t) {\n let t = Ah(i, e.ra(s));\n null == t && (\n // Just include nulls in the array for fields being replaced with a\n // sentinel.\n t = {\n nullValue: \"NULL_VALUE\"\n }), n.push(t), s++;\n }\n return {\n arrayValue: {\n values: n\n }\n };\n }(t, e);\n }\n return function(t, e) {\n if (null === (t = getModularInstance(t))) return {\n nullValue: \"NULL_VALUE\"\n };\n if (\"number\" == typeof t) return Rn(e.wt, t);\n if (\"boolean\" == typeof t) return {\n booleanValue: t\n };\n if (\"string\" == typeof t) return {\n stringValue: t\n };\n if (t instanceof Date) {\n const n = ut.fromDate(t);\n return {\n timestampValue: xs(e.wt, n)\n };\n }\n if (t instanceof ut) {\n // Firestore backend truncates precision down to microseconds. To ensure\n // offline mode works the same with regards to truncation, perform the\n // truncation immediately without waiting for the backend to do that.\n const n = new ut(t.seconds, 1e3 * Math.floor(t.nanoseconds / 1e3));\n return {\n timestampValue: xs(e.wt, n)\n };\n }\n if (t instanceof rh) return {\n geoPointValue: {\n latitude: t.latitude,\n longitude: t.longitude\n }\n };\n if (t instanceof sh) return {\n bytesValue: Ns(e.wt, t._byteString)\n };\n if (t instanceof va) {\n const n = e.databaseId, s = t.firestore._databaseId;\n if (!s.isEqual(n)) throw e.oa(`Document reference is for database ${s.projectId}/${s.database} but should be for database ${n.projectId}/${n.database}`);\n return {\n referenceValue: Os(t.firestore._databaseId || e.databaseId, t._key.path)\n };\n }\n throw e.oa(`Unsupported field value: ${Ta(t)}`);\n }\n /**\n * Checks whether an object looks like a JSON object that should be converted\n * into a struct. Normal class/prototype instances are considered to look like\n * JSON objects since they should be converted to a struct value. Arrays, Dates,\n * GeoPoints, etc. are not considered to look like JSON objects since they map\n * to specific FieldValue types other than ObjectValue.\n */ (t, e);\n}\n\nfunction Rh(t, e) {\n const n = {};\n return Kt(t) ? \n // If we encounter an empty object, we explicitly add it to the update\n // mask to ensure that the server creates a map entry.\n e.path && e.path.length > 0 && e.fieldMask.push(e.path) : qt(t, ((t, s) => {\n const i = Ah(s, e.ea(t));\n null != i && (n[t] = i);\n })), {\n mapValue: {\n fields: n\n }\n };\n}\n\nfunction bh(t) {\n return !(\"object\" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof ut || t instanceof rh || t instanceof sh || t instanceof va || t instanceof ih);\n}\n\nfunction Ph(t, e, n) {\n if (!bh(n) || !function(t) {\n return \"object\" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));\n }(n)) {\n const s = Ta(n);\n throw \"an object\" === s ? e.oa(t + \" a custom object\") : e.oa(t + \" \" + s);\n }\n}\n\n/**\n * Helper that calls fromDotSeparatedString() but wraps any error thrown.\n */ function vh(t, e, n) {\n if ((\n // If required, replace the FieldPath Compat class with with the firestore-exp\n // FieldPath.\n e = getModularInstance(e)) instanceof eh) return e._internalPath;\n if (\"string\" == typeof e) return Sh(t, e);\n throw Dh(\"Field path arguments must be of type string or \", t, \n /* hasConverter= */ !1, \n /* path= */ void 0, n);\n}\n\n/**\n * Matches any characters in a field path string that are reserved.\n */ const Vh = new RegExp(\"[~\\\\*/\\\\[\\\\]]\");\n\n/**\n * Wraps fromDotSeparatedString with an error message about the method that\n * was thrown.\n * @param methodName - The publicly visible method name\n * @param path - The dot-separated string form of a field path which will be\n * split on dots.\n * @param targetDoc - The document against which the field path will be\n * evaluated.\n */ function Sh(t, e, n) {\n if (e.search(Vh) >= 0) throw Dh(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`, t, \n /* hasConverter= */ !1, \n /* path= */ void 0, n);\n try {\n return new eh(...e.split(\".\"))._internalPath;\n } catch (s) {\n throw Dh(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`, t, \n /* hasConverter= */ !1, \n /* path= */ void 0, n);\n }\n}\n\nfunction Dh(t, e, n, s, i) {\n const r = s && !s.isEmpty(), o = void 0 !== i;\n let u = `Function ${e}() called with invalid data`;\n n && (u += \" (via `toFirestore()`)\"), u += \". \";\n let c = \"\";\n return (r || o) && (c += \" (found\", r && (c += ` in field ${s}`), o && (c += ` in document ${i}`), \n c += \")\"), new Q(G.INVALID_ARGUMENT, u + t + c);\n}\n\n/** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */ function Ch(t, e) {\n return t.some((t => t.isEqual(e)));\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A `DocumentSnapshot` contains data read from a document in your Firestore\n * database. The data can be extracted with `.data()` or `.get(<field>)` to\n * get a specific field.\n *\n * For a `DocumentSnapshot` that points to a non-existing document, any data\n * access will return 'undefined'. You can use the `exists()` method to\n * explicitly verify a document's existence.\n */ class xh {\n // Note: This class is stripped down version of the DocumentSnapshot in\n // the legacy SDK. The changes are:\n // - No support for SnapshotMetadata.\n // - No support for SnapshotOptions.\n /** @hideconstructor protected */\n constructor(t, e, n, s, i) {\n this._firestore = t, this._userDataWriter = e, this._key = n, this._document = s, \n this._converter = i;\n }\n /** Property of the `DocumentSnapshot` that provides the document's ID. */ get id() {\n return this._key.path.lastSegment();\n }\n /**\n * The `DocumentReference` for the document included in the `DocumentSnapshot`.\n */ get ref() {\n return new va(this._firestore, this._converter, this._key);\n }\n /**\n * Signals whether or not the document at the snapshot's location exists.\n *\n * @returns true if the document exists.\n */ exists() {\n return null !== this._document;\n }\n /**\n * Retrieves all fields in the document as an `Object`. Returns `undefined` if\n * the document doesn't exist.\n *\n * @returns An `Object` containing all fields in the document or `undefined`\n * if the document doesn't exist.\n */ data() {\n if (this._document) {\n if (this._converter) {\n // We only want to use the converter and create a new DocumentSnapshot\n // if a converter has been provided.\n const t = new Nh(this._firestore, this._userDataWriter, this._key, this._document, \n /* converter= */ null);\n return this._converter.fromFirestore(t);\n }\n return this._userDataWriter.convertValue(this._document.data.value);\n }\n }\n /**\n * Retrieves the field specified by `fieldPath`. Returns `undefined` if the\n * document or field doesn't exist.\n *\n * @param fieldPath - The path (for example 'foo' or 'foo.bar') to a specific\n * field.\n * @returns The data at the specified field location or undefined if no such\n * field exists in the document.\n */\n // We are using `any` here to avoid an explicit cast by our users.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n get(t) {\n if (this._document) {\n const e = this._document.data.field(kh(\"DocumentSnapshot.get\", t));\n if (null !== e) return this._userDataWriter.convertValue(e);\n }\n }\n}\n\n/**\n * A `QueryDocumentSnapshot` contains data read from a document in your\n * Firestore database as part of a query. The document is guaranteed to exist\n * and its data can be extracted with `.data()` or `.get(<field>)` to get a\n * specific field.\n *\n * A `QueryDocumentSnapshot` offers the same API surface as a\n * `DocumentSnapshot`. Since query results contain only existing documents, the\n * `exists` property will always be true and `data()` will never return\n * 'undefined'.\n */ class Nh extends xh {\n /**\n * Retrieves all fields in the document as an `Object`.\n *\n * @override\n * @returns An `Object` containing all fields in the document.\n */\n data() {\n return super.data();\n }\n}\n\n/**\n * Helper that calls `fromDotSeparatedString()` but wraps any error thrown.\n */ function kh(t, e) {\n return \"string\" == typeof e ? Sh(t, e) : e instanceof eh ? e._internalPath : e._delegate._internalPath;\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Metadata about a snapshot, describing the state of the snapshot.\n */ class Mh {\n /** @hideconstructor */\n constructor(t, e) {\n this.hasPendingWrites = t, this.fromCache = e;\n }\n /**\n * Returns true if this `SnapshotMetadata` is equal to the provided one.\n *\n * @param other - The `SnapshotMetadata` to compare against.\n * @returns true if this `SnapshotMetadata` is equal to the provided one.\n */ isEqual(t) {\n return this.hasPendingWrites === t.hasPendingWrites && this.fromCache === t.fromCache;\n }\n}\n\n/**\n * A `DocumentSnapshot` contains data read from a document in your Firestore\n * database. The data can be extracted with `.data()` or `.get(<field>)` to\n * get a specific field.\n *\n * For a `DocumentSnapshot` that points to a non-existing document, any data\n * access will return 'undefined'. You can use the `exists()` method to\n * explicitly verify a document's existence.\n */ class Oh extends xh {\n /** @hideconstructor protected */\n constructor(t, e, n, s, i, r) {\n super(t, e, n, s, r), this._firestore = t, this._firestoreImpl = t, this.metadata = i;\n }\n /**\n * Returns whether or not the data exists. True if the document exists.\n */ exists() {\n return super.exists();\n }\n /**\n * Retrieves all fields in the document as an `Object`. Returns `undefined` if\n * the document doesn't exist.\n *\n * By default, `serverTimestamp()` values that have not yet been\n * set to their final value will be returned as `null`. You can override\n * this by passing an options object.\n *\n * @param options - An options object to configure how data is retrieved from\n * the snapshot (for example the desired behavior for server timestamps that\n * have not yet been set to their final value).\n * @returns An `Object` containing all fields in the document or `undefined` if\n * the document doesn't exist.\n */ data(t = {}) {\n if (this._document) {\n if (this._converter) {\n // We only want to use the converter and create a new DocumentSnapshot\n // if a converter has been provided.\n const e = new Fh(this._firestore, this._userDataWriter, this._key, this._document, this.metadata, \n /* converter= */ null);\n return this._converter.fromFirestore(e, t);\n }\n return this._userDataWriter.convertValue(this._document.data.value, t.serverTimestamps);\n }\n }\n /**\n * Retrieves the field specified by `fieldPath`. Returns `undefined` if the\n * document or field doesn't exist.\n *\n * By default, a `serverTimestamp()` that has not yet been set to\n * its final value will be returned as `null`. You can override this by\n * passing an options object.\n *\n * @param fieldPath - The path (for example 'foo' or 'foo.bar') to a specific\n * field.\n * @param options - An options object to configure how the field is retrieved\n * from the snapshot (for example the desired behavior for server timestamps\n * that have not yet been set to their final value).\n * @returns The data at the specified field location or undefined if no such\n * field exists in the document.\n */\n // We are using `any` here to avoid an explicit cast by our users.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n get(t, e = {}) {\n if (this._document) {\n const n = this._document.data.field(kh(\"DocumentSnapshot.get\", t));\n if (null !== n) return this._userDataWriter.convertValue(n, e.serverTimestamps);\n }\n }\n}\n\n/**\n * A `QueryDocumentSnapshot` contains data read from a document in your\n * Firestore database as part of a query. The document is guaranteed to exist\n * and its data can be extracted with `.data()` or `.get(<field>)` to get a\n * specific field.\n *\n * A `QueryDocumentSnapshot` offers the same API surface as a\n * `DocumentSnapshot`. Since query results contain only existing documents, the\n * `exists` property will always be true and `data()` will never return\n * 'undefined'.\n */ class Fh extends Oh {\n /**\n * Retrieves all fields in the document as an `Object`.\n *\n * By default, `serverTimestamp()` values that have not yet been\n * set to their final value will be returned as `null`. You can override\n * this by passing an options object.\n *\n * @override\n * @param options - An options object to configure how data is retrieved from\n * the snapshot (for example the desired behavior for server timestamps that\n * have not yet been set to their final value).\n * @returns An `Object` containing all fields in the document.\n */\n data(t = {}) {\n return super.data(t);\n }\n}\n\n/**\n * A `QuerySnapshot` contains zero or more `DocumentSnapshot` objects\n * representing the results of a query. The documents can be accessed as an\n * array via the `docs` property or enumerated using the `forEach` method. The\n * number of documents can be determined via the `empty` and `size`\n * properties.\n */ class $h {\n /** @hideconstructor */\n constructor(t, e, n, s) {\n this._firestore = t, this._userDataWriter = e, this._snapshot = s, this.metadata = new Mh(s.hasPendingWrites, s.fromCache), \n this.query = n;\n }\n /** An array of all the documents in the `QuerySnapshot`. */ get docs() {\n const t = [];\n return this.forEach((e => t.push(e))), t;\n }\n /** The number of documents in the `QuerySnapshot`. */ get size() {\n return this._snapshot.docs.size;\n }\n /** True if there are no documents in the `QuerySnapshot`. */ get empty() {\n return 0 === this.size;\n }\n /**\n * Enumerates all of the documents in the `QuerySnapshot`.\n *\n * @param callback - A callback to be called with a `QueryDocumentSnapshot` for\n * each document in the snapshot.\n * @param thisArg - The `this` binding for the callback.\n */ forEach(t, e) {\n this._snapshot.docs.forEach((n => {\n t.call(e, new Fh(this._firestore, this._userDataWriter, n.key, n, new Mh(this._snapshot.mutatedKeys.has(n.key), this._snapshot.fromCache), this.query.converter));\n }));\n }\n /**\n * Returns an array of the documents changes since the last snapshot. If this\n * is the first snapshot, all documents will be in the list as 'added'\n * changes.\n *\n * @param options - `SnapshotListenOptions` that control whether metadata-only\n * changes (i.e. only `DocumentSnapshot.metadata` changed) should trigger\n * snapshot events.\n */ docChanges(t = {}) {\n const e = !!t.includeMetadataChanges;\n if (e && this._snapshot.excludesMetadataChanges) throw new Q(G.INVALID_ARGUMENT, \"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().\");\n return this._cachedChanges && this._cachedChangesIncludeMetadataChanges === e || (this._cachedChanges = \n /** Calculates the array of `DocumentChange`s for a given `ViewSnapshot`. */\n function(t, e) {\n if (t._snapshot.oldDocs.isEmpty()) {\n let e = 0;\n return t._snapshot.docChanges.map((n => ({\n type: \"added\",\n doc: new Fh(t._firestore, t._userDataWriter, n.doc.key, n.doc, new Mh(t._snapshot.mutatedKeys.has(n.doc.key), t._snapshot.fromCache), t.query.converter),\n oldIndex: -1,\n newIndex: e++\n })));\n }\n {\n // A `DocumentSet` that is updated incrementally as changes are applied to use\n // to lookup the index of a document.\n let n = t._snapshot.oldDocs;\n return t._snapshot.docChanges.filter((t => e || 3 /* Metadata */ !== t.type)).map((e => {\n const s = new Fh(t._firestore, t._userDataWriter, e.doc.key, e.doc, new Mh(t._snapshot.mutatedKeys.has(e.doc.key), t._snapshot.fromCache), t.query.converter);\n let i = -1, r = -1;\n return 0 /* Added */ !== e.type && (i = n.indexOf(e.doc.key), n = n.delete(e.doc.key)), \n 1 /* Removed */ !== e.type && (n = n.add(e.doc), r = n.indexOf(e.doc.key)), {\n type: Bh(e.type),\n doc: s,\n oldIndex: i,\n newIndex: r\n };\n }));\n }\n }(this, e), this._cachedChangesIncludeMetadataChanges = e), this._cachedChanges;\n }\n}\n\nfunction Bh(t) {\n switch (t) {\n case 0 /* Added */ :\n return \"added\";\n\n case 2 /* Modified */ :\n case 3 /* Metadata */ :\n return \"modified\";\n\n case 1 /* Removed */ :\n return \"removed\";\n\n default:\n return L();\n }\n}\n\n// TODO(firestoreexp): Add tests for snapshotEqual with different snapshot\n// metadata\n/**\n * Returns true if the provided snapshots are equal.\n *\n * @param left - A snapshot to compare.\n * @param right - A snapshot to compare.\n * @returns true if the snapshots are equal.\n */ function Lh(t, e) {\n return t instanceof Oh && e instanceof Oh ? t._firestore === e._firestore && t._key.isEqual(e._key) && (null === t._document ? null === e._document : t._document.isEqual(e._document)) && t._converter === e._converter : t instanceof $h && e instanceof $h && (t._firestore === e._firestore && ka(t.query, e.query) && t.metadata.isEqual(e.metadata) && t._snapshot.isEqual(e._snapshot));\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ function Uh(t) {\n if (\"L\" /* Last */ === t.limitType && 0 === t.explicitOrderBy.length) throw new Q(G.UNIMPLEMENTED, \"limitToLast() queries require specifying at least one orderBy() clause\");\n}\n\n/**\n * A `QueryConstraint` is used to narrow the set of documents returned by a\n * Firestore query. `QueryConstraint`s are created by invoking {@link where},\n * {@link orderBy}, {@link (startAt:1)}, {@link (startAfter:1)}, {@link\n * endBefore:1}, {@link (endAt:1)}, {@link limit} or {@link limitToLast} and\n * can then be passed to {@link query} to create a new query instance that\n * also contains this `QueryConstraint`.\n */ class qh {}\n\n/**\n * Creates a new immutable instance of {@link Query} that is extended to also include\n * additional query constraints.\n *\n * @param query - The {@link Query} instance to use as a base for the new constraints.\n * @param queryConstraints - The list of {@link QueryConstraint}s to apply.\n * @throws if any of the provided query constraints cannot be combined with the\n * existing or new constraints.\n */ function Kh(t, ...e) {\n for (const n of e) t = n._apply(t);\n return t;\n}\n\nclass Gh extends qh {\n constructor(t, e, n) {\n super(), this.fa = t, this.da = e, this._a = n, this.type = \"where\";\n }\n _apply(t) {\n const e = fh(t.firestore), n = function(t, e, n, s, i, r, o) {\n let u;\n if (i.isKeyField()) {\n if (\"array-contains\" /* ARRAY_CONTAINS */ === r || \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ === r) throw new Q(G.INVALID_ARGUMENT, `Invalid Query. You can't perform '${r}' queries on documentId().`);\n if (\"in\" /* IN */ === r || \"not-in\" /* NOT_IN */ === r) {\n rl(o, r);\n const e = [];\n for (const n of o) e.push(il(s, t, n));\n u = {\n arrayValue: {\n values: e\n }\n };\n } else u = il(s, t, o);\n } else \"in\" /* IN */ !== r && \"not-in\" /* NOT_IN */ !== r && \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ !== r || rl(o, r), \n u = Eh(n, e, o, \n /* allowArrays= */ \"in\" /* IN */ === r || \"not-in\" /* NOT_IN */ === r);\n const c = Ge.create(i, r, u);\n return function(t, e) {\n if (e.ht()) {\n const n = hn(t);\n if (null !== n && !n.isEqual(e.field)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '${n.toString()}' and '${e.field.toString()}'`);\n const s = an(t);\n null !== s && ol(t, e.field, s);\n }\n const n = function(t, e) {\n for (const n of t.filters) if (e.indexOf(n.op) >= 0) return n.op;\n return null;\n }(t, \n /**\n * Given an operator, returns the set of operators that cannot be used with it.\n *\n * Operators in a query must adhere to the following set of rules:\n * 1. Only one array operator is allowed.\n * 2. Only one disjunctive operator is allowed.\n * 3. `NOT_EQUAL` cannot be used with another `NOT_EQUAL` operator.\n * 4. `NOT_IN` cannot be used with array, disjunctive, or `NOT_EQUAL` operators.\n *\n * Array operators: `ARRAY_CONTAINS`, `ARRAY_CONTAINS_ANY`\n * Disjunctive operators: `IN`, `ARRAY_CONTAINS_ANY`, `NOT_IN`\n */\n function(t) {\n switch (t) {\n case \"!=\" /* NOT_EQUAL */ :\n return [ \"!=\" /* NOT_EQUAL */ , \"not-in\" /* NOT_IN */ ];\n\n case \"array-contains\" /* ARRAY_CONTAINS */ :\n return [ \"array-contains\" /* ARRAY_CONTAINS */ , \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ , \"not-in\" /* NOT_IN */ ];\n\n case \"in\" /* IN */ :\n return [ \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ , \"in\" /* IN */ , \"not-in\" /* NOT_IN */ ];\n\n case \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ :\n return [ \"array-contains\" /* ARRAY_CONTAINS */ , \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ , \"in\" /* IN */ , \"not-in\" /* NOT_IN */ ];\n\n case \"not-in\" /* NOT_IN */ :\n return [ \"array-contains\" /* ARRAY_CONTAINS */ , \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ , \"in\" /* IN */ , \"not-in\" /* NOT_IN */ , \"!=\" /* NOT_EQUAL */ ];\n\n default:\n return [];\n }\n }(e.op));\n if (null !== n) \n // Special case when it's a duplicate op to give a slightly clearer error message.\n throw n === e.op ? new Q(G.INVALID_ARGUMENT, `Invalid query. You cannot use more than one '${e.op.toString()}' filter.`) : new Q(G.INVALID_ARGUMENT, `Invalid query. You cannot use '${e.op.toString()}' filters with '${n.toString()}' filters.`);\n }(t, c), c;\n }(t._query, \"where\", e, t.firestore._databaseId, this.fa, this.da, this._a);\n return new Va(t.firestore, t.converter, function(t, e) {\n const n = t.filters.concat([ e ]);\n return new rn(t.path, t.collectionGroup, t.explicitOrderBy.slice(), n, t.limit, t.limitType, t.startAt, t.endAt);\n }(t._query, n));\n }\n}\n\n/**\n * Creates a {@link QueryConstraint} that enforces that documents must contain the\n * specified field and that the value should satisfy the relation constraint\n * provided.\n *\n * @param fieldPath - The path to compare\n * @param opStr - The operation string (e.g \"<\", \"<=\", \"==\", \"<\",\n * \"<=\", \"!=\").\n * @param value - The value for comparison\n * @returns The created {@link Query}.\n */ function Qh(t, e, n) {\n const s = e, i = kh(\"where\", t);\n return new Gh(i, s, n);\n}\n\nclass jh extends qh {\n constructor(t, e) {\n super(), this.fa = t, this.wa = e, this.type = \"orderBy\";\n }\n _apply(t) {\n const e = function(t, e, n) {\n if (null !== t.startAt) throw new Q(G.INVALID_ARGUMENT, \"Invalid query. You must not call startAt() or startAfter() before calling orderBy().\");\n if (null !== t.endAt) throw new Q(G.INVALID_ARGUMENT, \"Invalid query. You must not call endAt() or endBefore() before calling orderBy().\");\n const s = new tn(e, n);\n return function(t, e) {\n if (null === an(t)) {\n // This is the first order by. It must match any inequality.\n const n = hn(t);\n null !== n && ol(t, n, e.field);\n }\n }(t, s), s;\n }\n /**\n * Create a `Bound` from a query and a document.\n *\n * Note that the `Bound` will always include the key of the document\n * and so only the provided document will compare equal to the returned\n * position.\n *\n * Will throw if the document does not contain all fields of the order by\n * of the query or if any of the fields in the order by are an uncommitted\n * server timestamp.\n */ (t._query, this.fa, this.wa);\n return new Va(t.firestore, t.converter, function(t, e) {\n // TODO(dimond): validate that orderBy does not list the same key twice.\n const n = t.explicitOrderBy.concat([ e ]);\n return new rn(t.path, t.collectionGroup, n, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);\n }(t._query, e));\n }\n}\n\n/**\n * Creates a {@link QueryConstraint} that sorts the query result by the\n * specified field, optionally in descending order instead of ascending.\n *\n * @param fieldPath - The field to sort by.\n * @param directionStr - Optional direction to sort by ('asc' or 'desc'). If\n * not specified, order will be ascending.\n * @returns The created {@link Query}.\n */ function Wh(t, e = \"asc\") {\n const n = e, s = kh(\"orderBy\", t);\n return new jh(s, n);\n}\n\nclass zh extends qh {\n constructor(t, e, n) {\n super(), this.type = t, this.ma = e, this.ga = n;\n }\n _apply(t) {\n return new Va(t.firestore, t.converter, _n(t._query, this.ma, this.ga));\n }\n}\n\n/**\n * Creates a {@link QueryConstraint} that only returns the first matching documents.\n *\n * @param limit - The maximum number of items to return.\n * @returns The created {@link Query}.\n */ function Hh(t) {\n return Aa(\"limit\", t), new zh(\"limit\", t, \"F\" /* First */);\n}\n\n/**\n * Creates a {@link QueryConstraint} that only returns the last matching documents.\n *\n * You must specify at least one `orderBy` clause for `limitToLast` queries,\n * otherwise an exception will be thrown during execution.\n *\n * @param limit - The maximum number of items to return.\n * @returns The created {@link Query}.\n */ function Jh(t) {\n return Aa(\"limitToLast\", t), new zh(\"limitToLast\", t, \"L\" /* Last */);\n}\n\nclass Yh extends qh {\n constructor(t, e, n) {\n super(), this.type = t, this.ya = e, this.pa = n;\n }\n _apply(t) {\n const e = sl(t, this.type, this.ya, this.pa);\n return new Va(t.firestore, t.converter, function(t, e) {\n return new rn(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);\n }(t._query, e));\n }\n}\n\nfunction Xh(...t) {\n return new Yh(\"startAt\", t, \n /*inclusive=*/ !0);\n}\n\nfunction Zh(...t) {\n return new Yh(\"startAfter\", t, \n /*inclusive=*/ !1);\n}\n\nclass tl extends qh {\n constructor(t, e, n) {\n super(), this.type = t, this.ya = e, this.pa = n;\n }\n _apply(t) {\n const e = sl(t, this.type, this.ya, this.pa);\n return new Va(t.firestore, t.converter, function(t, e) {\n return new rn(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);\n }(t._query, e));\n }\n}\n\nfunction el(...t) {\n return new tl(\"endBefore\", t, \n /*inclusive=*/ !1);\n}\n\nfunction nl(...t) {\n return new tl(\"endAt\", t, /*inclusive=*/ !0);\n}\n\n/** Helper function to create a bound from a document or fields */ function sl(t, e, n, s) {\n if (n[0] = getModularInstance(n[0]), n[0] instanceof xh) return function(t, e, n, s, i) {\n if (!s) throw new Q(G.NOT_FOUND, `Can't use a DocumentSnapshot that doesn't exist for ${n}().`);\n const r = [];\n // Because people expect to continue/end a query at the exact document\n // provided, we need to use the implicit sort order rather than the explicit\n // sort order, because it's guaranteed to contain the document key. That way\n // the position becomes unambiguous and the query continues/ends exactly at\n // the provided document. Without the key (by using the explicit sort\n // orders), multiple documents could match the position, yielding duplicate\n // results.\n for (const n of fn(t)) if (n.field.isKeyField()) r.push(Ie(e, s.key)); else {\n const t = s.data.field(n.field);\n if (se(t)) throw new Q(G.INVALID_ARGUMENT, 'Invalid query. You are trying to start or end a query using a document for which the field \"' + n.field + '\" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');\n if (null === t) {\n const t = n.field.canonicalString();\n throw new Q(G.INVALID_ARGUMENT, `Invalid query. You are trying to start or end a query using a document for which the field '${t}' (used as the orderBy) does not exist.`);\n }\n r.push(t);\n }\n return new Ze(r, i);\n }\n /**\n * Converts a list of field values to a `Bound` for the given query.\n */ (t._query, t.firestore._databaseId, e, n[0]._document, s);\n {\n const i = fh(t.firestore);\n return function(t, e, n, s, i, r) {\n // Use explicit order by's because it has to match the query the user made\n const o = t.explicitOrderBy;\n if (i.length > o.length) throw new Q(G.INVALID_ARGUMENT, `Too many arguments provided to ${s}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);\n const u = [];\n for (let r = 0; r < i.length; r++) {\n const c = i[r];\n if (o[r].field.isKeyField()) {\n if (\"string\" != typeof c) throw new Q(G.INVALID_ARGUMENT, `Invalid query. Expected a string for document ID in ${s}(), but got a ${typeof c}`);\n if (!ln(t) && -1 !== c.indexOf(\"/\")) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection and ordering by documentId(), the value passed to ${s}() must be a plain document ID, but '${c}' contains a slash.`);\n const n = t.path.child(ht.fromString(c));\n if (!dt.isDocumentKey(n)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection group and ordering by documentId(), the value passed to ${s}() must result in a valid document path, but '${n}' is not because it contains an odd number of segments.`);\n const i = new dt(n);\n u.push(Ie(e, i));\n } else {\n const t = Eh(n, s, c);\n u.push(t);\n }\n }\n return new Ze(u, r);\n }\n /**\n * Parses the given `documentIdValue` into a `ReferenceValue`, throwing\n * appropriate errors if the value is anything other than a `DocumentReference`\n * or `string`, or if the string is malformed.\n */ (t._query, t.firestore._databaseId, i, e, n, s);\n }\n}\n\nfunction il(t, e, n) {\n if (\"string\" == typeof (n = getModularInstance(n))) {\n if (\"\" === n) throw new Q(G.INVALID_ARGUMENT, \"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.\");\n if (!ln(e) && -1 !== n.indexOf(\"/\")) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);\n const s = e.path.child(ht.fromString(n));\n if (!dt.isDocumentKey(s)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${s}' is not because it has an odd number of segments (${s.length}).`);\n return Ie(t, new dt(s));\n }\n if (n instanceof va) return Ie(t, n._key);\n throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${Ta(n)}.`);\n}\n\n/**\n * Validates that the value passed into a disjunctive filter satisfies all\n * array requirements.\n */ function rl(t, e) {\n if (!Array.isArray(t) || 0 === t.length) throw new Q(G.INVALID_ARGUMENT, `Invalid Query. A non-empty array is required for '${e.toString()}' filters.`);\n if (t.length > 10) throw new Q(G.INVALID_ARGUMENT, `Invalid Query. '${e.toString()}' filters support a maximum of 10 elements in the value array.`);\n}\n\nfunction ol(t, e, n) {\n if (!n.isEqual(e)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '${e.toString()}' and so you must also use '${e.toString()}' as your first argument to orderBy(), but your first orderBy() is on field '${n.toString()}' instead.`);\n}\n\n/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ const ul = {\n maxAttempts: 5\n};\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Converts Firestore's internal types to the JavaScript types that we expose\n * to the user.\n *\n * @internal\n */\nclass cl {\n convertValue(t, e = \"none\") {\n switch (de(t)) {\n case 0 /* NullValue */ :\n return null;\n\n case 1 /* BooleanValue */ :\n return t.booleanValue;\n\n case 2 /* NumberValue */ :\n return ee(t.integerValue || t.doubleValue);\n\n case 3 /* TimestampValue */ :\n return this.convertTimestamp(t.timestampValue);\n\n case 4 /* ServerTimestampValue */ :\n return this.convertServerTimestamp(t, e);\n\n case 5 /* StringValue */ :\n return t.stringValue;\n\n case 6 /* BlobValue */ :\n return this.convertBytes(ne(t.bytesValue));\n\n case 7 /* RefValue */ :\n return this.convertReference(t.referenceValue);\n\n case 8 /* GeoPointValue */ :\n return this.convertGeoPoint(t.geoPointValue);\n\n case 9 /* ArrayValue */ :\n return this.convertArray(t.arrayValue, e);\n\n case 10 /* ObjectValue */ :\n return this.convertObject(t.mapValue, e);\n\n default:\n throw L();\n }\n }\n convertObject(t, e) {\n const n = {};\n return qt(t.fields, ((t, s) => {\n n[t] = this.convertValue(s, e);\n })), n;\n }\n convertGeoPoint(t) {\n return new rh(ee(t.latitude), ee(t.longitude));\n }\n convertArray(t, e) {\n return (t.values || []).map((t => this.convertValue(t, e)));\n }\n convertServerTimestamp(t, e) {\n switch (e) {\n case \"previous\":\n const n = ie(t);\n return null == n ? null : this.convertValue(n, e);\n\n case \"estimate\":\n return this.convertTimestamp(re(t));\n\n default:\n return null;\n }\n }\n convertTimestamp(t) {\n const e = te(t);\n return new ut(e.seconds, e.nanos);\n }\n convertDocumentKey(t, e) {\n const n = ht.fromString(t);\n U(ai(n));\n const s = new ue(n.get(1), n.get(3)), i = new dt(n.popFirst(5));\n return s.isEqual(e) || \n // TODO(b/64130202): Somehow support foreign references.\n F(`Document ${i} contains a document reference within a different database (${s.projectId}/${s.database}) which is not supported. It will be treated as a reference in the current database (${e.projectId}/${e.database}) instead.`), \n i;\n }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Converts custom model object of type T into `DocumentData` by applying the\n * converter if it exists.\n *\n * This function is used when converting user objects to `DocumentData`\n * because we want to provide the user with a more specific error message if\n * their `set()` or fails due to invalid data originating from a `toFirestore()`\n * call.\n */ function al(t, e, n) {\n let s;\n // Cast to `any` in order to satisfy the union type constraint on\n // toFirestore().\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return s = t ? n && (n.merge || n.mergeFields) ? t.toFirestore(e, n) : t.toFirestore(e) : e, \n s;\n}\n\nclass hl extends cl {\n constructor(t) {\n super(), this.firestore = t;\n }\n convertBytes(t) {\n return new sh(t);\n }\n convertReference(t) {\n const e = this.convertDocumentKey(t, this.firestore._databaseId);\n return new va(this.firestore, /* converter= */ null, e);\n }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A write batch, used to perform multiple writes as a single atomic unit.\n *\n * A `WriteBatch` object can be acquired by calling {@link writeBatch}. It\n * provides methods for adding writes to the write batch. None of the writes\n * will be committed (or visible locally) until {@link WriteBatch.commit} is\n * called.\n */ class ll {\n /** @hideconstructor */\n constructor(t, e) {\n this._firestore = t, this._commitHandler = e, this._mutations = [], this._committed = !1, \n this._dataReader = fh(t);\n }\n set(t, e, n) {\n this._verifyNotCommitted();\n const s = fl(t, this._firestore), i = al(s.converter, e, n), r = dh(this._dataReader, \"WriteBatch.set\", s._key, i, null !== s.converter, n);\n return this._mutations.push(r.toMutation(s._key, Ln.none())), this;\n }\n update(t, e, n, ...s) {\n this._verifyNotCommitted();\n const i = fl(t, this._firestore);\n // For Compat types, we have to \"extract\" the underlying types before\n // performing validation.\n let r;\n return r = \"string\" == typeof (e = getModularInstance(e)) || e instanceof eh ? Th(this._dataReader, \"WriteBatch.update\", i._key, e, n, s) : Ih(this._dataReader, \"WriteBatch.update\", i._key, e), \n this._mutations.push(r.toMutation(i._key, Ln.exists(!0))), this;\n }\n /**\n * Deletes the document referred to by the provided {@link DocumentReference}.\n *\n * @param documentRef - A reference to the document to be deleted.\n * @returns This `WriteBatch` instance. Used for chaining method calls.\n */ delete(t) {\n this._verifyNotCommitted();\n const e = fl(t, this._firestore);\n return this._mutations = this._mutations.concat(new Zn(e._key, Ln.none())), this;\n }\n /**\n * Commits all of the writes in this write batch as a single atomic unit.\n *\n * The result of these writes will only be reflected in document reads that\n * occur after the returned promise resolves. If the client is offline, the\n * write fails. If you would like to see local modifications or buffer writes\n * until the client is online, use the full Firestore SDK.\n *\n * @returns A `Promise` resolved once all of the writes in the batch have been\n * successfully written to the backend as an atomic unit (note that it won't\n * resolve while you're offline).\n */ commit() {\n return this._verifyNotCommitted(), this._committed = !0, this._mutations.length > 0 ? this._commitHandler(this._mutations) : Promise.resolve();\n }\n _verifyNotCommitted() {\n if (this._committed) throw new Q(G.FAILED_PRECONDITION, \"A write batch can no longer be used after commit() has been called.\");\n }\n}\n\nfunction fl(t, e) {\n if ((t = getModularInstance(t)).firestore !== e) throw new Q(G.INVALID_ARGUMENT, \"Provided document reference is from a different Firestore instance.\");\n return t;\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// TODO(mrschmidt) Consider using `BaseTransaction` as the base class in the\n// legacy SDK.\n/**\n * A reference to a transaction.\n *\n * The `Transaction` object passed to a transaction's `updateFunction` provides\n * the methods to read and write data within the transaction context. See\n * {@link runTransaction}.\n */\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Reads the document referred to by this `DocumentReference`.\n *\n * Note: `getDoc()` attempts to provide up-to-date data when possible by waiting\n * for data from the server, but it may return cached data or fail if you are\n * offline and the server cannot be reached. To specify this behavior, invoke\n * {@link getDocFromCache} or {@link getDocFromServer}.\n *\n * @param reference - The reference of the document to fetch.\n * @returns A Promise resolved with a `DocumentSnapshot` containing the\n * current document contents.\n */\nfunction dl(t) {\n t = Ea(t, va);\n const e = Ea(t.firestore, Ba);\n return aa(qa(e), t._key).then((n => vl(e, t, n)));\n}\n\nclass _l extends cl {\n constructor(t) {\n super(), this.firestore = t;\n }\n convertBytes(t) {\n return new sh(t);\n }\n convertReference(t) {\n const e = this.convertDocumentKey(t, this.firestore._databaseId);\n return new va(this.firestore, /* converter= */ null, e);\n }\n}\n\n/**\n * Reads the document referred to by this `DocumentReference` from cache.\n * Returns an error if the document is not currently cached.\n *\n * @returns A `Promise` resolved with a `DocumentSnapshot` containing the\n * current document contents.\n */ function wl(t) {\n t = Ea(t, va);\n const e = Ea(t.firestore, Ba), n = qa(e), s = new _l(e);\n return ca(n, t._key).then((n => new Oh(e, s, t._key, n, new Mh(null !== n && n.hasLocalMutations, \n /* fromCache= */ !0), t.converter)));\n}\n\n/**\n * Reads the document referred to by this `DocumentReference` from the server.\n * Returns an error if the network is not available.\n *\n * @returns A `Promise` resolved with a `DocumentSnapshot` containing the\n * current document contents.\n */ function ml(t) {\n t = Ea(t, va);\n const e = Ea(t.firestore, Ba);\n return aa(qa(e), t._key, {\n source: \"server\"\n }).then((n => vl(e, t, n)));\n}\n\n/**\n * Executes the query and returns the results as a `QuerySnapshot`.\n *\n * Note: `getDocs()` attempts to provide up-to-date data when possible by\n * waiting for data from the server, but it may return cached data or fail if\n * you are offline and the server cannot be reached. To specify this behavior,\n * invoke {@link getDocsFromCache} or {@link getDocsFromServer}.\n *\n * @returns A `Promise` that will be resolved with the results of the query.\n */ function gl(t) {\n t = Ea(t, Va);\n const e = Ea(t.firestore, Ba), n = qa(e), s = new _l(e);\n return Uh(t._query), la(n, t._query).then((n => new $h(e, s, t, n)));\n}\n\n/**\n * Executes the query and returns the results as a `QuerySnapshot` from cache.\n * Returns an error if the document is not currently cached.\n *\n * @returns A `Promise` that will be resolved with the results of the query.\n */ function yl(t) {\n t = Ea(t, Va);\n const e = Ea(t.firestore, Ba), n = qa(e), s = new _l(e);\n return ha(n, t._query).then((n => new $h(e, s, t, n)));\n}\n\n/**\n * Executes the query and returns the results as a `QuerySnapshot` from the\n * server. Returns an error if the network is not available.\n *\n * @returns A `Promise` that will be resolved with the results of the query.\n */ function pl(t) {\n t = Ea(t, Va);\n const e = Ea(t.firestore, Ba), n = qa(e), s = new _l(e);\n return la(n, t._query, {\n source: \"server\"\n }).then((n => new $h(e, s, t, n)));\n}\n\nfunction Il(t, e, n) {\n t = Ea(t, va);\n const s = Ea(t.firestore, Ba), i = al(t.converter, e, n);\n return Pl(s, [ dh(fh(s), \"setDoc\", t._key, i, null !== t.converter, n).toMutation(t._key, Ln.none()) ]);\n}\n\nfunction Tl(t, e, n, ...s) {\n t = Ea(t, va);\n const i = Ea(t.firestore, Ba), r = fh(i);\n let o;\n o = \"string\" == typeof (\n // For Compat types, we have to \"extract\" the underlying types before\n // performing validation.\n e = getModularInstance(e)) || e instanceof eh ? Th(r, \"updateDoc\", t._key, e, n, s) : Ih(r, \"updateDoc\", t._key, e);\n return Pl(i, [ o.toMutation(t._key, Ln.exists(!0)) ]);\n}\n\n/**\n * Deletes the document referred to by the specified `DocumentReference`.\n *\n * @param reference - A reference to the document to delete.\n * @returns A Promise resolved once the document has been successfully\n * deleted from the backend (note that it won't resolve while you're offline).\n */ function El(t) {\n return Pl(Ea(t.firestore, Ba), [ new Zn(t._key, Ln.none()) ]);\n}\n\n/**\n * Add a new document to specified `CollectionReference` with the given data,\n * assigning it a document ID automatically.\n *\n * @param reference - A reference to the collection to add this document to.\n * @param data - An Object containing the data for the new document.\n * @returns A `Promise` resolved with a `DocumentReference` pointing to the\n * newly created document after it has been written to the backend (Note that it\n * won't resolve while you're offline).\n */ function Al(t, e) {\n const n = Ea(t.firestore, Ba), s = xa(t), i = al(t.converter, e);\n return Pl(n, [ dh(fh(t.firestore), \"addDoc\", s._key, i, null !== t.converter, {}).toMutation(s._key, Ln.exists(!1)) ]).then((() => s));\n}\n\nfunction Rl(t, ...e) {\n var n, s, i;\n t = getModularInstance(t);\n let r = {\n includeMetadataChanges: !1\n }, o = 0;\n \"object\" != typeof e[o] || Oa(e[o]) || (r = e[o], o++);\n const u = {\n includeMetadataChanges: r.includeMetadataChanges\n };\n if (Oa(e[o])) {\n const t = e[o];\n e[o] = null === (n = t.next) || void 0 === n ? void 0 : n.bind(t), e[o + 1] = null === (s = t.error) || void 0 === s ? void 0 : s.bind(t), \n e[o + 2] = null === (i = t.complete) || void 0 === i ? void 0 : i.bind(t);\n }\n let c, a, h;\n if (t instanceof va) a = Ea(t.firestore, Ba), h = un(t._key.path), c = {\n next: n => {\n e[o] && e[o](vl(a, t, n));\n },\n error: e[o + 1],\n complete: e[o + 2]\n }; else {\n const n = Ea(t, Va);\n a = Ea(n.firestore, Ba), h = n._query;\n const s = new _l(a);\n c = {\n next: t => {\n e[o] && e[o](new $h(a, s, n, t));\n },\n error: e[o + 1],\n complete: e[o + 2]\n }, Uh(t._query);\n }\n return function(t, e, n, s) {\n const i = new jc(s), r = new Xu(e, i, n);\n return t.asyncQueue.enqueueAndForget((async () => Wu(await ra(t), r))), () => {\n i.Tc(), t.asyncQueue.enqueueAndForget((async () => zu(await ra(t), r)));\n };\n }(qa(a), h, u, c);\n}\n\nfunction bl(t, e) {\n return fa(qa(t = Ea(t, Ba)), Oa(e) ? e : {\n next: e\n });\n}\n\n/**\n * Locally writes `mutations` on the async queue.\n * @internal\n */ function Pl(t, e) {\n return function(t, e) {\n const n = new j;\n return t.asyncQueue.enqueueAndForget((async () => fc(await ia(t), e, n))), n.promise;\n }(qa(t), e);\n}\n\n/**\n * Converts a {@link ViewSnapshot} that contains the single document specified by `ref`\n * to a {@link DocumentSnapshot}.\n */ function vl(t, e, n) {\n const s = n.docs.get(e._key), i = new _l(t);\n return new Oh(t, i, e._key, s, new Mh(n.hasPendingWrites, n.fromCache), e.converter);\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A reference to a transaction.\n *\n * The `Transaction` object passed to a transaction's `updateFunction` provides\n * the methods to read and write data within the transaction context. See\n * {@link runTransaction}.\n */ class Vl extends class {\n /** @hideconstructor */\n constructor(t, e) {\n this._firestore = t, this._transaction = e, this._dataReader = fh(t);\n }\n /**\n * Reads the document referenced by the provided {@link DocumentReference}.\n *\n * @param documentRef - A reference to the document to be read.\n * @returns A `DocumentSnapshot` with the read data.\n */ get(t) {\n const e = fl(t, this._firestore), n = new hl(this._firestore);\n return this._transaction.lookup([ e._key ]).then((t => {\n if (!t || 1 !== t.length) return L();\n const s = t[0];\n if (s.isFoundDocument()) return new xh(this._firestore, n, s.key, s, e.converter);\n if (s.isNoDocument()) return new xh(this._firestore, n, e._key, null, e.converter);\n throw L();\n }));\n }\n set(t, e, n) {\n const s = fl(t, this._firestore), i = al(s.converter, e, n), r = dh(this._dataReader, \"Transaction.set\", s._key, i, null !== s.converter, n);\n return this._transaction.set(s._key, r), this;\n }\n update(t, e, n, ...s) {\n const i = fl(t, this._firestore);\n // For Compat types, we have to \"extract\" the underlying types before\n // performing validation.\n let r;\n return r = \"string\" == typeof (e = getModularInstance(e)) || e instanceof eh ? Th(this._dataReader, \"Transaction.update\", i._key, e, n, s) : Ih(this._dataReader, \"Transaction.update\", i._key, e), \n this._transaction.update(i._key, r), this;\n }\n /**\n * Deletes the document referred to by the provided {@link DocumentReference}.\n *\n * @param documentRef - A reference to the document to be deleted.\n * @returns This `Transaction` instance. Used for chaining method calls.\n */ delete(t) {\n const e = fl(t, this._firestore);\n return this._transaction.delete(e._key), this;\n }\n} {\n // This class implements the same logic as the Transaction API in the Lite SDK\n // but is subclassed in order to return its own DocumentSnapshot types.\n /** @hideconstructor */\n constructor(t, e) {\n super(t, e), this._firestore = t;\n }\n /**\n * Reads the document referenced by the provided {@link DocumentReference}.\n *\n * @param documentRef - A reference to the document to be read.\n * @returns A `DocumentSnapshot` with the read data.\n */ get(t) {\n const e = fl(t, this._firestore), n = new _l(this._firestore);\n return super.get(t).then((t => new Oh(this._firestore, n, e._key, t._document, new Mh(\n /* hasPendingWrites= */ !1, \n /* fromCache= */ !1), e.converter)));\n }\n}\n\n/**\n * Executes the given `updateFunction` and then attempts to commit the changes\n * applied within the transaction. If any document read within the transaction\n * has changed, Cloud Firestore retries the `updateFunction`. If it fails to\n * commit after 5 attempts, the transaction fails.\n *\n * The maximum number of writes allowed in a single transaction is 500.\n *\n * @param firestore - A reference to the Firestore database to run this\n * transaction against.\n * @param updateFunction - The function to execute within the transaction\n * context.\n * @param options - An options object to configure maximum number of attempts to\n * commit.\n * @returns If the transaction completed successfully or was explicitly aborted\n * (the `updateFunction` returned a failed promise), the promise returned by the\n * `updateFunction `is returned here. Otherwise, if the transaction failed, a\n * rejected promise with the corresponding failure error is returned.\n */ function Sl(t, e, n) {\n t = Ea(t, Ba);\n const s = Object.assign(Object.assign({}, ul), n);\n !function(t) {\n if (t.maxAttempts < 1) throw new Q(G.INVALID_ARGUMENT, \"Max attempts must be at least 1\");\n }(s);\n return da(qa(t), (n => e(new Vl(t, n))), s);\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Returns a sentinel for use with {@link @firebase/firestore/lite#(updateDoc:1)} or\n * {@link @firebase/firestore/lite#(setDoc:1)} with `{merge: true}` to mark a field for deletion.\n */ function Dl() {\n return new _h(\"deleteField\");\n}\n\n/**\n * Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to\n * include a server-generated timestamp in the written data.\n */ function Cl() {\n return new mh(\"serverTimestamp\");\n}\n\n/**\n * Returns a special value that can be used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link\n * @firebase/firestore/lite#(updateDoc:1)} that tells the server to union the given elements with any array\n * value that already exists on the server. Each specified element that doesn't\n * already exist in the array will be added to the end. If the field being\n * modified is not already an array it will be overwritten with an array\n * containing exactly the specified elements.\n *\n * @param elements - The elements to union into the array.\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\n * `updateDoc()`.\n */ function xl(...t) {\n // NOTE: We don't actually parse the data until it's used in set() or\n // update() since we'd need the Firestore instance to do this.\n return new gh(\"arrayUnion\", t);\n}\n\n/**\n * Returns a special value that can be used with {@link (setDoc:1)} or {@link\n * updateDoc:1} that tells the server to remove the given elements from any\n * array value that already exists on the server. All instances of each element\n * specified will be removed from the array. If the field being modified is not\n * already an array it will be overwritten with an empty array.\n *\n * @param elements - The elements to remove from the array.\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\n * `updateDoc()`\n */ function Nl(...t) {\n // NOTE: We don't actually parse the data until it's used in set() or\n // update() since we'd need the Firestore instance to do this.\n return new yh(\"arrayRemove\", t);\n}\n\n/**\n * Returns a special value that can be used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link\n * @firebase/firestore/lite#(updateDoc:1)} that tells the server to increment the field's current value by\n * the given value.\n *\n * If either the operand or the current field value uses floating point\n * precision, all arithmetic follows IEEE 754 semantics. If both values are\n * integers, values outside of JavaScript's safe number range\n * (`Number.MIN_SAFE_INTEGER` to `Number.MAX_SAFE_INTEGER`) are also subject to\n * precision loss. Furthermore, once processed by the Firestore backend, all\n * integer operations are capped between -2^63 and 2^63-1.\n *\n * If the current field value is not of type `number`, or if the field does not\n * yet exist, the transformation sets the field to the given value.\n *\n * @param n - The value to increment by.\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\n * `updateDoc()`\n */ function kl(t) {\n return new ph(\"increment\", t);\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Creates a write batch, used for performing multiple writes as a single\n * atomic operation. The maximum number of writes allowed in a single {@link WriteBatch}\n * is 500.\n *\n * Unlike transactions, write batches are persisted offline and therefore are\n * preferable when you don't need to condition your writes on read data.\n *\n * @returns A {@link WriteBatch} that can be used to atomically execute multiple\n * writes.\n */ function Ml(t) {\n return qa(t = Ea(t, Ba)), new ll(t, (e => Pl(t, e)));\n}\n\n/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ function Ol(t, e) {\n var n;\n const s = qa(t = Ea(t, Ba));\n // PORTING NOTE: We don't return an error if the user has not enabled\n // persistence since `enableIndexeddbPersistence()` can fail on the Web.\n if (!(null === (n = s.offlineComponents) || void 0 === n ? void 0 : n.indexBackfillerScheduler)) return $(\"Cannot enable indexes when persistence is disabled\"), \n Promise.resolve();\n const i = function(t) {\n const e = \"string\" == typeof t ? function(t) {\n var e;\n try {\n return JSON.parse(t);\n } catch (t) {\n throw new Q(G.INVALID_ARGUMENT, \"Failed to parse JSON: \" + (null === (e = t) || void 0 === e ? void 0 : e.message));\n }\n }(t) : t, n = [];\n if (Array.isArray(e.indexes)) for (const t of e.indexes) {\n const e = Fl(t, \"collectionGroup\"), s = [];\n if (Array.isArray(t.fields)) for (const e of t.fields) {\n const t = Sh(\"setIndexConfiguration\", Fl(e, \"fieldPath\"));\n \"CONTAINS\" === e.arrayConfig ? s.push(new yt(t, 2 /* CONTAINS */)) : \"ASCENDING\" === e.order ? s.push(new yt(t, 0 /* ASCENDING */)) : \"DESCENDING\" === e.order && s.push(new yt(t, 1 /* DESCENDING */));\n }\n n.push(new _t(_t.UNKNOWN_ID, e, s, It.empty()));\n }\n return n;\n }(e);\n return na(s).then((t => async function(t, e) {\n const n = K(t), s = n.indexManager, i = [];\n return n.persistence.runTransaction(\"Configure indexes\", \"readwrite\", (t => s.getFieldIndexes(t).next((n => function(t, e, n, s, i) {\n t = [ ...t ], e = [ ...e ], t.sort(n), e.sort(n);\n const r = t.length, o = e.length;\n let u = 0, c = 0;\n for (;u < o && c < r; ) {\n const r = n(t[c], e[u]);\n r < 0 ? \n // The element was removed if the next element in our ordered\n // walkthrough is only in `before`.\n i(t[c++]) : r > 0 ? \n // The element was added if the next element in our ordered walkthrough\n // is only in `after`.\n s(e[u++]) : (u++, c++);\n }\n for (;u < o; ) s(e[u++]);\n for (;c < r; ) i(t[c++]);\n }(n, e, gt, (e => {\n i.push(s.addFieldIndex(t, e));\n }), (e => {\n i.push(s.deleteFieldIndex(t, e));\n })))).next((() => Vt.waitFor(i)))));\n }\n /**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n // The format of the LocalStorage key that stores the client state is:\n // firestore_clients_<persistence_prefix>_<instance_key>\n (t, i)));\n}\n\nfunction Fl(t, e) {\n if (\"string\" != typeof t[e]) throw new Q(G.INVALID_ARGUMENT, \"Missing string value for: \" + e);\n return t[e];\n}\n\n/**\n * Cloud Firestore\n *\n * @packageDocumentation\n */ !function(t, e = !0) {\n !function(t) {\n x = t;\n }(SDK_VERSION), _registerComponent(new Component(\"firestore\", ((t, {options: n}) => {\n const s = t.getProvider(\"app\").getImmediate(), i = new Ba(s, new J(t.getProvider(\"auth-internal\")), new tt(t.getProvider(\"app-check-internal\")));\n return n = Object.assign({\n useFetchStreams: e\n }, n), i._setSettings(n), i;\n }), \"PUBLIC\")), registerVersion(D, \"3.4.14\", t), \n // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation\n registerVersion(D, \"3.4.14\", \"esm2017\");\n}();\n\nexport { cl as AbstractUserDataWriter, sh as Bytes, $a as CACHE_SIZE_UNLIMITED, Sa as CollectionReference, va as DocumentReference, Oh as DocumentSnapshot, eh as FieldPath, ih as FieldValue, Ba as Firestore, Q as FirestoreError, rh as GeoPoint, Fa as LoadBundleTask, Va as Query, qh as QueryConstraint, Fh as QueryDocumentSnapshot, $h as QuerySnapshot, Mh as SnapshotMetadata, ut as Timestamp, Vl as Transaction, ll as WriteBatch, ue as _DatabaseId, dt as _DocumentKey, et as _EmptyAppCheckTokenProvider, z as _EmptyAuthCredentialsProvider, ft as _FieldPath, Ea as _cast, q as _debugAssert, Yt as _isBase64Available, $ as _logWarn, ya as _validateIsNotUsedTogether, Al as addDoc, Nl as arrayRemove, xl as arrayUnion, Wa as clearIndexedDbPersistence, Da as collection, Ca as collectionGroup, Pa as connectFirestoreEmulator, El as deleteDoc, Dl as deleteField, Ja as disableNetwork, xa as doc, nh as documentId, Ga as enableIndexedDbPersistence, Qa as enableMultiTabIndexedDbPersistence, Ha as enableNetwork, nl as endAt, el as endBefore, qa as ensureFirestoreConfigured, Pl as executeWrite, dl as getDoc, wl as getDocFromCache, ml as getDocFromServer, gl as getDocs, yl as getDocsFromCache, pl as getDocsFromServer, Ua as getFirestore, kl as increment, La as initializeFirestore, Hh as limit, Jh as limitToLast, Xa as loadBundle, Za as namedQuery, Rl as onSnapshot, bl as onSnapshotsInSync, Wh as orderBy, Kh as query, ka as queryEqual, Na as refEqual, Sl as runTransaction, Cl as serverTimestamp, Il as setDoc, Ol as setIndexConfiguration, M as setLogLevel, Lh as snapshotEqual, Zh as startAfter, Xh as startAt, Ya as terminate, Tl as updateDoc, za as waitForPendingWrites, Qh as where, Ml as writeBatch };\n//# sourceMappingURL=index.esm2017.js.map\n","import firebase from '@firebase/app-compat';\nimport { FirestoreError, Bytes, _isBase64Available, enableIndexedDbPersistence, enableMultiTabIndexedDbPersistence, clearIndexedDbPersistence, _DatabaseId, _logWarn, connectFirestoreEmulator, enableNetwork, disableNetwork, _validateIsNotUsedTogether, waitForPendingWrites, onSnapshotsInSync, collection, doc, collectionGroup, runTransaction, ensureFirestoreConfigured, WriteBatch as WriteBatch$1, executeWrite, loadBundle, namedQuery, _cast, DocumentReference as DocumentReference$1, DocumentSnapshot as DocumentSnapshot$1, _DocumentKey, refEqual, setDoc, updateDoc, deleteDoc, onSnapshot, getDocFromCache, getDocFromServer, getDoc, snapshotEqual, query, where, orderBy, limit, limitToLast, startAt, startAfter, endBefore, endAt, queryEqual, getDocsFromCache, getDocsFromServer, getDocs, QuerySnapshot as QuerySnapshot$1, addDoc, AbstractUserDataWriter, setLogLevel as setLogLevel$1, QueryDocumentSnapshot as QueryDocumentSnapshot$1, _debugAssert, FieldPath as FieldPath$1, _FieldPath, serverTimestamp, deleteField, arrayUnion, arrayRemove, increment, GeoPoint, Timestamp, CACHE_SIZE_UNLIMITED } from '@firebase/firestore';\nimport { getModularInstance } from '@firebase/util';\nimport { Component } from '@firebase/component';\n\nconst name = \"@firebase/firestore-compat\";\nconst version = \"0.1.23\";\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 validateSetOptions(methodName, options) {\r\n if (options === undefined) {\r\n return {\r\n merge: false\r\n };\r\n }\r\n if (options.mergeFields !== undefined && options.merge !== undefined) {\r\n throw new FirestoreError('invalid-argument', `Invalid options passed to function ${methodName}(): You cannot ` +\r\n 'specify both \"merge\" and \"mergeFields\".');\r\n }\r\n return options;\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/** Helper function to assert Uint8Array is available at runtime. */\r\nfunction assertUint8ArrayAvailable() {\r\n if (typeof Uint8Array === 'undefined') {\r\n throw new FirestoreError('unimplemented', 'Uint8Arrays are not available in this environment.');\r\n }\r\n}\r\n/** Helper function to assert Base64 functions are available at runtime. */\r\nfunction assertBase64Available() {\r\n if (!_isBase64Available()) {\r\n throw new FirestoreError('unimplemented', 'Blobs are unavailable in Firestore in this environment.');\r\n }\r\n}\r\n/** Immutable class holding a blob (binary data) */\r\nclass Blob {\r\n constructor(_delegate) {\r\n this._delegate = _delegate;\r\n }\r\n static fromBase64String(base64) {\r\n assertBase64Available();\r\n return new Blob(Bytes.fromBase64String(base64));\r\n }\r\n static fromUint8Array(array) {\r\n assertUint8ArrayAvailable();\r\n return new Blob(Bytes.fromUint8Array(array));\r\n }\r\n toBase64() {\r\n assertBase64Available();\r\n return this._delegate.toBase64();\r\n }\r\n toUint8Array() {\r\n assertUint8ArrayAvailable();\r\n return this._delegate.toUint8Array();\r\n }\r\n isEqual(other) {\r\n return this._delegate.isEqual(other._delegate);\r\n }\r\n toString() {\r\n return 'Blob(base64: ' + this.toBase64() + ')';\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\nfunction isPartialObserver(obj) {\r\n return implementsAnyMethods(obj, ['next', 'error', 'complete']);\r\n}\r\n/**\r\n * Returns true if obj is an object and contains at least one of the specified\r\n * methods.\r\n */\r\nfunction implementsAnyMethods(obj, methods) {\r\n if (typeof obj !== 'object' || obj === null) {\r\n return false;\r\n }\r\n const object = obj;\r\n for (const method of methods) {\r\n if (method in object && typeof object[method] === 'function') {\r\n return true;\r\n }\r\n }\r\n return false;\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 * The persistence provider included with the full Firestore SDK.\r\n */\r\nclass IndexedDbPersistenceProvider {\r\n enableIndexedDbPersistence(firestore, forceOwnership) {\r\n return enableIndexedDbPersistence(firestore._delegate, { forceOwnership });\r\n }\r\n enableMultiTabIndexedDbPersistence(firestore) {\r\n return enableMultiTabIndexedDbPersistence(firestore._delegate);\r\n }\r\n clearIndexedDbPersistence(firestore) {\r\n return clearIndexedDbPersistence(firestore._delegate);\r\n }\r\n}\r\n/**\r\n * Compat class for Firestore. Exposes Firestore Legacy API, but delegates\r\n * to the functional API of firestore-exp.\r\n */\r\nclass Firestore {\r\n constructor(databaseIdOrApp, _delegate, _persistenceProvider) {\r\n this._delegate = _delegate;\r\n this._persistenceProvider = _persistenceProvider;\r\n this.INTERNAL = {\r\n delete: () => this.terminate()\r\n };\r\n if (!(databaseIdOrApp instanceof _DatabaseId)) {\r\n this._appCompat = databaseIdOrApp;\r\n }\r\n }\r\n get _databaseId() {\r\n return this._delegate._databaseId;\r\n }\r\n settings(settingsLiteral) {\r\n const currentSettings = this._delegate._getSettings();\r\n if (!settingsLiteral.merge &&\r\n currentSettings.host !== settingsLiteral.host) {\r\n _logWarn('You are overriding the original host. If you did not intend ' +\r\n 'to override your settings, use {merge: true}.');\r\n }\r\n if (settingsLiteral.merge) {\r\n settingsLiteral = Object.assign(Object.assign({}, currentSettings), settingsLiteral);\r\n // Remove the property from the settings once the merge is completed\r\n delete settingsLiteral.merge;\r\n }\r\n this._delegate._setSettings(settingsLiteral);\r\n }\r\n useEmulator(host, port, options = {}) {\r\n connectFirestoreEmulator(this._delegate, host, port, options);\r\n }\r\n enableNetwork() {\r\n return enableNetwork(this._delegate);\r\n }\r\n disableNetwork() {\r\n return disableNetwork(this._delegate);\r\n }\r\n enablePersistence(settings) {\r\n let synchronizeTabs = false;\r\n let experimentalForceOwningTab = false;\r\n if (settings) {\r\n synchronizeTabs = !!settings.synchronizeTabs;\r\n experimentalForceOwningTab = !!settings.experimentalForceOwningTab;\r\n _validateIsNotUsedTogether('synchronizeTabs', synchronizeTabs, 'experimentalForceOwningTab', experimentalForceOwningTab);\r\n }\r\n return synchronizeTabs\r\n ? this._persistenceProvider.enableMultiTabIndexedDbPersistence(this)\r\n : this._persistenceProvider.enableIndexedDbPersistence(this, experimentalForceOwningTab);\r\n }\r\n clearPersistence() {\r\n return this._persistenceProvider.clearIndexedDbPersistence(this);\r\n }\r\n terminate() {\r\n if (this._appCompat) {\r\n this._appCompat._removeServiceInstance('firestore-compat');\r\n this._appCompat._removeServiceInstance('firestore');\r\n }\r\n return this._delegate._delete();\r\n }\r\n waitForPendingWrites() {\r\n return waitForPendingWrites(this._delegate);\r\n }\r\n onSnapshotsInSync(arg) {\r\n return onSnapshotsInSync(this._delegate, arg);\r\n }\r\n get app() {\r\n if (!this._appCompat) {\r\n throw new FirestoreError('failed-precondition', \"Firestore was not initialized using the Firebase SDK. 'app' is \" +\r\n 'not available');\r\n }\r\n return this._appCompat;\r\n }\r\n collection(pathString) {\r\n try {\r\n return new CollectionReference(this, collection(this._delegate, pathString));\r\n }\r\n catch (e) {\r\n throw replaceFunctionName(e, 'collection()', 'Firestore.collection()');\r\n }\r\n }\r\n doc(pathString) {\r\n try {\r\n return new DocumentReference(this, doc(this._delegate, pathString));\r\n }\r\n catch (e) {\r\n throw replaceFunctionName(e, 'doc()', 'Firestore.doc()');\r\n }\r\n }\r\n collectionGroup(collectionId) {\r\n try {\r\n return new Query(this, collectionGroup(this._delegate, collectionId));\r\n }\r\n catch (e) {\r\n throw replaceFunctionName(e, 'collectionGroup()', 'Firestore.collectionGroup()');\r\n }\r\n }\r\n runTransaction(updateFunction) {\r\n return runTransaction(this._delegate, transaction => updateFunction(new Transaction(this, transaction)));\r\n }\r\n batch() {\r\n ensureFirestoreConfigured(this._delegate);\r\n return new WriteBatch(new WriteBatch$1(this._delegate, mutations => executeWrite(this._delegate, mutations)));\r\n }\r\n loadBundle(bundleData) {\r\n return loadBundle(this._delegate, bundleData);\r\n }\r\n namedQuery(name) {\r\n return namedQuery(this._delegate, name).then(expQuery => {\r\n if (!expQuery) {\r\n return null;\r\n }\r\n return new Query(this, \r\n // We can pass `expQuery` here directly since named queries don't have a UserDataConverter.\r\n // Otherwise, we would have to create a new ExpQuery and pass the old UserDataConverter.\r\n expQuery);\r\n });\r\n }\r\n}\r\nclass UserDataWriter extends AbstractUserDataWriter {\r\n constructor(firestore) {\r\n super();\r\n this.firestore = firestore;\r\n }\r\n convertBytes(bytes) {\r\n return new Blob(new Bytes(bytes));\r\n }\r\n convertReference(name) {\r\n const key = this.convertDocumentKey(name, this.firestore._databaseId);\r\n return DocumentReference.forKey(key, this.firestore, /* converter= */ null);\r\n }\r\n}\r\nfunction setLogLevel(level) {\r\n setLogLevel$1(level);\r\n}\r\n/**\r\n * A reference to a transaction.\r\n */\r\nclass Transaction {\r\n constructor(_firestore, _delegate) {\r\n this._firestore = _firestore;\r\n this._delegate = _delegate;\r\n this._userDataWriter = new UserDataWriter(_firestore);\r\n }\r\n get(documentRef) {\r\n const ref = castReference(documentRef);\r\n return this._delegate\r\n .get(ref)\r\n .then(result => new DocumentSnapshot(this._firestore, new DocumentSnapshot$1(this._firestore._delegate, this._userDataWriter, result._key, result._document, result.metadata, ref.converter)));\r\n }\r\n set(documentRef, data, options) {\r\n const ref = castReference(documentRef);\r\n if (options) {\r\n validateSetOptions('Transaction.set', options);\r\n this._delegate.set(ref, data, options);\r\n }\r\n else {\r\n this._delegate.set(ref, data);\r\n }\r\n return this;\r\n }\r\n update(documentRef, dataOrField, value, ...moreFieldsAndValues) {\r\n const ref = castReference(documentRef);\r\n if (arguments.length === 2) {\r\n this._delegate.update(ref, dataOrField);\r\n }\r\n else {\r\n this._delegate.update(ref, dataOrField, value, ...moreFieldsAndValues);\r\n }\r\n return this;\r\n }\r\n delete(documentRef) {\r\n const ref = castReference(documentRef);\r\n this._delegate.delete(ref);\r\n return this;\r\n }\r\n}\r\nclass WriteBatch {\r\n constructor(_delegate) {\r\n this._delegate = _delegate;\r\n }\r\n set(documentRef, data, options) {\r\n const ref = castReference(documentRef);\r\n if (options) {\r\n validateSetOptions('WriteBatch.set', options);\r\n this._delegate.set(ref, data, options);\r\n }\r\n else {\r\n this._delegate.set(ref, data);\r\n }\r\n return this;\r\n }\r\n update(documentRef, dataOrField, value, ...moreFieldsAndValues) {\r\n const ref = castReference(documentRef);\r\n if (arguments.length === 2) {\r\n this._delegate.update(ref, dataOrField);\r\n }\r\n else {\r\n this._delegate.update(ref, dataOrField, value, ...moreFieldsAndValues);\r\n }\r\n return this;\r\n }\r\n delete(documentRef) {\r\n const ref = castReference(documentRef);\r\n this._delegate.delete(ref);\r\n return this;\r\n }\r\n commit() {\r\n return this._delegate.commit();\r\n }\r\n}\r\n/**\r\n * Wraps a `PublicFirestoreDataConverter` translating the types from the\r\n * experimental SDK into corresponding types from the Classic SDK before passing\r\n * them to the wrapped converter.\r\n */\r\nclass FirestoreDataConverter {\r\n constructor(_firestore, _userDataWriter, _delegate) {\r\n this._firestore = _firestore;\r\n this._userDataWriter = _userDataWriter;\r\n this._delegate = _delegate;\r\n }\r\n fromFirestore(snapshot, options) {\r\n const expSnapshot = new QueryDocumentSnapshot$1(this._firestore._delegate, this._userDataWriter, snapshot._key, snapshot._document, snapshot.metadata, \r\n /* converter= */ null);\r\n return this._delegate.fromFirestore(new QueryDocumentSnapshot(this._firestore, expSnapshot), options !== null && options !== void 0 ? options : {});\r\n }\r\n toFirestore(modelObject, options) {\r\n if (!options) {\r\n return this._delegate.toFirestore(modelObject);\r\n }\r\n else {\r\n return this._delegate.toFirestore(modelObject, options);\r\n }\r\n }\r\n // Use the same instance of `FirestoreDataConverter` for the given instances\r\n // of `Firestore` and `PublicFirestoreDataConverter` so that isEqual() will\r\n // compare equal for two objects created with the same converter instance.\r\n static getInstance(firestore, converter) {\r\n const converterMapByFirestore = FirestoreDataConverter.INSTANCES;\r\n let untypedConverterByConverter = converterMapByFirestore.get(firestore);\r\n if (!untypedConverterByConverter) {\r\n untypedConverterByConverter = new WeakMap();\r\n converterMapByFirestore.set(firestore, untypedConverterByConverter);\r\n }\r\n let instance = untypedConverterByConverter.get(converter);\r\n if (!instance) {\r\n instance = new FirestoreDataConverter(firestore, new UserDataWriter(firestore), converter);\r\n untypedConverterByConverter.set(converter, instance);\r\n }\r\n return instance;\r\n }\r\n}\r\nFirestoreDataConverter.INSTANCES = new WeakMap();\r\n/**\r\n * A reference to a particular document in a collection in the database.\r\n */\r\nclass DocumentReference {\r\n constructor(firestore, _delegate) {\r\n this.firestore = firestore;\r\n this._delegate = _delegate;\r\n this._userDataWriter = new UserDataWriter(firestore);\r\n }\r\n static forPath(path, firestore, converter) {\r\n if (path.length % 2 !== 0) {\r\n throw new FirestoreError('invalid-argument', 'Invalid document reference. Document ' +\r\n 'references must have an even number of segments, but ' +\r\n `${path.canonicalString()} has ${path.length}`);\r\n }\r\n return new DocumentReference(firestore, new DocumentReference$1(firestore._delegate, converter, new _DocumentKey(path)));\r\n }\r\n static forKey(key, firestore, converter) {\r\n return new DocumentReference(firestore, new DocumentReference$1(firestore._delegate, converter, key));\r\n }\r\n get id() {\r\n return this._delegate.id;\r\n }\r\n get parent() {\r\n return new CollectionReference(this.firestore, this._delegate.parent);\r\n }\r\n get path() {\r\n return this._delegate.path;\r\n }\r\n collection(pathString) {\r\n try {\r\n return new CollectionReference(this.firestore, collection(this._delegate, pathString));\r\n }\r\n catch (e) {\r\n throw replaceFunctionName(e, 'collection()', 'DocumentReference.collection()');\r\n }\r\n }\r\n isEqual(other) {\r\n other = getModularInstance(other);\r\n if (!(other instanceof DocumentReference$1)) {\r\n return false;\r\n }\r\n return refEqual(this._delegate, other);\r\n }\r\n set(value, options) {\r\n options = validateSetOptions('DocumentReference.set', options);\r\n try {\r\n if (options) {\r\n return setDoc(this._delegate, value, options);\r\n }\r\n else {\r\n return setDoc(this._delegate, value);\r\n }\r\n }\r\n catch (e) {\r\n throw replaceFunctionName(e, 'setDoc()', 'DocumentReference.set()');\r\n }\r\n }\r\n update(fieldOrUpdateData, value, ...moreFieldsAndValues) {\r\n try {\r\n if (arguments.length === 1) {\r\n return updateDoc(this._delegate, fieldOrUpdateData);\r\n }\r\n else {\r\n return updateDoc(this._delegate, fieldOrUpdateData, value, ...moreFieldsAndValues);\r\n }\r\n }\r\n catch (e) {\r\n throw replaceFunctionName(e, 'updateDoc()', 'DocumentReference.update()');\r\n }\r\n }\r\n delete() {\r\n return deleteDoc(this._delegate);\r\n }\r\n onSnapshot(...args) {\r\n const options = extractSnapshotOptions(args);\r\n const observer = wrapObserver(args, result => new DocumentSnapshot(this.firestore, new DocumentSnapshot$1(this.firestore._delegate, this._userDataWriter, result._key, result._document, result.metadata, this._delegate.converter)));\r\n return onSnapshot(this._delegate, options, observer);\r\n }\r\n get(options) {\r\n let snap;\r\n if ((options === null || options === void 0 ? void 0 : options.source) === 'cache') {\r\n snap = getDocFromCache(this._delegate);\r\n }\r\n else if ((options === null || options === void 0 ? void 0 : options.source) === 'server') {\r\n snap = getDocFromServer(this._delegate);\r\n }\r\n else {\r\n snap = getDoc(this._delegate);\r\n }\r\n return snap.then(result => new DocumentSnapshot(this.firestore, new DocumentSnapshot$1(this.firestore._delegate, this._userDataWriter, result._key, result._document, result.metadata, this._delegate.converter)));\r\n }\r\n withConverter(converter) {\r\n return new DocumentReference(this.firestore, converter\r\n ? this._delegate.withConverter(FirestoreDataConverter.getInstance(this.firestore, converter))\r\n : this._delegate.withConverter(null));\r\n }\r\n}\r\n/**\r\n * Replaces the function name in an error thrown by the firestore-exp API\r\n * with the function names used in the classic API.\r\n */\r\nfunction replaceFunctionName(e, original, updated) {\r\n e.message = e.message.replace(original, updated);\r\n return e;\r\n}\r\n/**\r\n * Iterates the list of arguments from an `onSnapshot` call and returns the\r\n * first argument that may be an `SnapshotListenOptions` object. Returns an\r\n * empty object if none is found.\r\n */\r\nfunction extractSnapshotOptions(args) {\r\n for (const arg of args) {\r\n if (typeof arg === 'object' && !isPartialObserver(arg)) {\r\n return arg;\r\n }\r\n }\r\n return {};\r\n}\r\n/**\r\n * Creates an observer that can be passed to the firestore-exp SDK. The\r\n * observer converts all observed values into the format expected by the classic\r\n * SDK.\r\n *\r\n * @param args - The list of arguments from an `onSnapshot` call.\r\n * @param wrapper - The function that converts the firestore-exp type into the\r\n * type used by this shim.\r\n */\r\nfunction wrapObserver(args, wrapper) {\r\n var _a, _b;\r\n let userObserver;\r\n if (isPartialObserver(args[0])) {\r\n userObserver = args[0];\r\n }\r\n else if (isPartialObserver(args[1])) {\r\n userObserver = args[1];\r\n }\r\n else if (typeof args[0] === 'function') {\r\n userObserver = {\r\n next: args[0],\r\n error: args[1],\r\n complete: args[2]\r\n };\r\n }\r\n else {\r\n userObserver = {\r\n next: args[1],\r\n error: args[2],\r\n complete: args[3]\r\n };\r\n }\r\n return {\r\n next: val => {\r\n if (userObserver.next) {\r\n userObserver.next(wrapper(val));\r\n }\r\n },\r\n error: (_a = userObserver.error) === null || _a === void 0 ? void 0 : _a.bind(userObserver),\r\n complete: (_b = userObserver.complete) === null || _b === void 0 ? void 0 : _b.bind(userObserver)\r\n };\r\n}\r\nclass DocumentSnapshot {\r\n constructor(_firestore, _delegate) {\r\n this._firestore = _firestore;\r\n this._delegate = _delegate;\r\n }\r\n get ref() {\r\n return new DocumentReference(this._firestore, this._delegate.ref);\r\n }\r\n get id() {\r\n return this._delegate.id;\r\n }\r\n get metadata() {\r\n return this._delegate.metadata;\r\n }\r\n get exists() {\r\n return this._delegate.exists();\r\n }\r\n data(options) {\r\n return this._delegate.data(options);\r\n }\r\n get(fieldPath, options\r\n // We are using `any` here to avoid an explicit cast by our users.\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n ) {\r\n return this._delegate.get(fieldPath, options);\r\n }\r\n isEqual(other) {\r\n return snapshotEqual(this._delegate, other._delegate);\r\n }\r\n}\r\nclass QueryDocumentSnapshot extends DocumentSnapshot {\r\n data(options) {\r\n const data = this._delegate.data(options);\r\n _debugAssert(data !== undefined, 'Document in a QueryDocumentSnapshot should exist');\r\n return data;\r\n }\r\n}\r\nclass Query {\r\n constructor(firestore, _delegate) {\r\n this.firestore = firestore;\r\n this._delegate = _delegate;\r\n this._userDataWriter = new UserDataWriter(firestore);\r\n }\r\n where(fieldPath, opStr, value) {\r\n try {\r\n // The \"as string\" cast is a little bit of a hack. `where` accepts the\r\n // FieldPath Compat type as input, but is not typed as such in order to\r\n // not expose this via our public typings file.\r\n return new Query(this.firestore, query(this._delegate, where(fieldPath, opStr, value)));\r\n }\r\n catch (e) {\r\n throw replaceFunctionName(e, /(orderBy|where)\\(\\)/, 'Query.$1()');\r\n }\r\n }\r\n orderBy(fieldPath, directionStr) {\r\n try {\r\n // The \"as string\" cast is a little bit of a hack. `orderBy` accepts the\r\n // FieldPath Compat type as input, but is not typed as such in order to\r\n // not expose this via our public typings file.\r\n return new Query(this.firestore, query(this._delegate, orderBy(fieldPath, directionStr)));\r\n }\r\n catch (e) {\r\n throw replaceFunctionName(e, /(orderBy|where)\\(\\)/, 'Query.$1()');\r\n }\r\n }\r\n limit(n) {\r\n try {\r\n return new Query(this.firestore, query(this._delegate, limit(n)));\r\n }\r\n catch (e) {\r\n throw replaceFunctionName(e, 'limit()', 'Query.limit()');\r\n }\r\n }\r\n limitToLast(n) {\r\n try {\r\n return new Query(this.firestore, query(this._delegate, limitToLast(n)));\r\n }\r\n catch (e) {\r\n throw replaceFunctionName(e, 'limitToLast()', 'Query.limitToLast()');\r\n }\r\n }\r\n startAt(...args) {\r\n try {\r\n return new Query(this.firestore, query(this._delegate, startAt(...args)));\r\n }\r\n catch (e) {\r\n throw replaceFunctionName(e, 'startAt()', 'Query.startAt()');\r\n }\r\n }\r\n startAfter(...args) {\r\n try {\r\n return new Query(this.firestore, query(this._delegate, startAfter(...args)));\r\n }\r\n catch (e) {\r\n throw replaceFunctionName(e, 'startAfter()', 'Query.startAfter()');\r\n }\r\n }\r\n endBefore(...args) {\r\n try {\r\n return new Query(this.firestore, query(this._delegate, endBefore(...args)));\r\n }\r\n catch (e) {\r\n throw replaceFunctionName(e, 'endBefore()', 'Query.endBefore()');\r\n }\r\n }\r\n endAt(...args) {\r\n try {\r\n return new Query(this.firestore, query(this._delegate, endAt(...args)));\r\n }\r\n catch (e) {\r\n throw replaceFunctionName(e, 'endAt()', 'Query.endAt()');\r\n }\r\n }\r\n isEqual(other) {\r\n return queryEqual(this._delegate, other._delegate);\r\n }\r\n get(options) {\r\n let query;\r\n if ((options === null || options === void 0 ? void 0 : options.source) === 'cache') {\r\n query = getDocsFromCache(this._delegate);\r\n }\r\n else if ((options === null || options === void 0 ? void 0 : options.source) === 'server') {\r\n query = getDocsFromServer(this._delegate);\r\n }\r\n else {\r\n query = getDocs(this._delegate);\r\n }\r\n return query.then(result => new QuerySnapshot(this.firestore, new QuerySnapshot$1(this.firestore._delegate, this._userDataWriter, this._delegate, result._snapshot)));\r\n }\r\n onSnapshot(...args) {\r\n const options = extractSnapshotOptions(args);\r\n const observer = wrapObserver(args, snap => new QuerySnapshot(this.firestore, new QuerySnapshot$1(this.firestore._delegate, this._userDataWriter, this._delegate, snap._snapshot)));\r\n return onSnapshot(this._delegate, options, observer);\r\n }\r\n withConverter(converter) {\r\n return new Query(this.firestore, converter\r\n ? this._delegate.withConverter(FirestoreDataConverter.getInstance(this.firestore, converter))\r\n : this._delegate.withConverter(null));\r\n }\r\n}\r\nclass DocumentChange {\r\n constructor(_firestore, _delegate) {\r\n this._firestore = _firestore;\r\n this._delegate = _delegate;\r\n }\r\n get type() {\r\n return this._delegate.type;\r\n }\r\n get doc() {\r\n return new QueryDocumentSnapshot(this._firestore, this._delegate.doc);\r\n }\r\n get oldIndex() {\r\n return this._delegate.oldIndex;\r\n }\r\n get newIndex() {\r\n return this._delegate.newIndex;\r\n }\r\n}\r\nclass QuerySnapshot {\r\n constructor(_firestore, _delegate) {\r\n this._firestore = _firestore;\r\n this._delegate = _delegate;\r\n }\r\n get query() {\r\n return new Query(this._firestore, this._delegate.query);\r\n }\r\n get metadata() {\r\n return this._delegate.metadata;\r\n }\r\n get size() {\r\n return this._delegate.size;\r\n }\r\n get empty() {\r\n return this._delegate.empty;\r\n }\r\n get docs() {\r\n return this._delegate.docs.map(doc => new QueryDocumentSnapshot(this._firestore, doc));\r\n }\r\n docChanges(options) {\r\n return this._delegate\r\n .docChanges(options)\r\n .map(docChange => new DocumentChange(this._firestore, docChange));\r\n }\r\n forEach(callback, thisArg) {\r\n this._delegate.forEach(snapshot => {\r\n callback.call(thisArg, new QueryDocumentSnapshot(this._firestore, snapshot));\r\n });\r\n }\r\n isEqual(other) {\r\n return snapshotEqual(this._delegate, other._delegate);\r\n }\r\n}\r\nclass CollectionReference extends Query {\r\n constructor(firestore, _delegate) {\r\n super(firestore, _delegate);\r\n this.firestore = firestore;\r\n this._delegate = _delegate;\r\n }\r\n get id() {\r\n return this._delegate.id;\r\n }\r\n get path() {\r\n return this._delegate.path;\r\n }\r\n get parent() {\r\n const docRef = this._delegate.parent;\r\n return docRef ? new DocumentReference(this.firestore, docRef) : null;\r\n }\r\n doc(documentPath) {\r\n try {\r\n if (documentPath === undefined) {\r\n // Call `doc` without `documentPath` if `documentPath` is `undefined`\r\n // as `doc` validates the number of arguments to prevent users from\r\n // accidentally passing `undefined`.\r\n return new DocumentReference(this.firestore, doc(this._delegate));\r\n }\r\n else {\r\n return new DocumentReference(this.firestore, doc(this._delegate, documentPath));\r\n }\r\n }\r\n catch (e) {\r\n throw replaceFunctionName(e, 'doc()', 'CollectionReference.doc()');\r\n }\r\n }\r\n add(data) {\r\n return addDoc(this._delegate, data).then(docRef => new DocumentReference(this.firestore, docRef));\r\n }\r\n isEqual(other) {\r\n return refEqual(this._delegate, other._delegate);\r\n }\r\n withConverter(converter) {\r\n return new CollectionReference(this.firestore, converter\r\n ? this._delegate.withConverter(FirestoreDataConverter.getInstance(this.firestore, converter))\r\n : this._delegate.withConverter(null));\r\n }\r\n}\r\nfunction castReference(documentRef) {\r\n return _cast(documentRef, DocumentReference$1);\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// The objects that are a part of this API are exposed to third-parties as\r\n// compiled javascript so we want to flag our private members with a leading\r\n// underscore to discourage their use.\r\n/**\r\n * A `FieldPath` refers to a field in a document. The path may consist of a\r\n * single field name (referring to a top-level field in the document), or a list\r\n * of field names (referring to a nested field in the document).\r\n */\r\nclass FieldPath {\r\n /**\r\n * Creates a FieldPath from the provided field names. If more than one field\r\n * name is provided, the path will point to a nested field in a document.\r\n *\r\n * @param fieldNames - A list of field names.\r\n */\r\n constructor(...fieldNames) {\r\n this._delegate = new FieldPath$1(...fieldNames);\r\n }\r\n static documentId() {\r\n /**\r\n * Internal Note: The backend doesn't technically support querying by\r\n * document ID. Instead it queries by the entire document name (full path\r\n * included), but in the cases we currently support documentId(), the net\r\n * effect is the same.\r\n */\r\n return new FieldPath(_FieldPath.keyField().canonicalString());\r\n }\r\n isEqual(other) {\r\n other = getModularInstance(other);\r\n if (!(other instanceof FieldPath$1)) {\r\n return false;\r\n }\r\n return this._delegate._internalPath.isEqual(other._internalPath);\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\nclass FieldValue {\r\n constructor(_delegate) {\r\n this._delegate = _delegate;\r\n }\r\n static serverTimestamp() {\r\n const delegate = serverTimestamp();\r\n delegate._methodName = 'FieldValue.serverTimestamp';\r\n return new FieldValue(delegate);\r\n }\r\n static delete() {\r\n const delegate = deleteField();\r\n delegate._methodName = 'FieldValue.delete';\r\n return new FieldValue(delegate);\r\n }\r\n static arrayUnion(...elements) {\r\n const delegate = arrayUnion(...elements);\r\n delegate._methodName = 'FieldValue.arrayUnion';\r\n return new FieldValue(delegate);\r\n }\r\n static arrayRemove(...elements) {\r\n const delegate = arrayRemove(...elements);\r\n delegate._methodName = 'FieldValue.arrayRemove';\r\n return new FieldValue(delegate);\r\n }\r\n static increment(n) {\r\n const delegate = increment(n);\r\n delegate._methodName = 'FieldValue.increment';\r\n return new FieldValue(delegate);\r\n }\r\n isEqual(other) {\r\n return this._delegate.isEqual(other._delegate);\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\nconst firestoreNamespace = {\r\n Firestore,\r\n GeoPoint,\r\n Timestamp,\r\n Blob,\r\n Transaction,\r\n WriteBatch,\r\n DocumentReference,\r\n DocumentSnapshot,\r\n Query,\r\n QueryDocumentSnapshot,\r\n QuerySnapshot,\r\n CollectionReference,\r\n FieldPath,\r\n FieldValue,\r\n setLogLevel,\r\n CACHE_SIZE_UNLIMITED\r\n};\r\n/**\r\n * Configures Firestore as part of the Firebase SDK by calling registerComponent.\r\n *\r\n * @param firebase - The FirebaseNamespace to register Firestore with\r\n * @param firestoreFactory - A factory function that returns a new Firestore\r\n * instance.\r\n */\r\nfunction configureForFirebase(firebase, firestoreFactory) {\r\n firebase.INTERNAL.registerComponent(new Component('firestore-compat', container => {\r\n const app = container.getProvider('app-compat').getImmediate();\r\n const firestoreExp = container.getProvider('firestore').getImmediate();\r\n return firestoreFactory(app, firestoreExp);\r\n }, 'PUBLIC').setServiceProps(Object.assign({}, firestoreNamespace)));\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 * Registers the main Firestore build with the components framework.\r\n * Persistence can be enabled via `firebase.firestore().enablePersistence()`.\r\n */\r\nfunction registerFirestore(instance) {\r\n configureForFirebase(instance, (app, firestoreExp) => new Firestore(app, firestoreExp, new IndexedDbPersistenceProvider()));\r\n instance.registerVersion(name, version);\r\n}\r\nregisterFirestore(firebase);\n\nexport { registerFirestore };\n//# sourceMappingURL=index.esm2017.js.map\n","import { getApp, _getProvider, _registerComponent, registerVersion, SDK_VERSION } from '@firebase/app';\nimport { FirebaseError, createMockUserToken, getModularInstance } from '@firebase/util';\nimport { Component } from '@firebase/component';\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 Constants used in the Firebase Storage library.\r\n */\r\n/**\r\n * Domain name for firebase storage.\r\n */\r\nconst DEFAULT_HOST = 'firebasestorage.googleapis.com';\r\n/**\r\n * The key in Firebase config json for the storage bucket.\r\n */\r\nconst CONFIG_STORAGE_BUCKET_KEY = 'storageBucket';\r\n/**\r\n * 2 minutes\r\n *\r\n * The timeout for all operations except upload.\r\n */\r\nconst DEFAULT_MAX_OPERATION_RETRY_TIME = 2 * 60 * 1000;\r\n/**\r\n * 10 minutes\r\n *\r\n * The timeout for upload.\r\n */\r\nconst DEFAULT_MAX_UPLOAD_RETRY_TIME = 10 * 60 * 1000;\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 * An error returned by the Firebase Storage SDK.\r\n * @public\r\n */\r\nclass StorageError extends FirebaseError {\r\n /**\r\n * @param code - A StorageErrorCode string to be prefixed with 'storage/' and\r\n * added to the end of the message.\r\n * @param message - Error message.\r\n */\r\n constructor(code, message) {\r\n super(prependCode(code), `Firebase Storage: ${message} (${prependCode(code)})`);\r\n /**\r\n * Stores custom error data unque to StorageError.\r\n */\r\n this.customData = { serverResponse: null };\r\n this._baseMessage = this.message;\r\n // Without this, `instanceof StorageError`, in tests for example,\r\n // returns false.\r\n Object.setPrototypeOf(this, StorageError.prototype);\r\n }\r\n /**\r\n * Compares a StorageErrorCode against this error's code, filtering out the prefix.\r\n */\r\n _codeEquals(code) {\r\n return prependCode(code) === this.code;\r\n }\r\n /**\r\n * Optional response message that was added by the server.\r\n */\r\n get serverResponse() {\r\n return this.customData.serverResponse;\r\n }\r\n set serverResponse(serverResponse) {\r\n this.customData.serverResponse = serverResponse;\r\n if (this.customData.serverResponse) {\r\n this.message = `${this._baseMessage}\\n${this.customData.serverResponse}`;\r\n }\r\n else {\r\n this.message = this._baseMessage;\r\n }\r\n }\r\n}\r\nfunction prependCode(code) {\r\n return 'storage/' + code;\r\n}\r\nfunction unknown() {\r\n const message = 'An unknown error occurred, please check the error payload for ' +\r\n 'server response.';\r\n return new StorageError(\"unknown\" /* UNKNOWN */, message);\r\n}\r\nfunction objectNotFound(path) {\r\n return new StorageError(\"object-not-found\" /* OBJECT_NOT_FOUND */, \"Object '\" + path + \"' does not exist.\");\r\n}\r\nfunction quotaExceeded(bucket) {\r\n return new StorageError(\"quota-exceeded\" /* QUOTA_EXCEEDED */, \"Quota for bucket '\" +\r\n bucket +\r\n \"' exceeded, please view quota on \" +\r\n 'https://firebase.google.com/pricing/.');\r\n}\r\nfunction unauthenticated() {\r\n const message = 'User is not authenticated, please authenticate using Firebase ' +\r\n 'Authentication and try again.';\r\n return new StorageError(\"unauthenticated\" /* UNAUTHENTICATED */, message);\r\n}\r\nfunction unauthorizedApp() {\r\n return new StorageError(\"unauthorized-app\" /* UNAUTHORIZED_APP */, 'This app does not have permission to access Firebase Storage on this project.');\r\n}\r\nfunction unauthorized(path) {\r\n return new StorageError(\"unauthorized\" /* UNAUTHORIZED */, \"User does not have permission to access '\" + path + \"'.\");\r\n}\r\nfunction retryLimitExceeded() {\r\n return new StorageError(\"retry-limit-exceeded\" /* RETRY_LIMIT_EXCEEDED */, 'Max retry time for operation exceeded, please try again.');\r\n}\r\nfunction canceled() {\r\n return new StorageError(\"canceled\" /* CANCELED */, 'User canceled the upload/download.');\r\n}\r\nfunction invalidUrl(url) {\r\n return new StorageError(\"invalid-url\" /* INVALID_URL */, \"Invalid URL '\" + url + \"'.\");\r\n}\r\nfunction invalidDefaultBucket(bucket) {\r\n return new StorageError(\"invalid-default-bucket\" /* INVALID_DEFAULT_BUCKET */, \"Invalid default bucket '\" + bucket + \"'.\");\r\n}\r\nfunction noDefaultBucket() {\r\n return new StorageError(\"no-default-bucket\" /* NO_DEFAULT_BUCKET */, 'No default bucket ' +\r\n \"found. Did you set the '\" +\r\n CONFIG_STORAGE_BUCKET_KEY +\r\n \"' property when initializing the app?\");\r\n}\r\nfunction cannotSliceBlob() {\r\n return new StorageError(\"cannot-slice-blob\" /* CANNOT_SLICE_BLOB */, 'Cannot slice blob for upload. Please retry the upload.');\r\n}\r\nfunction serverFileWrongSize() {\r\n return new StorageError(\"server-file-wrong-size\" /* SERVER_FILE_WRONG_SIZE */, 'Server recorded incorrect upload file size, please retry the upload.');\r\n}\r\nfunction noDownloadURL() {\r\n return new StorageError(\"no-download-url\" /* NO_DOWNLOAD_URL */, 'The given file does not have any download URLs.');\r\n}\r\n/**\r\n * @internal\r\n */\r\nfunction invalidArgument(message) {\r\n return new StorageError(\"invalid-argument\" /* INVALID_ARGUMENT */, message);\r\n}\r\nfunction appDeleted() {\r\n return new StorageError(\"app-deleted\" /* APP_DELETED */, 'The Firebase app was deleted.');\r\n}\r\n/**\r\n * @param name - The name of the operation that was invalid.\r\n *\r\n * @internal\r\n */\r\nfunction invalidRootOperation(name) {\r\n return new StorageError(\"invalid-root-operation\" /* INVALID_ROOT_OPERATION */, \"The operation '\" +\r\n name +\r\n \"' cannot be performed on a root reference, create a non-root \" +\r\n \"reference using child, such as .child('file.png').\");\r\n}\r\n/**\r\n * @param format - The format that was not valid.\r\n * @param message - A message describing the format violation.\r\n */\r\nfunction invalidFormat(format, message) {\r\n return new StorageError(\"invalid-format\" /* INVALID_FORMAT */, \"String does not match format '\" + format + \"': \" + message);\r\n}\r\n/**\r\n * @param message - A message describing the internal error.\r\n */\r\nfunction internalError(message) {\r\n throw new StorageError(\"internal-error\" /* INTERNAL_ERROR */, 'Internal error: ' + 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\n/**\r\n * Firebase Storage location data.\r\n *\r\n * @internal\r\n */\r\nclass Location {\r\n constructor(bucket, path) {\r\n this.bucket = bucket;\r\n this.path_ = path;\r\n }\r\n get path() {\r\n return this.path_;\r\n }\r\n get isRoot() {\r\n return this.path.length === 0;\r\n }\r\n fullServerUrl() {\r\n const encode = encodeURIComponent;\r\n return '/b/' + encode(this.bucket) + '/o/' + encode(this.path);\r\n }\r\n bucketOnlyServerUrl() {\r\n const encode = encodeURIComponent;\r\n return '/b/' + encode(this.bucket) + '/o';\r\n }\r\n static makeFromBucketSpec(bucketString, host) {\r\n let bucketLocation;\r\n try {\r\n bucketLocation = Location.makeFromUrl(bucketString, host);\r\n }\r\n catch (e) {\r\n // Not valid URL, use as-is. This lets you put bare bucket names in\r\n // config.\r\n return new Location(bucketString, '');\r\n }\r\n if (bucketLocation.path === '') {\r\n return bucketLocation;\r\n }\r\n else {\r\n throw invalidDefaultBucket(bucketString);\r\n }\r\n }\r\n static makeFromUrl(url, host) {\r\n let location = null;\r\n const bucketDomain = '([A-Za-z0-9.\\\\-_]+)';\r\n function gsModify(loc) {\r\n if (loc.path.charAt(loc.path.length - 1) === '/') {\r\n loc.path_ = loc.path_.slice(0, -1);\r\n }\r\n }\r\n const gsPath = '(/(.*))?$';\r\n const gsRegex = new RegExp('^gs://' + bucketDomain + gsPath, 'i');\r\n const gsIndices = { bucket: 1, path: 3 };\r\n function httpModify(loc) {\r\n loc.path_ = decodeURIComponent(loc.path);\r\n }\r\n const version = 'v[A-Za-z0-9_]+';\r\n const firebaseStorageHost = host.replace(/[.]/g, '\\\\.');\r\n const firebaseStoragePath = '(/([^?#]*).*)?$';\r\n const firebaseStorageRegExp = new RegExp(`^https?://${firebaseStorageHost}/${version}/b/${bucketDomain}/o${firebaseStoragePath}`, 'i');\r\n const firebaseStorageIndices = { bucket: 1, path: 3 };\r\n const cloudStorageHost = host === DEFAULT_HOST\r\n ? '(?:storage.googleapis.com|storage.cloud.google.com)'\r\n : host;\r\n const cloudStoragePath = '([^?#]*)';\r\n const cloudStorageRegExp = new RegExp(`^https?://${cloudStorageHost}/${bucketDomain}/${cloudStoragePath}`, 'i');\r\n const cloudStorageIndices = { bucket: 1, path: 2 };\r\n const groups = [\r\n { regex: gsRegex, indices: gsIndices, postModify: gsModify },\r\n {\r\n regex: firebaseStorageRegExp,\r\n indices: firebaseStorageIndices,\r\n postModify: httpModify\r\n },\r\n {\r\n regex: cloudStorageRegExp,\r\n indices: cloudStorageIndices,\r\n postModify: httpModify\r\n }\r\n ];\r\n for (let i = 0; i < groups.length; i++) {\r\n const group = groups[i];\r\n const captures = group.regex.exec(url);\r\n if (captures) {\r\n const bucketValue = captures[group.indices.bucket];\r\n let pathValue = captures[group.indices.path];\r\n if (!pathValue) {\r\n pathValue = '';\r\n }\r\n location = new Location(bucketValue, pathValue);\r\n group.postModify(location);\r\n break;\r\n }\r\n }\r\n if (location == null) {\r\n throw invalidUrl(url);\r\n }\r\n return location;\r\n }\r\n}\n\n/**\r\n * A request whose promise always fails.\r\n */\r\nclass FailRequest {\r\n constructor(error) {\r\n this.promise_ = Promise.reject(error);\r\n }\r\n /** @inheritDoc */\r\n getPromise() {\r\n return this.promise_;\r\n }\r\n /** @inheritDoc */\r\n cancel(_appDelete = false) { }\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 * @param f May be invoked\r\n * before the function returns.\r\n * @param callback Get all the arguments passed to the function\r\n * passed to f, including the initial boolean.\r\n */\r\nfunction start(f, \r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\ncallback, timeout) {\r\n // TODO(andysoto): make this code cleaner (probably refactor into an actual\r\n // type instead of a bunch of functions with state shared in the closure)\r\n let waitSeconds = 1;\r\n // Would type this as \"number\" but that doesn't work for Node so ¯\\_(ツ)_/¯\r\n // TODO: find a way to exclude Node type definition for storage because storage only works in browser\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n let retryTimeoutId = null;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n let globalTimeoutId = null;\r\n let hitTimeout = false;\r\n let cancelState = 0;\r\n function canceled() {\r\n return cancelState === 2;\r\n }\r\n let triggeredCallback = false;\r\n function triggerCallback(...args) {\r\n if (!triggeredCallback) {\r\n triggeredCallback = true;\r\n callback.apply(null, args);\r\n }\r\n }\r\n function callWithDelay(millis) {\r\n retryTimeoutId = setTimeout(() => {\r\n retryTimeoutId = null;\r\n f(handler, canceled());\r\n }, millis);\r\n }\r\n function clearGlobalTimeout() {\r\n if (globalTimeoutId) {\r\n clearTimeout(globalTimeoutId);\r\n }\r\n }\r\n function handler(success, ...args) {\r\n if (triggeredCallback) {\r\n clearGlobalTimeout();\r\n return;\r\n }\r\n if (success) {\r\n clearGlobalTimeout();\r\n triggerCallback.call(null, success, ...args);\r\n return;\r\n }\r\n const mustStop = canceled() || hitTimeout;\r\n if (mustStop) {\r\n clearGlobalTimeout();\r\n triggerCallback.call(null, success, ...args);\r\n return;\r\n }\r\n if (waitSeconds < 64) {\r\n /* TODO(andysoto): don't back off so quickly if we know we're offline. */\r\n waitSeconds *= 2;\r\n }\r\n let waitMillis;\r\n if (cancelState === 1) {\r\n cancelState = 2;\r\n waitMillis = 0;\r\n }\r\n else {\r\n waitMillis = (waitSeconds + Math.random()) * 1000;\r\n }\r\n callWithDelay(waitMillis);\r\n }\r\n let stopped = false;\r\n function stop(wasTimeout) {\r\n if (stopped) {\r\n return;\r\n }\r\n stopped = true;\r\n clearGlobalTimeout();\r\n if (triggeredCallback) {\r\n return;\r\n }\r\n if (retryTimeoutId !== null) {\r\n if (!wasTimeout) {\r\n cancelState = 2;\r\n }\r\n clearTimeout(retryTimeoutId);\r\n callWithDelay(0);\r\n }\r\n else {\r\n if (!wasTimeout) {\r\n cancelState = 1;\r\n }\r\n }\r\n }\r\n callWithDelay(0);\r\n globalTimeoutId = setTimeout(() => {\r\n hitTimeout = true;\r\n stop(true);\r\n }, timeout);\r\n return stop;\r\n}\r\n/**\r\n * Stops the retry loop from repeating.\r\n * If the function is currently \"in between\" retries, it is invoked immediately\r\n * with the second parameter as \"true\". Otherwise, it will be invoked once more\r\n * after the current invocation finishes iff the current invocation would have\r\n * triggered another retry.\r\n */\r\nfunction stop(id) {\r\n id(false);\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 isJustDef(p) {\r\n return p !== void 0;\r\n}\r\n// eslint-disable-next-line @typescript-eslint/ban-types\r\nfunction isFunction(p) {\r\n return typeof p === 'function';\r\n}\r\nfunction isNonArrayObject(p) {\r\n return typeof p === 'object' && !Array.isArray(p);\r\n}\r\nfunction isString(p) {\r\n return typeof p === 'string' || p instanceof String;\r\n}\r\nfunction isNativeBlob(p) {\r\n return isNativeBlobDefined() && p instanceof Blob;\r\n}\r\nfunction isNativeBlobDefined() {\r\n return typeof Blob !== 'undefined';\r\n}\r\nfunction validateNumber(argument, minValue, maxValue, value) {\r\n if (value < minValue) {\r\n throw invalidArgument(`Invalid value for '${argument}'. Expected ${minValue} or greater.`);\r\n }\r\n if (value > maxValue) {\r\n throw invalidArgument(`Invalid value for '${argument}'. Expected ${maxValue} or less.`);\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\nfunction makeUrl(urlPart, host, protocol) {\r\n let origin = host;\r\n if (protocol == null) {\r\n origin = `https://${host}`;\r\n }\r\n return `${protocol}://${origin}/v0${urlPart}`;\r\n}\r\nfunction makeQueryString(params) {\r\n const encode = encodeURIComponent;\r\n let queryPart = '?';\r\n for (const key in params) {\r\n if (params.hasOwnProperty(key)) {\r\n const nextPart = encode(key) + '=' + encode(params[key]);\r\n queryPart = queryPart + nextPart + '&';\r\n }\r\n }\r\n // Chop off the extra '&' or '?' on the end\r\n queryPart = queryPart.slice(0, -1);\r\n return queryPart;\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 * Error codes for requests made by the the XhrIo wrapper.\r\n */\r\nvar ErrorCode;\r\n(function (ErrorCode) {\r\n ErrorCode[ErrorCode[\"NO_ERROR\"] = 0] = \"NO_ERROR\";\r\n ErrorCode[ErrorCode[\"NETWORK_ERROR\"] = 1] = \"NETWORK_ERROR\";\r\n ErrorCode[ErrorCode[\"ABORT\"] = 2] = \"ABORT\";\r\n})(ErrorCode || (ErrorCode = {}));\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 * Handles network logic for all Storage Requests, including error reporting and\r\n * retries with backoff.\r\n *\r\n * @param I - the type of the backend's network response.\r\n * @param - O the output type used by the rest of the SDK. The conversion\r\n * happens in the specified `callback_`.\r\n */\r\nclass NetworkRequest {\r\n constructor(url_, method_, headers_, body_, successCodes_, additionalRetryCodes_, callback_, errorCallback_, timeout_, progressCallback_, connectionFactory_) {\r\n this.url_ = url_;\r\n this.method_ = method_;\r\n this.headers_ = headers_;\r\n this.body_ = body_;\r\n this.successCodes_ = successCodes_;\r\n this.additionalRetryCodes_ = additionalRetryCodes_;\r\n this.callback_ = callback_;\r\n this.errorCallback_ = errorCallback_;\r\n this.timeout_ = timeout_;\r\n this.progressCallback_ = progressCallback_;\r\n this.connectionFactory_ = connectionFactory_;\r\n this.pendingConnection_ = null;\r\n this.backoffId_ = null;\r\n this.canceled_ = false;\r\n this.appDelete_ = false;\r\n this.promise_ = new Promise((resolve, reject) => {\r\n this.resolve_ = resolve;\r\n this.reject_ = reject;\r\n this.start_();\r\n });\r\n }\r\n /**\r\n * Actually starts the retry loop.\r\n */\r\n start_() {\r\n const doTheRequest = (backoffCallback, canceled) => {\r\n if (canceled) {\r\n backoffCallback(false, new RequestEndStatus(false, null, true));\r\n return;\r\n }\r\n const connection = this.connectionFactory_();\r\n this.pendingConnection_ = connection;\r\n const progressListener = progressEvent => {\r\n const loaded = progressEvent.loaded;\r\n const total = progressEvent.lengthComputable\r\n ? progressEvent.total\r\n : -1;\r\n if (this.progressCallback_ !== null) {\r\n this.progressCallback_(loaded, total);\r\n }\r\n };\r\n if (this.progressCallback_ !== null) {\r\n connection.addUploadProgressListener(progressListener);\r\n }\r\n // connection.send() never rejects, so we don't need to have a error handler or use catch on the returned promise.\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n connection\r\n .send(this.url_, this.method_, this.body_, this.headers_)\r\n .then(() => {\r\n if (this.progressCallback_ !== null) {\r\n connection.removeUploadProgressListener(progressListener);\r\n }\r\n this.pendingConnection_ = null;\r\n const hitServer = connection.getErrorCode() === ErrorCode.NO_ERROR;\r\n const status = connection.getStatus();\r\n if (!hitServer || this.isRetryStatusCode_(status)) {\r\n const wasCanceled = connection.getErrorCode() === ErrorCode.ABORT;\r\n backoffCallback(false, new RequestEndStatus(false, null, wasCanceled));\r\n return;\r\n }\r\n const successCode = this.successCodes_.indexOf(status) !== -1;\r\n backoffCallback(true, new RequestEndStatus(successCode, connection));\r\n });\r\n };\r\n /**\r\n * @param requestWentThrough - True if the request eventually went\r\n * through, false if it hit the retry limit or was canceled.\r\n */\r\n const backoffDone = (requestWentThrough, status) => {\r\n const resolve = this.resolve_;\r\n const reject = this.reject_;\r\n const connection = status.connection;\r\n if (status.wasSuccessCode) {\r\n try {\r\n const result = this.callback_(connection, connection.getResponse());\r\n if (isJustDef(result)) {\r\n resolve(result);\r\n }\r\n else {\r\n resolve();\r\n }\r\n }\r\n catch (e) {\r\n reject(e);\r\n }\r\n }\r\n else {\r\n if (connection !== null) {\r\n const err = unknown();\r\n err.serverResponse = connection.getErrorText();\r\n if (this.errorCallback_) {\r\n reject(this.errorCallback_(connection, err));\r\n }\r\n else {\r\n reject(err);\r\n }\r\n }\r\n else {\r\n if (status.canceled) {\r\n const err = this.appDelete_ ? appDeleted() : canceled();\r\n reject(err);\r\n }\r\n else {\r\n const err = retryLimitExceeded();\r\n reject(err);\r\n }\r\n }\r\n }\r\n };\r\n if (this.canceled_) {\r\n backoffDone(false, new RequestEndStatus(false, null, true));\r\n }\r\n else {\r\n this.backoffId_ = start(doTheRequest, backoffDone, this.timeout_);\r\n }\r\n }\r\n /** @inheritDoc */\r\n getPromise() {\r\n return this.promise_;\r\n }\r\n /** @inheritDoc */\r\n cancel(appDelete) {\r\n this.canceled_ = true;\r\n this.appDelete_ = appDelete || false;\r\n if (this.backoffId_ !== null) {\r\n stop(this.backoffId_);\r\n }\r\n if (this.pendingConnection_ !== null) {\r\n this.pendingConnection_.abort();\r\n }\r\n }\r\n isRetryStatusCode_(status) {\r\n // The codes for which to retry came from this page:\r\n // https://cloud.google.com/storage/docs/exponential-backoff\r\n const isFiveHundredCode = status >= 500 && status < 600;\r\n const extraRetryCodes = [\r\n // Request Timeout: web server didn't receive full request in time.\r\n 408,\r\n // Too Many Requests: you're getting rate-limited, basically.\r\n 429\r\n ];\r\n const isExtraRetryCode = extraRetryCodes.indexOf(status) !== -1;\r\n const isRequestSpecificRetryCode = this.additionalRetryCodes_.indexOf(status) !== -1;\r\n return isFiveHundredCode || isExtraRetryCode || isRequestSpecificRetryCode;\r\n }\r\n}\r\n/**\r\n * A collection of information about the result of a network request.\r\n * @param opt_canceled - Defaults to false.\r\n */\r\nclass RequestEndStatus {\r\n constructor(wasSuccessCode, connection, canceled) {\r\n this.wasSuccessCode = wasSuccessCode;\r\n this.connection = connection;\r\n this.canceled = !!canceled;\r\n }\r\n}\r\nfunction addAuthHeader_(headers, authToken) {\r\n if (authToken !== null && authToken.length > 0) {\r\n headers['Authorization'] = 'Firebase ' + authToken;\r\n }\r\n}\r\nfunction addVersionHeader_(headers, firebaseVersion) {\r\n headers['X-Firebase-Storage-Version'] =\r\n 'webjs/' + (firebaseVersion !== null && firebaseVersion !== void 0 ? firebaseVersion : 'AppManager');\r\n}\r\nfunction addGmpidHeader_(headers, appId) {\r\n if (appId) {\r\n headers['X-Firebase-GMPID'] = appId;\r\n }\r\n}\r\nfunction addAppCheckHeader_(headers, appCheckToken) {\r\n if (appCheckToken !== null) {\r\n headers['X-Firebase-AppCheck'] = appCheckToken;\r\n }\r\n}\r\nfunction makeRequest(requestInfo, appId, authToken, appCheckToken, requestFactory, firebaseVersion) {\r\n const queryPart = makeQueryString(requestInfo.urlParams);\r\n const url = requestInfo.url + queryPart;\r\n const headers = Object.assign({}, requestInfo.headers);\r\n addGmpidHeader_(headers, appId);\r\n addAuthHeader_(headers, authToken);\r\n addVersionHeader_(headers, firebaseVersion);\r\n addAppCheckHeader_(headers, appCheckToken);\r\n return new NetworkRequest(url, requestInfo.method, headers, requestInfo.body, requestInfo.successCodes, requestInfo.additionalRetryCodes, requestInfo.handler, requestInfo.errorHandler, requestInfo.timeout, requestInfo.progressCallback, requestFactory);\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 getBlobBuilder() {\r\n if (typeof BlobBuilder !== 'undefined') {\r\n return BlobBuilder;\r\n }\r\n else if (typeof WebKitBlobBuilder !== 'undefined') {\r\n return WebKitBlobBuilder;\r\n }\r\n else {\r\n return undefined;\r\n }\r\n}\r\n/**\r\n * Concatenates one or more values together and converts them to a Blob.\r\n *\r\n * @param args The values that will make up the resulting blob.\r\n * @return The blob.\r\n */\r\nfunction getBlob$1(...args) {\r\n const BlobBuilder = getBlobBuilder();\r\n if (BlobBuilder !== undefined) {\r\n const bb = new BlobBuilder();\r\n for (let i = 0; i < args.length; i++) {\r\n bb.append(args[i]);\r\n }\r\n return bb.getBlob();\r\n }\r\n else {\r\n if (isNativeBlobDefined()) {\r\n return new Blob(args);\r\n }\r\n else {\r\n throw new StorageError(\"unsupported-environment\" /* UNSUPPORTED_ENVIRONMENT */, \"This browser doesn't seem to support creating Blobs\");\r\n }\r\n }\r\n}\r\n/**\r\n * Slices the blob. The returned blob contains data from the start byte\r\n * (inclusive) till the end byte (exclusive). Negative indices cannot be used.\r\n *\r\n * @param blob The blob to be sliced.\r\n * @param start Index of the starting byte.\r\n * @param end Index of the ending byte.\r\n * @return The blob slice or null if not supported.\r\n */\r\nfunction sliceBlob(blob, start, end) {\r\n if (blob.webkitSlice) {\r\n return blob.webkitSlice(start, end);\r\n }\r\n else if (blob.mozSlice) {\r\n return blob.mozSlice(start, end);\r\n }\r\n else if (blob.slice) {\r\n return blob.slice(start, end);\r\n }\r\n return null;\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\n/** Converts a Base64 encoded string to a binary string. */\r\nfunction decodeBase64(encoded) {\r\n return atob(encoded);\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 * An enumeration of the possible string formats for upload.\r\n * @public\r\n */\r\nconst StringFormat = {\r\n /**\r\n * Indicates the string should be interpreted \"raw\", that is, as normal text.\r\n * The string will be interpreted as UTF-16, then uploaded as a UTF-8 byte\r\n * sequence.\r\n * Example: The string 'Hello! \\\\ud83d\\\\ude0a' becomes the byte sequence\r\n * 48 65 6c 6c 6f 21 20 f0 9f 98 8a\r\n */\r\n RAW: 'raw',\r\n /**\r\n * Indicates the string should be interpreted as base64-encoded data.\r\n * Padding characters (trailing '='s) are optional.\r\n * Example: The string 'rWmO++E6t7/rlw==' becomes the byte sequence\r\n * ad 69 8e fb e1 3a b7 bf eb 97\r\n */\r\n BASE64: 'base64',\r\n /**\r\n * Indicates the string should be interpreted as base64url-encoded data.\r\n * Padding characters (trailing '='s) are optional.\r\n * Example: The string 'rWmO--E6t7_rlw==' becomes the byte sequence\r\n * ad 69 8e fb e1 3a b7 bf eb 97\r\n */\r\n BASE64URL: 'base64url',\r\n /**\r\n * Indicates the string is a data URL, such as one obtained from\r\n * canvas.toDataURL().\r\n * Example: the string 'data:application/octet-stream;base64,aaaa'\r\n * becomes the byte sequence\r\n * 69 a6 9a\r\n * (the content-type \"application/octet-stream\" is also applied, but can\r\n * be overridden in the metadata object).\r\n */\r\n DATA_URL: 'data_url'\r\n};\r\nclass StringData {\r\n constructor(data, contentType) {\r\n this.data = data;\r\n this.contentType = contentType || null;\r\n }\r\n}\r\n/**\r\n * @internal\r\n */\r\nfunction dataFromString(format, stringData) {\r\n switch (format) {\r\n case StringFormat.RAW:\r\n return new StringData(utf8Bytes_(stringData));\r\n case StringFormat.BASE64:\r\n case StringFormat.BASE64URL:\r\n return new StringData(base64Bytes_(format, stringData));\r\n case StringFormat.DATA_URL:\r\n return new StringData(dataURLBytes_(stringData), dataURLContentType_(stringData));\r\n // do nothing\r\n }\r\n // assert(false);\r\n throw unknown();\r\n}\r\nfunction utf8Bytes_(value) {\r\n const b = [];\r\n for (let i = 0; i < value.length; i++) {\r\n let c = value.charCodeAt(i);\r\n if (c <= 127) {\r\n b.push(c);\r\n }\r\n else {\r\n if (c <= 2047) {\r\n b.push(192 | (c >> 6), 128 | (c & 63));\r\n }\r\n else {\r\n if ((c & 64512) === 55296) {\r\n // The start of a surrogate pair.\r\n const valid = i < value.length - 1 && (value.charCodeAt(i + 1) & 64512) === 56320;\r\n if (!valid) {\r\n // The second surrogate wasn't there.\r\n b.push(239, 191, 189);\r\n }\r\n else {\r\n const hi = c;\r\n const lo = value.charCodeAt(++i);\r\n c = 65536 | ((hi & 1023) << 10) | (lo & 1023);\r\n b.push(240 | (c >> 18), 128 | ((c >> 12) & 63), 128 | ((c >> 6) & 63), 128 | (c & 63));\r\n }\r\n }\r\n else {\r\n if ((c & 64512) === 56320) {\r\n // Invalid low surrogate.\r\n b.push(239, 191, 189);\r\n }\r\n else {\r\n b.push(224 | (c >> 12), 128 | ((c >> 6) & 63), 128 | (c & 63));\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return new Uint8Array(b);\r\n}\r\nfunction percentEncodedBytes_(value) {\r\n let decoded;\r\n try {\r\n decoded = decodeURIComponent(value);\r\n }\r\n catch (e) {\r\n throw invalidFormat(StringFormat.DATA_URL, 'Malformed data URL.');\r\n }\r\n return utf8Bytes_(decoded);\r\n}\r\nfunction base64Bytes_(format, value) {\r\n switch (format) {\r\n case StringFormat.BASE64: {\r\n const hasMinus = value.indexOf('-') !== -1;\r\n const hasUnder = value.indexOf('_') !== -1;\r\n if (hasMinus || hasUnder) {\r\n const invalidChar = hasMinus ? '-' : '_';\r\n throw invalidFormat(format, \"Invalid character '\" +\r\n invalidChar +\r\n \"' found: is it base64url encoded?\");\r\n }\r\n break;\r\n }\r\n case StringFormat.BASE64URL: {\r\n const hasPlus = value.indexOf('+') !== -1;\r\n const hasSlash = value.indexOf('/') !== -1;\r\n if (hasPlus || hasSlash) {\r\n const invalidChar = hasPlus ? '+' : '/';\r\n throw invalidFormat(format, \"Invalid character '\" + invalidChar + \"' found: is it base64 encoded?\");\r\n }\r\n value = value.replace(/-/g, '+').replace(/_/g, '/');\r\n break;\r\n }\r\n // do nothing\r\n }\r\n let bytes;\r\n try {\r\n bytes = decodeBase64(value);\r\n }\r\n catch (e) {\r\n throw invalidFormat(format, 'Invalid character found');\r\n }\r\n const array = new Uint8Array(bytes.length);\r\n for (let i = 0; i < bytes.length; i++) {\r\n array[i] = bytes.charCodeAt(i);\r\n }\r\n return array;\r\n}\r\nclass DataURLParts {\r\n constructor(dataURL) {\r\n this.base64 = false;\r\n this.contentType = null;\r\n const matches = dataURL.match(/^data:([^,]+)?,/);\r\n if (matches === null) {\r\n throw invalidFormat(StringFormat.DATA_URL, \"Must be formatted 'data:[<mediatype>][;base64],<data>\");\r\n }\r\n const middle = matches[1] || null;\r\n if (middle != null) {\r\n this.base64 = endsWith(middle, ';base64');\r\n this.contentType = this.base64\r\n ? middle.substring(0, middle.length - ';base64'.length)\r\n : middle;\r\n }\r\n this.rest = dataURL.substring(dataURL.indexOf(',') + 1);\r\n }\r\n}\r\nfunction dataURLBytes_(dataUrl) {\r\n const parts = new DataURLParts(dataUrl);\r\n if (parts.base64) {\r\n return base64Bytes_(StringFormat.BASE64, parts.rest);\r\n }\r\n else {\r\n return percentEncodedBytes_(parts.rest);\r\n }\r\n}\r\nfunction dataURLContentType_(dataUrl) {\r\n const parts = new DataURLParts(dataUrl);\r\n return parts.contentType;\r\n}\r\nfunction endsWith(s, end) {\r\n const longEnough = s.length >= end.length;\r\n if (!longEnough) {\r\n return false;\r\n }\r\n return s.substring(s.length - end.length) === end;\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 * @param opt_elideCopy - If true, doesn't copy mutable input data\r\n * (e.g. Uint8Arrays). Pass true only if you know the objects will not be\r\n * modified after this blob's construction.\r\n *\r\n * @internal\r\n */\r\nclass FbsBlob {\r\n constructor(data, elideCopy) {\r\n let size = 0;\r\n let blobType = '';\r\n if (isNativeBlob(data)) {\r\n this.data_ = data;\r\n size = data.size;\r\n blobType = data.type;\r\n }\r\n else if (data instanceof ArrayBuffer) {\r\n if (elideCopy) {\r\n this.data_ = new Uint8Array(data);\r\n }\r\n else {\r\n this.data_ = new Uint8Array(data.byteLength);\r\n this.data_.set(new Uint8Array(data));\r\n }\r\n size = this.data_.length;\r\n }\r\n else if (data instanceof Uint8Array) {\r\n if (elideCopy) {\r\n this.data_ = data;\r\n }\r\n else {\r\n this.data_ = new Uint8Array(data.length);\r\n this.data_.set(data);\r\n }\r\n size = data.length;\r\n }\r\n this.size_ = size;\r\n this.type_ = blobType;\r\n }\r\n size() {\r\n return this.size_;\r\n }\r\n type() {\r\n return this.type_;\r\n }\r\n slice(startByte, endByte) {\r\n if (isNativeBlob(this.data_)) {\r\n const realBlob = this.data_;\r\n const sliced = sliceBlob(realBlob, startByte, endByte);\r\n if (sliced === null) {\r\n return null;\r\n }\r\n return new FbsBlob(sliced);\r\n }\r\n else {\r\n const slice = new Uint8Array(this.data_.buffer, startByte, endByte - startByte);\r\n return new FbsBlob(slice, true);\r\n }\r\n }\r\n static getBlob(...args) {\r\n if (isNativeBlobDefined()) {\r\n const blobby = args.map((val) => {\r\n if (val instanceof FbsBlob) {\r\n return val.data_;\r\n }\r\n else {\r\n return val;\r\n }\r\n });\r\n return new FbsBlob(getBlob$1.apply(null, blobby));\r\n }\r\n else {\r\n const uint8Arrays = args.map((val) => {\r\n if (isString(val)) {\r\n return dataFromString(StringFormat.RAW, val).data;\r\n }\r\n else {\r\n // Blobs don't exist, so this has to be a Uint8Array.\r\n return val.data_;\r\n }\r\n });\r\n let finalLength = 0;\r\n uint8Arrays.forEach((array) => {\r\n finalLength += array.byteLength;\r\n });\r\n const merged = new Uint8Array(finalLength);\r\n let index = 0;\r\n uint8Arrays.forEach((array) => {\r\n for (let i = 0; i < array.length; i++) {\r\n merged[index++] = array[i];\r\n }\r\n });\r\n return new FbsBlob(merged, true);\r\n }\r\n }\r\n uploadData() {\r\n return this.data_;\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/**\r\n * Returns the Object resulting from parsing the given JSON, or null if the\r\n * given string does not represent a JSON object.\r\n */\r\nfunction jsonObjectOrNull(s) {\r\n let obj;\r\n try {\r\n obj = JSON.parse(s);\r\n }\r\n catch (e) {\r\n return null;\r\n }\r\n if (isNonArrayObject(obj)) {\r\n return obj;\r\n }\r\n else {\r\n return null;\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/**\r\n * @fileoverview Contains helper methods for manipulating paths.\r\n */\r\n/**\r\n * @return Null if the path is already at the root.\r\n */\r\nfunction parent(path) {\r\n if (path.length === 0) {\r\n return null;\r\n }\r\n const index = path.lastIndexOf('/');\r\n if (index === -1) {\r\n return '';\r\n }\r\n const newPath = path.slice(0, index);\r\n return newPath;\r\n}\r\nfunction child(path, childPath) {\r\n const canonicalChildPath = childPath\r\n .split('/')\r\n .filter(component => component.length > 0)\r\n .join('/');\r\n if (path.length === 0) {\r\n return canonicalChildPath;\r\n }\r\n else {\r\n return path + '/' + canonicalChildPath;\r\n }\r\n}\r\n/**\r\n * Returns the last component of a path.\r\n * '/foo/bar' -> 'bar'\r\n * '/foo/bar/baz/' -> 'baz/'\r\n * '/a' -> 'a'\r\n */\r\nfunction lastComponent(path) {\r\n const index = path.lastIndexOf('/', path.length - 2);\r\n if (index === -1) {\r\n return path;\r\n }\r\n else {\r\n return path.slice(index + 1);\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\nfunction noXform_(metadata, value) {\r\n return value;\r\n}\r\nclass Mapping {\r\n constructor(server, local, writable, xform) {\r\n this.server = server;\r\n this.local = local || server;\r\n this.writable = !!writable;\r\n this.xform = xform || noXform_;\r\n }\r\n}\r\nlet mappings_ = null;\r\nfunction xformPath(fullPath) {\r\n if (!isString(fullPath) || fullPath.length < 2) {\r\n return fullPath;\r\n }\r\n else {\r\n return lastComponent(fullPath);\r\n }\r\n}\r\nfunction getMappings() {\r\n if (mappings_) {\r\n return mappings_;\r\n }\r\n const mappings = [];\r\n mappings.push(new Mapping('bucket'));\r\n mappings.push(new Mapping('generation'));\r\n mappings.push(new Mapping('metageneration'));\r\n mappings.push(new Mapping('name', 'fullPath', true));\r\n function mappingsXformPath(_metadata, fullPath) {\r\n return xformPath(fullPath);\r\n }\r\n const nameMapping = new Mapping('name');\r\n nameMapping.xform = mappingsXformPath;\r\n mappings.push(nameMapping);\r\n /**\r\n * Coerces the second param to a number, if it is defined.\r\n */\r\n function xformSize(_metadata, size) {\r\n if (size !== undefined) {\r\n return Number(size);\r\n }\r\n else {\r\n return size;\r\n }\r\n }\r\n const sizeMapping = new Mapping('size');\r\n sizeMapping.xform = xformSize;\r\n mappings.push(sizeMapping);\r\n mappings.push(new Mapping('timeCreated'));\r\n mappings.push(new Mapping('updated'));\r\n mappings.push(new Mapping('md5Hash', null, true));\r\n mappings.push(new Mapping('cacheControl', null, true));\r\n mappings.push(new Mapping('contentDisposition', null, true));\r\n mappings.push(new Mapping('contentEncoding', null, true));\r\n mappings.push(new Mapping('contentLanguage', null, true));\r\n mappings.push(new Mapping('contentType', null, true));\r\n mappings.push(new Mapping('metadata', 'customMetadata', true));\r\n mappings_ = mappings;\r\n return mappings_;\r\n}\r\nfunction addRef(metadata, service) {\r\n function generateRef() {\r\n const bucket = metadata['bucket'];\r\n const path = metadata['fullPath'];\r\n const loc = new Location(bucket, path);\r\n return service._makeStorageReference(loc);\r\n }\r\n Object.defineProperty(metadata, 'ref', { get: generateRef });\r\n}\r\nfunction fromResource(service, resource, mappings) {\r\n const metadata = {};\r\n metadata['type'] = 'file';\r\n const len = mappings.length;\r\n for (let i = 0; i < len; i++) {\r\n const mapping = mappings[i];\r\n metadata[mapping.local] = mapping.xform(metadata, resource[mapping.server]);\r\n }\r\n addRef(metadata, service);\r\n return metadata;\r\n}\r\nfunction fromResourceString(service, resourceString, mappings) {\r\n const obj = jsonObjectOrNull(resourceString);\r\n if (obj === null) {\r\n return null;\r\n }\r\n const resource = obj;\r\n return fromResource(service, resource, mappings);\r\n}\r\nfunction downloadUrlFromResourceString(metadata, resourceString, host, protocol) {\r\n const obj = jsonObjectOrNull(resourceString);\r\n if (obj === null) {\r\n return null;\r\n }\r\n if (!isString(obj['downloadTokens'])) {\r\n // This can happen if objects are uploaded through GCS and retrieved\r\n // through list, so we don't want to throw an Error.\r\n return null;\r\n }\r\n const tokens = obj['downloadTokens'];\r\n if (tokens.length === 0) {\r\n return null;\r\n }\r\n const encode = encodeURIComponent;\r\n const tokensList = tokens.split(',');\r\n const urls = tokensList.map((token) => {\r\n const bucket = metadata['bucket'];\r\n const path = metadata['fullPath'];\r\n const urlPart = '/b/' + encode(bucket) + '/o/' + encode(path);\r\n const base = makeUrl(urlPart, host, protocol);\r\n const queryString = makeQueryString({\r\n alt: 'media',\r\n token\r\n });\r\n return base + queryString;\r\n });\r\n return urls[0];\r\n}\r\nfunction toResourceString(metadata, mappings) {\r\n const resource = {};\r\n const len = mappings.length;\r\n for (let i = 0; i < len; i++) {\r\n const mapping = mappings[i];\r\n if (mapping.writable) {\r\n resource[mapping.server] = metadata[mapping.local];\r\n }\r\n }\r\n return JSON.stringify(resource);\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 PREFIXES_KEY = 'prefixes';\r\nconst ITEMS_KEY = 'items';\r\nfunction fromBackendResponse(service, bucket, resource) {\r\n const listResult = {\r\n prefixes: [],\r\n items: [],\r\n nextPageToken: resource['nextPageToken']\r\n };\r\n if (resource[PREFIXES_KEY]) {\r\n for (const path of resource[PREFIXES_KEY]) {\r\n const pathWithoutTrailingSlash = path.replace(/\\/$/, '');\r\n const reference = service._makeStorageReference(new Location(bucket, pathWithoutTrailingSlash));\r\n listResult.prefixes.push(reference);\r\n }\r\n }\r\n if (resource[ITEMS_KEY]) {\r\n for (const item of resource[ITEMS_KEY]) {\r\n const reference = service._makeStorageReference(new Location(bucket, item['name']));\r\n listResult.items.push(reference);\r\n }\r\n }\r\n return listResult;\r\n}\r\nfunction fromResponseString(service, bucket, resourceString) {\r\n const obj = jsonObjectOrNull(resourceString);\r\n if (obj === null) {\r\n return null;\r\n }\r\n const resource = obj;\r\n return fromBackendResponse(service, bucket, resource);\r\n}\n\n/**\r\n * Contains a fully specified request.\r\n *\r\n * @param I - the type of the backend's network response.\r\n * @param O - the output response type used by the rest of the SDK.\r\n */\r\nclass RequestInfo {\r\n constructor(url, method, \r\n /**\r\n * Returns the value with which to resolve the request's promise. Only called\r\n * if the request is successful. Throw from this function to reject the\r\n * returned Request's promise with the thrown error.\r\n * Note: The XhrIo passed to this function may be reused after this callback\r\n * returns. Do not keep a reference to it in any way.\r\n */\r\n handler, timeout) {\r\n this.url = url;\r\n this.method = method;\r\n this.handler = handler;\r\n this.timeout = timeout;\r\n this.urlParams = {};\r\n this.headers = {};\r\n this.body = null;\r\n this.errorHandler = null;\r\n /**\r\n * Called with the current number of bytes uploaded and total size (-1 if not\r\n * computable) of the request body (i.e. used to report upload progress).\r\n */\r\n this.progressCallback = null;\r\n this.successCodes = [200];\r\n this.additionalRetryCodes = [];\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/**\r\n * Throws the UNKNOWN StorageError if cndn is false.\r\n */\r\nfunction handlerCheck(cndn) {\r\n if (!cndn) {\r\n throw unknown();\r\n }\r\n}\r\nfunction metadataHandler(service, mappings) {\r\n function handler(xhr, text) {\r\n const metadata = fromResourceString(service, text, mappings);\r\n handlerCheck(metadata !== null);\r\n return metadata;\r\n }\r\n return handler;\r\n}\r\nfunction listHandler(service, bucket) {\r\n function handler(xhr, text) {\r\n const listResult = fromResponseString(service, bucket, text);\r\n handlerCheck(listResult !== null);\r\n return listResult;\r\n }\r\n return handler;\r\n}\r\nfunction downloadUrlHandler(service, mappings) {\r\n function handler(xhr, text) {\r\n const metadata = fromResourceString(service, text, mappings);\r\n handlerCheck(metadata !== null);\r\n return downloadUrlFromResourceString(metadata, text, service.host, service._protocol);\r\n }\r\n return handler;\r\n}\r\nfunction sharedErrorHandler(location) {\r\n function errorHandler(xhr, err) {\r\n let newErr;\r\n if (xhr.getStatus() === 401) {\r\n if (\r\n // This exact message string is the only consistent part of the\r\n // server's error response that identifies it as an App Check error.\r\n xhr.getErrorText().includes('Firebase App Check token is invalid')) {\r\n newErr = unauthorizedApp();\r\n }\r\n else {\r\n newErr = unauthenticated();\r\n }\r\n }\r\n else {\r\n if (xhr.getStatus() === 402) {\r\n newErr = quotaExceeded(location.bucket);\r\n }\r\n else {\r\n if (xhr.getStatus() === 403) {\r\n newErr = unauthorized(location.path);\r\n }\r\n else {\r\n newErr = err;\r\n }\r\n }\r\n }\r\n newErr.serverResponse = err.serverResponse;\r\n return newErr;\r\n }\r\n return errorHandler;\r\n}\r\nfunction objectErrorHandler(location) {\r\n const shared = sharedErrorHandler(location);\r\n function errorHandler(xhr, err) {\r\n let newErr = shared(xhr, err);\r\n if (xhr.getStatus() === 404) {\r\n newErr = objectNotFound(location.path);\r\n }\r\n newErr.serverResponse = err.serverResponse;\r\n return newErr;\r\n }\r\n return errorHandler;\r\n}\r\nfunction getMetadata$2(service, location, mappings) {\r\n const urlPart = location.fullServerUrl();\r\n const url = makeUrl(urlPart, service.host, service._protocol);\r\n const method = 'GET';\r\n const timeout = service.maxOperationRetryTime;\r\n const requestInfo = new RequestInfo(url, method, metadataHandler(service, mappings), timeout);\r\n requestInfo.errorHandler = objectErrorHandler(location);\r\n return requestInfo;\r\n}\r\nfunction list$2(service, location, delimiter, pageToken, maxResults) {\r\n const urlParams = {};\r\n if (location.isRoot) {\r\n urlParams['prefix'] = '';\r\n }\r\n else {\r\n urlParams['prefix'] = location.path + '/';\r\n }\r\n if (delimiter && delimiter.length > 0) {\r\n urlParams['delimiter'] = delimiter;\r\n }\r\n if (pageToken) {\r\n urlParams['pageToken'] = pageToken;\r\n }\r\n if (maxResults) {\r\n urlParams['maxResults'] = maxResults;\r\n }\r\n const urlPart = location.bucketOnlyServerUrl();\r\n const url = makeUrl(urlPart, service.host, service._protocol);\r\n const method = 'GET';\r\n const timeout = service.maxOperationRetryTime;\r\n const requestInfo = new RequestInfo(url, method, listHandler(service, location.bucket), timeout);\r\n requestInfo.urlParams = urlParams;\r\n requestInfo.errorHandler = sharedErrorHandler(location);\r\n return requestInfo;\r\n}\r\nfunction getBytes$1(service, location, maxDownloadSizeBytes) {\r\n const urlPart = location.fullServerUrl();\r\n const url = makeUrl(urlPart, service.host, service._protocol) + '?alt=media';\r\n const method = 'GET';\r\n const timeout = service.maxOperationRetryTime;\r\n const requestInfo = new RequestInfo(url, method, (_, data) => data, timeout);\r\n requestInfo.errorHandler = objectErrorHandler(location);\r\n if (maxDownloadSizeBytes !== undefined) {\r\n requestInfo.headers['Range'] = `bytes=0-${maxDownloadSizeBytes}`;\r\n requestInfo.successCodes = [200 /* OK */, 206 /* Partial Content */];\r\n }\r\n return requestInfo;\r\n}\r\nfunction getDownloadUrl(service, location, mappings) {\r\n const urlPart = location.fullServerUrl();\r\n const url = makeUrl(urlPart, service.host, service._protocol);\r\n const method = 'GET';\r\n const timeout = service.maxOperationRetryTime;\r\n const requestInfo = new RequestInfo(url, method, downloadUrlHandler(service, mappings), timeout);\r\n requestInfo.errorHandler = objectErrorHandler(location);\r\n return requestInfo;\r\n}\r\nfunction updateMetadata$2(service, location, metadata, mappings) {\r\n const urlPart = location.fullServerUrl();\r\n const url = makeUrl(urlPart, service.host, service._protocol);\r\n const method = 'PATCH';\r\n const body = toResourceString(metadata, mappings);\r\n const headers = { 'Content-Type': 'application/json; charset=utf-8' };\r\n const timeout = service.maxOperationRetryTime;\r\n const requestInfo = new RequestInfo(url, method, metadataHandler(service, mappings), timeout);\r\n requestInfo.headers = headers;\r\n requestInfo.body = body;\r\n requestInfo.errorHandler = objectErrorHandler(location);\r\n return requestInfo;\r\n}\r\nfunction deleteObject$2(service, location) {\r\n const urlPart = location.fullServerUrl();\r\n const url = makeUrl(urlPart, service.host, service._protocol);\r\n const method = 'DELETE';\r\n const timeout = service.maxOperationRetryTime;\r\n function handler(_xhr, _text) { }\r\n const requestInfo = new RequestInfo(url, method, handler, timeout);\r\n requestInfo.successCodes = [200, 204];\r\n requestInfo.errorHandler = objectErrorHandler(location);\r\n return requestInfo;\r\n}\r\nfunction determineContentType_(metadata, blob) {\r\n return ((metadata && metadata['contentType']) ||\r\n (blob && blob.type()) ||\r\n 'application/octet-stream');\r\n}\r\nfunction metadataForUpload_(location, blob, metadata) {\r\n const metadataClone = Object.assign({}, metadata);\r\n metadataClone['fullPath'] = location.path;\r\n metadataClone['size'] = blob.size();\r\n if (!metadataClone['contentType']) {\r\n metadataClone['contentType'] = determineContentType_(null, blob);\r\n }\r\n return metadataClone;\r\n}\r\n/**\r\n * Prepare RequestInfo for uploads as Content-Type: multipart.\r\n */\r\nfunction multipartUpload(service, location, mappings, blob, metadata) {\r\n const urlPart = location.bucketOnlyServerUrl();\r\n const headers = {\r\n 'X-Goog-Upload-Protocol': 'multipart'\r\n };\r\n function genBoundary() {\r\n let str = '';\r\n for (let i = 0; i < 2; i++) {\r\n str = str + Math.random().toString().slice(2);\r\n }\r\n return str;\r\n }\r\n const boundary = genBoundary();\r\n headers['Content-Type'] = 'multipart/related; boundary=' + boundary;\r\n const metadata_ = metadataForUpload_(location, blob, metadata);\r\n const metadataString = toResourceString(metadata_, mappings);\r\n const preBlobPart = '--' +\r\n boundary +\r\n '\\r\\n' +\r\n 'Content-Type: application/json; charset=utf-8\\r\\n\\r\\n' +\r\n metadataString +\r\n '\\r\\n--' +\r\n boundary +\r\n '\\r\\n' +\r\n 'Content-Type: ' +\r\n metadata_['contentType'] +\r\n '\\r\\n\\r\\n';\r\n const postBlobPart = '\\r\\n--' + boundary + '--';\r\n const body = FbsBlob.getBlob(preBlobPart, blob, postBlobPart);\r\n if (body === null) {\r\n throw cannotSliceBlob();\r\n }\r\n const urlParams = { name: metadata_['fullPath'] };\r\n const url = makeUrl(urlPart, service.host, service._protocol);\r\n const method = 'POST';\r\n const timeout = service.maxUploadRetryTime;\r\n const requestInfo = new RequestInfo(url, method, metadataHandler(service, mappings), timeout);\r\n requestInfo.urlParams = urlParams;\r\n requestInfo.headers = headers;\r\n requestInfo.body = body.uploadData();\r\n requestInfo.errorHandler = sharedErrorHandler(location);\r\n return requestInfo;\r\n}\r\n/**\r\n * @param current The number of bytes that have been uploaded so far.\r\n * @param total The total number of bytes in the upload.\r\n * @param opt_finalized True if the server has finished the upload.\r\n * @param opt_metadata The upload metadata, should\r\n * only be passed if opt_finalized is true.\r\n */\r\nclass ResumableUploadStatus {\r\n constructor(current, total, finalized, metadata) {\r\n this.current = current;\r\n this.total = total;\r\n this.finalized = !!finalized;\r\n this.metadata = metadata || null;\r\n }\r\n}\r\nfunction checkResumeHeader_(xhr, allowed) {\r\n let status = null;\r\n try {\r\n status = xhr.getResponseHeader('X-Goog-Upload-Status');\r\n }\r\n catch (e) {\r\n handlerCheck(false);\r\n }\r\n const allowedStatus = allowed || ['active'];\r\n handlerCheck(!!status && allowedStatus.indexOf(status) !== -1);\r\n return status;\r\n}\r\nfunction createResumableUpload(service, location, mappings, blob, metadata) {\r\n const urlPart = location.bucketOnlyServerUrl();\r\n const metadataForUpload = metadataForUpload_(location, blob, metadata);\r\n const urlParams = { name: metadataForUpload['fullPath'] };\r\n const url = makeUrl(urlPart, service.host, service._protocol);\r\n const method = 'POST';\r\n const headers = {\r\n 'X-Goog-Upload-Protocol': 'resumable',\r\n 'X-Goog-Upload-Command': 'start',\r\n 'X-Goog-Upload-Header-Content-Length': `${blob.size()}`,\r\n 'X-Goog-Upload-Header-Content-Type': metadataForUpload['contentType'],\r\n 'Content-Type': 'application/json; charset=utf-8'\r\n };\r\n const body = toResourceString(metadataForUpload, mappings);\r\n const timeout = service.maxUploadRetryTime;\r\n function handler(xhr) {\r\n checkResumeHeader_(xhr);\r\n let url;\r\n try {\r\n url = xhr.getResponseHeader('X-Goog-Upload-URL');\r\n }\r\n catch (e) {\r\n handlerCheck(false);\r\n }\r\n handlerCheck(isString(url));\r\n return url;\r\n }\r\n const requestInfo = new RequestInfo(url, method, handler, timeout);\r\n requestInfo.urlParams = urlParams;\r\n requestInfo.headers = headers;\r\n requestInfo.body = body;\r\n requestInfo.errorHandler = sharedErrorHandler(location);\r\n return requestInfo;\r\n}\r\n/**\r\n * @param url From a call to fbs.requests.createResumableUpload.\r\n */\r\nfunction getResumableUploadStatus(service, location, url, blob) {\r\n const headers = { 'X-Goog-Upload-Command': 'query' };\r\n function handler(xhr) {\r\n const status = checkResumeHeader_(xhr, ['active', 'final']);\r\n let sizeString = null;\r\n try {\r\n sizeString = xhr.getResponseHeader('X-Goog-Upload-Size-Received');\r\n }\r\n catch (e) {\r\n handlerCheck(false);\r\n }\r\n if (!sizeString) {\r\n // null or empty string\r\n handlerCheck(false);\r\n }\r\n const size = Number(sizeString);\r\n handlerCheck(!isNaN(size));\r\n return new ResumableUploadStatus(size, blob.size(), status === 'final');\r\n }\r\n const method = 'POST';\r\n const timeout = service.maxUploadRetryTime;\r\n const requestInfo = new RequestInfo(url, method, handler, timeout);\r\n requestInfo.headers = headers;\r\n requestInfo.errorHandler = sharedErrorHandler(location);\r\n return requestInfo;\r\n}\r\n/**\r\n * Any uploads via the resumable upload API must transfer a number of bytes\r\n * that is a multiple of this number.\r\n */\r\nconst RESUMABLE_UPLOAD_CHUNK_SIZE = 256 * 1024;\r\n/**\r\n * @param url From a call to fbs.requests.createResumableUpload.\r\n * @param chunkSize Number of bytes to upload.\r\n * @param status The previous status.\r\n * If not passed or null, we start from the beginning.\r\n * @throws fbs.Error If the upload is already complete, the passed in status\r\n * has a final size inconsistent with the blob, or the blob cannot be sliced\r\n * for upload.\r\n */\r\nfunction continueResumableUpload(location, service, url, blob, chunkSize, mappings, status, progressCallback) {\r\n // TODO(andysoto): standardize on internal asserts\r\n // assert(!(opt_status && opt_status.finalized));\r\n const status_ = new ResumableUploadStatus(0, 0);\r\n if (status) {\r\n status_.current = status.current;\r\n status_.total = status.total;\r\n }\r\n else {\r\n status_.current = 0;\r\n status_.total = blob.size();\r\n }\r\n if (blob.size() !== status_.total) {\r\n throw serverFileWrongSize();\r\n }\r\n const bytesLeft = status_.total - status_.current;\r\n let bytesToUpload = bytesLeft;\r\n if (chunkSize > 0) {\r\n bytesToUpload = Math.min(bytesToUpload, chunkSize);\r\n }\r\n const startByte = status_.current;\r\n const endByte = startByte + bytesToUpload;\r\n const uploadCommand = bytesToUpload === bytesLeft ? 'upload, finalize' : 'upload';\r\n const headers = {\r\n 'X-Goog-Upload-Command': uploadCommand,\r\n 'X-Goog-Upload-Offset': `${status_.current}`\r\n };\r\n const body = blob.slice(startByte, endByte);\r\n if (body === null) {\r\n throw cannotSliceBlob();\r\n }\r\n function handler(xhr, text) {\r\n // TODO(andysoto): Verify the MD5 of each uploaded range:\r\n // the 'x-range-md5' header comes back with status code 308 responses.\r\n // We'll only be able to bail out though, because you can't re-upload a\r\n // range that you previously uploaded.\r\n const uploadStatus = checkResumeHeader_(xhr, ['active', 'final']);\r\n const newCurrent = status_.current + bytesToUpload;\r\n const size = blob.size();\r\n let metadata;\r\n if (uploadStatus === 'final') {\r\n metadata = metadataHandler(service, mappings)(xhr, text);\r\n }\r\n else {\r\n metadata = null;\r\n }\r\n return new ResumableUploadStatus(newCurrent, size, uploadStatus === 'final', metadata);\r\n }\r\n const method = 'POST';\r\n const timeout = service.maxUploadRetryTime;\r\n const requestInfo = new RequestInfo(url, method, handler, timeout);\r\n requestInfo.headers = headers;\r\n requestInfo.body = body.uploadData();\r\n requestInfo.progressCallback = progressCallback || null;\r\n requestInfo.errorHandler = sharedErrorHandler(location);\r\n return requestInfo;\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 * An event that is triggered on a task.\r\n * @internal\r\n */\r\nconst TaskEvent = {\r\n /**\r\n * For this event,\r\n * <ul>\r\n * <li>The `next` function is triggered on progress updates and when the\r\n * task is paused/resumed with an `UploadTaskSnapshot` as the first\r\n * argument.</li>\r\n * <li>The `error` function is triggered if the upload is canceled or fails\r\n * for another reason.</li>\r\n * <li>The `complete` function is triggered if the upload completes\r\n * successfully.</li>\r\n * </ul>\r\n */\r\n STATE_CHANGED: 'state_changed'\r\n};\r\n// type keys = keyof TaskState\r\n/**\r\n * Represents the current state of a running upload.\r\n * @internal\r\n */\r\nconst TaskState = {\r\n /** The task is currently transferring data. */\r\n RUNNING: 'running',\r\n /** The task was paused by the user. */\r\n PAUSED: 'paused',\r\n /** The task completed successfully. */\r\n SUCCESS: 'success',\r\n /** The task was canceled. */\r\n CANCELED: 'canceled',\r\n /** The task failed with an error. */\r\n ERROR: 'error'\r\n};\r\nfunction taskStateFromInternalTaskState(state) {\r\n switch (state) {\r\n case \"running\" /* RUNNING */:\r\n case \"pausing\" /* PAUSING */:\r\n case \"canceling\" /* CANCELING */:\r\n return TaskState.RUNNING;\r\n case \"paused\" /* PAUSED */:\r\n return TaskState.PAUSED;\r\n case \"success\" /* SUCCESS */:\r\n return TaskState.SUCCESS;\r\n case \"canceled\" /* CANCELED */:\r\n return TaskState.CANCELED;\r\n case \"error\" /* ERROR */:\r\n return TaskState.ERROR;\r\n default:\r\n // TODO(andysoto): assert(false);\r\n return TaskState.ERROR;\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\nclass Observer {\r\n constructor(nextOrObserver, error, complete) {\r\n const asFunctions = isFunction(nextOrObserver) || error != null || complete != null;\r\n if (asFunctions) {\r\n this.next = nextOrObserver;\r\n this.error = error !== null && error !== void 0 ? error : undefined;\r\n this.complete = complete !== null && complete !== void 0 ? complete : undefined;\r\n }\r\n else {\r\n const observer = nextOrObserver;\r\n this.next = observer.next;\r\n this.error = observer.error;\r\n this.complete = observer.complete;\r\n }\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/**\r\n * Returns a function that invokes f with its arguments asynchronously as a\r\n * microtask, i.e. as soon as possible after the current script returns back\r\n * into browser code.\r\n */\r\n// eslint-disable-next-line @typescript-eslint/ban-types\r\nfunction async(f) {\r\n return (...argsToForward) => {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n Promise.resolve().then(() => f(...argsToForward));\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/** An override for the text-based Connection. Used in tests. */\r\nlet textFactoryOverride = null;\r\n/**\r\n * Network layer for browsers. We use this instead of goog.net.XhrIo because\r\n * goog.net.XhrIo is hyuuuuge and doesn't work in React Native on Android.\r\n */\r\nclass XhrConnection {\r\n constructor() {\r\n this.sent_ = false;\r\n this.xhr_ = new XMLHttpRequest();\r\n this.initXhr();\r\n this.errorCode_ = ErrorCode.NO_ERROR;\r\n this.sendPromise_ = new Promise(resolve => {\r\n this.xhr_.addEventListener('abort', () => {\r\n this.errorCode_ = ErrorCode.ABORT;\r\n resolve();\r\n });\r\n this.xhr_.addEventListener('error', () => {\r\n this.errorCode_ = ErrorCode.NETWORK_ERROR;\r\n resolve();\r\n });\r\n this.xhr_.addEventListener('load', () => {\r\n resolve();\r\n });\r\n });\r\n }\r\n send(url, method, body, headers) {\r\n if (this.sent_) {\r\n throw internalError('cannot .send() more than once');\r\n }\r\n this.sent_ = true;\r\n this.xhr_.open(method, url, true);\r\n if (headers !== undefined) {\r\n for (const key in headers) {\r\n if (headers.hasOwnProperty(key)) {\r\n this.xhr_.setRequestHeader(key, headers[key].toString());\r\n }\r\n }\r\n }\r\n if (body !== undefined) {\r\n this.xhr_.send(body);\r\n }\r\n else {\r\n this.xhr_.send();\r\n }\r\n return this.sendPromise_;\r\n }\r\n getErrorCode() {\r\n if (!this.sent_) {\r\n throw internalError('cannot .getErrorCode() before sending');\r\n }\r\n return this.errorCode_;\r\n }\r\n getStatus() {\r\n if (!this.sent_) {\r\n throw internalError('cannot .getStatus() before sending');\r\n }\r\n try {\r\n return this.xhr_.status;\r\n }\r\n catch (e) {\r\n return -1;\r\n }\r\n }\r\n getResponse() {\r\n if (!this.sent_) {\r\n throw internalError('cannot .getResponse() before sending');\r\n }\r\n return this.xhr_.response;\r\n }\r\n getErrorText() {\r\n if (!this.sent_) {\r\n throw internalError('cannot .getErrorText() before sending');\r\n }\r\n return this.xhr_.statusText;\r\n }\r\n /** Aborts the request. */\r\n abort() {\r\n this.xhr_.abort();\r\n }\r\n getResponseHeader(header) {\r\n return this.xhr_.getResponseHeader(header);\r\n }\r\n addUploadProgressListener(listener) {\r\n if (this.xhr_.upload != null) {\r\n this.xhr_.upload.addEventListener('progress', listener);\r\n }\r\n }\r\n removeUploadProgressListener(listener) {\r\n if (this.xhr_.upload != null) {\r\n this.xhr_.upload.removeEventListener('progress', listener);\r\n }\r\n }\r\n}\r\nclass XhrTextConnection extends XhrConnection {\r\n initXhr() {\r\n this.xhr_.responseType = 'text';\r\n }\r\n}\r\nfunction newTextConnection() {\r\n return textFactoryOverride ? textFactoryOverride() : new XhrTextConnection();\r\n}\r\nclass XhrBytesConnection extends XhrConnection {\r\n initXhr() {\r\n this.xhr_.responseType = 'arraybuffer';\r\n }\r\n}\r\nfunction newBytesConnection() {\r\n return new XhrBytesConnection();\r\n}\r\nclass XhrBlobConnection extends XhrConnection {\r\n initXhr() {\r\n this.xhr_.responseType = 'blob';\r\n }\r\n}\r\nfunction newBlobConnection() {\r\n return new XhrBlobConnection();\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 * Represents a blob being uploaded. Can be used to pause/resume/cancel the\r\n * upload and manage callbacks for various events.\r\n * @internal\r\n */\r\nclass UploadTask {\r\n /**\r\n * @param ref - The firebaseStorage.Reference object this task came\r\n * from, untyped to avoid cyclic dependencies.\r\n * @param blob - The blob to upload.\r\n */\r\n constructor(ref, blob, metadata = null) {\r\n /**\r\n * Number of bytes transferred so far.\r\n */\r\n this._transferred = 0;\r\n this._needToFetchStatus = false;\r\n this._needToFetchMetadata = false;\r\n this._observers = [];\r\n this._error = undefined;\r\n this._uploadUrl = undefined;\r\n this._request = undefined;\r\n this._chunkMultiplier = 1;\r\n this._resolve = undefined;\r\n this._reject = undefined;\r\n this._ref = ref;\r\n this._blob = blob;\r\n this._metadata = metadata;\r\n this._mappings = getMappings();\r\n this._resumable = this._shouldDoResumable(this._blob);\r\n this._state = \"running\" /* RUNNING */;\r\n this._errorHandler = error => {\r\n this._request = undefined;\r\n this._chunkMultiplier = 1;\r\n if (error._codeEquals(\"canceled\" /* CANCELED */)) {\r\n this._needToFetchStatus = true;\r\n this.completeTransitions_();\r\n }\r\n else {\r\n this._error = error;\r\n this._transition(\"error\" /* ERROR */);\r\n }\r\n };\r\n this._metadataErrorHandler = error => {\r\n this._request = undefined;\r\n if (error._codeEquals(\"canceled\" /* CANCELED */)) {\r\n this.completeTransitions_();\r\n }\r\n else {\r\n this._error = error;\r\n this._transition(\"error\" /* ERROR */);\r\n }\r\n };\r\n this._promise = new Promise((resolve, reject) => {\r\n this._resolve = resolve;\r\n this._reject = reject;\r\n this._start();\r\n });\r\n // Prevent uncaught rejections on the internal promise from bubbling out\r\n // to the top level with a dummy handler.\r\n this._promise.then(null, () => { });\r\n }\r\n _makeProgressCallback() {\r\n const sizeBefore = this._transferred;\r\n return loaded => this._updateProgress(sizeBefore + loaded);\r\n }\r\n _shouldDoResumable(blob) {\r\n return blob.size() > 256 * 1024;\r\n }\r\n _start() {\r\n if (this._state !== \"running\" /* RUNNING */) {\r\n // This can happen if someone pauses us in a resume callback, for example.\r\n return;\r\n }\r\n if (this._request !== undefined) {\r\n return;\r\n }\r\n if (this._resumable) {\r\n if (this._uploadUrl === undefined) {\r\n this._createResumable();\r\n }\r\n else {\r\n if (this._needToFetchStatus) {\r\n this._fetchStatus();\r\n }\r\n else {\r\n if (this._needToFetchMetadata) {\r\n // Happens if we miss the metadata on upload completion.\r\n this._fetchMetadata();\r\n }\r\n else {\r\n this._continueUpload();\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n this._oneShotUpload();\r\n }\r\n }\r\n _resolveToken(callback) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n Promise.all([\r\n this._ref.storage._getAuthToken(),\r\n this._ref.storage._getAppCheckToken()\r\n ]).then(([authToken, appCheckToken]) => {\r\n switch (this._state) {\r\n case \"running\" /* RUNNING */:\r\n callback(authToken, appCheckToken);\r\n break;\r\n case \"canceling\" /* CANCELING */:\r\n this._transition(\"canceled\" /* CANCELED */);\r\n break;\r\n case \"pausing\" /* PAUSING */:\r\n this._transition(\"paused\" /* PAUSED */);\r\n break;\r\n }\r\n });\r\n }\r\n // TODO(andysoto): assert false\r\n _createResumable() {\r\n this._resolveToken((authToken, appCheckToken) => {\r\n const requestInfo = createResumableUpload(this._ref.storage, this._ref._location, this._mappings, this._blob, this._metadata);\r\n const createRequest = this._ref.storage._makeRequest(requestInfo, newTextConnection, authToken, appCheckToken);\r\n this._request = createRequest;\r\n createRequest.getPromise().then((url) => {\r\n this._request = undefined;\r\n this._uploadUrl = url;\r\n this._needToFetchStatus = false;\r\n this.completeTransitions_();\r\n }, this._errorHandler);\r\n });\r\n }\r\n _fetchStatus() {\r\n // TODO(andysoto): assert(this.uploadUrl_ !== null);\r\n const url = this._uploadUrl;\r\n this._resolveToken((authToken, appCheckToken) => {\r\n const requestInfo = getResumableUploadStatus(this._ref.storage, this._ref._location, url, this._blob);\r\n const statusRequest = this._ref.storage._makeRequest(requestInfo, newTextConnection, authToken, appCheckToken);\r\n this._request = statusRequest;\r\n statusRequest.getPromise().then(status => {\r\n status = status;\r\n this._request = undefined;\r\n this._updateProgress(status.current);\r\n this._needToFetchStatus = false;\r\n if (status.finalized) {\r\n this._needToFetchMetadata = true;\r\n }\r\n this.completeTransitions_();\r\n }, this._errorHandler);\r\n });\r\n }\r\n _continueUpload() {\r\n const chunkSize = RESUMABLE_UPLOAD_CHUNK_SIZE * this._chunkMultiplier;\r\n const status = new ResumableUploadStatus(this._transferred, this._blob.size());\r\n // TODO(andysoto): assert(this.uploadUrl_ !== null);\r\n const url = this._uploadUrl;\r\n this._resolveToken((authToken, appCheckToken) => {\r\n let requestInfo;\r\n try {\r\n requestInfo = continueResumableUpload(this._ref._location, this._ref.storage, url, this._blob, chunkSize, this._mappings, status, this._makeProgressCallback());\r\n }\r\n catch (e) {\r\n this._error = e;\r\n this._transition(\"error\" /* ERROR */);\r\n return;\r\n }\r\n const uploadRequest = this._ref.storage._makeRequest(requestInfo, newTextConnection, authToken, appCheckToken);\r\n this._request = uploadRequest;\r\n uploadRequest.getPromise().then((newStatus) => {\r\n this._increaseMultiplier();\r\n this._request = undefined;\r\n this._updateProgress(newStatus.current);\r\n if (newStatus.finalized) {\r\n this._metadata = newStatus.metadata;\r\n this._transition(\"success\" /* SUCCESS */);\r\n }\r\n else {\r\n this.completeTransitions_();\r\n }\r\n }, this._errorHandler);\r\n });\r\n }\r\n _increaseMultiplier() {\r\n const currentSize = RESUMABLE_UPLOAD_CHUNK_SIZE * this._chunkMultiplier;\r\n // Max chunk size is 32M.\r\n if (currentSize < 32 * 1024 * 1024) {\r\n this._chunkMultiplier *= 2;\r\n }\r\n }\r\n _fetchMetadata() {\r\n this._resolveToken((authToken, appCheckToken) => {\r\n const requestInfo = getMetadata$2(this._ref.storage, this._ref._location, this._mappings);\r\n const metadataRequest = this._ref.storage._makeRequest(requestInfo, newTextConnection, authToken, appCheckToken);\r\n this._request = metadataRequest;\r\n metadataRequest.getPromise().then(metadata => {\r\n this._request = undefined;\r\n this._metadata = metadata;\r\n this._transition(\"success\" /* SUCCESS */);\r\n }, this._metadataErrorHandler);\r\n });\r\n }\r\n _oneShotUpload() {\r\n this._resolveToken((authToken, appCheckToken) => {\r\n const requestInfo = multipartUpload(this._ref.storage, this._ref._location, this._mappings, this._blob, this._metadata);\r\n const multipartRequest = this._ref.storage._makeRequest(requestInfo, newTextConnection, authToken, appCheckToken);\r\n this._request = multipartRequest;\r\n multipartRequest.getPromise().then(metadata => {\r\n this._request = undefined;\r\n this._metadata = metadata;\r\n this._updateProgress(this._blob.size());\r\n this._transition(\"success\" /* SUCCESS */);\r\n }, this._errorHandler);\r\n });\r\n }\r\n _updateProgress(transferred) {\r\n const old = this._transferred;\r\n this._transferred = transferred;\r\n // A progress update can make the \"transferred\" value smaller (e.g. a\r\n // partial upload not completed by server, after which the \"transferred\"\r\n // value may reset to the value at the beginning of the request).\r\n if (this._transferred !== old) {\r\n this._notifyObservers();\r\n }\r\n }\r\n _transition(state) {\r\n if (this._state === state) {\r\n return;\r\n }\r\n switch (state) {\r\n case \"canceling\" /* CANCELING */:\r\n // TODO(andysoto):\r\n // assert(this.state_ === InternalTaskState.RUNNING ||\r\n // this.state_ === InternalTaskState.PAUSING);\r\n this._state = state;\r\n if (this._request !== undefined) {\r\n this._request.cancel();\r\n }\r\n break;\r\n case \"pausing\" /* PAUSING */:\r\n // TODO(andysoto):\r\n // assert(this.state_ === InternalTaskState.RUNNING);\r\n this._state = state;\r\n if (this._request !== undefined) {\r\n this._request.cancel();\r\n }\r\n break;\r\n case \"running\" /* RUNNING */:\r\n // TODO(andysoto):\r\n // assert(this.state_ === InternalTaskState.PAUSED ||\r\n // this.state_ === InternalTaskState.PAUSING);\r\n const wasPaused = this._state === \"paused\" /* PAUSED */;\r\n this._state = state;\r\n if (wasPaused) {\r\n this._notifyObservers();\r\n this._start();\r\n }\r\n break;\r\n case \"paused\" /* PAUSED */:\r\n // TODO(andysoto):\r\n // assert(this.state_ === InternalTaskState.PAUSING);\r\n this._state = state;\r\n this._notifyObservers();\r\n break;\r\n case \"canceled\" /* CANCELED */:\r\n // TODO(andysoto):\r\n // assert(this.state_ === InternalTaskState.PAUSED ||\r\n // this.state_ === InternalTaskState.CANCELING);\r\n this._error = canceled();\r\n this._state = state;\r\n this._notifyObservers();\r\n break;\r\n case \"error\" /* ERROR */:\r\n // TODO(andysoto):\r\n // assert(this.state_ === InternalTaskState.RUNNING ||\r\n // this.state_ === InternalTaskState.PAUSING ||\r\n // this.state_ === InternalTaskState.CANCELING);\r\n this._state = state;\r\n this._notifyObservers();\r\n break;\r\n case \"success\" /* SUCCESS */:\r\n // TODO(andysoto):\r\n // assert(this.state_ === InternalTaskState.RUNNING ||\r\n // this.state_ === InternalTaskState.PAUSING ||\r\n // this.state_ === InternalTaskState.CANCELING);\r\n this._state = state;\r\n this._notifyObservers();\r\n break;\r\n }\r\n }\r\n completeTransitions_() {\r\n switch (this._state) {\r\n case \"pausing\" /* PAUSING */:\r\n this._transition(\"paused\" /* PAUSED */);\r\n break;\r\n case \"canceling\" /* CANCELING */:\r\n this._transition(\"canceled\" /* CANCELED */);\r\n break;\r\n case \"running\" /* RUNNING */:\r\n this._start();\r\n break;\r\n }\r\n }\r\n /**\r\n * A snapshot of the current task state.\r\n */\r\n get snapshot() {\r\n const externalState = taskStateFromInternalTaskState(this._state);\r\n return {\r\n bytesTransferred: this._transferred,\r\n totalBytes: this._blob.size(),\r\n state: externalState,\r\n metadata: this._metadata,\r\n task: this,\r\n ref: this._ref\r\n };\r\n }\r\n /**\r\n * Adds a callback for an event.\r\n * @param type - The type of event to listen for.\r\n * @param nextOrObserver -\r\n * The `next` function, which gets called for each item in\r\n * the event stream, or an observer object with some or all of these three\r\n * properties (`next`, `error`, `complete`).\r\n * @param error - A function that gets called with a `StorageError`\r\n * if the event stream ends due to an error.\r\n * @param completed - A function that gets called if the\r\n * event stream ends normally.\r\n * @returns\r\n * If only the event argument is passed, returns a function you can use to\r\n * add callbacks (see the examples above). If more than just the event\r\n * argument is passed, returns a function you can call to unregister the\r\n * callbacks.\r\n */\r\n on(type, nextOrObserver, error, completed) {\r\n const observer = new Observer(nextOrObserver || undefined, error || undefined, completed || undefined);\r\n this._addObserver(observer);\r\n return () => {\r\n this._removeObserver(observer);\r\n };\r\n }\r\n /**\r\n * This object behaves like a Promise, and resolves with its snapshot data\r\n * when the upload completes.\r\n * @param onFulfilled - The fulfillment callback. Promise chaining works as normal.\r\n * @param onRejected - The rejection callback.\r\n */\r\n then(onFulfilled, onRejected) {\r\n // These casts are needed so that TypeScript can infer the types of the\r\n // resulting Promise.\r\n return this._promise.then(onFulfilled, onRejected);\r\n }\r\n /**\r\n * Equivalent to calling `then(null, onRejected)`.\r\n */\r\n catch(onRejected) {\r\n return this.then(null, onRejected);\r\n }\r\n /**\r\n * Adds the given observer.\r\n */\r\n _addObserver(observer) {\r\n this._observers.push(observer);\r\n this._notifyObserver(observer);\r\n }\r\n /**\r\n * Removes the given observer.\r\n */\r\n _removeObserver(observer) {\r\n const i = this._observers.indexOf(observer);\r\n if (i !== -1) {\r\n this._observers.splice(i, 1);\r\n }\r\n }\r\n _notifyObservers() {\r\n this._finishPromise();\r\n const observers = this._observers.slice();\r\n observers.forEach(observer => {\r\n this._notifyObserver(observer);\r\n });\r\n }\r\n _finishPromise() {\r\n if (this._resolve !== undefined) {\r\n let triggered = true;\r\n switch (taskStateFromInternalTaskState(this._state)) {\r\n case TaskState.SUCCESS:\r\n async(this._resolve.bind(null, this.snapshot))();\r\n break;\r\n case TaskState.CANCELED:\r\n case TaskState.ERROR:\r\n const toCall = this._reject;\r\n async(toCall.bind(null, this._error))();\r\n break;\r\n default:\r\n triggered = false;\r\n break;\r\n }\r\n if (triggered) {\r\n this._resolve = undefined;\r\n this._reject = undefined;\r\n }\r\n }\r\n }\r\n _notifyObserver(observer) {\r\n const externalState = taskStateFromInternalTaskState(this._state);\r\n switch (externalState) {\r\n case TaskState.RUNNING:\r\n case TaskState.PAUSED:\r\n if (observer.next) {\r\n async(observer.next.bind(observer, this.snapshot))();\r\n }\r\n break;\r\n case TaskState.SUCCESS:\r\n if (observer.complete) {\r\n async(observer.complete.bind(observer))();\r\n }\r\n break;\r\n case TaskState.CANCELED:\r\n case TaskState.ERROR:\r\n if (observer.error) {\r\n async(observer.error.bind(observer, this._error))();\r\n }\r\n break;\r\n default:\r\n // TODO(andysoto): assert(false);\r\n if (observer.error) {\r\n async(observer.error.bind(observer, this._error))();\r\n }\r\n }\r\n }\r\n /**\r\n * Resumes a paused task. Has no effect on a currently running or failed task.\r\n * @returns True if the operation took effect, false if ignored.\r\n */\r\n resume() {\r\n const valid = this._state === \"paused\" /* PAUSED */ ||\r\n this._state === \"pausing\" /* PAUSING */;\r\n if (valid) {\r\n this._transition(\"running\" /* RUNNING */);\r\n }\r\n return valid;\r\n }\r\n /**\r\n * Pauses a currently running task. Has no effect on a paused or failed task.\r\n * @returns True if the operation took effect, false if ignored.\r\n */\r\n pause() {\r\n const valid = this._state === \"running\" /* RUNNING */;\r\n if (valid) {\r\n this._transition(\"pausing\" /* PAUSING */);\r\n }\r\n return valid;\r\n }\r\n /**\r\n * Cancels a currently running or paused task. Has no effect on a complete or\r\n * failed task.\r\n * @returns True if the operation took effect, false if ignored.\r\n */\r\n cancel() {\r\n const valid = this._state === \"running\" /* RUNNING */ ||\r\n this._state === \"pausing\" /* PAUSING */;\r\n if (valid) {\r\n this._transition(\"canceling\" /* CANCELING */);\r\n }\r\n return valid;\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 * Provides methods to interact with a bucket in the Firebase Storage service.\r\n * @internal\r\n * @param _location - An fbs.location, or the URL at\r\n * which to base this object, in one of the following forms:\r\n * gs://<bucket>/<object-path>\r\n * http[s]://firebasestorage.googleapis.com/\r\n * <api-version>/b/<bucket>/o/<object-path>\r\n * Any query or fragment strings will be ignored in the http[s]\r\n * format. If no value is passed, the storage object will use a URL based on\r\n * the project ID of the base firebase.App instance.\r\n */\r\nclass Reference {\r\n constructor(_service, location) {\r\n this._service = _service;\r\n if (location instanceof Location) {\r\n this._location = location;\r\n }\r\n else {\r\n this._location = Location.makeFromUrl(location, _service.host);\r\n }\r\n }\r\n /**\r\n * Returns the URL for the bucket and path this object references,\r\n * in the form gs://<bucket>/<object-path>\r\n * @override\r\n */\r\n toString() {\r\n return 'gs://' + this._location.bucket + '/' + this._location.path;\r\n }\r\n _newRef(service, location) {\r\n return new Reference(service, location);\r\n }\r\n /**\r\n * A reference to the root of this object's bucket.\r\n */\r\n get root() {\r\n const location = new Location(this._location.bucket, '');\r\n return this._newRef(this._service, location);\r\n }\r\n /**\r\n * The name of the bucket containing this reference's object.\r\n */\r\n get bucket() {\r\n return this._location.bucket;\r\n }\r\n /**\r\n * The full path of this object.\r\n */\r\n get fullPath() {\r\n return this._location.path;\r\n }\r\n /**\r\n * The short name of this object, which is the last component of the full path.\r\n * For example, if fullPath is 'full/path/image.png', name is 'image.png'.\r\n */\r\n get name() {\r\n return lastComponent(this._location.path);\r\n }\r\n /**\r\n * The `StorageService` instance this `StorageReference` is associated with.\r\n */\r\n get storage() {\r\n return this._service;\r\n }\r\n /**\r\n * A `StorageReference` pointing to the parent location of this `StorageReference`, or null if\r\n * this reference is the root.\r\n */\r\n get parent() {\r\n const newPath = parent(this._location.path);\r\n if (newPath === null) {\r\n return null;\r\n }\r\n const location = new Location(this._location.bucket, newPath);\r\n return new Reference(this._service, location);\r\n }\r\n /**\r\n * Utility function to throw an error in methods that do not accept a root reference.\r\n */\r\n _throwIfRoot(name) {\r\n if (this._location.path === '') {\r\n throw invalidRootOperation(name);\r\n }\r\n }\r\n}\r\n/**\r\n * Download the bytes at the object's location.\r\n * @returns A Promise containing the downloaded bytes.\r\n */\r\nfunction getBytesInternal(ref, maxDownloadSizeBytes) {\r\n ref._throwIfRoot('getBytes');\r\n const requestInfo = getBytes$1(ref.storage, ref._location, maxDownloadSizeBytes);\r\n return ref.storage\r\n .makeRequestWithTokens(requestInfo, newBytesConnection)\r\n .then(bytes => maxDownloadSizeBytes !== undefined\r\n ? // GCS may not honor the Range header for small files\r\n bytes.slice(0, maxDownloadSizeBytes)\r\n : bytes);\r\n}\r\n/**\r\n * Download the bytes at the object's location.\r\n * @returns A Promise containing the downloaded blob.\r\n */\r\nfunction getBlobInternal(ref, maxDownloadSizeBytes) {\r\n ref._throwIfRoot('getBlob');\r\n const requestInfo = getBytes$1(ref.storage, ref._location, maxDownloadSizeBytes);\r\n return ref.storage\r\n .makeRequestWithTokens(requestInfo, newBlobConnection)\r\n .then(blob => maxDownloadSizeBytes !== undefined\r\n ? // GCS may not honor the Range header for small files\r\n blob.slice(0, maxDownloadSizeBytes)\r\n : blob);\r\n}\r\n/**\r\n * Uploads data to this object's location.\r\n * The upload is not resumable.\r\n *\r\n * @param ref - StorageReference where data should be uploaded.\r\n * @param data - The data to upload.\r\n * @param metadata - Metadata for the newly uploaded data.\r\n * @returns A Promise containing an UploadResult\r\n */\r\nfunction uploadBytes$1(ref, data, metadata) {\r\n ref._throwIfRoot('uploadBytes');\r\n const requestInfo = multipartUpload(ref.storage, ref._location, getMappings(), new FbsBlob(data, true), metadata);\r\n return ref.storage\r\n .makeRequestWithTokens(requestInfo, newTextConnection)\r\n .then(finalMetadata => {\r\n return {\r\n metadata: finalMetadata,\r\n ref\r\n };\r\n });\r\n}\r\n/**\r\n * Uploads data to this object's location.\r\n * The upload can be paused and resumed, and exposes progress updates.\r\n * @public\r\n * @param ref - StorageReference where data should be uploaded.\r\n * @param data - The data to upload.\r\n * @param metadata - Metadata for the newly uploaded data.\r\n * @returns An UploadTask\r\n */\r\nfunction uploadBytesResumable$1(ref, data, metadata) {\r\n ref._throwIfRoot('uploadBytesResumable');\r\n return new UploadTask(ref, new FbsBlob(data), metadata);\r\n}\r\n/**\r\n * Uploads a string to this object's location.\r\n * The upload is not resumable.\r\n * @public\r\n * @param ref - StorageReference where string should be uploaded.\r\n * @param value - The string to upload.\r\n * @param format - The format of the string to upload.\r\n * @param metadata - Metadata for the newly uploaded string.\r\n * @returns A Promise containing an UploadResult\r\n */\r\nfunction uploadString$1(ref, value, format = StringFormat.RAW, metadata) {\r\n ref._throwIfRoot('uploadString');\r\n const data = dataFromString(format, value);\r\n const metadataClone = Object.assign({}, metadata);\r\n if (metadataClone['contentType'] == null && data.contentType != null) {\r\n metadataClone['contentType'] = data.contentType;\r\n }\r\n return uploadBytes$1(ref, data.data, metadataClone);\r\n}\r\n/**\r\n * List all items (files) and prefixes (folders) under this storage reference.\r\n *\r\n * This is a helper method for calling list() repeatedly until there are\r\n * no more results. The default pagination size is 1000.\r\n *\r\n * Note: The results may not be consistent if objects are changed while this\r\n * operation is running.\r\n *\r\n * Warning: listAll may potentially consume too many resources if there are\r\n * too many results.\r\n * @public\r\n * @param ref - StorageReference to get list from.\r\n *\r\n * @returns A Promise that resolves with all the items and prefixes under\r\n * the current storage reference. `prefixes` contains references to\r\n * sub-directories and `items` contains references to objects in this\r\n * folder. `nextPageToken` is never returned.\r\n */\r\nfunction listAll$1(ref) {\r\n const accumulator = {\r\n prefixes: [],\r\n items: []\r\n };\r\n return listAllHelper(ref, accumulator).then(() => accumulator);\r\n}\r\n/**\r\n * Separated from listAll because async functions can't use \"arguments\".\r\n * @param ref\r\n * @param accumulator\r\n * @param pageToken\r\n */\r\nasync function listAllHelper(ref, accumulator, pageToken) {\r\n const opt = {\r\n // maxResults is 1000 by default.\r\n pageToken\r\n };\r\n const nextPage = await list$1(ref, opt);\r\n accumulator.prefixes.push(...nextPage.prefixes);\r\n accumulator.items.push(...nextPage.items);\r\n if (nextPage.nextPageToken != null) {\r\n await listAllHelper(ref, accumulator, nextPage.nextPageToken);\r\n }\r\n}\r\n/**\r\n * List items (files) and prefixes (folders) under this storage reference.\r\n *\r\n * List API is only available for Firebase Rules Version 2.\r\n *\r\n * GCS is a key-blob store. Firebase Storage imposes the semantic of '/'\r\n * delimited folder structure.\r\n * Refer to GCS's List API if you want to learn more.\r\n *\r\n * To adhere to Firebase Rules's Semantics, Firebase Storage does not\r\n * support objects whose paths end with \"/\" or contain two consecutive\r\n * \"/\"s. Firebase Storage List API will filter these unsupported objects.\r\n * list() may fail if there are too many unsupported objects in the bucket.\r\n * @public\r\n *\r\n * @param ref - StorageReference to get list from.\r\n * @param options - See ListOptions for details.\r\n * @returns A Promise that resolves with the items and prefixes.\r\n * `prefixes` contains references to sub-folders and `items`\r\n * contains references to objects in this folder. `nextPageToken`\r\n * can be used to get the rest of the results.\r\n */\r\nfunction list$1(ref, options) {\r\n if (options != null) {\r\n if (typeof options.maxResults === 'number') {\r\n validateNumber('options.maxResults', \r\n /* minValue= */ 1, \r\n /* maxValue= */ 1000, options.maxResults);\r\n }\r\n }\r\n const op = options || {};\r\n const requestInfo = list$2(ref.storage, ref._location, \r\n /*delimiter= */ '/', op.pageToken, op.maxResults);\r\n return ref.storage.makeRequestWithTokens(requestInfo, newTextConnection);\r\n}\r\n/**\r\n * A `Promise` that resolves with the metadata for this object. If this\r\n * object doesn't exist or metadata cannot be retreived, the promise is\r\n * rejected.\r\n * @public\r\n * @param ref - StorageReference to get metadata from.\r\n */\r\nfunction getMetadata$1(ref) {\r\n ref._throwIfRoot('getMetadata');\r\n const requestInfo = getMetadata$2(ref.storage, ref._location, getMappings());\r\n return ref.storage.makeRequestWithTokens(requestInfo, newTextConnection);\r\n}\r\n/**\r\n * Updates the metadata for this object.\r\n * @public\r\n * @param ref - StorageReference to update metadata for.\r\n * @param metadata - The new metadata for the object.\r\n * Only values that have been explicitly set will be changed. Explicitly\r\n * setting a value to null will remove the metadata.\r\n * @returns A `Promise` that resolves\r\n * with the new metadata for this object.\r\n * See `firebaseStorage.Reference.prototype.getMetadata`\r\n */\r\nfunction updateMetadata$1(ref, metadata) {\r\n ref._throwIfRoot('updateMetadata');\r\n const requestInfo = updateMetadata$2(ref.storage, ref._location, metadata, getMappings());\r\n return ref.storage.makeRequestWithTokens(requestInfo, newTextConnection);\r\n}\r\n/**\r\n * Returns the download URL for the given Reference.\r\n * @public\r\n * @returns A `Promise` that resolves with the download\r\n * URL for this object.\r\n */\r\nfunction getDownloadURL$1(ref) {\r\n ref._throwIfRoot('getDownloadURL');\r\n const requestInfo = getDownloadUrl(ref.storage, ref._location, getMappings());\r\n return ref.storage\r\n .makeRequestWithTokens(requestInfo, newTextConnection)\r\n .then(url => {\r\n if (url === null) {\r\n throw noDownloadURL();\r\n }\r\n return url;\r\n });\r\n}\r\n/**\r\n * Deletes the object at this location.\r\n * @public\r\n * @param ref - StorageReference for object to delete.\r\n * @returns A `Promise` that resolves if the deletion succeeds.\r\n */\r\nfunction deleteObject$1(ref) {\r\n ref._throwIfRoot('deleteObject');\r\n const requestInfo = deleteObject$2(ref.storage, ref._location);\r\n return ref.storage.makeRequestWithTokens(requestInfo, newTextConnection);\r\n}\r\n/**\r\n * Returns reference for object obtained by appending `childPath` to `ref`.\r\n *\r\n * @param ref - StorageReference to get child of.\r\n * @param childPath - Child path from provided ref.\r\n * @returns A reference to the object obtained by\r\n * appending childPath, removing any duplicate, beginning, or trailing\r\n * slashes.\r\n *\r\n */\r\nfunction _getChild$1(ref, childPath) {\r\n const newPath = child(ref._location.path, childPath);\r\n const location = new Location(ref._location.bucket, newPath);\r\n return new Reference(ref.storage, location);\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 isUrl(path) {\r\n return /^[A-Za-z]+:\\/\\//.test(path);\r\n}\r\n/**\r\n * Returns a firebaseStorage.Reference for the given url.\r\n */\r\nfunction refFromURL(service, url) {\r\n return new Reference(service, url);\r\n}\r\n/**\r\n * Returns a firebaseStorage.Reference for the given path in the default\r\n * bucket.\r\n */\r\nfunction refFromPath(ref, path) {\r\n if (ref instanceof FirebaseStorageImpl) {\r\n const service = ref;\r\n if (service._bucket == null) {\r\n throw noDefaultBucket();\r\n }\r\n const reference = new Reference(service, service._bucket);\r\n if (path != null) {\r\n return refFromPath(reference, path);\r\n }\r\n else {\r\n return reference;\r\n }\r\n }\r\n else {\r\n // ref is a Reference\r\n if (path !== undefined) {\r\n return _getChild$1(ref, path);\r\n }\r\n else {\r\n return ref;\r\n }\r\n }\r\n}\r\nfunction ref$1(serviceOrRef, pathOrUrl) {\r\n if (pathOrUrl && isUrl(pathOrUrl)) {\r\n if (serviceOrRef instanceof FirebaseStorageImpl) {\r\n return refFromURL(serviceOrRef, pathOrUrl);\r\n }\r\n else {\r\n throw invalidArgument('To use ref(service, url), the first argument must be a Storage instance.');\r\n }\r\n }\r\n else {\r\n return refFromPath(serviceOrRef, pathOrUrl);\r\n }\r\n}\r\nfunction extractBucket(host, config) {\r\n const bucketString = config === null || config === void 0 ? void 0 : config[CONFIG_STORAGE_BUCKET_KEY];\r\n if (bucketString == null) {\r\n return null;\r\n }\r\n return Location.makeFromBucketSpec(bucketString, host);\r\n}\r\nfunction connectStorageEmulator$1(storage, host, port, options = {}) {\r\n storage.host = `${host}:${port}`;\r\n storage._protocol = 'http';\r\n const { mockUserToken } = options;\r\n if (mockUserToken) {\r\n storage._overrideAuthToken =\r\n typeof mockUserToken === 'string'\r\n ? mockUserToken\r\n : createMockUserToken(mockUserToken, storage.app.options.projectId);\r\n }\r\n}\r\n/**\r\n * A service that provides Firebase Storage Reference instances.\r\n * @param opt_url - gs:// url to a custom Storage Bucket\r\n *\r\n * @internal\r\n */\r\nclass FirebaseStorageImpl {\r\n constructor(\r\n /**\r\n * FirebaseApp associated with this StorageService instance.\r\n */\r\n app, _authProvider, \r\n /**\r\n * @internal\r\n */\r\n _appCheckProvider, \r\n /**\r\n * @internal\r\n */\r\n _url, _firebaseVersion) {\r\n this.app = app;\r\n this._authProvider = _authProvider;\r\n this._appCheckProvider = _appCheckProvider;\r\n this._url = _url;\r\n this._firebaseVersion = _firebaseVersion;\r\n this._bucket = null;\r\n /**\r\n * This string can be in the formats:\r\n * - host\r\n * - host:port\r\n */\r\n this._host = DEFAULT_HOST;\r\n this._protocol = 'https';\r\n this._appId = null;\r\n this._deleted = false;\r\n this._maxOperationRetryTime = DEFAULT_MAX_OPERATION_RETRY_TIME;\r\n this._maxUploadRetryTime = DEFAULT_MAX_UPLOAD_RETRY_TIME;\r\n this._requests = new Set();\r\n if (_url != null) {\r\n this._bucket = Location.makeFromBucketSpec(_url, this._host);\r\n }\r\n else {\r\n this._bucket = extractBucket(this._host, this.app.options);\r\n }\r\n }\r\n /**\r\n * The host string for this service, in the form of `host` or\r\n * `host:port`.\r\n */\r\n get host() {\r\n return this._host;\r\n }\r\n set host(host) {\r\n this._host = host;\r\n if (this._url != null) {\r\n this._bucket = Location.makeFromBucketSpec(this._url, host);\r\n }\r\n else {\r\n this._bucket = extractBucket(host, this.app.options);\r\n }\r\n }\r\n /**\r\n * The maximum time to retry uploads in milliseconds.\r\n */\r\n get maxUploadRetryTime() {\r\n return this._maxUploadRetryTime;\r\n }\r\n set maxUploadRetryTime(time) {\r\n validateNumber('time', \r\n /* minValue=*/ 0, \r\n /* maxValue= */ Number.POSITIVE_INFINITY, time);\r\n this._maxUploadRetryTime = time;\r\n }\r\n /**\r\n * The maximum time to retry operations other than uploads or downloads in\r\n * milliseconds.\r\n */\r\n get maxOperationRetryTime() {\r\n return this._maxOperationRetryTime;\r\n }\r\n set maxOperationRetryTime(time) {\r\n validateNumber('time', \r\n /* minValue=*/ 0, \r\n /* maxValue= */ Number.POSITIVE_INFINITY, time);\r\n this._maxOperationRetryTime = time;\r\n }\r\n async _getAuthToken() {\r\n if (this._overrideAuthToken) {\r\n return this._overrideAuthToken;\r\n }\r\n const auth = this._authProvider.getImmediate({ optional: true });\r\n if (auth) {\r\n const tokenData = await auth.getToken();\r\n if (tokenData !== null) {\r\n return tokenData.accessToken;\r\n }\r\n }\r\n return null;\r\n }\r\n async _getAppCheckToken() {\r\n const appCheck = this._appCheckProvider.getImmediate({ optional: true });\r\n if (appCheck) {\r\n const result = await appCheck.getToken();\r\n // TODO: What do we want to do if there is an error getting the token?\r\n // Context: appCheck.getToken() will never throw even if an error happened. In the error case, a dummy token will be\r\n // returned along with an error field describing the error. In general, we shouldn't care about the error condition and just use\r\n // the token (actual or dummy) to send requests.\r\n return result.token;\r\n }\r\n return null;\r\n }\r\n /**\r\n * Stop running requests and prevent more from being created.\r\n */\r\n _delete() {\r\n if (!this._deleted) {\r\n this._deleted = true;\r\n this._requests.forEach(request => request.cancel());\r\n this._requests.clear();\r\n }\r\n return Promise.resolve();\r\n }\r\n /**\r\n * Returns a new firebaseStorage.Reference object referencing this StorageService\r\n * at the given Location.\r\n */\r\n _makeStorageReference(loc) {\r\n return new Reference(this, loc);\r\n }\r\n /**\r\n * @param requestInfo - HTTP RequestInfo object\r\n * @param authToken - Firebase auth token\r\n */\r\n _makeRequest(requestInfo, requestFactory, authToken, appCheckToken) {\r\n if (!this._deleted) {\r\n const request = makeRequest(requestInfo, this._appId, authToken, appCheckToken, requestFactory, this._firebaseVersion);\r\n this._requests.add(request);\r\n // Request removes itself from set when complete.\r\n request.getPromise().then(() => this._requests.delete(request), () => this._requests.delete(request));\r\n return request;\r\n }\r\n else {\r\n return new FailRequest(appDeleted());\r\n }\r\n }\r\n async makeRequestWithTokens(requestInfo, requestFactory) {\r\n const [authToken, appCheckToken] = await Promise.all([\r\n this._getAuthToken(),\r\n this._getAppCheckToken()\r\n ]);\r\n return this._makeRequest(requestInfo, requestFactory, authToken, appCheckToken).getPromise();\r\n }\r\n}\n\nconst name = \"@firebase/storage\";\nconst version = \"0.9.9\";\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 * Type constant for Firebase Storage.\r\n */\r\nconst STORAGE_TYPE = 'storage';\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 * Downloads the data at the object's location. Returns an error if the object\r\n * is not found.\r\n *\r\n * To use this functionality, you have to whitelist your app's origin in your\r\n * Cloud Storage bucket. See also\r\n * https://cloud.google.com/storage/docs/configuring-cors\r\n *\r\n * @public\r\n * @param ref - StorageReference where data should be downloaded.\r\n * @param maxDownloadSizeBytes - If set, the maximum allowed size in bytes to\r\n * retrieve.\r\n * @returns A Promise containing the object's bytes\r\n */\r\nfunction getBytes(ref, maxDownloadSizeBytes) {\r\n ref = getModularInstance(ref);\r\n return getBytesInternal(ref, maxDownloadSizeBytes);\r\n}\r\n/**\r\n * Uploads data to this object's location.\r\n * The upload is not resumable.\r\n * @public\r\n * @param ref - {@link StorageReference} where data should be uploaded.\r\n * @param data - The data to upload.\r\n * @param metadata - Metadata for the data to upload.\r\n * @returns A Promise containing an UploadResult\r\n */\r\nfunction uploadBytes(ref, data, metadata) {\r\n ref = getModularInstance(ref);\r\n return uploadBytes$1(ref, data, metadata);\r\n}\r\n/**\r\n * Uploads a string to this object's location.\r\n * The upload is not resumable.\r\n * @public\r\n * @param ref - {@link StorageReference} where string should be uploaded.\r\n * @param value - The string to upload.\r\n * @param format - The format of the string to upload.\r\n * @param metadata - Metadata for the string to upload.\r\n * @returns A Promise containing an UploadResult\r\n */\r\nfunction uploadString(ref, value, format, metadata) {\r\n ref = getModularInstance(ref);\r\n return uploadString$1(ref, value, format, metadata);\r\n}\r\n/**\r\n * Uploads data to this object's location.\r\n * The upload can be paused and resumed, and exposes progress updates.\r\n * @public\r\n * @param ref - {@link StorageReference} where data should be uploaded.\r\n * @param data - The data to upload.\r\n * @param metadata - Metadata for the data to upload.\r\n * @returns An UploadTask\r\n */\r\nfunction uploadBytesResumable(ref, data, metadata) {\r\n ref = getModularInstance(ref);\r\n return uploadBytesResumable$1(ref, data, metadata);\r\n}\r\n/**\r\n * A `Promise` that resolves with the metadata for this object. If this\r\n * object doesn't exist or metadata cannot be retreived, the promise is\r\n * rejected.\r\n * @public\r\n * @param ref - {@link StorageReference} to get metadata from.\r\n */\r\nfunction getMetadata(ref) {\r\n ref = getModularInstance(ref);\r\n return getMetadata$1(ref);\r\n}\r\n/**\r\n * Updates the metadata for this object.\r\n * @public\r\n * @param ref - {@link StorageReference} to update metadata for.\r\n * @param metadata - The new metadata for the object.\r\n * Only values that have been explicitly set will be changed. Explicitly\r\n * setting a value to null will remove the metadata.\r\n * @returns A `Promise` that resolves with the new metadata for this object.\r\n */\r\nfunction updateMetadata(ref, metadata) {\r\n ref = getModularInstance(ref);\r\n return updateMetadata$1(ref, metadata);\r\n}\r\n/**\r\n * List items (files) and prefixes (folders) under this storage reference.\r\n *\r\n * List API is only available for Firebase Rules Version 2.\r\n *\r\n * GCS is a key-blob store. Firebase Storage imposes the semantic of '/'\r\n * delimited folder structure.\r\n * Refer to GCS's List API if you want to learn more.\r\n *\r\n * To adhere to Firebase Rules's Semantics, Firebase Storage does not\r\n * support objects whose paths end with \"/\" or contain two consecutive\r\n * \"/\"s. Firebase Storage List API will filter these unsupported objects.\r\n * list() may fail if there are too many unsupported objects in the bucket.\r\n * @public\r\n *\r\n * @param ref - {@link StorageReference} to get list from.\r\n * @param options - See {@link ListOptions} for details.\r\n * @returns A `Promise` that resolves with the items and prefixes.\r\n * `prefixes` contains references to sub-folders and `items`\r\n * contains references to objects in this folder. `nextPageToken`\r\n * can be used to get the rest of the results.\r\n */\r\nfunction list(ref, options) {\r\n ref = getModularInstance(ref);\r\n return list$1(ref, options);\r\n}\r\n/**\r\n * List all items (files) and prefixes (folders) under this storage reference.\r\n *\r\n * This is a helper method for calling list() repeatedly until there are\r\n * no more results. The default pagination size is 1000.\r\n *\r\n * Note: The results may not be consistent if objects are changed while this\r\n * operation is running.\r\n *\r\n * Warning: `listAll` may potentially consume too many resources if there are\r\n * too many results.\r\n * @public\r\n * @param ref - {@link StorageReference} to get list from.\r\n *\r\n * @returns A `Promise` that resolves with all the items and prefixes under\r\n * the current storage reference. `prefixes` contains references to\r\n * sub-directories and `items` contains references to objects in this\r\n * folder. `nextPageToken` is never returned.\r\n */\r\nfunction listAll(ref) {\r\n ref = getModularInstance(ref);\r\n return listAll$1(ref);\r\n}\r\n/**\r\n * Returns the download URL for the given {@link StorageReference}.\r\n * @public\r\n * @param ref - {@link StorageReference} to get the download URL for.\r\n * @returns A `Promise` that resolves with the download\r\n * URL for this object.\r\n */\r\nfunction getDownloadURL(ref) {\r\n ref = getModularInstance(ref);\r\n return getDownloadURL$1(ref);\r\n}\r\n/**\r\n * Deletes the object at this location.\r\n * @public\r\n * @param ref - {@link StorageReference} for object to delete.\r\n * @returns A `Promise` that resolves if the deletion succeeds.\r\n */\r\nfunction deleteObject(ref) {\r\n ref = getModularInstance(ref);\r\n return deleteObject$1(ref);\r\n}\r\nfunction ref(serviceOrRef, pathOrUrl) {\r\n serviceOrRef = getModularInstance(serviceOrRef);\r\n return ref$1(serviceOrRef, pathOrUrl);\r\n}\r\n/**\r\n * @internal\r\n */\r\nfunction _getChild(ref, childPath) {\r\n return _getChild$1(ref, childPath);\r\n}\r\n/**\r\n * Gets a {@link FirebaseStorage} instance for the given Firebase app.\r\n * @public\r\n * @param app - Firebase app to get {@link FirebaseStorage} instance for.\r\n * @param bucketUrl - The gs:// url to your Firebase Storage Bucket.\r\n * If not passed, uses the app's default Storage Bucket.\r\n * @returns A {@link FirebaseStorage} instance.\r\n */\r\nfunction getStorage(app = getApp(), bucketUrl) {\r\n app = getModularInstance(app);\r\n const storageProvider = _getProvider(app, STORAGE_TYPE);\r\n const storageInstance = storageProvider.getImmediate({\r\n identifier: bucketUrl\r\n });\r\n return storageInstance;\r\n}\r\n/**\r\n * Modify this {@link FirebaseStorage} instance to communicate with the Cloud Storage emulator.\r\n *\r\n * @param storage - The {@link FirebaseStorage} instance\r\n * @param host - The emulator host (ex: localhost)\r\n * @param port - The emulator port (ex: 5001)\r\n * @param options - Emulator options. `options.mockUserToken` is the mock auth\r\n * token to use for unit testing Security Rules.\r\n * @public\r\n */\r\nfunction connectStorageEmulator(storage, host, port, options = {}) {\r\n connectStorageEmulator$1(storage, host, port, options);\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\n/**\r\n * Downloads the data at the object's location. Returns an error if the object\r\n * is not found.\r\n *\r\n * To use this functionality, you have to whitelist your app's origin in your\r\n * Cloud Storage bucket. See also\r\n * https://cloud.google.com/storage/docs/configuring-cors\r\n *\r\n * This API is not available in Node.\r\n *\r\n * @public\r\n * @param ref - StorageReference where data should be downloaded.\r\n * @param maxDownloadSizeBytes - If set, the maximum allowed size in bytes to\r\n * retrieve.\r\n * @returns A Promise that resolves with a Blob containing the object's bytes\r\n */\r\nfunction getBlob(ref, maxDownloadSizeBytes) {\r\n ref = getModularInstance(ref);\r\n return getBlobInternal(ref, maxDownloadSizeBytes);\r\n}\r\n/**\r\n * Downloads the data at the object's location. Raises an error event if the\r\n * object is not found.\r\n *\r\n * This API is only available in Node.\r\n *\r\n * @public\r\n * @param ref - StorageReference where data should be downloaded.\r\n * @param maxDownloadSizeBytes - If set, the maximum allowed size in bytes to\r\n * retrieve.\r\n * @returns A stream with the object's data as bytes\r\n */\r\nfunction getStream(ref, maxDownloadSizeBytes) {\r\n throw new Error('getStream() is only supported by NodeJS builds');\r\n}\n\n/**\r\n * Cloud Storage for Firebase\r\n *\r\n * @packageDocumentation\r\n */\r\nfunction factory(container, { instanceIdentifier: url }) {\r\n const app = container.getProvider('app').getImmediate();\r\n const authProvider = container.getProvider('auth-internal');\r\n const appCheckProvider = container.getProvider('app-check-internal');\r\n return new FirebaseStorageImpl(app, authProvider, appCheckProvider, url, SDK_VERSION);\r\n}\r\nfunction registerStorage() {\r\n _registerComponent(new Component(STORAGE_TYPE, factory, \"PUBLIC\" /* PUBLIC */).setMultipleInstances(true));\r\n //RUNTIME_ENV will be replaced during the compilation to \"node\" for nodejs and an empty string for browser\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}\r\nregisterStorage();\n\nexport { StringFormat, FbsBlob as _FbsBlob, Location as _Location, TaskEvent as _TaskEvent, TaskState as _TaskState, UploadTask as _UploadTask, dataFromString as _dataFromString, _getChild, invalidArgument as _invalidArgument, invalidRootOperation as _invalidRootOperation, connectStorageEmulator, deleteObject, getBlob, getBytes, getDownloadURL, getMetadata, getStorage, getStream, list, listAll, ref, updateMetadata, uploadBytes, uploadBytesResumable, uploadString };\n//# sourceMappingURL=index.esm2017.js.map\n","import firebase from '@firebase/app-compat';\nimport { _getChild, uploadBytesResumable, StringFormat, _dataFromString, _UploadTask, _FbsBlob, listAll, list, getMetadata, updateMetadata, getDownloadURL, deleteObject, _invalidRootOperation, _invalidArgument, ref, _Location, connectStorageEmulator, _TaskState, _TaskEvent } from '@firebase/storage';\nimport { Component } from '@firebase/component';\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\nclass UploadTaskSnapshotCompat {\r\n constructor(_delegate, task, ref) {\r\n this._delegate = _delegate;\r\n this.task = task;\r\n this.ref = ref;\r\n }\r\n get bytesTransferred() {\r\n return this._delegate.bytesTransferred;\r\n }\r\n get metadata() {\r\n return this._delegate.metadata;\r\n }\r\n get state() {\r\n return this._delegate.state;\r\n }\r\n get totalBytes() {\r\n return this._delegate.totalBytes;\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\nclass UploadTaskCompat {\r\n constructor(_delegate, _ref) {\r\n this._delegate = _delegate;\r\n this._ref = _ref;\r\n this.cancel = this._delegate.cancel.bind(this._delegate);\r\n this.catch = this._delegate.catch.bind(this._delegate);\r\n this.pause = this._delegate.pause.bind(this._delegate);\r\n this.resume = this._delegate.resume.bind(this._delegate);\r\n }\r\n get snapshot() {\r\n return new UploadTaskSnapshotCompat(this._delegate.snapshot, this, this._ref);\r\n }\r\n then(onFulfilled, onRejected) {\r\n return this._delegate.then(snapshot => {\r\n if (onFulfilled) {\r\n return onFulfilled(new UploadTaskSnapshotCompat(snapshot, this, this._ref));\r\n }\r\n }, onRejected);\r\n }\r\n on(type, nextOrObserver, error, completed) {\r\n let wrappedNextOrObserver = undefined;\r\n if (!!nextOrObserver) {\r\n if (typeof nextOrObserver === 'function') {\r\n wrappedNextOrObserver = (taskSnapshot) => nextOrObserver(new UploadTaskSnapshotCompat(taskSnapshot, this, this._ref));\r\n }\r\n else {\r\n wrappedNextOrObserver = {\r\n next: !!nextOrObserver.next\r\n ? (taskSnapshot) => nextOrObserver.next(new UploadTaskSnapshotCompat(taskSnapshot, this, this._ref))\r\n : undefined,\r\n complete: nextOrObserver.complete || undefined,\r\n error: nextOrObserver.error || undefined\r\n };\r\n }\r\n }\r\n return this._delegate.on(type, wrappedNextOrObserver, error || undefined, completed || undefined);\r\n }\r\n}\n\nclass ListResultCompat {\r\n constructor(_delegate, _service) {\r\n this._delegate = _delegate;\r\n this._service = _service;\r\n }\r\n get prefixes() {\r\n return this._delegate.prefixes.map(ref => new ReferenceCompat(ref, this._service));\r\n }\r\n get items() {\r\n return this._delegate.items.map(ref => new ReferenceCompat(ref, this._service));\r\n }\r\n get nextPageToken() {\r\n return this._delegate.nextPageToken || null;\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\nclass ReferenceCompat {\r\n constructor(_delegate, storage) {\r\n this._delegate = _delegate;\r\n this.storage = storage;\r\n }\r\n get name() {\r\n return this._delegate.name;\r\n }\r\n get bucket() {\r\n return this._delegate.bucket;\r\n }\r\n get fullPath() {\r\n return this._delegate.fullPath;\r\n }\r\n toString() {\r\n return this._delegate.toString();\r\n }\r\n /**\r\n * @returns A reference to the object obtained by\r\n * appending childPath, removing any duplicate, beginning, or trailing\r\n * slashes.\r\n */\r\n child(childPath) {\r\n const reference = _getChild(this._delegate, childPath);\r\n return new ReferenceCompat(reference, this.storage);\r\n }\r\n get root() {\r\n return new ReferenceCompat(this._delegate.root, this.storage);\r\n }\r\n /**\r\n * @returns A reference to the parent of the\r\n * current object, or null if the current object is the root.\r\n */\r\n get parent() {\r\n const reference = this._delegate.parent;\r\n if (reference == null) {\r\n return null;\r\n }\r\n return new ReferenceCompat(reference, this.storage);\r\n }\r\n /**\r\n * Uploads a blob to this object's location.\r\n * @param data - The blob to upload.\r\n * @returns An UploadTask that lets you control and\r\n * observe the upload.\r\n */\r\n put(data, metadata) {\r\n this._throwIfRoot('put');\r\n return new UploadTaskCompat(uploadBytesResumable(this._delegate, data, metadata), this);\r\n }\r\n /**\r\n * Uploads a string to this object's location.\r\n * @param value - The string to upload.\r\n * @param format - The format of the string to upload.\r\n * @returns An UploadTask that lets you control and\r\n * observe the upload.\r\n */\r\n putString(value, format = StringFormat.RAW, metadata) {\r\n this._throwIfRoot('putString');\r\n const data = _dataFromString(format, value);\r\n const metadataClone = Object.assign({}, metadata);\r\n if (metadataClone['contentType'] == null && data.contentType != null) {\r\n metadataClone['contentType'] = data.contentType;\r\n }\r\n return new UploadTaskCompat(new _UploadTask(this._delegate, new _FbsBlob(data.data, true), metadataClone), this);\r\n }\r\n /**\r\n * List all items (files) and prefixes (folders) under this storage reference.\r\n *\r\n * This is a helper method for calling list() repeatedly until there are\r\n * no more results. The default pagination size is 1000.\r\n *\r\n * Note: The results may not be consistent if objects are changed while this\r\n * operation is running.\r\n *\r\n * Warning: listAll may potentially consume too many resources if there are\r\n * too many results.\r\n *\r\n * @returns A Promise that resolves with all the items and prefixes under\r\n * the current storage reference. `prefixes` contains references to\r\n * sub-directories and `items` contains references to objects in this\r\n * folder. `nextPageToken` is never returned.\r\n */\r\n listAll() {\r\n return listAll(this._delegate).then(r => new ListResultCompat(r, this.storage));\r\n }\r\n /**\r\n * List items (files) and prefixes (folders) under this storage reference.\r\n *\r\n * List API is only available for Firebase Rules Version 2.\r\n *\r\n * GCS is a key-blob store. Firebase Storage imposes the semantic of '/'\r\n * delimited folder structure. Refer to GCS's List API if you want to learn more.\r\n *\r\n * To adhere to Firebase Rules's Semantics, Firebase Storage does not\r\n * support objects whose paths end with \"/\" or contain two consecutive\r\n * \"/\"s. Firebase Storage List API will filter these unsupported objects.\r\n * list() may fail if there are too many unsupported objects in the bucket.\r\n *\r\n * @param options - See ListOptions for details.\r\n * @returns A Promise that resolves with the items and prefixes.\r\n * `prefixes` contains references to sub-folders and `items`\r\n * contains references to objects in this folder. `nextPageToken`\r\n * can be used to get the rest of the results.\r\n */\r\n list(options) {\r\n return list(this._delegate, options || undefined).then(r => new ListResultCompat(r, this.storage));\r\n }\r\n /**\r\n * A `Promise` that resolves with the metadata for this object. If this\r\n * object doesn't exist or metadata cannot be retreived, the promise is\r\n * rejected.\r\n */\r\n getMetadata() {\r\n return getMetadata(this._delegate);\r\n }\r\n /**\r\n * Updates the metadata for this object.\r\n * @param metadata - The new metadata for the object.\r\n * Only values that have been explicitly set will be changed. Explicitly\r\n * setting a value to null will remove the metadata.\r\n * @returns A `Promise` that resolves\r\n * with the new metadata for this object.\r\n * @see firebaseStorage.Reference.prototype.getMetadata\r\n */\r\n updateMetadata(metadata) {\r\n return updateMetadata(this._delegate, metadata);\r\n }\r\n /**\r\n * @returns A `Promise` that resolves with the download\r\n * URL for this object.\r\n */\r\n getDownloadURL() {\r\n return getDownloadURL(this._delegate);\r\n }\r\n /**\r\n * Deletes the object at this location.\r\n * @returns A `Promise` that resolves if the deletion succeeds.\r\n */\r\n delete() {\r\n this._throwIfRoot('delete');\r\n return deleteObject(this._delegate);\r\n }\r\n _throwIfRoot(name) {\r\n if (this._delegate._location.path === '') {\r\n throw _invalidRootOperation(name);\r\n }\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 * A service that provides firebaseStorage.Reference instances.\r\n * @param opt_url gs:// url to a custom Storage Bucket\r\n */\r\nclass StorageServiceCompat {\r\n constructor(app, _delegate) {\r\n this.app = app;\r\n this._delegate = _delegate;\r\n }\r\n get maxOperationRetryTime() {\r\n return this._delegate.maxOperationRetryTime;\r\n }\r\n get maxUploadRetryTime() {\r\n return this._delegate.maxUploadRetryTime;\r\n }\r\n /**\r\n * Returns a firebaseStorage.Reference for the given path in the default\r\n * bucket.\r\n */\r\n ref(path) {\r\n if (isUrl(path)) {\r\n throw _invalidArgument('ref() expected a child path but got a URL, use refFromURL instead.');\r\n }\r\n return new ReferenceCompat(ref(this._delegate, path), this);\r\n }\r\n /**\r\n * Returns a firebaseStorage.Reference object for the given absolute URL,\r\n * which must be a gs:// or http[s]:// URL.\r\n */\r\n refFromURL(url) {\r\n if (!isUrl(url)) {\r\n throw _invalidArgument('refFromURL() expected a full URL but got a child path, use ref() instead.');\r\n }\r\n try {\r\n _Location.makeFromUrl(url, this._delegate.host);\r\n }\r\n catch (e) {\r\n throw _invalidArgument('refFromUrl() expected a valid full URL but got an invalid one.');\r\n }\r\n return new ReferenceCompat(ref(this._delegate, url), this);\r\n }\r\n setMaxUploadRetryTime(time) {\r\n this._delegate.maxUploadRetryTime = time;\r\n }\r\n setMaxOperationRetryTime(time) {\r\n this._delegate.maxOperationRetryTime = time;\r\n }\r\n useEmulator(host, port, options = {}) {\r\n connectStorageEmulator(this._delegate, host, port, options);\r\n }\r\n}\r\nfunction isUrl(path) {\r\n return /^[A-Za-z]+:\\/\\//.test(path);\r\n}\n\nconst name = \"@firebase/storage-compat\";\nconst version = \"0.1.17\";\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 * Type constant for Firebase Storage.\r\n */\r\nconst STORAGE_TYPE = 'storage-compat';\r\nfunction factory(container, { instanceIdentifier: url }) {\r\n // Dependencies\r\n const app = container.getProvider('app-compat').getImmediate();\r\n const storageExp = container\r\n .getProvider('storage')\r\n .getImmediate({ identifier: url });\r\n const storageServiceCompat = new StorageServiceCompat(app, storageExp);\r\n return storageServiceCompat;\r\n}\r\nfunction registerStorage(instance) {\r\n const namespaceExports = {\r\n // no-inline\r\n TaskState: _TaskState,\r\n TaskEvent: _TaskEvent,\r\n StringFormat,\r\n Storage: StorageServiceCompat,\r\n Reference: ReferenceCompat\r\n };\r\n instance.INTERNAL.registerComponent(new Component(STORAGE_TYPE, factory, \"PUBLIC\" /* PUBLIC */)\r\n .setServiceProps(namespaceExports)\r\n .setMultipleInstances(true));\r\n instance.registerVersion(name, version);\r\n}\r\nregisterStorage(firebase);\n\nexport { registerStorage };\n//# sourceMappingURL=index.esm2017.js.map\n","// Styles\nimport './VApp.sass'\n\n// Mixins\nimport Themeable from '../../mixins/themeable'\n\n// Utilities\nimport mixins from '../../util/mixins'\n\n/* @vue/component */\nexport default mixins(\n Themeable\n).extend({\n name: 'v-app',\n\n props: {\n dark: {\n type: Boolean,\n default: undefined,\n },\n id: {\n type: String,\n default: 'app',\n },\n light: {\n type: Boolean,\n default: undefined,\n },\n },\n\n computed: {\n isDark (): boolean {\n return this.$vuetify.theme.dark\n },\n },\n\n beforeCreate () {\n if (!this.$vuetify || (this.$vuetify === this.$root as any)) {\n throw new Error('Vuetify is not properly initialized, see https://vuetifyjs.com/getting-started/quick-start#bootstrapping-the-vuetify-object')\n }\n },\n\n render (h) {\n const wrapper = h('div', { staticClass: 'v-application--wrap' }, this.$slots.default)\n\n return h('div', {\n staticClass: 'v-application',\n class: {\n 'v-application--is-rtl': this.$vuetify.rtl,\n 'v-application--is-ltr': !this.$vuetify.rtl,\n ...this.themeClasses,\n },\n attrs: { 'data-app': true },\n domProps: { id: this.id },\n }, [wrapper])\n },\n})\n","import { VNodeDirective } from 'vue/types/vnode'\nimport { DirectiveOptions, VNode } from 'vue'\n\ninterface ScrollVNodeDirective extends Omit<VNodeDirective, 'modifiers'> {\n value: EventListener | {\n handler: EventListener\n options?: boolean | AddEventListenerOptions\n } | EventListenerObject & { options?: boolean | AddEventListenerOptions }\n modifiers?: {\n self?: boolean\n }\n}\n\nfunction inserted (el: HTMLElement, binding: ScrollVNodeDirective, vnode: VNode) {\n const { self = false } = binding.modifiers || {}\n const value = binding.value\n const options = (typeof value === 'object' && value.options) || { passive: true }\n const handler = typeof value === 'function' || 'handleEvent' in value ? value : value.handler\n\n const target = self\n ? el\n : binding.arg\n ? document.querySelector(binding.arg)\n : window\n\n if (!target) return\n\n target.addEventListener('scroll', handler, options)\n\n el._onScroll = Object(el._onScroll)\n el._onScroll![vnode.context!._uid] = {\n handler,\n options,\n // Don't reference self\n target: self ? undefined : target,\n }\n}\n\nfunction unbind (el: HTMLElement, binding: ScrollVNodeDirective, vnode: VNode) {\n if (!el._onScroll?.[vnode.context!._uid]) return\n\n const { handler, options, target = el } = el._onScroll[vnode.context!._uid]!\n\n target.removeEventListener('scroll', handler, options)\n delete el._onScroll[vnode.context!._uid]\n}\n\nexport const Scroll = {\n inserted,\n unbind,\n} as DirectiveOptions\n\nexport default Scroll\n","// Directives\nimport { Scroll } from '../../directives'\n\n// Utilities\nimport { consoleWarn } from '../../util/console'\n\n// Types\nimport Vue from 'vue'\n\n/**\n * Scrollable\n *\n * Used for monitoring scrolling and\n * invoking functions based upon\n * scrolling thresholds being\n * met.\n */\n/* @vue/component */\nexport default Vue.extend({\n name: 'scrollable',\n\n directives: { Scroll },\n\n props: {\n scrollTarget: String,\n scrollThreshold: [String, Number],\n },\n\n data: () => ({\n currentScroll: 0,\n currentThreshold: 0,\n isActive: false,\n isScrollingUp: false,\n previousScroll: 0,\n savedScroll: 0,\n target: null as Element | null,\n }),\n\n computed: {\n /**\n * A computed property that returns\n * whether scrolling features are\n * enabled or disabled\n */\n canScroll (): boolean {\n return typeof window !== 'undefined'\n },\n /**\n * The threshold that must be met before\n * thresholdMet function is invoked\n */\n computedScrollThreshold (): number {\n return this.scrollThreshold\n ? Number(this.scrollThreshold)\n : 300\n },\n },\n\n watch: {\n isScrollingUp () {\n this.savedScroll = this.savedScroll || this.currentScroll\n },\n isActive () {\n this.savedScroll = 0\n },\n },\n\n mounted () {\n if (this.scrollTarget) {\n this.target = document.querySelector(this.scrollTarget)\n\n if (!this.target) {\n consoleWarn(`Unable to locate element with identifier ${this.scrollTarget}`, this)\n }\n }\n },\n\n methods: {\n onScroll () {\n if (!this.canScroll) return\n\n this.previousScroll = this.currentScroll\n this.currentScroll = this.target\n ? this.target.scrollTop\n : window.pageYOffset\n\n this.isScrollingUp = this.currentScroll < this.previousScroll\n this.currentThreshold = Math.abs(this.currentScroll - this.computedScrollThreshold)\n\n this.$nextTick(() => {\n if (\n Math.abs(this.currentScroll - this.savedScroll) >\n this.computedScrollThreshold\n ) this.thresholdMet()\n })\n },\n /**\n * The method invoked when\n * scrolling in any direction\n * has exceeded the threshold\n */\n thresholdMet () { /* noop */ },\n },\n})\n","// Styles\nimport './VAppBar.sass'\n\n// Extensions\nimport VToolbar from '../VToolbar/VToolbar'\n\n// Directives\nimport Scroll from '../../directives/scroll'\n\n// Mixins\nimport Applicationable from '../../mixins/applicationable'\nimport Scrollable from '../../mixins/scrollable'\nimport SSRBootable from '../../mixins/ssr-bootable'\nimport Toggleable from '../../mixins/toggleable'\n\n// Utilities\nimport { convertToUnit } from '../../util/helpers'\nimport mixins from '../../util/mixins'\n\n// Types\nimport { VNode } from 'vue'\n\nconst baseMixins = mixins(\n VToolbar,\n Scrollable,\n SSRBootable,\n Toggleable,\n Applicationable('top', [\n 'clippedLeft',\n 'clippedRight',\n 'computedHeight',\n 'invertedScroll',\n 'isExtended',\n 'isProminent',\n 'value',\n ])\n)\n\n/* @vue/component */\nexport default baseMixins.extend({\n name: 'v-app-bar',\n\n directives: { Scroll },\n\n provide (): object {\n return { VAppBar: this }\n },\n\n props: {\n clippedLeft: Boolean,\n clippedRight: Boolean,\n collapseOnScroll: Boolean,\n elevateOnScroll: Boolean,\n fadeImgOnScroll: Boolean,\n hideOnScroll: Boolean,\n invertedScroll: Boolean,\n scrollOffScreen: Boolean,\n shrinkOnScroll: Boolean,\n value: {\n type: Boolean,\n default: true,\n },\n },\n\n data () {\n return {\n isActive: this.value,\n }\n },\n\n computed: {\n applicationProperty (): string {\n return !this.bottom ? 'top' : 'bottom'\n },\n canScroll (): boolean {\n return (\n Scrollable.options.computed.canScroll.call(this) &&\n (\n this.invertedScroll ||\n this.elevateOnScroll ||\n this.hideOnScroll ||\n this.collapseOnScroll ||\n this.isBooted ||\n // If falsy, user has provided an\n // explicit value which should\n // overwrite anything we do\n !this.value\n )\n )\n },\n classes (): object {\n return {\n ...VToolbar.options.computed.classes.call(this),\n 'v-toolbar--collapse': this.collapse || this.collapseOnScroll,\n 'v-app-bar': true,\n 'v-app-bar--clipped': this.clippedLeft || this.clippedRight,\n 'v-app-bar--fade-img-on-scroll': this.fadeImgOnScroll,\n 'v-app-bar--elevate-on-scroll': this.elevateOnScroll,\n 'v-app-bar--fixed': !this.absolute && (this.app || this.fixed),\n 'v-app-bar--hide-shadow': this.hideShadow,\n 'v-app-bar--is-scrolled': this.currentScroll > 0,\n 'v-app-bar--shrink-on-scroll': this.shrinkOnScroll,\n }\n },\n scrollRatio (): number {\n const threshold = this.computedScrollThreshold\n return Math.max((threshold - this.currentScroll) / threshold, 0)\n },\n computedContentHeight (): number {\n if (!this.shrinkOnScroll) return VToolbar.options.computed.computedContentHeight.call(this)\n\n const min = this.dense ? 48 : 56\n const max = this.computedOriginalHeight\n\n return min + (max - min) * this.scrollRatio\n },\n computedFontSize (): number | undefined {\n if (!this.isProminent) return undefined\n\n const min = 1.25\n const max = 1.5\n\n return min + (max - min) * this.scrollRatio\n },\n computedLeft (): number {\n if (!this.app || this.clippedLeft) return 0\n\n return this.$vuetify.application.left\n },\n computedMarginTop (): number {\n if (!this.app) return 0\n\n return this.$vuetify.application.bar\n },\n computedOpacity (): number | undefined {\n if (!this.fadeImgOnScroll) return undefined\n\n return this.scrollRatio\n },\n computedOriginalHeight (): number {\n let height = VToolbar.options.computed.computedContentHeight.call(this)\n if (this.isExtended) height += parseInt(this.extensionHeight)\n return height\n },\n computedRight (): number {\n if (!this.app || this.clippedRight) return 0\n\n return this.$vuetify.application.right\n },\n computedScrollThreshold (): number {\n if (this.scrollThreshold) return Number(this.scrollThreshold)\n\n return this.computedOriginalHeight - (this.dense ? 48 : 56)\n },\n computedTransform (): number {\n if (\n !this.canScroll ||\n (this.elevateOnScroll && this.currentScroll === 0 && this.isActive)\n ) return 0\n\n if (this.isActive) return 0\n\n const scrollOffScreen = this.scrollOffScreen\n ? this.computedHeight\n : this.computedContentHeight\n\n return this.bottom ? scrollOffScreen : -scrollOffScreen\n },\n hideShadow (): boolean {\n if (this.elevateOnScroll && this.isExtended) {\n return this.currentScroll < this.computedScrollThreshold\n }\n\n if (this.elevateOnScroll) {\n return this.currentScroll === 0 ||\n this.computedTransform < 0\n }\n\n return (\n !this.isExtended ||\n this.scrollOffScreen\n ) && this.computedTransform !== 0\n },\n isCollapsed (): boolean {\n if (!this.collapseOnScroll) {\n return VToolbar.options.computed.isCollapsed.call(this)\n }\n\n return this.currentScroll > 0\n },\n isProminent (): boolean {\n return (\n VToolbar.options.computed.isProminent.call(this) ||\n this.shrinkOnScroll\n )\n },\n styles (): object {\n return {\n ...VToolbar.options.computed.styles.call(this),\n fontSize: convertToUnit(this.computedFontSize, 'rem'),\n marginTop: convertToUnit(this.computedMarginTop),\n transform: `translateY(${convertToUnit(this.computedTransform)})`,\n left: convertToUnit(this.computedLeft),\n right: convertToUnit(this.computedRight),\n }\n },\n },\n\n watch: {\n canScroll: 'onScroll',\n computedTransform () {\n // Normally we do not want the v-app-bar\n // to update the application top value\n // to avoid screen jump. However, in\n // this situation, we must so that\n // the clipped drawer can update\n // its top value when scrolled\n if (\n !this.canScroll ||\n (!this.clippedLeft && !this.clippedRight)\n ) return\n\n this.callUpdate()\n },\n invertedScroll (val: boolean) {\n this.isActive = !val || this.currentScroll !== 0\n },\n hideOnScroll (val: boolean) {\n this.isActive = !val || this.currentScroll < this.computedScrollThreshold\n },\n },\n\n created () {\n if (this.invertedScroll) this.isActive = false\n },\n\n methods: {\n genBackground () {\n const render = VToolbar.options.methods.genBackground.call(this)\n\n render.data = this._b(render.data || {}, render.tag!, {\n style: { opacity: this.computedOpacity },\n })\n\n return render\n },\n updateApplication (): number {\n return this.invertedScroll\n ? 0\n : this.computedHeight + this.computedTransform\n },\n thresholdMet () {\n if (this.invertedScroll) {\n this.isActive = this.currentScroll > this.computedScrollThreshold\n return\n }\n\n if (this.hideOnScroll) {\n this.isActive = this.isScrollingUp ||\n this.currentScroll < this.computedScrollThreshold\n }\n\n if (this.currentThreshold < this.computedScrollThreshold) return\n\n this.savedScroll = this.currentScroll\n },\n },\n\n render (h): VNode {\n const render = VToolbar.options.render.call(this, h)\n\n render.data = render.data || {}\n\n if (this.canScroll) {\n render.data.directives = render.data.directives || []\n render.data.directives.push({\n arg: this.scrollTarget,\n name: 'scroll',\n value: this.onScroll,\n })\n }\n\n return render\n },\n})\n","// Components\nimport VIcon from '../VIcon'\nimport VBtn from '../VBtn/VBtn'\n\n// Types\nimport Vue from 'vue'\n\n/* @vue/component */\nexport default Vue.extend({\n name: 'v-app-bar-nav-icon',\n\n functional: true,\n\n render (h, { slots, listeners, props, data }) {\n const d = Object.assign(data, {\n staticClass: (`v-app-bar__nav-icon ${data.staticClass || ''}`).trim(),\n props: {\n ...props,\n icon: true,\n },\n on: listeners,\n })\n\n const defaultSlot = slots().default\n\n return h(VBtn, d, defaultSlot || [h(VIcon, '$menu')])\n },\n})\n","import VProgressCircular from './VProgressCircular'\n\nexport { VProgressCircular }\nexport default VProgressCircular\n","// Styles\nimport './VBtn.sass'\n\n// Extensions\nimport VSheet from '../VSheet'\n\n// Components\nimport VProgressCircular from '../VProgressCircular'\n\n// Mixins\nimport { factory as GroupableFactory } from '../../mixins/groupable'\nimport { factory as ToggleableFactory } from '../../mixins/toggleable'\nimport Elevatable from '../../mixins/elevatable'\nimport Positionable from '../../mixins/positionable'\nimport Routable from '../../mixins/routable'\nimport Sizeable from '../../mixins/sizeable'\n\n// Utilities\nimport mixins, { ExtractVue } from '../../util/mixins'\nimport { breaking } from '../../util/console'\n\n// Types\nimport { VNode } from 'vue'\nimport { PropValidator, PropType } from 'vue/types/options'\nimport { RippleOptions } from '../../directives/ripple'\n\nconst baseMixins = mixins(\n VSheet,\n Routable,\n Positionable,\n Sizeable,\n GroupableFactory('btnToggle'),\n ToggleableFactory('inputValue')\n /* @vue/component */\n)\ninterface options extends ExtractVue<typeof baseMixins> {\n $el: HTMLElement\n}\n\nexport default baseMixins.extend<options>().extend({\n name: 'v-btn',\n\n props: {\n activeClass: {\n type: String,\n default (): string | undefined {\n if (!this.btnToggle) return ''\n\n return this.btnToggle.activeClass\n },\n } as any as PropValidator<string>,\n block: Boolean,\n depressed: Boolean,\n fab: Boolean,\n icon: Boolean,\n loading: Boolean,\n outlined: Boolean,\n plain: Boolean,\n retainFocusOnClick: Boolean,\n rounded: Boolean,\n tag: {\n type: String,\n default: 'button',\n },\n text: Boolean,\n tile: Boolean,\n type: {\n type: String,\n default: 'button',\n },\n value: null as any as PropType<any>,\n },\n\n data: () => ({\n proxyClass: 'v-btn--active',\n }),\n\n computed: {\n classes (): any {\n return {\n 'v-btn': true,\n ...Routable.options.computed.classes.call(this),\n 'v-btn--absolute': this.absolute,\n 'v-btn--block': this.block,\n 'v-btn--bottom': this.bottom,\n 'v-btn--disabled': this.disabled,\n 'v-btn--is-elevated': this.isElevated,\n 'v-btn--fab': this.fab,\n 'v-btn--fixed': this.fixed,\n 'v-btn--has-bg': this.hasBg,\n 'v-btn--icon': this.icon,\n 'v-btn--left': this.left,\n 'v-btn--loading': this.loading,\n 'v-btn--outlined': this.outlined,\n 'v-btn--plain': this.plain,\n 'v-btn--right': this.right,\n 'v-btn--round': this.isRound,\n 'v-btn--rounded': this.rounded,\n 'v-btn--router': this.to,\n 'v-btn--text': this.text,\n 'v-btn--tile': this.tile,\n 'v-btn--top': this.top,\n ...this.themeClasses,\n ...this.groupClasses,\n ...this.elevationClasses,\n ...this.sizeableClasses,\n }\n },\n computedElevation (): string | number | undefined {\n if (this.disabled) return undefined\n\n return Elevatable.options.computed.computedElevation.call(this)\n },\n computedRipple (): RippleOptions | boolean {\n const defaultRipple = this.icon || this.fab ? { circle: true } : true\n if (this.disabled) return false\n else return this.ripple ?? defaultRipple\n },\n hasBg (): boolean {\n return !this.text && !this.plain && !this.outlined && !this.icon\n },\n isElevated (): boolean {\n return Boolean(\n !this.icon &&\n !this.text &&\n !this.outlined &&\n !this.depressed &&\n !this.disabled &&\n !this.plain &&\n (this.elevation == null || Number(this.elevation) > 0)\n )\n },\n isRound (): boolean {\n return Boolean(\n this.icon ||\n this.fab\n )\n },\n styles (): object {\n return {\n ...this.measurableStyles,\n }\n },\n },\n\n created () {\n const breakingProps = [\n ['flat', 'text'],\n ['outline', 'outlined'],\n ['round', 'rounded'],\n ]\n\n /* istanbul ignore next */\n breakingProps.forEach(([original, replacement]) => {\n if (this.$attrs.hasOwnProperty(original)) breaking(original, replacement, this)\n })\n },\n\n methods: {\n click (e: MouseEvent): void {\n // TODO: Remove this in v3\n !this.retainFocusOnClick && !this.fab && e.detail && this.$el.blur()\n this.$emit('click', e)\n\n this.btnToggle && this.toggle()\n },\n genContent (): VNode {\n return this.$createElement('span', {\n staticClass: 'v-btn__content',\n }, this.$slots.default)\n },\n genLoader (): VNode {\n return this.$createElement('span', {\n class: 'v-btn__loader',\n }, this.$slots.loader || [this.$createElement(VProgressCircular, {\n props: {\n indeterminate: true,\n size: 23,\n width: 2,\n },\n })])\n },\n },\n\n render (h): VNode {\n const children = [\n this.genContent(),\n this.loading && this.genLoader(),\n ]\n const { tag, data } = this.generateRouteLink()\n const setColor = this.hasBg\n ? this.setBackgroundColor\n : this.setTextColor\n\n if (tag === 'button') {\n data.attrs!.type = this.type\n data.attrs!.disabled = this.disabled\n }\n data.attrs!.value = ['string', 'number'].includes(typeof this.value)\n ? this.value\n : JSON.stringify(this.value)\n\n return h(tag, this.disabled ? data : setColor(this.color, data), children)\n },\n})\n","// Styles\nimport './VBtnToggle.sass'\n\n// Mixins\nimport ButtonGroup from '../../mixins/button-group'\nimport Colorable from '../../mixins/colorable'\n\n// Utilities\nimport mixins from '../../util/mixins'\n\n/* @vue/component */\nexport default mixins(\n ButtonGroup,\n Colorable\n).extend({\n name: 'v-btn-toggle',\n\n props: {\n backgroundColor: String,\n borderless: Boolean,\n dense: Boolean,\n group: Boolean,\n rounded: Boolean,\n shaped: Boolean,\n tile: Boolean,\n },\n\n computed: {\n classes (): object {\n return {\n ...ButtonGroup.options.computed.classes.call(this),\n 'v-btn-toggle': true,\n 'v-btn-toggle--borderless': this.borderless,\n 'v-btn-toggle--dense': this.dense,\n 'v-btn-toggle--group': this.group,\n 'v-btn-toggle--rounded': this.rounded,\n 'v-btn-toggle--shaped': this.shaped,\n 'v-btn-toggle--tile': this.tile,\n ...this.themeClasses,\n }\n },\n },\n\n methods: {\n genData () {\n const data = this.setTextColor(this.color, {\n ...ButtonGroup.options.methods.genData.call(this),\n })\n\n if (this.group) return data\n\n return this.setBackgroundColor(this.backgroundColor, data)\n },\n },\n})\n","// Styles\nimport './VCard.sass'\n\n// Extensions\nimport VSheet from '../VSheet'\n\n// Mixins\nimport Loadable from '../../mixins/loadable'\nimport Routable from '../../mixins/routable'\n\n// Helpers\nimport mixins from '../../util/mixins'\n\n// Types\nimport { VNode } from 'vue'\n\n/* @vue/component */\nexport default mixins(\n Loadable,\n Routable,\n VSheet\n).extend({\n name: 'v-card',\n\n props: {\n flat: Boolean,\n hover: Boolean,\n img: String,\n link: Boolean,\n loaderHeight: {\n type: [Number, String],\n default: 4,\n },\n raised: Boolean,\n },\n\n computed: {\n classes (): object {\n return {\n 'v-card': true,\n ...Routable.options.computed.classes.call(this),\n 'v-card--flat': this.flat,\n 'v-card--hover': this.hover,\n 'v-card--link': this.isClickable,\n 'v-card--loading': this.loading,\n 'v-card--disabled': this.disabled,\n 'v-card--raised': this.raised,\n ...VSheet.options.computed.classes.call(this),\n }\n },\n styles (): object {\n const style: Dictionary<string> = {\n ...VSheet.options.computed.styles.call(this),\n }\n\n if (this.img) {\n style.background = `url(\"${this.img}\") center center / cover no-repeat`\n }\n\n return style\n },\n },\n\n methods: {\n genProgress () {\n const render = Loadable.options.methods.genProgress.call(this)\n\n if (!render) return null\n\n return this.$createElement('div', {\n staticClass: 'v-card__progress',\n key: 'progress',\n }, [render])\n },\n },\n\n render (h): VNode {\n const { tag, data } = this.generateRouteLink()\n\n data.style = this.styles\n\n if (this.isClickable) {\n data.attrs = data.attrs || {}\n data.attrs.tabindex = 0\n }\n\n return h(tag, this.setBackgroundColor(this.color, data), [\n this.genProgress(),\n this.$slots.default,\n ])\n },\n})\n","import VCard from './VCard'\nimport { createSimpleFunctional } from '../../util/helpers'\n\nconst VCardActions = createSimpleFunctional('v-card__actions')\nconst VCardSubtitle = createSimpleFunctional('v-card__subtitle')\nconst VCardText = createSimpleFunctional('v-card__text')\nconst VCardTitle = createSimpleFunctional('v-card__title')\n\nexport {\n VCard,\n VCardActions,\n VCardSubtitle,\n VCardText,\n VCardTitle,\n}\n\nexport default {\n $_vuetify_subcomponents: {\n VCard,\n VCardActions,\n VCardSubtitle,\n VCardText,\n VCardTitle,\n },\n}\n","import VBtn from './VBtn'\n\nexport { VBtn }\nexport default VBtn\n","// Styles\nimport './VWindow.sass'\n\n// Types\nimport { VNode, VNodeDirective } from 'vue/types/vnode'\nimport { PropType } from 'vue'\nimport { TouchHandlers } from 'vuetify/types'\n\n// Directives\nimport Touch from '../../directives/touch'\n\n// Components\nimport VBtn from '../VBtn'\nimport VIcon from '../VIcon'\nimport { BaseItemGroup } from '../VItemGroup/VItemGroup'\n\n/* @vue/component */\nexport default BaseItemGroup.extend({\n name: 'v-window',\n\n directives: { Touch },\n\n provide (): object {\n return {\n windowGroup: this,\n }\n },\n\n props: {\n activeClass: {\n type: String,\n default: 'v-window-item--active',\n },\n continuous: Boolean,\n mandatory: {\n type: Boolean,\n default: true,\n },\n nextIcon: {\n type: [Boolean, String],\n default: '$next',\n },\n prevIcon: {\n type: [Boolean, String],\n default: '$prev',\n },\n reverse: Boolean,\n showArrows: Boolean,\n showArrowsOnHover: Boolean,\n touch: Object as PropType<TouchHandlers>,\n touchless: Boolean,\n value: {\n required: false,\n },\n vertical: Boolean,\n },\n\n data () {\n return {\n changedByDelimiters: false,\n internalHeight: undefined as undefined | string, // This can be fixed by child class.\n transitionHeight: undefined as undefined | string, // Intermediate height during transition.\n transitionCount: 0, // Number of windows in transition state.\n isBooted: false,\n isReverse: false,\n }\n },\n\n computed: {\n isActive (): boolean {\n return this.transitionCount > 0\n },\n classes (): object {\n return {\n ...BaseItemGroup.options.computed.classes.call(this),\n 'v-window--show-arrows-on-hover': this.showArrowsOnHover,\n }\n },\n computedTransition (): string {\n if (!this.isBooted) return ''\n\n const axis = this.vertical ? 'y' : 'x'\n const reverse = this.internalReverse ? !this.isReverse : this.isReverse\n const direction = reverse ? '-reverse' : ''\n\n return `v-window-${axis}${direction}-transition`\n },\n hasActiveItems (): boolean {\n return Boolean(\n this.items.find(item => !item.disabled)\n )\n },\n hasNext (): boolean {\n return this.continuous || this.internalIndex < this.items.length - 1\n },\n hasPrev (): boolean {\n return this.continuous || this.internalIndex > 0\n },\n internalIndex (): number {\n return this.items.findIndex((item, i) => {\n return this.internalValue === this.getValue(item, i)\n })\n },\n internalReverse (): boolean {\n return this.$vuetify.rtl ? !this.reverse : this.reverse\n },\n },\n\n watch: {\n internalIndex (val, oldVal) {\n this.isReverse = this.updateReverse(val, oldVal)\n },\n },\n\n mounted () {\n window.requestAnimationFrame(() => (this.isBooted = true))\n },\n\n methods: {\n genDefaultSlot () {\n return this.$slots.default\n },\n genContainer (): VNode {\n const children = [this.genDefaultSlot()]\n\n if (this.showArrows) {\n children.push(this.genControlIcons())\n }\n\n return this.$createElement('div', {\n staticClass: 'v-window__container',\n class: {\n 'v-window__container--is-active': this.isActive,\n },\n style: {\n height: this.internalHeight || this.transitionHeight,\n },\n }, children)\n },\n genIcon (\n direction: 'prev' | 'next',\n icon: string,\n click: () => void\n ) {\n const on = {\n click: (e: Event) => {\n e.stopPropagation()\n this.changedByDelimiters = true\n click()\n },\n }\n const attrs = {\n 'aria-label': this.$vuetify.lang.t(`$vuetify.carousel.${direction}`),\n }\n const children = this.$scopedSlots[direction]?.({\n on,\n attrs,\n }) ?? [this.$createElement(VBtn, {\n props: { icon: true },\n attrs,\n on,\n }, [\n this.$createElement(VIcon, {\n props: { large: true },\n }, icon),\n ])]\n\n return this.$createElement('div', {\n staticClass: `v-window__${direction}`,\n }, children)\n },\n genControlIcons () {\n const icons = []\n\n const prevIcon = this.$vuetify.rtl\n ? this.nextIcon\n : this.prevIcon\n\n /* istanbul ignore else */\n if (\n this.hasPrev &&\n prevIcon &&\n typeof prevIcon === 'string'\n ) {\n const icon = this.genIcon('prev', prevIcon, this.prev)\n icon && icons.push(icon)\n }\n\n const nextIcon = this.$vuetify.rtl\n ? this.prevIcon\n : this.nextIcon\n\n /* istanbul ignore else */\n if (\n this.hasNext &&\n nextIcon &&\n typeof nextIcon === 'string'\n ) {\n const icon = this.genIcon('next', nextIcon, this.next)\n icon && icons.push(icon)\n }\n\n return icons\n },\n getNextIndex (index: number): number {\n const nextIndex = (index + 1) % this.items.length\n const item = this.items[nextIndex]\n\n if (item.disabled) return this.getNextIndex(nextIndex)\n\n return nextIndex\n },\n getPrevIndex (index: number): number {\n const prevIndex = (index + this.items.length - 1) % this.items.length\n const item = this.items[prevIndex]\n\n if (item.disabled) return this.getPrevIndex(prevIndex)\n\n return prevIndex\n },\n next () {\n /* istanbul ignore if */\n if (!this.hasActiveItems || !this.hasNext) return\n\n const nextIndex = this.getNextIndex(this.internalIndex)\n const item = this.items[nextIndex]\n\n this.internalValue = this.getValue(item, nextIndex)\n },\n prev () {\n /* istanbul ignore if */\n if (!this.hasActiveItems || !this.hasPrev) return\n\n const lastIndex = this.getPrevIndex(this.internalIndex)\n const item = this.items[lastIndex]\n\n this.internalValue = this.getValue(item, lastIndex)\n },\n updateReverse (val: number, oldVal: number) {\n const itemsLength = this.items.length\n const lastIndex = itemsLength - 1\n\n if (itemsLength <= 2) return val < oldVal\n\n if (val === lastIndex && oldVal === 0) {\n return true\n } else if (val === 0 && oldVal === lastIndex) {\n return false\n } else {\n return val < oldVal\n }\n },\n },\n\n render (h): VNode {\n const data = {\n staticClass: 'v-window',\n class: this.classes,\n directives: [] as VNodeDirective[],\n }\n\n if (!this.touchless) {\n const value = this.touch || {\n left: () => {\n this.$vuetify.rtl ? this.prev() : this.next()\n },\n right: () => {\n this.$vuetify.rtl ? this.next() : this.prev()\n },\n end: (e: TouchEvent) => {\n e.stopPropagation()\n },\n start: (e: TouchEvent) => {\n e.stopPropagation()\n },\n }\n\n data.directives.push({\n name: 'touch',\n value,\n })\n }\n\n return h('div', data, [this.genContainer()])\n },\n})\n","// Styles\nimport './VCarousel.sass'\n\n// Extensions\nimport VWindow from '../VWindow/VWindow'\n\n// Components\nimport VBtn from '../VBtn'\nimport VIcon from '../VIcon'\nimport VProgressLinear from '../VProgressLinear'\n\n// Mixins\n// TODO: Move this into core components v2.0\nimport ButtonGroup from '../../mixins/button-group'\n\n// Utilities\nimport { convertToUnit } from '../../util/helpers'\nimport { breaking } from '../../util/console'\n\n// Types\nimport { VNode, PropType } from 'vue'\n\nexport default VWindow.extend({\n name: 'v-carousel',\n\n props: {\n continuous: {\n type: Boolean,\n default: true,\n },\n cycle: Boolean,\n delimiterIcon: {\n type: String,\n default: '$delimiter',\n },\n height: {\n type: [Number, String],\n default: 500,\n },\n hideDelimiters: Boolean,\n hideDelimiterBackground: Boolean,\n interval: {\n type: [Number, String],\n default: 6000,\n validator: (value: string | number) => value > 0,\n },\n mandatory: {\n type: Boolean,\n default: true,\n },\n progress: Boolean,\n progressColor: String,\n showArrows: {\n type: Boolean,\n default: true,\n },\n verticalDelimiters: {\n type: String as PropType<'' | 'left' | 'right'>,\n default: undefined,\n },\n },\n\n // pass down the parent's theme\n provide (): object {\n return {\n parentTheme: this.theme,\n }\n },\n\n data () {\n return {\n internalHeight: this.height,\n slideTimeout: undefined as number | undefined,\n }\n },\n\n computed: {\n classes (): object {\n return {\n ...VWindow.options.computed.classes.call(this),\n 'v-carousel': true,\n 'v-carousel--hide-delimiter-background': this.hideDelimiterBackground,\n 'v-carousel--vertical-delimiters': this.isVertical,\n }\n },\n isDark (): boolean {\n return this.dark || !this.light\n },\n isVertical (): boolean {\n return this.verticalDelimiters != null\n },\n },\n\n watch: {\n internalValue: 'restartTimeout',\n interval: 'restartTimeout',\n height (val, oldVal) {\n if (val === oldVal || !val) return\n this.internalHeight = val\n },\n cycle (val) {\n if (val) {\n this.restartTimeout()\n } else {\n clearTimeout(this.slideTimeout)\n this.slideTimeout = undefined\n }\n },\n },\n\n created () {\n /* istanbul ignore next */\n if (this.$attrs.hasOwnProperty('hide-controls')) {\n breaking('hide-controls', ':show-arrows=\"false\"', this)\n }\n },\n\n mounted () {\n this.startTimeout()\n },\n\n methods: {\n genControlIcons () {\n if (this.isVertical) return null\n\n return VWindow.options.methods.genControlIcons.call(this)\n },\n genDelimiters (): VNode {\n return this.$createElement('div', {\n staticClass: 'v-carousel__controls',\n style: {\n left: this.verticalDelimiters === 'left' && this.isVertical ? 0 : 'auto',\n right: this.verticalDelimiters === 'right' ? 0 : 'auto',\n },\n }, [this.genItems()])\n },\n genItems (): VNode {\n const length = this.items.length\n const children = []\n\n for (let i = 0; i < length; i++) {\n const child = this.$createElement(VBtn, {\n staticClass: 'v-carousel__controls__item',\n attrs: {\n 'aria-label': this.$vuetify.lang.t('$vuetify.carousel.ariaLabel.delimiter', i + 1, length),\n },\n props: {\n icon: true,\n small: true,\n value: this.getValue(this.items[i], i),\n },\n key: i,\n }, [\n this.$createElement(VIcon, {\n props: { size: 18 },\n }, this.delimiterIcon),\n ])\n\n children.push(child)\n }\n\n return this.$createElement(ButtonGroup, {\n props: {\n value: this.internalValue,\n mandatory: this.mandatory,\n },\n on: {\n change: (val: unknown) => {\n this.internalValue = val\n },\n },\n }, children)\n },\n genProgress () {\n return this.$createElement(VProgressLinear, {\n staticClass: 'v-carousel__progress',\n props: {\n color: this.progressColor,\n value: (this.internalIndex + 1) / this.items.length * 100,\n },\n })\n },\n restartTimeout () {\n this.slideTimeout && clearTimeout(this.slideTimeout)\n this.slideTimeout = undefined\n\n window.requestAnimationFrame(this.startTimeout)\n },\n startTimeout () {\n if (!this.cycle) return\n\n this.slideTimeout = window.setTimeout(this.next, +this.interval > 0 ? +this.interval : 6000)\n },\n },\n\n render (h): VNode {\n const render = VWindow.options.render.call(this, h)\n\n render.data!.style = `height: ${convertToUnit(this.height)};`\n\n /* istanbul ignore else */\n if (!this.hideDelimiters) {\n render.children!.push(this.genDelimiters())\n }\n\n /* istanbul ignore else */\n if (this.progress || this.progressColor) {\n render.children!.push(this.genProgress())\n }\n\n return render\n },\n})\n","// Components\nimport VWindow from './VWindow'\n\n// Mixins\nimport Bootable from '../../mixins/bootable'\nimport { factory as GroupableFactory } from '../../mixins/groupable'\n\n// Directives\nimport Touch from '../../directives/touch'\n\n// Utilities\nimport { convertToUnit } from '../../util/helpers'\nimport mixins, { ExtractVue } from '../../util/mixins'\n\n// Types\nimport { VNode } from 'vue'\n\nconst baseMixins = mixins(\n Bootable,\n GroupableFactory('windowGroup', 'v-window-item', 'v-window')\n)\n\ninterface options extends ExtractVue<typeof baseMixins> {\n $el: HTMLElement\n windowGroup: InstanceType<typeof VWindow>\n}\n\nexport default baseMixins.extend<options>().extend(\n /* @vue/component */\n).extend({\n name: 'v-window-item',\n\n directives: {\n Touch,\n },\n\n props: {\n disabled: Boolean,\n reverseTransition: {\n type: [Boolean, String],\n default: undefined,\n },\n transition: {\n type: [Boolean, String],\n default: undefined,\n },\n value: {\n required: false,\n },\n },\n\n data () {\n return {\n isActive: false,\n inTransition: false,\n }\n },\n\n computed: {\n classes (): object {\n return this.groupClasses\n },\n computedTransition (): string | boolean {\n if (!this.windowGroup.internalReverse) {\n return typeof this.transition !== 'undefined'\n ? this.transition || ''\n : this.windowGroup.computedTransition\n }\n\n return typeof this.reverseTransition !== 'undefined'\n ? this.reverseTransition || ''\n : this.windowGroup.computedTransition\n },\n },\n\n methods: {\n genDefaultSlot () {\n return this.$slots.default\n },\n genWindowItem () {\n return this.$createElement('div', {\n staticClass: 'v-window-item',\n class: this.classes,\n directives: [{\n name: 'show',\n value: this.isActive,\n }],\n on: this.$listeners,\n }, this.genDefaultSlot())\n },\n onAfterTransition () {\n if (!this.inTransition) {\n return\n }\n\n // Finalize transition state.\n this.inTransition = false\n if (this.windowGroup.transitionCount > 0) {\n this.windowGroup.transitionCount--\n\n // Remove container height if we are out of transition.\n if (this.windowGroup.transitionCount === 0) {\n this.windowGroup.transitionHeight = undefined\n }\n }\n },\n onBeforeTransition () {\n if (this.inTransition) {\n return\n }\n\n // Initialize transition state here.\n this.inTransition = true\n if (this.windowGroup.transitionCount === 0) {\n // Set initial height for height transition.\n this.windowGroup.transitionHeight = convertToUnit(this.windowGroup.$el.clientHeight)\n }\n this.windowGroup.transitionCount++\n },\n onTransitionCancelled () {\n this.onAfterTransition() // This should have the same path as normal transition end.\n },\n onEnter (el: HTMLElement) {\n if (!this.inTransition) {\n return\n }\n\n this.$nextTick(() => {\n // Do not set height if no transition or cancelled.\n if (!this.computedTransition || !this.inTransition) {\n return\n }\n\n // Set transition target height.\n this.windowGroup.transitionHeight = convertToUnit(el.clientHeight)\n })\n },\n },\n\n render (h): VNode {\n return h('transition', {\n props: {\n name: this.computedTransition,\n },\n on: {\n // Handlers for enter windows.\n beforeEnter: this.onBeforeTransition,\n afterEnter: this.onAfterTransition,\n enterCancelled: this.onTransitionCancelled,\n\n // Handlers for leave windows.\n beforeLeave: this.onBeforeTransition,\n afterLeave: this.onAfterTransition,\n leaveCancelled: this.onTransitionCancelled,\n\n // Enter handler for height transition.\n enter: this.onEnter,\n },\n }, this.showLazyContent(() => [this.genWindowItem()]))\n },\n})\n","// Extensions\nimport VWindowItem from '../VWindow/VWindowItem'\n\n// Components\nimport { VImg } from '../VImg'\n\n// Utilities\nimport mixins, { ExtractVue } from '../../util/mixins'\nimport { getSlot } from '../../util/helpers'\nimport Routable from '../../mixins/routable'\n\n// Types\nconst baseMixins = mixins(\n VWindowItem,\n Routable\n)\n\ninterface options extends ExtractVue<typeof baseMixins> {\n parentTheme: {\n isDark: boolean\n }\n}\n\n/* @vue/component */\nexport default baseMixins.extend<options>().extend({\n name: 'v-carousel-item',\n\n inject: {\n parentTheme: {\n default: {\n isDark: false,\n },\n },\n },\n\n // pass down the parent's theme\n provide (): object {\n return {\n theme: this.parentTheme,\n }\n },\n\n inheritAttrs: false,\n\n methods: {\n genDefaultSlot () {\n return [\n this.$createElement(VImg, {\n staticClass: 'v-carousel__item',\n props: {\n ...this.$attrs,\n height: this.windowGroup.internalHeight,\n },\n on: this.$listeners,\n scopedSlots: {\n placeholder: this.$scopedSlots.placeholder,\n },\n }, getSlot(this)),\n ]\n },\n genWindowItem () {\n const { tag, data } = this.generateRouteLink()\n\n data.staticClass = 'v-window-item'\n data.directives!.push({\n name: 'show',\n value: this.isActive,\n })\n\n return this.$createElement(tag, data, this.genDefaultSlot())\n },\n },\n})\n","// Styles\nimport './VFooter.sass'\n\n// Components\nimport VSheet from '../VSheet/VSheet'\n\n// Mixins\nimport Applicationable from '../../mixins/applicationable'\nimport SSRBootable from '../../mixins/ssr-bootable'\n\n// Utilities\nimport mixins from '../../util/mixins'\nimport { convertToUnit } from '../../util/helpers'\n\n// Types\nimport { VNode } from 'vue/types/vnode'\n\n/* @vue/component */\nexport default mixins(\n VSheet,\n Applicationable('footer', [\n 'height',\n 'inset',\n ]),\n SSRBootable\n).extend({\n name: 'v-footer',\n\n props: {\n height: {\n default: 'auto',\n type: [Number, String],\n },\n inset: Boolean,\n padless: Boolean,\n tag: {\n type: String,\n default: 'footer',\n },\n },\n\n computed: {\n applicationProperty (): string {\n return this.inset ? 'insetFooter' : 'footer'\n },\n classes (): object {\n return {\n ...VSheet.options.computed.classes.call(this),\n 'v-footer--absolute': this.absolute,\n 'v-footer--fixed': !this.absolute && (this.app || this.fixed),\n 'v-footer--padless': this.padless,\n 'v-footer--inset': this.inset,\n }\n },\n computedBottom (): number | undefined {\n if (!this.isPositioned) return undefined\n\n return this.app\n ? this.$vuetify.application.bottom\n : 0\n },\n computedLeft (): number | undefined {\n if (!this.isPositioned) return undefined\n\n return this.app && this.inset\n ? this.$vuetify.application.left\n : 0\n },\n computedRight (): number | undefined {\n if (!this.isPositioned) return undefined\n\n return this.app && this.inset\n ? this.$vuetify.application.right\n : 0\n },\n isPositioned (): boolean {\n return Boolean(\n this.absolute ||\n this.fixed ||\n this.app\n )\n },\n styles (): object {\n const height = parseInt(this.height)\n\n return {\n ...VSheet.options.computed.styles.call(this),\n height: isNaN(height) ? height : convertToUnit(height),\n left: convertToUnit(this.computedLeft),\n right: convertToUnit(this.computedRight),\n bottom: convertToUnit(this.computedBottom),\n }\n },\n },\n\n methods: {\n updateApplication () {\n const height = parseInt(this.height)\n\n return isNaN(height)\n ? this.$el ? this.$el.clientHeight : 0\n : height\n },\n },\n\n render (h): VNode {\n const data = this.setBackgroundColor(this.color, {\n staticClass: 'v-footer',\n class: this.classes,\n style: this.styles,\n })\n\n return h(this.tag, data, this.$slots.default)\n },\n})\n","import './VGrid.sass'\n\nimport Vue, { VNode, PropOptions } from 'vue'\nimport mergeData from '../../util/mergeData'\nimport { upperFirst } from '../../util/helpers'\n\n// no xs\nconst breakpoints = ['sm', 'md', 'lg', 'xl']\n\nconst breakpointProps = (() => {\n return breakpoints.reduce((props, val) => {\n props[val] = {\n type: [Boolean, String, Number],\n default: false,\n }\n return props\n }, {} as Dictionary<PropOptions>)\n})()\n\nconst offsetProps = (() => {\n return breakpoints.reduce((props, val) => {\n props['offset' + upperFirst(val)] = {\n type: [String, Number],\n default: null,\n }\n return props\n }, {} as Dictionary<PropOptions>)\n})()\n\nconst orderProps = (() => {\n return breakpoints.reduce((props, val) => {\n props['order' + upperFirst(val)] = {\n type: [String, Number],\n default: null,\n }\n return props\n }, {} as Dictionary<PropOptions>)\n})()\n\nconst propMap = {\n col: Object.keys(breakpointProps),\n offset: Object.keys(offsetProps),\n order: Object.keys(orderProps),\n}\n\nfunction breakpointClass (type: keyof typeof propMap, prop: string, val: boolean | string | number) {\n let className = type\n if (val == null || val === false) {\n return undefined\n }\n if (prop) {\n const breakpoint = prop.replace(type, '')\n className += `-${breakpoint}`\n }\n // Handling the boolean style prop when accepting [Boolean, String, Number]\n // means Vue will not convert <v-col sm></v-col> to sm: true for us.\n // Since the default is false, an empty string indicates the prop's presence.\n if (type === 'col' && (val === '' || val === true)) {\n // .col-md\n return className.toLowerCase()\n }\n // .order-md-6\n className += `-${val}`\n return className.toLowerCase()\n}\n\nconst cache = new Map<string, any[]>()\n\nexport default Vue.extend({\n name: 'v-col',\n functional: true,\n props: {\n cols: {\n type: [Boolean, String, Number],\n default: false,\n },\n ...breakpointProps,\n offset: {\n type: [String, Number],\n default: null,\n },\n ...offsetProps,\n order: {\n type: [String, Number],\n default: null,\n },\n ...orderProps,\n alignSelf: {\n type: String,\n default: null,\n validator: (str: any) => ['auto', 'start', 'end', 'center', 'baseline', 'stretch'].includes(str),\n },\n tag: {\n type: String,\n default: 'div',\n },\n },\n render (h, { props, data, children, parent }): VNode {\n // Super-fast memoization based on props, 5x faster than JSON.stringify\n let cacheKey = ''\n for (const prop in props) {\n cacheKey += String((props as any)[prop])\n }\n let classList = cache.get(cacheKey)\n\n if (!classList) {\n classList = []\n // Loop through `col`, `offset`, `order` breakpoint props\n let type: keyof typeof propMap\n for (type in propMap) {\n propMap[type].forEach(prop => {\n const value: string | number | boolean = (props as any)[prop]\n const className = breakpointClass(type, prop, value)\n if (className) classList!.push(className)\n })\n }\n\n const hasColClasses = classList.some(className => className.startsWith('col-'))\n\n classList.push({\n // Default to .col if no other col-{bp}-* classes generated nor `cols` specified.\n col: !hasColClasses || !props.cols,\n [`col-${props.cols}`]: props.cols,\n [`offset-${props.offset}`]: props.offset,\n [`order-${props.order}`]: props.order,\n [`align-self-${props.alignSelf}`]: props.alignSelf,\n })\n\n cache.set(cacheKey, classList)\n }\n\n return h(props.tag, mergeData(data, { class: classList }), children)\n },\n})\n","// Types\nimport Vue, { VNode } from 'vue'\n\nexport default function VGrid (name: string) {\n /* @vue/component */\n return Vue.extend({\n name: `v-${name}`,\n\n functional: true,\n\n props: {\n id: String,\n tag: {\n type: String,\n default: 'div',\n },\n },\n\n render (h, { props, data, children }): VNode {\n data.staticClass = (`${name} ${data.staticClass || ''}`).trim()\n\n const { attrs } = data\n if (attrs) {\n // reset attrs to extract utility clases like pa-3\n data.attrs = {}\n const classes = Object.keys(attrs).filter(key => {\n // TODO: Remove once resolved\n // https://github.com/vuejs/vue/issues/7841\n if (key === 'slot') return false\n\n const value = attrs[key]\n\n // add back data attributes like data-test=\"foo\" but do not\n // add them as classes\n if (key.startsWith('data-')) {\n data.attrs![key] = value\n return false\n }\n\n return value || typeof value === 'string'\n })\n\n if (classes.length) data.staticClass += ` ${classes.join(' ')}`\n }\n\n if (props.id) {\n data.domProps = data.domProps || {}\n data.domProps.id = props.id\n }\n\n return h(props.tag, data, children)\n },\n })\n}\n","import './_grid.sass'\nimport './VGrid.sass'\n\nimport Grid from './grid'\n\nimport mergeData from '../../util/mergeData'\n\n/* @vue/component */\nexport default Grid('container').extend({\n name: 'v-container',\n functional: true,\n props: {\n id: String,\n tag: {\n type: String,\n default: 'div',\n },\n fluid: {\n type: Boolean,\n default: false,\n },\n },\n render (h, { props, data, children }) {\n let classes\n const { attrs } = data\n if (attrs) {\n // reset attrs to extract utility clases like pa-3\n data.attrs = {}\n classes = Object.keys(attrs).filter(key => {\n // TODO: Remove once resolved\n // https://github.com/vuejs/vue/issues/7841\n if (key === 'slot') return false\n\n const value = attrs[key]\n\n // add back data attributes like data-test=\"foo\" but do not\n // add them as classes\n if (key.startsWith('data-')) {\n data.attrs![key] = value\n return false\n }\n\n return value || typeof value === 'string'\n })\n }\n\n if (props.id) {\n data.domProps = data.domProps || {}\n data.domProps.id = props.id\n }\n\n return h(\n props.tag,\n mergeData(data, {\n staticClass: 'container',\n class: Array<any>({\n 'container--fluid': props.fluid,\n }).concat(classes || []),\n }),\n children\n )\n },\n})\n","import './VGrid.sass'\n\nimport Vue, { PropOptions } from 'vue'\nimport mergeData from '../../util/mergeData'\nimport { upperFirst } from '../../util/helpers'\n\n// no xs\nconst breakpoints = ['sm', 'md', 'lg', 'xl']\n\nconst ALIGNMENT = ['start', 'end', 'center']\n\nfunction makeProps (prefix: string, def: () => PropOptions) {\n return breakpoints.reduce((props, val) => {\n props[prefix + upperFirst(val)] = def()\n return props\n }, {} as Dictionary<PropOptions>)\n}\n\nconst alignValidator = (str: any) => [...ALIGNMENT, 'baseline', 'stretch'].includes(str)\nconst alignProps = makeProps('align', () => ({\n type: String,\n default: null,\n validator: alignValidator,\n}))\n\nconst justifyValidator = (str: any) => [...ALIGNMENT, 'space-between', 'space-around'].includes(str)\nconst justifyProps = makeProps('justify', () => ({\n type: String,\n default: null,\n validator: justifyValidator,\n}))\n\nconst alignContentValidator = (str: any) => [...ALIGNMENT, 'space-between', 'space-around', 'stretch'].includes(str)\nconst alignContentProps = makeProps('alignContent', () => ({\n type: String,\n default: null,\n validator: alignContentValidator,\n}))\n\nconst propMap = {\n align: Object.keys(alignProps),\n justify: Object.keys(justifyProps),\n alignContent: Object.keys(alignContentProps),\n}\n\nconst classMap = {\n align: 'align',\n justify: 'justify',\n alignContent: 'align-content',\n}\n\nfunction breakpointClass (type: keyof typeof propMap, prop: string, val: string) {\n let className = classMap[type]\n if (val == null) {\n return undefined\n }\n if (prop) {\n // alignSm -> Sm\n const breakpoint = prop.replace(type, '')\n className += `-${breakpoint}`\n }\n // .align-items-sm-center\n className += `-${val}`\n return className.toLowerCase()\n}\n\nconst cache = new Map<string, any[]>()\n\nexport default Vue.extend({\n name: 'v-row',\n functional: true,\n props: {\n tag: {\n type: String,\n default: 'div',\n },\n dense: Boolean,\n noGutters: Boolean,\n align: {\n type: String,\n default: null,\n validator: alignValidator,\n },\n ...alignProps,\n justify: {\n type: String,\n default: null,\n validator: justifyValidator,\n },\n ...justifyProps,\n alignContent: {\n type: String,\n default: null,\n validator: alignContentValidator,\n },\n ...alignContentProps,\n },\n render (h, { props, data, children }) {\n // Super-fast memoization based on props, 5x faster than JSON.stringify\n let cacheKey = ''\n for (const prop in props) {\n cacheKey += String((props as any)[prop])\n }\n let classList = cache.get(cacheKey)\n\n if (!classList) {\n classList = []\n // Loop through `align`, `justify`, `alignContent` breakpoint props\n let type: keyof typeof propMap\n for (type in propMap) {\n propMap[type].forEach(prop => {\n const value: string = (props as any)[prop]\n const className = breakpointClass(type, prop, value)\n if (className) classList!.push(className)\n })\n }\n\n classList.push({\n 'no-gutters': props.noGutters,\n 'row--dense': props.dense,\n [`align-${props.align}`]: props.align,\n [`justify-${props.justify}`]: props.justify,\n [`align-content-${props.alignContent}`]: props.alignContent,\n })\n\n cache.set(cacheKey, classList)\n }\n\n return h(\n props.tag,\n mergeData(data, {\n staticClass: 'row',\n class: classList,\n }),\n children\n )\n },\n})\n","import './_grid.sass'\nimport { createSimpleFunctional } from '../../util/helpers'\n\nexport default createSimpleFunctional('spacer', 'div', 'v-spacer')\n","import './VIcon.sass'\n\n// Mixins\nimport BindsAttrs from '../../mixins/binds-attrs'\nimport Colorable from '../../mixins/colorable'\nimport Sizeable from '../../mixins/sizeable'\nimport Themeable from '../../mixins/themeable'\n\n// Util\nimport { convertToUnit, keys, remapInternalIcon } from '../../util/helpers'\n\n// Types\nimport Vue, { CreateElement, VNode, VNodeChildren, VNodeData } from 'vue'\nimport mixins from '../../util/mixins'\nimport { VuetifyIcon, VuetifyIconComponent } from 'vuetify/types/services/icons'\n\nenum SIZE_MAP {\n xSmall = '12px',\n small = '16px',\n default = '24px',\n medium = '28px',\n large = '36px',\n xLarge = '40px'\n}\n\nfunction isFontAwesome5 (iconType: string): boolean {\n return ['fas', 'far', 'fal', 'fab', 'fad', 'fak'].some(val => iconType.includes(val))\n}\n\nfunction isSvgPath (icon: string): boolean {\n return (/^[mzlhvcsqta]\\s*[-+.0-9][^mlhvzcsqta]+/i.test(icon) && /[\\dz]$/i.test(icon) && icon.length > 4)\n}\n\nconst VIcon = mixins(\n BindsAttrs,\n Colorable,\n Sizeable,\n Themeable\n /* @vue/component */\n).extend({\n name: 'v-icon',\n\n props: {\n dense: Boolean,\n disabled: Boolean,\n left: Boolean,\n right: Boolean,\n size: [Number, String],\n tag: {\n type: String,\n required: false,\n default: 'i',\n },\n },\n\n computed: {\n medium () {\n return false\n },\n hasClickListener (): boolean {\n return Boolean(\n this.listeners$.click || this.listeners$['!click']\n )\n },\n },\n\n methods: {\n getIcon (): VuetifyIcon {\n let iconName = ''\n if (this.$slots.default) iconName = this.$slots.default[0].text!.trim()\n\n return remapInternalIcon(this, iconName)\n },\n getSize (): string | undefined {\n const sizes = {\n xSmall: this.xSmall,\n small: this.small,\n medium: this.medium,\n large: this.large,\n xLarge: this.xLarge,\n }\n\n const explicitSize = keys(sizes).find(key => sizes[key])\n\n return (\n (explicitSize && SIZE_MAP[explicitSize]) || convertToUnit(this.size)\n )\n },\n // Component data for both font icon and SVG wrapper span\n getDefaultData (): VNodeData {\n return {\n staticClass: 'v-icon notranslate',\n class: {\n 'v-icon--disabled': this.disabled,\n 'v-icon--left': this.left,\n 'v-icon--link': this.hasClickListener,\n 'v-icon--right': this.right,\n 'v-icon--dense': this.dense,\n },\n attrs: {\n 'aria-hidden': !this.hasClickListener,\n disabled: this.hasClickListener && this.disabled,\n type: this.hasClickListener ? 'button' : undefined,\n ...this.attrs$,\n },\n on: this.listeners$,\n }\n },\n getSvgWrapperData () {\n const fontSize = this.getSize()\n const wrapperData = {\n ...this.getDefaultData(),\n style: fontSize ? {\n fontSize,\n height: fontSize,\n width: fontSize,\n } : undefined,\n }\n this.applyColors(wrapperData)\n\n return wrapperData\n },\n applyColors (data: VNodeData): void {\n data.class = { ...data.class, ...this.themeClasses }\n this.setTextColor(this.color, data)\n },\n renderFontIcon (icon: string, h: CreateElement): VNode {\n const newChildren: VNodeChildren = []\n const data = this.getDefaultData()\n\n let iconType = 'material-icons'\n // Material Icon delimiter is _\n // https://material.io/icons/\n const delimiterIndex = icon.indexOf('-')\n const isMaterialIcon = delimiterIndex <= -1\n\n if (isMaterialIcon) {\n // Material icon uses ligatures.\n newChildren.push(icon)\n } else {\n iconType = icon.slice(0, delimiterIndex)\n if (isFontAwesome5(iconType)) iconType = ''\n }\n\n data.class[iconType] = true\n data.class[icon] = !isMaterialIcon\n\n const fontSize = this.getSize()\n if (fontSize) data.style = { fontSize }\n\n this.applyColors(data)\n\n return h(this.hasClickListener ? 'button' : this.tag, data, newChildren)\n },\n renderSvgIcon (icon: string, h: CreateElement): VNode {\n const svgData: VNodeData = {\n class: 'v-icon__svg',\n attrs: {\n xmlns: 'http://www.w3.org/2000/svg',\n viewBox: '0 0 24 24',\n role: 'img',\n 'aria-hidden': true,\n },\n }\n\n const size = this.getSize()\n if (size) {\n svgData.style = {\n fontSize: size,\n height: size,\n width: size,\n }\n }\n\n return h(this.hasClickListener ? 'button' : 'span', this.getSvgWrapperData(), [\n h('svg', svgData, [\n h('path', {\n attrs: {\n d: icon,\n },\n }),\n ]),\n ])\n },\n renderSvgIconComponent (\n icon: VuetifyIconComponent,\n h: CreateElement\n ): VNode {\n const data: VNodeData = {\n class: {\n 'v-icon__component': true,\n },\n }\n\n const size = this.getSize()\n if (size) {\n data.style = {\n fontSize: size,\n height: size,\n width: size,\n }\n }\n\n this.applyColors(data)\n\n const component = icon.component\n data.props = icon.props\n data.nativeOn = data.on\n\n return h(this.hasClickListener ? 'button' : 'span', this.getSvgWrapperData(), [\n h(component, data),\n ])\n },\n },\n\n render (h: CreateElement): VNode {\n const icon = this.getIcon()\n\n if (typeof icon === 'string') {\n if (isSvgPath(icon)) {\n return this.renderSvgIcon(icon, h)\n }\n return this.renderFontIcon(icon, h)\n }\n\n return this.renderSvgIconComponent(icon, h)\n },\n})\n\nexport default Vue.extend({\n name: 'v-icon',\n\n $_wrapperFor: VIcon,\n\n functional: true,\n\n render (h, { data, children }): VNode {\n let iconName = ''\n\n // Support usage of v-text and v-html\n if (data.domProps) {\n iconName = data.domProps.textContent ||\n data.domProps.innerHTML ||\n iconName\n\n // Remove nodes so it doesn't\n // overwrite our changes\n delete data.domProps.textContent\n delete data.domProps.innerHTML\n }\n\n return h(VIcon, data, iconName ? [iconName] : children)\n },\n})\n","import VIcon from './VIcon'\n\nexport { VIcon }\nexport default VIcon\n","import './VResponsive.sass'\n\n// Mixins\nimport Measurable, { NumberOrNumberString } from '../../mixins/measurable'\n\n// Types\nimport { VNode } from 'vue'\n\n// Utils\nimport mixins from '../../util/mixins'\nimport { getSlot } from '../../util/helpers'\n\n/* @vue/component */\nexport default mixins(Measurable).extend({\n name: 'v-responsive',\n\n props: {\n aspectRatio: [String, Number] as NumberOrNumberString,\n contentClass: String,\n },\n\n computed: {\n computedAspectRatio (): number {\n return Number(this.aspectRatio)\n },\n aspectStyle (): object | undefined {\n return this.computedAspectRatio\n ? { paddingBottom: (1 / this.computedAspectRatio) * 100 + '%' }\n : undefined\n },\n __cachedSizer (): VNode | [] {\n if (!this.aspectStyle) return []\n\n return this.$createElement('div', {\n style: this.aspectStyle,\n staticClass: 'v-responsive__sizer',\n })\n },\n },\n\n methods: {\n genContent (): VNode {\n return this.$createElement('div', {\n staticClass: 'v-responsive__content',\n class: this.contentClass,\n }, getSlot(this))\n },\n },\n\n render (h): VNode {\n return h('div', {\n staticClass: 'v-responsive',\n style: this.measurableStyles,\n on: this.$listeners,\n }, [\n this.__cachedSizer,\n this.genContent(),\n ])\n },\n})\n","import VResponsive from './VResponsive'\n\nexport { VResponsive }\nexport default VResponsive\n","// Styles\nimport './VImg.sass'\n\n// Directives\nimport intersect from '../../directives/intersect'\n\n// Types\nimport { VNode } from 'vue'\nimport { PropValidator } from 'vue/types/options'\n\n// Components\nimport VResponsive from '../VResponsive'\n\n// Mixins\nimport Themeable from '../../mixins/themeable'\n\n// Utils\nimport mixins from '../../util/mixins'\nimport mergeData from '../../util/mergeData'\nimport { consoleWarn } from '../../util/console'\nimport { getSlot } from '../../util/helpers'\n\n// not intended for public use, this is passed in by vuetify-loader\nexport interface srcObject {\n src: string\n srcset?: string\n lazySrc: string\n aspect: number\n}\n\nconst hasIntersect = typeof window !== 'undefined' && 'IntersectionObserver' in window\n\n/* @vue/component */\nexport default mixins(\n VResponsive,\n Themeable,\n).extend({\n name: 'v-img',\n\n directives: { intersect },\n\n props: {\n alt: String,\n contain: Boolean,\n eager: Boolean,\n gradient: String,\n lazySrc: String,\n options: {\n type: Object,\n // For more information on types, navigate to:\n // https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API\n default: () => ({\n root: undefined,\n rootMargin: undefined,\n threshold: undefined,\n }),\n } as PropValidator<IntersectionObserverInit>,\n position: {\n type: String,\n default: 'center center',\n },\n sizes: String,\n src: {\n type: [String, Object],\n default: '',\n } as PropValidator<string | srcObject>,\n srcset: String,\n transition: {\n type: [Boolean, String],\n default: 'fade-transition',\n },\n },\n\n data () {\n return {\n currentSrc: '', // Set from srcset\n image: null as HTMLImageElement | null,\n isLoading: true,\n calculatedAspectRatio: undefined as number | undefined,\n naturalWidth: undefined as number | undefined,\n hasError: false,\n }\n },\n\n computed: {\n computedAspectRatio (): number {\n return Number(this.normalisedSrc.aspect || this.calculatedAspectRatio)\n },\n normalisedSrc (): srcObject {\n return this.src && typeof this.src === 'object'\n ? {\n src: this.src.src,\n srcset: this.srcset || this.src.srcset,\n lazySrc: this.lazySrc || this.src.lazySrc,\n aspect: Number(this.aspectRatio || this.src.aspect),\n } : {\n src: this.src,\n srcset: this.srcset,\n lazySrc: this.lazySrc,\n aspect: Number(this.aspectRatio || 0),\n }\n },\n __cachedImage (): VNode | [] {\n if (!(this.normalisedSrc.src || this.normalisedSrc.lazySrc || this.gradient)) return []\n\n const backgroundImage: string[] = []\n const src = this.isLoading ? this.normalisedSrc.lazySrc : this.currentSrc\n\n if (this.gradient) backgroundImage.push(`linear-gradient(${this.gradient})`)\n if (src) backgroundImage.push(`url(\"${src}\")`)\n\n const image = this.$createElement('div', {\n staticClass: 'v-image__image',\n class: {\n 'v-image__image--preload': this.isLoading,\n 'v-image__image--contain': this.contain,\n 'v-image__image--cover': !this.contain,\n },\n style: {\n backgroundImage: backgroundImage.join(', '),\n backgroundPosition: this.position,\n },\n key: +this.isLoading,\n })\n\n /* istanbul ignore if */\n if (!this.transition) return image\n\n return this.$createElement('transition', {\n attrs: {\n name: this.transition,\n mode: 'in-out',\n },\n }, [image])\n },\n },\n\n watch: {\n src () {\n // Force re-init when src changes\n if (!this.isLoading) this.init(undefined, undefined, true)\n else this.loadImage()\n },\n '$vuetify.breakpoint.width': 'getSrc',\n },\n\n mounted () {\n this.init()\n },\n\n methods: {\n init (\n entries?: IntersectionObserverEntry[],\n observer?: IntersectionObserver,\n isIntersecting?: boolean\n ) {\n // If the current browser supports the intersection\n // observer api, the image is not observable, and\n // the eager prop isn't being used, do not load\n if (\n hasIntersect &&\n !isIntersecting &&\n !this.eager\n ) return\n\n if (this.normalisedSrc.lazySrc) {\n const lazyImg = new Image()\n lazyImg.src = this.normalisedSrc.lazySrc\n this.pollForSize(lazyImg, null)\n }\n /* istanbul ignore else */\n if (this.normalisedSrc.src) this.loadImage()\n },\n onLoad () {\n this.getSrc()\n this.isLoading = false\n this.$emit('load', this.src)\n\n if (\n this.image &&\n (this.normalisedSrc.src.endsWith('.svg') || this.normalisedSrc.src.startsWith('data:image/svg+xml'))\n ) {\n if (this.image.naturalHeight && this.image.naturalWidth) {\n this.naturalWidth = this.image.naturalWidth\n this.calculatedAspectRatio = this.image.naturalWidth / this.image.naturalHeight\n } else {\n this.calculatedAspectRatio = 1\n }\n }\n },\n onError () {\n this.hasError = true\n this.$emit('error', this.src)\n },\n getSrc () {\n /* istanbul ignore else */\n if (this.image) this.currentSrc = this.image.currentSrc || this.image.src\n },\n loadImage () {\n const image = new Image()\n this.image = image\n\n image.onload = () => {\n /* istanbul ignore if */\n if (image.decode) {\n image.decode().catch((err: DOMException) => {\n consoleWarn(\n `Failed to decode image, trying to render anyway\\n\\n` +\n `src: ${this.normalisedSrc.src}` +\n (err.message ? `\\nOriginal error: ${err.message}` : ''),\n this\n )\n }).then(this.onLoad)\n } else {\n this.onLoad()\n }\n }\n image.onerror = this.onError\n\n this.hasError = false\n this.sizes && (image.sizes = this.sizes)\n this.normalisedSrc.srcset && (image.srcset = this.normalisedSrc.srcset)\n image.src = this.normalisedSrc.src\n this.$emit('loadstart', this.normalisedSrc.src)\n\n this.aspectRatio || this.pollForSize(image)\n this.getSrc()\n },\n pollForSize (img: HTMLImageElement, timeout: number | null = 100) {\n const poll = () => {\n const { naturalHeight, naturalWidth } = img\n\n if (naturalHeight || naturalWidth) {\n this.naturalWidth = naturalWidth\n this.calculatedAspectRatio = naturalWidth / naturalHeight\n } else if (!img.complete && this.isLoading && !this.hasError && timeout != null) {\n setTimeout(poll, timeout)\n }\n }\n\n poll()\n },\n genContent () {\n const content: VNode = VResponsive.options.methods.genContent.call(this)\n if (this.naturalWidth) {\n this._b(content.data!, 'div', {\n style: { width: `${this.naturalWidth}px` },\n })\n }\n\n return content\n },\n __genPlaceholder (): VNode | void {\n const slot = getSlot(this, 'placeholder')\n if (slot) {\n const placeholder = this.isLoading\n ? [this.$createElement('div', {\n staticClass: 'v-image__placeholder',\n }, slot)]\n : []\n\n if (!this.transition) return placeholder[0]\n\n return this.$createElement('transition', {\n props: {\n appear: true,\n name: this.transition,\n },\n }, placeholder)\n }\n },\n },\n\n render (h): VNode {\n const node = VResponsive.options.render.call(this, h)\n\n const data = mergeData(node.data!, {\n staticClass: 'v-image',\n attrs: {\n 'aria-label': this.alt,\n role: this.alt ? 'img' : undefined,\n },\n class: this.themeClasses,\n // Only load intersect directive if it\n // will work in the current browser.\n directives: hasIntersect\n ? [{\n name: 'intersect',\n modifiers: { once: true },\n value: {\n handler: this.init,\n options: this.options,\n },\n }]\n : undefined,\n })\n\n node.children = [\n this.__cachedSizer,\n this.__cachedImage,\n this.__genPlaceholder(),\n this.genContent(),\n ] as VNode[]\n\n return h(node.tag, data, node.children)\n },\n})\n","// Styles\nimport './VItemGroup.sass'\n\n// Mixins\nimport Comparable from '../../mixins/comparable'\nimport Groupable from '../../mixins/groupable'\nimport Proxyable from '../../mixins/proxyable'\nimport Themeable from '../../mixins/themeable'\n\n// Utilities\nimport mixins from '../../util/mixins'\nimport { consoleWarn } from '../../util/console'\n\n// Types\nimport { VNode } from 'vue/types'\n\nexport type GroupableInstance = InstanceType<typeof Groupable> & {\n id?: string\n to?: any\n value?: any\n }\n\nexport const BaseItemGroup = mixins(\n Comparable,\n Proxyable,\n Themeable\n).extend({\n name: 'base-item-group',\n\n props: {\n activeClass: {\n type: String,\n default: 'v-item--active',\n },\n mandatory: Boolean,\n max: {\n type: [Number, String],\n default: null,\n },\n multiple: Boolean,\n tag: {\n type: String,\n default: 'div',\n },\n },\n\n data () {\n return {\n // As long as a value is defined, show it\n // Otherwise, check if multiple\n // to determine which default to provide\n internalLazyValue: this.value !== undefined\n ? this.value\n : this.multiple ? [] : undefined,\n items: [] as GroupableInstance[],\n }\n },\n\n computed: {\n classes (): Record<string, boolean> {\n return {\n 'v-item-group': true,\n ...this.themeClasses,\n }\n },\n selectedIndex (): number {\n return (this.selectedItem && this.items.indexOf(this.selectedItem)) || -1\n },\n selectedItem (): GroupableInstance | undefined {\n if (this.multiple) return undefined\n\n return this.selectedItems[0]\n },\n selectedItems (): GroupableInstance[] {\n return this.items.filter((item, index) => {\n return this.toggleMethod(this.getValue(item, index))\n })\n },\n selectedValues (): any[] {\n if (this.internalValue == null) return []\n\n return Array.isArray(this.internalValue)\n ? this.internalValue\n : [this.internalValue]\n },\n toggleMethod (): (v: any) => boolean {\n if (!this.multiple) {\n return (v: any) => this.valueComparator(this.internalValue, v)\n }\n\n const internalValue = this.internalValue\n if (Array.isArray(internalValue)) {\n return (v: any) => internalValue.some(intern => this.valueComparator(intern, v))\n }\n\n return () => false\n },\n },\n\n watch: {\n internalValue: 'updateItemsState',\n items: 'updateItemsState',\n },\n\n created () {\n if (this.multiple && !Array.isArray(this.internalValue)) {\n consoleWarn('Model must be bound to an array if the multiple property is true.', this)\n }\n },\n\n methods: {\n\n genData (): object {\n return {\n class: this.classes,\n }\n },\n getValue (item: GroupableInstance, i: number): unknown {\n return item.value === undefined\n ? i\n : item.value\n },\n onClick (item: GroupableInstance) {\n this.updateInternalValue(\n this.getValue(item, this.items.indexOf(item))\n )\n },\n register (item: GroupableInstance) {\n const index = this.items.push(item) - 1\n\n item.$on('change', () => this.onClick(item))\n\n // If no value provided and mandatory,\n // assign first registered item\n if (this.mandatory && !this.selectedValues.length) {\n this.updateMandatory()\n }\n\n this.updateItem(item, index)\n },\n unregister (item: GroupableInstance) {\n if (this._isDestroyed) return\n\n const index = this.items.indexOf(item)\n const value = this.getValue(item, index)\n\n this.items.splice(index, 1)\n\n const valueIndex = this.selectedValues.indexOf(value)\n\n // Items is not selected, do nothing\n if (valueIndex < 0) return\n\n // If not mandatory, use regular update process\n if (!this.mandatory) {\n return this.updateInternalValue(value)\n }\n\n // Remove the value\n if (this.multiple && Array.isArray(this.internalValue)) {\n this.internalValue = this.internalValue.filter(v => v !== value)\n } else {\n this.internalValue = undefined\n }\n\n // If mandatory and we have no selection\n // add the last item as value\n /* istanbul ignore else */\n if (!this.selectedItems.length) {\n this.updateMandatory(true)\n }\n },\n updateItem (item: GroupableInstance, index: number) {\n const value = this.getValue(item, index)\n\n item.isActive = this.toggleMethod(value)\n },\n // https://github.com/vuetifyjs/vuetify/issues/5352\n updateItemsState () {\n this.$nextTick(() => {\n if (this.mandatory &&\n !this.selectedItems.length\n ) {\n return this.updateMandatory()\n }\n\n // TODO: Make this smarter so it\n // doesn't have to iterate every\n // child in an update\n this.items.forEach(this.updateItem)\n })\n },\n updateInternalValue (value: any) {\n this.multiple\n ? this.updateMultiple(value)\n : this.updateSingle(value)\n },\n updateMandatory (last?: boolean) {\n if (!this.items.length) return\n\n const items = this.items.slice()\n\n if (last) items.reverse()\n\n const item = items.find(item => !item.disabled)\n\n // If no tabs are available\n // aborts mandatory value\n if (!item) return\n\n const index = this.items.indexOf(item)\n\n this.updateInternalValue(\n this.getValue(item, index)\n )\n },\n updateMultiple (value: any) {\n const defaultValue = Array.isArray(this.internalValue)\n ? this.internalValue\n : []\n const internalValue = defaultValue.slice()\n const index = internalValue.findIndex(val => this.valueComparator(val, value))\n\n if (\n this.mandatory &&\n // Item already exists\n index > -1 &&\n // value would be reduced below min\n internalValue.length - 1 < 1\n ) return\n\n if (\n // Max is set\n this.max != null &&\n // Item doesn't exist\n index < 0 &&\n // value would be increased above max\n internalValue.length + 1 > this.max\n ) return\n\n index > -1\n ? internalValue.splice(index, 1)\n : internalValue.push(value)\n\n this.internalValue = internalValue\n },\n updateSingle (value: any) {\n const isSame = this.valueComparator(this.internalValue, value)\n\n if (this.mandatory && isSame) return\n\n this.internalValue = isSame ? undefined : value\n },\n },\n\n render (h): VNode {\n return h(this.tag, this.genData(), this.$slots.default)\n },\n})\n\nexport default BaseItemGroup.extend({\n name: 'v-item-group',\n\n provide (): object {\n return {\n itemGroup: this,\n }\n },\n})\n","// Styles\nimport './VList.sass'\nimport VListGroup from './VListGroup'\n\n// Components\nimport VSheet from '../VSheet/VSheet'\n\n// Types\nimport { VNode } from 'vue'\n\ntype VListGroupInstance = InstanceType<typeof VListGroup>\n\ninterface options extends InstanceType<typeof VSheet> {\n isInMenu: boolean\n isInNav: boolean\n}\n\n/* @vue/component */\nexport default VSheet.extend<options>().extend({\n name: 'v-list',\n\n provide (): object {\n return {\n isInList: true,\n list: this,\n }\n },\n\n inject: {\n isInMenu: {\n default: false,\n },\n isInNav: {\n default: false,\n },\n },\n\n props: {\n dense: Boolean,\n disabled: Boolean,\n expand: Boolean,\n flat: Boolean,\n nav: Boolean,\n rounded: Boolean,\n subheader: Boolean,\n threeLine: Boolean,\n twoLine: Boolean,\n },\n\n data: () => ({\n groups: [] as VListGroupInstance[],\n }),\n\n computed: {\n classes (): object {\n return {\n ...VSheet.options.computed.classes.call(this),\n 'v-list--dense': this.dense,\n 'v-list--disabled': this.disabled,\n 'v-list--flat': this.flat,\n 'v-list--nav': this.nav,\n 'v-list--rounded': this.rounded,\n 'v-list--subheader': this.subheader,\n 'v-list--two-line': this.twoLine,\n 'v-list--three-line': this.threeLine,\n }\n },\n },\n\n methods: {\n register (content: VListGroupInstance) {\n this.groups.push(content)\n },\n unregister (content: VListGroupInstance) {\n const index = this.groups.findIndex(g => g._uid === content._uid)\n\n if (index > -1) this.groups.splice(index, 1)\n },\n listClick (uid: number) {\n if (this.expand) return\n\n for (const group of this.groups) {\n group.toggle(uid)\n }\n },\n },\n\n render (h): VNode {\n const data = {\n staticClass: 'v-list',\n class: this.classes,\n style: this.styles,\n attrs: {\n role: this.isInNav || this.isInMenu ? undefined : 'list',\n ...this.attrs$,\n },\n }\n\n return h(this.tag, this.setBackgroundColor(this.color, data), [this.$slots.default])\n },\n})\n","// Styles\nimport './VListItem.sass'\n\n// Mixins\nimport Colorable from '../../mixins/colorable'\nimport Routable from '../../mixins/routable'\nimport { factory as GroupableFactory } from '../../mixins/groupable'\nimport Themeable from '../../mixins/themeable'\nimport { factory as ToggleableFactory } from '../../mixins/toggleable'\n\n// Directives\nimport Ripple from '../../directives/ripple'\n\n// Utilities\nimport { keyCodes } from './../../util/helpers'\nimport { ExtractVue } from './../../util/mixins'\nimport { removed } from '../../util/console'\n\n// Types\nimport mixins from '../../util/mixins'\nimport { VNode } from 'vue'\nimport { PropType, PropValidator } from 'vue/types/options'\n\nconst baseMixins = mixins(\n Colorable,\n Routable,\n Themeable,\n GroupableFactory('listItemGroup'),\n ToggleableFactory('inputValue')\n)\n\ninterface options extends ExtractVue<typeof baseMixins> {\n $el: HTMLElement\n isInGroup: boolean\n isInList: boolean\n isInMenu: boolean\n isInNav: boolean\n}\n\n/* @vue/component */\nexport default baseMixins.extend<options>().extend({\n name: 'v-list-item',\n\n directives: {\n Ripple,\n },\n\n inject: {\n isInGroup: {\n default: false,\n },\n isInList: {\n default: false,\n },\n isInMenu: {\n default: false,\n },\n isInNav: {\n default: false,\n },\n },\n\n inheritAttrs: false,\n\n props: {\n activeClass: {\n type: String,\n default (): string | undefined {\n if (!this.listItemGroup) return ''\n\n return this.listItemGroup.activeClass\n },\n } as any as PropValidator<string>,\n dense: Boolean,\n inactive: Boolean,\n link: Boolean,\n selectable: {\n type: Boolean,\n },\n tag: {\n type: String,\n default: 'div',\n },\n threeLine: Boolean,\n twoLine: Boolean,\n value: null as any as PropType<any>,\n },\n\n data: () => ({\n proxyClass: 'v-list-item--active',\n }),\n\n computed: {\n classes (): object {\n return {\n 'v-list-item': true,\n ...Routable.options.computed.classes.call(this),\n 'v-list-item--dense': this.dense,\n 'v-list-item--disabled': this.disabled,\n 'v-list-item--link': this.isClickable && !this.inactive,\n 'v-list-item--selectable': this.selectable,\n 'v-list-item--three-line': this.threeLine,\n 'v-list-item--two-line': this.twoLine,\n ...this.themeClasses,\n }\n },\n isClickable (): boolean {\n return Boolean(\n Routable.options.computed.isClickable.call(this) ||\n this.listItemGroup\n )\n },\n },\n\n created () {\n /* istanbul ignore next */\n if (this.$attrs.hasOwnProperty('avatar')) {\n removed('avatar', this)\n }\n },\n\n methods: {\n click (e: MouseEvent | KeyboardEvent) {\n if (e.detail) this.$el.blur()\n\n this.$emit('click', e)\n\n this.to || this.toggle()\n },\n genAttrs () {\n const attrs: Record<string, any> = {\n 'aria-disabled': this.disabled ? true : undefined,\n tabindex: this.isClickable && !this.disabled ? 0 : -1,\n ...this.$attrs,\n }\n\n if (this.$attrs.hasOwnProperty('role')) {\n // do nothing, role already provided\n } else if (this.isInNav) {\n // do nothing, role is inherit\n } else if (this.isInGroup) {\n attrs.role = 'option'\n attrs['aria-selected'] = String(this.isActive)\n } else if (this.isInMenu) {\n attrs.role = this.isClickable ? 'menuitem' : undefined\n attrs.id = attrs.id || `list-item-${this._uid}`\n } else if (this.isInList) {\n attrs.role = 'listitem'\n }\n\n return attrs\n },\n toggle () {\n if (this.to && this.inputValue === undefined) {\n this.isActive = !this.isActive\n }\n this.$emit('change')\n },\n },\n\n render (h): VNode {\n let { tag, data } = this.generateRouteLink()\n\n data.attrs = {\n ...data.attrs,\n ...this.genAttrs(),\n }\n data[this.to ? 'nativeOn' : 'on'] = {\n ...data[this.to ? 'nativeOn' : 'on'],\n keydown: (e: KeyboardEvent) => {\n if (!this.disabled) {\n /* istanbul ignore else */\n if (e.keyCode === keyCodes.enter) this.click(e)\n\n this.$emit('keydown', e)\n }\n },\n }\n\n if (this.inactive) tag = 'div'\n if (this.inactive && this.to) {\n data.on = data.nativeOn\n delete data.nativeOn\n }\n\n const children = this.$scopedSlots.default\n ? this.$scopedSlots.default({\n active: this.isActive,\n toggle: this.toggle,\n })\n : this.$slots.default\n\n return h(tag, this.isActive ? this.setTextColor(this.color, data) : data, children)\n },\n})\n","// Types\nimport Vue, { VNode } from 'vue'\n\n/* @vue/component */\nexport default Vue.extend({\n name: 'v-list-item-action',\n\n functional: true,\n\n render (h, { data, children = [] }): VNode {\n data.staticClass = data.staticClass ? `v-list-item__action ${data.staticClass}` : 'v-list-item__action'\n const filteredChild = children.filter(VNode => {\n return VNode.isComment === false && VNode.text !== ' '\n })\n if (filteredChild.length > 1) data.staticClass += ' v-list-item__action--stack'\n\n return h('div', data, children)\n },\n})\n","// Styles\nimport './VListItemGroup.sass'\n\n// Extensions\nimport { BaseItemGroup } from '../VItemGroup/VItemGroup'\n\n// Mixins\nimport Colorable from '../../mixins/colorable'\n\n// Utilities\nimport mixins from '../../util/mixins'\n\nexport default mixins(\n BaseItemGroup,\n Colorable\n).extend({\n name: 'v-list-item-group',\n\n provide () {\n return {\n isInGroup: true,\n listItemGroup: this,\n }\n },\n\n computed: {\n classes (): object {\n return {\n ...BaseItemGroup.options.computed.classes.call(this),\n 'v-list-item-group': true,\n }\n },\n },\n\n methods: {\n genData (): object {\n return this.setTextColor(this.color, {\n ...BaseItemGroup.options.methods.genData.call(this),\n attrs: {\n role: 'listbox',\n },\n })\n },\n },\n})\n","// Types\nimport Vue, { VNode } from 'vue'\n\n/* @vue/component */\nexport default Vue.extend({\n name: 'v-list-item-icon',\n\n functional: true,\n\n render (h, { data, children }): VNode {\n data.staticClass = (`v-list-item__icon ${data.staticClass || ''}`).trim()\n\n return h('div', data, children)\n },\n})\n","// Styles\nimport './VListGroup.sass'\n\n// Components\nimport VIcon from '../VIcon'\nimport VList from './VList'\nimport VListItem from './VListItem'\nimport VListItemIcon from './VListItemIcon'\n\n// Mixins\nimport BindsAttrs from '../../mixins/binds-attrs'\nimport Bootable from '../../mixins/bootable'\nimport Colorable from '../../mixins/colorable'\nimport Toggleable from '../../mixins/toggleable'\nimport { inject as RegistrableInject } from '../../mixins/registrable'\n\n// Directives\nimport ripple from '../../directives/ripple'\n\n// Transitions\nimport { VExpandTransition } from '../transitions'\n\n// Utils\nimport mixins, { ExtractVue } from '../../util/mixins'\nimport { getSlot } from '../../util/helpers'\n\n// Types\nimport { VNode } from 'vue'\nimport { Route } from 'vue-router'\n\nconst baseMixins = mixins(\n BindsAttrs,\n Bootable,\n Colorable,\n RegistrableInject('list'),\n Toggleable\n)\n\ntype VListInstance = InstanceType<typeof VList>\n\ninterface options extends ExtractVue<typeof baseMixins> {\n list: VListInstance\n $refs: {\n group: HTMLElement\n }\n $route: Route\n}\n\nexport default baseMixins.extend<options>().extend({\n name: 'v-list-group',\n\n directives: { ripple },\n\n props: {\n activeClass: {\n type: String,\n default: '',\n },\n appendIcon: {\n type: String,\n default: '$expand',\n },\n color: {\n type: String,\n default: 'primary',\n },\n disabled: Boolean,\n group: [String, RegExp],\n noAction: Boolean,\n prependIcon: String,\n ripple: {\n type: [Boolean, Object],\n default: true,\n },\n subGroup: Boolean,\n },\n\n computed: {\n classes (): object {\n return {\n 'v-list-group--active': this.isActive,\n 'v-list-group--disabled': this.disabled,\n 'v-list-group--no-action': this.noAction,\n 'v-list-group--sub-group': this.subGroup,\n }\n },\n },\n\n watch: {\n isActive (val: boolean) {\n /* istanbul ignore else */\n if (!this.subGroup && val) {\n this.list && this.list.listClick(this._uid)\n }\n },\n $route: 'onRouteChange',\n },\n\n created () {\n this.list && this.list.register(this)\n\n if (this.group &&\n this.$route &&\n this.value == null\n ) {\n this.isActive = this.matchRoute(this.$route.path)\n }\n },\n\n beforeDestroy () {\n this.list && this.list.unregister(this)\n },\n\n methods: {\n click (e: Event) {\n if (this.disabled) return\n\n this.isBooted = true\n\n this.$emit('click', e)\n this.$nextTick(() => (this.isActive = !this.isActive))\n },\n genIcon (icon: string | false): VNode {\n return this.$createElement(VIcon, icon)\n },\n genAppendIcon (): VNode | null {\n const icon = !this.subGroup ? this.appendIcon : false\n\n if (!icon && !this.$slots.appendIcon) return null\n\n return this.$createElement(VListItemIcon, {\n staticClass: 'v-list-group__header__append-icon',\n }, [\n this.$slots.appendIcon || this.genIcon(icon),\n ])\n },\n genHeader (): VNode {\n return this.$createElement(VListItem, {\n staticClass: 'v-list-group__header',\n attrs: {\n 'aria-expanded': String(this.isActive),\n role: 'button',\n },\n class: {\n [this.activeClass]: this.isActive,\n },\n props: {\n inputValue: this.isActive,\n },\n directives: [{\n name: 'ripple',\n value: this.ripple,\n }],\n on: {\n ...this.listeners$,\n click: this.click,\n },\n }, [\n this.genPrependIcon(),\n this.$slots.activator,\n this.genAppendIcon(),\n ])\n },\n genItems (): VNode[] {\n return this.showLazyContent(() => [\n this.$createElement('div', {\n staticClass: 'v-list-group__items',\n directives: [{\n name: 'show',\n value: this.isActive,\n }],\n }, getSlot(this)),\n ])\n },\n genPrependIcon (): VNode | null {\n const icon = this.subGroup && this.prependIcon == null\n ? '$subgroup'\n : this.prependIcon\n\n if (!icon && !this.$slots.prependIcon) return null\n\n return this.$createElement(VListItemIcon, {\n staticClass: 'v-list-group__header__prepend-icon',\n }, [\n this.$slots.prependIcon || this.genIcon(icon),\n ])\n },\n onRouteChange (to: Route) {\n /* istanbul ignore if */\n if (!this.group) return\n\n const isActive = this.matchRoute(to.path)\n\n /* istanbul ignore else */\n if (isActive && this.isActive !== isActive) {\n this.list && this.list.listClick(this._uid)\n }\n\n this.isActive = isActive\n },\n toggle (uid: number) {\n const isActive = this._uid === uid\n\n if (isActive) this.isBooted = true\n this.$nextTick(() => (this.isActive = isActive))\n },\n matchRoute (to: string) {\n return to.match(this.group) !== null\n },\n },\n\n render (h): VNode {\n return h('div', this.setTextColor(this.isActive && this.color, {\n staticClass: 'v-list-group',\n class: this.classes,\n }), [\n this.genHeader(),\n h(VExpandTransition, this.genItems()),\n ])\n },\n})\n","import './VAvatar.sass'\n\n// Mixins\nimport Colorable from '../../mixins/colorable'\nimport Measurable from '../../mixins/measurable'\nimport Roundable from '../../mixins/roundable'\n\n// Utilities\nimport { convertToUnit } from '../../util/helpers'\n\n// Types\nimport { VNode } from 'vue'\nimport mixins from '../../util/mixins'\n\nexport default mixins(\n Colorable,\n Measurable,\n Roundable,\n /* @vue/component */\n).extend({\n name: 'v-avatar',\n\n props: {\n left: Boolean,\n right: Boolean,\n size: {\n type: [Number, String],\n default: 48,\n },\n },\n\n computed: {\n classes (): object {\n return {\n 'v-avatar--left': this.left,\n 'v-avatar--right': this.right,\n ...this.roundedClasses,\n }\n },\n styles (): object {\n return {\n height: convertToUnit(this.size),\n minWidth: convertToUnit(this.size),\n width: convertToUnit(this.size),\n ...this.measurableStyles,\n }\n },\n },\n\n render (h): VNode {\n const data = {\n staticClass: 'v-avatar',\n class: this.classes,\n style: this.styles,\n on: this.$listeners,\n }\n\n return h('div', this.setBackgroundColor(this.color, data), this.$slots.default)\n },\n})\n","import VAvatar from './VAvatar'\n\nexport { VAvatar }\nexport default VAvatar\n","// Components\nimport VAvatar from '../VAvatar'\n\n// Types\nimport { VNode } from 'vue'\n\n/* @vue/component */\nexport default VAvatar.extend({\n name: 'v-list-item-avatar',\n\n props: {\n horizontal: Boolean,\n size: {\n type: [Number, String],\n default: 40,\n },\n },\n\n computed: {\n classes (): object {\n return {\n 'v-list-item__avatar--horizontal': this.horizontal,\n ...VAvatar.options.computed.classes.call(this),\n 'v-avatar--tile': this.tile || this.horizontal,\n }\n },\n },\n\n render (h): VNode {\n const render = VAvatar.options.render.call(this, h)\n\n render.data = render.data || {}\n render.data.staticClass += ' v-list-item__avatar'\n\n return render\n },\n})\n","import { createSimpleFunctional } from '../../util/helpers'\n\nimport VList from './VList'\nimport VListGroup from './VListGroup'\nimport VListItem from './VListItem'\nimport VListItemGroup from './VListItemGroup'\nimport VListItemAction from './VListItemAction'\nimport VListItemAvatar from './VListItemAvatar'\nimport VListItemIcon from './VListItemIcon'\n\nexport const VListItemActionText = createSimpleFunctional('v-list-item__action-text', 'span')\nexport const VListItemContent = createSimpleFunctional('v-list-item__content', 'div')\nexport const VListItemTitle = createSimpleFunctional('v-list-item__title', 'div')\nexport const VListItemSubtitle = createSimpleFunctional('v-list-item__subtitle', 'div')\n\nexport {\n VList,\n VListGroup,\n VListItem,\n VListItemAction,\n VListItemAvatar,\n VListItemIcon,\n VListItemGroup,\n}\n\nexport default {\n $_vuetify_subcomponents: {\n VList,\n VListGroup,\n VListItem,\n VListItemAction,\n VListItemActionText,\n VListItemAvatar,\n VListItemContent,\n VListItemGroup,\n VListItemIcon,\n VListItemSubtitle,\n VListItemTitle,\n },\n}\n","// Styles\nimport './VMain.sass'\n\n// Mixins\nimport SSRBootable from '../../mixins/ssr-bootable'\n\n// Types\nimport { VNode } from 'vue'\n\n/* @vue/component */\nexport default SSRBootable.extend({\n name: 'v-main',\n\n props: {\n tag: {\n type: String,\n default: 'main',\n },\n },\n\n computed: {\n styles (): object {\n const {\n bar, top, right, footer, insetFooter, bottom, left,\n } = this.$vuetify.application\n\n return {\n paddingTop: `${top + bar}px`,\n paddingRight: `${right}px`,\n paddingBottom: `${footer + insetFooter + bottom}px`,\n paddingLeft: `${left}px`,\n }\n },\n },\n\n render (h): VNode {\n const data = {\n staticClass: 'v-main',\n style: this.styles,\n ref: 'main',\n }\n\n return h(this.tag, data, [\n h(\n 'div',\n { staticClass: 'v-main__wrap' },\n this.$slots.default\n ),\n ])\n },\n})\n","// Types\nimport { BreakpointName } from 'vuetify/types/services/breakpoint'\nimport { deprecate } from '../../util/console'\nimport Vue, { PropType } from 'vue'\n\n/* @vue/component */\nexport default Vue.extend({\n name: 'mobile',\n\n props: {\n mobileBreakpoint: {\n type: [Number, String] as PropType<number | BreakpointName>,\n default (): number | BreakpointName | undefined {\n // Avoid destroying unit\n // tests for users\n return this.$vuetify\n ? this.$vuetify.breakpoint.mobileBreakpoint\n : undefined\n },\n validator: v => (\n !isNaN(Number(v)) ||\n ['xs', 'sm', 'md', 'lg', 'xl'].includes(String(v))\n ),\n },\n },\n\n computed: {\n isMobile (): boolean {\n const {\n mobile,\n width,\n name,\n mobileBreakpoint,\n } = this.$vuetify.breakpoint\n\n // Check if local mobileBreakpoint matches\n // the application's mobileBreakpoint\n if (mobileBreakpoint === this.mobileBreakpoint) return mobile\n\n const mobileWidth = parseInt(this.mobileBreakpoint, 10)\n const isNumber = !isNaN(mobileWidth)\n\n return isNumber\n ? width < mobileWidth\n : name === this.mobileBreakpoint\n },\n },\n\n created () {\n /* istanbul ignore next */\n if (this.$attrs.hasOwnProperty('mobile-break-point')) {\n deprecate('mobile-break-point', 'mobile-breakpoint', this)\n }\n },\n})\n","// Styles\nimport './VNavigationDrawer.sass'\n\n// Components\nimport VImg, { srcObject } from '../VImg/VImg'\n\n// Mixins\nimport Applicationable from '../../mixins/applicationable'\nimport Colorable from '../../mixins/colorable'\nimport Dependent from '../../mixins/dependent'\nimport Mobile from '../../mixins/mobile'\nimport Overlayable from '../../mixins/overlayable'\nimport SSRBootable from '../../mixins/ssr-bootable'\nimport Themeable from '../../mixins/themeable'\n\n// Directives\nimport ClickOutside from '../../directives/click-outside'\nimport Resize from '../../directives/resize'\nimport Touch from '../../directives/touch'\n\n// Utilities\nimport { convertToUnit, getSlot } from '../../util/helpers'\nimport mixins from '../../util/mixins'\n\n// Types\nimport { VNode, VNodeDirective, PropType } from 'vue'\nimport { TouchWrapper } from 'vuetify/types'\n\nconst baseMixins = mixins(\n Applicationable('left', [\n 'isActive',\n 'isMobile',\n 'miniVariant',\n 'expandOnHover',\n 'permanent',\n 'right',\n 'temporary',\n 'width',\n ]),\n Colorable,\n Dependent,\n Mobile,\n Overlayable,\n SSRBootable,\n Themeable\n)\n\n/* @vue/component */\nexport default baseMixins.extend({\n name: 'v-navigation-drawer',\n\n directives: {\n ClickOutside,\n Resize,\n Touch,\n },\n\n provide (): object {\n return {\n isInNav: this.tag === 'nav',\n }\n },\n\n props: {\n bottom: Boolean,\n clipped: Boolean,\n disableResizeWatcher: Boolean,\n disableRouteWatcher: Boolean,\n expandOnHover: Boolean,\n floating: Boolean,\n height: {\n type: [Number, String],\n default (): string {\n return this.app ? '100vh' : '100%'\n },\n },\n miniVariant: Boolean,\n miniVariantWidth: {\n type: [Number, String],\n default: 56,\n },\n permanent: Boolean,\n right: Boolean,\n src: {\n type: [String, Object] as PropType<string | srcObject>,\n default: '',\n },\n stateless: Boolean,\n tag: {\n type: String,\n default (): string {\n return this.app ? 'nav' : 'aside'\n },\n },\n temporary: Boolean,\n touchless: Boolean,\n width: {\n type: [Number, String],\n default: 256,\n },\n value: null as unknown as PropType<any>,\n },\n\n data: () => ({\n isMouseover: false,\n touchArea: {\n left: 0,\n right: 0,\n },\n stackMinZIndex: 6,\n }),\n\n computed: {\n /**\n * Used for setting an app value from a dynamic\n * property. Called from applicationable.js\n */\n applicationProperty (): string {\n return this.right ? 'right' : 'left'\n },\n classes (): object {\n return {\n 'v-navigation-drawer': true,\n 'v-navigation-drawer--absolute': this.absolute,\n 'v-navigation-drawer--bottom': this.bottom,\n 'v-navigation-drawer--clipped': this.clipped,\n 'v-navigation-drawer--close': !this.isActive,\n 'v-navigation-drawer--fixed': !this.absolute && (this.app || this.fixed),\n 'v-navigation-drawer--floating': this.floating,\n 'v-navigation-drawer--is-mobile': this.isMobile,\n 'v-navigation-drawer--is-mouseover': this.isMouseover,\n 'v-navigation-drawer--mini-variant': this.isMiniVariant,\n 'v-navigation-drawer--custom-mini-variant': Number(this.miniVariantWidth) !== 56,\n 'v-navigation-drawer--open': this.isActive,\n 'v-navigation-drawer--open-on-hover': this.expandOnHover,\n 'v-navigation-drawer--right': this.right,\n 'v-navigation-drawer--temporary': this.temporary,\n ...this.themeClasses,\n }\n },\n computedMaxHeight (): number | null {\n if (!this.hasApp) return null\n\n const computedMaxHeight = (\n this.$vuetify.application.bottom +\n this.$vuetify.application.footer +\n this.$vuetify.application.bar\n )\n\n if (!this.clipped) return computedMaxHeight\n\n return computedMaxHeight + this.$vuetify.application.top\n },\n computedTop (): number {\n if (!this.hasApp) return 0\n\n let computedTop = this.$vuetify.application.bar\n\n computedTop += this.clipped\n ? this.$vuetify.application.top\n : 0\n\n return computedTop\n },\n computedTransform (): number {\n if (this.isActive) return 0\n if (this.isBottom) return 100\n return this.right ? 100 : -100\n },\n computedWidth (): string | number {\n return this.isMiniVariant ? this.miniVariantWidth : this.width\n },\n hasApp (): boolean {\n return (\n this.app &&\n (!this.isMobile && !this.temporary)\n )\n },\n isBottom (): boolean {\n return this.bottom && this.isMobile\n },\n isMiniVariant (): boolean {\n return (\n !this.expandOnHover &&\n this.miniVariant\n ) || (\n this.expandOnHover &&\n !this.isMouseover\n )\n },\n isMobile (): boolean {\n return (\n !this.stateless &&\n !this.permanent &&\n Mobile.options.computed.isMobile.call(this)\n )\n },\n reactsToClick (): boolean {\n return (\n !this.stateless &&\n !this.permanent &&\n (this.isMobile || this.temporary)\n )\n },\n reactsToMobile (): boolean {\n return (\n this.app &&\n !this.disableResizeWatcher &&\n !this.permanent &&\n !this.stateless &&\n !this.temporary\n )\n },\n reactsToResize (): boolean {\n return !this.disableResizeWatcher && !this.stateless\n },\n reactsToRoute (): boolean {\n return (\n !this.disableRouteWatcher &&\n !this.stateless &&\n (this.temporary || this.isMobile)\n )\n },\n showOverlay (): boolean {\n return (\n !this.hideOverlay &&\n this.isActive &&\n (this.isMobile || this.temporary)\n )\n },\n styles (): object {\n const translate = this.isBottom ? 'translateY' : 'translateX'\n return {\n height: convertToUnit(this.height),\n top: !this.isBottom ? convertToUnit(this.computedTop) : 'auto',\n maxHeight: this.computedMaxHeight != null\n ? `calc(100% - ${convertToUnit(this.computedMaxHeight)})`\n : undefined,\n transform: `${translate}(${convertToUnit(this.computedTransform, '%')})`,\n width: convertToUnit(this.computedWidth),\n }\n },\n },\n\n watch: {\n $route: 'onRouteChange',\n isActive (val) {\n this.$emit('input', val)\n },\n /**\n * When mobile changes, adjust the active state\n * only when there has been a previous value\n */\n isMobile (val, prev) {\n !val &&\n this.isActive &&\n !this.temporary &&\n this.removeOverlay()\n\n if (prev == null ||\n !this.reactsToResize ||\n !this.reactsToMobile\n ) return\n\n this.isActive = !val\n },\n permanent (val) {\n // If enabling prop enable the drawer\n if (val) this.isActive = true\n },\n showOverlay (val) {\n if (val) this.genOverlay()\n else this.removeOverlay()\n },\n value (val) {\n if (this.permanent) return\n\n if (val == null) {\n this.init()\n return\n }\n\n if (val !== this.isActive) this.isActive = val\n },\n expandOnHover: 'updateMiniVariant',\n isMouseover (val) {\n this.updateMiniVariant(!val)\n },\n },\n\n beforeMount () {\n this.init()\n },\n\n methods: {\n calculateTouchArea () {\n const parent = this.$el.parentNode as Element\n\n if (!parent) return\n\n const parentRect = parent.getBoundingClientRect()\n\n this.touchArea = {\n left: parentRect.left + 50,\n right: parentRect.right - 50,\n }\n },\n closeConditional () {\n return this.isActive && !this._isDestroyed && this.reactsToClick\n },\n genAppend () {\n return this.genPosition('append')\n },\n genBackground () {\n const props = {\n height: '100%',\n width: '100%',\n src: this.src,\n }\n\n const image = this.$scopedSlots.img\n ? this.$scopedSlots.img(props)\n : this.$createElement(VImg, { props })\n\n return this.$createElement('div', {\n staticClass: 'v-navigation-drawer__image',\n }, [image])\n },\n genDirectives (): VNodeDirective[] {\n const directives = [{\n name: 'click-outside',\n value: {\n handler: () => { this.isActive = false },\n closeConditional: this.closeConditional,\n include: this.getOpenDependentElements,\n },\n }]\n\n if (!this.touchless && !this.stateless) {\n directives.push({\n name: 'touch',\n value: {\n parent: true,\n left: this.swipeLeft,\n right: this.swipeRight,\n },\n } as any)\n }\n\n return directives\n },\n genListeners () {\n const on: Record<string, (e: Event) => void> = {\n mouseenter: () => (this.isMouseover = true),\n mouseleave: () => (this.isMouseover = false),\n transitionend: (e: Event) => {\n if (e.target !== e.currentTarget) return\n this.$emit('transitionend', e)\n\n // IE11 does not support new Event('resize')\n const resizeEvent = document.createEvent('UIEvents')\n resizeEvent.initUIEvent('resize', true, false, window, 0)\n window.dispatchEvent(resizeEvent)\n },\n }\n\n if (this.miniVariant) {\n on.click = () => this.$emit('update:mini-variant', false)\n }\n\n return on\n },\n genPosition (name: 'prepend' | 'append') {\n const slot = getSlot(this, name)\n\n if (!slot) return slot\n\n return this.$createElement('div', {\n staticClass: `v-navigation-drawer__${name}`,\n }, slot)\n },\n genPrepend () {\n return this.genPosition('prepend')\n },\n genContent () {\n return this.$createElement('div', {\n staticClass: 'v-navigation-drawer__content',\n }, this.$slots.default)\n },\n genBorder () {\n return this.$createElement('div', {\n staticClass: 'v-navigation-drawer__border',\n })\n },\n init () {\n if (this.permanent) {\n this.isActive = true\n } else if (this.stateless ||\n this.value != null\n ) {\n this.isActive = this.value\n } else if (!this.temporary) {\n this.isActive = !this.isMobile\n }\n },\n onRouteChange () {\n if (this.reactsToRoute && this.closeConditional()) {\n this.isActive = false\n }\n },\n swipeLeft (e: TouchWrapper) {\n if (this.isActive && this.right) return\n this.calculateTouchArea()\n\n if (Math.abs(e.touchendX - e.touchstartX) < 100) return\n if (this.right &&\n e.touchstartX >= this.touchArea.right\n ) this.isActive = true\n else if (!this.right && this.isActive) this.isActive = false\n },\n swipeRight (e: TouchWrapper) {\n if (this.isActive && !this.right) return\n this.calculateTouchArea()\n\n if (Math.abs(e.touchendX - e.touchstartX) < 100) return\n if (!this.right &&\n e.touchstartX <= this.touchArea.left\n ) this.isActive = true\n else if (this.right && this.isActive) this.isActive = false\n },\n /**\n * Update the application layout\n */\n updateApplication () {\n if (\n !this.isActive ||\n this.isMobile ||\n this.temporary ||\n !this.$el\n ) return 0\n\n const width = Number(this.miniVariant ? this.miniVariantWidth : this.width)\n\n return isNaN(width) ? this.$el.clientWidth : width\n },\n updateMiniVariant (val: boolean) {\n if (this.expandOnHover && this.miniVariant !== val) this.$emit('update:mini-variant', val)\n },\n },\n\n render (h): VNode {\n const children = [\n this.genPrepend(),\n this.genContent(),\n this.genAppend(),\n this.genBorder(),\n ]\n\n if (this.src || getSlot(this, 'img')) children.unshift(this.genBackground())\n\n return h(this.tag, this.setBackgroundColor(this.color, {\n class: this.classes,\n style: this.styles,\n directives: this.genDirectives(),\n on: this.genListeners(),\n }), children)\n },\n})\n","import Vue from 'vue'\n\nexport default Vue.extend({\n name: 'translatable',\n\n props: {\n height: Number,\n },\n\n data: () => ({\n elOffsetTop: 0,\n parallax: 0,\n parallaxDist: 0,\n percentScrolled: 0,\n scrollTop: 0,\n windowHeight: 0,\n windowBottom: 0,\n }),\n\n computed: {\n imgHeight (): number {\n return this.objHeight()\n },\n },\n\n beforeDestroy () {\n window.removeEventListener('scroll', this.translate, false)\n window.removeEventListener('resize', this.translate, false)\n },\n\n methods: {\n calcDimensions () {\n const offset = this.$el.getBoundingClientRect()\n\n this.scrollTop = window.pageYOffset\n this.parallaxDist = this.imgHeight - this.height\n this.elOffsetTop = offset.top + this.scrollTop\n this.windowHeight = window.innerHeight\n this.windowBottom = this.scrollTop + this.windowHeight\n },\n listeners () {\n window.addEventListener('scroll', this.translate, false)\n window.addEventListener('resize', this.translate, false)\n },\n /** @abstract **/\n objHeight (): number {\n throw new Error('Not implemented !')\n },\n translate () {\n this.calcDimensions()\n\n this.percentScrolled = (\n (this.windowBottom - this.elOffsetTop) /\n (parseInt(this.height) + this.windowHeight)\n )\n\n this.parallax = Math.round(this.parallaxDist * this.percentScrolled)\n },\n },\n})\n","// Style\nimport './VParallax.sass'\n\n// Mixins\nimport Translatable from '../../mixins/translatable'\n\n// Types\nimport { VNode, VNodeData } from 'vue/types/vnode'\nimport mixins from '../../util/mixins'\n\nconst baseMixins = mixins(\n Translatable\n)\ninterface options extends InstanceType<typeof baseMixins> {\n $refs: {\n img: HTMLImageElement\n }\n}\n\n/* @vue/component */\nexport default baseMixins.extend<options>().extend({\n name: 'v-parallax',\n\n props: {\n alt: {\n type: String,\n default: '',\n },\n height: {\n type: [String, Number],\n default: 500,\n },\n src: String,\n srcset: String,\n },\n\n data: () => ({\n isBooted: false,\n }),\n\n computed: {\n styles (): object {\n return {\n display: 'block',\n opacity: this.isBooted ? 1 : 0,\n transform: `translate(-50%, ${this.parallax}px)`,\n }\n },\n },\n\n mounted () {\n this.init()\n },\n\n methods: {\n init () {\n const img = this.$refs.img\n\n if (!img) return\n\n if (img.complete) {\n this.translate()\n this.listeners()\n } else {\n img.addEventListener('load', () => {\n this.translate()\n this.listeners()\n }, false)\n }\n\n this.isBooted = true\n },\n objHeight () {\n return this.$refs.img.naturalHeight\n },\n },\n\n render (h): VNode {\n const imgData: VNodeData = {\n staticClass: 'v-parallax__image',\n style: this.styles,\n attrs: {\n src: this.src,\n srcset: this.srcset,\n alt: this.alt,\n },\n ref: 'img',\n }\n\n const container = h('div', {\n staticClass: 'v-parallax__image-container',\n }, [\n h('img', imgData),\n ])\n\n const content = h('div', {\n staticClass: 'v-parallax__content',\n }, this.$slots.default)\n\n return h('div', {\n staticClass: 'v-parallax',\n style: {\n height: `${this.height}px`,\n },\n on: this.$listeners,\n }, [container, content])\n },\n})\n","// Styles\nimport './VProgressCircular.sass'\n\n// Directives\nimport intersect from '../../directives/intersect'\n\n// Mixins\nimport Colorable from '../../mixins/colorable'\n\n// Utils\nimport { convertToUnit } from '../../util/helpers'\n\n// Types\nimport { VNode, VNodeChildren } from 'vue'\n\n/* @vue/component */\nexport default Colorable.extend({\n name: 'v-progress-circular',\n\n directives: { intersect },\n\n props: {\n button: Boolean,\n indeterminate: Boolean,\n rotate: {\n type: [Number, String],\n default: 0,\n },\n size: {\n type: [Number, String],\n default: 32,\n },\n width: {\n type: [Number, String],\n default: 4,\n },\n value: {\n type: [Number, String],\n default: 0,\n },\n },\n\n data: () => ({\n radius: 20,\n isVisible: true,\n }),\n\n computed: {\n calculatedSize (): number {\n return Number(this.size) + (this.button ? 8 : 0)\n },\n\n circumference (): number {\n return 2 * Math.PI * this.radius\n },\n\n classes (): object {\n return {\n 'v-progress-circular--visible': this.isVisible,\n 'v-progress-circular--indeterminate': this.indeterminate,\n 'v-progress-circular--button': this.button,\n }\n },\n\n normalizedValue (): number {\n if (this.value < 0) {\n return 0\n }\n\n if (this.value > 100) {\n return 100\n }\n\n return parseFloat(this.value)\n },\n\n strokeDashArray (): number {\n return Math.round(this.circumference * 1000) / 1000\n },\n\n strokeDashOffset (): string {\n return ((100 - this.normalizedValue) / 100) * this.circumference + 'px'\n },\n\n strokeWidth (): number {\n return Number(this.width) / +this.size * this.viewBoxSize * 2\n },\n\n styles (): object {\n return {\n height: convertToUnit(this.calculatedSize),\n width: convertToUnit(this.calculatedSize),\n }\n },\n\n svgStyles (): object {\n return {\n transform: `rotate(${Number(this.rotate)}deg)`,\n }\n },\n\n viewBoxSize (): number {\n return this.radius / (1 - Number(this.width) / +this.size)\n },\n },\n\n methods: {\n genCircle (name: string, offset: string | number): VNode {\n return this.$createElement('circle', {\n class: `v-progress-circular__${name}`,\n attrs: {\n fill: 'transparent',\n cx: 2 * this.viewBoxSize,\n cy: 2 * this.viewBoxSize,\n r: this.radius,\n 'stroke-width': this.strokeWidth,\n 'stroke-dasharray': this.strokeDashArray,\n 'stroke-dashoffset': offset,\n },\n })\n },\n genSvg (): VNode {\n const children = [\n this.indeterminate || this.genCircle('underlay', 0),\n this.genCircle('overlay', this.strokeDashOffset),\n ] as VNodeChildren\n\n return this.$createElement('svg', {\n style: this.svgStyles,\n attrs: {\n xmlns: 'http://www.w3.org/2000/svg',\n viewBox: `${this.viewBoxSize} ${this.viewBoxSize} ${2 * this.viewBoxSize} ${2 * this.viewBoxSize}`,\n },\n }, children)\n },\n genInfo (): VNode {\n return this.$createElement('div', {\n staticClass: 'v-progress-circular__info',\n }, this.$slots.default)\n },\n onObserve (entries: IntersectionObserverEntry[], observer: IntersectionObserver, isIntersecting: boolean) {\n this.isVisible = isIntersecting\n },\n },\n\n render (h): VNode {\n return h('div', this.setTextColor(this.color, {\n staticClass: 'v-progress-circular',\n attrs: {\n role: 'progressbar',\n 'aria-valuemin': 0,\n 'aria-valuemax': 100,\n 'aria-valuenow': this.indeterminate ? undefined : this.normalizedValue,\n },\n class: this.classes,\n directives: [{\n name: 'intersect',\n value: this.onObserve,\n }],\n style: this.styles,\n on: this.$listeners,\n }), [\n this.genSvg(),\n this.genInfo(),\n ])\n },\n})\n","import './VProgressLinear.sass'\n\n// Components\nimport {\n VFadeTransition,\n VSlideXTransition,\n} from '../transitions'\n\n// Directives\nimport intersect from '../../directives/intersect'\n\n// Mixins\nimport Colorable from '../../mixins/colorable'\nimport { factory as PositionableFactory } from '../../mixins/positionable'\nimport Proxyable from '../../mixins/proxyable'\nimport Themeable from '../../mixins/themeable'\n\n// Utilities\nimport { convertToUnit, getSlot } from '../../util/helpers'\nimport mixins from '../../util/mixins'\n\n// Types\nimport { FunctionalComponentOptions } from 'vue/types'\nimport { VNode } from 'vue'\n\nconst baseMixins = mixins(\n Colorable,\n PositionableFactory(['absolute', 'fixed', 'top', 'bottom']),\n Proxyable,\n Themeable\n)\n\n/* @vue/component */\nexport default baseMixins.extend({\n name: 'v-progress-linear',\n\n directives: { intersect },\n\n props: {\n active: {\n type: Boolean,\n default: true,\n },\n backgroundColor: {\n type: String,\n default: null,\n },\n backgroundOpacity: {\n type: [Number, String],\n default: null,\n },\n bufferValue: {\n type: [Number, String],\n default: 100,\n },\n color: {\n type: String,\n default: 'primary',\n },\n height: {\n type: [Number, String],\n default: 4,\n },\n indeterminate: Boolean,\n query: Boolean,\n reverse: Boolean,\n rounded: Boolean,\n stream: Boolean,\n striped: Boolean,\n value: {\n type: [Number, String],\n default: 0,\n },\n },\n\n data () {\n return {\n internalLazyValue: this.value || 0,\n isVisible: true,\n }\n },\n\n computed: {\n __cachedBackground (): VNode {\n return this.$createElement('div', this.setBackgroundColor(this.backgroundColor || this.color, {\n staticClass: 'v-progress-linear__background',\n style: this.backgroundStyle,\n }))\n },\n __cachedBar (): VNode {\n return this.$createElement(this.computedTransition, [this.__cachedBarType])\n },\n __cachedBarType (): VNode {\n return this.indeterminate ? this.__cachedIndeterminate : this.__cachedDeterminate\n },\n __cachedBuffer (): VNode {\n return this.$createElement('div', {\n staticClass: 'v-progress-linear__buffer',\n style: this.styles,\n })\n },\n __cachedDeterminate (): VNode {\n return this.$createElement('div', this.setBackgroundColor(this.color, {\n staticClass: `v-progress-linear__determinate`,\n style: {\n width: convertToUnit(this.normalizedValue, '%'),\n },\n }))\n },\n __cachedIndeterminate (): VNode {\n return this.$createElement('div', {\n staticClass: 'v-progress-linear__indeterminate',\n class: {\n 'v-progress-linear__indeterminate--active': this.active,\n },\n }, [\n this.genProgressBar('long'),\n this.genProgressBar('short'),\n ])\n },\n __cachedStream (): VNode | null {\n if (!this.stream) return null\n\n return this.$createElement('div', this.setTextColor(this.color, {\n staticClass: 'v-progress-linear__stream',\n style: {\n width: convertToUnit(100 - this.normalizedBuffer, '%'),\n },\n }))\n },\n backgroundStyle (): object {\n const backgroundOpacity = this.backgroundOpacity == null\n ? (this.backgroundColor ? 1 : 0.3)\n : parseFloat(this.backgroundOpacity)\n\n return {\n opacity: backgroundOpacity,\n [this.isReversed ? 'right' : 'left']: convertToUnit(this.normalizedValue, '%'),\n width: convertToUnit(Math.max(0, this.normalizedBuffer - this.normalizedValue), '%'),\n }\n },\n classes (): object {\n return {\n 'v-progress-linear--absolute': this.absolute,\n 'v-progress-linear--fixed': this.fixed,\n 'v-progress-linear--query': this.query,\n 'v-progress-linear--reactive': this.reactive,\n 'v-progress-linear--reverse': this.isReversed,\n 'v-progress-linear--rounded': this.rounded,\n 'v-progress-linear--striped': this.striped,\n 'v-progress-linear--visible': this.isVisible,\n ...this.themeClasses,\n }\n },\n computedTransition (): FunctionalComponentOptions {\n return this.indeterminate ? VFadeTransition : VSlideXTransition\n },\n isReversed (): boolean {\n return this.$vuetify.rtl !== this.reverse\n },\n normalizedBuffer (): number {\n return this.normalize(this.bufferValue)\n },\n normalizedValue (): number {\n return this.normalize(this.internalLazyValue)\n },\n reactive (): boolean {\n return Boolean(this.$listeners.change)\n },\n styles (): object {\n const styles: Record<string, any> = {}\n\n if (!this.active) {\n styles.height = 0\n }\n\n if (!this.indeterminate && parseFloat(this.normalizedBuffer) !== 100) {\n styles.width = convertToUnit(this.normalizedBuffer, '%')\n }\n\n return styles\n },\n },\n\n methods: {\n genContent () {\n const slot = getSlot(this, 'default', { value: this.internalLazyValue })\n\n if (!slot) return null\n\n return this.$createElement('div', {\n staticClass: 'v-progress-linear__content',\n }, slot)\n },\n genListeners () {\n const listeners = this.$listeners\n\n if (this.reactive) {\n listeners.click = this.onClick\n }\n\n return listeners\n },\n genProgressBar (name: 'long' | 'short') {\n return this.$createElement('div', this.setBackgroundColor(this.color, {\n staticClass: 'v-progress-linear__indeterminate',\n class: {\n [name]: true,\n },\n }))\n },\n onClick (e: MouseEvent) {\n if (!this.reactive) return\n\n const { width } = this.$el.getBoundingClientRect()\n\n this.internalValue = e.offsetX / width * 100\n },\n onObserve (entries: IntersectionObserverEntry[], observer: IntersectionObserver, isIntersecting: boolean) {\n this.isVisible = isIntersecting\n },\n normalize (value: string | number) {\n if (value < 0) return 0\n if (value > 100) return 100\n return parseFloat(value)\n },\n },\n\n render (h): VNode {\n const data = {\n staticClass: 'v-progress-linear',\n attrs: {\n role: 'progressbar',\n 'aria-valuemin': 0,\n 'aria-valuemax': this.normalizedBuffer,\n 'aria-valuenow': this.indeterminate ? undefined : this.normalizedValue,\n },\n class: this.classes,\n directives: [{\n name: 'intersect',\n value: this.onObserve,\n }],\n style: {\n bottom: this.bottom ? 0 : undefined,\n height: this.active ? convertToUnit(this.height) : 0,\n top: this.top ? 0 : undefined,\n },\n on: this.genListeners(),\n }\n\n return h('div', data, [\n this.__cachedStream,\n this.__cachedBackground,\n this.__cachedBuffer,\n this.__cachedBar,\n this.genContent(),\n ])\n },\n})\n","import VProgressLinear from './VProgressLinear'\n\nexport { VProgressLinear }\nexport default VProgressLinear\n","// Styles\nimport './VSheet.sass'\n\n// Mixins\nimport BindsAttrs from '../../mixins/binds-attrs'\nimport Colorable from '../../mixins/colorable'\nimport Elevatable from '../../mixins/elevatable'\nimport Measurable from '../../mixins/measurable'\nimport Roundable from '../../mixins/roundable'\nimport Themeable from '../../mixins/themeable'\n\n// Helpers\nimport mixins from '../../util/mixins'\n\n// Types\nimport { VNode } from 'vue'\n\n/* @vue/component */\nexport default mixins(\n BindsAttrs,\n Colorable,\n Elevatable,\n Measurable,\n Roundable,\n Themeable\n).extend({\n name: 'v-sheet',\n\n props: {\n outlined: Boolean,\n shaped: Boolean,\n tag: {\n type: String,\n default: 'div',\n },\n },\n\n computed: {\n classes (): object {\n return {\n 'v-sheet': true,\n 'v-sheet--outlined': this.outlined,\n 'v-sheet--shaped': this.shaped,\n ...this.themeClasses,\n ...this.elevationClasses,\n ...this.roundedClasses,\n }\n },\n styles (): object {\n return this.measurableStyles\n },\n },\n\n render (h): VNode {\n const data = {\n class: this.classes,\n style: this.styles,\n on: this.listeners$,\n }\n\n return h(\n this.tag,\n this.setBackgroundColor(this.color, data),\n this.$slots.default\n )\n },\n})\n","import VSheet from './VSheet'\n\nexport { VSheet }\nexport default VSheet\n","// Styles\nimport './VToolbar.sass'\n\n// Extensions\nimport VSheet from '../VSheet/VSheet'\n\n// Components\nimport VImg, { srcObject } from '../VImg/VImg'\n\n// Utilities\nimport { convertToUnit, getSlot } from '../../util/helpers'\nimport { breaking } from '../../util/console'\n\n// Types\nimport { VNode, PropType } from 'vue'\n\n/* @vue/component */\nexport default VSheet.extend({\n name: 'v-toolbar',\n\n props: {\n absolute: Boolean,\n bottom: Boolean,\n collapse: Boolean,\n dense: Boolean,\n extended: Boolean,\n extensionHeight: {\n default: 48,\n type: [Number, String],\n },\n flat: Boolean,\n floating: Boolean,\n prominent: Boolean,\n short: Boolean,\n src: {\n type: [String, Object] as PropType<string | srcObject>,\n default: '',\n },\n tag: {\n type: String,\n default: 'header',\n },\n },\n\n data: () => ({\n isExtended: false,\n }),\n\n computed: {\n computedHeight (): number {\n const height = this.computedContentHeight\n\n if (!this.isExtended) return height\n\n const extensionHeight = parseInt(this.extensionHeight)\n\n return this.isCollapsed\n ? height\n : height + (!isNaN(extensionHeight) ? extensionHeight : 0)\n },\n computedContentHeight (): number {\n if (this.height) return parseInt(this.height)\n if (this.isProminent && this.dense) return 96\n if (this.isProminent && this.short) return 112\n if (this.isProminent) return 128\n if (this.dense) return 48\n if (this.short || this.$vuetify.breakpoint.smAndDown) return 56\n return 64\n },\n classes (): object {\n return {\n ...VSheet.options.computed.classes.call(this),\n 'v-toolbar': true,\n 'v-toolbar--absolute': this.absolute,\n 'v-toolbar--bottom': this.bottom,\n 'v-toolbar--collapse': this.collapse,\n 'v-toolbar--collapsed': this.isCollapsed,\n 'v-toolbar--dense': this.dense,\n 'v-toolbar--extended': this.isExtended,\n 'v-toolbar--flat': this.flat,\n 'v-toolbar--floating': this.floating,\n 'v-toolbar--prominent': this.isProminent,\n }\n },\n isCollapsed (): boolean {\n return this.collapse\n },\n isProminent (): boolean {\n return this.prominent\n },\n styles (): object {\n return {\n ...this.measurableStyles,\n height: convertToUnit(this.computedHeight),\n }\n },\n },\n\n created () {\n const breakingProps = [\n ['app', '<v-app-bar app>'],\n ['manual-scroll', '<v-app-bar :value=\"false\">'],\n ['clipped-left', '<v-app-bar clipped-left>'],\n ['clipped-right', '<v-app-bar clipped-right>'],\n ['inverted-scroll', '<v-app-bar inverted-scroll>'],\n ['scroll-off-screen', '<v-app-bar scroll-off-screen>'],\n ['scroll-target', '<v-app-bar scroll-target>'],\n ['scroll-threshold', '<v-app-bar scroll-threshold>'],\n ['card', '<v-app-bar flat>'],\n ]\n\n /* istanbul ignore next */\n breakingProps.forEach(([original, replacement]) => {\n if (this.$attrs.hasOwnProperty(original)) breaking(original, replacement, this)\n })\n },\n\n methods: {\n genBackground () {\n const props = {\n height: convertToUnit(this.computedHeight),\n src: this.src,\n }\n\n const image = this.$scopedSlots.img\n ? this.$scopedSlots.img({ props })\n : this.$createElement(VImg, { props })\n\n return this.$createElement('div', {\n staticClass: 'v-toolbar__image',\n }, [image])\n },\n genContent () {\n return this.$createElement('div', {\n staticClass: 'v-toolbar__content',\n style: {\n height: convertToUnit(this.computedContentHeight),\n },\n }, getSlot(this))\n },\n genExtension () {\n return this.$createElement('div', {\n staticClass: 'v-toolbar__extension',\n style: {\n height: convertToUnit(this.extensionHeight),\n },\n }, getSlot(this, 'extension'))\n },\n },\n\n render (h): VNode {\n this.isExtended = this.extended || !!this.$scopedSlots.extension\n\n const children = [this.genContent()]\n const data = this.setBackgroundColor(this.color, {\n class: this.classes,\n style: this.styles,\n on: this.$listeners,\n })\n\n if (this.isExtended) children.push(this.genExtension())\n if (this.src || this.$scopedSlots.img) children.unshift(this.genBackground())\n\n return h(this.tag, data, children)\n },\n})\n","// Components\nimport VToolbar from './VToolbar'\n\n// Utilities\nimport { createSimpleFunctional } from '../../util/helpers'\n\nconst VToolbarTitle = createSimpleFunctional('v-toolbar__title')\nconst VToolbarItems = createSimpleFunctional('v-toolbar__items')\n\nexport {\n VToolbar,\n VToolbarItems,\n VToolbarTitle,\n}\n\nexport default {\n $_vuetify_subcomponents: {\n VToolbar,\n VToolbarItems,\n VToolbarTitle,\n },\n}\n","import { FunctionalComponentOptions, VNode, VNodeData } from 'vue'\nimport mergeData from '../../util/mergeData'\n\nfunction mergeTransitions (\n dest: Function | Function[] = [],\n ...transitions: (Function | Function[])[]\n) {\n /* eslint-disable-next-line no-array-constructor */\n return Array<Function>().concat(dest, ...transitions)\n}\n\nexport function createSimpleTransition (\n name: string,\n origin = 'top center 0',\n mode?: string\n): FunctionalComponentOptions {\n return {\n name,\n\n functional: true,\n\n props: {\n group: {\n type: Boolean,\n default: false,\n },\n hideOnLeave: {\n type: Boolean,\n default: false,\n },\n leaveAbsolute: {\n type: Boolean,\n default: false,\n },\n mode: {\n type: String,\n default: mode,\n },\n origin: {\n type: String,\n default: origin,\n },\n },\n\n render (h, context): VNode {\n const tag = `transition${context.props.group ? '-group' : ''}`\n const data: VNodeData = {\n props: {\n name,\n mode: context.props.mode,\n },\n on: {\n beforeEnter (el: HTMLElement) {\n el.style.transformOrigin = context.props.origin\n el.style.webkitTransformOrigin = context.props.origin\n },\n },\n }\n\n if (context.props.leaveAbsolute) {\n data.on!.leave = mergeTransitions(data.on!.leave, (el: HTMLElement) => {\n const { offsetTop, offsetLeft, offsetWidth, offsetHeight } = el\n el._transitionInitialStyles = {\n position: el.style.position,\n top: el.style.top,\n left: el.style.left,\n width: el.style.width,\n height: el.style.height,\n }\n el.style.position = 'absolute'\n el.style.top = offsetTop + 'px'\n el.style.left = offsetLeft + 'px'\n el.style.width = offsetWidth + 'px'\n el.style.height = offsetHeight + 'px'\n })\n data.on!.afterLeave = mergeTransitions(data.on!.afterLeave, (el?: HTMLElement) => {\n if (el && el._transitionInitialStyles) {\n const { position, top, left, width, height } = el._transitionInitialStyles\n delete el._transitionInitialStyles\n el.style.position = position || ''\n el.style.top = top || ''\n el.style.left = left || ''\n el.style.width = width || ''\n el.style.height = height || ''\n }\n })\n }\n if (context.props.hideOnLeave) {\n data.on!.leave = mergeTransitions(data.on!.leave, (el: HTMLElement) => {\n el.style.setProperty('display', 'none', 'important')\n })\n }\n\n return h(tag, mergeData(context.data, data), context.children)\n },\n }\n}\n\nexport function createJavascriptTransition (\n name: string,\n functions: Record<string, any>,\n mode = 'in-out'\n): FunctionalComponentOptions {\n return {\n name,\n\n functional: true,\n\n props: {\n mode: {\n type: String,\n default: mode,\n },\n },\n\n render (h, context): VNode {\n return h(\n 'transition',\n mergeData(context.data, {\n props: { name },\n on: functions,\n }),\n context.children\n )\n },\n }\n}\n","import { upperFirst } from '../../util/helpers'\n\ninterface HTMLExpandElement extends HTMLElement {\n _parent?: (Node & ParentNode & HTMLElement) | null\n _initialStyle?: {\n transition: string\n overflow: string\n height?: string | null\n width?: string | null\n }\n}\n\nexport default function (expandedParentClass = '', x = false) {\n const sizeProperty = x ? 'width' : 'height' as 'width' | 'height'\n const offsetProperty = `offset${upperFirst(sizeProperty)}` as 'offsetHeight' | 'offsetWidth'\n\n return {\n beforeEnter (el: HTMLExpandElement) {\n el._parent = el.parentNode as (Node & ParentNode & HTMLElement) | null\n el._initialStyle = {\n transition: el.style.transition,\n overflow: el.style.overflow,\n [sizeProperty]: el.style[sizeProperty],\n }\n },\n\n enter (el: HTMLExpandElement) {\n const initialStyle = el._initialStyle!\n\n el.style.setProperty('transition', 'none', 'important')\n // Hide overflow to account for collapsed margins in the calculated height\n el.style.overflow = 'hidden'\n const offset = `${el[offsetProperty]}px`\n\n el.style[sizeProperty] = '0'\n\n void el.offsetHeight // force reflow\n\n el.style.transition = initialStyle.transition\n\n if (expandedParentClass && el._parent) {\n el._parent.classList.add(expandedParentClass)\n }\n\n requestAnimationFrame(() => {\n el.style[sizeProperty] = offset\n })\n },\n\n afterEnter: resetStyles,\n enterCancelled: resetStyles,\n\n leave (el: HTMLExpandElement) {\n el._initialStyle = {\n transition: '',\n overflow: el.style.overflow,\n [sizeProperty]: el.style[sizeProperty],\n }\n\n el.style.overflow = 'hidden'\n el.style[sizeProperty] = `${el[offsetProperty]}px`\n void el.offsetHeight // force reflow\n\n requestAnimationFrame(() => (el.style[sizeProperty] = '0'))\n },\n\n afterLeave,\n leaveCancelled: afterLeave,\n }\n\n function afterLeave (el: HTMLExpandElement) {\n if (expandedParentClass && el._parent) {\n el._parent.classList.remove(expandedParentClass)\n }\n resetStyles(el)\n }\n\n function resetStyles (el: HTMLExpandElement) {\n const size = el._initialStyle![sizeProperty]\n el.style.overflow = el._initialStyle!.overflow\n if (size != null) el.style[sizeProperty] = size\n delete el._initialStyle\n }\n}\n","import {\n createSimpleTransition,\n createJavascriptTransition,\n} from './createTransition'\n\nimport ExpandTransitionGenerator from './expand-transition'\n\n// Component specific transitions\nexport const VCarouselTransition = createSimpleTransition('carousel-transition')\nexport const VCarouselReverseTransition = createSimpleTransition('carousel-reverse-transition')\nexport const VTabTransition = createSimpleTransition('tab-transition')\nexport const VTabReverseTransition = createSimpleTransition('tab-reverse-transition')\nexport const VMenuTransition = createSimpleTransition('menu-transition')\nexport const VFabTransition = createSimpleTransition('fab-transition', 'center center', 'out-in')\n\n// Generic transitions\nexport const VDialogTransition = createSimpleTransition('dialog-transition')\nexport const VDialogBottomTransition = createSimpleTransition('dialog-bottom-transition')\nexport const VDialogTopTransition = createSimpleTransition('dialog-top-transition')\nexport const VFadeTransition = createSimpleTransition('fade-transition')\nexport const VScaleTransition = createSimpleTransition('scale-transition')\nexport const VScrollXTransition = createSimpleTransition('scroll-x-transition')\nexport const VScrollXReverseTransition = createSimpleTransition('scroll-x-reverse-transition')\nexport const VScrollYTransition = createSimpleTransition('scroll-y-transition')\nexport const VScrollYReverseTransition = createSimpleTransition('scroll-y-reverse-transition')\nexport const VSlideXTransition = createSimpleTransition('slide-x-transition')\nexport const VSlideXReverseTransition = createSimpleTransition('slide-x-reverse-transition')\nexport const VSlideYTransition = createSimpleTransition('slide-y-transition')\nexport const VSlideYReverseTransition = createSimpleTransition('slide-y-reverse-transition')\n\n// Javascript transitions\nexport const VExpandTransition = createJavascriptTransition('expand-transition', ExpandTransitionGenerator())\nexport const VExpandXTransition = createJavascriptTransition('expand-x-transition', ExpandTransitionGenerator('', true))\n\nexport default {\n $_vuetify_subcomponents: {\n VCarouselTransition,\n VCarouselReverseTransition,\n VDialogTransition,\n VDialogBottomTransition,\n VDialogTopTransition,\n VFabTransition,\n VFadeTransition,\n VMenuTransition,\n VScaleTransition,\n VScrollXTransition,\n VScrollXReverseTransition,\n VScrollYTransition,\n VScrollYReverseTransition,\n VSlideXTransition,\n VSlideXReverseTransition,\n VSlideYTransition,\n VSlideYReverseTransition,\n VTabReverseTransition,\n VTabTransition,\n VExpandTransition,\n VExpandXTransition,\n },\n}\n","import { attachedRoot } from '../../util/dom'\nimport { VNodeDirective } from 'vue/types/vnode'\nimport { VNode } from 'vue'\n\ninterface ClickOutsideBindingArgs {\n handler: (e: Event) => void\n closeConditional?: (e: Event) => boolean\n include?: () => HTMLElement[]\n}\n\ninterface ClickOutsideDirective extends VNodeDirective {\n value?: ((e: Event) => void) | ClickOutsideBindingArgs\n}\n\nfunction defaultConditional () {\n return true\n}\n\nfunction checkEvent (e: PointerEvent, el: HTMLElement, binding: ClickOutsideDirective): boolean {\n // The include element callbacks below can be expensive\n // so we should avoid calling them when we're not active.\n // Explicitly check for false to allow fallback compatibility\n // with non-toggleable components\n if (!e || checkIsActive(e, binding) === false) return false\n\n // If we're clicking inside the shadowroot, then the app root doesn't get the same\n // level of introspection as to _what_ we're clicking. We want to check to see if\n // our target is the shadowroot parent container, and if it is, ignore.\n const root = attachedRoot(el)\n if (\n typeof ShadowRoot !== 'undefined' &&\n root instanceof ShadowRoot &&\n root.host === e.target\n ) return false\n\n // Check if additional elements were passed to be included in check\n // (click must be outside all included elements, if any)\n const elements = ((typeof binding.value === 'object' && binding.value.include) || (() => []))()\n // Add the root element for the component this directive was defined on\n elements.push(el)\n\n // Check if it's a click outside our elements, and then if our callback returns true.\n // Non-toggleable components should take action in their callback and return falsy.\n // Toggleable can return true if it wants to deactivate.\n // Note that, because we're in the capture phase, this callback will occur before\n // the bubbling click event on any outside elements.\n return !elements.some(el => el.contains(e.target as Node))\n}\n\nfunction checkIsActive (e: PointerEvent, binding: ClickOutsideDirective): boolean | void {\n const isActive = (typeof binding.value === 'object' && binding.value.closeConditional) || defaultConditional\n\n return isActive(e)\n}\n\nfunction directive (e: PointerEvent, el: HTMLElement, binding: ClickOutsideDirective, vnode: VNode) {\n const handler = typeof binding.value === 'function' ? binding.value : binding.value!.handler\n\n el._clickOutside!.lastMousedownWasOutside && checkEvent(e, el, binding) && setTimeout(() => {\n checkIsActive(e, binding) && handler && handler(e)\n }, 0)\n}\n\nfunction handleShadow (el: HTMLElement, callback: Function): void {\n const root = attachedRoot(el)\n\n callback(document)\n\n if (typeof ShadowRoot !== 'undefined' && root instanceof ShadowRoot) {\n callback(root)\n }\n}\n\nexport const ClickOutside = {\n // [data-app] may not be found\n // if using bind, inserted makes\n // sure that the root element is\n // available, iOS does not support\n // clicks on body\n inserted (el: HTMLElement, binding: ClickOutsideDirective, vnode: VNode) {\n const onClick = (e: Event) => directive(e as PointerEvent, el, binding, vnode)\n const onMousedown = (e: Event) => {\n el._clickOutside!.lastMousedownWasOutside = checkEvent(e as PointerEvent, el, binding)\n }\n\n handleShadow(el, (app: HTMLElement) => {\n app.addEventListener('click', onClick, true)\n app.addEventListener('mousedown', onMousedown, true)\n })\n\n if (!el._clickOutside) {\n el._clickOutside = {\n lastMousedownWasOutside: true,\n }\n }\n\n el._clickOutside[vnode.context!._uid] = {\n onClick,\n onMousedown,\n }\n },\n\n unbind (el: HTMLElement, binding: ClickOutsideDirective, vnode: VNode) {\n if (!el._clickOutside) return\n\n handleShadow(el, (app: HTMLElement) => {\n if (!app || !el._clickOutside?.[vnode.context!._uid]) return\n\n const { onClick, onMousedown } = el._clickOutside[vnode.context!._uid]!\n\n app.removeEventListener('click', onClick, true)\n app.removeEventListener('mousedown', onMousedown, true)\n })\n\n delete el._clickOutside[vnode.context!._uid]\n },\n}\n\nexport default ClickOutside\n","import { VNodeDirective } from 'vue/types/vnode'\nimport { VNode } from 'vue'\n\ntype ObserveHandler = (\n entries: IntersectionObserverEntry[],\n observer: IntersectionObserver,\n isIntersecting: boolean,\n) => void\n\ninterface ObserveVNodeDirective extends Omit<VNodeDirective, 'modifiers'> {\n value?: ObserveHandler | { handler: ObserveHandler, options?: IntersectionObserverInit }\n modifiers?: {\n once?: boolean\n quiet?: boolean\n }\n}\n\nfunction inserted (el: HTMLElement, binding: ObserveVNodeDirective, vnode: VNode) {\n if (typeof window === 'undefined' || !('IntersectionObserver' in window)) return\n\n const modifiers = binding.modifiers || {}\n const value = binding.value\n const { handler, options } = typeof value === 'object'\n ? value\n : { handler: value, options: {} }\n const observer = new IntersectionObserver((\n entries: IntersectionObserverEntry[] = [],\n observer: IntersectionObserver\n ) => {\n const _observe = el._observe?.[vnode.context!._uid]\n if (!_observe) return // Just in case, should never fire\n\n const isIntersecting = entries.some(entry => entry.isIntersecting)\n\n // If is not quiet or has already been\n // initted, invoke the user callback\n if (\n handler && (\n !modifiers.quiet ||\n _observe.init\n ) && (\n !modifiers.once ||\n isIntersecting ||\n _observe.init\n )\n ) {\n handler(entries, observer, isIntersecting)\n }\n\n if (isIntersecting && modifiers.once) unbind(el, binding, vnode)\n else _observe.init = true\n }, options)\n\n el._observe = Object(el._observe)\n el._observe![vnode.context!._uid] = { init: false, observer }\n\n observer.observe(el)\n}\n\nfunction unbind (el: HTMLElement, binding: ObserveVNodeDirective, vnode: VNode) {\n const observe = el._observe?.[vnode.context!._uid]\n if (!observe) return\n\n observe.observer.unobserve(el)\n delete el._observe![vnode.context!._uid]\n}\n\nexport const Intersect = {\n inserted,\n unbind,\n}\n\nexport default Intersect\n","import { VNodeDirective } from 'vue/types/vnode'\nimport { VNode } from 'vue'\n\ninterface ResizeVNodeDirective extends VNodeDirective {\n value?: () => void\n options?: boolean | AddEventListenerOptions\n}\n\nfunction inserted (el: HTMLElement, binding: ResizeVNodeDirective, vnode: VNode) {\n const callback = binding.value!\n const options = binding.options || { passive: true }\n\n window.addEventListener('resize', callback, options)\n\n el._onResize = Object(el._onResize)\n el._onResize![vnode.context!._uid] = {\n callback,\n options,\n }\n\n if (!binding.modifiers || !binding.modifiers.quiet) {\n callback()\n }\n}\n\nfunction unbind (el: HTMLElement, binding: ResizeVNodeDirective, vnode: VNode) {\n if (!el._onResize?.[vnode.context!._uid]) return\n\n const { callback, options } = el._onResize[vnode.context!._uid]!\n\n window.removeEventListener('resize', callback, options)\n\n delete el._onResize[vnode.context!._uid]\n}\n\nexport const Resize = {\n inserted,\n unbind,\n}\n\nexport default Resize\n","// Styles\nimport './VRipple.sass'\n\n// Utilities\nimport { consoleWarn } from '../../util/console'\nimport { keyCodes } from '../../util/helpers'\n\n// Types\nimport { VNode, VNodeDirective } from 'vue'\n\ntype VuetifyRippleEvent = (MouseEvent | TouchEvent | KeyboardEvent) & { rippleStop?: boolean }\n\nconst DELAY_RIPPLE = 80\n\nfunction transform (el: HTMLElement, value: string) {\n el.style.transform = value\n el.style.webkitTransform = value\n}\n\nexport interface RippleOptions {\n class?: string\n center?: boolean\n circle?: boolean\n}\n\nfunction isTouchEvent (e: VuetifyRippleEvent): e is TouchEvent {\n return e.constructor.name === 'TouchEvent'\n}\n\nfunction isKeyboardEvent (e: VuetifyRippleEvent): e is KeyboardEvent {\n return e.constructor.name === 'KeyboardEvent'\n}\n\nconst calculate = (\n e: VuetifyRippleEvent,\n el: HTMLElement,\n value: RippleOptions = {}\n) => {\n let localX = 0\n let localY = 0\n\n if (!isKeyboardEvent(e)) {\n const offset = el.getBoundingClientRect()\n const target = isTouchEvent(e) ? e.touches[e.touches.length - 1] : e\n\n localX = target.clientX - offset.left\n localY = target.clientY - offset.top\n }\n\n let radius = 0\n let scale = 0.3\n if (el._ripple && el._ripple.circle) {\n scale = 0.15\n radius = el.clientWidth / 2\n radius = value.center ? radius : radius + Math.sqrt((localX - radius) ** 2 + (localY - radius) ** 2) / 4\n } else {\n radius = Math.sqrt(el.clientWidth ** 2 + el.clientHeight ** 2) / 2\n }\n\n const centerX = `${(el.clientWidth - (radius * 2)) / 2}px`\n const centerY = `${(el.clientHeight - (radius * 2)) / 2}px`\n\n const x = value.center ? centerX : `${localX - radius}px`\n const y = value.center ? centerY : `${localY - radius}px`\n\n return { radius, scale, x, y, centerX, centerY }\n}\n\nconst ripples = {\n /* eslint-disable max-statements */\n show (\n e: VuetifyRippleEvent,\n el: HTMLElement,\n value: RippleOptions = {}\n ) {\n if (!el._ripple || !el._ripple.enabled) {\n return\n }\n\n const container = document.createElement('span')\n const animation = document.createElement('span')\n\n container.appendChild(animation)\n container.className = 'v-ripple__container'\n\n if (value.class) {\n container.className += ` ${value.class}`\n }\n\n const { radius, scale, x, y, centerX, centerY } = calculate(e, el, value)\n\n const size = `${radius * 2}px`\n animation.className = 'v-ripple__animation'\n animation.style.width = size\n animation.style.height = size\n\n el.appendChild(container)\n\n const computed = window.getComputedStyle(el)\n if (computed && computed.position === 'static') {\n el.style.position = 'relative'\n el.dataset.previousPosition = 'static'\n }\n\n animation.classList.add('v-ripple__animation--enter')\n animation.classList.add('v-ripple__animation--visible')\n transform(animation, `translate(${x}, ${y}) scale3d(${scale},${scale},${scale})`)\n animation.dataset.activated = String(performance.now())\n\n setTimeout(() => {\n animation.classList.remove('v-ripple__animation--enter')\n animation.classList.add('v-ripple__animation--in')\n transform(animation, `translate(${centerX}, ${centerY}) scale3d(1,1,1)`)\n }, 0)\n },\n\n hide (el: HTMLElement | null) {\n if (!el || !el._ripple || !el._ripple.enabled) return\n\n const ripples = el.getElementsByClassName('v-ripple__animation')\n\n if (ripples.length === 0) return\n const animation = ripples[ripples.length - 1]\n\n if (animation.dataset.isHiding) return\n else animation.dataset.isHiding = 'true'\n\n const diff = performance.now() - Number(animation.dataset.activated)\n const delay = Math.max(250 - diff, 0)\n\n setTimeout(() => {\n animation.classList.remove('v-ripple__animation--in')\n animation.classList.add('v-ripple__animation--out')\n\n setTimeout(() => {\n const ripples = el.getElementsByClassName('v-ripple__animation')\n if (ripples.length === 1 && el.dataset.previousPosition) {\n el.style.position = el.dataset.previousPosition\n delete el.dataset.previousPosition\n }\n\n animation.parentNode && el.removeChild(animation.parentNode)\n }, 300)\n }, delay)\n },\n}\n\nfunction isRippleEnabled (value: any): value is true {\n return typeof value === 'undefined' || !!value\n}\n\nfunction rippleShow (e: VuetifyRippleEvent) {\n const value: RippleOptions = {}\n const element = e.currentTarget as HTMLElement\n\n if (!element || !element._ripple || element._ripple.touched || e.rippleStop) return\n\n // Don't allow the event to trigger ripples on any other elements\n e.rippleStop = true\n\n if (isTouchEvent(e)) {\n element._ripple.touched = true\n element._ripple.isTouch = true\n } else {\n // It's possible for touch events to fire\n // as mouse events on Android/iOS, this\n // will skip the event call if it has\n // already been registered as touch\n if (element._ripple.isTouch) return\n }\n value.center = element._ripple.centered || isKeyboardEvent(e)\n if (element._ripple.class) {\n value.class = element._ripple.class\n }\n\n if (isTouchEvent(e)) {\n // already queued that shows or hides the ripple\n if (element._ripple.showTimerCommit) return\n\n element._ripple.showTimerCommit = () => {\n ripples.show(e, element, value)\n }\n element._ripple.showTimer = window.setTimeout(() => {\n if (element && element._ripple && element._ripple.showTimerCommit) {\n element._ripple.showTimerCommit()\n element._ripple.showTimerCommit = null\n }\n }, DELAY_RIPPLE)\n } else {\n ripples.show(e, element, value)\n }\n}\n\nfunction rippleHide (e: Event) {\n const element = e.currentTarget as HTMLElement | null\n if (!element || !element._ripple) return\n\n window.clearTimeout(element._ripple.showTimer)\n\n // The touch interaction occurs before the show timer is triggered.\n // We still want to show ripple effect.\n if (e.type === 'touchend' && element._ripple.showTimerCommit) {\n element._ripple.showTimerCommit()\n element._ripple.showTimerCommit = null\n\n // re-queue ripple hiding\n element._ripple.showTimer = setTimeout(() => {\n rippleHide(e)\n })\n return\n }\n\n window.setTimeout(() => {\n if (element._ripple) {\n element._ripple.touched = false\n }\n })\n ripples.hide(element)\n}\n\nfunction rippleCancelShow (e: MouseEvent | TouchEvent) {\n const element = e.currentTarget as HTMLElement | undefined\n\n if (!element || !element._ripple) return\n\n if (element._ripple.showTimerCommit) {\n element._ripple.showTimerCommit = null\n }\n\n window.clearTimeout(element._ripple.showTimer)\n}\n\nlet keyboardRipple = false\n\nfunction keyboardRippleShow (e: KeyboardEvent) {\n if (!keyboardRipple && (e.keyCode === keyCodes.enter || e.keyCode === keyCodes.space)) {\n keyboardRipple = true\n rippleShow(e)\n }\n}\n\nfunction keyboardRippleHide (e: KeyboardEvent) {\n keyboardRipple = false\n rippleHide(e)\n}\n\nfunction focusRippleHide (e: FocusEvent) {\n if (keyboardRipple === true) {\n keyboardRipple = false\n rippleHide(e)\n }\n}\n\nfunction updateRipple (el: HTMLElement, binding: VNodeDirective, wasEnabled: boolean) {\n const enabled = isRippleEnabled(binding.value)\n if (!enabled) {\n ripples.hide(el)\n }\n el._ripple = el._ripple || {}\n el._ripple.enabled = enabled\n const value = binding.value || {}\n if (value.center) {\n el._ripple.centered = true\n }\n if (value.class) {\n el._ripple.class = binding.value.class\n }\n if (value.circle) {\n el._ripple.circle = value.circle\n }\n if (enabled && !wasEnabled) {\n el.addEventListener('touchstart', rippleShow, { passive: true })\n el.addEventListener('touchend', rippleHide, { passive: true })\n el.addEventListener('touchmove', rippleCancelShow, { passive: true })\n el.addEventListener('touchcancel', rippleHide)\n\n el.addEventListener('mousedown', rippleShow)\n el.addEventListener('mouseup', rippleHide)\n el.addEventListener('mouseleave', rippleHide)\n\n el.addEventListener('keydown', keyboardRippleShow)\n el.addEventListener('keyup', keyboardRippleHide)\n\n el.addEventListener('blur', focusRippleHide)\n\n // Anchor tags can be dragged, causes other hides to fail - #1537\n el.addEventListener('dragstart', rippleHide, { passive: true })\n } else if (!enabled && wasEnabled) {\n removeListeners(el)\n }\n}\n\nfunction removeListeners (el: HTMLElement) {\n el.removeEventListener('mousedown', rippleShow)\n el.removeEventListener('touchstart', rippleShow)\n el.removeEventListener('touchend', rippleHide)\n el.removeEventListener('touchmove', rippleCancelShow)\n el.removeEventListener('touchcancel', rippleHide)\n el.removeEventListener('mouseup', rippleHide)\n el.removeEventListener('mouseleave', rippleHide)\n el.removeEventListener('keydown', keyboardRippleShow)\n el.removeEventListener('keyup', keyboardRippleHide)\n el.removeEventListener('dragstart', rippleHide)\n el.removeEventListener('blur', focusRippleHide)\n}\n\nfunction directive (el: HTMLElement, binding: VNodeDirective, node: VNode) {\n updateRipple(el, binding, false)\n\n if (process.env.NODE_ENV === 'development') {\n // warn if an inline element is used, waiting for el to be in the DOM first\n node.context && node.context.$nextTick(() => {\n const computed = window.getComputedStyle(el)\n if (computed && computed.display === 'inline') {\n const context = (node as any).fnOptions ? [(node as any).fnOptions, node.context] : [node.componentInstance]\n consoleWarn('v-ripple can only be used on block-level elements', ...context)\n }\n })\n }\n}\n\nfunction unbind (el: HTMLElement) {\n delete el._ripple\n removeListeners(el)\n}\n\nfunction update (el: HTMLElement, binding: VNodeDirective) {\n if (binding.value === binding.oldValue) {\n return\n }\n\n const wasEnabled = isRippleEnabled(binding.oldValue)\n updateRipple(el, binding, wasEnabled)\n}\n\nexport const Ripple = {\n bind: directive,\n unbind,\n update,\n}\n\nexport default Ripple\n","import { VNodeDirective, VNode } from 'vue/types/vnode'\nimport { keys } from '../../util/helpers'\nimport { TouchHandlers, TouchValue, TouchWrapper } from 'vuetify/types'\n\nexport interface TouchStoredHandlers {\n touchstart: (e: TouchEvent) => void\n touchend: (e: TouchEvent) => void\n touchmove: (e: TouchEvent) => void\n}\n\ninterface TouchVNodeDirective extends VNodeDirective {\n value?: TouchValue\n}\n\nconst handleGesture = (wrapper: TouchWrapper) => {\n const { touchstartX, touchendX, touchstartY, touchendY } = wrapper\n const dirRatio = 0.5\n const minDistance = 16\n wrapper.offsetX = touchendX - touchstartX\n wrapper.offsetY = touchendY - touchstartY\n\n if (Math.abs(wrapper.offsetY) < dirRatio * Math.abs(wrapper.offsetX)) {\n wrapper.left && (touchendX < touchstartX - minDistance) && wrapper.left(wrapper)\n wrapper.right && (touchendX > touchstartX + minDistance) && wrapper.right(wrapper)\n }\n\n if (Math.abs(wrapper.offsetX) < dirRatio * Math.abs(wrapper.offsetY)) {\n wrapper.up && (touchendY < touchstartY - minDistance) && wrapper.up(wrapper)\n wrapper.down && (touchendY > touchstartY + minDistance) && wrapper.down(wrapper)\n }\n}\n\nfunction touchstart (event: TouchEvent, wrapper: TouchWrapper) {\n const touch = event.changedTouches[0]\n wrapper.touchstartX = touch.clientX\n wrapper.touchstartY = touch.clientY\n\n wrapper.start &&\n wrapper.start(Object.assign(event, wrapper))\n}\n\nfunction touchend (event: TouchEvent, wrapper: TouchWrapper) {\n const touch = event.changedTouches[0]\n wrapper.touchendX = touch.clientX\n wrapper.touchendY = touch.clientY\n\n wrapper.end &&\n wrapper.end(Object.assign(event, wrapper))\n\n handleGesture(wrapper)\n}\n\nfunction touchmove (event: TouchEvent, wrapper: TouchWrapper) {\n const touch = event.changedTouches[0]\n wrapper.touchmoveX = touch.clientX\n wrapper.touchmoveY = touch.clientY\n\n wrapper.move && wrapper.move(Object.assign(event, wrapper))\n}\n\nfunction createHandlers (value: TouchHandlers): TouchStoredHandlers {\n const wrapper = {\n touchstartX: 0,\n touchstartY: 0,\n touchendX: 0,\n touchendY: 0,\n touchmoveX: 0,\n touchmoveY: 0,\n offsetX: 0,\n offsetY: 0,\n left: value.left,\n right: value.right,\n up: value.up,\n down: value.down,\n start: value.start,\n move: value.move,\n end: value.end,\n }\n\n return {\n touchstart: (e: TouchEvent) => touchstart(e, wrapper),\n touchend: (e: TouchEvent) => touchend(e, wrapper),\n touchmove: (e: TouchEvent) => touchmove(e, wrapper),\n }\n}\n\nfunction inserted (el: HTMLElement, binding: TouchVNodeDirective, vnode: VNode) {\n const value = binding.value!\n const target = value.parent ? el.parentElement : el\n const options = value.options || { passive: true }\n\n // Needed to pass unit tests\n if (!target) return\n\n const handlers = createHandlers(binding.value!)\n target._touchHandlers = Object(target._touchHandlers)\n target._touchHandlers![vnode.context!._uid] = handlers\n\n keys(handlers).forEach(eventName => {\n target.addEventListener(eventName, handlers[eventName] as EventListener, options)\n })\n}\n\nfunction unbind (el: HTMLElement, binding: TouchVNodeDirective, vnode: VNode) {\n const target = binding.value!.parent ? el.parentElement : el\n if (!target || !target._touchHandlers) return\n\n const handlers = target._touchHandlers[vnode.context!._uid]\n keys(handlers).forEach(eventName => {\n target.removeEventListener(eventName, handlers[eventName])\n })\n delete target._touchHandlers[vnode.context!._uid]\n}\n\nexport const Touch = {\n inserted,\n unbind,\n}\n\nexport default Touch\n","import OurVue, { VueConstructor } from 'vue'\nimport { VuetifyUseOptions } from 'vuetify/types'\nimport { consoleError } from './util/console'\n\nexport function install (Vue: VueConstructor, args: VuetifyUseOptions = {}) {\n if ((install as any).installed) return\n (install as any).installed = true\n\n if (OurVue !== Vue) {\n consoleError(`Multiple instances of Vue detected\nSee https://github.com/vuetifyjs/vuetify/issues/4068\n\nIf you're seeing \"$attrs is readonly\", it's caused by this`)\n }\n\n const components = args.components || {}\n const directives = args.directives || {}\n\n for (const name in directives) {\n const directive = directives[name]\n\n Vue.directive(name, directive)\n }\n\n (function registerComponents (components: any) {\n if (components) {\n for (const key in components) {\n const component = components[key]\n if (component && !registerComponents(component.$_vuetify_subcomponents)) {\n Vue.component(key, component as typeof Vue)\n }\n }\n return true\n }\n return false\n })(components)\n\n // Used to avoid multiple mixins being setup\n // when in dev mode and hot module reload\n // https://github.com/vuejs/vue/issues/5089#issuecomment-284260111\n if (Vue.$_vuetify_installed) return\n Vue.$_vuetify_installed = true\n\n Vue.mixin({\n beforeCreate () {\n const options = this.$options as any\n\n if (options.vuetify) {\n options.vuetify.init(this, this.$ssrContext)\n this.$vuetify = Vue.observable(options.vuetify.framework)\n } else {\n this.$vuetify = (options.parent && options.parent.$vuetify) || this\n }\n },\n beforeMount () {\n // @ts-ignore\n if (this.$options.vuetify && this.$el && this.$el.hasAttribute('data-server-rendered')) {\n // @ts-ignore\n this.$vuetify.isHydrating = true\n // @ts-ignore\n this.$vuetify.breakpoint.update(true)\n }\n },\n mounted () {\n // @ts-ignore\n if (this.$options.vuetify && this.$vuetify.isHydrating) {\n // @ts-ignore\n this.$vuetify.isHydrating = false\n // @ts-ignore\n this.$vuetify.breakpoint.update()\n }\n },\n })\n}\n","export default {\n badge: 'Badge',\n close: 'Close',\n dataIterator: {\n noResultsText: 'No matching records found',\n loadingText: 'Loading items...',\n },\n dataTable: {\n itemsPerPageText: 'Rows per page:',\n ariaLabel: {\n sortDescending: 'Sorted descending.',\n sortAscending: 'Sorted ascending.',\n sortNone: 'Not sorted.',\n activateNone: 'Activate to remove sorting.',\n activateDescending: 'Activate to sort descending.',\n activateAscending: 'Activate to sort ascending.',\n },\n sortBy: 'Sort by',\n },\n dataFooter: {\n itemsPerPageText: 'Items per page:',\n itemsPerPageAll: 'All',\n nextPage: 'Next page',\n prevPage: 'Previous page',\n firstPage: 'First page',\n lastPage: 'Last page',\n pageText: '{0}-{1} of {2}',\n },\n datePicker: {\n itemsSelected: '{0} selected',\n nextMonthAriaLabel: 'Next month',\n nextYearAriaLabel: 'Next year',\n prevMonthAriaLabel: 'Previous month',\n prevYearAriaLabel: 'Previous year',\n },\n noDataText: 'No data available',\n carousel: {\n prev: 'Previous visual',\n next: 'Next visual',\n ariaLabel: {\n delimiter: 'Carousel slide {0} of {1}',\n },\n },\n calendar: {\n moreEvents: '{0} more',\n },\n fileInput: {\n counter: '{0} files',\n counterSize: '{0} files ({1} in total)',\n },\n timePicker: {\n am: 'AM',\n pm: 'PM',\n },\n pagination: {\n ariaLabel: {\n wrapper: 'Pagination Navigation',\n next: 'Next page',\n previous: 'Previous page',\n page: 'Goto Page {0}',\n currentPage: 'Current Page, Page {0}',\n },\n },\n rating: {\n ariaLabel: {\n icon: 'Rating {0} of {1}',\n },\n },\n}\n","// Styles\nimport '../../styles/main.sass'\n\n// Locale\nimport { en } from '../../locale'\n\n// Icons\n// TODO: Enable for v3\n// import mdi from '../../services/icons/presets/mdi'\n\n// Types\nimport { VuetifyPreset } from 'vuetify/types/services/presets'\n\nexport const preset: VuetifyPreset = {\n breakpoint: {\n // TODO: update to MD2 spec in v3 - 1280\n mobileBreakpoint: 1264,\n scrollBarWidth: 16,\n thresholds: {\n xs: 600,\n sm: 960,\n md: 1280,\n lg: 1920,\n },\n },\n icons: {\n // TODO: remove v3\n iconfont: 'mdi',\n values: {},\n },\n lang: {\n current: 'en',\n locales: { en },\n // Default translator exists in lang service\n t: undefined as any,\n },\n rtl: false,\n theme: {\n dark: false,\n default: 'light',\n disable: false,\n options: {\n cspNonce: undefined,\n customProperties: undefined,\n minifyTheme: undefined,\n themeCache: undefined,\n variations: true,\n },\n themes: {\n light: {\n primary: '#1976D2',\n secondary: '#424242',\n accent: '#82B1FF',\n error: '#FF5252',\n info: '#2196F3',\n success: '#4CAF50',\n warning: '#FB8C00',\n },\n dark: {\n primary: '#2196F3',\n secondary: '#424242',\n accent: '#FF4081',\n error: '#FF5252',\n info: '#2196F3',\n success: '#4CAF50',\n warning: '#FB8C00',\n },\n },\n },\n}\n","// Preset\nimport { preset as Preset } from '../../presets/default'\n\n// Utilities\nimport { consoleWarn } from '../../util/console'\nimport { mergeDeep } from '../../util/helpers'\n\n// Types\nimport Vuetify from 'vuetify/types'\nimport { Service } from '../service'\nimport {\n UserVuetifyPreset,\n VuetifyPreset,\n} from 'vuetify/types/services/presets'\n\nexport class Presets extends Service {\n static property: 'presets' = 'presets'\n\n constructor (\n parentPreset: Partial<UserVuetifyPreset>,\n parent: Vuetify,\n ) {\n super()\n\n // The default preset\n const defaultPreset = mergeDeep({}, Preset)\n // The user provided preset\n const { userPreset } = parent\n // The user provided global preset\n const {\n preset: globalPreset = {},\n ...preset\n } = userPreset\n\n if (globalPreset.preset != null) {\n consoleWarn('Global presets do not support the **preset** option, it can be safely omitted')\n }\n\n parent.preset = mergeDeep(\n mergeDeep(defaultPreset, globalPreset),\n preset\n ) as VuetifyPreset\n }\n}\n","// Extensions\nimport { Service } from '../service'\n\n// Types\nimport { TargetPropValues, TargetProp, Application as IApplication } from 'vuetify/types/services/application'\n\nexport class Application extends Service implements IApplication {\n static property: 'application' = 'application'\n\n bar = 0\n\n top = 0\n\n left = 0\n\n insetFooter = 0\n\n right = 0\n\n bottom = 0\n\n footer = 0\n\n application: Dictionary<TargetPropValues> = {\n bar: {},\n top: {},\n left: {},\n insetFooter: {},\n right: {},\n bottom: {},\n footer: {},\n }\n\n register (\n uid: number,\n location: TargetProp,\n size: number\n ) {\n this.application[location][uid] = size\n\n this.update(location)\n }\n\n unregister (uid: number, location: TargetProp) {\n if (this.application[location][uid] == null) return\n\n delete this.application[location][uid]\n this.update(location)\n }\n\n update (location: TargetProp) {\n this[location] = Object.values(this.application[location])\n .reduce((acc: number, cur: number): number => (acc + cur), 0)\n }\n}\n","// Extensions\nimport { Service } from '../service'\n\n// Types\nimport { VuetifyPreset } from 'vuetify/types/services/presets'\nimport { Breakpoint as IBreakpoint } from 'vuetify/types/services/breakpoint'\n\nexport class Breakpoint extends Service implements IBreakpoint {\n public static property: 'breakpoint' = 'breakpoint'\n\n // Public\n public xs = false\n\n public sm = false\n\n public md = false\n\n public lg = false\n\n public xl = false\n\n public xsOnly = false\n\n public smOnly = false\n\n public smAndDown = false\n\n public smAndUp = false\n\n public mdOnly = false\n\n public mdAndDown = false\n\n public mdAndUp = false\n\n public lgOnly = false\n\n public lgAndDown = false\n\n public lgAndUp = false\n\n public xlOnly = false\n\n // Value is xs to match v2.x functionality\n public name: IBreakpoint['name'] = 'xs'\n\n public height = 0\n\n public width = 0\n\n // TODO: Add functionality to detect this dynamically in v3\n // Value is true to match v2.x functionality\n public mobile = true\n\n public mobileBreakpoint: IBreakpoint['mobileBreakpoint']\n\n public thresholds: IBreakpoint['thresholds']\n\n public scrollBarWidth: IBreakpoint['scrollBarWidth']\n\n private resizeTimeout = 0\n\n constructor (preset: VuetifyPreset) {\n super()\n\n const {\n mobileBreakpoint,\n scrollBarWidth,\n thresholds,\n } = preset[Breakpoint.property]\n\n this.mobileBreakpoint = mobileBreakpoint\n this.scrollBarWidth = scrollBarWidth\n this.thresholds = thresholds\n }\n\n public init () {\n this.update()\n\n /* istanbul ignore if */\n if (typeof window === 'undefined') return\n\n window.addEventListener(\n 'resize',\n this.onResize.bind(this),\n { passive: true }\n )\n }\n\n /* eslint-disable-next-line max-statements */\n public update (ssr = false) {\n const height = ssr ? 0 : this.getClientHeight()\n const width = ssr ? 0 : this.getClientWidth()\n\n const xs = width < this.thresholds.xs\n const sm = width < this.thresholds.sm && !xs\n const md = width < (this.thresholds.md - this.scrollBarWidth) && !(sm || xs)\n const lg = width < (this.thresholds.lg - this.scrollBarWidth) && !(md || sm || xs)\n const xl = width >= (this.thresholds.lg - this.scrollBarWidth)\n\n this.height = height\n this.width = width\n\n this.xs = xs\n this.sm = sm\n this.md = md\n this.lg = lg\n this.xl = xl\n\n this.xsOnly = xs\n this.smOnly = sm\n this.smAndDown = (xs || sm) && !(md || lg || xl)\n this.smAndUp = !xs && (sm || md || lg || xl)\n this.mdOnly = md\n this.mdAndDown = (xs || sm || md) && !(lg || xl)\n this.mdAndUp = !(xs || sm) && (md || lg || xl)\n this.lgOnly = lg\n this.lgAndDown = (xs || sm || md || lg) && !xl\n this.lgAndUp = !(xs || sm || md) && (lg || xl)\n this.xlOnly = xl\n\n switch (true) {\n case (xs):\n this.name = 'xs'\n break\n case (sm):\n this.name = 'sm'\n break\n case (md):\n this.name = 'md'\n break\n case (lg):\n this.name = 'lg'\n break\n default:\n this.name = 'xl'\n break\n }\n\n if (typeof this.mobileBreakpoint === 'number') {\n this.mobile = width < parseInt(this.mobileBreakpoint, 10)\n\n return\n }\n\n const breakpoints = {\n xs: 0,\n sm: 1,\n md: 2,\n lg: 3,\n xl: 4,\n } as const\n\n const current = breakpoints[this.name]\n const max = breakpoints[this.mobileBreakpoint]\n\n this.mobile = current <= max\n }\n\n private onResize () {\n clearTimeout(this.resizeTimeout)\n\n // Added debounce to match what\n // v-resize used to do but was\n // removed due to a memory leak\n // https://github.com/vuetifyjs/vuetify/pull/2997\n this.resizeTimeout = window.setTimeout(this.update.bind(this), 200)\n }\n\n // Cross-browser support as described in:\n // https://stackoverflow.com/questions/1248081\n private getClientWidth () {\n /* istanbul ignore if */\n if (typeof document === 'undefined') return 0 // SSR\n return Math.max(\n document.documentElement!.clientWidth,\n window.innerWidth || 0\n )\n }\n\n private getClientHeight () {\n /* istanbul ignore if */\n if (typeof document === 'undefined') return 0 // SSR\n return Math.max(\n document.documentElement!.clientHeight,\n window.innerHeight || 0\n )\n }\n}\n","import { VuetifyIcons } from 'vuetify/types/services/icons'\n\nconst icons: VuetifyIcons = {\n complete: 'M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z',\n cancel: 'M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z',\n close: 'M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z',\n delete: 'M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z', // delete (e.g. v-chip close)\n clear: 'M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z',\n success: 'M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41 10.59L10 14.17L17.59 6.58L19 8L10 17Z',\n info: 'M13,9H11V7H13M13,17H11V11H13M12,2C6.48,2 2,6.48 2,12C2,17.52 6.48,22 12,22C17.52,22 22,17.52 22,12C22,6.48 17.52,2 12,2ZM13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z',\n warning: 'M13,13H11V7H13M13,17H11V15H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z',\n error: 'M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z',\n prev: 'M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z',\n next: 'M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z',\n checkboxOn: 'M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8M19,3H5C3.89,3 3,3.89 3,5V19C3,20.1 3.9,21 5,21H19C20.1,21 21,20.1 21,19V5C21,3.89 20.1,3 19,3Z',\n checkboxOff: 'M19,3H5C3.89,3 3,3.89 3,5V19C3,20.1 3.9,21 5,21H19C20.1,21 21,20.1 21,19V5C21,3.89 20.1,3 19,3M19,5V19H5V5H19Z',\n checkboxIndeterminate: 'M17,13H7V11H17M19,3H5C3.89,3 3,3.89 3,5V19C3,20.1 3.9,21 5,21H19C20.1,21 21,20.1 21,19V5C21,3.89 20.1,3 19,3Z',\n delimiter: 'M12,2C6.48,2 2,6.48 2,12C2,17.52 6.48,22 12,22C17.52,22 22,17.52 22,12C22,6.48 17.52,2 12,2Z', // for carousel\n sort: 'M13,20H11V8L5.5,13.5L4.08,12.08L12,4.16L19.92,12.08L18.5,13.5L13,8V20Z',\n expand: 'M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z',\n menu: 'M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z',\n subgroup: 'M7,10L12,15L17,10H7Z',\n dropdown: 'M7,10L12,15L17,10H7Z',\n radioOn: 'M12,20C7.58,20 4,16.42 4,12C4,7.58 7.58,4 12,4C16.42,4 20,7.58 20,12C20,16.42 16.42,20 12,20M12,2C6.48,2 2,6.48 2,12C2,17.52 6.48,22 12,22C17.52,22 22,17.52 22,12C22,6.48 17.52,2 12,2M12,7C9.24,7 7,9.24 7,12C7,14.76 9.24,17 12,17C14.76,17 17,14.76 17,12C17,9.24 14.76,7 12,7Z',\n radioOff: 'M12,20C7.58,20 4,16.42 4,12C4,7.58 7.58,4 12,4C16.42,4 20,7.58 20,12C20,16.42 16.42,20 12,20M12,2C6.48,2 2,6.48 2,12C2,17.52 6.48,22 12,22C17.52,22 22,17.52 22,12C22,6.48 17.52,2 12,2Z',\n edit: 'M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z',\n ratingEmpty: 'M12,15.39L8.24,17.66L9.23,13.38L5.91,10.5L10.29,10.13L12,6.09L13.71,10.13L18.09,10.5L14.77,13.38L15.76,17.66M22,9.24L14.81,8.63L12,2L9.19,8.63L2,9.24L7.45,13.97L5.82,21L12,17.27L18.18,21L16.54,13.97L22,9.24Z',\n ratingFull: 'M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.62L12,2L9.19,8.62L2,9.24L7.45,13.97L5.82,21L12,17.27Z',\n ratingHalf: 'M12,15.4V6.1L13.71,10.13L18.09,10.5L14.77,13.39L15.76,17.67M22,9.24L14.81,8.63L12,2L9.19,8.63L2,9.24L7.45,13.97L5.82,21L12,17.27L18.18,21L16.54,13.97L22,9.24Z',\n loading: 'M19,8L15,12H18C18,15.31 15.31,18 12,18C11,18 10.03,17.75 9.2,17.3L7.74,18.76C8.97,19.54 10.43,20 12,20C16.42,20 20,16.42 20,12H23M6,12C6,8.69 8.69,6 12,6C13,6 13.97,6.25 14.8,6.7L16.26,5.24C15.03,4.46 13.57,4 12,4C7.58,4 4,7.58 4,12H1L5,16L9,12',\n first: 'M18.41,16.59L13.82,12L18.41,7.41L17,6L11,12L17,18L18.41,16.59M6,6H8V18H6V6Z',\n last: 'M5.59,7.41L10.18,12L5.59,16.59L7,18L13,12L7,6L5.59,7.41M16,6H18V18H16V6Z',\n unfold: 'M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z',\n file: 'M16.5,6V17.5C16.5,19.71 14.71,21.5 12.5,21.5C10.29,21.5 8.5,19.71 8.5,17.5V5C8.5,3.62 9.62,2.5 11,2.5C12.38,2.5 13.5,3.62 13.5,5V15.5C13.5,16.05 13.05,16.5 12.5,16.5C11.95,16.5 11.5,16.05 11.5,15.5V6H10V15.5C10,16.88 11.12,18 12.5,18C13.88,18 15,16.88 15,15.5V5C15,2.79 13.21,1 11,1C8.79,1 7,2.79 7,5V17.5C7,20.54 9.46,23 12.5,23C15.54,23 18,20.54 18,17.5V6H16.5Z',\n plus: 'M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z',\n minus: 'M19,13H5V11H19V13Z',\n}\n\nexport default icons\n","import { VuetifyIcons } from 'vuetify/types/services/icons'\n\nconst icons: VuetifyIcons = {\n complete: 'check',\n cancel: 'cancel',\n close: 'close',\n delete: 'cancel', // delete (e.g. v-chip close)\n clear: 'clear',\n success: 'check_circle',\n info: 'info',\n warning: 'priority_high',\n error: 'warning',\n prev: 'chevron_left',\n next: 'chevron_right',\n checkboxOn: 'check_box',\n checkboxOff: 'check_box_outline_blank',\n checkboxIndeterminate: 'indeterminate_check_box',\n delimiter: 'fiber_manual_record', // for carousel\n sort: 'arrow_upward',\n expand: 'keyboard_arrow_down',\n menu: 'menu',\n subgroup: 'arrow_drop_down',\n dropdown: 'arrow_drop_down',\n radioOn: 'radio_button_checked',\n radioOff: 'radio_button_unchecked',\n edit: 'edit',\n ratingEmpty: 'star_border',\n ratingFull: 'star',\n ratingHalf: 'star_half',\n loading: 'cached',\n first: 'first_page',\n last: 'last_page',\n unfold: 'unfold_more',\n file: 'attach_file',\n plus: 'add',\n minus: 'remove',\n}\n\nexport default icons\n","import { VuetifyIcons } from 'vuetify/types/services/icons'\n\nconst icons: VuetifyIcons = {\n complete: 'mdi-check',\n cancel: 'mdi-close-circle',\n close: 'mdi-close',\n delete: 'mdi-close-circle', // delete (e.g. v-chip close)\n clear: 'mdi-close',\n success: 'mdi-check-circle',\n info: 'mdi-information',\n warning: 'mdi-exclamation',\n error: 'mdi-alert',\n prev: 'mdi-chevron-left',\n next: 'mdi-chevron-right',\n checkboxOn: 'mdi-checkbox-marked',\n checkboxOff: 'mdi-checkbox-blank-outline',\n checkboxIndeterminate: 'mdi-minus-box',\n delimiter: 'mdi-circle', // for carousel\n sort: 'mdi-arrow-up',\n expand: 'mdi-chevron-down',\n menu: 'mdi-menu',\n subgroup: 'mdi-menu-down',\n dropdown: 'mdi-menu-down',\n radioOn: 'mdi-radiobox-marked',\n radioOff: 'mdi-radiobox-blank',\n edit: 'mdi-pencil',\n ratingEmpty: 'mdi-star-outline',\n ratingFull: 'mdi-star',\n ratingHalf: 'mdi-star-half-full',\n loading: 'mdi-cached',\n first: 'mdi-page-first',\n last: 'mdi-page-last',\n unfold: 'mdi-unfold-more-horizontal',\n file: 'mdi-paperclip',\n plus: 'mdi-plus',\n minus: 'mdi-minus',\n}\n\nexport default icons\n","import { VuetifyIcons } from 'vuetify/types/services/icons'\n\nconst icons: VuetifyIcons = {\n complete: 'fas fa-check',\n cancel: 'fas fa-times-circle',\n close: 'fas fa-times',\n delete: 'fas fa-times-circle', // delete (e.g. v-chip close)\n clear: 'fas fa-times-circle', // delete (e.g. v-chip close)\n success: 'fas fa-check-circle',\n info: 'fas fa-info-circle',\n warning: 'fas fa-exclamation',\n error: 'fas fa-exclamation-triangle',\n prev: 'fas fa-chevron-left',\n next: 'fas fa-chevron-right',\n checkboxOn: 'fas fa-check-square',\n checkboxOff: 'far fa-square', // note 'far'\n checkboxIndeterminate: 'fas fa-minus-square',\n delimiter: 'fas fa-circle', // for carousel\n sort: 'fas fa-sort-up',\n expand: 'fas fa-chevron-down',\n menu: 'fas fa-bars',\n subgroup: 'fas fa-caret-down',\n dropdown: 'fas fa-caret-down',\n radioOn: 'far fa-dot-circle',\n radioOff: 'far fa-circle',\n edit: 'fas fa-edit',\n ratingEmpty: 'far fa-star',\n ratingFull: 'fas fa-star',\n ratingHalf: 'fas fa-star-half',\n loading: 'fas fa-sync',\n first: 'fas fa-step-backward',\n last: 'fas fa-step-forward',\n unfold: 'fas fa-arrows-alt-v',\n file: 'fas fa-paperclip',\n plus: 'fas fa-plus',\n minus: 'fas fa-minus',\n}\n\nexport default icons\n","import { VuetifyIcons } from 'vuetify/types/services/icons'\n\nconst icons: VuetifyIcons = {\n complete: 'fa fa-check',\n cancel: 'fa fa-times-circle',\n close: 'fa fa-times',\n delete: 'fa fa-times-circle', // delete (e.g. v-chip close)\n clear: 'fa fa-times-circle', // delete (e.g. v-chip close)\n success: 'fa fa-check-circle',\n info: 'fa fa-info-circle',\n warning: 'fa fa-exclamation',\n error: 'fa fa-exclamation-triangle',\n prev: 'fa fa-chevron-left',\n next: 'fa fa-chevron-right',\n checkboxOn: 'fa fa-check-square',\n checkboxOff: 'fa fa-square-o',\n checkboxIndeterminate: 'fa fa-minus-square',\n delimiter: 'fa fa-circle', // for carousel\n sort: 'fa fa-sort-up',\n expand: 'fa fa-chevron-down',\n menu: 'fa fa-bars',\n subgroup: 'fa fa-caret-down',\n dropdown: 'fa fa-caret-down',\n radioOn: 'fa fa-dot-circle-o',\n radioOff: 'fa fa-circle-o',\n edit: 'fa fa-pencil',\n ratingEmpty: 'fa fa-star-o',\n ratingFull: 'fa fa-star',\n ratingHalf: 'fa fa-star-half-o',\n loading: 'fa fa-refresh',\n first: 'fa fa-step-backward',\n last: 'fa fa-step-forward',\n unfold: 'fa fa-angle-double-down',\n file: 'fa fa-paperclip',\n plus: 'fa fa-plus',\n minus: 'fa fa-minus',\n}\n\nexport default icons\n","import { VuetifyIcons } from 'vuetify/types/services/icons'\nimport { Component } from 'vue'\nimport icons from './fa'\n\nexport function convertToComponentDeclarations (\n component: Component | string,\n iconSet: VuetifyIcons,\n) {\n const result: Partial<VuetifyIcons> = {}\n\n for (const key in iconSet) {\n result[key] = {\n component,\n props: {\n icon: (iconSet[key] as string).split(' fa-'),\n },\n }\n }\n\n return result as VuetifyIcons\n}\n\nexport default convertToComponentDeclarations('font-awesome-icon', icons)\n","import mdiSvg from './mdi-svg'\nimport md from './md'\nimport mdi from './mdi'\nimport fa from './fa'\nimport fa4 from './fa4'\nimport faSvg from './fa-svg'\n\nexport default Object.freeze({\n mdiSvg,\n md,\n mdi,\n fa,\n fa4,\n faSvg,\n})\n","// Extensions\nimport { Service } from '../service'\n\n// Utilities\nimport { mergeDeep } from '../../util/helpers'\n\n// Types\nimport { VuetifyPreset } from 'vuetify/types/services/presets'\nimport { Icons as IIcons } from 'vuetify/types/services/icons'\n\n// Presets\nimport presets from './presets'\n\nexport class Icons extends Service implements IIcons {\n static property: 'icons' = 'icons'\n\n public iconfont: IIcons['iconfont']\n\n public values: IIcons['values']\n\n public component: IIcons['component']\n\n constructor (preset: VuetifyPreset) {\n super()\n\n const {\n iconfont,\n values,\n component,\n } = preset[Icons.property]\n\n this.component = component\n this.iconfont = iconfont\n this.values = mergeDeep(\n presets[iconfont],\n values\n ) as IIcons['values']\n }\n}\n","// Extensions\nimport { Service } from '../service'\n\n// Utilities\nimport { getObjectValueByPath } from '../../util/helpers'\nimport { consoleError, consoleWarn } from '../../util/console'\n\n// Types\nimport { VuetifyPreset } from 'vuetify/types/services/presets'\nimport {\n VuetifyLocale,\n Lang as ILang,\n} from 'vuetify/types/services/lang'\n\nconst LANG_PREFIX = '$vuetify.'\nconst fallback = Symbol('Lang fallback')\n\nfunction getTranslation (\n locale: VuetifyLocale,\n key: string,\n usingDefault = false,\n defaultLocale: VuetifyLocale\n): string {\n const shortKey = key.replace(LANG_PREFIX, '')\n let translation = getObjectValueByPath(locale, shortKey, fallback) as string | typeof fallback\n\n if (translation === fallback) {\n if (usingDefault) {\n consoleError(`Translation key \"${shortKey}\" not found in fallback`)\n translation = key\n } else {\n consoleWarn(`Translation key \"${shortKey}\" not found, falling back to default`)\n translation = getTranslation(defaultLocale, key, true, defaultLocale)\n }\n }\n\n return translation\n}\n\nexport class Lang extends Service implements ILang {\n static property: 'lang' = 'lang'\n\n public current: ILang['current']\n\n public defaultLocale = 'en'\n\n public locales: ILang['locales']\n\n private translator: ILang['t']\n\n constructor (preset: VuetifyPreset) {\n super()\n\n const {\n current,\n locales,\n t,\n } = preset[Lang.property]\n\n this.current = current\n this.locales = locales\n this.translator = t || this.defaultTranslator\n }\n\n public currentLocale (key: string) {\n const translation = this.locales[this.current]\n const defaultLocale = this.locales[this.defaultLocale]\n\n return getTranslation(translation, key, false, defaultLocale)\n }\n\n public t (key: string, ...params: any[]) {\n if (!key.startsWith(LANG_PREFIX)) return this.replace(key, params)\n\n return this.translator(key, ...params)\n }\n\n private defaultTranslator (key: string, ...params: any[]) {\n return this.replace(this.currentLocale(key), params)\n }\n\n private replace (str: string, params: any[]) {\n return str.replace(/\\{(\\d+)\\}/g, (match: string, index: string) => {\n /* istanbul ignore next */\n return String(params[+index])\n })\n }\n}\n","import { ColorInt, XYZ } from '../colorUtils'\nimport { clamp } from '../../util/helpers'\n\n// For converting XYZ to sRGB\nconst srgbForwardMatrix = [\n [3.2406, -1.5372, -0.4986],\n [-0.9689, 1.8758, 0.0415],\n [0.0557, -0.2040, 1.0570],\n]\n\n// Forward gamma adjust\nconst srgbForwardTransform = (C: number): number => (\n C <= 0.0031308\n ? C * 12.92\n : 1.055 * C ** (1 / 2.4) - 0.055\n)\n\n// For converting sRGB to XYZ\nconst srgbReverseMatrix = [\n [0.4124, 0.3576, 0.1805],\n [0.2126, 0.7152, 0.0722],\n [0.0193, 0.1192, 0.9505],\n]\n\n// Reverse gamma adjust\nconst srgbReverseTransform = (C: number): number => (\n C <= 0.04045\n ? C / 12.92\n : ((C + 0.055) / 1.055) ** 2.4\n)\n\nexport function fromXYZ (xyz: XYZ): ColorInt {\n const rgb = Array(3)\n const transform = srgbForwardTransform\n const matrix = srgbForwardMatrix\n\n // Matrix transform, then gamma adjustment\n for (let i = 0; i < 3; ++i) {\n rgb[i] = Math.round(clamp(transform(\n matrix[i][0] * xyz[0] +\n matrix[i][1] * xyz[1] +\n matrix[i][2] * xyz[2]\n )) * 255)\n }\n\n // Rescale back to [0, 255]\n return (rgb[0] << 16) + (rgb[1] << 8) + (rgb[2] << 0)\n}\n\nexport function toXYZ (rgb: ColorInt): XYZ {\n const xyz: XYZ = [0, 0, 0]\n const transform = srgbReverseTransform\n const matrix = srgbReverseMatrix\n\n // Rescale from [0, 255] to [0, 1] then adjust sRGB gamma to linear RGB\n const r = transform((rgb >> 16 & 0xff) / 255)\n const g = transform((rgb >> 8 & 0xff) / 255)\n const b = transform((rgb >> 0 & 0xff) / 255)\n\n // Matrix color space transform\n for (let i = 0; i < 3; ++i) {\n xyz[i] = matrix[i][0] * r + matrix[i][1] * g + matrix[i][2] * b\n }\n\n return xyz\n}\n","import { XYZ, LAB } from '../colorUtils'\n\nconst delta = 0.20689655172413793 // 6÷29\n\nconst cielabForwardTransform = (t: number): number => (\n t > delta ** 3\n ? Math.cbrt(t)\n : (t / (3 * delta ** 2)) + 4 / 29\n)\n\nconst cielabReverseTransform = (t: number): number => (\n t > delta\n ? t ** 3\n : (3 * delta ** 2) * (t - 4 / 29)\n)\n\nexport function fromXYZ (xyz: XYZ): LAB {\n const transform = cielabForwardTransform\n const transformedY = transform(xyz[1])\n\n return [\n 116 * transformedY - 16,\n 500 * (transform(xyz[0] / 0.95047) - transformedY),\n 200 * (transformedY - transform(xyz[2] / 1.08883)),\n ]\n}\n\nexport function toXYZ (lab: LAB): XYZ {\n const transform = cielabReverseTransform\n const Ln = (lab[0] + 16) / 116\n return [\n transform(Ln + lab[1] / 500) * 0.95047,\n transform(Ln),\n transform(Ln - lab[2] / 200) * 1.08883,\n ]\n}\n","import { keys } from '../../util/helpers'\nimport { colorToInt, intToHex, colorToHex, ColorInt } from '../../util/colorUtils'\nimport * as sRGB from '../../util/color/transformSRGB'\nimport * as LAB from '../../util/color/transformCIELAB'\nimport {\n VuetifyParsedTheme,\n VuetifyThemeItem,\n} from 'vuetify/types/services/theme'\n\nexport function parse (\n theme: Record<string, VuetifyThemeItem>,\n isItem = false,\n variations = true,\n): VuetifyParsedTheme {\n const { anchor, ...variant } = theme\n const colors = Object.keys(variant)\n const parsedTheme: any = {}\n\n for (let i = 0; i < colors.length; ++i) {\n const name = colors[i]\n const value = theme[name]\n\n if (value == null) continue\n\n if (!variations) {\n parsedTheme[name] = { base: intToHex(colorToInt(value)) }\n } else if (isItem) {\n /* istanbul ignore else */\n if (name === 'base' || name.startsWith('lighten') || name.startsWith('darken')) {\n parsedTheme[name] = colorToHex(value)\n }\n } else if (typeof value === 'object') {\n parsedTheme[name] = parse(value, true, variations)\n } else {\n parsedTheme[name] = genVariations(name, colorToInt(value))\n }\n }\n\n if (!isItem) {\n parsedTheme.anchor = anchor || parsedTheme.base || parsedTheme.primary.base\n }\n\n return parsedTheme\n}\n\n/**\n * Generate the CSS for a base color (.primary)\n */\nconst genBaseColor = (name: string, value: string): string => {\n return `\n.v-application .${name} {\n background-color: ${value} !important;\n border-color: ${value} !important;\n}\n.v-application .${name}--text {\n color: ${value} !important;\n caret-color: ${value} !important;\n}`\n}\n\n/**\n * Generate the CSS for a variant color (.primary.darken-2)\n */\nconst genVariantColor = (name: string, variant: string, value: string): string => {\n const [type, n] = variant.split(/(\\d)/, 2)\n return `\n.v-application .${name}.${type}-${n} {\n background-color: ${value} !important;\n border-color: ${value} !important;\n}\n.v-application .${name}--text.text--${type}-${n} {\n color: ${value} !important;\n caret-color: ${value} !important;\n}`\n}\n\nconst genColorVariableName = (name: string, variant = 'base'): string => `--v-${name}-${variant}`\n\nconst genColorVariable = (name: string, variant = 'base'): string => `var(${genColorVariableName(name, variant)})`\n\nexport function genStyles (theme: VuetifyParsedTheme, cssVar = false): string {\n const { anchor, ...variant } = theme\n const colors = Object.keys(variant)\n\n if (!colors.length) return ''\n\n let variablesCss = ''\n let css = ''\n\n const aColor = cssVar ? genColorVariable('anchor') : anchor\n css += `.v-application a { color: ${aColor}; }`\n cssVar && (variablesCss += ` ${genColorVariableName('anchor')}: ${anchor};\\n`)\n\n for (let i = 0; i < colors.length; ++i) {\n const name = colors[i]\n const value = theme[name]\n\n css += genBaseColor(name, cssVar ? genColorVariable(name) : value.base)\n cssVar && (variablesCss += ` ${genColorVariableName(name)}: ${value.base};\\n`)\n\n const variants = keys(value)\n for (let i = 0; i < variants.length; ++i) {\n const variant = variants[i]\n const variantValue = value[variant]\n if (variant === 'base') continue\n\n css += genVariantColor(name, variant, cssVar ? genColorVariable(name, variant) : variantValue)\n cssVar && (variablesCss += ` ${genColorVariableName(name, variant)}: ${variantValue};\\n`)\n }\n }\n\n if (cssVar) {\n variablesCss = `:root {\\n${variablesCss}}\\n\\n`\n }\n\n return variablesCss + css\n}\n\nexport function genVariations (name: string, value: ColorInt): Record<string, string> {\n const values: Record<string, string> = {\n base: intToHex(value),\n }\n\n for (let i = 5; i > 0; --i) {\n values[`lighten${i}`] = intToHex(lighten(value, i))\n }\n\n for (let i = 1; i <= 4; ++i) {\n values[`darken${i}`] = intToHex(darken(value, i))\n }\n\n return values\n}\n\nexport function lighten (value: ColorInt, amount: number): ColorInt {\n const lab = LAB.fromXYZ(sRGB.toXYZ(value))\n lab[0] = lab[0] + amount * 10\n return sRGB.fromXYZ(LAB.toXYZ(lab))\n}\n\nexport function darken (value: ColorInt, amount: number): ColorInt {\n const lab = LAB.fromXYZ(sRGB.toXYZ(value))\n lab[0] = lab[0] - amount * 10\n return sRGB.fromXYZ(LAB.toXYZ(lab))\n}\n","/* eslint-disable no-multi-spaces */\n// Extensions\nimport { Service } from '../service'\n\n// Utilities\nimport * as ThemeUtils from './utils'\nimport { getNestedValue } from '../../util/helpers'\n\n// Types\nimport Vue from 'vue'\nimport { VuetifyPreset } from 'vuetify/types/services/presets'\nimport {\n VuetifyParsedTheme,\n VuetifyThemes,\n VuetifyThemeVariant,\n Theme as ITheme,\n} from 'vuetify/types/services/theme'\n\nexport class Theme extends Service {\n static property: 'theme' = 'theme'\n\n public disabled = false\n\n public options: ITheme['options']\n\n public styleEl?: HTMLStyleElement\n\n public themes: VuetifyThemes\n\n public defaults: VuetifyThemes\n\n private isDark = null as boolean | null\n\n private unwatch = null as (() => void) | null\n\n private vueMeta = null as any | null\n\n constructor (preset: VuetifyPreset) {\n super()\n\n const {\n dark,\n disable,\n options,\n themes,\n } = preset[Theme.property]\n\n this.dark = Boolean(dark)\n this.defaults = this.themes = themes\n this.options = options\n\n if (disable) {\n this.disabled = true\n\n return\n }\n\n this.themes = {\n dark: this.fillVariant(themes.dark, true),\n light: this.fillVariant(themes.light, false),\n }\n }\n\n // When setting css, check for element and apply new values\n /* eslint-disable-next-line accessor-pairs */\n set css (val: string) {\n if (this.vueMeta) {\n if (this.isVueMeta23) {\n this.applyVueMeta23()\n }\n return\n }\n this.checkOrCreateStyleElement() && (this.styleEl!.innerHTML = val)\n }\n\n set dark (val: boolean) {\n const oldDark = this.isDark\n\n this.isDark = val\n // Only apply theme after dark\n // has already been set before\n oldDark != null && this.applyTheme()\n }\n\n get dark () {\n return Boolean(this.isDark)\n }\n\n // Apply current theme default\n // only called on client side\n public applyTheme (): void {\n if (this.disabled) return this.clearCss()\n\n this.css = this.generatedStyles\n }\n\n public clearCss (): void {\n this.css = ''\n }\n\n // Initialize theme for SSR and SPA\n // Attach to ssrContext head or\n // apply new theme to document\n public init (root: Vue, ssrContext?: any): void {\n if (this.disabled) return\n\n /* istanbul ignore else */\n if ((root as any).$meta) {\n this.initVueMeta(root)\n } else if (ssrContext) {\n this.initSSR(ssrContext)\n }\n\n this.initTheme(root)\n }\n\n // Allows for you to set target theme\n public setTheme (theme: 'light' | 'dark', value: object) {\n this.themes[theme] = Object.assign(this.themes[theme], value)\n this.applyTheme()\n }\n\n // Reset theme defaults\n public resetThemes () {\n this.themes.light = Object.assign({}, this.defaults.light)\n this.themes.dark = Object.assign({}, this.defaults.dark)\n this.applyTheme()\n }\n\n // Check for existence of style element\n private checkOrCreateStyleElement (): boolean {\n this.styleEl = document.getElementById('vuetify-theme-stylesheet') as HTMLStyleElement\n\n /* istanbul ignore next */\n if (this.styleEl) return true\n\n this.genStyleElement() // If doesn't have it, create it\n\n return Boolean(this.styleEl)\n }\n\n private fillVariant (\n theme: Partial<VuetifyThemeVariant> = {},\n dark: boolean\n ): VuetifyThemeVariant {\n const defaultTheme = this.themes[dark ? 'dark' : 'light']\n\n return Object.assign({},\n defaultTheme,\n theme\n )\n }\n\n // Generate the style element\n // if applicable\n private genStyleElement (): void {\n /* istanbul ignore if */\n if (typeof document === 'undefined') return\n\n /* istanbul ignore next */\n this.styleEl = document.createElement('style')\n this.styleEl.type = 'text/css'\n this.styleEl.id = 'vuetify-theme-stylesheet'\n\n if (this.options.cspNonce) {\n this.styleEl.setAttribute('nonce', this.options.cspNonce)\n }\n\n document.head.appendChild(this.styleEl)\n }\n\n private initVueMeta (root: any) {\n this.vueMeta = root.$meta()\n if (this.isVueMeta23) {\n // vue-meta needs to apply after mounted()\n root.$nextTick(() => {\n this.applyVueMeta23()\n })\n return\n }\n\n const metaKeyName = typeof this.vueMeta.getOptions === 'function' ? this.vueMeta.getOptions().keyName : 'metaInfo'\n const metaInfo = root.$options[metaKeyName] || {}\n\n root.$options[metaKeyName] = () => {\n metaInfo.style = metaInfo.style || []\n\n const vuetifyStylesheet = metaInfo.style.find((s: any) => s.id === 'vuetify-theme-stylesheet')\n\n if (!vuetifyStylesheet) {\n metaInfo.style.push({\n cssText: this.generatedStyles,\n type: 'text/css',\n id: 'vuetify-theme-stylesheet',\n nonce: (this.options || {}).cspNonce,\n })\n } else {\n vuetifyStylesheet.cssText = this.generatedStyles\n }\n\n return metaInfo\n }\n }\n\n private applyVueMeta23 () {\n const { set } = this.vueMeta.addApp('vuetify')\n\n set({\n style: [{\n cssText: this.generatedStyles,\n type: 'text/css',\n id: 'vuetify-theme-stylesheet',\n nonce: this.options.cspNonce,\n }],\n })\n }\n\n private initSSR (ssrContext?: any) {\n // SSR\n const nonce = this.options.cspNonce ? ` nonce=\"${this.options.cspNonce}\"` : ''\n ssrContext.head = ssrContext.head || ''\n ssrContext.head += `<style type=\"text/css\" id=\"vuetify-theme-stylesheet\"${nonce}>${this.generatedStyles}</style>`\n }\n\n private initTheme (root: Vue) {\n // Only watch for reactivity on client side\n if (typeof document === 'undefined') return\n\n // If we get here somehow, ensure\n // existing instance is removed\n if (this.unwatch) {\n this.unwatch()\n this.unwatch = null\n }\n\n // TODO: Update to use RFC if merged\n // https://github.com/vuejs/rfcs/blob/advanced-reactivity-api/active-rfcs/0000-advanced-reactivity-api.md\n root.$once('hook:created', () => {\n const obs = Vue.observable({ themes: this.themes })\n this.unwatch = root.$watch(() => obs.themes, () => this.applyTheme(), { deep: true })\n })\n this.applyTheme()\n }\n\n get currentTheme () {\n const target = this.dark ? 'dark' : 'light'\n\n return this.themes[target]\n }\n\n get generatedStyles (): string {\n const theme = this.parsedTheme\n /* istanbul ignore next */\n const options = this.options || {}\n let css\n\n if (options.themeCache != null) {\n css = options.themeCache.get(theme)\n /* istanbul ignore if */\n if (css != null) return css\n }\n\n css = ThemeUtils.genStyles(theme, options.customProperties)\n\n if (options.minifyTheme != null) {\n css = options.minifyTheme(css)\n }\n\n if (options.themeCache != null) {\n options.themeCache.set(theme, css)\n }\n\n return css\n }\n\n get parsedTheme (): VuetifyParsedTheme {\n return ThemeUtils.parse(\n this.currentTheme || {},\n undefined,\n getNestedValue(this.options, ['variations'], true)\n )\n }\n\n // Is using v2.3 of vue-meta\n // https://github.com/nuxt/vue-meta/releases/tag/v2.3.0\n private get isVueMeta23 (): boolean {\n return typeof this.vueMeta.addApp === 'function'\n }\n}\n","import { install } from './install'\n\n// Types\nimport Vue from 'vue'\nimport {\n UserVuetifyPreset,\n VuetifyPreset,\n} from 'vuetify/types/services/presets'\nimport {\n VuetifyService,\n VuetifyServiceContract,\n} from 'vuetify/types/services'\n\n// Services\nimport * as services from './services'\n\nexport default class Vuetify {\n static install = install\n\n static installed = false\n\n static version = __VUETIFY_VERSION__\n\n static config = {\n silent: false,\n }\n\n public framework: Dictionary<VuetifyServiceContract> = {\n isHydrating: false,\n } as any\n\n public installed: string[] = []\n\n public preset = {} as VuetifyPreset\n\n public userPreset: UserVuetifyPreset = {}\n\n constructor (userPreset: UserVuetifyPreset = {}) {\n this.userPreset = userPreset\n\n this.use(services.Presets)\n this.use(services.Application)\n this.use(services.Breakpoint)\n this.use(services.Goto)\n this.use(services.Icons)\n this.use(services.Lang)\n this.use(services.Theme)\n }\n\n // Called on the new vuetify instance\n // bootstrap in install beforeCreate\n // Exposes ssrContext if available\n init (root: Vue, ssrContext?: object) {\n this.installed.forEach(property => {\n const service = this.framework[property]\n\n service.framework = this.framework\n\n service.init(root, ssrContext)\n })\n\n // rtl is not installed and\n // will never be called by\n // the init process\n this.framework.rtl = Boolean(this.preset.rtl) as any\n }\n\n // Instantiate a VuetifyService\n use (Service: VuetifyService) {\n const property = Service.property\n\n if (this.installed.includes(property)) return\n\n // TODO maybe a specific type for arg 2?\n this.framework[property] = new Service(this.preset, this as any)\n this.installed.push(property)\n }\n}\n","export default {\n badge: 'Placa',\n close: 'Cerrar',\n dataIterator: {\n noResultsText: 'Ningún elemento coincide con la búsqueda',\n loadingText: 'Cargando...',\n },\n dataTable: {\n itemsPerPageText: 'Filas por página:',\n ariaLabel: {\n sortDescending: 'Orden descendente.',\n sortAscending: 'Orden ascendente.',\n sortNone: 'Sin ordenar.',\n activateNone: 'Pulse para quitar orden.',\n activateDescending: 'Pulse para ordenar de forma descendente.',\n activateAscending: 'Pulse para ordenar de forma ascendente.',\n },\n sortBy: 'Ordenado por',\n },\n dataFooter: {\n itemsPerPageText: 'Elementos por página:',\n itemsPerPageAll: 'Todos',\n nextPage: 'Página siguiente',\n prevPage: 'Página anterior',\n firstPage: 'Primera página',\n lastPage: 'Última página',\n pageText: '{0}-{1} de {2}',\n },\n datePicker: {\n itemsSelected: '{0} seleccionados',\n nextMonthAriaLabel: 'Próximo mes',\n nextYearAriaLabel: 'Próximo año',\n prevMonthAriaLabel: 'Mes anterior',\n prevYearAriaLabel: 'Año anterior',\n },\n noDataText: 'No hay datos disponibles',\n carousel: {\n prev: 'Visual anterior',\n next: 'Visual siguiente',\n ariaLabel: {\n delimiter: 'Visual {0} de {1}',\n },\n },\n calendar: {\n moreEvents: '{0} más',\n },\n fileInput: {\n counter: '{0} archivos',\n counterSize: '{0} archivos ({1} en total)',\n },\n timePicker: {\n am: 'AM',\n pm: 'PM',\n },\n pagination: {\n ariaLabel: {\n wrapper: 'Navegación de paginación',\n next: 'Página siguiente',\n previous: 'Página anterior',\n page: 'Ir a la página {0}',\n currentPage: 'Página actual, página {0}',\n },\n },\n rating: {\n ariaLabel: {\n icon: 'Puntuación {0} de {1}',\n },\n },\n}\n","import { factory as PositionableFactory } from '../positionable'\nimport { TargetProp } from 'vuetify/types/services/application'\n\n// Util\nimport mixins from '../../util/mixins'\n\nexport default function applicationable (value: TargetProp, events: string[] = []) {\n /* @vue/component */\n return mixins(PositionableFactory(['absolute', 'fixed'])).extend({\n name: 'applicationable',\n\n props: {\n app: Boolean,\n },\n\n computed: {\n applicationProperty (): TargetProp {\n return value\n },\n },\n\n watch: {\n // If previous value was app\n // reset the provided prop\n app (x: boolean, prev: boolean) {\n prev\n ? this.removeApplication(true)\n : this.callUpdate()\n },\n applicationProperty (newVal, oldVal) {\n this.$vuetify.application.unregister(this._uid, oldVal)\n },\n },\n\n activated () {\n this.callUpdate()\n },\n\n created () {\n for (let i = 0, length = events.length; i < length; i++) {\n this.$watch(events[i], this.callUpdate)\n }\n this.callUpdate()\n },\n\n mounted () {\n this.callUpdate()\n },\n\n deactivated () {\n this.removeApplication()\n },\n\n destroyed () {\n this.removeApplication()\n },\n\n methods: {\n callUpdate () {\n if (!this.app) return\n\n this.$vuetify.application.register(\n this._uid,\n this.applicationProperty,\n this.updateApplication()\n )\n },\n removeApplication (force = false) {\n if (!force && !this.app) return\n\n this.$vuetify.application.unregister(\n this._uid,\n this.applicationProperty\n )\n },\n updateApplication: () => 0,\n },\n })\n}\n","import Vue from 'vue'\n\n/**\n * This mixin provides `attrs$` and `listeners$` to work around\n * vue bug https://github.com/vuejs/vue/issues/10115\n */\n\nfunction makeWatcher (property: string): ThisType<Vue> & ((val: any, oldVal: any) => void) {\n return function (this: Vue, val, oldVal) {\n for (const attr in oldVal) {\n if (!Object.prototype.hasOwnProperty.call(val, attr)) {\n this.$delete(this.$data[property], attr)\n }\n }\n for (const attr in val) {\n this.$set(this.$data[property], attr, val[attr])\n }\n }\n}\n\nexport default Vue.extend({\n data: () => ({\n attrs$: {} as Dictionary<string>,\n listeners$: {} as Dictionary<Function | Function[]>,\n }),\n\n created () {\n // Work around unwanted re-renders: https://github.com/vuejs/vue/issues/10115\n // Make sure to use `attrs$` instead of `$attrs` (confusing right?)\n this.$watch('$attrs', makeWatcher('attrs$'), { immediate: true })\n this.$watch('$listeners', makeWatcher('listeners$'), { immediate: true })\n },\n})\n","// Utilities\nimport { removed } from '../../util/console'\n\n// Types\nimport Vue, { VNode } from 'vue'\ninterface Toggleable extends Vue {\n isActive?: boolean\n}\n\n/**\n * Bootable\n * @mixin\n *\n * Used to add lazy content functionality to components\n * Looks for change in \"isActive\" to automatically boot\n * Otherwise can be set manually\n */\n/* @vue/component */\nexport default Vue.extend<Vue & Toggleable>().extend({\n name: 'bootable',\n\n props: {\n eager: Boolean,\n },\n\n data: () => ({\n isBooted: false,\n }),\n\n computed: {\n hasContent (): boolean | undefined {\n return this.isBooted || this.eager || this.isActive\n },\n },\n\n watch: {\n isActive () {\n this.isBooted = true\n },\n },\n\n created () {\n /* istanbul ignore next */\n if ('lazy' in this.$attrs) {\n removed('lazy', this)\n }\n },\n\n methods: {\n showLazyContent (content?: () => VNode[]): VNode[] {\n return (this.hasContent && content) ? content() : [this.$createElement()]\n },\n },\n})\n","// Extensions\nimport { BaseItemGroup } from '../../components/VItemGroup/VItemGroup'\n\n/* @vue/component */\nexport default BaseItemGroup.extend({\n name: 'button-group',\n\n provide (): object {\n return {\n btnToggle: this,\n }\n },\n\n computed: {\n classes (): object {\n return BaseItemGroup.options.computed.classes.call(this)\n },\n },\n\n methods: {\n // Isn't being passed down through types\n genData: BaseItemGroup.options.methods.genData,\n },\n})\n","import Vue from 'vue'\nimport { VNodeData } from 'vue/types/vnode'\nimport { consoleError } from '../../util/console'\nimport { isCssColor } from '../../util/colorUtils'\n\nexport default Vue.extend({\n name: 'colorable',\n\n props: {\n color: String,\n },\n\n methods: {\n setBackgroundColor (color?: string | false, data: VNodeData = {}): VNodeData {\n if (typeof data.style === 'string') {\n // istanbul ignore next\n consoleError('style must be an object', this)\n // istanbul ignore next\n return data\n }\n if (typeof data.class === 'string') {\n // istanbul ignore next\n consoleError('class must be an object', this)\n // istanbul ignore next\n return data\n }\n if (isCssColor(color)) {\n data.style = {\n ...data.style as object,\n 'background-color': `${color}`,\n 'border-color': `${color}`,\n }\n } else if (color) {\n data.class = {\n ...data.class,\n [color]: true,\n }\n }\n\n return data\n },\n\n setTextColor (color?: string | false, data: VNodeData = {}): VNodeData {\n if (typeof data.style === 'string') {\n // istanbul ignore next\n consoleError('style must be an object', this)\n // istanbul ignore next\n return data\n }\n if (typeof data.class === 'string') {\n // istanbul ignore next\n consoleError('class must be an object', this)\n // istanbul ignore next\n return data\n }\n if (isCssColor(color)) {\n data.style = {\n ...data.style as object,\n color: `${color}`,\n 'caret-color': `${color}`,\n }\n } else if (color) {\n const [colorName, colorModifier] = color.toString().trim().split(' ', 2) as (string | undefined)[]\n data.class = {\n ...data.class,\n [colorName + '--text']: true,\n }\n if (colorModifier) {\n data.class['text--' + colorModifier] = true\n }\n }\n return data\n },\n },\n})\n","import Vue from 'vue'\nimport { PropValidator } from 'vue/types/options'\nimport { deepEqual } from '../../util/helpers'\n\nexport default Vue.extend({\n name: 'comparable',\n props: {\n valueComparator: {\n type: Function,\n default: deepEqual,\n } as PropValidator<typeof deepEqual>,\n },\n})\n","import Vue from 'vue'\n\nimport mixins from '../../util/mixins'\nimport { VOverlay } from '../../components/VOverlay'\n\ninterface options {\n $el: HTMLElement\n $refs: {\n content?: HTMLElement\n }\n overlay?: InstanceType<typeof VOverlay>\n}\n\ninterface DependentInstance extends Vue {\n isActive?: boolean\n isDependent?: boolean\n}\n\nfunction searchChildren (children: Vue[]): DependentInstance[] {\n const results = []\n for (let index = 0; index < children.length; index++) {\n const child = children[index] as DependentInstance\n if (child.isActive && child.isDependent) {\n results.push(child)\n } else {\n results.push(...searchChildren(child.$children))\n }\n }\n\n return results\n}\n\n/* @vue/component */\nexport default mixins<Vue & options>().extend({\n name: 'dependent',\n\n data () {\n return {\n closeDependents: true,\n isActive: false,\n isDependent: true,\n }\n },\n\n watch: {\n isActive (val) {\n if (val) return\n\n const openDependents = this.getOpenDependents()\n for (let index = 0; index < openDependents.length; index++) {\n openDependents[index].isActive = false\n }\n },\n },\n\n methods: {\n getOpenDependents (): any[] {\n if (this.closeDependents) return searchChildren(this.$children)\n\n return []\n },\n getOpenDependentElements (): HTMLElement[] {\n const result = []\n const openDependents = this.getOpenDependents()\n\n for (let index = 0; index < openDependents.length; index++) {\n result.push(...openDependents[index].getClickableDependentElements())\n }\n\n return result\n },\n getClickableDependentElements (): HTMLElement[] {\n const result = [this.$el]\n if (this.$refs.content) result.push(this.$refs.content)\n if (this.overlay) result.push(this.overlay.$el as HTMLElement)\n result.push(...this.getOpenDependentElements())\n\n return result\n },\n },\n})\n","import Vue from 'vue'\n\nexport default Vue.extend({\n name: 'elevatable',\n\n props: {\n elevation: [Number, String],\n },\n\n computed: {\n computedElevation (): string | number | undefined {\n return this.elevation\n },\n elevationClasses (): Record<string, boolean> {\n const elevation = this.computedElevation\n\n if (elevation == null) return {}\n if (isNaN(parseInt(elevation))) return {}\n return { [`elevation-${this.elevation}`]: true }\n },\n },\n})\n","// Mixins\nimport { Registrable, inject as RegistrableInject } from '../registrable'\n\n// Utilities\nimport { ExtractVue } from '../../util/mixins'\nimport { VueConstructor } from 'vue'\nimport { PropValidator } from 'vue/types/options'\n\nexport type Groupable<T extends string, C extends VueConstructor | null = null> = VueConstructor<ExtractVue<Registrable<T, C>> & {\n activeClass: string\n isActive: boolean\n disabled: boolean\n groupClasses: object\n toggle (): void\n}>\n\nexport function factory<T extends string, C extends VueConstructor | null = null> (\n namespace: T,\n child?: string,\n parent?: string\n): Groupable<T, C> {\n return RegistrableInject<T, C>(namespace, child, parent).extend({\n name: 'groupable',\n\n props: {\n activeClass: {\n type: String,\n default (): string | undefined {\n if (!this[namespace]) return undefined\n\n return this[namespace].activeClass\n },\n } as any as PropValidator<string>,\n disabled: Boolean,\n },\n\n data () {\n return {\n isActive: false,\n }\n },\n\n computed: {\n groupClasses (): object {\n if (!this.activeClass) return {}\n\n return {\n [this.activeClass]: this.isActive,\n }\n },\n },\n\n created () {\n this[namespace] && (this[namespace] as any).register(this)\n },\n\n beforeDestroy () {\n this[namespace] && (this[namespace] as any).unregister(this)\n },\n\n methods: {\n toggle () {\n this.$emit('change')\n },\n },\n })\n}\n\n/* eslint-disable-next-line @typescript-eslint/no-redeclare */\nconst Groupable = factory('itemGroup')\n\nexport default Groupable\n","import Vue, { VNode } from 'vue'\nimport VProgressLinear from '../../components/VProgressLinear'\n\ninterface colorable extends Vue {\n color?: string\n}\n\n/**\n * Loadable\n *\n * @mixin\n *\n * Used to add linear progress bar to components\n * Can use a default bar with a specific color\n * or designate a custom progress linear bar\n */\n/* @vue/component */\nexport default Vue.extend<colorable>().extend({\n name: 'loadable',\n\n props: {\n loading: {\n type: [Boolean, String],\n default: false,\n },\n loaderHeight: {\n type: [Number, String],\n default: 2,\n },\n },\n\n methods: {\n genProgress (): VNode | VNode[] | null {\n if (this.loading === false) return null\n\n return this.$slots.progress || this.$createElement(VProgressLinear, {\n props: {\n absolute: true,\n color: (this.loading === true || this.loading === '')\n ? (this.color || 'primary')\n : this.loading,\n height: this.loaderHeight,\n indeterminate: true,\n },\n })\n },\n },\n})\n","// Helpers\nimport { convertToUnit } from '../../util/helpers'\n\n// Types\nimport Vue, { PropType } from 'vue'\n\nexport type NumberOrNumberString = PropType<string | number | undefined>\n\nexport default Vue.extend({\n name: 'measurable',\n\n props: {\n height: [Number, String] as NumberOrNumberString,\n maxHeight: [Number, String] as NumberOrNumberString,\n maxWidth: [Number, String] as NumberOrNumberString,\n minHeight: [Number, String] as NumberOrNumberString,\n minWidth: [Number, String] as NumberOrNumberString,\n width: [Number, String] as NumberOrNumberString,\n },\n\n computed: {\n measurableStyles (): object {\n const styles: Record<string, string> = {}\n\n const height = convertToUnit(this.height)\n const minHeight = convertToUnit(this.minHeight)\n const minWidth = convertToUnit(this.minWidth)\n const maxHeight = convertToUnit(this.maxHeight)\n const maxWidth = convertToUnit(this.maxWidth)\n const width = convertToUnit(this.width)\n\n if (height) styles.height = height\n if (minHeight) styles.minHeight = minHeight\n if (minWidth) styles.minWidth = minWidth\n if (maxHeight) styles.maxHeight = maxHeight\n if (maxWidth) styles.maxWidth = maxWidth\n if (width) styles.width = width\n\n return styles\n },\n },\n})\n","// Styles\nimport './VOverlay.sass'\n\n// Mixins\nimport Colorable from './../../mixins/colorable'\nimport Themeable from '../../mixins/themeable'\nimport Toggleable from './../../mixins/toggleable'\n\n// Utilities\nimport mixins from '../../util/mixins'\n\n// Types\nimport { VNode } from 'vue'\n\n/* @vue/component */\nexport default mixins(\n Colorable,\n Themeable,\n Toggleable\n).extend({\n name: 'v-overlay',\n\n props: {\n absolute: Boolean,\n color: {\n type: String,\n default: '#212121',\n },\n dark: {\n type: Boolean,\n default: true,\n },\n opacity: {\n type: [Number, String],\n default: 0.46,\n },\n value: {\n default: true,\n },\n zIndex: {\n type: [Number, String],\n default: 5,\n },\n },\n\n computed: {\n __scrim (): VNode {\n const data = this.setBackgroundColor(this.color, {\n staticClass: 'v-overlay__scrim',\n style: {\n opacity: this.computedOpacity,\n },\n })\n\n return this.$createElement('div', data)\n },\n classes (): object {\n return {\n 'v-overlay--absolute': this.absolute,\n 'v-overlay--active': this.isActive,\n ...this.themeClasses,\n }\n },\n computedOpacity (): number {\n return Number(this.isActive ? this.opacity : 0)\n },\n styles (): object {\n return {\n zIndex: this.zIndex,\n }\n },\n },\n\n methods: {\n genContent () {\n return this.$createElement('div', {\n staticClass: 'v-overlay__content',\n }, this.$slots.default)\n },\n },\n\n render (h): VNode {\n const children = [this.__scrim]\n\n if (this.isActive) children.push(this.genContent())\n\n return h('div', {\n staticClass: 'v-overlay',\n on: this.$listeners,\n class: this.classes,\n style: this.styles,\n }, children)\n },\n})\n","import VOverlay from './VOverlay'\n\nexport { VOverlay }\n\nexport default VOverlay\n","// Components\nimport VOverlay from '../../components/VOverlay'\n\n// Utilities\nimport {\n keyCodes,\n addOnceEventListener,\n addPassiveEventListener,\n getZIndex,\n composedPath,\n} from '../../util/helpers'\n\n// Types\nimport Vue from 'vue'\n\ninterface Toggleable extends Vue {\n isActive?: boolean\n}\n\ninterface Stackable extends Vue {\n activeZIndex: number\n}\n\ninterface options {\n absolute?: boolean\n $refs: {\n dialog?: HTMLElement\n content?: HTMLElement\n }\n}\n\n/* @vue/component */\nexport default Vue.extend<Vue & Toggleable & Stackable & options>().extend({\n name: 'overlayable',\n\n props: {\n hideOverlay: Boolean,\n overlayColor: String,\n overlayOpacity: [Number, String],\n },\n\n data () {\n return {\n animationFrame: 0,\n overlay: null as InstanceType<typeof VOverlay> | null,\n }\n },\n\n watch: {\n hideOverlay (value) {\n if (!this.isActive) return\n\n if (value) this.removeOverlay()\n else this.genOverlay()\n },\n },\n\n beforeDestroy () {\n this.removeOverlay()\n },\n\n methods: {\n createOverlay () {\n const overlay = new VOverlay({\n propsData: {\n absolute: this.absolute,\n value: false,\n color: this.overlayColor,\n opacity: this.overlayOpacity,\n },\n })\n\n overlay.$mount()\n\n const parent = this.absolute\n ? this.$el.parentNode\n : document.querySelector('[data-app]')\n\n parent && parent.insertBefore(overlay.$el, parent.firstChild)\n\n this.overlay = overlay\n },\n genOverlay () {\n this.hideScroll()\n\n if (this.hideOverlay) return\n\n if (!this.overlay) this.createOverlay()\n\n this.animationFrame = requestAnimationFrame(() => {\n if (!this.overlay) return\n\n if (this.activeZIndex !== undefined) {\n this.overlay.zIndex = String(this.activeZIndex - 1)\n } else if (this.$el) {\n this.overlay.zIndex = getZIndex(this.$el)\n }\n\n this.overlay.value = true\n })\n\n return true\n },\n /** removeOverlay(false) will not restore the scollbar afterwards */\n removeOverlay (showScroll = true) {\n if (this.overlay) {\n addOnceEventListener(this.overlay.$el, 'transitionend', () => {\n if (\n !this.overlay ||\n !this.overlay.$el ||\n !this.overlay.$el.parentNode ||\n this.overlay.value ||\n this.isActive\n ) return\n\n this.overlay.$el.parentNode.removeChild(this.overlay.$el)\n this.overlay.$destroy()\n this.overlay = null\n })\n\n // Cancel animation frame in case\n // overlay is removed before it\n // has finished its animation\n cancelAnimationFrame(this.animationFrame)\n\n this.overlay.value = false\n }\n\n showScroll && this.showScroll()\n },\n scrollListener (e: WheelEvent | KeyboardEvent) {\n if ('key' in e) {\n if (\n ['INPUT', 'TEXTAREA', 'SELECT'].includes((e.target as Element).tagName) ||\n // https://github.com/vuetifyjs/vuetify/issues/4715\n (e.target as HTMLElement).isContentEditable\n ) return\n\n const up = [keyCodes.up, keyCodes.pageup]\n const down = [keyCodes.down, keyCodes.pagedown]\n\n if (up.includes(e.keyCode)) {\n (e as any).deltaY = -1\n } else if (down.includes(e.keyCode)) {\n (e as any).deltaY = 1\n } else {\n return\n }\n }\n\n if (e.target === this.overlay ||\n (e.type !== 'keydown' && e.target === document.body) ||\n this.checkPath(e as WheelEvent)) e.preventDefault()\n },\n hasScrollbar (el?: Element) {\n if (!el || el.nodeType !== Node.ELEMENT_NODE) return false\n\n const style = window.getComputedStyle(el)\n return ((['auto', 'scroll'].includes(style.overflowY!) || el.tagName === 'SELECT') && el.scrollHeight > el.clientHeight) ||\n ((['auto', 'scroll'].includes(style.overflowX!)) && el.scrollWidth > el.clientWidth)\n },\n shouldScroll (el: Element, e: WheelEvent): boolean {\n if (el.hasAttribute('data-app')) return false\n\n const dir = e.shiftKey || e.deltaX ? 'x' : 'y'\n const delta = dir === 'y' ? e.deltaY : e.deltaX || e.deltaY\n\n let alreadyAtStart: boolean\n let alreadyAtEnd: boolean\n if (dir === 'y') {\n alreadyAtStart = el.scrollTop === 0\n alreadyAtEnd = el.scrollTop + el.clientHeight === el.scrollHeight\n } else {\n alreadyAtStart = el.scrollLeft === 0\n alreadyAtEnd = el.scrollLeft + el.clientWidth === el.scrollWidth\n }\n\n const scrollingUp = delta < 0\n const scrollingDown = delta > 0\n\n if (!alreadyAtStart && scrollingUp) return true\n if (!alreadyAtEnd && scrollingDown) return true\n if ((alreadyAtStart || alreadyAtEnd)) {\n return this.shouldScroll(el.parentNode as Element, e)\n }\n\n return false\n },\n isInside (el: Element, parent: Element): boolean {\n if (el === parent) {\n return true\n } else if (el === null || el === document.body) {\n return false\n } else {\n return this.isInside(el.parentNode as Element, parent)\n }\n },\n checkPath (e: WheelEvent) {\n const path = composedPath(e)\n\n if (e.type === 'keydown' && path[0] === document.body) {\n const dialog = this.$refs.dialog\n // getSelection returns null in firefox in some edge cases, can be ignored\n const selected = window.getSelection()!.anchorNode as Element\n if (dialog && this.hasScrollbar(dialog) && this.isInside(selected, dialog)) {\n return !this.shouldScroll(dialog, e)\n }\n return true\n }\n\n for (let index = 0; index < path.length; index++) {\n const el = path[index]\n\n if (el === document) return true\n if (el === document.documentElement) return true\n if (el === this.$refs.content) return true\n\n if (this.hasScrollbar(el as Element)) return !this.shouldScroll(el as Element, e)\n }\n\n return true\n },\n hideScroll () {\n if (this.$vuetify.breakpoint.smAndDown) {\n document.documentElement!.classList.add('overflow-y-hidden')\n } else {\n addPassiveEventListener(window, 'wheel', this.scrollListener, { passive: false })\n window.addEventListener('keydown', this.scrollListener)\n }\n },\n showScroll () {\n document.documentElement!.classList.remove('overflow-y-hidden')\n window.removeEventListener('wheel', this.scrollListener)\n window.removeEventListener('keydown', this.scrollListener)\n },\n },\n})\n","import Vue from 'vue'\nimport { filterObjectOnKeys } from '../../util/helpers'\nimport { OptionsVue, VueConstructor } from 'vue/types/vue'\n\nconst availableProps = {\n absolute: Boolean,\n bottom: Boolean,\n fixed: Boolean,\n left: Boolean,\n right: Boolean,\n top: Boolean,\n}\ntype props = Record<keyof typeof availableProps, boolean>\n\nexport type Positionable<S extends keyof props> = VueConstructor<Vue & { [P in S]: boolean }, { [P in S]: BooleanConstructor }>\n\nexport function factory <S extends keyof props> (selected?: S[]): Positionable<S>\nexport function factory (selected: undefined): OptionsVue<Vue, {}, {}, {}, props, typeof availableProps>\nexport function factory (selected: any[] = []): any {\n return Vue.extend({\n name: 'positionable',\n props: selected.length ? filterObjectOnKeys(availableProps, selected) : availableProps,\n })\n}\n\nexport default factory()\n\n// Add a `*` before the second `/`\n/* Tests /\nlet single = factory(['top']).extend({\n created () {\n this.top\n this.bottom\n this.absolute\n }\n})\n\nlet some = factory(['top', 'bottom']).extend({\n created () {\n this.top\n this.bottom\n this.absolute\n }\n})\n\nlet all = factory().extend({\n created () {\n this.top\n this.bottom\n this.absolute\n this.foobar\n }\n})\n/**/\n","import Vue, { VueConstructor } from 'vue'\n\nexport type Proxyable<T extends string = 'value'> = VueConstructor<Vue & {\n internalLazyValue: unknown\n internalValue: unknown\n} & Record<T, any>>\n\nexport function factory<T extends string = 'value'> (prop?: T, event?: string): Proxyable<T>\nexport function factory (\n prop = 'value',\n event = 'change'\n) {\n return Vue.extend({\n name: 'proxyable',\n\n model: {\n prop,\n event,\n },\n\n props: {\n [prop]: {\n required: false,\n },\n },\n\n data () {\n return {\n internalLazyValue: this[prop] as unknown,\n }\n },\n\n computed: {\n internalValue: {\n get (): unknown {\n return this.internalLazyValue\n },\n set (val: any) {\n if (val === this.internalLazyValue) return\n\n this.internalLazyValue = val\n\n this.$emit(event, val)\n },\n },\n },\n\n watch: {\n [prop] (val) {\n this.internalLazyValue = val\n },\n },\n })\n}\n\n/* eslint-disable-next-line @typescript-eslint/no-redeclare */\nconst Proxyable = factory()\n\nexport default Proxyable\n","import Vue from 'vue'\nimport { VueConstructor } from 'vue/types/vue'\nimport { consoleWarn } from '../../util/console'\n\nfunction generateWarning (child: string, parent: string) {\n return () => consoleWarn(`The ${child} component must be used inside a ${parent}`)\n}\n\nexport type Registrable<T extends string, C extends VueConstructor | null = null> = VueConstructor<Vue & {\n [K in T]: C extends VueConstructor ? InstanceType<C> : {\n register (...props: any[]): void\n unregister (self: any): void\n }\n}>\n\nexport function inject<\n T extends string, C extends VueConstructor | null = null\n> (namespace: T, child?: string, parent?: string): Registrable<T, C> {\n const defaultImpl = child && parent ? {\n register: generateWarning(child, parent),\n unregister: generateWarning(child, parent),\n } : null\n\n return Vue.extend({\n name: 'registrable-inject',\n\n inject: {\n [namespace]: {\n default: defaultImpl,\n },\n },\n })\n}\n\nexport function provide (namespace: string, self = false) {\n return Vue.extend({\n name: 'registrable-provide',\n\n provide (): object {\n return {\n [namespace]: self ? this : {\n register: (this as any).register,\n unregister: (this as any).unregister,\n },\n }\n },\n })\n}\n","import Vue from 'vue'\n\n/* @vue/component */\nexport default Vue.extend({\n name: 'roundable',\n\n props: {\n rounded: [Boolean, String],\n tile: Boolean,\n },\n\n computed: {\n roundedClasses (): Record<string, boolean> {\n const composite = []\n const rounded = typeof this.rounded === 'string'\n ? String(this.rounded)\n : this.rounded === true\n\n if (this.tile) {\n composite.push('rounded-0')\n } else if (typeof rounded === 'string') {\n const values = rounded.split(' ')\n\n for (const value of values) {\n composite.push(`rounded-${value}`)\n }\n } else if (rounded) {\n composite.push('rounded')\n }\n\n return composite.length > 0 ? {\n [composite.join(' ')]: true,\n } : {}\n },\n },\n})\n","import Vue, { VNodeData, PropType } from 'vue'\n\n// Directives\nimport Ripple, { RippleOptions } from '../../directives/ripple'\n\n// Utilities\nimport { getObjectValueByPath } from '../../util/helpers'\n\nexport default Vue.extend({\n name: 'routable',\n\n directives: {\n Ripple,\n },\n\n props: {\n activeClass: String,\n append: Boolean,\n disabled: Boolean,\n exact: {\n type: Boolean as PropType<boolean | undefined>,\n default: undefined,\n },\n exactPath: Boolean,\n exactActiveClass: String,\n link: Boolean,\n href: [String, Object],\n to: [String, Object],\n nuxt: Boolean,\n replace: Boolean,\n ripple: {\n type: [Boolean, Object],\n default: null,\n },\n tag: String,\n target: String,\n },\n\n data: () => ({\n isActive: false,\n proxyClass: '',\n }),\n\n computed: {\n classes (): object {\n const classes: Record<string, boolean> = {}\n\n if (this.to) return classes\n\n if (this.activeClass) classes[this.activeClass] = this.isActive\n if (this.proxyClass) classes[this.proxyClass] = this.isActive\n\n return classes\n },\n computedRipple (): RippleOptions | boolean {\n return this.ripple ?? (!this.disabled && this.isClickable)\n },\n isClickable (): boolean {\n if (this.disabled) return false\n\n return Boolean(\n this.isLink ||\n this.$listeners.click ||\n this.$listeners['!click'] ||\n this.$attrs.tabindex\n )\n },\n isLink (): boolean {\n return this.to || this.href || this.link\n },\n styles: () => ({}),\n },\n\n watch: {\n $route: 'onRouteChange',\n },\n\n mounted () {\n this.onRouteChange()\n },\n\n methods: {\n generateRouteLink () {\n let exact = this.exact\n let tag\n\n const data: VNodeData = {\n attrs: {\n tabindex: 'tabindex' in this.$attrs ? this.$attrs.tabindex : undefined,\n },\n class: this.classes,\n style: this.styles,\n props: {},\n directives: [{\n name: 'ripple',\n value: this.computedRipple,\n }],\n [this.to ? 'nativeOn' : 'on']: {\n ...this.$listeners,\n ...('click' in this ? { click: (this as any).click } : undefined), // #14447\n },\n ref: 'link',\n }\n\n if (typeof this.exact === 'undefined') {\n exact = this.to === '/' ||\n (this.to === Object(this.to) && this.to.path === '/')\n }\n\n if (this.to) {\n // Add a special activeClass hook\n // for component level styles\n let activeClass = this.activeClass\n let exactActiveClass = this.exactActiveClass || activeClass\n\n if (this.proxyClass) {\n activeClass = `${activeClass} ${this.proxyClass}`.trim()\n exactActiveClass = `${exactActiveClass} ${this.proxyClass}`.trim()\n }\n\n tag = this.nuxt ? 'nuxt-link' : 'router-link'\n Object.assign(data.props, {\n to: this.to,\n exact,\n exactPath: this.exactPath,\n activeClass,\n exactActiveClass,\n append: this.append,\n replace: this.replace,\n })\n } else {\n tag = (this.href && 'a') || this.tag || 'div'\n\n if (tag === 'a' && this.href) data.attrs!.href = this.href\n }\n\n if (this.target) data.attrs!.target = this.target\n\n return { tag, data }\n },\n onRouteChange () {\n if (!this.to || !this.$refs.link || !this.$route) return\n const activeClass = `${this.activeClass || ''} ${this.proxyClass || ''}`.trim()\n const exactActiveClass = `${this.exactActiveClass || ''} ${this.proxyClass || ''}`.trim() || activeClass\n\n const path = '_vnode.data.class.' + (this.exact ? exactActiveClass : activeClass)\n\n this.$nextTick(() => {\n /* istanbul ignore else */\n if (!getObjectValueByPath(this.$refs.link, path) === this.isActive) {\n this.toggle()\n }\n })\n },\n toggle () {\n this.isActive = !this.isActive\n },\n },\n})\n","import Vue from 'vue'\n\nexport default Vue.extend({\n name: 'sizeable',\n\n props: {\n large: Boolean,\n small: Boolean,\n xLarge: Boolean,\n xSmall: Boolean,\n },\n\n computed: {\n medium (): boolean {\n return Boolean(\n !this.xSmall &&\n !this.small &&\n !this.large &&\n !this.xLarge\n )\n },\n sizeableClasses (): object {\n return {\n 'v-size--x-small': this.xSmall,\n 'v-size--small': this.small,\n 'v-size--default': this.medium,\n 'v-size--large': this.large,\n 'v-size--x-large': this.xLarge,\n }\n },\n },\n})\n","import Vue from 'vue'\n\n/**\n * SSRBootable\n *\n * @mixin\n *\n * Used in layout components (drawer, toolbar, content)\n * to avoid an entry animation when using SSR\n */\nexport default Vue.extend({\n name: 'ssr-bootable',\n\n data: () => ({\n isBooted: false,\n }),\n\n mounted () {\n // Use setAttribute instead of dataset\n // because dataset does not work well\n // with unit tests\n window.requestAnimationFrame(() => {\n this.$el.setAttribute('data-booted', 'true')\n this.isBooted = true\n })\n },\n})\n","import Vue from 'vue'\nimport { PropType, RenderContext } from 'vue/types/options'\n\ninterface options extends Vue {\n theme: {\n isDark: boolean\n }\n}\n\n/* @vue/component */\nconst Themeable = Vue.extend<options>().extend({\n name: 'themeable',\n\n provide (): object {\n return {\n theme: this.themeableProvide,\n }\n },\n\n inject: {\n theme: {\n default: {\n isDark: false,\n },\n },\n },\n\n props: {\n dark: {\n type: Boolean as PropType<boolean | null>,\n default: null,\n },\n light: {\n type: Boolean as PropType<boolean | null>,\n default: null,\n },\n },\n\n data () {\n return {\n themeableProvide: {\n isDark: false,\n },\n }\n },\n\n computed: {\n appIsDark (): boolean {\n return this.$vuetify.theme.dark || false\n },\n isDark (): boolean {\n if (this.dark === true) {\n // explicitly dark\n return true\n } else if (this.light === true) {\n // explicitly light\n return false\n } else {\n // inherit from parent, or default false if there is none\n return this.theme.isDark\n }\n },\n themeClasses (): object {\n return {\n 'theme--dark': this.isDark,\n 'theme--light': !this.isDark,\n }\n },\n /** Used by menus and dialogs, inherits from v-app instead of the parent */\n rootIsDark (): boolean {\n if (this.dark === true) {\n // explicitly dark\n return true\n } else if (this.light === true) {\n // explicitly light\n return false\n } else {\n // inherit from v-app\n return this.appIsDark\n }\n },\n rootThemeClasses (): Dictionary<boolean> {\n return {\n 'theme--dark': this.rootIsDark,\n 'theme--light': !this.rootIsDark,\n }\n },\n },\n\n watch: {\n isDark: {\n handler (newVal, oldVal) {\n if (newVal !== oldVal) {\n this.themeableProvide.isDark = this.isDark\n }\n },\n immediate: true,\n },\n },\n})\n\nexport default Themeable\n\nexport function functionalThemeClasses (context: RenderContext): object {\n const vm = {\n ...context.props,\n ...context.injections,\n }\n const isDark = Themeable.options.computed.isDark.call(vm)\n return Themeable.options.computed.themeClasses.call({ isDark })\n}\n","import Vue, { VueConstructor } from 'vue'\n\nexport type Toggleable<T extends string = 'value'> = VueConstructor<Vue & { isActive: boolean } & Record<T, any>>\n\nexport function factory<T extends string = 'value'> (prop?: T, event?: string): Toggleable<T>\nexport function factory (prop = 'value', event = 'input') {\n return Vue.extend({\n name: 'toggleable',\n\n model: { prop, event },\n\n props: {\n [prop]: { required: false },\n },\n\n data () {\n return {\n isActive: !!this[prop],\n }\n },\n\n watch: {\n [prop] (val) {\n this.isActive = !!val\n },\n isActive (val) {\n !!val !== this[prop] && this.$emit(event, val)\n },\n },\n })\n}\n\n/* eslint-disable-next-line @typescript-eslint/no-redeclare */\nconst Toggleable = factory()\n\nexport default Toggleable\n","export type EasingFunction = (t: number) => number\n\n// linear\nexport const linear = (t: number) => t\n// accelerating from zero velocity\nexport const easeInQuad = (t: number) => t ** 2\n// decelerating to zero velocity\nexport const easeOutQuad = (t: number) => t * (2 - t)\n// acceleration until halfway, then deceleration\nexport const easeInOutQuad = (t: number) => (t < 0.5 ? 2 * t ** 2 : -1 + (4 - 2 * t) * t)\n// accelerating from zero velocity\nexport const easeInCubic = (t: number) => t ** 3\n// decelerating to zero velocity\nexport const easeOutCubic = (t: number) => --t ** 3 + 1\n// acceleration until halfway, then deceleration\nexport const easeInOutCubic = (t: number) => t < 0.5 ? 4 * t ** 3 : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1\n// accelerating from zero velocity\nexport const easeInQuart = (t: number) => t ** 4\n// decelerating to zero velocity\nexport const easeOutQuart = (t: number) => 1 - --t ** 4\n// acceleration until halfway, then deceleration\nexport const easeInOutQuart = (t: number) => (t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t)\n// accelerating from zero velocity\nexport const easeInQuint = (t: number) => t ** 5\n// decelerating to zero velocity\nexport const easeOutQuint = (t: number) => 1 + --t ** 5\n// acceleration until halfway, then deceleration\nexport const easeInOutQuint = (t: number) => t < 0.5 ? 16 * t ** 5 : 1 + 16 * --t ** 5\n","import Vue from 'vue'\n\n// Return target's cumulative offset from the top\nexport function getOffset (target: any): number {\n if (typeof target === 'number') {\n return target\n }\n\n let el = $(target)\n if (!el) {\n throw typeof target === 'string'\n ? new Error(`Target element \"${target}\" not found.`)\n : new TypeError(`Target must be a Number/Selector/HTMLElement/VueComponent, received ${type(target)} instead.`)\n }\n\n let totalOffset = 0\n while (el) {\n totalOffset += el.offsetTop\n el = el.offsetParent as HTMLElement\n }\n\n return totalOffset\n}\n\nexport function getContainer (container: any): HTMLElement {\n const el = $(container)\n\n if (el) return el\n\n throw typeof container === 'string'\n ? new Error(`Container element \"${container}\" not found.`)\n : new TypeError(`Container must be a Selector/HTMLElement/VueComponent, received ${type(container)} instead.`)\n}\n\nfunction type (el: any) {\n return el == null ? el : el.constructor.name\n}\n\nfunction $ (el: any): HTMLElement | null {\n if (typeof el === 'string') {\n return document.querySelector<HTMLElement>(el)\n } else if (el && el._isVue) {\n return (el as Vue).$el as HTMLElement\n } else if (el instanceof HTMLElement) {\n return el\n } else {\n return null\n }\n}\n","// Extensions\nimport { Service } from '../service'\n\n// Utilities\nimport * as easingPatterns from './easing-patterns'\nimport {\n getContainer,\n getOffset,\n} from './util'\n\n// Types\nimport { GoToOptions, VuetifyGoToTarget } from 'vuetify/types/services/goto'\n\nimport { VuetifyServiceContract } from 'vuetify/types/services'\n\nexport default function goTo (\n _target: VuetifyGoToTarget,\n _settings: GoToOptions = {}\n): Promise<number> {\n const settings: GoToOptions = {\n container: (document.scrollingElement as HTMLElement | null) || document.body || document.documentElement,\n duration: 500,\n offset: 0,\n easing: 'easeInOutCubic',\n appOffset: true,\n ..._settings,\n }\n const container = getContainer(settings.container)\n\n /* istanbul ignore else */\n if (settings.appOffset && goTo.framework.application) {\n const isDrawer = container.classList.contains('v-navigation-drawer')\n const isClipped = container.classList.contains('v-navigation-drawer--clipped')\n const { bar, top } = goTo.framework.application as any\n\n settings.offset += bar\n /* istanbul ignore else */\n if (!isDrawer || isClipped) settings.offset += top\n }\n\n const startTime = performance.now()\n\n let targetLocation: number\n if (typeof _target === 'number') {\n targetLocation = getOffset(_target) - settings.offset!\n } else {\n targetLocation = getOffset(_target) - getOffset(container) - settings.offset!\n }\n\n const startLocation = container.scrollTop\n if (targetLocation === startLocation) return Promise.resolve(targetLocation)\n\n const ease = typeof settings.easing === 'function'\n ? settings.easing\n : easingPatterns[settings.easing!]\n /* istanbul ignore else */\n if (!ease) throw new TypeError(`Easing function \"${settings.easing}\" not found.`)\n\n // Cannot be tested properly in jsdom\n /* istanbul ignore next */\n return new Promise(resolve => requestAnimationFrame(function step (currentTime: number) {\n const timeElapsed = currentTime - startTime\n const progress = Math.abs(settings.duration ? Math.min(timeElapsed / settings.duration, 1) : 1)\n\n container.scrollTop = Math.floor(startLocation + (targetLocation - startLocation) * ease(progress))\n\n const clientHeight = container === document.body ? document.documentElement.clientHeight : container.clientHeight\n const reachBottom = clientHeight + container.scrollTop >= container.scrollHeight\n if (\n progress === 1 ||\n // Need to go lower but reach bottom\n (targetLocation > container.scrollTop && reachBottom)\n ) {\n return resolve(targetLocation)\n }\n\n requestAnimationFrame(step)\n }))\n}\n\ngoTo.framework = {} as Record<string, VuetifyServiceContract>\ngoTo.init = () => {}\n\nexport class Goto extends Service {\n public static property: 'goTo' = 'goTo'\n\n constructor () {\n super()\n\n return goTo\n }\n}\n","// Contracts\nimport { VuetifyServiceContract } from 'vuetify/types/services/index'\n\n// Types\nimport Vue from 'vue'\n\nexport class Service implements VuetifyServiceContract {\n framework = {}\n\n init (root: Vue, ssrContext?: object) {}\n}\n","// Utilities\nimport { consoleWarn } from './console'\nimport { chunk, padEnd } from './helpers'\nimport { toXYZ } from './color/transformSRGB'\n\n// Types\nimport { VuetifyThemeVariant } from 'types/services/theme'\n\nexport type ColorInt = number\nexport type XYZ = [number, number, number]\nexport type LAB = [number, number, number]\nexport type HSV = { h: number, s: number, v: number }\nexport type HSVA = HSV & { a: number }\nexport type RGB = { r: number, g: number, b: number }\nexport type RGBA = RGB & { a: number }\nexport type HSL = { h: number, s: number, l: number }\nexport type HSLA = HSL & { a: number }\nexport type Hex = string\nexport type Hexa = string\nexport type Color = string | number | {}\n\nexport function isCssColor (color?: string | false): boolean {\n return !!color && !!color.match(/^(#|var\\(--|(rgb|hsl)a?\\()/)\n}\n\nexport function colorToInt (color: Color): ColorInt {\n let rgb\n\n if (typeof color === 'number') {\n rgb = color\n } else if (typeof color === 'string') {\n let c = color[0] === '#' ? color.substring(1) : color\n if (c.length === 3) {\n c = c.split('').map(char => char + char).join('')\n }\n if (c.length !== 6) {\n consoleWarn(`'${color}' is not a valid rgb color`)\n }\n rgb = parseInt(c, 16)\n } else {\n throw new TypeError(`Colors can only be numbers or strings, recieved ${color == null ? color : color.constructor.name} instead`)\n }\n\n if (rgb < 0) {\n consoleWarn(`Colors cannot be negative: '${color}'`)\n rgb = 0\n } else if (rgb > 0xffffff || isNaN(rgb)) {\n consoleWarn(`'${color}' is not a valid rgb color`)\n rgb = 0xffffff\n }\n\n return rgb\n}\n\nexport function classToHex (\n color: string,\n colors: Record<string, Record<string, string>>,\n currentTheme: Partial<VuetifyThemeVariant>,\n): string {\n const [colorName, colorModifier] = color\n .toString().trim().replace('-', '').split(' ', 2) as (string | undefined)[]\n\n let hexColor = ''\n if (colorName && colorName in colors) {\n if (colorModifier && colorModifier in colors[colorName]) {\n hexColor = colors[colorName][colorModifier]\n } else if ('base' in colors[colorName]) {\n hexColor = colors[colorName].base\n }\n } else if (colorName && colorName in currentTheme) {\n hexColor = currentTheme[colorName] as string\n }\n\n return hexColor\n}\n\nexport function intToHex (color: ColorInt): string {\n let hexColor: string = color.toString(16)\n\n if (hexColor.length < 6) hexColor = '0'.repeat(6 - hexColor.length) + hexColor\n\n return '#' + hexColor\n}\n\nexport function colorToHex (color: Color): string {\n return intToHex(colorToInt(color))\n}\n\n/**\n * Converts HSVA to RGBA. Based on formula from https://en.wikipedia.org/wiki/HSL_and_HSV\n *\n * @param color HSVA color as an array [0-360, 0-1, 0-1, 0-1]\n */\nexport function HSVAtoRGBA (hsva: HSVA): RGBA {\n const { h, s, v, a } = hsva\n const f = (n: number) => {\n const k = (n + (h / 60)) % 6\n return v - v * s * Math.max(Math.min(k, 4 - k, 1), 0)\n }\n\n const rgb = [f(5), f(3), f(1)].map(v => Math.round(v * 255))\n\n return { r: rgb[0], g: rgb[1], b: rgb[2], a }\n}\n\n/**\n * Converts RGBA to HSVA. Based on formula from https://en.wikipedia.org/wiki/HSL_and_HSV\n *\n * @param color RGBA color as an array [0-255, 0-255, 0-255, 0-1]\n */\nexport function RGBAtoHSVA (rgba: RGBA): HSVA {\n if (!rgba) return { h: 0, s: 1, v: 1, a: 1 }\n\n const r = rgba.r / 255\n const g = rgba.g / 255\n const b = rgba.b / 255\n const max = Math.max(r, g, b)\n const min = Math.min(r, g, b)\n\n let h = 0\n\n if (max !== min) {\n if (max === r) {\n h = 60 * (0 + ((g - b) / (max - min)))\n } else if (max === g) {\n h = 60 * (2 + ((b - r) / (max - min)))\n } else if (max === b) {\n h = 60 * (4 + ((r - g) / (max - min)))\n }\n }\n\n if (h < 0) h = h + 360\n\n const s = max === 0 ? 0 : (max - min) / max\n const hsv = [h, s, max]\n\n return { h: hsv[0], s: hsv[1], v: hsv[2], a: rgba.a }\n}\n\nexport function HSVAtoHSLA (hsva: HSVA): HSLA {\n const { h, s, v, a } = hsva\n\n const l = v - (v * s / 2)\n\n const sprime = l === 1 || l === 0 ? 0 : (v - l) / Math.min(l, 1 - l)\n\n return { h, s: sprime, l, a }\n}\n\nexport function HSLAtoHSVA (hsl: HSLA): HSVA {\n const { h, s, l, a } = hsl\n\n const v = l + s * Math.min(l, 1 - l)\n\n const sprime = v === 0 ? 0 : 2 - (2 * l / v)\n\n return { h, s: sprime, v, a }\n}\n\nexport function RGBAtoCSS (rgba: RGBA): string {\n return `rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${rgba.a})`\n}\n\nexport function RGBtoCSS (rgba: RGBA): string {\n return RGBAtoCSS({ ...rgba, a: 1 })\n}\n\nexport function RGBAtoHex (rgba: RGBA): Hex {\n const toHex = (v: number) => {\n const h = Math.round(v).toString(16)\n return ('00'.substr(0, 2 - h.length) + h).toUpperCase()\n }\n\n return `#${[\n toHex(rgba.r),\n toHex(rgba.g),\n toHex(rgba.b),\n toHex(Math.round(rgba.a * 255)),\n ].join('')}`\n}\n\nexport function HexToRGBA (hex: Hex): RGBA {\n const rgba = chunk(hex.slice(1), 2).map((c: string) => parseInt(c, 16))\n\n return {\n r: rgba[0],\n g: rgba[1],\n b: rgba[2],\n a: Math.round((rgba[3] / 255) * 100) / 100,\n }\n}\n\nexport function HexToHSVA (hex: Hex): HSVA {\n const rgb = HexToRGBA(hex)\n return RGBAtoHSVA(rgb)\n}\n\nexport function HSVAtoHex (hsva: HSVA): Hex {\n return RGBAtoHex(HSVAtoRGBA(hsva))\n}\n\nexport function parseHex (hex: string): Hex {\n if (hex.startsWith('#')) {\n hex = hex.slice(1)\n }\n\n hex = hex.replace(/([^0-9a-f])/gi, 'F')\n\n if (hex.length === 3 || hex.length === 4) {\n hex = hex.split('').map(x => x + x).join('')\n }\n\n if (hex.length === 6) {\n hex = padEnd(hex, 8, 'F')\n } else {\n hex = padEnd(padEnd(hex, 6), 8, 'F')\n }\n\n return `#${hex}`.toUpperCase().substr(0, 9)\n}\n\nexport function parseGradient (\n gradient: string,\n colors: Record<string, Record<string, string>>,\n currentTheme: Partial<VuetifyThemeVariant>,\n) {\n return gradient.replace(/([a-z]+(\\s[a-z]+-[1-5])?)(?=$|,)/gi, x => {\n return classToHex(x, colors, currentTheme) || x\n }).replace(/(rgba\\()#[0-9a-f]+(?=,)/gi, x => {\n return 'rgba(' + Object.values(HexToRGBA(parseHex(x.replace(/rgba\\(/, '')))).slice(0, 3).join(',')\n })\n}\n\nexport function RGBtoInt (rgba: RGBA): ColorInt {\n return (rgba.r << 16) + (rgba.g << 8) + rgba.b\n}\n\n/**\n * Returns the contrast ratio (1-21) between two colors.\n *\n * @param c1 First color\n * @param c2 Second color\n */\nexport function contrastRatio (c1: RGBA, c2: RGBA): number {\n const [, y1] = toXYZ(RGBtoInt(c1))\n const [, y2] = toXYZ(RGBtoInt(c2))\n\n return (Math.max(y1, y2) + 0.05) / (Math.min(y1, y2) + 0.05)\n}\n","/* eslint-disable no-console */\nimport Vuetify from '../framework'\n\nfunction createMessage (message: string, vm?: any, parent?: any): string | void {\n if (Vuetify.config.silent) return\n\n if (parent) {\n vm = {\n _isVue: true,\n $parent: parent,\n $options: vm,\n }\n }\n\n if (vm) {\n // Only show each message once per instance\n vm.$_alreadyWarned = vm.$_alreadyWarned || []\n if (vm.$_alreadyWarned.includes(message)) return\n vm.$_alreadyWarned.push(message)\n }\n\n return `[Vuetify] ${message}` + (\n vm ? generateComponentTrace(vm) : ''\n )\n}\n\nexport function consoleInfo (message: string, vm?: any, parent?: any): void {\n const newMessage = createMessage(message, vm, parent)\n newMessage != null && console.info(newMessage)\n}\n\nexport function consoleWarn (message: string, vm?: any, parent?: any): void {\n const newMessage = createMessage(message, vm, parent)\n newMessage != null && console.warn(newMessage)\n}\n\nexport function consoleError (message: string, vm?: any, parent?: any): void {\n const newMessage = createMessage(message, vm, parent)\n newMessage != null && console.error(newMessage)\n}\n\nexport function deprecate (original: string, replacement: string, vm?: any, parent?: any) {\n consoleWarn(`[UPGRADE] '${original}' is deprecated, use '${replacement}' instead.`, vm, parent)\n}\nexport function breaking (original: string, replacement: string, vm?: any, parent?: any) {\n consoleError(`[BREAKING] '${original}' has been removed, use '${replacement}' instead. For more information, see the upgrade guide https://github.com/vuetifyjs/vuetify/releases/tag/v2.0.0#user-content-upgrade-guide`, vm, parent)\n}\nexport function removed (original: string, vm?: any, parent?: any) {\n consoleWarn(`[REMOVED] '${original}' has been removed. You can safely omit it.`, vm, parent)\n}\n\n/**\n * Shamelessly stolen from vuejs/vue/blob/dev/src/core/util/debug.js\n */\n\nconst classifyRE = /(?:^|[-_])(\\w)/g\nconst classify = (str: string) => str\n .replace(classifyRE, c => c.toUpperCase())\n .replace(/[-_]/g, '')\n\nfunction formatComponentName (vm: any, includeFile?: boolean): string {\n if (vm.$root === vm) {\n return '<Root>'\n }\n const options = typeof vm === 'function' && vm.cid != null\n ? vm.options\n : vm._isVue\n ? vm.$options || vm.constructor.options\n : vm || {}\n let name = options.name || options._componentTag\n const file = options.__file\n if (!name && file) {\n const match = file.match(/([^/\\\\]+)\\.vue$/)\n name = match && match[1]\n }\n\n return (\n (name ? `<${classify(name)}>` : `<Anonymous>`) +\n (file && includeFile !== false ? ` at ${file}` : '')\n )\n}\n\nfunction generateComponentTrace (vm: any): string {\n if (vm._isVue && vm.$parent) {\n const tree: any[] = []\n let currentRecursiveSequence = 0\n while (vm) {\n if (tree.length > 0) {\n const last: any = tree[tree.length - 1]\n if (last.constructor === vm.constructor) {\n currentRecursiveSequence++\n vm = vm.$parent\n continue\n } else if (currentRecursiveSequence > 0) {\n tree[tree.length - 1] = [last, currentRecursiveSequence]\n currentRecursiveSequence = 0\n }\n }\n tree.push(vm)\n vm = vm.$parent\n }\n return '\\n\\nfound in\\n\\n' + tree\n .map((vm, i) => `${\n i === 0 ? '---> ' : ' '.repeat(5 + i * 2)\n }${\n Array.isArray(vm)\n ? `${formatComponentName(vm[0])}... (${vm[1]} recursive calls)`\n : formatComponentName(vm)\n }`)\n .join('\\n')\n } else {\n return `\\n\\n(found in ${formatComponentName(vm)})`\n }\n}\n","/**\n * Returns:\n * - 'null' if the node is not attached to the DOM\n * - the root node (HTMLDocument | ShadowRoot) otherwise\n */\nexport function attachedRoot (node: Node): null | HTMLDocument | ShadowRoot {\n /* istanbul ignore next */\n if (typeof node.getRootNode !== 'function') {\n // Shadow DOM not supported (IE11), lets find the root of this node\n while (node.parentNode) node = node.parentNode\n\n // The root parent is the document if the node is attached to the DOM\n if (node !== document) return null\n\n return document\n }\n\n const root = node.getRootNode()\n\n // The composed root node is the document if the node is attached to the DOM\n if (root !== document && root.getRootNode({ composed: true }) !== document) return null\n\n return root as HTMLDocument | ShadowRoot\n}\n","import Vue from 'vue'\nimport { VNode, VNodeDirective } from 'vue/types'\nimport { VuetifyIcon } from 'vuetify/types/services/icons'\nimport { DataTableCompareFunction, SelectItemKey, ItemGroup } from 'vuetify/types'\n\nexport function createSimpleFunctional (\n c: string,\n el = 'div',\n name?: string\n) {\n return Vue.extend({\n name: name || c.replace(/__/g, '-'),\n\n functional: true,\n\n props: {\n tag: {\n type: String,\n default: el,\n },\n },\n\n render (h, { data, props, children }): VNode {\n data.staticClass = (`${c} ${data.staticClass || ''}`).trim()\n\n return h(props.tag, data, children)\n },\n })\n}\n\nexport type BindingConfig = Pick<VNodeDirective, 'arg' | 'modifiers' | 'value'>\nexport function directiveConfig (binding: BindingConfig, defaults = {}): VNodeDirective {\n return {\n ...defaults,\n ...binding.modifiers,\n value: binding.arg,\n ...(binding.value || {}),\n }\n}\n\nexport function addOnceEventListener (\n el: EventTarget,\n eventName: string,\n cb: (event: Event) => void,\n options: boolean | AddEventListenerOptions = false\n): void {\n const once = (event: Event) => {\n cb(event)\n el.removeEventListener(eventName, once, options)\n }\n\n el.addEventListener(eventName, once, options)\n}\n\nlet passiveSupported = false\ntry {\n if (typeof window !== 'undefined') {\n const testListenerOpts = Object.defineProperty({}, 'passive', {\n get: () => {\n passiveSupported = true\n },\n }) as EventListener & EventListenerOptions\n\n window.addEventListener('testListener', testListenerOpts, testListenerOpts)\n window.removeEventListener('testListener', testListenerOpts, testListenerOpts)\n }\n} catch (e) { console.warn(e) } /* eslint-disable-line no-console */\nexport { passiveSupported }\n\nexport function addPassiveEventListener (\n el: EventTarget,\n event: string,\n cb: (event: any) => void,\n options: {}\n): void {\n el.addEventListener(event, cb, passiveSupported ? options : false)\n}\n\nexport function getNestedValue (obj: any, path: (string | number)[], fallback?: any): any {\n const last = path.length - 1\n\n if (last < 0) return obj === undefined ? fallback : obj\n\n for (let i = 0; i < last; i++) {\n if (obj == null) {\n return fallback\n }\n obj = obj[path[i]]\n }\n\n if (obj == null) return fallback\n\n return obj[path[last]] === undefined ? fallback : obj[path[last]]\n}\n\nexport function deepEqual (a: any, b: any): boolean {\n if (a === b) return true\n\n if (\n a instanceof Date &&\n b instanceof Date &&\n a.getTime() !== b.getTime()\n ) {\n // If the values are Date, compare them as timestamps\n return false\n }\n\n if (a !== Object(a) || b !== Object(b)) {\n // If the values aren't objects, they were already checked for equality\n return false\n }\n\n const props = Object.keys(a)\n\n if (props.length !== Object.keys(b).length) {\n // Different number of props, don't bother to check\n return false\n }\n\n return props.every(p => deepEqual(a[p], b[p]))\n}\n\nexport function getObjectValueByPath (obj: any, path: string, fallback?: any): any {\n // credit: http://stackoverflow.com/questions/6491463/accessing-nested-javascript-objects-with-string-key#comment55278413_6491621\n if (obj == null || !path || typeof path !== 'string') return fallback\n if (obj[path] !== undefined) return obj[path]\n path = path.replace(/\\[(\\w+)\\]/g, '.$1') // convert indexes to properties\n path = path.replace(/^\\./, '') // strip a leading dot\n return getNestedValue(obj, path.split('.'), fallback)\n}\n\nexport function getPropertyFromItem (\n item: object,\n property: SelectItemKey,\n fallback?: any\n): any {\n if (property == null) return item === undefined ? fallback : item\n\n if (item !== Object(item)) return fallback === undefined ? item : fallback\n\n if (typeof property === 'string') return getObjectValueByPath(item, property, fallback)\n\n if (Array.isArray(property)) return getNestedValue(item, property, fallback)\n\n if (typeof property !== 'function') return fallback\n\n const value = property(item, fallback)\n\n return typeof value === 'undefined' ? fallback : value\n}\n\nexport function createRange (length: number): number[] {\n return Array.from({ length }, (v, k) => k)\n}\n\nexport function getZIndex (el?: Element | null): number {\n if (!el || el.nodeType !== Node.ELEMENT_NODE) return 0\n\n const index = +window.getComputedStyle(el).getPropertyValue('z-index')\n\n if (!index) return getZIndex(el.parentNode as Element)\n return index\n}\n\nconst tagsToReplace = {\n '&': '&',\n '<': '<',\n '>': '>',\n} as any\n\nexport function escapeHTML (str: string): string {\n return str.replace(/[&<>]/g, tag => tagsToReplace[tag] || tag)\n}\n\nexport function filterObjectOnKeys<T, K extends keyof T> (obj: T, keys: K[]): { [N in K]: T[N] } {\n const filtered = {} as { [N in K]: T[N] }\n\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i]\n if (typeof obj[key] !== 'undefined') {\n filtered[key] = obj[key]\n }\n }\n\n return filtered\n}\n\nexport function convertToUnit (str: string | number | null | undefined, unit = 'px'): string | undefined {\n if (str == null || str === '') {\n return undefined\n } else if (isNaN(+str!)) {\n return String(str)\n } else {\n return `${Number(str)}${unit}`\n }\n}\n\nexport function kebabCase (str: string): string {\n return (str || '').replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase()\n}\n\nexport function isObject (obj: any): obj is object {\n return obj !== null && typeof obj === 'object'\n}\n\n// KeyboardEvent.keyCode aliases\nexport const keyCodes = Object.freeze({\n enter: 13,\n tab: 9,\n delete: 46,\n esc: 27,\n space: 32,\n up: 38,\n down: 40,\n left: 37,\n right: 39,\n end: 35,\n home: 36,\n del: 46,\n backspace: 8,\n insert: 45,\n pageup: 33,\n pagedown: 34,\n shift: 16,\n})\n\n/**\n * This remaps internal names like '$cancel' or '$vuetify.icons.cancel'\n * to the current name or component for that icon.\n */\nexport function remapInternalIcon (vm: Vue, iconName: string): VuetifyIcon {\n // Look for custom component in the configuration\n const component = vm.$vuetify.icons.component\n\n // Look for overrides\n if (iconName.startsWith('$')) {\n // Get the target icon name\n const iconPath = `$vuetify.icons.values.${iconName.split('$').pop()!.split('.').pop()}`\n\n // Now look up icon indirection name,\n // e.g. '$vuetify.icons.values.cancel'\n const override = getObjectValueByPath(vm, iconPath, iconName)\n\n if (typeof override === 'string') iconName = override\n else return override\n }\n\n if (component == null) {\n return iconName\n }\n\n return {\n component,\n props: {\n icon: iconName,\n },\n }\n}\n\nexport function keys<O> (o: O) {\n return Object.keys(o) as (keyof O)[]\n}\n\n/**\n * Camelize a hyphen-delimited string.\n */\nconst camelizeRE = /-(\\w)/g\nexport const camelize = (str: string): string => {\n return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : '')\n}\n\n/**\n * Returns the set difference of B and A, i.e. the set of elements in B but not in A\n */\nexport function arrayDiff (a: any[], b: any[]): any[] {\n const diff: any[] = []\n for (let i = 0; i < b.length; i++) {\n if (a.indexOf(b[i]) < 0) diff.push(b[i])\n }\n return diff\n}\n\n/**\n * Makes the first character of a string uppercase\n */\nexport function upperFirst (str: string): string {\n return str.charAt(0).toUpperCase() + str.slice(1)\n}\n\nexport function groupItems<T extends any = any> (\n items: T[],\n groupBy: string[],\n groupDesc: boolean[]\n): ItemGroup<T>[] {\n const key = groupBy[0]\n const groups: ItemGroup<T>[] = []\n let current\n for (let i = 0; i < items.length; i++) {\n const item = items[i]\n const val = getObjectValueByPath(item, key, null)\n if (current !== val) {\n current = val\n groups.push({\n name: val ?? '',\n items: [],\n })\n }\n groups[groups.length - 1].items.push(item)\n }\n return groups\n}\n\nexport function wrapInArray<T> (v: T | T[] | null | undefined): T[] { return v != null ? Array.isArray(v) ? v : [v] : [] }\n\nexport function sortItems<T extends any = any> (\n items: T[],\n sortBy: string[],\n sortDesc: boolean[],\n locale: string,\n customSorters?: Record<string, DataTableCompareFunction<T>>\n): T[] {\n if (sortBy === null || !sortBy.length) return items\n const stringCollator = new Intl.Collator(locale, { sensitivity: 'accent', usage: 'sort' })\n\n return items.sort((a, b) => {\n for (let i = 0; i < sortBy.length; i++) {\n const sortKey = sortBy[i]\n\n let sortA = getObjectValueByPath(a, sortKey)\n let sortB = getObjectValueByPath(b, sortKey)\n\n if (sortDesc[i]) {\n [sortA, sortB] = [sortB, sortA]\n }\n\n if (customSorters && customSorters[sortKey]) {\n const customResult = customSorters[sortKey](sortA, sortB)\n\n if (!customResult) continue\n\n return customResult\n }\n\n // Check if both cannot be evaluated\n if (sortA === null && sortB === null) {\n continue\n }\n\n // Dates should be compared numerically\n if (sortA instanceof Date && sortB instanceof Date) {\n return sortA.getTime() - sortB.getTime()\n }\n\n [sortA, sortB] = [sortA, sortB].map(s => (s || '').toString().toLocaleLowerCase())\n\n if (sortA !== sortB) {\n if (!isNaN(sortA) && !isNaN(sortB)) return Number(sortA) - Number(sortB)\n return stringCollator.compare(sortA, sortB)\n }\n }\n\n return 0\n })\n}\n\nexport function defaultFilter (value: any, search: string | null, item: any) {\n return value != null &&\n search != null &&\n typeof value !== 'boolean' &&\n value.toString().toLocaleLowerCase().indexOf(search.toLocaleLowerCase()) !== -1\n}\n\nexport function searchItems<T extends any = any> (items: T[], search: string): T[] {\n if (!search) return items\n search = search.toString().toLowerCase()\n if (search.trim() === '') return items\n\n return items.filter((item: any) => Object.keys(item).some(key => defaultFilter(getObjectValueByPath(item, key), search, item)))\n}\n\n/**\n * Returns:\n * - 'normal' for old style slots - `<template slot=\"default\">`\n * - 'scoped' for old style scoped slots (`<template slot=\"default\" slot-scope=\"data\">`) or bound v-slot (`#default=\"data\"`)\n * - 'v-slot' for unbound v-slot (`#default`) - only if the third param is true, otherwise counts as scoped\n */\nexport function getSlotType<T extends boolean = false> (vm: Vue, name: string, split?: T): (T extends true ? 'v-slot' : never) | 'normal' | 'scoped' | void {\n if (vm.$slots.hasOwnProperty(name) && vm.$scopedSlots.hasOwnProperty(name) && (vm.$scopedSlots[name] as any).name) {\n return split ? 'v-slot' as any : 'scoped'\n }\n if (vm.$slots.hasOwnProperty(name)) return 'normal'\n if (vm.$scopedSlots.hasOwnProperty(name)) return 'scoped'\n}\n\nexport function debounce (fn: Function, delay: number) {\n let timeoutId = 0 as any\n return (...args: any[]) => {\n clearTimeout(timeoutId)\n timeoutId = setTimeout(() => fn(...args), delay)\n }\n}\n\nexport function throttle<T extends (...args: any[]) => any> (fn: T, limit: number) {\n let throttling = false\n return (...args: Parameters<T>): void | ReturnType<T> => {\n if (!throttling) {\n throttling = true\n setTimeout(() => throttling = false, limit)\n return fn(...args)\n }\n }\n}\n\nexport function getPrefixedScopedSlots (prefix: string, scopedSlots: any) {\n return Object.keys(scopedSlots).filter(k => k.startsWith(prefix)).reduce((obj: any, k: string) => {\n obj[k.replace(prefix, '')] = scopedSlots[k]\n return obj\n }, {})\n}\n\nexport function getSlot (vm: Vue, name = 'default', data?: object | (() => object), optional = false) {\n if (vm.$scopedSlots.hasOwnProperty(name)) {\n return vm.$scopedSlots[name]!(data instanceof Function ? data() : data)\n } else if (vm.$slots.hasOwnProperty(name) && (!data || optional)) {\n return vm.$slots[name]\n }\n return undefined\n}\n\nexport function clamp (value: number, min = 0, max = 1) {\n return Math.max(min, Math.min(max, value))\n}\n\nexport function padEnd (str: string, length: number, char = '0') {\n return str + char.repeat(Math.max(0, length - str.length))\n}\n\nexport function chunk (str: string, size = 1) {\n const chunked: string[] = []\n let index = 0\n while (index < str.length) {\n chunked.push(str.substr(index, size))\n index += size\n }\n return chunked\n}\n\nexport function humanReadableFileSize (bytes: number, binary = false): string {\n const base = binary ? 1024 : 1000\n if (bytes < base) {\n return `${bytes} B`\n }\n\n const prefix = binary ? ['Ki', 'Mi', 'Gi'] : ['k', 'M', 'G']\n let unit = -1\n while (Math.abs(bytes) >= base && unit < prefix.length - 1) {\n bytes /= base\n ++unit\n }\n return `${bytes.toFixed(1)} ${prefix[unit]}B`\n}\n\nexport function camelizeObjectKeys (obj: Record<string, any> | null | undefined) {\n if (!obj) return {}\n\n return Object.keys(obj).reduce((o: any, key: string) => {\n o[camelize(key)] = obj[key]\n return o\n }, {})\n}\n\nexport function mergeDeep (\n source: Dictionary<any> = {},\n target: Dictionary<any> = {}\n) {\n for (const key in target) {\n const sourceProperty = source[key]\n const targetProperty = target[key]\n\n // Only continue deep merging if\n // both properties are objects\n if (\n isObject(sourceProperty) &&\n isObject(targetProperty)\n ) {\n source[key] = mergeDeep(sourceProperty, targetProperty)\n\n continue\n }\n\n source[key] = targetProperty\n }\n\n return source\n}\n\nexport function fillArray<T> (length: number, obj: T) {\n return Array(length).fill(obj)\n}\n\n/** Polyfill for Event.prototype.composedPath */\nexport function composedPath (e: Event): EventTarget[] {\n if (e.composedPath) return e.composedPath()\n\n const path = []\n let el = e.target as Element\n\n while (el) {\n path.push(el)\n\n if (el.tagName === 'HTML') {\n path.push(document)\n path.push(window)\n\n return path\n }\n\n el = el.parentElement!\n }\n return path\n}\n","/**\n * @copyright 2017 Alex Regan\n * @license MIT\n * @see https://github.com/alexsasharegan/vue-functional-data-merge\n */\n/* eslint-disable max-statements */\nimport { VNodeData } from 'vue'\nimport { camelize, wrapInArray } from './helpers'\n\nconst pattern = {\n styleList: /;(?![^(]*\\))/g,\n styleProp: /:(.*)/,\n} as const\n\nfunction parseStyle (style: string) {\n const styleMap: Dictionary<any> = {}\n\n for (const s of style.split(pattern.styleList)) {\n let [key, val] = s.split(pattern.styleProp)\n key = key.trim()\n if (!key) {\n continue\n }\n // May be undefined if the `key: value` pair is incomplete.\n if (typeof val === 'string') {\n val = val.trim()\n }\n styleMap[camelize(key)] = val\n }\n\n return styleMap\n}\n\n/**\n * Intelligently merges data for createElement.\n * Merges arguments left to right, preferring the right argument.\n * Returns new VNodeData object.\n */\nexport default function mergeData (...vNodeData: VNodeData[]): VNodeData\nexport default function mergeData (): VNodeData {\n const mergeTarget: VNodeData & Dictionary<any> = {}\n let i: number = arguments.length\n let prop: string\n\n // Allow for variadic argument length.\n while (i--) {\n // Iterate through the data properties and execute merge strategies\n // Object.keys eliminates need for hasOwnProperty call\n for (prop of Object.keys(arguments[i])) {\n switch (prop) {\n // Array merge strategy (array concatenation)\n case 'class':\n case 'directives':\n if (arguments[i][prop]) {\n mergeTarget[prop] = mergeClasses(mergeTarget[prop], arguments[i][prop])\n }\n break\n case 'style':\n if (arguments[i][prop]) {\n mergeTarget[prop] = mergeStyles(mergeTarget[prop], arguments[i][prop])\n }\n break\n // Space delimited string concatenation strategy\n case 'staticClass':\n if (!arguments[i][prop]) {\n break\n }\n if (mergeTarget[prop] === undefined) {\n mergeTarget[prop] = ''\n }\n if (mergeTarget[prop]) {\n // Not an empty string, so concatenate\n mergeTarget[prop] += ' '\n }\n mergeTarget[prop] += arguments[i][prop].trim()\n break\n // Object, the properties of which to merge via array merge strategy (array concatenation).\n // Callback merge strategy merges callbacks to the beginning of the array,\n // so that the last defined callback will be invoked first.\n // This is done since to mimic how Object.assign merging\n // uses the last given value to assign.\n case 'on':\n case 'nativeOn':\n if (arguments[i][prop]) {\n mergeTarget[prop] = mergeListeners(mergeTarget[prop], arguments[i][prop])\n }\n break\n // Object merge strategy\n case 'attrs':\n case 'props':\n case 'domProps':\n case 'scopedSlots':\n case 'staticStyle':\n case 'hook':\n case 'transition':\n if (!arguments[i][prop]) {\n break\n }\n if (!mergeTarget[prop]) {\n mergeTarget[prop] = {}\n }\n mergeTarget[prop] = { ...arguments[i][prop], ...mergeTarget[prop] }\n break\n // Reassignment strategy (no merge)\n default: // slot, key, ref, tag, show, keepAlive\n if (!mergeTarget[prop]) {\n mergeTarget[prop] = arguments[i][prop]\n }\n }\n }\n }\n\n return mergeTarget\n}\n\nexport function mergeStyles (\n target: undefined | string | object[] | object,\n source: undefined | string | object[] | object\n) {\n if (!target) return source\n if (!source) return target\n\n target = wrapInArray(typeof target === 'string' ? parseStyle(target) : target)\n\n return (target as object[]).concat(typeof source === 'string' ? parseStyle(source) : source)\n}\n\nexport function mergeClasses (target: any, source: any) {\n if (!source) return target\n if (!target) return source\n\n return target ? wrapInArray(target).concat(source) : source\n}\n\nexport function mergeListeners (...args: [\n { [key: string]: Function | Function[] } | undefined,\n { [key: string]: Function | Function[] } | undefined\n]) {\n if (!args[0]) return args[1]\n if (!args[1]) return args[0]\n\n const dest: { [key: string]: Function | Function[] } = {}\n\n for (let i = 2; i--;) {\n const arg = args[i]\n for (const event in arg) {\n if (!arg[event]) continue\n\n if (dest[event]) {\n // Merge current listeners before (because we are iterating backwards).\n // Note that neither \"target\" or \"source\" must be altered.\n dest[event] = ([] as Function[]).concat(arg[event], dest[event])\n } else {\n // Straight assign.\n dest[event] = arg[event]\n }\n }\n }\n\n return dest\n}\n","/* eslint-disable max-len, import/export, no-use-before-define */\nimport Vue, { VueConstructor } from 'vue'\n\nexport default function mixins<T extends VueConstructor[]> (...args: T): ExtractVue<T> extends infer V ? V extends Vue ? VueConstructor<V> : never : never\nexport default function mixins<T extends Vue> (...args: VueConstructor[]): VueConstructor<T>\nexport default function mixins (...args: VueConstructor[]): VueConstructor {\n return Vue.extend({ mixins: args })\n}\n\n/**\n * Returns the instance type from a VueConstructor\n * Useful for adding types when using mixins().extend()\n */\nexport type ExtractVue<T extends VueConstructor | VueConstructor[]> = T extends (infer U)[]\n ? UnionToIntersection<\n U extends VueConstructor<infer V> ? V : never\n >\n : T extends VueConstructor<infer V> ? V : never\n\ntype UnionToIntersection<U> =\n (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never\n","/*!\n * vue-i18n v8.27.2 \n * (c) 2022 kazuya kawaguchi\n * Released under the MIT License.\n */\n/* */\n\n/**\n * constants\n */\n\nvar numberFormatKeys = [\n 'compactDisplay',\n 'currency',\n 'currencyDisplay',\n 'currencySign',\n 'localeMatcher',\n 'notation',\n 'numberingSystem',\n 'signDisplay',\n 'style',\n 'unit',\n 'unitDisplay',\n 'useGrouping',\n 'minimumIntegerDigits',\n 'minimumFractionDigits',\n 'maximumFractionDigits',\n 'minimumSignificantDigits',\n 'maximumSignificantDigits'\n];\n\n/**\n * utilities\n */\n\nfunction warn (msg, err) {\n if (typeof console !== 'undefined') {\n console.warn('[vue-i18n] ' + msg);\n /* istanbul ignore if */\n if (err) {\n console.warn(err.stack);\n }\n }\n}\n\nfunction error (msg, err) {\n if (typeof console !== 'undefined') {\n console.error('[vue-i18n] ' + msg);\n /* istanbul ignore if */\n if (err) {\n console.error(err.stack);\n }\n }\n}\n\nvar isArray = Array.isArray;\n\nfunction isObject (obj) {\n return obj !== null && typeof obj === 'object'\n}\n\nfunction isBoolean (val) {\n return typeof val === 'boolean'\n}\n\nfunction isString (val) {\n return typeof val === 'string'\n}\n\nvar toString = Object.prototype.toString;\nvar OBJECT_STRING = '[object Object]';\nfunction isPlainObject (obj) {\n return toString.call(obj) === OBJECT_STRING\n}\n\nfunction isNull (val) {\n return val === null || val === undefined\n}\n\nfunction isFunction (val) {\n return typeof val === 'function'\n}\n\nfunction parseArgs () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var locale = null;\n var params = null;\n if (args.length === 1) {\n if (isObject(args[0]) || isArray(args[0])) {\n params = args[0];\n } else if (typeof args[0] === 'string') {\n locale = args[0];\n }\n } else if (args.length === 2) {\n if (typeof args[0] === 'string') {\n locale = args[0];\n }\n /* istanbul ignore if */\n if (isObject(args[1]) || isArray(args[1])) {\n params = args[1];\n }\n }\n\n return { locale: locale, params: params }\n}\n\nfunction looseClone (obj) {\n return JSON.parse(JSON.stringify(obj))\n}\n\nfunction remove (arr, item) {\n if (arr.delete(item)) {\n return arr\n }\n}\n\nfunction arrayFrom (arr) {\n var ret = [];\n arr.forEach(function (a) { return ret.push(a); });\n return ret\n}\n\nfunction includes (arr, item) {\n return !!~arr.indexOf(item)\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nfunction hasOwn (obj, key) {\n return hasOwnProperty.call(obj, key)\n}\n\nfunction merge (target) {\n var arguments$1 = arguments;\n\n var output = Object(target);\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments$1[i];\n if (source !== undefined && source !== null) {\n var key = (void 0);\n for (key in source) {\n if (hasOwn(source, key)) {\n if (isObject(source[key])) {\n output[key] = merge(output[key], source[key]);\n } else {\n output[key] = source[key];\n }\n }\n }\n }\n }\n return output\n}\n\nfunction looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = isArray(a);\n var isArrayB = isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}\n\n/**\n * Sanitizes html special characters from input strings. For mitigating risk of XSS attacks.\n * @param rawText The raw input from the user that should be escaped.\n */\nfunction escapeHtml(rawText) {\n return rawText\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''')\n}\n\n/**\n * Escapes html tags and special symbols from all provided params which were returned from parseArgs().params.\n * This method performs an in-place operation on the params object.\n *\n * @param {any} params Parameters as provided from `parseArgs().params`.\n * May be either an array of strings or a string->any map.\n *\n * @returns The manipulated `params` object.\n */\nfunction escapeParams(params) {\n if(params != null) {\n Object.keys(params).forEach(function (key) {\n if(typeof(params[key]) == 'string') {\n params[key] = escapeHtml(params[key]);\n }\n });\n }\n return params\n}\n\n/* */\n\nfunction extend (Vue) {\n if (!Vue.prototype.hasOwnProperty('$i18n')) {\n // $FlowFixMe\n Object.defineProperty(Vue.prototype, '$i18n', {\n get: function get () { return this._i18n }\n });\n }\n\n Vue.prototype.$t = function (key) {\n var values = [], len = arguments.length - 1;\n while ( len-- > 0 ) values[ len ] = arguments[ len + 1 ];\n\n var i18n = this.$i18n;\n return i18n._t.apply(i18n, [ key, i18n.locale, i18n._getMessages(), this ].concat( values ))\n };\n\n Vue.prototype.$tc = function (key, choice) {\n var values = [], len = arguments.length - 2;\n while ( len-- > 0 ) values[ len ] = arguments[ len + 2 ];\n\n var i18n = this.$i18n;\n return i18n._tc.apply(i18n, [ key, i18n.locale, i18n._getMessages(), this, choice ].concat( values ))\n };\n\n Vue.prototype.$te = function (key, locale) {\n var i18n = this.$i18n;\n return i18n._te(key, i18n.locale, i18n._getMessages(), locale)\n };\n\n Vue.prototype.$d = function (value) {\n var ref;\n\n var args = [], len = arguments.length - 1;\n while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];\n return (ref = this.$i18n).d.apply(ref, [ value ].concat( args ))\n };\n\n Vue.prototype.$n = function (value) {\n var ref;\n\n var args = [], len = arguments.length - 1;\n while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];\n return (ref = this.$i18n).n.apply(ref, [ value ].concat( args ))\n };\n}\n\n/* */\n\n/**\n * Mixin\n * \n * If `bridge` mode, empty mixin is returned,\n * else regulary mixin implementation is returned.\n */\nfunction defineMixin (bridge) {\n if ( bridge === void 0 ) bridge = false;\n\n function mounted () {\n if (this !== this.$root && this.$options.__INTLIFY_META__ && this.$el) {\n this.$el.setAttribute('data-intlify', this.$options.__INTLIFY_META__);\n }\n }\n\n return bridge\n ? { mounted: mounted } // delegate `vue-i18n-bridge` mixin implementation\n : { // regulary \n beforeCreate: function beforeCreate () {\n var options = this.$options;\n options.i18n = options.i18n || ((options.__i18nBridge || options.__i18n) ? {} : null);\n\n if (options.i18n) {\n if (options.i18n instanceof VueI18n) {\n // init locale messages via custom blocks\n if ((options.__i18nBridge || options.__i18n)) {\n try {\n var localeMessages = options.i18n && options.i18n.messages ? options.i18n.messages : {};\n var _i18n = options.__i18nBridge || options.__i18n;\n _i18n.forEach(function (resource) {\n localeMessages = merge(localeMessages, JSON.parse(resource));\n });\n Object.keys(localeMessages).forEach(function (locale) {\n options.i18n.mergeLocaleMessage(locale, localeMessages[locale]);\n });\n } catch (e) {\n if (process.env.NODE_ENV !== 'production') {\n error(\"Cannot parse locale messages via custom blocks.\", e);\n }\n }\n }\n this._i18n = options.i18n;\n this._i18nWatcher = this._i18n.watchI18nData();\n } else if (isPlainObject(options.i18n)) {\n var rootI18n = this.$root && this.$root.$i18n && this.$root.$i18n instanceof VueI18n\n ? this.$root.$i18n\n : null;\n // component local i18n\n if (rootI18n) {\n options.i18n.root = this.$root;\n options.i18n.formatter = rootI18n.formatter;\n options.i18n.fallbackLocale = rootI18n.fallbackLocale;\n options.i18n.formatFallbackMessages = rootI18n.formatFallbackMessages;\n options.i18n.silentTranslationWarn = rootI18n.silentTranslationWarn;\n options.i18n.silentFallbackWarn = rootI18n.silentFallbackWarn;\n options.i18n.pluralizationRules = rootI18n.pluralizationRules;\n options.i18n.preserveDirectiveContent = rootI18n.preserveDirectiveContent;\n }\n\n // init locale messages via custom blocks\n if ((options.__i18nBridge || options.__i18n)) {\n try {\n var localeMessages$1 = options.i18n && options.i18n.messages ? options.i18n.messages : {};\n var _i18n$1 = options.__i18nBridge || options.__i18n;\n _i18n$1.forEach(function (resource) {\n localeMessages$1 = merge(localeMessages$1, JSON.parse(resource));\n });\n options.i18n.messages = localeMessages$1;\n } catch (e) {\n if (process.env.NODE_ENV !== 'production') {\n warn(\"Cannot parse locale messages via custom blocks.\", e);\n }\n }\n }\n\n var ref = options.i18n;\n var sharedMessages = ref.sharedMessages;\n if (sharedMessages && isPlainObject(sharedMessages)) {\n options.i18n.messages = merge(options.i18n.messages, sharedMessages);\n }\n\n this._i18n = new VueI18n(options.i18n);\n this._i18nWatcher = this._i18n.watchI18nData();\n\n if (options.i18n.sync === undefined || !!options.i18n.sync) {\n this._localeWatcher = this.$i18n.watchLocale();\n }\n\n if (rootI18n) {\n rootI18n.onComponentInstanceCreated(this._i18n);\n }\n } else {\n if (process.env.NODE_ENV !== 'production') {\n warn(\"Cannot be interpreted 'i18n' option.\");\n }\n }\n } else if (this.$root && this.$root.$i18n && this.$root.$i18n instanceof VueI18n) {\n // root i18n\n this._i18n = this.$root.$i18n;\n } else if (options.parent && options.parent.$i18n && options.parent.$i18n instanceof VueI18n) {\n // parent i18n\n this._i18n = options.parent.$i18n;\n }\n },\n\n beforeMount: function beforeMount () {\n var options = this.$options;\n options.i18n = options.i18n || ((options.__i18nBridge || options.__i18n) ? {} : null);\n\n if (options.i18n) {\n if (options.i18n instanceof VueI18n) {\n // init locale messages via custom blocks\n this._i18n.subscribeDataChanging(this);\n this._subscribing = true;\n } else if (isPlainObject(options.i18n)) {\n this._i18n.subscribeDataChanging(this);\n this._subscribing = true;\n } else {\n if (process.env.NODE_ENV !== 'production') {\n warn(\"Cannot be interpreted 'i18n' option.\");\n }\n }\n } else if (this.$root && this.$root.$i18n && this.$root.$i18n instanceof VueI18n) {\n this._i18n.subscribeDataChanging(this);\n this._subscribing = true;\n } else if (options.parent && options.parent.$i18n && options.parent.$i18n instanceof VueI18n) {\n this._i18n.subscribeDataChanging(this);\n this._subscribing = true;\n }\n },\n\n mounted: mounted,\n\n beforeDestroy: function beforeDestroy () {\n if (!this._i18n) { return }\n\n var self = this;\n this.$nextTick(function () {\n if (self._subscribing) {\n self._i18n.unsubscribeDataChanging(self);\n delete self._subscribing;\n }\n\n if (self._i18nWatcher) {\n self._i18nWatcher();\n self._i18n.destroyVM();\n delete self._i18nWatcher;\n }\n\n if (self._localeWatcher) {\n self._localeWatcher();\n delete self._localeWatcher;\n }\n });\n }\n }\n}\n\n/* */\n\nvar interpolationComponent = {\n name: 'i18n',\n functional: true,\n props: {\n tag: {\n type: [String, Boolean, Object],\n default: 'span'\n },\n path: {\n type: String,\n required: true\n },\n locale: {\n type: String\n },\n places: {\n type: [Array, Object]\n }\n },\n render: function render (h, ref) {\n var data = ref.data;\n var parent = ref.parent;\n var props = ref.props;\n var slots = ref.slots;\n\n var $i18n = parent.$i18n;\n if (!$i18n) {\n if (process.env.NODE_ENV !== 'production') {\n warn('Cannot find VueI18n instance!');\n }\n return\n }\n\n var path = props.path;\n var locale = props.locale;\n var places = props.places;\n var params = slots();\n var children = $i18n.i(\n path,\n locale,\n onlyHasDefaultPlace(params) || places\n ? useLegacyPlaces(params.default, places)\n : params\n );\n\n var tag = (!!props.tag && props.tag !== true) || props.tag === false ? props.tag : 'span';\n return tag ? h(tag, data, children) : children\n }\n};\n\nfunction onlyHasDefaultPlace (params) {\n var prop;\n for (prop in params) {\n if (prop !== 'default') { return false }\n }\n return Boolean(prop)\n}\n\nfunction useLegacyPlaces (children, places) {\n var params = places ? createParamsFromPlaces(places) : {};\n\n if (!children) { return params }\n\n // Filter empty text nodes\n children = children.filter(function (child) {\n return child.tag || child.text.trim() !== ''\n });\n\n var everyPlace = children.every(vnodeHasPlaceAttribute);\n if (process.env.NODE_ENV !== 'production' && everyPlace) {\n warn('`place` attribute is deprecated in next major version. Please switch to Vue slots.');\n }\n\n return children.reduce(\n everyPlace ? assignChildPlace : assignChildIndex,\n params\n )\n}\n\nfunction createParamsFromPlaces (places) {\n if (process.env.NODE_ENV !== 'production') {\n warn('`places` prop is deprecated in next major version. Please switch to Vue slots.');\n }\n\n return Array.isArray(places)\n ? places.reduce(assignChildIndex, {})\n : Object.assign({}, places)\n}\n\nfunction assignChildPlace (params, child) {\n if (child.data && child.data.attrs && child.data.attrs.place) {\n params[child.data.attrs.place] = child;\n }\n return params\n}\n\nfunction assignChildIndex (params, child, index) {\n params[index] = child;\n return params\n}\n\nfunction vnodeHasPlaceAttribute (vnode) {\n return Boolean(vnode.data && vnode.data.attrs && vnode.data.attrs.place)\n}\n\n/* */\n\nvar numberComponent = {\n name: 'i18n-n',\n functional: true,\n props: {\n tag: {\n type: [String, Boolean, Object],\n default: 'span'\n },\n value: {\n type: Number,\n required: true\n },\n format: {\n type: [String, Object]\n },\n locale: {\n type: String\n }\n },\n render: function render (h, ref) {\n var props = ref.props;\n var parent = ref.parent;\n var data = ref.data;\n\n var i18n = parent.$i18n;\n\n if (!i18n) {\n if (process.env.NODE_ENV !== 'production') {\n warn('Cannot find VueI18n instance!');\n }\n return null\n }\n\n var key = null;\n var options = null;\n\n if (isString(props.format)) {\n key = props.format;\n } else if (isObject(props.format)) {\n if (props.format.key) {\n key = props.format.key;\n }\n\n // Filter out number format options only\n options = Object.keys(props.format).reduce(function (acc, prop) {\n var obj;\n\n if (includes(numberFormatKeys, prop)) {\n return Object.assign({}, acc, ( obj = {}, obj[prop] = props.format[prop], obj ))\n }\n return acc\n }, null);\n }\n\n var locale = props.locale || i18n.locale;\n var parts = i18n._ntp(props.value, locale, key, options);\n\n var values = parts.map(function (part, index) {\n var obj;\n\n var slot = data.scopedSlots && data.scopedSlots[part.type];\n return slot ? slot(( obj = {}, obj[part.type] = part.value, obj.index = index, obj.parts = parts, obj )) : part.value\n });\n\n var tag = (!!props.tag && props.tag !== true) || props.tag === false ? props.tag : 'span';\n return tag\n ? h(tag, {\n attrs: data.attrs,\n 'class': data['class'],\n staticClass: data.staticClass\n }, values)\n : values\n }\n};\n\n/* */\n\nfunction bind (el, binding, vnode) {\n if (!assert(el, vnode)) { return }\n\n t(el, binding, vnode);\n}\n\nfunction update (el, binding, vnode, oldVNode) {\n if (!assert(el, vnode)) { return }\n\n var i18n = vnode.context.$i18n;\n if (localeEqual(el, vnode) &&\n (looseEqual(binding.value, binding.oldValue) &&\n looseEqual(el._localeMessage, i18n.getLocaleMessage(i18n.locale)))) { return }\n\n t(el, binding, vnode);\n}\n\nfunction unbind (el, binding, vnode, oldVNode) {\n var vm = vnode.context;\n if (!vm) {\n warn('Vue instance does not exists in VNode context');\n return\n }\n\n var i18n = vnode.context.$i18n || {};\n if (!binding.modifiers.preserve && !i18n.preserveDirectiveContent) {\n el.textContent = '';\n }\n el._vt = undefined;\n delete el['_vt'];\n el._locale = undefined;\n delete el['_locale'];\n el._localeMessage = undefined;\n delete el['_localeMessage'];\n}\n\nfunction assert (el, vnode) {\n var vm = vnode.context;\n if (!vm) {\n warn('Vue instance does not exists in VNode context');\n return false\n }\n\n if (!vm.$i18n) {\n warn('VueI18n instance does not exists in Vue instance');\n return false\n }\n\n return true\n}\n\nfunction localeEqual (el, vnode) {\n var vm = vnode.context;\n return el._locale === vm.$i18n.locale\n}\n\nfunction t (el, binding, vnode) {\n var ref$1, ref$2;\n\n var value = binding.value;\n\n var ref = parseValue(value);\n var path = ref.path;\n var locale = ref.locale;\n var args = ref.args;\n var choice = ref.choice;\n if (!path && !locale && !args) {\n warn('value type not supported');\n return\n }\n\n if (!path) {\n warn('`path` is required in v-t directive');\n return\n }\n\n var vm = vnode.context;\n if (choice != null) {\n el._vt = el.textContent = (ref$1 = vm.$i18n).tc.apply(ref$1, [ path, choice ].concat( makeParams(locale, args) ));\n } else {\n el._vt = el.textContent = (ref$2 = vm.$i18n).t.apply(ref$2, [ path ].concat( makeParams(locale, args) ));\n }\n el._locale = vm.$i18n.locale;\n el._localeMessage = vm.$i18n.getLocaleMessage(vm.$i18n.locale);\n}\n\nfunction parseValue (value) {\n var path;\n var locale;\n var args;\n var choice;\n\n if (isString(value)) {\n path = value;\n } else if (isPlainObject(value)) {\n path = value.path;\n locale = value.locale;\n args = value.args;\n choice = value.choice;\n }\n\n return { path: path, locale: locale, args: args, choice: choice }\n}\n\nfunction makeParams (locale, args) {\n var params = [];\n\n locale && params.push(locale);\n if (args && (Array.isArray(args) || isPlainObject(args))) {\n params.push(args);\n }\n\n return params\n}\n\nvar Vue;\n\nfunction install (_Vue, options) {\n if ( options === void 0 ) options = { bridge: false };\n\n /* istanbul ignore if */\n if (process.env.NODE_ENV !== 'production' && install.installed && _Vue === Vue) {\n warn('already installed.');\n return\n }\n install.installed = true;\n\n Vue = _Vue;\n\n var version = (Vue.version && Number(Vue.version.split('.')[0])) || -1;\n /* istanbul ignore if */\n if (process.env.NODE_ENV !== 'production' && version < 2) {\n warn((\"vue-i18n (\" + (install.version) + \") need to use Vue 2.0 or later (Vue: \" + (Vue.version) + \").\"));\n return\n }\n\n extend(Vue);\n Vue.mixin(defineMixin(options.bridge));\n Vue.directive('t', { bind: bind, update: update, unbind: unbind });\n Vue.component(interpolationComponent.name, interpolationComponent);\n Vue.component(numberComponent.name, numberComponent);\n\n // use simple mergeStrategies to prevent i18n instance lose '__proto__'\n var strats = Vue.config.optionMergeStrategies;\n strats.i18n = function (parentVal, childVal) {\n return childVal === undefined\n ? parentVal\n : childVal\n };\n}\n\n/* */\n\nvar BaseFormatter = function BaseFormatter () {\n this._caches = Object.create(null);\n};\n\nBaseFormatter.prototype.interpolate = function interpolate (message, values) {\n if (!values) {\n return [message]\n }\n var tokens = this._caches[message];\n if (!tokens) {\n tokens = parse(message);\n this._caches[message] = tokens;\n }\n return compile(tokens, values)\n};\n\n\n\nvar RE_TOKEN_LIST_VALUE = /^(?:\\d)+/;\nvar RE_TOKEN_NAMED_VALUE = /^(?:\\w)+/;\n\nfunction parse (format) {\n var tokens = [];\n var position = 0;\n\n var text = '';\n while (position < format.length) {\n var char = format[position++];\n if (char === '{') {\n if (text) {\n tokens.push({ type: 'text', value: text });\n }\n\n text = '';\n var sub = '';\n char = format[position++];\n while (char !== undefined && char !== '}') {\n sub += char;\n char = format[position++];\n }\n var isClosed = char === '}';\n\n var type = RE_TOKEN_LIST_VALUE.test(sub)\n ? 'list'\n : isClosed && RE_TOKEN_NAMED_VALUE.test(sub)\n ? 'named'\n : 'unknown';\n tokens.push({ value: sub, type: type });\n } else if (char === '%') {\n // when found rails i18n syntax, skip text capture\n if (format[(position)] !== '{') {\n text += char;\n }\n } else {\n text += char;\n }\n }\n\n text && tokens.push({ type: 'text', value: text });\n\n return tokens\n}\n\nfunction compile (tokens, values) {\n var compiled = [];\n var index = 0;\n\n var mode = Array.isArray(values)\n ? 'list'\n : isObject(values)\n ? 'named'\n : 'unknown';\n if (mode === 'unknown') { return compiled }\n\n while (index < tokens.length) {\n var token = tokens[index];\n switch (token.type) {\n case 'text':\n compiled.push(token.value);\n break\n case 'list':\n compiled.push(values[parseInt(token.value, 10)]);\n break\n case 'named':\n if (mode === 'named') {\n compiled.push((values)[token.value]);\n } else {\n if (process.env.NODE_ENV !== 'production') {\n warn((\"Type of token '\" + (token.type) + \"' and format of value '\" + mode + \"' don't match!\"));\n }\n }\n break\n case 'unknown':\n if (process.env.NODE_ENV !== 'production') {\n warn(\"Detect 'unknown' type of token!\");\n }\n break\n }\n index++;\n }\n\n return compiled\n}\n\n/* */\n\n/**\n * Path parser\n * - Inspired:\n * Vue.js Path parser\n */\n\n// actions\nvar APPEND = 0;\nvar PUSH = 1;\nvar INC_SUB_PATH_DEPTH = 2;\nvar PUSH_SUB_PATH = 3;\n\n// states\nvar BEFORE_PATH = 0;\nvar IN_PATH = 1;\nvar BEFORE_IDENT = 2;\nvar IN_IDENT = 3;\nvar IN_SUB_PATH = 4;\nvar IN_SINGLE_QUOTE = 5;\nvar IN_DOUBLE_QUOTE = 6;\nvar AFTER_PATH = 7;\nvar ERROR = 8;\n\nvar pathStateMachine = [];\n\npathStateMachine[BEFORE_PATH] = {\n 'ws': [BEFORE_PATH],\n 'ident': [IN_IDENT, APPEND],\n '[': [IN_SUB_PATH],\n 'eof': [AFTER_PATH]\n};\n\npathStateMachine[IN_PATH] = {\n 'ws': [IN_PATH],\n '.': [BEFORE_IDENT],\n '[': [IN_SUB_PATH],\n 'eof': [AFTER_PATH]\n};\n\npathStateMachine[BEFORE_IDENT] = {\n 'ws': [BEFORE_IDENT],\n 'ident': [IN_IDENT, APPEND],\n '0': [IN_IDENT, APPEND],\n 'number': [IN_IDENT, APPEND]\n};\n\npathStateMachine[IN_IDENT] = {\n 'ident': [IN_IDENT, APPEND],\n '0': [IN_IDENT, APPEND],\n 'number': [IN_IDENT, APPEND],\n 'ws': [IN_PATH, PUSH],\n '.': [BEFORE_IDENT, PUSH],\n '[': [IN_SUB_PATH, PUSH],\n 'eof': [AFTER_PATH, PUSH]\n};\n\npathStateMachine[IN_SUB_PATH] = {\n \"'\": [IN_SINGLE_QUOTE, APPEND],\n '\"': [IN_DOUBLE_QUOTE, APPEND],\n '[': [IN_SUB_PATH, INC_SUB_PATH_DEPTH],\n ']': [IN_PATH, PUSH_SUB_PATH],\n 'eof': ERROR,\n 'else': [IN_SUB_PATH, APPEND]\n};\n\npathStateMachine[IN_SINGLE_QUOTE] = {\n \"'\": [IN_SUB_PATH, APPEND],\n 'eof': ERROR,\n 'else': [IN_SINGLE_QUOTE, APPEND]\n};\n\npathStateMachine[IN_DOUBLE_QUOTE] = {\n '\"': [IN_SUB_PATH, APPEND],\n 'eof': ERROR,\n 'else': [IN_DOUBLE_QUOTE, APPEND]\n};\n\n/**\n * Check if an expression is a literal value.\n */\n\nvar literalValueRE = /^\\s?(?:true|false|-?[\\d.]+|'[^']*'|\"[^\"]*\")\\s?$/;\nfunction isLiteral (exp) {\n return literalValueRE.test(exp)\n}\n\n/**\n * Strip quotes from a string\n */\n\nfunction stripQuotes (str) {\n var a = str.charCodeAt(0);\n var b = str.charCodeAt(str.length - 1);\n return a === b && (a === 0x22 || a === 0x27)\n ? str.slice(1, -1)\n : str\n}\n\n/**\n * Determine the type of a character in a keypath.\n */\n\nfunction getPathCharType (ch) {\n if (ch === undefined || ch === null) { return 'eof' }\n\n var code = ch.charCodeAt(0);\n\n switch (code) {\n case 0x5B: // [\n case 0x5D: // ]\n case 0x2E: // .\n case 0x22: // \"\n case 0x27: // '\n return ch\n\n case 0x5F: // _\n case 0x24: // $\n case 0x2D: // -\n return 'ident'\n\n case 0x09: // Tab\n case 0x0A: // Newline\n case 0x0D: // Return\n case 0xA0: // No-break space\n case 0xFEFF: // Byte Order Mark\n case 0x2028: // Line Separator\n case 0x2029: // Paragraph Separator\n return 'ws'\n }\n\n return 'ident'\n}\n\n/**\n * Format a subPath, return its plain form if it is\n * a literal string or number. Otherwise prepend the\n * dynamic indicator (*).\n */\n\nfunction formatSubPath (path) {\n var trimmed = path.trim();\n // invalid leading 0\n if (path.charAt(0) === '0' && isNaN(path)) { return false }\n\n return isLiteral(trimmed) ? stripQuotes(trimmed) : '*' + trimmed\n}\n\n/**\n * Parse a string path into an array of segments\n */\n\nfunction parse$1 (path) {\n var keys = [];\n var index = -1;\n var mode = BEFORE_PATH;\n var subPathDepth = 0;\n var c;\n var key;\n var newChar;\n var type;\n var transition;\n var action;\n var typeMap;\n var actions = [];\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key);\n key = undefined;\n }\n };\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar;\n } else {\n key += newChar;\n }\n };\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]();\n subPathDepth++;\n };\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--;\n mode = IN_SUB_PATH;\n actions[APPEND]();\n } else {\n subPathDepth = 0;\n if (key === undefined) { return false }\n key = formatSubPath(key);\n if (key === false) {\n return false\n } else {\n actions[PUSH]();\n }\n }\n };\n\n function maybeUnescapeQuote () {\n var nextChar = path[index + 1];\n if ((mode === IN_SINGLE_QUOTE && nextChar === \"'\") ||\n (mode === IN_DOUBLE_QUOTE && nextChar === '\"')) {\n index++;\n newChar = '\\\\' + nextChar;\n actions[APPEND]();\n return true\n }\n }\n\n while (mode !== null) {\n index++;\n c = path[index];\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue\n }\n\n type = getPathCharType(c);\n typeMap = pathStateMachine[mode];\n transition = typeMap[type] || typeMap['else'] || ERROR;\n\n if (transition === ERROR) {\n return // parse error\n }\n\n mode = transition[0];\n action = actions[transition[1]];\n if (action) {\n newChar = transition[2];\n newChar = newChar === undefined\n ? c\n : newChar;\n if (action() === false) {\n return\n }\n }\n\n if (mode === AFTER_PATH) {\n return keys\n }\n }\n}\n\n\n\n\n\nvar I18nPath = function I18nPath () {\n this._cache = Object.create(null);\n};\n\n/**\n * External parse that check for a cache hit first\n */\nI18nPath.prototype.parsePath = function parsePath (path) {\n var hit = this._cache[path];\n if (!hit) {\n hit = parse$1(path);\n if (hit) {\n this._cache[path] = hit;\n }\n }\n return hit || []\n};\n\n/**\n * Get path value from path string\n */\nI18nPath.prototype.getPathValue = function getPathValue (obj, path) {\n if (!isObject(obj)) { return null }\n\n var paths = this.parsePath(path);\n if (paths.length === 0) {\n return null\n } else {\n var length = paths.length;\n var last = obj;\n var i = 0;\n while (i < length) {\n var value = last[paths[i]];\n if (value === undefined || value === null) {\n return null\n }\n last = value;\n i++;\n }\n\n return last\n }\n};\n\n/* */\n\n\n\nvar htmlTagMatcher = /<\\/?[\\w\\s=\"/.':;#-\\/]+>/;\nvar linkKeyMatcher = /(?:@(?:\\.[a-zA-Z]+)?:(?:[\\w\\-_|./]+|\\([\\w\\-_:|./]+\\)))/g;\nvar linkKeyPrefixMatcher = /^@(?:\\.([a-zA-Z]+))?:/;\nvar bracketsMatcher = /[()]/g;\nvar defaultModifiers = {\n 'upper': function (str) { return str.toLocaleUpperCase(); },\n 'lower': function (str) { return str.toLocaleLowerCase(); },\n 'capitalize': function (str) { return (\"\" + (str.charAt(0).toLocaleUpperCase()) + (str.substr(1))); }\n};\n\nvar defaultFormatter = new BaseFormatter();\n\nvar VueI18n = function VueI18n (options) {\n var this$1 = this;\n if ( options === void 0 ) options = {};\n\n // Auto install if it is not done yet and `window` has `Vue`.\n // To allow users to avoid auto-installation in some cases,\n // this code should be placed here. See #290\n /* istanbul ignore if */\n if (!Vue && typeof window !== 'undefined' && window.Vue) {\n install(window.Vue);\n }\n\n var locale = options.locale || 'en-US';\n var fallbackLocale = options.fallbackLocale === false\n ? false\n : options.fallbackLocale || 'en-US';\n var messages = options.messages || {};\n var dateTimeFormats = options.dateTimeFormats || options.datetimeFormats || {};\n var numberFormats = options.numberFormats || {};\n\n this._vm = null;\n this._formatter = options.formatter || defaultFormatter;\n this._modifiers = options.modifiers || {};\n this._missing = options.missing || null;\n this._root = options.root || null;\n this._sync = options.sync === undefined ? true : !!options.sync;\n this._fallbackRoot = options.fallbackRoot === undefined\n ? true\n : !!options.fallbackRoot;\n this._fallbackRootWithEmptyString = options.fallbackRootWithEmptyString === undefined\n ? true\n : !!options.fallbackRootWithEmptyString;\n this._formatFallbackMessages = options.formatFallbackMessages === undefined\n ? false\n : !!options.formatFallbackMessages;\n this._silentTranslationWarn = options.silentTranslationWarn === undefined\n ? false\n : options.silentTranslationWarn;\n this._silentFallbackWarn = options.silentFallbackWarn === undefined\n ? false\n : !!options.silentFallbackWarn;\n this._dateTimeFormatters = {};\n this._numberFormatters = {};\n this._path = new I18nPath();\n this._dataListeners = new Set();\n this._componentInstanceCreatedListener = options.componentInstanceCreatedListener || null;\n this._preserveDirectiveContent = options.preserveDirectiveContent === undefined\n ? false\n : !!options.preserveDirectiveContent;\n this.pluralizationRules = options.pluralizationRules || {};\n this._warnHtmlInMessage = options.warnHtmlInMessage || 'off';\n this._postTranslation = options.postTranslation || null;\n this._escapeParameterHtml = options.escapeParameterHtml || false;\n\n if ('__VUE_I18N_BRIDGE__' in options) {\n this.__VUE_I18N_BRIDGE__ = options.__VUE_I18N_BRIDGE__;\n }\n\n /**\n * @param choice {number} a choice index given by the input to $tc: `$tc('path.to.rule', choiceIndex)`\n * @param choicesLength {number} an overall amount of available choices\n * @returns a final choice index\n */\n this.getChoiceIndex = function (choice, choicesLength) {\n var thisPrototype = Object.getPrototypeOf(this$1);\n if (thisPrototype && thisPrototype.getChoiceIndex) {\n var prototypeGetChoiceIndex = (thisPrototype.getChoiceIndex);\n return (prototypeGetChoiceIndex).call(this$1, choice, choicesLength)\n }\n\n // Default (old) getChoiceIndex implementation - english-compatible\n var defaultImpl = function (_choice, _choicesLength) {\n _choice = Math.abs(_choice);\n\n if (_choicesLength === 2) {\n return _choice\n ? _choice > 1\n ? 1\n : 0\n : 1\n }\n\n return _choice ? Math.min(_choice, 2) : 0\n };\n\n if (this$1.locale in this$1.pluralizationRules) {\n return this$1.pluralizationRules[this$1.locale].apply(this$1, [choice, choicesLength])\n } else {\n return defaultImpl(choice, choicesLength)\n }\n };\n\n\n this._exist = function (message, key) {\n if (!message || !key) { return false }\n if (!isNull(this$1._path.getPathValue(message, key))) { return true }\n // fallback for flat key\n if (message[key]) { return true }\n return false\n };\n\n if (this._warnHtmlInMessage === 'warn' || this._warnHtmlInMessage === 'error') {\n Object.keys(messages).forEach(function (locale) {\n this$1._checkLocaleMessage(locale, this$1._warnHtmlInMessage, messages[locale]);\n });\n }\n\n this._initVM({\n locale: locale,\n fallbackLocale: fallbackLocale,\n messages: messages,\n dateTimeFormats: dateTimeFormats,\n numberFormats: numberFormats\n });\n};\n\nvar prototypeAccessors = { vm: { configurable: true },messages: { configurable: true },dateTimeFormats: { configurable: true },numberFormats: { configurable: true },availableLocales: { configurable: true },locale: { configurable: true },fallbackLocale: { configurable: true },formatFallbackMessages: { configurable: true },missing: { configurable: true },formatter: { configurable: true },silentTranslationWarn: { configurable: true },silentFallbackWarn: { configurable: true },preserveDirectiveContent: { configurable: true },warnHtmlInMessage: { configurable: true },postTranslation: { configurable: true },sync: { configurable: true } };\n\nVueI18n.prototype._checkLocaleMessage = function _checkLocaleMessage (locale, level, message) {\n var paths = [];\n\n var fn = function (level, locale, message, paths) {\n if (isPlainObject(message)) {\n Object.keys(message).forEach(function (key) {\n var val = message[key];\n if (isPlainObject(val)) {\n paths.push(key);\n paths.push('.');\n fn(level, locale, val, paths);\n paths.pop();\n paths.pop();\n } else {\n paths.push(key);\n fn(level, locale, val, paths);\n paths.pop();\n }\n });\n } else if (isArray(message)) {\n message.forEach(function (item, index) {\n if (isPlainObject(item)) {\n paths.push((\"[\" + index + \"]\"));\n paths.push('.');\n fn(level, locale, item, paths);\n paths.pop();\n paths.pop();\n } else {\n paths.push((\"[\" + index + \"]\"));\n fn(level, locale, item, paths);\n paths.pop();\n }\n });\n } else if (isString(message)) {\n var ret = htmlTagMatcher.test(message);\n if (ret) {\n var msg = \"Detected HTML in message '\" + message + \"' of keypath '\" + (paths.join('')) + \"' at '\" + locale + \"'. Consider component interpolation with '<i18n>' to avoid XSS. See https://bit.ly/2ZqJzkp\";\n if (level === 'warn') {\n warn(msg);\n } else if (level === 'error') {\n error(msg);\n }\n }\n }\n };\n\n fn(level, locale, message, paths);\n};\n\nVueI18n.prototype._initVM = function _initVM (data) {\n var silent = Vue.config.silent;\n Vue.config.silent = true;\n this._vm = new Vue({ data: data, __VUE18N__INSTANCE__: true });\n Vue.config.silent = silent;\n};\n\nVueI18n.prototype.destroyVM = function destroyVM () {\n this._vm.$destroy();\n};\n\nVueI18n.prototype.subscribeDataChanging = function subscribeDataChanging (vm) {\n this._dataListeners.add(vm);\n};\n\nVueI18n.prototype.unsubscribeDataChanging = function unsubscribeDataChanging (vm) {\n remove(this._dataListeners, vm);\n};\n\nVueI18n.prototype.watchI18nData = function watchI18nData () {\n var this$1 = this;\n return this._vm.$watch('$data', function () {\n var listeners = arrayFrom(this$1._dataListeners);\n var i = listeners.length;\n while(i--) {\n Vue.nextTick(function () {\n listeners[i] && listeners[i].$forceUpdate();\n });\n }\n }, { deep: true })\n};\n\nVueI18n.prototype.watchLocale = function watchLocale (composer) {\n if (!composer) {\n /* istanbul ignore if */\n if (!this._sync || !this._root) { return null }\n var target = this._vm;\n return this._root.$i18n.vm.$watch('locale', function (val) {\n target.$set(target, 'locale', val);\n target.$forceUpdate();\n }, { immediate: true })\n } else {\n // deal with vue-i18n-bridge\n if (!this.__VUE_I18N_BRIDGE__) { return null }\n var self = this;\n var target$1 = this._vm;\n return this.vm.$watch('locale', function (val) {\n target$1.$set(target$1, 'locale', val);\n if (self.__VUE_I18N_BRIDGE__ && composer) {\n composer.locale.value = val;\n }\n target$1.$forceUpdate();\n }, { immediate: true })\n }\n};\n\nVueI18n.prototype.onComponentInstanceCreated = function onComponentInstanceCreated (newI18n) {\n if (this._componentInstanceCreatedListener) {\n this._componentInstanceCreatedListener(newI18n, this);\n }\n};\n\nprototypeAccessors.vm.get = function () { return this._vm };\n\nprototypeAccessors.messages.get = function () { return looseClone(this._getMessages()) };\nprototypeAccessors.dateTimeFormats.get = function () { return looseClone(this._getDateTimeFormats()) };\nprototypeAccessors.numberFormats.get = function () { return looseClone(this._getNumberFormats()) };\nprototypeAccessors.availableLocales.get = function () { return Object.keys(this.messages).sort() };\n\nprototypeAccessors.locale.get = function () { return this._vm.locale };\nprototypeAccessors.locale.set = function (locale) {\n this._vm.$set(this._vm, 'locale', locale);\n};\n\nprototypeAccessors.fallbackLocale.get = function () { return this._vm.fallbackLocale };\nprototypeAccessors.fallbackLocale.set = function (locale) {\n this._localeChainCache = {};\n this._vm.$set(this._vm, 'fallbackLocale', locale);\n};\n\nprototypeAccessors.formatFallbackMessages.get = function () { return this._formatFallbackMessages };\nprototypeAccessors.formatFallbackMessages.set = function (fallback) { this._formatFallbackMessages = fallback; };\n\nprototypeAccessors.missing.get = function () { return this._missing };\nprototypeAccessors.missing.set = function (handler) { this._missing = handler; };\n\nprototypeAccessors.formatter.get = function () { return this._formatter };\nprototypeAccessors.formatter.set = function (formatter) { this._formatter = formatter; };\n\nprototypeAccessors.silentTranslationWarn.get = function () { return this._silentTranslationWarn };\nprototypeAccessors.silentTranslationWarn.set = function (silent) { this._silentTranslationWarn = silent; };\n\nprototypeAccessors.silentFallbackWarn.get = function () { return this._silentFallbackWarn };\nprototypeAccessors.silentFallbackWarn.set = function (silent) { this._silentFallbackWarn = silent; };\n\nprototypeAccessors.preserveDirectiveContent.get = function () { return this._preserveDirectiveContent };\nprototypeAccessors.preserveDirectiveContent.set = function (preserve) { this._preserveDirectiveContent = preserve; };\n\nprototypeAccessors.warnHtmlInMessage.get = function () { return this._warnHtmlInMessage };\nprototypeAccessors.warnHtmlInMessage.set = function (level) {\n var this$1 = this;\n\n var orgLevel = this._warnHtmlInMessage;\n this._warnHtmlInMessage = level;\n if (orgLevel !== level && (level === 'warn' || level === 'error')) {\n var messages = this._getMessages();\n Object.keys(messages).forEach(function (locale) {\n this$1._checkLocaleMessage(locale, this$1._warnHtmlInMessage, messages[locale]);\n });\n }\n};\n\nprototypeAccessors.postTranslation.get = function () { return this._postTranslation };\nprototypeAccessors.postTranslation.set = function (handler) { this._postTranslation = handler; };\n\nprototypeAccessors.sync.get = function () { return this._sync };\nprototypeAccessors.sync.set = function (val) { this._sync = val; };\n\nVueI18n.prototype._getMessages = function _getMessages () { return this._vm.messages };\nVueI18n.prototype._getDateTimeFormats = function _getDateTimeFormats () { return this._vm.dateTimeFormats };\nVueI18n.prototype._getNumberFormats = function _getNumberFormats () { return this._vm.numberFormats };\n\nVueI18n.prototype._warnDefault = function _warnDefault (locale, key, result, vm, values, interpolateMode) {\n if (!isNull(result)) { return result }\n if (this._missing) {\n var missingRet = this._missing.apply(null, [locale, key, vm, values]);\n if (isString(missingRet)) {\n return missingRet\n }\n } else {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key)) {\n warn(\n \"Cannot translate the value of keypath '\" + key + \"'. \" +\n 'Use the value of keypath as default.'\n );\n }\n }\n\n if (this._formatFallbackMessages) {\n var parsedArgs = parseArgs.apply(void 0, values);\n return this._render(key, interpolateMode, parsedArgs.params, key)\n } else {\n return key\n }\n};\n\nVueI18n.prototype._isFallbackRoot = function _isFallbackRoot (val) {\n return (this._fallbackRootWithEmptyString? !val : isNull(val)) && !isNull(this._root) && this._fallbackRoot\n};\n\nVueI18n.prototype._isSilentFallbackWarn = function _isSilentFallbackWarn (key) {\n return this._silentFallbackWarn instanceof RegExp\n ? this._silentFallbackWarn.test(key)\n : this._silentFallbackWarn\n};\n\nVueI18n.prototype._isSilentFallback = function _isSilentFallback (locale, key) {\n return this._isSilentFallbackWarn(key) && (this._isFallbackRoot() || locale !== this.fallbackLocale)\n};\n\nVueI18n.prototype._isSilentTranslationWarn = function _isSilentTranslationWarn (key) {\n return this._silentTranslationWarn instanceof RegExp\n ? this._silentTranslationWarn.test(key)\n : this._silentTranslationWarn\n};\n\nVueI18n.prototype._interpolate = function _interpolate (\n locale,\n message,\n key,\n host,\n interpolateMode,\n values,\n visitedLinkStack\n) {\n if (!message) { return null }\n\n var pathRet = this._path.getPathValue(message, key);\n if (isArray(pathRet) || isPlainObject(pathRet)) { return pathRet }\n\n var ret;\n if (isNull(pathRet)) {\n /* istanbul ignore else */\n if (isPlainObject(message)) {\n ret = message[key];\n if (!(isString(ret) || isFunction(ret))) {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallback(locale, key)) {\n warn((\"Value of key '\" + key + \"' is not a string or function !\"));\n }\n return null\n }\n } else {\n return null\n }\n } else {\n /* istanbul ignore else */\n if (isString(pathRet) || isFunction(pathRet)) {\n ret = pathRet;\n } else {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallback(locale, key)) {\n warn((\"Value of key '\" + key + \"' is not a string or function!\"));\n }\n return null\n }\n }\n\n // Check for the existence of links within the translated string\n if (isString(ret) && (ret.indexOf('@:') >= 0 || ret.indexOf('@.') >= 0)) {\n ret = this._link(locale, message, ret, host, 'raw', values, visitedLinkStack);\n }\n\n return this._render(ret, interpolateMode, values, key)\n};\n\nVueI18n.prototype._link = function _link (\n locale,\n message,\n str,\n host,\n interpolateMode,\n values,\n visitedLinkStack\n) {\n var ret = str;\n\n // Match all the links within the local\n // We are going to replace each of\n // them with its translation\n var matches = ret.match(linkKeyMatcher);\n\n // eslint-disable-next-line no-autofix/prefer-const\n for (var idx in matches) {\n // ie compatible: filter custom array\n // prototype method\n if (!matches.hasOwnProperty(idx)) {\n continue\n }\n var link = matches[idx];\n var linkKeyPrefixMatches = link.match(linkKeyPrefixMatcher);\n var linkPrefix = linkKeyPrefixMatches[0];\n var formatterName = linkKeyPrefixMatches[1];\n\n // Remove the leading @:, @.case: and the brackets\n var linkPlaceholder = link.replace(linkPrefix, '').replace(bracketsMatcher, '');\n\n if (includes(visitedLinkStack, linkPlaceholder)) {\n if (process.env.NODE_ENV !== 'production') {\n warn((\"Circular reference found. \\\"\" + link + \"\\\" is already visited in the chain of \" + (visitedLinkStack.reverse().join(' <- '))));\n }\n return ret\n }\n visitedLinkStack.push(linkPlaceholder);\n\n // Translate the link\n var translated = this._interpolate(\n locale, message, linkPlaceholder, host,\n interpolateMode === 'raw' ? 'string' : interpolateMode,\n interpolateMode === 'raw' ? undefined : values,\n visitedLinkStack\n );\n\n if (this._isFallbackRoot(translated)) {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(linkPlaceholder)) {\n warn((\"Fall back to translate the link placeholder '\" + linkPlaceholder + \"' with root locale.\"));\n }\n /* istanbul ignore if */\n if (!this._root) { throw Error('unexpected error') }\n var root = this._root.$i18n;\n translated = root._translate(\n root._getMessages(), root.locale, root.fallbackLocale,\n linkPlaceholder, host, interpolateMode, values\n );\n }\n translated = this._warnDefault(\n locale, linkPlaceholder, translated, host,\n isArray(values) ? values : [values],\n interpolateMode\n );\n\n if (this._modifiers.hasOwnProperty(formatterName)) {\n translated = this._modifiers[formatterName](translated);\n } else if (defaultModifiers.hasOwnProperty(formatterName)) {\n translated = defaultModifiers[formatterName](translated);\n }\n\n visitedLinkStack.pop();\n\n // Replace the link with the translated\n ret = !translated ? ret : ret.replace(link, translated);\n }\n\n return ret\n};\n\nVueI18n.prototype._createMessageContext = function _createMessageContext (values, formatter, path, interpolateMode) {\n var this$1 = this;\n\n var _list = isArray(values) ? values : [];\n var _named = isObject(values) ? values : {};\n var list = function (index) { return _list[index]; };\n var named = function (key) { return _named[key]; };\n var messages = this._getMessages();\n var locale = this.locale;\n\n return {\n list: list,\n named: named,\n values: values,\n formatter: formatter,\n path: path,\n messages: messages,\n locale: locale,\n linked: function (linkedKey) { return this$1._interpolate(locale, messages[locale] || {}, linkedKey, null, interpolateMode, undefined, [linkedKey]); }\n }\n};\n\nVueI18n.prototype._render = function _render (message, interpolateMode, values, path) {\n if (isFunction(message)) {\n return message(\n this._createMessageContext(values, this._formatter || defaultFormatter, path, interpolateMode)\n )\n }\n\n var ret = this._formatter.interpolate(message, values, path);\n\n // If the custom formatter refuses to work - apply the default one\n if (!ret) {\n ret = defaultFormatter.interpolate(message, values, path);\n }\n\n // if interpolateMode is **not** 'string' ('row'),\n // return the compiled data (e.g. ['foo', VNode, 'bar']) with formatter\n return interpolateMode === 'string' && !isString(ret) ? ret.join('') : ret\n};\n\nVueI18n.prototype._appendItemToChain = function _appendItemToChain (chain, item, blocks) {\n var follow = false;\n if (!includes(chain, item)) {\n follow = true;\n if (item) {\n follow = item[item.length - 1] !== '!';\n item = item.replace(/!/g, '');\n chain.push(item);\n if (blocks && blocks[item]) {\n follow = blocks[item];\n }\n }\n }\n return follow\n};\n\nVueI18n.prototype._appendLocaleToChain = function _appendLocaleToChain (chain, locale, blocks) {\n var follow;\n var tokens = locale.split('-');\n do {\n var item = tokens.join('-');\n follow = this._appendItemToChain(chain, item, blocks);\n tokens.splice(-1, 1);\n } while (tokens.length && (follow === true))\n return follow\n};\n\nVueI18n.prototype._appendBlockToChain = function _appendBlockToChain (chain, block, blocks) {\n var follow = true;\n for (var i = 0; (i < block.length) && (isBoolean(follow)); i++) {\n var locale = block[i];\n if (isString(locale)) {\n follow = this._appendLocaleToChain(chain, locale, blocks);\n }\n }\n return follow\n};\n\nVueI18n.prototype._getLocaleChain = function _getLocaleChain (start, fallbackLocale) {\n if (start === '') { return [] }\n\n if (!this._localeChainCache) {\n this._localeChainCache = {};\n }\n\n var chain = this._localeChainCache[start];\n if (!chain) {\n if (!fallbackLocale) {\n fallbackLocale = this.fallbackLocale;\n }\n chain = [];\n\n // first block defined by start\n var block = [start];\n\n // while any intervening block found\n while (isArray(block)) {\n block = this._appendBlockToChain(\n chain,\n block,\n fallbackLocale\n );\n }\n\n // last block defined by default\n var defaults;\n if (isArray(fallbackLocale)) {\n defaults = fallbackLocale;\n } else if (isObject(fallbackLocale)) {\n /* $FlowFixMe */\n if (fallbackLocale['default']) {\n defaults = fallbackLocale['default'];\n } else {\n defaults = null;\n }\n } else {\n defaults = fallbackLocale;\n }\n\n // convert defaults to array\n if (isString(defaults)) {\n block = [defaults];\n } else {\n block = defaults;\n }\n if (block) {\n this._appendBlockToChain(\n chain,\n block,\n null\n );\n }\n this._localeChainCache[start] = chain;\n }\n return chain\n};\n\nVueI18n.prototype._translate = function _translate (\n messages,\n locale,\n fallback,\n key,\n host,\n interpolateMode,\n args\n) {\n var chain = this._getLocaleChain(locale, fallback);\n var res;\n for (var i = 0; i < chain.length; i++) {\n var step = chain[i];\n res =\n this._interpolate(step, messages[step], key, host, interpolateMode, args, [key]);\n if (!isNull(res)) {\n if (step !== locale && process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallbackWarn(key)) {\n warn((\"Fall back to translate the keypath '\" + key + \"' with '\" + step + \"' locale.\"));\n }\n return res\n }\n }\n return null\n};\n\nVueI18n.prototype._t = function _t (key, _locale, messages, host) {\n var ref;\n\n var values = [], len = arguments.length - 4;\n while ( len-- > 0 ) values[ len ] = arguments[ len + 4 ];\n if (!key) { return '' }\n\n var parsedArgs = parseArgs.apply(void 0, values);\n if(this._escapeParameterHtml) {\n parsedArgs.params = escapeParams(parsedArgs.params);\n }\n\n var locale = parsedArgs.locale || _locale;\n\n var ret = this._translate(\n messages, locale, this.fallbackLocale, key,\n host, 'string', parsedArgs.params\n );\n if (this._isFallbackRoot(ret)) {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallbackWarn(key)) {\n warn((\"Fall back to translate the keypath '\" + key + \"' with root locale.\"));\n }\n /* istanbul ignore if */\n if (!this._root) { throw Error('unexpected error') }\n return (ref = this._root).$t.apply(ref, [ key ].concat( values ))\n } else {\n ret = this._warnDefault(locale, key, ret, host, values, 'string');\n if (this._postTranslation && ret !== null && ret !== undefined) {\n ret = this._postTranslation(ret, key);\n }\n return ret\n }\n};\n\nVueI18n.prototype.t = function t (key) {\n var ref;\n\n var values = [], len = arguments.length - 1;\n while ( len-- > 0 ) values[ len ] = arguments[ len + 1 ];\n return (ref = this)._t.apply(ref, [ key, this.locale, this._getMessages(), null ].concat( values ))\n};\n\nVueI18n.prototype._i = function _i (key, locale, messages, host, values) {\n var ret =\n this._translate(messages, locale, this.fallbackLocale, key, host, 'raw', values);\n if (this._isFallbackRoot(ret)) {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key)) {\n warn((\"Fall back to interpolate the keypath '\" + key + \"' with root locale.\"));\n }\n if (!this._root) { throw Error('unexpected error') }\n return this._root.$i18n.i(key, locale, values)\n } else {\n return this._warnDefault(locale, key, ret, host, [values], 'raw')\n }\n};\n\nVueI18n.prototype.i = function i (key, locale, values) {\n /* istanbul ignore if */\n if (!key) { return '' }\n\n if (!isString(locale)) {\n locale = this.locale;\n }\n\n return this._i(key, locale, this._getMessages(), null, values)\n};\n\nVueI18n.prototype._tc = function _tc (\n key,\n _locale,\n messages,\n host,\n choice\n) {\n var ref;\n\n var values = [], len = arguments.length - 5;\n while ( len-- > 0 ) values[ len ] = arguments[ len + 5 ];\n if (!key) { return '' }\n if (choice === undefined) {\n choice = 1;\n }\n\n var predefined = { 'count': choice, 'n': choice };\n var parsedArgs = parseArgs.apply(void 0, values);\n parsedArgs.params = Object.assign(predefined, parsedArgs.params);\n values = parsedArgs.locale === null ? [parsedArgs.params] : [parsedArgs.locale, parsedArgs.params];\n return this.fetchChoice((ref = this)._t.apply(ref, [ key, _locale, messages, host ].concat( values )), choice)\n};\n\nVueI18n.prototype.fetchChoice = function fetchChoice (message, choice) {\n /* istanbul ignore if */\n if (!message || !isString(message)) { return null }\n var choices = message.split('|');\n\n choice = this.getChoiceIndex(choice, choices.length);\n if (!choices[choice]) { return message }\n return choices[choice].trim()\n};\n\nVueI18n.prototype.tc = function tc (key, choice) {\n var ref;\n\n var values = [], len = arguments.length - 2;\n while ( len-- > 0 ) values[ len ] = arguments[ len + 2 ];\n return (ref = this)._tc.apply(ref, [ key, this.locale, this._getMessages(), null, choice ].concat( values ))\n};\n\nVueI18n.prototype._te = function _te (key, locale, messages) {\n var args = [], len = arguments.length - 3;\n while ( len-- > 0 ) args[ len ] = arguments[ len + 3 ];\n\n var _locale = parseArgs.apply(void 0, args).locale || locale;\n return this._exist(messages[_locale], key)\n};\n\nVueI18n.prototype.te = function te (key, locale) {\n return this._te(key, this.locale, this._getMessages(), locale)\n};\n\nVueI18n.prototype.getLocaleMessage = function getLocaleMessage (locale) {\n return looseClone(this._vm.messages[locale] || {})\n};\n\nVueI18n.prototype.setLocaleMessage = function setLocaleMessage (locale, message) {\n if (this._warnHtmlInMessage === 'warn' || this._warnHtmlInMessage === 'error') {\n this._checkLocaleMessage(locale, this._warnHtmlInMessage, message);\n }\n this._vm.$set(this._vm.messages, locale, message);\n};\n\nVueI18n.prototype.mergeLocaleMessage = function mergeLocaleMessage (locale, message) {\n if (this._warnHtmlInMessage === 'warn' || this._warnHtmlInMessage === 'error') {\n this._checkLocaleMessage(locale, this._warnHtmlInMessage, message);\n }\n this._vm.$set(this._vm.messages, locale, merge(\n typeof this._vm.messages[locale] !== 'undefined' && Object.keys(this._vm.messages[locale]).length\n ? Object.assign({}, this._vm.messages[locale])\n : {},\n message\n ));\n};\n\nVueI18n.prototype.getDateTimeFormat = function getDateTimeFormat (locale) {\n return looseClone(this._vm.dateTimeFormats[locale] || {})\n};\n\nVueI18n.prototype.setDateTimeFormat = function setDateTimeFormat (locale, format) {\n this._vm.$set(this._vm.dateTimeFormats, locale, format);\n this._clearDateTimeFormat(locale, format);\n};\n\nVueI18n.prototype.mergeDateTimeFormat = function mergeDateTimeFormat (locale, format) {\n this._vm.$set(this._vm.dateTimeFormats, locale, merge(this._vm.dateTimeFormats[locale] || {}, format));\n this._clearDateTimeFormat(locale, format);\n};\n\nVueI18n.prototype._clearDateTimeFormat = function _clearDateTimeFormat (locale, format) {\n // eslint-disable-next-line no-autofix/prefer-const\n for (var key in format) {\n var id = locale + \"__\" + key;\n\n if (!this._dateTimeFormatters.hasOwnProperty(id)) {\n continue\n }\n\n delete this._dateTimeFormatters[id];\n }\n};\n\nVueI18n.prototype._localizeDateTime = function _localizeDateTime (\n value,\n locale,\n fallback,\n dateTimeFormats,\n key\n) {\n var _locale = locale;\n var formats = dateTimeFormats[_locale];\n\n var chain = this._getLocaleChain(locale, fallback);\n for (var i = 0; i < chain.length; i++) {\n var current = _locale;\n var step = chain[i];\n formats = dateTimeFormats[step];\n _locale = step;\n // fallback locale\n if (isNull(formats) || isNull(formats[key])) {\n if (step !== locale && process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallbackWarn(key)) {\n warn((\"Fall back to '\" + step + \"' datetime formats from '\" + current + \"' datetime formats.\"));\n }\n } else {\n break\n }\n }\n\n if (isNull(formats) || isNull(formats[key])) {\n return null\n } else {\n var format = formats[key];\n var id = _locale + \"__\" + key;\n var formatter = this._dateTimeFormatters[id];\n if (!formatter) {\n formatter = this._dateTimeFormatters[id] = new Intl.DateTimeFormat(_locale, format);\n }\n return formatter.format(value)\n }\n};\n\nVueI18n.prototype._d = function _d (value, locale, key) {\n /* istanbul ignore if */\n if (process.env.NODE_ENV !== 'production' && !VueI18n.availabilities.dateTimeFormat) {\n warn('Cannot format a Date value due to not supported Intl.DateTimeFormat.');\n return ''\n }\n\n if (!key) {\n return new Intl.DateTimeFormat(locale).format(value)\n }\n\n var ret =\n this._localizeDateTime(value, locale, this.fallbackLocale, this._getDateTimeFormats(), key);\n if (this._isFallbackRoot(ret)) {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallbackWarn(key)) {\n warn((\"Fall back to datetime localization of root: key '\" + key + \"'.\"));\n }\n /* istanbul ignore if */\n if (!this._root) { throw Error('unexpected error') }\n return this._root.$i18n.d(value, key, locale)\n } else {\n return ret || ''\n }\n};\n\nVueI18n.prototype.d = function d (value) {\n var args = [], len = arguments.length - 1;\n while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];\n\n var locale = this.locale;\n var key = null;\n\n if (args.length === 1) {\n if (isString(args[0])) {\n key = args[0];\n } else if (isObject(args[0])) {\n if (args[0].locale) {\n locale = args[0].locale;\n }\n if (args[0].key) {\n key = args[0].key;\n }\n }\n } else if (args.length === 2) {\n if (isString(args[0])) {\n key = args[0];\n }\n if (isString(args[1])) {\n locale = args[1];\n }\n }\n\n return this._d(value, locale, key)\n};\n\nVueI18n.prototype.getNumberFormat = function getNumberFormat (locale) {\n return looseClone(this._vm.numberFormats[locale] || {})\n};\n\nVueI18n.prototype.setNumberFormat = function setNumberFormat (locale, format) {\n this._vm.$set(this._vm.numberFormats, locale, format);\n this._clearNumberFormat(locale, format);\n};\n\nVueI18n.prototype.mergeNumberFormat = function mergeNumberFormat (locale, format) {\n this._vm.$set(this._vm.numberFormats, locale, merge(this._vm.numberFormats[locale] || {}, format));\n this._clearNumberFormat(locale, format);\n};\n\nVueI18n.prototype._clearNumberFormat = function _clearNumberFormat (locale, format) {\n // eslint-disable-next-line no-autofix/prefer-const\n for (var key in format) {\n var id = locale + \"__\" + key;\n\n if (!this._numberFormatters.hasOwnProperty(id)) {\n continue\n }\n\n delete this._numberFormatters[id];\n }\n};\n\nVueI18n.prototype._getNumberFormatter = function _getNumberFormatter (\n value,\n locale,\n fallback,\n numberFormats,\n key,\n options\n) {\n var _locale = locale;\n var formats = numberFormats[_locale];\n\n var chain = this._getLocaleChain(locale, fallback);\n for (var i = 0; i < chain.length; i++) {\n var current = _locale;\n var step = chain[i];\n formats = numberFormats[step];\n _locale = step;\n // fallback locale\n if (isNull(formats) || isNull(formats[key])) {\n if (step !== locale && process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallbackWarn(key)) {\n warn((\"Fall back to '\" + step + \"' number formats from '\" + current + \"' number formats.\"));\n }\n } else {\n break\n }\n }\n\n if (isNull(formats) || isNull(formats[key])) {\n return null\n } else {\n var format = formats[key];\n\n var formatter;\n if (options) {\n // If options specified - create one time number formatter\n formatter = new Intl.NumberFormat(_locale, Object.assign({}, format, options));\n } else {\n var id = _locale + \"__\" + key;\n formatter = this._numberFormatters[id];\n if (!formatter) {\n formatter = this._numberFormatters[id] = new Intl.NumberFormat(_locale, format);\n }\n }\n return formatter\n }\n};\n\nVueI18n.prototype._n = function _n (value, locale, key, options) {\n /* istanbul ignore if */\n if (!VueI18n.availabilities.numberFormat) {\n if (process.env.NODE_ENV !== 'production') {\n warn('Cannot format a Number value due to not supported Intl.NumberFormat.');\n }\n return ''\n }\n\n if (!key) {\n var nf = !options ? new Intl.NumberFormat(locale) : new Intl.NumberFormat(locale, options);\n return nf.format(value)\n }\n\n var formatter = this._getNumberFormatter(value, locale, this.fallbackLocale, this._getNumberFormats(), key, options);\n var ret = formatter && formatter.format(value);\n if (this._isFallbackRoot(ret)) {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallbackWarn(key)) {\n warn((\"Fall back to number localization of root: key '\" + key + \"'.\"));\n }\n /* istanbul ignore if */\n if (!this._root) { throw Error('unexpected error') }\n return this._root.$i18n.n(value, Object.assign({}, { key: key, locale: locale }, options))\n } else {\n return ret || ''\n }\n};\n\nVueI18n.prototype.n = function n (value) {\n var args = [], len = arguments.length - 1;\n while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];\n\n var locale = this.locale;\n var key = null;\n var options = null;\n\n if (args.length === 1) {\n if (isString(args[0])) {\n key = args[0];\n } else if (isObject(args[0])) {\n if (args[0].locale) {\n locale = args[0].locale;\n }\n if (args[0].key) {\n key = args[0].key;\n }\n\n // Filter out number format options only\n options = Object.keys(args[0]).reduce(function (acc, key) {\n var obj;\n\n if (includes(numberFormatKeys, key)) {\n return Object.assign({}, acc, ( obj = {}, obj[key] = args[0][key], obj ))\n }\n return acc\n }, null);\n }\n } else if (args.length === 2) {\n if (isString(args[0])) {\n key = args[0];\n }\n if (isString(args[1])) {\n locale = args[1];\n }\n }\n\n return this._n(value, locale, key, options)\n};\n\nVueI18n.prototype._ntp = function _ntp (value, locale, key, options) {\n /* istanbul ignore if */\n if (!VueI18n.availabilities.numberFormat) {\n if (process.env.NODE_ENV !== 'production') {\n warn('Cannot format to parts a Number value due to not supported Intl.NumberFormat.');\n }\n return []\n }\n\n if (!key) {\n var nf = !options ? new Intl.NumberFormat(locale) : new Intl.NumberFormat(locale, options);\n return nf.formatToParts(value)\n }\n\n var formatter = this._getNumberFormatter(value, locale, this.fallbackLocale, this._getNumberFormats(), key, options);\n var ret = formatter && formatter.formatToParts(value);\n if (this._isFallbackRoot(ret)) {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key)) {\n warn((\"Fall back to format number to parts of root: key '\" + key + \"' .\"));\n }\n /* istanbul ignore if */\n if (!this._root) { throw Error('unexpected error') }\n return this._root.$i18n._ntp(value, locale, key, options)\n } else {\n return ret || []\n }\n};\n\nObject.defineProperties( VueI18n.prototype, prototypeAccessors );\n\nvar availabilities;\n// $FlowFixMe\nObject.defineProperty(VueI18n, 'availabilities', {\n get: function get () {\n if (!availabilities) {\n var intlDefined = typeof Intl !== 'undefined';\n availabilities = {\n dateTimeFormat: intlDefined && typeof Intl.DateTimeFormat !== 'undefined',\n numberFormat: intlDefined && typeof Intl.NumberFormat !== 'undefined'\n };\n }\n\n return availabilities\n }\n});\n\nVueI18n.install = install;\nVueI18n.version = '8.27.2';\n\nexport default VueI18n;\n","/*!\n * vue-router v3.6.3\n * (c) 2022 Evan You\n * @license MIT\n */\n/* */\n\nfunction assert (condition, message) {\n if (!condition) {\n throw new Error((\"[vue-router] \" + message))\n }\n}\n\nfunction warn (condition, message) {\n if (!condition) {\n typeof console !== 'undefined' && console.warn((\"[vue-router] \" + message));\n }\n}\n\nfunction extend (a, b) {\n for (var key in b) {\n a[key] = b[key];\n }\n return a\n}\n\n/* */\n\nvar encodeReserveRE = /[!'()*]/g;\nvar encodeReserveReplacer = function (c) { return '%' + c.charCodeAt(0).toString(16); };\nvar commaRE = /%2C/g;\n\n// fixed encodeURIComponent which is more conformant to RFC3986:\n// - escapes [!'()*]\n// - preserve commas\nvar encode = function (str) { return encodeURIComponent(str)\n .replace(encodeReserveRE, encodeReserveReplacer)\n .replace(commaRE, ','); };\n\nfunction decode (str) {\n try {\n return decodeURIComponent(str)\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n warn(false, (\"Error decoding \\\"\" + str + \"\\\". Leaving it intact.\"));\n }\n }\n return str\n}\n\nfunction resolveQuery (\n query,\n extraQuery,\n _parseQuery\n) {\n if ( extraQuery === void 0 ) extraQuery = {};\n\n var parse = _parseQuery || parseQuery;\n var parsedQuery;\n try {\n parsedQuery = parse(query || '');\n } catch (e) {\n process.env.NODE_ENV !== 'production' && warn(false, e.message);\n parsedQuery = {};\n }\n for (var key in extraQuery) {\n var value = extraQuery[key];\n parsedQuery[key] = Array.isArray(value)\n ? value.map(castQueryParamValue)\n : castQueryParamValue(value);\n }\n return parsedQuery\n}\n\nvar castQueryParamValue = function (value) { return (value == null || typeof value === 'object' ? value : String(value)); };\n\nfunction parseQuery (query) {\n var res = {};\n\n query = query.trim().replace(/^(\\?|#|&)/, '');\n\n if (!query) {\n return res\n }\n\n query.split('&').forEach(function (param) {\n var parts = param.replace(/\\+/g, ' ').split('=');\n var key = decode(parts.shift());\n var val = parts.length > 0 ? decode(parts.join('=')) : null;\n\n if (res[key] === undefined) {\n res[key] = val;\n } else if (Array.isArray(res[key])) {\n res[key].push(val);\n } else {\n res[key] = [res[key], val];\n }\n });\n\n return res\n}\n\nfunction stringifyQuery (obj) {\n var res = obj\n ? Object.keys(obj)\n .map(function (key) {\n var val = obj[key];\n\n if (val === undefined) {\n return ''\n }\n\n if (val === null) {\n return encode(key)\n }\n\n if (Array.isArray(val)) {\n var result = [];\n val.forEach(function (val2) {\n if (val2 === undefined) {\n return\n }\n if (val2 === null) {\n result.push(encode(key));\n } else {\n result.push(encode(key) + '=' + encode(val2));\n }\n });\n return result.join('&')\n }\n\n return encode(key) + '=' + encode(val)\n })\n .filter(function (x) { return x.length > 0; })\n .join('&')\n : null;\n return res ? (\"?\" + res) : ''\n}\n\n/* */\n\nvar trailingSlashRE = /\\/?$/;\n\nfunction createRoute (\n record,\n location,\n redirectedFrom,\n router\n) {\n var stringifyQuery = router && router.options.stringifyQuery;\n\n var query = location.query || {};\n try {\n query = clone(query);\n } catch (e) {}\n\n var route = {\n name: location.name || (record && record.name),\n meta: (record && record.meta) || {},\n path: location.path || '/',\n hash: location.hash || '',\n query: query,\n params: location.params || {},\n fullPath: getFullPath(location, stringifyQuery),\n matched: record ? formatMatch(record) : []\n };\n if (redirectedFrom) {\n route.redirectedFrom = getFullPath(redirectedFrom, stringifyQuery);\n }\n return Object.freeze(route)\n}\n\nfunction clone (value) {\n if (Array.isArray(value)) {\n return value.map(clone)\n } else if (value && typeof value === 'object') {\n var res = {};\n for (var key in value) {\n res[key] = clone(value[key]);\n }\n return res\n } else {\n return value\n }\n}\n\n// the starting route that represents the initial state\nvar START = createRoute(null, {\n path: '/'\n});\n\nfunction formatMatch (record) {\n var res = [];\n while (record) {\n res.unshift(record);\n record = record.parent;\n }\n return res\n}\n\nfunction getFullPath (\n ref,\n _stringifyQuery\n) {\n var path = ref.path;\n var query = ref.query; if ( query === void 0 ) query = {};\n var hash = ref.hash; if ( hash === void 0 ) hash = '';\n\n var stringify = _stringifyQuery || stringifyQuery;\n return (path || '/') + stringify(query) + hash\n}\n\nfunction isSameRoute (a, b, onlyPath) {\n if (b === START) {\n return a === b\n } else if (!b) {\n return false\n } else if (a.path && b.path) {\n return a.path.replace(trailingSlashRE, '') === b.path.replace(trailingSlashRE, '') && (onlyPath ||\n a.hash === b.hash &&\n isObjectEqual(a.query, b.query))\n } else if (a.name && b.name) {\n return (\n a.name === b.name &&\n (onlyPath || (\n a.hash === b.hash &&\n isObjectEqual(a.query, b.query) &&\n isObjectEqual(a.params, b.params))\n )\n )\n } else {\n return false\n }\n}\n\nfunction isObjectEqual (a, b) {\n if ( a === void 0 ) a = {};\n if ( b === void 0 ) b = {};\n\n // handle null value #1566\n if (!a || !b) { return a === b }\n var aKeys = Object.keys(a).sort();\n var bKeys = Object.keys(b).sort();\n if (aKeys.length !== bKeys.length) {\n return false\n }\n return aKeys.every(function (key, i) {\n var aVal = a[key];\n var bKey = bKeys[i];\n if (bKey !== key) { return false }\n var bVal = b[key];\n // query values can be null and undefined\n if (aVal == null || bVal == null) { return aVal === bVal }\n // check nested equality\n if (typeof aVal === 'object' && typeof bVal === 'object') {\n return isObjectEqual(aVal, bVal)\n }\n return String(aVal) === String(bVal)\n })\n}\n\nfunction isIncludedRoute (current, target) {\n return (\n current.path.replace(trailingSlashRE, '/').indexOf(\n target.path.replace(trailingSlashRE, '/')\n ) === 0 &&\n (!target.hash || current.hash === target.hash) &&\n queryIncludes(current.query, target.query)\n )\n}\n\nfunction queryIncludes (current, target) {\n for (var key in target) {\n if (!(key in current)) {\n return false\n }\n }\n return true\n}\n\nfunction handleRouteEntered (route) {\n for (var i = 0; i < route.matched.length; i++) {\n var record = route.matched[i];\n for (var name in record.instances) {\n var instance = record.instances[name];\n var cbs = record.enteredCbs[name];\n if (!instance || !cbs) { continue }\n delete record.enteredCbs[name];\n for (var i$1 = 0; i$1 < cbs.length; i$1++) {\n if (!instance._isBeingDestroyed) { cbs[i$1](instance); }\n }\n }\n }\n}\n\nvar View = {\n name: 'RouterView',\n functional: true,\n props: {\n name: {\n type: String,\n default: 'default'\n }\n },\n render: function render (_, ref) {\n var props = ref.props;\n var children = ref.children;\n var parent = ref.parent;\n var data = ref.data;\n\n // used by devtools to display a router-view badge\n data.routerView = true;\n\n // directly use parent context's createElement() function\n // so that components rendered by router-view can resolve named slots\n var h = parent.$createElement;\n var name = props.name;\n var route = parent.$route;\n var cache = parent._routerViewCache || (parent._routerViewCache = {});\n\n // determine current view depth, also check to see if the tree\n // has been toggled inactive but kept-alive.\n var depth = 0;\n var inactive = false;\n while (parent && parent._routerRoot !== parent) {\n var vnodeData = parent.$vnode ? parent.$vnode.data : {};\n if (vnodeData.routerView) {\n depth++;\n }\n if (vnodeData.keepAlive && parent._directInactive && parent._inactive) {\n inactive = true;\n }\n parent = parent.$parent;\n }\n data.routerViewDepth = depth;\n\n // render previous view if the tree is inactive and kept-alive\n if (inactive) {\n var cachedData = cache[name];\n var cachedComponent = cachedData && cachedData.component;\n if (cachedComponent) {\n // #2301\n // pass props\n if (cachedData.configProps) {\n fillPropsinData(cachedComponent, data, cachedData.route, cachedData.configProps);\n }\n return h(cachedComponent, data, children)\n } else {\n // render previous empty view\n return h()\n }\n }\n\n var matched = route.matched[depth];\n var component = matched && matched.components[name];\n\n // render empty node if no matched route or no config component\n if (!matched || !component) {\n cache[name] = null;\n return h()\n }\n\n // cache component\n cache[name] = { component: component };\n\n // attach instance registration hook\n // this will be called in the instance's injected lifecycle hooks\n data.registerRouteInstance = function (vm, val) {\n // val could be undefined for unregistration\n var current = matched.instances[name];\n if (\n (val && current !== vm) ||\n (!val && current === vm)\n ) {\n matched.instances[name] = val;\n }\n }\n\n // also register instance in prepatch hook\n // in case the same component instance is reused across different routes\n ;(data.hook || (data.hook = {})).prepatch = function (_, vnode) {\n matched.instances[name] = vnode.componentInstance;\n };\n\n // register instance in init hook\n // in case kept-alive component be actived when routes changed\n data.hook.init = function (vnode) {\n if (vnode.data.keepAlive &&\n vnode.componentInstance &&\n vnode.componentInstance !== matched.instances[name]\n ) {\n matched.instances[name] = vnode.componentInstance;\n }\n\n // if the route transition has already been confirmed then we weren't\n // able to call the cbs during confirmation as the component was not\n // registered yet, so we call it here.\n handleRouteEntered(route);\n };\n\n var configProps = matched.props && matched.props[name];\n // save route and configProps in cache\n if (configProps) {\n extend(cache[name], {\n route: route,\n configProps: configProps\n });\n fillPropsinData(component, data, route, configProps);\n }\n\n return h(component, data, children)\n }\n};\n\nfunction fillPropsinData (component, data, route, configProps) {\n // resolve props\n var propsToPass = data.props = resolveProps(route, configProps);\n if (propsToPass) {\n // clone to prevent mutation\n propsToPass = data.props = extend({}, propsToPass);\n // pass non-declared props as attrs\n var attrs = data.attrs = data.attrs || {};\n for (var key in propsToPass) {\n if (!component.props || !(key in component.props)) {\n attrs[key] = propsToPass[key];\n delete propsToPass[key];\n }\n }\n }\n}\n\nfunction resolveProps (route, config) {\n switch (typeof config) {\n case 'undefined':\n return\n case 'object':\n return config\n case 'function':\n return config(route)\n case 'boolean':\n return config ? route.params : undefined\n default:\n if (process.env.NODE_ENV !== 'production') {\n warn(\n false,\n \"props in \\\"\" + (route.path) + \"\\\" is a \" + (typeof config) + \", \" +\n \"expecting an object, function or boolean.\"\n );\n }\n }\n}\n\n/* */\n\nfunction resolvePath (\n relative,\n base,\n append\n) {\n var firstChar = relative.charAt(0);\n if (firstChar === '/') {\n return relative\n }\n\n if (firstChar === '?' || firstChar === '#') {\n return base + relative\n }\n\n var stack = base.split('/');\n\n // remove trailing segment if:\n // - not appending\n // - appending to trailing slash (last segment is empty)\n if (!append || !stack[stack.length - 1]) {\n stack.pop();\n }\n\n // resolve relative path\n var segments = relative.replace(/^\\//, '').split('/');\n for (var i = 0; i < segments.length; i++) {\n var segment = segments[i];\n if (segment === '..') {\n stack.pop();\n } else if (segment !== '.') {\n stack.push(segment);\n }\n }\n\n // ensure leading slash\n if (stack[0] !== '') {\n stack.unshift('');\n }\n\n return stack.join('/')\n}\n\nfunction parsePath (path) {\n var hash = '';\n var query = '';\n\n var hashIndex = path.indexOf('#');\n if (hashIndex >= 0) {\n hash = path.slice(hashIndex);\n path = path.slice(0, hashIndex);\n }\n\n var queryIndex = path.indexOf('?');\n if (queryIndex >= 0) {\n query = path.slice(queryIndex + 1);\n path = path.slice(0, queryIndex);\n }\n\n return {\n path: path,\n query: query,\n hash: hash\n }\n}\n\nfunction cleanPath (path) {\n return path.replace(/\\/(?:\\s*\\/)+/g, '/')\n}\n\nvar isarray = Array.isArray || function (arr) {\n return Object.prototype.toString.call(arr) == '[object Array]';\n};\n\n/**\n * Expose `pathToRegexp`.\n */\nvar pathToRegexp_1 = pathToRegexp;\nvar parse_1 = parse;\nvar compile_1 = compile;\nvar tokensToFunction_1 = tokensToFunction;\nvar tokensToRegExp_1 = tokensToRegExp;\n\n/**\n * The main path matching regexp utility.\n *\n * @type {RegExp}\n */\nvar PATH_REGEXP = new RegExp([\n // Match escaped characters that would otherwise appear in future matches.\n // This allows the user to escape special characters that won't transform.\n '(\\\\\\\\.)',\n // Match Express-style parameters and un-named parameters with a prefix\n // and optional suffixes. Matches appear as:\n //\n // \"/:test(\\\\d+)?\" => [\"/\", \"test\", \"\\d+\", undefined, \"?\", undefined]\n // \"/route(\\\\d+)\" => [undefined, undefined, undefined, \"\\d+\", undefined, undefined]\n // \"/*\" => [\"/\", undefined, undefined, undefined, undefined, \"*\"]\n '([\\\\/.])?(?:(?:\\\\:(\\\\w+)(?:\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))?|\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))([+*?])?|(\\\\*))'\n].join('|'), 'g');\n\n/**\n * Parse a string for the raw tokens.\n *\n * @param {string} str\n * @param {Object=} options\n * @return {!Array}\n */\nfunction parse (str, options) {\n var tokens = [];\n var key = 0;\n var index = 0;\n var path = '';\n var defaultDelimiter = options && options.delimiter || '/';\n var res;\n\n while ((res = PATH_REGEXP.exec(str)) != null) {\n var m = res[0];\n var escaped = res[1];\n var offset = res.index;\n path += str.slice(index, offset);\n index = offset + m.length;\n\n // Ignore already escaped sequences.\n if (escaped) {\n path += escaped[1];\n continue\n }\n\n var next = str[index];\n var prefix = res[2];\n var name = res[3];\n var capture = res[4];\n var group = res[5];\n var modifier = res[6];\n var asterisk = res[7];\n\n // Push the current path onto the tokens.\n if (path) {\n tokens.push(path);\n path = '';\n }\n\n var partial = prefix != null && next != null && next !== prefix;\n var repeat = modifier === '+' || modifier === '*';\n var optional = modifier === '?' || modifier === '*';\n var delimiter = res[2] || defaultDelimiter;\n var pattern = capture || group;\n\n tokens.push({\n name: name || key++,\n prefix: prefix || '',\n delimiter: delimiter,\n optional: optional,\n repeat: repeat,\n partial: partial,\n asterisk: !!asterisk,\n pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')\n });\n }\n\n // Match any characters still remaining.\n if (index < str.length) {\n path += str.substr(index);\n }\n\n // If the path exists, push it onto the end.\n if (path) {\n tokens.push(path);\n }\n\n return tokens\n}\n\n/**\n * Compile a string to a template function for the path.\n *\n * @param {string} str\n * @param {Object=} options\n * @return {!function(Object=, Object=)}\n */\nfunction compile (str, options) {\n return tokensToFunction(parse(str, options), options)\n}\n\n/**\n * Prettier encoding of URI path segments.\n *\n * @param {string}\n * @return {string}\n */\nfunction encodeURIComponentPretty (str) {\n return encodeURI(str).replace(/[\\/?#]/g, function (c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n })\n}\n\n/**\n * Encode the asterisk parameter. Similar to `pretty`, but allows slashes.\n *\n * @param {string}\n * @return {string}\n */\nfunction encodeAsterisk (str) {\n return encodeURI(str).replace(/[?#]/g, function (c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n })\n}\n\n/**\n * Expose a method for transforming tokens into the path function.\n */\nfunction tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length);\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options));\n }\n }\n\n return function (obj, opts) {\n var path = '';\n var data = obj || {};\n var options = opts || {};\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent;\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (typeof token === 'string') {\n path += token;\n\n continue\n }\n\n var value = data[token.name];\n var segment;\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix;\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j]);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment;\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment;\n }\n\n return path\n }\n}\n\n/**\n * Escape a regular expression string.\n *\n * @param {string} str\n * @return {string}\n */\nfunction escapeString (str) {\n return str.replace(/([.+*?=^!:${}()[\\]|\\/\\\\])/g, '\\\\$1')\n}\n\n/**\n * Escape the capturing group by escaping special characters and meaning.\n *\n * @param {string} group\n * @return {string}\n */\nfunction escapeGroup (group) {\n return group.replace(/([=!:$\\/()])/g, '\\\\$1')\n}\n\n/**\n * Attach the keys as a property of the regexp.\n *\n * @param {!RegExp} re\n * @param {Array} keys\n * @return {!RegExp}\n */\nfunction attachKeys (re, keys) {\n re.keys = keys;\n return re\n}\n\n/**\n * Get the flags for a regexp from the options.\n *\n * @param {Object} options\n * @return {string}\n */\nfunction flags (options) {\n return options && options.sensitive ? '' : 'i'\n}\n\n/**\n * Pull out keys from a regexp.\n *\n * @param {!RegExp} path\n * @param {!Array} keys\n * @return {!RegExp}\n */\nfunction regexpToRegexp (path, keys) {\n // Use a negative lookahead to match only capturing groups.\n var groups = path.source.match(/\\((?!\\?)/g);\n\n if (groups) {\n for (var i = 0; i < groups.length; i++) {\n keys.push({\n name: i,\n prefix: null,\n delimiter: null,\n optional: false,\n repeat: false,\n partial: false,\n asterisk: false,\n pattern: null\n });\n }\n }\n\n return attachKeys(path, keys)\n}\n\n/**\n * Transform an array into a regexp.\n *\n * @param {!Array} path\n * @param {Array} keys\n * @param {!Object} options\n * @return {!RegExp}\n */\nfunction arrayToRegexp (path, keys, options) {\n var parts = [];\n\n for (var i = 0; i < path.length; i++) {\n parts.push(pathToRegexp(path[i], keys, options).source);\n }\n\n var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options));\n\n return attachKeys(regexp, keys)\n}\n\n/**\n * Create a path regexp from string input.\n *\n * @param {string} path\n * @param {!Array} keys\n * @param {!Object} options\n * @return {!RegExp}\n */\nfunction stringToRegexp (path, keys, options) {\n return tokensToRegExp(parse(path, options), keys, options)\n}\n\n/**\n * Expose a function for taking tokens and returning a RegExp.\n *\n * @param {!Array} tokens\n * @param {(Array|Object)=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\nfunction tokensToRegExp (tokens, keys, options) {\n if (!isarray(keys)) {\n options = /** @type {!Object} */ (keys || options);\n keys = [];\n }\n\n options = options || {};\n\n var strict = options.strict;\n var end = options.end !== false;\n var route = '';\n\n // Iterate over the tokens and create our regexp string.\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (typeof token === 'string') {\n route += escapeString(token);\n } else {\n var prefix = escapeString(token.prefix);\n var capture = '(?:' + token.pattern + ')';\n\n keys.push(token);\n\n if (token.repeat) {\n capture += '(?:' + prefix + capture + ')*';\n }\n\n if (token.optional) {\n if (!token.partial) {\n capture = '(?:' + prefix + '(' + capture + '))?';\n } else {\n capture = prefix + '(' + capture + ')?';\n }\n } else {\n capture = prefix + '(' + capture + ')';\n }\n\n route += capture;\n }\n }\n\n var delimiter = escapeString(options.delimiter || '/');\n var endsWithDelimiter = route.slice(-delimiter.length) === delimiter;\n\n // In non-strict mode we allow a slash at the end of match. If the path to\n // match already ends with a slash, we remove it for consistency. The slash\n // is valid at the end of a path match, not in the middle. This is important\n // in non-ending mode, where \"/test/\" shouldn't match \"/test//route\".\n if (!strict) {\n route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?';\n }\n\n if (end) {\n route += '$';\n } else {\n // In non-ending mode, we need the capturing groups to match as much as\n // possible by using a positive lookahead to the end or next path segment.\n route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)';\n }\n\n return attachKeys(new RegExp('^' + route, flags(options)), keys)\n}\n\n/**\n * Normalize the given path string, returning a regular expression.\n *\n * An empty array can be passed in for the keys, which will hold the\n * placeholder key descriptions. For example, using `/user/:id`, `keys` will\n * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.\n *\n * @param {(string|RegExp|Array)} path\n * @param {(Array|Object)=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\nfunction pathToRegexp (path, keys, options) {\n if (!isarray(keys)) {\n options = /** @type {!Object} */ (keys || options);\n keys = [];\n }\n\n options = options || {};\n\n if (path instanceof RegExp) {\n return regexpToRegexp(path, /** @type {!Array} */ (keys))\n }\n\n if (isarray(path)) {\n return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)\n }\n\n return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)\n}\npathToRegexp_1.parse = parse_1;\npathToRegexp_1.compile = compile_1;\npathToRegexp_1.tokensToFunction = tokensToFunction_1;\npathToRegexp_1.tokensToRegExp = tokensToRegExp_1;\n\n/* */\n\n// $flow-disable-line\nvar regexpCompileCache = Object.create(null);\n\nfunction fillParams (\n path,\n params,\n routeMsg\n) {\n params = params || {};\n try {\n var filler =\n regexpCompileCache[path] ||\n (regexpCompileCache[path] = pathToRegexp_1.compile(path));\n\n // Fix #2505 resolving asterisk routes { name: 'not-found', params: { pathMatch: '/not-found' }}\n // and fix #3106 so that you can work with location descriptor object having params.pathMatch equal to empty string\n if (typeof params.pathMatch === 'string') { params[0] = params.pathMatch; }\n\n return filler(params, { pretty: true })\n } catch (e) {\n if (process.env.NODE_ENV !== 'production') {\n // Fix #3072 no warn if `pathMatch` is string\n warn(typeof params.pathMatch === 'string', (\"missing param for \" + routeMsg + \": \" + (e.message)));\n }\n return ''\n } finally {\n // delete the 0 if it was added\n delete params[0];\n }\n}\n\n/* */\n\nfunction normalizeLocation (\n raw,\n current,\n append,\n router\n) {\n var next = typeof raw === 'string' ? { path: raw } : raw;\n // named target\n if (next._normalized) {\n return next\n } else if (next.name) {\n next = extend({}, raw);\n var params = next.params;\n if (params && typeof params === 'object') {\n next.params = extend({}, params);\n }\n return next\n }\n\n // relative params\n if (!next.path && next.params && current) {\n next = extend({}, next);\n next._normalized = true;\n var params$1 = extend(extend({}, current.params), next.params);\n if (current.name) {\n next.name = current.name;\n next.params = params$1;\n } else if (current.matched.length) {\n var rawPath = current.matched[current.matched.length - 1].path;\n next.path = fillParams(rawPath, params$1, (\"path \" + (current.path)));\n } else if (process.env.NODE_ENV !== 'production') {\n warn(false, \"relative params navigation requires a current route.\");\n }\n return next\n }\n\n var parsedPath = parsePath(next.path || '');\n var basePath = (current && current.path) || '/';\n var path = parsedPath.path\n ? resolvePath(parsedPath.path, basePath, append || next.append)\n : basePath;\n\n var query = resolveQuery(\n parsedPath.query,\n next.query,\n router && router.options.parseQuery\n );\n\n var hash = next.hash || parsedPath.hash;\n if (hash && hash.charAt(0) !== '#') {\n hash = \"#\" + hash;\n }\n\n return {\n _normalized: true,\n path: path,\n query: query,\n hash: hash\n }\n}\n\n/* */\n\n// work around weird flow bug\nvar toTypes = [String, Object];\nvar eventTypes = [String, Array];\n\nvar noop = function () {};\n\nvar warnedCustomSlot;\nvar warnedTagProp;\nvar warnedEventProp;\n\nvar Link = {\n name: 'RouterLink',\n props: {\n to: {\n type: toTypes,\n required: true\n },\n tag: {\n type: String,\n default: 'a'\n },\n custom: Boolean,\n exact: Boolean,\n exactPath: Boolean,\n append: Boolean,\n replace: Boolean,\n activeClass: String,\n exactActiveClass: String,\n ariaCurrentValue: {\n type: String,\n default: 'page'\n },\n event: {\n type: eventTypes,\n default: 'click'\n }\n },\n render: function render (h) {\n var this$1$1 = this;\n\n var router = this.$router;\n var current = this.$route;\n var ref = router.resolve(\n this.to,\n current,\n this.append\n );\n var location = ref.location;\n var route = ref.route;\n var href = ref.href;\n\n var classes = {};\n var globalActiveClass = router.options.linkActiveClass;\n var globalExactActiveClass = router.options.linkExactActiveClass;\n // Support global empty active class\n var activeClassFallback =\n globalActiveClass == null ? 'router-link-active' : globalActiveClass;\n var exactActiveClassFallback =\n globalExactActiveClass == null\n ? 'router-link-exact-active'\n : globalExactActiveClass;\n var activeClass =\n this.activeClass == null ? activeClassFallback : this.activeClass;\n var exactActiveClass =\n this.exactActiveClass == null\n ? exactActiveClassFallback\n : this.exactActiveClass;\n\n var compareTarget = route.redirectedFrom\n ? createRoute(null, normalizeLocation(route.redirectedFrom), null, router)\n : route;\n\n classes[exactActiveClass] = isSameRoute(current, compareTarget, this.exactPath);\n classes[activeClass] = this.exact || this.exactPath\n ? classes[exactActiveClass]\n : isIncludedRoute(current, compareTarget);\n\n var ariaCurrentValue = classes[exactActiveClass] ? this.ariaCurrentValue : null;\n\n var handler = function (e) {\n if (guardEvent(e)) {\n if (this$1$1.replace) {\n router.replace(location, noop);\n } else {\n router.push(location, noop);\n }\n }\n };\n\n var on = { click: guardEvent };\n if (Array.isArray(this.event)) {\n this.event.forEach(function (e) {\n on[e] = handler;\n });\n } else {\n on[this.event] = handler;\n }\n\n var data = { class: classes };\n\n var scopedSlot =\n !this.$scopedSlots.$hasNormal &&\n this.$scopedSlots.default &&\n this.$scopedSlots.default({\n href: href,\n route: route,\n navigate: handler,\n isActive: classes[activeClass],\n isExactActive: classes[exactActiveClass]\n });\n\n if (scopedSlot) {\n if (process.env.NODE_ENV !== 'production' && !this.custom) {\n !warnedCustomSlot && warn(false, 'In Vue Router 4, the v-slot API will by default wrap its content with an <a> element. Use the custom prop to remove this warning:\\n<router-link v-slot=\"{ navigate, href }\" custom></router-link>\\n');\n warnedCustomSlot = true;\n }\n if (scopedSlot.length === 1) {\n return scopedSlot[0]\n } else if (scopedSlot.length > 1 || !scopedSlot.length) {\n if (process.env.NODE_ENV !== 'production') {\n warn(\n false,\n (\"<router-link> with to=\\\"\" + (this.to) + \"\\\" is trying to use a scoped slot but it didn't provide exactly one child. Wrapping the content with a span element.\")\n );\n }\n return scopedSlot.length === 0 ? h() : h('span', {}, scopedSlot)\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if ('tag' in this.$options.propsData && !warnedTagProp) {\n warn(\n false,\n \"<router-link>'s tag prop is deprecated and has been removed in Vue Router 4. Use the v-slot API to remove this warning: https://next.router.vuejs.org/guide/migration/#removal-of-event-and-tag-props-in-router-link.\"\n );\n warnedTagProp = true;\n }\n if ('event' in this.$options.propsData && !warnedEventProp) {\n warn(\n false,\n \"<router-link>'s event prop is deprecated and has been removed in Vue Router 4. Use the v-slot API to remove this warning: https://next.router.vuejs.org/guide/migration/#removal-of-event-and-tag-props-in-router-link.\"\n );\n warnedEventProp = true;\n }\n }\n\n if (this.tag === 'a') {\n data.on = on;\n data.attrs = { href: href, 'aria-current': ariaCurrentValue };\n } else {\n // find the first <a> child and apply listener and href\n var a = findAnchor(this.$slots.default);\n if (a) {\n // in case the <a> is a static node\n a.isStatic = false;\n var aData = (a.data = extend({}, a.data));\n aData.on = aData.on || {};\n // transform existing events in both objects into arrays so we can push later\n for (var event in aData.on) {\n var handler$1 = aData.on[event];\n if (event in on) {\n aData.on[event] = Array.isArray(handler$1) ? handler$1 : [handler$1];\n }\n }\n // append new listeners for router-link\n for (var event$1 in on) {\n if (event$1 in aData.on) {\n // on[event] is always a function\n aData.on[event$1].push(on[event$1]);\n } else {\n aData.on[event$1] = handler;\n }\n }\n\n var aAttrs = (a.data.attrs = extend({}, a.data.attrs));\n aAttrs.href = href;\n aAttrs['aria-current'] = ariaCurrentValue;\n } else {\n // doesn't have <a> child, apply listener to self\n data.on = on;\n }\n }\n\n return h(this.tag, data, this.$slots.default)\n }\n};\n\nfunction guardEvent (e) {\n // don't redirect with control keys\n if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) { return }\n // don't redirect when preventDefault called\n if (e.defaultPrevented) { return }\n // don't redirect on right click\n if (e.button !== undefined && e.button !== 0) { return }\n // don't redirect if `target=\"_blank\"`\n if (e.currentTarget && e.currentTarget.getAttribute) {\n var target = e.currentTarget.getAttribute('target');\n if (/\\b_blank\\b/i.test(target)) { return }\n }\n // this may be a Weex event which doesn't have this method\n if (e.preventDefault) {\n e.preventDefault();\n }\n return true\n}\n\nfunction findAnchor (children) {\n if (children) {\n var child;\n for (var i = 0; i < children.length; i++) {\n child = children[i];\n if (child.tag === 'a') {\n return child\n }\n if (child.children && (child = findAnchor(child.children))) {\n return child\n }\n }\n }\n}\n\nvar _Vue;\n\nfunction install (Vue) {\n if (install.installed && _Vue === Vue) { return }\n install.installed = true;\n\n _Vue = Vue;\n\n var isDef = function (v) { return v !== undefined; };\n\n var registerInstance = function (vm, callVal) {\n var i = vm.$options._parentVnode;\n if (isDef(i) && isDef(i = i.data) && isDef(i = i.registerRouteInstance)) {\n i(vm, callVal);\n }\n };\n\n Vue.mixin({\n beforeCreate: function beforeCreate () {\n if (isDef(this.$options.router)) {\n this._routerRoot = this;\n this._router = this.$options.router;\n this._router.init(this);\n Vue.util.defineReactive(this, '_route', this._router.history.current);\n } else {\n this._routerRoot = (this.$parent && this.$parent._routerRoot) || this;\n }\n registerInstance(this, this);\n },\n destroyed: function destroyed () {\n registerInstance(this);\n }\n });\n\n Object.defineProperty(Vue.prototype, '$router', {\n get: function get () { return this._routerRoot._router }\n });\n\n Object.defineProperty(Vue.prototype, '$route', {\n get: function get () { return this._routerRoot._route }\n });\n\n Vue.component('RouterView', View);\n Vue.component('RouterLink', Link);\n\n var strats = Vue.config.optionMergeStrategies;\n // use the same hook merging strategy for route hooks\n strats.beforeRouteEnter = strats.beforeRouteLeave = strats.beforeRouteUpdate = strats.created;\n}\n\n/* */\n\nvar inBrowser = typeof window !== 'undefined';\n\n/* */\n\nfunction createRouteMap (\n routes,\n oldPathList,\n oldPathMap,\n oldNameMap,\n parentRoute\n) {\n // the path list is used to control path matching priority\n var pathList = oldPathList || [];\n // $flow-disable-line\n var pathMap = oldPathMap || Object.create(null);\n // $flow-disable-line\n var nameMap = oldNameMap || Object.create(null);\n\n routes.forEach(function (route) {\n addRouteRecord(pathList, pathMap, nameMap, route, parentRoute);\n });\n\n // ensure wildcard routes are always at the end\n for (var i = 0, l = pathList.length; i < l; i++) {\n if (pathList[i] === '*') {\n pathList.push(pathList.splice(i, 1)[0]);\n l--;\n i--;\n }\n }\n\n if (process.env.NODE_ENV === 'development') {\n // warn if routes do not include leading slashes\n var found = pathList\n // check for missing leading slash\n .filter(function (path) { return path && path.charAt(0) !== '*' && path.charAt(0) !== '/'; });\n\n if (found.length > 0) {\n var pathNames = found.map(function (path) { return (\"- \" + path); }).join('\\n');\n warn(false, (\"Non-nested routes must include a leading slash character. Fix the following routes: \\n\" + pathNames));\n }\n }\n\n return {\n pathList: pathList,\n pathMap: pathMap,\n nameMap: nameMap\n }\n}\n\nfunction addRouteRecord (\n pathList,\n pathMap,\n nameMap,\n route,\n parent,\n matchAs\n) {\n var path = route.path;\n var name = route.name;\n if (process.env.NODE_ENV !== 'production') {\n assert(path != null, \"\\\"path\\\" is required in a route configuration.\");\n assert(\n typeof route.component !== 'string',\n \"route config \\\"component\\\" for path: \" + (String(\n path || name\n )) + \" cannot be a \" + \"string id. Use an actual component instead.\"\n );\n\n warn(\n // eslint-disable-next-line no-control-regex\n !/[^\\u0000-\\u007F]+/.test(path),\n \"Route with path \\\"\" + path + \"\\\" contains unencoded characters, make sure \" +\n \"your path is correctly encoded before passing it to the router. Use \" +\n \"encodeURI to encode static segments of your path.\"\n );\n }\n\n var pathToRegexpOptions =\n route.pathToRegexpOptions || {};\n var normalizedPath = normalizePath(path, parent, pathToRegexpOptions.strict);\n\n if (typeof route.caseSensitive === 'boolean') {\n pathToRegexpOptions.sensitive = route.caseSensitive;\n }\n\n var record = {\n path: normalizedPath,\n regex: compileRouteRegex(normalizedPath, pathToRegexpOptions),\n components: route.components || { default: route.component },\n alias: route.alias\n ? typeof route.alias === 'string'\n ? [route.alias]\n : route.alias\n : [],\n instances: {},\n enteredCbs: {},\n name: name,\n parent: parent,\n matchAs: matchAs,\n redirect: route.redirect,\n beforeEnter: route.beforeEnter,\n meta: route.meta || {},\n props:\n route.props == null\n ? {}\n : route.components\n ? route.props\n : { default: route.props }\n };\n\n if (route.children) {\n // Warn if route is named, does not redirect and has a default child route.\n // If users navigate to this route by name, the default child will\n // not be rendered (GH Issue #629)\n if (process.env.NODE_ENV !== 'production') {\n if (\n route.name &&\n !route.redirect &&\n route.children.some(function (child) { return /^\\/?$/.test(child.path); })\n ) {\n warn(\n false,\n \"Named Route '\" + (route.name) + \"' has a default child route. \" +\n \"When navigating to this named route (:to=\\\"{name: '\" + (route.name) + \"'}\\\"), \" +\n \"the default child route will not be rendered. Remove the name from \" +\n \"this route and use the name of the default child route for named \" +\n \"links instead.\"\n );\n }\n }\n route.children.forEach(function (child) {\n var childMatchAs = matchAs\n ? cleanPath((matchAs + \"/\" + (child.path)))\n : undefined;\n addRouteRecord(pathList, pathMap, nameMap, child, record, childMatchAs);\n });\n }\n\n if (!pathMap[record.path]) {\n pathList.push(record.path);\n pathMap[record.path] = record;\n }\n\n if (route.alias !== undefined) {\n var aliases = Array.isArray(route.alias) ? route.alias : [route.alias];\n for (var i = 0; i < aliases.length; ++i) {\n var alias = aliases[i];\n if (process.env.NODE_ENV !== 'production' && alias === path) {\n warn(\n false,\n (\"Found an alias with the same value as the path: \\\"\" + path + \"\\\". You have to remove that alias. It will be ignored in development.\")\n );\n // skip in dev to make it work\n continue\n }\n\n var aliasRoute = {\n path: alias,\n children: route.children\n };\n addRouteRecord(\n pathList,\n pathMap,\n nameMap,\n aliasRoute,\n parent,\n record.path || '/' // matchAs\n );\n }\n }\n\n if (name) {\n if (!nameMap[name]) {\n nameMap[name] = record;\n } else if (process.env.NODE_ENV !== 'production' && !matchAs) {\n warn(\n false,\n \"Duplicate named routes definition: \" +\n \"{ name: \\\"\" + name + \"\\\", path: \\\"\" + (record.path) + \"\\\" }\"\n );\n }\n }\n}\n\nfunction compileRouteRegex (\n path,\n pathToRegexpOptions\n) {\n var regex = pathToRegexp_1(path, [], pathToRegexpOptions);\n if (process.env.NODE_ENV !== 'production') {\n var keys = Object.create(null);\n regex.keys.forEach(function (key) {\n warn(\n !keys[key.name],\n (\"Duplicate param keys in route with path: \\\"\" + path + \"\\\"\")\n );\n keys[key.name] = true;\n });\n }\n return regex\n}\n\nfunction normalizePath (\n path,\n parent,\n strict\n) {\n if (!strict) { path = path.replace(/\\/$/, ''); }\n if (path[0] === '/') { return path }\n if (parent == null) { return path }\n return cleanPath(((parent.path) + \"/\" + path))\n}\n\n/* */\n\n\n\nfunction createMatcher (\n routes,\n router\n) {\n var ref = createRouteMap(routes);\n var pathList = ref.pathList;\n var pathMap = ref.pathMap;\n var nameMap = ref.nameMap;\n\n function addRoutes (routes) {\n createRouteMap(routes, pathList, pathMap, nameMap);\n }\n\n function addRoute (parentOrRoute, route) {\n var parent = (typeof parentOrRoute !== 'object') ? nameMap[parentOrRoute] : undefined;\n // $flow-disable-line\n createRouteMap([route || parentOrRoute], pathList, pathMap, nameMap, parent);\n\n // add aliases of parent\n if (parent && parent.alias.length) {\n createRouteMap(\n // $flow-disable-line route is defined if parent is\n parent.alias.map(function (alias) { return ({ path: alias, children: [route] }); }),\n pathList,\n pathMap,\n nameMap,\n parent\n );\n }\n }\n\n function getRoutes () {\n return pathList.map(function (path) { return pathMap[path]; })\n }\n\n function match (\n raw,\n currentRoute,\n redirectedFrom\n ) {\n var location = normalizeLocation(raw, currentRoute, false, router);\n var name = location.name;\n\n if (name) {\n var record = nameMap[name];\n if (process.env.NODE_ENV !== 'production') {\n warn(record, (\"Route with name '\" + name + \"' does not exist\"));\n }\n if (!record) { return _createRoute(null, location) }\n var paramNames = record.regex.keys\n .filter(function (key) { return !key.optional; })\n .map(function (key) { return key.name; });\n\n if (typeof location.params !== 'object') {\n location.params = {};\n }\n\n if (currentRoute && typeof currentRoute.params === 'object') {\n for (var key in currentRoute.params) {\n if (!(key in location.params) && paramNames.indexOf(key) > -1) {\n location.params[key] = currentRoute.params[key];\n }\n }\n }\n\n location.path = fillParams(record.path, location.params, (\"named route \\\"\" + name + \"\\\"\"));\n return _createRoute(record, location, redirectedFrom)\n } else if (location.path) {\n location.params = {};\n for (var i = 0; i < pathList.length; i++) {\n var path = pathList[i];\n var record$1 = pathMap[path];\n if (matchRoute(record$1.regex, location.path, location.params)) {\n return _createRoute(record$1, location, redirectedFrom)\n }\n }\n }\n // no match\n return _createRoute(null, location)\n }\n\n function redirect (\n record,\n location\n ) {\n var originalRedirect = record.redirect;\n var redirect = typeof originalRedirect === 'function'\n ? originalRedirect(createRoute(record, location, null, router))\n : originalRedirect;\n\n if (typeof redirect === 'string') {\n redirect = { path: redirect };\n }\n\n if (!redirect || typeof redirect !== 'object') {\n if (process.env.NODE_ENV !== 'production') {\n warn(\n false, (\"invalid redirect option: \" + (JSON.stringify(redirect)))\n );\n }\n return _createRoute(null, location)\n }\n\n var re = redirect;\n var name = re.name;\n var path = re.path;\n var query = location.query;\n var hash = location.hash;\n var params = location.params;\n query = re.hasOwnProperty('query') ? re.query : query;\n hash = re.hasOwnProperty('hash') ? re.hash : hash;\n params = re.hasOwnProperty('params') ? re.params : params;\n\n if (name) {\n // resolved named direct\n var targetRecord = nameMap[name];\n if (process.env.NODE_ENV !== 'production') {\n assert(targetRecord, (\"redirect failed: named route \\\"\" + name + \"\\\" not found.\"));\n }\n return match({\n _normalized: true,\n name: name,\n query: query,\n hash: hash,\n params: params\n }, undefined, location)\n } else if (path) {\n // 1. resolve relative redirect\n var rawPath = resolveRecordPath(path, record);\n // 2. resolve params\n var resolvedPath = fillParams(rawPath, params, (\"redirect route with path \\\"\" + rawPath + \"\\\"\"));\n // 3. rematch with existing query and hash\n return match({\n _normalized: true,\n path: resolvedPath,\n query: query,\n hash: hash\n }, undefined, location)\n } else {\n if (process.env.NODE_ENV !== 'production') {\n warn(false, (\"invalid redirect option: \" + (JSON.stringify(redirect))));\n }\n return _createRoute(null, location)\n }\n }\n\n function alias (\n record,\n location,\n matchAs\n ) {\n var aliasedPath = fillParams(matchAs, location.params, (\"aliased route with path \\\"\" + matchAs + \"\\\"\"));\n var aliasedMatch = match({\n _normalized: true,\n path: aliasedPath\n });\n if (aliasedMatch) {\n var matched = aliasedMatch.matched;\n var aliasedRecord = matched[matched.length - 1];\n location.params = aliasedMatch.params;\n return _createRoute(aliasedRecord, location)\n }\n return _createRoute(null, location)\n }\n\n function _createRoute (\n record,\n location,\n redirectedFrom\n ) {\n if (record && record.redirect) {\n return redirect(record, redirectedFrom || location)\n }\n if (record && record.matchAs) {\n return alias(record, location, record.matchAs)\n }\n return createRoute(record, location, redirectedFrom, router)\n }\n\n return {\n match: match,\n addRoute: addRoute,\n getRoutes: getRoutes,\n addRoutes: addRoutes\n }\n}\n\nfunction matchRoute (\n regex,\n path,\n params\n) {\n var m = path.match(regex);\n\n if (!m) {\n return false\n } else if (!params) {\n return true\n }\n\n for (var i = 1, len = m.length; i < len; ++i) {\n var key = regex.keys[i - 1];\n if (key) {\n // Fix #1994: using * with props: true generates a param named 0\n params[key.name || 'pathMatch'] = typeof m[i] === 'string' ? decode(m[i]) : m[i];\n }\n }\n\n return true\n}\n\nfunction resolveRecordPath (path, record) {\n return resolvePath(path, record.parent ? record.parent.path : '/', true)\n}\n\n/* */\n\n// use User Timing api (if present) for more accurate key precision\nvar Time =\n inBrowser && window.performance && window.performance.now\n ? window.performance\n : Date;\n\nfunction genStateKey () {\n return Time.now().toFixed(3)\n}\n\nvar _key = genStateKey();\n\nfunction getStateKey () {\n return _key\n}\n\nfunction setStateKey (key) {\n return (_key = key)\n}\n\n/* */\n\nvar positionStore = Object.create(null);\n\nfunction setupScroll () {\n // Prevent browser scroll behavior on History popstate\n if ('scrollRestoration' in window.history) {\n window.history.scrollRestoration = 'manual';\n }\n // Fix for #1585 for Firefox\n // Fix for #2195 Add optional third attribute to workaround a bug in safari https://bugs.webkit.org/show_bug.cgi?id=182678\n // Fix for #2774 Support for apps loaded from Windows file shares not mapped to network drives: replaced location.origin with\n // window.location.protocol + '//' + window.location.host\n // location.host contains the port and location.hostname doesn't\n var protocolAndPath = window.location.protocol + '//' + window.location.host;\n var absolutePath = window.location.href.replace(protocolAndPath, '');\n // preserve existing history state as it could be overriden by the user\n var stateCopy = extend({}, window.history.state);\n stateCopy.key = getStateKey();\n window.history.replaceState(stateCopy, '', absolutePath);\n window.addEventListener('popstate', handlePopState);\n return function () {\n window.removeEventListener('popstate', handlePopState);\n }\n}\n\nfunction handleScroll (\n router,\n to,\n from,\n isPop\n) {\n if (!router.app) {\n return\n }\n\n var behavior = router.options.scrollBehavior;\n if (!behavior) {\n return\n }\n\n if (process.env.NODE_ENV !== 'production') {\n assert(typeof behavior === 'function', \"scrollBehavior must be a function\");\n }\n\n // wait until re-render finishes before scrolling\n router.app.$nextTick(function () {\n var position = getScrollPosition();\n var shouldScroll = behavior.call(\n router,\n to,\n from,\n isPop ? position : null\n );\n\n if (!shouldScroll) {\n return\n }\n\n if (typeof shouldScroll.then === 'function') {\n shouldScroll\n .then(function (shouldScroll) {\n scrollToPosition((shouldScroll), position);\n })\n .catch(function (err) {\n if (process.env.NODE_ENV !== 'production') {\n assert(false, err.toString());\n }\n });\n } else {\n scrollToPosition(shouldScroll, position);\n }\n });\n}\n\nfunction saveScrollPosition () {\n var key = getStateKey();\n if (key) {\n positionStore[key] = {\n x: window.pageXOffset,\n y: window.pageYOffset\n };\n }\n}\n\nfunction handlePopState (e) {\n saveScrollPosition();\n if (e.state && e.state.key) {\n setStateKey(e.state.key);\n }\n}\n\nfunction getScrollPosition () {\n var key = getStateKey();\n if (key) {\n return positionStore[key]\n }\n}\n\nfunction getElementPosition (el, offset) {\n var docEl = document.documentElement;\n var docRect = docEl.getBoundingClientRect();\n var elRect = el.getBoundingClientRect();\n return {\n x: elRect.left - docRect.left - offset.x,\n y: elRect.top - docRect.top - offset.y\n }\n}\n\nfunction isValidPosition (obj) {\n return isNumber(obj.x) || isNumber(obj.y)\n}\n\nfunction normalizePosition (obj) {\n return {\n x: isNumber(obj.x) ? obj.x : window.pageXOffset,\n y: isNumber(obj.y) ? obj.y : window.pageYOffset\n }\n}\n\nfunction normalizeOffset (obj) {\n return {\n x: isNumber(obj.x) ? obj.x : 0,\n y: isNumber(obj.y) ? obj.y : 0\n }\n}\n\nfunction isNumber (v) {\n return typeof v === 'number'\n}\n\nvar hashStartsWithNumberRE = /^#\\d/;\n\nfunction scrollToPosition (shouldScroll, position) {\n var isObject = typeof shouldScroll === 'object';\n if (isObject && typeof shouldScroll.selector === 'string') {\n // getElementById would still fail if the selector contains a more complicated query like #main[data-attr]\n // but at the same time, it doesn't make much sense to select an element with an id and an extra selector\n var el = hashStartsWithNumberRE.test(shouldScroll.selector) // $flow-disable-line\n ? document.getElementById(shouldScroll.selector.slice(1)) // $flow-disable-line\n : document.querySelector(shouldScroll.selector);\n\n if (el) {\n var offset =\n shouldScroll.offset && typeof shouldScroll.offset === 'object'\n ? shouldScroll.offset\n : {};\n offset = normalizeOffset(offset);\n position = getElementPosition(el, offset);\n } else if (isValidPosition(shouldScroll)) {\n position = normalizePosition(shouldScroll);\n }\n } else if (isObject && isValidPosition(shouldScroll)) {\n position = normalizePosition(shouldScroll);\n }\n\n if (position) {\n // $flow-disable-line\n if ('scrollBehavior' in document.documentElement.style) {\n window.scrollTo({\n left: position.x,\n top: position.y,\n // $flow-disable-line\n behavior: shouldScroll.behavior\n });\n } else {\n window.scrollTo(position.x, position.y);\n }\n }\n}\n\n/* */\n\nvar supportsPushState =\n inBrowser &&\n (function () {\n var ua = window.navigator.userAgent;\n\n if (\n (ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) &&\n ua.indexOf('Mobile Safari') !== -1 &&\n ua.indexOf('Chrome') === -1 &&\n ua.indexOf('Windows Phone') === -1\n ) {\n return false\n }\n\n return window.history && typeof window.history.pushState === 'function'\n })();\n\nfunction pushState (url, replace) {\n saveScrollPosition();\n // try...catch the pushState call to get around Safari\n // DOM Exception 18 where it limits to 100 pushState calls\n var history = window.history;\n try {\n if (replace) {\n // preserve existing history state as it could be overriden by the user\n var stateCopy = extend({}, history.state);\n stateCopy.key = getStateKey();\n history.replaceState(stateCopy, '', url);\n } else {\n history.pushState({ key: setStateKey(genStateKey()) }, '', url);\n }\n } catch (e) {\n window.location[replace ? 'replace' : 'assign'](url);\n }\n}\n\nfunction replaceState (url) {\n pushState(url, true);\n}\n\n// When changing thing, also edit router.d.ts\nvar NavigationFailureType = {\n redirected: 2,\n aborted: 4,\n cancelled: 8,\n duplicated: 16\n};\n\nfunction createNavigationRedirectedError (from, to) {\n return createRouterError(\n from,\n to,\n NavigationFailureType.redirected,\n (\"Redirected when going from \\\"\" + (from.fullPath) + \"\\\" to \\\"\" + (stringifyRoute(\n to\n )) + \"\\\" via a navigation guard.\")\n )\n}\n\nfunction createNavigationDuplicatedError (from, to) {\n var error = createRouterError(\n from,\n to,\n NavigationFailureType.duplicated,\n (\"Avoided redundant navigation to current location: \\\"\" + (from.fullPath) + \"\\\".\")\n );\n // backwards compatible with the first introduction of Errors\n error.name = 'NavigationDuplicated';\n return error\n}\n\nfunction createNavigationCancelledError (from, to) {\n return createRouterError(\n from,\n to,\n NavigationFailureType.cancelled,\n (\"Navigation cancelled from \\\"\" + (from.fullPath) + \"\\\" to \\\"\" + (to.fullPath) + \"\\\" with a new navigation.\")\n )\n}\n\nfunction createNavigationAbortedError (from, to) {\n return createRouterError(\n from,\n to,\n NavigationFailureType.aborted,\n (\"Navigation aborted from \\\"\" + (from.fullPath) + \"\\\" to \\\"\" + (to.fullPath) + \"\\\" via a navigation guard.\")\n )\n}\n\nfunction createRouterError (from, to, type, message) {\n var error = new Error(message);\n error._isRouter = true;\n error.from = from;\n error.to = to;\n error.type = type;\n\n return error\n}\n\nvar propertiesToLog = ['params', 'query', 'hash'];\n\nfunction stringifyRoute (to) {\n if (typeof to === 'string') { return to }\n if ('path' in to) { return to.path }\n var location = {};\n propertiesToLog.forEach(function (key) {\n if (key in to) { location[key] = to[key]; }\n });\n return JSON.stringify(location, null, 2)\n}\n\nfunction isError (err) {\n return Object.prototype.toString.call(err).indexOf('Error') > -1\n}\n\nfunction isNavigationFailure (err, errorType) {\n return (\n isError(err) &&\n err._isRouter &&\n (errorType == null || err.type === errorType)\n )\n}\n\n/* */\n\nfunction runQueue (queue, fn, cb) {\n var step = function (index) {\n if (index >= queue.length) {\n cb();\n } else {\n if (queue[index]) {\n fn(queue[index], function () {\n step(index + 1);\n });\n } else {\n step(index + 1);\n }\n }\n };\n step(0);\n}\n\n/* */\n\nfunction resolveAsyncComponents (matched) {\n return function (to, from, next) {\n var hasAsync = false;\n var pending = 0;\n var error = null;\n\n flatMapComponents(matched, function (def, _, match, key) {\n // if it's a function and doesn't have cid attached,\n // assume it's an async component resolve function.\n // we are not using Vue's default async resolving mechanism because\n // we want to halt the navigation until the incoming component has been\n // resolved.\n if (typeof def === 'function' && def.cid === undefined) {\n hasAsync = true;\n pending++;\n\n var resolve = once(function (resolvedDef) {\n if (isESModule(resolvedDef)) {\n resolvedDef = resolvedDef.default;\n }\n // save resolved on async factory in case it's used elsewhere\n def.resolved = typeof resolvedDef === 'function'\n ? resolvedDef\n : _Vue.extend(resolvedDef);\n match.components[key] = resolvedDef;\n pending--;\n if (pending <= 0) {\n next();\n }\n });\n\n var reject = once(function (reason) {\n var msg = \"Failed to resolve async component \" + key + \": \" + reason;\n process.env.NODE_ENV !== 'production' && warn(false, msg);\n if (!error) {\n error = isError(reason)\n ? reason\n : new Error(msg);\n next(error);\n }\n });\n\n var res;\n try {\n res = def(resolve, reject);\n } catch (e) {\n reject(e);\n }\n if (res) {\n if (typeof res.then === 'function') {\n res.then(resolve, reject);\n } else {\n // new syntax in Vue 2.3\n var comp = res.component;\n if (comp && typeof comp.then === 'function') {\n comp.then(resolve, reject);\n }\n }\n }\n }\n });\n\n if (!hasAsync) { next(); }\n }\n}\n\nfunction flatMapComponents (\n matched,\n fn\n) {\n return flatten(matched.map(function (m) {\n return Object.keys(m.components).map(function (key) { return fn(\n m.components[key],\n m.instances[key],\n m, key\n ); })\n }))\n}\n\nfunction flatten (arr) {\n return Array.prototype.concat.apply([], arr)\n}\n\nvar hasSymbol =\n typeof Symbol === 'function' &&\n typeof Symbol.toStringTag === 'symbol';\n\nfunction isESModule (obj) {\n return obj.__esModule || (hasSymbol && obj[Symbol.toStringTag] === 'Module')\n}\n\n// in Webpack 2, require.ensure now also returns a Promise\n// so the resolve/reject functions may get called an extra time\n// if the user uses an arrow function shorthand that happens to\n// return that Promise.\nfunction once (fn) {\n var called = false;\n return function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n if (called) { return }\n called = true;\n return fn.apply(this, args)\n }\n}\n\n/* */\n\nvar History = function History (router, base) {\n this.router = router;\n this.base = normalizeBase(base);\n // start with a route object that stands for \"nowhere\"\n this.current = START;\n this.pending = null;\n this.ready = false;\n this.readyCbs = [];\n this.readyErrorCbs = [];\n this.errorCbs = [];\n this.listeners = [];\n};\n\nHistory.prototype.listen = function listen (cb) {\n this.cb = cb;\n};\n\nHistory.prototype.onReady = function onReady (cb, errorCb) {\n if (this.ready) {\n cb();\n } else {\n this.readyCbs.push(cb);\n if (errorCb) {\n this.readyErrorCbs.push(errorCb);\n }\n }\n};\n\nHistory.prototype.onError = function onError (errorCb) {\n this.errorCbs.push(errorCb);\n};\n\nHistory.prototype.transitionTo = function transitionTo (\n location,\n onComplete,\n onAbort\n) {\n var this$1$1 = this;\n\n var route;\n // catch redirect option https://github.com/vuejs/vue-router/issues/3201\n try {\n route = this.router.match(location, this.current);\n } catch (e) {\n this.errorCbs.forEach(function (cb) {\n cb(e);\n });\n // Exception should still be thrown\n throw e\n }\n var prev = this.current;\n this.confirmTransition(\n route,\n function () {\n this$1$1.updateRoute(route);\n onComplete && onComplete(route);\n this$1$1.ensureURL();\n this$1$1.router.afterHooks.forEach(function (hook) {\n hook && hook(route, prev);\n });\n\n // fire ready cbs once\n if (!this$1$1.ready) {\n this$1$1.ready = true;\n this$1$1.readyCbs.forEach(function (cb) {\n cb(route);\n });\n }\n },\n function (err) {\n if (onAbort) {\n onAbort(err);\n }\n if (err && !this$1$1.ready) {\n // Initial redirection should not mark the history as ready yet\n // because it's triggered by the redirection instead\n // https://github.com/vuejs/vue-router/issues/3225\n // https://github.com/vuejs/vue-router/issues/3331\n if (!isNavigationFailure(err, NavigationFailureType.redirected) || prev !== START) {\n this$1$1.ready = true;\n this$1$1.readyErrorCbs.forEach(function (cb) {\n cb(err);\n });\n }\n }\n }\n );\n};\n\nHistory.prototype.confirmTransition = function confirmTransition (route, onComplete, onAbort) {\n var this$1$1 = this;\n\n var current = this.current;\n this.pending = route;\n var abort = function (err) {\n // changed after adding errors with\n // https://github.com/vuejs/vue-router/pull/3047 before that change,\n // redirect and aborted navigation would produce an err == null\n if (!isNavigationFailure(err) && isError(err)) {\n if (this$1$1.errorCbs.length) {\n this$1$1.errorCbs.forEach(function (cb) {\n cb(err);\n });\n } else {\n if (process.env.NODE_ENV !== 'production') {\n warn(false, 'uncaught error during route navigation:');\n }\n console.error(err);\n }\n }\n onAbort && onAbort(err);\n };\n var lastRouteIndex = route.matched.length - 1;\n var lastCurrentIndex = current.matched.length - 1;\n if (\n isSameRoute(route, current) &&\n // in the case the route map has been dynamically appended to\n lastRouteIndex === lastCurrentIndex &&\n route.matched[lastRouteIndex] === current.matched[lastCurrentIndex]\n ) {\n this.ensureURL();\n if (route.hash) {\n handleScroll(this.router, current, route, false);\n }\n return abort(createNavigationDuplicatedError(current, route))\n }\n\n var ref = resolveQueue(\n this.current.matched,\n route.matched\n );\n var updated = ref.updated;\n var deactivated = ref.deactivated;\n var activated = ref.activated;\n\n var queue = [].concat(\n // in-component leave guards\n extractLeaveGuards(deactivated),\n // global before hooks\n this.router.beforeHooks,\n // in-component update hooks\n extractUpdateHooks(updated),\n // in-config enter guards\n activated.map(function (m) { return m.beforeEnter; }),\n // async components\n resolveAsyncComponents(activated)\n );\n\n var iterator = function (hook, next) {\n if (this$1$1.pending !== route) {\n return abort(createNavigationCancelledError(current, route))\n }\n try {\n hook(route, current, function (to) {\n if (to === false) {\n // next(false) -> abort navigation, ensure current URL\n this$1$1.ensureURL(true);\n abort(createNavigationAbortedError(current, route));\n } else if (isError(to)) {\n this$1$1.ensureURL(true);\n abort(to);\n } else if (\n typeof to === 'string' ||\n (typeof to === 'object' &&\n (typeof to.path === 'string' || typeof to.name === 'string'))\n ) {\n // next('/') or next({ path: '/' }) -> redirect\n abort(createNavigationRedirectedError(current, route));\n if (typeof to === 'object' && to.replace) {\n this$1$1.replace(to);\n } else {\n this$1$1.push(to);\n }\n } else {\n // confirm transition and pass on the value\n next(to);\n }\n });\n } catch (e) {\n abort(e);\n }\n };\n\n runQueue(queue, iterator, function () {\n // wait until async components are resolved before\n // extracting in-component enter guards\n var enterGuards = extractEnterGuards(activated);\n var queue = enterGuards.concat(this$1$1.router.resolveHooks);\n runQueue(queue, iterator, function () {\n if (this$1$1.pending !== route) {\n return abort(createNavigationCancelledError(current, route))\n }\n this$1$1.pending = null;\n onComplete(route);\n if (this$1$1.router.app) {\n this$1$1.router.app.$nextTick(function () {\n handleRouteEntered(route);\n });\n }\n });\n });\n};\n\nHistory.prototype.updateRoute = function updateRoute (route) {\n this.current = route;\n this.cb && this.cb(route);\n};\n\nHistory.prototype.setupListeners = function setupListeners () {\n // Default implementation is empty\n};\n\nHistory.prototype.teardown = function teardown () {\n // clean up event listeners\n // https://github.com/vuejs/vue-router/issues/2341\n this.listeners.forEach(function (cleanupListener) {\n cleanupListener();\n });\n this.listeners = [];\n\n // reset current history route\n // https://github.com/vuejs/vue-router/issues/3294\n this.current = START;\n this.pending = null;\n};\n\nfunction normalizeBase (base) {\n if (!base) {\n if (inBrowser) {\n // respect <base> tag\n var baseEl = document.querySelector('base');\n base = (baseEl && baseEl.getAttribute('href')) || '/';\n // strip full URL origin\n base = base.replace(/^https?:\\/\\/[^\\/]+/, '');\n } else {\n base = '/';\n }\n }\n // make sure there's the starting slash\n if (base.charAt(0) !== '/') {\n base = '/' + base;\n }\n // remove trailing slash\n return base.replace(/\\/$/, '')\n}\n\nfunction resolveQueue (\n current,\n next\n) {\n var i;\n var max = Math.max(current.length, next.length);\n for (i = 0; i < max; i++) {\n if (current[i] !== next[i]) {\n break\n }\n }\n return {\n updated: next.slice(0, i),\n activated: next.slice(i),\n deactivated: current.slice(i)\n }\n}\n\nfunction extractGuards (\n records,\n name,\n bind,\n reverse\n) {\n var guards = flatMapComponents(records, function (def, instance, match, key) {\n var guard = extractGuard(def, name);\n if (guard) {\n return Array.isArray(guard)\n ? guard.map(function (guard) { return bind(guard, instance, match, key); })\n : bind(guard, instance, match, key)\n }\n });\n return flatten(reverse ? guards.reverse() : guards)\n}\n\nfunction extractGuard (\n def,\n key\n) {\n if (typeof def !== 'function') {\n // extend now so that global mixins are applied.\n def = _Vue.extend(def);\n }\n return def.options[key]\n}\n\nfunction extractLeaveGuards (deactivated) {\n return extractGuards(deactivated, 'beforeRouteLeave', bindGuard, true)\n}\n\nfunction extractUpdateHooks (updated) {\n return extractGuards(updated, 'beforeRouteUpdate', bindGuard)\n}\n\nfunction bindGuard (guard, instance) {\n if (instance) {\n return function boundRouteGuard () {\n return guard.apply(instance, arguments)\n }\n }\n}\n\nfunction extractEnterGuards (\n activated\n) {\n return extractGuards(\n activated,\n 'beforeRouteEnter',\n function (guard, _, match, key) {\n return bindEnterGuard(guard, match, key)\n }\n )\n}\n\nfunction bindEnterGuard (\n guard,\n match,\n key\n) {\n return function routeEnterGuard (to, from, next) {\n return guard(to, from, function (cb) {\n if (typeof cb === 'function') {\n if (!match.enteredCbs[key]) {\n match.enteredCbs[key] = [];\n }\n match.enteredCbs[key].push(cb);\n }\n next(cb);\n })\n }\n}\n\n/* */\n\nvar HTML5History = /*@__PURE__*/(function (History) {\n function HTML5History (router, base) {\n History.call(this, router, base);\n\n this._startLocation = getLocation(this.base);\n }\n\n if ( History ) HTML5History.__proto__ = History;\n HTML5History.prototype = Object.create( History && History.prototype );\n HTML5History.prototype.constructor = HTML5History;\n\n HTML5History.prototype.setupListeners = function setupListeners () {\n var this$1$1 = this;\n\n if (this.listeners.length > 0) {\n return\n }\n\n var router = this.router;\n var expectScroll = router.options.scrollBehavior;\n var supportsScroll = supportsPushState && expectScroll;\n\n if (supportsScroll) {\n this.listeners.push(setupScroll());\n }\n\n var handleRoutingEvent = function () {\n var current = this$1$1.current;\n\n // Avoiding first `popstate` event dispatched in some browsers but first\n // history route not updated since async guard at the same time.\n var location = getLocation(this$1$1.base);\n if (this$1$1.current === START && location === this$1$1._startLocation) {\n return\n }\n\n this$1$1.transitionTo(location, function (route) {\n if (supportsScroll) {\n handleScroll(router, route, current, true);\n }\n });\n };\n window.addEventListener('popstate', handleRoutingEvent);\n this.listeners.push(function () {\n window.removeEventListener('popstate', handleRoutingEvent);\n });\n };\n\n HTML5History.prototype.go = function go (n) {\n window.history.go(n);\n };\n\n HTML5History.prototype.push = function push (location, onComplete, onAbort) {\n var this$1$1 = this;\n\n var ref = this;\n var fromRoute = ref.current;\n this.transitionTo(location, function (route) {\n pushState(cleanPath(this$1$1.base + route.fullPath));\n handleScroll(this$1$1.router, route, fromRoute, false);\n onComplete && onComplete(route);\n }, onAbort);\n };\n\n HTML5History.prototype.replace = function replace (location, onComplete, onAbort) {\n var this$1$1 = this;\n\n var ref = this;\n var fromRoute = ref.current;\n this.transitionTo(location, function (route) {\n replaceState(cleanPath(this$1$1.base + route.fullPath));\n handleScroll(this$1$1.router, route, fromRoute, false);\n onComplete && onComplete(route);\n }, onAbort);\n };\n\n HTML5History.prototype.ensureURL = function ensureURL (push) {\n if (getLocation(this.base) !== this.current.fullPath) {\n var current = cleanPath(this.base + this.current.fullPath);\n push ? pushState(current) : replaceState(current);\n }\n };\n\n HTML5History.prototype.getCurrentLocation = function getCurrentLocation () {\n return getLocation(this.base)\n };\n\n return HTML5History;\n}(History));\n\nfunction getLocation (base) {\n var path = window.location.pathname;\n var pathLowerCase = path.toLowerCase();\n var baseLowerCase = base.toLowerCase();\n // base=\"/a\" shouldn't turn path=\"/app\" into \"/a/pp\"\n // https://github.com/vuejs/vue-router/issues/3555\n // so we ensure the trailing slash in the base\n if (base && ((pathLowerCase === baseLowerCase) ||\n (pathLowerCase.indexOf(cleanPath(baseLowerCase + '/')) === 0))) {\n path = path.slice(base.length);\n }\n return (path || '/') + window.location.search + window.location.hash\n}\n\n/* */\n\nvar HashHistory = /*@__PURE__*/(function (History) {\n function HashHistory (router, base, fallback) {\n History.call(this, router, base);\n // check history fallback deeplinking\n if (fallback && checkFallback(this.base)) {\n return\n }\n ensureSlash();\n }\n\n if ( History ) HashHistory.__proto__ = History;\n HashHistory.prototype = Object.create( History && History.prototype );\n HashHistory.prototype.constructor = HashHistory;\n\n // this is delayed until the app mounts\n // to avoid the hashchange listener being fired too early\n HashHistory.prototype.setupListeners = function setupListeners () {\n var this$1$1 = this;\n\n if (this.listeners.length > 0) {\n return\n }\n\n var router = this.router;\n var expectScroll = router.options.scrollBehavior;\n var supportsScroll = supportsPushState && expectScroll;\n\n if (supportsScroll) {\n this.listeners.push(setupScroll());\n }\n\n var handleRoutingEvent = function () {\n var current = this$1$1.current;\n if (!ensureSlash()) {\n return\n }\n this$1$1.transitionTo(getHash(), function (route) {\n if (supportsScroll) {\n handleScroll(this$1$1.router, route, current, true);\n }\n if (!supportsPushState) {\n replaceHash(route.fullPath);\n }\n });\n };\n var eventType = supportsPushState ? 'popstate' : 'hashchange';\n window.addEventListener(\n eventType,\n handleRoutingEvent\n );\n this.listeners.push(function () {\n window.removeEventListener(eventType, handleRoutingEvent);\n });\n };\n\n HashHistory.prototype.push = function push (location, onComplete, onAbort) {\n var this$1$1 = this;\n\n var ref = this;\n var fromRoute = ref.current;\n this.transitionTo(\n location,\n function (route) {\n pushHash(route.fullPath);\n handleScroll(this$1$1.router, route, fromRoute, false);\n onComplete && onComplete(route);\n },\n onAbort\n );\n };\n\n HashHistory.prototype.replace = function replace (location, onComplete, onAbort) {\n var this$1$1 = this;\n\n var ref = this;\n var fromRoute = ref.current;\n this.transitionTo(\n location,\n function (route) {\n replaceHash(route.fullPath);\n handleScroll(this$1$1.router, route, fromRoute, false);\n onComplete && onComplete(route);\n },\n onAbort\n );\n };\n\n HashHistory.prototype.go = function go (n) {\n window.history.go(n);\n };\n\n HashHistory.prototype.ensureURL = function ensureURL (push) {\n var current = this.current.fullPath;\n if (getHash() !== current) {\n push ? pushHash(current) : replaceHash(current);\n }\n };\n\n HashHistory.prototype.getCurrentLocation = function getCurrentLocation () {\n return getHash()\n };\n\n return HashHistory;\n}(History));\n\nfunction checkFallback (base) {\n var location = getLocation(base);\n if (!/^\\/#/.test(location)) {\n window.location.replace(cleanPath(base + '/#' + location));\n return true\n }\n}\n\nfunction ensureSlash () {\n var path = getHash();\n if (path.charAt(0) === '/') {\n return true\n }\n replaceHash('/' + path);\n return false\n}\n\nfunction getHash () {\n // We can't use window.location.hash here because it's not\n // consistent across browsers - Firefox will pre-decode it!\n var href = window.location.href;\n var index = href.indexOf('#');\n // empty path\n if (index < 0) { return '' }\n\n href = href.slice(index + 1);\n\n return href\n}\n\nfunction getUrl (path) {\n var href = window.location.href;\n var i = href.indexOf('#');\n var base = i >= 0 ? href.slice(0, i) : href;\n return (base + \"#\" + path)\n}\n\nfunction pushHash (path) {\n if (supportsPushState) {\n pushState(getUrl(path));\n } else {\n window.location.hash = path;\n }\n}\n\nfunction replaceHash (path) {\n if (supportsPushState) {\n replaceState(getUrl(path));\n } else {\n window.location.replace(getUrl(path));\n }\n}\n\n/* */\n\nvar AbstractHistory = /*@__PURE__*/(function (History) {\n function AbstractHistory (router, base) {\n History.call(this, router, base);\n this.stack = [];\n this.index = -1;\n }\n\n if ( History ) AbstractHistory.__proto__ = History;\n AbstractHistory.prototype = Object.create( History && History.prototype );\n AbstractHistory.prototype.constructor = AbstractHistory;\n\n AbstractHistory.prototype.push = function push (location, onComplete, onAbort) {\n var this$1$1 = this;\n\n this.transitionTo(\n location,\n function (route) {\n this$1$1.stack = this$1$1.stack.slice(0, this$1$1.index + 1).concat(route);\n this$1$1.index++;\n onComplete && onComplete(route);\n },\n onAbort\n );\n };\n\n AbstractHistory.prototype.replace = function replace (location, onComplete, onAbort) {\n var this$1$1 = this;\n\n this.transitionTo(\n location,\n function (route) {\n this$1$1.stack = this$1$1.stack.slice(0, this$1$1.index).concat(route);\n onComplete && onComplete(route);\n },\n onAbort\n );\n };\n\n AbstractHistory.prototype.go = function go (n) {\n var this$1$1 = this;\n\n var targetIndex = this.index + n;\n if (targetIndex < 0 || targetIndex >= this.stack.length) {\n return\n }\n var route = this.stack[targetIndex];\n this.confirmTransition(\n route,\n function () {\n var prev = this$1$1.current;\n this$1$1.index = targetIndex;\n this$1$1.updateRoute(route);\n this$1$1.router.afterHooks.forEach(function (hook) {\n hook && hook(route, prev);\n });\n },\n function (err) {\n if (isNavigationFailure(err, NavigationFailureType.duplicated)) {\n this$1$1.index = targetIndex;\n }\n }\n );\n };\n\n AbstractHistory.prototype.getCurrentLocation = function getCurrentLocation () {\n var current = this.stack[this.stack.length - 1];\n return current ? current.fullPath : '/'\n };\n\n AbstractHistory.prototype.ensureURL = function ensureURL () {\n // noop\n };\n\n return AbstractHistory;\n}(History));\n\n/* */\n\n\n\nvar VueRouter = function VueRouter (options) {\n if ( options === void 0 ) options = {};\n\n if (process.env.NODE_ENV !== 'production') {\n warn(this instanceof VueRouter, \"Router must be called with the new operator.\");\n }\n this.app = null;\n this.apps = [];\n this.options = options;\n this.beforeHooks = [];\n this.resolveHooks = [];\n this.afterHooks = [];\n this.matcher = createMatcher(options.routes || [], this);\n\n var mode = options.mode || 'hash';\n this.fallback =\n mode === 'history' && !supportsPushState && options.fallback !== false;\n if (this.fallback) {\n mode = 'hash';\n }\n if (!inBrowser) {\n mode = 'abstract';\n }\n this.mode = mode;\n\n switch (mode) {\n case 'history':\n this.history = new HTML5History(this, options.base);\n break\n case 'hash':\n this.history = new HashHistory(this, options.base, this.fallback);\n break\n case 'abstract':\n this.history = new AbstractHistory(this, options.base);\n break\n default:\n if (process.env.NODE_ENV !== 'production') {\n assert(false, (\"invalid mode: \" + mode));\n }\n }\n};\n\nvar prototypeAccessors = { currentRoute: { configurable: true } };\n\nVueRouter.prototype.match = function match (raw, current, redirectedFrom) {\n return this.matcher.match(raw, current, redirectedFrom)\n};\n\nprototypeAccessors.currentRoute.get = function () {\n return this.history && this.history.current\n};\n\nVueRouter.prototype.init = function init (app /* Vue component instance */) {\n var this$1$1 = this;\n\n process.env.NODE_ENV !== 'production' &&\n assert(\n install.installed,\n \"not installed. Make sure to call `Vue.use(VueRouter)` \" +\n \"before creating root instance.\"\n );\n\n this.apps.push(app);\n\n // set up app destroyed handler\n // https://github.com/vuejs/vue-router/issues/2639\n app.$once('hook:destroyed', function () {\n // clean out app from this.apps array once destroyed\n var index = this$1$1.apps.indexOf(app);\n if (index > -1) { this$1$1.apps.splice(index, 1); }\n // ensure we still have a main app or null if no apps\n // we do not release the router so it can be reused\n if (this$1$1.app === app) { this$1$1.app = this$1$1.apps[0] || null; }\n\n if (!this$1$1.app) { this$1$1.history.teardown(); }\n });\n\n // main app previously initialized\n // return as we don't need to set up new history listener\n if (this.app) {\n return\n }\n\n this.app = app;\n\n var history = this.history;\n\n if (history instanceof HTML5History || history instanceof HashHistory) {\n var handleInitialScroll = function (routeOrError) {\n var from = history.current;\n var expectScroll = this$1$1.options.scrollBehavior;\n var supportsScroll = supportsPushState && expectScroll;\n\n if (supportsScroll && 'fullPath' in routeOrError) {\n handleScroll(this$1$1, routeOrError, from, false);\n }\n };\n var setupListeners = function (routeOrError) {\n history.setupListeners();\n handleInitialScroll(routeOrError);\n };\n history.transitionTo(\n history.getCurrentLocation(),\n setupListeners,\n setupListeners\n );\n }\n\n history.listen(function (route) {\n this$1$1.apps.forEach(function (app) {\n app._route = route;\n });\n });\n};\n\nVueRouter.prototype.beforeEach = function beforeEach (fn) {\n return registerHook(this.beforeHooks, fn)\n};\n\nVueRouter.prototype.beforeResolve = function beforeResolve (fn) {\n return registerHook(this.resolveHooks, fn)\n};\n\nVueRouter.prototype.afterEach = function afterEach (fn) {\n return registerHook(this.afterHooks, fn)\n};\n\nVueRouter.prototype.onReady = function onReady (cb, errorCb) {\n this.history.onReady(cb, errorCb);\n};\n\nVueRouter.prototype.onError = function onError (errorCb) {\n this.history.onError(errorCb);\n};\n\nVueRouter.prototype.push = function push (location, onComplete, onAbort) {\n var this$1$1 = this;\n\n // $flow-disable-line\n if (!onComplete && !onAbort && typeof Promise !== 'undefined') {\n return new Promise(function (resolve, reject) {\n this$1$1.history.push(location, resolve, reject);\n })\n } else {\n this.history.push(location, onComplete, onAbort);\n }\n};\n\nVueRouter.prototype.replace = function replace (location, onComplete, onAbort) {\n var this$1$1 = this;\n\n // $flow-disable-line\n if (!onComplete && !onAbort && typeof Promise !== 'undefined') {\n return new Promise(function (resolve, reject) {\n this$1$1.history.replace(location, resolve, reject);\n })\n } else {\n this.history.replace(location, onComplete, onAbort);\n }\n};\n\nVueRouter.prototype.go = function go (n) {\n this.history.go(n);\n};\n\nVueRouter.prototype.back = function back () {\n this.go(-1);\n};\n\nVueRouter.prototype.forward = function forward () {\n this.go(1);\n};\n\nVueRouter.prototype.getMatchedComponents = function getMatchedComponents (to) {\n var route = to\n ? to.matched\n ? to\n : this.resolve(to).route\n : this.currentRoute;\n if (!route) {\n return []\n }\n return [].concat.apply(\n [],\n route.matched.map(function (m) {\n return Object.keys(m.components).map(function (key) {\n return m.components[key]\n })\n })\n )\n};\n\nVueRouter.prototype.resolve = function resolve (\n to,\n current,\n append\n) {\n current = current || this.history.current;\n var location = normalizeLocation(to, current, append, this);\n var route = this.match(location, current);\n var fullPath = route.redirectedFrom || route.fullPath;\n var base = this.history.base;\n var href = createHref(base, fullPath, this.mode);\n return {\n location: location,\n route: route,\n href: href,\n // for backwards compat\n normalizedTo: location,\n resolved: route\n }\n};\n\nVueRouter.prototype.getRoutes = function getRoutes () {\n return this.matcher.getRoutes()\n};\n\nVueRouter.prototype.addRoute = function addRoute (parentOrRoute, route) {\n this.matcher.addRoute(parentOrRoute, route);\n if (this.history.current !== START) {\n this.history.transitionTo(this.history.getCurrentLocation());\n }\n};\n\nVueRouter.prototype.addRoutes = function addRoutes (routes) {\n if (process.env.NODE_ENV !== 'production') {\n warn(false, 'router.addRoutes() is deprecated and has been removed in Vue Router 4. Use router.addRoute() instead.');\n }\n this.matcher.addRoutes(routes);\n if (this.history.current !== START) {\n this.history.transitionTo(this.history.getCurrentLocation());\n }\n};\n\nObject.defineProperties( VueRouter.prototype, prototypeAccessors );\n\nvar VueRouter$1 = VueRouter;\n\nfunction registerHook (list, fn) {\n list.push(fn);\n return function () {\n var i = list.indexOf(fn);\n if (i > -1) { list.splice(i, 1); }\n }\n}\n\nfunction createHref (base, fullPath, mode) {\n var path = mode === 'hash' ? '#' + fullPath : fullPath;\n return base ? cleanPath(base + '/' + path) : path\n}\n\n// We cannot remove this as it would be a breaking change\nVueRouter.install = install;\nVueRouter.version = '3.6.3';\nVueRouter.isNavigationFailure = isNavigationFailure;\nVueRouter.NavigationFailureType = NavigationFailureType;\nVueRouter.START_LOCATION = START;\n\nif (inBrowser && window.Vue) {\n window.Vue.use(VueRouter);\n}\n\nvar version = '3.6.3';\n\nexport { NavigationFailureType, Link as RouterLink, View as RouterView, START as START_LOCATION, VueRouter$1 as default, isNavigationFailure, version };\n","/*!\n * Vue.js v2.7.10\n * (c) 2014-2022 Evan You\n * Released under the MIT License.\n */\nvar emptyObject = Object.freeze({});\r\nvar isArray = Array.isArray;\r\n// These helpers produce better VM code in JS engines due to their\r\n// explicitness and function inlining.\r\nfunction isUndef(v) {\r\n return v === undefined || v === null;\r\n}\r\nfunction isDef(v) {\r\n return v !== undefined && v !== null;\r\n}\r\nfunction isTrue(v) {\r\n return v === true;\r\n}\r\nfunction isFalse(v) {\r\n return v === false;\r\n}\r\n/**\r\n * Check if value is primitive.\r\n */\r\nfunction isPrimitive(value) {\r\n return (typeof value === 'string' ||\r\n typeof value === 'number' ||\r\n // $flow-disable-line\r\n typeof value === 'symbol' ||\r\n typeof value === 'boolean');\r\n}\r\nfunction isFunction(value) {\r\n return typeof value === 'function';\r\n}\r\n/**\r\n * Quick object check - this is primarily used to tell\r\n * objects from primitive values when we know the value\r\n * is a JSON-compliant type.\r\n */\r\nfunction isObject(obj) {\r\n return obj !== null && typeof obj === 'object';\r\n}\r\n/**\r\n * Get the raw type string of a value, e.g., [object Object].\r\n */\r\nvar _toString = Object.prototype.toString;\r\nfunction toRawType(value) {\r\n return _toString.call(value).slice(8, -1);\r\n}\r\n/**\r\n * Strict object type check. Only returns true\r\n * for plain JavaScript objects.\r\n */\r\nfunction isPlainObject(obj) {\r\n return _toString.call(obj) === '[object Object]';\r\n}\r\nfunction isRegExp(v) {\r\n return _toString.call(v) === '[object RegExp]';\r\n}\r\n/**\r\n * Check if val is a valid array index.\r\n */\r\nfunction isValidArrayIndex(val) {\r\n var n = parseFloat(String(val));\r\n return n >= 0 && Math.floor(n) === n && isFinite(val);\r\n}\r\nfunction isPromise(val) {\r\n return (isDef(val) &&\r\n typeof val.then === 'function' &&\r\n typeof val.catch === 'function');\r\n}\r\n/**\r\n * Convert a value to a string that is actually rendered.\r\n */\r\nfunction toString(val) {\r\n return val == null\r\n ? ''\r\n : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)\r\n ? JSON.stringify(val, null, 2)\r\n : String(val);\r\n}\r\n/**\r\n * Convert an input value to a number for persistence.\r\n * If the conversion fails, return original string.\r\n */\r\nfunction toNumber(val) {\r\n var n = parseFloat(val);\r\n return isNaN(n) ? val : n;\r\n}\r\n/**\r\n * Make a map and return a function for checking if a key\r\n * is in that map.\r\n */\r\nfunction makeMap(str, expectsLowerCase) {\r\n var map = Object.create(null);\r\n var list = str.split(',');\r\n for (var i = 0; i < list.length; i++) {\r\n map[list[i]] = true;\r\n }\r\n return expectsLowerCase ? function (val) { return map[val.toLowerCase()]; } : function (val) { return map[val]; };\r\n}\r\n/**\r\n * Check if a tag is a built-in tag.\r\n */\r\nvar isBuiltInTag = makeMap('slot,component', true);\r\n/**\r\n * Check if an attribute is a reserved attribute.\r\n */\r\nvar isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');\r\n/**\r\n * Remove an item from an array.\r\n */\r\nfunction remove$2(arr, item) {\r\n if (arr.length) {\r\n var index = arr.indexOf(item);\r\n if (index > -1) {\r\n return arr.splice(index, 1);\r\n }\r\n }\r\n}\r\n/**\r\n * Check whether an object has the property.\r\n */\r\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\r\nfunction hasOwn(obj, key) {\r\n return hasOwnProperty.call(obj, key);\r\n}\r\n/**\r\n * Create a cached version of a pure function.\r\n */\r\nfunction cached(fn) {\r\n var cache = Object.create(null);\r\n return function cachedFn(str) {\r\n var hit = cache[str];\r\n return hit || (cache[str] = fn(str));\r\n };\r\n}\r\n/**\r\n * Camelize a hyphen-delimited string.\r\n */\r\nvar camelizeRE = /-(\\w)/g;\r\nvar camelize = cached(function (str) {\r\n return str.replace(camelizeRE, function (_, c) { return (c ? c.toUpperCase() : ''); });\r\n});\r\n/**\r\n * Capitalize a string.\r\n */\r\nvar capitalize = cached(function (str) {\r\n return str.charAt(0).toUpperCase() + str.slice(1);\r\n});\r\n/**\r\n * Hyphenate a camelCase string.\r\n */\r\nvar hyphenateRE = /\\B([A-Z])/g;\r\nvar hyphenate = cached(function (str) {\r\n return str.replace(hyphenateRE, '-$1').toLowerCase();\r\n});\r\n/**\r\n * Simple bind polyfill for environments that do not support it,\r\n * e.g., PhantomJS 1.x. Technically, we don't need this anymore\r\n * since native bind is now performant enough in most browsers.\r\n * But removing it would mean breaking code that was able to run in\r\n * PhantomJS 1.x, so this must be kept for backward compatibility.\r\n */\r\n/* istanbul ignore next */\r\nfunction polyfillBind(fn, ctx) {\r\n function boundFn(a) {\r\n var l = arguments.length;\r\n return l\r\n ? l > 1\r\n ? fn.apply(ctx, arguments)\r\n : fn.call(ctx, a)\r\n : fn.call(ctx);\r\n }\r\n boundFn._length = fn.length;\r\n return boundFn;\r\n}\r\nfunction nativeBind(fn, ctx) {\r\n return fn.bind(ctx);\r\n}\r\n// @ts-expect-error bind cannot be `undefined`\r\nvar bind = Function.prototype.bind ? nativeBind : polyfillBind;\r\n/**\r\n * Convert an Array-like object to a real Array.\r\n */\r\nfunction toArray(list, start) {\r\n start = start || 0;\r\n var i = list.length - start;\r\n var ret = new Array(i);\r\n while (i--) {\r\n ret[i] = list[i + start];\r\n }\r\n return ret;\r\n}\r\n/**\r\n * Mix properties into target object.\r\n */\r\nfunction extend(to, _from) {\r\n for (var key in _from) {\r\n to[key] = _from[key];\r\n }\r\n return to;\r\n}\r\n/**\r\n * Merge an Array of Objects into a single Object.\r\n */\r\nfunction toObject(arr) {\r\n var res = {};\r\n for (var i = 0; i < arr.length; i++) {\r\n if (arr[i]) {\r\n extend(res, arr[i]);\r\n }\r\n }\r\n return res;\r\n}\r\n/* eslint-disable no-unused-vars */\r\n/**\r\n * Perform no operation.\r\n * Stubbing args to make Flow happy without leaving useless transpiled code\r\n * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).\r\n */\r\nfunction noop(a, b, c) { }\r\n/**\r\n * Always return false.\r\n */\r\nvar no = function (a, b, c) { return false; };\r\n/* eslint-enable no-unused-vars */\r\n/**\r\n * Return the same value.\r\n */\r\nvar identity = function (_) { return _; };\r\n/**\r\n * Check if two values are loosely equal - that is,\r\n * if they are plain objects, do they have the same shape?\r\n */\r\nfunction looseEqual(a, b) {\r\n if (a === b)\r\n return true;\r\n var isObjectA = isObject(a);\r\n var isObjectB = isObject(b);\r\n if (isObjectA && isObjectB) {\r\n try {\r\n var isArrayA = Array.isArray(a);\r\n var isArrayB = Array.isArray(b);\r\n if (isArrayA && isArrayB) {\r\n return (a.length === b.length &&\r\n a.every(function (e, i) {\r\n return looseEqual(e, b[i]);\r\n }));\r\n }\r\n else if (a instanceof Date && b instanceof Date) {\r\n return a.getTime() === b.getTime();\r\n }\r\n else if (!isArrayA && !isArrayB) {\r\n var keysA = Object.keys(a);\r\n var keysB = Object.keys(b);\r\n return (keysA.length === keysB.length &&\r\n keysA.every(function (key) {\r\n return looseEqual(a[key], b[key]);\r\n }));\r\n }\r\n else {\r\n /* istanbul ignore next */\r\n return false;\r\n }\r\n }\r\n catch (e) {\r\n /* istanbul ignore next */\r\n return false;\r\n }\r\n }\r\n else if (!isObjectA && !isObjectB) {\r\n return String(a) === String(b);\r\n }\r\n else {\r\n return false;\r\n }\r\n}\r\n/**\r\n * Return the first index at which a loosely equal value can be\r\n * found in the array (if value is a plain object, the array must\r\n * contain an object of the same shape), or -1 if it is not present.\r\n */\r\nfunction looseIndexOf(arr, val) {\r\n for (var i = 0; i < arr.length; i++) {\r\n if (looseEqual(arr[i], val))\r\n return i;\r\n }\r\n return -1;\r\n}\r\n/**\r\n * Ensure a function is called only once.\r\n */\r\nfunction once(fn) {\r\n var called = false;\r\n return function () {\r\n if (!called) {\r\n called = true;\r\n fn.apply(this, arguments);\r\n }\r\n };\r\n}\r\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is#polyfill\r\nfunction hasChanged(x, y) {\r\n if (x === y) {\r\n return x === 0 && 1 / x !== 1 / y;\r\n }\r\n else {\r\n return x === x || y === y;\r\n }\r\n}\n\nvar SSR_ATTR = 'data-server-rendered';\r\nvar ASSET_TYPES = ['component', 'directive', 'filter'];\r\nvar LIFECYCLE_HOOKS = [\r\n 'beforeCreate',\r\n 'created',\r\n 'beforeMount',\r\n 'mounted',\r\n 'beforeUpdate',\r\n 'updated',\r\n 'beforeDestroy',\r\n 'destroyed',\r\n 'activated',\r\n 'deactivated',\r\n 'errorCaptured',\r\n 'serverPrefetch',\r\n 'renderTracked',\r\n 'renderTriggered'\r\n];\n\nvar config = {\r\n /**\r\n * Option merge strategies (used in core/util/options)\r\n */\r\n // $flow-disable-line\r\n optionMergeStrategies: Object.create(null),\r\n /**\r\n * Whether to suppress warnings.\r\n */\r\n silent: false,\r\n /**\r\n * Show production mode tip message on boot?\r\n */\r\n productionTip: process.env.NODE_ENV !== 'production',\r\n /**\r\n * Whether to enable devtools\r\n */\r\n devtools: process.env.NODE_ENV !== 'production',\r\n /**\r\n * Whether to record perf\r\n */\r\n performance: false,\r\n /**\r\n * Error handler for watcher errors\r\n */\r\n errorHandler: null,\r\n /**\r\n * Warn handler for watcher warns\r\n */\r\n warnHandler: null,\r\n /**\r\n * Ignore certain custom elements\r\n */\r\n ignoredElements: [],\r\n /**\r\n * Custom user key aliases for v-on\r\n */\r\n // $flow-disable-line\r\n keyCodes: Object.create(null),\r\n /**\r\n * Check if a tag is reserved so that it cannot be registered as a\r\n * component. This is platform-dependent and may be overwritten.\r\n */\r\n isReservedTag: no,\r\n /**\r\n * Check if an attribute is reserved so that it cannot be used as a component\r\n * prop. This is platform-dependent and may be overwritten.\r\n */\r\n isReservedAttr: no,\r\n /**\r\n * Check if a tag is an unknown element.\r\n * Platform-dependent.\r\n */\r\n isUnknownElement: no,\r\n /**\r\n * Get the namespace of an element\r\n */\r\n getTagNamespace: noop,\r\n /**\r\n * Parse the real tag name for the specific platform.\r\n */\r\n parsePlatformTagName: identity,\r\n /**\r\n * Check if an attribute must be bound using property, e.g. value\r\n * Platform-dependent.\r\n */\r\n mustUseProp: no,\r\n /**\r\n * Perform updates asynchronously. Intended to be used by Vue Test Utils\r\n * This will significantly reduce performance if set to false.\r\n */\r\n async: true,\r\n /**\r\n * Exposed for legacy reasons\r\n */\r\n _lifecycleHooks: LIFECYCLE_HOOKS\r\n};\n\n/**\r\n * unicode letters used for parsing html tags, component names and property paths.\r\n * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname\r\n * skipping \\u10000-\\uEFFFF due to it freezing up PhantomJS\r\n */\r\nvar unicodeRegExp = /a-zA-Z\\u00B7\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u203F-\\u2040\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD/;\r\n/**\r\n * Check if a string starts with $ or _\r\n */\r\nfunction isReserved(str) {\r\n var c = (str + '').charCodeAt(0);\r\n return c === 0x24 || c === 0x5f;\r\n}\r\n/**\r\n * Define a property.\r\n */\r\nfunction def(obj, key, val, enumerable) {\r\n Object.defineProperty(obj, key, {\r\n value: val,\r\n enumerable: !!enumerable,\r\n writable: true,\r\n configurable: true\r\n });\r\n}\r\n/**\r\n * Parse simple path.\r\n */\r\nvar bailRE = new RegExp(\"[^\".concat(unicodeRegExp.source, \".$_\\\\d]\"));\r\nfunction parsePath(path) {\r\n if (bailRE.test(path)) {\r\n return;\r\n }\r\n var segments = path.split('.');\r\n return function (obj) {\r\n for (var i = 0; i < segments.length; i++) {\r\n if (!obj)\r\n return;\r\n obj = obj[segments[i]];\r\n }\r\n return obj;\r\n };\r\n}\n\n// can we use __proto__?\r\nvar hasProto = '__proto__' in {};\r\n// Browser environment sniffing\r\nvar inBrowser = typeof window !== 'undefined';\r\nvar UA = inBrowser && window.navigator.userAgent.toLowerCase();\r\nvar isIE = UA && /msie|trident/.test(UA);\r\nvar isIE9 = UA && UA.indexOf('msie 9.0') > 0;\r\nvar isEdge = UA && UA.indexOf('edge/') > 0;\r\nUA && UA.indexOf('android') > 0;\r\nvar isIOS = UA && /iphone|ipad|ipod|ios/.test(UA);\r\nUA && /chrome\\/\\d+/.test(UA) && !isEdge;\r\nUA && /phantomjs/.test(UA);\r\nvar isFF = UA && UA.match(/firefox\\/(\\d+)/);\r\n// Firefox has a \"watch\" function on Object.prototype...\r\n// @ts-expect-error firebox support\r\nvar nativeWatch = {}.watch;\r\nvar supportsPassive = false;\r\nif (inBrowser) {\r\n try {\r\n var opts = {};\r\n Object.defineProperty(opts, 'passive', {\r\n get: function () {\r\n /* istanbul ignore next */\r\n supportsPassive = true;\r\n }\r\n }); // https://github.com/facebook/flow/issues/285\r\n window.addEventListener('test-passive', null, opts);\r\n }\r\n catch (e) { }\r\n}\r\n// this needs to be lazy-evaled because vue may be required before\r\n// vue-server-renderer can set VUE_ENV\r\nvar _isServer;\r\nvar isServerRendering = function () {\r\n if (_isServer === undefined) {\r\n /* istanbul ignore if */\r\n if (!inBrowser && typeof global !== 'undefined') {\r\n // detect presence of vue-server-renderer and avoid\r\n // Webpack shimming the process\r\n _isServer =\r\n global['process'] && global['process'].env.VUE_ENV === 'server';\r\n }\r\n else {\r\n _isServer = false;\r\n }\r\n }\r\n return _isServer;\r\n};\r\n// detect devtools\r\nvar devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;\r\n/* istanbul ignore next */\r\nfunction isNative(Ctor) {\r\n return typeof Ctor === 'function' && /native code/.test(Ctor.toString());\r\n}\r\nvar hasSymbol = typeof Symbol !== 'undefined' &&\r\n isNative(Symbol) &&\r\n typeof Reflect !== 'undefined' &&\r\n isNative(Reflect.ownKeys);\r\nvar _Set; // $flow-disable-line\r\n/* istanbul ignore if */ if (typeof Set !== 'undefined' && isNative(Set)) {\r\n // use native Set when available.\r\n _Set = Set;\r\n}\r\nelse {\r\n // a non-standard Set polyfill that only works with primitive keys.\r\n _Set = /** @class */ (function () {\r\n function Set() {\r\n this.set = Object.create(null);\r\n }\r\n Set.prototype.has = function (key) {\r\n return this.set[key] === true;\r\n };\r\n Set.prototype.add = function (key) {\r\n this.set[key] = true;\r\n };\r\n Set.prototype.clear = function () {\r\n this.set = Object.create(null);\r\n };\r\n return Set;\r\n }());\r\n}\n\nvar currentInstance = null;\r\n/**\r\n * This is exposed for compatibility with v3 (e.g. some functions in VueUse\r\n * relies on it). Do not use this internally, just use `currentInstance`.\r\n *\r\n * @internal this function needs manual type declaration because it relies\r\n * on previously manually authored types from Vue 2\r\n */\r\nfunction getCurrentInstance() {\r\n return currentInstance && { proxy: currentInstance };\r\n}\r\n/**\r\n * @internal\r\n */\r\nfunction setCurrentInstance(vm) {\r\n if (vm === void 0) { vm = null; }\r\n if (!vm)\r\n currentInstance && currentInstance._scope.off();\r\n currentInstance = vm;\r\n vm && vm._scope.on();\r\n}\n\n/**\r\n * @internal\r\n */\r\nvar VNode = /** @class */ (function () {\r\n function VNode(tag, data, children, text, elm, context, componentOptions, asyncFactory) {\r\n this.tag = tag;\r\n this.data = data;\r\n this.children = children;\r\n this.text = text;\r\n this.elm = elm;\r\n this.ns = undefined;\r\n this.context = context;\r\n this.fnContext = undefined;\r\n this.fnOptions = undefined;\r\n this.fnScopeId = undefined;\r\n this.key = data && data.key;\r\n this.componentOptions = componentOptions;\r\n this.componentInstance = undefined;\r\n this.parent = undefined;\r\n this.raw = false;\r\n this.isStatic = false;\r\n this.isRootInsert = true;\r\n this.isComment = false;\r\n this.isCloned = false;\r\n this.isOnce = false;\r\n this.asyncFactory = asyncFactory;\r\n this.asyncMeta = undefined;\r\n this.isAsyncPlaceholder = false;\r\n }\r\n Object.defineProperty(VNode.prototype, \"child\", {\r\n // DEPRECATED: alias for componentInstance for backwards compat.\r\n /* istanbul ignore next */\r\n get: function () {\r\n return this.componentInstance;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n return VNode;\r\n}());\r\nvar createEmptyVNode = function (text) {\r\n if (text === void 0) { text = ''; }\r\n var node = new VNode();\r\n node.text = text;\r\n node.isComment = true;\r\n return node;\r\n};\r\nfunction createTextVNode(val) {\r\n return new VNode(undefined, undefined, undefined, String(val));\r\n}\r\n// optimized shallow clone\r\n// used for static nodes and slot nodes because they may be reused across\r\n// multiple renders, cloning them avoids errors when DOM manipulations rely\r\n// on their elm reference.\r\nfunction cloneVNode(vnode) {\r\n var cloned = new VNode(vnode.tag, vnode.data, \r\n // #7975\r\n // clone children array to avoid mutating original in case of cloning\r\n // a child.\r\n vnode.children && vnode.children.slice(), vnode.text, vnode.elm, vnode.context, vnode.componentOptions, vnode.asyncFactory);\r\n cloned.ns = vnode.ns;\r\n cloned.isStatic = vnode.isStatic;\r\n cloned.key = vnode.key;\r\n cloned.isComment = vnode.isComment;\r\n cloned.fnContext = vnode.fnContext;\r\n cloned.fnOptions = vnode.fnOptions;\r\n cloned.fnScopeId = vnode.fnScopeId;\r\n cloned.asyncMeta = vnode.asyncMeta;\r\n cloned.isCloned = true;\r\n return cloned;\r\n}\n\n/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\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\nvar uid$2 = 0;\r\n/**\r\n * A dep is an observable that can have multiple\r\n * directives subscribing to it.\r\n * @internal\r\n */\r\nvar Dep = /** @class */ (function () {\r\n function Dep() {\r\n this.id = uid$2++;\r\n this.subs = [];\r\n }\r\n Dep.prototype.addSub = function (sub) {\r\n this.subs.push(sub);\r\n };\r\n Dep.prototype.removeSub = function (sub) {\r\n remove$2(this.subs, sub);\r\n };\r\n Dep.prototype.depend = function (info) {\r\n if (Dep.target) {\r\n Dep.target.addDep(this);\r\n if (process.env.NODE_ENV !== 'production' && info && Dep.target.onTrack) {\r\n Dep.target.onTrack(__assign({ effect: Dep.target }, info));\r\n }\r\n }\r\n };\r\n Dep.prototype.notify = function (info) {\r\n // stabilize the subscriber list first\r\n var subs = this.subs.slice();\r\n if (process.env.NODE_ENV !== 'production' && !config.async) {\r\n // subs aren't sorted in scheduler if not running async\r\n // we need to sort them now to make sure they fire in correct\r\n // order\r\n subs.sort(function (a, b) { return a.id - b.id; });\r\n }\r\n for (var i = 0, l = subs.length; i < l; i++) {\r\n if (process.env.NODE_ENV !== 'production' && info) {\r\n var sub = subs[i];\r\n sub.onTrigger &&\r\n sub.onTrigger(__assign({ effect: subs[i] }, info));\r\n }\r\n subs[i].update();\r\n }\r\n };\r\n return Dep;\r\n}());\r\n// The current target watcher being evaluated.\r\n// This is globally unique because only one watcher\r\n// can be evaluated at a time.\r\nDep.target = null;\r\nvar targetStack = [];\r\nfunction pushTarget(target) {\r\n targetStack.push(target);\r\n Dep.target = target;\r\n}\r\nfunction popTarget() {\r\n targetStack.pop();\r\n Dep.target = targetStack[targetStack.length - 1];\r\n}\n\n/*\r\n * not type checking this file because flow doesn't play well with\r\n * dynamically accessing methods on Array prototype\r\n */\r\nvar arrayProto = Array.prototype;\r\nvar arrayMethods = Object.create(arrayProto);\r\nvar methodsToPatch = [\r\n 'push',\r\n 'pop',\r\n 'shift',\r\n 'unshift',\r\n 'splice',\r\n 'sort',\r\n 'reverse'\r\n];\r\n/**\r\n * Intercept mutating methods and emit events\r\n */\r\nmethodsToPatch.forEach(function (method) {\r\n // cache original method\r\n var original = arrayProto[method];\r\n def(arrayMethods, method, function mutator() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var result = original.apply(this, args);\r\n var ob = this.__ob__;\r\n var inserted;\r\n switch (method) {\r\n case 'push':\r\n case 'unshift':\r\n inserted = args;\r\n break;\r\n case 'splice':\r\n inserted = args.slice(2);\r\n break;\r\n }\r\n if (inserted)\r\n ob.observeArray(inserted);\r\n // notify change\r\n if (process.env.NODE_ENV !== 'production') {\r\n ob.dep.notify({\r\n type: \"array mutation\" /* TriggerOpTypes.ARRAY_MUTATION */,\r\n target: this,\r\n key: method\r\n });\r\n }\r\n else {\r\n ob.dep.notify();\r\n }\r\n return result;\r\n });\r\n});\n\nvar arrayKeys = Object.getOwnPropertyNames(arrayMethods);\r\nvar NO_INIITIAL_VALUE = {};\r\n/**\r\n * In some cases we may want to disable observation inside a component's\r\n * update computation.\r\n */\r\nvar shouldObserve = true;\r\nfunction toggleObserving(value) {\r\n shouldObserve = value;\r\n}\r\n// ssr mock dep\r\nvar mockDep = {\r\n notify: noop,\r\n depend: noop,\r\n addSub: noop,\r\n removeSub: noop\r\n};\r\n/**\r\n * Observer class that is attached to each observed\r\n * object. Once attached, the observer converts the target\r\n * object's property keys into getter/setters that\r\n * collect dependencies and dispatch updates.\r\n */\r\nvar Observer = /** @class */ (function () {\r\n function Observer(value, shallow, mock) {\r\n if (shallow === void 0) { shallow = false; }\r\n if (mock === void 0) { mock = false; }\r\n this.value = value;\r\n this.shallow = shallow;\r\n this.mock = mock;\r\n // this.value = value\r\n this.dep = mock ? mockDep : new Dep();\r\n this.vmCount = 0;\r\n def(value, '__ob__', this);\r\n if (isArray(value)) {\r\n if (!mock) {\r\n if (hasProto) {\r\n value.__proto__ = arrayMethods;\r\n /* eslint-enable no-proto */\r\n }\r\n else {\r\n for (var i = 0, l = arrayKeys.length; i < l; i++) {\r\n var key = arrayKeys[i];\r\n def(value, key, arrayMethods[key]);\r\n }\r\n }\r\n }\r\n if (!shallow) {\r\n this.observeArray(value);\r\n }\r\n }\r\n else {\r\n /**\r\n * Walk through all properties and convert them into\r\n * getter/setters. This method should only be called when\r\n * value type is Object.\r\n */\r\n var keys = Object.keys(value);\r\n for (var i = 0; i < keys.length; i++) {\r\n var key = keys[i];\r\n defineReactive(value, key, NO_INIITIAL_VALUE, undefined, shallow, mock);\r\n }\r\n }\r\n }\r\n /**\r\n * Observe a list of Array items.\r\n */\r\n Observer.prototype.observeArray = function (value) {\r\n for (var i = 0, l = value.length; i < l; i++) {\r\n observe(value[i], false, this.mock);\r\n }\r\n };\r\n return Observer;\r\n}());\r\n// helpers\r\n/**\r\n * Attempt to create an observer instance for a value,\r\n * returns the new observer if successfully observed,\r\n * or the existing observer if the value already has one.\r\n */\r\nfunction observe(value, shallow, ssrMockReactivity) {\r\n if (!isObject(value) || isRef(value) || value instanceof VNode) {\r\n return;\r\n }\r\n var ob;\r\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\r\n ob = value.__ob__;\r\n }\r\n else if (shouldObserve &&\r\n (ssrMockReactivity || !isServerRendering()) &&\r\n (isArray(value) || isPlainObject(value)) &&\r\n Object.isExtensible(value) &&\r\n !value.__v_skip /* ReactiveFlags.SKIP */) {\r\n ob = new Observer(value, shallow, ssrMockReactivity);\r\n }\r\n return ob;\r\n}\r\n/**\r\n * Define a reactive property on an Object.\r\n */\r\nfunction defineReactive(obj, key, val, customSetter, shallow, mock) {\r\n var dep = new Dep();\r\n var property = Object.getOwnPropertyDescriptor(obj, key);\r\n if (property && property.configurable === false) {\r\n return;\r\n }\r\n // cater for pre-defined getter/setters\r\n var getter = property && property.get;\r\n var setter = property && property.set;\r\n if ((!getter || setter) &&\r\n (val === NO_INIITIAL_VALUE || arguments.length === 2)) {\r\n val = obj[key];\r\n }\r\n var childOb = !shallow && observe(val, false, mock);\r\n Object.defineProperty(obj, key, {\r\n enumerable: true,\r\n configurable: true,\r\n get: function reactiveGetter() {\r\n var value = getter ? getter.call(obj) : val;\r\n if (Dep.target) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n dep.depend({\r\n target: obj,\r\n type: \"get\" /* TrackOpTypes.GET */,\r\n key: key\r\n });\r\n }\r\n else {\r\n dep.depend();\r\n }\r\n if (childOb) {\r\n childOb.dep.depend();\r\n if (isArray(value)) {\r\n dependArray(value);\r\n }\r\n }\r\n }\r\n return isRef(value) && !shallow ? value.value : value;\r\n },\r\n set: function reactiveSetter(newVal) {\r\n var value = getter ? getter.call(obj) : val;\r\n if (!hasChanged(value, newVal)) {\r\n return;\r\n }\r\n if (process.env.NODE_ENV !== 'production' && customSetter) {\r\n customSetter();\r\n }\r\n if (setter) {\r\n setter.call(obj, newVal);\r\n }\r\n else if (getter) {\r\n // #7981: for accessor properties without setter\r\n return;\r\n }\r\n else if (!shallow && isRef(value) && !isRef(newVal)) {\r\n value.value = newVal;\r\n return;\r\n }\r\n else {\r\n val = newVal;\r\n }\r\n childOb = !shallow && observe(newVal, false, mock);\r\n if (process.env.NODE_ENV !== 'production') {\r\n dep.notify({\r\n type: \"set\" /* TriggerOpTypes.SET */,\r\n target: obj,\r\n key: key,\r\n newValue: newVal,\r\n oldValue: value\r\n });\r\n }\r\n else {\r\n dep.notify();\r\n }\r\n }\r\n });\r\n return dep;\r\n}\r\nfunction set(target, key, val) {\r\n if (process.env.NODE_ENV !== 'production' && (isUndef(target) || isPrimitive(target))) {\r\n warn(\"Cannot set reactive property on undefined, null, or primitive value: \".concat(target));\r\n }\r\n if (isReadonly(target)) {\r\n process.env.NODE_ENV !== 'production' && warn(\"Set operation on key \\\"\".concat(key, \"\\\" failed: target is readonly.\"));\r\n return;\r\n }\r\n var ob = target.__ob__;\r\n if (isArray(target) && isValidArrayIndex(key)) {\r\n target.length = Math.max(target.length, key);\r\n target.splice(key, 1, val);\r\n // when mocking for SSR, array methods are not hijacked\r\n if (ob && !ob.shallow && ob.mock) {\r\n observe(val, false, true);\r\n }\r\n return val;\r\n }\r\n if (key in target && !(key in Object.prototype)) {\r\n target[key] = val;\r\n return val;\r\n }\r\n if (target._isVue || (ob && ob.vmCount)) {\r\n process.env.NODE_ENV !== 'production' &&\r\n warn('Avoid adding reactive properties to a Vue instance or its root $data ' +\r\n 'at runtime - declare it upfront in the data option.');\r\n return val;\r\n }\r\n if (!ob) {\r\n target[key] = val;\r\n return val;\r\n }\r\n defineReactive(ob.value, key, val, undefined, ob.shallow, ob.mock);\r\n if (process.env.NODE_ENV !== 'production') {\r\n ob.dep.notify({\r\n type: \"add\" /* TriggerOpTypes.ADD */,\r\n target: target,\r\n key: key,\r\n newValue: val,\r\n oldValue: undefined\r\n });\r\n }\r\n else {\r\n ob.dep.notify();\r\n }\r\n return val;\r\n}\r\nfunction del(target, key) {\r\n if (process.env.NODE_ENV !== 'production' && (isUndef(target) || isPrimitive(target))) {\r\n warn(\"Cannot delete reactive property on undefined, null, or primitive value: \".concat(target));\r\n }\r\n if (isArray(target) && isValidArrayIndex(key)) {\r\n target.splice(key, 1);\r\n return;\r\n }\r\n var ob = target.__ob__;\r\n if (target._isVue || (ob && ob.vmCount)) {\r\n process.env.NODE_ENV !== 'production' &&\r\n warn('Avoid deleting properties on a Vue instance or its root $data ' +\r\n '- just set it to null.');\r\n return;\r\n }\r\n if (isReadonly(target)) {\r\n process.env.NODE_ENV !== 'production' &&\r\n warn(\"Delete operation on key \\\"\".concat(key, \"\\\" failed: target is readonly.\"));\r\n return;\r\n }\r\n if (!hasOwn(target, key)) {\r\n return;\r\n }\r\n delete target[key];\r\n if (!ob) {\r\n return;\r\n }\r\n if (process.env.NODE_ENV !== 'production') {\r\n ob.dep.notify({\r\n type: \"delete\" /* TriggerOpTypes.DELETE */,\r\n target: target,\r\n key: key\r\n });\r\n }\r\n else {\r\n ob.dep.notify();\r\n }\r\n}\r\n/**\r\n * Collect dependencies on array elements when the array is touched, since\r\n * we cannot intercept array element access like property getters.\r\n */\r\nfunction dependArray(value) {\r\n for (var e = void 0, i = 0, l = value.length; i < l; i++) {\r\n e = value[i];\r\n if (e && e.__ob__) {\r\n e.__ob__.dep.depend();\r\n }\r\n if (isArray(e)) {\r\n dependArray(e);\r\n }\r\n }\r\n}\n\nfunction reactive(target) {\r\n makeReactive(target, false);\r\n return target;\r\n}\r\n/**\r\n * Return a shallowly-reactive copy of the original object, where only the root\r\n * level properties are reactive. It also does not auto-unwrap refs (even at the\r\n * root level).\r\n */\r\nfunction shallowReactive(target) {\r\n makeReactive(target, true);\r\n def(target, \"__v_isShallow\" /* ReactiveFlags.IS_SHALLOW */, true);\r\n return target;\r\n}\r\nfunction makeReactive(target, shallow) {\r\n // if trying to observe a readonly proxy, return the readonly version.\r\n if (!isReadonly(target)) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n if (isArray(target)) {\r\n warn(\"Avoid using Array as root value for \".concat(shallow ? \"shallowReactive()\" : \"reactive()\", \" as it cannot be tracked in watch() or watchEffect(). Use \").concat(shallow ? \"shallowRef()\" : \"ref()\", \" instead. This is a Vue-2-only limitation.\"));\r\n }\r\n var existingOb = target && target.__ob__;\r\n if (existingOb && existingOb.shallow !== shallow) {\r\n warn(\"Target is already a \".concat(existingOb.shallow ? \"\" : \"non-\", \"shallow reactive object, and cannot be converted to \").concat(shallow ? \"\" : \"non-\", \"shallow.\"));\r\n }\r\n }\r\n var ob = observe(target, shallow, isServerRendering() /* ssr mock reactivity */);\r\n if (process.env.NODE_ENV !== 'production' && !ob) {\r\n if (target == null || isPrimitive(target)) {\r\n warn(\"value cannot be made reactive: \".concat(String(target)));\r\n }\r\n if (isCollectionType(target)) {\r\n warn(\"Vue 2 does not support reactive collection types such as Map or Set.\");\r\n }\r\n }\r\n }\r\n}\r\nfunction isReactive(value) {\r\n if (isReadonly(value)) {\r\n return isReactive(value[\"__v_raw\" /* ReactiveFlags.RAW */]);\r\n }\r\n return !!(value && value.__ob__);\r\n}\r\nfunction isShallow(value) {\r\n return !!(value && value.__v_isShallow);\r\n}\r\nfunction isReadonly(value) {\r\n return !!(value && value.__v_isReadonly);\r\n}\r\nfunction isProxy(value) {\r\n return isReactive(value) || isReadonly(value);\r\n}\r\nfunction toRaw(observed) {\r\n var raw = observed && observed[\"__v_raw\" /* ReactiveFlags.RAW */];\r\n return raw ? toRaw(raw) : observed;\r\n}\r\nfunction markRaw(value) {\r\n def(value, \"__v_skip\" /* ReactiveFlags.SKIP */, true);\r\n return value;\r\n}\r\n/**\r\n * @internal\r\n */\r\nfunction isCollectionType(value) {\r\n var type = toRawType(value);\r\n return (type === 'Map' || type === 'WeakMap' || type === 'Set' || type === 'WeakSet');\r\n}\n\n/**\r\n * @internal\r\n */\r\nvar RefFlag = \"__v_isRef\";\r\nfunction isRef(r) {\r\n return !!(r && r.__v_isRef === true);\r\n}\r\nfunction ref$1(value) {\r\n return createRef(value, false);\r\n}\r\nfunction shallowRef(value) {\r\n return createRef(value, true);\r\n}\r\nfunction createRef(rawValue, shallow) {\r\n if (isRef(rawValue)) {\r\n return rawValue;\r\n }\r\n var ref = {};\r\n def(ref, RefFlag, true);\r\n def(ref, \"__v_isShallow\" /* ReactiveFlags.IS_SHALLOW */, shallow);\r\n def(ref, 'dep', defineReactive(ref, 'value', rawValue, null, shallow, isServerRendering()));\r\n return ref;\r\n}\r\nfunction triggerRef(ref) {\r\n if (process.env.NODE_ENV !== 'production' && !ref.dep) {\r\n warn(\"received object is not a triggerable ref.\");\r\n }\r\n if (process.env.NODE_ENV !== 'production') {\r\n ref.dep &&\r\n ref.dep.notify({\r\n type: \"set\" /* TriggerOpTypes.SET */,\r\n target: ref,\r\n key: 'value'\r\n });\r\n }\r\n else {\r\n ref.dep && ref.dep.notify();\r\n }\r\n}\r\nfunction unref(ref) {\r\n return isRef(ref) ? ref.value : ref;\r\n}\r\nfunction proxyRefs(objectWithRefs) {\r\n if (isReactive(objectWithRefs)) {\r\n return objectWithRefs;\r\n }\r\n var proxy = {};\r\n var keys = Object.keys(objectWithRefs);\r\n for (var i = 0; i < keys.length; i++) {\r\n proxyWithRefUnwrap(proxy, objectWithRefs, keys[i]);\r\n }\r\n return proxy;\r\n}\r\nfunction proxyWithRefUnwrap(target, source, key) {\r\n Object.defineProperty(target, key, {\r\n enumerable: true,\r\n configurable: true,\r\n get: function () {\r\n var val = source[key];\r\n if (isRef(val)) {\r\n return val.value;\r\n }\r\n else {\r\n var ob = val && val.__ob__;\r\n if (ob)\r\n ob.dep.depend();\r\n return val;\r\n }\r\n },\r\n set: function (value) {\r\n var oldValue = source[key];\r\n if (isRef(oldValue) && !isRef(value)) {\r\n oldValue.value = value;\r\n }\r\n else {\r\n source[key] = value;\r\n }\r\n }\r\n });\r\n}\r\nfunction customRef(factory) {\r\n var dep = new Dep();\r\n var _a = factory(function () {\r\n if (process.env.NODE_ENV !== 'production') {\r\n dep.depend({\r\n target: ref,\r\n type: \"get\" /* TrackOpTypes.GET */,\r\n key: 'value'\r\n });\r\n }\r\n else {\r\n dep.depend();\r\n }\r\n }, function () {\r\n if (process.env.NODE_ENV !== 'production') {\r\n dep.notify({\r\n target: ref,\r\n type: \"set\" /* TriggerOpTypes.SET */,\r\n key: 'value'\r\n });\r\n }\r\n else {\r\n dep.notify();\r\n }\r\n }), get = _a.get, set = _a.set;\r\n var ref = {\r\n get value() {\r\n return get();\r\n },\r\n set value(newVal) {\r\n set(newVal);\r\n }\r\n };\r\n def(ref, RefFlag, true);\r\n return ref;\r\n}\r\nfunction toRefs(object) {\r\n if (process.env.NODE_ENV !== 'production' && !isReactive(object)) {\r\n warn(\"toRefs() expects a reactive object but received a plain one.\");\r\n }\r\n var ret = isArray(object) ? new Array(object.length) : {};\r\n for (var key in object) {\r\n ret[key] = toRef(object, key);\r\n }\r\n return ret;\r\n}\r\nfunction toRef(object, key, defaultValue) {\r\n var val = object[key];\r\n if (isRef(val)) {\r\n return val;\r\n }\r\n var ref = {\r\n get value() {\r\n var val = object[key];\r\n return val === undefined ? defaultValue : val;\r\n },\r\n set value(newVal) {\r\n object[key] = newVal;\r\n }\r\n };\r\n def(ref, RefFlag, true);\r\n return ref;\r\n}\n\nvar rawToReadonlyFlag = \"__v_rawToReadonly\";\r\nvar rawToShallowReadonlyFlag = \"__v_rawToShallowReadonly\";\r\nfunction readonly(target) {\r\n return createReadonly(target, false);\r\n}\r\nfunction createReadonly(target, shallow) {\r\n if (!isPlainObject(target)) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n if (isArray(target)) {\r\n warn(\"Vue 2 does not support readonly arrays.\");\r\n }\r\n else if (isCollectionType(target)) {\r\n warn(\"Vue 2 does not support readonly collection types such as Map or Set.\");\r\n }\r\n else {\r\n warn(\"value cannot be made readonly: \".concat(typeof target));\r\n }\r\n }\r\n return target;\r\n }\r\n // already a readonly object\r\n if (isReadonly(target)) {\r\n return target;\r\n }\r\n // already has a readonly proxy\r\n var existingFlag = shallow ? rawToShallowReadonlyFlag : rawToReadonlyFlag;\r\n var existingProxy = target[existingFlag];\r\n if (existingProxy) {\r\n return existingProxy;\r\n }\r\n var proxy = Object.create(Object.getPrototypeOf(target));\r\n def(target, existingFlag, proxy);\r\n def(proxy, \"__v_isReadonly\" /* ReactiveFlags.IS_READONLY */, true);\r\n def(proxy, \"__v_raw\" /* ReactiveFlags.RAW */, target);\r\n if (isRef(target)) {\r\n def(proxy, RefFlag, true);\r\n }\r\n if (shallow || isShallow(target)) {\r\n def(proxy, \"__v_isShallow\" /* ReactiveFlags.IS_SHALLOW */, true);\r\n }\r\n var keys = Object.keys(target);\r\n for (var i = 0; i < keys.length; i++) {\r\n defineReadonlyProperty(proxy, target, keys[i], shallow);\r\n }\r\n return proxy;\r\n}\r\nfunction defineReadonlyProperty(proxy, target, key, shallow) {\r\n Object.defineProperty(proxy, key, {\r\n enumerable: true,\r\n configurable: true,\r\n get: function () {\r\n var val = target[key];\r\n return shallow || !isPlainObject(val) ? val : readonly(val);\r\n },\r\n set: function () {\r\n process.env.NODE_ENV !== 'production' &&\r\n warn(\"Set operation on key \\\"\".concat(key, \"\\\" failed: target is readonly.\"));\r\n }\r\n });\r\n}\r\n/**\r\n * Returns a reactive-copy of the original object, where only the root level\r\n * properties are readonly, and does NOT unwrap refs nor recursively convert\r\n * returned properties.\r\n * This is used for creating the props proxy object for stateful components.\r\n */\r\nfunction shallowReadonly(target) {\r\n return createReadonly(target, true);\r\n}\n\nfunction computed(getterOrOptions, debugOptions) {\r\n var getter;\r\n var setter;\r\n var onlyGetter = isFunction(getterOrOptions);\r\n if (onlyGetter) {\r\n getter = getterOrOptions;\r\n setter = process.env.NODE_ENV !== 'production'\r\n ? function () {\r\n warn('Write operation failed: computed value is readonly');\r\n }\r\n : noop;\r\n }\r\n else {\r\n getter = getterOrOptions.get;\r\n setter = getterOrOptions.set;\r\n }\r\n var watcher = isServerRendering()\r\n ? null\r\n : new Watcher(currentInstance, getter, noop, { lazy: true });\r\n if (process.env.NODE_ENV !== 'production' && watcher && debugOptions) {\r\n watcher.onTrack = debugOptions.onTrack;\r\n watcher.onTrigger = debugOptions.onTrigger;\r\n }\r\n var ref = {\r\n // some libs rely on the presence effect for checking computed refs\r\n // from normal refs, but the implementation doesn't matter\r\n effect: watcher,\r\n get value() {\r\n if (watcher) {\r\n if (watcher.dirty) {\r\n watcher.evaluate();\r\n }\r\n if (Dep.target) {\r\n if (process.env.NODE_ENV !== 'production' && Dep.target.onTrack) {\r\n Dep.target.onTrack({\r\n effect: Dep.target,\r\n target: ref,\r\n type: \"get\" /* TrackOpTypes.GET */,\r\n key: 'value'\r\n });\r\n }\r\n watcher.depend();\r\n }\r\n return watcher.value;\r\n }\r\n else {\r\n return getter();\r\n }\r\n },\r\n set value(newVal) {\r\n setter(newVal);\r\n }\r\n };\r\n def(ref, RefFlag, true);\r\n def(ref, \"__v_isReadonly\" /* ReactiveFlags.IS_READONLY */, onlyGetter);\r\n return ref;\r\n}\n\nvar WATCHER = \"watcher\";\r\nvar WATCHER_CB = \"\".concat(WATCHER, \" callback\");\r\nvar WATCHER_GETTER = \"\".concat(WATCHER, \" getter\");\r\nvar WATCHER_CLEANUP = \"\".concat(WATCHER, \" cleanup\");\r\n// Simple effect.\r\nfunction watchEffect(effect, options) {\r\n return doWatch(effect, null, options);\r\n}\r\nfunction watchPostEffect(effect, options) {\r\n return doWatch(effect, null, (process.env.NODE_ENV !== 'production'\r\n ? __assign(__assign({}, options), { flush: 'post' }) : { flush: 'post' }));\r\n}\r\nfunction watchSyncEffect(effect, options) {\r\n return doWatch(effect, null, (process.env.NODE_ENV !== 'production'\r\n ? __assign(__assign({}, options), { flush: 'sync' }) : { flush: 'sync' }));\r\n}\r\n// initial value for watchers to trigger on undefined initial values\r\nvar INITIAL_WATCHER_VALUE = {};\r\n// implementation\r\nfunction watch(source, cb, options) {\r\n if (process.env.NODE_ENV !== 'production' && typeof cb !== 'function') {\r\n warn(\"`watch(fn, options?)` signature has been moved to a separate API. \" +\r\n \"Use `watchEffect(fn, options?)` instead. `watch` now only \" +\r\n \"supports `watch(source, cb, options?) signature.\");\r\n }\r\n return doWatch(source, cb, options);\r\n}\r\nfunction doWatch(source, cb, _a) {\r\n var _b = _a === void 0 ? emptyObject : _a, immediate = _b.immediate, deep = _b.deep, _c = _b.flush, flush = _c === void 0 ? 'pre' : _c, onTrack = _b.onTrack, onTrigger = _b.onTrigger;\r\n if (process.env.NODE_ENV !== 'production' && !cb) {\r\n if (immediate !== undefined) {\r\n warn(\"watch() \\\"immediate\\\" option is only respected when using the \" +\r\n \"watch(source, callback, options?) signature.\");\r\n }\r\n if (deep !== undefined) {\r\n warn(\"watch() \\\"deep\\\" option is only respected when using the \" +\r\n \"watch(source, callback, options?) signature.\");\r\n }\r\n }\r\n var warnInvalidSource = function (s) {\r\n warn(\"Invalid watch source: \".concat(s, \". A watch source can only be a getter/effect \") +\r\n \"function, a ref, a reactive object, or an array of these types.\");\r\n };\r\n var instance = currentInstance;\r\n var call = function (fn, type, args) {\r\n if (args === void 0) { args = null; }\r\n return invokeWithErrorHandling(fn, null, args, instance, type);\r\n };\r\n var getter;\r\n var forceTrigger = false;\r\n var isMultiSource = false;\r\n if (isRef(source)) {\r\n getter = function () { return source.value; };\r\n forceTrigger = isShallow(source);\r\n }\r\n else if (isReactive(source)) {\r\n getter = function () {\r\n source.__ob__.dep.depend();\r\n return source;\r\n };\r\n deep = true;\r\n }\r\n else if (isArray(source)) {\r\n isMultiSource = true;\r\n forceTrigger = source.some(function (s) { return isReactive(s) || isShallow(s); });\r\n getter = function () {\r\n return source.map(function (s) {\r\n if (isRef(s)) {\r\n return s.value;\r\n }\r\n else if (isReactive(s)) {\r\n return traverse(s);\r\n }\r\n else if (isFunction(s)) {\r\n return call(s, WATCHER_GETTER);\r\n }\r\n else {\r\n process.env.NODE_ENV !== 'production' && warnInvalidSource(s);\r\n }\r\n });\r\n };\r\n }\r\n else if (isFunction(source)) {\r\n if (cb) {\r\n // getter with cb\r\n getter = function () { return call(source, WATCHER_GETTER); };\r\n }\r\n else {\r\n // no cb -> simple effect\r\n getter = function () {\r\n if (instance && instance._isDestroyed) {\r\n return;\r\n }\r\n if (cleanup) {\r\n cleanup();\r\n }\r\n return call(source, WATCHER, [onCleanup]);\r\n };\r\n }\r\n }\r\n else {\r\n getter = noop;\r\n process.env.NODE_ENV !== 'production' && warnInvalidSource(source);\r\n }\r\n if (cb && deep) {\r\n var baseGetter_1 = getter;\r\n getter = function () { return traverse(baseGetter_1()); };\r\n }\r\n var cleanup;\r\n var onCleanup = function (fn) {\r\n cleanup = watcher.onStop = function () {\r\n call(fn, WATCHER_CLEANUP);\r\n };\r\n };\r\n // in SSR there is no need to setup an actual effect, and it should be noop\r\n // unless it's eager\r\n if (isServerRendering()) {\r\n // we will also not call the invalidate callback (+ runner is not set up)\r\n onCleanup = noop;\r\n if (!cb) {\r\n getter();\r\n }\r\n else if (immediate) {\r\n call(cb, WATCHER_CB, [\r\n getter(),\r\n isMultiSource ? [] : undefined,\r\n onCleanup\r\n ]);\r\n }\r\n return noop;\r\n }\r\n var watcher = new Watcher(currentInstance, getter, noop, {\r\n lazy: true\r\n });\r\n watcher.noRecurse = !cb;\r\n var oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE;\r\n // overwrite default run\r\n watcher.run = function () {\r\n if (!watcher.active) {\r\n return;\r\n }\r\n if (cb) {\r\n // watch(source, cb)\r\n var newValue = watcher.get();\r\n if (deep ||\r\n forceTrigger ||\r\n (isMultiSource\r\n ? newValue.some(function (v, i) {\r\n return hasChanged(v, oldValue[i]);\r\n })\r\n : hasChanged(newValue, oldValue))) {\r\n // cleanup before running cb again\r\n if (cleanup) {\r\n cleanup();\r\n }\r\n call(cb, WATCHER_CB, [\r\n newValue,\r\n // pass undefined as the old value when it's changed for the first time\r\n oldValue === INITIAL_WATCHER_VALUE ? undefined : oldValue,\r\n onCleanup\r\n ]);\r\n oldValue = newValue;\r\n }\r\n }\r\n else {\r\n // watchEffect\r\n watcher.get();\r\n }\r\n };\r\n if (flush === 'sync') {\r\n watcher.update = watcher.run;\r\n }\r\n else if (flush === 'post') {\r\n watcher.post = true;\r\n watcher.update = function () { return queueWatcher(watcher); };\r\n }\r\n else {\r\n // pre\r\n watcher.update = function () {\r\n if (instance && instance === currentInstance && !instance._isMounted) {\r\n // pre-watcher triggered before\r\n var buffer = instance._preWatchers || (instance._preWatchers = []);\r\n if (buffer.indexOf(watcher) < 0)\r\n buffer.push(watcher);\r\n }\r\n else {\r\n queueWatcher(watcher);\r\n }\r\n };\r\n }\r\n if (process.env.NODE_ENV !== 'production') {\r\n watcher.onTrack = onTrack;\r\n watcher.onTrigger = onTrigger;\r\n }\r\n // initial run\r\n if (cb) {\r\n if (immediate) {\r\n watcher.run();\r\n }\r\n else {\r\n oldValue = watcher.get();\r\n }\r\n }\r\n else if (flush === 'post' && instance) {\r\n instance.$once('hook:mounted', function () { return watcher.get(); });\r\n }\r\n else {\r\n watcher.get();\r\n }\r\n return function () {\r\n watcher.teardown();\r\n };\r\n}\n\nvar activeEffectScope;\r\nvar EffectScope = /** @class */ (function () {\r\n function EffectScope(detached) {\r\n if (detached === void 0) { detached = false; }\r\n /**\r\n * @internal\r\n */\r\n this.active = true;\r\n /**\r\n * @internal\r\n */\r\n this.effects = [];\r\n /**\r\n * @internal\r\n */\r\n this.cleanups = [];\r\n if (!detached && activeEffectScope) {\r\n this.parent = activeEffectScope;\r\n this.index =\r\n (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1;\r\n }\r\n }\r\n EffectScope.prototype.run = function (fn) {\r\n if (this.active) {\r\n var currentEffectScope = activeEffectScope;\r\n try {\r\n activeEffectScope = this;\r\n return fn();\r\n }\r\n finally {\r\n activeEffectScope = currentEffectScope;\r\n }\r\n }\r\n else if (process.env.NODE_ENV !== 'production') {\r\n warn(\"cannot run an inactive effect scope.\");\r\n }\r\n };\r\n /**\r\n * This should only be called on non-detached scopes\r\n * @internal\r\n */\r\n EffectScope.prototype.on = function () {\r\n activeEffectScope = this;\r\n };\r\n /**\r\n * This should only be called on non-detached scopes\r\n * @internal\r\n */\r\n EffectScope.prototype.off = function () {\r\n activeEffectScope = this.parent;\r\n };\r\n EffectScope.prototype.stop = function (fromParent) {\r\n if (this.active) {\r\n var i = void 0, l = void 0;\r\n for (i = 0, l = this.effects.length; i < l; i++) {\r\n this.effects[i].teardown();\r\n }\r\n for (i = 0, l = this.cleanups.length; i < l; i++) {\r\n this.cleanups[i]();\r\n }\r\n if (this.scopes) {\r\n for (i = 0, l = this.scopes.length; i < l; i++) {\r\n this.scopes[i].stop(true);\r\n }\r\n }\r\n // nested scope, dereference from parent to avoid memory leaks\r\n if (this.parent && !fromParent) {\r\n // optimized O(1) removal\r\n var last = this.parent.scopes.pop();\r\n if (last && last !== this) {\r\n this.parent.scopes[this.index] = last;\r\n last.index = this.index;\r\n }\r\n }\r\n this.active = false;\r\n }\r\n };\r\n return EffectScope;\r\n}());\r\nfunction effectScope(detached) {\r\n return new EffectScope(detached);\r\n}\r\n/**\r\n * @internal\r\n */\r\nfunction recordEffectScope(effect, scope) {\r\n if (scope === void 0) { scope = activeEffectScope; }\r\n if (scope && scope.active) {\r\n scope.effects.push(effect);\r\n }\r\n}\r\nfunction getCurrentScope() {\r\n return activeEffectScope;\r\n}\r\nfunction onScopeDispose(fn) {\r\n if (activeEffectScope) {\r\n activeEffectScope.cleanups.push(fn);\r\n }\r\n else if (process.env.NODE_ENV !== 'production') {\r\n warn(\"onScopeDispose() is called when there is no active effect scope\" +\r\n \" to be associated with.\");\r\n }\r\n}\n\nfunction provide(key, value) {\r\n if (!currentInstance) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n warn(\"provide() can only be used inside setup().\");\r\n }\r\n }\r\n else {\r\n // TS doesn't allow symbol as index type\r\n resolveProvided(currentInstance)[key] = value;\r\n }\r\n}\r\nfunction resolveProvided(vm) {\r\n // by default an instance inherits its parent's provides object\r\n // but when it needs to provide values of its own, it creates its\r\n // own provides object using parent provides object as prototype.\r\n // this way in `inject` we can simply look up injections from direct\r\n // parent and let the prototype chain do the work.\r\n var existing = vm._provided;\r\n var parentProvides = vm.$parent && vm.$parent._provided;\r\n if (parentProvides === existing) {\r\n return (vm._provided = Object.create(parentProvides));\r\n }\r\n else {\r\n return existing;\r\n }\r\n}\r\nfunction inject(key, defaultValue, treatDefaultAsFactory) {\r\n if (treatDefaultAsFactory === void 0) { treatDefaultAsFactory = false; }\r\n // fallback to `currentRenderingInstance` so that this can be called in\r\n // a functional component\r\n var instance = currentInstance;\r\n if (instance) {\r\n // #2400\r\n // to support `app.use` plugins,\r\n // fallback to appContext's `provides` if the instance is at root\r\n var provides = instance.$parent && instance.$parent._provided;\r\n if (provides && key in provides) {\r\n // TS doesn't allow symbol as index type\r\n return provides[key];\r\n }\r\n else if (arguments.length > 1) {\r\n return treatDefaultAsFactory && isFunction(defaultValue)\r\n ? defaultValue.call(instance)\r\n : defaultValue;\r\n }\r\n else if (process.env.NODE_ENV !== 'production') {\r\n warn(\"injection \\\"\".concat(String(key), \"\\\" not found.\"));\r\n }\r\n }\r\n else if (process.env.NODE_ENV !== 'production') {\r\n warn(\"inject() can only be used inside setup() or functional components.\");\r\n }\r\n}\n\nvar normalizeEvent = cached(function (name) {\r\n var passive = name.charAt(0) === '&';\r\n name = passive ? name.slice(1) : name;\r\n var once = name.charAt(0) === '~'; // Prefixed last, checked first\r\n name = once ? name.slice(1) : name;\r\n var capture = name.charAt(0) === '!';\r\n name = capture ? name.slice(1) : name;\r\n return {\r\n name: name,\r\n once: once,\r\n capture: capture,\r\n passive: passive\r\n };\r\n});\r\nfunction createFnInvoker(fns, vm) {\r\n function invoker() {\r\n var fns = invoker.fns;\r\n if (isArray(fns)) {\r\n var cloned = fns.slice();\r\n for (var i = 0; i < cloned.length; i++) {\r\n invokeWithErrorHandling(cloned[i], null, arguments, vm, \"v-on handler\");\r\n }\r\n }\r\n else {\r\n // return handler return value for single handlers\r\n return invokeWithErrorHandling(fns, null, arguments, vm, \"v-on handler\");\r\n }\r\n }\r\n invoker.fns = fns;\r\n return invoker;\r\n}\r\nfunction updateListeners(on, oldOn, add, remove, createOnceHandler, vm) {\r\n var name, cur, old, event;\r\n for (name in on) {\r\n cur = on[name];\r\n old = oldOn[name];\r\n event = normalizeEvent(name);\r\n if (isUndef(cur)) {\r\n process.env.NODE_ENV !== 'production' &&\r\n warn(\"Invalid handler for event \\\"\".concat(event.name, \"\\\": got \") + String(cur), vm);\r\n }\r\n else if (isUndef(old)) {\r\n if (isUndef(cur.fns)) {\r\n cur = on[name] = createFnInvoker(cur, vm);\r\n }\r\n if (isTrue(event.once)) {\r\n cur = on[name] = createOnceHandler(event.name, cur, event.capture);\r\n }\r\n add(event.name, cur, event.capture, event.passive, event.params);\r\n }\r\n else if (cur !== old) {\r\n old.fns = cur;\r\n on[name] = old;\r\n }\r\n }\r\n for (name in oldOn) {\r\n if (isUndef(on[name])) {\r\n event = normalizeEvent(name);\r\n remove(event.name, oldOn[name], event.capture);\r\n }\r\n }\r\n}\n\nfunction mergeVNodeHook(def, hookKey, hook) {\r\n if (def instanceof VNode) {\r\n def = def.data.hook || (def.data.hook = {});\r\n }\r\n var invoker;\r\n var oldHook = def[hookKey];\r\n function wrappedHook() {\r\n hook.apply(this, arguments);\r\n // important: remove merged hook to ensure it's called only once\r\n // and prevent memory leak\r\n remove$2(invoker.fns, wrappedHook);\r\n }\r\n if (isUndef(oldHook)) {\r\n // no existing hook\r\n invoker = createFnInvoker([wrappedHook]);\r\n }\r\n else {\r\n /* istanbul ignore if */\r\n if (isDef(oldHook.fns) && isTrue(oldHook.merged)) {\r\n // already a merged invoker\r\n invoker = oldHook;\r\n invoker.fns.push(wrappedHook);\r\n }\r\n else {\r\n // existing plain hook\r\n invoker = createFnInvoker([oldHook, wrappedHook]);\r\n }\r\n }\r\n invoker.merged = true;\r\n def[hookKey] = invoker;\r\n}\n\nfunction extractPropsFromVNodeData(data, Ctor, tag) {\r\n // we are only extracting raw values here.\r\n // validation and default values are handled in the child\r\n // component itself.\r\n var propOptions = Ctor.options.props;\r\n if (isUndef(propOptions)) {\r\n return;\r\n }\r\n var res = {};\r\n var attrs = data.attrs, props = data.props;\r\n if (isDef(attrs) || isDef(props)) {\r\n for (var key in propOptions) {\r\n var altKey = hyphenate(key);\r\n if (process.env.NODE_ENV !== 'production') {\r\n var keyInLowerCase = key.toLowerCase();\r\n if (key !== keyInLowerCase && attrs && hasOwn(attrs, keyInLowerCase)) {\r\n tip(\"Prop \\\"\".concat(keyInLowerCase, \"\\\" is passed to component \") +\r\n \"\".concat(formatComponentName(\r\n // @ts-expect-error tag is string\r\n tag || Ctor), \", but the declared prop name is\") +\r\n \" \\\"\".concat(key, \"\\\". \") +\r\n \"Note that HTML attributes are case-insensitive and camelCased \" +\r\n \"props need to use their kebab-case equivalents when using in-DOM \" +\r\n \"templates. You should probably use \\\"\".concat(altKey, \"\\\" instead of \\\"\").concat(key, \"\\\".\"));\r\n }\r\n }\r\n checkProp(res, props, key, altKey, true) ||\r\n checkProp(res, attrs, key, altKey, false);\r\n }\r\n }\r\n return res;\r\n}\r\nfunction checkProp(res, hash, key, altKey, preserve) {\r\n if (isDef(hash)) {\r\n if (hasOwn(hash, key)) {\r\n res[key] = hash[key];\r\n if (!preserve) {\r\n delete hash[key];\r\n }\r\n return true;\r\n }\r\n else if (hasOwn(hash, altKey)) {\r\n res[key] = hash[altKey];\r\n if (!preserve) {\r\n delete hash[altKey];\r\n }\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\n\n// The template compiler attempts to minimize the need for normalization by\r\n// statically analyzing the template at compile time.\r\n//\r\n// For plain HTML markup, normalization can be completely skipped because the\r\n// generated render function is guaranteed to return Array<VNode>. There are\r\n// two cases where extra normalization is needed:\r\n// 1. When the children contains components - because a functional component\r\n// may return an Array instead of a single root. In this case, just a simple\r\n// normalization is needed - if any child is an Array, we flatten the whole\r\n// thing with Array.prototype.concat. It is guaranteed to be only 1-level deep\r\n// because functional components already normalize their own children.\r\nfunction simpleNormalizeChildren(children) {\r\n for (var i = 0; i < children.length; i++) {\r\n if (isArray(children[i])) {\r\n return Array.prototype.concat.apply([], children);\r\n }\r\n }\r\n return children;\r\n}\r\n// 2. When the children contains constructs that always generated nested Arrays,\r\n// e.g. <template>, <slot>, v-for, or when the children is provided by user\r\n// with hand-written render functions / JSX. In such cases a full normalization\r\n// is needed to cater to all possible types of children values.\r\nfunction normalizeChildren(children) {\r\n return isPrimitive(children)\r\n ? [createTextVNode(children)]\r\n : isArray(children)\r\n ? normalizeArrayChildren(children)\r\n : undefined;\r\n}\r\nfunction isTextNode(node) {\r\n return isDef(node) && isDef(node.text) && isFalse(node.isComment);\r\n}\r\nfunction normalizeArrayChildren(children, nestedIndex) {\r\n var res = [];\r\n var i, c, lastIndex, last;\r\n for (i = 0; i < children.length; i++) {\r\n c = children[i];\r\n if (isUndef(c) || typeof c === 'boolean')\r\n continue;\r\n lastIndex = res.length - 1;\r\n last = res[lastIndex];\r\n // nested\r\n if (isArray(c)) {\r\n if (c.length > 0) {\r\n c = normalizeArrayChildren(c, \"\".concat(nestedIndex || '', \"_\").concat(i));\r\n // merge adjacent text nodes\r\n if (isTextNode(c[0]) && isTextNode(last)) {\r\n res[lastIndex] = createTextVNode(last.text + c[0].text);\r\n c.shift();\r\n }\r\n res.push.apply(res, c);\r\n }\r\n }\r\n else if (isPrimitive(c)) {\r\n if (isTextNode(last)) {\r\n // merge adjacent text nodes\r\n // this is necessary for SSR hydration because text nodes are\r\n // essentially merged when rendered to HTML strings\r\n res[lastIndex] = createTextVNode(last.text + c);\r\n }\r\n else if (c !== '') {\r\n // convert primitive to vnode\r\n res.push(createTextVNode(c));\r\n }\r\n }\r\n else {\r\n if (isTextNode(c) && isTextNode(last)) {\r\n // merge adjacent text nodes\r\n res[lastIndex] = createTextVNode(last.text + c.text);\r\n }\r\n else {\r\n // default key for nested array children (likely generated by v-for)\r\n if (isTrue(children._isVList) &&\r\n isDef(c.tag) &&\r\n isUndef(c.key) &&\r\n isDef(nestedIndex)) {\r\n c.key = \"__vlist\".concat(nestedIndex, \"_\").concat(i, \"__\");\r\n }\r\n res.push(c);\r\n }\r\n }\r\n }\r\n return res;\r\n}\n\n/**\r\n * Runtime helper for rendering v-for lists.\r\n */\r\nfunction renderList(val, render) {\r\n var ret = null, i, l, keys, key;\r\n if (isArray(val) || typeof val === 'string') {\r\n ret = new Array(val.length);\r\n for (i = 0, l = val.length; i < l; i++) {\r\n ret[i] = render(val[i], i);\r\n }\r\n }\r\n else if (typeof val === 'number') {\r\n ret = new Array(val);\r\n for (i = 0; i < val; i++) {\r\n ret[i] = render(i + 1, i);\r\n }\r\n }\r\n else if (isObject(val)) {\r\n if (hasSymbol && val[Symbol.iterator]) {\r\n ret = [];\r\n var iterator = val[Symbol.iterator]();\r\n var result = iterator.next();\r\n while (!result.done) {\r\n ret.push(render(result.value, ret.length));\r\n result = iterator.next();\r\n }\r\n }\r\n else {\r\n keys = Object.keys(val);\r\n ret = new Array(keys.length);\r\n for (i = 0, l = keys.length; i < l; i++) {\r\n key = keys[i];\r\n ret[i] = render(val[key], key, i);\r\n }\r\n }\r\n }\r\n if (!isDef(ret)) {\r\n ret = [];\r\n }\r\n ret._isVList = true;\r\n return ret;\r\n}\n\n/**\r\n * Runtime helper for rendering <slot>\r\n */\r\nfunction renderSlot(name, fallbackRender, props, bindObject) {\r\n var scopedSlotFn = this.$scopedSlots[name];\r\n var nodes;\r\n if (scopedSlotFn) {\r\n // scoped slot\r\n props = props || {};\r\n if (bindObject) {\r\n if (process.env.NODE_ENV !== 'production' && !isObject(bindObject)) {\r\n warn('slot v-bind without argument expects an Object', this);\r\n }\r\n props = extend(extend({}, bindObject), props);\r\n }\r\n nodes =\r\n scopedSlotFn(props) ||\r\n (isFunction(fallbackRender) ? fallbackRender() : fallbackRender);\r\n }\r\n else {\r\n nodes =\r\n this.$slots[name] ||\r\n (isFunction(fallbackRender) ? fallbackRender() : fallbackRender);\r\n }\r\n var target = props && props.slot;\r\n if (target) {\r\n return this.$createElement('template', { slot: target }, nodes);\r\n }\r\n else {\r\n return nodes;\r\n }\r\n}\n\n/**\r\n * Runtime helper for resolving filters\r\n */\r\nfunction resolveFilter(id) {\r\n return resolveAsset(this.$options, 'filters', id, true) || identity;\r\n}\n\nfunction isKeyNotMatch(expect, actual) {\r\n if (isArray(expect)) {\r\n return expect.indexOf(actual) === -1;\r\n }\r\n else {\r\n return expect !== actual;\r\n }\r\n}\r\n/**\r\n * Runtime helper for checking keyCodes from config.\r\n * exposed as Vue.prototype._k\r\n * passing in eventKeyName as last argument separately for backwards compat\r\n */\r\nfunction checkKeyCodes(eventKeyCode, key, builtInKeyCode, eventKeyName, builtInKeyName) {\r\n var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;\r\n if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {\r\n return isKeyNotMatch(builtInKeyName, eventKeyName);\r\n }\r\n else if (mappedKeyCode) {\r\n return isKeyNotMatch(mappedKeyCode, eventKeyCode);\r\n }\r\n else if (eventKeyName) {\r\n return hyphenate(eventKeyName) !== key;\r\n }\r\n return eventKeyCode === undefined;\r\n}\n\n/**\r\n * Runtime helper for merging v-bind=\"object\" into a VNode's data.\r\n */\r\nfunction bindObjectProps(data, tag, value, asProp, isSync) {\r\n if (value) {\r\n if (!isObject(value)) {\r\n process.env.NODE_ENV !== 'production' &&\r\n warn('v-bind without argument expects an Object or Array value', this);\r\n }\r\n else {\r\n if (isArray(value)) {\r\n value = toObject(value);\r\n }\r\n var hash = void 0;\r\n var _loop_1 = function (key) {\r\n if (key === 'class' || key === 'style' || isReservedAttribute(key)) {\r\n hash = data;\r\n }\r\n else {\r\n var type = data.attrs && data.attrs.type;\r\n hash =\r\n asProp || config.mustUseProp(tag, type, key)\r\n ? data.domProps || (data.domProps = {})\r\n : data.attrs || (data.attrs = {});\r\n }\r\n var camelizedKey = camelize(key);\r\n var hyphenatedKey = hyphenate(key);\r\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\r\n hash[key] = value[key];\r\n if (isSync) {\r\n var on = data.on || (data.on = {});\r\n on[\"update:\".concat(key)] = function ($event) {\r\n value[key] = $event;\r\n };\r\n }\r\n }\r\n };\r\n for (var key in value) {\r\n _loop_1(key);\r\n }\r\n }\r\n }\r\n return data;\r\n}\n\n/**\r\n * Runtime helper for rendering static trees.\r\n */\r\nfunction renderStatic(index, isInFor) {\r\n var cached = this._staticTrees || (this._staticTrees = []);\r\n var tree = cached[index];\r\n // if has already-rendered static tree and not inside v-for,\r\n // we can reuse the same tree.\r\n if (tree && !isInFor) {\r\n return tree;\r\n }\r\n // otherwise, render a fresh tree.\r\n tree = cached[index] = this.$options.staticRenderFns[index].call(this._renderProxy, this._c, this // for render fns generated for functional component templates\r\n );\r\n markStatic(tree, \"__static__\".concat(index), false);\r\n return tree;\r\n}\r\n/**\r\n * Runtime helper for v-once.\r\n * Effectively it means marking the node as static with a unique key.\r\n */\r\nfunction markOnce(tree, index, key) {\r\n markStatic(tree, \"__once__\".concat(index).concat(key ? \"_\".concat(key) : \"\"), true);\r\n return tree;\r\n}\r\nfunction markStatic(tree, key, isOnce) {\r\n if (isArray(tree)) {\r\n for (var i = 0; i < tree.length; i++) {\r\n if (tree[i] && typeof tree[i] !== 'string') {\r\n markStaticNode(tree[i], \"\".concat(key, \"_\").concat(i), isOnce);\r\n }\r\n }\r\n }\r\n else {\r\n markStaticNode(tree, key, isOnce);\r\n }\r\n}\r\nfunction markStaticNode(node, key, isOnce) {\r\n node.isStatic = true;\r\n node.key = key;\r\n node.isOnce = isOnce;\r\n}\n\nfunction bindObjectListeners(data, value) {\r\n if (value) {\r\n if (!isPlainObject(value)) {\r\n process.env.NODE_ENV !== 'production' && warn('v-on without argument expects an Object value', this);\r\n }\r\n else {\r\n var on = (data.on = data.on ? extend({}, data.on) : {});\r\n for (var key in value) {\r\n var existing = on[key];\r\n var ours = value[key];\r\n on[key] = existing ? [].concat(existing, ours) : ours;\r\n }\r\n }\r\n }\r\n return data;\r\n}\n\nfunction resolveScopedSlots(fns, res, \r\n// the following are added in 2.6\r\nhasDynamicKeys, contentHashKey) {\r\n res = res || { $stable: !hasDynamicKeys };\r\n for (var i = 0; i < fns.length; i++) {\r\n var slot = fns[i];\r\n if (isArray(slot)) {\r\n resolveScopedSlots(slot, res, hasDynamicKeys);\r\n }\r\n else if (slot) {\r\n // marker for reverse proxying v-slot without scope on this.$slots\r\n // @ts-expect-error\r\n if (slot.proxy) {\r\n // @ts-expect-error\r\n slot.fn.proxy = true;\r\n }\r\n res[slot.key] = slot.fn;\r\n }\r\n }\r\n if (contentHashKey) {\r\n res.$key = contentHashKey;\r\n }\r\n return res;\r\n}\n\n// helper to process dynamic keys for dynamic arguments in v-bind and v-on.\r\nfunction bindDynamicKeys(baseObj, values) {\r\n for (var i = 0; i < values.length; i += 2) {\r\n var key = values[i];\r\n if (typeof key === 'string' && key) {\r\n baseObj[values[i]] = values[i + 1];\r\n }\r\n else if (process.env.NODE_ENV !== 'production' && key !== '' && key !== null) {\r\n // null is a special value for explicitly removing a binding\r\n warn(\"Invalid value for dynamic directive argument (expected string or null): \".concat(key), this);\r\n }\r\n }\r\n return baseObj;\r\n}\r\n// helper to dynamically append modifier runtime markers to event names.\r\n// ensure only append when value is already string, otherwise it will be cast\r\n// to string and cause the type check to miss.\r\nfunction prependModifier(value, symbol) {\r\n return typeof value === 'string' ? symbol + value : value;\r\n}\n\nfunction installRenderHelpers(target) {\r\n target._o = markOnce;\r\n target._n = toNumber;\r\n target._s = toString;\r\n target._l = renderList;\r\n target._t = renderSlot;\r\n target._q = looseEqual;\r\n target._i = looseIndexOf;\r\n target._m = renderStatic;\r\n target._f = resolveFilter;\r\n target._k = checkKeyCodes;\r\n target._b = bindObjectProps;\r\n target._v = createTextVNode;\r\n target._e = createEmptyVNode;\r\n target._u = resolveScopedSlots;\r\n target._g = bindObjectListeners;\r\n target._d = bindDynamicKeys;\r\n target._p = prependModifier;\r\n}\n\n/**\r\n * Runtime helper for resolving raw children VNodes into a slot object.\r\n */\r\nfunction resolveSlots(children, context) {\r\n if (!children || !children.length) {\r\n return {};\r\n }\r\n var slots = {};\r\n for (var i = 0, l = children.length; i < l; i++) {\r\n var child = children[i];\r\n var data = child.data;\r\n // remove slot attribute if the node is resolved as a Vue slot node\r\n if (data && data.attrs && data.attrs.slot) {\r\n delete data.attrs.slot;\r\n }\r\n // named slots should only be respected if the vnode was rendered in the\r\n // same context.\r\n if ((child.context === context || child.fnContext === context) &&\r\n data &&\r\n data.slot != null) {\r\n var name_1 = data.slot;\r\n var slot = slots[name_1] || (slots[name_1] = []);\r\n if (child.tag === 'template') {\r\n slot.push.apply(slot, child.children || []);\r\n }\r\n else {\r\n slot.push(child);\r\n }\r\n }\r\n else {\r\n (slots.default || (slots.default = [])).push(child);\r\n }\r\n }\r\n // ignore slots that contains only whitespace\r\n for (var name_2 in slots) {\r\n if (slots[name_2].every(isWhitespace)) {\r\n delete slots[name_2];\r\n }\r\n }\r\n return slots;\r\n}\r\nfunction isWhitespace(node) {\r\n return (node.isComment && !node.asyncFactory) || node.text === ' ';\r\n}\n\nfunction isAsyncPlaceholder(node) {\r\n // @ts-expect-error not really boolean type\r\n return node.isComment && node.asyncFactory;\r\n}\n\nfunction normalizeScopedSlots(ownerVm, scopedSlots, normalSlots, prevScopedSlots) {\r\n var res;\r\n var hasNormalSlots = Object.keys(normalSlots).length > 0;\r\n var isStable = scopedSlots ? !!scopedSlots.$stable : !hasNormalSlots;\r\n var key = scopedSlots && scopedSlots.$key;\r\n if (!scopedSlots) {\r\n res = {};\r\n }\r\n else if (scopedSlots._normalized) {\r\n // fast path 1: child component re-render only, parent did not change\r\n return scopedSlots._normalized;\r\n }\r\n else if (isStable &&\r\n prevScopedSlots &&\r\n prevScopedSlots !== emptyObject &&\r\n key === prevScopedSlots.$key &&\r\n !hasNormalSlots &&\r\n !prevScopedSlots.$hasNormal) {\r\n // fast path 2: stable scoped slots w/ no normal slots to proxy,\r\n // only need to normalize once\r\n return prevScopedSlots;\r\n }\r\n else {\r\n res = {};\r\n for (var key_1 in scopedSlots) {\r\n if (scopedSlots[key_1] && key_1[0] !== '$') {\r\n res[key_1] = normalizeScopedSlot(ownerVm, normalSlots, key_1, scopedSlots[key_1]);\r\n }\r\n }\r\n }\r\n // expose normal slots on scopedSlots\r\n for (var key_2 in normalSlots) {\r\n if (!(key_2 in res)) {\r\n res[key_2] = proxyNormalSlot(normalSlots, key_2);\r\n }\r\n }\r\n // avoriaz seems to mock a non-extensible $scopedSlots object\r\n // and when that is passed down this would cause an error\r\n if (scopedSlots && Object.isExtensible(scopedSlots)) {\r\n scopedSlots._normalized = res;\r\n }\r\n def(res, '$stable', isStable);\r\n def(res, '$key', key);\r\n def(res, '$hasNormal', hasNormalSlots);\r\n return res;\r\n}\r\nfunction normalizeScopedSlot(vm, normalSlots, key, fn) {\r\n var normalized = function () {\r\n var cur = currentInstance;\r\n setCurrentInstance(vm);\r\n var res = arguments.length ? fn.apply(null, arguments) : fn({});\r\n res =\r\n res && typeof res === 'object' && !isArray(res)\r\n ? [res] // single vnode\r\n : normalizeChildren(res);\r\n var vnode = res && res[0];\r\n setCurrentInstance(cur);\r\n return res &&\r\n (!vnode ||\r\n (res.length === 1 && vnode.isComment && !isAsyncPlaceholder(vnode))) // #9658, #10391\r\n ? undefined\r\n : res;\r\n };\r\n // this is a slot using the new v-slot syntax without scope. although it is\r\n // compiled as a scoped slot, render fn users would expect it to be present\r\n // on this.$slots because the usage is semantically a normal slot.\r\n if (fn.proxy) {\r\n Object.defineProperty(normalSlots, key, {\r\n get: normalized,\r\n enumerable: true,\r\n configurable: true\r\n });\r\n }\r\n return normalized;\r\n}\r\nfunction proxyNormalSlot(slots, key) {\r\n return function () { return slots[key]; };\r\n}\n\nfunction initSetup(vm) {\r\n var options = vm.$options;\r\n var setup = options.setup;\r\n if (setup) {\r\n var ctx = (vm._setupContext = createSetupContext(vm));\r\n setCurrentInstance(vm);\r\n pushTarget();\r\n var setupResult = invokeWithErrorHandling(setup, null, [vm._props || shallowReactive({}), ctx], vm, \"setup\");\r\n popTarget();\r\n setCurrentInstance();\r\n if (isFunction(setupResult)) {\r\n // render function\r\n // @ts-ignore\r\n options.render = setupResult;\r\n }\r\n else if (isObject(setupResult)) {\r\n // bindings\r\n if (process.env.NODE_ENV !== 'production' && setupResult instanceof VNode) {\r\n warn(\"setup() should not return VNodes directly - \" +\r\n \"return a render function instead.\");\r\n }\r\n vm._setupState = setupResult;\r\n // __sfc indicates compiled bindings from <script setup>\r\n if (!setupResult.__sfc) {\r\n for (var key in setupResult) {\r\n if (!isReserved(key)) {\r\n proxyWithRefUnwrap(vm, setupResult, key);\r\n }\r\n else if (process.env.NODE_ENV !== 'production') {\r\n warn(\"Avoid using variables that start with _ or $ in setup().\");\r\n }\r\n }\r\n }\r\n else {\r\n // exposed for compiled render fn\r\n var proxy = (vm._setupProxy = {});\r\n for (var key in setupResult) {\r\n if (key !== '__sfc') {\r\n proxyWithRefUnwrap(proxy, setupResult, key);\r\n }\r\n }\r\n }\r\n }\r\n else if (process.env.NODE_ENV !== 'production' && setupResult !== undefined) {\r\n warn(\"setup() should return an object. Received: \".concat(setupResult === null ? 'null' : typeof setupResult));\r\n }\r\n }\r\n}\r\nfunction createSetupContext(vm) {\r\n var exposeCalled = false;\r\n return {\r\n get attrs() {\r\n if (!vm._attrsProxy) {\r\n var proxy = (vm._attrsProxy = {});\r\n def(proxy, '_v_attr_proxy', true);\r\n syncSetupProxy(proxy, vm.$attrs, emptyObject, vm, '$attrs');\r\n }\r\n return vm._attrsProxy;\r\n },\r\n get listeners() {\r\n if (!vm._listenersProxy) {\r\n var proxy = (vm._listenersProxy = {});\r\n syncSetupProxy(proxy, vm.$listeners, emptyObject, vm, '$listeners');\r\n }\r\n return vm._listenersProxy;\r\n },\r\n get slots() {\r\n return initSlotsProxy(vm);\r\n },\r\n emit: bind(vm.$emit, vm),\r\n expose: function (exposed) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n if (exposeCalled) {\r\n warn(\"expose() should be called only once per setup().\", vm);\r\n }\r\n exposeCalled = true;\r\n }\r\n if (exposed) {\r\n Object.keys(exposed).forEach(function (key) {\r\n return proxyWithRefUnwrap(vm, exposed, key);\r\n });\r\n }\r\n }\r\n };\r\n}\r\nfunction syncSetupProxy(to, from, prev, instance, type) {\r\n var changed = false;\r\n for (var key in from) {\r\n if (!(key in to)) {\r\n changed = true;\r\n defineProxyAttr(to, key, instance, type);\r\n }\r\n else if (from[key] !== prev[key]) {\r\n changed = true;\r\n }\r\n }\r\n for (var key in to) {\r\n if (!(key in from)) {\r\n changed = true;\r\n delete to[key];\r\n }\r\n }\r\n return changed;\r\n}\r\nfunction defineProxyAttr(proxy, key, instance, type) {\r\n Object.defineProperty(proxy, key, {\r\n enumerable: true,\r\n configurable: true,\r\n get: function () {\r\n return instance[type][key];\r\n }\r\n });\r\n}\r\nfunction initSlotsProxy(vm) {\r\n if (!vm._slotsProxy) {\r\n syncSetupSlots((vm._slotsProxy = {}), vm.$scopedSlots);\r\n }\r\n return vm._slotsProxy;\r\n}\r\nfunction syncSetupSlots(to, from) {\r\n for (var key in from) {\r\n to[key] = from[key];\r\n }\r\n for (var key in to) {\r\n if (!(key in from)) {\r\n delete to[key];\r\n }\r\n }\r\n}\r\n/**\r\n * @internal use manual type def because public setup context type relies on\r\n * legacy VNode types\r\n */\r\nfunction useSlots() {\r\n return getContext().slots;\r\n}\r\n/**\r\n * @internal use manual type def because public setup context type relies on\r\n * legacy VNode types\r\n */\r\nfunction useAttrs() {\r\n return getContext().attrs;\r\n}\r\n/**\r\n * Vue 2 only\r\n * @internal use manual type def because public setup context type relies on\r\n * legacy VNode types\r\n */\r\nfunction useListeners() {\r\n return getContext().listeners;\r\n}\r\nfunction getContext() {\r\n if (process.env.NODE_ENV !== 'production' && !currentInstance) {\r\n warn(\"useContext() called without active instance.\");\r\n }\r\n var vm = currentInstance;\r\n return vm._setupContext || (vm._setupContext = createSetupContext(vm));\r\n}\r\n/**\r\n * Runtime helper for merging default declarations. Imported by compiled code\r\n * only.\r\n * @internal\r\n */\r\nfunction mergeDefaults(raw, defaults) {\r\n var props = isArray(raw)\r\n ? raw.reduce(function (normalized, p) { return ((normalized[p] = {}), normalized); }, {})\r\n : raw;\r\n for (var key in defaults) {\r\n var opt = props[key];\r\n if (opt) {\r\n if (isArray(opt) || isFunction(opt)) {\r\n props[key] = { type: opt, default: defaults[key] };\r\n }\r\n else {\r\n opt.default = defaults[key];\r\n }\r\n }\r\n else if (opt === null) {\r\n props[key] = { default: defaults[key] };\r\n }\r\n else if (process.env.NODE_ENV !== 'production') {\r\n warn(\"props default key \\\"\".concat(key, \"\\\" has no corresponding declaration.\"));\r\n }\r\n }\r\n return props;\r\n}\n\nfunction initRender(vm) {\r\n vm._vnode = null; // the root of the child tree\r\n vm._staticTrees = null; // v-once cached trees\r\n var options = vm.$options;\r\n var parentVnode = (vm.$vnode = options._parentVnode); // the placeholder node in parent tree\r\n var renderContext = parentVnode && parentVnode.context;\r\n vm.$slots = resolveSlots(options._renderChildren, renderContext);\r\n vm.$scopedSlots = parentVnode\r\n ? normalizeScopedSlots(vm.$parent, parentVnode.data.scopedSlots, vm.$slots)\r\n : emptyObject;\r\n // bind the createElement fn to this instance\r\n // so that we get proper render context inside it.\r\n // args order: tag, data, children, normalizationType, alwaysNormalize\r\n // internal version is used by render functions compiled from templates\r\n // @ts-expect-error\r\n vm._c = function (a, b, c, d) { return createElement$1(vm, a, b, c, d, false); };\r\n // normalization is always applied for the public version, used in\r\n // user-written render functions.\r\n // @ts-expect-error\r\n vm.$createElement = function (a, b, c, d) { return createElement$1(vm, a, b, c, d, true); };\r\n // $attrs & $listeners are exposed for easier HOC creation.\r\n // they need to be reactive so that HOCs using them are always updated\r\n var parentData = parentVnode && parentVnode.data;\r\n /* istanbul ignore else */\r\n if (process.env.NODE_ENV !== 'production') {\r\n defineReactive(vm, '$attrs', (parentData && parentData.attrs) || emptyObject, function () {\r\n !isUpdatingChildComponent && warn(\"$attrs is readonly.\", vm);\r\n }, true);\r\n defineReactive(vm, '$listeners', options._parentListeners || emptyObject, function () {\r\n !isUpdatingChildComponent && warn(\"$listeners is readonly.\", vm);\r\n }, true);\r\n }\r\n else {\r\n defineReactive(vm, '$attrs', (parentData && parentData.attrs) || emptyObject, null, true);\r\n defineReactive(vm, '$listeners', options._parentListeners || emptyObject, null, true);\r\n }\r\n}\r\nvar currentRenderingInstance = null;\r\nfunction renderMixin(Vue) {\r\n // install runtime convenience helpers\r\n installRenderHelpers(Vue.prototype);\r\n Vue.prototype.$nextTick = function (fn) {\r\n return nextTick(fn, this);\r\n };\r\n Vue.prototype._render = function () {\r\n var vm = this;\r\n var _a = vm.$options, render = _a.render, _parentVnode = _a._parentVnode;\r\n if (_parentVnode && vm._isMounted) {\r\n vm.$scopedSlots = normalizeScopedSlots(vm.$parent, _parentVnode.data.scopedSlots, vm.$slots, vm.$scopedSlots);\r\n if (vm._slotsProxy) {\r\n syncSetupSlots(vm._slotsProxy, vm.$scopedSlots);\r\n }\r\n }\r\n // set parent vnode. this allows render functions to have access\r\n // to the data on the placeholder node.\r\n vm.$vnode = _parentVnode;\r\n // render self\r\n var vnode;\r\n try {\r\n // There's no need to maintain a stack because all render fns are called\r\n // separately from one another. Nested component's render fns are called\r\n // when parent component is patched.\r\n setCurrentInstance(vm);\r\n currentRenderingInstance = vm;\r\n vnode = render.call(vm._renderProxy, vm.$createElement);\r\n }\r\n catch (e) {\r\n handleError(e, vm, \"render\");\r\n // return error render result,\r\n // or previous vnode to prevent render error causing blank component\r\n /* istanbul ignore else */\r\n if (process.env.NODE_ENV !== 'production' && vm.$options.renderError) {\r\n try {\r\n vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);\r\n }\r\n catch (e) {\r\n handleError(e, vm, \"renderError\");\r\n vnode = vm._vnode;\r\n }\r\n }\r\n else {\r\n vnode = vm._vnode;\r\n }\r\n }\r\n finally {\r\n currentRenderingInstance = null;\r\n setCurrentInstance();\r\n }\r\n // if the returned array contains only a single node, allow it\r\n if (isArray(vnode) && vnode.length === 1) {\r\n vnode = vnode[0];\r\n }\r\n // return empty vnode in case the render function errored out\r\n if (!(vnode instanceof VNode)) {\r\n if (process.env.NODE_ENV !== 'production' && isArray(vnode)) {\r\n warn('Multiple root nodes returned from render function. Render function ' +\r\n 'should return a single root node.', vm);\r\n }\r\n vnode = createEmptyVNode();\r\n }\r\n // set parent\r\n vnode.parent = _parentVnode;\r\n return vnode;\r\n };\r\n}\n\nfunction ensureCtor(comp, base) {\r\n if (comp.__esModule || (hasSymbol && comp[Symbol.toStringTag] === 'Module')) {\r\n comp = comp.default;\r\n }\r\n return isObject(comp) ? base.extend(comp) : comp;\r\n}\r\nfunction createAsyncPlaceholder(factory, data, context, children, tag) {\r\n var node = createEmptyVNode();\r\n node.asyncFactory = factory;\r\n node.asyncMeta = { data: data, context: context, children: children, tag: tag };\r\n return node;\r\n}\r\nfunction resolveAsyncComponent(factory, baseCtor) {\r\n if (isTrue(factory.error) && isDef(factory.errorComp)) {\r\n return factory.errorComp;\r\n }\r\n if (isDef(factory.resolved)) {\r\n return factory.resolved;\r\n }\r\n var owner = currentRenderingInstance;\r\n if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {\r\n // already pending\r\n factory.owners.push(owner);\r\n }\r\n if (isTrue(factory.loading) && isDef(factory.loadingComp)) {\r\n return factory.loadingComp;\r\n }\r\n if (owner && !isDef(factory.owners)) {\r\n var owners_1 = (factory.owners = [owner]);\r\n var sync_1 = true;\r\n var timerLoading_1 = null;\r\n var timerTimeout_1 = null;\r\n owner.$on('hook:destroyed', function () { return remove$2(owners_1, owner); });\r\n var forceRender_1 = function (renderCompleted) {\r\n for (var i = 0, l = owners_1.length; i < l; i++) {\r\n owners_1[i].$forceUpdate();\r\n }\r\n if (renderCompleted) {\r\n owners_1.length = 0;\r\n if (timerLoading_1 !== null) {\r\n clearTimeout(timerLoading_1);\r\n timerLoading_1 = null;\r\n }\r\n if (timerTimeout_1 !== null) {\r\n clearTimeout(timerTimeout_1);\r\n timerTimeout_1 = null;\r\n }\r\n }\r\n };\r\n var resolve = once(function (res) {\r\n // cache resolved\r\n factory.resolved = ensureCtor(res, baseCtor);\r\n // invoke callbacks only if this is not a synchronous resolve\r\n // (async resolves are shimmed as synchronous during SSR)\r\n if (!sync_1) {\r\n forceRender_1(true);\r\n }\r\n else {\r\n owners_1.length = 0;\r\n }\r\n });\r\n var reject_1 = once(function (reason) {\r\n process.env.NODE_ENV !== 'production' &&\r\n warn(\"Failed to resolve async component: \".concat(String(factory)) +\r\n (reason ? \"\\nReason: \".concat(reason) : ''));\r\n if (isDef(factory.errorComp)) {\r\n factory.error = true;\r\n forceRender_1(true);\r\n }\r\n });\r\n var res_1 = factory(resolve, reject_1);\r\n if (isObject(res_1)) {\r\n if (isPromise(res_1)) {\r\n // () => Promise\r\n if (isUndef(factory.resolved)) {\r\n res_1.then(resolve, reject_1);\r\n }\r\n }\r\n else if (isPromise(res_1.component)) {\r\n res_1.component.then(resolve, reject_1);\r\n if (isDef(res_1.error)) {\r\n factory.errorComp = ensureCtor(res_1.error, baseCtor);\r\n }\r\n if (isDef(res_1.loading)) {\r\n factory.loadingComp = ensureCtor(res_1.loading, baseCtor);\r\n if (res_1.delay === 0) {\r\n factory.loading = true;\r\n }\r\n else {\r\n // @ts-expect-error NodeJS timeout type\r\n timerLoading_1 = setTimeout(function () {\r\n timerLoading_1 = null;\r\n if (isUndef(factory.resolved) && isUndef(factory.error)) {\r\n factory.loading = true;\r\n forceRender_1(false);\r\n }\r\n }, res_1.delay || 200);\r\n }\r\n }\r\n if (isDef(res_1.timeout)) {\r\n // @ts-expect-error NodeJS timeout type\r\n timerTimeout_1 = setTimeout(function () {\r\n timerTimeout_1 = null;\r\n if (isUndef(factory.resolved)) {\r\n reject_1(process.env.NODE_ENV !== 'production' ? \"timeout (\".concat(res_1.timeout, \"ms)\") : null);\r\n }\r\n }, res_1.timeout);\r\n }\r\n }\r\n }\r\n sync_1 = false;\r\n // return in case resolved synchronously\r\n return factory.loading ? factory.loadingComp : factory.resolved;\r\n }\r\n}\n\nfunction getFirstComponentChild(children) {\r\n if (isArray(children)) {\r\n for (var i = 0; i < children.length; i++) {\r\n var c = children[i];\r\n if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {\r\n return c;\r\n }\r\n }\r\n }\r\n}\n\nvar SIMPLE_NORMALIZE = 1;\r\nvar ALWAYS_NORMALIZE = 2;\r\n// wrapper function for providing a more flexible interface\r\n// without getting yelled at by flow\r\nfunction createElement$1(context, tag, data, children, normalizationType, alwaysNormalize) {\r\n if (isArray(data) || isPrimitive(data)) {\r\n normalizationType = children;\r\n children = data;\r\n data = undefined;\r\n }\r\n if (isTrue(alwaysNormalize)) {\r\n normalizationType = ALWAYS_NORMALIZE;\r\n }\r\n return _createElement(context, tag, data, children, normalizationType);\r\n}\r\nfunction _createElement(context, tag, data, children, normalizationType) {\r\n if (isDef(data) && isDef(data.__ob__)) {\r\n process.env.NODE_ENV !== 'production' &&\r\n warn(\"Avoid using observed data object as vnode data: \".concat(JSON.stringify(data), \"\\n\") + 'Always create fresh vnode data objects in each render!', context);\r\n return createEmptyVNode();\r\n }\r\n // object syntax in v-bind\r\n if (isDef(data) && isDef(data.is)) {\r\n tag = data.is;\r\n }\r\n if (!tag) {\r\n // in case of component :is set to falsy value\r\n return createEmptyVNode();\r\n }\r\n // warn against non-primitive key\r\n if (process.env.NODE_ENV !== 'production' && isDef(data) && isDef(data.key) && !isPrimitive(data.key)) {\r\n warn('Avoid using non-primitive value as key, ' +\r\n 'use string/number value instead.', context);\r\n }\r\n // support single function children as default scoped slot\r\n if (isArray(children) && isFunction(children[0])) {\r\n data = data || {};\r\n data.scopedSlots = { default: children[0] };\r\n children.length = 0;\r\n }\r\n if (normalizationType === ALWAYS_NORMALIZE) {\r\n children = normalizeChildren(children);\r\n }\r\n else if (normalizationType === SIMPLE_NORMALIZE) {\r\n children = simpleNormalizeChildren(children);\r\n }\r\n var vnode, ns;\r\n if (typeof tag === 'string') {\r\n var Ctor = void 0;\r\n ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);\r\n if (config.isReservedTag(tag)) {\r\n // platform built-in elements\r\n if (process.env.NODE_ENV !== 'production' &&\r\n isDef(data) &&\r\n isDef(data.nativeOn) &&\r\n data.tag !== 'component') {\r\n warn(\"The .native modifier for v-on is only valid on components but it was used on <\".concat(tag, \">.\"), context);\r\n }\r\n vnode = new VNode(config.parsePlatformTagName(tag), data, children, undefined, undefined, context);\r\n }\r\n else if ((!data || !data.pre) &&\r\n isDef((Ctor = resolveAsset(context.$options, 'components', tag)))) {\r\n // component\r\n vnode = createComponent(Ctor, data, context, children, tag);\r\n }\r\n else {\r\n // unknown or unlisted namespaced elements\r\n // check at runtime because it may get assigned a namespace when its\r\n // parent normalizes children\r\n vnode = new VNode(tag, data, children, undefined, undefined, context);\r\n }\r\n }\r\n else {\r\n // direct component options / constructor\r\n vnode = createComponent(tag, data, context, children);\r\n }\r\n if (isArray(vnode)) {\r\n return vnode;\r\n }\r\n else if (isDef(vnode)) {\r\n if (isDef(ns))\r\n applyNS(vnode, ns);\r\n if (isDef(data))\r\n registerDeepBindings(data);\r\n return vnode;\r\n }\r\n else {\r\n return createEmptyVNode();\r\n }\r\n}\r\nfunction applyNS(vnode, ns, force) {\r\n vnode.ns = ns;\r\n if (vnode.tag === 'foreignObject') {\r\n // use default namespace inside foreignObject\r\n ns = undefined;\r\n force = true;\r\n }\r\n if (isDef(vnode.children)) {\r\n for (var i = 0, l = vnode.children.length; i < l; i++) {\r\n var child = vnode.children[i];\r\n if (isDef(child.tag) &&\r\n (isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {\r\n applyNS(child, ns, force);\r\n }\r\n }\r\n }\r\n}\r\n// ref #5318\r\n// necessary to ensure parent re-render when deep bindings like :style and\r\n// :class are used on slot nodes\r\nfunction registerDeepBindings(data) {\r\n if (isObject(data.style)) {\r\n traverse(data.style);\r\n }\r\n if (isObject(data.class)) {\r\n traverse(data.class);\r\n }\r\n}\n\n/**\r\n * @internal this function needs manual public type declaration because it relies\r\n * on previously manually authored types from Vue 2\r\n */\r\nfunction h(type, props, children) {\r\n if (!currentInstance) {\r\n process.env.NODE_ENV !== 'production' &&\r\n warn(\"globally imported h() can only be invoked when there is an active \" +\r\n \"component instance, e.g. synchronously in a component's render or setup function.\");\r\n }\r\n return createElement$1(currentInstance, type, props, children, 2, true);\r\n}\n\nfunction handleError(err, vm, info) {\r\n // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.\r\n // See: https://github.com/vuejs/vuex/issues/1505\r\n pushTarget();\r\n try {\r\n if (vm) {\r\n var cur = vm;\r\n while ((cur = cur.$parent)) {\r\n var hooks = cur.$options.errorCaptured;\r\n if (hooks) {\r\n for (var i = 0; i < hooks.length; i++) {\r\n try {\r\n var capture = hooks[i].call(cur, err, vm, info) === false;\r\n if (capture)\r\n return;\r\n }\r\n catch (e) {\r\n globalHandleError(e, cur, 'errorCaptured hook');\r\n }\r\n }\r\n }\r\n }\r\n }\r\n globalHandleError(err, vm, info);\r\n }\r\n finally {\r\n popTarget();\r\n }\r\n}\r\nfunction invokeWithErrorHandling(handler, context, args, vm, info) {\r\n var res;\r\n try {\r\n res = args ? handler.apply(context, args) : handler.call(context);\r\n if (res && !res._isVue && isPromise(res) && !res._handled) {\r\n res.catch(function (e) { return handleError(e, vm, info + \" (Promise/async)\"); });\r\n res._handled = true;\r\n }\r\n }\r\n catch (e) {\r\n handleError(e, vm, info);\r\n }\r\n return res;\r\n}\r\nfunction globalHandleError(err, vm, info) {\r\n if (config.errorHandler) {\r\n try {\r\n return config.errorHandler.call(null, err, vm, info);\r\n }\r\n catch (e) {\r\n // if the user intentionally throws the original error in the handler,\r\n // do not log it twice\r\n if (e !== err) {\r\n logError(e, null, 'config.errorHandler');\r\n }\r\n }\r\n }\r\n logError(err, vm, info);\r\n}\r\nfunction logError(err, vm, info) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n warn(\"Error in \".concat(info, \": \\\"\").concat(err.toString(), \"\\\"\"), vm);\r\n }\r\n /* istanbul ignore else */\r\n if (inBrowser && typeof console !== 'undefined') {\r\n console.error(err);\r\n }\r\n else {\r\n throw err;\r\n }\r\n}\n\n/* globals MutationObserver */\r\nvar isUsingMicroTask = false;\r\nvar callbacks = [];\r\nvar pending = false;\r\nfunction flushCallbacks() {\r\n pending = false;\r\n var copies = callbacks.slice(0);\r\n callbacks.length = 0;\r\n for (var i = 0; i < copies.length; i++) {\r\n copies[i]();\r\n }\r\n}\r\n// Here we have async deferring wrappers using microtasks.\r\n// In 2.5 we used (macro) tasks (in combination with microtasks).\r\n// However, it has subtle problems when state is changed right before repaint\r\n// (e.g. #6813, out-in transitions).\r\n// Also, using (macro) tasks in event handler would cause some weird behaviors\r\n// that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).\r\n// So we now use microtasks everywhere, again.\r\n// A major drawback of this tradeoff is that there are some scenarios\r\n// where microtasks have too high a priority and fire in between supposedly\r\n// sequential events (e.g. #4521, #6690, which have workarounds)\r\n// or even between bubbling of the same event (#6566).\r\nvar timerFunc;\r\n// The nextTick behavior leverages the microtask queue, which can be accessed\r\n// via either native Promise.then or MutationObserver.\r\n// MutationObserver has wider support, however it is seriously bugged in\r\n// UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It\r\n// completely stops working after triggering a few times... so, if native\r\n// Promise is available, we will use it:\r\n/* istanbul ignore next, $flow-disable-line */\r\nif (typeof Promise !== 'undefined' && isNative(Promise)) {\r\n var p_1 = Promise.resolve();\r\n timerFunc = function () {\r\n p_1.then(flushCallbacks);\r\n // In problematic UIWebViews, Promise.then doesn't completely break, but\r\n // it can get stuck in a weird state where callbacks are pushed into the\r\n // microtask queue but the queue isn't being flushed, until the browser\r\n // needs to do some other work, e.g. handle a timer. Therefore we can\r\n // \"force\" the microtask queue to be flushed by adding an empty timer.\r\n if (isIOS)\r\n setTimeout(noop);\r\n };\r\n isUsingMicroTask = true;\r\n}\r\nelse if (!isIE &&\r\n typeof MutationObserver !== 'undefined' &&\r\n (isNative(MutationObserver) ||\r\n // PhantomJS and iOS 7.x\r\n MutationObserver.toString() === '[object MutationObserverConstructor]')) {\r\n // Use MutationObserver where native Promise is not available,\r\n // e.g. PhantomJS, iOS7, Android 4.4\r\n // (#6466 MutationObserver is unreliable in IE11)\r\n var counter_1 = 1;\r\n var observer = new MutationObserver(flushCallbacks);\r\n var textNode_1 = document.createTextNode(String(counter_1));\r\n observer.observe(textNode_1, {\r\n characterData: true\r\n });\r\n timerFunc = function () {\r\n counter_1 = (counter_1 + 1) % 2;\r\n textNode_1.data = String(counter_1);\r\n };\r\n isUsingMicroTask = true;\r\n}\r\nelse if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {\r\n // Fallback to setImmediate.\r\n // Technically it leverages the (macro) task queue,\r\n // but it is still a better choice than setTimeout.\r\n timerFunc = function () {\r\n setImmediate(flushCallbacks);\r\n };\r\n}\r\nelse {\r\n // Fallback to setTimeout.\r\n timerFunc = function () {\r\n setTimeout(flushCallbacks, 0);\r\n };\r\n}\r\n/**\r\n * @internal\r\n */\r\nfunction nextTick(cb, ctx) {\r\n var _resolve;\r\n callbacks.push(function () {\r\n if (cb) {\r\n try {\r\n cb.call(ctx);\r\n }\r\n catch (e) {\r\n handleError(e, ctx, 'nextTick');\r\n }\r\n }\r\n else if (_resolve) {\r\n _resolve(ctx);\r\n }\r\n });\r\n if (!pending) {\r\n pending = true;\r\n timerFunc();\r\n }\r\n // $flow-disable-line\r\n if (!cb && typeof Promise !== 'undefined') {\r\n return new Promise(function (resolve) {\r\n _resolve = resolve;\r\n });\r\n }\r\n}\n\nfunction useCssModule(name) {\r\n if (name === void 0) { name = '$style'; }\r\n /* istanbul ignore else */\r\n {\r\n if (!currentInstance) {\r\n process.env.NODE_ENV !== 'production' && warn(\"useCssModule must be called inside setup()\");\r\n return emptyObject;\r\n }\r\n var mod = currentInstance[name];\r\n if (!mod) {\r\n process.env.NODE_ENV !== 'production' &&\r\n warn(\"Current instance does not have CSS module named \\\"\".concat(name, \"\\\".\"));\r\n return emptyObject;\r\n }\r\n return mod;\r\n }\r\n}\n\n/**\r\n * Runtime helper for SFC's CSS variable injection feature.\r\n * @private\r\n */\r\nfunction useCssVars(getter) {\r\n if (!inBrowser && !false)\r\n return;\r\n var instance = currentInstance;\r\n if (!instance) {\r\n process.env.NODE_ENV !== 'production' &&\r\n warn(\"useCssVars is called without current active component instance.\");\r\n return;\r\n }\r\n watchPostEffect(function () {\r\n var el = instance.$el;\r\n var vars = getter(instance, instance._setupProxy);\r\n if (el && el.nodeType === 1) {\r\n var style = el.style;\r\n for (var key in vars) {\r\n style.setProperty(\"--\".concat(key), vars[key]);\r\n }\r\n }\r\n });\r\n}\n\n/**\r\n * v3-compatible async component API.\r\n * @internal the type is manually declared in <root>/types/v3-define-async-component.d.ts\r\n * because it relies on existing manual types\r\n */\r\nfunction defineAsyncComponent(source) {\r\n if (isFunction(source)) {\r\n source = { loader: source };\r\n }\r\n var loader = source.loader, loadingComponent = source.loadingComponent, errorComponent = source.errorComponent, _a = source.delay, delay = _a === void 0 ? 200 : _a, timeout = source.timeout, // undefined = never times out\r\n _b = source.suspensible, // undefined = never times out\r\n suspensible = _b === void 0 ? false : _b, // in Vue 3 default is true\r\n userOnError = source.onError;\r\n if (process.env.NODE_ENV !== 'production' && suspensible) {\r\n warn(\"The suspensiblbe option for async components is not supported in Vue2. It is ignored.\");\r\n }\r\n var pendingRequest = null;\r\n var retries = 0;\r\n var retry = function () {\r\n retries++;\r\n pendingRequest = null;\r\n return load();\r\n };\r\n var load = function () {\r\n var thisRequest;\r\n return (pendingRequest ||\r\n (thisRequest = pendingRequest =\r\n loader()\r\n .catch(function (err) {\r\n err = err instanceof Error ? err : new Error(String(err));\r\n if (userOnError) {\r\n return new Promise(function (resolve, reject) {\r\n var userRetry = function () { return resolve(retry()); };\r\n var userFail = function () { return reject(err); };\r\n userOnError(err, userRetry, userFail, retries + 1);\r\n });\r\n }\r\n else {\r\n throw err;\r\n }\r\n })\r\n .then(function (comp) {\r\n if (thisRequest !== pendingRequest && pendingRequest) {\r\n return pendingRequest;\r\n }\r\n if (process.env.NODE_ENV !== 'production' && !comp) {\r\n warn(\"Async component loader resolved to undefined. \" +\r\n \"If you are using retry(), make sure to return its return value.\");\r\n }\r\n // interop module default\r\n if (comp &&\r\n (comp.__esModule || comp[Symbol.toStringTag] === 'Module')) {\r\n comp = comp.default;\r\n }\r\n if (process.env.NODE_ENV !== 'production' && comp && !isObject(comp) && !isFunction(comp)) {\r\n throw new Error(\"Invalid async component load result: \".concat(comp));\r\n }\r\n return comp;\r\n })));\r\n };\r\n return function () {\r\n var component = load();\r\n return {\r\n component: component,\r\n delay: delay,\r\n timeout: timeout,\r\n error: errorComponent,\r\n loading: loadingComponent\r\n };\r\n };\r\n}\n\nfunction createLifeCycle(hookName) {\r\n return function (fn, target) {\r\n if (target === void 0) { target = currentInstance; }\r\n if (!target) {\r\n process.env.NODE_ENV !== 'production' &&\r\n warn(\"\".concat(formatName(hookName), \" is called when there is no active component instance to be \") +\r\n \"associated with. \" +\r\n \"Lifecycle injection APIs can only be used during execution of setup().\");\r\n return;\r\n }\r\n return injectHook(target, hookName, fn);\r\n };\r\n}\r\nfunction formatName(name) {\r\n if (name === 'beforeDestroy') {\r\n name = 'beforeUnmount';\r\n }\r\n else if (name === 'destroyed') {\r\n name = 'unmounted';\r\n }\r\n return \"on\".concat(name[0].toUpperCase() + name.slice(1));\r\n}\r\nfunction injectHook(instance, hookName, fn) {\r\n var options = instance.$options;\r\n options[hookName] = mergeLifecycleHook(options[hookName], fn);\r\n}\r\nvar onBeforeMount = createLifeCycle('beforeMount');\r\nvar onMounted = createLifeCycle('mounted');\r\nvar onBeforeUpdate = createLifeCycle('beforeUpdate');\r\nvar onUpdated = createLifeCycle('updated');\r\nvar onBeforeUnmount = createLifeCycle('beforeDestroy');\r\nvar onUnmounted = createLifeCycle('destroyed');\r\nvar onActivated = createLifeCycle('activated');\r\nvar onDeactivated = createLifeCycle('deactivated');\r\nvar onServerPrefetch = createLifeCycle('serverPrefetch');\r\nvar onRenderTracked = createLifeCycle('renderTracked');\r\nvar onRenderTriggered = createLifeCycle('renderTriggered');\r\nvar injectErrorCapturedHook = createLifeCycle('errorCaptured');\r\nfunction onErrorCaptured(hook, target) {\r\n if (target === void 0) { target = currentInstance; }\r\n injectErrorCapturedHook(hook, target);\r\n}\n\n/**\r\n * Note: also update dist/vue.runtime.mjs when adding new exports to this file.\r\n */\r\nvar version = '2.7.10';\r\n/**\r\n * @internal type is manually declared in <root>/types/v3-define-component.d.ts\r\n */\r\nfunction defineComponent(options) {\r\n return options;\r\n}\n\nvar seenObjects = new _Set();\r\n/**\r\n * Recursively traverse an object to evoke all converted\r\n * getters, so that every nested property inside the object\r\n * is collected as a \"deep\" dependency.\r\n */\r\nfunction traverse(val) {\r\n _traverse(val, seenObjects);\r\n seenObjects.clear();\r\n return val;\r\n}\r\nfunction _traverse(val, seen) {\r\n var i, keys;\r\n var isA = isArray(val);\r\n if ((!isA && !isObject(val)) ||\r\n Object.isFrozen(val) ||\r\n val instanceof VNode) {\r\n return;\r\n }\r\n if (val.__ob__) {\r\n var depId = val.__ob__.dep.id;\r\n if (seen.has(depId)) {\r\n return;\r\n }\r\n seen.add(depId);\r\n }\r\n if (isA) {\r\n i = val.length;\r\n while (i--)\r\n _traverse(val[i], seen);\r\n }\r\n else if (isRef(val)) {\r\n _traverse(val.value, seen);\r\n }\r\n else {\r\n keys = Object.keys(val);\r\n i = keys.length;\r\n while (i--)\r\n _traverse(val[keys[i]], seen);\r\n }\r\n}\n\nvar uid$1 = 0;\r\n/**\r\n * A watcher parses an expression, collects dependencies,\r\n * and fires callback when the expression value changes.\r\n * This is used for both the $watch() api and directives.\r\n * @internal\r\n */\r\nvar Watcher = /** @class */ (function () {\r\n function Watcher(vm, expOrFn, cb, options, isRenderWatcher) {\r\n recordEffectScope(this, \r\n // if the active effect scope is manually created (not a component scope),\r\n // prioritize it\r\n activeEffectScope && !activeEffectScope._vm\r\n ? activeEffectScope\r\n : vm\r\n ? vm._scope\r\n : undefined);\r\n if ((this.vm = vm) && isRenderWatcher) {\r\n vm._watcher = this;\r\n }\r\n // options\r\n if (options) {\r\n this.deep = !!options.deep;\r\n this.user = !!options.user;\r\n this.lazy = !!options.lazy;\r\n this.sync = !!options.sync;\r\n this.before = options.before;\r\n if (process.env.NODE_ENV !== 'production') {\r\n this.onTrack = options.onTrack;\r\n this.onTrigger = options.onTrigger;\r\n }\r\n }\r\n else {\r\n this.deep = this.user = this.lazy = this.sync = false;\r\n }\r\n this.cb = cb;\r\n this.id = ++uid$1; // uid for batching\r\n this.active = true;\r\n this.post = false;\r\n this.dirty = this.lazy; // for lazy watchers\r\n this.deps = [];\r\n this.newDeps = [];\r\n this.depIds = new _Set();\r\n this.newDepIds = new _Set();\r\n this.expression = process.env.NODE_ENV !== 'production' ? expOrFn.toString() : '';\r\n // parse expression for getter\r\n if (isFunction(expOrFn)) {\r\n this.getter = expOrFn;\r\n }\r\n else {\r\n this.getter = parsePath(expOrFn);\r\n if (!this.getter) {\r\n this.getter = noop;\r\n process.env.NODE_ENV !== 'production' &&\r\n warn(\"Failed watching path: \\\"\".concat(expOrFn, \"\\\" \") +\r\n 'Watcher only accepts simple dot-delimited paths. ' +\r\n 'For full control, use a function instead.', vm);\r\n }\r\n }\r\n this.value = this.lazy ? undefined : this.get();\r\n }\r\n /**\r\n * Evaluate the getter, and re-collect dependencies.\r\n */\r\n Watcher.prototype.get = function () {\r\n pushTarget(this);\r\n var value;\r\n var vm = this.vm;\r\n try {\r\n value = this.getter.call(vm, vm);\r\n }\r\n catch (e) {\r\n if (this.user) {\r\n handleError(e, vm, \"getter for watcher \\\"\".concat(this.expression, \"\\\"\"));\r\n }\r\n else {\r\n throw e;\r\n }\r\n }\r\n finally {\r\n // \"touch\" every property so they are all tracked as\r\n // dependencies for deep watching\r\n if (this.deep) {\r\n traverse(value);\r\n }\r\n popTarget();\r\n this.cleanupDeps();\r\n }\r\n return value;\r\n };\r\n /**\r\n * Add a dependency to this directive.\r\n */\r\n Watcher.prototype.addDep = function (dep) {\r\n var id = dep.id;\r\n if (!this.newDepIds.has(id)) {\r\n this.newDepIds.add(id);\r\n this.newDeps.push(dep);\r\n if (!this.depIds.has(id)) {\r\n dep.addSub(this);\r\n }\r\n }\r\n };\r\n /**\r\n * Clean up for dependency collection.\r\n */\r\n Watcher.prototype.cleanupDeps = function () {\r\n var i = this.deps.length;\r\n while (i--) {\r\n var dep = this.deps[i];\r\n if (!this.newDepIds.has(dep.id)) {\r\n dep.removeSub(this);\r\n }\r\n }\r\n var tmp = this.depIds;\r\n this.depIds = this.newDepIds;\r\n this.newDepIds = tmp;\r\n this.newDepIds.clear();\r\n tmp = this.deps;\r\n this.deps = this.newDeps;\r\n this.newDeps = tmp;\r\n this.newDeps.length = 0;\r\n };\r\n /**\r\n * Subscriber interface.\r\n * Will be called when a dependency changes.\r\n */\r\n Watcher.prototype.update = function () {\r\n /* istanbul ignore else */\r\n if (this.lazy) {\r\n this.dirty = true;\r\n }\r\n else if (this.sync) {\r\n this.run();\r\n }\r\n else {\r\n queueWatcher(this);\r\n }\r\n };\r\n /**\r\n * Scheduler job interface.\r\n * Will be called by the scheduler.\r\n */\r\n Watcher.prototype.run = function () {\r\n if (this.active) {\r\n var value = this.get();\r\n if (value !== this.value ||\r\n // Deep watchers and watchers on Object/Arrays should fire even\r\n // when the value is the same, because the value may\r\n // have mutated.\r\n isObject(value) ||\r\n this.deep) {\r\n // set new value\r\n var oldValue = this.value;\r\n this.value = value;\r\n if (this.user) {\r\n var info = \"callback for watcher \\\"\".concat(this.expression, \"\\\"\");\r\n invokeWithErrorHandling(this.cb, this.vm, [value, oldValue], this.vm, info);\r\n }\r\n else {\r\n this.cb.call(this.vm, value, oldValue);\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Evaluate the value of the watcher.\r\n * This only gets called for lazy watchers.\r\n */\r\n Watcher.prototype.evaluate = function () {\r\n this.value = this.get();\r\n this.dirty = false;\r\n };\r\n /**\r\n * Depend on all deps collected by this watcher.\r\n */\r\n Watcher.prototype.depend = function () {\r\n var i = this.deps.length;\r\n while (i--) {\r\n this.deps[i].depend();\r\n }\r\n };\r\n /**\r\n * Remove self from all dependencies' subscriber list.\r\n */\r\n Watcher.prototype.teardown = function () {\r\n if (this.vm && !this.vm._isBeingDestroyed) {\r\n remove$2(this.vm._scope.effects, this);\r\n }\r\n if (this.active) {\r\n var i = this.deps.length;\r\n while (i--) {\r\n this.deps[i].removeSub(this);\r\n }\r\n this.active = false;\r\n if (this.onStop) {\r\n this.onStop();\r\n }\r\n }\r\n };\r\n return Watcher;\r\n}());\n\nvar mark;\r\nvar measure;\r\nif (process.env.NODE_ENV !== 'production') {\r\n var perf_1 = inBrowser && window.performance;\r\n /* istanbul ignore if */\r\n if (perf_1 &&\r\n // @ts-ignore\r\n perf_1.mark &&\r\n // @ts-ignore\r\n perf_1.measure &&\r\n // @ts-ignore\r\n perf_1.clearMarks &&\r\n // @ts-ignore\r\n perf_1.clearMeasures) {\r\n mark = function (tag) { return perf_1.mark(tag); };\r\n measure = function (name, startTag, endTag) {\r\n perf_1.measure(name, startTag, endTag);\r\n perf_1.clearMarks(startTag);\r\n perf_1.clearMarks(endTag);\r\n // perf.clearMeasures(name)\r\n };\r\n }\r\n}\n\nfunction initEvents(vm) {\r\n vm._events = Object.create(null);\r\n vm._hasHookEvent = false;\r\n // init parent attached events\r\n var listeners = vm.$options._parentListeners;\r\n if (listeners) {\r\n updateComponentListeners(vm, listeners);\r\n }\r\n}\r\nvar target$1;\r\nfunction add$1(event, fn) {\r\n target$1.$on(event, fn);\r\n}\r\nfunction remove$1(event, fn) {\r\n target$1.$off(event, fn);\r\n}\r\nfunction createOnceHandler$1(event, fn) {\r\n var _target = target$1;\r\n return function onceHandler() {\r\n var res = fn.apply(null, arguments);\r\n if (res !== null) {\r\n _target.$off(event, onceHandler);\r\n }\r\n };\r\n}\r\nfunction updateComponentListeners(vm, listeners, oldListeners) {\r\n target$1 = vm;\r\n updateListeners(listeners, oldListeners || {}, add$1, remove$1, createOnceHandler$1, vm);\r\n target$1 = undefined;\r\n}\r\nfunction eventsMixin(Vue) {\r\n var hookRE = /^hook:/;\r\n Vue.prototype.$on = function (event, fn) {\r\n var vm = this;\r\n if (isArray(event)) {\r\n for (var i = 0, l = event.length; i < l; i++) {\r\n vm.$on(event[i], fn);\r\n }\r\n }\r\n else {\r\n (vm._events[event] || (vm._events[event] = [])).push(fn);\r\n // optimize hook:event cost by using a boolean flag marked at registration\r\n // instead of a hash lookup\r\n if (hookRE.test(event)) {\r\n vm._hasHookEvent = true;\r\n }\r\n }\r\n return vm;\r\n };\r\n Vue.prototype.$once = function (event, fn) {\r\n var vm = this;\r\n function on() {\r\n vm.$off(event, on);\r\n fn.apply(vm, arguments);\r\n }\r\n on.fn = fn;\r\n vm.$on(event, on);\r\n return vm;\r\n };\r\n Vue.prototype.$off = function (event, fn) {\r\n var vm = this;\r\n // all\r\n if (!arguments.length) {\r\n vm._events = Object.create(null);\r\n return vm;\r\n }\r\n // array of events\r\n if (isArray(event)) {\r\n for (var i_1 = 0, l = event.length; i_1 < l; i_1++) {\r\n vm.$off(event[i_1], fn);\r\n }\r\n return vm;\r\n }\r\n // specific event\r\n var cbs = vm._events[event];\r\n if (!cbs) {\r\n return vm;\r\n }\r\n if (!fn) {\r\n vm._events[event] = null;\r\n return vm;\r\n }\r\n // specific handler\r\n var cb;\r\n var i = cbs.length;\r\n while (i--) {\r\n cb = cbs[i];\r\n if (cb === fn || cb.fn === fn) {\r\n cbs.splice(i, 1);\r\n break;\r\n }\r\n }\r\n return vm;\r\n };\r\n Vue.prototype.$emit = function (event) {\r\n var vm = this;\r\n if (process.env.NODE_ENV !== 'production') {\r\n var lowerCaseEvent = event.toLowerCase();\r\n if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {\r\n tip(\"Event \\\"\".concat(lowerCaseEvent, \"\\\" is emitted in component \") +\r\n \"\".concat(formatComponentName(vm), \" but the handler is registered for \\\"\").concat(event, \"\\\". \") +\r\n \"Note that HTML attributes are case-insensitive and you cannot use \" +\r\n \"v-on to listen to camelCase events when using in-DOM templates. \" +\r\n \"You should probably use \\\"\".concat(hyphenate(event), \"\\\" instead of \\\"\").concat(event, \"\\\".\"));\r\n }\r\n }\r\n var cbs = vm._events[event];\r\n if (cbs) {\r\n cbs = cbs.length > 1 ? toArray(cbs) : cbs;\r\n var args = toArray(arguments, 1);\r\n var info = \"event handler for \\\"\".concat(event, \"\\\"\");\r\n for (var i = 0, l = cbs.length; i < l; i++) {\r\n invokeWithErrorHandling(cbs[i], vm, args, vm, info);\r\n }\r\n }\r\n return vm;\r\n };\r\n}\n\nvar activeInstance = null;\r\nvar isUpdatingChildComponent = false;\r\nfunction setActiveInstance(vm) {\r\n var prevActiveInstance = activeInstance;\r\n activeInstance = vm;\r\n return function () {\r\n activeInstance = prevActiveInstance;\r\n };\r\n}\r\nfunction initLifecycle(vm) {\r\n var options = vm.$options;\r\n // locate first non-abstract parent\r\n var parent = options.parent;\r\n if (parent && !options.abstract) {\r\n while (parent.$options.abstract && parent.$parent) {\r\n parent = parent.$parent;\r\n }\r\n parent.$children.push(vm);\r\n }\r\n vm.$parent = parent;\r\n vm.$root = parent ? parent.$root : vm;\r\n vm.$children = [];\r\n vm.$refs = {};\r\n vm._provided = parent ? parent._provided : Object.create(null);\r\n vm._watcher = null;\r\n vm._inactive = null;\r\n vm._directInactive = false;\r\n vm._isMounted = false;\r\n vm._isDestroyed = false;\r\n vm._isBeingDestroyed = false;\r\n}\r\nfunction lifecycleMixin(Vue) {\r\n Vue.prototype._update = function (vnode, hydrating) {\r\n var vm = this;\r\n var prevEl = vm.$el;\r\n var prevVnode = vm._vnode;\r\n var restoreActiveInstance = setActiveInstance(vm);\r\n vm._vnode = vnode;\r\n // Vue.prototype.__patch__ is injected in entry points\r\n // based on the rendering backend used.\r\n if (!prevVnode) {\r\n // initial render\r\n vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);\r\n }\r\n else {\r\n // updates\r\n vm.$el = vm.__patch__(prevVnode, vnode);\r\n }\r\n restoreActiveInstance();\r\n // update __vue__ reference\r\n if (prevEl) {\r\n prevEl.__vue__ = null;\r\n }\r\n if (vm.$el) {\r\n vm.$el.__vue__ = vm;\r\n }\r\n // if parent is an HOC, update its $el as well\r\n var wrapper = vm;\r\n while (wrapper &&\r\n wrapper.$vnode &&\r\n wrapper.$parent &&\r\n wrapper.$vnode === wrapper.$parent._vnode) {\r\n wrapper.$parent.$el = wrapper.$el;\r\n wrapper = wrapper.$parent;\r\n }\r\n // updated hook is called by the scheduler to ensure that children are\r\n // updated in a parent's updated hook.\r\n };\r\n Vue.prototype.$forceUpdate = function () {\r\n var vm = this;\r\n if (vm._watcher) {\r\n vm._watcher.update();\r\n }\r\n };\r\n Vue.prototype.$destroy = function () {\r\n var vm = this;\r\n if (vm._isBeingDestroyed) {\r\n return;\r\n }\r\n callHook$1(vm, 'beforeDestroy');\r\n vm._isBeingDestroyed = true;\r\n // remove self from parent\r\n var parent = vm.$parent;\r\n if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {\r\n remove$2(parent.$children, vm);\r\n }\r\n // teardown scope. this includes both the render watcher and other\r\n // watchers created\r\n vm._scope.stop();\r\n // remove reference from data ob\r\n // frozen object may not have observer.\r\n if (vm._data.__ob__) {\r\n vm._data.__ob__.vmCount--;\r\n }\r\n // call the last hook...\r\n vm._isDestroyed = true;\r\n // invoke destroy hooks on current rendered tree\r\n vm.__patch__(vm._vnode, null);\r\n // fire destroyed hook\r\n callHook$1(vm, 'destroyed');\r\n // turn off all instance listeners.\r\n vm.$off();\r\n // remove __vue__ reference\r\n if (vm.$el) {\r\n vm.$el.__vue__ = null;\r\n }\r\n // release circular reference (#6759)\r\n if (vm.$vnode) {\r\n vm.$vnode.parent = null;\r\n }\r\n };\r\n}\r\nfunction mountComponent(vm, el, hydrating) {\r\n vm.$el = el;\r\n if (!vm.$options.render) {\r\n // @ts-expect-error invalid type\r\n vm.$options.render = createEmptyVNode;\r\n if (process.env.NODE_ENV !== 'production') {\r\n /* istanbul ignore if */\r\n if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||\r\n vm.$options.el ||\r\n el) {\r\n warn('You are using the runtime-only build of Vue where the template ' +\r\n 'compiler is not available. Either pre-compile the templates into ' +\r\n 'render functions, or use the compiler-included build.', vm);\r\n }\r\n else {\r\n warn('Failed to mount component: template or render function not defined.', vm);\r\n }\r\n }\r\n }\r\n callHook$1(vm, 'beforeMount');\r\n var updateComponent;\r\n /* istanbul ignore if */\r\n if (process.env.NODE_ENV !== 'production' && config.performance && mark) {\r\n updateComponent = function () {\r\n var name = vm._name;\r\n var id = vm._uid;\r\n var startTag = \"vue-perf-start:\".concat(id);\r\n var endTag = \"vue-perf-end:\".concat(id);\r\n mark(startTag);\r\n var vnode = vm._render();\r\n mark(endTag);\r\n measure(\"vue \".concat(name, \" render\"), startTag, endTag);\r\n mark(startTag);\r\n vm._update(vnode, hydrating);\r\n mark(endTag);\r\n measure(\"vue \".concat(name, \" patch\"), startTag, endTag);\r\n };\r\n }\r\n else {\r\n updateComponent = function () {\r\n vm._update(vm._render(), hydrating);\r\n };\r\n }\r\n var watcherOptions = {\r\n before: function () {\r\n if (vm._isMounted && !vm._isDestroyed) {\r\n callHook$1(vm, 'beforeUpdate');\r\n }\r\n }\r\n };\r\n if (process.env.NODE_ENV !== 'production') {\r\n watcherOptions.onTrack = function (e) { return callHook$1(vm, 'renderTracked', [e]); };\r\n watcherOptions.onTrigger = function (e) { return callHook$1(vm, 'renderTriggered', [e]); };\r\n }\r\n // we set this to vm._watcher inside the watcher's constructor\r\n // since the watcher's initial patch may call $forceUpdate (e.g. inside child\r\n // component's mounted hook), which relies on vm._watcher being already defined\r\n new Watcher(vm, updateComponent, noop, watcherOptions, true /* isRenderWatcher */);\r\n hydrating = false;\r\n // flush buffer for flush: \"pre\" watchers queued in setup()\r\n var preWatchers = vm._preWatchers;\r\n if (preWatchers) {\r\n for (var i = 0; i < preWatchers.length; i++) {\r\n preWatchers[i].run();\r\n }\r\n }\r\n // manually mounted instance, call mounted on self\r\n // mounted is called for render-created child components in its inserted hook\r\n if (vm.$vnode == null) {\r\n vm._isMounted = true;\r\n callHook$1(vm, 'mounted');\r\n }\r\n return vm;\r\n}\r\nfunction updateChildComponent(vm, propsData, listeners, parentVnode, renderChildren) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n isUpdatingChildComponent = true;\r\n }\r\n // determine whether component has slot children\r\n // we need to do this before overwriting $options._renderChildren.\r\n // check if there are dynamic scopedSlots (hand-written or compiled but with\r\n // dynamic slot names). Static scoped slots compiled from template has the\r\n // \"$stable\" marker.\r\n var newScopedSlots = parentVnode.data.scopedSlots;\r\n var oldScopedSlots = vm.$scopedSlots;\r\n var hasDynamicScopedSlot = !!((newScopedSlots && !newScopedSlots.$stable) ||\r\n (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||\r\n (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key) ||\r\n (!newScopedSlots && vm.$scopedSlots.$key));\r\n // Any static slot children from the parent may have changed during parent's\r\n // update. Dynamic scoped slots may also have changed. In such cases, a forced\r\n // update is necessary to ensure correctness.\r\n var needsForceUpdate = !!(renderChildren || // has new static slots\r\n vm.$options._renderChildren || // has old static slots\r\n hasDynamicScopedSlot);\r\n var prevVNode = vm.$vnode;\r\n vm.$options._parentVnode = parentVnode;\r\n vm.$vnode = parentVnode; // update vm's placeholder node without re-render\r\n if (vm._vnode) {\r\n // update child tree's parent\r\n vm._vnode.parent = parentVnode;\r\n }\r\n vm.$options._renderChildren = renderChildren;\r\n // update $attrs and $listeners hash\r\n // these are also reactive so they may trigger child update if the child\r\n // used them during render\r\n var attrs = parentVnode.data.attrs || emptyObject;\r\n if (vm._attrsProxy) {\r\n // force update if attrs are accessed and has changed since it may be\r\n // passed to a child component.\r\n if (syncSetupProxy(vm._attrsProxy, attrs, (prevVNode.data && prevVNode.data.attrs) || emptyObject, vm, '$attrs')) {\r\n needsForceUpdate = true;\r\n }\r\n }\r\n vm.$attrs = attrs;\r\n // update listeners\r\n listeners = listeners || emptyObject;\r\n var prevListeners = vm.$options._parentListeners;\r\n if (vm._listenersProxy) {\r\n syncSetupProxy(vm._listenersProxy, listeners, prevListeners || emptyObject, vm, '$listeners');\r\n }\r\n vm.$listeners = vm.$options._parentListeners = listeners;\r\n updateComponentListeners(vm, listeners, prevListeners);\r\n // update props\r\n if (propsData && vm.$options.props) {\r\n toggleObserving(false);\r\n var props = vm._props;\r\n var propKeys = vm.$options._propKeys || [];\r\n for (var i = 0; i < propKeys.length; i++) {\r\n var key = propKeys[i];\r\n var propOptions = vm.$options.props; // wtf flow?\r\n props[key] = validateProp(key, propOptions, propsData, vm);\r\n }\r\n toggleObserving(true);\r\n // keep a copy of raw propsData\r\n vm.$options.propsData = propsData;\r\n }\r\n // resolve slots + force update if has children\r\n if (needsForceUpdate) {\r\n vm.$slots = resolveSlots(renderChildren, parentVnode.context);\r\n vm.$forceUpdate();\r\n }\r\n if (process.env.NODE_ENV !== 'production') {\r\n isUpdatingChildComponent = false;\r\n }\r\n}\r\nfunction isInInactiveTree(vm) {\r\n while (vm && (vm = vm.$parent)) {\r\n if (vm._inactive)\r\n return true;\r\n }\r\n return false;\r\n}\r\nfunction activateChildComponent(vm, direct) {\r\n if (direct) {\r\n vm._directInactive = false;\r\n if (isInInactiveTree(vm)) {\r\n return;\r\n }\r\n }\r\n else if (vm._directInactive) {\r\n return;\r\n }\r\n if (vm._inactive || vm._inactive === null) {\r\n vm._inactive = false;\r\n for (var i = 0; i < vm.$children.length; i++) {\r\n activateChildComponent(vm.$children[i]);\r\n }\r\n callHook$1(vm, 'activated');\r\n }\r\n}\r\nfunction deactivateChildComponent(vm, direct) {\r\n if (direct) {\r\n vm._directInactive = true;\r\n if (isInInactiveTree(vm)) {\r\n return;\r\n }\r\n }\r\n if (!vm._inactive) {\r\n vm._inactive = true;\r\n for (var i = 0; i < vm.$children.length; i++) {\r\n deactivateChildComponent(vm.$children[i]);\r\n }\r\n callHook$1(vm, 'deactivated');\r\n }\r\n}\r\nfunction callHook$1(vm, hook, args, setContext) {\r\n if (setContext === void 0) { setContext = true; }\r\n // #7573 disable dep collection when invoking lifecycle hooks\r\n pushTarget();\r\n var prev = currentInstance;\r\n setContext && setCurrentInstance(vm);\r\n var handlers = vm.$options[hook];\r\n var info = \"\".concat(hook, \" hook\");\r\n if (handlers) {\r\n for (var i = 0, j = handlers.length; i < j; i++) {\r\n invokeWithErrorHandling(handlers[i], vm, args || null, vm, info);\r\n }\r\n }\r\n if (vm._hasHookEvent) {\r\n vm.$emit('hook:' + hook);\r\n }\r\n setContext && setCurrentInstance(prev);\r\n popTarget();\r\n}\n\nvar MAX_UPDATE_COUNT = 100;\r\nvar queue = [];\r\nvar activatedChildren = [];\r\nvar has = {};\r\nvar circular = {};\r\nvar waiting = false;\r\nvar flushing = false;\r\nvar index = 0;\r\n/**\r\n * Reset the scheduler's state.\r\n */\r\nfunction resetSchedulerState() {\r\n index = queue.length = activatedChildren.length = 0;\r\n has = {};\r\n if (process.env.NODE_ENV !== 'production') {\r\n circular = {};\r\n }\r\n waiting = flushing = false;\r\n}\r\n// Async edge case #6566 requires saving the timestamp when event listeners are\r\n// attached. However, calling performance.now() has a perf overhead especially\r\n// if the page has thousands of event listeners. Instead, we take a timestamp\r\n// every time the scheduler flushes and use that for all event listeners\r\n// attached during that flush.\r\nvar currentFlushTimestamp = 0;\r\n// Async edge case fix requires storing an event listener's attach timestamp.\r\nvar getNow = Date.now;\r\n// Determine what event timestamp the browser is using. Annoyingly, the\r\n// timestamp can either be hi-res (relative to page load) or low-res\r\n// (relative to UNIX epoch), so in order to compare time we have to use the\r\n// same timestamp type when saving the flush timestamp.\r\n// All IE versions use low-res event timestamps, and have problematic clock\r\n// implementations (#9632)\r\nif (inBrowser && !isIE) {\r\n var performance_1 = window.performance;\r\n if (performance_1 &&\r\n typeof performance_1.now === 'function' &&\r\n getNow() > document.createEvent('Event').timeStamp) {\r\n // if the event timestamp, although evaluated AFTER the Date.now(), is\r\n // smaller than it, it means the event is using a hi-res timestamp,\r\n // and we need to use the hi-res version for event listener timestamps as\r\n // well.\r\n getNow = function () { return performance_1.now(); };\r\n }\r\n}\r\nvar sortCompareFn = function (a, b) {\r\n if (a.post) {\r\n if (!b.post)\r\n return 1;\r\n }\r\n else if (b.post) {\r\n return -1;\r\n }\r\n return a.id - b.id;\r\n};\r\n/**\r\n * Flush both queues and run the watchers.\r\n */\r\nfunction flushSchedulerQueue() {\r\n currentFlushTimestamp = getNow();\r\n flushing = true;\r\n var watcher, id;\r\n // Sort queue before flush.\r\n // This ensures that:\r\n // 1. Components are updated from parent to child. (because parent is always\r\n // created before the child)\r\n // 2. A component's user watchers are run before its render watcher (because\r\n // user watchers are created before the render watcher)\r\n // 3. If a component is destroyed during a parent component's watcher run,\r\n // its watchers can be skipped.\r\n queue.sort(sortCompareFn);\r\n // do not cache length because more watchers might be pushed\r\n // as we run existing watchers\r\n for (index = 0; index < queue.length; index++) {\r\n watcher = queue[index];\r\n if (watcher.before) {\r\n watcher.before();\r\n }\r\n id = watcher.id;\r\n has[id] = null;\r\n watcher.run();\r\n // in dev build, check and stop circular updates.\r\n if (process.env.NODE_ENV !== 'production' && has[id] != null) {\r\n circular[id] = (circular[id] || 0) + 1;\r\n if (circular[id] > MAX_UPDATE_COUNT) {\r\n warn('You may have an infinite update loop ' +\r\n (watcher.user\r\n ? \"in watcher with expression \\\"\".concat(watcher.expression, \"\\\"\")\r\n : \"in a component render function.\"), watcher.vm);\r\n break;\r\n }\r\n }\r\n }\r\n // keep copies of post queues before resetting state\r\n var activatedQueue = activatedChildren.slice();\r\n var updatedQueue = queue.slice();\r\n resetSchedulerState();\r\n // call component updated and activated hooks\r\n callActivatedHooks(activatedQueue);\r\n callUpdatedHooks(updatedQueue);\r\n // devtool hook\r\n /* istanbul ignore if */\r\n if (devtools && config.devtools) {\r\n devtools.emit('flush');\r\n }\r\n}\r\nfunction callUpdatedHooks(queue) {\r\n var i = queue.length;\r\n while (i--) {\r\n var watcher = queue[i];\r\n var vm = watcher.vm;\r\n if (vm && vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {\r\n callHook$1(vm, 'updated');\r\n }\r\n }\r\n}\r\n/**\r\n * Queue a kept-alive component that was activated during patch.\r\n * The queue will be processed after the entire tree has been patched.\r\n */\r\nfunction queueActivatedComponent(vm) {\r\n // setting _inactive to false here so that a render function can\r\n // rely on checking whether it's in an inactive tree (e.g. router-view)\r\n vm._inactive = false;\r\n activatedChildren.push(vm);\r\n}\r\nfunction callActivatedHooks(queue) {\r\n for (var i = 0; i < queue.length; i++) {\r\n queue[i]._inactive = true;\r\n activateChildComponent(queue[i], true /* true */);\r\n }\r\n}\r\n/**\r\n * Push a watcher into the watcher queue.\r\n * Jobs with duplicate IDs will be skipped unless it's\r\n * pushed when the queue is being flushed.\r\n */\r\nfunction queueWatcher(watcher) {\r\n var id = watcher.id;\r\n if (has[id] != null) {\r\n return;\r\n }\r\n if (watcher === Dep.target && watcher.noRecurse) {\r\n return;\r\n }\r\n has[id] = true;\r\n if (!flushing) {\r\n queue.push(watcher);\r\n }\r\n else {\r\n // if already flushing, splice the watcher based on its id\r\n // if already past its id, it will be run next immediately.\r\n var i = queue.length - 1;\r\n while (i > index && queue[i].id > watcher.id) {\r\n i--;\r\n }\r\n queue.splice(i + 1, 0, watcher);\r\n }\r\n // queue the flush\r\n if (!waiting) {\r\n waiting = true;\r\n if (process.env.NODE_ENV !== 'production' && !config.async) {\r\n flushSchedulerQueue();\r\n return;\r\n }\r\n nextTick(flushSchedulerQueue);\r\n }\r\n}\n\nfunction initProvide(vm) {\r\n var provideOption = vm.$options.provide;\r\n if (provideOption) {\r\n var provided = isFunction(provideOption)\r\n ? provideOption.call(vm)\r\n : provideOption;\r\n if (!isObject(provided)) {\r\n return;\r\n }\r\n var source = resolveProvided(vm);\r\n // IE9 doesn't support Object.getOwnPropertyDescriptors so we have to\r\n // iterate the keys ourselves.\r\n var keys = hasSymbol ? Reflect.ownKeys(provided) : Object.keys(provided);\r\n for (var i = 0; i < keys.length; i++) {\r\n var key = keys[i];\r\n Object.defineProperty(source, key, Object.getOwnPropertyDescriptor(provided, key));\r\n }\r\n }\r\n}\r\nfunction initInjections(vm) {\r\n var result = resolveInject(vm.$options.inject, vm);\r\n if (result) {\r\n toggleObserving(false);\r\n Object.keys(result).forEach(function (key) {\r\n /* istanbul ignore else */\r\n if (process.env.NODE_ENV !== 'production') {\r\n defineReactive(vm, key, result[key], function () {\r\n warn(\"Avoid mutating an injected value directly since the changes will be \" +\r\n \"overwritten whenever the provided component re-renders. \" +\r\n \"injection being mutated: \\\"\".concat(key, \"\\\"\"), vm);\r\n });\r\n }\r\n else {\r\n defineReactive(vm, key, result[key]);\r\n }\r\n });\r\n toggleObserving(true);\r\n }\r\n}\r\nfunction resolveInject(inject, vm) {\r\n if (inject) {\r\n // inject is :any because flow is not smart enough to figure out cached\r\n var result = Object.create(null);\r\n var keys = hasSymbol ? Reflect.ownKeys(inject) : Object.keys(inject);\r\n for (var i = 0; i < keys.length; i++) {\r\n var key = keys[i];\r\n // #6574 in case the inject object is observed...\r\n if (key === '__ob__')\r\n continue;\r\n var provideKey = inject[key].from;\r\n if (provideKey in vm._provided) {\r\n result[key] = vm._provided[provideKey];\r\n }\r\n else if ('default' in inject[key]) {\r\n var provideDefault = inject[key].default;\r\n result[key] = isFunction(provideDefault)\r\n ? provideDefault.call(vm)\r\n : provideDefault;\r\n }\r\n else if (process.env.NODE_ENV !== 'production') {\r\n warn(\"Injection \\\"\".concat(key, \"\\\" not found\"), vm);\r\n }\r\n }\r\n return result;\r\n }\r\n}\n\nfunction FunctionalRenderContext(data, props, children, parent, Ctor) {\r\n var _this = this;\r\n var options = Ctor.options;\r\n // ensure the createElement function in functional components\r\n // gets a unique context - this is necessary for correct named slot check\r\n var contextVm;\r\n if (hasOwn(parent, '_uid')) {\r\n contextVm = Object.create(parent);\r\n contextVm._original = parent;\r\n }\r\n else {\r\n // the context vm passed in is a functional context as well.\r\n // in this case we want to make sure we are able to get a hold to the\r\n // real context instance.\r\n contextVm = parent;\r\n // @ts-ignore\r\n parent = parent._original;\r\n }\r\n var isCompiled = isTrue(options._compiled);\r\n var needNormalization = !isCompiled;\r\n this.data = data;\r\n this.props = props;\r\n this.children = children;\r\n this.parent = parent;\r\n this.listeners = data.on || emptyObject;\r\n this.injections = resolveInject(options.inject, parent);\r\n this.slots = function () {\r\n if (!_this.$slots) {\r\n normalizeScopedSlots(parent, data.scopedSlots, (_this.$slots = resolveSlots(children, parent)));\r\n }\r\n return _this.$slots;\r\n };\r\n Object.defineProperty(this, 'scopedSlots', {\r\n enumerable: true,\r\n get: function () {\r\n return normalizeScopedSlots(parent, data.scopedSlots, this.slots());\r\n }\r\n });\r\n // support for compiled functional template\r\n if (isCompiled) {\r\n // exposing $options for renderStatic()\r\n this.$options = options;\r\n // pre-resolve slots for renderSlot()\r\n this.$slots = this.slots();\r\n this.$scopedSlots = normalizeScopedSlots(parent, data.scopedSlots, this.$slots);\r\n }\r\n if (options._scopeId) {\r\n this._c = function (a, b, c, d) {\r\n var vnode = createElement$1(contextVm, a, b, c, d, needNormalization);\r\n if (vnode && !isArray(vnode)) {\r\n vnode.fnScopeId = options._scopeId;\r\n vnode.fnContext = parent;\r\n }\r\n return vnode;\r\n };\r\n }\r\n else {\r\n this._c = function (a, b, c, d) {\r\n return createElement$1(contextVm, a, b, c, d, needNormalization);\r\n };\r\n }\r\n}\r\ninstallRenderHelpers(FunctionalRenderContext.prototype);\r\nfunction createFunctionalComponent(Ctor, propsData, data, contextVm, children) {\r\n var options = Ctor.options;\r\n var props = {};\r\n var propOptions = options.props;\r\n if (isDef(propOptions)) {\r\n for (var key in propOptions) {\r\n props[key] = validateProp(key, propOptions, propsData || emptyObject);\r\n }\r\n }\r\n else {\r\n if (isDef(data.attrs))\r\n mergeProps(props, data.attrs);\r\n if (isDef(data.props))\r\n mergeProps(props, data.props);\r\n }\r\n var renderContext = new FunctionalRenderContext(data, props, children, contextVm, Ctor);\r\n var vnode = options.render.call(null, renderContext._c, renderContext);\r\n if (vnode instanceof VNode) {\r\n return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext);\r\n }\r\n else if (isArray(vnode)) {\r\n var vnodes = normalizeChildren(vnode) || [];\r\n var res = new Array(vnodes.length);\r\n for (var i = 0; i < vnodes.length; i++) {\r\n res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);\r\n }\r\n return res;\r\n }\r\n}\r\nfunction cloneAndMarkFunctionalResult(vnode, data, contextVm, options, renderContext) {\r\n // #7817 clone node before setting fnContext, otherwise if the node is reused\r\n // (e.g. it was from a cached normal slot) the fnContext causes named slots\r\n // that should not be matched to match.\r\n var clone = cloneVNode(vnode);\r\n clone.fnContext = contextVm;\r\n clone.fnOptions = options;\r\n if (process.env.NODE_ENV !== 'production') {\r\n (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext =\r\n renderContext;\r\n }\r\n if (data.slot) {\r\n (clone.data || (clone.data = {})).slot = data.slot;\r\n }\r\n return clone;\r\n}\r\nfunction mergeProps(to, from) {\r\n for (var key in from) {\r\n to[camelize(key)] = from[key];\r\n }\r\n}\n\nfunction getComponentName(options) {\r\n return options.name || options.__name || options._componentTag;\r\n}\r\n// inline hooks to be invoked on component VNodes during patch\r\nvar componentVNodeHooks = {\r\n init: function (vnode, hydrating) {\r\n if (vnode.componentInstance &&\r\n !vnode.componentInstance._isDestroyed &&\r\n vnode.data.keepAlive) {\r\n // kept-alive components, treat as a patch\r\n var mountedNode = vnode; // work around flow\r\n componentVNodeHooks.prepatch(mountedNode, mountedNode);\r\n }\r\n else {\r\n var child = (vnode.componentInstance = createComponentInstanceForVnode(vnode, activeInstance));\r\n child.$mount(hydrating ? vnode.elm : undefined, hydrating);\r\n }\r\n },\r\n prepatch: function (oldVnode, vnode) {\r\n var options = vnode.componentOptions;\r\n var child = (vnode.componentInstance = oldVnode.componentInstance);\r\n updateChildComponent(child, options.propsData, // updated props\r\n options.listeners, // updated listeners\r\n vnode, // new parent vnode\r\n options.children // new children\r\n );\r\n },\r\n insert: function (vnode) {\r\n var context = vnode.context, componentInstance = vnode.componentInstance;\r\n if (!componentInstance._isMounted) {\r\n componentInstance._isMounted = true;\r\n callHook$1(componentInstance, 'mounted');\r\n }\r\n if (vnode.data.keepAlive) {\r\n if (context._isMounted) {\r\n // vue-router#1212\r\n // During updates, a kept-alive component's child components may\r\n // change, so directly walking the tree here may call activated hooks\r\n // on incorrect children. Instead we push them into a queue which will\r\n // be processed after the whole patch process ended.\r\n queueActivatedComponent(componentInstance);\r\n }\r\n else {\r\n activateChildComponent(componentInstance, true /* direct */);\r\n }\r\n }\r\n },\r\n destroy: function (vnode) {\r\n var componentInstance = vnode.componentInstance;\r\n if (!componentInstance._isDestroyed) {\r\n if (!vnode.data.keepAlive) {\r\n componentInstance.$destroy();\r\n }\r\n else {\r\n deactivateChildComponent(componentInstance, true /* direct */);\r\n }\r\n }\r\n }\r\n};\r\nvar hooksToMerge = Object.keys(componentVNodeHooks);\r\nfunction createComponent(Ctor, data, context, children, tag) {\r\n if (isUndef(Ctor)) {\r\n return;\r\n }\r\n var baseCtor = context.$options._base;\r\n // plain options object: turn it into a constructor\r\n if (isObject(Ctor)) {\r\n Ctor = baseCtor.extend(Ctor);\r\n }\r\n // if at this stage it's not a constructor or an async component factory,\r\n // reject.\r\n if (typeof Ctor !== 'function') {\r\n if (process.env.NODE_ENV !== 'production') {\r\n warn(\"Invalid Component definition: \".concat(String(Ctor)), context);\r\n }\r\n return;\r\n }\r\n // async component\r\n var asyncFactory;\r\n // @ts-expect-error\r\n if (isUndef(Ctor.cid)) {\r\n asyncFactory = Ctor;\r\n Ctor = resolveAsyncComponent(asyncFactory, baseCtor);\r\n if (Ctor === undefined) {\r\n // return a placeholder node for async component, which is rendered\r\n // as a comment node but preserves all the raw information for the node.\r\n // the information will be used for async server-rendering and hydration.\r\n return createAsyncPlaceholder(asyncFactory, data, context, children, tag);\r\n }\r\n }\r\n data = data || {};\r\n // resolve constructor options in case global mixins are applied after\r\n // component constructor creation\r\n resolveConstructorOptions(Ctor);\r\n // transform component v-model data into props & events\r\n if (isDef(data.model)) {\r\n // @ts-expect-error\r\n transformModel(Ctor.options, data);\r\n }\r\n // extract props\r\n // @ts-expect-error\r\n var propsData = extractPropsFromVNodeData(data, Ctor, tag);\r\n // functional component\r\n // @ts-expect-error\r\n if (isTrue(Ctor.options.functional)) {\r\n return createFunctionalComponent(Ctor, propsData, data, context, children);\r\n }\r\n // extract listeners, since these needs to be treated as\r\n // child component listeners instead of DOM listeners\r\n var listeners = data.on;\r\n // replace with listeners with .native modifier\r\n // so it gets processed during parent component patch.\r\n data.on = data.nativeOn;\r\n // @ts-expect-error\r\n if (isTrue(Ctor.options.abstract)) {\r\n // abstract components do not keep anything\r\n // other than props & listeners & slot\r\n // work around flow\r\n var slot = data.slot;\r\n data = {};\r\n if (slot) {\r\n data.slot = slot;\r\n }\r\n }\r\n // install component management hooks onto the placeholder node\r\n installComponentHooks(data);\r\n // return a placeholder vnode\r\n // @ts-expect-error\r\n var name = getComponentName(Ctor.options) || tag;\r\n var vnode = new VNode(\r\n // @ts-expect-error\r\n \"vue-component-\".concat(Ctor.cid).concat(name ? \"-\".concat(name) : ''), data, undefined, undefined, undefined, context, \r\n // @ts-expect-error\r\n { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children }, asyncFactory);\r\n return vnode;\r\n}\r\nfunction createComponentInstanceForVnode(\r\n// we know it's MountedComponentVNode but flow doesn't\r\nvnode, \r\n// activeInstance in lifecycle state\r\nparent) {\r\n var options = {\r\n _isComponent: true,\r\n _parentVnode: vnode,\r\n parent: parent\r\n };\r\n // check inline-template render functions\r\n var inlineTemplate = vnode.data.inlineTemplate;\r\n if (isDef(inlineTemplate)) {\r\n options.render = inlineTemplate.render;\r\n options.staticRenderFns = inlineTemplate.staticRenderFns;\r\n }\r\n return new vnode.componentOptions.Ctor(options);\r\n}\r\nfunction installComponentHooks(data) {\r\n var hooks = data.hook || (data.hook = {});\r\n for (var i = 0; i < hooksToMerge.length; i++) {\r\n var key = hooksToMerge[i];\r\n var existing = hooks[key];\r\n var toMerge = componentVNodeHooks[key];\r\n // @ts-expect-error\r\n if (existing !== toMerge && !(existing && existing._merged)) {\r\n hooks[key] = existing ? mergeHook(toMerge, existing) : toMerge;\r\n }\r\n }\r\n}\r\nfunction mergeHook(f1, f2) {\r\n var merged = function (a, b) {\r\n // flow complains about extra args which is why we use any\r\n f1(a, b);\r\n f2(a, b);\r\n };\r\n merged._merged = true;\r\n return merged;\r\n}\r\n// transform component v-model info (value and callback) into\r\n// prop and event handler respectively.\r\nfunction transformModel(options, data) {\r\n var prop = (options.model && options.model.prop) || 'value';\r\n var event = (options.model && options.model.event) || 'input';\r\n (data.attrs || (data.attrs = {}))[prop] = data.model.value;\r\n var on = data.on || (data.on = {});\r\n var existing = on[event];\r\n var callback = data.model.callback;\r\n if (isDef(existing)) {\r\n if (isArray(existing)\r\n ? existing.indexOf(callback) === -1\r\n : existing !== callback) {\r\n on[event] = [callback].concat(existing);\r\n }\r\n }\r\n else {\r\n on[event] = callback;\r\n }\r\n}\n\nvar warn = noop;\r\nvar tip = noop;\r\nvar generateComponentTrace; // work around flow check\r\nvar formatComponentName;\r\nif (process.env.NODE_ENV !== 'production') {\r\n var hasConsole_1 = typeof console !== 'undefined';\r\n var classifyRE_1 = /(?:^|[-_])(\\w)/g;\r\n var classify_1 = function (str) {\r\n return str.replace(classifyRE_1, function (c) { return c.toUpperCase(); }).replace(/[-_]/g, '');\r\n };\r\n warn = function (msg, vm) {\r\n if (vm === void 0) { vm = currentInstance; }\r\n var trace = vm ? generateComponentTrace(vm) : '';\r\n if (config.warnHandler) {\r\n config.warnHandler.call(null, msg, vm, trace);\r\n }\r\n else if (hasConsole_1 && !config.silent) {\r\n console.error(\"[Vue warn]: \".concat(msg).concat(trace));\r\n }\r\n };\r\n tip = function (msg, vm) {\r\n if (hasConsole_1 && !config.silent) {\r\n console.warn(\"[Vue tip]: \".concat(msg) + (vm ? generateComponentTrace(vm) : ''));\r\n }\r\n };\r\n formatComponentName = function (vm, includeFile) {\r\n if (vm.$root === vm) {\r\n return '<Root>';\r\n }\r\n var options = isFunction(vm) && vm.cid != null\r\n ? vm.options\r\n : vm._isVue\r\n ? vm.$options || vm.constructor.options\r\n : vm;\r\n var name = getComponentName(options);\r\n var file = options.__file;\r\n if (!name && file) {\r\n var match = file.match(/([^/\\\\]+)\\.vue$/);\r\n name = match && match[1];\r\n }\r\n return ((name ? \"<\".concat(classify_1(name), \">\") : \"<Anonymous>\") +\r\n (file && includeFile !== false ? \" at \".concat(file) : ''));\r\n };\r\n var repeat_1 = function (str, n) {\r\n var res = '';\r\n while (n) {\r\n if (n % 2 === 1)\r\n res += str;\r\n if (n > 1)\r\n str += str;\r\n n >>= 1;\r\n }\r\n return res;\r\n };\r\n generateComponentTrace = function (vm) {\r\n if (vm._isVue && vm.$parent) {\r\n var tree = [];\r\n var currentRecursiveSequence = 0;\r\n while (vm) {\r\n if (tree.length > 0) {\r\n var last = tree[tree.length - 1];\r\n if (last.constructor === vm.constructor) {\r\n currentRecursiveSequence++;\r\n vm = vm.$parent;\r\n continue;\r\n }\r\n else if (currentRecursiveSequence > 0) {\r\n tree[tree.length - 1] = [last, currentRecursiveSequence];\r\n currentRecursiveSequence = 0;\r\n }\r\n }\r\n tree.push(vm);\r\n vm = vm.$parent;\r\n }\r\n return ('\\n\\nfound in\\n\\n' +\r\n tree\r\n .map(function (vm, i) {\r\n return \"\".concat(i === 0 ? '---> ' : repeat_1(' ', 5 + i * 2)).concat(isArray(vm)\r\n ? \"\".concat(formatComponentName(vm[0]), \"... (\").concat(vm[1], \" recursive calls)\")\r\n : formatComponentName(vm));\r\n })\r\n .join('\\n'));\r\n }\r\n else {\r\n return \"\\n\\n(found in \".concat(formatComponentName(vm), \")\");\r\n }\r\n };\r\n}\n\n/**\r\n * Option overwriting strategies are functions that handle\r\n * how to merge a parent option value and a child option\r\n * value into the final value.\r\n */\r\nvar strats = config.optionMergeStrategies;\r\n/**\r\n * Options with restrictions\r\n */\r\nif (process.env.NODE_ENV !== 'production') {\r\n strats.el = strats.propsData = function (parent, child, vm, key) {\r\n if (!vm) {\r\n warn(\"option \\\"\".concat(key, \"\\\" can only be used during instance \") +\r\n 'creation with the `new` keyword.');\r\n }\r\n return defaultStrat(parent, child);\r\n };\r\n}\r\n/**\r\n * Helper that recursively merges two data objects together.\r\n */\r\nfunction mergeData(to, from) {\r\n if (!from)\r\n return to;\r\n var key, toVal, fromVal;\r\n var keys = hasSymbol\r\n ? Reflect.ownKeys(from)\r\n : Object.keys(from);\r\n for (var i = 0; i < keys.length; i++) {\r\n key = keys[i];\r\n // in case the object is already observed...\r\n if (key === '__ob__')\r\n continue;\r\n toVal = to[key];\r\n fromVal = from[key];\r\n if (!hasOwn(to, key)) {\r\n set(to, key, fromVal);\r\n }\r\n else if (toVal !== fromVal &&\r\n isPlainObject(toVal) &&\r\n isPlainObject(fromVal)) {\r\n mergeData(toVal, fromVal);\r\n }\r\n }\r\n return to;\r\n}\r\n/**\r\n * Data\r\n */\r\nfunction mergeDataOrFn(parentVal, childVal, vm) {\r\n if (!vm) {\r\n // in a Vue.extend merge, both should be functions\r\n if (!childVal) {\r\n return parentVal;\r\n }\r\n if (!parentVal) {\r\n return childVal;\r\n }\r\n // when parentVal & childVal are both present,\r\n // we need to return a function that returns the\r\n // merged result of both functions... no need to\r\n // check if parentVal is a function here because\r\n // it has to be a function to pass previous merges.\r\n return function mergedDataFn() {\r\n return mergeData(isFunction(childVal) ? childVal.call(this, this) : childVal, isFunction(parentVal) ? parentVal.call(this, this) : parentVal);\r\n };\r\n }\r\n else {\r\n return function mergedInstanceDataFn() {\r\n // instance merge\r\n var instanceData = isFunction(childVal)\r\n ? childVal.call(vm, vm)\r\n : childVal;\r\n var defaultData = isFunction(parentVal)\r\n ? parentVal.call(vm, vm)\r\n : parentVal;\r\n if (instanceData) {\r\n return mergeData(instanceData, defaultData);\r\n }\r\n else {\r\n return defaultData;\r\n }\r\n };\r\n }\r\n}\r\nstrats.data = function (parentVal, childVal, vm) {\r\n if (!vm) {\r\n if (childVal && typeof childVal !== 'function') {\r\n process.env.NODE_ENV !== 'production' &&\r\n warn('The \"data\" option should be a function ' +\r\n 'that returns a per-instance value in component ' +\r\n 'definitions.', vm);\r\n return parentVal;\r\n }\r\n return mergeDataOrFn(parentVal, childVal);\r\n }\r\n return mergeDataOrFn(parentVal, childVal, vm);\r\n};\r\n/**\r\n * Hooks and props are merged as arrays.\r\n */\r\nfunction mergeLifecycleHook(parentVal, childVal) {\r\n var res = childVal\r\n ? parentVal\r\n ? parentVal.concat(childVal)\r\n : isArray(childVal)\r\n ? childVal\r\n : [childVal]\r\n : parentVal;\r\n return res ? dedupeHooks(res) : res;\r\n}\r\nfunction dedupeHooks(hooks) {\r\n var res = [];\r\n for (var i = 0; i < hooks.length; i++) {\r\n if (res.indexOf(hooks[i]) === -1) {\r\n res.push(hooks[i]);\r\n }\r\n }\r\n return res;\r\n}\r\nLIFECYCLE_HOOKS.forEach(function (hook) {\r\n strats[hook] = mergeLifecycleHook;\r\n});\r\n/**\r\n * Assets\r\n *\r\n * When a vm is present (instance creation), we need to do\r\n * a three-way merge between constructor options, instance\r\n * options and parent options.\r\n */\r\nfunction mergeAssets(parentVal, childVal, vm, key) {\r\n var res = Object.create(parentVal || null);\r\n if (childVal) {\r\n process.env.NODE_ENV !== 'production' && assertObjectType(key, childVal, vm);\r\n return extend(res, childVal);\r\n }\r\n else {\r\n return res;\r\n }\r\n}\r\nASSET_TYPES.forEach(function (type) {\r\n strats[type + 's'] = mergeAssets;\r\n});\r\n/**\r\n * Watchers.\r\n *\r\n * Watchers hashes should not overwrite one\r\n * another, so we merge them as arrays.\r\n */\r\nstrats.watch = function (parentVal, childVal, vm, key) {\r\n // work around Firefox's Object.prototype.watch...\r\n //@ts-expect-error work around\r\n if (parentVal === nativeWatch)\r\n parentVal = undefined;\r\n //@ts-expect-error work around\r\n if (childVal === nativeWatch)\r\n childVal = undefined;\r\n /* istanbul ignore if */\r\n if (!childVal)\r\n return Object.create(parentVal || null);\r\n if (process.env.NODE_ENV !== 'production') {\r\n assertObjectType(key, childVal, vm);\r\n }\r\n if (!parentVal)\r\n return childVal;\r\n var ret = {};\r\n extend(ret, parentVal);\r\n for (var key_1 in childVal) {\r\n var parent_1 = ret[key_1];\r\n var child = childVal[key_1];\r\n if (parent_1 && !isArray(parent_1)) {\r\n parent_1 = [parent_1];\r\n }\r\n ret[key_1] = parent_1 ? parent_1.concat(child) : isArray(child) ? child : [child];\r\n }\r\n return ret;\r\n};\r\n/**\r\n * Other object hashes.\r\n */\r\nstrats.props =\r\n strats.methods =\r\n strats.inject =\r\n strats.computed =\r\n function (parentVal, childVal, vm, key) {\r\n if (childVal && process.env.NODE_ENV !== 'production') {\r\n assertObjectType(key, childVal, vm);\r\n }\r\n if (!parentVal)\r\n return childVal;\r\n var ret = Object.create(null);\r\n extend(ret, parentVal);\r\n if (childVal)\r\n extend(ret, childVal);\r\n return ret;\r\n };\r\nstrats.provide = mergeDataOrFn;\r\n/**\r\n * Default strategy.\r\n */\r\nvar defaultStrat = function (parentVal, childVal) {\r\n return childVal === undefined ? parentVal : childVal;\r\n};\r\n/**\r\n * Validate component names\r\n */\r\nfunction checkComponents(options) {\r\n for (var key in options.components) {\r\n validateComponentName(key);\r\n }\r\n}\r\nfunction validateComponentName(name) {\r\n if (!new RegExp(\"^[a-zA-Z][\\\\-\\\\.0-9_\".concat(unicodeRegExp.source, \"]*$\")).test(name)) {\r\n warn('Invalid component name: \"' +\r\n name +\r\n '\". Component names ' +\r\n 'should conform to valid custom element name in html5 specification.');\r\n }\r\n if (isBuiltInTag(name) || config.isReservedTag(name)) {\r\n warn('Do not use built-in or reserved HTML elements as component ' +\r\n 'id: ' +\r\n name);\r\n }\r\n}\r\n/**\r\n * Ensure all props option syntax are normalized into the\r\n * Object-based format.\r\n */\r\nfunction normalizeProps(options, vm) {\r\n var props = options.props;\r\n if (!props)\r\n return;\r\n var res = {};\r\n var i, val, name;\r\n if (isArray(props)) {\r\n i = props.length;\r\n while (i--) {\r\n val = props[i];\r\n if (typeof val === 'string') {\r\n name = camelize(val);\r\n res[name] = { type: null };\r\n }\r\n else if (process.env.NODE_ENV !== 'production') {\r\n warn('props must be strings when using array syntax.');\r\n }\r\n }\r\n }\r\n else if (isPlainObject(props)) {\r\n for (var key in props) {\r\n val = props[key];\r\n name = camelize(key);\r\n res[name] = isPlainObject(val) ? val : { type: val };\r\n }\r\n }\r\n else if (process.env.NODE_ENV !== 'production') {\r\n warn(\"Invalid value for option \\\"props\\\": expected an Array or an Object, \" +\r\n \"but got \".concat(toRawType(props), \".\"), vm);\r\n }\r\n options.props = res;\r\n}\r\n/**\r\n * Normalize all injections into Object-based format\r\n */\r\nfunction normalizeInject(options, vm) {\r\n var inject = options.inject;\r\n if (!inject)\r\n return;\r\n var normalized = (options.inject = {});\r\n if (isArray(inject)) {\r\n for (var i = 0; i < inject.length; i++) {\r\n normalized[inject[i]] = { from: inject[i] };\r\n }\r\n }\r\n else if (isPlainObject(inject)) {\r\n for (var key in inject) {\r\n var val = inject[key];\r\n normalized[key] = isPlainObject(val)\r\n ? extend({ from: key }, val)\r\n : { from: val };\r\n }\r\n }\r\n else if (process.env.NODE_ENV !== 'production') {\r\n warn(\"Invalid value for option \\\"inject\\\": expected an Array or an Object, \" +\r\n \"but got \".concat(toRawType(inject), \".\"), vm);\r\n }\r\n}\r\n/**\r\n * Normalize raw function directives into object format.\r\n */\r\nfunction normalizeDirectives$1(options) {\r\n var dirs = options.directives;\r\n if (dirs) {\r\n for (var key in dirs) {\r\n var def = dirs[key];\r\n if (isFunction(def)) {\r\n dirs[key] = { bind: def, update: def };\r\n }\r\n }\r\n }\r\n}\r\nfunction assertObjectType(name, value, vm) {\r\n if (!isPlainObject(value)) {\r\n warn(\"Invalid value for option \\\"\".concat(name, \"\\\": expected an Object, \") +\r\n \"but got \".concat(toRawType(value), \".\"), vm);\r\n }\r\n}\r\n/**\r\n * Merge two option objects into a new one.\r\n * Core utility used in both instantiation and inheritance.\r\n */\r\nfunction mergeOptions(parent, child, vm) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n checkComponents(child);\r\n }\r\n if (isFunction(child)) {\r\n // @ts-expect-error\r\n child = child.options;\r\n }\r\n normalizeProps(child, vm);\r\n normalizeInject(child, vm);\r\n normalizeDirectives$1(child);\r\n // Apply extends and mixins on the child options,\r\n // but only if it is a raw options object that isn't\r\n // the result of another mergeOptions call.\r\n // Only merged options has the _base property.\r\n if (!child._base) {\r\n if (child.extends) {\r\n parent = mergeOptions(parent, child.extends, vm);\r\n }\r\n if (child.mixins) {\r\n for (var i = 0, l = child.mixins.length; i < l; i++) {\r\n parent = mergeOptions(parent, child.mixins[i], vm);\r\n }\r\n }\r\n }\r\n var options = {};\r\n var key;\r\n for (key in parent) {\r\n mergeField(key);\r\n }\r\n for (key in child) {\r\n if (!hasOwn(parent, key)) {\r\n mergeField(key);\r\n }\r\n }\r\n function mergeField(key) {\r\n var strat = strats[key] || defaultStrat;\r\n options[key] = strat(parent[key], child[key], vm, key);\r\n }\r\n return options;\r\n}\r\n/**\r\n * Resolve an asset.\r\n * This function is used because child instances need access\r\n * to assets defined in its ancestor chain.\r\n */\r\nfunction resolveAsset(options, type, id, warnMissing) {\r\n /* istanbul ignore if */\r\n if (typeof id !== 'string') {\r\n return;\r\n }\r\n var assets = options[type];\r\n // check local registration variations first\r\n if (hasOwn(assets, id))\r\n return assets[id];\r\n var camelizedId = camelize(id);\r\n if (hasOwn(assets, camelizedId))\r\n return assets[camelizedId];\r\n var PascalCaseId = capitalize(camelizedId);\r\n if (hasOwn(assets, PascalCaseId))\r\n return assets[PascalCaseId];\r\n // fallback to prototype chain\r\n var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];\r\n if (process.env.NODE_ENV !== 'production' && warnMissing && !res) {\r\n warn('Failed to resolve ' + type.slice(0, -1) + ': ' + id);\r\n }\r\n return res;\r\n}\n\nfunction validateProp(key, propOptions, propsData, vm) {\r\n var prop = propOptions[key];\r\n var absent = !hasOwn(propsData, key);\r\n var value = propsData[key];\r\n // boolean casting\r\n var booleanIndex = getTypeIndex(Boolean, prop.type);\r\n if (booleanIndex > -1) {\r\n if (absent && !hasOwn(prop, 'default')) {\r\n value = false;\r\n }\r\n else if (value === '' || value === hyphenate(key)) {\r\n // only cast empty string / same name to boolean if\r\n // boolean has higher priority\r\n var stringIndex = getTypeIndex(String, prop.type);\r\n if (stringIndex < 0 || booleanIndex < stringIndex) {\r\n value = true;\r\n }\r\n }\r\n }\r\n // check default value\r\n if (value === undefined) {\r\n value = getPropDefaultValue(vm, prop, key);\r\n // since the default value is a fresh copy,\r\n // make sure to observe it.\r\n var prevShouldObserve = shouldObserve;\r\n toggleObserving(true);\r\n observe(value);\r\n toggleObserving(prevShouldObserve);\r\n }\r\n if (process.env.NODE_ENV !== 'production') {\r\n assertProp(prop, key, value, vm, absent);\r\n }\r\n return value;\r\n}\r\n/**\r\n * Get the default value of a prop.\r\n */\r\nfunction getPropDefaultValue(vm, prop, key) {\r\n // no default, return undefined\r\n if (!hasOwn(prop, 'default')) {\r\n return undefined;\r\n }\r\n var def = prop.default;\r\n // warn against non-factory defaults for Object & Array\r\n if (process.env.NODE_ENV !== 'production' && isObject(def)) {\r\n warn('Invalid default value for prop \"' +\r\n key +\r\n '\": ' +\r\n 'Props with type Object/Array must use a factory function ' +\r\n 'to return the default value.', vm);\r\n }\r\n // the raw prop value was also undefined from previous render,\r\n // return previous default value to avoid unnecessary watcher trigger\r\n if (vm &&\r\n vm.$options.propsData &&\r\n vm.$options.propsData[key] === undefined &&\r\n vm._props[key] !== undefined) {\r\n return vm._props[key];\r\n }\r\n // call factory function for non-Function types\r\n // a value is Function if its prototype is function even across different execution context\r\n return isFunction(def) && getType(prop.type) !== 'Function'\r\n ? def.call(vm)\r\n : def;\r\n}\r\n/**\r\n * Assert whether a prop is valid.\r\n */\r\nfunction assertProp(prop, name, value, vm, absent) {\r\n if (prop.required && absent) {\r\n warn('Missing required prop: \"' + name + '\"', vm);\r\n return;\r\n }\r\n if (value == null && !prop.required) {\r\n return;\r\n }\r\n var type = prop.type;\r\n var valid = !type || type === true;\r\n var expectedTypes = [];\r\n if (type) {\r\n if (!isArray(type)) {\r\n type = [type];\r\n }\r\n for (var i = 0; i < type.length && !valid; i++) {\r\n var assertedType = assertType(value, type[i], vm);\r\n expectedTypes.push(assertedType.expectedType || '');\r\n valid = assertedType.valid;\r\n }\r\n }\r\n var haveExpectedTypes = expectedTypes.some(function (t) { return t; });\r\n if (!valid && haveExpectedTypes) {\r\n warn(getInvalidTypeMessage(name, value, expectedTypes), vm);\r\n return;\r\n }\r\n var validator = prop.validator;\r\n if (validator) {\r\n if (!validator(value)) {\r\n warn('Invalid prop: custom validator check failed for prop \"' + name + '\".', vm);\r\n }\r\n }\r\n}\r\nvar simpleCheckRE = /^(String|Number|Boolean|Function|Symbol|BigInt)$/;\r\nfunction assertType(value, type, vm) {\r\n var valid;\r\n var expectedType = getType(type);\r\n if (simpleCheckRE.test(expectedType)) {\r\n var t = typeof value;\r\n valid = t === expectedType.toLowerCase();\r\n // for primitive wrapper objects\r\n if (!valid && t === 'object') {\r\n valid = value instanceof type;\r\n }\r\n }\r\n else if (expectedType === 'Object') {\r\n valid = isPlainObject(value);\r\n }\r\n else if (expectedType === 'Array') {\r\n valid = isArray(value);\r\n }\r\n else {\r\n try {\r\n valid = value instanceof type;\r\n }\r\n catch (e) {\r\n warn('Invalid prop type: \"' + String(type) + '\" is not a constructor', vm);\r\n valid = false;\r\n }\r\n }\r\n return {\r\n valid: valid,\r\n expectedType: expectedType\r\n };\r\n}\r\nvar functionTypeCheckRE = /^\\s*function (\\w+)/;\r\n/**\r\n * Use function string name to check built-in types,\r\n * because a simple equality check will fail when running\r\n * across different vms / iframes.\r\n */\r\nfunction getType(fn) {\r\n var match = fn && fn.toString().match(functionTypeCheckRE);\r\n return match ? match[1] : '';\r\n}\r\nfunction isSameType(a, b) {\r\n return getType(a) === getType(b);\r\n}\r\nfunction getTypeIndex(type, expectedTypes) {\r\n if (!isArray(expectedTypes)) {\r\n return isSameType(expectedTypes, type) ? 0 : -1;\r\n }\r\n for (var i = 0, len = expectedTypes.length; i < len; i++) {\r\n if (isSameType(expectedTypes[i], type)) {\r\n return i;\r\n }\r\n }\r\n return -1;\r\n}\r\nfunction getInvalidTypeMessage(name, value, expectedTypes) {\r\n var message = \"Invalid prop: type check failed for prop \\\"\".concat(name, \"\\\".\") +\r\n \" Expected \".concat(expectedTypes.map(capitalize).join(', '));\r\n var expectedType = expectedTypes[0];\r\n var receivedType = toRawType(value);\r\n // check if we need to specify expected value\r\n if (expectedTypes.length === 1 &&\r\n isExplicable(expectedType) &&\r\n isExplicable(typeof value) &&\r\n !isBoolean(expectedType, receivedType)) {\r\n message += \" with value \".concat(styleValue(value, expectedType));\r\n }\r\n message += \", got \".concat(receivedType, \" \");\r\n // check if we need to specify received value\r\n if (isExplicable(receivedType)) {\r\n message += \"with value \".concat(styleValue(value, receivedType), \".\");\r\n }\r\n return message;\r\n}\r\nfunction styleValue(value, type) {\r\n if (type === 'String') {\r\n return \"\\\"\".concat(value, \"\\\"\");\r\n }\r\n else if (type === 'Number') {\r\n return \"\".concat(Number(value));\r\n }\r\n else {\r\n return \"\".concat(value);\r\n }\r\n}\r\nvar EXPLICABLE_TYPES = ['string', 'number', 'boolean'];\r\nfunction isExplicable(value) {\r\n return EXPLICABLE_TYPES.some(function (elem) { return value.toLowerCase() === elem; });\r\n}\r\nfunction isBoolean() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; });\r\n}\n\n/* not type checking this file because flow doesn't play well with Proxy */\r\nvar initProxy;\r\nif (process.env.NODE_ENV !== 'production') {\r\n var allowedGlobals_1 = makeMap('Infinity,undefined,NaN,isFinite,isNaN,' +\r\n 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +\r\n 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,' +\r\n 'require' // for Webpack/Browserify\r\n );\r\n var warnNonPresent_1 = function (target, key) {\r\n warn(\"Property or method \\\"\".concat(key, \"\\\" is not defined on the instance but \") +\r\n 'referenced during render. Make sure that this property is reactive, ' +\r\n 'either in the data option, or for class-based components, by ' +\r\n 'initializing the property. ' +\r\n 'See: https://v2.vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.', target);\r\n };\r\n var warnReservedPrefix_1 = function (target, key) {\r\n warn(\"Property \\\"\".concat(key, \"\\\" must be accessed with \\\"$data.\").concat(key, \"\\\" because \") +\r\n 'properties starting with \"$\" or \"_\" are not proxied in the Vue instance to ' +\r\n 'prevent conflicts with Vue internals. ' +\r\n 'See: https://v2.vuejs.org/v2/api/#data', target);\r\n };\r\n var hasProxy_1 = typeof Proxy !== 'undefined' && isNative(Proxy);\r\n if (hasProxy_1) {\r\n var isBuiltInModifier_1 = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');\r\n config.keyCodes = new Proxy(config.keyCodes, {\r\n set: function (target, key, value) {\r\n if (isBuiltInModifier_1(key)) {\r\n warn(\"Avoid overwriting built-in modifier in config.keyCodes: .\".concat(key));\r\n return false;\r\n }\r\n else {\r\n target[key] = value;\r\n return true;\r\n }\r\n }\r\n });\r\n }\r\n var hasHandler_1 = {\r\n has: function (target, key) {\r\n var has = key in target;\r\n var isAllowed = allowedGlobals_1(key) ||\r\n (typeof key === 'string' &&\r\n key.charAt(0) === '_' &&\r\n !(key in target.$data));\r\n if (!has && !isAllowed) {\r\n if (key in target.$data)\r\n warnReservedPrefix_1(target, key);\r\n else\r\n warnNonPresent_1(target, key);\r\n }\r\n return has || !isAllowed;\r\n }\r\n };\r\n var getHandler_1 = {\r\n get: function (target, key) {\r\n if (typeof key === 'string' && !(key in target)) {\r\n if (key in target.$data)\r\n warnReservedPrefix_1(target, key);\r\n else\r\n warnNonPresent_1(target, key);\r\n }\r\n return target[key];\r\n }\r\n };\r\n initProxy = function initProxy(vm) {\r\n if (hasProxy_1) {\r\n // determine which proxy handler to use\r\n var options = vm.$options;\r\n var handlers = options.render && options.render._withStripped ? getHandler_1 : hasHandler_1;\r\n vm._renderProxy = new Proxy(vm, handlers);\r\n }\r\n else {\r\n vm._renderProxy = vm;\r\n }\r\n };\r\n}\n\nvar sharedPropertyDefinition = {\r\n enumerable: true,\r\n configurable: true,\r\n get: noop,\r\n set: noop\r\n};\r\nfunction proxy(target, sourceKey, key) {\r\n sharedPropertyDefinition.get = function proxyGetter() {\r\n return this[sourceKey][key];\r\n };\r\n sharedPropertyDefinition.set = function proxySetter(val) {\r\n this[sourceKey][key] = val;\r\n };\r\n Object.defineProperty(target, key, sharedPropertyDefinition);\r\n}\r\nfunction initState(vm) {\r\n var opts = vm.$options;\r\n if (opts.props)\r\n initProps$1(vm, opts.props);\r\n // Composition API\r\n initSetup(vm);\r\n if (opts.methods)\r\n initMethods(vm, opts.methods);\r\n if (opts.data) {\r\n initData(vm);\r\n }\r\n else {\r\n var ob = observe((vm._data = {}));\r\n ob && ob.vmCount++;\r\n }\r\n if (opts.computed)\r\n initComputed$1(vm, opts.computed);\r\n if (opts.watch && opts.watch !== nativeWatch) {\r\n initWatch(vm, opts.watch);\r\n }\r\n}\r\nfunction initProps$1(vm, propsOptions) {\r\n var propsData = vm.$options.propsData || {};\r\n var props = (vm._props = shallowReactive({}));\r\n // cache prop keys so that future props updates can iterate using Array\r\n // instead of dynamic object key enumeration.\r\n var keys = (vm.$options._propKeys = []);\r\n var isRoot = !vm.$parent;\r\n // root instance props should be converted\r\n if (!isRoot) {\r\n toggleObserving(false);\r\n }\r\n var _loop_1 = function (key) {\r\n keys.push(key);\r\n var value = validateProp(key, propsOptions, propsData, vm);\r\n /* istanbul ignore else */\r\n if (process.env.NODE_ENV !== 'production') {\r\n var hyphenatedKey = hyphenate(key);\r\n if (isReservedAttribute(hyphenatedKey) ||\r\n config.isReservedAttr(hyphenatedKey)) {\r\n warn(\"\\\"\".concat(hyphenatedKey, \"\\\" is a reserved attribute and cannot be used as component prop.\"), vm);\r\n }\r\n defineReactive(props, key, value, function () {\r\n if (!isRoot && !isUpdatingChildComponent) {\r\n warn(\"Avoid mutating a prop directly since the value will be \" +\r\n \"overwritten whenever the parent component re-renders. \" +\r\n \"Instead, use a data or computed property based on the prop's \" +\r\n \"value. Prop being mutated: \\\"\".concat(key, \"\\\"\"), vm);\r\n }\r\n });\r\n }\r\n else {\r\n defineReactive(props, key, value);\r\n }\r\n // static props are already proxied on the component's prototype\r\n // during Vue.extend(). We only need to proxy props defined at\r\n // instantiation here.\r\n if (!(key in vm)) {\r\n proxy(vm, \"_props\", key);\r\n }\r\n };\r\n for (var key in propsOptions) {\r\n _loop_1(key);\r\n }\r\n toggleObserving(true);\r\n}\r\nfunction initData(vm) {\r\n var data = vm.$options.data;\r\n data = vm._data = isFunction(data) ? getData(data, vm) : data || {};\r\n if (!isPlainObject(data)) {\r\n data = {};\r\n process.env.NODE_ENV !== 'production' &&\r\n warn('data functions should return an object:\\n' +\r\n 'https://v2.vuejs.org/v2/guide/components.html#data-Must-Be-a-Function', vm);\r\n }\r\n // proxy data on instance\r\n var keys = Object.keys(data);\r\n var props = vm.$options.props;\r\n var methods = vm.$options.methods;\r\n var i = keys.length;\r\n while (i--) {\r\n var key = keys[i];\r\n if (process.env.NODE_ENV !== 'production') {\r\n if (methods && hasOwn(methods, key)) {\r\n warn(\"Method \\\"\".concat(key, \"\\\" has already been defined as a data property.\"), vm);\r\n }\r\n }\r\n if (props && hasOwn(props, key)) {\r\n process.env.NODE_ENV !== 'production' &&\r\n warn(\"The data property \\\"\".concat(key, \"\\\" is already declared as a prop. \") +\r\n \"Use prop default value instead.\", vm);\r\n }\r\n else if (!isReserved(key)) {\r\n proxy(vm, \"_data\", key);\r\n }\r\n }\r\n // observe data\r\n var ob = observe(data);\r\n ob && ob.vmCount++;\r\n}\r\nfunction getData(data, vm) {\r\n // #7573 disable dep collection when invoking data getters\r\n pushTarget();\r\n try {\r\n return data.call(vm, vm);\r\n }\r\n catch (e) {\r\n handleError(e, vm, \"data()\");\r\n return {};\r\n }\r\n finally {\r\n popTarget();\r\n }\r\n}\r\nvar computedWatcherOptions = { lazy: true };\r\nfunction initComputed$1(vm, computed) {\r\n // $flow-disable-line\r\n var watchers = (vm._computedWatchers = Object.create(null));\r\n // computed properties are just getters during SSR\r\n var isSSR = isServerRendering();\r\n for (var key in computed) {\r\n var userDef = computed[key];\r\n var getter = isFunction(userDef) ? userDef : userDef.get;\r\n if (process.env.NODE_ENV !== 'production' && getter == null) {\r\n warn(\"Getter is missing for computed property \\\"\".concat(key, \"\\\".\"), vm);\r\n }\r\n if (!isSSR) {\r\n // create internal watcher for the computed property.\r\n watchers[key] = new Watcher(vm, getter || noop, noop, computedWatcherOptions);\r\n }\r\n // component-defined computed properties are already defined on the\r\n // component prototype. We only need to define computed properties defined\r\n // at instantiation here.\r\n if (!(key in vm)) {\r\n defineComputed(vm, key, userDef);\r\n }\r\n else if (process.env.NODE_ENV !== 'production') {\r\n if (key in vm.$data) {\r\n warn(\"The computed property \\\"\".concat(key, \"\\\" is already defined in data.\"), vm);\r\n }\r\n else if (vm.$options.props && key in vm.$options.props) {\r\n warn(\"The computed property \\\"\".concat(key, \"\\\" is already defined as a prop.\"), vm);\r\n }\r\n else if (vm.$options.methods && key in vm.$options.methods) {\r\n warn(\"The computed property \\\"\".concat(key, \"\\\" is already defined as a method.\"), vm);\r\n }\r\n }\r\n }\r\n}\r\nfunction defineComputed(target, key, userDef) {\r\n var shouldCache = !isServerRendering();\r\n if (isFunction(userDef)) {\r\n sharedPropertyDefinition.get = shouldCache\r\n ? createComputedGetter(key)\r\n : createGetterInvoker(userDef);\r\n sharedPropertyDefinition.set = noop;\r\n }\r\n else {\r\n sharedPropertyDefinition.get = userDef.get\r\n ? shouldCache && userDef.cache !== false\r\n ? createComputedGetter(key)\r\n : createGetterInvoker(userDef.get)\r\n : noop;\r\n sharedPropertyDefinition.set = userDef.set || noop;\r\n }\r\n if (process.env.NODE_ENV !== 'production' && sharedPropertyDefinition.set === noop) {\r\n sharedPropertyDefinition.set = function () {\r\n warn(\"Computed property \\\"\".concat(key, \"\\\" was assigned to but it has no setter.\"), this);\r\n };\r\n }\r\n Object.defineProperty(target, key, sharedPropertyDefinition);\r\n}\r\nfunction createComputedGetter(key) {\r\n return function computedGetter() {\r\n var watcher = this._computedWatchers && this._computedWatchers[key];\r\n if (watcher) {\r\n if (watcher.dirty) {\r\n watcher.evaluate();\r\n }\r\n if (Dep.target) {\r\n if (process.env.NODE_ENV !== 'production' && Dep.target.onTrack) {\r\n Dep.target.onTrack({\r\n effect: Dep.target,\r\n target: this,\r\n type: \"get\" /* TrackOpTypes.GET */,\r\n key: key\r\n });\r\n }\r\n watcher.depend();\r\n }\r\n return watcher.value;\r\n }\r\n };\r\n}\r\nfunction createGetterInvoker(fn) {\r\n return function computedGetter() {\r\n return fn.call(this, this);\r\n };\r\n}\r\nfunction initMethods(vm, methods) {\r\n var props = vm.$options.props;\r\n for (var key in methods) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n if (typeof methods[key] !== 'function') {\r\n warn(\"Method \\\"\".concat(key, \"\\\" has type \\\"\").concat(typeof methods[key], \"\\\" in the component definition. \") +\r\n \"Did you reference the function correctly?\", vm);\r\n }\r\n if (props && hasOwn(props, key)) {\r\n warn(\"Method \\\"\".concat(key, \"\\\" has already been defined as a prop.\"), vm);\r\n }\r\n if (key in vm && isReserved(key)) {\r\n warn(\"Method \\\"\".concat(key, \"\\\" conflicts with an existing Vue instance method. \") +\r\n \"Avoid defining component methods that start with _ or $.\");\r\n }\r\n }\r\n vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);\r\n }\r\n}\r\nfunction initWatch(vm, watch) {\r\n for (var key in watch) {\r\n var handler = watch[key];\r\n if (isArray(handler)) {\r\n for (var i = 0; i < handler.length; i++) {\r\n createWatcher(vm, key, handler[i]);\r\n }\r\n }\r\n else {\r\n createWatcher(vm, key, handler);\r\n }\r\n }\r\n}\r\nfunction createWatcher(vm, expOrFn, handler, options) {\r\n if (isPlainObject(handler)) {\r\n options = handler;\r\n handler = handler.handler;\r\n }\r\n if (typeof handler === 'string') {\r\n handler = vm[handler];\r\n }\r\n return vm.$watch(expOrFn, handler, options);\r\n}\r\nfunction stateMixin(Vue) {\r\n // flow somehow has problems with directly declared definition object\r\n // when using Object.defineProperty, so we have to procedurally build up\r\n // the object here.\r\n var dataDef = {};\r\n dataDef.get = function () {\r\n return this._data;\r\n };\r\n var propsDef = {};\r\n propsDef.get = function () {\r\n return this._props;\r\n };\r\n if (process.env.NODE_ENV !== 'production') {\r\n dataDef.set = function () {\r\n warn('Avoid replacing instance root $data. ' +\r\n 'Use nested data properties instead.', this);\r\n };\r\n propsDef.set = function () {\r\n warn(\"$props is readonly.\", this);\r\n };\r\n }\r\n Object.defineProperty(Vue.prototype, '$data', dataDef);\r\n Object.defineProperty(Vue.prototype, '$props', propsDef);\r\n Vue.prototype.$set = set;\r\n Vue.prototype.$delete = del;\r\n Vue.prototype.$watch = function (expOrFn, cb, options) {\r\n var vm = this;\r\n if (isPlainObject(cb)) {\r\n return createWatcher(vm, expOrFn, cb, options);\r\n }\r\n options = options || {};\r\n options.user = true;\r\n var watcher = new Watcher(vm, expOrFn, cb, options);\r\n if (options.immediate) {\r\n var info = \"callback for immediate watcher \\\"\".concat(watcher.expression, \"\\\"\");\r\n pushTarget();\r\n invokeWithErrorHandling(cb, vm, [watcher.value], vm, info);\r\n popTarget();\r\n }\r\n return function unwatchFn() {\r\n watcher.teardown();\r\n };\r\n };\r\n}\n\nvar uid = 0;\r\nfunction initMixin$1(Vue) {\r\n Vue.prototype._init = function (options) {\r\n var vm = this;\r\n // a uid\r\n vm._uid = uid++;\r\n var startTag, endTag;\r\n /* istanbul ignore if */\r\n if (process.env.NODE_ENV !== 'production' && config.performance && mark) {\r\n startTag = \"vue-perf-start:\".concat(vm._uid);\r\n endTag = \"vue-perf-end:\".concat(vm._uid);\r\n mark(startTag);\r\n }\r\n // a flag to mark this as a Vue instance without having to do instanceof\r\n // check\r\n vm._isVue = true;\r\n // avoid instances from being observed\r\n vm.__v_skip = true;\r\n // effect scope\r\n vm._scope = new EffectScope(true /* detached */);\r\n vm._scope._vm = true;\r\n // merge options\r\n if (options && options._isComponent) {\r\n // optimize internal component instantiation\r\n // since dynamic options merging is pretty slow, and none of the\r\n // internal component options needs special treatment.\r\n initInternalComponent(vm, options);\r\n }\r\n else {\r\n vm.$options = mergeOptions(resolveConstructorOptions(vm.constructor), options || {}, vm);\r\n }\r\n /* istanbul ignore else */\r\n if (process.env.NODE_ENV !== 'production') {\r\n initProxy(vm);\r\n }\r\n else {\r\n vm._renderProxy = vm;\r\n }\r\n // expose real self\r\n vm._self = vm;\r\n initLifecycle(vm);\r\n initEvents(vm);\r\n initRender(vm);\r\n callHook$1(vm, 'beforeCreate', undefined, false /* setContext */);\r\n initInjections(vm); // resolve injections before data/props\r\n initState(vm);\r\n initProvide(vm); // resolve provide after data/props\r\n callHook$1(vm, 'created');\r\n /* istanbul ignore if */\r\n if (process.env.NODE_ENV !== 'production' && config.performance && mark) {\r\n vm._name = formatComponentName(vm, false);\r\n mark(endTag);\r\n measure(\"vue \".concat(vm._name, \" init\"), startTag, endTag);\r\n }\r\n if (vm.$options.el) {\r\n vm.$mount(vm.$options.el);\r\n }\r\n };\r\n}\r\nfunction initInternalComponent(vm, options) {\r\n var opts = (vm.$options = Object.create(vm.constructor.options));\r\n // doing this because it's faster than dynamic enumeration.\r\n var parentVnode = options._parentVnode;\r\n opts.parent = options.parent;\r\n opts._parentVnode = parentVnode;\r\n var vnodeComponentOptions = parentVnode.componentOptions;\r\n opts.propsData = vnodeComponentOptions.propsData;\r\n opts._parentListeners = vnodeComponentOptions.listeners;\r\n opts._renderChildren = vnodeComponentOptions.children;\r\n opts._componentTag = vnodeComponentOptions.tag;\r\n if (options.render) {\r\n opts.render = options.render;\r\n opts.staticRenderFns = options.staticRenderFns;\r\n }\r\n}\r\nfunction resolveConstructorOptions(Ctor) {\r\n var options = Ctor.options;\r\n if (Ctor.super) {\r\n var superOptions = resolveConstructorOptions(Ctor.super);\r\n var cachedSuperOptions = Ctor.superOptions;\r\n if (superOptions !== cachedSuperOptions) {\r\n // super option changed,\r\n // need to resolve new options.\r\n Ctor.superOptions = superOptions;\r\n // check if there are any late-modified/attached options (#4976)\r\n var modifiedOptions = resolveModifiedOptions(Ctor);\r\n // update base extend options\r\n if (modifiedOptions) {\r\n extend(Ctor.extendOptions, modifiedOptions);\r\n }\r\n options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);\r\n if (options.name) {\r\n options.components[options.name] = Ctor;\r\n }\r\n }\r\n }\r\n return options;\r\n}\r\nfunction resolveModifiedOptions(Ctor) {\r\n var modified;\r\n var latest = Ctor.options;\r\n var sealed = Ctor.sealedOptions;\r\n for (var key in latest) {\r\n if (latest[key] !== sealed[key]) {\r\n if (!modified)\r\n modified = {};\r\n modified[key] = latest[key];\r\n }\r\n }\r\n return modified;\r\n}\n\nfunction Vue(options) {\r\n if (process.env.NODE_ENV !== 'production' && !(this instanceof Vue)) {\r\n warn('Vue is a constructor and should be called with the `new` keyword');\r\n }\r\n this._init(options);\r\n}\r\n//@ts-expect-error Vue has function type\r\ninitMixin$1(Vue);\r\n//@ts-expect-error Vue has function type\r\nstateMixin(Vue);\r\n//@ts-expect-error Vue has function type\r\neventsMixin(Vue);\r\n//@ts-expect-error Vue has function type\r\nlifecycleMixin(Vue);\r\n//@ts-expect-error Vue has function type\r\nrenderMixin(Vue);\n\nfunction initUse(Vue) {\r\n Vue.use = function (plugin) {\r\n var installedPlugins = this._installedPlugins || (this._installedPlugins = []);\r\n if (installedPlugins.indexOf(plugin) > -1) {\r\n return this;\r\n }\r\n // additional parameters\r\n var args = toArray(arguments, 1);\r\n args.unshift(this);\r\n if (isFunction(plugin.install)) {\r\n plugin.install.apply(plugin, args);\r\n }\r\n else if (isFunction(plugin)) {\r\n plugin.apply(null, args);\r\n }\r\n installedPlugins.push(plugin);\r\n return this;\r\n };\r\n}\n\nfunction initMixin(Vue) {\r\n Vue.mixin = function (mixin) {\r\n this.options = mergeOptions(this.options, mixin);\r\n return this;\r\n };\r\n}\n\nfunction initExtend(Vue) {\r\n /**\r\n * Each instance constructor, including Vue, has a unique\r\n * cid. This enables us to create wrapped \"child\r\n * constructors\" for prototypal inheritance and cache them.\r\n */\r\n Vue.cid = 0;\r\n var cid = 1;\r\n /**\r\n * Class inheritance\r\n */\r\n Vue.extend = function (extendOptions) {\r\n extendOptions = extendOptions || {};\r\n var Super = this;\r\n var SuperId = Super.cid;\r\n var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});\r\n if (cachedCtors[SuperId]) {\r\n return cachedCtors[SuperId];\r\n }\r\n var name = getComponentName(extendOptions) || getComponentName(Super.options);\r\n if (process.env.NODE_ENV !== 'production' && name) {\r\n validateComponentName(name);\r\n }\r\n var Sub = function VueComponent(options) {\r\n this._init(options);\r\n };\r\n Sub.prototype = Object.create(Super.prototype);\r\n Sub.prototype.constructor = Sub;\r\n Sub.cid = cid++;\r\n Sub.options = mergeOptions(Super.options, extendOptions);\r\n Sub['super'] = Super;\r\n // For props and computed properties, we define the proxy getters on\r\n // the Vue instances at extension time, on the extended prototype. This\r\n // avoids Object.defineProperty calls for each instance created.\r\n if (Sub.options.props) {\r\n initProps(Sub);\r\n }\r\n if (Sub.options.computed) {\r\n initComputed(Sub);\r\n }\r\n // allow further extension/mixin/plugin usage\r\n Sub.extend = Super.extend;\r\n Sub.mixin = Super.mixin;\r\n Sub.use = Super.use;\r\n // create asset registers, so extended classes\r\n // can have their private assets too.\r\n ASSET_TYPES.forEach(function (type) {\r\n Sub[type] = Super[type];\r\n });\r\n // enable recursive self-lookup\r\n if (name) {\r\n Sub.options.components[name] = Sub;\r\n }\r\n // keep a reference to the super options at extension time.\r\n // later at instantiation we can check if Super's options have\r\n // been updated.\r\n Sub.superOptions = Super.options;\r\n Sub.extendOptions = extendOptions;\r\n Sub.sealedOptions = extend({}, Sub.options);\r\n // cache constructor\r\n cachedCtors[SuperId] = Sub;\r\n return Sub;\r\n };\r\n}\r\nfunction initProps(Comp) {\r\n var props = Comp.options.props;\r\n for (var key in props) {\r\n proxy(Comp.prototype, \"_props\", key);\r\n }\r\n}\r\nfunction initComputed(Comp) {\r\n var computed = Comp.options.computed;\r\n for (var key in computed) {\r\n defineComputed(Comp.prototype, key, computed[key]);\r\n }\r\n}\n\nfunction initAssetRegisters(Vue) {\r\n /**\r\n * Create asset registration methods.\r\n */\r\n ASSET_TYPES.forEach(function (type) {\r\n // @ts-expect-error function is not exact same type\r\n Vue[type] = function (id, definition) {\r\n if (!definition) {\r\n return this.options[type + 's'][id];\r\n }\r\n else {\r\n /* istanbul ignore if */\r\n if (process.env.NODE_ENV !== 'production' && type === 'component') {\r\n validateComponentName(id);\r\n }\r\n if (type === 'component' && isPlainObject(definition)) {\r\n // @ts-expect-error\r\n definition.name = definition.name || id;\r\n definition = this.options._base.extend(definition);\r\n }\r\n if (type === 'directive' && isFunction(definition)) {\r\n definition = { bind: definition, update: definition };\r\n }\r\n this.options[type + 's'][id] = definition;\r\n return definition;\r\n }\r\n };\r\n });\r\n}\n\nfunction _getComponentName(opts) {\r\n return opts && (getComponentName(opts.Ctor.options) || opts.tag);\r\n}\r\nfunction matches(pattern, name) {\r\n if (isArray(pattern)) {\r\n return pattern.indexOf(name) > -1;\r\n }\r\n else if (typeof pattern === 'string') {\r\n return pattern.split(',').indexOf(name) > -1;\r\n }\r\n else if (isRegExp(pattern)) {\r\n return pattern.test(name);\r\n }\r\n /* istanbul ignore next */\r\n return false;\r\n}\r\nfunction pruneCache(keepAliveInstance, filter) {\r\n var cache = keepAliveInstance.cache, keys = keepAliveInstance.keys, _vnode = keepAliveInstance._vnode;\r\n for (var key in cache) {\r\n var entry = cache[key];\r\n if (entry) {\r\n var name_1 = entry.name;\r\n if (name_1 && !filter(name_1)) {\r\n pruneCacheEntry(cache, key, keys, _vnode);\r\n }\r\n }\r\n }\r\n}\r\nfunction pruneCacheEntry(cache, key, keys, current) {\r\n var entry = cache[key];\r\n if (entry && (!current || entry.tag !== current.tag)) {\r\n // @ts-expect-error can be undefined\r\n entry.componentInstance.$destroy();\r\n }\r\n cache[key] = null;\r\n remove$2(keys, key);\r\n}\r\nvar patternTypes = [String, RegExp, Array];\r\n// TODO defineComponent\r\nvar KeepAlive = {\r\n name: 'keep-alive',\r\n abstract: true,\r\n props: {\r\n include: patternTypes,\r\n exclude: patternTypes,\r\n max: [String, Number]\r\n },\r\n methods: {\r\n cacheVNode: function () {\r\n var _a = this, cache = _a.cache, keys = _a.keys, vnodeToCache = _a.vnodeToCache, keyToCache = _a.keyToCache;\r\n if (vnodeToCache) {\r\n var tag = vnodeToCache.tag, componentInstance = vnodeToCache.componentInstance, componentOptions = vnodeToCache.componentOptions;\r\n cache[keyToCache] = {\r\n name: _getComponentName(componentOptions),\r\n tag: tag,\r\n componentInstance: componentInstance\r\n };\r\n keys.push(keyToCache);\r\n // prune oldest entry\r\n if (this.max && keys.length > parseInt(this.max)) {\r\n pruneCacheEntry(cache, keys[0], keys, this._vnode);\r\n }\r\n this.vnodeToCache = null;\r\n }\r\n }\r\n },\r\n created: function () {\r\n this.cache = Object.create(null);\r\n this.keys = [];\r\n },\r\n destroyed: function () {\r\n for (var key in this.cache) {\r\n pruneCacheEntry(this.cache, key, this.keys);\r\n }\r\n },\r\n mounted: function () {\r\n var _this = this;\r\n this.cacheVNode();\r\n this.$watch('include', function (val) {\r\n pruneCache(_this, function (name) { return matches(val, name); });\r\n });\r\n this.$watch('exclude', function (val) {\r\n pruneCache(_this, function (name) { return !matches(val, name); });\r\n });\r\n },\r\n updated: function () {\r\n this.cacheVNode();\r\n },\r\n render: function () {\r\n var slot = this.$slots.default;\r\n var vnode = getFirstComponentChild(slot);\r\n var componentOptions = vnode && vnode.componentOptions;\r\n if (componentOptions) {\r\n // check pattern\r\n var name_2 = _getComponentName(componentOptions);\r\n var _a = this, include = _a.include, exclude = _a.exclude;\r\n if (\r\n // not included\r\n (include && (!name_2 || !matches(include, name_2))) ||\r\n // excluded\r\n (exclude && name_2 && matches(exclude, name_2))) {\r\n return vnode;\r\n }\r\n var _b = this, cache = _b.cache, keys = _b.keys;\r\n var key = vnode.key == null\r\n ? // same constructor may get registered as different local components\r\n // so cid alone is not enough (#3269)\r\n componentOptions.Ctor.cid +\r\n (componentOptions.tag ? \"::\".concat(componentOptions.tag) : '')\r\n : vnode.key;\r\n if (cache[key]) {\r\n vnode.componentInstance = cache[key].componentInstance;\r\n // make current key freshest\r\n remove$2(keys, key);\r\n keys.push(key);\r\n }\r\n else {\r\n // delay setting the cache until update\r\n this.vnodeToCache = vnode;\r\n this.keyToCache = key;\r\n }\r\n // @ts-expect-error can vnode.data can be undefined\r\n vnode.data.keepAlive = true;\r\n }\r\n return vnode || (slot && slot[0]);\r\n }\r\n};\n\nvar builtInComponents = {\r\n KeepAlive: KeepAlive\r\n};\n\nfunction initGlobalAPI(Vue) {\r\n // config\r\n var configDef = {};\r\n configDef.get = function () { return config; };\r\n if (process.env.NODE_ENV !== 'production') {\r\n configDef.set = function () {\r\n warn('Do not replace the Vue.config object, set individual fields instead.');\r\n };\r\n }\r\n Object.defineProperty(Vue, 'config', configDef);\r\n // exposed util methods.\r\n // NOTE: these are not considered part of the public API - avoid relying on\r\n // them unless you are aware of the risk.\r\n Vue.util = {\r\n warn: warn,\r\n extend: extend,\r\n mergeOptions: mergeOptions,\r\n defineReactive: defineReactive\r\n };\r\n Vue.set = set;\r\n Vue.delete = del;\r\n Vue.nextTick = nextTick;\r\n // 2.6 explicit observable API\r\n Vue.observable = function (obj) {\r\n observe(obj);\r\n return obj;\r\n };\r\n Vue.options = Object.create(null);\r\n ASSET_TYPES.forEach(function (type) {\r\n Vue.options[type + 's'] = Object.create(null);\r\n });\r\n // this is used to identify the \"base\" constructor to extend all plain-object\r\n // components with in Weex's multi-instance scenarios.\r\n Vue.options._base = Vue;\r\n extend(Vue.options.components, builtInComponents);\r\n initUse(Vue);\r\n initMixin(Vue);\r\n initExtend(Vue);\r\n initAssetRegisters(Vue);\r\n}\n\ninitGlobalAPI(Vue);\r\nObject.defineProperty(Vue.prototype, '$isServer', {\r\n get: isServerRendering\r\n});\r\nObject.defineProperty(Vue.prototype, '$ssrContext', {\r\n get: function () {\r\n /* istanbul ignore next */\r\n return this.$vnode && this.$vnode.ssrContext;\r\n }\r\n});\r\n// expose FunctionalRenderContext for ssr runtime helper installation\r\nObject.defineProperty(Vue, 'FunctionalRenderContext', {\r\n value: FunctionalRenderContext\r\n});\r\nVue.version = version;\n\n// these are reserved for web because they are directly compiled away\r\n// during template compilation\r\nvar isReservedAttr = makeMap('style,class');\r\n// attributes that should be using props for binding\r\nvar acceptValue = makeMap('input,textarea,option,select,progress');\r\nvar mustUseProp = function (tag, type, attr) {\r\n return ((attr === 'value' && acceptValue(tag) && type !== 'button') ||\r\n (attr === 'selected' && tag === 'option') ||\r\n (attr === 'checked' && tag === 'input') ||\r\n (attr === 'muted' && tag === 'video'));\r\n};\r\nvar isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');\r\nvar isValidContentEditableValue = makeMap('events,caret,typing,plaintext-only');\r\nvar convertEnumeratedValue = function (key, value) {\r\n return isFalsyAttrValue(value) || value === 'false'\r\n ? 'false'\r\n : // allow arbitrary string value for contenteditable\r\n key === 'contenteditable' && isValidContentEditableValue(value)\r\n ? value\r\n : 'true';\r\n};\r\nvar isBooleanAttr = makeMap('allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +\r\n 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +\r\n 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +\r\n 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +\r\n 'required,reversed,scoped,seamless,selected,sortable,' +\r\n 'truespeed,typemustmatch,visible');\r\nvar xlinkNS = 'http://www.w3.org/1999/xlink';\r\nvar isXlink = function (name) {\r\n return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink';\r\n};\r\nvar getXlinkProp = function (name) {\r\n return isXlink(name) ? name.slice(6, name.length) : '';\r\n};\r\nvar isFalsyAttrValue = function (val) {\r\n return val == null || val === false;\r\n};\n\nfunction genClassForVnode(vnode) {\r\n var data = vnode.data;\r\n var parentNode = vnode;\r\n var childNode = vnode;\r\n while (isDef(childNode.componentInstance)) {\r\n childNode = childNode.componentInstance._vnode;\r\n if (childNode && childNode.data) {\r\n data = mergeClassData(childNode.data, data);\r\n }\r\n }\r\n // @ts-expect-error parentNode.parent not VNodeWithData\r\n while (isDef((parentNode = parentNode.parent))) {\r\n if (parentNode && parentNode.data) {\r\n data = mergeClassData(data, parentNode.data);\r\n }\r\n }\r\n return renderClass(data.staticClass, data.class);\r\n}\r\nfunction mergeClassData(child, parent) {\r\n return {\r\n staticClass: concat(child.staticClass, parent.staticClass),\r\n class: isDef(child.class) ? [child.class, parent.class] : parent.class\r\n };\r\n}\r\nfunction renderClass(staticClass, dynamicClass) {\r\n if (isDef(staticClass) || isDef(dynamicClass)) {\r\n return concat(staticClass, stringifyClass(dynamicClass));\r\n }\r\n /* istanbul ignore next */\r\n return '';\r\n}\r\nfunction concat(a, b) {\r\n return a ? (b ? a + ' ' + b : a) : b || '';\r\n}\r\nfunction stringifyClass(value) {\r\n if (Array.isArray(value)) {\r\n return stringifyArray(value);\r\n }\r\n if (isObject(value)) {\r\n return stringifyObject(value);\r\n }\r\n if (typeof value === 'string') {\r\n return value;\r\n }\r\n /* istanbul ignore next */\r\n return '';\r\n}\r\nfunction stringifyArray(value) {\r\n var res = '';\r\n var stringified;\r\n for (var i = 0, l = value.length; i < l; i++) {\r\n if (isDef((stringified = stringifyClass(value[i]))) && stringified !== '') {\r\n if (res)\r\n res += ' ';\r\n res += stringified;\r\n }\r\n }\r\n return res;\r\n}\r\nfunction stringifyObject(value) {\r\n var res = '';\r\n for (var key in value) {\r\n if (value[key]) {\r\n if (res)\r\n res += ' ';\r\n res += key;\r\n }\r\n }\r\n return res;\r\n}\n\nvar namespaceMap = {\r\n svg: 'http://www.w3.org/2000/svg',\r\n math: 'http://www.w3.org/1998/Math/MathML'\r\n};\r\nvar isHTMLTag = makeMap('html,body,base,head,link,meta,style,title,' +\r\n 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +\r\n 'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' +\r\n 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +\r\n 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +\r\n 'embed,object,param,source,canvas,script,noscript,del,ins,' +\r\n 'caption,col,colgroup,table,thead,tbody,td,th,tr,' +\r\n 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +\r\n 'output,progress,select,textarea,' +\r\n 'details,dialog,menu,menuitem,summary,' +\r\n 'content,element,shadow,template,blockquote,iframe,tfoot');\r\n// this map is intentionally selective, only covering SVG elements that may\r\n// contain child elements.\r\nvar isSVG = makeMap('svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +\r\n 'foreignobject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +\r\n 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view', true);\r\nvar isReservedTag = function (tag) {\r\n return isHTMLTag(tag) || isSVG(tag);\r\n};\r\nfunction getTagNamespace(tag) {\r\n if (isSVG(tag)) {\r\n return 'svg';\r\n }\r\n // basic support for MathML\r\n // note it doesn't support other MathML elements being component roots\r\n if (tag === 'math') {\r\n return 'math';\r\n }\r\n}\r\nvar unknownElementCache = Object.create(null);\r\nfunction isUnknownElement(tag) {\r\n /* istanbul ignore if */\r\n if (!inBrowser) {\r\n return true;\r\n }\r\n if (isReservedTag(tag)) {\r\n return false;\r\n }\r\n tag = tag.toLowerCase();\r\n /* istanbul ignore if */\r\n if (unknownElementCache[tag] != null) {\r\n return unknownElementCache[tag];\r\n }\r\n var el = document.createElement(tag);\r\n if (tag.indexOf('-') > -1) {\r\n // http://stackoverflow.com/a/28210364/1070244\r\n return (unknownElementCache[tag] =\r\n el.constructor === window.HTMLUnknownElement ||\r\n el.constructor === window.HTMLElement);\r\n }\r\n else {\r\n return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()));\r\n }\r\n}\r\nvar isTextInputType = makeMap('text,number,password,search,email,tel,url');\n\n/**\r\n * Query an element selector if it's not an element already.\r\n */\r\nfunction query(el) {\r\n if (typeof el === 'string') {\r\n var selected = document.querySelector(el);\r\n if (!selected) {\r\n process.env.NODE_ENV !== 'production' && warn('Cannot find element: ' + el);\r\n return document.createElement('div');\r\n }\r\n return selected;\r\n }\r\n else {\r\n return el;\r\n }\r\n}\n\nfunction createElement(tagName, vnode) {\r\n var elm = document.createElement(tagName);\r\n if (tagName !== 'select') {\r\n return elm;\r\n }\r\n // false or null will remove the attribute but undefined will not\r\n if (vnode.data &&\r\n vnode.data.attrs &&\r\n vnode.data.attrs.multiple !== undefined) {\r\n elm.setAttribute('multiple', 'multiple');\r\n }\r\n return elm;\r\n}\r\nfunction createElementNS(namespace, tagName) {\r\n return document.createElementNS(namespaceMap[namespace], tagName);\r\n}\r\nfunction createTextNode(text) {\r\n return document.createTextNode(text);\r\n}\r\nfunction createComment(text) {\r\n return document.createComment(text);\r\n}\r\nfunction insertBefore(parentNode, newNode, referenceNode) {\r\n parentNode.insertBefore(newNode, referenceNode);\r\n}\r\nfunction removeChild(node, child) {\r\n node.removeChild(child);\r\n}\r\nfunction appendChild(node, child) {\r\n node.appendChild(child);\r\n}\r\nfunction parentNode(node) {\r\n return node.parentNode;\r\n}\r\nfunction nextSibling(node) {\r\n return node.nextSibling;\r\n}\r\nfunction tagName(node) {\r\n return node.tagName;\r\n}\r\nfunction setTextContent(node, text) {\r\n node.textContent = text;\r\n}\r\nfunction setStyleScope(node, scopeId) {\r\n node.setAttribute(scopeId, '');\r\n}\n\nvar nodeOps = /*#__PURE__*/Object.freeze({\n __proto__: null,\n createElement: createElement,\n createElementNS: createElementNS,\n createTextNode: createTextNode,\n createComment: createComment,\n insertBefore: insertBefore,\n removeChild: removeChild,\n appendChild: appendChild,\n parentNode: parentNode,\n nextSibling: nextSibling,\n tagName: tagName,\n setTextContent: setTextContent,\n setStyleScope: setStyleScope\n});\n\nvar ref = {\r\n create: function (_, vnode) {\r\n registerRef(vnode);\r\n },\r\n update: function (oldVnode, vnode) {\r\n if (oldVnode.data.ref !== vnode.data.ref) {\r\n registerRef(oldVnode, true);\r\n registerRef(vnode);\r\n }\r\n },\r\n destroy: function (vnode) {\r\n registerRef(vnode, true);\r\n }\r\n};\r\nfunction registerRef(vnode, isRemoval) {\r\n var ref = vnode.data.ref;\r\n if (!isDef(ref))\r\n return;\r\n var vm = vnode.context;\r\n var refValue = vnode.componentInstance || vnode.elm;\r\n var value = isRemoval ? null : refValue;\r\n var $refsValue = isRemoval ? undefined : refValue;\r\n if (isFunction(ref)) {\r\n invokeWithErrorHandling(ref, vm, [value], vm, \"template ref function\");\r\n return;\r\n }\r\n var isFor = vnode.data.refInFor;\r\n var _isString = typeof ref === 'string' || typeof ref === 'number';\r\n var _isRef = isRef(ref);\r\n var refs = vm.$refs;\r\n if (_isString || _isRef) {\r\n if (isFor) {\r\n var existing = _isString ? refs[ref] : ref.value;\r\n if (isRemoval) {\r\n isArray(existing) && remove$2(existing, refValue);\r\n }\r\n else {\r\n if (!isArray(existing)) {\r\n if (_isString) {\r\n refs[ref] = [refValue];\r\n setSetupRef(vm, ref, refs[ref]);\r\n }\r\n else {\r\n ref.value = [refValue];\r\n }\r\n }\r\n else if (!existing.includes(refValue)) {\r\n existing.push(refValue);\r\n }\r\n }\r\n }\r\n else if (_isString) {\r\n if (isRemoval && refs[ref] !== refValue) {\r\n return;\r\n }\r\n refs[ref] = $refsValue;\r\n setSetupRef(vm, ref, value);\r\n }\r\n else if (_isRef) {\r\n if (isRemoval && ref.value !== refValue) {\r\n return;\r\n }\r\n ref.value = value;\r\n }\r\n else if (process.env.NODE_ENV !== 'production') {\r\n warn(\"Invalid template ref type: \".concat(typeof ref));\r\n }\r\n }\r\n}\r\nfunction setSetupRef(_a, key, val) {\r\n var _setupState = _a._setupState;\r\n if (_setupState && hasOwn(_setupState, key)) {\r\n if (isRef(_setupState[key])) {\r\n _setupState[key].value = val;\r\n }\r\n else {\r\n _setupState[key] = val;\r\n }\r\n }\r\n}\n\n/**\r\n * Virtual DOM patching algorithm based on Snabbdom by\r\n * Simon Friis Vindum (@paldepind)\r\n * Licensed under the MIT License\r\n * https://github.com/paldepind/snabbdom/blob/master/LICENSE\r\n *\r\n * modified by Evan You (@yyx990803)\r\n *\r\n * Not type-checking this because this file is perf-critical and the cost\r\n * of making flow understand it is not worth it.\r\n */\r\nvar emptyNode = new VNode('', {}, []);\r\nvar hooks = ['create', 'activate', 'update', 'remove', 'destroy'];\r\nfunction sameVnode(a, b) {\r\n return (a.key === b.key &&\r\n a.asyncFactory === b.asyncFactory &&\r\n ((a.tag === b.tag &&\r\n a.isComment === b.isComment &&\r\n isDef(a.data) === isDef(b.data) &&\r\n sameInputType(a, b)) ||\r\n (isTrue(a.isAsyncPlaceholder) && isUndef(b.asyncFactory.error))));\r\n}\r\nfunction sameInputType(a, b) {\r\n if (a.tag !== 'input')\r\n return true;\r\n var i;\r\n var typeA = isDef((i = a.data)) && isDef((i = i.attrs)) && i.type;\r\n var typeB = isDef((i = b.data)) && isDef((i = i.attrs)) && i.type;\r\n return typeA === typeB || (isTextInputType(typeA) && isTextInputType(typeB));\r\n}\r\nfunction createKeyToOldIdx(children, beginIdx, endIdx) {\r\n var i, key;\r\n var map = {};\r\n for (i = beginIdx; i <= endIdx; ++i) {\r\n key = children[i].key;\r\n if (isDef(key))\r\n map[key] = i;\r\n }\r\n return map;\r\n}\r\nfunction createPatchFunction(backend) {\r\n var i, j;\r\n var cbs = {};\r\n var modules = backend.modules, nodeOps = backend.nodeOps;\r\n for (i = 0; i < hooks.length; ++i) {\r\n cbs[hooks[i]] = [];\r\n for (j = 0; j < modules.length; ++j) {\r\n if (isDef(modules[j][hooks[i]])) {\r\n cbs[hooks[i]].push(modules[j][hooks[i]]);\r\n }\r\n }\r\n }\r\n function emptyNodeAt(elm) {\r\n return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm);\r\n }\r\n function createRmCb(childElm, listeners) {\r\n function remove() {\r\n if (--remove.listeners === 0) {\r\n removeNode(childElm);\r\n }\r\n }\r\n remove.listeners = listeners;\r\n return remove;\r\n }\r\n function removeNode(el) {\r\n var parent = nodeOps.parentNode(el);\r\n // element may have already been removed due to v-html / v-text\r\n if (isDef(parent)) {\r\n nodeOps.removeChild(parent, el);\r\n }\r\n }\r\n function isUnknownElement(vnode, inVPre) {\r\n return (!inVPre &&\r\n !vnode.ns &&\r\n !(config.ignoredElements.length &&\r\n config.ignoredElements.some(function (ignore) {\r\n return isRegExp(ignore)\r\n ? ignore.test(vnode.tag)\r\n : ignore === vnode.tag;\r\n })) &&\r\n config.isUnknownElement(vnode.tag));\r\n }\r\n var creatingElmInVPre = 0;\r\n function createElm(vnode, insertedVnodeQueue, parentElm, refElm, nested, ownerArray, index) {\r\n if (isDef(vnode.elm) && isDef(ownerArray)) {\r\n // This vnode was used in a previous render!\r\n // now it's used as a new node, overwriting its elm would cause\r\n // potential patch errors down the road when it's used as an insertion\r\n // reference node. Instead, we clone the node on-demand before creating\r\n // associated DOM element for it.\r\n vnode = ownerArray[index] = cloneVNode(vnode);\r\n }\r\n vnode.isRootInsert = !nested; // for transition enter check\r\n if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {\r\n return;\r\n }\r\n var data = vnode.data;\r\n var children = vnode.children;\r\n var tag = vnode.tag;\r\n if (isDef(tag)) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n if (data && data.pre) {\r\n creatingElmInVPre++;\r\n }\r\n if (isUnknownElement(vnode, creatingElmInVPre)) {\r\n warn('Unknown custom element: <' +\r\n tag +\r\n '> - did you ' +\r\n 'register the component correctly? For recursive components, ' +\r\n 'make sure to provide the \"name\" option.', vnode.context);\r\n }\r\n }\r\n vnode.elm = vnode.ns\r\n ? nodeOps.createElementNS(vnode.ns, tag)\r\n : nodeOps.createElement(tag, vnode);\r\n setScope(vnode);\r\n createChildren(vnode, children, insertedVnodeQueue);\r\n if (isDef(data)) {\r\n invokeCreateHooks(vnode, insertedVnodeQueue);\r\n }\r\n insert(parentElm, vnode.elm, refElm);\r\n if (process.env.NODE_ENV !== 'production' && data && data.pre) {\r\n creatingElmInVPre--;\r\n }\r\n }\r\n else if (isTrue(vnode.isComment)) {\r\n vnode.elm = nodeOps.createComment(vnode.text);\r\n insert(parentElm, vnode.elm, refElm);\r\n }\r\n else {\r\n vnode.elm = nodeOps.createTextNode(vnode.text);\r\n insert(parentElm, vnode.elm, refElm);\r\n }\r\n }\r\n function createComponent(vnode, insertedVnodeQueue, parentElm, refElm) {\r\n var i = vnode.data;\r\n if (isDef(i)) {\r\n var isReactivated = isDef(vnode.componentInstance) && i.keepAlive;\r\n if (isDef((i = i.hook)) && isDef((i = i.init))) {\r\n i(vnode, false /* hydrating */);\r\n }\r\n // after calling the init hook, if the vnode is a child component\r\n // it should've created a child instance and mounted it. the child\r\n // component also has set the placeholder vnode's elm.\r\n // in that case we can just return the element and be done.\r\n if (isDef(vnode.componentInstance)) {\r\n initComponent(vnode, insertedVnodeQueue);\r\n insert(parentElm, vnode.elm, refElm);\r\n if (isTrue(isReactivated)) {\r\n reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);\r\n }\r\n return true;\r\n }\r\n }\r\n }\r\n function initComponent(vnode, insertedVnodeQueue) {\r\n if (isDef(vnode.data.pendingInsert)) {\r\n insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);\r\n vnode.data.pendingInsert = null;\r\n }\r\n vnode.elm = vnode.componentInstance.$el;\r\n if (isPatchable(vnode)) {\r\n invokeCreateHooks(vnode, insertedVnodeQueue);\r\n setScope(vnode);\r\n }\r\n else {\r\n // empty component root.\r\n // skip all element-related modules except for ref (#3455)\r\n registerRef(vnode);\r\n // make sure to invoke the insert hook\r\n insertedVnodeQueue.push(vnode);\r\n }\r\n }\r\n function reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm) {\r\n var i;\r\n // hack for #4339: a reactivated component with inner transition\r\n // does not trigger because the inner node's created hooks are not called\r\n // again. It's not ideal to involve module-specific logic in here but\r\n // there doesn't seem to be a better way to do it.\r\n var innerNode = vnode;\r\n while (innerNode.componentInstance) {\r\n innerNode = innerNode.componentInstance._vnode;\r\n if (isDef((i = innerNode.data)) && isDef((i = i.transition))) {\r\n for (i = 0; i < cbs.activate.length; ++i) {\r\n cbs.activate[i](emptyNode, innerNode);\r\n }\r\n insertedVnodeQueue.push(innerNode);\r\n break;\r\n }\r\n }\r\n // unlike a newly created component,\r\n // a reactivated keep-alive component doesn't insert itself\r\n insert(parentElm, vnode.elm, refElm);\r\n }\r\n function insert(parent, elm, ref) {\r\n if (isDef(parent)) {\r\n if (isDef(ref)) {\r\n if (nodeOps.parentNode(ref) === parent) {\r\n nodeOps.insertBefore(parent, elm, ref);\r\n }\r\n }\r\n else {\r\n nodeOps.appendChild(parent, elm);\r\n }\r\n }\r\n }\r\n function createChildren(vnode, children, insertedVnodeQueue) {\r\n if (isArray(children)) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n checkDuplicateKeys(children);\r\n }\r\n for (var i_1 = 0; i_1 < children.length; ++i_1) {\r\n createElm(children[i_1], insertedVnodeQueue, vnode.elm, null, true, children, i_1);\r\n }\r\n }\r\n else if (isPrimitive(vnode.text)) {\r\n nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(String(vnode.text)));\r\n }\r\n }\r\n function isPatchable(vnode) {\r\n while (vnode.componentInstance) {\r\n vnode = vnode.componentInstance._vnode;\r\n }\r\n return isDef(vnode.tag);\r\n }\r\n function invokeCreateHooks(vnode, insertedVnodeQueue) {\r\n for (var i_2 = 0; i_2 < cbs.create.length; ++i_2) {\r\n cbs.create[i_2](emptyNode, vnode);\r\n }\r\n i = vnode.data.hook; // Reuse variable\r\n if (isDef(i)) {\r\n if (isDef(i.create))\r\n i.create(emptyNode, vnode);\r\n if (isDef(i.insert))\r\n insertedVnodeQueue.push(vnode);\r\n }\r\n }\r\n // set scope id attribute for scoped CSS.\r\n // this is implemented as a special case to avoid the overhead\r\n // of going through the normal attribute patching process.\r\n function setScope(vnode) {\r\n var i;\r\n if (isDef((i = vnode.fnScopeId))) {\r\n nodeOps.setStyleScope(vnode.elm, i);\r\n }\r\n else {\r\n var ancestor = vnode;\r\n while (ancestor) {\r\n if (isDef((i = ancestor.context)) && isDef((i = i.$options._scopeId))) {\r\n nodeOps.setStyleScope(vnode.elm, i);\r\n }\r\n ancestor = ancestor.parent;\r\n }\r\n }\r\n // for slot content they should also get the scopeId from the host instance.\r\n if (isDef((i = activeInstance)) &&\r\n i !== vnode.context &&\r\n i !== vnode.fnContext &&\r\n isDef((i = i.$options._scopeId))) {\r\n nodeOps.setStyleScope(vnode.elm, i);\r\n }\r\n }\r\n function addVnodes(parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {\r\n for (; startIdx <= endIdx; ++startIdx) {\r\n createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm, false, vnodes, startIdx);\r\n }\r\n }\r\n function invokeDestroyHook(vnode) {\r\n var i, j;\r\n var data = vnode.data;\r\n if (isDef(data)) {\r\n if (isDef((i = data.hook)) && isDef((i = i.destroy)))\r\n i(vnode);\r\n for (i = 0; i < cbs.destroy.length; ++i)\r\n cbs.destroy[i](vnode);\r\n }\r\n if (isDef((i = vnode.children))) {\r\n for (j = 0; j < vnode.children.length; ++j) {\r\n invokeDestroyHook(vnode.children[j]);\r\n }\r\n }\r\n }\r\n function removeVnodes(vnodes, startIdx, endIdx) {\r\n for (; startIdx <= endIdx; ++startIdx) {\r\n var ch = vnodes[startIdx];\r\n if (isDef(ch)) {\r\n if (isDef(ch.tag)) {\r\n removeAndInvokeRemoveHook(ch);\r\n invokeDestroyHook(ch);\r\n }\r\n else {\r\n // Text node\r\n removeNode(ch.elm);\r\n }\r\n }\r\n }\r\n }\r\n function removeAndInvokeRemoveHook(vnode, rm) {\r\n if (isDef(rm) || isDef(vnode.data)) {\r\n var i_3;\r\n var listeners = cbs.remove.length + 1;\r\n if (isDef(rm)) {\r\n // we have a recursively passed down rm callback\r\n // increase the listeners count\r\n rm.listeners += listeners;\r\n }\r\n else {\r\n // directly removing\r\n rm = createRmCb(vnode.elm, listeners);\r\n }\r\n // recursively invoke hooks on child component root node\r\n if (isDef((i_3 = vnode.componentInstance)) &&\r\n isDef((i_3 = i_3._vnode)) &&\r\n isDef(i_3.data)) {\r\n removeAndInvokeRemoveHook(i_3, rm);\r\n }\r\n for (i_3 = 0; i_3 < cbs.remove.length; ++i_3) {\r\n cbs.remove[i_3](vnode, rm);\r\n }\r\n if (isDef((i_3 = vnode.data.hook)) && isDef((i_3 = i_3.remove))) {\r\n i_3(vnode, rm);\r\n }\r\n else {\r\n rm();\r\n }\r\n }\r\n else {\r\n removeNode(vnode.elm);\r\n }\r\n }\r\n function updateChildren(parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {\r\n var oldStartIdx = 0;\r\n var newStartIdx = 0;\r\n var oldEndIdx = oldCh.length - 1;\r\n var oldStartVnode = oldCh[0];\r\n var oldEndVnode = oldCh[oldEndIdx];\r\n var newEndIdx = newCh.length - 1;\r\n var newStartVnode = newCh[0];\r\n var newEndVnode = newCh[newEndIdx];\r\n var oldKeyToIdx, idxInOld, vnodeToMove, refElm;\r\n // removeOnly is a special flag used only by <transition-group>\r\n // to ensure removed elements stay in correct relative positions\r\n // during leaving transitions\r\n var canMove = !removeOnly;\r\n if (process.env.NODE_ENV !== 'production') {\r\n checkDuplicateKeys(newCh);\r\n }\r\n while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {\r\n if (isUndef(oldStartVnode)) {\r\n oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left\r\n }\r\n else if (isUndef(oldEndVnode)) {\r\n oldEndVnode = oldCh[--oldEndIdx];\r\n }\r\n else if (sameVnode(oldStartVnode, newStartVnode)) {\r\n patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);\r\n oldStartVnode = oldCh[++oldStartIdx];\r\n newStartVnode = newCh[++newStartIdx];\r\n }\r\n else if (sameVnode(oldEndVnode, newEndVnode)) {\r\n patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);\r\n oldEndVnode = oldCh[--oldEndIdx];\r\n newEndVnode = newCh[--newEndIdx];\r\n }\r\n else if (sameVnode(oldStartVnode, newEndVnode)) {\r\n // Vnode moved right\r\n patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);\r\n canMove &&\r\n nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));\r\n oldStartVnode = oldCh[++oldStartIdx];\r\n newEndVnode = newCh[--newEndIdx];\r\n }\r\n else if (sameVnode(oldEndVnode, newStartVnode)) {\r\n // Vnode moved left\r\n patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);\r\n canMove &&\r\n nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);\r\n oldEndVnode = oldCh[--oldEndIdx];\r\n newStartVnode = newCh[++newStartIdx];\r\n }\r\n else {\r\n if (isUndef(oldKeyToIdx))\r\n oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx);\r\n idxInOld = isDef(newStartVnode.key)\r\n ? oldKeyToIdx[newStartVnode.key]\r\n : findIdxInOld(newStartVnode, oldCh, oldStartIdx, oldEndIdx);\r\n if (isUndef(idxInOld)) {\r\n // New element\r\n createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);\r\n }\r\n else {\r\n vnodeToMove = oldCh[idxInOld];\r\n if (sameVnode(vnodeToMove, newStartVnode)) {\r\n patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);\r\n oldCh[idxInOld] = undefined;\r\n canMove &&\r\n nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm);\r\n }\r\n else {\r\n // same key but different element. treat as new element\r\n createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);\r\n }\r\n }\r\n newStartVnode = newCh[++newStartIdx];\r\n }\r\n }\r\n if (oldStartIdx > oldEndIdx) {\r\n refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;\r\n addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);\r\n }\r\n else if (newStartIdx > newEndIdx) {\r\n removeVnodes(oldCh, oldStartIdx, oldEndIdx);\r\n }\r\n }\r\n function checkDuplicateKeys(children) {\r\n var seenKeys = {};\r\n for (var i_4 = 0; i_4 < children.length; i_4++) {\r\n var vnode = children[i_4];\r\n var key = vnode.key;\r\n if (isDef(key)) {\r\n if (seenKeys[key]) {\r\n warn(\"Duplicate keys detected: '\".concat(key, \"'. This may cause an update error.\"), vnode.context);\r\n }\r\n else {\r\n seenKeys[key] = true;\r\n }\r\n }\r\n }\r\n }\r\n function findIdxInOld(node, oldCh, start, end) {\r\n for (var i_5 = start; i_5 < end; i_5++) {\r\n var c = oldCh[i_5];\r\n if (isDef(c) && sameVnode(node, c))\r\n return i_5;\r\n }\r\n }\r\n function patchVnode(oldVnode, vnode, insertedVnodeQueue, ownerArray, index, removeOnly) {\r\n if (oldVnode === vnode) {\r\n return;\r\n }\r\n if (isDef(vnode.elm) && isDef(ownerArray)) {\r\n // clone reused vnode\r\n vnode = ownerArray[index] = cloneVNode(vnode);\r\n }\r\n var elm = (vnode.elm = oldVnode.elm);\r\n if (isTrue(oldVnode.isAsyncPlaceholder)) {\r\n if (isDef(vnode.asyncFactory.resolved)) {\r\n hydrate(oldVnode.elm, vnode, insertedVnodeQueue);\r\n }\r\n else {\r\n vnode.isAsyncPlaceholder = true;\r\n }\r\n return;\r\n }\r\n // reuse element for static trees.\r\n // note we only do this if the vnode is cloned -\r\n // if the new node is not cloned it means the render functions have been\r\n // reset by the hot-reload-api and we need to do a proper re-render.\r\n if (isTrue(vnode.isStatic) &&\r\n isTrue(oldVnode.isStatic) &&\r\n vnode.key === oldVnode.key &&\r\n (isTrue(vnode.isCloned) || isTrue(vnode.isOnce))) {\r\n vnode.componentInstance = oldVnode.componentInstance;\r\n return;\r\n }\r\n var i;\r\n var data = vnode.data;\r\n if (isDef(data) && isDef((i = data.hook)) && isDef((i = i.prepatch))) {\r\n i(oldVnode, vnode);\r\n }\r\n var oldCh = oldVnode.children;\r\n var ch = vnode.children;\r\n if (isDef(data) && isPatchable(vnode)) {\r\n for (i = 0; i < cbs.update.length; ++i)\r\n cbs.update[i](oldVnode, vnode);\r\n if (isDef((i = data.hook)) && isDef((i = i.update)))\r\n i(oldVnode, vnode);\r\n }\r\n if (isUndef(vnode.text)) {\r\n if (isDef(oldCh) && isDef(ch)) {\r\n if (oldCh !== ch)\r\n updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly);\r\n }\r\n else if (isDef(ch)) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n checkDuplicateKeys(ch);\r\n }\r\n if (isDef(oldVnode.text))\r\n nodeOps.setTextContent(elm, '');\r\n addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);\r\n }\r\n else if (isDef(oldCh)) {\r\n removeVnodes(oldCh, 0, oldCh.length - 1);\r\n }\r\n else if (isDef(oldVnode.text)) {\r\n nodeOps.setTextContent(elm, '');\r\n }\r\n }\r\n else if (oldVnode.text !== vnode.text) {\r\n nodeOps.setTextContent(elm, vnode.text);\r\n }\r\n if (isDef(data)) {\r\n if (isDef((i = data.hook)) && isDef((i = i.postpatch)))\r\n i(oldVnode, vnode);\r\n }\r\n }\r\n function invokeInsertHook(vnode, queue, initial) {\r\n // delay insert hooks for component root nodes, invoke them after the\r\n // element is really inserted\r\n if (isTrue(initial) && isDef(vnode.parent)) {\r\n vnode.parent.data.pendingInsert = queue;\r\n }\r\n else {\r\n for (var i_6 = 0; i_6 < queue.length; ++i_6) {\r\n queue[i_6].data.hook.insert(queue[i_6]);\r\n }\r\n }\r\n }\r\n var hydrationBailed = false;\r\n // list of modules that can skip create hook during hydration because they\r\n // are already rendered on the client or has no need for initialization\r\n // Note: style is excluded because it relies on initial clone for future\r\n // deep updates (#7063).\r\n var isRenderedModule = makeMap('attrs,class,staticClass,staticStyle,key');\r\n // Note: this is a browser-only function so we can assume elms are DOM nodes.\r\n function hydrate(elm, vnode, insertedVnodeQueue, inVPre) {\r\n var i;\r\n var tag = vnode.tag, data = vnode.data, children = vnode.children;\r\n inVPre = inVPre || (data && data.pre);\r\n vnode.elm = elm;\r\n if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) {\r\n vnode.isAsyncPlaceholder = true;\r\n return true;\r\n }\r\n // assert node match\r\n if (process.env.NODE_ENV !== 'production') {\r\n if (!assertNodeMatch(elm, vnode, inVPre)) {\r\n return false;\r\n }\r\n }\r\n if (isDef(data)) {\r\n if (isDef((i = data.hook)) && isDef((i = i.init)))\r\n i(vnode, true /* hydrating */);\r\n if (isDef((i = vnode.componentInstance))) {\r\n // child component. it should have hydrated its own tree.\r\n initComponent(vnode, insertedVnodeQueue);\r\n return true;\r\n }\r\n }\r\n if (isDef(tag)) {\r\n if (isDef(children)) {\r\n // empty element, allow client to pick up and populate children\r\n if (!elm.hasChildNodes()) {\r\n createChildren(vnode, children, insertedVnodeQueue);\r\n }\r\n else {\r\n // v-html and domProps: innerHTML\r\n if (isDef((i = data)) &&\r\n isDef((i = i.domProps)) &&\r\n isDef((i = i.innerHTML))) {\r\n if (i !== elm.innerHTML) {\r\n /* istanbul ignore if */\r\n if (process.env.NODE_ENV !== 'production' &&\r\n typeof console !== 'undefined' &&\r\n !hydrationBailed) {\r\n hydrationBailed = true;\r\n console.warn('Parent: ', elm);\r\n console.warn('server innerHTML: ', i);\r\n console.warn('client innerHTML: ', elm.innerHTML);\r\n }\r\n return false;\r\n }\r\n }\r\n else {\r\n // iterate and compare children lists\r\n var childrenMatch = true;\r\n var childNode = elm.firstChild;\r\n for (var i_7 = 0; i_7 < children.length; i_7++) {\r\n if (!childNode ||\r\n !hydrate(childNode, children[i_7], insertedVnodeQueue, inVPre)) {\r\n childrenMatch = false;\r\n break;\r\n }\r\n childNode = childNode.nextSibling;\r\n }\r\n // if childNode is not null, it means the actual childNodes list is\r\n // longer than the virtual children list.\r\n if (!childrenMatch || childNode) {\r\n /* istanbul ignore if */\r\n if (process.env.NODE_ENV !== 'production' &&\r\n typeof console !== 'undefined' &&\r\n !hydrationBailed) {\r\n hydrationBailed = true;\r\n console.warn('Parent: ', elm);\r\n console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children);\r\n }\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n if (isDef(data)) {\r\n var fullInvoke = false;\r\n for (var key in data) {\r\n if (!isRenderedModule(key)) {\r\n fullInvoke = true;\r\n invokeCreateHooks(vnode, insertedVnodeQueue);\r\n break;\r\n }\r\n }\r\n if (!fullInvoke && data['class']) {\r\n // ensure collecting deps for deep class bindings for future updates\r\n traverse(data['class']);\r\n }\r\n }\r\n }\r\n else if (elm.data !== vnode.text) {\r\n elm.data = vnode.text;\r\n }\r\n return true;\r\n }\r\n function assertNodeMatch(node, vnode, inVPre) {\r\n if (isDef(vnode.tag)) {\r\n return (vnode.tag.indexOf('vue-component') === 0 ||\r\n (!isUnknownElement(vnode, inVPre) &&\r\n vnode.tag.toLowerCase() ===\r\n (node.tagName && node.tagName.toLowerCase())));\r\n }\r\n else {\r\n return node.nodeType === (vnode.isComment ? 8 : 3);\r\n }\r\n }\r\n return function patch(oldVnode, vnode, hydrating, removeOnly) {\r\n if (isUndef(vnode)) {\r\n if (isDef(oldVnode))\r\n invokeDestroyHook(oldVnode);\r\n return;\r\n }\r\n var isInitialPatch = false;\r\n var insertedVnodeQueue = [];\r\n if (isUndef(oldVnode)) {\r\n // empty mount (likely as component), create new root element\r\n isInitialPatch = true;\r\n createElm(vnode, insertedVnodeQueue);\r\n }\r\n else {\r\n var isRealElement = isDef(oldVnode.nodeType);\r\n if (!isRealElement && sameVnode(oldVnode, vnode)) {\r\n // patch existing root node\r\n patchVnode(oldVnode, vnode, insertedVnodeQueue, null, null, removeOnly);\r\n }\r\n else {\r\n if (isRealElement) {\r\n // mounting to a real element\r\n // check if this is server-rendered content and if we can perform\r\n // a successful hydration.\r\n if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) {\r\n oldVnode.removeAttribute(SSR_ATTR);\r\n hydrating = true;\r\n }\r\n if (isTrue(hydrating)) {\r\n if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {\r\n invokeInsertHook(vnode, insertedVnodeQueue, true);\r\n return oldVnode;\r\n }\r\n else if (process.env.NODE_ENV !== 'production') {\r\n warn('The client-side rendered virtual DOM tree is not matching ' +\r\n 'server-rendered content. This is likely caused by incorrect ' +\r\n 'HTML markup, for example nesting block-level elements inside ' +\r\n '<p>, or missing <tbody>. Bailing hydration and performing ' +\r\n 'full client-side render.');\r\n }\r\n }\r\n // either not server-rendered, or hydration failed.\r\n // create an empty node and replace it\r\n oldVnode = emptyNodeAt(oldVnode);\r\n }\r\n // replacing existing element\r\n var oldElm = oldVnode.elm;\r\n var parentElm = nodeOps.parentNode(oldElm);\r\n // create new node\r\n createElm(vnode, insertedVnodeQueue, \r\n // extremely rare edge case: do not insert if old element is in a\r\n // leaving transition. Only happens when combining transition +\r\n // keep-alive + HOCs. (#4590)\r\n oldElm._leaveCb ? null : parentElm, nodeOps.nextSibling(oldElm));\r\n // update parent placeholder node element, recursively\r\n if (isDef(vnode.parent)) {\r\n var ancestor = vnode.parent;\r\n var patchable = isPatchable(vnode);\r\n while (ancestor) {\r\n for (var i_8 = 0; i_8 < cbs.destroy.length; ++i_8) {\r\n cbs.destroy[i_8](ancestor);\r\n }\r\n ancestor.elm = vnode.elm;\r\n if (patchable) {\r\n for (var i_9 = 0; i_9 < cbs.create.length; ++i_9) {\r\n cbs.create[i_9](emptyNode, ancestor);\r\n }\r\n // #6513\r\n // invoke insert hooks that may have been merged by create hooks.\r\n // e.g. for directives that uses the \"inserted\" hook.\r\n var insert_1 = ancestor.data.hook.insert;\r\n if (insert_1.merged) {\r\n // start at index 1 to avoid re-invoking component mounted hook\r\n for (var i_10 = 1; i_10 < insert_1.fns.length; i_10++) {\r\n insert_1.fns[i_10]();\r\n }\r\n }\r\n }\r\n else {\r\n registerRef(ancestor);\r\n }\r\n ancestor = ancestor.parent;\r\n }\r\n }\r\n // destroy old node\r\n if (isDef(parentElm)) {\r\n removeVnodes([oldVnode], 0, 0);\r\n }\r\n else if (isDef(oldVnode.tag)) {\r\n invokeDestroyHook(oldVnode);\r\n }\r\n }\r\n }\r\n invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);\r\n return vnode.elm;\r\n };\r\n}\n\nvar directives = {\r\n create: updateDirectives,\r\n update: updateDirectives,\r\n destroy: function unbindDirectives(vnode) {\r\n // @ts-expect-error emptyNode is not VNodeWithData\r\n updateDirectives(vnode, emptyNode);\r\n }\r\n};\r\nfunction updateDirectives(oldVnode, vnode) {\r\n if (oldVnode.data.directives || vnode.data.directives) {\r\n _update(oldVnode, vnode);\r\n }\r\n}\r\nfunction _update(oldVnode, vnode) {\r\n var isCreate = oldVnode === emptyNode;\r\n var isDestroy = vnode === emptyNode;\r\n var oldDirs = normalizeDirectives(oldVnode.data.directives, oldVnode.context);\r\n var newDirs = normalizeDirectives(vnode.data.directives, vnode.context);\r\n var dirsWithInsert = [];\r\n var dirsWithPostpatch = [];\r\n var key, oldDir, dir;\r\n for (key in newDirs) {\r\n oldDir = oldDirs[key];\r\n dir = newDirs[key];\r\n if (!oldDir) {\r\n // new directive, bind\r\n callHook(dir, 'bind', vnode, oldVnode);\r\n if (dir.def && dir.def.inserted) {\r\n dirsWithInsert.push(dir);\r\n }\r\n }\r\n else {\r\n // existing directive, update\r\n dir.oldValue = oldDir.value;\r\n dir.oldArg = oldDir.arg;\r\n callHook(dir, 'update', vnode, oldVnode);\r\n if (dir.def && dir.def.componentUpdated) {\r\n dirsWithPostpatch.push(dir);\r\n }\r\n }\r\n }\r\n if (dirsWithInsert.length) {\r\n var callInsert = function () {\r\n for (var i = 0; i < dirsWithInsert.length; i++) {\r\n callHook(dirsWithInsert[i], 'inserted', vnode, oldVnode);\r\n }\r\n };\r\n if (isCreate) {\r\n mergeVNodeHook(vnode, 'insert', callInsert);\r\n }\r\n else {\r\n callInsert();\r\n }\r\n }\r\n if (dirsWithPostpatch.length) {\r\n mergeVNodeHook(vnode, 'postpatch', function () {\r\n for (var i = 0; i < dirsWithPostpatch.length; i++) {\r\n callHook(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode);\r\n }\r\n });\r\n }\r\n if (!isCreate) {\r\n for (key in oldDirs) {\r\n if (!newDirs[key]) {\r\n // no longer present, unbind\r\n callHook(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy);\r\n }\r\n }\r\n }\r\n}\r\nvar emptyModifiers = Object.create(null);\r\nfunction normalizeDirectives(dirs, vm) {\r\n var res = Object.create(null);\r\n if (!dirs) {\r\n // $flow-disable-line\r\n return res;\r\n }\r\n var i, dir;\r\n for (i = 0; i < dirs.length; i++) {\r\n dir = dirs[i];\r\n if (!dir.modifiers) {\r\n // $flow-disable-line\r\n dir.modifiers = emptyModifiers;\r\n }\r\n res[getRawDirName(dir)] = dir;\r\n if (vm._setupState && vm._setupState.__sfc) {\r\n var setupDef = dir.def || resolveAsset(vm, '_setupState', 'v-' + dir.name);\r\n if (typeof setupDef === 'function') {\r\n dir.def = {\r\n bind: setupDef,\r\n update: setupDef,\r\n };\r\n }\r\n else {\r\n dir.def = setupDef;\r\n }\r\n }\r\n dir.def = dir.def || resolveAsset(vm.$options, 'directives', dir.name, true);\r\n }\r\n // $flow-disable-line\r\n return res;\r\n}\r\nfunction getRawDirName(dir) {\r\n return (dir.rawName || \"\".concat(dir.name, \".\").concat(Object.keys(dir.modifiers || {}).join('.')));\r\n}\r\nfunction callHook(dir, hook, vnode, oldVnode, isDestroy) {\r\n var fn = dir.def && dir.def[hook];\r\n if (fn) {\r\n try {\r\n fn(vnode.elm, dir, vnode, oldVnode, isDestroy);\r\n }\r\n catch (e) {\r\n handleError(e, vnode.context, \"directive \".concat(dir.name, \" \").concat(hook, \" hook\"));\r\n }\r\n }\r\n}\n\nvar baseModules = [ref, directives];\n\nfunction updateAttrs(oldVnode, vnode) {\r\n var opts = vnode.componentOptions;\r\n if (isDef(opts) && opts.Ctor.options.inheritAttrs === false) {\r\n return;\r\n }\r\n if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) {\r\n return;\r\n }\r\n var key, cur, old;\r\n var elm = vnode.elm;\r\n var oldAttrs = oldVnode.data.attrs || {};\r\n var attrs = vnode.data.attrs || {};\r\n // clone observed objects, as the user probably wants to mutate it\r\n if (isDef(attrs.__ob__) || isTrue(attrs._v_attr_proxy)) {\r\n attrs = vnode.data.attrs = extend({}, attrs);\r\n }\r\n for (key in attrs) {\r\n cur = attrs[key];\r\n old = oldAttrs[key];\r\n if (old !== cur) {\r\n setAttr(elm, key, cur, vnode.data.pre);\r\n }\r\n }\r\n // #4391: in IE9, setting type can reset value for input[type=radio]\r\n // #6666: IE/Edge forces progress value down to 1 before setting a max\r\n /* istanbul ignore if */\r\n if ((isIE || isEdge) && attrs.value !== oldAttrs.value) {\r\n setAttr(elm, 'value', attrs.value);\r\n }\r\n for (key in oldAttrs) {\r\n if (isUndef(attrs[key])) {\r\n if (isXlink(key)) {\r\n elm.removeAttributeNS(xlinkNS, getXlinkProp(key));\r\n }\r\n else if (!isEnumeratedAttr(key)) {\r\n elm.removeAttribute(key);\r\n }\r\n }\r\n }\r\n}\r\nfunction setAttr(el, key, value, isInPre) {\r\n if (isInPre || el.tagName.indexOf('-') > -1) {\r\n baseSetAttr(el, key, value);\r\n }\r\n else if (isBooleanAttr(key)) {\r\n // set attribute for blank value\r\n // e.g. <option disabled>Select one</option>\r\n if (isFalsyAttrValue(value)) {\r\n el.removeAttribute(key);\r\n }\r\n else {\r\n // technically allowfullscreen is a boolean attribute for <iframe>,\r\n // but Flash expects a value of \"true\" when used on <embed> tag\r\n value = key === 'allowfullscreen' && el.tagName === 'EMBED' ? 'true' : key;\r\n el.setAttribute(key, value);\r\n }\r\n }\r\n else if (isEnumeratedAttr(key)) {\r\n el.setAttribute(key, convertEnumeratedValue(key, value));\r\n }\r\n else if (isXlink(key)) {\r\n if (isFalsyAttrValue(value)) {\r\n el.removeAttributeNS(xlinkNS, getXlinkProp(key));\r\n }\r\n else {\r\n el.setAttributeNS(xlinkNS, key, value);\r\n }\r\n }\r\n else {\r\n baseSetAttr(el, key, value);\r\n }\r\n}\r\nfunction baseSetAttr(el, key, value) {\r\n if (isFalsyAttrValue(value)) {\r\n el.removeAttribute(key);\r\n }\r\n else {\r\n // #7138: IE10 & 11 fires input event when setting placeholder on\r\n // <textarea>... block the first input event and remove the blocker\r\n // immediately.\r\n /* istanbul ignore if */\r\n if (isIE &&\r\n !isIE9 &&\r\n el.tagName === 'TEXTAREA' &&\r\n key === 'placeholder' &&\r\n value !== '' &&\r\n !el.__ieph) {\r\n var blocker_1 = function (e) {\r\n e.stopImmediatePropagation();\r\n el.removeEventListener('input', blocker_1);\r\n };\r\n el.addEventListener('input', blocker_1);\r\n // $flow-disable-line\r\n el.__ieph = true; /* IE placeholder patched */\r\n }\r\n el.setAttribute(key, value);\r\n }\r\n}\r\nvar attrs = {\r\n create: updateAttrs,\r\n update: updateAttrs\r\n};\n\nfunction updateClass(oldVnode, vnode) {\r\n var el = vnode.elm;\r\n var data = vnode.data;\r\n var oldData = oldVnode.data;\r\n if (isUndef(data.staticClass) &&\r\n isUndef(data.class) &&\r\n (isUndef(oldData) ||\r\n (isUndef(oldData.staticClass) && isUndef(oldData.class)))) {\r\n return;\r\n }\r\n var cls = genClassForVnode(vnode);\r\n // handle transition classes\r\n var transitionClass = el._transitionClasses;\r\n if (isDef(transitionClass)) {\r\n cls = concat(cls, stringifyClass(transitionClass));\r\n }\r\n // set the class\r\n if (cls !== el._prevClass) {\r\n el.setAttribute('class', cls);\r\n el._prevClass = cls;\r\n }\r\n}\r\nvar klass = {\r\n create: updateClass,\r\n update: updateClass\r\n};\n\n// in some cases, the event used has to be determined at runtime\r\n// so we used some reserved tokens during compile.\r\nvar RANGE_TOKEN = '__r';\r\nvar CHECKBOX_RADIO_TOKEN = '__c';\n\n// normalize v-model event tokens that can only be determined at runtime.\r\n// it's important to place the event as the first in the array because\r\n// the whole point is ensuring the v-model callback gets called before\r\n// user-attached handlers.\r\nfunction normalizeEvents(on) {\r\n /* istanbul ignore if */\r\n if (isDef(on[RANGE_TOKEN])) {\r\n // IE input[type=range] only supports `change` event\r\n var event_1 = isIE ? 'change' : 'input';\r\n on[event_1] = [].concat(on[RANGE_TOKEN], on[event_1] || []);\r\n delete on[RANGE_TOKEN];\r\n }\r\n // This was originally intended to fix #4521 but no longer necessary\r\n // after 2.5. Keeping it for backwards compat with generated code from < 2.4\r\n /* istanbul ignore if */\r\n if (isDef(on[CHECKBOX_RADIO_TOKEN])) {\r\n on.change = [].concat(on[CHECKBOX_RADIO_TOKEN], on.change || []);\r\n delete on[CHECKBOX_RADIO_TOKEN];\r\n }\r\n}\r\nvar target;\r\nfunction createOnceHandler(event, handler, capture) {\r\n var _target = target; // save current target element in closure\r\n return function onceHandler() {\r\n var res = handler.apply(null, arguments);\r\n if (res !== null) {\r\n remove(event, onceHandler, capture, _target);\r\n }\r\n };\r\n}\r\n// #9446: Firefox <= 53 (in particular, ESR 52) has incorrect Event.timeStamp\r\n// implementation and does not fire microtasks in between event propagation, so\r\n// safe to exclude.\r\nvar useMicrotaskFix = isUsingMicroTask && !(isFF && Number(isFF[1]) <= 53);\r\nfunction add(name, handler, capture, passive) {\r\n // async edge case #6566: inner click event triggers patch, event handler\r\n // attached to outer element during patch, and triggered again. This\r\n // happens because browsers fire microtask ticks between event propagation.\r\n // the solution is simple: we save the timestamp when a handler is attached,\r\n // and the handler would only fire if the event passed to it was fired\r\n // AFTER it was attached.\r\n if (useMicrotaskFix) {\r\n var attachedTimestamp_1 = currentFlushTimestamp;\r\n var original_1 = handler;\r\n //@ts-expect-error\r\n handler = original_1._wrapper = function (e) {\r\n if (\r\n // no bubbling, should always fire.\r\n // this is just a safety net in case event.timeStamp is unreliable in\r\n // certain weird environments...\r\n e.target === e.currentTarget ||\r\n // event is fired after handler attachment\r\n e.timeStamp >= attachedTimestamp_1 ||\r\n // bail for environments that have buggy event.timeStamp implementations\r\n // #9462 iOS 9 bug: event.timeStamp is 0 after history.pushState\r\n // #9681 QtWebEngine event.timeStamp is negative value\r\n e.timeStamp <= 0 ||\r\n // #9448 bail if event is fired in another document in a multi-page\r\n // electron/nw.js app, since event.timeStamp will be using a different\r\n // starting reference\r\n e.target.ownerDocument !== document) {\r\n return original_1.apply(this, arguments);\r\n }\r\n };\r\n }\r\n target.addEventListener(name, handler, supportsPassive ? { capture: capture, passive: passive } : capture);\r\n}\r\nfunction remove(name, handler, capture, _target) {\r\n (_target || target).removeEventListener(name, \r\n //@ts-expect-error\r\n handler._wrapper || handler, capture);\r\n}\r\nfunction updateDOMListeners(oldVnode, vnode) {\r\n if (isUndef(oldVnode.data.on) && isUndef(vnode.data.on)) {\r\n return;\r\n }\r\n var on = vnode.data.on || {};\r\n var oldOn = oldVnode.data.on || {};\r\n // vnode is empty when removing all listeners,\r\n // and use old vnode dom element\r\n target = vnode.elm || oldVnode.elm;\r\n normalizeEvents(on);\r\n updateListeners(on, oldOn, add, remove, createOnceHandler, vnode.context);\r\n target = undefined;\r\n}\r\nvar events = {\r\n create: updateDOMListeners,\r\n update: updateDOMListeners,\r\n // @ts-expect-error emptyNode has actually data\r\n destroy: function (vnode) { return updateDOMListeners(vnode, emptyNode); }\r\n};\n\nvar svgContainer;\r\nfunction updateDOMProps(oldVnode, vnode) {\r\n if (isUndef(oldVnode.data.domProps) && isUndef(vnode.data.domProps)) {\r\n return;\r\n }\r\n var key, cur;\r\n var elm = vnode.elm;\r\n var oldProps = oldVnode.data.domProps || {};\r\n var props = vnode.data.domProps || {};\r\n // clone observed objects, as the user probably wants to mutate it\r\n if (isDef(props.__ob__) || isTrue(props._v_attr_proxy)) {\r\n props = vnode.data.domProps = extend({}, props);\r\n }\r\n for (key in oldProps) {\r\n if (!(key in props)) {\r\n elm[key] = '';\r\n }\r\n }\r\n for (key in props) {\r\n cur = props[key];\r\n // ignore children if the node has textContent or innerHTML,\r\n // as these will throw away existing DOM nodes and cause removal errors\r\n // on subsequent patches (#3360)\r\n if (key === 'textContent' || key === 'innerHTML') {\r\n if (vnode.children)\r\n vnode.children.length = 0;\r\n if (cur === oldProps[key])\r\n continue;\r\n // #6601 work around Chrome version <= 55 bug where single textNode\r\n // replaced by innerHTML/textContent retains its parentNode property\r\n if (elm.childNodes.length === 1) {\r\n elm.removeChild(elm.childNodes[0]);\r\n }\r\n }\r\n if (key === 'value' && elm.tagName !== 'PROGRESS') {\r\n // store value as _value as well since\r\n // non-string values will be stringified\r\n elm._value = cur;\r\n // avoid resetting cursor position when value is the same\r\n var strCur = isUndef(cur) ? '' : String(cur);\r\n if (shouldUpdateValue(elm, strCur)) {\r\n elm.value = strCur;\r\n }\r\n }\r\n else if (key === 'innerHTML' &&\r\n isSVG(elm.tagName) &&\r\n isUndef(elm.innerHTML)) {\r\n // IE doesn't support innerHTML for SVG elements\r\n svgContainer = svgContainer || document.createElement('div');\r\n svgContainer.innerHTML = \"<svg>\".concat(cur, \"</svg>\");\r\n var svg = svgContainer.firstChild;\r\n while (elm.firstChild) {\r\n elm.removeChild(elm.firstChild);\r\n }\r\n while (svg.firstChild) {\r\n elm.appendChild(svg.firstChild);\r\n }\r\n }\r\n else if (\r\n // skip the update if old and new VDOM state is the same.\r\n // `value` is handled separately because the DOM value may be temporarily\r\n // out of sync with VDOM state due to focus, composition and modifiers.\r\n // This #4521 by skipping the unnecessary `checked` update.\r\n cur !== oldProps[key]) {\r\n // some property updates can throw\r\n // e.g. `value` on <progress> w/ non-finite value\r\n try {\r\n elm[key] = cur;\r\n }\r\n catch (e) { }\r\n }\r\n }\r\n}\r\nfunction shouldUpdateValue(elm, checkVal) {\r\n return (\r\n //@ts-expect-error\r\n !elm.composing &&\r\n (elm.tagName === 'OPTION' ||\r\n isNotInFocusAndDirty(elm, checkVal) ||\r\n isDirtyWithModifiers(elm, checkVal)));\r\n}\r\nfunction isNotInFocusAndDirty(elm, checkVal) {\r\n // return true when textbox (.number and .trim) loses focus and its value is\r\n // not equal to the updated value\r\n var notInFocus = true;\r\n // #6157\r\n // work around IE bug when accessing document.activeElement in an iframe\r\n try {\r\n notInFocus = document.activeElement !== elm;\r\n }\r\n catch (e) { }\r\n return notInFocus && elm.value !== checkVal;\r\n}\r\nfunction isDirtyWithModifiers(elm, newVal) {\r\n var value = elm.value;\r\n var modifiers = elm._vModifiers; // injected by v-model runtime\r\n if (isDef(modifiers)) {\r\n if (modifiers.number) {\r\n return toNumber(value) !== toNumber(newVal);\r\n }\r\n if (modifiers.trim) {\r\n return value.trim() !== newVal.trim();\r\n }\r\n }\r\n return value !== newVal;\r\n}\r\nvar domProps = {\r\n create: updateDOMProps,\r\n update: updateDOMProps\r\n};\n\nvar parseStyleText = cached(function (cssText) {\r\n var res = {};\r\n var listDelimiter = /;(?![^(]*\\))/g;\r\n var propertyDelimiter = /:(.+)/;\r\n cssText.split(listDelimiter).forEach(function (item) {\r\n if (item) {\r\n var tmp = item.split(propertyDelimiter);\r\n tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());\r\n }\r\n });\r\n return res;\r\n});\r\n// merge static and dynamic style data on the same vnode\r\nfunction normalizeStyleData(data) {\r\n var style = normalizeStyleBinding(data.style);\r\n // static style is pre-processed into an object during compilation\r\n // and is always a fresh object, so it's safe to merge into it\r\n return data.staticStyle ? extend(data.staticStyle, style) : style;\r\n}\r\n// normalize possible array / string values into Object\r\nfunction normalizeStyleBinding(bindingStyle) {\r\n if (Array.isArray(bindingStyle)) {\r\n return toObject(bindingStyle);\r\n }\r\n if (typeof bindingStyle === 'string') {\r\n return parseStyleText(bindingStyle);\r\n }\r\n return bindingStyle;\r\n}\r\n/**\r\n * parent component style should be after child's\r\n * so that parent component's style could override it\r\n */\r\nfunction getStyle(vnode, checkChild) {\r\n var res = {};\r\n var styleData;\r\n if (checkChild) {\r\n var childNode = vnode;\r\n while (childNode.componentInstance) {\r\n childNode = childNode.componentInstance._vnode;\r\n if (childNode &&\r\n childNode.data &&\r\n (styleData = normalizeStyleData(childNode.data))) {\r\n extend(res, styleData);\r\n }\r\n }\r\n }\r\n if ((styleData = normalizeStyleData(vnode.data))) {\r\n extend(res, styleData);\r\n }\r\n var parentNode = vnode;\r\n // @ts-expect-error parentNode.parent not VNodeWithData\r\n while ((parentNode = parentNode.parent)) {\r\n if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {\r\n extend(res, styleData);\r\n }\r\n }\r\n return res;\r\n}\n\nvar cssVarRE = /^--/;\r\nvar importantRE = /\\s*!important$/;\r\nvar setProp = function (el, name, val) {\r\n /* istanbul ignore if */\r\n if (cssVarRE.test(name)) {\r\n el.style.setProperty(name, val);\r\n }\r\n else if (importantRE.test(val)) {\r\n el.style.setProperty(hyphenate(name), val.replace(importantRE, ''), 'important');\r\n }\r\n else {\r\n var normalizedName = normalize(name);\r\n if (Array.isArray(val)) {\r\n // Support values array created by autoprefixer, e.g.\r\n // {display: [\"-webkit-box\", \"-ms-flexbox\", \"flex\"]}\r\n // Set them one by one, and the browser will only set those it can recognize\r\n for (var i = 0, len = val.length; i < len; i++) {\r\n el.style[normalizedName] = val[i];\r\n }\r\n }\r\n else {\r\n el.style[normalizedName] = val;\r\n }\r\n }\r\n};\r\nvar vendorNames = ['Webkit', 'Moz', 'ms'];\r\nvar emptyStyle;\r\nvar normalize = cached(function (prop) {\r\n emptyStyle = emptyStyle || document.createElement('div').style;\r\n prop = camelize(prop);\r\n if (prop !== 'filter' && prop in emptyStyle) {\r\n return prop;\r\n }\r\n var capName = prop.charAt(0).toUpperCase() + prop.slice(1);\r\n for (var i = 0; i < vendorNames.length; i++) {\r\n var name_1 = vendorNames[i] + capName;\r\n if (name_1 in emptyStyle) {\r\n return name_1;\r\n }\r\n }\r\n});\r\nfunction updateStyle(oldVnode, vnode) {\r\n var data = vnode.data;\r\n var oldData = oldVnode.data;\r\n if (isUndef(data.staticStyle) &&\r\n isUndef(data.style) &&\r\n isUndef(oldData.staticStyle) &&\r\n isUndef(oldData.style)) {\r\n return;\r\n }\r\n var cur, name;\r\n var el = vnode.elm;\r\n var oldStaticStyle = oldData.staticStyle;\r\n var oldStyleBinding = oldData.normalizedStyle || oldData.style || {};\r\n // if static style exists, stylebinding already merged into it when doing normalizeStyleData\r\n var oldStyle = oldStaticStyle || oldStyleBinding;\r\n var style = normalizeStyleBinding(vnode.data.style) || {};\r\n // store normalized style under a different key for next diff\r\n // make sure to clone it if it's reactive, since the user likely wants\r\n // to mutate it.\r\n vnode.data.normalizedStyle = isDef(style.__ob__) ? extend({}, style) : style;\r\n var newStyle = getStyle(vnode, true);\r\n for (name in oldStyle) {\r\n if (isUndef(newStyle[name])) {\r\n setProp(el, name, '');\r\n }\r\n }\r\n for (name in newStyle) {\r\n cur = newStyle[name];\r\n if (cur !== oldStyle[name]) {\r\n // ie9 setting to null has no effect, must use empty string\r\n setProp(el, name, cur == null ? '' : cur);\r\n }\r\n }\r\n}\r\nvar style = {\r\n create: updateStyle,\r\n update: updateStyle\r\n};\n\nvar whitespaceRE = /\\s+/;\r\n/**\r\n * Add class with compatibility for SVG since classList is not supported on\r\n * SVG elements in IE\r\n */\r\nfunction addClass(el, cls) {\r\n /* istanbul ignore if */\r\n if (!cls || !(cls = cls.trim())) {\r\n return;\r\n }\r\n /* istanbul ignore else */\r\n if (el.classList) {\r\n if (cls.indexOf(' ') > -1) {\r\n cls.split(whitespaceRE).forEach(function (c) { return el.classList.add(c); });\r\n }\r\n else {\r\n el.classList.add(cls);\r\n }\r\n }\r\n else {\r\n var cur = \" \".concat(el.getAttribute('class') || '', \" \");\r\n if (cur.indexOf(' ' + cls + ' ') < 0) {\r\n el.setAttribute('class', (cur + cls).trim());\r\n }\r\n }\r\n}\r\n/**\r\n * Remove class with compatibility for SVG since classList is not supported on\r\n * SVG elements in IE\r\n */\r\nfunction removeClass(el, cls) {\r\n /* istanbul ignore if */\r\n if (!cls || !(cls = cls.trim())) {\r\n return;\r\n }\r\n /* istanbul ignore else */\r\n if (el.classList) {\r\n if (cls.indexOf(' ') > -1) {\r\n cls.split(whitespaceRE).forEach(function (c) { return el.classList.remove(c); });\r\n }\r\n else {\r\n el.classList.remove(cls);\r\n }\r\n if (!el.classList.length) {\r\n el.removeAttribute('class');\r\n }\r\n }\r\n else {\r\n var cur = \" \".concat(el.getAttribute('class') || '', \" \");\r\n var tar = ' ' + cls + ' ';\r\n while (cur.indexOf(tar) >= 0) {\r\n cur = cur.replace(tar, ' ');\r\n }\r\n cur = cur.trim();\r\n if (cur) {\r\n el.setAttribute('class', cur);\r\n }\r\n else {\r\n el.removeAttribute('class');\r\n }\r\n }\r\n}\n\nfunction resolveTransition(def) {\r\n if (!def) {\r\n return;\r\n }\r\n /* istanbul ignore else */\r\n if (typeof def === 'object') {\r\n var res = {};\r\n if (def.css !== false) {\r\n extend(res, autoCssTransition(def.name || 'v'));\r\n }\r\n extend(res, def);\r\n return res;\r\n }\r\n else if (typeof def === 'string') {\r\n return autoCssTransition(def);\r\n }\r\n}\r\nvar autoCssTransition = cached(function (name) {\r\n return {\r\n enterClass: \"\".concat(name, \"-enter\"),\r\n enterToClass: \"\".concat(name, \"-enter-to\"),\r\n enterActiveClass: \"\".concat(name, \"-enter-active\"),\r\n leaveClass: \"\".concat(name, \"-leave\"),\r\n leaveToClass: \"\".concat(name, \"-leave-to\"),\r\n leaveActiveClass: \"\".concat(name, \"-leave-active\")\r\n };\r\n});\r\nvar hasTransition = inBrowser && !isIE9;\r\nvar TRANSITION = 'transition';\r\nvar ANIMATION = 'animation';\r\n// Transition property/event sniffing\r\nvar transitionProp = 'transition';\r\nvar transitionEndEvent = 'transitionend';\r\nvar animationProp = 'animation';\r\nvar animationEndEvent = 'animationend';\r\nif (hasTransition) {\r\n /* istanbul ignore if */\r\n if (window.ontransitionend === undefined &&\r\n window.onwebkittransitionend !== undefined) {\r\n transitionProp = 'WebkitTransition';\r\n transitionEndEvent = 'webkitTransitionEnd';\r\n }\r\n if (window.onanimationend === undefined &&\r\n window.onwebkitanimationend !== undefined) {\r\n animationProp = 'WebkitAnimation';\r\n animationEndEvent = 'webkitAnimationEnd';\r\n }\r\n}\r\n// binding to window is necessary to make hot reload work in IE in strict mode\r\nvar raf = inBrowser\r\n ? window.requestAnimationFrame\r\n ? window.requestAnimationFrame.bind(window)\r\n : setTimeout\r\n : /* istanbul ignore next */ function (/* istanbul ignore next */ fn) { return fn(); };\r\nfunction nextFrame(fn) {\r\n raf(function () {\r\n // @ts-expect-error\r\n raf(fn);\r\n });\r\n}\r\nfunction addTransitionClass(el, cls) {\r\n var transitionClasses = el._transitionClasses || (el._transitionClasses = []);\r\n if (transitionClasses.indexOf(cls) < 0) {\r\n transitionClasses.push(cls);\r\n addClass(el, cls);\r\n }\r\n}\r\nfunction removeTransitionClass(el, cls) {\r\n if (el._transitionClasses) {\r\n remove$2(el._transitionClasses, cls);\r\n }\r\n removeClass(el, cls);\r\n}\r\nfunction whenTransitionEnds(el, expectedType, cb) {\r\n var _a = getTransitionInfo(el, expectedType), type = _a.type, timeout = _a.timeout, propCount = _a.propCount;\r\n if (!type)\r\n return cb();\r\n var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;\r\n var ended = 0;\r\n var end = function () {\r\n el.removeEventListener(event, onEnd);\r\n cb();\r\n };\r\n var onEnd = function (e) {\r\n if (e.target === el) {\r\n if (++ended >= propCount) {\r\n end();\r\n }\r\n }\r\n };\r\n setTimeout(function () {\r\n if (ended < propCount) {\r\n end();\r\n }\r\n }, timeout + 1);\r\n el.addEventListener(event, onEnd);\r\n}\r\nvar transformRE = /\\b(transform|all)(,|$)/;\r\nfunction getTransitionInfo(el, expectedType) {\r\n var styles = window.getComputedStyle(el);\r\n // JSDOM may return undefined for transition properties\r\n var transitionDelays = (styles[transitionProp + 'Delay'] || '').split(', ');\r\n var transitionDurations = (styles[transitionProp + 'Duration'] || '').split(', ');\r\n var transitionTimeout = getTimeout(transitionDelays, transitionDurations);\r\n var animationDelays = (styles[animationProp + 'Delay'] || '').split(', ');\r\n var animationDurations = (styles[animationProp + 'Duration'] || '').split(', ');\r\n var animationTimeout = getTimeout(animationDelays, animationDurations);\r\n var type;\r\n var timeout = 0;\r\n var propCount = 0;\r\n /* istanbul ignore if */\r\n if (expectedType === TRANSITION) {\r\n if (transitionTimeout > 0) {\r\n type = TRANSITION;\r\n timeout = transitionTimeout;\r\n propCount = transitionDurations.length;\r\n }\r\n }\r\n else if (expectedType === ANIMATION) {\r\n if (animationTimeout > 0) {\r\n type = ANIMATION;\r\n timeout = animationTimeout;\r\n propCount = animationDurations.length;\r\n }\r\n }\r\n else {\r\n timeout = Math.max(transitionTimeout, animationTimeout);\r\n type =\r\n timeout > 0\r\n ? transitionTimeout > animationTimeout\r\n ? TRANSITION\r\n : ANIMATION\r\n : null;\r\n propCount = type\r\n ? type === TRANSITION\r\n ? transitionDurations.length\r\n : animationDurations.length\r\n : 0;\r\n }\r\n var hasTransform = type === TRANSITION && transformRE.test(styles[transitionProp + 'Property']);\r\n return {\r\n type: type,\r\n timeout: timeout,\r\n propCount: propCount,\r\n hasTransform: hasTransform\r\n };\r\n}\r\nfunction getTimeout(delays, durations) {\r\n /* istanbul ignore next */\r\n while (delays.length < durations.length) {\r\n delays = delays.concat(delays);\r\n }\r\n return Math.max.apply(null, durations.map(function (d, i) {\r\n return toMs(d) + toMs(delays[i]);\r\n }));\r\n}\r\n// Old versions of Chromium (below 61.0.3163.100) formats floating pointer numbers\r\n// in a locale-dependent way, using a comma instead of a dot.\r\n// If comma is not replaced with a dot, the input will be rounded down (i.e. acting\r\n// as a floor function) causing unexpected behaviors\r\nfunction toMs(s) {\r\n return Number(s.slice(0, -1).replace(',', '.')) * 1000;\r\n}\n\nfunction enter(vnode, toggleDisplay) {\r\n var el = vnode.elm;\r\n // call leave callback now\r\n if (isDef(el._leaveCb)) {\r\n el._leaveCb.cancelled = true;\r\n el._leaveCb();\r\n }\r\n var data = resolveTransition(vnode.data.transition);\r\n if (isUndef(data)) {\r\n return;\r\n }\r\n /* istanbul ignore if */\r\n if (isDef(el._enterCb) || el.nodeType !== 1) {\r\n return;\r\n }\r\n var css = data.css, type = data.type, enterClass = data.enterClass, enterToClass = data.enterToClass, enterActiveClass = data.enterActiveClass, appearClass = data.appearClass, appearToClass = data.appearToClass, appearActiveClass = data.appearActiveClass, beforeEnter = data.beforeEnter, enter = data.enter, afterEnter = data.afterEnter, enterCancelled = data.enterCancelled, beforeAppear = data.beforeAppear, appear = data.appear, afterAppear = data.afterAppear, appearCancelled = data.appearCancelled, duration = data.duration;\r\n // activeInstance will always be the <transition> component managing this\r\n // transition. One edge case to check is when the <transition> is placed\r\n // as the root node of a child component. In that case we need to check\r\n // <transition>'s parent for appear check.\r\n var context = activeInstance;\r\n var transitionNode = activeInstance.$vnode;\r\n while (transitionNode && transitionNode.parent) {\r\n context = transitionNode.context;\r\n transitionNode = transitionNode.parent;\r\n }\r\n var isAppear = !context._isMounted || !vnode.isRootInsert;\r\n if (isAppear && !appear && appear !== '') {\r\n return;\r\n }\r\n var startClass = isAppear && appearClass ? appearClass : enterClass;\r\n var activeClass = isAppear && appearActiveClass ? appearActiveClass : enterActiveClass;\r\n var toClass = isAppear && appearToClass ? appearToClass : enterToClass;\r\n var beforeEnterHook = isAppear ? beforeAppear || beforeEnter : beforeEnter;\r\n var enterHook = isAppear ? (isFunction(appear) ? appear : enter) : enter;\r\n var afterEnterHook = isAppear ? afterAppear || afterEnter : afterEnter;\r\n var enterCancelledHook = isAppear\r\n ? appearCancelled || enterCancelled\r\n : enterCancelled;\r\n var explicitEnterDuration = toNumber(isObject(duration) ? duration.enter : duration);\r\n if (process.env.NODE_ENV !== 'production' && explicitEnterDuration != null) {\r\n checkDuration(explicitEnterDuration, 'enter', vnode);\r\n }\r\n var expectsCSS = css !== false && !isIE9;\r\n var userWantsControl = getHookArgumentsLength(enterHook);\r\n var cb = (el._enterCb = once(function () {\r\n if (expectsCSS) {\r\n removeTransitionClass(el, toClass);\r\n removeTransitionClass(el, activeClass);\r\n }\r\n // @ts-expect-error\r\n if (cb.cancelled) {\r\n if (expectsCSS) {\r\n removeTransitionClass(el, startClass);\r\n }\r\n enterCancelledHook && enterCancelledHook(el);\r\n }\r\n else {\r\n afterEnterHook && afterEnterHook(el);\r\n }\r\n el._enterCb = null;\r\n }));\r\n if (!vnode.data.show) {\r\n // remove pending leave element on enter by injecting an insert hook\r\n mergeVNodeHook(vnode, 'insert', function () {\r\n var parent = el.parentNode;\r\n var pendingNode = parent && parent._pending && parent._pending[vnode.key];\r\n if (pendingNode &&\r\n pendingNode.tag === vnode.tag &&\r\n pendingNode.elm._leaveCb) {\r\n pendingNode.elm._leaveCb();\r\n }\r\n enterHook && enterHook(el, cb);\r\n });\r\n }\r\n // start enter transition\r\n beforeEnterHook && beforeEnterHook(el);\r\n if (expectsCSS) {\r\n addTransitionClass(el, startClass);\r\n addTransitionClass(el, activeClass);\r\n nextFrame(function () {\r\n removeTransitionClass(el, startClass);\r\n // @ts-expect-error\r\n if (!cb.cancelled) {\r\n addTransitionClass(el, toClass);\r\n if (!userWantsControl) {\r\n if (isValidDuration(explicitEnterDuration)) {\r\n setTimeout(cb, explicitEnterDuration);\r\n }\r\n else {\r\n whenTransitionEnds(el, type, cb);\r\n }\r\n }\r\n }\r\n });\r\n }\r\n if (vnode.data.show) {\r\n toggleDisplay && toggleDisplay();\r\n enterHook && enterHook(el, cb);\r\n }\r\n if (!expectsCSS && !userWantsControl) {\r\n cb();\r\n }\r\n}\r\nfunction leave(vnode, rm) {\r\n var el = vnode.elm;\r\n // call enter callback now\r\n if (isDef(el._enterCb)) {\r\n el._enterCb.cancelled = true;\r\n el._enterCb();\r\n }\r\n var data = resolveTransition(vnode.data.transition);\r\n if (isUndef(data) || el.nodeType !== 1) {\r\n return rm();\r\n }\r\n /* istanbul ignore if */\r\n if (isDef(el._leaveCb)) {\r\n return;\r\n }\r\n var css = data.css, type = data.type, leaveClass = data.leaveClass, leaveToClass = data.leaveToClass, leaveActiveClass = data.leaveActiveClass, beforeLeave = data.beforeLeave, leave = data.leave, afterLeave = data.afterLeave, leaveCancelled = data.leaveCancelled, delayLeave = data.delayLeave, duration = data.duration;\r\n var expectsCSS = css !== false && !isIE9;\r\n var userWantsControl = getHookArgumentsLength(leave);\r\n var explicitLeaveDuration = toNumber(isObject(duration) ? duration.leave : duration);\r\n if (process.env.NODE_ENV !== 'production' && isDef(explicitLeaveDuration)) {\r\n checkDuration(explicitLeaveDuration, 'leave', vnode);\r\n }\r\n var cb = (el._leaveCb = once(function () {\r\n if (el.parentNode && el.parentNode._pending) {\r\n el.parentNode._pending[vnode.key] = null;\r\n }\r\n if (expectsCSS) {\r\n removeTransitionClass(el, leaveToClass);\r\n removeTransitionClass(el, leaveActiveClass);\r\n }\r\n // @ts-expect-error\r\n if (cb.cancelled) {\r\n if (expectsCSS) {\r\n removeTransitionClass(el, leaveClass);\r\n }\r\n leaveCancelled && leaveCancelled(el);\r\n }\r\n else {\r\n rm();\r\n afterLeave && afterLeave(el);\r\n }\r\n el._leaveCb = null;\r\n }));\r\n if (delayLeave) {\r\n delayLeave(performLeave);\r\n }\r\n else {\r\n performLeave();\r\n }\r\n function performLeave() {\r\n // the delayed leave may have already been cancelled\r\n // @ts-expect-error\r\n if (cb.cancelled) {\r\n return;\r\n }\r\n // record leaving element\r\n if (!vnode.data.show && el.parentNode) {\r\n (el.parentNode._pending || (el.parentNode._pending = {}))[vnode.key] =\r\n vnode;\r\n }\r\n beforeLeave && beforeLeave(el);\r\n if (expectsCSS) {\r\n addTransitionClass(el, leaveClass);\r\n addTransitionClass(el, leaveActiveClass);\r\n nextFrame(function () {\r\n removeTransitionClass(el, leaveClass);\r\n // @ts-expect-error\r\n if (!cb.cancelled) {\r\n addTransitionClass(el, leaveToClass);\r\n if (!userWantsControl) {\r\n if (isValidDuration(explicitLeaveDuration)) {\r\n setTimeout(cb, explicitLeaveDuration);\r\n }\r\n else {\r\n whenTransitionEnds(el, type, cb);\r\n }\r\n }\r\n }\r\n });\r\n }\r\n leave && leave(el, cb);\r\n if (!expectsCSS && !userWantsControl) {\r\n cb();\r\n }\r\n }\r\n}\r\n// only used in dev mode\r\nfunction checkDuration(val, name, vnode) {\r\n if (typeof val !== 'number') {\r\n warn(\"<transition> explicit \".concat(name, \" duration is not a valid number - \") +\r\n \"got \".concat(JSON.stringify(val), \".\"), vnode.context);\r\n }\r\n else if (isNaN(val)) {\r\n warn(\"<transition> explicit \".concat(name, \" duration is NaN - \") +\r\n 'the duration expression might be incorrect.', vnode.context);\r\n }\r\n}\r\nfunction isValidDuration(val) {\r\n return typeof val === 'number' && !isNaN(val);\r\n}\r\n/**\r\n * Normalize a transition hook's argument length. The hook may be:\r\n * - a merged hook (invoker) with the original in .fns\r\n * - a wrapped component method (check ._length)\r\n * - a plain function (.length)\r\n */\r\nfunction getHookArgumentsLength(fn) {\r\n if (isUndef(fn)) {\r\n return false;\r\n }\r\n // @ts-expect-error\r\n var invokerFns = fn.fns;\r\n if (isDef(invokerFns)) {\r\n // invoker\r\n return getHookArgumentsLength(Array.isArray(invokerFns) ? invokerFns[0] : invokerFns);\r\n }\r\n else {\r\n // @ts-expect-error\r\n return (fn._length || fn.length) > 1;\r\n }\r\n}\r\nfunction _enter(_, vnode) {\r\n if (vnode.data.show !== true) {\r\n enter(vnode);\r\n }\r\n}\r\nvar transition = inBrowser\r\n ? {\r\n create: _enter,\r\n activate: _enter,\r\n remove: function (vnode, rm) {\r\n /* istanbul ignore else */\r\n if (vnode.data.show !== true) {\r\n // @ts-expect-error\r\n leave(vnode, rm);\r\n }\r\n else {\r\n rm();\r\n }\r\n }\r\n }\r\n : {};\n\nvar platformModules = [attrs, klass, events, domProps, style, transition];\n\n// the directive module should be applied last, after all\r\n// built-in modules have been applied.\r\nvar modules = platformModules.concat(baseModules);\r\nvar patch = createPatchFunction({ nodeOps: nodeOps, modules: modules });\n\n/**\r\n * Not type checking this file because flow doesn't like attaching\r\n * properties to Elements.\r\n */\r\n/* istanbul ignore if */\r\nif (isIE9) {\r\n // http://www.matts411.com/post/internet-explorer-9-oninput/\r\n document.addEventListener('selectionchange', function () {\r\n var el = document.activeElement;\r\n // @ts-expect-error\r\n if (el && el.vmodel) {\r\n trigger(el, 'input');\r\n }\r\n });\r\n}\r\nvar directive = {\r\n inserted: function (el, binding, vnode, oldVnode) {\r\n if (vnode.tag === 'select') {\r\n // #6903\r\n if (oldVnode.elm && !oldVnode.elm._vOptions) {\r\n mergeVNodeHook(vnode, 'postpatch', function () {\r\n directive.componentUpdated(el, binding, vnode);\r\n });\r\n }\r\n else {\r\n setSelected(el, binding, vnode.context);\r\n }\r\n el._vOptions = [].map.call(el.options, getValue);\r\n }\r\n else if (vnode.tag === 'textarea' || isTextInputType(el.type)) {\r\n el._vModifiers = binding.modifiers;\r\n if (!binding.modifiers.lazy) {\r\n el.addEventListener('compositionstart', onCompositionStart);\r\n el.addEventListener('compositionend', onCompositionEnd);\r\n // Safari < 10.2 & UIWebView doesn't fire compositionend when\r\n // switching focus before confirming composition choice\r\n // this also fixes the issue where some browsers e.g. iOS Chrome\r\n // fires \"change\" instead of \"input\" on autocomplete.\r\n el.addEventListener('change', onCompositionEnd);\r\n /* istanbul ignore if */\r\n if (isIE9) {\r\n el.vmodel = true;\r\n }\r\n }\r\n }\r\n },\r\n componentUpdated: function (el, binding, vnode) {\r\n if (vnode.tag === 'select') {\r\n setSelected(el, binding, vnode.context);\r\n // in case the options rendered by v-for have changed,\r\n // it's possible that the value is out-of-sync with the rendered options.\r\n // detect such cases and filter out values that no longer has a matching\r\n // option in the DOM.\r\n var prevOptions_1 = el._vOptions;\r\n var curOptions_1 = (el._vOptions = [].map.call(el.options, getValue));\r\n if (curOptions_1.some(function (o, i) { return !looseEqual(o, prevOptions_1[i]); })) {\r\n // trigger change event if\r\n // no matching option found for at least one value\r\n var needReset = el.multiple\r\n ? binding.value.some(function (v) { return hasNoMatchingOption(v, curOptions_1); })\r\n : binding.value !== binding.oldValue &&\r\n hasNoMatchingOption(binding.value, curOptions_1);\r\n if (needReset) {\r\n trigger(el, 'change');\r\n }\r\n }\r\n }\r\n }\r\n};\r\nfunction setSelected(el, binding, vm) {\r\n actuallySetSelected(el, binding, vm);\r\n /* istanbul ignore if */\r\n if (isIE || isEdge) {\r\n setTimeout(function () {\r\n actuallySetSelected(el, binding, vm);\r\n }, 0);\r\n }\r\n}\r\nfunction actuallySetSelected(el, binding, vm) {\r\n var value = binding.value;\r\n var isMultiple = el.multiple;\r\n if (isMultiple && !Array.isArray(value)) {\r\n process.env.NODE_ENV !== 'production' &&\r\n warn(\"<select multiple v-model=\\\"\".concat(binding.expression, \"\\\"> \") +\r\n \"expects an Array value for its binding, but got \".concat(Object.prototype.toString\r\n .call(value)\r\n .slice(8, -1)), vm);\r\n return;\r\n }\r\n var selected, option;\r\n for (var i = 0, l = el.options.length; i < l; i++) {\r\n option = el.options[i];\r\n if (isMultiple) {\r\n selected = looseIndexOf(value, getValue(option)) > -1;\r\n if (option.selected !== selected) {\r\n option.selected = selected;\r\n }\r\n }\r\n else {\r\n if (looseEqual(getValue(option), value)) {\r\n if (el.selectedIndex !== i) {\r\n el.selectedIndex = i;\r\n }\r\n return;\r\n }\r\n }\r\n }\r\n if (!isMultiple) {\r\n el.selectedIndex = -1;\r\n }\r\n}\r\nfunction hasNoMatchingOption(value, options) {\r\n return options.every(function (o) { return !looseEqual(o, value); });\r\n}\r\nfunction getValue(option) {\r\n return '_value' in option ? option._value : option.value;\r\n}\r\nfunction onCompositionStart(e) {\r\n e.target.composing = true;\r\n}\r\nfunction onCompositionEnd(e) {\r\n // prevent triggering an input event for no reason\r\n if (!e.target.composing)\r\n return;\r\n e.target.composing = false;\r\n trigger(e.target, 'input');\r\n}\r\nfunction trigger(el, type) {\r\n var e = document.createEvent('HTMLEvents');\r\n e.initEvent(type, true, true);\r\n el.dispatchEvent(e);\r\n}\n\n// recursively search for possible transition defined inside the component root\r\nfunction locateNode(vnode) {\r\n // @ts-expect-error\r\n return vnode.componentInstance && (!vnode.data || !vnode.data.transition)\r\n ? locateNode(vnode.componentInstance._vnode)\r\n : vnode;\r\n}\r\nvar show = {\r\n bind: function (el, _a, vnode) {\r\n var value = _a.value;\r\n vnode = locateNode(vnode);\r\n var transition = vnode.data && vnode.data.transition;\r\n var originalDisplay = (el.__vOriginalDisplay =\r\n el.style.display === 'none' ? '' : el.style.display);\r\n if (value && transition) {\r\n vnode.data.show = true;\r\n enter(vnode, function () {\r\n el.style.display = originalDisplay;\r\n });\r\n }\r\n else {\r\n el.style.display = value ? originalDisplay : 'none';\r\n }\r\n },\r\n update: function (el, _a, vnode) {\r\n var value = _a.value, oldValue = _a.oldValue;\r\n /* istanbul ignore if */\r\n if (!value === !oldValue)\r\n return;\r\n vnode = locateNode(vnode);\r\n var transition = vnode.data && vnode.data.transition;\r\n if (transition) {\r\n vnode.data.show = true;\r\n if (value) {\r\n enter(vnode, function () {\r\n el.style.display = el.__vOriginalDisplay;\r\n });\r\n }\r\n else {\r\n leave(vnode, function () {\r\n el.style.display = 'none';\r\n });\r\n }\r\n }\r\n else {\r\n el.style.display = value ? el.__vOriginalDisplay : 'none';\r\n }\r\n },\r\n unbind: function (el, binding, vnode, oldVnode, isDestroy) {\r\n if (!isDestroy) {\r\n el.style.display = el.__vOriginalDisplay;\r\n }\r\n }\r\n};\n\nvar platformDirectives = {\r\n model: directive,\r\n show: show\r\n};\n\n// Provides transition support for a single element/component.\r\nvar transitionProps = {\r\n name: String,\r\n appear: Boolean,\r\n css: Boolean,\r\n mode: String,\r\n type: String,\r\n enterClass: String,\r\n leaveClass: String,\r\n enterToClass: String,\r\n leaveToClass: String,\r\n enterActiveClass: String,\r\n leaveActiveClass: String,\r\n appearClass: String,\r\n appearActiveClass: String,\r\n appearToClass: String,\r\n duration: [Number, String, Object]\r\n};\r\n// in case the child is also an abstract component, e.g. <keep-alive>\r\n// we want to recursively retrieve the real component to be rendered\r\nfunction getRealChild(vnode) {\r\n var compOptions = vnode && vnode.componentOptions;\r\n if (compOptions && compOptions.Ctor.options.abstract) {\r\n return getRealChild(getFirstComponentChild(compOptions.children));\r\n }\r\n else {\r\n return vnode;\r\n }\r\n}\r\nfunction extractTransitionData(comp) {\r\n var data = {};\r\n var options = comp.$options;\r\n // props\r\n for (var key in options.propsData) {\r\n data[key] = comp[key];\r\n }\r\n // events.\r\n // extract listeners and pass them directly to the transition methods\r\n var listeners = options._parentListeners;\r\n for (var key in listeners) {\r\n data[camelize(key)] = listeners[key];\r\n }\r\n return data;\r\n}\r\nfunction placeholder(h, rawChild) {\r\n // @ts-expect-error\r\n if (/\\d-keep-alive$/.test(rawChild.tag)) {\r\n return h('keep-alive', {\r\n props: rawChild.componentOptions.propsData\r\n });\r\n }\r\n}\r\nfunction hasParentTransition(vnode) {\r\n while ((vnode = vnode.parent)) {\r\n if (vnode.data.transition) {\r\n return true;\r\n }\r\n }\r\n}\r\nfunction isSameChild(child, oldChild) {\r\n return oldChild.key === child.key && oldChild.tag === child.tag;\r\n}\r\nvar isNotTextNode = function (c) { return c.tag || isAsyncPlaceholder(c); };\r\nvar isVShowDirective = function (d) { return d.name === 'show'; };\r\nvar Transition = {\r\n name: 'transition',\r\n props: transitionProps,\r\n abstract: true,\r\n render: function (h) {\r\n var _this = this;\r\n var children = this.$slots.default;\r\n if (!children) {\r\n return;\r\n }\r\n // filter out text nodes (possible whitespaces)\r\n children = children.filter(isNotTextNode);\r\n /* istanbul ignore if */\r\n if (!children.length) {\r\n return;\r\n }\r\n // warn multiple elements\r\n if (process.env.NODE_ENV !== 'production' && children.length > 1) {\r\n warn('<transition> can only be used on a single element. Use ' +\r\n '<transition-group> for lists.', this.$parent);\r\n }\r\n var mode = this.mode;\r\n // warn invalid mode\r\n if (process.env.NODE_ENV !== 'production' && mode && mode !== 'in-out' && mode !== 'out-in') {\r\n warn('invalid <transition> mode: ' + mode, this.$parent);\r\n }\r\n var rawChild = children[0];\r\n // if this is a component root node and the component's\r\n // parent container node also has transition, skip.\r\n if (hasParentTransition(this.$vnode)) {\r\n return rawChild;\r\n }\r\n // apply transition data to child\r\n // use getRealChild() to ignore abstract components e.g. keep-alive\r\n var child = getRealChild(rawChild);\r\n /* istanbul ignore if */\r\n if (!child) {\r\n return rawChild;\r\n }\r\n if (this._leaving) {\r\n return placeholder(h, rawChild);\r\n }\r\n // ensure a key that is unique to the vnode type and to this transition\r\n // component instance. This key will be used to remove pending leaving nodes\r\n // during entering.\r\n var id = \"__transition-\".concat(this._uid, \"-\");\r\n child.key =\r\n child.key == null\r\n ? child.isComment\r\n ? id + 'comment'\r\n : id + child.tag\r\n : isPrimitive(child.key)\r\n ? String(child.key).indexOf(id) === 0\r\n ? child.key\r\n : id + child.key\r\n : child.key;\r\n var data = ((child.data || (child.data = {})).transition =\r\n extractTransitionData(this));\r\n var oldRawChild = this._vnode;\r\n var oldChild = getRealChild(oldRawChild);\r\n // mark v-show\r\n // so that the transition module can hand over the control to the directive\r\n if (child.data.directives && child.data.directives.some(isVShowDirective)) {\r\n child.data.show = true;\r\n }\r\n if (oldChild &&\r\n oldChild.data &&\r\n !isSameChild(child, oldChild) &&\r\n !isAsyncPlaceholder(oldChild) &&\r\n // #6687 component root is a comment node\r\n !(oldChild.componentInstance &&\r\n oldChild.componentInstance._vnode.isComment)) {\r\n // replace old child transition data with fresh one\r\n // important for dynamic transitions!\r\n var oldData = (oldChild.data.transition = extend({}, data));\r\n // handle transition mode\r\n if (mode === 'out-in') {\r\n // return placeholder node and queue update when leave finishes\r\n this._leaving = true;\r\n mergeVNodeHook(oldData, 'afterLeave', function () {\r\n _this._leaving = false;\r\n _this.$forceUpdate();\r\n });\r\n return placeholder(h, rawChild);\r\n }\r\n else if (mode === 'in-out') {\r\n if (isAsyncPlaceholder(child)) {\r\n return oldRawChild;\r\n }\r\n var delayedLeave_1;\r\n var performLeave = function () {\r\n delayedLeave_1();\r\n };\r\n mergeVNodeHook(data, 'afterEnter', performLeave);\r\n mergeVNodeHook(data, 'enterCancelled', performLeave);\r\n mergeVNodeHook(oldData, 'delayLeave', function (leave) {\r\n delayedLeave_1 = leave;\r\n });\r\n }\r\n }\r\n return rawChild;\r\n }\r\n};\n\n// Provides transition support for list items.\r\nvar props = extend({\r\n tag: String,\r\n moveClass: String\r\n}, transitionProps);\r\ndelete props.mode;\r\nvar TransitionGroup = {\r\n props: props,\r\n beforeMount: function () {\r\n var _this = this;\r\n var update = this._update;\r\n this._update = function (vnode, hydrating) {\r\n var restoreActiveInstance = setActiveInstance(_this);\r\n // force removing pass\r\n _this.__patch__(_this._vnode, _this.kept, false, // hydrating\r\n true // removeOnly (!important, avoids unnecessary moves)\r\n );\r\n _this._vnode = _this.kept;\r\n restoreActiveInstance();\r\n update.call(_this, vnode, hydrating);\r\n };\r\n },\r\n render: function (h) {\r\n var tag = this.tag || this.$vnode.data.tag || 'span';\r\n var map = Object.create(null);\r\n var prevChildren = (this.prevChildren = this.children);\r\n var rawChildren = this.$slots.default || [];\r\n var children = (this.children = []);\r\n var transitionData = extractTransitionData(this);\r\n for (var i = 0; i < rawChildren.length; i++) {\r\n var c = rawChildren[i];\r\n if (c.tag) {\r\n if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {\r\n children.push(c);\r\n map[c.key] = c;\r\n (c.data || (c.data = {})).transition = transitionData;\r\n }\r\n else if (process.env.NODE_ENV !== 'production') {\r\n var opts = c.componentOptions;\r\n var name_1 = opts\r\n ? getComponentName(opts.Ctor.options) || opts.tag || ''\r\n : c.tag;\r\n warn(\"<transition-group> children must be keyed: <\".concat(name_1, \">\"));\r\n }\r\n }\r\n }\r\n if (prevChildren) {\r\n var kept = [];\r\n var removed = [];\r\n for (var i = 0; i < prevChildren.length; i++) {\r\n var c = prevChildren[i];\r\n c.data.transition = transitionData;\r\n // @ts-expect-error .getBoundingClientRect is not typed in Node\r\n c.data.pos = c.elm.getBoundingClientRect();\r\n if (map[c.key]) {\r\n kept.push(c);\r\n }\r\n else {\r\n removed.push(c);\r\n }\r\n }\r\n this.kept = h(tag, null, kept);\r\n this.removed = removed;\r\n }\r\n return h(tag, null, children);\r\n },\r\n updated: function () {\r\n var children = this.prevChildren;\r\n var moveClass = this.moveClass || (this.name || 'v') + '-move';\r\n if (!children.length || !this.hasMove(children[0].elm, moveClass)) {\r\n return;\r\n }\r\n // we divide the work into three loops to avoid mixing DOM reads and writes\r\n // in each iteration - which helps prevent layout thrashing.\r\n children.forEach(callPendingCbs);\r\n children.forEach(recordPosition);\r\n children.forEach(applyTranslation);\r\n // force reflow to put everything in position\r\n // assign to this to avoid being removed in tree-shaking\r\n // $flow-disable-line\r\n this._reflow = document.body.offsetHeight;\r\n children.forEach(function (c) {\r\n if (c.data.moved) {\r\n var el_1 = c.elm;\r\n var s = el_1.style;\r\n addTransitionClass(el_1, moveClass);\r\n s.transform = s.WebkitTransform = s.transitionDuration = '';\r\n el_1.addEventListener(transitionEndEvent, (el_1._moveCb = function cb(e) {\r\n if (e && e.target !== el_1) {\r\n return;\r\n }\r\n if (!e || /transform$/.test(e.propertyName)) {\r\n el_1.removeEventListener(transitionEndEvent, cb);\r\n el_1._moveCb = null;\r\n removeTransitionClass(el_1, moveClass);\r\n }\r\n }));\r\n }\r\n });\r\n },\r\n methods: {\r\n hasMove: function (el, moveClass) {\r\n /* istanbul ignore if */\r\n if (!hasTransition) {\r\n return false;\r\n }\r\n /* istanbul ignore if */\r\n if (this._hasMove) {\r\n return this._hasMove;\r\n }\r\n // Detect whether an element with the move class applied has\r\n // CSS transitions. Since the element may be inside an entering\r\n // transition at this very moment, we make a clone of it and remove\r\n // all other transition classes applied to ensure only the move class\r\n // is applied.\r\n var clone = el.cloneNode();\r\n if (el._transitionClasses) {\r\n el._transitionClasses.forEach(function (cls) {\r\n removeClass(clone, cls);\r\n });\r\n }\r\n addClass(clone, moveClass);\r\n clone.style.display = 'none';\r\n this.$el.appendChild(clone);\r\n var info = getTransitionInfo(clone);\r\n this.$el.removeChild(clone);\r\n return (this._hasMove = info.hasTransform);\r\n }\r\n }\r\n};\r\nfunction callPendingCbs(c) {\r\n /* istanbul ignore if */\r\n if (c.elm._moveCb) {\r\n c.elm._moveCb();\r\n }\r\n /* istanbul ignore if */\r\n if (c.elm._enterCb) {\r\n c.elm._enterCb();\r\n }\r\n}\r\nfunction recordPosition(c) {\r\n c.data.newPos = c.elm.getBoundingClientRect();\r\n}\r\nfunction applyTranslation(c) {\r\n var oldPos = c.data.pos;\r\n var newPos = c.data.newPos;\r\n var dx = oldPos.left - newPos.left;\r\n var dy = oldPos.top - newPos.top;\r\n if (dx || dy) {\r\n c.data.moved = true;\r\n var s = c.elm.style;\r\n s.transform = s.WebkitTransform = \"translate(\".concat(dx, \"px,\").concat(dy, \"px)\");\r\n s.transitionDuration = '0s';\r\n }\r\n}\n\nvar platformComponents = {\r\n Transition: Transition,\r\n TransitionGroup: TransitionGroup\r\n};\n\n// install platform specific utils\r\nVue.config.mustUseProp = mustUseProp;\r\nVue.config.isReservedTag = isReservedTag;\r\nVue.config.isReservedAttr = isReservedAttr;\r\nVue.config.getTagNamespace = getTagNamespace;\r\nVue.config.isUnknownElement = isUnknownElement;\r\n// install platform runtime directives & components\r\nextend(Vue.options.directives, platformDirectives);\r\nextend(Vue.options.components, platformComponents);\r\n// install platform patch function\r\nVue.prototype.__patch__ = inBrowser ? patch : noop;\r\n// public mount method\r\nVue.prototype.$mount = function (el, hydrating) {\r\n el = el && inBrowser ? query(el) : undefined;\r\n return mountComponent(this, el, hydrating);\r\n};\r\n// devtools global hook\r\n/* istanbul ignore next */\r\nif (inBrowser) {\r\n setTimeout(function () {\r\n if (config.devtools) {\r\n if (devtools) {\r\n devtools.emit('init', Vue);\r\n }\r\n else if (process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test') {\r\n // @ts-expect-error\r\n console[console.info ? 'info' : 'log']('Download the Vue Devtools extension for a better development experience:\\n' +\r\n 'https://github.com/vuejs/vue-devtools');\r\n }\r\n }\r\n if (process.env.NODE_ENV !== 'production' &&\r\n process.env.NODE_ENV !== 'test' &&\r\n config.productionTip !== false &&\r\n typeof console !== 'undefined') {\r\n // @ts-expect-error\r\n console[console.info ? 'info' : 'log'](\"You are running Vue in development mode.\\n\" +\r\n \"Make sure to turn on production mode when deploying for production.\\n\" +\r\n \"See more tips at https://vuejs.org/guide/deployment.html\");\r\n }\r\n }, 0);\r\n}\n\nexport { EffectScope, computed, customRef, Vue as default, defineAsyncComponent, defineComponent, del, effectScope, getCurrentInstance, getCurrentScope, h, inject, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, mergeDefaults, nextTick, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, provide, proxyRefs, reactive, readonly, ref$1 as ref, set, shallowReactive, shallowReadonly, shallowRef, toRaw, toRef, toRefs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useListeners, useSlots, version, watch, watchEffect, watchPostEffect, watchSyncEffect };\n","/*!\n * vuex v3.6.2\n * (c) 2021 Evan You\n * @license MIT\n */\nfunction applyMixin (Vue) {\n var version = Number(Vue.version.split('.')[0]);\n\n if (version >= 2) {\n Vue.mixin({ beforeCreate: vuexInit });\n } else {\n // override init and inject vuex init procedure\n // for 1.x backwards compatibility.\n var _init = Vue.prototype._init;\n Vue.prototype._init = function (options) {\n if ( options === void 0 ) options = {};\n\n options.init = options.init\n ? [vuexInit].concat(options.init)\n : vuexInit;\n _init.call(this, options);\n };\n }\n\n /**\n * Vuex init hook, injected into each instances init hooks list.\n */\n\n function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }\n}\n\nvar target = typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\nvar devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;\n\nfunction devtoolPlugin (store) {\n if (!devtoolHook) { return }\n\n store._devtoolHook = devtoolHook;\n\n devtoolHook.emit('vuex:init', store);\n\n devtoolHook.on('vuex:travel-to-state', function (targetState) {\n store.replaceState(targetState);\n });\n\n store.subscribe(function (mutation, state) {\n devtoolHook.emit('vuex:mutation', mutation, state);\n }, { prepend: true });\n\n store.subscribeAction(function (action, state) {\n devtoolHook.emit('vuex:action', action, state);\n }, { prepend: true });\n}\n\n/**\n * Get the first item that pass the test\n * by second argument function\n *\n * @param {Array} list\n * @param {Function} f\n * @return {*}\n */\nfunction find (list, f) {\n return list.filter(f)[0]\n}\n\n/**\n * Deep copy the given object considering circular structure.\n * This function caches all nested objects and its copies.\n * If it detects circular structure, use cached copy to avoid infinite loop.\n *\n * @param {*} obj\n * @param {Array<Object>} cache\n * @return {*}\n */\nfunction deepCopy (obj, cache) {\n if ( cache === void 0 ) cache = [];\n\n // just return if obj is immutable value\n if (obj === null || typeof obj !== 'object') {\n return obj\n }\n\n // if obj is hit, it is in circular structure\n var hit = find(cache, function (c) { return c.original === obj; });\n if (hit) {\n return hit.copy\n }\n\n var copy = Array.isArray(obj) ? [] : {};\n // put the copy into cache at first\n // because we want to refer it in recursive deepCopy\n cache.push({\n original: obj,\n copy: copy\n });\n\n Object.keys(obj).forEach(function (key) {\n copy[key] = deepCopy(obj[key], cache);\n });\n\n return copy\n}\n\n/**\n * forEach for object\n */\nfunction forEachValue (obj, fn) {\n Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });\n}\n\nfunction isObject (obj) {\n return obj !== null && typeof obj === 'object'\n}\n\nfunction isPromise (val) {\n return val && typeof val.then === 'function'\n}\n\nfunction assert (condition, msg) {\n if (!condition) { throw new Error((\"[vuex] \" + msg)) }\n}\n\nfunction partial (fn, arg) {\n return function () {\n return fn(arg)\n }\n}\n\n// Base data struct for store's module, package with some attribute and method\nvar Module = function Module (rawModule, runtime) {\n this.runtime = runtime;\n // Store some children item\n this._children = Object.create(null);\n // Store the origin module object which passed by programmer\n this._rawModule = rawModule;\n var rawState = rawModule.state;\n\n // Store the origin module's state\n this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};\n};\n\nvar prototypeAccessors = { namespaced: { configurable: true } };\n\nprototypeAccessors.namespaced.get = function () {\n return !!this._rawModule.namespaced\n};\n\nModule.prototype.addChild = function addChild (key, module) {\n this._children[key] = module;\n};\n\nModule.prototype.removeChild = function removeChild (key) {\n delete this._children[key];\n};\n\nModule.prototype.getChild = function getChild (key) {\n return this._children[key]\n};\n\nModule.prototype.hasChild = function hasChild (key) {\n return key in this._children\n};\n\nModule.prototype.update = function update (rawModule) {\n this._rawModule.namespaced = rawModule.namespaced;\n if (rawModule.actions) {\n this._rawModule.actions = rawModule.actions;\n }\n if (rawModule.mutations) {\n this._rawModule.mutations = rawModule.mutations;\n }\n if (rawModule.getters) {\n this._rawModule.getters = rawModule.getters;\n }\n};\n\nModule.prototype.forEachChild = function forEachChild (fn) {\n forEachValue(this._children, fn);\n};\n\nModule.prototype.forEachGetter = function forEachGetter (fn) {\n if (this._rawModule.getters) {\n forEachValue(this._rawModule.getters, fn);\n }\n};\n\nModule.prototype.forEachAction = function forEachAction (fn) {\n if (this._rawModule.actions) {\n forEachValue(this._rawModule.actions, fn);\n }\n};\n\nModule.prototype.forEachMutation = function forEachMutation (fn) {\n if (this._rawModule.mutations) {\n forEachValue(this._rawModule.mutations, fn);\n }\n};\n\nObject.defineProperties( Module.prototype, prototypeAccessors );\n\nvar ModuleCollection = function ModuleCollection (rawRootModule) {\n // register root module (Vuex.Store options)\n this.register([], rawRootModule, false);\n};\n\nModuleCollection.prototype.get = function get (path) {\n return path.reduce(function (module, key) {\n return module.getChild(key)\n }, this.root)\n};\n\nModuleCollection.prototype.getNamespace = function getNamespace (path) {\n var module = this.root;\n return path.reduce(function (namespace, key) {\n module = module.getChild(key);\n return namespace + (module.namespaced ? key + '/' : '')\n }, '')\n};\n\nModuleCollection.prototype.update = function update$1 (rawRootModule) {\n update([], this.root, rawRootModule);\n};\n\nModuleCollection.prototype.register = function register (path, rawModule, runtime) {\n var this$1 = this;\n if ( runtime === void 0 ) runtime = true;\n\n if ((process.env.NODE_ENV !== 'production')) {\n assertRawModule(path, rawModule);\n }\n\n var newModule = new Module(rawModule, runtime);\n if (path.length === 0) {\n this.root = newModule;\n } else {\n var parent = this.get(path.slice(0, -1));\n parent.addChild(path[path.length - 1], newModule);\n }\n\n // register nested modules\n if (rawModule.modules) {\n forEachValue(rawModule.modules, function (rawChildModule, key) {\n this$1.register(path.concat(key), rawChildModule, runtime);\n });\n }\n};\n\nModuleCollection.prototype.unregister = function unregister (path) {\n var parent = this.get(path.slice(0, -1));\n var key = path[path.length - 1];\n var child = parent.getChild(key);\n\n if (!child) {\n if ((process.env.NODE_ENV !== 'production')) {\n console.warn(\n \"[vuex] trying to unregister module '\" + key + \"', which is \" +\n \"not registered\"\n );\n }\n return\n }\n\n if (!child.runtime) {\n return\n }\n\n parent.removeChild(key);\n};\n\nModuleCollection.prototype.isRegistered = function isRegistered (path) {\n var parent = this.get(path.slice(0, -1));\n var key = path[path.length - 1];\n\n if (parent) {\n return parent.hasChild(key)\n }\n\n return false\n};\n\nfunction update (path, targetModule, newModule) {\n if ((process.env.NODE_ENV !== 'production')) {\n assertRawModule(path, newModule);\n }\n\n // update target module\n targetModule.update(newModule);\n\n // update nested modules\n if (newModule.modules) {\n for (var key in newModule.modules) {\n if (!targetModule.getChild(key)) {\n if ((process.env.NODE_ENV !== 'production')) {\n console.warn(\n \"[vuex] trying to add a new module '\" + key + \"' on hot reloading, \" +\n 'manual reload is needed'\n );\n }\n return\n }\n update(\n path.concat(key),\n targetModule.getChild(key),\n newModule.modules[key]\n );\n }\n }\n}\n\nvar functionAssert = {\n assert: function (value) { return typeof value === 'function'; },\n expected: 'function'\n};\n\nvar objectAssert = {\n assert: function (value) { return typeof value === 'function' ||\n (typeof value === 'object' && typeof value.handler === 'function'); },\n expected: 'function or object with \"handler\" function'\n};\n\nvar assertTypes = {\n getters: functionAssert,\n mutations: functionAssert,\n actions: objectAssert\n};\n\nfunction assertRawModule (path, rawModule) {\n Object.keys(assertTypes).forEach(function (key) {\n if (!rawModule[key]) { return }\n\n var assertOptions = assertTypes[key];\n\n forEachValue(rawModule[key], function (value, type) {\n assert(\n assertOptions.assert(value),\n makeAssertionMessage(path, key, type, value, assertOptions.expected)\n );\n });\n });\n}\n\nfunction makeAssertionMessage (path, key, type, value, expected) {\n var buf = key + \" should be \" + expected + \" but \\\"\" + key + \".\" + type + \"\\\"\";\n if (path.length > 0) {\n buf += \" in module \\\"\" + (path.join('.')) + \"\\\"\";\n }\n buf += \" is \" + (JSON.stringify(value)) + \".\";\n return buf\n}\n\nvar Vue; // bind on install\n\nvar Store = function Store (options) {\n var this$1 = this;\n if ( options === void 0 ) options = {};\n\n // Auto install if it is not done yet and `window` has `Vue`.\n // To allow users to avoid auto-installation in some cases,\n // this code should be placed here. See #731\n if (!Vue && typeof window !== 'undefined' && window.Vue) {\n install(window.Vue);\n }\n\n if ((process.env.NODE_ENV !== 'production')) {\n assert(Vue, \"must call Vue.use(Vuex) before creating a store instance.\");\n assert(typeof Promise !== 'undefined', \"vuex requires a Promise polyfill in this browser.\");\n assert(this instanceof Store, \"store must be called with the new operator.\");\n }\n\n var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];\n var strict = options.strict; if ( strict === void 0 ) strict = false;\n\n // store internal state\n this._committing = false;\n this._actions = Object.create(null);\n this._actionSubscribers = [];\n this._mutations = Object.create(null);\n this._wrappedGetters = Object.create(null);\n this._modules = new ModuleCollection(options);\n this._modulesNamespaceMap = Object.create(null);\n this._subscribers = [];\n this._watcherVM = new Vue();\n this._makeLocalGettersCache = Object.create(null);\n\n // bind commit and dispatch to self\n var store = this;\n var ref = this;\n var dispatch = ref.dispatch;\n var commit = ref.commit;\n this.dispatch = function boundDispatch (type, payload) {\n return dispatch.call(store, type, payload)\n };\n this.commit = function boundCommit (type, payload, options) {\n return commit.call(store, type, payload, options)\n };\n\n // strict mode\n this.strict = strict;\n\n var state = this._modules.root.state;\n\n // init root module.\n // this also recursively registers all sub-modules\n // and collects all module getters inside this._wrappedGetters\n installModule(this, state, [], this._modules.root);\n\n // initialize the store vm, which is responsible for the reactivity\n // (also registers _wrappedGetters as computed properties)\n resetStoreVM(this, state);\n\n // apply plugins\n plugins.forEach(function (plugin) { return plugin(this$1); });\n\n var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;\n if (useDevtools) {\n devtoolPlugin(this);\n }\n};\n\nvar prototypeAccessors$1 = { state: { configurable: true } };\n\nprototypeAccessors$1.state.get = function () {\n return this._vm._data.$$state\n};\n\nprototypeAccessors$1.state.set = function (v) {\n if ((process.env.NODE_ENV !== 'production')) {\n assert(false, \"use store.replaceState() to explicit replace store state.\");\n }\n};\n\nStore.prototype.commit = function commit (_type, _payload, _options) {\n var this$1 = this;\n\n // check object-style commit\n var ref = unifyObjectStyle(_type, _payload, _options);\n var type = ref.type;\n var payload = ref.payload;\n var options = ref.options;\n\n var mutation = { type: type, payload: payload };\n var entry = this._mutations[type];\n if (!entry) {\n if ((process.env.NODE_ENV !== 'production')) {\n console.error((\"[vuex] unknown mutation type: \" + type));\n }\n return\n }\n this._withCommit(function () {\n entry.forEach(function commitIterator (handler) {\n handler(payload);\n });\n });\n\n this._subscribers\n .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe\n .forEach(function (sub) { return sub(mutation, this$1.state); });\n\n if (\n (process.env.NODE_ENV !== 'production') &&\n options && options.silent\n ) {\n console.warn(\n \"[vuex] mutation type: \" + type + \". Silent option has been removed. \" +\n 'Use the filter functionality in the vue-devtools'\n );\n }\n};\n\nStore.prototype.dispatch = function dispatch (_type, _payload) {\n var this$1 = this;\n\n // check object-style dispatch\n var ref = unifyObjectStyle(_type, _payload);\n var type = ref.type;\n var payload = ref.payload;\n\n var action = { type: type, payload: payload };\n var entry = this._actions[type];\n if (!entry) {\n if ((process.env.NODE_ENV !== 'production')) {\n console.error((\"[vuex] unknown action type: \" + type));\n }\n return\n }\n\n try {\n this._actionSubscribers\n .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe\n .filter(function (sub) { return sub.before; })\n .forEach(function (sub) { return sub.before(action, this$1.state); });\n } catch (e) {\n if ((process.env.NODE_ENV !== 'production')) {\n console.warn(\"[vuex] error in before action subscribers: \");\n console.error(e);\n }\n }\n\n var result = entry.length > 1\n ? Promise.all(entry.map(function (handler) { return handler(payload); }))\n : entry[0](payload);\n\n return new Promise(function (resolve, reject) {\n result.then(function (res) {\n try {\n this$1._actionSubscribers\n .filter(function (sub) { return sub.after; })\n .forEach(function (sub) { return sub.after(action, this$1.state); });\n } catch (e) {\n if ((process.env.NODE_ENV !== 'production')) {\n console.warn(\"[vuex] error in after action subscribers: \");\n console.error(e);\n }\n }\n resolve(res);\n }, function (error) {\n try {\n this$1._actionSubscribers\n .filter(function (sub) { return sub.error; })\n .forEach(function (sub) { return sub.error(action, this$1.state, error); });\n } catch (e) {\n if ((process.env.NODE_ENV !== 'production')) {\n console.warn(\"[vuex] error in error action subscribers: \");\n console.error(e);\n }\n }\n reject(error);\n });\n })\n};\n\nStore.prototype.subscribe = function subscribe (fn, options) {\n return genericSubscribe(fn, this._subscribers, options)\n};\n\nStore.prototype.subscribeAction = function subscribeAction (fn, options) {\n var subs = typeof fn === 'function' ? { before: fn } : fn;\n return genericSubscribe(subs, this._actionSubscribers, options)\n};\n\nStore.prototype.watch = function watch (getter, cb, options) {\n var this$1 = this;\n\n if ((process.env.NODE_ENV !== 'production')) {\n assert(typeof getter === 'function', \"store.watch only accepts a function.\");\n }\n return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)\n};\n\nStore.prototype.replaceState = function replaceState (state) {\n var this$1 = this;\n\n this._withCommit(function () {\n this$1._vm._data.$$state = state;\n });\n};\n\nStore.prototype.registerModule = function registerModule (path, rawModule, options) {\n if ( options === void 0 ) options = {};\n\n if (typeof path === 'string') { path = [path]; }\n\n if ((process.env.NODE_ENV !== 'production')) {\n assert(Array.isArray(path), \"module path must be a string or an Array.\");\n assert(path.length > 0, 'cannot register the root module by using registerModule.');\n }\n\n this._modules.register(path, rawModule);\n installModule(this, this.state, path, this._modules.get(path), options.preserveState);\n // reset store to update getters...\n resetStoreVM(this, this.state);\n};\n\nStore.prototype.unregisterModule = function unregisterModule (path) {\n var this$1 = this;\n\n if (typeof path === 'string') { path = [path]; }\n\n if ((process.env.NODE_ENV !== 'production')) {\n assert(Array.isArray(path), \"module path must be a string or an Array.\");\n }\n\n this._modules.unregister(path);\n this._withCommit(function () {\n var parentState = getNestedState(this$1.state, path.slice(0, -1));\n Vue.delete(parentState, path[path.length - 1]);\n });\n resetStore(this);\n};\n\nStore.prototype.hasModule = function hasModule (path) {\n if (typeof path === 'string') { path = [path]; }\n\n if ((process.env.NODE_ENV !== 'production')) {\n assert(Array.isArray(path), \"module path must be a string or an Array.\");\n }\n\n return this._modules.isRegistered(path)\n};\n\nStore.prototype.hotUpdate = function hotUpdate (newOptions) {\n this._modules.update(newOptions);\n resetStore(this, true);\n};\n\nStore.prototype._withCommit = function _withCommit (fn) {\n var committing = this._committing;\n this._committing = true;\n fn();\n this._committing = committing;\n};\n\nObject.defineProperties( Store.prototype, prototypeAccessors$1 );\n\nfunction genericSubscribe (fn, subs, options) {\n if (subs.indexOf(fn) < 0) {\n options && options.prepend\n ? subs.unshift(fn)\n : subs.push(fn);\n }\n return function () {\n var i = subs.indexOf(fn);\n if (i > -1) {\n subs.splice(i, 1);\n }\n }\n}\n\nfunction resetStore (store, hot) {\n store._actions = Object.create(null);\n store._mutations = Object.create(null);\n store._wrappedGetters = Object.create(null);\n store._modulesNamespaceMap = Object.create(null);\n var state = store.state;\n // init all modules\n installModule(store, state, [], store._modules.root, true);\n // reset vm\n resetStoreVM(store, state, hot);\n}\n\nfunction resetStoreVM (store, state, hot) {\n var oldVm = store._vm;\n\n // bind store public getters\n store.getters = {};\n // reset local getters cache\n store._makeLocalGettersCache = Object.create(null);\n var wrappedGetters = store._wrappedGetters;\n var computed = {};\n forEachValue(wrappedGetters, function (fn, key) {\n // use computed to leverage its lazy-caching mechanism\n // direct inline function use will lead to closure preserving oldVm.\n // using partial to return function with only arguments preserved in closure environment.\n computed[key] = partial(fn, store);\n Object.defineProperty(store.getters, key, {\n get: function () { return store._vm[key]; },\n enumerable: true // for local getters\n });\n });\n\n // use a Vue instance to store the state tree\n // suppress warnings just in case the user has added\n // some funky global mixins\n var silent = Vue.config.silent;\n Vue.config.silent = true;\n store._vm = new Vue({\n data: {\n $$state: state\n },\n computed: computed\n });\n Vue.config.silent = silent;\n\n // enable strict mode for new vm\n if (store.strict) {\n enableStrictMode(store);\n }\n\n if (oldVm) {\n if (hot) {\n // dispatch changes in all subscribed watchers\n // to force getter re-evaluation for hot reloading.\n store._withCommit(function () {\n oldVm._data.$$state = null;\n });\n }\n Vue.nextTick(function () { return oldVm.$destroy(); });\n }\n}\n\nfunction installModule (store, rootState, path, module, hot) {\n var isRoot = !path.length;\n var namespace = store._modules.getNamespace(path);\n\n // register in namespace map\n if (module.namespaced) {\n if (store._modulesNamespaceMap[namespace] && (process.env.NODE_ENV !== 'production')) {\n console.error((\"[vuex] duplicate namespace \" + namespace + \" for the namespaced module \" + (path.join('/'))));\n }\n store._modulesNamespaceMap[namespace] = module;\n }\n\n // set state\n if (!isRoot && !hot) {\n var parentState = getNestedState(rootState, path.slice(0, -1));\n var moduleName = path[path.length - 1];\n store._withCommit(function () {\n if ((process.env.NODE_ENV !== 'production')) {\n if (moduleName in parentState) {\n console.warn(\n (\"[vuex] state field \\\"\" + moduleName + \"\\\" was overridden by a module with the same name at \\\"\" + (path.join('.')) + \"\\\"\")\n );\n }\n }\n Vue.set(parentState, moduleName, module.state);\n });\n }\n\n var local = module.context = makeLocalContext(store, namespace, path);\n\n module.forEachMutation(function (mutation, key) {\n var namespacedType = namespace + key;\n registerMutation(store, namespacedType, mutation, local);\n });\n\n module.forEachAction(function (action, key) {\n var type = action.root ? key : namespace + key;\n var handler = action.handler || action;\n registerAction(store, type, handler, local);\n });\n\n module.forEachGetter(function (getter, key) {\n var namespacedType = namespace + key;\n registerGetter(store, namespacedType, getter, local);\n });\n\n module.forEachChild(function (child, key) {\n installModule(store, rootState, path.concat(key), child, hot);\n });\n}\n\n/**\n * make localized dispatch, commit, getters and state\n * if there is no namespace, just use root ones\n */\nfunction makeLocalContext (store, namespace, path) {\n var noNamespace = namespace === '';\n\n var local = {\n dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {\n var args = unifyObjectStyle(_type, _payload, _options);\n var payload = args.payload;\n var options = args.options;\n var type = args.type;\n\n if (!options || !options.root) {\n type = namespace + type;\n if ((process.env.NODE_ENV !== 'production') && !store._actions[type]) {\n console.error((\"[vuex] unknown local action type: \" + (args.type) + \", global type: \" + type));\n return\n }\n }\n\n return store.dispatch(type, payload)\n },\n\n commit: noNamespace ? store.commit : function (_type, _payload, _options) {\n var args = unifyObjectStyle(_type, _payload, _options);\n var payload = args.payload;\n var options = args.options;\n var type = args.type;\n\n if (!options || !options.root) {\n type = namespace + type;\n if ((process.env.NODE_ENV !== 'production') && !store._mutations[type]) {\n console.error((\"[vuex] unknown local mutation type: \" + (args.type) + \", global type: \" + type));\n return\n }\n }\n\n store.commit(type, payload, options);\n }\n };\n\n // getters and state object must be gotten lazily\n // because they will be changed by vm update\n Object.defineProperties(local, {\n getters: {\n get: noNamespace\n ? function () { return store.getters; }\n : function () { return makeLocalGetters(store, namespace); }\n },\n state: {\n get: function () { return getNestedState(store.state, path); }\n }\n });\n\n return local\n}\n\nfunction makeLocalGetters (store, namespace) {\n if (!store._makeLocalGettersCache[namespace]) {\n var gettersProxy = {};\n var splitPos = namespace.length;\n Object.keys(store.getters).forEach(function (type) {\n // skip if the target getter is not match this namespace\n if (type.slice(0, splitPos) !== namespace) { return }\n\n // extract local getter type\n var localType = type.slice(splitPos);\n\n // Add a port to the getters proxy.\n // Define as getter property because\n // we do not want to evaluate the getters in this time.\n Object.defineProperty(gettersProxy, localType, {\n get: function () { return store.getters[type]; },\n enumerable: true\n });\n });\n store._makeLocalGettersCache[namespace] = gettersProxy;\n }\n\n return store._makeLocalGettersCache[namespace]\n}\n\nfunction registerMutation (store, type, handler, local) {\n var entry = store._mutations[type] || (store._mutations[type] = []);\n entry.push(function wrappedMutationHandler (payload) {\n handler.call(store, local.state, payload);\n });\n}\n\nfunction registerAction (store, type, handler, local) {\n var entry = store._actions[type] || (store._actions[type] = []);\n entry.push(function wrappedActionHandler (payload) {\n var res = handler.call(store, {\n dispatch: local.dispatch,\n commit: local.commit,\n getters: local.getters,\n state: local.state,\n rootGetters: store.getters,\n rootState: store.state\n }, payload);\n if (!isPromise(res)) {\n res = Promise.resolve(res);\n }\n if (store._devtoolHook) {\n return res.catch(function (err) {\n store._devtoolHook.emit('vuex:error', err);\n throw err\n })\n } else {\n return res\n }\n });\n}\n\nfunction registerGetter (store, type, rawGetter, local) {\n if (store._wrappedGetters[type]) {\n if ((process.env.NODE_ENV !== 'production')) {\n console.error((\"[vuex] duplicate getter key: \" + type));\n }\n return\n }\n store._wrappedGetters[type] = function wrappedGetter (store) {\n return rawGetter(\n local.state, // local state\n local.getters, // local getters\n store.state, // root state\n store.getters // root getters\n )\n };\n}\n\nfunction enableStrictMode (store) {\n store._vm.$watch(function () { return this._data.$$state }, function () {\n if ((process.env.NODE_ENV !== 'production')) {\n assert(store._committing, \"do not mutate vuex store state outside mutation handlers.\");\n }\n }, { deep: true, sync: true });\n}\n\nfunction getNestedState (state, path) {\n return path.reduce(function (state, key) { return state[key]; }, state)\n}\n\nfunction unifyObjectStyle (type, payload, options) {\n if (isObject(type) && type.type) {\n options = payload;\n payload = type;\n type = type.type;\n }\n\n if ((process.env.NODE_ENV !== 'production')) {\n assert(typeof type === 'string', (\"expects string as the type, but found \" + (typeof type) + \".\"));\n }\n\n return { type: type, payload: payload, options: options }\n}\n\nfunction install (_Vue) {\n if (Vue && _Vue === Vue) {\n if ((process.env.NODE_ENV !== 'production')) {\n console.error(\n '[vuex] already installed. Vue.use(Vuex) should be called only once.'\n );\n }\n return\n }\n Vue = _Vue;\n applyMixin(Vue);\n}\n\n/**\n * Reduce the code which written in Vue.js for getting the state.\n * @param {String} [namespace] - Module's namespace\n * @param {Object|Array} states # Object's item can be a function which accept state and getters for param, you can do something for state and getters in it.\n * @param {Object}\n */\nvar mapState = normalizeNamespace(function (namespace, states) {\n var res = {};\n if ((process.env.NODE_ENV !== 'production') && !isValidMap(states)) {\n console.error('[vuex] mapState: mapper parameter must be either an Array or an Object');\n }\n normalizeMap(states).forEach(function (ref) {\n var key = ref.key;\n var val = ref.val;\n\n res[key] = function mappedState () {\n var state = this.$store.state;\n var getters = this.$store.getters;\n if (namespace) {\n var module = getModuleByNamespace(this.$store, 'mapState', namespace);\n if (!module) {\n return\n }\n state = module.context.state;\n getters = module.context.getters;\n }\n return typeof val === 'function'\n ? val.call(this, state, getters)\n : state[val]\n };\n // mark vuex getter for devtools\n res[key].vuex = true;\n });\n return res\n});\n\n/**\n * Reduce the code which written in Vue.js for committing the mutation\n * @param {String} [namespace] - Module's namespace\n * @param {Object|Array} mutations # Object's item can be a function which accept `commit` function as the first param, it can accept another params. You can commit mutation and do any other things in this function. specially, You need to pass anthor params from the mapped function.\n * @return {Object}\n */\nvar mapMutations = normalizeNamespace(function (namespace, mutations) {\n var res = {};\n if ((process.env.NODE_ENV !== 'production') && !isValidMap(mutations)) {\n console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');\n }\n normalizeMap(mutations).forEach(function (ref) {\n var key = ref.key;\n var val = ref.val;\n\n res[key] = function mappedMutation () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n // Get the commit method from store\n var commit = this.$store.commit;\n if (namespace) {\n var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);\n if (!module) {\n return\n }\n commit = module.context.commit;\n }\n return typeof val === 'function'\n ? val.apply(this, [commit].concat(args))\n : commit.apply(this.$store, [val].concat(args))\n };\n });\n return res\n});\n\n/**\n * Reduce the code which written in Vue.js for getting the getters\n * @param {String} [namespace] - Module's namespace\n * @param {Object|Array} getters\n * @return {Object}\n */\nvar mapGetters = normalizeNamespace(function (namespace, getters) {\n var res = {};\n if ((process.env.NODE_ENV !== 'production') && !isValidMap(getters)) {\n console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object');\n }\n normalizeMap(getters).forEach(function (ref) {\n var key = ref.key;\n var val = ref.val;\n\n // The namespace has been mutated by normalizeNamespace\n val = namespace + val;\n res[key] = function mappedGetter () {\n if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {\n return\n }\n if ((process.env.NODE_ENV !== 'production') && !(val in this.$store.getters)) {\n console.error((\"[vuex] unknown getter: \" + val));\n return\n }\n return this.$store.getters[val]\n };\n // mark vuex getter for devtools\n res[key].vuex = true;\n });\n return res\n});\n\n/**\n * Reduce the code which written in Vue.js for dispatch the action\n * @param {String} [namespace] - Module's namespace\n * @param {Object|Array} actions # Object's item can be a function which accept `dispatch` function as the first param, it can accept anthor params. You can dispatch action and do any other things in this function. specially, You need to pass anthor params from the mapped function.\n * @return {Object}\n */\nvar mapActions = normalizeNamespace(function (namespace, actions) {\n var res = {};\n if ((process.env.NODE_ENV !== 'production') && !isValidMap(actions)) {\n console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');\n }\n normalizeMap(actions).forEach(function (ref) {\n var key = ref.key;\n var val = ref.val;\n\n res[key] = function mappedAction () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n // get dispatch function from store\n var dispatch = this.$store.dispatch;\n if (namespace) {\n var module = getModuleByNamespace(this.$store, 'mapActions', namespace);\n if (!module) {\n return\n }\n dispatch = module.context.dispatch;\n }\n return typeof val === 'function'\n ? val.apply(this, [dispatch].concat(args))\n : dispatch.apply(this.$store, [val].concat(args))\n };\n });\n return res\n});\n\n/**\n * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object\n * @param {String} namespace\n * @return {Object}\n */\nvar createNamespacedHelpers = function (namespace) { return ({\n mapState: mapState.bind(null, namespace),\n mapGetters: mapGetters.bind(null, namespace),\n mapMutations: mapMutations.bind(null, namespace),\n mapActions: mapActions.bind(null, namespace)\n}); };\n\n/**\n * Normalize the map\n * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]\n * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]\n * @param {Array|Object} map\n * @return {Object}\n */\nfunction normalizeMap (map) {\n if (!isValidMap(map)) {\n return []\n }\n return Array.isArray(map)\n ? map.map(function (key) { return ({ key: key, val: key }); })\n : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })\n}\n\n/**\n * Validate whether given map is valid or not\n * @param {*} map\n * @return {Boolean}\n */\nfunction isValidMap (map) {\n return Array.isArray(map) || isObject(map)\n}\n\n/**\n * Return a function expect two param contains namespace and map. it will normalize the namespace and then the param's function will handle the new namespace and the map.\n * @param {Function} fn\n * @return {Function}\n */\nfunction normalizeNamespace (fn) {\n return function (namespace, map) {\n if (typeof namespace !== 'string') {\n map = namespace;\n namespace = '';\n } else if (namespace.charAt(namespace.length - 1) !== '/') {\n namespace += '/';\n }\n return fn(namespace, map)\n }\n}\n\n/**\n * Search a special module from store by namespace. if module not exist, print error message.\n * @param {Object} store\n * @param {String} helper\n * @param {String} namespace\n * @return {Object}\n */\nfunction getModuleByNamespace (store, helper, namespace) {\n var module = store._modulesNamespaceMap[namespace];\n if ((process.env.NODE_ENV !== 'production') && !module) {\n console.error((\"[vuex] module namespace not found in \" + helper + \"(): \" + namespace));\n }\n return module\n}\n\n// Credits: borrowed code from fcomb/redux-logger\n\nfunction createLogger (ref) {\n if ( ref === void 0 ) ref = {};\n var collapsed = ref.collapsed; if ( collapsed === void 0 ) collapsed = true;\n var filter = ref.filter; if ( filter === void 0 ) filter = function (mutation, stateBefore, stateAfter) { return true; };\n var transformer = ref.transformer; if ( transformer === void 0 ) transformer = function (state) { return state; };\n var mutationTransformer = ref.mutationTransformer; if ( mutationTransformer === void 0 ) mutationTransformer = function (mut) { return mut; };\n var actionFilter = ref.actionFilter; if ( actionFilter === void 0 ) actionFilter = function (action, state) { return true; };\n var actionTransformer = ref.actionTransformer; if ( actionTransformer === void 0 ) actionTransformer = function (act) { return act; };\n var logMutations = ref.logMutations; if ( logMutations === void 0 ) logMutations = true;\n var logActions = ref.logActions; if ( logActions === void 0 ) logActions = true;\n var logger = ref.logger; if ( logger === void 0 ) logger = console;\n\n return function (store) {\n var prevState = deepCopy(store.state);\n\n if (typeof logger === 'undefined') {\n return\n }\n\n if (logMutations) {\n store.subscribe(function (mutation, state) {\n var nextState = deepCopy(state);\n\n if (filter(mutation, prevState, nextState)) {\n var formattedTime = getFormattedTime();\n var formattedMutation = mutationTransformer(mutation);\n var message = \"mutation \" + (mutation.type) + formattedTime;\n\n startMessage(logger, message, collapsed);\n logger.log('%c prev state', 'color: #9E9E9E; font-weight: bold', transformer(prevState));\n logger.log('%c mutation', 'color: #03A9F4; font-weight: bold', formattedMutation);\n logger.log('%c next state', 'color: #4CAF50; font-weight: bold', transformer(nextState));\n endMessage(logger);\n }\n\n prevState = nextState;\n });\n }\n\n if (logActions) {\n store.subscribeAction(function (action, state) {\n if (actionFilter(action, state)) {\n var formattedTime = getFormattedTime();\n var formattedAction = actionTransformer(action);\n var message = \"action \" + (action.type) + formattedTime;\n\n startMessage(logger, message, collapsed);\n logger.log('%c action', 'color: #03A9F4; font-weight: bold', formattedAction);\n endMessage(logger);\n }\n });\n }\n }\n}\n\nfunction startMessage (logger, message, collapsed) {\n var startMessage = collapsed\n ? logger.groupCollapsed\n : logger.group;\n\n // render\n try {\n startMessage.call(logger, message);\n } catch (e) {\n logger.log(message);\n }\n}\n\nfunction endMessage (logger) {\n try {\n logger.groupEnd();\n } catch (e) {\n logger.log('—— log end ——');\n }\n}\n\nfunction getFormattedTime () {\n var time = new Date();\n return (\" @ \" + (pad(time.getHours(), 2)) + \":\" + (pad(time.getMinutes(), 2)) + \":\" + (pad(time.getSeconds(), 2)) + \".\" + (pad(time.getMilliseconds(), 3)))\n}\n\nfunction repeat (str, times) {\n return (new Array(times + 1)).join(str)\n}\n\nfunction pad (num, maxLength) {\n return repeat('0', maxLength - num.toString().length) + num\n}\n\nvar index = {\n Store: Store,\n install: install,\n version: '3.6.2',\n mapState: mapState,\n mapMutations: mapMutations,\n mapGetters: mapGetters,\n mapActions: mapActions,\n createNamespacedHelpers: createNamespacedHelpers,\n createLogger: createLogger\n};\n\nexport default index;\nexport { Store, createLogger, createNamespacedHelpers, install, mapActions, mapGetters, mapMutations, mapState };\n","import { ErrorFactory, contains, deepExtend, createSubscribe, isBrowser } from '@firebase/util';\nimport { Component } from '@firebase/component';\nimport * as modularAPIs from '@firebase/app';\nimport { _addComponent, deleteApp, _DEFAULT_ENTRY_NAME, _addOrOverwriteComponent, registerVersion } from '@firebase/app';\nimport { Logger } from '@firebase/logger';\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 * Global context object for a collection of services using\r\n * a shared authentication state.\r\n *\r\n * marked as internal because it references internal types exported from @firebase/app\r\n * @internal\r\n */\r\nclass FirebaseAppImpl {\r\n constructor(_delegate, firebase) {\r\n this._delegate = _delegate;\r\n this.firebase = firebase;\r\n // add itself to container\r\n _addComponent(_delegate, new Component('app-compat', () => this, \"PUBLIC\" /* PUBLIC */));\r\n this.container = _delegate.container;\r\n }\r\n get automaticDataCollectionEnabled() {\r\n return this._delegate.automaticDataCollectionEnabled;\r\n }\r\n set automaticDataCollectionEnabled(val) {\r\n this._delegate.automaticDataCollectionEnabled = val;\r\n }\r\n get name() {\r\n return this._delegate.name;\r\n }\r\n get options() {\r\n return this._delegate.options;\r\n }\r\n delete() {\r\n return new Promise(resolve => {\r\n this._delegate.checkDestroyed();\r\n resolve();\r\n }).then(() => {\r\n this.firebase.INTERNAL.removeApp(this.name);\r\n return deleteApp(this._delegate);\r\n });\r\n }\r\n /**\r\n * Return a service instance associated with this app (creating it\r\n * on demand), identified by the passed instanceIdentifier.\r\n *\r\n * NOTE: Currently storage and functions are the only ones that are leveraging this\r\n * functionality. They invoke it by calling:\r\n *\r\n * ```javascript\r\n * firebase.app().storage('STORAGE BUCKET ID')\r\n * ```\r\n *\r\n * The service name is passed to this already\r\n * @internal\r\n */\r\n _getService(name, instanceIdentifier = _DEFAULT_ENTRY_NAME) {\r\n var _a;\r\n this._delegate.checkDestroyed();\r\n // Initialize instance if InstatiationMode is `EXPLICIT`.\r\n const provider = this._delegate.container.getProvider(name);\r\n if (!provider.isInitialized() &&\r\n ((_a = provider.getComponent()) === null || _a === void 0 ? void 0 : _a.instantiationMode) === \"EXPLICIT\" /* EXPLICIT */) {\r\n provider.initialize();\r\n }\r\n // getImmediate will always succeed because _getService is only called for registered components.\r\n return provider.getImmediate({\r\n identifier: instanceIdentifier\r\n });\r\n }\r\n /**\r\n * Remove a service instance from the cache, so we will create a new instance for this service\r\n * when people try to get it again.\r\n *\r\n * NOTE: currently only firestore uses this functionality to support firestore shutdown.\r\n *\r\n * @param name The service name\r\n * @param instanceIdentifier instance identifier in case multiple instances are allowed\r\n * @internal\r\n */\r\n _removeServiceInstance(name, instanceIdentifier = _DEFAULT_ENTRY_NAME) {\r\n this._delegate.container\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n .getProvider(name)\r\n .clearInstance(instanceIdentifier);\r\n }\r\n /**\r\n * @param component the component being added to this app's container\r\n * @internal\r\n */\r\n _addComponent(component) {\r\n _addComponent(this._delegate, component);\r\n }\r\n _addOrOverwriteComponent(component) {\r\n _addOrOverwriteComponent(this._delegate, component);\r\n }\r\n toJSON() {\r\n return {\r\n name: this.name,\r\n automaticDataCollectionEnabled: this.automaticDataCollectionEnabled,\r\n options: this.options\r\n };\r\n }\r\n}\r\n// TODO: investigate why the following needs to be commented out\r\n// Prevent dead-code elimination of these methods w/o invalid property\r\n// copying.\r\n// (FirebaseAppImpl.prototype.name && FirebaseAppImpl.prototype.options) ||\r\n// FirebaseAppImpl.prototype.delete ||\r\n// console.log('dc');\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\" /* NO_APP */]: \"No Firebase App '{$appName}' has been created - \" +\r\n 'call Firebase App.initializeApp()',\r\n [\"invalid-app-argument\" /* INVALID_APP_ARGUMENT */]: 'firebase.{$appName}() takes either no argument or a ' +\r\n 'Firebase App instance.'\r\n};\r\nconst ERROR_FACTORY = new ErrorFactory('app-compat', '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\n/**\r\n * Because auth can't share code with other components, we attach the utility functions\r\n * in an internal namespace to share code.\r\n * This function return a firebase namespace object without\r\n * any utility functions, so it can be shared between the regular firebaseNamespace and\r\n * the lite version.\r\n */\r\nfunction createFirebaseNamespaceCore(firebaseAppImpl) {\r\n const apps = {};\r\n // // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n // const components = new Map<string, Component<any>>();\r\n // A namespace is a plain JavaScript Object.\r\n const namespace = {\r\n // Hack to prevent Babel from modifying the object returned\r\n // as the firebase namespace.\r\n // @ts-ignore\r\n __esModule: true,\r\n initializeApp: initializeAppCompat,\r\n // @ts-ignore\r\n app,\r\n registerVersion: modularAPIs.registerVersion,\r\n setLogLevel: modularAPIs.setLogLevel,\r\n onLog: modularAPIs.onLog,\r\n // @ts-ignore\r\n apps: null,\r\n SDK_VERSION: modularAPIs.SDK_VERSION,\r\n INTERNAL: {\r\n registerComponent: registerComponentCompat,\r\n removeApp,\r\n useAsService,\r\n modularAPIs\r\n }\r\n };\r\n // Inject a circular default export to allow Babel users who were previously\r\n // using:\r\n //\r\n // import firebase from 'firebase';\r\n // which becomes: var firebase = require('firebase').default;\r\n //\r\n // instead of\r\n //\r\n // import * as firebase from 'firebase';\r\n // which becomes: var firebase = require('firebase');\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n namespace['default'] = namespace;\r\n // firebase.apps is a read-only getter.\r\n Object.defineProperty(namespace, 'apps', {\r\n get: getApps\r\n });\r\n /**\r\n * Called by App.delete() - but before any services associated with the App\r\n * are deleted.\r\n */\r\n function removeApp(name) {\r\n delete apps[name];\r\n }\r\n /**\r\n * Get the App object for a given name (or DEFAULT).\r\n */\r\n function app(name) {\r\n name = name || modularAPIs._DEFAULT_ENTRY_NAME;\r\n if (!contains(apps, name)) {\r\n throw ERROR_FACTORY.create(\"no-app\" /* NO_APP */, { appName: name });\r\n }\r\n return apps[name];\r\n }\r\n // @ts-ignore\r\n app['App'] = firebaseAppImpl;\r\n /**\r\n * Create a new App instance (name must be unique).\r\n *\r\n * This function is idempotent. It can be called more than once and return the same instance using the same options and config.\r\n */\r\n function initializeAppCompat(options, rawConfig = {}) {\r\n const app = modularAPIs.initializeApp(options, rawConfig);\r\n if (contains(apps, app.name)) {\r\n return apps[app.name];\r\n }\r\n const appCompat = new firebaseAppImpl(app, namespace);\r\n apps[app.name] = appCompat;\r\n return appCompat;\r\n }\r\n /*\r\n * Return an array of all the non-deleted FirebaseApps.\r\n */\r\n function getApps() {\r\n // Make a copy so caller cannot mutate the apps list.\r\n return Object.keys(apps).map(name => apps[name]);\r\n }\r\n function registerComponentCompat(component) {\r\n const componentName = component.name;\r\n const componentNameWithoutCompat = componentName.replace('-compat', '');\r\n if (modularAPIs._registerComponent(component) &&\r\n component.type === \"PUBLIC\" /* PUBLIC */) {\r\n // create service namespace for public components\r\n // The Service namespace is an accessor function ...\r\n const serviceNamespace = (appArg = app()) => {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n if (typeof appArg[componentNameWithoutCompat] !== 'function') {\r\n // Invalid argument.\r\n // This happens in the following case: firebase.storage('gs:/')\r\n throw ERROR_FACTORY.create(\"invalid-app-argument\" /* INVALID_APP_ARGUMENT */, {\r\n appName: componentName\r\n });\r\n }\r\n // Forward service instance lookup to the FirebaseApp.\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n return appArg[componentNameWithoutCompat]();\r\n };\r\n // ... and a container for service-level properties.\r\n if (component.serviceProps !== undefined) {\r\n deepExtend(serviceNamespace, component.serviceProps);\r\n }\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n namespace[componentNameWithoutCompat] = serviceNamespace;\r\n // Patch the FirebaseAppImpl prototype\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n firebaseAppImpl.prototype[componentNameWithoutCompat] =\r\n // TODO: The eslint disable can be removed and the 'ignoreRestArgs'\r\n // option added to the no-explicit-any rule when ESlint releases it.\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n function (...args) {\r\n const serviceFxn = this._getService.bind(this, componentName);\r\n return serviceFxn.apply(this, component.multipleInstances ? args : []);\r\n };\r\n }\r\n return component.type === \"PUBLIC\" /* PUBLIC */\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n namespace[componentNameWithoutCompat]\r\n : null;\r\n }\r\n // Map the requested service to a registered service name\r\n // (used to map auth to serverAuth service when needed).\r\n function useAsService(app, name) {\r\n if (name === 'serverAuth') {\r\n return null;\r\n }\r\n const useService = name;\r\n return useService;\r\n }\r\n return namespace;\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 * Return a firebase namespace object.\r\n *\r\n * In production, this will be called exactly once and the result\r\n * assigned to the 'firebase' global. It may be called multiple times\r\n * in unit tests.\r\n */\r\nfunction createFirebaseNamespace() {\r\n const namespace = createFirebaseNamespaceCore(FirebaseAppImpl);\r\n namespace.INTERNAL = Object.assign(Object.assign({}, namespace.INTERNAL), { createFirebaseNamespace,\r\n extendNamespace,\r\n createSubscribe,\r\n ErrorFactory,\r\n deepExtend });\r\n /**\r\n * Patch the top-level firebase namespace with additional properties.\r\n *\r\n * firebase.INTERNAL.extendNamespace()\r\n */\r\n function extendNamespace(props) {\r\n deepExtend(namespace, props);\r\n }\r\n return namespace;\r\n}\r\nconst firebase$1 = createFirebaseNamespace();\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-compat');\n\nconst name = \"@firebase/app-compat\";\nconst version = \"0.1.32\";\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 // Register `app` package.\r\n registerVersion(name, version, variant);\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// Firebase Lite detection\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nif (isBrowser() && self.firebase !== undefined) {\r\n logger.warn(`\n Warning: Firebase is already defined in the global scope. Please make sure\n Firebase library is only loaded once.\n `);\r\n // eslint-disable-next-line\r\n const sdkVersion = self.firebase.SDK_VERSION;\r\n if (sdkVersion && sdkVersion.indexOf('LITE') >= 0) {\r\n logger.warn(`\n Warning: You are trying to load Firebase while using Firebase Performance standalone script.\n You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.\n `);\r\n }\r\n}\r\nconst firebase = firebase$1;\r\nregisterCoreComponents();\n\nexport { firebase as default };\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));\n });\n }\n if (blocked)\n request.addEventListener('blocked', () => blocked());\n openPromise\n .then((db) => {\n if (terminated)\n db.addEventListener('close', () => terminated());\n if (blocking)\n db.addEventListener('versionchange', () => blocking());\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', () => blocked());\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","import { Component, ComponentContainer } from '@firebase/component';\nimport { Logger, setUserLogHandler, setLogLevel as setLogLevel$1 } from '@firebase/logger';\nimport { ErrorFactory, 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\" /* VERSION */;\r\n}\n\nconst name$o = \"@firebase/app\";\nconst version$1 = \"0.7.31\";\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 = \"9.9.3\";\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\" /* NO_APP */]: \"No Firebase App '{$appName}' has been created - \" +\r\n 'call Firebase App.initializeApp()',\r\n [\"bad-app-name\" /* BAD_APP_NAME */]: \"Illegal App name: '{$appName}\",\r\n [\"duplicate-app\" /* DUPLICATE_APP */]: \"Firebase App named '{$appName}' already exists with different options or config\",\r\n [\"app-deleted\" /* APP_DELETED */]: \"Firebase App named '{$appName}' already deleted\",\r\n [\"invalid-app-argument\" /* INVALID_APP_ARGUMENT */]: 'firebase.{$appName}() takes either no argument or a ' +\r\n 'Firebase App instance.',\r\n [\"invalid-log-argument\" /* INVALID_LOG_ARGUMENT */]: 'First argument to `onLog` must be null or a function.',\r\n [\"idb-open\" /* IDB_OPEN */]: 'Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.',\r\n [\"idb-get\" /* IDB_GET */]: 'Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.',\r\n [\"idb-set\" /* IDB_WRITE */]: 'Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.',\r\n [\"idb-delete\" /* 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\" /* 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\" /* 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 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\" /* BAD_APP_NAME */, {\r\n appName: String(name)\r\n });\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\" /* 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) {\r\n throw ERROR_FACTORY.create(\"no-app\" /* 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\" /* 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\" /* 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 db.createObjectStore(STORE_NAME);\r\n }\r\n }\r\n }).catch(e => {\r\n throw ERROR_FACTORY.create(\"idb-open\" /* 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 var _a;\r\n try {\r\n const db = await getDbPromise();\r\n return db\r\n .transaction(STORE_NAME)\r\n .objectStore(STORE_NAME)\r\n .get(computeKey(app));\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\" /* IDB_GET */, {\r\n originalErrorMessage: (_a = e) === null || _a === void 0 ? void 0 : _a.message\r\n });\r\n logger.warn(idbGetError.message);\r\n }\r\n }\r\n}\r\nasync function writeHeartbeatsToIndexedDB(app, heartbeatObject) {\r\n var _a;\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 return 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\" /* IDB_WRITE */, {\r\n originalErrorMessage: (_a = e) === null || _a === void 0 ? void 0 : _a.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 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 (this._heartbeatsCache === null) {\r\n this._heartbeatsCache = await this._heartbeatsCachePromise;\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 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 (this._heartbeatsCache === 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 return idbHeartbeatObject || { heartbeats: [] };\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\" /* PRIVATE */));\r\n _registerComponent(new Component('heartbeat', container => new HeartbeatServiceImpl(container), \"PRIVATE\" /* 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\" /* 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\" /* 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\" /* 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"],"names":["__rest","s","e","t","p","Object","prototype","hasOwnProperty","call","indexOf","getOwnPropertySymbols","i","length","propertyIsEnumerable","create","ProviderId","FACEBOOK","GITHUB","GOOGLE","PASSWORD","PHONE","TWITTER","ActionCodeOperation","EMAIL_SIGNIN","PASSWORD_RESET","RECOVER_EMAIL","REVERT_SECOND_FACTOR_ADDITION","VERIFY_AND_CHANGE_EMAIL","VERIFY_EMAIL","_debugErrorMap","_prodErrorMap","debugErrorMap","prodErrorMap","_DEFAULT_AUTH_ERROR_FACTORY","logClient","_logError","msg","args","logLevel","error","SDK_VERSION","_fail","authOrCode","rest","createErrorInternal","_createError","_errorWithCustomMessage","auth","code","message","errorMap","assign","factory","appName","name","_assertInstanceOf","object","instance","constructorInstance","constructor","fullParams","slice","_errorFactory","_assert","assertion","debugFail","failure","Error","debugAssert","instanceCache","Map","_getInstance","cls","Function","get","set","initializeAuth","app","deps","provider","_getProvider","isInitialized","getImmediate","initialOptions","getOptions","initialize","options","_initializeAuthInstance","persistence","hierarchy","Array","isArray","map","_updateErrorMap","_initializeWithPersistence","popupRedirectResolver","_getCurrentUrl","_a","self","location","href","_isHttpOrHttps","_getCurrentScheme","protocol","_isOnline","navigator","onLine","_getUserLanguage","navigatorLanguage","languages","language","Delay","shortDelay","longDelay","this","isMobile","Math","min","_emulatorUrl","config","path","emulator","url","startsWith","FetchProvider","static","fetchImpl","headersImpl","responseImpl","fetch","Headers","Response","SERVER_ERROR_MAP","DEFAULT_API_TIMEOUT_MS","_addTidIfNecessary","request","tenantId","async","_performApiRequest","method","customErrorMap","_performFetchWithErrorHandling","body","params","JSON","stringify","query","key","apiKey","headers","_getAdditionalHeaders","languageCode","_getFinalTarget","apiHost","referrerPolicy","fetchFn","_canInitEmulator","networkTimeout","NetworkTimeout","response","Promise","race","promise","clearNetworkTimeout","json","_makeTaggedError","ok","errorMessage","serverErrorCode","serverErrorMessage","split","authError","toLowerCase","replace","_performSignInRequest","serverResponse","_serverResponse","host","base","apiScheme","timer","_","reject","setTimeout","clearTimeout","errorParams","email","phoneNumber","customData","_tokenResponse","deleteAccount","deleteLinkedAccounts","getAccountInfo","utcTimestampToDateString","utcTimestamp","date","Date","Number","isNaN","getTime","toUTCString","getIdTokenResult","user","forceRefresh","userInternal","token","getIdToken","claims","_parseToken","exp","auth_time","iat","firebase","undefined","signInProvider","authTime","secondsStringToMilliseconds","issuedAtTime","expirationTime","signInSecondFactor","seconds","algorithm","payload","signature","decoded","parse","toString","_tokenExpiresIn","parsedToken","_logoutIfInvalidated","bypassAuthState","isUserInvalidated","currentUser","signOut","ProactiveRefresh","isRunning","timerId","errorBackoff","_start","schedule","_stop","getInterval","wasError","interval","expTime","stsTokenManager","now","max","iteration","UserMetadata","createdAt","lastLoginAt","_initializeTime","lastSignInTime","creationTime","_copy","metadata","toJSON","_reloadWithoutSaving","idToken","users","coreAccount","_notifyReloadListener","newProviderData","providerUserInfo","extractProviderData","providerData","mergeProviderData","oldIsAnonymous","isAnonymous","newIsAnonymous","passwordHash","updates","uid","localId","displayName","photoURL","photoUrl","emailVerified","reload","_persistUserIfCurrent","_notifyListenersIfCurrent","original","newData","deduped","filter","o","some","n","providerId","providers","rawId","requestStsToken","refreshToken","tokenApiHost","accessToken","access_token","expiresIn","expires_in","refresh_token","StsTokenManager","isExpired","updateFromServerResponse","updateTokensAndExpiration","refresh","clearRefreshToken","oldToken","expiresInSec","manager","_assign","_clone","_performRefresh","assertStringOrUndefined","UserImpl","opt","proactiveRefresh","reloadUserInfo","reloadListener","getToken","userInfo","_onReload","callback","_startProactiveRefresh","_stopProactiveRefresh","tokensRefreshed","_redirectEventId","_b","_c","_d","_e","_f","_g","_h","plainObjectTokenManager","fromJSON","idTokenResponse","InMemoryPersistence","type","storage","value","_addListener","_key","_listener","_removeListener","inMemoryPersistence","_persistenceKeyName","PersistenceUserManager","userKey","fullUserKey","fullPersistenceKey","boundEventHandler","_onStorageEvent","bind","setCurrentUser","_set","blob","_get","_fromJSON","removeCurrentUser","_remove","savePersistenceForRedirect","newPersistence","getCurrentUser","delete","persistenceHierarchy","availablePersistences","all","_isAvailable","selectedPersistence","userToMigrate","migrationHierarchy","_shouldAllowMigration","_getBrowserName","userAgent","ua","includes","_isIEMobile","_isFirefox","_isBlackBerry","_isWebOS","_isSafari","_isChromeIOS","_isAndroid","re","matches","match","test","_isIOS","_isIOS7Or8","_isIOSStandalone","window","standalone","_isIE10","document","documentMode","_isMobileBrowser","_isIframe","top","_getClientVersion","clientPlatform","frameworks","reportedPlatform","reportedFrameworks","join","AuthMiddlewareQueue","queue","pushCallback","onAbort","wrappedCallback","resolve","result","push","index","nextUser","onAbortStack","beforeStateCallback","reverse","originalMessage","AuthImpl","heartbeatServiceProvider","emulatorConfig","operations","authStateSubscription","Subscription","idTokenSubscription","beforeStateQueue","redirectUser","isProactiveRefreshEnabled","_isInitialized","_deleted","_initializationPromise","_popupRedirectResolver","lastNotifiedUid","settings","appVerificationDisabledForTesting","clientVersion","sdkClientVersion","persistenceManager","_shouldInitProactively","_initialize","initializeCurrentUser","assertedPersistence","_currentUser","_updateCurrentUser","previouslyStoredUser","futureCurrentUser","needsTocheckMiddleware","authDomain","getOrInitRedirectPersistenceManager","redirectUserEventId","storedUserEventId","tryRedirectSignIn","directlySetCurrentUser","runMiddleware","_overrideRedirectResult","reloadAndSetCurrentUserOrClear","redirectResolver","_completeRedirectFn","_setRedirectUser","useDeviceLanguage","userExtern","skipBeforeStateCallbacks","notifyAuthListeners","redirectPersistenceManager","setPersistence","_getPersistence","onAuthStateChanged","nextOrObserver","completed","registerStateListener","beforeAuthStateChanged","onIdTokenChanged","redirectManager","resolver","_redirectPersistence","id","next","currentUid","subscription","cb","then","addObserver","action","_logFramework","framework","sort","_getFrameworks","appId","heartbeatsHeader","optional","getHeartbeatsHeader","_castAuth","observer","connectAuthEmulator","authInternal","disableWarnings","extractProtocol","port","extractHostAndPort","portStr","freeze","emitEmulatorWarning","protocolEnd","substr","authority","exec","hostAndPort","pop","bracketedIPv6","parsePort","attachBanner","el","createElement","sty","style","innerText","position","width","backgroundColor","border","color","bottom","left","margin","zIndex","textAlign","classList","add","appendChild","console","info","readyState","addEventListener","AuthCredential","signInMethod","_getIdTokenResponse","_auth","_linkToIdToken","_idToken","_getReauthenticationResolver","resetPassword","updateEmailPassword","applyActionCode$1","signInWithPassword","sendOobCode","sendEmailVerification$1","sendPasswordResetEmail$1","sendSignInLinkToEmail$1","verifyAndChangeEmail","signInWithEmailLink$1","signInWithEmailLinkForLinking","EmailAuthCredential","_email","_password","_tenantId","super","password","oobCode","obj","_fromEmailAndPassword","_fromEmailAndCode","returnSecureToken","signInWithIdp","IDP_REQUEST_URI$1","OAuthCredential","arguments","pendingToken","cred","nonce","oauthToken","oauthTokenSecret","secret","buildRequest","autoCreate","requestUri","postBody","sendPhoneVerificationCode","signInWithPhoneNumber$1","linkWithPhoneNumber$1","temporaryProof","VERIFY_PHONE_NUMBER_FOR_EXISTING_ERROR_MAP_","verifyPhoneNumberForExisting","apiRequest","operation","PhoneAuthCredential","verificationId","verificationCode","_makeVerificationRequest","sessionInfo","parseMode","mode","parseDeepLink","link","doubleDeepLink","iOSDeepLink","iOSDoubleDeepLink","ActionCodeURL","actionLink","searchParams","continueUrl","EmailAuthProvider","PROVIDER_ID","emailLink","actionCodeUrl","parseLink","EMAIL_PASSWORD_SIGN_IN_METHOD","EMAIL_LINK_SIGN_IN_METHOD","FederatedAuthProvider","defaultLanguageCode","customParameters","setDefaultLanguage","setCustomParameters","customOAuthParameters","getCustomParameters","BaseOAuthProvider","scopes","addScope","scope","getScopes","OAuthProvider","_fromParams","credential","_credential","rawNonce","userCredential","oauthCredentialFromTaggedObject","tokenResponse","oauthIdToken","oauthAccessToken","FacebookAuthProvider","FACEBOOK_SIGN_IN_METHOD","credentialFromTaggedObject","GoogleAuthProvider","GOOGLE_SIGN_IN_METHOD","GithubAuthProvider","GITHUB_SIGN_IN_METHOD","IDP_REQUEST_URI","SAMLAuthCredential","SAML_PROVIDER_PREFIX","SAMLAuthProvider","samlCredentialFromTaggedObject","_create","TwitterAuthProvider","TWITTER_SIGN_IN_METHOD","signUp","UserCredentialImpl","operationType","_fromIdTokenResponse","providerIdForResponse","userCred","_updateTokensIfNecessary","signInAnonymously","MultiFactorError","setPrototypeOf","_processCredentialSavingMfaContextIfNecessary","idTokenProvider","catch","_fromErrorAndOperation","providerDataAsNames","Set","pid","unlink","_assertLinkedStatus","deleteProvider","providersLeft","pd","has","_link$1","_forOperation","expected","providerIds","_reauthenticate","parsed","sub","_signInWithCredential","signInWithCredential","linkWithCredential","reauthenticateWithCredential","signInWithCustomToken$1","signInWithCustomToken","customToken","MultiFactorInfoImpl","factorId","mfaEnrollmentId","enrollmentTime","enrolledAt","enrollment","PhoneMultiFactorInfoImpl","_fromServerResponse","phoneInfo","_setActionCodeSettingsOnRequest","actionCodeSettings","dynamicLinkDomain","canHandleCodeInApp","handleCodeInApp","iOS","bundleId","iOSBundleId","android","packageName","androidInstallApp","installApp","androidMinimumVersionCode","minimumVersion","androidPackageName","sendPasswordResetEmail","authModular","requestType","confirmPasswordReset","newPassword","applyActionCode","checkActionCode","newEmail","mfaInfo","multiFactorInfo","data","previousEmail","verifyPasswordResetCode","createUserWithEmailAndPassword","signInWithEmailAndPassword","sendSignInLinkToEmail","isSignInWithEmailLink","signInWithEmailLink","credentialWithLink","createAuthUri","fetchSignInMethodsForEmail","continueUri","identifier","signinMethods","sendEmailVerification","verifyBeforeUpdateEmail","updateProfile$1","updateProfile","profileRequest","passwordProvider","find","updateEmail","updateEmailOrPassword","updatePassword","profile","rawUserInfo","isNewUser","kind","filteredProviderId","GenericAdditionalUserInfo","FacebookAdditionalUserInfo","GithubAdditionalUserInfo","GoogleAdditionalUserInfo","TwitterAdditionalUserInfo","screenName","FederatedAdditionalUserInfoWithUsername","username","login","getAdditionalUserInfo","MultiFactorSessionImpl","mfaPendingCredential","multiFactorSession","pendingCredential","_fromMfaPendingCredential","_fromIdtoken","MultiFactorResolverImpl","session","hints","signInResolver","authExtern","mfaResponse","_process","assertionExtern","getMultiFactorResolver","errorInternal","_fromError","startEnrollPhoneMfa","finalizeEnrollPhoneMfa","withdrawMfa","MultiFactorUserImpl","enrolledFactors","getSession","finalizeMfaResponse","infoOrUid","multiFactorUserCache","WeakMap","multiFactor","userModular","_fromUser","STORAGE_AVAILABLE_KEY","BrowserPersistenceClass","storageRetriever","setItem","removeItem","getItem","_iframeCannotSyncWebStorage","_POLLING_INTERVAL_MS$1","IE10_LOCAL_STORAGE_SYNC_DELAY","BrowserLocalPersistence","localStorage","event","poll","onStorageEvent","listeners","localCache","pollTimer","safariLocalStorageNotSynced","fallbackToPolling","forAllChangedKeys","keys","newValue","oldValue","_oldValue","notifyListeners","detachListener","stopPolling","storedValue","triggerListeners","listener","from","startPolling","setInterval","StorageEvent","clearInterval","attachListener","removeEventListener","size","browserLocalPersistence","BrowserSessionPersistence","sessionStorage","browserSessionPersistence","_allSettled","promises","fulfilled","reason","Receiver","eventTarget","handlersMap","handleEvent","existingInstance","receivers","receiver","isListeningto","newInstance","messageEvent","eventId","eventType","handlers","ports","postMessage","status","handler","origin","_subscribe","eventHandler","_unsubscribe","_generateEventId","prefix","digits","random","floor","Sender","target","removeMessageHandler","messageChannel","port1","onMessage","close","timeout","MessageChannel","completionTimer","start","ackTimer","port2","finally","_window","_setWindowLocation","_isWorker","_getActiveServiceWorker","serviceWorker","registration","ready","active","_getServiceWorkerController","controller","_getWorkerGlobalScope","DB_NAME","DB_VERSION","DB_OBJECTSTORE_NAME","DB_DATA_KEYPATH","DBPromise","toPromise","getObjectStore","db","isReadWrite","transaction","objectStore","_deleteDatabase","indexedDB","deleteDatabase","_openDatabase","open","createObjectStore","keyPath","objectStoreNames","contains","_putObject","put","getObject","_deleteObject","_POLLING_INTERVAL_MS","_TRANSACTION_RETRY_COUNT","IndexedDBLocalPersistence","pendingWrites","sender","serviceWorkerReceiverAvailable","activeServiceWorker","_workerInitializationPromise","initializeServiceWorkerMessaging","op","numAttempts","_openDb","initializeReceiver","initializeSender","_origin","_poll","keyProcessed","_data","results","_send","write","_withPendingWrite","_withRetries","notifyServiceWorker","getAllRequest","getAll","keysInResult","fbase_key","localKey","indexedDBLocalPersistence","startSignInPhoneMfa","finalizeSignInPhoneMfa","getRecaptchaParams","recaptchaSiteKey","getScriptParentElement","getElementsByTagName","_loadJS","setAttribute","onload","onerror","charset","_generateCallbackName","_SOLVE_TIME_MS","_EXPIRATION_TIME_MS","_WIDGET_ID_START","MockReCaptcha","counter","_widgets","render","container","parameters","MockWidget","reset","optWidgetId","getResponse","execute","containerOrId","deleted","responseToken","clickHandler","getElementById","isVisible","checkIfDeleted","generateRandomAlphaNumericString","expiredCallback","len","chars","allowedChars","charAt","_JSLOAD_CALLBACK","NETWORK_TIMEOUT_DELAY","RECAPTCHA_BASE","ReCaptchaLoaderImpl","hostLanguage","librarySeparatelyLoaded","grecaptcha","load","hl","isHostLanguageValid","shouldResolveImmediately","recaptcha","widgetId","clearedOneInstance","MockReCaptchaLoaderImpl","RECAPTCHA_VERIFIER_TYPE","DEFAULT_PARAMS","theme","RecaptchaVerifier","destroyed","tokenChangeListeners","renderPromise","isInvisible","makeTokenCallback","_recaptchaLoader","validateStartingState","assertNotDestroyed","getAssertedRecaptcha","tokenChange","makeRenderPromise","_reset","clear","childNodes","forEach","node","removeChild","sitekey","hasChildNodes","existing","globalFunc","init","guaranteedEmpty","domReady","siteKey","ConfirmationResultImpl","onConfirmation","confirm","authCredential","_fromVerification","signInWithPhoneNumber","appVerifier","_verifyPhoneNumber","linkWithPhoneNumber","reauthenticateWithPhoneNumber","verifier","recaptchaToken","verify","phoneInfoOptions","phoneEnrollmentInfo","phoneSessionInfo","multiFactorHint","multiFactorUid","phoneSignInInfo","phoneResponseInfo","updatePhoneNumber","PhoneAuthProvider","verifyPhoneNumber","phoneOptions","applicationVerifier","_fromTokenResponse","_withDefaultResolver","resolverOverride","PHONE_SIGN_IN_METHOD","IdpCredential","_buildIdpRequest","sessionId","returnIdpCredential","_signIn","_reauth","_link","AbstractPopupRedirectOperation","pendingPromise","eventManager","onExecution","registerConsumer","urlResponse","getIdpTask","onError","unregisterAndCleanUp","unregisterConsumer","cleanUp","_POLL_WINDOW_CLOSE_TIMEOUT","signInWithPopup","resolverInternal","PopupOperation","executeNotNull","reauthenticateWithPopup","linkWithPopup","authWindow","pollId","currentPopupAction","cancel","_openPopup","associatedEvent","_originValidation","_isIframeWebStorageSupported","isSupported","pollUserCancellation","closed","PENDING_REDIRECT_KEY","redirectOutcomeMap","RedirectAction","readyOutcome","hasPendingRedirect","_getAndClearPendingRedirectStatus","onAuthEvent","_redirectUserForId","pendingRedirectKey","resolverPersistence","_setPendingRedirectStatus","_clearRedirectOutcomes","signInWithRedirect","_signInWithRedirect","_openRedirect","reauthenticateWithRedirect","_reauthenticateWithRedirect","prepareUserForRedirect","linkWithRedirect","_linkWithRedirect","getRedirectResult","_getRedirectResult","resolverExtern","EVENT_DUPLICATION_CACHE_DURATION_MS","AuthEventManager","cachedEventUids","consumers","queuedRedirectEvent","hasHandledPotentialRedirect","lastProcessedEventTime","authEventConsumer","isEventForConsumer","sendToConsumer","saveEventToCache","onEvent","hasEventBeenHandled","handled","consumer","isRedirectEvent","isNullRedirectEvent","eventIdMatches","eventUid","v","_getProjectConfig","IP_ADDRESS_REGEX","HTTP_REGEX","_validateOrigin","authorizedDomains","domain","matchDomain","currentUrl","hostname","URL","ceUrl","escapedDomainPattern","RegExp","NETWORK_TIMEOUT","resetUnloadedGapiModules","beacon","___jsl","H","hint","r","L","CP","loadGapi","loadGapiIframe","gapi","iframes","getContext","ontimeout","Iframe","cbName","cachedGApiLoader","_loadGapi","PING_TIMEOUT","IFRAME_PATH","EMULATED_IFRAME_PATH","IFRAME_ATTRIBUTES","height","tabindex","EID_FROM_APIHOST","getIframeUrl","eid","fw","_openIframe","context","where","messageHandlersFilter","CROSS_ORIGIN_IFRAMES_FILTER","attributes","dontclear","iframe","restyle","setHideOnLeave","networkError","networkErrorTimer","clearTimerAndResolve","ping","BASE_POPUP_OPTIONS","resizable","statusbar","toolbar","DEFAULT_WIDTH","DEFAULT_HEIGHT","TARGET_BLANK","FIREFOX_EMPTY_URL","AuthPopup","_open","screen","availHeight","availWidth","scrollbars","optionsString","entries","reduce","accum","openAsNewWindowIOS","newWin","focus","click","createEvent","initMouseEvent","dispatchEvent","WIDGET_PATH","EMULATOR_WIDGET_PATH","_getRedirectUrl","authType","redirectUrl","additionalParams","tid","paramsDict","getHandlerBase","WEB_STORAGE_SUPPORT_KEY","BrowserPopupRedirectResolver","eventManagers","originValidationPromises","initAndGetManager","register","iframeEvent","authEvent","send","browserPopupRedirectResolver","MultiFactorAssertionImpl","_finalizeEnroll","_finalizeSignIn","PhoneMultiFactorAssertionImpl","phoneVerificationInfo","PhoneMultiFactorGenerator","_fromCredential","FACTOR_ID","version","AuthInterop","internalListeners","getUid","assertAuthConfigured","addAuthTokenListener","unsubscribe","updateProactiveRefresh","removeAuthTokenListener","getVersionForPlatform","registerAuth","_registerComponent","getProvider","authInstance","setInstantiationMode","setInstanceCreatedCallback","_instanceIdentifier","_instance","authInternalProvider","registerVersion","getAuth","getApp","stringToByteArray$1","str","out","c","charCodeAt","byteArrayToString","bytes","pos","c1","String","fromCharCode","c2","c3","c4","u","base64","byteToCharMap_","charToByteMap_","byteToCharMapWebSafe_","charToByteMapWebSafe_","ENCODED_VALS_BASE","ENCODED_VALS","ENCODED_VALS_WEBSAFE","HAS_NATIVE_SUPPORT","atob","encodeByteArray","input","webSafe","init_","byteToCharMap","output","byte1","haveByte2","byte2","haveByte3","byte3","outByte1","outByte2","outByte3","outByte4","encodeString","btoa","decodeString","decodeStringToByteArray","charToByteMap","haveByte4","byte4","base64Encode","utf8Bytes","base64urlEncodeWithoutPadding","base64Decode","deepExtend","source","dateValue","prop","isValidKey","Deferred","wrapCallback","createMockUserToken","projectId","header","alg","project","user_id","iss","aud","sign_in_provider","identities","getUA","isMobileCordova","isNode","g","process","isBrowser","isBrowserExtension","runtime","chrome","browser","isReactNative","isElectron","isIE","isUWP","isSafari","isIndexedDBAvailable","validateIndexedDBOpenable","preExist","DB_CHECK_NAME","onsuccess","onupgradeneeded","ERROR_NAME","FirebaseError","captureStackTrace","ErrorFactory","service","serviceName","errors","fullCode","template","replaceTemplate","fullMessage","PATTERN","isEmpty","deepEqual","a","b","aKeys","bKeys","k","aProp","bProp","isObject","thing","querystring","querystringParams","arrayVal","encodeURIComponent","querystringDecode","tokens","decodeURIComponent","extractQuerystring","queryStart","fragmentStart","substring","createSubscribe","executor","onNoObservers","proxy","ObserverProxy","subscribe","observers","unsubscribes","observerCount","task","finalized","forEachObserver","complete","implementsAnyMethods","noop","unsub","unsubscribeOne","finalError","fn","sendOne","err","methods","getModularInstance","_delegate","normalizeComponent","scriptExports","staticRenderFns","functionalTemplate","injectStyles","scopeId","moduleIdentifier","shadowMode","hook","_compiled","functional","_scopeId","$vnode","ssrContext","parent","__VUE_SSR_CONTEXT__","_registeredComponents","_ssrRegister","$root","$options","shadowRoot","_injectStyles","originalRender","h","beforeCreate","concat","exports","isCallable","tryToString","$TypeError","TypeError","module","argument","$String","toIndexedObject","toAbsoluteIndex","lengthOfArrayLike","createMethod","IS_INCLUDES","$this","fromIndex","O","uncurryThis","stringSlice","it","TO_STRING_TAG_SUPPORT","classofRaw","wellKnownSymbol","TO_STRING_TAG","$Object","CORRECT_ARGUMENTS","tryGet","tag","callee","$Error","TEST","arg","stack","V8_OR_CHAKRA_STACK_ENTRY","IS_V8_OR_CHAKRA_STACK","dropEntries","prepareStackTrace","hasOwn","ownKeys","getOwnPropertyDescriptorModule","definePropertyModule","exceptions","defineProperty","f","getOwnPropertyDescriptor","DESCRIPTORS","createPropertyDescriptor","bitmap","enumerable","configurable","writable","makeBuiltIn","defineGlobalProperty","simple","global","unsafe","nonConfigurable","nonWritable","fails","EXISTS","getBuiltIn","Deno","versions","v8","createNonEnumerableProperty","defineBuiltIn","copyConstructorProperties","isForced","FORCED","targetProperty","sourceProperty","descriptor","TARGET","GLOBAL","STATIC","stat","dontCallGetSet","forced","sham","NATIVE_BIND","FunctionPrototype","apply","Reflect","getDescriptor","PROPER","CONFIGURABLE","aFunction","namespace","aCallable","V","P","func","check","globalThis","toObject","classof","dummy","Wrapper","NewTarget","NewTargetPrototype","store","functionToString","inspectSource","cause","NATIVE_WEAK_MAP","shared","sharedKey","hiddenKeys","OBJECT_ALREADY_INITIALIZED","enforce","getterFor","TYPE","state","wmget","wmhas","wmset","facade","STATE","replacement","feature","detection","normalize","POLYFILL","NATIVE","string","isPrototypeOf","USE_SYMBOL_AS_UID","$Symbol","toLength","CONFIGURABLE_FUNCTION_NAME","InternalStateModule","enforceInternalState","getInternalState","CONFIGURABLE_LENGTH","TEMPLATE","getter","setter","arity","ceil","trunc","x","V8_VERSION","symbol","Symbol","$default","IE8_DOM_DEFINE","V8_PROTOTYPE_DEFINE_BUG","anObject","toPropertyKey","$defineProperty","$getOwnPropertyDescriptor","ENUMERABLE","WRITABLE","Attributes","current","propertyIsEnumerableModule","internalObjectKeys","enumBugKeys","getOwnPropertyNames","names","$propertyIsEnumerable","NASHORN_BUG","aPossiblePrototype","CORRECT_SETTER","proto","__proto__","pref","val","valueOf","getOwnPropertyNamesModule","getOwnPropertySymbolsModule","Target","Source","SHARED","IS_PURE","copyright","license","toIntegerOrInfinity","integer","IndexedObject","requireObjectCoercible","number","isSymbol","getMethod","ordinaryToPrimitive","TO_PRIMITIVE","exoticToPrim","toPrimitive","postfix","NATIVE_SYMBOL","iterator","WellKnownSymbolsStore","symbolFor","createWellKnownSymbol","withoutSetter","description","proxyAccessor","inheritIfRequired","normalizeStringArgument","installErrorCause","clearErrorStack","ERROR_STACK_INSTALLABLE","FULL_NAME","wrapper","IS_AGGREGATE_ERROR","STACK_TRACE_LIMIT","OPTIONS_POSITION","OriginalError","OriginalErrorPrototype","BaseError","WrappedError","$","wrapErrorConstructorWithCause","WEB_ASSEMBLY","WebAssembly","exportGlobalErrorCauseWrapper","exportWebAssemblyErrorCauseWrapper","_cordovaWindow","REDIRECT_TIMEOUT_MS","_generateHandlerUrl","BuildInfo","sessionDigest","computeSha256","iosBundleId","_performRedirect","handlerUrl","cordova","plugins","browsertab","isAvailable","browserTabIsAvailable","iabRef","openUrl","InAppBrowser","_waitForAppResume","eventListener","cleanup","onCloseTimer","authEventSeen","closeBrowserTab","resumed","visibilityChanged","visibilityState","addPassiveListener","removePassiveListener","_checkCordovaConfiguration","_j","_k","win","universalLinks","missingPlugin","stringToArrayBuffer","buf","crypto","subtle","digest","arr","Uint8Array","num","padStart","TextEncoder","encode","buff","ArrayBuffer","view","SESSION_ID_LENGTH","CordovaAuthEventManager","passiveListeners","initPromise","resolveInialized","resetRedirect","_generateNewEvent","generateSessionId","_savePartialEvent","persistenceKey","_getAndRemoveEvent","_eventFromPartialAndUrl","partialEvent","callbackUrl","_getDeepLinkFromCallback","searchParamsOrEmpty","errorObject","parseJsonOrNull","idx","INITIAL_EVENT_TIMEOUT_MS","CordovaPopupRedirectResolver","attachCallbackListeners","initialized","_cb","handleOpenURL","noEventTimeout","generateNoEvent","universalLinksCb","eventData","finalEvent","existingHandleOpenURL","packagePrefix","cordovaPopupRedirectResolver","addFrameworkForLogging","CORDOVA_ONDEVICEREADY_TIMEOUT_MS","_isAndroidOrIosCordovaScheme","_isNativeEnvironment","_isIe11","_isEdge","_isLocalStorageNotSynchronized","_isWebStorageSupported","_isPopupRedirectSupported","_isLikelyCordova","_isCordova","timeoutId","_getSelfWindow","Persistence","LOCAL","NONE","SESSION","_assert$3","PERSISTENCE_KEY","_validatePersistenceArgument","values","_savePersistenceForRedirect","getSessionStorageIfAvailable","_getPersistencesFromRedirect","_assert$2","CompatPopupRedirectResolver","browserResolver","cordovaResolver","underlyingResolver","selectUnderlyingResolver","assertedUnderlyingResolver","isCordova","unwrap","wrapped","credentialFromResponse","credentialFromObject","attachExtraErrorFields","mfaErr","MultiFactorResolver","credErr","credentialFromError","credentialFromResult","convertCredential","credentialPromise","additionalUserInfo","User","getOrCreate","convertConfirmationResult","confirmationResultPromise","confirmationResultExp","resolveSignIn","USER_MAP","linkAndRetrieveDataWithCredential","reauthenticateAndRetrieveDataWithCredential","phoneCredential","_assert$1","Auth","linkUnderlyingAuth","buildPersistenceHierarchy","useEmulator","fetchProvidersForEmail","errorFn","wrapObservers","converted","isIndexedDBFullySupported","signInAndRetrieveDataWithCredential","updateCurrentUser","_delete","oldNext","newNext","persistences","AUTH_TYPE","registerAuthCompat","INTERNAL","registerComponent","authProvider","setServiceProps","ActionCodeInfo","Operation","setMultipleInstances","commonjsGlobal","esm","goog","l","aa","ba","da","ea","fa","ha","ia","d","unshift","q","ja","Z","Vb","ka","la","na","M","shift","ma","oa","pa","qa","ra","sa","ta","trim","w","va","wa","xa","ya","za","Aa","Ca","Fa","Ga","Na","Ha","y","Ia","Ja","Ka","La","Ma","Oa","Pa","Qa","parseFloat","Sa","Ra","parseInt","Ta","Ua","Va","z","defaultPrevented","A","relatedTarget","button","screenY","screenX","clientY","clientX","metaKey","shiftKey","altKey","ctrlKey","pointerId","pointerType","changedTouches","srcElement","nodeName","fromElement","toElement","pageX","pageY","Wa","preventDefault","returnValue","B","Xa","Ya","src","capture","ca","Za","$a","bb","splice","ab","fb","once","gb","hb","N","ib","jb","kb","attachEvent","lb","addListener","removeListener","mb","nb","ob","detachEvent","pb","C","I","D","qb","rb","sb","tb","ub","vb","Ab","j","wb","yb","zb","Bb","Cb","Db","Eb","Fb","S","Gb","Hb","m","Ib","E","Jb","Kb","Lb","Mb","Nb","G","Ob","F","Pb","Qb","Rb","Sb","Tb","Ub","STAT_EVENT","J","K","Wb","NO_ERROR","xb","TIMEOUT","Xb","Yb","Zb","$b","cc","OPEN","ac","bc","dc","X","ec","W","Y","U","fc","XMLHttpRequest","gc","hc","ic","jc","kc","lc","mc","nc","qc","Ba","tc","vc","sc","wc","rc","xc","eb","pc","uc","abort","yc","zc","Ac","Bc","Cc","Q","Da","Ea","getResponseHeader","Dc","R","Ec","Fc","Gc","Hc","Ic","Jc","Kc","T","Lc","ga","oc","TextDecoder","decode","stream","Mc","Nc","Oc","Pc","Qc","Rc","Sc","Tc","Zc","Uc","$c","abs","ad","bd","decodeURI","encodeURI","cd","Vc","Wc","Xc","Yc","dd","ed","fd","gd","hd","PerformanceNavigationTiming","performance","getEntriesByType","nextHopProtocol","jd","kd","ld","md","nd","Image","od","onabort","qd","rd","responseType","responseText","statusText","onreadystatechange","ud","read","td","sd","credentials","cache","Request","arrayBuffer","ReadableStream","getReader","text","done","setRequestHeader","append","getAllResponseHeaders","vd","wd","xd","yd","Bd","zd","Cd","Dd","Ed","Ad","mozResponseArrayBuffer","Fd","Gd","Hd","internalChannelParams","Id","xmlHttpFactory","supportsCrossDomainXhr","concurrentRequestLimit","fastHandshake","forceLongPolling","detectBufferingProxy","Jd","Kd","sendBeacon","Ld","Md","Nd","Od","Qd","Pd","round","Rd","Sd","Td","messageUrlParams","messageHeaders","clientProtocolHeaderRequired","initMessageHeaders","messageContentType","httpHeadersOverwriteParam","sendRawJson","httpSessionIdParam","Ud","__sm__","Vd","toUpperCase","FormData","withCredentials","__data__","createWebChannel","HTTP_ERROR","COMPLETE","EventType","CLOSE","ERROR","MESSAGE","listen","listenOnce","getLastError","getLastErrorCode","getStatus","getResponseJson","getResponseText","createWebChannelTransport","getStatEventTarget","ErrorCode","Event","Stat","PROXY","NOPROXY","FetchXmlHttpFactory","WebChannel","XhrIo","isAuthenticated","toKey","isEqual","UNAUTHENTICATED","GOOGLE_CREDENTIALS","FIRST_PARTY","MOCK_USER","setLogLevel","debug","warn","OK","CANCELLED","UNKNOWN","INVALID_ARGUMENT","DEADLINE_EXCEEDED","NOT_FOUND","ALREADY_EXISTS","PERMISSION_DENIED","RESOURCE_EXHAUSTED","FAILED_PRECONDITION","ABORTED","OUT_OF_RANGE","UNIMPLEMENTED","UNAVAILABLE","DATA_LOSS","invalidateToken","enqueueRetryable","shutdown","changeListener","onInit","getAuthHeaderValueForFirstParty","tt","appCheck","addTokenListener","removeTokenListener","nt","msCrypto","getRandomValues","st","rt","every","ot","ut","nanoseconds","fromMillis","toDate","toMillis","_compareTo","ct","timestamp","compareTo","toMicroseconds","toTimestamp","at","segments","offset","comparator","child","limit","construct","popFirst","popLast","firstSegment","lastSegment","isPrefixOf","isImmediateParentOf","toArray","ht","canonicalString","lt","ft","isValidIdentifier","isKeyField","dt","fromString","emptyPath","collectionGroup","hasCollectionId","getCollectionGroup","getCollectionPath","_t","indexId","fields","indexState","wt","mt","UNKNOWN_ID","yt","fieldPath","It","sequenceNumber","At","Tt","fromTimestamp","empty","Et","readTime","documentKey","largestBatchId","Rt","bt","Pt","onCommittedListeners","addOnCommittedListener","raiseOnCommittedEvent","vt","Vt","nextCallback","catchCallback","isDone","callbackAttached","wrapFailure","wrapSuccess","wrapUserFunction","waitFor","St","aborted","oncomplete","xt","Ft","commit","kt","Dt","Mt","onblocked","oldVersion","onversionchange","Ct","cursor","Nt","count","range","primaryKey","continue","openKeyCursor","openCursor","Ot","$t","asyncQueue","stop","started","enqueueAfterDelay","Bt","localStore","runTransaction","et","doWhile","indexManager","getNextCollectionGroupToUpdate","getMinOffsetFromCollectionGroup","localDocuments","getNextDocuments","changes","updateIndexEntries","updateCollectionGroup","batchId","Lt","previousValue","sequenceNumberHandler","writeSequenceNumber","Ut","qt","Kt","Gt","root","jt","EMPTY","insert","copy","BLACK","remove","right","minKey","maxKey","inorderTraversal","reverseTraversal","getIterator","Qt","getIteratorFrom","getReverseIterator","getReverseIteratorFrom","isReverse","nodeStack","getNext","hasNext","peek","RED","fixUp","removeMin","isRed","moveRedLeft","rotateRight","moveRedRight","rotateLeft","colorFlip","checkMaxDepth","pow","Wt","first","last","forEachInRange","forEachWhile","firstAfterOrEqual","zt","unionWith","iter","Ht","Jt","covers","Yt","Xt","binaryString","toBase64","toUint8Array","approximateByteSize","EMPTY_BYTE_STRING","Zt","te","nanos","ee","ne","fromBase64String","fromUint8Array","se","mapValue","__type__","stringValue","ie","__previous_value__","__local_write_time__","timestampValue","oe","databaseId","ssl","autoDetectLongPolling","useFetchStreams","ue","database","isDefaultDatabase","ce","ae","he","isInteger","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","le","fe","nullValue","de","ve","booleanValue","bytesValue","referenceValue","geoPointValue","latitude","longitude","integerValue","doubleValue","arrayValue","we","me","ge","ye","pe","fromName","Ie","Te","Ee","Ae","Re","be","Pe","Ve","NaN","Se","De","inclusive","Ce","xe","field","getFieldsMap","setAll","applyChanges","clone","Ne","ke","documentType","documentState","convertToFoundDocument","convertToNoDocument","convertToUnknownDocument","setHasCommittedMutations","setHasLocalMutations","setReadTime","hasLocalMutations","hasCommittedMutations","hasPendingWrites","isValidDocument","isFoundDocument","isNoDocument","isUnknownDocument","mutableCopy","Me","orderBy","filters","startAt","endAt","Oe","Fe","dir","$e","Be","en","sn","Le","isDocumentKey","Ue","Ge","qe","Ke","Qe","He","Je","Ye","Xe","je","We","ze","Ze","tn","nn","rn","explicitOrderBy","limitType","on","un","cn","an","hn","ln","keyField","dn","_n","wn","mn","gn","yn","pn","In","Tn","En","An","Rn","bn","Pn","Sn","Dn","Cn","xn","Nn","Vn","Mn","vn","kn","elements","On","Fn","transform","$n","Bn","transformResults","Ln","updateTime","exists","isNone","Un","qn","Kn","Zn","none","zn","Hn","Gn","Yn","fieldTransforms","precondition","Jn","Qn","Xn","fieldMask","jn","Wn","getFieldMask","ts","es","ns","ss","is","rs","os","mapKeyFn","equalsFn","inner","innerSize","us","cs","as","hs","ls","overlayedDocument","fs","_s","ds","ws","ms","gs","ys","ps","Is","snapshotVersion","targetChanges","targetMismatches","documentUpdates","resolvedLimboDocuments","Ts","createSynthesizedTargetChangeForCurrentChange","resumeToken","addedDocuments","modifiedDocuments","removedDocuments","Es","gt","removedTargetIds","As","targetId","Rs","targetIds","bs","Vs","Ps","vs","forEachTarget","removeTarget","newNoDocument","purpose","getRemoteKeysForTarget","Ss","asc","desc","Ds","in","Cs","xs","toISOString","Ns","ks","Ms","Os","Fs","ai","$s","Bs","Ks","Ls","Us","qs","Gs","Qs","newFoundDocument","js","found","missing","Ws","targetChange","targetChangeType","documentChange","documentDelete","documentRemove","zs","update","updateMask","ci","updateTransforms","setToServerValue","appendMissingElements","removeAllFromArray","increment","currentDocument","Hs","fromServerFormat","fieldPaths","Js","Ys","documents","Xs","structuredQuery","collectionId","allDescendants","unaryFilter","ii","fieldFilter","si","compositeFilter","direction","ni","before","Zs","ei","ri","ti","ui","oi","hi","fi","li","di","_i","wi","mi","gi","yi","pi","Ii","Ti","Ei","Ai","Ri","bi","Pi","vi","Vi","Si","Di","Ci","xi","Ni","ki","Mi","Oi","Fi","currentSequenceNumber","$i","Bi","localWriteTime","baseMutations","mutations","applyToRemoteDocument","mutationResults","applyToLocalView","applyToLocalDocumentSet","mutatedFields","Li","batch","commitVersion","docVersions","Ui","mutation","getKey","qi","lastLimboFreeSnapshotVersion","withSequenceNumber","withResumeToken","withLastLimboFreeSnapshotVersion","Ki","Gi","noDocument","fromSegments","zi","unknownDocument","newUnknownDocument","Qi","prefixPath","documentId","ji","Wi","Hi","localWriteTimeMs","Ji","lastListenSequenceNumber","Yi","canonicalId","Xi","Zi","overlayMutation","tr","er","nr","getBundleMetadata","sr","createTime","saveBundleMetadata","getNamedQuery","ir","bundledQuery","saveNamedQuery","rr","userId","getOverlay","or","getOverlays","saveOverlays","removeOverlaysForBatchId","IDBKeyRange","bound","getOverlaysForCollection","POSITIVE_INFINITY","getOverlaysForCollectionGroup","collectionPath","ur","cr","ar","hr","buffer","codePointAt","seed","DataView","setFloat64","lr","fr","dr","_r","directionalValue","wr","mr","gr","yr","pr","addToCollectionParentIndex","getCollectionParents","getEntries","addFieldIndex","deleteFieldIndex","getDocumentsMatchingTarget","getIndexType","getFieldIndexes","getMinOffset","Ir","Tr","Er","Rr","br","Ar","createRange","orderedDocumentKey","only","upperBound","Pr","mapArray","vr","didRun","sequenceNumbersCollected","targetsRemoved","documentsRemoved","Vr","cacheSizeCollectionThreshold","percentileToCollect","maximumSequenceNumbersToCollect","DEFAULT_COLLECTION_PERCENTILE","DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT","Sr","Dr","DEFAULT","DISABLED","Cr","referenceDelegate","checkEmpty","NEGATIVE_INFINITY","Nr","addMutationBatch","kr","lookupMutationBatch","getNextMutationBatchAfterBatchId","lowerBound","getHighestUnacknowledgedBatchId","getAllMutationBatches","getAllMutationBatchesAffectingDocumentKey","getAllMutationBatchesAffectingDocumentKeys","getAllMutationBatchesAffectingQuery","removeMutationBatch","markPotentiallyOrphaned","performConsistencyCheck","containsKey","xr","Mr","lastAcknowledgedBatchId","lastStreamToken","Or","Fr","allocateTargetId","highestTargetId","getLastRemoteSnapshotVersion","lastRemoteSnapshotVersion","getHighestSequenceNumber","highestListenSequenceNumber","setTargetsMetadata","addTargetData","targetCount","updateTargetData","removeTargetData","removeMatchingKeysForTargetId","$r","removeTargets","Br","getTargetCount","getTargetData","addMatchingKeys","Lr","addReference","removeMatchingKeys","removeReference","getMatchingKeysForTargetId","Ur","qr","maxValue","Kr","garbageCollector","collectGarbage","Gr","calculateTargetCount","nthSequenceNumber","removeOrphanedDocuments","collect","getCacheSize","Qr","getTargetCache","jr","getRemoteDocumentCache","newChangeBuffer","getEntry","removeEntry","updateLimboDocument","getSize","Wr","changesApplied","addEntry","assertNotApplied","newInvalidDocument","getFromCache","getAllFromCache","zr","setIndexManager","Xr","updateMetadata","getMetadata","byteSize","Zr","eo","getAllFromCollection","getAllFromCollectionGroup","to","Jr","trackRemovals","Yr","Hr","no","so","remoteDocumentCache","mutationQueue","documentOverlayCache","getDocument","getBaseDocument","getDocuments","getLocalViewOfDocuments","populateOverlays","computeViews","getOverlayedDocuments","recalculateAndSaveOverlays","recalculateAndSaveOverlaysForDocumentKeys","getDocumentsMatchingQuery","getDocumentsMatchingDocumentQuery","getDocumentsMatchingCollectionGroupQuery","getDocumentsMatchingCollectionQuery","io","ro","overlays","oo","uo","co","ao","docs","ho","lo","fo","setDatabaseDeletedListener","setNetworkEnabled","getIndexManager","getDocumentOverlayCache","getMutationQueue","getBundleCache","_o","wo","fromPath","mo","autoIncrement","createIndex","unique","go","deleteObjectStore","yo","po","allowTabSynchronization","clientId","isPrimary","networkEnabled","inForeground","newVersion","enqueueAndForget","To","updateTimeMs","Io","ownerId","leaseTimestampMs","appVersion","enterRestrictedMode","Eo","Ao","fromCache","docChanges","doc","Ro","bo","Po","vo","removedBatchIds","addedBatchIds","Vo","So","Do","Co","xo","No","ko","Mo","$o","Oo","Fo","Bo","Lo","Uo","qo","Ko","Go","Qo","jo","activeTargetIds","Wo","onlineState","zo","Ho","syncEngine","onlineStateHandler","getAllActiveQueryTargets","isActiveQueryTarget","addPendingMutation","updateMutationState","addLocalQueryTarget","removeLocalQueryTarget","isLocalQueryTarget","clearQueryState","updateQueryState","handleUserChange","setOnlineState","notifyBundleLoaded","storageArea","Jo","Yo","Xo","Zo","BatchGetDocuments","Commit","RunQuery","tu","eu","databaseInfo","forwardChannelRequestTimeoutMs","nu","su","iu","ru","skipDelay","ou","authCredentialsProvider","appCheckCredentialsProvider","uu","addTarget","labels","cu","streamToken","writeResults","commitTime","writes","au","authCredentials","appCheckCredentials","terminate","hu","lu","datastore","remoteSyncer","fu","du","Iu","_u","pu","yu","$u","mu","wu","gu","Tu","Eu","Au","Ru","rejectListen","bu","applyRemoteEvent","Pu","vu","Bu","Vu","Su","Du","Cu","xu","Nu","ku","applySuccessfulWrite","Mu","rejectFailedWrite","Ou","verifyOperationInProgress","handleCredentialChange","Fu","Lu","targetTimeMs","removalCallback","deferred","timerHandle","handleDelayElapsed","Uu","qu","keyedMap","sortedSet","Ku","track","Gu","oldDocs","mutatedKeys","syncStateChanged","excludesMetadataChanges","emptySet","Qu","ju","queries","Wu","onListen","Yu","zu","onUnlisten","Hu","Ju","Xu","includeMetadataChanges","fromInitialDocuments","Zu","byteLength","collectionGroups","progress","bytesLoaded","documentsLoaded","namedQuery","documentMetadata","taskState","totalDocuments","totalBytes","snapshot","remoteStore","sharedClientState","maxConcurrentLimboResolutions","isPrimaryClient","createSynthesizedRemoteEventForCurrentChange","_completeWith","_updateProgress","_failWith","synchronizeTabs","gcScheduler","indexBackfillerScheduler","initialUser","cacheSizeBytes","forceOwnership","withCacheSize","createDatastore","createRemoteStore","createEventManager","createSyncEngine","releaseLock","muted","findIndex","readVersions","committed","lastWriteError","writtenDocs","ensureCommitNotCalled","recordVersion","toMutation","preconditionForUpdate","updateFunction","maxAttempts","run","authCredentialListener","appCheckCredentialListener","setCredentialChangeListener","setAppCheckTokenChangeListener","verifyNotTerminated","isShuttingDown","enqueueAndForgetEvenWhileRestricted","onlineComponents","offlineComponents","getConfiguration","enqueue","ignoreUndefinedProperties","experimentalForceLongPolling","experimentalAutoDetectLongPolling","_authCredentials","_appCheckCredentials","_persistenceKey","_settings","_settingsFrozen","_databaseId","_app","_initialized","_terminated","_terminateTask","_setSettings","client","sessionIndex","iamToken","_getSettings","_freezeSettings","_terminate","mockUserToken","converter","firestore","_path","withConverter","_query","createAndSchedule","_progressObserver","_taskCompletionResolver","_lastProgress","onProgress","_queue","_firestoreClient","th","DOMException","eh","_internalPath","sh","_byteString","ih","_methodName","rh","isFinite","_lat","_long","oh","uh","ch","ah","hh","Dh","methodName","lh","fh","dh","merge","mergeFields","Ph","Rh","vh","Ch","_toFieldTransform","wh","mh","gh","Ah","yh","ph","Ih","Sh","Th","Eh","bh","fromDate","getPrototypeOf","Vh","search","xh","_firestore","_userDataWriter","_document","_converter","ref","Nh","fromFirestore","convertValue","kh","Mh","Oh","_firestoreImpl","Fh","serverTimestamps","$h","_snapshot","_cachedChanges","_cachedChangesIncludeMetadataChanges","oldIndex","newIndex","Bh","Lh","Uh","qh","Kh","_apply","Gh","rl","il","ol","Qh","jh","Wh","zh","Hh","Jh","Yh","sl","Xh","Zh","tl","nl","ul","cl","convertTimestamp","convertServerTimestamp","convertBytes","convertReference","convertGeoPoint","convertArray","convertObject","convertDocumentKey","al","toFirestore","ll","_commitHandler","_mutations","_committed","_dataReader","_verifyNotCommitted","fl","dl","vl","_l","wl","ml","gl","yl","pl","Il","Pl","Tl","El","Al","Rl","bl","Vl","_transaction","lookup","Sl","Dl","Cl","xl","Nl","kl","validateSetOptions","assertUint8ArrayAvailable","assertBase64Available","Blob","array","other","isPartialObserver","IndexedDbPersistenceProvider","enableIndexedDbPersistence","enableMultiTabIndexedDbPersistence","clearIndexedDbPersistence","Firestore","databaseIdOrApp","_persistenceProvider","_appCompat","settingsLiteral","currentSettings","enableNetwork","disableNetwork","enablePersistence","experimentalForceOwningTab","clearPersistence","_removeServiceInstance","waitForPendingWrites","onSnapshotsInSync","collection","pathString","CollectionReference","replaceFunctionName","DocumentReference","Query","Transaction","WriteBatch","loadBundle","bundleData","expQuery","UserDataWriter","forKey","level","documentRef","castReference","DocumentSnapshot","dataOrField","moreFieldsAndValues","FirestoreDataConverter","expSnapshot","QueryDocumentSnapshot","modelObject","converterMapByFirestore","INSTANCES","untypedConverterByConverter","fieldOrUpdateData","onSnapshot","extractSnapshotOptions","wrapObserver","snap","getInstance","updated","userObserver","opStr","directionStr","limitToLast","startAfter","endBefore","QuerySnapshot","DocumentChange","docChange","thisArg","docRef","documentPath","FieldPath","fieldNames","FieldValue","delegate","firestoreNamespace","GeoPoint","Timestamp","CACHE_SIZE_UNLIMITED","configureForFirebase","firestoreFactory","firestoreExp","registerFirestore","DEFAULT_HOST","CONFIG_STORAGE_BUCKET_KEY","DEFAULT_MAX_OPERATION_RETRY_TIME","DEFAULT_MAX_UPLOAD_RETRY_TIME","StorageError","prependCode","_baseMessage","_codeEquals","unknown","objectNotFound","quotaExceeded","bucket","unauthenticated","unauthorizedApp","unauthorized","retryLimitExceeded","canceled","invalidUrl","invalidDefaultBucket","noDefaultBucket","cannotSliceBlob","serverFileWrongSize","noDownloadURL","invalidArgument","appDeleted","invalidRootOperation","invalidFormat","format","internalError","Location","path_","isRoot","fullServerUrl","bucketOnlyServerUrl","bucketString","bucketLocation","makeFromUrl","bucketDomain","gsModify","loc","gsPath","gsRegex","gsIndices","httpModify","firebaseStorageHost","firebaseStoragePath","firebaseStorageRegExp","firebaseStorageIndices","cloudStorageHost","cloudStoragePath","cloudStorageRegExp","cloudStorageIndices","groups","regex","indices","postModify","group","captures","bucketValue","pathValue","FailRequest","promise_","getPromise","_appDelete","waitSeconds","retryTimeoutId","globalTimeoutId","hitTimeout","cancelState","triggeredCallback","triggerCallback","callWithDelay","millis","clearGlobalTimeout","success","mustStop","waitMillis","stopped","wasTimeout","isJustDef","isFunction","isNonArrayObject","isString","isNativeBlob","isNativeBlobDefined","validateNumber","minValue","makeUrl","urlPart","makeQueryString","queryPart","nextPart","NetworkRequest","url_","method_","headers_","body_","successCodes_","additionalRetryCodes_","callback_","errorCallback_","timeout_","progressCallback_","connectionFactory_","pendingConnection_","backoffId_","canceled_","appDelete_","resolve_","reject_","start_","doTheRequest","backoffCallback","RequestEndStatus","connection","progressListener","progressEvent","loaded","total","lengthComputable","addUploadProgressListener","removeUploadProgressListener","hitServer","getErrorCode","isRetryStatusCode_","wasCanceled","ABORT","successCode","backoffDone","requestWentThrough","wasSuccessCode","getErrorText","appDelete","isFiveHundredCode","extraRetryCodes","isExtraRetryCode","isRequestSpecificRetryCode","addAuthHeader_","authToken","addVersionHeader_","firebaseVersion","addGmpidHeader_","addAppCheckHeader_","appCheckToken","makeRequest","requestInfo","requestFactory","urlParams","successCodes","additionalRetryCodes","errorHandler","progressCallback","getBlobBuilder","BlobBuilder","WebKitBlobBuilder","getBlob$1","getBlob","sliceBlob","end","webkitSlice","mozSlice","decodeBase64","encoded","StringFormat","RAW","BASE64","BASE64URL","DATA_URL","StringData","contentType","dataFromString","stringData","utf8Bytes_","base64Bytes_","dataURLBytes_","dataURLContentType_","valid","percentEncodedBytes_","hasMinus","hasUnder","invalidChar","hasPlus","hasSlash","DataURLParts","dataURL","middle","endsWith","dataUrl","parts","longEnough","FbsBlob","elideCopy","blobType","data_","size_","type_","startByte","endByte","realBlob","sliced","blobby","uint8Arrays","finalLength","merged","uploadData","jsonObjectOrNull","lastIndexOf","newPath","childPath","canonicalChildPath","component","lastComponent","noXform_","Mapping","server","local","xform","mappings_","xformPath","fullPath","getMappings","mappings","mappingsXformPath","_metadata","nameMapping","xformSize","sizeMapping","addRef","generateRef","_makeStorageReference","fromResource","resource","mapping","fromResourceString","resourceString","downloadUrlFromResourceString","tokensList","urls","queryString","alt","toResourceString","PREFIXES_KEY","ITEMS_KEY","fromBackendResponse","listResult","prefixes","items","nextPageToken","pathWithoutTrailingSlash","reference","item","fromResponseString","RequestInfo","handlerCheck","cndn","metadataHandler","xhr","listHandler","downloadUrlHandler","_protocol","sharedErrorHandler","newErr","objectErrorHandler","getMetadata$2","maxOperationRetryTime","list$2","delimiter","pageToken","maxResults","getDownloadUrl","updateMetadata$2","deleteObject$2","_xhr","_text","determineContentType_","metadataForUpload_","metadataClone","multipartUpload","genBoundary","boundary","metadata_","metadataString","preBlobPart","postBlobPart","maxUploadRetryTime","ResumableUploadStatus","checkResumeHeader_","allowed","allowedStatus","createResumableUpload","metadataForUpload","getResumableUploadStatus","sizeString","RESUMABLE_UPLOAD_CHUNK_SIZE","continueResumableUpload","chunkSize","status_","bytesLeft","bytesToUpload","uploadCommand","uploadStatus","newCurrent","TaskEvent","STATE_CHANGED","TaskState","RUNNING","PAUSED","SUCCESS","CANCELED","taskStateFromInternalTaskState","Observer","asFunctions","argsToForward","textFactoryOverride","XhrConnection","sent_","xhr_","initXhr","errorCode_","sendPromise_","NETWORK_ERROR","upload","XhrTextConnection","newTextConnection","UploadTask","_transferred","_needToFetchStatus","_needToFetchMetadata","_observers","_error","_uploadUrl","_request","_chunkMultiplier","_resolve","_reject","_ref","_blob","_mappings","_resumable","_shouldDoResumable","_state","_errorHandler","completeTransitions_","_transition","_metadataErrorHandler","_promise","_makeProgressCallback","sizeBefore","_createResumable","_fetchStatus","_fetchMetadata","_continueUpload","_oneShotUpload","_resolveToken","_getAuthToken","_getAppCheckToken","_location","createRequest","_makeRequest","statusRequest","uploadRequest","newStatus","_increaseMultiplier","currentSize","metadataRequest","multipartRequest","transferred","old","_notifyObservers","wasPaused","externalState","bytesTransferred","_addObserver","_removeObserver","onFulfilled","onRejected","_notifyObserver","_finishPromise","triggered","toCall","resume","pause","Reference","_service","_newRef","_throwIfRoot","uploadBytesResumable$1","listAll$1","accumulator","listAllHelper","nextPage","list$1","makeRequestWithTokens","getMetadata$1","updateMetadata$1","getDownloadURL$1","deleteObject$1","_getChild$1","isUrl","refFromURL","refFromPath","FirebaseStorageImpl","_bucket","ref$1","serviceOrRef","pathOrUrl","extractBucket","makeFromBucketSpec","connectStorageEmulator$1","_overrideAuthToken","_authProvider","_appCheckProvider","_url","_firebaseVersion","_host","_appId","_maxOperationRetryTime","_maxUploadRetryTime","_requests","time","tokenData","STORAGE_TYPE","uploadBytesResumable","list","listAll","getDownloadURL","deleteObject","_getChild","connectStorageEmulator","instanceIdentifier","appCheckProvider","registerStorage","UploadTaskSnapshotCompat","UploadTaskCompat","wrappedNextOrObserver","taskSnapshot","ListResultCompat","ReferenceCompat","putString","StorageServiceCompat","setMaxUploadRetryTime","setMaxOperationRetryTime","storageExp","storageServiceCompat","namespaceExports","Storage","mixins","Themeable","extend","props","dark","Boolean","default","light","computed","isDark","$vuetify","staticClass","$slots","class","rtl","themeClasses","attrs","domProps","inserted","binding","vnode","modifiers","passive","querySelector","_onScroll","_uid","unbind","Scroll","Vue","directives","scrollTarget","scrollThreshold","currentScroll","currentThreshold","isActive","isScrollingUp","previousScroll","savedScroll","canScroll","computedScrollThreshold","watch","mounted","consoleWarn","onScroll","scrollTop","pageYOffset","$nextTick","thresholdMet","baseMixins","VToolbar","Scrollable","SSRBootable","Toggleable","Applicationable","provide","VAppBar","clippedLeft","clippedRight","collapseOnScroll","elevateOnScroll","fadeImgOnScroll","hideOnScroll","invertedScroll","scrollOffScreen","shrinkOnScroll","applicationProperty","isBooted","classes","collapse","absolute","fixed","hideShadow","scrollRatio","threshold","computedContentHeight","dense","computedOriginalHeight","computedFontSize","isProminent","computedLeft","application","computedMarginTop","bar","computedOpacity","isExtended","extensionHeight","computedRight","computedTransform","computedHeight","isCollapsed","styles","fontSize","convertToUnit","marginTop","callUpdate","created","genBackground","opacity","updateApplication","slots","icon","defaultSlot","VBtn","VIcon","VProgressCircular","VSheet","Routable","Positionable","Sizeable","GroupableFactory","ToggleableFactory","activeClass","btnToggle","block","depressed","fab","loading","outlined","plain","retainFocusOnClick","rounded","tile","proxyClass","disabled","isElevated","hasBg","isRound","groupClasses","elevationClasses","sizeableClasses","computedElevation","Elevatable","computedRipple","defaultRipple","circle","ripple","elevation","measurableStyles","breakingProps","$attrs","breaking","detail","$el","blur","$emit","toggle","genContent","$createElement","genLoader","loader","indeterminate","children","generateRouteLink","setColor","setBackgroundColor","setTextColor","ButtonGroup","Colorable","borderless","shaped","genData","Loadable","flat","hover","img","loaderHeight","raised","isClickable","background","genProgress","VCardActions","createSimpleFunctional","VCardSubtitle","VCardText","VCardTitle","BaseItemGroup","Touch","windowGroup","continuous","mandatory","nextIcon","prevIcon","showArrows","showArrowsOnHover","touch","touchless","required","vertical","changedByDelimiters","internalHeight","transitionHeight","transitionCount","computedTransition","axis","internalReverse","hasActiveItems","internalIndex","hasPrev","internalValue","getValue","oldVal","updateReverse","requestAnimationFrame","genDefaultSlot","genContainer","genControlIcons","genIcon","stopPropagation","lang","$scopedSlots","large","icons","prev","getNextIndex","nextIndex","getPrevIndex","prevIndex","lastIndex","itemsLength","VWindow","cycle","delimiterIcon","hideDelimiters","hideDelimiterBackground","validator","progressColor","verticalDelimiters","parentTheme","slideTimeout","isVertical","restartTimeout","startTimeout","genDelimiters","genItems","small","change","VProgressLinear","Bootable","reverseTransition","transition","inTransition","genWindowItem","$listeners","onAfterTransition","onBeforeTransition","clientHeight","onTransitionCancelled","onEnter","beforeEnter","afterEnter","enterCancelled","beforeLeave","afterLeave","leaveCancelled","enter","showLazyContent","VWindowItem","inject","inheritAttrs","VImg","scopedSlots","placeholder","getSlot","inset","padless","computedBottom","isPositioned","breakpoints","breakpointProps","offsetProps","upperFirst","orderProps","propMap","col","order","breakpointClass","className","breakpoint","cols","alignSelf","cacheKey","hasColClasses","mergeData","VGrid","Grid","fluid","ALIGNMENT","makeProps","def","alignValidator","alignProps","justifyValidator","justifyProps","alignContentValidator","alignContentProps","align","justify","alignContent","classMap","noGutters","SIZE_MAP","isFontAwesome5","iconType","isSvgPath","BindsAttrs","medium","hasClickListener","listeners$","getIcon","iconName","remapInternalIcon","sizes","xSmall","xLarge","explicitSize","getDefaultData","attrs$","getSvgWrapperData","wrapperData","applyColors","renderFontIcon","newChildren","delimiterIndex","isMaterialIcon","renderSvgIcon","svgData","xmlns","viewBox","role","renderSvgIconComponent","nativeOn","$_wrapperFor","textContent","innerHTML","Measurable","aspectRatio","contentClass","computedAspectRatio","aspectStyle","paddingBottom","__cachedSizer","hasIntersect","VResponsive","intersect","contain","eager","gradient","lazySrc","rootMargin","srcset","currentSrc","image","isLoading","calculatedAspectRatio","naturalWidth","hasError","normalisedSrc","aspect","__cachedImage","backgroundImage","backgroundPosition","loadImage","isIntersecting","lazyImg","pollForSize","onLoad","getSrc","naturalHeight","content","__genPlaceholder","slot","appear","Comparable","Proxyable","multiple","internalLazyValue","selectedIndex","selectedItem","selectedItems","toggleMethod","selectedValues","valueComparator","intern","onClick","updateInternalValue","$on","updateMandatory","updateItem","unregister","_isDestroyed","valueIndex","updateItemsState","updateMultiple","updateSingle","defaultValue","isSame","itemGroup","isInList","isInMenu","isInNav","expand","nav","subheader","threeLine","twoLine","listClick","Ripple","isInGroup","listItemGroup","inactive","selectable","removed","genAttrs","inputValue","keydown","keyCode","keyCodes","filteredChild","VNode","isComment","RegistrableInject","appendIcon","noAction","prependIcon","subGroup","$route","matchRoute","beforeDestroy","genAppendIcon","VListItemIcon","genHeader","VListItem","genPrependIcon","activator","onRouteChange","VExpandTransition","Roundable","roundedClasses","minWidth","VAvatar","horizontal","VListItemActionText","VListItemContent","VListItemTitle","VListItemSubtitle","footer","insetFooter","paddingTop","paddingRight","paddingLeft","mobileBreakpoint","mobile","mobileWidth","isNumber","deprecate","Dependent","Mobile","Overlayable","ClickOutside","Resize","clipped","disableResizeWatcher","disableRouteWatcher","expandOnHover","floating","miniVariant","miniVariantWidth","permanent","stateless","temporary","isMouseover","touchArea","stackMinZIndex","isMiniVariant","computedMaxHeight","hasApp","computedTop","isBottom","computedWidth","reactsToClick","reactsToMobile","reactsToResize","reactsToRoute","showOverlay","hideOverlay","translate","maxHeight","removeOverlay","genOverlay","updateMiniVariant","beforeMount","calculateTouchArea","parentNode","parentRect","getBoundingClientRect","closeConditional","genAppend","genPosition","genDirectives","include","getOpenDependentElements","swipeLeft","swipeRight","genListeners","mouseenter","mouseleave","transitionend","currentTarget","resizeEvent","initUIEvent","genPrepend","genBorder","touchendX","touchstartX","clientWidth","elOffsetTop","parallax","parallaxDist","percentScrolled","windowHeight","windowBottom","imgHeight","objHeight","calcDimensions","innerHeight","Translatable","display","$refs","imgData","rotate","radius","calculatedSize","circumference","PI","normalizedValue","strokeDashArray","strokeDashOffset","strokeWidth","viewBoxSize","svgStyles","genCircle","fill","cx","cy","genSvg","genInfo","onObserve","PositionableFactory","backgroundOpacity","bufferValue","striped","__cachedBackground","backgroundStyle","__cachedBar","__cachedBarType","__cachedIndeterminate","__cachedDeterminate","__cachedBuffer","genProgressBar","__cachedStream","normalizedBuffer","isReversed","reactive","VFadeTransition","VSlideXTransition","offsetX","extended","prominent","short","smAndDown","genExtension","extension","VToolbarTitle","VToolbarItems","mergeTransitions","dest","transitions","createSimpleTransition","hideOnLeave","leaveAbsolute","transformOrigin","webkitTransformOrigin","leave","offsetTop","offsetLeft","offsetWidth","offsetHeight","_transitionInitialStyles","setProperty","createJavascriptTransition","functions","expandedParentClass","sizeProperty","offsetProperty","_parent","_initialStyle","overflow","initialStyle","resetStyles","ExpandTransitionGenerator","VExpandXTransition","defaultConditional","checkEvent","checkIsActive","attachedRoot","ShadowRoot","directive","_clickOutside","lastMousedownWasOutside","handleShadow","onMousedown","IntersectionObserver","_observe","entry","quiet","observe","unobserve","Intersect","_onResize","DELAY_RIPPLE","webkitTransform","isTouchEvent","isKeyboardEvent","calculate","localX","localY","touches","scale","_ripple","center","sqrt","centerX","centerY","ripples","show","enabled","animation","getComputedStyle","dataset","previousPosition","activated","hide","getElementsByClassName","isHiding","diff","delay","isRippleEnabled","rippleShow","element","touched","rippleStop","isTouch","centered","showTimerCommit","showTimer","rippleHide","rippleCancelShow","keyboardRipple","keyboardRippleShow","keyboardRippleHide","focusRippleHide","updateRipple","wasEnabled","removeListeners","handleGesture","touchstartY","touchendY","dirRatio","minDistance","offsetY","up","down","touchstart","touchend","touchmove","touchmoveX","touchmoveY","move","createHandlers","parentElement","_touchHandlers","eventName","install","installed","OurVue","consoleError","components","registerComponents","$_vuetify_subcomponents","$_vuetify_installed","mixin","vuetify","$ssrContext","observable","hasAttribute","isHydrating","badge","dataIterator","noResultsText","loadingText","dataTable","itemsPerPageText","ariaLabel","sortDescending","sortAscending","sortNone","activateNone","activateDescending","activateAscending","sortBy","dataFooter","itemsPerPageAll","prevPage","firstPage","lastPage","pageText","datePicker","itemsSelected","nextMonthAriaLabel","nextYearAriaLabel","prevMonthAriaLabel","prevYearAriaLabel","noDataText","carousel","calendar","moreEvents","fileInput","counterSize","timePicker","am","pm","pagination","previous","page","currentPage","rating","preset","scrollBarWidth","thresholds","sm","lg","iconfont","locales","disable","cspNonce","customProperties","minifyTheme","themeCache","variations","themes","primary","secondary","accent","warning","Presets","Service","parentPreset","defaultPreset","mergeDeep","Preset","userPreset","globalPreset","Application","acc","cur","Breakpoint","xsOnly","smOnly","smAndUp","mdOnly","mdAndDown","mdAndUp","lgOnly","lgAndDown","lgAndUp","xlOnly","resizeTimeout","property","onResize","ssr","getClientHeight","getClientWidth","documentElement","innerWidth","checkboxOn","checkboxOff","checkboxIndeterminate","menu","subgroup","dropdown","radioOn","radioOff","edit","ratingEmpty","ratingFull","ratingHalf","unfold","file","plus","minus","convertToComponentDeclarations","iconSet","mdiSvg","mdi","fa4","faSvg","Icons","presets","LANG_PREFIX","fallback","getTranslation","locale","usingDefault","defaultLocale","shortKey","translation","getObjectValueByPath","Lang","translator","defaultTranslator","currentLocale","srgbForwardMatrix","srgbForwardTransform","srgbReverseMatrix","srgbReverseTransform","fromXYZ","xyz","rgb","matrix","clamp","toXYZ","delta","cielabForwardTransform","cbrt","cielabReverseTransform","transformedY","lab","isItem","anchor","variant","colors","parsedTheme","colorToHex","genVariations","colorToInt","intToHex","genBaseColor","genVariantColor","genColorVariableName","genColorVariable","genStyles","cssVar","variablesCss","css","aColor","variants","variantValue","lighten","darken","amount","LAB","sRGB","Theme","unwatch","vueMeta","defaults","fillVariant","isVueMeta23","applyVueMeta23","checkOrCreateStyleElement","styleEl","oldDark","applyTheme","clearCss","generatedStyles","$meta","initVueMeta","initSSR","initTheme","setTheme","resetThemes","genStyleElement","defaultTheme","head","metaKeyName","keyName","metaInfo","vuetifyStylesheet","cssText","addApp","$once","obs","$watch","deep","currentTheme","ThemeUtils","getNestedValue","Vuetify","use","services","silent","applicationable","events","removeApplication","newVal","deactivated","force","makeWatcher","attr","$delete","$data","$set","immediate","hasContent","isCssColor","colorName","colorModifier","searchChildren","isDependent","$children","closeDependents","openDependents","getOpenDependents","getClickableDependentElements","overlay","maxWidth","minHeight","__scrim","overlayColor","overlayOpacity","animationFrame","createOverlay","VOverlay","propsData","$mount","insertBefore","firstChild","hideScroll","activeZIndex","getZIndex","showScroll","addOnceEventListener","$destroy","cancelAnimationFrame","scrollListener","tagName","isContentEditable","deltaY","checkPath","hasScrollbar","nodeType","Node","ELEMENT_NODE","overflowY","scrollHeight","overflowX","scrollWidth","shouldScroll","deltaX","alreadyAtStart","alreadyAtEnd","scrollLeft","scrollingUp","scrollingDown","isInside","composedPath","dialog","selected","getSelection","anchorNode","addPassiveEventListener","availableProps","filterObjectOnKeys","model","generateWarning","defaultImpl","composite","exact","exactPath","exactActiveClass","nuxt","isLink","themeableProvide","appIsDark","rootIsDark","rootThemeClasses","functionalThemeClasses","vm","injections","linear","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","getOffset","totalOffset","offsetParent","getContainer","_isVue","HTMLElement","goTo","_target","scrollingElement","duration","easing","appOffset","isDrawer","isClipped","startTime","targetLocation","startLocation","ease","easingPatterns","step","currentTime","timeElapsed","reachBottom","Goto","char","hexColor","repeat","createMessage","$parent","$_alreadyWarned","generateComponentTrace","newMessage","classifyRE","classify","formatComponentName","includeFile","cid","_componentTag","__file","tree","currentRecursiveSequence","getRootNode","composed","passiveSupported","testListenerOpts","getPropertyFromItem","getPropertyValue","tagsToReplace","escapeHTML","filtered","unit","kebabCase","tab","esc","space","home","del","backspace","pageup","pagedown","iconPath","override","camelizeRE","camelize","wrapInArray","getSlotType","humanReadableFileSize","binary","toFixed","pattern","styleList","styleProp","parseStyle","styleMap","mergeTarget","mergeClasses","mergeStyles","mergeListeners","numberFormatKeys","isBoolean","OBJECT_STRING","isPlainObject","isNull","parseArgs","looseClone","arrayFrom","ret","arguments$1","looseEqual","isObjectA","isObjectB","isArrayA","isArrayB","keysA","keysB","escapeHtml","rawText","escapeParams","_i18n","i18n","$i18n","_getMessages","$tc","choice","_tc","$te","_te","$d","defineMixin","bridge","__INTLIFY_META__","__i18nBridge","__i18n","VueI18n","localeMessages","messages","mergeLocaleMessage","_i18nWatcher","watchI18nData","rootI18n","formatter","fallbackLocale","formatFallbackMessages","silentTranslationWarn","silentFallbackWarn","pluralizationRules","preserveDirectiveContent","localeMessages$1","_i18n$1","sharedMessages","sync","_localeWatcher","watchLocale","onComponentInstanceCreated","subscribeDataChanging","_subscribing","unsubscribeDataChanging","destroyVM","interpolationComponent","places","onlyHasDefaultPlace","useLegacyPlaces","createParamsFromPlaces","everyPlace","vnodeHasPlaceAttribute","assignChildPlace","assignChildIndex","place","numberComponent","_ntp","part","assert","oldVNode","localeEqual","_localeMessage","getLocaleMessage","preserve","_vt","_locale","ref$2","parseValue","makeParams","_Vue","strats","optionMergeStrategies","parentVal","childVal","BaseFormatter","_caches","interpolate","compile","RE_TOKEN_LIST_VALUE","RE_TOKEN_NAMED_VALUE","isClosed","compiled","APPEND","PUSH","INC_SUB_PATH_DEPTH","PUSH_SUB_PATH","BEFORE_PATH","IN_PATH","BEFORE_IDENT","IN_IDENT","IN_SUB_PATH","IN_SINGLE_QUOTE","IN_DOUBLE_QUOTE","AFTER_PATH","pathStateMachine","literalValueRE","isLiteral","stripQuotes","getPathCharType","formatSubPath","trimmed","parse$1","newChar","typeMap","subPathDepth","actions","maybeUnescapeQuote","nextChar","I18nPath","_cache","parsePath","hit","getPathValue","paths","availabilities","htmlTagMatcher","linkKeyMatcher","linkKeyPrefixMatcher","bracketsMatcher","defaultModifiers","toLocaleUpperCase","toLocaleLowerCase","defaultFormatter","this$1","dateTimeFormats","datetimeFormats","numberFormats","_vm","_formatter","_modifiers","_missing","_root","_sync","_fallbackRoot","fallbackRoot","_fallbackRootWithEmptyString","fallbackRootWithEmptyString","_formatFallbackMessages","_silentTranslationWarn","_silentFallbackWarn","_dateTimeFormatters","_numberFormatters","_dataListeners","_componentInstanceCreatedListener","componentInstanceCreatedListener","_preserveDirectiveContent","_warnHtmlInMessage","warnHtmlInMessage","_postTranslation","postTranslation","_escapeParameterHtml","escapeParameterHtml","__VUE_I18N_BRIDGE__","getChoiceIndex","choicesLength","thisPrototype","prototypeGetChoiceIndex","_choice","_choicesLength","_exist","_checkLocaleMessage","_initVM","prototypeAccessors","availableLocales","__VUE18N__INSTANCE__","nextTick","$forceUpdate","composer","target$1","newI18n","_getDateTimeFormats","_getNumberFormats","_localeChainCache","orgLevel","_warnDefault","interpolateMode","missingRet","parsedArgs","_render","_isFallbackRoot","_isSilentFallbackWarn","_isSilentFallback","_isSilentTranslationWarn","_interpolate","visitedLinkStack","pathRet","linkKeyPrefixMatches","linkPrefix","formatterName","linkPlaceholder","translated","_translate","_createMessageContext","_list","_named","named","linked","linkedKey","_appendItemToChain","chain","blocks","follow","_appendLocaleToChain","_appendBlockToChain","_getLocaleChain","res","predefined","fetchChoice","choices","setLocaleMessage","getDateTimeFormat","setDateTimeFormat","_clearDateTimeFormat","mergeDateTimeFormat","_localizeDateTime","formats","Intl","DateTimeFormat","getNumberFormat","setNumberFormat","_clearNumberFormat","mergeNumberFormat","_getNumberFormatter","NumberFormat","numberFormat","nf","formatToParts","defineProperties","intlDefined","dateTimeFormat","encodeReserveRE","encodeReserveReplacer","commaRE","resolveQuery","extraQuery","_parseQuery","parsedQuery","parseQuery","castQueryParamValue","param","stringifyQuery","val2","trailingSlashRE","createRoute","record","redirectedFrom","router","route","meta","hash","getFullPath","matched","formatMatch","START","_stringifyQuery","isSameRoute","onlyPath","isObjectEqual","aVal","bKey","bVal","isIncludedRoute","queryIncludes","handleRouteEntered","instances","cbs","enteredCbs","i$1","_isBeingDestroyed","View","routerView","_routerViewCache","depth","_routerRoot","vnodeData","keepAlive","_directInactive","_inactive","routerViewDepth","cachedData","cachedComponent","configProps","fillPropsinData","registerRouteInstance","prepatch","componentInstance","propsToPass","resolveProps","resolvePath","relative","firstChar","segment","hashIndex","queryIndex","cleanPath","isarray","pathToRegexp_1","pathToRegexp","parse_1","compile_1","tokensToFunction_1","tokensToFunction","tokensToRegExp_1","tokensToRegExp","PATH_REGEXP","defaultDelimiter","escaped","modifier","asterisk","partial","escapeGroup","escapeString","encodeURIComponentPretty","encodeAsterisk","flags","opts","pretty","attachKeys","sensitive","regexpToRegexp","arrayToRegexp","regexp","stringToRegexp","strict","endsWithDelimiter","regexpCompileCache","fillParams","routeMsg","filler","pathMatch","normalizeLocation","raw","_normalized","params$1","rawPath","parsedPath","basePath","toTypes","eventTypes","Link","custom","ariaCurrentValue","this$1$1","$router","globalActiveClass","linkActiveClass","globalExactActiveClass","linkExactActiveClass","activeClassFallback","exactActiveClassFallback","compareTarget","guardEvent","scopedSlot","$hasNormal","navigate","isExactActive","findAnchor","isStatic","aData","handler$1","event$1","aAttrs","getAttribute","isDef","registerInstance","callVal","_parentVnode","_router","util","defineReactive","history","_route","beforeRouteEnter","beforeRouteLeave","beforeRouteUpdate","inBrowser","createRouteMap","routes","oldPathList","oldPathMap","oldNameMap","parentRoute","pathList","pathMap","nameMap","addRouteRecord","matchAs","pathToRegexpOptions","normalizedPath","normalizePath","caseSensitive","compileRouteRegex","alias","redirect","childMatchAs","aliases","aliasRoute","createMatcher","addRoutes","addRoute","parentOrRoute","getRoutes","currentRoute","_createRoute","paramNames","record$1","originalRedirect","resolveRecordPath","resolvedPath","aliasedPath","aliasedMatch","aliasedRecord","Time","genStateKey","getStateKey","setStateKey","positionStore","setupScroll","scrollRestoration","protocolAndPath","absolutePath","stateCopy","replaceState","handlePopState","handleScroll","isPop","behavior","scrollBehavior","getScrollPosition","scrollToPosition","saveScrollPosition","pageXOffset","getElementPosition","docEl","docRect","elRect","isValidPosition","normalizePosition","normalizeOffset","hashStartsWithNumberRE","selector","scrollTo","supportsPushState","pushState","NavigationFailureType","redirected","cancelled","duplicated","createNavigationRedirectedError","createRouterError","stringifyRoute","createNavigationDuplicatedError","createNavigationCancelledError","createNavigationAbortedError","_isRouter","propertiesToLog","isError","isNavigationFailure","errorType","runQueue","resolveAsyncComponents","hasAsync","pending","flatMapComponents","resolvedDef","isESModule","resolved","comp","flatten","hasSymbol","toStringTag","__esModule","called","History","normalizeBase","readyCbs","readyErrorCbs","errorCbs","baseEl","resolveQueue","extractGuards","records","guards","guard","extractGuard","extractLeaveGuards","bindGuard","extractUpdateHooks","extractEnterGuards","bindEnterGuard","onReady","errorCb","transitionTo","onComplete","confirmTransition","updateRoute","ensureURL","afterHooks","lastRouteIndex","lastCurrentIndex","beforeHooks","enterGuards","resolveHooks","setupListeners","teardown","cleanupListener","HTML5History","_startLocation","getLocation","expectScroll","supportsScroll","handleRoutingEvent","fromRoute","getCurrentLocation","pathname","pathLowerCase","baseLowerCase","HashHistory","checkFallback","ensureSlash","getHash","replaceHash","pushHash","getUrl","AbstractHistory","targetIndex","VueRouter","apps","matcher","handleInitialScroll","routeOrError","beforeEach","registerHook","beforeResolve","afterEach","back","forward","getMatchedComponents","createHref","normalizedTo","VueRouter$1","START_LOCATION","emptyObject","isUndef","isTrue","isFalse","isPrimitive","_toString","isRegExp","isValidArrayIndex","isPromise","toNumber","makeMap","expectsLowerCase","isReservedAttribute","remove$2","cached","capitalize","hyphenateRE","hyphenate","polyfillBind","ctx","boundFn","_length","nativeBind","_from","identity","looseIndexOf","hasChanged","SSR_ATTR","ASSET_TYPES","LIFECYCLE_HOOKS","productionTip","devtools","warnHandler","ignoredElements","isReservedTag","isReservedAttr","isUnknownElement","getTagNamespace","parsePlatformTagName","mustUseProp","_lifecycleHooks","unicodeRegExp","isReserved","bailRE","hasProto","UA","isIE9","isEdge","isIOS","_isServer","isFF","nativeWatch","supportsPassive","isServerRendering","env","VUE_ENV","__VUE_DEVTOOLS_GLOBAL_HOOK__","isNative","Ctor","_Set","currentInstance","setCurrentInstance","_scope","off","elm","componentOptions","asyncFactory","fnContext","fnOptions","fnScopeId","isRootInsert","isCloned","isOnce","asyncMeta","isAsyncPlaceholder","createEmptyVNode","createTextVNode","cloneVNode","cloned","uid$2","Dep","subs","addSub","removeSub","depend","addDep","notify","targetStack","pushTarget","popTarget","arrayProto","arrayMethods","methodsToPatch","__ob__","observeArray","dep","arrayKeys","NO_INIITIAL_VALUE","shouldObserve","toggleObserving","mockDep","shallow","mock","vmCount","ssrMockReactivity","isRef","isExtensible","__v_skip","customSetter","childOb","dependArray","isReadonly","shallowReactive","makeReactive","__v_isReadonly","__v_isRef","proxyWithRefUnwrap","WATCHER","activeEffectScope","EffectScope","detached","effects","cleanups","currentEffectScope","fromParent","recordEffectScope","effect","resolveProvided","_provided","parentProvides","normalizeEvent","createFnInvoker","fns","invoker","invokeWithErrorHandling","updateListeners","oldOn","createOnceHandler","mergeVNodeHook","hookKey","oldHook","wrappedHook","extractPropsFromVNodeData","propOptions","checkProp","simpleNormalizeChildren","normalizeChildren","normalizeArrayChildren","isTextNode","nestedIndex","_isVList","renderList","renderSlot","fallbackRender","bindObject","nodes","scopedSlotFn","resolveFilter","resolveAsset","isKeyNotMatch","expect","actual","checkKeyCodes","eventKeyCode","builtInKeyCode","eventKeyName","builtInKeyName","mappedKeyCode","bindObjectProps","asProp","isSync","_loop_1","camelizedKey","hyphenatedKey","$event","renderStatic","isInFor","_staticTrees","_renderProxy","markStatic","markOnce","markStaticNode","bindObjectListeners","ours","resolveScopedSlots","hasDynamicKeys","contentHashKey","$stable","$key","bindDynamicKeys","baseObj","prependModifier","installRenderHelpers","_q","_m","_v","_p","resolveSlots","name_1","name_2","isWhitespace","normalizeScopedSlots","ownerVm","normalSlots","prevScopedSlots","hasNormalSlots","isStable","key_1","normalizeScopedSlot","key_2","proxyNormalSlot","normalized","initSetup","setup","_setupContext","createSetupContext","setupResult","_props","_setupState","__sfc","_setupProxy","_attrsProxy","syncSetupProxy","_listenersProxy","initSlotsProxy","emit","expose","exposed","changed","defineProxyAttr","_slotsProxy","syncSetupSlots","initRender","_vnode","parentVnode","renderContext","_renderChildren","createElement$1","parentData","_parentListeners","currentRenderingInstance","renderMixin","_isMounted","handleError","ensureCtor","createAsyncPlaceholder","resolveAsyncComponent","baseCtor","errorComp","owner","owners","loadingComp","owners_1","sync_1","timerLoading_1","timerTimeout_1","forceRender_1","renderCompleted","reject_1","res_1","getFirstComponentChild","SIMPLE_NORMALIZE","ALWAYS_NORMALIZE","normalizationType","alwaysNormalize","_createElement","pre","createComponent","applyNS","registerDeepBindings","traverse","hooks","errorCaptured","globalHandleError","_handled","logError","timerFunc","isUsingMicroTask","callbacks","flushCallbacks","copies","p_1","MutationObserver","setImmediate","counter_1","textNode_1","createTextNode","characterData","createLifeCycle","hookName","injectHook","mergeLifecycleHook","seenObjects","_traverse","seen","isA","isFrozen","depId","uid$1","Watcher","expOrFn","isRenderWatcher","_watcher","lazy","post","dirty","newDeps","depIds","newDepIds","expression","cleanupDeps","tmp","queueWatcher","evaluate","onStop","initEvents","_events","_hasHookEvent","updateComponentListeners","add$1","remove$1","$off","createOnceHandler$1","onceHandler","oldListeners","eventsMixin","hookRE","i_1","activeInstance","setActiveInstance","prevActiveInstance","initLifecycle","abstract","lifecycleMixin","_update","hydrating","prevEl","prevVnode","restoreActiveInstance","__patch__","__vue__","callHook$1","mountComponent","updateComponent","watcherOptions","preWatchers","_preWatchers","updateChildComponent","renderChildren","newScopedSlots","oldScopedSlots","hasDynamicScopedSlot","needsForceUpdate","prevVNode","prevListeners","propKeys","_propKeys","validateProp","isInInactiveTree","activateChildComponent","direct","deactivateChildComponent","setContext","activatedChildren","waiting","flushing","resetSchedulerState","currentFlushTimestamp","getNow","performance_1","timeStamp","sortCompareFn","flushSchedulerQueue","watcher","activatedQueue","updatedQueue","callActivatedHooks","callUpdatedHooks","queueActivatedComponent","noRecurse","initProvide","provideOption","provided","initInjections","resolveInject","provideKey","provideDefault","FunctionalRenderContext","contextVm","_this","_original","isCompiled","needNormalization","createFunctionalComponent","mergeProps","cloneAndMarkFunctionalResult","vnodes","getComponentName","__name","componentVNodeHooks","mountedNode","createComponentInstanceForVnode","oldVnode","destroy","hooksToMerge","_base","resolveConstructorOptions","transformModel","installComponentHooks","_isComponent","inlineTemplate","toMerge","_merged","mergeHook","f1","f2","toVal","fromVal","mergeDataOrFn","instanceData","defaultData","dedupeHooks","mergeAssets","parent_1","defaultStrat","normalizeProps","normalizeInject","normalizeDirectives$1","dirs","mergeOptions","extends","mergeField","strat","warnMissing","assets","camelizedId","PascalCaseId","absent","booleanIndex","getTypeIndex","stringIndex","getPropDefaultValue","prevShouldObserve","getType","functionTypeCheckRE","isSameType","expectedTypes","sharedPropertyDefinition","sourceKey","initState","initProps$1","initMethods","initData","initComputed$1","initWatch","propsOptions","getData","computedWatcherOptions","watchers","_computedWatchers","isSSR","userDef","defineComputed","shouldCache","createComputedGetter","createGetterInvoker","createWatcher","stateMixin","dataDef","propsDef","initMixin$1","_init","initInternalComponent","_self","vnodeComponentOptions","superOptions","cachedSuperOptions","modifiedOptions","resolveModifiedOptions","extendOptions","modified","latest","sealed","sealedOptions","initUse","plugin","installedPlugins","_installedPlugins","initMixin","initExtend","Super","SuperId","cachedCtors","_Ctor","Sub","initProps","initComputed","Comp","initAssetRegisters","definition","_getComponentName","pruneCache","keepAliveInstance","pruneCacheEntry","patternTypes","KeepAlive","exclude","cacheVNode","vnodeToCache","keyToCache","builtInComponents","initGlobalAPI","configDef","acceptValue","isEnumeratedAttr","isValidContentEditableValue","convertEnumeratedValue","isFalsyAttrValue","isBooleanAttr","xlinkNS","isXlink","getXlinkProp","genClassForVnode","childNode","mergeClassData","renderClass","dynamicClass","stringifyClass","stringifyArray","stringifyObject","stringified","namespaceMap","svg","math","isHTMLTag","isSVG","unknownElementCache","HTMLUnknownElement","isTextInputType","createElementNS","createComment","newNode","referenceNode","nextSibling","setTextContent","setStyleScope","nodeOps","registerRef","isRemoval","refValue","$refsValue","isFor","refInFor","_isString","_isRef","refs","setSetupRef","emptyNode","sameVnode","sameInputType","typeA","typeB","createKeyToOldIdx","beginIdx","endIdx","createPatchFunction","backend","modules","emptyNodeAt","createRmCb","childElm","removeNode","createElm","insertedVnodeQueue","parentElm","refElm","nested","ownerArray","setScope","createChildren","invokeCreateHooks","isReactivated","initComponent","reactivateComponent","pendingInsert","isPatchable","innerNode","activate","i_2","ancestor","addVnodes","startIdx","invokeDestroyHook","removeVnodes","removeAndInvokeRemoveHook","rm","i_3","updateChildren","oldCh","newCh","removeOnly","oldKeyToIdx","idxInOld","vnodeToMove","oldStartIdx","newStartIdx","oldEndIdx","oldStartVnode","oldEndVnode","newEndIdx","newStartVnode","newEndVnode","canMove","patchVnode","findIdxInOld","i_5","hydrate","postpatch","invokeInsertHook","initial","i_6","isRenderedModule","inVPre","childrenMatch","i_7","fullInvoke","isInitialPatch","isRealElement","removeAttribute","oldElm","_leaveCb","patchable","i_8","i_9","insert_1","i_10","updateDirectives","oldDir","isCreate","isDestroy","oldDirs","normalizeDirectives","newDirs","dirsWithInsert","dirsWithPostpatch","oldArg","callHook","componentUpdated","callInsert","emptyModifiers","getRawDirName","setupDef","rawName","baseModules","updateAttrs","oldAttrs","_v_attr_proxy","setAttr","removeAttributeNS","isInPre","baseSetAttr","setAttributeNS","__ieph","blocker_1","stopImmediatePropagation","updateClass","oldData","transitionClass","_transitionClasses","_prevClass","klass","RANGE_TOKEN","CHECKBOX_RADIO_TOKEN","normalizeEvents","event_1","useMicrotaskFix","attachedTimestamp_1","original_1","_wrapper","ownerDocument","updateDOMListeners","svgContainer","updateDOMProps","oldProps","_value","strCur","shouldUpdateValue","checkVal","composing","isNotInFocusAndDirty","isDirtyWithModifiers","notInFocus","activeElement","_vModifiers","parseStyleText","listDelimiter","propertyDelimiter","normalizeStyleData","normalizeStyleBinding","staticStyle","bindingStyle","getStyle","checkChild","styleData","emptyStyle","cssVarRE","importantRE","setProp","normalizedName","vendorNames","capName","updateStyle","oldStaticStyle","oldStyleBinding","normalizedStyle","oldStyle","newStyle","whitespaceRE","addClass","removeClass","tar","resolveTransition","autoCssTransition","enterClass","enterToClass","enterActiveClass","leaveClass","leaveToClass","leaveActiveClass","hasTransition","TRANSITION","ANIMATION","transitionProp","transitionEndEvent","animationProp","animationEndEvent","ontransitionend","onwebkittransitionend","onanimationend","onwebkitanimationend","raf","nextFrame","addTransitionClass","transitionClasses","removeTransitionClass","whenTransitionEnds","expectedType","getTransitionInfo","propCount","ended","onEnd","transformRE","transitionDelays","transitionDurations","transitionTimeout","getTimeout","animationDelays","animationDurations","animationTimeout","hasTransform","delays","durations","toMs","toggleDisplay","_enterCb","appearClass","appearToClass","appearActiveClass","beforeAppear","afterAppear","appearCancelled","transitionNode","isAppear","startClass","toClass","beforeEnterHook","enterHook","afterEnterHook","enterCancelledHook","explicitEnterDuration","expectsCSS","userWantsControl","getHookArgumentsLength","pendingNode","_pending","isValidDuration","delayLeave","explicitLeaveDuration","performLeave","invokerFns","_enter","platformModules","patch","vmodel","trigger","_vOptions","setSelected","onCompositionStart","onCompositionEnd","prevOptions_1","curOptions_1","needReset","hasNoMatchingOption","actuallySetSelected","isMultiple","option","initEvent","locateNode","originalDisplay","__vOriginalDisplay","platformDirectives","transitionProps","getRealChild","compOptions","extractTransitionData","rawChild","hasParentTransition","isSameChild","oldChild","isNotTextNode","isVShowDirective","Transition","_leaving","oldRawChild","delayedLeave_1","moveClass","TransitionGroup","kept","prevChildren","rawChildren","transitionData","hasMove","callPendingCbs","recordPosition","applyTranslation","_reflow","moved","el_1","WebkitTransform","transitionDuration","_moveCb","propertyName","_hasMove","cloneNode","newPos","oldPos","dx","dy","platformComponents","applyMixin","vuexInit","$store","devtoolHook","devtoolPlugin","_devtoolHook","targetState","prepend","subscribeAction","deepCopy","forEachValue","Module","rawModule","_children","_rawModule","rawState","namespaced","addChild","getChild","hasChild","getters","forEachChild","forEachGetter","forEachAction","forEachMutation","ModuleCollection","rawRootModule","targetModule","newModule","getNamespace","rawChildModule","isRegistered","Store","_committing","_actions","_actionSubscribers","_wrappedGetters","_modules","_modulesNamespaceMap","_subscribers","_watcherVM","_makeLocalGettersCache","dispatch","installModule","resetStoreVM","useDevtools","prototypeAccessors$1","genericSubscribe","resetStore","hot","oldVm","wrappedGetters","$$state","enableStrictMode","_withCommit","rootState","parentState","getNestedState","moduleName","makeLocalContext","namespacedType","registerMutation","registerAction","registerGetter","noNamespace","_type","_payload","_options","unifyObjectStyle","makeLocalGetters","gettersProxy","splitPos","localType","rootGetters","rawGetter","after","registerModule","preserveState","unregisterModule","hasModule","hotUpdate","newOptions","committing","mapState","normalizeNamespace","states","normalizeMap","getModuleByNamespace","vuex","mapMutations","mapGetters","mapActions","createNamespacedHelpers","isValidMap","helper","createLogger","collapsed","stateBefore","stateAfter","transformer","mutationTransformer","mut","actionFilter","actionTransformer","act","logMutations","logActions","logger","prevState","nextState","formattedTime","getFormattedTime","formattedMutation","startMessage","log","endMessage","formattedAction","groupCollapsed","groupEnd","pad","getHours","getMinutes","getSeconds","getMilliseconds","times","maxLength","FirebaseAppImpl","_addComponent","automaticDataCollectionEnabled","checkDestroyed","removeApp","deleteApp","_getService","_DEFAULT_ENTRY_NAME","getComponent","instantiationMode","clearInstance","_addOrOverwriteComponent","ERRORS","ERROR_FACTORY","createFirebaseNamespaceCore","firebaseAppImpl","initializeApp","initializeAppCompat","onLog","registerComponentCompat","useAsService","modularAPIs","rawConfig","appCompat","getApps","componentName","componentNameWithoutCompat","serviceNamespace","appArg","serviceProps","serviceFxn","multipleInstances","useService","createFirebaseNamespace","extendNamespace","firebase$1","registerCoreComponents","sdkVersion","instanceOfAny","constructors","idbProxyableTypes","cursorAdvanceMethods","getIdbProxyableTypes","IDBDatabase","IDBObjectStore","IDBIndex","IDBCursor","IDBTransaction","getCursorAdvanceMethods","advance","continuePrimaryKey","cursorRequestMap","transactionDoneMap","transactionStoreNamesMap","transformCache","reverseTransformCache","promisifyRequest","unlisten","cacheDonePromiseForTransaction","tx","idbProxyTraps","replaceTraps","wrapFunction","storeNames","transformCachableValue","Proxy","IDBRequest","openDB","blocked","upgrade","blocking","terminated","openPromise","readMethods","writeMethods","cachedMethods","targetFuncName","useIndex","isWrite","storeName","oldTraps","PlatformLoggerServiceImpl","getPlatformInfoString","getProviders","isVersionServiceProvider","library","logString","name$o","version$1","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","_components","addComponent","addOrOverwriteComponent","heartbeatController","triggerHeartbeat","_clearComponents","_isDeleted","_config","_name","_automaticDataCollectionEnabled","_container","isDeleted","existingApp","newApp","libraryKeyOrName","libraryMismatch","versionMismatch","logCallback","STORE_NAME","dbPromise","getDbPromise","originalErrorMessage","readHeartbeatsFromIndexedDB","computeKey","idbGetError","writeHeartbeatsToIndexedDB","heartbeatObject","MAX_HEADER_BYTES","STORED_HEARTBEAT_RETENTION_MAX_MILLIS","HeartbeatServiceImpl","_heartbeatsCache","_storage","HeartbeatStorageImpl","_heartbeatsCachePromise","platformLogger","agent","getUTCDateString","lastSentHeartbeatDate","heartbeats","singleDateHeartbeat","hbTimestamp","overwrite","heartbeatsToSend","unsentEntries","extractHeartbeatsForHeader","headerString","today","heartbeatsCache","maxSize","heartbeatEntry","dates","countBytes","_canUseIndexedDBPromise","runIndexedDBEnvironmentCheck","canUseIndexedDB","idbHeartbeatObject","heartbeatsObject","existingHeartbeatsObject","Component","instanceFactory","onInstanceCreated","Provider","instancesDeferred","instancesOptions","onInitCallbacks","normalizedIdentifier","normalizeInstanceIdentifier","shouldAutoInitialize","getOrInitializeService","setComponent","isComponentEager","instanceDeferred","isComponentSet","normalizedDeferredIdentifier","existingCallbacks","invokeOnInitCallbacks","normalizeIdentifierForFactory","ComponentContainer","LogLevel","levelStringToEnum","DEBUG","VERBOSE","INFO","WARN","SILENT","defaultLogLevel","ConsoleMethod","defaultLogHandler","logType","Logger","_logLevel","_logHandler","_userLogHandler","logHandler","userLogHandler","inst","setUserLogHandler","customLogLevel","ignored"],"sourceRoot":""}