cloudcommerce 0.0.75 → 0.0.76

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 (56) hide show
  1. package/.vscode/extensions.json +2 -1
  2. package/.vscode/settings.json +9 -0
  3. package/CHANGELOG.md +17 -0
  4. package/package.json +1 -1
  5. package/packages/api/package.json +1 -1
  6. package/packages/apps/correios/package.json +1 -1
  7. package/packages/apps/custom-shipping/package.json +1 -1
  8. package/packages/apps/discounts/package.json +1 -1
  9. package/packages/apps/frenet/package.json +1 -1
  10. package/packages/apps/tiny-erp/package.json +1 -1
  11. package/packages/cli/config/firebase.json +7 -0
  12. package/packages/cli/package.json +1 -1
  13. package/packages/config/package.json +1 -1
  14. package/packages/events/package.json +1 -1
  15. package/packages/firebase/package.json +1 -1
  16. package/packages/modules/package.json +1 -1
  17. package/packages/passport/package.json +1 -1
  18. package/packages/ssr/package.json +1 -1
  19. package/packages/storefront/astro.config.mjs +9 -3
  20. package/packages/storefront/dist/client/assets/_...3d331176.css +1 -0
  21. package/packages/storefront/dist/client/assets/{fallback.9cd2ed3f.css → _...b330a555.css} +1 -1
  22. package/packages/storefront/dist/client/assets/_...c1ec409f.css +4 -0
  23. package/packages/storefront/dist/client/assets/fallback-index.552fd862.css +1 -0
  24. package/packages/storefront/dist/client/assets/{_...27b7eb4d.css → fallback.a3f85892.css} +1 -1
  25. package/packages/storefront/dist/client/assets/{index.c5a9ea80.css → index.73f26ab5.css} +1 -1
  26. package/packages/storefront/dist/client/client.80baece3.js +1 -0
  27. package/packages/storefront/dist/client/hoisted.61a32b69.js +661 -0
  28. package/packages/storefront/dist/server/entry.mjs +326 -161
  29. package/packages/storefront/package.json +6 -1
  30. package/packages/storefront/src/html.d.ts +23 -0
  31. package/packages/storefront/src/lib/components/Card.astro +1 -1
  32. package/packages/storefront/src/lib/components/LoginModal.vue +14 -20
  33. package/packages/storefront/src/lib/layouts/Base.astro +129 -0
  34. package/packages/storefront/src/lib/layouts/Checkout.astro +0 -0
  35. package/packages/storefront/src/lib/layouts/Pages.astro +30 -0
  36. package/packages/storefront/src/lib/layouts/meta/Head.astro +62 -1
  37. package/packages/storefront/src/lib/layouts/meta/Json.astro +49 -10
  38. package/packages/storefront/src/lib/main/Home.astro +84 -0
  39. package/packages/storefront/src/lib/main/Wildcard.astro +0 -0
  40. package/packages/storefront/src/lib/ssr-context.ts +2 -1
  41. package/packages/storefront/src/lib/views/[...slug].astro +3 -3
  42. package/packages/storefront/src/lib/views/fallback.astro +5 -3
  43. package/packages/storefront/src/lib/views/index.astro +4 -3
  44. package/packages/storefront/src/pages/index.astro +7 -2
  45. package/packages/storefront/tailwind.config.ts +0 -0
  46. package/packages/storefront/uno.config.ts +98 -0
  47. package/packages/types/package.json +1 -1
  48. package/packages/storefront/dist/client/LoginModal.d6b935cf.js +0 -1
  49. package/packages/storefront/dist/client/assets/_...b3f65c5c.css +0 -1
  50. package/packages/storefront/dist/client/assets/fallback-index.90217cf0.css +0 -1
  51. package/packages/storefront/dist/client/chunks/index.esm.69f70489.js +0 -1726
  52. package/packages/storefront/dist/client/chunks/index.esm2017.1194d1a1.js +0 -457
  53. package/packages/storefront/dist/client/chunks/runtime-core.esm-bundler.a7337834.js +0 -1
  54. package/packages/storefront/dist/client/client.80b904f3.js +0 -1
  55. package/packages/storefront/dist/client/hoisted.24787260.js +0 -376
  56. package/packages/storefront/src/lib/layouts/Layout.astro +0 -84
@@ -0,0 +1,661 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2017 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
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 Ie=function(t){const e=[];let n=0;for(let r=0;r<t.length;r++){let a=t.charCodeAt(r);a<128?e[n++]=a:a<2048?(e[n++]=a>>6|192,e[n++]=a&63|128):(a&64512)===55296&&r+1<t.length&&(t.charCodeAt(r+1)&64512)===56320?(a=65536+((a&1023)<<10)+(t.charCodeAt(++r)&1023),e[n++]=a>>18|240,e[n++]=a>>12&63|128,e[n++]=a>>6&63|128,e[n++]=a&63|128):(e[n++]=a>>12|224,e[n++]=a>>6&63|128,e[n++]=a&63|128)}return e},et=function(t){const e=[];let n=0,r=0;for(;n<t.length;){const a=t[n++];if(a<128)e[r++]=String.fromCharCode(a);else if(a>191&&a<224){const i=t[n++];e[r++]=String.fromCharCode((a&31)<<6|i&63)}else if(a>239&&a<365){const i=t[n++],s=t[n++],o=t[n++],c=((a&7)<<18|(i&63)<<12|(s&63)<<6|o&63)-65536;e[r++]=String.fromCharCode(55296+(c>>10)),e[r++]=String.fromCharCode(56320+(c&1023))}else{const i=t[n++],s=t[n++];e[r++]=String.fromCharCode((a&15)<<12|(i&63)<<6|s&63)}}return e.join("")},tt={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(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let a=0;a<t.length;a+=3){const i=t[a],s=a+1<t.length,o=s?t[a+1]:0,c=a+2<t.length,l=c?t[a+2]:0,u=i>>2,h=(i&3)<<4|o>>4;let m=(o&15)<<2|l>>6,f=l&63;c||(f=64,s||(m=64)),r.push(n[u],n[h],n[m],n[f])}return r.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(Ie(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):et(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let a=0;a<t.length;){const i=n[t.charAt(a++)],o=a<t.length?n[t.charAt(a)]:0;++a;const l=a<t.length?n[t.charAt(a)]:64;++a;const h=a<t.length?n[t.charAt(a)]:64;if(++a,i==null||o==null||l==null||h==null)throw Error();const m=i<<2|o>>4;if(r.push(m),l!==64){const f=o<<4&240|l>>2;if(r.push(f),h!==64){const Qe=l<<6&192|h;r.push(Qe)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t<this.ENCODED_VALS.length;t++)this.byteToCharMap_[t]=this.ENCODED_VALS.charAt(t),this.charToByteMap_[this.byteToCharMap_[t]]=t,this.byteToCharMapWebSafe_[t]=this.ENCODED_VALS_WEBSAFE.charAt(t),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[t]]=t,t>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}},nt=function(t){const e=Ie(t);return tt.encodeByteArray(e,!0)},ye=function(t){return nt(t).replace(/\./g,"")};/**
32
+ * @license
33
+ * Copyright 2017 Google LLC
34
+ *
35
+ * Licensed under the Apache License, Version 2.0 (the "License");
36
+ * you may not use this file except in compliance with the License.
37
+ * You may obtain a copy of the License at
38
+ *
39
+ * http://www.apache.org/licenses/LICENSE-2.0
40
+ *
41
+ * Unless required by applicable law or agreed to in writing, software
42
+ * distributed under the License is distributed on an "AS IS" BASIS,
43
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
44
+ * See the License for the specific language governing permissions and
45
+ * limitations under the License.
46
+ */class rt{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}wrapCallback(e){return(n,r)=>{n?this.reject(n):this.resolve(r),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(n):e(n,r))}}}function at(){const t=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof t=="object"&&t.id!==void 0}function we(){return typeof indexedDB=="object"}function Ee(){return new Promise((t,e)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",a=self.indexedDB.open(r);a.onsuccess=()=>{a.result.close(),n||self.indexedDB.deleteDatabase(r),t(!0)},a.onupgradeneeded=()=>{n=!1},a.onerror=()=>{var i;e(((i=a.error)===null||i===void 0?void 0:i.message)||"")}}catch(n){e(n)}})}function it(){return!(typeof navigator>"u"||!navigator.cookieEnabled)}/**
47
+ * @license
48
+ * Copyright 2017 Google LLC
49
+ *
50
+ * Licensed under the Apache License, Version 2.0 (the "License");
51
+ * you may not use this file except in compliance with the License.
52
+ * You may obtain a copy of the License at
53
+ *
54
+ * http://www.apache.org/licenses/LICENSE-2.0
55
+ *
56
+ * Unless required by applicable law or agreed to in writing, software
57
+ * distributed under the License is distributed on an "AS IS" BASIS,
58
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
59
+ * See the License for the specific language governing permissions and
60
+ * limitations under the License.
61
+ */const st="FirebaseError";class T extends Error{constructor(e,n,r){super(n),this.code=e,this.customData=r,this.name=st,Object.setPrototypeOf(this,T.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,N.prototype.create)}}class N{constructor(e,n,r){this.service=e,this.serviceName=n,this.errors=r}create(e,...n){const r=n[0]||{},a=`${this.service}/${e}`,i=this.errors[e],s=i?ot(i,r):"Error",o=`${this.serviceName}: ${s} (${a}).`;return new T(a,o,r)}}function ot(t,e){return t.replace(ct,(n,r)=>{const a=e[r];return a!=null?String(a):`<${r}?>`})}const ct=/\{\$([^}]+)}/g;function R(t,e){if(t===e)return!0;const n=Object.keys(t),r=Object.keys(e);for(const a of n){if(!r.includes(a))return!1;const i=t[a],s=e[a];if(te(i)&&te(s)){if(!R(i,s))return!1}else if(i!==s)return!1}for(const a of r)if(!n.includes(a))return!1;return!0}function te(t){return t!==null&&typeof t=="object"}/**
62
+ * @license
63
+ * Copyright 2019 Google LLC
64
+ *
65
+ * Licensed under the Apache License, Version 2.0 (the "License");
66
+ * you may not use this file except in compliance with the License.
67
+ * You may obtain a copy of the License at
68
+ *
69
+ * http://www.apache.org/licenses/LICENSE-2.0
70
+ *
71
+ * Unless required by applicable law or agreed to in writing, software
72
+ * distributed under the License is distributed on an "AS IS" BASIS,
73
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
74
+ * See the License for the specific language governing permissions and
75
+ * limitations under the License.
76
+ */const lt=1e3,dt=2,ut=4*60*60*1e3,ht=.5;function ne(t,e=lt,n=dt){const r=e*Math.pow(n,t),a=Math.round(ht*r*(Math.random()-.5)*2);return Math.min(ut,r+a)}/**
77
+ * @license
78
+ * Copyright 2021 Google LLC
79
+ *
80
+ * Licensed under the Apache License, Version 2.0 (the "License");
81
+ * you may not use this file except in compliance with the License.
82
+ * You may obtain a copy of the License at
83
+ *
84
+ * http://www.apache.org/licenses/LICENSE-2.0
85
+ *
86
+ * Unless required by applicable law or agreed to in writing, software
87
+ * distributed under the License is distributed on an "AS IS" BASIS,
88
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
89
+ * See the License for the specific language governing permissions and
90
+ * limitations under the License.
91
+ */function _e(t){return t&&t._delegate?t._delegate:t}class y{constructor(e,n,r){this.name=e,this.instanceFactory=n,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}/**
92
+ * @license
93
+ * Copyright 2019 Google LLC
94
+ *
95
+ * Licensed under the Apache License, Version 2.0 (the "License");
96
+ * you may not use this file except in compliance with the License.
97
+ * You may obtain a copy of the License at
98
+ *
99
+ * http://www.apache.org/licenses/LICENSE-2.0
100
+ *
101
+ * Unless required by applicable law or agreed to in writing, software
102
+ * distributed under the License is distributed on an "AS IS" BASIS,
103
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
104
+ * See the License for the specific language governing permissions and
105
+ * limitations under the License.
106
+ */const w="[DEFAULT]";/**
107
+ * @license
108
+ * Copyright 2019 Google LLC
109
+ *
110
+ * Licensed under the Apache License, Version 2.0 (the "License");
111
+ * you may not use this file except in compliance with the License.
112
+ * You may obtain a copy of the License at
113
+ *
114
+ * http://www.apache.org/licenses/LICENSE-2.0
115
+ *
116
+ * Unless required by applicable law or agreed to in writing, software
117
+ * distributed under the License is distributed on an "AS IS" BASIS,
118
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
119
+ * See the License for the specific language governing permissions and
120
+ * limitations under the License.
121
+ */class ft{constructor(e,n){this.name=e,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const n=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(n)){const r=new rt;if(this.instancesDeferred.set(n,r),this.isInitialized(n)||this.shouldAutoInitialize())try{const a=this.getOrInitializeService({instanceIdentifier:n});a&&r.resolve(a)}catch{}}return this.instancesDeferred.get(n).promise}getImmediate(e){var n;const r=this.normalizeInstanceIdentifier(e?.identifier),a=(n=e?.optional)!==null&&n!==void 0?n:!1;if(this.isInitialized(r)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:r})}catch(i){if(a)return null;throw i}else{if(a)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(mt(e))try{this.getOrInitializeService({instanceIdentifier:w})}catch{}for(const[n,r]of this.instancesDeferred.entries()){const a=this.normalizeInstanceIdentifier(n);try{const i=this.getOrInitializeService({instanceIdentifier:a});r.resolve(i)}catch{}}}}clearInstance(e=w){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(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...e.filter(n=>"_delete"in n).map(n=>n._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=w){return this.instances.has(e)}getOptions(e=w){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:n={}}=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 a=this.getOrInitializeService({instanceIdentifier:r,options:n});for(const[i,s]of this.instancesDeferred.entries()){const o=this.normalizeInstanceIdentifier(i);r===o&&s.resolve(a)}return a}onInit(e,n){var r;const a=this.normalizeInstanceIdentifier(n),i=(r=this.onInitCallbacks.get(a))!==null&&r!==void 0?r:new Set;i.add(e),this.onInitCallbacks.set(a,i);const s=this.instances.get(a);return s&&e(s,a),()=>{i.delete(e)}}invokeOnInitCallbacks(e,n){const r=this.onInitCallbacks.get(n);if(!!r)for(const a of r)try{a(e,n)}catch{}}getOrInitializeService({instanceIdentifier:e,options:n={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:pt(e),options:n}),this.instances.set(e,r),this.instancesOptions.set(e,n),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=w){return this.component?this.component.multipleInstances?e:w:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function pt(t){return t===w?void 0:t}function mt(t){return t.instantiationMode==="EAGER"}/**
122
+ * @license
123
+ * Copyright 2019 Google LLC
124
+ *
125
+ * Licensed under the Apache License, Version 2.0 (the "License");
126
+ * you may not use this file except in compliance with the License.
127
+ * You may obtain a copy of the License at
128
+ *
129
+ * http://www.apache.org/licenses/LICENSE-2.0
130
+ *
131
+ * Unless required by applicable law or agreed to in writing, software
132
+ * distributed under the License is distributed on an "AS IS" BASIS,
133
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
134
+ * See the License for the specific language governing permissions and
135
+ * limitations under the License.
136
+ */class gt{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const n=this.getProvider(e.name);if(n.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);n.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 n=new ft(e,this);return this.providers.set(e,n),n}getProviders(){return Array.from(this.providers.values())}}/**
137
+ * @license
138
+ * Copyright 2017 Google LLC
139
+ *
140
+ * Licensed under the Apache License, Version 2.0 (the "License");
141
+ * you may not use this file except in compliance with the License.
142
+ * You may obtain a copy of the License at
143
+ *
144
+ * http://www.apache.org/licenses/LICENSE-2.0
145
+ *
146
+ * Unless required by applicable law or agreed to in writing, software
147
+ * distributed under the License is distributed on an "AS IS" BASIS,
148
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
149
+ * See the License for the specific language governing permissions and
150
+ * limitations under the License.
151
+ */var d;(function(t){t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT"})(d||(d={}));const bt={debug:d.DEBUG,verbose:d.VERBOSE,info:d.INFO,warn:d.WARN,error:d.ERROR,silent:d.SILENT},It=d.INFO,yt={[d.DEBUG]:"log",[d.VERBOSE]:"log",[d.INFO]:"info",[d.WARN]:"warn",[d.ERROR]:"error"},wt=(t,e,...n)=>{if(e<t.logLevel)return;const r=new Date().toISOString(),a=yt[e];if(a)console[a](`[${r}] ${t.name}:`,...n);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)};class ve{constructor(e){this.name=e,this._logLevel=It,this._logHandler=wt,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in d))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?bt[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,d.DEBUG,...e),this._logHandler(this,d.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,d.VERBOSE,...e),this._logHandler(this,d.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,d.INFO,...e),this._logHandler(this,d.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,d.WARN,...e),this._logHandler(this,d.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,d.ERROR,...e),this._logHandler(this,d.ERROR,...e)}}const Et=(t,e)=>e.some(n=>t instanceof n);let re,ae;function _t(){return re||(re=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function vt(){return ae||(ae=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Ae=new WeakMap,W=new WeakMap,Se=new WeakMap,x=new WeakMap,J=new WeakMap;function At(t){const e=new Promise((n,r)=>{const a=()=>{t.removeEventListener("success",i),t.removeEventListener("error",s)},i=()=>{n(b(t.result)),a()},s=()=>{r(t.error),a()};t.addEventListener("success",i),t.addEventListener("error",s)});return e.then(n=>{n instanceof IDBCursor&&Ae.set(n,t)}).catch(()=>{}),J.set(e,t),e}function St(t){if(W.has(t))return;const e=new Promise((n,r)=>{const a=()=>{t.removeEventListener("complete",i),t.removeEventListener("error",s),t.removeEventListener("abort",s)},i=()=>{n(),a()},s=()=>{r(t.error||new DOMException("AbortError","AbortError")),a()};t.addEventListener("complete",i),t.addEventListener("error",s),t.addEventListener("abort",s)});W.set(t,e)}let q={get(t,e,n){if(t instanceof IDBTransaction){if(e==="done")return W.get(t);if(e==="objectStoreNames")return t.objectStoreNames||Se.get(t);if(e==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return b(t[e])},set(t,e,n){return t[e]=n,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function Ct(t){q=t(q)}function Tt(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...n){const r=t.call(F(this),e,...n);return Se.set(r,e.sort?e.sort():[e]),b(r)}:vt().includes(t)?function(...e){return t.apply(F(this),e),b(Ae.get(this))}:function(...e){return b(t.apply(F(this),e))}}function Dt(t){return typeof t=="function"?Tt(t):(t instanceof IDBTransaction&&St(t),Et(t,_t())?new Proxy(t,q):t)}function b(t){if(t instanceof IDBRequest)return At(t);if(x.has(t))return x.get(t);const e=Dt(t);return e!==t&&(x.set(t,e),J.set(e,t)),e}const F=t=>J.get(t);function Ce(t,e,{blocked:n,upgrade:r,blocking:a,terminated:i}={}){const s=indexedDB.open(t,e),o=b(s);return r&&s.addEventListener("upgradeneeded",c=>{r(b(s.result),c.oldVersion,c.newVersion,b(s.transaction))}),n&&s.addEventListener("blocked",()=>n()),o.then(c=>{i&&c.addEventListener("close",()=>i()),a&&c.addEventListener("versionchange",()=>a())}).catch(()=>{}),o}const Ot=["get","getKey","getAll","getAllKeys","count"],Rt=["put","add","delete","clear"],j=new Map;function ie(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(j.get(e))return j.get(e);const n=e.replace(/FromIndex$/,""),r=e!==n,a=Rt.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(a||Ot.includes(n)))return;const i=async function(s,...o){const c=this.transaction(s,a?"readwrite":"readonly");let l=c.store;return r&&(l=l.index(o.shift())),(await Promise.all([l[n](...o),a&&c.done]))[0]};return j.set(e,i),i}Ct(t=>({...t,get:(e,n,r)=>ie(e,n)||t.get(e,n,r),has:(e,n)=>!!ie(e,n)||t.has(e,n)}));/**
152
+ * @license
153
+ * Copyright 2019 Google LLC
154
+ *
155
+ * Licensed under the Apache License, Version 2.0 (the "License");
156
+ * you may not use this file except in compliance with the License.
157
+ * You may obtain a copy of the License at
158
+ *
159
+ * http://www.apache.org/licenses/LICENSE-2.0
160
+ *
161
+ * Unless required by applicable law or agreed to in writing, software
162
+ * distributed under the License is distributed on an "AS IS" BASIS,
163
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
164
+ * See the License for the specific language governing permissions and
165
+ * limitations under the License.
166
+ */class Bt{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(Mt(n)){const r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}}function Mt(t){const e=t.getComponent();return e?.type==="VERSION"}const G="@firebase/app",se="0.7.32";/**
167
+ * @license
168
+ * Copyright 2019 Google LLC
169
+ *
170
+ * Licensed under the Apache License, Version 2.0 (the "License");
171
+ * you may not use this file except in compliance with the License.
172
+ * You may obtain a copy of the License at
173
+ *
174
+ * http://www.apache.org/licenses/LICENSE-2.0
175
+ *
176
+ * Unless required by applicable law or agreed to in writing, software
177
+ * distributed under the License is distributed on an "AS IS" BASIS,
178
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
179
+ * See the License for the specific language governing permissions and
180
+ * limitations under the License.
181
+ */const _=new ve("@firebase/app"),$t="@firebase/app-compat",Nt="@firebase/analytics-compat",kt="@firebase/analytics",Pt="@firebase/app-check-compat",Lt="@firebase/app-check",xt="@firebase/auth",Ft="@firebase/auth-compat",jt="@firebase/database",Ht="@firebase/database-compat",Vt="@firebase/functions",zt="@firebase/functions-compat",Ut="@firebase/installations",Wt="@firebase/installations-compat",qt="@firebase/messaging",Gt="@firebase/messaging-compat",Kt="@firebase/performance",Yt="@firebase/performance-compat",Jt="@firebase/remote-config",Xt="@firebase/remote-config-compat",Zt="@firebase/storage",Qt="@firebase/storage-compat",en="@firebase/firestore",tn="@firebase/firestore-compat",nn="firebase";/**
182
+ * @license
183
+ * Copyright 2019 Google LLC
184
+ *
185
+ * Licensed under the Apache License, Version 2.0 (the "License");
186
+ * you may not use this file except in compliance with the License.
187
+ * You may obtain a copy of the License at
188
+ *
189
+ * http://www.apache.org/licenses/LICENSE-2.0
190
+ *
191
+ * Unless required by applicable law or agreed to in writing, software
192
+ * distributed under the License is distributed on an "AS IS" BASIS,
193
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
194
+ * See the License for the specific language governing permissions and
195
+ * limitations under the License.
196
+ */const Te="[DEFAULT]",rn={[G]:"fire-core",[$t]:"fire-core-compat",[kt]:"fire-analytics",[Nt]:"fire-analytics-compat",[Lt]:"fire-app-check",[Pt]:"fire-app-check-compat",[xt]:"fire-auth",[Ft]:"fire-auth-compat",[jt]:"fire-rtdb",[Ht]:"fire-rtdb-compat",[Vt]:"fire-fn",[zt]:"fire-fn-compat",[Ut]:"fire-iid",[Wt]:"fire-iid-compat",[qt]:"fire-fcm",[Gt]:"fire-fcm-compat",[Kt]:"fire-perf",[Yt]:"fire-perf-compat",[Jt]:"fire-rc",[Xt]:"fire-rc-compat",[Zt]:"fire-gcs",[Qt]:"fire-gcs-compat",[en]:"fire-fst",[tn]:"fire-fst-compat","fire-js":"fire-js",[nn]:"fire-js-all"};/**
197
+ * @license
198
+ * Copyright 2019 Google LLC
199
+ *
200
+ * Licensed under the Apache License, Version 2.0 (the "License");
201
+ * you may not use this file except in compliance with the License.
202
+ * You may obtain a copy of the License at
203
+ *
204
+ * http://www.apache.org/licenses/LICENSE-2.0
205
+ *
206
+ * Unless required by applicable law or agreed to in writing, software
207
+ * distributed under the License is distributed on an "AS IS" BASIS,
208
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
209
+ * See the License for the specific language governing permissions and
210
+ * limitations under the License.
211
+ */const B=new Map,K=new Map;function an(t,e){try{t.container.addComponent(e)}catch(n){_.debug(`Component ${e.name} failed to register with FirebaseApp ${t.name}`,n)}}function v(t){const e=t.name;if(K.has(e))return _.debug(`There were multiple attempts to register component ${e}.`),!1;K.set(e,t);for(const n of B.values())an(n,t);return!0}function k(t,e){const n=t.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),t.container.getProvider(e)}/**
212
+ * @license
213
+ * Copyright 2019 Google LLC
214
+ *
215
+ * Licensed under the Apache License, Version 2.0 (the "License");
216
+ * you may not use this file except in compliance with the License.
217
+ * You may obtain a copy of the License at
218
+ *
219
+ * http://www.apache.org/licenses/LICENSE-2.0
220
+ *
221
+ * Unless required by applicable law or agreed to in writing, software
222
+ * distributed under the License is distributed on an "AS IS" BASIS,
223
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
224
+ * See the License for the specific language governing permissions and
225
+ * limitations under the License.
226
+ */const sn={["no-app"]:"No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()",["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",["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}."},A=new N("app","Firebase",sn);/**
227
+ * @license
228
+ * Copyright 2019 Google LLC
229
+ *
230
+ * Licensed under the Apache License, Version 2.0 (the "License");
231
+ * you may not use this file except in compliance with the License.
232
+ * You may obtain a copy of the License at
233
+ *
234
+ * http://www.apache.org/licenses/LICENSE-2.0
235
+ *
236
+ * Unless required by applicable law or agreed to in writing, software
237
+ * distributed under the License is distributed on an "AS IS" BASIS,
238
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
239
+ * See the License for the specific language governing permissions and
240
+ * limitations under the License.
241
+ */class on{constructor(e,n,r){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},n),this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new y("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw A.create("app-deleted",{appName:this._name})}}function cn(t,e={}){typeof e!="object"&&(e={name:e});const n=Object.assign({name:Te,automaticDataCollectionEnabled:!1},e),r=n.name;if(typeof r!="string"||!r)throw A.create("bad-app-name",{appName:String(r)});const a=B.get(r);if(a){if(R(t,a.options)&&R(n,a.config))return a;throw A.create("duplicate-app",{appName:r})}const i=new gt(r);for(const o of K.values())i.addComponent(o);const s=new on(t,n,i);return B.set(r,s),s}function ln(t=Te){const e=B.get(t);if(!e)throw A.create("no-app",{appName:t});return e}function I(t,e,n){var r;let a=(r=rn[t])!==null&&r!==void 0?r:t;n&&(a+=`-${n}`);const i=a.match(/\s|\//),s=e.match(/\s|\//);if(i||s){const o=[`Unable to register library "${a}" with version "${e}":`];i&&o.push(`library name "${a}" contains illegal characters (whitespace or "/")`),i&&s&&o.push("and"),s&&o.push(`version name "${e}" contains illegal characters (whitespace or "/")`),_.warn(o.join(" "));return}v(new y(`${a}-version`,()=>({library:a,version:e}),"VERSION"))}/**
242
+ * @license
243
+ * Copyright 2021 Google LLC
244
+ *
245
+ * Licensed under the Apache License, Version 2.0 (the "License");
246
+ * you may not use this file except in compliance with the License.
247
+ * You may obtain a copy of the License at
248
+ *
249
+ * http://www.apache.org/licenses/LICENSE-2.0
250
+ *
251
+ * Unless required by applicable law or agreed to in writing, software
252
+ * distributed under the License is distributed on an "AS IS" BASIS,
253
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
254
+ * See the License for the specific language governing permissions and
255
+ * limitations under the License.
256
+ */const dn="firebase-heartbeat-database",un=1,O="firebase-heartbeat-store";let H=null;function De(){return H||(H=Ce(dn,un,{upgrade:(t,e)=>{switch(e){case 0:t.createObjectStore(O)}}}).catch(t=>{throw A.create("idb-open",{originalErrorMessage:t.message})})),H}async function hn(t){var e;try{return(await De()).transaction(O).objectStore(O).get(Oe(t))}catch(n){if(n instanceof T)_.warn(n.message);else{const r=A.create("idb-get",{originalErrorMessage:(e=n)===null||e===void 0?void 0:e.message});_.warn(r.message)}}}async function oe(t,e){var n;try{const a=(await De()).transaction(O,"readwrite");return await a.objectStore(O).put(e,Oe(t)),a.done}catch(r){if(r instanceof T)_.warn(r.message);else{const a=A.create("idb-set",{originalErrorMessage:(n=r)===null||n===void 0?void 0:n.message});_.warn(a.message)}}}function Oe(t){return`${t.name}!${t.options.appId}`}/**
257
+ * @license
258
+ * Copyright 2021 Google LLC
259
+ *
260
+ * Licensed under the Apache License, Version 2.0 (the "License");
261
+ * you may not use this file except in compliance with the License.
262
+ * You may obtain a copy of the License at
263
+ *
264
+ * http://www.apache.org/licenses/LICENSE-2.0
265
+ *
266
+ * Unless required by applicable law or agreed to in writing, software
267
+ * distributed under the License is distributed on an "AS IS" BASIS,
268
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
269
+ * See the License for the specific language governing permissions and
270
+ * limitations under the License.
271
+ */const fn=1024,pn=30*24*60*60*1e3;class mn{constructor(e){this.container=e,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new bn(n),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){const n=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),r=ce();if(this._heartbeatsCache===null&&(this._heartbeatsCache=await this._heartbeatsCachePromise),!(this._heartbeatsCache.lastSentHeartbeatDate===r||this._heartbeatsCache.heartbeats.some(a=>a.date===r)))return this._heartbeatsCache.heartbeats.push({date:r,agent:n}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(a=>{const i=new Date(a.date).valueOf();return Date.now()-i<=pn}),this._storage.overwrite(this._heartbeatsCache)}async getHeartbeatsHeader(){if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,this._heartbeatsCache===null||this._heartbeatsCache.heartbeats.length===0)return"";const e=ce(),{heartbeatsToSend:n,unsentEntries:r}=gn(this._heartbeatsCache.heartbeats),a=ye(JSON.stringify({version:2,heartbeats:n}));return this._heartbeatsCache.lastSentHeartbeatDate=e,r.length>0?(this._heartbeatsCache.heartbeats=r,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),a}}function ce(){return new Date().toISOString().substring(0,10)}function gn(t,e=fn){const n=[];let r=t.slice();for(const a of t){const i=n.find(s=>s.agent===a.agent);if(i){if(i.dates.push(a.date),le(n)>e){i.dates.pop();break}}else if(n.push({agent:a.agent,dates:[a.date]}),le(n)>e){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}class bn{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return we()?Ee().then(()=>!0).catch(()=>!1):!1}async read(){return await this._canUseIndexedDBPromise?await hn(this.app)||{heartbeats:[]}:{heartbeats:[]}}async overwrite(e){var n;if(await this._canUseIndexedDBPromise){const a=await this.read();return oe(this.app,{lastSentHeartbeatDate:(n=e.lastSentHeartbeatDate)!==null&&n!==void 0?n:a.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){var n;if(await this._canUseIndexedDBPromise){const a=await this.read();return oe(this.app,{lastSentHeartbeatDate:(n=e.lastSentHeartbeatDate)!==null&&n!==void 0?n:a.lastSentHeartbeatDate,heartbeats:[...a.heartbeats,...e.heartbeats]})}else return}}function le(t){return ye(JSON.stringify({version:2,heartbeats:t})).length}/**
272
+ * @license
273
+ * Copyright 2019 Google LLC
274
+ *
275
+ * Licensed under the Apache License, Version 2.0 (the "License");
276
+ * you may not use this file except in compliance with the License.
277
+ * You may obtain a copy of the License at
278
+ *
279
+ * http://www.apache.org/licenses/LICENSE-2.0
280
+ *
281
+ * Unless required by applicable law or agreed to in writing, software
282
+ * distributed under the License is distributed on an "AS IS" BASIS,
283
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
284
+ * See the License for the specific language governing permissions and
285
+ * limitations under the License.
286
+ */function In(t){v(new y("platform-logger",e=>new Bt(e),"PRIVATE")),v(new y("heartbeat",e=>new mn(e),"PRIVATE")),I(G,se,t),I(G,se,"esm2017"),I("fire-js","")}In("");var yn="firebase",wn="9.9.4";/**
287
+ * @license
288
+ * Copyright 2020 Google LLC
289
+ *
290
+ * Licensed under the Apache License, Version 2.0 (the "License");
291
+ * you may not use this file except in compliance with the License.
292
+ * You may obtain a copy of the License at
293
+ *
294
+ * http://www.apache.org/licenses/LICENSE-2.0
295
+ *
296
+ * Unless required by applicable law or agreed to in writing, software
297
+ * distributed under the License is distributed on an "AS IS" BASIS,
298
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
299
+ * See the License for the specific language governing permissions and
300
+ * limitations under the License.
301
+ */I(yn,wn,"app");const Re="@firebase/installations",X="0.5.12";/**
302
+ * @license
303
+ * Copyright 2019 Google LLC
304
+ *
305
+ * Licensed under the Apache License, Version 2.0 (the "License");
306
+ * you may not use this file except in compliance with the License.
307
+ * You may obtain a copy of the License at
308
+ *
309
+ * http://www.apache.org/licenses/LICENSE-2.0
310
+ *
311
+ * Unless required by applicable law or agreed to in writing, software
312
+ * distributed under the License is distributed on an "AS IS" BASIS,
313
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
314
+ * See the License for the specific language governing permissions and
315
+ * limitations under the License.
316
+ */const Be=1e4,Me=`w:${X}`,$e="FIS_v2",En="https://firebaseinstallations.googleapis.com/v1",_n=60*60*1e3,vn="installations",An="Installations";/**
317
+ * @license
318
+ * Copyright 2019 Google LLC
319
+ *
320
+ * Licensed under the Apache License, Version 2.0 (the "License");
321
+ * you may not use this file except in compliance with the License.
322
+ * You may obtain a copy of the License at
323
+ *
324
+ * http://www.apache.org/licenses/LICENSE-2.0
325
+ *
326
+ * Unless required by applicable law or agreed to in writing, software
327
+ * distributed under the License is distributed on an "AS IS" BASIS,
328
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
329
+ * See the License for the specific language governing permissions and
330
+ * limitations under the License.
331
+ */const Sn={["missing-app-config-values"]:'Missing App configuration value: "{$valueName}"',["not-registered"]:"Firebase Installation is not registered.",["installation-not-found"]:"Firebase Installation not found.",["request-failed"]:'{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',["app-offline"]:"Could not process request. Application offline.",["delete-pending-registration"]:"Can't delete installation while there is a pending registration request."},S=new N(vn,An,Sn);function Ne(t){return t instanceof T&&t.code.includes("request-failed")}/**
332
+ * @license
333
+ * Copyright 2019 Google LLC
334
+ *
335
+ * Licensed under the Apache License, Version 2.0 (the "License");
336
+ * you may not use this file except in compliance with the License.
337
+ * You may obtain a copy of the License at
338
+ *
339
+ * http://www.apache.org/licenses/LICENSE-2.0
340
+ *
341
+ * Unless required by applicable law or agreed to in writing, software
342
+ * distributed under the License is distributed on an "AS IS" BASIS,
343
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
344
+ * See the License for the specific language governing permissions and
345
+ * limitations under the License.
346
+ */function ke({projectId:t}){return`${En}/projects/${t}/installations`}function Pe(t){return{token:t.token,requestStatus:2,expiresIn:Tn(t.expiresIn),creationTime:Date.now()}}async function Le(t,e){const r=(await e.json()).error;return S.create("request-failed",{requestName:t,serverCode:r.code,serverMessage:r.message,serverStatus:r.status})}function xe({apiKey:t}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":t})}function Cn(t,{refreshToken:e}){const n=xe(t);return n.append("Authorization",Dn(e)),n}async function Fe(t){const e=await t();return e.status>=500&&e.status<600?t():e}function Tn(t){return Number(t.replace("s","000"))}function Dn(t){return`${$e} ${t}`}/**
347
+ * @license
348
+ * Copyright 2019 Google LLC
349
+ *
350
+ * Licensed under the Apache License, Version 2.0 (the "License");
351
+ * you may not use this file except in compliance with the License.
352
+ * You may obtain a copy of the License at
353
+ *
354
+ * http://www.apache.org/licenses/LICENSE-2.0
355
+ *
356
+ * Unless required by applicable law or agreed to in writing, software
357
+ * distributed under the License is distributed on an "AS IS" BASIS,
358
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
359
+ * See the License for the specific language governing permissions and
360
+ * limitations under the License.
361
+ */async function On({appConfig:t,heartbeatServiceProvider:e},{fid:n}){const r=ke(t),a=xe(t),i=e.getImmediate({optional:!0});if(i){const l=await i.getHeartbeatsHeader();l&&a.append("x-firebase-client",l)}const s={fid:n,authVersion:$e,appId:t.appId,sdkVersion:Me},o={method:"POST",headers:a,body:JSON.stringify(s)},c=await Fe(()=>fetch(r,o));if(c.ok){const l=await c.json();return{fid:l.fid||n,registrationStatus:2,refreshToken:l.refreshToken,authToken:Pe(l.authToken)}}else throw await Le("Create Installation",c)}/**
362
+ * @license
363
+ * Copyright 2019 Google LLC
364
+ *
365
+ * Licensed under the Apache License, Version 2.0 (the "License");
366
+ * you may not use this file except in compliance with the License.
367
+ * You may obtain a copy of the License at
368
+ *
369
+ * http://www.apache.org/licenses/LICENSE-2.0
370
+ *
371
+ * Unless required by applicable law or agreed to in writing, software
372
+ * distributed under the License is distributed on an "AS IS" BASIS,
373
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
374
+ * See the License for the specific language governing permissions and
375
+ * limitations under the License.
376
+ */function je(t){return new Promise(e=>{setTimeout(e,t)})}/**
377
+ * @license
378
+ * Copyright 2019 Google LLC
379
+ *
380
+ * Licensed under the Apache License, Version 2.0 (the "License");
381
+ * you may not use this file except in compliance with the License.
382
+ * You may obtain a copy of the License at
383
+ *
384
+ * http://www.apache.org/licenses/LICENSE-2.0
385
+ *
386
+ * Unless required by applicable law or agreed to in writing, software
387
+ * distributed under the License is distributed on an "AS IS" BASIS,
388
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
389
+ * See the License for the specific language governing permissions and
390
+ * limitations under the License.
391
+ */function Rn(t){return btoa(String.fromCharCode(...t)).replace(/\+/g,"-").replace(/\//g,"_")}/**
392
+ * @license
393
+ * Copyright 2019 Google LLC
394
+ *
395
+ * Licensed under the Apache License, Version 2.0 (the "License");
396
+ * you may not use this file except in compliance with the License.
397
+ * You may obtain a copy of the License at
398
+ *
399
+ * http://www.apache.org/licenses/LICENSE-2.0
400
+ *
401
+ * Unless required by applicable law or agreed to in writing, software
402
+ * distributed under the License is distributed on an "AS IS" BASIS,
403
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
404
+ * See the License for the specific language governing permissions and
405
+ * limitations under the License.
406
+ */const Bn=/^[cdef][\w-]{21}$/,Y="";function Mn(){try{const t=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(t),t[0]=112+t[0]%16;const n=$n(t);return Bn.test(n)?n:Y}catch{return Y}}function $n(t){return Rn(t).substr(0,22)}/**
407
+ * @license
408
+ * Copyright 2019 Google LLC
409
+ *
410
+ * Licensed under the Apache License, Version 2.0 (the "License");
411
+ * you may not use this file except in compliance with the License.
412
+ * You may obtain a copy of the License at
413
+ *
414
+ * http://www.apache.org/licenses/LICENSE-2.0
415
+ *
416
+ * Unless required by applicable law or agreed to in writing, software
417
+ * distributed under the License is distributed on an "AS IS" BASIS,
418
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
419
+ * See the License for the specific language governing permissions and
420
+ * limitations under the License.
421
+ */function P(t){return`${t.appName}!${t.appId}`}/**
422
+ * @license
423
+ * Copyright 2019 Google LLC
424
+ *
425
+ * Licensed under the Apache License, Version 2.0 (the "License");
426
+ * you may not use this file except in compliance with the License.
427
+ * You may obtain a copy of the License at
428
+ *
429
+ * http://www.apache.org/licenses/LICENSE-2.0
430
+ *
431
+ * Unless required by applicable law or agreed to in writing, software
432
+ * distributed under the License is distributed on an "AS IS" BASIS,
433
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
434
+ * See the License for the specific language governing permissions and
435
+ * limitations under the License.
436
+ */const He=new Map;function Ve(t,e){const n=P(t);ze(n,e),Nn(n,e)}function ze(t,e){const n=He.get(t);if(!!n)for(const r of n)r(e)}function Nn(t,e){const n=kn();n&&n.postMessage({key:t,fid:e}),Pn()}let E=null;function kn(){return!E&&"BroadcastChannel"in self&&(E=new BroadcastChannel("[Firebase] FID Change"),E.onmessage=t=>{ze(t.data.key,t.data.fid)}),E}function Pn(){He.size===0&&E&&(E.close(),E=null)}/**
437
+ * @license
438
+ * Copyright 2019 Google LLC
439
+ *
440
+ * Licensed under the Apache License, Version 2.0 (the "License");
441
+ * you may not use this file except in compliance with the License.
442
+ * You may obtain a copy of the License at
443
+ *
444
+ * http://www.apache.org/licenses/LICENSE-2.0
445
+ *
446
+ * Unless required by applicable law or agreed to in writing, software
447
+ * distributed under the License is distributed on an "AS IS" BASIS,
448
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
449
+ * See the License for the specific language governing permissions and
450
+ * limitations under the License.
451
+ */const Ln="firebase-installations-database",xn=1,C="firebase-installations-store";let V=null;function Z(){return V||(V=Ce(Ln,xn,{upgrade:(t,e)=>{switch(e){case 0:t.createObjectStore(C)}}})),V}async function M(t,e){const n=P(t),a=(await Z()).transaction(C,"readwrite"),i=a.objectStore(C),s=await i.get(n);return await i.put(e,n),await a.done,(!s||s.fid!==e.fid)&&Ve(t,e.fid),e}async function Ue(t){const e=P(t),r=(await Z()).transaction(C,"readwrite");await r.objectStore(C).delete(e),await r.done}async function L(t,e){const n=P(t),a=(await Z()).transaction(C,"readwrite"),i=a.objectStore(C),s=await i.get(n),o=e(s);return o===void 0?await i.delete(n):await i.put(o,n),await a.done,o&&(!s||s.fid!==o.fid)&&Ve(t,o.fid),o}/**
452
+ * @license
453
+ * Copyright 2019 Google LLC
454
+ *
455
+ * Licensed under the Apache License, Version 2.0 (the "License");
456
+ * you may not use this file except in compliance with the License.
457
+ * You may obtain a copy of the License at
458
+ *
459
+ * http://www.apache.org/licenses/LICENSE-2.0
460
+ *
461
+ * Unless required by applicable law or agreed to in writing, software
462
+ * distributed under the License is distributed on an "AS IS" BASIS,
463
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
464
+ * See the License for the specific language governing permissions and
465
+ * limitations under the License.
466
+ */async function Q(t){let e;const n=await L(t.appConfig,r=>{const a=Fn(r),i=jn(t,a);return e=i.registrationPromise,i.installationEntry});return n.fid===Y?{installationEntry:await e}:{installationEntry:n,registrationPromise:e}}function Fn(t){const e=t||{fid:Mn(),registrationStatus:0};return We(e)}function jn(t,e){if(e.registrationStatus===0){if(!navigator.onLine){const a=Promise.reject(S.create("app-offline"));return{installationEntry:e,registrationPromise:a}}const n={fid:e.fid,registrationStatus:1,registrationTime:Date.now()},r=Hn(t,n);return{installationEntry:n,registrationPromise:r}}else return e.registrationStatus===1?{installationEntry:e,registrationPromise:Vn(t)}:{installationEntry:e}}async function Hn(t,e){try{const n=await On(t,e);return M(t.appConfig,n)}catch(n){throw Ne(n)&&n.customData.serverCode===409?await Ue(t.appConfig):await M(t.appConfig,{fid:e.fid,registrationStatus:0}),n}}async function Vn(t){let e=await de(t.appConfig);for(;e.registrationStatus===1;)await je(100),e=await de(t.appConfig);if(e.registrationStatus===0){const{installationEntry:n,registrationPromise:r}=await Q(t);return r||n}return e}function de(t){return L(t,e=>{if(!e)throw S.create("installation-not-found");return We(e)})}function We(t){return zn(t)?{fid:t.fid,registrationStatus:0}:t}function zn(t){return t.registrationStatus===1&&t.registrationTime+Be<Date.now()}/**
467
+ * @license
468
+ * Copyright 2019 Google LLC
469
+ *
470
+ * Licensed under the Apache License, Version 2.0 (the "License");
471
+ * you may not use this file except in compliance with the License.
472
+ * You may obtain a copy of the License at
473
+ *
474
+ * http://www.apache.org/licenses/LICENSE-2.0
475
+ *
476
+ * Unless required by applicable law or agreed to in writing, software
477
+ * distributed under the License is distributed on an "AS IS" BASIS,
478
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
479
+ * See the License for the specific language governing permissions and
480
+ * limitations under the License.
481
+ */async function Un({appConfig:t,heartbeatServiceProvider:e},n){const r=Wn(t,n),a=Cn(t,n),i=e.getImmediate({optional:!0});if(i){const l=await i.getHeartbeatsHeader();l&&a.append("x-firebase-client",l)}const s={installation:{sdkVersion:Me,appId:t.appId}},o={method:"POST",headers:a,body:JSON.stringify(s)},c=await Fe(()=>fetch(r,o));if(c.ok){const l=await c.json();return Pe(l)}else throw await Le("Generate Auth Token",c)}function Wn(t,{fid:e}){return`${ke(t)}/${e}/authTokens:generate`}/**
482
+ * @license
483
+ * Copyright 2019 Google LLC
484
+ *
485
+ * Licensed under the Apache License, Version 2.0 (the "License");
486
+ * you may not use this file except in compliance with the License.
487
+ * You may obtain a copy of the License at
488
+ *
489
+ * http://www.apache.org/licenses/LICENSE-2.0
490
+ *
491
+ * Unless required by applicable law or agreed to in writing, software
492
+ * distributed under the License is distributed on an "AS IS" BASIS,
493
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
494
+ * See the License for the specific language governing permissions and
495
+ * limitations under the License.
496
+ */async function ee(t,e=!1){let n;const r=await L(t.appConfig,i=>{if(!qe(i))throw S.create("not-registered");const s=i.authToken;if(!e&&Kn(s))return i;if(s.requestStatus===1)return n=qn(t,e),i;{if(!navigator.onLine)throw S.create("app-offline");const o=Jn(i);return n=Gn(t,o),o}});return n?await n:r.authToken}async function qn(t,e){let n=await ue(t.appConfig);for(;n.authToken.requestStatus===1;)await je(100),n=await ue(t.appConfig);const r=n.authToken;return r.requestStatus===0?ee(t,e):r}function ue(t){return L(t,e=>{if(!qe(e))throw S.create("not-registered");const n=e.authToken;return Xn(n)?Object.assign(Object.assign({},e),{authToken:{requestStatus:0}}):e})}async function Gn(t,e){try{const n=await Un(t,e),r=Object.assign(Object.assign({},e),{authToken:n});return await M(t.appConfig,r),n}catch(n){if(Ne(n)&&(n.customData.serverCode===401||n.customData.serverCode===404))await Ue(t.appConfig);else{const r=Object.assign(Object.assign({},e),{authToken:{requestStatus:0}});await M(t.appConfig,r)}throw n}}function qe(t){return t!==void 0&&t.registrationStatus===2}function Kn(t){return t.requestStatus===2&&!Yn(t)}function Yn(t){const e=Date.now();return e<t.creationTime||t.creationTime+t.expiresIn<e+_n}function Jn(t){const e={requestStatus:1,requestTime:Date.now()};return Object.assign(Object.assign({},t),{authToken:e})}function Xn(t){return t.requestStatus===1&&t.requestTime+Be<Date.now()}/**
497
+ * @license
498
+ * Copyright 2019 Google LLC
499
+ *
500
+ * Licensed under the Apache License, Version 2.0 (the "License");
501
+ * you may not use this file except in compliance with the License.
502
+ * You may obtain a copy of the License at
503
+ *
504
+ * http://www.apache.org/licenses/LICENSE-2.0
505
+ *
506
+ * Unless required by applicable law or agreed to in writing, software
507
+ * distributed under the License is distributed on an "AS IS" BASIS,
508
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
509
+ * See the License for the specific language governing permissions and
510
+ * limitations under the License.
511
+ */async function Zn(t){const e=t,{installationEntry:n,registrationPromise:r}=await Q(e);return r?r.catch(console.error):ee(e).catch(console.error),n.fid}/**
512
+ * @license
513
+ * Copyright 2019 Google LLC
514
+ *
515
+ * Licensed under the Apache License, Version 2.0 (the "License");
516
+ * you may not use this file except in compliance with the License.
517
+ * You may obtain a copy of the License at
518
+ *
519
+ * http://www.apache.org/licenses/LICENSE-2.0
520
+ *
521
+ * Unless required by applicable law or agreed to in writing, software
522
+ * distributed under the License is distributed on an "AS IS" BASIS,
523
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
524
+ * See the License for the specific language governing permissions and
525
+ * limitations under the License.
526
+ */async function Qn(t,e=!1){const n=t;return await er(n),(await ee(n,e)).token}async function er(t){const{registrationPromise:e}=await Q(t);e&&await e}/**
527
+ * @license
528
+ * Copyright 2019 Google LLC
529
+ *
530
+ * Licensed under the Apache License, Version 2.0 (the "License");
531
+ * you may not use this file except in compliance with the License.
532
+ * You may obtain a copy of the License at
533
+ *
534
+ * http://www.apache.org/licenses/LICENSE-2.0
535
+ *
536
+ * Unless required by applicable law or agreed to in writing, software
537
+ * distributed under the License is distributed on an "AS IS" BASIS,
538
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
539
+ * See the License for the specific language governing permissions and
540
+ * limitations under the License.
541
+ */function tr(t){if(!t||!t.options)throw z("App Configuration");if(!t.name)throw z("App Name");const e=["projectId","apiKey","appId"];for(const n of e)if(!t.options[n])throw z(n);return{appName:t.name,projectId:t.options.projectId,apiKey:t.options.apiKey,appId:t.options.appId}}function z(t){return S.create("missing-app-config-values",{valueName:t})}/**
542
+ * @license
543
+ * Copyright 2020 Google LLC
544
+ *
545
+ * Licensed under the Apache License, Version 2.0 (the "License");
546
+ * you may not use this file except in compliance with the License.
547
+ * You may obtain a copy of the License at
548
+ *
549
+ * http://www.apache.org/licenses/LICENSE-2.0
550
+ *
551
+ * Unless required by applicable law or agreed to in writing, software
552
+ * distributed under the License is distributed on an "AS IS" BASIS,
553
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
554
+ * See the License for the specific language governing permissions and
555
+ * limitations under the License.
556
+ */const Ge="installations",nr="installations-internal",rr=t=>{const e=t.getProvider("app").getImmediate(),n=tr(e),r=k(e,"heartbeat");return{app:e,appConfig:n,heartbeatServiceProvider:r,_delete:()=>Promise.resolve()}},ar=t=>{const e=t.getProvider("app").getImmediate(),n=k(e,Ge).getImmediate();return{getId:()=>Zn(n),getToken:a=>Qn(n,a)}};function ir(){v(new y(Ge,rr,"PUBLIC")),v(new y(nr,ar,"PRIVATE"))}ir();I(Re,X);I(Re,X,"esm2017");/**
557
+ * @license
558
+ * Copyright 2019 Google LLC
559
+ *
560
+ * Licensed under the Apache License, Version 2.0 (the "License");
561
+ * you may not use this file except in compliance with the License.
562
+ * You may obtain a copy of the License at
563
+ *
564
+ * http://www.apache.org/licenses/LICENSE-2.0
565
+ *
566
+ * Unless required by applicable law or agreed to in writing, software
567
+ * distributed under the License is distributed on an "AS IS" BASIS,
568
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
569
+ * See the License for the specific language governing permissions and
570
+ * limitations under the License.
571
+ */const $="analytics",sr="firebase_id",or="origin",cr=60*1e3,lr="https://firebase.googleapis.com/v1alpha/projects/-/apps/{app-id}/webConfig",Ke="https://www.googletagmanager.com/gtag/js";/**
572
+ * @license
573
+ * Copyright 2019 Google LLC
574
+ *
575
+ * Licensed under the Apache License, Version 2.0 (the "License");
576
+ * you may not use this file except in compliance with the License.
577
+ * You may obtain a copy of the License at
578
+ *
579
+ * http://www.apache.org/licenses/LICENSE-2.0
580
+ *
581
+ * Unless required by applicable law or agreed to in writing, software
582
+ * distributed under the License is distributed on an "AS IS" BASIS,
583
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
584
+ * See the License for the specific language governing permissions and
585
+ * limitations under the License.
586
+ */const p=new ve("@firebase/analytics");/**
587
+ * @license
588
+ * Copyright 2019 Google LLC
589
+ *
590
+ * Licensed under the Apache License, Version 2.0 (the "License");
591
+ * you may not use this file except in compliance with the License.
592
+ * You may obtain a copy of the License at
593
+ *
594
+ * http://www.apache.org/licenses/LICENSE-2.0
595
+ *
596
+ * Unless required by applicable law or agreed to in writing, software
597
+ * distributed under the License is distributed on an "AS IS" BASIS,
598
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
599
+ * See the License for the specific language governing permissions and
600
+ * limitations under the License.
601
+ */function Ye(t){return Promise.all(t.map(e=>e.catch(n=>n)))}function dr(t,e){const n=document.createElement("script");n.src=`${Ke}?l=${t}&id=${e}`,n.async=!0,document.head.appendChild(n)}function ur(t){let e=[];return Array.isArray(window[t])?e=window[t]:window[t]=e,e}async function hr(t,e,n,r,a,i){const s=r[a];try{if(s)await e[s];else{const c=(await Ye(n)).find(l=>l.measurementId===a);c&&await e[c.appId]}}catch(o){p.error(o)}t("config",a,i)}async function fr(t,e,n,r,a){try{let i=[];if(a&&a.send_to){let s=a.send_to;Array.isArray(s)||(s=[s]);const o=await Ye(n);for(const c of s){const l=o.find(h=>h.measurementId===c),u=l&&e[l.appId];if(u)i.push(u);else{i=[];break}}}i.length===0&&(i=Object.values(e)),await Promise.all(i),t("event",r,a||{})}catch(i){p.error(i)}}function pr(t,e,n,r){async function a(i,s,o){try{i==="event"?await fr(t,e,n,s,o):i==="config"?await hr(t,e,n,r,s,o):i==="consent"?t("consent","update",o):t("set",s)}catch(c){p.error(c)}}return a}function mr(t,e,n,r,a){let i=function(...s){window[r].push(arguments)};return window[a]&&typeof window[a]=="function"&&(i=window[a]),window[a]=pr(i,t,e,n),{gtagCore:i,wrappedGtag:window[a]}}function gr(){const t=window.document.getElementsByTagName("script");for(const e of Object.values(t))if(e.src&&e.src.includes(Ke))return e;return null}/**
602
+ * @license
603
+ * Copyright 2019 Google LLC
604
+ *
605
+ * Licensed under the Apache License, Version 2.0 (the "License");
606
+ * you may not use this file except in compliance with the License.
607
+ * You may obtain a copy of the License at
608
+ *
609
+ * http://www.apache.org/licenses/LICENSE-2.0
610
+ *
611
+ * Unless required by applicable law or agreed to in writing, software
612
+ * distributed under the License is distributed on an "AS IS" BASIS,
613
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
614
+ * See the License for the specific language governing permissions and
615
+ * limitations under the License.
616
+ */const br={["already-exists"]:"A Firebase Analytics instance with the appId {$id} already exists. Only one Firebase Analytics instance can be created for each appId.",["already-initialized"]:"initializeAnalytics() cannot be called again with different options than those it was initially called with. It can be called again with the same options to return the existing instance, or getAnalytics() can be used to get a reference to the already-intialized instance.",["already-initialized-settings"]:"Firebase Analytics has already been initialized.settings() must be called before initializing any Analytics instanceor it will have no effect.",["interop-component-reg-failed"]:"Firebase Analytics Interop Component failed to instantiate: {$reason}",["invalid-analytics-context"]:"Firebase Analytics is not supported in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}",["indexeddb-unavailable"]:"IndexedDB unavailable or restricted in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}",["fetch-throttle"]:"The config fetch request timed out while in an exponential backoff state. Unix timestamp in milliseconds when fetch request throttling ends: {$throttleEndTimeMillis}.",["config-fetch-failed"]:"Dynamic config fetch failed: [{$httpStatus}] {$responseMessage}",["no-api-key"]:'The "apiKey" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid API key.',["no-app-id"]:'The "appId" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid app ID.'},g=new N("analytics","Analytics",br);/**
617
+ * @license
618
+ * Copyright 2020 Google LLC
619
+ *
620
+ * Licensed under the Apache License, Version 2.0 (the "License");
621
+ * you may not use this file except in compliance with the License.
622
+ * You may obtain a copy of the License at
623
+ *
624
+ * http://www.apache.org/licenses/LICENSE-2.0
625
+ *
626
+ * Unless required by applicable law or agreed to in writing, software
627
+ * distributed under the License is distributed on an "AS IS" BASIS,
628
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
629
+ * See the License for the specific language governing permissions and
630
+ * limitations under the License.
631
+ */const Ir=30,yr=1e3;class wr{constructor(e={},n=yr){this.throttleMetadata=e,this.intervalMillis=n}getThrottleMetadata(e){return this.throttleMetadata[e]}setThrottleMetadata(e,n){this.throttleMetadata[e]=n}deleteThrottleMetadata(e){delete this.throttleMetadata[e]}}const Je=new wr;function Er(t){return new Headers({Accept:"application/json","x-goog-api-key":t})}async function _r(t){var e;const{appId:n,apiKey:r}=t,a={method:"GET",headers:Er(r)},i=lr.replace("{app-id}",n),s=await fetch(i,a);if(s.status!==200&&s.status!==304){let o="";try{const c=await s.json();!((e=c.error)===null||e===void 0)&&e.message&&(o=c.error.message)}catch{}throw g.create("config-fetch-failed",{httpStatus:s.status,responseMessage:o})}return s.json()}async function vr(t,e=Je,n){const{appId:r,apiKey:a,measurementId:i}=t.options;if(!r)throw g.create("no-app-id");if(!a){if(i)return{measurementId:i,appId:r};throw g.create("no-api-key")}const s=e.getThrottleMetadata(r)||{backoffCount:0,throttleEndTimeMillis:Date.now()},o=new Cr;return setTimeout(async()=>{o.abort()},n!==void 0?n:cr),Xe({appId:r,apiKey:a,measurementId:i},s,o,e)}async function Xe(t,{throttleEndTimeMillis:e,backoffCount:n},r,a=Je){var i,s;const{appId:o,measurementId:c}=t;try{await Ar(r,e)}catch(l){if(c)return p.warn(`Timed out fetching this Firebase app's measurement ID from the server. Falling back to the measurement ID ${c} provided in the "measurementId" field in the local Firebase config. [${(i=l)===null||i===void 0?void 0:i.message}]`),{appId:o,measurementId:c};throw l}try{const l=await _r(t);return a.deleteThrottleMetadata(o),l}catch(l){const u=l;if(!Sr(u)){if(a.deleteThrottleMetadata(o),c)return p.warn(`Failed to fetch this Firebase app's measurement ID from the server. Falling back to the measurement ID ${c} provided in the "measurementId" field in the local Firebase config. [${u?.message}]`),{appId:o,measurementId:c};throw l}const h=Number((s=u?.customData)===null||s===void 0?void 0:s.httpStatus)===503?ne(n,a.intervalMillis,Ir):ne(n,a.intervalMillis),m={throttleEndTimeMillis:Date.now()+h,backoffCount:n+1};return a.setThrottleMetadata(o,m),p.debug(`Calling attemptFetch again in ${h} millis`),Xe(t,m,r,a)}}function Ar(t,e){return new Promise((n,r)=>{const a=Math.max(e-Date.now(),0),i=setTimeout(n,a);t.addEventListener(()=>{clearTimeout(i),r(g.create("fetch-throttle",{throttleEndTimeMillis:e}))})})}function Sr(t){if(!(t instanceof T)||!t.customData)return!1;const e=Number(t.customData.httpStatus);return e===429||e===500||e===503||e===504}class Cr{constructor(){this.listeners=[]}addEventListener(e){this.listeners.push(e)}abort(){this.listeners.forEach(e=>e())}}async function Tr(t,e,n,r,a){if(a&&a.global){t("event",n,r);return}else{const i=await e,s=Object.assign(Object.assign({},r),{send_to:i});t("event",n,s)}}/**
632
+ * @license
633
+ * Copyright 2020 Google LLC
634
+ *
635
+ * Licensed under the Apache License, Version 2.0 (the "License");
636
+ * you may not use this file except in compliance with the License.
637
+ * You may obtain a copy of the License at
638
+ *
639
+ * http://www.apache.org/licenses/LICENSE-2.0
640
+ *
641
+ * Unless required by applicable law or agreed to in writing, software
642
+ * distributed under the License is distributed on an "AS IS" BASIS,
643
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
644
+ * See the License for the specific language governing permissions and
645
+ * limitations under the License.
646
+ */async function Dr(){var t;if(we())try{await Ee()}catch(e){return p.warn(g.create("indexeddb-unavailable",{errorInfo:(t=e)===null||t===void 0?void 0:t.toString()}).message),!1}else return p.warn(g.create("indexeddb-unavailable",{errorInfo:"IndexedDB is not available in this environment."}).message),!1;return!0}async function Or(t,e,n,r,a,i,s){var o;const c=vr(t);c.then(f=>{n[f.measurementId]=f.appId,t.options.measurementId&&f.measurementId!==t.options.measurementId&&p.warn(`The measurement ID in the local Firebase config (${t.options.measurementId}) does not match the measurement ID fetched from the server (${f.measurementId}). To ensure analytics events are always sent to the correct Analytics property, update the measurement ID field in the local config or remove it from the local config.`)}).catch(f=>p.error(f)),e.push(c);const l=Dr().then(f=>{if(f)return r.getId()}),[u,h]=await Promise.all([c,l]);gr()||dr(i,u.measurementId),a("js",new Date);const m=(o=s?.config)!==null&&o!==void 0?o:{};return m[or]="firebase",m.update=!0,h!=null&&(m[sr]=h),a("config",u.measurementId,m),u.measurementId}/**
647
+ * @license
648
+ * Copyright 2019 Google LLC
649
+ *
650
+ * Licensed under the Apache License, Version 2.0 (the "License");
651
+ * you may not use this file except in compliance with the License.
652
+ * You may obtain a copy of the License at
653
+ *
654
+ * http://www.apache.org/licenses/LICENSE-2.0
655
+ *
656
+ * Unless required by applicable law or agreed to in writing, software
657
+ * distributed under the License is distributed on an "AS IS" BASIS,
658
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
659
+ * See the License for the specific language governing permissions and
660
+ * limitations under the License.
661
+ */class Rr{constructor(e){this.app=e}_delete(){return delete D[this.app.options.appId],Promise.resolve()}}let D={},he=[];const fe={};let U="dataLayer",Br="gtag",pe,Ze,me=!1;function Mr(){const t=[];if(at()&&t.push("This is a browser extension environment."),it()||t.push("Cookies are not available."),t.length>0){const e=t.map((r,a)=>`(${a+1}) ${r}`).join(" "),n=g.create("invalid-analytics-context",{errorInfo:e});p.warn(n.message)}}function $r(t,e,n){Mr();const r=t.options.appId;if(!r)throw g.create("no-app-id");if(!t.options.apiKey)if(t.options.measurementId)p.warn(`The "apiKey" field is empty in the local Firebase config. This is needed to fetch the latest measurement ID for this Firebase app. Falling back to the measurement ID ${t.options.measurementId} provided in the "measurementId" field in the local Firebase config.`);else throw g.create("no-api-key");if(D[r]!=null)throw g.create("already-exists",{id:r});if(!me){ur(U);const{wrappedGtag:i,gtagCore:s}=mr(D,he,fe,U,Br);Ze=i,pe=s,me=!0}return D[r]=Or(t,he,fe,e,pe,U,n),new Rr(t)}function Nr(t=ln()){t=_e(t);const e=k(t,$);return e.isInitialized()?e.getImmediate():kr(t)}function kr(t,e={}){const n=k(t,$);if(n.isInitialized()){const a=n.getImmediate();if(R(e,n.getOptions()))return a;throw g.create("already-initialized")}return n.initialize({options:e})}function Pr(t,e,n,r){t=_e(t),Tr(Ze,D[t.app.options.appId],e,n,r).catch(a=>p.error(a))}const ge="@firebase/analytics",be="0.8.0";function Lr(){v(new y($,(e,{options:n})=>{const r=e.getProvider("app").getImmediate(),a=e.getProvider("installations-internal").getImmediate();return $r(r,a,n)},"PUBLIC")),v(new y("analytics-internal",t,"PRIVATE")),I(ge,be),I(ge,be,"esm2017");function t(e){try{const n=e.getProvider($).getImmediate();return{logEvent:(r,a,i)=>Pr(n,r,a,i)}}catch(n){throw g.create("interop-component-reg-failed",{reason:n})}}}Lr();const xr=window.firebaseConfig||{apiKey:"AIzaSyCrVzemDgpyp9i6ni7Yc5ZuEVfXYwl-4J0",authDomain:"ecom2-002.firebaseapp.com",projectId:"ecom2-002",storageBucket:"ecom2-002.appspot.com",messagingSenderId:"402807248219",appId:"1:402807248219:web:cf7d57759751e74776367e",measurementId:"G-SC592CE0GB"},Fr=cn(xr);Nr(Fr);