cloudcommerce 0.37.1 → 0.39.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/.github/workflows/test-apps.yml +2 -2
  2. package/.vscode/settings.json +1 -1
  3. package/CHANGELOG.md +64 -0
  4. package/action.yml +2 -2
  5. package/ecomplus-stores/barra-doce/functions/many/package.json +3 -3
  6. package/ecomplus-stores/barra-doce/functions/ssr/package.json +6 -6
  7. package/ecomplus-stores/barra-doce/functions/ssr/src/layouts/PageHeader.astro +3 -6
  8. package/ecomplus-stores/barra-doce/functions/with-apps/package.json +3 -3
  9. package/ecomplus-stores/barra-doce/package.json +2 -2
  10. package/package.json +7 -7
  11. package/packages/api/lib/api.d.ts +2 -2
  12. package/packages/api/package.json +1 -1
  13. package/packages/api/types.d.ts +4 -1
  14. package/packages/apps/affilate-program/package.json +1 -1
  15. package/packages/apps/correios/package.json +1 -1
  16. package/packages/apps/custom-payment/package.json +1 -1
  17. package/packages/apps/custom-shipping/package.json +1 -1
  18. package/packages/apps/datafrete/package.json +1 -1
  19. package/packages/apps/discounts/package.json +1 -1
  20. package/packages/apps/emails/package.json +1 -1
  21. package/packages/apps/fb-conversions/package.json +1 -1
  22. package/packages/apps/flash-courier/package.json +1 -1
  23. package/packages/apps/frenet/package.json +1 -1
  24. package/packages/apps/galaxpay/package.json +1 -1
  25. package/packages/apps/google-analytics/package.json +1 -1
  26. package/packages/apps/jadlog/package.json +1 -1
  27. package/packages/apps/loyalty-points/package.json +1 -1
  28. package/packages/apps/mandae/package.json +1 -1
  29. package/packages/apps/melhor-envio/package.json +1 -1
  30. package/packages/apps/mercadopago/package.json +1 -1
  31. package/packages/apps/pagarme/package.json +1 -1
  32. package/packages/apps/pagarme-v5/package.json +1 -1
  33. package/packages/apps/paghiper/package.json +1 -1
  34. package/packages/apps/pix/package.json +1 -1
  35. package/packages/apps/tiny-erp/package.json +1 -1
  36. package/packages/apps/webhooks/package.json +1 -1
  37. package/packages/cli/config/firestore.rules +4 -1
  38. package/packages/cli/lib/cli.js +30 -9
  39. package/packages/cli/package.json +2 -1
  40. package/packages/cli/src/cli.ts +37 -9
  41. package/packages/config/package.json +1 -1
  42. package/packages/emails/package.json +1 -1
  43. package/packages/eslint/package.json +3 -3
  44. package/packages/events/package.json +1 -1
  45. package/packages/feeds/package.json +1 -1
  46. package/packages/firebase/package.json +1 -1
  47. package/packages/i18n/package.json +1 -1
  48. package/packages/modules/package.json +1 -1
  49. package/packages/passport/package.json +1 -1
  50. package/packages/ssr/package.json +5 -5
  51. package/packages/storefront/.auto-imports.d.ts +1 -0
  52. package/packages/storefront/client.d.ts +1 -0
  53. package/packages/storefront/config/storefront.tailwind.cjs +21 -20
  54. package/packages/storefront/config/storefront.unocss.cjs +11 -0
  55. package/packages/storefront/dist/client/_astro/{AccountPage.700be123.js → AccountPage.j0C5JBLY.js} +1 -1
  56. package/packages/storefront/dist/client/_astro/{CartSidebar.430b55df.js → CartSidebar.1kUFk9Xn.js} +1 -1
  57. package/packages/storefront/dist/client/_astro/HeroSlider.tR1dVXyu.js +1 -0
  58. package/packages/storefront/dist/client/_astro/{PitchBar.06e0f831.js → PitchBar.FelC04wE.js} +1 -1
  59. package/packages/storefront/dist/client/_astro/{Prices.0e829c31.js → Prices.PuQc6C7F.js} +1 -1
  60. package/packages/storefront/dist/client/_astro/ProductCard.ephJafAE.js +1 -0
  61. package/packages/storefront/dist/client/_astro/ProductDetails.B6Ih5MGf.js +7 -0
  62. package/packages/storefront/dist/client/_astro/ProductShelf.GESxuPZ_.js +1 -0
  63. package/packages/storefront/dist/client/_astro/{QuantitySelector.ebf60845.js → QuantitySelector.YNmWjN8y.js} +1 -1
  64. package/packages/storefront/dist/client/_astro/SearchContainer.BzixfU3R.js +1 -0
  65. package/packages/storefront/dist/client/_astro/SearchModal.F7vbwxIv.js +1 -0
  66. package/packages/storefront/dist/client/_astro/ShopHeader.5vR1LgSW.js +10 -0
  67. package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.sk5AFsEV.js +1 -0
  68. package/packages/storefront/dist/client/_astro/_slug_.r8QHNfdw.css +1 -0
  69. package/packages/storefront/dist/client/_astro/client.RF8UxjZd.js +1 -0
  70. package/packages/storefront/dist/client/_astro/customer-session._VkzXnXT.js +7 -0
  71. package/packages/storefront/dist/client/_astro/ecom-utils.gJYgRPRz.js +1 -0
  72. package/packages/storefront/dist/client/_astro/{firebase-app.992a296f.js → firebase-app.cPMfoOsn.js} +1 -1
  73. package/packages/storefront/dist/client/_astro/{format-money.9cf6b04d.js → format-money.FMQXgKHB.js} +1 -1
  74. package/packages/storefront/dist/client/_astro/{hoisted.c90fc6ab.js → hoisted.B6fKrLPR.js} +1 -1
  75. package/packages/storefront/dist/client/_astro/{hoisted.54eaab04.js → hoisted._FbzheVm.js} +1 -1
  76. package/packages/storefront/dist/client/_astro/{i18n.29216eeb.js → i18n.m7SpISxy.js} +1 -1
  77. package/packages/storefront/dist/client/_astro/{img.4f23a3dd.js → img.zh-Drf-O.js} +1 -1
  78. package/packages/storefront/dist/client/_astro/{index-61e5ac61.bdc8d0cd.js → index-dd468b12.D5s8VdAL.js} +92 -107
  79. package/packages/storefront/dist/client/_astro/{index.570b84fe.js → index.5PN-EYMS.js} +1 -1
  80. package/packages/storefront/dist/client/_astro/index.XrHFaN2F.js +1 -0
  81. package/packages/storefront/dist/client/_astro/{modules-info.55780599.js → modules-info.sD0tdb2b.js} +1 -1
  82. package/packages/storefront/dist/client/_astro/name.HU5l7TJo.js +1 -0
  83. package/packages/storefront/dist/client/_astro/{photoswipe-lightbox.esm.c157838f.js → photoswipe-lightbox.esm.dZBqKD9u.js} +1 -1
  84. package/packages/storefront/dist/client/_astro/{photoswipe.01431ec7.js → photoswipe.0V7m2jWu.js} +1 -2
  85. package/packages/storefront/dist/client/_astro/{photoswipe.esm.92c2d901.js → photoswipe.esm.Ylh9TGkz.js} +1 -1
  86. package/packages/storefront/dist/client/_astro/sf-utils.5t7r9A2G.js +1 -0
  87. package/packages/storefront/dist/client/_astro/{shopping-cart.d9f601dd.js → shopping-cart.A-1jhlKi.js} +1 -1
  88. package/packages/storefront/dist/client/_astro/use-analytics.1EVxbrS7.js +1 -0
  89. package/packages/storefront/dist/client/_astro/{use-product-card.437911bb.js → use-product-card.erbOV6Fv.js} +1 -1
  90. package/packages/storefront/dist/client/robots.txt +1 -0
  91. package/packages/storefront/dist/server/chunks/{CartSidebar_eab28771.mjs → CartSidebar_hAgJQJgm.mjs} +1 -1
  92. package/packages/storefront/dist/server/chunks/SearchModal_eWb5SdQM.mjs +351 -0
  93. package/packages/storefront/dist/server/chunks/{_.._5a781fb3.mjs → _.._S7DDBn_b.mjs} +1 -1
  94. package/packages/storefront/dist/server/chunks/{account_519edb70.mjs → account_3ySmGzMc.mjs} +1 -1
  95. package/packages/storefront/dist/server/chunks/astro/{assets-service_a9d9ab5f.mjs → assets-service_QlOZG8ov.mjs} +1 -1
  96. package/packages/storefront/dist/server/chunks/{astro_d98f7186.mjs → astro_zcC1GStV.mjs} +17 -34
  97. package/packages/storefront/dist/server/chunks/{index_5e3ed8a0.mjs → index_nIwq11oA.mjs} +1 -1
  98. package/packages/storefront/dist/server/chunks/{index_10e14f85.mjs → index_uAR5ZV4d.mjs} +1 -1
  99. package/packages/storefront/dist/server/chunks/{node_1119b0d1.mjs → node_2VvC7trl.mjs} +1 -1
  100. package/packages/storefront/dist/server/chunks/pages/{__93ade2dd.mjs → __MSibDuuV.mjs} +652 -255
  101. package/packages/storefront/dist/server/chunks/pages/{account_e5d410a7.mjs → account_iG-YqJ5q.mjs} +3 -2
  102. package/packages/storefront/dist/server/chunks/pages/{index_7e25afc1.mjs → index_BtDyKPh_.mjs} +3 -2
  103. package/packages/storefront/dist/server/chunks/pages/{node_bd378ac0.mjs → node_bKqL47eZ.mjs} +2 -2
  104. package/packages/storefront/dist/server/chunks/pages/{~fallback_73578d2f.mjs → ~fallback_73R5VA6j.mjs} +3 -2
  105. package/packages/storefront/dist/server/chunks/{photoswipe_9528923e.mjs → photoswipe_IcWDJiwc.mjs} +1 -1
  106. package/packages/storefront/dist/server/chunks/{~fallback_41122b9b.mjs → ~fallback_7q1dqY4e.mjs} +1 -1
  107. package/packages/storefront/dist/server/entry.mjs +970 -93
  108. package/packages/storefront/dist/server/manifest_dSwvaOdW.mjs +195 -0
  109. package/packages/storefront/dist/server/renderers.mjs +2 -2
  110. package/packages/storefront/package.json +12 -12
  111. package/packages/storefront/src/helpers/sf-utils.ts +29 -1
  112. package/packages/storefront/src/lib/components/SharedData.astro +2 -2
  113. package/packages/storefront/src/lib/composables/use-breadcrumbs.ts +1 -1
  114. package/packages/storefront/src/lib/composables/use-search-modal.ts +1 -1
  115. package/packages/storefront/src/lib/composables/use-search-showcase.ts +55 -0
  116. package/packages/storefront/src/lib/composables/use-shared-data.ts +10 -5
  117. package/packages/storefront/src/lib/composables/use-shop-header.ts +14 -5
  118. package/packages/storefront/src/lib/composables/use-sticky-header.ts +2 -0
  119. package/packages/storefront/src/lib/layouts/BaseHead.astro +8 -1
  120. package/packages/storefront/src/lib/layouts/use-page-header.ts +6 -3
  121. package/packages/storefront/src/lib/layouts/use-page-main.ts +45 -1
  122. package/packages/storefront/src/lib/scripts/firestore.ts +27 -0
  123. package/packages/storefront/src/lib/ssr-context.ts +14 -0
  124. package/packages/storefront/src/lib/state/search-engine.ts +65 -27
  125. package/packages/storefront/src/lib/state/use-analytics.ts +9 -10
  126. package/packages/test-base/package.json +1 -1
  127. package/packages/types/package.json +1 -1
  128. package/packages/storefront/dist/client/_astro/HeroSlider.bd684ed8.js +0 -1
  129. package/packages/storefront/dist/client/_astro/ProductDetails.06da998d.js +0 -1
  130. package/packages/storefront/dist/client/_astro/ProductShelf.3f4f38b5.js +0 -1
  131. package/packages/storefront/dist/client/_astro/ProductShelf.bf82838b.js +0 -1
  132. package/packages/storefront/dist/client/_astro/SearchModal.b6aa5ef7.js +0 -1
  133. package/packages/storefront/dist/client/_astro/ShopHeader.2d6e361a.js +0 -4
  134. package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.f75743ee.js +0 -1
  135. package/packages/storefront/dist/client/_astro/_slug_.e7cac999.css +0 -1
  136. package/packages/storefront/dist/client/_astro/client.41b42098.js +0 -1
  137. package/packages/storefront/dist/client/_astro/customer-session.5ab9ab1a.js +0 -1
  138. package/packages/storefront/dist/client/_astro/ecom-utils.5cbfb95e.js +0 -1
  139. package/packages/storefront/dist/client/_astro/index.8ac1db99.js +0 -1
  140. package/packages/storefront/dist/client/_astro/name.01410784.js +0 -1
  141. package/packages/storefront/dist/client/_astro/sf-utils.b04e1813.js +0 -1
  142. package/packages/storefront/dist/client/_astro/use-analytics.cc95e346.js +0 -1
  143. package/packages/storefront/dist/server/chunks/SearchModal_f66549d4.mjs +0 -147
  144. package/packages/storefront/dist/server/manifest_221d806b.mjs +0 -1069
  145. /package/packages/storefront/dist/client/_astro/{afetch.f4507208.js → afetch.5c8VmT0-.js} +0 -0
  146. /package/packages/storefront/dist/client/_astro/{img-sizes.41e0efe4.js → img-sizes.gxAI9JNh.js} +0 -0
  147. /package/packages/storefront/dist/client/_astro/{price.04ceb6c4.js → price.Easct8WC.js} +0 -0
@@ -1,4 +1,4 @@
1
- /**
1
+ var st={};/**
2
2
  * @license
3
3
  * Copyright 2017 Google LLC
4
4
  *
@@ -13,22 +13,7 @@
13
13
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
- *//**
17
- * @license
18
- * Copyright 2017 Google LLC
19
- *
20
- * Licensed under the Apache License, Version 2.0 (the "License");
21
- * you may not use this file except in compliance with the License.
22
- * You may obtain a copy of the License at
23
- *
24
- * http://www.apache.org/licenses/LICENSE-2.0
25
- *
26
- * Unless required by applicable law or agreed to in writing, software
27
- * distributed under the License is distributed on an "AS IS" BASIS,
28
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29
- * See the License for the specific language governing permissions and
30
- * limitations under the License.
31
- */const Ot=function(n){const e=[];let t=0;for(let r=0;r<n.length;r++){let i=n.charCodeAt(r);i<128?e[t++]=i:i<2048?(e[t++]=i>>6|192,e[t++]=i&63|128):(i&64512)===55296&&r+1<n.length&&(n.charCodeAt(r+1)&64512)===56320?(i=65536+((i&1023)<<10)+(n.charCodeAt(++r)&1023),e[t++]=i>>18|240,e[t++]=i>>12&63|128,e[t++]=i>>6&63|128,e[t++]=i&63|128):(e[t++]=i>>12|224,e[t++]=i>>6&63|128,e[t++]=i&63|128)}return e},bn=function(n){const e=[];let t=0,r=0;for(;t<n.length;){const i=n[t++];if(i<128)e[r++]=String.fromCharCode(i);else if(i>191&&i<224){const s=n[t++];e[r++]=String.fromCharCode((i&31)<<6|s&63)}else if(i>239&&i<365){const s=n[t++],o=n[t++],c=n[t++],a=((i&7)<<18|(s&63)<<12|(o&63)<<6|c&63)-65536;e[r++]=String.fromCharCode(55296+(a>>10)),e[r++]=String.fromCharCode(56320+(a&1023))}else{const s=n[t++],o=n[t++];e[r++]=String.fromCharCode((i&15)<<12|(s&63)<<6|o&63)}}return e.join("")},Nt={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(n,e){if(!Array.isArray(n))throw Error("encodeByteArray takes an array as a parameter");this.init_();const t=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let i=0;i<n.length;i+=3){const s=n[i],o=i+1<n.length,c=o?n[i+1]:0,a=i+2<n.length,l=a?n[i+2]:0,u=s>>2,f=(s&3)<<4|c>>4;let g=(c&15)<<2|l>>6,v=l&63;a||(v=64,o||(g=64)),r.push(t[u],t[f],t[g],t[v])}return r.join("")},encodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(n):this.encodeByteArray(Ot(n),e)},decodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(n):bn(this.decodeStringToByteArray(n,e))},decodeStringToByteArray(n,e){this.init_();const t=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let i=0;i<n.length;){const s=t[n.charAt(i++)],c=i<n.length?t[n.charAt(i)]:0;++i;const l=i<n.length?t[n.charAt(i)]:64;++i;const f=i<n.length?t[n.charAt(i)]:64;if(++i,s==null||c==null||l==null||f==null)throw new Tn;const g=s<<2|c>>4;if(r.push(g),l!==64){const v=c<<4&240|l>>2;if(r.push(v),f!==64){const H=l<<6&192|f;r.push(H)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let n=0;n<this.ENCODED_VALS.length;n++)this.byteToCharMap_[n]=this.ENCODED_VALS.charAt(n),this.charToByteMap_[this.byteToCharMap_[n]]=n,this.byteToCharMapWebSafe_[n]=this.ENCODED_VALS_WEBSAFE.charAt(n),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[n]]=n,n>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(n)]=n,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(n)]=n)}}};class Tn extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const Sn=function(n){const e=Ot(n);return Nt.encodeByteArray(e,!0)},Dt=function(n){return Sn(n).replace(/\./g,"")},Lt=function(n){try{return Nt.decodeString(n,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/**
16
+ */const Nt=function(n){const e=[];let t=0;for(let r=0;r<n.length;r++){let i=n.charCodeAt(r);i<128?e[t++]=i:i<2048?(e[t++]=i>>6|192,e[t++]=i&63|128):(i&64512)===55296&&r+1<n.length&&(n.charCodeAt(r+1)&64512)===56320?(i=65536+((i&1023)<<10)+(n.charCodeAt(++r)&1023),e[t++]=i>>18|240,e[t++]=i>>12&63|128,e[t++]=i>>6&63|128,e[t++]=i&63|128):(e[t++]=i>>12|224,e[t++]=i>>6&63|128,e[t++]=i&63|128)}return e},Tn=function(n){const e=[];let t=0,r=0;for(;t<n.length;){const i=n[t++];if(i<128)e[r++]=String.fromCharCode(i);else if(i>191&&i<224){const s=n[t++];e[r++]=String.fromCharCode((i&31)<<6|s&63)}else if(i>239&&i<365){const s=n[t++],o=n[t++],c=n[t++],a=((i&7)<<18|(s&63)<<12|(o&63)<<6|c&63)-65536;e[r++]=String.fromCharCode(55296+(a>>10)),e[r++]=String.fromCharCode(56320+(a&1023))}else{const s=n[t++],o=n[t++];e[r++]=String.fromCharCode((i&15)<<12|(s&63)<<6|o&63)}}return e.join("")},Dt={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(n,e){if(!Array.isArray(n))throw Error("encodeByteArray takes an array as a parameter");this.init_();const t=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let i=0;i<n.length;i+=3){const s=n[i],o=i+1<n.length,c=o?n[i+1]:0,a=i+2<n.length,l=a?n[i+2]:0,u=s>>2,f=(s&3)<<4|c>>4;let g=(c&15)<<2|l>>6,I=l&63;a||(I=64,o||(g=64)),r.push(t[u],t[f],t[g],t[I])}return r.join("")},encodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(n):this.encodeByteArray(Nt(n),e)},decodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(n):Tn(this.decodeStringToByteArray(n,e))},decodeStringToByteArray(n,e){this.init_();const t=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let i=0;i<n.length;){const s=t[n.charAt(i++)],c=i<n.length?t[n.charAt(i)]:0;++i;const l=i<n.length?t[n.charAt(i)]:64;++i;const f=i<n.length?t[n.charAt(i)]:64;if(++i,s==null||c==null||l==null||f==null)throw new Sn;const g=s<<2|c>>4;if(r.push(g),l!==64){const I=c<<4&240|l>>2;if(r.push(I),f!==64){const V=l<<6&192|f;r.push(V)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let n=0;n<this.ENCODED_VALS.length;n++)this.byteToCharMap_[n]=this.ENCODED_VALS.charAt(n),this.charToByteMap_[this.byteToCharMap_[n]]=n,this.byteToCharMapWebSafe_[n]=this.ENCODED_VALS_WEBSAFE.charAt(n),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[n]]=n,n>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(n)]=n,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(n)]=n)}}};class Sn extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const An=function(n){const e=Nt(n);return Dt.encodeByteArray(e,!0)},Lt=function(n){return An(n).replace(/\./g,"")},Mt=function(n){try{return Dt.decodeString(n,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/**
32
17
  * @license
33
18
  * Copyright 2022 Google LLC
34
19
  *
@@ -43,7 +28,7 @@
43
28
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
44
29
  * See the License for the specific language governing permissions and
45
30
  * limitations under the License.
46
- */function An(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/**
31
+ */function Cn(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/**
47
32
  * @license
48
33
  * Copyright 2022 Google LLC
49
34
  *
@@ -58,7 +43,7 @@
58
43
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
59
44
  * See the License for the specific language governing permissions and
60
45
  * limitations under the License.
61
- */const kn=()=>An().__FIREBASE_DEFAULTS__,Cn=()=>{if(typeof process>"u"||typeof process.env>"u")return;const n={}.__FIREBASE_DEFAULTS__;if(n)return JSON.parse(n)},Rn=()=>{if(typeof document>"u")return;let n;try{n=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=n&&Lt(n[1]);return e&&JSON.parse(e)},We=()=>{try{return kn()||Cn()||Rn()}catch(n){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`);return}},Pn=n=>{var e,t;return(t=(e=We())===null||e===void 0?void 0:e.emulatorHosts)===null||t===void 0?void 0:t[n]},Mt=()=>{var n;return(n=We())===null||n===void 0?void 0:n.config},Ut=n=>{var e;return(e=We())===null||e===void 0?void 0:e[`_${n}`]};/**
46
+ */const kn=()=>Cn().__FIREBASE_DEFAULTS__,Rn=()=>{if(typeof process>"u"||typeof st>"u")return;const n=st.__FIREBASE_DEFAULTS__;if(n)return JSON.parse(n)},Pn=()=>{if(typeof document>"u")return;let n;try{n=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=n&&Mt(n[1]);return e&&JSON.parse(e)},We=()=>{try{return kn()||Rn()||Pn()}catch(n){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`);return}},On=n=>{var e,t;return(t=(e=We())===null||e===void 0?void 0:e.emulatorHosts)===null||t===void 0?void 0:t[n]},Ut=()=>{var n;return(n=We())===null||n===void 0?void 0:n.config},Ft=n=>{var e;return(e=We())===null||e===void 0?void 0:e[`_${n}`]};/**
62
47
  * @license
63
48
  * Copyright 2017 Google LLC
64
49
  *
@@ -73,7 +58,7 @@
73
58
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
74
59
  * See the License for the specific language governing permissions and
75
60
  * limitations under the License.
76
- */class On{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,r)=>{t?this.reject(t):this.resolve(r),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(t):e(t,r))}}}/**
61
+ */class Nn{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,r)=>{t?this.reject(t):this.resolve(r),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(t):e(t,r))}}}/**
77
62
  * @license
78
63
  * Copyright 2017 Google LLC
79
64
  *
@@ -88,7 +73,7 @@
88
73
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
89
74
  * See the License for the specific language governing permissions and
90
75
  * limitations under the License.
91
- */function p(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function Nn(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(p())}function Dn(){const n=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof n=="object"&&n.id!==void 0}function Ln(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function Mn(){const n=p();return n.indexOf("MSIE ")>=0||n.indexOf("Trident/")>=0}function Un(){try{return typeof indexedDB=="object"}catch{return!1}}function xn(){return new Promise((n,e)=>{try{let t=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),t||self.indexedDB.deleteDatabase(r),n(!0)},i.onupgradeneeded=()=>{t=!1},i.onerror=()=>{var s;e(((s=i.error)===null||s===void 0?void 0:s.message)||"")}}catch(t){e(t)}})}/**
76
+ */function p(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function Dn(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(p())}function Ln(){const n=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof n=="object"&&n.id!==void 0}function Mn(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function Un(){const n=p();return n.indexOf("MSIE ")>=0||n.indexOf("Trident/")>=0}function Fn(){try{return typeof indexedDB=="object"}catch{return!1}}function Bn(){return new Promise((n,e)=>{try{let t=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),t||self.indexedDB.deleteDatabase(r),n(!0)},i.onupgradeneeded=()=>{t=!1},i.onerror=()=>{var s;e(((s=i.error)===null||s===void 0?void 0:s.message)||"")}}catch(t){e(t)}})}/**
92
77
  * @license
93
78
  * Copyright 2017 Google LLC
94
79
  *
@@ -103,7 +88,7 @@
103
88
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
104
89
  * See the License for the specific language governing permissions and
105
90
  * limitations under the License.
106
- */const Fn="FirebaseError";class N extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name=Fn,Object.setPrototypeOf(this,N.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,te.prototype.create)}}class te{constructor(e,t,r){this.service=e,this.serviceName=t,this.errors=r}create(e,...t){const r=t[0]||{},i=`${this.service}/${e}`,s=this.errors[e],o=s?Bn(s,r):"Error",c=`${this.serviceName}: ${o} (${i}).`;return new N(i,c,r)}}function Bn(n,e){return n.replace(Hn,(t,r)=>{const i=e[r];return i!=null?String(i):`<${r}?>`})}const Hn=/\{\$([^}]+)}/g;function Vn(n){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}function he(n,e){if(n===e)return!0;const t=Object.keys(n),r=Object.keys(e);for(const i of t){if(!r.includes(i))return!1;const s=n[i],o=e[i];if(st(s)&&st(o)){if(!he(s,o))return!1}else if(s!==o)return!1}for(const i of r)if(!t.includes(i))return!1;return!0}function st(n){return n!==null&&typeof n=="object"}/**
91
+ */const xn="FirebaseError";class N extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name=xn,Object.setPrototypeOf(this,N.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,te.prototype.create)}}class te{constructor(e,t,r){this.service=e,this.serviceName=t,this.errors=r}create(e,...t){const r=t[0]||{},i=`${this.service}/${e}`,s=this.errors[e],o=s?Vn(s,r):"Error",c=`${this.serviceName}: ${o} (${i}).`;return new N(i,c,r)}}function Vn(n,e){return n.replace(Hn,(t,r)=>{const i=e[r];return i!=null?String(i):`<${r}?>`})}const Hn=/\{\$([^}]+)}/g;function $n(n){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}function he(n,e){if(n===e)return!0;const t=Object.keys(n),r=Object.keys(e);for(const i of t){if(!r.includes(i))return!1;const s=n[i],o=e[i];if(ot(s)&&ot(o)){if(!he(s,o))return!1}else if(s!==o)return!1}for(const i of r)if(!t.includes(i))return!1;return!0}function ot(n){return n!==null&&typeof n=="object"}/**
107
92
  * @license
108
93
  * Copyright 2017 Google LLC
109
94
  *
@@ -118,7 +103,7 @@
118
103
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
119
104
  * See the License for the specific language governing permissions and
120
105
  * limitations under the License.
121
- */function ne(n){const e=[];for(const[t,r]of Object.entries(n))Array.isArray(r)?r.forEach(i=>{e.push(encodeURIComponent(t)+"="+encodeURIComponent(i))}):e.push(encodeURIComponent(t)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}function G(n){const e={};return n.replace(/^\?/,"").split("&").forEach(r=>{if(r){const[i,s]=r.split("=");e[decodeURIComponent(i)]=decodeURIComponent(s)}}),e}function K(n){const e=n.indexOf("?");if(!e)return"";const t=n.indexOf("#",e);return n.substring(e,t>0?t:void 0)}function $n(n,e){const t=new Wn(n,e);return t.subscribe.bind(t)}class Wn{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(r=>{this.error(r)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,r){let i;if(e===void 0&&t===void 0&&r===void 0)throw new Error("Missing Observer.");jn(e,["next","error","complete"])?i=e:i={next:e,error:t,complete:r},i.next===void 0&&(i.next=Re),i.error===void 0&&(i.error=Re),i.complete===void 0&&(i.complete=Re);const s=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch{}}),this.observers.push(i),s}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{t(this.observers[e])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function jn(n,e){if(typeof n!="object"||n===null)return!1;for(const t of e)if(t in n&&typeof n[t]=="function")return!0;return!1}function Re(){}/**
106
+ */function ne(n){const e=[];for(const[t,r]of Object.entries(n))Array.isArray(r)?r.forEach(i=>{e.push(encodeURIComponent(t)+"="+encodeURIComponent(i))}):e.push(encodeURIComponent(t)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}function G(n){const e={};return n.replace(/^\?/,"").split("&").forEach(r=>{if(r){const[i,s]=r.split("=");e[decodeURIComponent(i)]=decodeURIComponent(s)}}),e}function K(n){const e=n.indexOf("?");if(!e)return"";const t=n.indexOf("#",e);return n.substring(e,t>0?t:void 0)}function Wn(n,e){const t=new jn(n,e);return t.subscribe.bind(t)}class jn{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(r=>{this.error(r)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,r){let i;if(e===void 0&&t===void 0&&r===void 0)throw new Error("Missing Observer.");zn(e,["next","error","complete"])?i=e:i={next:e,error:t,complete:r},i.next===void 0&&(i.next=Re),i.error===void 0&&(i.error=Re),i.complete===void 0&&(i.complete=Re);const s=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch{}}),this.observers.push(i),s}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{t(this.observers[e])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function zn(n,e){if(typeof n!="object"||n===null)return!1;for(const t of e)if(t in n&&typeof n[t]=="function")return!0;return!1}function Re(){}/**
122
107
  * @license
123
108
  * Copyright 2021 Google LLC
124
109
  *
@@ -163,7 +148,7 @@
163
148
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
164
149
  * See the License for the specific language governing permissions and
165
150
  * limitations under the License.
166
- */class zn{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const r=new On;if(this.instancesDeferred.set(t,r),this.isInitialized(t)||this.shouldAutoInitialize())try{const i=this.getOrInitializeService({instanceIdentifier:t});i&&r.resolve(i)}catch{}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;const r=this.normalizeInstanceIdentifier(e?.identifier),i=(t=e?.optional)!==null&&t!==void 0?t:!1;if(this.isInitialized(r)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:r})}catch(s){if(i)return null;throw s}else{if(i)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(Kn(e))try{this.getOrInitializeService({instanceIdentifier:L})}catch{}for(const[t,r]of this.instancesDeferred.entries()){const i=this.normalizeInstanceIdentifier(t);try{const s=this.getOrInitializeService({instanceIdentifier:i});r.resolve(s)}catch{}}}}clearInstance(e=L){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(t=>"INTERNAL"in t).map(t=>t.INTERNAL.delete()),...e.filter(t=>"_delete"in t).map(t=>t._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=L){return this.instances.has(e)}getOptions(e=L){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const i=this.getOrInitializeService({instanceIdentifier:r,options:t});for(const[s,o]of this.instancesDeferred.entries()){const c=this.normalizeInstanceIdentifier(s);r===c&&o.resolve(i)}return i}onInit(e,t){var r;const i=this.normalizeInstanceIdentifier(t),s=(r=this.onInitCallbacks.get(i))!==null&&r!==void 0?r:new Set;s.add(e),this.onInitCallbacks.set(i,s);const o=this.instances.get(i);return o&&e(o,i),()=>{s.delete(e)}}invokeOnInitCallbacks(e,t){const r=this.onInitCallbacks.get(t);if(r)for(const i of r)try{i(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:Gn(e),options:t}),this.instances.set(e,r),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=L){return this.component?this.component.multipleInstances?e:L:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function Gn(n){return n===L?void 0:n}function Kn(n){return n.instantiationMode==="EAGER"}/**
151
+ */class Gn{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const r=new Nn;if(this.instancesDeferred.set(t,r),this.isInitialized(t)||this.shouldAutoInitialize())try{const i=this.getOrInitializeService({instanceIdentifier:t});i&&r.resolve(i)}catch{}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;const r=this.normalizeInstanceIdentifier(e?.identifier),i=(t=e?.optional)!==null&&t!==void 0?t:!1;if(this.isInitialized(r)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:r})}catch(s){if(i)return null;throw s}else{if(i)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(qn(e))try{this.getOrInitializeService({instanceIdentifier:L})}catch{}for(const[t,r]of this.instancesDeferred.entries()){const i=this.normalizeInstanceIdentifier(t);try{const s=this.getOrInitializeService({instanceIdentifier:i});r.resolve(s)}catch{}}}}clearInstance(e=L){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(t=>"INTERNAL"in t).map(t=>t.INTERNAL.delete()),...e.filter(t=>"_delete"in t).map(t=>t._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=L){return this.instances.has(e)}getOptions(e=L){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const i=this.getOrInitializeService({instanceIdentifier:r,options:t});for(const[s,o]of this.instancesDeferred.entries()){const c=this.normalizeInstanceIdentifier(s);r===c&&o.resolve(i)}return i}onInit(e,t){var r;const i=this.normalizeInstanceIdentifier(t),s=(r=this.onInitCallbacks.get(i))!==null&&r!==void 0?r:new Set;s.add(e),this.onInitCallbacks.set(i,s);const o=this.instances.get(i);return o&&e(o,i),()=>{s.delete(e)}}invokeOnInitCallbacks(e,t){const r=this.onInitCallbacks.get(t);if(r)for(const i of r)try{i(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:Kn(e),options:t}),this.instances.set(e,r),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=L){return this.component?this.component.multipleInstances?e:L:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function Kn(n){return n===L?void 0:n}function qn(n){return n.instantiationMode==="EAGER"}/**
167
152
  * @license
168
153
  * Copyright 2019 Google LLC
169
154
  *
@@ -178,7 +163,7 @@
178
163
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
179
164
  * See the License for the specific language governing permissions and
180
165
  * limitations under the License.
181
- */class qn{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new zn(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}/**
166
+ */class Jn{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new Gn(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}/**
182
167
  * @license
183
168
  * Copyright 2017 Google LLC
184
169
  *
@@ -193,7 +178,7 @@
193
178
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
194
179
  * See the License for the specific language governing permissions and
195
180
  * limitations under the License.
196
- */var h;(function(n){n[n.DEBUG=0]="DEBUG",n[n.VERBOSE=1]="VERBOSE",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.SILENT=5]="SILENT"})(h||(h={}));const Jn={debug:h.DEBUG,verbose:h.VERBOSE,info:h.INFO,warn:h.WARN,error:h.ERROR,silent:h.SILENT},Yn=h.INFO,Xn={[h.DEBUG]:"log",[h.VERBOSE]:"log",[h.INFO]:"info",[h.WARN]:"warn",[h.ERROR]:"error"},Qn=(n,e,...t)=>{if(e<n.logLevel)return;const r=new Date().toISOString(),i=Xn[e];if(i)console[i](`[${r}] ${n.name}:`,...t);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)};class xt{constructor(e){this.name=e,this._logLevel=Yn,this._logHandler=Qn,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in h))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?Jn[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,h.DEBUG,...e),this._logHandler(this,h.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,h.VERBOSE,...e),this._logHandler(this,h.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,h.INFO,...e),this._logHandler(this,h.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,h.WARN,...e),this._logHandler(this,h.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,h.ERROR,...e),this._logHandler(this,h.ERROR,...e)}}const Zn=(n,e)=>e.some(t=>n instanceof t);let ot,at;function er(){return ot||(ot=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function tr(){return at||(at=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Ft=new WeakMap,Ue=new WeakMap,Bt=new WeakMap,Pe=new WeakMap,je=new WeakMap;function nr(n){const e=new Promise((t,r)=>{const i=()=>{n.removeEventListener("success",s),n.removeEventListener("error",o)},s=()=>{t(P(n.result)),i()},o=()=>{r(n.error),i()};n.addEventListener("success",s),n.addEventListener("error",o)});return e.then(t=>{t instanceof IDBCursor&&Ft.set(t,n)}).catch(()=>{}),je.set(e,n),e}function rr(n){if(Ue.has(n))return;const e=new Promise((t,r)=>{const i=()=>{n.removeEventListener("complete",s),n.removeEventListener("error",o),n.removeEventListener("abort",o)},s=()=>{t(),i()},o=()=>{r(n.error||new DOMException("AbortError","AbortError")),i()};n.addEventListener("complete",s),n.addEventListener("error",o),n.addEventListener("abort",o)});Ue.set(n,e)}let xe={get(n,e,t){if(n instanceof IDBTransaction){if(e==="done")return Ue.get(n);if(e==="objectStoreNames")return n.objectStoreNames||Bt.get(n);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return P(n[e])},set(n,e,t){return n[e]=t,!0},has(n,e){return n instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in n}};function ir(n){xe=n(xe)}function sr(n){return n===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){const r=n.call(Oe(this),e,...t);return Bt.set(r,e.sort?e.sort():[e]),P(r)}:tr().includes(n)?function(...e){return n.apply(Oe(this),e),P(Ft.get(this))}:function(...e){return P(n.apply(Oe(this),e))}}function or(n){return typeof n=="function"?sr(n):(n instanceof IDBTransaction&&rr(n),Zn(n,er())?new Proxy(n,xe):n)}function P(n){if(n instanceof IDBRequest)return nr(n);if(Pe.has(n))return Pe.get(n);const e=or(n);return e!==n&&(Pe.set(n,e),je.set(e,n)),e}const Oe=n=>je.get(n);function ar(n,e,{blocked:t,upgrade:r,blocking:i,terminated:s}={}){const o=indexedDB.open(n,e),c=P(o);return r&&o.addEventListener("upgradeneeded",a=>{r(P(o.result),a.oldVersion,a.newVersion,P(o.transaction),a)}),t&&o.addEventListener("blocked",a=>t(a.oldVersion,a.newVersion,a)),c.then(a=>{s&&a.addEventListener("close",()=>s()),i&&a.addEventListener("versionchange",l=>i(l.oldVersion,l.newVersion,l))}).catch(()=>{}),c}const cr=["get","getKey","getAll","getAllKeys","count"],lr=["put","add","delete","clear"],Ne=new Map;function ct(n,e){if(!(n instanceof IDBDatabase&&!(e in n)&&typeof e=="string"))return;if(Ne.get(e))return Ne.get(e);const t=e.replace(/FromIndex$/,""),r=e!==t,i=lr.includes(t);if(!(t in(r?IDBIndex:IDBObjectStore).prototype)||!(i||cr.includes(t)))return;const s=async function(o,...c){const a=this.transaction(o,i?"readwrite":"readonly");let l=a.store;return r&&(l=l.index(c.shift())),(await Promise.all([l[t](...c),i&&a.done]))[0]};return Ne.set(e,s),s}ir(n=>({...n,get:(e,t,r)=>ct(e,t)||n.get(e,t,r),has:(e,t)=>!!ct(e,t)||n.has(e,t)}));/**
181
+ */var h;(function(n){n[n.DEBUG=0]="DEBUG",n[n.VERBOSE=1]="VERBOSE",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.SILENT=5]="SILENT"})(h||(h={}));const Yn={debug:h.DEBUG,verbose:h.VERBOSE,info:h.INFO,warn:h.WARN,error:h.ERROR,silent:h.SILENT},Xn=h.INFO,Qn={[h.DEBUG]:"log",[h.VERBOSE]:"log",[h.INFO]:"info",[h.WARN]:"warn",[h.ERROR]:"error"},Zn=(n,e,...t)=>{if(e<n.logLevel)return;const r=new Date().toISOString(),i=Qn[e];if(i)console[i](`[${r}] ${n.name}:`,...t);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)};class Bt{constructor(e){this.name=e,this._logLevel=Xn,this._logHandler=Zn,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in h))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?Yn[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,h.DEBUG,...e),this._logHandler(this,h.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,h.VERBOSE,...e),this._logHandler(this,h.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,h.INFO,...e),this._logHandler(this,h.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,h.WARN,...e),this._logHandler(this,h.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,h.ERROR,...e),this._logHandler(this,h.ERROR,...e)}}const er=(n,e)=>e.some(t=>n instanceof t);let at,ct;function tr(){return at||(at=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function nr(){return ct||(ct=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const xt=new WeakMap,Ue=new WeakMap,Vt=new WeakMap,Pe=new WeakMap,je=new WeakMap;function rr(n){const e=new Promise((t,r)=>{const i=()=>{n.removeEventListener("success",s),n.removeEventListener("error",o)},s=()=>{t(P(n.result)),i()},o=()=>{r(n.error),i()};n.addEventListener("success",s),n.addEventListener("error",o)});return e.then(t=>{t instanceof IDBCursor&&xt.set(t,n)}).catch(()=>{}),je.set(e,n),e}function ir(n){if(Ue.has(n))return;const e=new Promise((t,r)=>{const i=()=>{n.removeEventListener("complete",s),n.removeEventListener("error",o),n.removeEventListener("abort",o)},s=()=>{t(),i()},o=()=>{r(n.error||new DOMException("AbortError","AbortError")),i()};n.addEventListener("complete",s),n.addEventListener("error",o),n.addEventListener("abort",o)});Ue.set(n,e)}let Fe={get(n,e,t){if(n instanceof IDBTransaction){if(e==="done")return Ue.get(n);if(e==="objectStoreNames")return n.objectStoreNames||Vt.get(n);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return P(n[e])},set(n,e,t){return n[e]=t,!0},has(n,e){return n instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in n}};function sr(n){Fe=n(Fe)}function or(n){return n===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){const r=n.call(Oe(this),e,...t);return Vt.set(r,e.sort?e.sort():[e]),P(r)}:nr().includes(n)?function(...e){return n.apply(Oe(this),e),P(xt.get(this))}:function(...e){return P(n.apply(Oe(this),e))}}function ar(n){return typeof n=="function"?or(n):(n instanceof IDBTransaction&&ir(n),er(n,tr())?new Proxy(n,Fe):n)}function P(n){if(n instanceof IDBRequest)return rr(n);if(Pe.has(n))return Pe.get(n);const e=ar(n);return e!==n&&(Pe.set(n,e),je.set(e,n)),e}const Oe=n=>je.get(n);function cr(n,e,{blocked:t,upgrade:r,blocking:i,terminated:s}={}){const o=indexedDB.open(n,e),c=P(o);return r&&o.addEventListener("upgradeneeded",a=>{r(P(o.result),a.oldVersion,a.newVersion,P(o.transaction),a)}),t&&o.addEventListener("blocked",a=>t(a.oldVersion,a.newVersion,a)),c.then(a=>{s&&a.addEventListener("close",()=>s()),i&&a.addEventListener("versionchange",l=>i(l.oldVersion,l.newVersion,l))}).catch(()=>{}),c}const lr=["get","getKey","getAll","getAllKeys","count"],dr=["put","add","delete","clear"],Ne=new Map;function lt(n,e){if(!(n instanceof IDBDatabase&&!(e in n)&&typeof e=="string"))return;if(Ne.get(e))return Ne.get(e);const t=e.replace(/FromIndex$/,""),r=e!==t,i=dr.includes(t);if(!(t in(r?IDBIndex:IDBObjectStore).prototype)||!(i||lr.includes(t)))return;const s=async function(o,...c){const a=this.transaction(o,i?"readwrite":"readonly");let l=a.store;return r&&(l=l.index(c.shift())),(await Promise.all([l[t](...c),i&&a.done]))[0]};return Ne.set(e,s),s}sr(n=>({...n,get:(e,t,r)=>lt(e,t)||n.get(e,t,r),has:(e,t)=>!!lt(e,t)||n.has(e,t)}));/**
197
182
  * @license
198
183
  * Copyright 2019 Google LLC
199
184
  *
@@ -208,7 +193,7 @@
208
193
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
209
194
  * See the License for the specific language governing permissions and
210
195
  * limitations under the License.
211
- */class dr{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(ur(t)){const r=t.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(t=>t).join(" ")}}function ur(n){const e=n.getComponent();return e?.type==="VERSION"}const Fe="@firebase/app",lt="0.9.23";/**
196
+ */class ur{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(hr(t)){const r=t.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(t=>t).join(" ")}}function hr(n){const e=n.getComponent();return e?.type==="VERSION"}const Be="@firebase/app",dt="0.9.25";/**
212
197
  * @license
213
198
  * Copyright 2019 Google LLC
214
199
  *
@@ -223,7 +208,7 @@
223
208
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
224
209
  * See the License for the specific language governing permissions and
225
210
  * limitations under the License.
226
- */const U=new xt("@firebase/app"),hr="@firebase/app-compat",fr="@firebase/analytics-compat",pr="@firebase/analytics",gr="@firebase/app-check-compat",mr="@firebase/app-check",_r="@firebase/auth",Ir="@firebase/auth-compat",vr="@firebase/database",yr="@firebase/database-compat",Er="@firebase/functions",wr="@firebase/functions-compat",br="@firebase/installations",Tr="@firebase/installations-compat",Sr="@firebase/messaging",Ar="@firebase/messaging-compat",kr="@firebase/performance",Cr="@firebase/performance-compat",Rr="@firebase/remote-config",Pr="@firebase/remote-config-compat",Or="@firebase/storage",Nr="@firebase/storage-compat",Dr="@firebase/firestore",Lr="@firebase/firestore-compat",Mr="firebase",Ur="10.6.0";/**
211
+ */const U=new Bt("@firebase/app"),fr="@firebase/app-compat",pr="@firebase/analytics-compat",gr="@firebase/analytics",mr="@firebase/app-check-compat",_r="@firebase/app-check",vr="@firebase/auth",Ir="@firebase/auth-compat",yr="@firebase/database",Er="@firebase/database-compat",wr="@firebase/functions",br="@firebase/functions-compat",Tr="@firebase/installations",Sr="@firebase/installations-compat",Ar="@firebase/messaging",Cr="@firebase/messaging-compat",kr="@firebase/performance",Rr="@firebase/performance-compat",Pr="@firebase/remote-config",Or="@firebase/remote-config-compat",Nr="@firebase/storage",Dr="@firebase/storage-compat",Lr="@firebase/firestore",Mr="@firebase/firestore-compat",Ur="firebase",Fr="10.7.1";/**
227
212
  * @license
228
213
  * Copyright 2019 Google LLC
229
214
  *
@@ -238,7 +223,7 @@
238
223
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
239
224
  * See the License for the specific language governing permissions and
240
225
  * limitations under the License.
241
- */const Be="[DEFAULT]",xr={[Fe]:"fire-core",[hr]:"fire-core-compat",[pr]:"fire-analytics",[fr]:"fire-analytics-compat",[mr]:"fire-app-check",[gr]:"fire-app-check-compat",[_r]:"fire-auth",[Ir]:"fire-auth-compat",[vr]:"fire-rtdb",[yr]:"fire-rtdb-compat",[Er]:"fire-fn",[wr]:"fire-fn-compat",[br]:"fire-iid",[Tr]:"fire-iid-compat",[Sr]:"fire-fcm",[Ar]:"fire-fcm-compat",[kr]:"fire-perf",[Cr]:"fire-perf-compat",[Rr]:"fire-rc",[Pr]:"fire-rc-compat",[Or]:"fire-gcs",[Nr]:"fire-gcs-compat",[Dr]:"fire-fst",[Lr]:"fire-fst-compat","fire-js":"fire-js",[Mr]:"fire-js-all"};/**
226
+ */const xe="[DEFAULT]",Br={[Be]:"fire-core",[fr]:"fire-core-compat",[gr]:"fire-analytics",[pr]:"fire-analytics-compat",[_r]:"fire-app-check",[mr]:"fire-app-check-compat",[vr]:"fire-auth",[Ir]:"fire-auth-compat",[yr]:"fire-rtdb",[Er]:"fire-rtdb-compat",[wr]:"fire-fn",[br]:"fire-fn-compat",[Tr]:"fire-iid",[Sr]:"fire-iid-compat",[Ar]:"fire-fcm",[Cr]:"fire-fcm-compat",[kr]:"fire-perf",[Rr]:"fire-perf-compat",[Pr]:"fire-rc",[Or]:"fire-rc-compat",[Nr]:"fire-gcs",[Dr]:"fire-gcs-compat",[Lr]:"fire-fst",[Mr]:"fire-fst-compat","fire-js":"fire-js",[Ur]:"fire-js-all"};/**
242
227
  * @license
243
228
  * Copyright 2019 Google LLC
244
229
  *
@@ -253,7 +238,7 @@
253
238
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
254
239
  * See the License for the specific language governing permissions and
255
240
  * limitations under the License.
256
- */const fe=new Map,He=new Map;function Fr(n,e){try{n.container.addComponent(e)}catch(t){U.debug(`Component ${e.name} failed to register with FirebaseApp ${n.name}`,t)}}function Y(n){const e=n.name;if(He.has(e))return U.debug(`There were multiple attempts to register component ${e}.`),!1;He.set(e,n);for(const t of fe.values())Fr(t,n);return!0}function Ht(n,e){const t=n.container.getProvider("heartbeat").getImmediate({optional:!0});return t&&t.triggerHeartbeat(),n.container.getProvider(e)}/**
241
+ */const fe=new Map,Ve=new Map;function xr(n,e){try{n.container.addComponent(e)}catch(t){U.debug(`Component ${e.name} failed to register with FirebaseApp ${n.name}`,t)}}function Y(n){const e=n.name;if(Ve.has(e))return U.debug(`There were multiple attempts to register component ${e}.`),!1;Ve.set(e,n);for(const t of fe.values())xr(t,n);return!0}function Ht(n,e){const t=n.container.getProvider("heartbeat").getImmediate({optional:!0});return t&&t.triggerHeartbeat(),n.container.getProvider(e)}/**
257
242
  * @license
258
243
  * Copyright 2019 Google LLC
259
244
  *
@@ -268,7 +253,7 @@
268
253
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
269
254
  * See the License for the specific language governing permissions and
270
255
  * limitations under the License.
271
- */const Br={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}."},O=new te("app","Firebase",Br);/**
256
+ */const Vr={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}."},O=new te("app","Firebase",Vr);/**
272
257
  * @license
273
258
  * Copyright 2019 Google LLC
274
259
  *
@@ -298,7 +283,7 @@
298
283
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
299
284
  * See the License for the specific language governing permissions and
300
285
  * limitations under the License.
301
- */const re=Ur;function Vr(n,e={}){let t=n;typeof e!="object"&&(e={name:e});const r=Object.assign({name:Be,automaticDataCollectionEnabled:!1},e),i=r.name;if(typeof i!="string"||!i)throw O.create("bad-app-name",{appName:String(i)});if(t||(t=Mt()),!t)throw O.create("no-options");const s=fe.get(i);if(s){if(he(t,s.options)&&he(r,s.config))return s;throw O.create("duplicate-app",{appName:i})}const o=new qn(i);for(const a of He.values())o.addComponent(a);const c=new Hr(t,r,o);return fe.set(i,c),c}function $r(n=Be){const e=fe.get(n);if(!e&&n===Be&&Mt())return Vr();if(!e)throw O.create("no-app",{appName:n});return e}function q(n,e,t){var r;let i=(r=xr[n])!==null&&r!==void 0?r:n;t&&(i+=`-${t}`);const s=i.match(/\s|\//),o=e.match(/\s|\//);if(s||o){const c=[`Unable to register library "${i}" with version "${e}":`];s&&c.push(`library name "${i}" contains illegal characters (whitespace or "/")`),s&&o&&c.push("and"),o&&c.push(`version name "${e}" contains illegal characters (whitespace or "/")`),U.warn(c.join(" "));return}Y(new j(`${i}-version`,()=>({library:i,version:e}),"VERSION"))}/**
286
+ */const re=Fr;function $r(n,e={}){let t=n;typeof e!="object"&&(e={name:e});const r=Object.assign({name:xe,automaticDataCollectionEnabled:!1},e),i=r.name;if(typeof i!="string"||!i)throw O.create("bad-app-name",{appName:String(i)});if(t||(t=Ut()),!t)throw O.create("no-options");const s=fe.get(i);if(s){if(he(t,s.options)&&he(r,s.config))return s;throw O.create("duplicate-app",{appName:i})}const o=new Jn(i);for(const a of Ve.values())o.addComponent(a);const c=new Hr(t,r,o);return fe.set(i,c),c}function Wr(n=xe){const e=fe.get(n);if(!e&&n===xe&&Ut())return $r();if(!e)throw O.create("no-app",{appName:n});return e}function q(n,e,t){var r;let i=(r=Br[n])!==null&&r!==void 0?r:n;t&&(i+=`-${t}`);const s=i.match(/\s|\//),o=e.match(/\s|\//);if(s||o){const c=[`Unable to register library "${i}" with version "${e}":`];s&&c.push(`library name "${i}" contains illegal characters (whitespace or "/")`),s&&o&&c.push("and"),o&&c.push(`version name "${e}" contains illegal characters (whitespace or "/")`),U.warn(c.join(" "));return}Y(new j(`${i}-version`,()=>({library:i,version:e}),"VERSION"))}/**
302
287
  * @license
303
288
  * Copyright 2021 Google LLC
304
289
  *
@@ -313,7 +298,7 @@
313
298
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
314
299
  * See the License for the specific language governing permissions and
315
300
  * limitations under the License.
316
- */const Wr="firebase-heartbeat-database",jr=1,X="firebase-heartbeat-store";let De=null;function Vt(){return De||(De=ar(Wr,jr,{upgrade:(n,e)=>{switch(e){case 0:n.createObjectStore(X)}}}).catch(n=>{throw O.create("idb-open",{originalErrorMessage:n.message})})),De}async function zr(n){try{return await(await Vt()).transaction(X).objectStore(X).get($t(n))}catch(e){if(e instanceof N)U.warn(e.message);else{const t=O.create("idb-get",{originalErrorMessage:e?.message});U.warn(t.message)}}}async function dt(n,e){try{const r=(await Vt()).transaction(X,"readwrite");await r.objectStore(X).put(e,$t(n)),await r.done}catch(t){if(t instanceof N)U.warn(t.message);else{const r=O.create("idb-set",{originalErrorMessage:t?.message});U.warn(r.message)}}}function $t(n){return`${n.name}!${n.options.appId}`}/**
301
+ */const jr="firebase-heartbeat-database",zr=1,X="firebase-heartbeat-store";let De=null;function $t(){return De||(De=cr(jr,zr,{upgrade:(n,e)=>{switch(e){case 0:n.createObjectStore(X)}}}).catch(n=>{throw O.create("idb-open",{originalErrorMessage:n.message})})),De}async function Gr(n){try{return await(await $t()).transaction(X).objectStore(X).get(Wt(n))}catch(e){if(e instanceof N)U.warn(e.message);else{const t=O.create("idb-get",{originalErrorMessage:e?.message});U.warn(t.message)}}}async function ut(n,e){try{const r=(await $t()).transaction(X,"readwrite");await r.objectStore(X).put(e,Wt(n)),await r.done}catch(t){if(t instanceof N)U.warn(t.message);else{const r=O.create("idb-set",{originalErrorMessage:t?.message});U.warn(r.message)}}}function Wt(n){return`${n.name}!${n.options.appId}`}/**
317
302
  * @license
318
303
  * Copyright 2021 Google LLC
319
304
  *
@@ -328,7 +313,7 @@
328
313
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
329
314
  * See the License for the specific language governing permissions and
330
315
  * limitations under the License.
331
- */const Gr=1024,Kr=30*24*60*60*1e3;class qr{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new Yr(t),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){var e;const r=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),i=ut();if(((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise),!(this._heartbeatsCache.lastSentHeartbeatDate===i||this._heartbeatsCache.heartbeats.some(s=>s.date===i)))return this._heartbeatsCache.heartbeats.push({date:i,agent:r}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(s=>{const o=new Date(s.date).valueOf();return Date.now()-o<=Kr}),this._storage.overwrite(this._heartbeatsCache)}async getHeartbeatsHeader(){var e;if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const t=ut(),{heartbeatsToSend:r,unsentEntries:i}=Jr(this._heartbeatsCache.heartbeats),s=Dt(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=t,i.length>0?(this._heartbeatsCache.heartbeats=i,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),s}}function ut(){return new Date().toISOString().substring(0,10)}function Jr(n,e=Gr){const t=[];let r=n.slice();for(const i of n){const s=t.find(o=>o.agent===i.agent);if(s){if(s.dates.push(i.date),ht(t)>e){s.dates.pop();break}}else if(t.push({agent:i.agent,dates:[i.date]}),ht(t)>e){t.pop();break}r=r.slice(1)}return{heartbeatsToSend:t,unsentEntries:r}}class Yr{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return Un()?xn().then(()=>!0).catch(()=>!1):!1}async read(){return await this._canUseIndexedDBPromise?await zr(this.app)||{heartbeats:[]}:{heartbeats:[]}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){const i=await this.read();return dt(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:i.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){var t;if(await this._canUseIndexedDBPromise){const i=await this.read();return dt(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:i.lastSentHeartbeatDate,heartbeats:[...i.heartbeats,...e.heartbeats]})}else return}}function ht(n){return Dt(JSON.stringify({version:2,heartbeats:n})).length}/**
316
+ */const Kr=1024,qr=30*24*60*60*1e3;class Jr{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new Xr(t),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){var e,t;const i=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),s=ht();if(!(((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((t=this._heartbeatsCache)===null||t===void 0?void 0:t.heartbeats)==null))&&!(this._heartbeatsCache.lastSentHeartbeatDate===s||this._heartbeatsCache.heartbeats.some(o=>o.date===s)))return this._heartbeatsCache.heartbeats.push({date:s,agent:i}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(o=>{const c=new Date(o.date).valueOf();return Date.now()-c<=qr}),this._storage.overwrite(this._heartbeatsCache)}async getHeartbeatsHeader(){var e;if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const t=ht(),{heartbeatsToSend:r,unsentEntries:i}=Yr(this._heartbeatsCache.heartbeats),s=Lt(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=t,i.length>0?(this._heartbeatsCache.heartbeats=i,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),s}}function ht(){return new Date().toISOString().substring(0,10)}function Yr(n,e=Kr){const t=[];let r=n.slice();for(const i of n){const s=t.find(o=>o.agent===i.agent);if(s){if(s.dates.push(i.date),ft(t)>e){s.dates.pop();break}}else if(t.push({agent:i.agent,dates:[i.date]}),ft(t)>e){t.pop();break}r=r.slice(1)}return{heartbeatsToSend:t,unsentEntries:r}}class Xr{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return Fn()?Bn().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const t=await Gr(this.app);return t?.heartbeats?t:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){const i=await this.read();return ut(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:i.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){var t;if(await this._canUseIndexedDBPromise){const i=await this.read();return ut(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:i.lastSentHeartbeatDate,heartbeats:[...i.heartbeats,...e.heartbeats]})}else return}}function ft(n){return Lt(JSON.stringify({version:2,heartbeats:n})).length}/**
332
317
  * @license
333
318
  * Copyright 2019 Google LLC
334
319
  *
@@ -343,7 +328,7 @@
343
328
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
344
329
  * See the License for the specific language governing permissions and
345
330
  * limitations under the License.
346
- */function Xr(n){Y(new j("platform-logger",e=>new dr(e),"PRIVATE")),Y(new j("heartbeat",e=>new qr(e),"PRIVATE")),q(Fe,lt,n),q(Fe,lt,"esm2017"),q("fire-js","")}Xr("");function ze(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t}function Wt(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const Qr=Wt,jt=new te("auth","Firebase",Wt());/**
331
+ */function Qr(n){Y(new j("platform-logger",e=>new ur(e),"PRIVATE")),Y(new j("heartbeat",e=>new Jr(e),"PRIVATE")),q(Be,dt,n),q(Be,dt,"esm2017"),q("fire-js","")}Qr("");function ze(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t}function jt(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const Zr=jt,zt=new te("auth","Firebase",jt());/**
347
332
  * @license
348
333
  * Copyright 2020 Google LLC
349
334
  *
@@ -358,7 +343,7 @@
358
343
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
359
344
  * See the License for the specific language governing permissions and
360
345
  * limitations under the License.
361
- */const pe=new xt("@firebase/auth");function Zr(n,...e){pe.logLevel<=h.WARN&&pe.warn(`Auth (${re}): ${n}`,...e)}function ce(n,...e){pe.logLevel<=h.ERROR&&pe.error(`Auth (${re}): ${n}`,...e)}/**
346
+ */const pe=new Bt("@firebase/auth");function ei(n,...e){pe.logLevel<=h.WARN&&pe.warn(`Auth (${re}): ${n}`,...e)}function ce(n,...e){pe.logLevel<=h.ERROR&&pe.error(`Auth (${re}): ${n}`,...e)}/**
362
347
  * @license
363
348
  * Copyright 2020 Google LLC
364
349
  *
@@ -373,7 +358,7 @@
373
358
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
374
359
  * See the License for the specific language governing permissions and
375
360
  * limitations under the License.
376
- */function m(n,...e){throw Ge(n,...e)}function _(n,...e){return Ge(n,...e)}function ei(n,e,t){const r=Object.assign(Object.assign({},Qr()),{[e]:t});return new te("auth","Firebase",r).create(e,{appName:n.name})}function Ge(n,...e){if(typeof n!="string"){const t=e[0],r=[...e.slice(1)];return r[0]&&(r[0].appName=n.name),n._errorFactory.create(t,...r)}return jt.create(n,...e)}function d(n,e,...t){if(!n)throw Ge(e,...t)}function y(n){const e="INTERNAL ASSERTION FAILED: "+n;throw ce(e),new Error(e)}function w(n,e){n||y(e)}/**
361
+ */function m(n,...e){throw Ge(n,...e)}function _(n,...e){return Ge(n,...e)}function ti(n,e,t){const r=Object.assign(Object.assign({},Zr()),{[e]:t});return new te("auth","Firebase",r).create(e,{appName:n.name})}function Ge(n,...e){if(typeof n!="string"){const t=e[0],r=[...e.slice(1)];return r[0]&&(r[0].appName=n.name),n._errorFactory.create(t,...r)}return zt.create(n,...e)}function d(n,e,...t){if(!n)throw Ge(e,...t)}function y(n){const e="INTERNAL ASSERTION FAILED: "+n;throw ce(e),new Error(e)}function w(n,e){n||y(e)}/**
377
362
  * @license
378
363
  * Copyright 2020 Google LLC
379
364
  *
@@ -388,7 +373,7 @@
388
373
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
389
374
  * See the License for the specific language governing permissions and
390
375
  * limitations under the License.
391
- */function ge(){var n;return typeof self<"u"&&((n=self.location)===null||n===void 0?void 0:n.href)||""}function ti(){return ft()==="http:"||ft()==="https:"}function ft(){var n;return typeof self<"u"&&((n=self.location)===null||n===void 0?void 0:n.protocol)||null}/**
376
+ */function ge(){var n;return typeof self<"u"&&((n=self.location)===null||n===void 0?void 0:n.href)||""}function ni(){return pt()==="http:"||pt()==="https:"}function pt(){var n;return typeof self<"u"&&((n=self.location)===null||n===void 0?void 0:n.protocol)||null}/**
392
377
  * @license
393
378
  * Copyright 2020 Google LLC
394
379
  *
@@ -403,7 +388,7 @@
403
388
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
404
389
  * See the License for the specific language governing permissions and
405
390
  * limitations under the License.
406
- */function ni(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(ti()||Dn()||"connection"in navigator)?navigator.onLine:!0}function ri(){if(typeof navigator>"u")return null;const n=navigator;return n.languages&&n.languages[0]||n.language||null}/**
391
+ */function ri(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(ni()||Ln()||"connection"in navigator)?navigator.onLine:!0}function ii(){if(typeof navigator>"u")return null;const n=navigator;return n.languages&&n.languages[0]||n.language||null}/**
407
392
  * @license
408
393
  * Copyright 2020 Google LLC
409
394
  *
@@ -418,7 +403,7 @@
418
403
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
419
404
  * See the License for the specific language governing permissions and
420
405
  * limitations under the License.
421
- */class ie{constructor(e,t){this.shortDelay=e,this.longDelay=t,w(t>e,"Short delay should be less than long delay!"),this.isMobile=Nn()||Ln()}get(){return ni()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
406
+ */class ie{constructor(e,t){this.shortDelay=e,this.longDelay=t,w(t>e,"Short delay should be less than long delay!"),this.isMobile=Dn()||Mn()}get(){return ri()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
422
407
  * @license
423
408
  * Copyright 2020 Google LLC
424
409
  *
@@ -448,7 +433,7 @@
448
433
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
449
434
  * See the License for the specific language governing permissions and
450
435
  * limitations under the License.
451
- */class zt{static initialize(e,t,r){this.fetchImpl=e,t&&(this.headersImpl=t),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;y("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;y("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;y("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/**
436
+ */class Gt{static initialize(e,t,r){this.fetchImpl=e,t&&(this.headersImpl=t),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;y("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;y("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;y("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/**
452
437
  * @license
453
438
  * Copyright 2020 Google LLC
454
439
  *
@@ -463,7 +448,7 @@
463
448
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
464
449
  * See the License for the specific language governing permissions and
465
450
  * limitations under the License.
466
- */const ii={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};/**
451
+ */const si={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};/**
467
452
  * @license
468
453
  * Copyright 2020 Google LLC
469
454
  *
@@ -478,7 +463,7 @@
478
463
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
479
464
  * See the License for the specific language governing permissions and
480
465
  * limitations under the License.
481
- */const si=new ie(3e4,6e4);function D(n,e){return n.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:n.tenantId}):e}async function T(n,e,t,r,i={}){return Gt(n,i,async()=>{let s={},o={};r&&(e==="GET"?o=r:s={body:JSON.stringify(r)});const c=ne(Object.assign({key:n.config.apiKey},o)).slice(1),a=await n._getAdditionalHeaders();return a["Content-Type"]="application/json",n.languageCode&&(a["X-Firebase-Locale"]=n.languageCode),zt.fetch()(Kt(n,n.config.apiHost,t,c),Object.assign({method:e,headers:a,referrerPolicy:"no-referrer"},s))})}async function Gt(n,e,t){n._canInitEmulator=!1;const r=Object.assign(Object.assign({},ii),e);try{const i=new ai(n),s=await Promise.race([t(),i.promise]);i.clearNetworkTimeout();const o=await s.json();if("needConfirmation"in o)throw ae(n,"account-exists-with-different-credential",o);if(s.ok&&!("errorMessage"in o))return o;{const c=s.ok?o.errorMessage:o.error.message,[a,l]=c.split(" : ");if(a==="FEDERATED_USER_ID_ALREADY_LINKED")throw ae(n,"credential-already-in-use",o);if(a==="EMAIL_EXISTS")throw ae(n,"email-already-in-use",o);if(a==="USER_DISABLED")throw ae(n,"user-disabled",o);const u=r[a]||a.toLowerCase().replace(/[_\s]+/g,"-");if(l)throw ei(n,u,l);m(n,u)}}catch(i){if(i instanceof N)throw i;m(n,"network-request-failed",{message:String(i)})}}async function ye(n,e,t,r,i={}){const s=await T(n,e,t,r,i);return"mfaPendingCredential"in s&&m(n,"multi-factor-auth-required",{_serverResponse:s}),s}function Kt(n,e,t,r){const i=`${e}${t}?${r}`;return n.config.emulator?Ke(n.config,i):`${n.config.apiScheme}://${i}`}function oi(n){switch(n){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class ai{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((t,r)=>{this.timer=setTimeout(()=>r(_(this.auth,"network-request-failed")),si.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function ae(n,e,t){const r={appName:n.name};t.email&&(r.email=t.email),t.phoneNumber&&(r.phoneNumber=t.phoneNumber);const i=_(n,e,r);return i.customData._tokenResponse=t,i}function pt(n){return n!==void 0&&n.enterprise!==void 0}class ci{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],e.recaptchaKey===void 0)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||this.recaptchaEnforcementState.length===0)return null;for(const t of this.recaptchaEnforcementState)if(t.provider&&t.provider===e)return oi(t.enforcementState);return null}isProviderEnabled(e){return this.getProviderEnforcementState(e)==="ENFORCE"||this.getProviderEnforcementState(e)==="AUDIT"}}async function li(n,e){return T(n,"GET","/v2/recaptchaConfig",D(n,e))}/**
466
+ */const oi=new ie(3e4,6e4);function D(n,e){return n.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:n.tenantId}):e}async function T(n,e,t,r,i={}){return Kt(n,i,async()=>{let s={},o={};r&&(e==="GET"?o=r:s={body:JSON.stringify(r)});const c=ne(Object.assign({key:n.config.apiKey},o)).slice(1),a=await n._getAdditionalHeaders();return a["Content-Type"]="application/json",n.languageCode&&(a["X-Firebase-Locale"]=n.languageCode),Gt.fetch()(qt(n,n.config.apiHost,t,c),Object.assign({method:e,headers:a,referrerPolicy:"no-referrer"},s))})}async function Kt(n,e,t){n._canInitEmulator=!1;const r=Object.assign(Object.assign({},si),e);try{const i=new ci(n),s=await Promise.race([t(),i.promise]);i.clearNetworkTimeout();const o=await s.json();if("needConfirmation"in o)throw ae(n,"account-exists-with-different-credential",o);if(s.ok&&!("errorMessage"in o))return o;{const c=s.ok?o.errorMessage:o.error.message,[a,l]=c.split(" : ");if(a==="FEDERATED_USER_ID_ALREADY_LINKED")throw ae(n,"credential-already-in-use",o);if(a==="EMAIL_EXISTS")throw ae(n,"email-already-in-use",o);if(a==="USER_DISABLED")throw ae(n,"user-disabled",o);const u=r[a]||a.toLowerCase().replace(/[_\s]+/g,"-");if(l)throw ti(n,u,l);m(n,u)}}catch(i){if(i instanceof N)throw i;m(n,"network-request-failed",{message:String(i)})}}async function ye(n,e,t,r,i={}){const s=await T(n,e,t,r,i);return"mfaPendingCredential"in s&&m(n,"multi-factor-auth-required",{_serverResponse:s}),s}function qt(n,e,t,r){const i=`${e}${t}?${r}`;return n.config.emulator?Ke(n.config,i):`${n.config.apiScheme}://${i}`}function ai(n){switch(n){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class ci{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((t,r)=>{this.timer=setTimeout(()=>r(_(this.auth,"network-request-failed")),oi.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function ae(n,e,t){const r={appName:n.name};t.email&&(r.email=t.email),t.phoneNumber&&(r.phoneNumber=t.phoneNumber);const i=_(n,e,r);return i.customData._tokenResponse=t,i}function gt(n){return n!==void 0&&n.enterprise!==void 0}class li{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],e.recaptchaKey===void 0)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||this.recaptchaEnforcementState.length===0)return null;for(const t of this.recaptchaEnforcementState)if(t.provider&&t.provider===e)return ai(t.enforcementState);return null}isProviderEnabled(e){return this.getProviderEnforcementState(e)==="ENFORCE"||this.getProviderEnforcementState(e)==="AUDIT"}}async function di(n,e){return T(n,"GET","/v2/recaptchaConfig",D(n,e))}/**
482
467
  * @license
483
468
  * Copyright 2020 Google LLC
484
469
  *
@@ -493,7 +478,7 @@
493
478
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
494
479
  * See the License for the specific language governing permissions and
495
480
  * limitations under the License.
496
- */async function di(n,e){return T(n,"POST","/v1/accounts:delete",e)}async function ui(n,e){return T(n,"POST","/v1/accounts:lookup",e)}/**
481
+ */async function ui(n,e){return T(n,"POST","/v1/accounts:delete",e)}async function hi(n,e){return T(n,"POST","/v1/accounts:lookup",e)}/**
497
482
  * @license
498
483
  * Copyright 2020 Google LLC
499
484
  *
@@ -508,7 +493,7 @@
508
493
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
509
494
  * See the License for the specific language governing permissions and
510
495
  * limitations under the License.
511
- */function J(n){if(n)try{const e=new Date(Number(n));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function hi(n,e=!1){const t=b(n),r=await t.getIdToken(e),i=qe(r);d(i&&i.exp&&i.auth_time&&i.iat,t.auth,"internal-error");const s=typeof i.firebase=="object"?i.firebase:void 0,o=s?.sign_in_provider;return{claims:i,token:r,authTime:J(Le(i.auth_time)),issuedAtTime:J(Le(i.iat)),expirationTime:J(Le(i.exp)),signInProvider:o||null,signInSecondFactor:s?.sign_in_second_factor||null}}function Le(n){return Number(n)*1e3}function qe(n){const[e,t,r]=n.split(".");if(e===void 0||t===void 0||r===void 0)return ce("JWT malformed, contained fewer than 3 sections"),null;try{const i=Lt(t);return i?JSON.parse(i):(ce("Failed to decode base64 JWT payload"),null)}catch(i){return ce("Caught error parsing JWT payload as JSON",i?.toString()),null}}function fi(n){const e=qe(n);return d(e,"internal-error"),d(typeof e.exp<"u","internal-error"),d(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}/**
496
+ */function J(n){if(n)try{const e=new Date(Number(n));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function fi(n,e=!1){const t=b(n),r=await t.getIdToken(e),i=qe(r);d(i&&i.exp&&i.auth_time&&i.iat,t.auth,"internal-error");const s=typeof i.firebase=="object"?i.firebase:void 0,o=s?.sign_in_provider;return{claims:i,token:r,authTime:J(Le(i.auth_time)),issuedAtTime:J(Le(i.iat)),expirationTime:J(Le(i.exp)),signInProvider:o||null,signInSecondFactor:s?.sign_in_second_factor||null}}function Le(n){return Number(n)*1e3}function qe(n){const[e,t,r]=n.split(".");if(e===void 0||t===void 0||r===void 0)return ce("JWT malformed, contained fewer than 3 sections"),null;try{const i=Mt(t);return i?JSON.parse(i):(ce("Failed to decode base64 JWT payload"),null)}catch(i){return ce("Caught error parsing JWT payload as JSON",i?.toString()),null}}function pi(n){const e=qe(n);return d(e,"internal-error"),d(typeof e.exp<"u","internal-error"),d(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}/**
512
497
  * @license
513
498
  * Copyright 2020 Google LLC
514
499
  *
@@ -523,7 +508,7 @@
523
508
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
524
509
  * See the License for the specific language governing permissions and
525
510
  * limitations under the License.
526
- */async function Q(n,e,t=!1){if(t)return e;try{return await e}catch(r){throw r instanceof N&&pi(r)&&n.auth.currentUser===n&&await n.auth.signOut(),r}}function pi({code:n}){return n==="auth/user-disabled"||n==="auth/user-token-expired"}/**
511
+ */async function Q(n,e,t=!1){if(t)return e;try{return await e}catch(r){throw r instanceof N&&gi(r)&&n.auth.currentUser===n&&await n.auth.signOut(),r}}function gi({code:n}){return n==="auth/user-disabled"||n==="auth/user-token-expired"}/**
527
512
  * @license
528
513
  * Copyright 2020 Google LLC
529
514
  *
@@ -538,7 +523,7 @@
538
523
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
539
524
  * See the License for the specific language governing permissions and
540
525
  * limitations under the License.
541
- */class gi{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(e){var t;if(e){const r=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),r}else{this.errorBackoff=3e4;const i=((t=this.user.stsTokenManager.expirationTime)!==null&&t!==void 0?t:0)-Date.now()-3e5;return Math.max(0,i)}}schedule(e=!1){if(!this.isRunning)return;const t=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},t)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){e?.code==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/**
526
+ */class mi{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(e){var t;if(e){const r=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),r}else{this.errorBackoff=3e4;const i=((t=this.user.stsTokenManager.expirationTime)!==null&&t!==void 0?t:0)-Date.now()-3e5;return Math.max(0,i)}}schedule(e=!1){if(!this.isRunning)return;const t=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},t)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){e?.code==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/**
542
527
  * @license
543
528
  * Copyright 2020 Google LLC
544
529
  *
@@ -553,7 +538,7 @@
553
538
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
554
539
  * See the License for the specific language governing permissions and
555
540
  * limitations under the License.
556
- */class qt{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=J(this.lastLoginAt),this.creationTime=J(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
541
+ */class Jt{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=J(this.lastLoginAt),this.creationTime=J(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
557
542
  * @license
558
543
  * Copyright 2019 Google LLC
559
544
  *
@@ -568,7 +553,7 @@
568
553
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
569
554
  * See the License for the specific language governing permissions and
570
555
  * limitations under the License.
571
- */async function me(n){var e;const t=n.auth,r=await n.getIdToken(),i=await Q(n,ui(t,{idToken:r}));d(i?.users.length,t,"internal-error");const s=i.users[0];n._notifyReloadListener(s);const o=!((e=s.providerUserInfo)===null||e===void 0)&&e.length?Ii(s.providerUserInfo):[],c=_i(n.providerData,o),a=n.isAnonymous,l=!(n.email&&s.passwordHash)&&!c?.length,u=a?l:!1,f={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:c,metadata:new qt(s.createdAt,s.lastLoginAt),isAnonymous:u};Object.assign(n,f)}async function mi(n){const e=b(n);await me(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function _i(n,e){return[...n.filter(r=>!e.some(i=>i.providerId===r.providerId)),...e]}function Ii(n){return n.map(e=>{var{providerId:t}=e,r=ze(e,["providerId"]);return{providerId:t,uid:r.rawId||"",displayName:r.displayName||null,email:r.email||null,phoneNumber:r.phoneNumber||null,photoURL:r.photoUrl||null}})}/**
556
+ */async function me(n){var e;const t=n.auth,r=await n.getIdToken(),i=await Q(n,hi(t,{idToken:r}));d(i?.users.length,t,"internal-error");const s=i.users[0];n._notifyReloadListener(s);const o=!((e=s.providerUserInfo)===null||e===void 0)&&e.length?Ii(s.providerUserInfo):[],c=vi(n.providerData,o),a=n.isAnonymous,l=!(n.email&&s.passwordHash)&&!c?.length,u=a?l:!1,f={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:c,metadata:new Jt(s.createdAt,s.lastLoginAt),isAnonymous:u};Object.assign(n,f)}async function _i(n){const e=b(n);await me(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function vi(n,e){return[...n.filter(r=>!e.some(i=>i.providerId===r.providerId)),...e]}function Ii(n){return n.map(e=>{var{providerId:t}=e,r=ze(e,["providerId"]);return{providerId:t,uid:r.rawId||"",displayName:r.displayName||null,email:r.email||null,phoneNumber:r.phoneNumber||null,photoURL:r.photoUrl||null}})}/**
572
557
  * @license
573
558
  * Copyright 2020 Google LLC
574
559
  *
@@ -583,7 +568,7 @@
583
568
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
584
569
  * See the License for the specific language governing permissions and
585
570
  * limitations under the License.
586
- */async function vi(n,e){const t=await Gt(n,{},async()=>{const r=ne({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:s}=n.config,o=Kt(n,i,"/v1/token",`key=${s}`),c=await n._getAdditionalHeaders();return c["Content-Type"]="application/x-www-form-urlencoded",zt.fetch()(o,{method:"POST",headers:c,body:r})});return{accessToken:t.access_token,expiresIn:t.expires_in,refreshToken:t.refresh_token}}async function yi(n,e){return T(n,"POST","/v2/accounts:revokeToken",D(n,e))}/**
571
+ */async function yi(n,e){const t=await Kt(n,{},async()=>{const r=ne({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:s}=n.config,o=qt(n,i,"/v1/token",`key=${s}`),c=await n._getAdditionalHeaders();return c["Content-Type"]="application/x-www-form-urlencoded",Gt.fetch()(o,{method:"POST",headers:c,body:r})});return{accessToken:t.access_token,expiresIn:t.expires_in,refreshToken:t.refresh_token}}async function Ei(n,e){return T(n,"POST","/v2/accounts:revokeToken",D(n,e))}/**
587
572
  * @license
588
573
  * Copyright 2020 Google LLC
589
574
  *
@@ -598,7 +583,7 @@
598
583
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
599
584
  * See the License for the specific language governing permissions and
600
585
  * limitations under the License.
601
- */class Z{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){d(e.idToken,"internal-error"),d(typeof e.idToken<"u","internal-error"),d(typeof e.refreshToken<"u","internal-error");const t="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):fi(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}async getToken(e,t=!1){return d(!this.accessToken||this.refreshToken,e,"user-token-expired"),!t&&this.accessToken&&!this.isExpired?this.accessToken:this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){const{accessToken:r,refreshToken:i,expiresIn:s}=await vi(e,t);this.updateTokensAndExpiration(r,i,Number(s))}updateTokensAndExpiration(e,t,r){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(e,t){const{refreshToken:r,accessToken:i,expirationTime:s}=t,o=new Z;return r&&(d(typeof r=="string","internal-error",{appName:e}),o.refreshToken=r),i&&(d(typeof i=="string","internal-error",{appName:e}),o.accessToken=i),s&&(d(typeof s=="number","internal-error",{appName:e}),o.expirationTime=s),o}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new Z,this.toJSON())}_performRefresh(){return y("not implemented")}}/**
586
+ */class Z{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){d(e.idToken,"internal-error"),d(typeof e.idToken<"u","internal-error"),d(typeof e.refreshToken<"u","internal-error");const t="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):pi(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}async getToken(e,t=!1){return d(!this.accessToken||this.refreshToken,e,"user-token-expired"),!t&&this.accessToken&&!this.isExpired?this.accessToken:this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){const{accessToken:r,refreshToken:i,expiresIn:s}=await yi(e,t);this.updateTokensAndExpiration(r,i,Number(s))}updateTokensAndExpiration(e,t,r){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(e,t){const{refreshToken:r,accessToken:i,expirationTime:s}=t,o=new Z;return r&&(d(typeof r=="string","internal-error",{appName:e}),o.refreshToken=r),i&&(d(typeof i=="string","internal-error",{appName:e}),o.accessToken=i),s&&(d(typeof s=="number","internal-error",{appName:e}),o.expirationTime=s),o}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new Z,this.toJSON())}_performRefresh(){return y("not implemented")}}/**
602
587
  * @license
603
588
  * Copyright 2020 Google LLC
604
589
  *
@@ -613,7 +598,7 @@
613
598
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
614
599
  * See the License for the specific language governing permissions and
615
600
  * limitations under the License.
616
- */function S(n,e){d(typeof n=="string"||typeof n>"u","internal-error",{appName:e})}class M{constructor(e){var{uid:t,auth:r,stsTokenManager:i}=e,s=ze(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new gi(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=r,this.stsTokenManager=i,this.accessToken=i.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new qt(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(e){const t=await Q(this,this.stsTokenManager.getToken(this.auth,e));return d(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return hi(this,e)}reload(){return mi(this)}_assign(e){this!==e&&(d(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(t=>Object.assign({},t)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const t=new M(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return t.metadata._copy(this.metadata),t}_onReload(e){d(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),t&&await me(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){const e=await this.getIdToken();return await Q(this,di(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>Object.assign({},e)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){var r,i,s,o,c,a,l,u;const f=(r=t.displayName)!==null&&r!==void 0?r:void 0,g=(i=t.email)!==null&&i!==void 0?i:void 0,v=(s=t.phoneNumber)!==null&&s!==void 0?s:void 0,H=(o=t.photoURL)!==null&&o!==void 0?o:void 0,Ze=(c=t.tenantId)!==null&&c!==void 0?c:void 0,Se=(a=t._redirectEventId)!==null&&a!==void 0?a:void 0,et=(l=t.createdAt)!==null&&l!==void 0?l:void 0,tt=(u=t.lastLoginAt)!==null&&u!==void 0?u:void 0,{uid:Ae,emailVerified:nt,isAnonymous:rt,providerData:ke,stsTokenManager:it}=t;d(Ae&&it,e,"internal-error");const En=Z.fromJSON(this.name,it);d(typeof Ae=="string",e,"internal-error"),S(f,e.name),S(g,e.name),d(typeof nt=="boolean",e,"internal-error"),d(typeof rt=="boolean",e,"internal-error"),S(v,e.name),S(H,e.name),S(Ze,e.name),S(Se,e.name),S(et,e.name),S(tt,e.name);const Ce=new M({uid:Ae,auth:e,email:g,emailVerified:nt,displayName:f,isAnonymous:rt,photoURL:H,phoneNumber:v,tenantId:Ze,stsTokenManager:En,createdAt:et,lastLoginAt:tt});return ke&&Array.isArray(ke)&&(Ce.providerData=ke.map(wn=>Object.assign({},wn))),Se&&(Ce._redirectEventId=Se),Ce}static async _fromIdTokenResponse(e,t,r=!1){const i=new Z;i.updateFromServerResponse(t);const s=new M({uid:t.localId,auth:e,stsTokenManager:i,isAnonymous:r});return await me(s),s}}/**
601
+ */function S(n,e){d(typeof n=="string"||typeof n>"u","internal-error",{appName:e})}class M{constructor(e){var{uid:t,auth:r,stsTokenManager:i}=e,s=ze(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new mi(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=r,this.stsTokenManager=i,this.accessToken=i.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new Jt(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(e){const t=await Q(this,this.stsTokenManager.getToken(this.auth,e));return d(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return fi(this,e)}reload(){return _i(this)}_assign(e){this!==e&&(d(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(t=>Object.assign({},t)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const t=new M(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return t.metadata._copy(this.metadata),t}_onReload(e){d(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),t&&await me(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){const e=await this.getIdToken();return await Q(this,ui(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>Object.assign({},e)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){var r,i,s,o,c,a,l,u;const f=(r=t.displayName)!==null&&r!==void 0?r:void 0,g=(i=t.email)!==null&&i!==void 0?i:void 0,I=(s=t.phoneNumber)!==null&&s!==void 0?s:void 0,V=(o=t.photoURL)!==null&&o!==void 0?o:void 0,Ze=(c=t.tenantId)!==null&&c!==void 0?c:void 0,Se=(a=t._redirectEventId)!==null&&a!==void 0?a:void 0,et=(l=t.createdAt)!==null&&l!==void 0?l:void 0,tt=(u=t.lastLoginAt)!==null&&u!==void 0?u:void 0,{uid:Ae,emailVerified:nt,isAnonymous:rt,providerData:Ce,stsTokenManager:it}=t;d(Ae&&it,e,"internal-error");const wn=Z.fromJSON(this.name,it);d(typeof Ae=="string",e,"internal-error"),S(f,e.name),S(g,e.name),d(typeof nt=="boolean",e,"internal-error"),d(typeof rt=="boolean",e,"internal-error"),S(I,e.name),S(V,e.name),S(Ze,e.name),S(Se,e.name),S(et,e.name),S(tt,e.name);const ke=new M({uid:Ae,auth:e,email:g,emailVerified:nt,displayName:f,isAnonymous:rt,photoURL:V,phoneNumber:I,tenantId:Ze,stsTokenManager:wn,createdAt:et,lastLoginAt:tt});return Ce&&Array.isArray(Ce)&&(ke.providerData=Ce.map(bn=>Object.assign({},bn))),Se&&(ke._redirectEventId=Se),ke}static async _fromIdTokenResponse(e,t,r=!1){const i=new Z;i.updateFromServerResponse(t);const s=new M({uid:t.localId,auth:e,stsTokenManager:i,isAnonymous:r});return await me(s),s}}/**
617
602
  * @license
618
603
  * Copyright 2020 Google LLC
619
604
  *
@@ -628,7 +613,7 @@
628
613
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
629
614
  * See the License for the specific language governing permissions and
630
615
  * limitations under the License.
631
- */const gt=new Map;function E(n){w(n instanceof Function,"Expected a class definition");let e=gt.get(n);return e?(w(e instanceof n,"Instance stored in cache mismatched with class"),e):(e=new n,gt.set(n,e),e)}/**
616
+ */const mt=new Map;function E(n){w(n instanceof Function,"Expected a class definition");let e=mt.get(n);return e?(w(e instanceof n,"Instance stored in cache mismatched with class"),e):(e=new n,mt.set(n,e),e)}/**
632
617
  * @license
633
618
  * Copyright 2019 Google LLC
634
619
  *
@@ -643,7 +628,7 @@
643
628
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
644
629
  * See the License for the specific language governing permissions and
645
630
  * limitations under the License.
646
- */class Jt{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){const t=this.storage[e];return t===void 0?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}Jt.type="NONE";const mt=Jt;/**
631
+ */class Yt{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){const t=this.storage[e];return t===void 0?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}Yt.type="NONE";const _t=Yt;/**
647
632
  * @license
648
633
  * Copyright 2019 Google LLC
649
634
  *
@@ -658,7 +643,7 @@
658
643
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
659
644
  * See the License for the specific language governing permissions and
660
645
  * limitations under the License.
661
- */function le(n,e,t){return`firebase:${n}:${e}:${t}`}class ${constructor(e,t,r){this.persistence=e,this.auth=t,this.userKey=r;const{config:i,name:s}=this.auth;this.fullUserKey=le(this.userKey,i.apiKey,s),this.fullPersistenceKey=le("persistence",i.apiKey,s),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);return e?M._fromJSON(this.auth,e):null}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const t=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,t)return this.setCurrentUser(t)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,t,r="authUser"){if(!t.length)return new $(E(mt),e,r);const i=(await Promise.all(t.map(async l=>{if(await l._isAvailable())return l}))).filter(l=>l);let s=i[0]||E(mt);const o=le(r,e.config.apiKey,e.name);let c=null;for(const l of t)try{const u=await l._get(o);if(u){const f=M._fromJSON(e,u);l!==s&&(c=f),s=l;break}}catch{}const a=i.filter(l=>l._shouldAllowMigration);return!s._shouldAllowMigration||!a.length?new $(s,e,r):(s=a[0],c&&await s._set(o,c.toJSON()),await Promise.all(t.map(async l=>{if(l!==s)try{await l._remove(o)}catch{}})),new $(s,e,r))}}/**
646
+ */function le(n,e,t){return`firebase:${n}:${e}:${t}`}class ${constructor(e,t,r){this.persistence=e,this.auth=t,this.userKey=r;const{config:i,name:s}=this.auth;this.fullUserKey=le(this.userKey,i.apiKey,s),this.fullPersistenceKey=le("persistence",i.apiKey,s),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);return e?M._fromJSON(this.auth,e):null}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const t=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,t)return this.setCurrentUser(t)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,t,r="authUser"){if(!t.length)return new $(E(_t),e,r);const i=(await Promise.all(t.map(async l=>{if(await l._isAvailable())return l}))).filter(l=>l);let s=i[0]||E(_t);const o=le(r,e.config.apiKey,e.name);let c=null;for(const l of t)try{const u=await l._get(o);if(u){const f=M._fromJSON(e,u);l!==s&&(c=f),s=l;break}}catch{}const a=i.filter(l=>l._shouldAllowMigration);return!s._shouldAllowMigration||!a.length?new $(s,e,r):(s=a[0],c&&await s._set(o,c.toJSON()),await Promise.all(t.map(async l=>{if(l!==s)try{await l._remove(o)}catch{}})),new $(s,e,r))}}/**
662
647
  * @license
663
648
  * Copyright 2020 Google LLC
664
649
  *
@@ -673,7 +658,7 @@
673
658
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
674
659
  * See the License for the specific language governing permissions and
675
660
  * limitations under the License.
676
- */function _t(n){const e=n.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(Qt(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(Yt(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(en(e))return"Blackberry";if(tn(e))return"Webos";if(Je(e))return"Safari";if((e.includes("chrome/")||Xt(e))&&!e.includes("edge/"))return"Chrome";if(Zt(e))return"Android";{const t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=n.match(t);if(r?.length===2)return r[1]}return"Other"}function Yt(n=p()){return/firefox\//i.test(n)}function Je(n=p()){const e=n.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function Xt(n=p()){return/crios\//i.test(n)}function Qt(n=p()){return/iemobile/i.test(n)}function Zt(n=p()){return/android/i.test(n)}function en(n=p()){return/blackberry/i.test(n)}function tn(n=p()){return/webos/i.test(n)}function Ee(n=p()){return/iphone|ipad|ipod/i.test(n)||/macintosh/i.test(n)&&/mobile/i.test(n)}function Ei(n=p()){var e;return Ee(n)&&!!(!((e=window.navigator)===null||e===void 0)&&e.standalone)}function wi(){return Mn()&&document.documentMode===10}function nn(n=p()){return Ee(n)||Zt(n)||tn(n)||en(n)||/windows phone/i.test(n)||Qt(n)}function bi(){try{return!!(window&&window!==window.top)}catch{return!1}}/**
661
+ */function vt(n){const e=n.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(Zt(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(Xt(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(tn(e))return"Blackberry";if(nn(e))return"Webos";if(Je(e))return"Safari";if((e.includes("chrome/")||Qt(e))&&!e.includes("edge/"))return"Chrome";if(en(e))return"Android";{const t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=n.match(t);if(r?.length===2)return r[1]}return"Other"}function Xt(n=p()){return/firefox\//i.test(n)}function Je(n=p()){const e=n.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function Qt(n=p()){return/crios\//i.test(n)}function Zt(n=p()){return/iemobile/i.test(n)}function en(n=p()){return/android/i.test(n)}function tn(n=p()){return/blackberry/i.test(n)}function nn(n=p()){return/webos/i.test(n)}function Ee(n=p()){return/iphone|ipad|ipod/i.test(n)||/macintosh/i.test(n)&&/mobile/i.test(n)}function wi(n=p()){var e;return Ee(n)&&!!(!((e=window.navigator)===null||e===void 0)&&e.standalone)}function bi(){return Un()&&document.documentMode===10}function rn(n=p()){return Ee(n)||en(n)||nn(n)||tn(n)||/windows phone/i.test(n)||Zt(n)}function Ti(){try{return!!(window&&window!==window.top)}catch{return!1}}/**
677
662
  * @license
678
663
  * Copyright 2020 Google LLC
679
664
  *
@@ -688,7 +673,7 @@
688
673
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
689
674
  * See the License for the specific language governing permissions and
690
675
  * limitations under the License.
691
- */function rn(n,e=[]){let t;switch(n){case"Browser":t=_t(p());break;case"Worker":t=`${_t(p())}-${n}`;break;default:t=n}const r=e.length?e.join(","):"FirebaseCore-web";return`${t}/JsCore/${re}/${r}`}/**
676
+ */function sn(n,e=[]){let t;switch(n){case"Browser":t=vt(p());break;case"Worker":t=`${vt(p())}-${n}`;break;default:t=n}const r=e.length?e.join(","):"FirebaseCore-web";return`${t}/JsCore/${re}/${r}`}/**
692
677
  * @license
693
678
  * Copyright 2022 Google LLC
694
679
  *
@@ -703,7 +688,7 @@
703
688
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
704
689
  * See the License for the specific language governing permissions and
705
690
  * limitations under the License.
706
- */class Ti{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){const r=s=>new Promise((o,c)=>{try{const a=e(s);o(a)}catch(a){c(a)}});r.onAbort=t,this.queue.push(r);const i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const t=[];try{for(const r of this.queue)await r(e),r.onAbort&&t.push(r.onAbort)}catch(r){t.reverse();for(const i of t)try{i()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:r?.message})}}}/**
691
+ */class Si{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){const r=s=>new Promise((o,c)=>{try{const a=e(s);o(a)}catch(a){c(a)}});r.onAbort=t,this.queue.push(r);const i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const t=[];try{for(const r of this.queue)await r(e),r.onAbort&&t.push(r.onAbort)}catch(r){t.reverse();for(const i of t)try{i()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:r?.message})}}}/**
707
692
  * @license
708
693
  * Copyright 2023 Google LLC
709
694
  *
@@ -718,7 +703,7 @@
718
703
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
719
704
  * See the License for the specific language governing permissions and
720
705
  * limitations under the License.
721
- */async function Si(n,e={}){return T(n,"GET","/v2/passwordPolicy",D(n,e))}/**
706
+ */async function Ai(n,e={}){return T(n,"GET","/v2/passwordPolicy",D(n,e))}/**
722
707
  * @license
723
708
  * Copyright 2023 Google LLC
724
709
  *
@@ -733,7 +718,7 @@
733
718
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
734
719
  * See the License for the specific language governing permissions and
735
720
  * limitations under the License.
736
- */const Ai=6;class ki{constructor(e){var t,r,i,s;const o=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=(t=o.minPasswordLength)!==null&&t!==void 0?t:Ai,o.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=o.maxPasswordLength),o.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=o.containsLowercaseCharacter),o.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=o.containsUppercaseCharacter),o.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=o.containsNumericCharacter),o.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=o.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=(i=(r=e.allowedNonAlphanumericCharacters)===null||r===void 0?void 0:r.join(""))!==null&&i!==void 0?i:"",this.forceUpgradeOnSignin=(s=e.forceUpgradeOnSignin)!==null&&s!==void 0?s:!1,this.schemaVersion=e.schemaVersion}validatePassword(e){var t,r,i,s,o,c;const a={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,a),this.validatePasswordCharacterOptions(e,a),a.isValid&&(a.isValid=(t=a.meetsMinPasswordLength)!==null&&t!==void 0?t:!0),a.isValid&&(a.isValid=(r=a.meetsMaxPasswordLength)!==null&&r!==void 0?r:!0),a.isValid&&(a.isValid=(i=a.containsLowercaseLetter)!==null&&i!==void 0?i:!0),a.isValid&&(a.isValid=(s=a.containsUppercaseLetter)!==null&&s!==void 0?s:!0),a.isValid&&(a.isValid=(o=a.containsNumericCharacter)!==null&&o!==void 0?o:!0),a.isValid&&(a.isValid=(c=a.containsNonAlphanumericCharacter)!==null&&c!==void 0?c:!0),a}validatePasswordLengthOptions(e,t){const r=this.customStrengthOptions.minPasswordLength,i=this.customStrengthOptions.maxPasswordLength;r&&(t.meetsMinPasswordLength=e.length>=r),i&&(t.meetsMaxPasswordLength=e.length<=i)}validatePasswordCharacterOptions(e,t){this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);let r;for(let i=0;i<e.length;i++)r=e.charAt(i),this.updatePasswordCharacterOptionsStatuses(t,r>="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(e,t,r,i,s){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=i)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=s))}}/**
721
+ */const Ci=6;class ki{constructor(e){var t,r,i,s;const o=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=(t=o.minPasswordLength)!==null&&t!==void 0?t:Ci,o.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=o.maxPasswordLength),o.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=o.containsLowercaseCharacter),o.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=o.containsUppercaseCharacter),o.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=o.containsNumericCharacter),o.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=o.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=(i=(r=e.allowedNonAlphanumericCharacters)===null||r===void 0?void 0:r.join(""))!==null&&i!==void 0?i:"",this.forceUpgradeOnSignin=(s=e.forceUpgradeOnSignin)!==null&&s!==void 0?s:!1,this.schemaVersion=e.schemaVersion}validatePassword(e){var t,r,i,s,o,c;const a={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,a),this.validatePasswordCharacterOptions(e,a),a.isValid&&(a.isValid=(t=a.meetsMinPasswordLength)!==null&&t!==void 0?t:!0),a.isValid&&(a.isValid=(r=a.meetsMaxPasswordLength)!==null&&r!==void 0?r:!0),a.isValid&&(a.isValid=(i=a.containsLowercaseLetter)!==null&&i!==void 0?i:!0),a.isValid&&(a.isValid=(s=a.containsUppercaseLetter)!==null&&s!==void 0?s:!0),a.isValid&&(a.isValid=(o=a.containsNumericCharacter)!==null&&o!==void 0?o:!0),a.isValid&&(a.isValid=(c=a.containsNonAlphanumericCharacter)!==null&&c!==void 0?c:!0),a}validatePasswordLengthOptions(e,t){const r=this.customStrengthOptions.minPasswordLength,i=this.customStrengthOptions.maxPasswordLength;r&&(t.meetsMinPasswordLength=e.length>=r),i&&(t.meetsMaxPasswordLength=e.length<=i)}validatePasswordCharacterOptions(e,t){this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);let r;for(let i=0;i<e.length;i++)r=e.charAt(i),this.updatePasswordCharacterOptionsStatuses(t,r>="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(e,t,r,i,s){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=i)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=s))}}/**
737
722
  * @license
738
723
  * Copyright 2020 Google LLC
739
724
  *
@@ -748,7 +733,7 @@
748
733
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
749
734
  * See the License for the specific language governing permissions and
750
735
  * limitations under the License.
751
- */class Ci{constructor(e,t,r,i){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=r,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new It(this),this.idTokenSubscription=new It(this),this.beforeStateQueue=new Ti(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=jt,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=i.sdkClientVersion}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=E(t)),this._initializationPromise=this.queue(async()=>{var r,i;if(!this._deleted&&(this.persistenceManager=await $.create(this,e),!this._deleted)){if(!((r=this._popupRedirectResolver)===null||r===void 0)&&r._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(t),this.lastNotifiedUid=((i=this.currentUser)===null||i===void 0?void 0:i.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUser(e){var t;const r=await this.assertedPersistence.getCurrentUser();let i=r,s=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const o=(t=this.redirectUser)===null||t===void 0?void 0:t._redirectEventId,c=i?._redirectEventId,a=await this.tryRedirectSignIn(e);(!o||o===c)&&a?.user&&(i=a.user,s=!0)}if(!i)return this.directlySetCurrentUser(null);if(!i._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(i)}catch(o){i=r,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(o))}return i?this.reloadAndSetCurrentUserOrClear(i):this.directlySetCurrentUser(null)}return d(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===i._redirectEventId?this.directlySetCurrentUser(i):this.reloadAndSetCurrentUserOrClear(i)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await me(e)}catch(t){if(t?.code!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=ri()}async _delete(){this._deleted=!0}async updateCurrentUser(e){const t=e?b(e):null;return t&&d(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&d(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0)}setPersistence(e){return this.queue(async()=>{await this.assertedPersistence.setPersistence(E(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):t.validatePassword(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await Si(this),t=new ki(e);this.tenantId===null?this._projectPasswordPolicy=t:this._tenantPasswordPolicies[this.tenantId]=t}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new te("auth","Firebase",e())}onAuthStateChanged(e,t,r){return this.registerStateListener(this.authStateSubscription,e,t,r)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,r){return this.registerStateListener(this.idTokenSubscription,e,t,r)}authStateReady(){return new Promise((e,t)=>{if(this.currentUser)e();else{const r=this.onAuthStateChanged(()=>{r(),e()},t)}})}async revokeAccessToken(e){if(this.currentUser){const t=await this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:t};this.tenantId!=null&&(r.tenantId=this.tenantId),await yi(this,r)}}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)===null||e===void 0?void 0:e.toJSON()}}async _setRedirectUser(e,t){const r=await this.getOrInitRedirectPersistenceManager(t);return e===null?r.removeCurrentUser():r.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const t=e&&E(e)||this._popupRedirectResolver;d(t,this,"argument-error"),this.redirectPersistenceManager=await $.create(this,[E(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var t,r;return this._isInitialized&&await this.queue(async()=>{}),((t=this._currentUser)===null||t===void 0?void 0:t._redirectEventId)===e?this._currentUser:((r=this.redirectUser)===null||r===void 0?void 0:r._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const r=(t=(e=this.currentUser)===null||e===void 0?void 0:e.uid)!==null&&t!==void 0?t:null;this.lastNotifiedUid!==r&&(this.lastNotifiedUid=r,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,r,i){if(this._deleted)return()=>{};const s=typeof t=="function"?t:t.next.bind(t);let o=!1;const c=this._isInitialized?Promise.resolve():this._initializationPromise;if(d(c,this,"internal-error"),c.then(()=>{o||s(this.currentUser)}),typeof t=="function"){const a=e.addObserver(t,r,i);return()=>{o=!0,a()}}else{const a=e.addObserver(t);return()=>{o=!0,a()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return d(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=rn(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const r=await((e=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getHeartbeatsHeader());r&&(t["X-Firebase-Client"]=r);const i=await this._getAppCheckToken();return i&&(t["X-Firebase-AppCheck"]=i),t}async _getAppCheckToken(){var e;const t=await((e=this.appCheckServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getToken());return t?.error&&Zr(`Error while retrieving App Check token: ${t.error}`),t?.token}}function F(n){return b(n)}class It{constructor(e){this.auth=e,this.observer=null,this.addObserver=$n(t=>this.observer=t)}get next(){return d(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
736
+ */class Ri{constructor(e,t,r,i){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=r,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new It(this),this.idTokenSubscription=new It(this),this.beforeStateQueue=new Si(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=zt,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=i.sdkClientVersion}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=E(t)),this._initializationPromise=this.queue(async()=>{var r,i;if(!this._deleted&&(this.persistenceManager=await $.create(this,e),!this._deleted)){if(!((r=this._popupRedirectResolver)===null||r===void 0)&&r._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(t),this.lastNotifiedUid=((i=this.currentUser)===null||i===void 0?void 0:i.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUser(e){var t;const r=await this.assertedPersistence.getCurrentUser();let i=r,s=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const o=(t=this.redirectUser)===null||t===void 0?void 0:t._redirectEventId,c=i?._redirectEventId,a=await this.tryRedirectSignIn(e);(!o||o===c)&&a?.user&&(i=a.user,s=!0)}if(!i)return this.directlySetCurrentUser(null);if(!i._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(i)}catch(o){i=r,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(o))}return i?this.reloadAndSetCurrentUserOrClear(i):this.directlySetCurrentUser(null)}return d(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===i._redirectEventId?this.directlySetCurrentUser(i):this.reloadAndSetCurrentUserOrClear(i)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await me(e)}catch(t){if(t?.code!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=ii()}async _delete(){this._deleted=!0}async updateCurrentUser(e){const t=e?b(e):null;return t&&d(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&d(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0)}setPersistence(e){return this.queue(async()=>{await this.assertedPersistence.setPersistence(E(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):t.validatePassword(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await Ai(this),t=new ki(e);this.tenantId===null?this._projectPasswordPolicy=t:this._tenantPasswordPolicies[this.tenantId]=t}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new te("auth","Firebase",e())}onAuthStateChanged(e,t,r){return this.registerStateListener(this.authStateSubscription,e,t,r)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,r){return this.registerStateListener(this.idTokenSubscription,e,t,r)}authStateReady(){return new Promise((e,t)=>{if(this.currentUser)e();else{const r=this.onAuthStateChanged(()=>{r(),e()},t)}})}async revokeAccessToken(e){if(this.currentUser){const t=await this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:t};this.tenantId!=null&&(r.tenantId=this.tenantId),await Ei(this,r)}}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)===null||e===void 0?void 0:e.toJSON()}}async _setRedirectUser(e,t){const r=await this.getOrInitRedirectPersistenceManager(t);return e===null?r.removeCurrentUser():r.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const t=e&&E(e)||this._popupRedirectResolver;d(t,this,"argument-error"),this.redirectPersistenceManager=await $.create(this,[E(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var t,r;return this._isInitialized&&await this.queue(async()=>{}),((t=this._currentUser)===null||t===void 0?void 0:t._redirectEventId)===e?this._currentUser:((r=this.redirectUser)===null||r===void 0?void 0:r._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const r=(t=(e=this.currentUser)===null||e===void 0?void 0:e.uid)!==null&&t!==void 0?t:null;this.lastNotifiedUid!==r&&(this.lastNotifiedUid=r,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,r,i){if(this._deleted)return()=>{};const s=typeof t=="function"?t:t.next.bind(t);let o=!1;const c=this._isInitialized?Promise.resolve():this._initializationPromise;if(d(c,this,"internal-error"),c.then(()=>{o||s(this.currentUser)}),typeof t=="function"){const a=e.addObserver(t,r,i);return()=>{o=!0,a()}}else{const a=e.addObserver(t);return()=>{o=!0,a()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return d(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=sn(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const r=await((e=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getHeartbeatsHeader());r&&(t["X-Firebase-Client"]=r);const i=await this._getAppCheckToken();return i&&(t["X-Firebase-AppCheck"]=i),t}async _getAppCheckToken(){var e;const t=await((e=this.appCheckServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getToken());return t?.error&&ei(`Error while retrieving App Check token: ${t.error}`),t?.token}}function B(n){return b(n)}class It{constructor(e){this.auth=e,this.observer=null,this.addObserver=Wn(t=>this.observer=t)}get next(){return d(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
752
737
  * @license
753
738
  * Copyright 2020 Google LLC
754
739
  *
@@ -763,7 +748,7 @@
763
748
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
764
749
  * See the License for the specific language governing permissions and
765
750
  * limitations under the License.
766
- */function Ri(){var n,e;return(e=(n=document.getElementsByTagName("head"))===null||n===void 0?void 0:n[0])!==null&&e!==void 0?e:document}function sn(n){return new Promise((e,t)=>{const r=document.createElement("script");r.setAttribute("src",n),r.onload=e,r.onerror=i=>{const s=_("internal-error");s.customData=i,t(s)},r.type="text/javascript",r.charset="UTF-8",Ri().appendChild(r)})}function Pi(n){return`__${n}${Math.floor(Math.random()*1e6)}`}const Oi="https://www.google.com/recaptcha/enterprise.js?render=",Ni="recaptcha-enterprise",Di="NO_RECAPTCHA";class Li{constructor(e){this.type=Ni,this.auth=F(e)}async verify(e="verify",t=!1){async function r(s){if(!t){if(s.tenantId==null&&s._agentRecaptchaConfig!=null)return s._agentRecaptchaConfig.siteKey;if(s.tenantId!=null&&s._tenantRecaptchaConfigs[s.tenantId]!==void 0)return s._tenantRecaptchaConfigs[s.tenantId].siteKey}return new Promise(async(o,c)=>{li(s,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(a=>{if(a.recaptchaKey===void 0)c(new Error("recaptcha Enterprise site key undefined"));else{const l=new ci(a);return s.tenantId==null?s._agentRecaptchaConfig=l:s._tenantRecaptchaConfigs[s.tenantId]=l,o(l.siteKey)}}).catch(a=>{c(a)})})}function i(s,o,c){const a=window.grecaptcha;pt(a)?a.enterprise.ready(()=>{a.enterprise.execute(s,{action:e}).then(l=>{o(l)}).catch(()=>{o(Di)})}):c(Error("No reCAPTCHA enterprise script loaded."))}return new Promise((s,o)=>{r(this.auth).then(c=>{if(!t&&pt(window.grecaptcha))i(c,s,o);else{if(typeof window>"u"){o(new Error("RecaptchaVerifier is only supported in browser"));return}sn(Oi+c).then(()=>{i(c,s,o)}).catch(a=>{o(a)})}}).catch(c=>{o(c)})})}}async function vt(n,e,t,r=!1){const i=new Li(n);let s;try{s=await i.verify(t)}catch{s=await i.verify(t,!0)}const o=Object.assign({},e);return r?Object.assign(o,{captchaResp:s}):Object.assign(o,{captchaResponse:s}),Object.assign(o,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(o,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),o}async function Ve(n,e,t,r){var i;if(!((i=n._getRecaptchaConfig())===null||i===void 0)&&i.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const s=await vt(n,e,t,t==="getOobCode");return r(n,s)}else return r(n,e).catch(async s=>{if(s.code==="auth/missing-recaptcha-token"){console.log(`${t} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);const o=await vt(n,e,t,t==="getOobCode");return r(n,o)}else return Promise.reject(s)})}/**
751
+ */function Pi(){var n,e;return(e=(n=document.getElementsByTagName("head"))===null||n===void 0?void 0:n[0])!==null&&e!==void 0?e:document}function on(n){return new Promise((e,t)=>{const r=document.createElement("script");r.setAttribute("src",n),r.onload=e,r.onerror=i=>{const s=_("internal-error");s.customData=i,t(s)},r.type="text/javascript",r.charset="UTF-8",Pi().appendChild(r)})}function Oi(n){return`__${n}${Math.floor(Math.random()*1e6)}`}const Ni="https://www.google.com/recaptcha/enterprise.js?render=",Di="recaptcha-enterprise",Li="NO_RECAPTCHA";class Mi{constructor(e){this.type=Di,this.auth=B(e)}async verify(e="verify",t=!1){async function r(s){if(!t){if(s.tenantId==null&&s._agentRecaptchaConfig!=null)return s._agentRecaptchaConfig.siteKey;if(s.tenantId!=null&&s._tenantRecaptchaConfigs[s.tenantId]!==void 0)return s._tenantRecaptchaConfigs[s.tenantId].siteKey}return new Promise(async(o,c)=>{di(s,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(a=>{if(a.recaptchaKey===void 0)c(new Error("recaptcha Enterprise site key undefined"));else{const l=new li(a);return s.tenantId==null?s._agentRecaptchaConfig=l:s._tenantRecaptchaConfigs[s.tenantId]=l,o(l.siteKey)}}).catch(a=>{c(a)})})}function i(s,o,c){const a=window.grecaptcha;gt(a)?a.enterprise.ready(()=>{a.enterprise.execute(s,{action:e}).then(l=>{o(l)}).catch(()=>{o(Li)})}):c(Error("No reCAPTCHA enterprise script loaded."))}return new Promise((s,o)=>{r(this.auth).then(c=>{if(!t&&gt(window.grecaptcha))i(c,s,o);else{if(typeof window>"u"){o(new Error("RecaptchaVerifier is only supported in browser"));return}on(Ni+c).then(()=>{i(c,s,o)}).catch(a=>{o(a)})}}).catch(c=>{o(c)})})}}async function yt(n,e,t,r=!1){const i=new Mi(n);let s;try{s=await i.verify(t)}catch{s=await i.verify(t,!0)}const o=Object.assign({},e);return r?Object.assign(o,{captchaResp:s}):Object.assign(o,{captchaResponse:s}),Object.assign(o,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(o,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),o}async function He(n,e,t,r){var i;if(!((i=n._getRecaptchaConfig())===null||i===void 0)&&i.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const s=await yt(n,e,t,t==="getOobCode");return r(n,s)}else return r(n,e).catch(async s=>{if(s.code==="auth/missing-recaptcha-token"){console.log(`${t} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);const o=await yt(n,e,t,t==="getOobCode");return r(n,o)}else return Promise.reject(s)})}/**
767
752
  * @license
768
753
  * Copyright 2020 Google LLC
769
754
  *
@@ -778,7 +763,7 @@
778
763
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
779
764
  * See the License for the specific language governing permissions and
780
765
  * limitations under the License.
781
- */function Mi(n,e){const t=Ht(n,"auth");if(t.isInitialized()){const i=t.getImmediate(),s=t.getOptions();if(he(s,e??{}))return i;m(i,"already-initialized")}return t.initialize({options:e})}function Ui(n,e){const t=e?.persistence||[],r=(Array.isArray(t)?t:[t]).map(E);e?.errorMap&&n._updateErrorMap(e.errorMap),n._initializeWithPersistence(r,e?.popupRedirectResolver)}function xi(n,e,t){const r=F(n);d(r._canInitEmulator,r,"emulator-config-failed"),d(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");const i=!!t?.disableWarnings,s=on(e),{host:o,port:c}=Fi(e),a=c===null?"":`:${c}`;r.config.emulator={url:`${s}//${o}${a}/`},r.settings.appVerificationDisabledForTesting=!0,r.emulatorConfig=Object.freeze({host:o,port:c,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:i})}),i||Bi()}function on(n){const e=n.indexOf(":");return e<0?"":n.substr(0,e+1)}function Fi(n){const e=on(n),t=/(\/\/)?([^?#/]+)/.exec(n.substr(e.length));if(!t)return{host:"",port:null};const r=t[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){const s=i[1];return{host:s,port:yt(r.substr(s.length+1))}}else{const[s,o]=r.split(":");return{host:s,port:yt(o)}}}function yt(n){if(!n)return null;const e=Number(n);return isNaN(e)?null:e}function Bi(){function n(){const e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",n):n())}/**
766
+ */function Ui(n,e){const t=Ht(n,"auth");if(t.isInitialized()){const i=t.getImmediate(),s=t.getOptions();if(he(s,e??{}))return i;m(i,"already-initialized")}return t.initialize({options:e})}function Fi(n,e){const t=e?.persistence||[],r=(Array.isArray(t)?t:[t]).map(E);e?.errorMap&&n._updateErrorMap(e.errorMap),n._initializeWithPersistence(r,e?.popupRedirectResolver)}function Bi(n,e,t){const r=B(n);d(r._canInitEmulator,r,"emulator-config-failed"),d(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");const i=!!t?.disableWarnings,s=an(e),{host:o,port:c}=xi(e),a=c===null?"":`:${c}`;r.config.emulator={url:`${s}//${o}${a}/`},r.settings.appVerificationDisabledForTesting=!0,r.emulatorConfig=Object.freeze({host:o,port:c,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:i})}),i||Vi()}function an(n){const e=n.indexOf(":");return e<0?"":n.substr(0,e+1)}function xi(n){const e=an(n),t=/(\/\/)?([^?#/]+)/.exec(n.substr(e.length));if(!t)return{host:"",port:null};const r=t[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){const s=i[1];return{host:s,port:Et(r.substr(s.length+1))}}else{const[s,o]=r.split(":");return{host:s,port:Et(o)}}}function Et(n){if(!n)return null;const e=Number(n);return isNaN(e)?null:e}function Vi(){function n(){const e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",n):n())}/**
782
767
  * @license
783
768
  * Copyright 2020 Google LLC
784
769
  *
@@ -808,7 +793,7 @@
808
793
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
809
794
  * See the License for the specific language governing permissions and
810
795
  * limitations under the License.
811
- */async function Vi(n,e){return ye(n,"POST","/v1/accounts:signInWithPassword",D(n,e))}async function $i(n,e){return T(n,"POST","/v1/accounts:sendOobCode",D(n,e))}async function Wi(n,e){return $i(n,e)}/**
796
+ */async function $i(n,e){return ye(n,"POST","/v1/accounts:signInWithPassword",D(n,e))}async function Wi(n,e){return T(n,"POST","/v1/accounts:sendOobCode",D(n,e))}async function ji(n,e){return Wi(n,e)}/**
812
797
  * @license
813
798
  * Copyright 2020 Google LLC
814
799
  *
@@ -823,7 +808,7 @@
823
808
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
824
809
  * See the License for the specific language governing permissions and
825
810
  * limitations under the License.
826
- */async function ji(n,e){return ye(n,"POST","/v1/accounts:signInWithEmailLink",D(n,e))}async function zi(n,e){return ye(n,"POST","/v1/accounts:signInWithEmailLink",D(n,e))}/**
811
+ */async function zi(n,e){return ye(n,"POST","/v1/accounts:signInWithEmailLink",D(n,e))}async function Gi(n,e){return ye(n,"POST","/v1/accounts:signInWithEmailLink",D(n,e))}/**
827
812
  * @license
828
813
  * Copyright 2020 Google LLC
829
814
  *
@@ -838,7 +823,7 @@
838
823
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
839
824
  * See the License for the specific language governing permissions and
840
825
  * limitations under the License.
841
- */class ee extends Ye{constructor(e,t,r,i=null){super("password",r),this._email=e,this._password=t,this._tenantId=i}static _fromEmailAndPassword(e,t){return new ee(e,t,"password")}static _fromEmailAndCode(e,t,r=null){return new ee(e,t,"emailLink",r)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const t=typeof e=="string"?JSON.parse(e):e;if(t?.email&&t?.password){if(t.signInMethod==="password")return this._fromEmailAndPassword(t.email,t.password);if(t.signInMethod==="emailLink")return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":const t={returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return Ve(e,t,"signInWithPassword",Vi);case"emailLink":return ji(e,{email:this._email,oobCode:this._password});default:m(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":const r={idToken:t,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return Ve(e,r,"signUpPassword",Hi);case"emailLink":return zi(e,{idToken:t,email:this._email,oobCode:this._password});default:m(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}/**
826
+ */class ee extends Ye{constructor(e,t,r,i=null){super("password",r),this._email=e,this._password=t,this._tenantId=i}static _fromEmailAndPassword(e,t){return new ee(e,t,"password")}static _fromEmailAndCode(e,t,r=null){return new ee(e,t,"emailLink",r)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const t=typeof e=="string"?JSON.parse(e):e;if(t?.email&&t?.password){if(t.signInMethod==="password")return this._fromEmailAndPassword(t.email,t.password);if(t.signInMethod==="emailLink")return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":const t={returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return He(e,t,"signInWithPassword",$i);case"emailLink":return zi(e,{email:this._email,oobCode:this._password});default:m(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":const r={idToken:t,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return He(e,r,"signUpPassword",Hi);case"emailLink":return Gi(e,{idToken:t,email:this._email,oobCode:this._password});default:m(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}/**
842
827
  * @license
843
828
  * Copyright 2020 Google LLC
844
829
  *
@@ -868,7 +853,7 @@
868
853
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
869
854
  * See the License for the specific language governing permissions and
870
855
  * limitations under the License.
871
- */const Gi="http://localhost";class x extends Ye{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new x(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):m("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const t=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:i}=t,s=ze(t,["providerId","signInMethod"]);if(!r||!i)return null;const o=new x(r,i);return o.idToken=s.idToken||void 0,o.accessToken=s.accessToken||void 0,o.secret=s.secret,o.nonce=s.nonce,o.pendingToken=s.pendingToken||null,o}_getIdTokenResponse(e){const t=this.buildRequest();return W(e,t)}_linkToIdToken(e,t){const r=this.buildRequest();return r.idToken=t,W(e,r)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,W(e,t)}buildRequest(){const e={requestUri:Gi,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=ne(t)}return e}}/**
856
+ */const Ki="http://localhost";class F extends Ye{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new F(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):m("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const t=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:i}=t,s=ze(t,["providerId","signInMethod"]);if(!r||!i)return null;const o=new F(r,i);return o.idToken=s.idToken||void 0,o.accessToken=s.accessToken||void 0,o.secret=s.secret,o.nonce=s.nonce,o.pendingToken=s.pendingToken||null,o}_getIdTokenResponse(e){const t=this.buildRequest();return W(e,t)}_linkToIdToken(e,t){const r=this.buildRequest();return r.idToken=t,W(e,r)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,W(e,t)}buildRequest(){const e={requestUri:Ki,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=ne(t)}return e}}/**
872
857
  * @license
873
858
  * Copyright 2020 Google LLC
874
859
  *
@@ -883,7 +868,7 @@
883
868
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
884
869
  * See the License for the specific language governing permissions and
885
870
  * limitations under the License.
886
- */function Ki(n){switch(n){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}function qi(n){const e=G(K(n)).link,t=e?G(K(e)).deep_link_id:null,r=G(K(n)).deep_link_id;return(r?G(K(r)).link:null)||r||t||e||n}class we{constructor(e){var t,r,i,s,o,c;const a=G(K(e)),l=(t=a.apiKey)!==null&&t!==void 0?t:null,u=(r=a.oobCode)!==null&&r!==void 0?r:null,f=Ki((i=a.mode)!==null&&i!==void 0?i:null);d(l&&u&&f,"argument-error"),this.apiKey=l,this.operation=f,this.code=u,this.continueUrl=(s=a.continueUrl)!==null&&s!==void 0?s:null,this.languageCode=(o=a.languageCode)!==null&&o!==void 0?o:null,this.tenantId=(c=a.tenantId)!==null&&c!==void 0?c:null}static parseLink(e){const t=qi(e);try{return new we(t)}catch{return null}}}/**
871
+ */function qi(n){switch(n){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}function Ji(n){const e=G(K(n)).link,t=e?G(K(e)).deep_link_id:null,r=G(K(n)).deep_link_id;return(r?G(K(r)).link:null)||r||t||e||n}class we{constructor(e){var t,r,i,s,o,c;const a=G(K(e)),l=(t=a.apiKey)!==null&&t!==void 0?t:null,u=(r=a.oobCode)!==null&&r!==void 0?r:null,f=qi((i=a.mode)!==null&&i!==void 0?i:null);d(l&&u&&f,"argument-error"),this.apiKey=l,this.operation=f,this.code=u,this.continueUrl=(s=a.continueUrl)!==null&&s!==void 0?s:null,this.languageCode=(o=a.languageCode)!==null&&o!==void 0?o:null,this.tenantId=(c=a.tenantId)!==null&&c!==void 0?c:null}static parseLink(e){const t=Ji(e);try{return new we(t)}catch{return null}}}/**
887
872
  * @license
888
873
  * Copyright 2020 Google LLC
889
874
  *
@@ -898,7 +883,7 @@
898
883
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
899
884
  * See the License for the specific language governing permissions and
900
885
  * limitations under the License.
901
- */class B{constructor(){this.providerId=B.PROVIDER_ID}static credential(e,t){return ee._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){const r=we.parseLink(t);return d(r,"argument-error"),ee._fromEmailAndCode(e,r.code,r.tenantId)}}B.PROVIDER_ID="password";B.EMAIL_PASSWORD_SIGN_IN_METHOD="password";B.EMAIL_LINK_SIGN_IN_METHOD="emailLink";/**
886
+ */class x{constructor(){this.providerId=x.PROVIDER_ID}static credential(e,t){return ee._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){const r=we.parseLink(t);return d(r,"argument-error"),ee._fromEmailAndCode(e,r.code,r.tenantId)}}x.PROVIDER_ID="password";x.EMAIL_PASSWORD_SIGN_IN_METHOD="password";x.EMAIL_LINK_SIGN_IN_METHOD="emailLink";/**
902
887
  * @license
903
888
  * Copyright 2020 Google LLC
904
889
  *
@@ -913,7 +898,7 @@
913
898
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
914
899
  * See the License for the specific language governing permissions and
915
900
  * limitations under the License.
916
- */class an{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}/**
901
+ */class cn{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}/**
917
902
  * @license
918
903
  * Copyright 2019 Google LLC
919
904
  *
@@ -928,7 +913,7 @@
928
913
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
929
914
  * See the License for the specific language governing permissions and
930
915
  * limitations under the License.
931
- */class se extends an{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}/**
916
+ */class se extends cn{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}/**
932
917
  * @license
933
918
  * Copyright 2020 Google LLC
934
919
  *
@@ -943,7 +928,7 @@
943
928
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
944
929
  * See the License for the specific language governing permissions and
945
930
  * limitations under the License.
946
- */class A extends se{constructor(){super("facebook.com")}static credential(e){return x._fromParams({providerId:A.PROVIDER_ID,signInMethod:A.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return A.credentialFromTaggedObject(e)}static credentialFromError(e){return A.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return A.credential(e.oauthAccessToken)}catch{return null}}}A.FACEBOOK_SIGN_IN_METHOD="facebook.com";A.PROVIDER_ID="facebook.com";/**
931
+ */class A extends se{constructor(){super("facebook.com")}static credential(e){return F._fromParams({providerId:A.PROVIDER_ID,signInMethod:A.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return A.credentialFromTaggedObject(e)}static credentialFromError(e){return A.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return A.credential(e.oauthAccessToken)}catch{return null}}}A.FACEBOOK_SIGN_IN_METHOD="facebook.com";A.PROVIDER_ID="facebook.com";/**
947
932
  * @license
948
933
  * Copyright 2020 Google LLC
949
934
  *
@@ -958,7 +943,7 @@
958
943
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
959
944
  * See the License for the specific language governing permissions and
960
945
  * limitations under the License.
961
- */class k extends se{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return x._fromParams({providerId:k.PROVIDER_ID,signInMethod:k.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return k.credentialFromTaggedObject(e)}static credentialFromError(e){return k.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:t,oauthAccessToken:r}=e;if(!t&&!r)return null;try{return k.credential(t,r)}catch{return null}}}k.GOOGLE_SIGN_IN_METHOD="google.com";k.PROVIDER_ID="google.com";/**
946
+ */class C extends se{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return F._fromParams({providerId:C.PROVIDER_ID,signInMethod:C.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return C.credentialFromTaggedObject(e)}static credentialFromError(e){return C.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:t,oauthAccessToken:r}=e;if(!t&&!r)return null;try{return C.credential(t,r)}catch{return null}}}C.GOOGLE_SIGN_IN_METHOD="google.com";C.PROVIDER_ID="google.com";/**
962
947
  * @license
963
948
  * Copyright 2020 Google LLC
964
949
  *
@@ -973,7 +958,7 @@
973
958
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
974
959
  * See the License for the specific language governing permissions and
975
960
  * limitations under the License.
976
- */class C extends se{constructor(){super("github.com")}static credential(e){return x._fromParams({providerId:C.PROVIDER_ID,signInMethod:C.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return C.credentialFromTaggedObject(e)}static credentialFromError(e){return C.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return C.credential(e.oauthAccessToken)}catch{return null}}}C.GITHUB_SIGN_IN_METHOD="github.com";C.PROVIDER_ID="github.com";/**
961
+ */class k extends se{constructor(){super("github.com")}static credential(e){return F._fromParams({providerId:k.PROVIDER_ID,signInMethod:k.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return k.credentialFromTaggedObject(e)}static credentialFromError(e){return k.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return k.credential(e.oauthAccessToken)}catch{return null}}}k.GITHUB_SIGN_IN_METHOD="github.com";k.PROVIDER_ID="github.com";/**
977
962
  * @license
978
963
  * Copyright 2020 Google LLC
979
964
  *
@@ -988,7 +973,7 @@
988
973
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
989
974
  * See the License for the specific language governing permissions and
990
975
  * limitations under the License.
991
- */class R extends se{constructor(){super("twitter.com")}static credential(e,t){return x._fromParams({providerId:R.PROVIDER_ID,signInMethod:R.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return R.credentialFromTaggedObject(e)}static credentialFromError(e){return R.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:t,oauthTokenSecret:r}=e;if(!t||!r)return null;try{return R.credential(t,r)}catch{return null}}}R.TWITTER_SIGN_IN_METHOD="twitter.com";R.PROVIDER_ID="twitter.com";/**
976
+ */class R extends se{constructor(){super("twitter.com")}static credential(e,t){return F._fromParams({providerId:R.PROVIDER_ID,signInMethod:R.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return R.credentialFromTaggedObject(e)}static credentialFromError(e){return R.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:t,oauthTokenSecret:r}=e;if(!t||!r)return null;try{return R.credential(t,r)}catch{return null}}}R.TWITTER_SIGN_IN_METHOD="twitter.com";R.PROVIDER_ID="twitter.com";/**
992
977
  * @license
993
978
  * Copyright 2020 Google LLC
994
979
  *
@@ -1003,7 +988,7 @@
1003
988
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1004
989
  * See the License for the specific language governing permissions and
1005
990
  * limitations under the License.
1006
- */class z{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,r,i=!1){const s=await M._fromIdTokenResponse(e,r,i),o=Et(r);return new z({user:s,providerId:o,_tokenResponse:r,operationType:t})}static async _forOperation(e,t,r){await e._updateTokensIfNecessary(r,!0);const i=Et(r);return new z({user:e,providerId:i,_tokenResponse:r,operationType:t})}}function Et(n){return n.providerId?n.providerId:"phoneNumber"in n?"phone":null}/**
991
+ */class z{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,r,i=!1){const s=await M._fromIdTokenResponse(e,r,i),o=wt(r);return new z({user:s,providerId:o,_tokenResponse:r,operationType:t})}static async _forOperation(e,t,r){await e._updateTokensIfNecessary(r,!0);const i=wt(r);return new z({user:e,providerId:i,_tokenResponse:r,operationType:t})}}function wt(n){return n.providerId?n.providerId:"phoneNumber"in n?"phone":null}/**
1007
992
  * @license
1008
993
  * Copyright 2020 Google LLC
1009
994
  *
@@ -1018,7 +1003,7 @@
1018
1003
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1019
1004
  * See the License for the specific language governing permissions and
1020
1005
  * limitations under the License.
1021
- */class _e extends N{constructor(e,t,r,i){var s;super(t.code,t.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,_e.prototype),this.customData={appName:e.name,tenantId:(s=e.tenantId)!==null&&s!==void 0?s:void 0,_serverResponse:t.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,t,r,i){return new _e(e,t,r,i)}}function cn(n,e,t,r){return(e==="reauthenticate"?t._getReauthenticationResolver(n):t._getIdTokenResponse(n)).catch(s=>{throw s.code==="auth/multi-factor-auth-required"?_e._fromErrorAndOperation(n,s,e,r):s})}async function Ji(n,e,t=!1){const r=await Q(n,e._linkToIdToken(n.auth,await n.getIdToken()),t);return z._forOperation(n,"link",r)}/**
1006
+ */class _e extends N{constructor(e,t,r,i){var s;super(t.code,t.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,_e.prototype),this.customData={appName:e.name,tenantId:(s=e.tenantId)!==null&&s!==void 0?s:void 0,_serverResponse:t.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,t,r,i){return new _e(e,t,r,i)}}function ln(n,e,t,r){return(e==="reauthenticate"?t._getReauthenticationResolver(n):t._getIdTokenResponse(n)).catch(s=>{throw s.code==="auth/multi-factor-auth-required"?_e._fromErrorAndOperation(n,s,e,r):s})}async function Yi(n,e,t=!1){const r=await Q(n,e._linkToIdToken(n.auth,await n.getIdToken()),t);return z._forOperation(n,"link",r)}/**
1022
1007
  * @license
1023
1008
  * Copyright 2019 Google LLC
1024
1009
  *
@@ -1033,7 +1018,7 @@
1033
1018
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1034
1019
  * See the License for the specific language governing permissions and
1035
1020
  * limitations under the License.
1036
- */async function Yi(n,e,t=!1){const{auth:r}=n,i="reauthenticate";try{const s=await Q(n,cn(r,i,e,n),t);d(s.idToken,r,"internal-error");const o=qe(s.idToken);d(o,r,"internal-error");const{sub:c}=o;return d(n.uid===c,r,"user-mismatch"),z._forOperation(n,i,s)}catch(s){throw s?.code==="auth/user-not-found"&&m(r,"user-mismatch"),s}}/**
1021
+ */async function Xi(n,e,t=!1){const{auth:r}=n,i="reauthenticate";try{const s=await Q(n,ln(r,i,e,n),t);d(s.idToken,r,"internal-error");const o=qe(s.idToken);d(o,r,"internal-error");const{sub:c}=o;return d(n.uid===c,r,"user-mismatch"),z._forOperation(n,i,s)}catch(s){throw s?.code==="auth/user-not-found"&&m(r,"user-mismatch"),s}}/**
1037
1022
  * @license
1038
1023
  * Copyright 2020 Google LLC
1039
1024
  *
@@ -1048,7 +1033,7 @@
1048
1033
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1049
1034
  * See the License for the specific language governing permissions and
1050
1035
  * limitations under the License.
1051
- */async function ln(n,e,t=!1){const r="signIn",i=await cn(n,r,e),s=await z._fromIdTokenResponse(n,r,i);return t||await n._updateCurrentUser(s.user),s}async function dn(n,e){return ln(F(n),e)}/**
1036
+ */async function dn(n,e,t=!1){const r="signIn",i=await ln(n,r,e),s=await z._fromIdTokenResponse(n,r,i);return t||await n._updateCurrentUser(s.user),s}async function un(n,e){return dn(B(n),e)}/**
1052
1037
  * @license
1053
1038
  * Copyright 2020 Google LLC
1054
1039
  *
@@ -1063,7 +1048,7 @@
1063
1048
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1064
1049
  * See the License for the specific language governing permissions and
1065
1050
  * limitations under the License.
1066
- */function Xi(n,e,t){var r;d(((r=t.url)===null||r===void 0?void 0:r.length)>0,n,"invalid-continue-uri"),d(typeof t.dynamicLinkDomain>"u"||t.dynamicLinkDomain.length>0,n,"invalid-dynamic-link-domain"),e.continueUrl=t.url,e.dynamicLinkDomain=t.dynamicLinkDomain,e.canHandleCodeInApp=t.handleCodeInApp,t.iOS&&(d(t.iOS.bundleId.length>0,n,"missing-ios-bundle-id"),e.iOSBundleId=t.iOS.bundleId),t.android&&(d(t.android.packageName.length>0,n,"missing-android-pkg-name"),e.androidInstallApp=t.android.installApp,e.androidMinimumVersionCode=t.android.minimumVersion,e.androidPackageName=t.android.packageName)}/**
1051
+ */function Qi(n,e,t){var r;d(((r=t.url)===null||r===void 0?void 0:r.length)>0,n,"invalid-continue-uri"),d(typeof t.dynamicLinkDomain>"u"||t.dynamicLinkDomain.length>0,n,"invalid-dynamic-link-domain"),e.continueUrl=t.url,e.dynamicLinkDomain=t.dynamicLinkDomain,e.canHandleCodeInApp=t.handleCodeInApp,t.iOS&&(d(t.iOS.bundleId.length>0,n,"missing-ios-bundle-id"),e.iOSBundleId=t.iOS.bundleId),t.android&&(d(t.android.packageName.length>0,n,"missing-android-pkg-name"),e.androidInstallApp=t.android.installApp,e.androidMinimumVersionCode=t.android.minimumVersion,e.androidPackageName=t.android.packageName)}/**
1067
1052
  * @license
1068
1053
  * Copyright 2020 Google LLC
1069
1054
  *
@@ -1078,7 +1063,7 @@
1078
1063
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1079
1064
  * See the License for the specific language governing permissions and
1080
1065
  * limitations under the License.
1081
- */async function Qi(n){const e=F(n);e._getPasswordPolicyInternal()&&await e._updatePasswordPolicy()}function fo(n,e,t){return dn(b(n),B.credential(e,t)).catch(async r=>{throw r.code==="auth/password-does-not-meet-requirements"&&Qi(n),r})}/**
1066
+ */async function Zi(n){const e=B(n);e._getPasswordPolicyInternal()&&await e._updatePasswordPolicy()}function po(n,e,t){return un(b(n),x.credential(e,t)).catch(async r=>{throw r.code==="auth/password-does-not-meet-requirements"&&Zi(n),r})}/**
1082
1067
  * @license
1083
1068
  * Copyright 2020 Google LLC
1084
1069
  *
@@ -1093,7 +1078,7 @@
1093
1078
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1094
1079
  * See the License for the specific language governing permissions and
1095
1080
  * limitations under the License.
1096
- */async function po(n,e,t){const r=F(n),i={requestType:"EMAIL_SIGNIN",email:e,clientType:"CLIENT_TYPE_WEB"};function s(o,c){d(c.handleCodeInApp,r,"argument-error"),c&&Xi(r,o,c)}s(i,t),await Ve(r,i,"getOobCode",Wi)}function go(n,e){const t=we.parseLink(e);return t?.operation==="EMAIL_SIGNIN"}async function mo(n,e,t){const r=b(n),i=B.credentialWithLink(e,t||ge());return d(i._tenantId===(r.tenantId||null),r,"tenant-id-mismatch"),dn(r,i)}function Zi(n,e,t,r){return b(n).onIdTokenChanged(e,t,r)}function es(n,e,t){return b(n).beforeAuthStateChanged(e,t)}function _o(n,e,t,r){return b(n).onAuthStateChanged(e,t,r)}const Ie="__sak";/**
1081
+ */async function go(n,e,t){const r=B(n),i={requestType:"EMAIL_SIGNIN",email:e,clientType:"CLIENT_TYPE_WEB"};function s(o,c){d(c.handleCodeInApp,r,"argument-error"),c&&Qi(r,o,c)}s(i,t),await He(r,i,"getOobCode",ji)}function mo(n,e){const t=we.parseLink(e);return t?.operation==="EMAIL_SIGNIN"}async function _o(n,e,t){const r=b(n),i=x.credentialWithLink(e,t||ge());return d(i._tenantId===(r.tenantId||null),r,"tenant-id-mismatch"),un(r,i)}function es(n,e,t,r){return b(n).onIdTokenChanged(e,t,r)}function ts(n,e,t){return b(n).beforeAuthStateChanged(e,t)}function vo(n,e,t,r){return b(n).onAuthStateChanged(e,t,r)}const ve="__sak";/**
1097
1082
  * @license
1098
1083
  * Copyright 2019 Google LLC
1099
1084
  *
@@ -1108,7 +1093,7 @@
1108
1093
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1109
1094
  * See the License for the specific language governing permissions and
1110
1095
  * limitations under the License.
1111
- */class un{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(Ie,"1"),this.storage.removeItem(Ie),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){const t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}/**
1096
+ */class hn{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(ve,"1"),this.storage.removeItem(ve),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){const t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}/**
1112
1097
  * @license
1113
1098
  * Copyright 2020 Google LLC
1114
1099
  *
@@ -1123,7 +1108,7 @@
1123
1108
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1124
1109
  * See the License for the specific language governing permissions and
1125
1110
  * limitations under the License.
1126
- */function ts(){const n=p();return Je(n)||Ee(n)}const ns=1e3,rs=10;class hn extends un{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=ts()&&bi(),this.fallbackToPolling=nn(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const t of Object.keys(this.listeners)){const r=this.storage.getItem(t),i=this.localCache[t];r!==i&&e(t,i,r)}}onStorageEvent(e,t=!1){if(!e.key){this.forAllChangedKeys((o,c,a)=>{this.notifyListeners(o,a)});return}const r=e.key;if(t?this.detachListener():this.stopPolling(),this.safariLocalStorageNotSynced){const o=this.storage.getItem(r);if(e.newValue!==o)e.newValue!==null?this.storage.setItem(r,e.newValue):this.storage.removeItem(r);else if(this.localCache[r]===e.newValue&&!t)return}const i=()=>{const o=this.storage.getItem(r);!t&&this.localCache[r]===o||this.notifyListeners(r,o)},s=this.storage.getItem(r);wi()&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(i,rs):i()}notifyListeners(e,t){this.localCache[e]=t;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(t&&JSON.parse(t))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:r}),!0)})},ns)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){const t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}hn.type="LOCAL";const is=hn;/**
1111
+ */function ns(){const n=p();return Je(n)||Ee(n)}const rs=1e3,is=10;class fn extends hn{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=ns()&&Ti(),this.fallbackToPolling=rn(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const t of Object.keys(this.listeners)){const r=this.storage.getItem(t),i=this.localCache[t];r!==i&&e(t,i,r)}}onStorageEvent(e,t=!1){if(!e.key){this.forAllChangedKeys((o,c,a)=>{this.notifyListeners(o,a)});return}const r=e.key;if(t?this.detachListener():this.stopPolling(),this.safariLocalStorageNotSynced){const o=this.storage.getItem(r);if(e.newValue!==o)e.newValue!==null?this.storage.setItem(r,e.newValue):this.storage.removeItem(r);else if(this.localCache[r]===e.newValue&&!t)return}const i=()=>{const o=this.storage.getItem(r);!t&&this.localCache[r]===o||this.notifyListeners(r,o)},s=this.storage.getItem(r);bi()&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(i,is):i()}notifyListeners(e,t){this.localCache[e]=t;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(t&&JSON.parse(t))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:r}),!0)})},rs)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){const t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}fn.type="LOCAL";const ss=fn;/**
1127
1112
  * @license
1128
1113
  * Copyright 2020 Google LLC
1129
1114
  *
@@ -1138,7 +1123,7 @@
1138
1123
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1139
1124
  * See the License for the specific language governing permissions and
1140
1125
  * limitations under the License.
1141
- */class fn extends un{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}fn.type="SESSION";const pn=fn;/**
1126
+ */class pn extends hn{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}pn.type="SESSION";const gn=pn;/**
1142
1127
  * @license
1143
1128
  * Copyright 2019 Google LLC
1144
1129
  *
@@ -1153,7 +1138,7 @@
1153
1138
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1154
1139
  * See the License for the specific language governing permissions and
1155
1140
  * limitations under the License.
1156
- */function ss(n){return Promise.all(n.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(t){return{fulfilled:!1,reason:t}}}))}/**
1141
+ */function os(n){return Promise.all(n.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(t){return{fulfilled:!1,reason:t}}}))}/**
1157
1142
  * @license
1158
1143
  * Copyright 2019 Google LLC
1159
1144
  *
@@ -1168,7 +1153,7 @@
1168
1153
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1169
1154
  * See the License for the specific language governing permissions and
1170
1155
  * limitations under the License.
1171
- */class be{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const t=this.receivers.find(i=>i.isListeningto(e));if(t)return t;const r=new be(e);return this.receivers.push(r),r}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const t=e,{eventId:r,eventType:i,data:s}=t.data,o=this.handlersMap[i];if(!o?.size)return;t.ports[0].postMessage({status:"ack",eventId:r,eventType:i});const c=Array.from(o).map(async l=>l(t.origin,s)),a=await ss(c);t.ports[0].postMessage({status:"done",eventId:r,eventType:i,response:a})}_subscribe(e,t){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),(!t||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}be.receivers=[];/**
1156
+ */class be{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const t=this.receivers.find(i=>i.isListeningto(e));if(t)return t;const r=new be(e);return this.receivers.push(r),r}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const t=e,{eventId:r,eventType:i,data:s}=t.data,o=this.handlersMap[i];if(!o?.size)return;t.ports[0].postMessage({status:"ack",eventId:r,eventType:i});const c=Array.from(o).map(async l=>l(t.origin,s)),a=await os(c);t.ports[0].postMessage({status:"done",eventId:r,eventType:i,response:a})}_subscribe(e,t){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),(!t||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}be.receivers=[];/**
1172
1157
  * @license
1173
1158
  * Copyright 2020 Google LLC
1174
1159
  *
@@ -1198,7 +1183,7 @@
1198
1183
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1199
1184
  * See the License for the specific language governing permissions and
1200
1185
  * limitations under the License.
1201
- */class os{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,t,r=50){const i=typeof MessageChannel<"u"?new MessageChannel:null;if(!i)throw new Error("connection_unavailable");let s,o;return new Promise((c,a)=>{const l=Xe("",20);i.port1.start();const u=setTimeout(()=>{a(new Error("unsupported_event"))},r);o={messageChannel:i,onMessage(f){const g=f;if(g.data.eventId===l)switch(g.data.status){case"ack":clearTimeout(u),s=setTimeout(()=>{a(new Error("timeout"))},3e3);break;case"done":clearTimeout(s),c(g.data.response);break;default:clearTimeout(u),clearTimeout(s),a(new Error("invalid_response"));break}}},this.handlers.add(o),i.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:e,eventId:l,data:t},[i.port2])}).finally(()=>{o&&this.removeMessageHandler(o)})}}/**
1186
+ */class as{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,t,r=50){const i=typeof MessageChannel<"u"?new MessageChannel:null;if(!i)throw new Error("connection_unavailable");let s,o;return new Promise((c,a)=>{const l=Xe("",20);i.port1.start();const u=setTimeout(()=>{a(new Error("unsupported_event"))},r);o={messageChannel:i,onMessage(f){const g=f;if(g.data.eventId===l)switch(g.data.status){case"ack":clearTimeout(u),s=setTimeout(()=>{a(new Error("timeout"))},3e3);break;case"done":clearTimeout(s),c(g.data.response);break;default:clearTimeout(u),clearTimeout(s),a(new Error("invalid_response"));break}}},this.handlers.add(o),i.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:e,eventId:l,data:t},[i.port2])}).finally(()=>{o&&this.removeMessageHandler(o)})}}/**
1202
1187
  * @license
1203
1188
  * Copyright 2020 Google LLC
1204
1189
  *
@@ -1213,7 +1198,7 @@
1213
1198
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1214
1199
  * See the License for the specific language governing permissions and
1215
1200
  * limitations under the License.
1216
- */function I(){return window}function as(n){I().location.href=n}/**
1201
+ */function v(){return window}function cs(n){v().location.href=n}/**
1217
1202
  * @license
1218
1203
  * Copyright 2020 Google LLC.
1219
1204
  *
@@ -1228,7 +1213,7 @@
1228
1213
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1229
1214
  * See the License for the specific language governing permissions and
1230
1215
  * limitations under the License.
1231
- */function gn(){return typeof I().WorkerGlobalScope<"u"&&typeof I().importScripts=="function"}async function cs(){if(!navigator?.serviceWorker)return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function ls(){var n;return((n=navigator?.serviceWorker)===null||n===void 0?void 0:n.controller)||null}function ds(){return gn()?self:null}/**
1216
+ */function mn(){return typeof v().WorkerGlobalScope<"u"&&typeof v().importScripts=="function"}async function ls(){if(!navigator?.serviceWorker)return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function ds(){var n;return((n=navigator?.serviceWorker)===null||n===void 0?void 0:n.controller)||null}function us(){return mn()?self:null}/**
1232
1217
  * @license
1233
1218
  * Copyright 2019 Google LLC
1234
1219
  *
@@ -1243,7 +1228,7 @@
1243
1228
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1244
1229
  * See the License for the specific language governing permissions and
1245
1230
  * limitations under the License.
1246
- */const mn="firebaseLocalStorageDb",us=1,ve="firebaseLocalStorage",_n="fbase_key";class oe{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{t(this.request.error)})})}}function Te(n,e){return n.transaction([ve],e?"readwrite":"readonly").objectStore(ve)}function hs(){const n=indexedDB.deleteDatabase(mn);return new oe(n).toPromise()}function $e(){const n=indexedDB.open(mn,us);return new Promise((e,t)=>{n.addEventListener("error",()=>{t(n.error)}),n.addEventListener("upgradeneeded",()=>{const r=n.result;try{r.createObjectStore(ve,{keyPath:_n})}catch(i){t(i)}}),n.addEventListener("success",async()=>{const r=n.result;r.objectStoreNames.contains(ve)?e(r):(r.close(),await hs(),e(await $e()))})})}async function wt(n,e,t){const r=Te(n,!0).put({[_n]:e,value:t});return new oe(r).toPromise()}async function fs(n,e){const t=Te(n,!1).get(e),r=await new oe(t).toPromise();return r===void 0?null:r.value}function bt(n,e){const t=Te(n,!0).delete(e);return new oe(t).toPromise()}const ps=800,gs=3;class In{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await $e(),this.db)}async _withRetries(e){let t=0;for(;;)try{const r=await this._openDb();return await e(r)}catch(r){if(t++>gs)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return gn()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=be._getInstance(ds()),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){var e,t;if(this.activeServiceWorker=await cs(),!this.activeServiceWorker)return;this.sender=new os(this.activeServiceWorker);const r=await this.sender._send("ping",{},800);r&&!((e=r[0])===null||e===void 0)&&e.fulfilled&&!((t=r[0])===null||t===void 0)&&t.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||ls()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await $e();return await wt(e,Ie,"1"),await bt(e,Ie),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(r=>wt(r,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){const t=await this._withRetries(r=>fs(r,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>bt(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(i=>{const s=Te(i,!1).getAll();return new oe(s).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const t=[],r=new Set;for(const{fbase_key:i,value:s}of e)r.add(i),JSON.stringify(this.localCache[i])!==JSON.stringify(s)&&(this.notifyListeners(i,s),t.push(i));for(const i of Object.keys(this.localCache))this.localCache[i]&&!r.has(i)&&(this.notifyListeners(i,null),t.push(i));return t}notifyListeners(e,t){this.localCache[e]=t;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),ps)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&this.stopPolling()}}In.type="LOCAL";const ms=In;new ie(3e4,6e4);/**
1231
+ */const _n="firebaseLocalStorageDb",hs=1,Ie="firebaseLocalStorage",vn="fbase_key";class oe{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{t(this.request.error)})})}}function Te(n,e){return n.transaction([Ie],e?"readwrite":"readonly").objectStore(Ie)}function fs(){const n=indexedDB.deleteDatabase(_n);return new oe(n).toPromise()}function $e(){const n=indexedDB.open(_n,hs);return new Promise((e,t)=>{n.addEventListener("error",()=>{t(n.error)}),n.addEventListener("upgradeneeded",()=>{const r=n.result;try{r.createObjectStore(Ie,{keyPath:vn})}catch(i){t(i)}}),n.addEventListener("success",async()=>{const r=n.result;r.objectStoreNames.contains(Ie)?e(r):(r.close(),await fs(),e(await $e()))})})}async function bt(n,e,t){const r=Te(n,!0).put({[vn]:e,value:t});return new oe(r).toPromise()}async function ps(n,e){const t=Te(n,!1).get(e),r=await new oe(t).toPromise();return r===void 0?null:r.value}function Tt(n,e){const t=Te(n,!0).delete(e);return new oe(t).toPromise()}const gs=800,ms=3;class In{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await $e(),this.db)}async _withRetries(e){let t=0;for(;;)try{const r=await this._openDb();return await e(r)}catch(r){if(t++>ms)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return mn()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=be._getInstance(us()),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){var e,t;if(this.activeServiceWorker=await ls(),!this.activeServiceWorker)return;this.sender=new as(this.activeServiceWorker);const r=await this.sender._send("ping",{},800);r&&!((e=r[0])===null||e===void 0)&&e.fulfilled&&!((t=r[0])===null||t===void 0)&&t.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||ds()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await $e();return await bt(e,ve,"1"),await Tt(e,ve),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(r=>bt(r,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){const t=await this._withRetries(r=>ps(r,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>Tt(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(i=>{const s=Te(i,!1).getAll();return new oe(s).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const t=[],r=new Set;if(e.length!==0)for(const{fbase_key:i,value:s}of e)r.add(i),JSON.stringify(this.localCache[i])!==JSON.stringify(s)&&(this.notifyListeners(i,s),t.push(i));for(const i of Object.keys(this.localCache))this.localCache[i]&&!r.has(i)&&(this.notifyListeners(i,null),t.push(i));return t}notifyListeners(e,t){this.localCache[e]=t;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),gs)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&this.stopPolling()}}In.type="LOCAL";const _s=In;new ie(3e4,6e4);/**
1247
1232
  * @license
1248
1233
  * Copyright 2021 Google LLC
1249
1234
  *
@@ -1258,7 +1243,7 @@
1258
1243
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1259
1244
  * See the License for the specific language governing permissions and
1260
1245
  * limitations under the License.
1261
- */function _s(n,e){return e?E(e):(d(n._popupRedirectResolver,n,"argument-error"),n._popupRedirectResolver)}/**
1246
+ */function vs(n,e){return e?E(e):(d(n._popupRedirectResolver,n,"argument-error"),n._popupRedirectResolver)}/**
1262
1247
  * @license
1263
1248
  * Copyright 2019 Google LLC
1264
1249
  *
@@ -1273,7 +1258,7 @@
1273
1258
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1274
1259
  * See the License for the specific language governing permissions and
1275
1260
  * limitations under the License.
1276
- */class Qe extends Ye{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return W(e,this._buildIdpRequest())}_linkToIdToken(e,t){return W(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return W(e,this._buildIdpRequest())}_buildIdpRequest(e){const t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}function Is(n){return ln(n.auth,new Qe(n),n.bypassAuthState)}function vs(n){const{auth:e,user:t}=n;return d(t,e,"internal-error"),Yi(t,new Qe(n),n.bypassAuthState)}async function ys(n){const{auth:e,user:t}=n;return d(t,e,"internal-error"),Ji(t,new Qe(n),n.bypassAuthState)}/**
1261
+ */class Qe extends Ye{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return W(e,this._buildIdpRequest())}_linkToIdToken(e,t){return W(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return W(e,this._buildIdpRequest())}_buildIdpRequest(e){const t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}function Is(n){return dn(n.auth,new Qe(n),n.bypassAuthState)}function ys(n){const{auth:e,user:t}=n;return d(t,e,"internal-error"),Xi(t,new Qe(n),n.bypassAuthState)}async function Es(n){const{auth:e,user:t}=n;return d(t,e,"internal-error"),Yi(t,new Qe(n),n.bypassAuthState)}/**
1277
1262
  * @license
1278
1263
  * Copyright 2020 Google LLC
1279
1264
  *
@@ -1288,7 +1273,7 @@
1288
1273
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1289
1274
  * See the License for the specific language governing permissions and
1290
1275
  * limitations under the License.
1291
- */class vn{constructor(e,t,r,i,s=!1){this.auth=e,this.resolver=r,this.user=i,this.bypassAuthState=s,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise(async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}})}async onAuthEvent(e){const{urlResponse:t,sessionId:r,postBody:i,tenantId:s,error:o,type:c}=e;if(o){this.reject(o);return}const a={auth:this.auth,requestUri:t,sessionId:r,tenantId:s||void 0,postBody:i||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(c)(a))}catch(l){this.reject(l)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return Is;case"linkViaPopup":case"linkViaRedirect":return ys;case"reauthViaPopup":case"reauthViaRedirect":return vs;default:m(this.auth,"internal-error")}}resolve(e){w(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){w(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/**
1276
+ */class yn{constructor(e,t,r,i,s=!1){this.auth=e,this.resolver=r,this.user=i,this.bypassAuthState=s,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise(async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}})}async onAuthEvent(e){const{urlResponse:t,sessionId:r,postBody:i,tenantId:s,error:o,type:c}=e;if(o){this.reject(o);return}const a={auth:this.auth,requestUri:t,sessionId:r,tenantId:s||void 0,postBody:i||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(c)(a))}catch(l){this.reject(l)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return Is;case"linkViaPopup":case"linkViaRedirect":return Es;case"reauthViaPopup":case"reauthViaRedirect":return ys;default:m(this.auth,"internal-error")}}resolve(e){w(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){w(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/**
1292
1277
  * @license
1293
1278
  * Copyright 2020 Google LLC
1294
1279
  *
@@ -1303,7 +1288,7 @@
1303
1288
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1304
1289
  * See the License for the specific language governing permissions and
1305
1290
  * limitations under the License.
1306
- */const Es=new ie(2e3,1e4);class V extends vn{constructor(e,t,r,i,s){super(e,t,i,s),this.provider=r,this.authWindow=null,this.pollId=null,V.currentPopupAction&&V.currentPopupAction.cancel(),V.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return d(e,this.auth,"internal-error"),e}async onExecution(){w(this.filter.length===1,"Popup operations only handle one event");const e=Xe();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(t=>{this.reject(t)}),this.resolver._isIframeWebStorageSupported(this.auth,t=>{t||this.reject(_(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return((e=this.authWindow)===null||e===void 0?void 0:e.associatedEvent)||null}cancel(){this.reject(_(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,V.currentPopupAction=null}pollUserCancellation(){const e=()=>{var t,r;if(!((r=(t=this.authWindow)===null||t===void 0?void 0:t.window)===null||r===void 0)&&r.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(_(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,Es.get())};e()}}V.currentPopupAction=null;/**
1291
+ */const ws=new ie(2e3,1e4);class H extends yn{constructor(e,t,r,i,s){super(e,t,i,s),this.provider=r,this.authWindow=null,this.pollId=null,H.currentPopupAction&&H.currentPopupAction.cancel(),H.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return d(e,this.auth,"internal-error"),e}async onExecution(){w(this.filter.length===1,"Popup operations only handle one event");const e=Xe();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(t=>{this.reject(t)}),this.resolver._isIframeWebStorageSupported(this.auth,t=>{t||this.reject(_(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return((e=this.authWindow)===null||e===void 0?void 0:e.associatedEvent)||null}cancel(){this.reject(_(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,H.currentPopupAction=null}pollUserCancellation(){const e=()=>{var t,r;if(!((r=(t=this.authWindow)===null||t===void 0?void 0:t.window)===null||r===void 0)&&r.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(_(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,ws.get())};e()}}H.currentPopupAction=null;/**
1307
1292
  * @license
1308
1293
  * Copyright 2020 Google LLC
1309
1294
  *
@@ -1318,7 +1303,7 @@
1318
1303
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1319
1304
  * See the License for the specific language governing permissions and
1320
1305
  * limitations under the License.
1321
- */const ws="pendingRedirect",de=new Map;class bs extends vn{constructor(e,t,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,r),this.eventId=null}async execute(){let e=de.get(this.auth._key());if(!e){try{const r=await Ts(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(r)}catch(t){e=()=>Promise.reject(t)}de.set(this.auth._key(),e)}return this.bypassAuthState||de.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if(e.type==="signInViaRedirect")return super.onAuthEvent(e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){const t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function Ts(n,e){const t=ks(e),r=As(n);if(!await r._isAvailable())return!1;const i=await r._get(t)==="true";return await r._remove(t),i}function Ss(n,e){de.set(n._key(),e)}function As(n){return E(n._redirectPersistence)}function ks(n){return le(ws,n.config.apiKey,n.name)}async function Cs(n,e,t=!1){const r=F(n),i=_s(r,e),o=await new bs(r,i,t).execute();return o&&!t&&(delete o.user._redirectEventId,await r._persistUserIfCurrent(o.user),await r._setRedirectUser(null,e)),o}/**
1306
+ */const bs="pendingRedirect",de=new Map;class Ts extends yn{constructor(e,t,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,r),this.eventId=null}async execute(){let e=de.get(this.auth._key());if(!e){try{const r=await Ss(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(r)}catch(t){e=()=>Promise.reject(t)}de.set(this.auth._key(),e)}return this.bypassAuthState||de.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if(e.type==="signInViaRedirect")return super.onAuthEvent(e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){const t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function Ss(n,e){const t=ks(e),r=Cs(n);if(!await r._isAvailable())return!1;const i=await r._get(t)==="true";return await r._remove(t),i}function As(n,e){de.set(n._key(),e)}function Cs(n){return E(n._redirectPersistence)}function ks(n){return le(bs,n.config.apiKey,n.name)}async function Rs(n,e,t=!1){const r=B(n),i=vs(r,e),o=await new Ts(r,i,t).execute();return o&&!t&&(delete o.user._redirectEventId,await r._persistUserIfCurrent(o.user),await r._setRedirectUser(null,e)),o}/**
1322
1307
  * @license
1323
1308
  * Copyright 2020 Google LLC
1324
1309
  *
@@ -1333,7 +1318,7 @@
1333
1318
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1334
1319
  * See the License for the specific language governing permissions and
1335
1320
  * limitations under the License.
1336
- */const Rs=10*60*1e3;class Ps{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(e,r)&&(t=!0,this.sendToConsumer(e,r),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!Os(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var r;if(e.error&&!yn(e)){const i=((r=e.error.code)===null||r===void 0?void 0:r.split("auth/")[1])||"internal-error";t.onError(_(this.auth,i))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const r=t.eventId===null||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=Rs&&this.cachedEventUids.clear(),this.cachedEventUids.has(Tt(e))}saveEventToCache(e){this.cachedEventUids.add(Tt(e)),this.lastProcessedEventTime=Date.now()}}function Tt(n){return[n.type,n.eventId,n.sessionId,n.tenantId].filter(e=>e).join("-")}function yn({type:n,error:e}){return n==="unknown"&&e?.code==="auth/no-auth-event"}function Os(n){switch(n.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return yn(n);default:return!1}}/**
1321
+ */const Ps=10*60*1e3;class Os{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(e,r)&&(t=!0,this.sendToConsumer(e,r),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!Ns(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var r;if(e.error&&!En(e)){const i=((r=e.error.code)===null||r===void 0?void 0:r.split("auth/")[1])||"internal-error";t.onError(_(this.auth,i))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const r=t.eventId===null||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=Ps&&this.cachedEventUids.clear(),this.cachedEventUids.has(St(e))}saveEventToCache(e){this.cachedEventUids.add(St(e)),this.lastProcessedEventTime=Date.now()}}function St(n){return[n.type,n.eventId,n.sessionId,n.tenantId].filter(e=>e).join("-")}function En({type:n,error:e}){return n==="unknown"&&e?.code==="auth/no-auth-event"}function Ns(n){switch(n.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return En(n);default:return!1}}/**
1337
1322
  * @license
1338
1323
  * Copyright 2020 Google LLC
1339
1324
  *
@@ -1348,7 +1333,7 @@
1348
1333
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1349
1334
  * See the License for the specific language governing permissions and
1350
1335
  * limitations under the License.
1351
- */async function Ns(n,e={}){return T(n,"GET","/v1/projects",e)}/**
1336
+ */async function Ds(n,e={}){return T(n,"GET","/v1/projects",e)}/**
1352
1337
  * @license
1353
1338
  * Copyright 2020 Google LLC
1354
1339
  *
@@ -1363,7 +1348,7 @@
1363
1348
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1364
1349
  * See the License for the specific language governing permissions and
1365
1350
  * limitations under the License.
1366
- */const Ds=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Ls=/^https?/;async function Ms(n){if(n.config.emulator)return;const{authorizedDomains:e}=await Ns(n);for(const t of e)try{if(Us(t))return}catch{}m(n,"unauthorized-domain")}function Us(n){const e=ge(),{protocol:t,hostname:r}=new URL(e);if(n.startsWith("chrome-extension://")){const o=new URL(n);return o.hostname===""&&r===""?t==="chrome-extension:"&&n.replace("chrome-extension://","")===e.replace("chrome-extension://",""):t==="chrome-extension:"&&o.hostname===r}if(!Ls.test(t))return!1;if(Ds.test(n))return r===n;const i=n.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}/**
1351
+ */const Ls=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Ms=/^https?/;async function Us(n){if(n.config.emulator)return;const{authorizedDomains:e}=await Ds(n);for(const t of e)try{if(Fs(t))return}catch{}m(n,"unauthorized-domain")}function Fs(n){const e=ge(),{protocol:t,hostname:r}=new URL(e);if(n.startsWith("chrome-extension://")){const o=new URL(n);return o.hostname===""&&r===""?t==="chrome-extension:"&&n.replace("chrome-extension://","")===e.replace("chrome-extension://",""):t==="chrome-extension:"&&o.hostname===r}if(!Ms.test(t))return!1;if(Ls.test(n))return r===n;const i=n.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}/**
1367
1352
  * @license
1368
1353
  * Copyright 2020 Google LLC.
1369
1354
  *
@@ -1378,7 +1363,7 @@
1378
1363
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1379
1364
  * See the License for the specific language governing permissions and
1380
1365
  * limitations under the License.
1381
- */const xs=new ie(3e4,6e4);function St(){const n=I().___jsl;if(n?.H){for(const e of Object.keys(n.H))if(n.H[e].r=n.H[e].r||[],n.H[e].L=n.H[e].L||[],n.H[e].r=[...n.H[e].L],n.CP)for(let t=0;t<n.CP.length;t++)n.CP[t]=null}}function Fs(n){return new Promise((e,t)=>{var r,i,s;function o(){St(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{St(),t(_(n,"network-request-failed"))},timeout:xs.get()})}if(!((i=(r=I().gapi)===null||r===void 0?void 0:r.iframes)===null||i===void 0)&&i.Iframe)e(gapi.iframes.getContext());else if(!((s=I().gapi)===null||s===void 0)&&s.load)o();else{const c=Pi("iframefcb");return I()[c]=()=>{gapi.load?o():t(_(n,"network-request-failed"))},sn(`https://apis.google.com/js/api.js?onload=${c}`).catch(a=>t(a))}}).catch(e=>{throw ue=null,e})}let ue=null;function Bs(n){return ue=ue||Fs(n),ue}/**
1366
+ */const Bs=new ie(3e4,6e4);function At(){const n=v().___jsl;if(n?.H){for(const e of Object.keys(n.H))if(n.H[e].r=n.H[e].r||[],n.H[e].L=n.H[e].L||[],n.H[e].r=[...n.H[e].L],n.CP)for(let t=0;t<n.CP.length;t++)n.CP[t]=null}}function xs(n){return new Promise((e,t)=>{var r,i,s;function o(){At(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{At(),t(_(n,"network-request-failed"))},timeout:Bs.get()})}if(!((i=(r=v().gapi)===null||r===void 0?void 0:r.iframes)===null||i===void 0)&&i.Iframe)e(gapi.iframes.getContext());else if(!((s=v().gapi)===null||s===void 0)&&s.load)o();else{const c=Oi("iframefcb");return v()[c]=()=>{gapi.load?o():t(_(n,"network-request-failed"))},on(`https://apis.google.com/js/api.js?onload=${c}`).catch(a=>t(a))}}).catch(e=>{throw ue=null,e})}let ue=null;function Vs(n){return ue=ue||xs(n),ue}/**
1382
1367
  * @license
1383
1368
  * Copyright 2020 Google LLC.
1384
1369
  *
@@ -1393,7 +1378,7 @@
1393
1378
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1394
1379
  * See the License for the specific language governing permissions and
1395
1380
  * limitations under the License.
1396
- */const Hs=new ie(5e3,15e3),Vs="__/auth/iframe",$s="emulator/auth/iframe",Ws={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},js=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function zs(n){const e=n.config;d(e.authDomain,n,"auth-domain-config-required");const t=e.emulator?Ke(e,$s):`https://${n.config.authDomain}/${Vs}`,r={apiKey:e.apiKey,appName:n.name,v:re},i=js.get(n.config.apiHost);i&&(r.eid=i);const s=n._getFrameworks();return s.length&&(r.fw=s.join(",")),`${t}?${ne(r).slice(1)}`}async function Gs(n){const e=await Bs(n),t=I().gapi;return d(t,n,"internal-error"),e.open({where:document.body,url:zs(n),messageHandlersFilter:t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:Ws,dontclear:!0},r=>new Promise(async(i,s)=>{await r.restyle({setHideOnLeave:!1});const o=_(n,"network-request-failed"),c=I().setTimeout(()=>{s(o)},Hs.get());function a(){I().clearTimeout(c),i(r)}r.ping(a).then(a,()=>{s(o)})}))}/**
1381
+ */const Hs=new ie(5e3,15e3),$s="__/auth/iframe",Ws="emulator/auth/iframe",js={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},zs=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function Gs(n){const e=n.config;d(e.authDomain,n,"auth-domain-config-required");const t=e.emulator?Ke(e,Ws):`https://${n.config.authDomain}/${$s}`,r={apiKey:e.apiKey,appName:n.name,v:re},i=zs.get(n.config.apiHost);i&&(r.eid=i);const s=n._getFrameworks();return s.length&&(r.fw=s.join(",")),`${t}?${ne(r).slice(1)}`}async function Ks(n){const e=await Vs(n),t=v().gapi;return d(t,n,"internal-error"),e.open({where:document.body,url:Gs(n),messageHandlersFilter:t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:js,dontclear:!0},r=>new Promise(async(i,s)=>{await r.restyle({setHideOnLeave:!1});const o=_(n,"network-request-failed"),c=v().setTimeout(()=>{s(o)},Hs.get());function a(){v().clearTimeout(c),i(r)}r.ping(a).then(a,()=>{s(o)})}))}/**
1397
1382
  * @license
1398
1383
  * Copyright 2020 Google LLC.
1399
1384
  *
@@ -1408,7 +1393,7 @@
1408
1393
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1409
1394
  * See the License for the specific language governing permissions and
1410
1395
  * limitations under the License.
1411
- */const Ks={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},qs=500,Js=600,Ys="_blank",Xs="http://localhost";class At{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function Qs(n,e,t,r=qs,i=Js){const s=Math.max((window.screen.availHeight-i)/2,0).toString(),o=Math.max((window.screen.availWidth-r)/2,0).toString();let c="";const a=Object.assign(Object.assign({},Ks),{width:r.toString(),height:i.toString(),top:s,left:o}),l=p().toLowerCase();t&&(c=Xt(l)?Ys:t),Yt(l)&&(e=e||Xs,a.scrollbars="yes");const u=Object.entries(a).reduce((g,[v,H])=>`${g}${v}=${H},`,"");if(Ei(l)&&c!=="_self")return Zs(e||"",c),new At(null);const f=window.open(e||"",c,u);d(f,n,"popup-blocked");try{f.focus()}catch{}return new At(f)}function Zs(n,e){const t=document.createElement("a");t.href=n,t.target=e;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),t.dispatchEvent(r)}/**
1396
+ */const qs={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},Js=500,Ys=600,Xs="_blank",Qs="http://localhost";class Ct{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function Zs(n,e,t,r=Js,i=Ys){const s=Math.max((window.screen.availHeight-i)/2,0).toString(),o=Math.max((window.screen.availWidth-r)/2,0).toString();let c="";const a=Object.assign(Object.assign({},qs),{width:r.toString(),height:i.toString(),top:s,left:o}),l=p().toLowerCase();t&&(c=Qt(l)?Xs:t),Xt(l)&&(e=e||Qs,a.scrollbars="yes");const u=Object.entries(a).reduce((g,[I,V])=>`${g}${I}=${V},`,"");if(wi(l)&&c!=="_self")return eo(e||"",c),new Ct(null);const f=window.open(e||"",c,u);d(f,n,"popup-blocked");try{f.focus()}catch{}return new Ct(f)}function eo(n,e){const t=document.createElement("a");t.href=n,t.target=e;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),t.dispatchEvent(r)}/**
1412
1397
  * @license
1413
1398
  * Copyright 2021 Google LLC
1414
1399
  *
@@ -1423,7 +1408,7 @@
1423
1408
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1424
1409
  * See the License for the specific language governing permissions and
1425
1410
  * limitations under the License.
1426
- */const eo="__/auth/handler",to="emulator/auth/handler",no=encodeURIComponent("fac");async function kt(n,e,t,r,i,s){d(n.config.authDomain,n,"auth-domain-config-required"),d(n.config.apiKey,n,"invalid-api-key");const o={apiKey:n.config.apiKey,appName:n.name,authType:t,redirectUrl:r,v:re,eventId:i};if(e instanceof an){e.setDefaultLanguage(n.languageCode),o.providerId=e.providerId||"",Vn(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(const[u,f]of Object.entries(s||{}))o[u]=f}if(e instanceof se){const u=e.getScopes().filter(f=>f!=="");u.length>0&&(o.scopes=u.join(","))}n.tenantId&&(o.tid=n.tenantId);const c=o;for(const u of Object.keys(c))c[u]===void 0&&delete c[u];const a=await n._getAppCheckToken(),l=a?`#${no}=${encodeURIComponent(a)}`:"";return`${ro(n)}?${ne(c).slice(1)}${l}`}function ro({config:n}){return n.emulator?Ke(n,to):`https://${n.authDomain}/${eo}`}/**
1411
+ */const to="__/auth/handler",no="emulator/auth/handler",ro=encodeURIComponent("fac");async function kt(n,e,t,r,i,s){d(n.config.authDomain,n,"auth-domain-config-required"),d(n.config.apiKey,n,"invalid-api-key");const o={apiKey:n.config.apiKey,appName:n.name,authType:t,redirectUrl:r,v:re,eventId:i};if(e instanceof cn){e.setDefaultLanguage(n.languageCode),o.providerId=e.providerId||"",$n(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(const[u,f]of Object.entries(s||{}))o[u]=f}if(e instanceof se){const u=e.getScopes().filter(f=>f!=="");u.length>0&&(o.scopes=u.join(","))}n.tenantId&&(o.tid=n.tenantId);const c=o;for(const u of Object.keys(c))c[u]===void 0&&delete c[u];const a=await n._getAppCheckToken(),l=a?`#${ro}=${encodeURIComponent(a)}`:"";return`${io(n)}?${ne(c).slice(1)}${l}`}function io({config:n}){return n.emulator?Ke(n,no):`https://${n.authDomain}/${to}`}/**
1427
1412
  * @license
1428
1413
  * Copyright 2020 Google LLC
1429
1414
  *
@@ -1438,7 +1423,7 @@
1438
1423
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1439
1424
  * See the License for the specific language governing permissions and
1440
1425
  * limitations under the License.
1441
- */const Me="webStorageSupport";class io{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=pn,this._completeRedirectFn=Cs,this._overrideRedirectResult=Ss}async _openPopup(e,t,r,i){var s;w((s=this.eventManagers[e._key()])===null||s===void 0?void 0:s.manager,"_initialize() not called before _openPopup()");const o=await kt(e,t,r,ge(),i);return Qs(e,o,Xe())}async _openRedirect(e,t,r,i){await this._originValidation(e);const s=await kt(e,t,r,ge(),i);return as(s),new Promise(()=>{})}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:i,promise:s}=this.eventManagers[t];return i?Promise.resolve(i):(w(s,"If manager is not set, promise should be"),s)}const r=this.initAndGetManager(e);return this.eventManagers[t]={promise:r},r.catch(()=>{delete this.eventManagers[t]}),r}async initAndGetManager(e){const t=await Gs(e),r=new Ps(e);return t.register("authEvent",i=>(d(i?.authEvent,e,"invalid-auth-event"),{status:r.onEvent(i.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=t,r}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(Me,{type:Me},i=>{var s;const o=(s=i?.[0])===null||s===void 0?void 0:s[Me];o!==void 0&&t(!!o),m(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=Ms(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return nn()||Je()||Ee()}}const so=io;var Ct="@firebase/auth",Rt="1.4.0";/**
1426
+ */const Me="webStorageSupport";class so{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=gn,this._completeRedirectFn=Rs,this._overrideRedirectResult=As}async _openPopup(e,t,r,i){var s;w((s=this.eventManagers[e._key()])===null||s===void 0?void 0:s.manager,"_initialize() not called before _openPopup()");const o=await kt(e,t,r,ge(),i);return Zs(e,o,Xe())}async _openRedirect(e,t,r,i){await this._originValidation(e);const s=await kt(e,t,r,ge(),i);return cs(s),new Promise(()=>{})}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:i,promise:s}=this.eventManagers[t];return i?Promise.resolve(i):(w(s,"If manager is not set, promise should be"),s)}const r=this.initAndGetManager(e);return this.eventManagers[t]={promise:r},r.catch(()=>{delete this.eventManagers[t]}),r}async initAndGetManager(e){const t=await Ks(e),r=new Os(e);return t.register("authEvent",i=>(d(i?.authEvent,e,"invalid-auth-event"),{status:r.onEvent(i.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=t,r}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(Me,{type:Me},i=>{var s;const o=(s=i?.[0])===null||s===void 0?void 0:s[Me];o!==void 0&&t(!!o),m(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=Us(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return rn()||Je()||Ee()}}const oo=so;var Rt="@firebase/auth",Pt="1.5.1";/**
1442
1427
  * @license
1443
1428
  * Copyright 2020 Google LLC
1444
1429
  *
@@ -1453,7 +1438,7 @@
1453
1438
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1454
1439
  * See the License for the specific language governing permissions and
1455
1440
  * limitations under the License.
1456
- */class oo{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),((e=this.auth.currentUser)===null||e===void 0?void 0:e.uid)||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const t=this.auth.onIdTokenChanged(r=>{e(r?.stsTokenManager.accessToken||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){d(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/**
1441
+ */class ao{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),((e=this.auth.currentUser)===null||e===void 0?void 0:e.uid)||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const t=this.auth.onIdTokenChanged(r=>{e(r?.stsTokenManager.accessToken||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){d(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/**
1457
1442
  * @license
1458
1443
  * Copyright 2020 Google LLC
1459
1444
  *
@@ -1468,7 +1453,7 @@
1468
1453
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1469
1454
  * See the License for the specific language governing permissions and
1470
1455
  * limitations under the License.
1471
- */function ao(n){switch(n){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";default:return}}function co(n){Y(new j("auth",(e,{options:t})=>{const r=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),s=e.getProvider("app-check-internal"),{apiKey:o,authDomain:c}=r.options;d(o&&!o.includes(":"),"invalid-api-key",{appName:r.name});const a={apiKey:o,authDomain:c,clientPlatform:n,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:rn(n)},l=new Ci(r,i,s,a);return Ui(l,t),l},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,r)=>{e.getProvider("auth-internal").initialize()})),Y(new j("auth-internal",e=>{const t=F(e.getProvider("auth").getImmediate());return(r=>new oo(r))(t)},"PRIVATE").setInstantiationMode("EXPLICIT")),q(Ct,Rt,ao(n)),q(Ct,Rt,"esm2017")}/**
1456
+ */function co(n){switch(n){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";default:return}}function lo(n){Y(new j("auth",(e,{options:t})=>{const r=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),s=e.getProvider("app-check-internal"),{apiKey:o,authDomain:c}=r.options;d(o&&!o.includes(":"),"invalid-api-key",{appName:r.name});const a={apiKey:o,authDomain:c,clientPlatform:n,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:sn(n)},l=new Ri(r,i,s,a);return Fi(l,t),l},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,r)=>{e.getProvider("auth-internal").initialize()})),Y(new j("auth-internal",e=>{const t=B(e.getProvider("auth").getImmediate());return(r=>new ao(r))(t)},"PRIVATE").setInstantiationMode("EXPLICIT")),q(Rt,Pt,co(n)),q(Rt,Pt,"esm2017")}/**
1472
1457
  * @license
1473
1458
  * Copyright 2021 Google LLC
1474
1459
  *
@@ -1483,4 +1468,4 @@
1483
1468
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1484
1469
  * See the License for the specific language governing permissions and
1485
1470
  * limitations under the License.
1486
- */const lo=5*60,uo=Ut("authIdTokenMaxAge")||lo;let Pt=null;const ho=n=>async e=>{const t=e&&await e.getIdTokenResult(),r=t&&(new Date().getTime()-Date.parse(t.issuedAtTime))/1e3;if(r&&r>uo)return;const i=t?.token;Pt!==i&&(Pt=i,await fetch(n,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};function Io(n=$r()){const e=Ht(n,"auth");if(e.isInitialized())return e.getImmediate();const t=Mi(n,{popupRedirectResolver:so,persistence:[ms,is,pn]}),r=Ut("authTokenSyncURL");if(r){const s=ho(r);es(t,s,()=>s(t.currentUser)),Zi(t,o=>s(o))}const i=Pn("auth");return i&&xi(t,`http://${i}`),t}co("Browser");export{go as a,po as b,fo as c,Io as g,Vr as i,_o as o,q as r,mo as s};
1471
+ */const uo=5*60,ho=Ft("authIdTokenMaxAge")||uo;let Ot=null;const fo=n=>async e=>{const t=e&&await e.getIdTokenResult(),r=t&&(new Date().getTime()-Date.parse(t.issuedAtTime))/1e3;if(r&&r>ho)return;const i=t?.token;Ot!==i&&(Ot=i,await fetch(n,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};function Io(n=Wr()){const e=Ht(n,"auth");if(e.isInitialized())return e.getImmediate();const t=Ui(n,{popupRedirectResolver:oo,persistence:[_s,ss,gn]}),r=Ft("authTokenSyncURL");if(r){const s=fo(r);ts(t,s,()=>s(t.currentUser)),es(t,o=>s(o))}const i=On("auth");return i&&Bi(t,`http://${i}`),t}lo("Browser");export{mo as a,go as b,po as c,Io as g,$r as i,vo as o,q as r,_o as s};