@fleox-agent-crm/agentcrm 0.0.0-stage → 0.3.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.
- package/LICENSE +143 -0
- package/README.md +223 -2
- package/changelog.json +57 -0
- package/dist/admin/admin-files.json +26 -0
- package/dist/admin/assets/chartsImpl-CE2akJat.js +91 -0
- package/dist/admin/assets/firebase-BHSUggRo.js +2 -0
- package/dist/admin/assets/gitJson-BulGh2KV.js +3 -0
- package/dist/admin/assets/index-DidVVK7L.js +1181 -0
- package/dist/admin/assets/index-hMXwHSvN.css +1 -0
- package/dist/admin/assets/index.esm-BFc7vwnl.js +400 -0
- package/dist/admin/assets/index.esm-CtEQZRb1.js +1651 -0
- package/dist/admin/assets/index.esm-Dum0J07z.js +16 -0
- package/dist/admin/assets/index.esm2017-EOzKbpUS.js +390 -0
- package/dist/admin/assets/lucide-react.min-DEDlHCPj.js +6 -0
- package/dist/admin/assets/sdk-CnrLnlRo.js +1717 -0
- package/dist/admin/config.js +3 -0
- package/dist/admin/favicon.svg +1 -0
- package/dist/admin/index.html +139 -0
- package/dist/admin/runtime/agentcrm-runtime.js +104 -0
- package/dist/admin/runtime/lucide-react.js +791 -0
- package/dist/admin/runtime/react-dom-client.js +17 -0
- package/dist/admin/runtime/react-dom.js +20 -0
- package/dist/admin/runtime/react-i18next.js +19 -0
- package/dist/admin/runtime/react-jsx-runtime.js +17 -0
- package/dist/admin/runtime/react.js +22 -0
- package/dist/agent/agentcrm.mjs +3932 -0
- package/dist/agent/chunks/_commonjsHelpers-ClciMIcB.mjs +14 -0
- package/dist/agent/chunks/activities-Cj_SIOay.mjs +227 -0
- package/dist/agent/chunks/api-B6OqNVWp.mjs +97 -0
- package/dist/agent/chunks/appearance-BaShelzt.mjs +174 -0
- package/dist/agent/chunks/automations-BWrvLqP6.mjs +698 -0
- package/dist/agent/chunks/backup-ClSmxmFZ.mjs +103 -0
- package/dist/agent/chunks/batch-CVETiJj5.mjs +142 -0
- package/dist/agent/chunks/compact-CsFPaAAq.mjs +69 -0
- package/dist/agent/chunks/context-CxFfqS4D.mjs +65 -0
- package/dist/agent/chunks/core-Dy7vY9H6.mjs +255 -0
- package/dist/agent/chunks/dedupe-BepmsaHv.mjs +123 -0
- package/dist/agent/chunks/encoding-C9MzdP95.mjs +36 -0
- package/dist/agent/chunks/exportCsv-B5hRvkNm.mjs +95 -0
- package/dist/agent/chunks/extCheck--7lmVvl7.mjs +193 -0
- package/dist/agent/chunks/extPackage-BGl5Oqs8.mjs +115 -0
- package/dist/agent/chunks/extScaffold-DqxI7R1e.mjs +320 -0
- package/dist/agent/chunks/extensionActions-D2HtpQz4.mjs +48 -0
- package/dist/agent/chunks/extensions-BP1k60md.mjs +151 -0
- package/dist/agent/chunks/featureRegistry-C9nbVShp.mjs +149 -0
- package/dist/agent/chunks/fields-B0bitgmr.mjs +476 -0
- package/dist/agent/chunks/files-CjsPJSR6.mjs +158 -0
- package/dist/agent/chunks/files-q8Xu5bft.mjs +367 -0
- package/dist/agent/chunks/firebase-DxGVQV9E.mjs +454 -0
- package/dist/agent/chunks/firebaseRules-iori-s7U.mjs +221 -0
- package/dist/agent/chunks/forms-BKU5F9WF.mjs +847 -0
- package/dist/agent/chunks/gitJson-fjr8mcHe.mjs +528 -0
- package/dist/agent/chunks/hosting-Bme7LxPc.mjs +144 -0
- package/dist/agent/chunks/http-Bk9ICb7I.mjs +127 -0
- package/dist/agent/chunks/ids-CvnmrMJX.mjs +59 -0
- package/dist/agent/chunks/ids-u-noYcy5.mjs +14 -0
- package/dist/agent/chunks/importCsv-DmE_sBch.mjs +334 -0
- package/dist/agent/chunks/index-B-4W0-P4.mjs +535 -0
- package/dist/agent/chunks/index-BM8qeGOb.mjs +2489 -0
- package/dist/agent/chunks/index-Bnmav-Oh.mjs +311 -0
- package/dist/agent/chunks/index-CRkw3_iF.mjs +147 -0
- package/dist/agent/chunks/index-CWrrF1wl.mjs +111 -0
- package/dist/agent/chunks/index-DUSdTBkz.mjs +2988 -0
- package/dist/agent/chunks/index-RCmo-uld.mjs +26 -0
- package/dist/agent/chunks/index-w03ReRs4.mjs +9780 -0
- package/dist/agent/chunks/install-CpHoUFtL.mjs +188 -0
- package/dist/agent/chunks/jsx-runtime-Ca2uwGDr.mjs +76 -0
- package/dist/agent/chunks/loader-C9nm3iwx.mjs +184 -0
- package/dist/agent/chunks/lucide-react.min-Bt3gtepY.mjs +64 -0
- package/dist/agent/chunks/memory-WNR3VHUJ.mjs +56 -0
- package/dist/agent/chunks/migrate-CsClnnN8.mjs +182 -0
- package/dist/agent/chunks/modules-CqdVQVJb.mjs +177 -0
- package/dist/agent/chunks/nodeImport-BPCt5uMu.mjs +38 -0
- package/dist/agent/chunks/package-DWbn3t2R.mjs +194 -0
- package/dist/agent/chunks/papaparse-DjBYnQM2.mjs +1285 -0
- package/dist/agent/chunks/pipelines-DCdRBNBV.mjs +234 -0
- package/dist/agent/chunks/plan-C0TBrU92.mjs +254 -0
- package/dist/agent/chunks/pluginRegistry-DyHtlkcr.mjs +83 -0
- package/dist/agent/chunks/query-C5nJB_3C.mjs +192 -0
- package/dist/agent/chunks/records-DoqiT9xR.mjs +2191 -0
- package/dist/agent/chunks/registry-Ceexawxl.mjs +182 -0
- package/dist/agent/chunks/registry-DijAKZ24.mjs +431 -0
- package/dist/agent/chunks/relations-B9TynBmA.mjs +191 -0
- package/dist/agent/chunks/reports-BB59N6ke.mjs +189 -0
- package/dist/agent/chunks/runtime-DHo7ZEEO.mjs +14852 -0
- package/dist/agent/chunks/runtimeConfig-CCOFg1RM.mjs +250 -0
- package/dist/agent/chunks/s3-Dz50-NuA.mjs +903 -0
- package/dist/agent/chunks/schema-7-4-qtSS.mjs +203 -0
- package/dist/agent/chunks/schema-DlHt2PxI.mjs +367 -0
- package/dist/agent/chunks/sdk-whvfg786.mjs +43644 -0
- package/dist/agent/chunks/seed-CugPGYZL.mjs +523 -0
- package/dist/agent/chunks/server-ISwlDRCN.mjs +242 -0
- package/dist/agent/chunks/settings-BtvR_jdm.mjs +76 -0
- package/dist/agent/chunks/standardObjects-CheqfDqa.mjs +243 -0
- package/dist/agent/chunks/stats-CfeJssSS.mjs +51 -0
- package/dist/agent/chunks/store-5gqRSKXg.mjs +122 -0
- package/dist/agent/chunks/themes-DPZFv3yc.mjs +43 -0
- package/dist/agent/chunks/tools-Bew8lxKx.mjs +844 -0
- package/dist/agent/chunks/types-BOy9PUl7.mjs +44 -0
- package/dist/agent/chunks/users-DI1BvS0f.mjs +107 -0
- package/dist/agent/chunks/utils-DmI8FtXP.mjs +83 -0
- package/dist/agent/chunks/views-fO_BM5U_.mjs +109 -0
- package/dist/version.json +7 -0
- package/package.json +97 -4
- package/plugin/.claude-plugin/plugin.json +17 -0
- package/plugin/skills/agentcrm-admin/SKILL.md +191 -0
- package/plugin/skills/agentcrm-admin/references/appearance.md +26 -0
- package/plugin/skills/agentcrm-admin/references/import.md +16 -0
- package/plugin/skills/agentcrm-admin/references/records.md +30 -0
- package/plugin/skills/agentcrm-admin/references/schema.md +59 -0
- package/plugin/skills/agentcrm-extensions/SKILL.md +93 -0
- package/plugin/skills/agentcrm-extensions/references/module-recipes.md +213 -0
- package/plugin/skills/agentcrm-extensions/references/runtime-api.md +41 -0
- package/plugin/skills/agentcrm-extensions/references/testing.md +76 -0
- package/plugin/skills/agentcrm-extensions/references/theme-recipes.md +65 -0
- package/plugin/skills/agentcrm-install/SKILL.md +116 -0
- package/plugin/skills/agentcrm-install/references/firebase.md +18 -0
- package/plugin/skills/agentcrm-install/references/github.md +20 -0
- package/plugin/skills/agentcrm-install/references/mcp.md +17 -0
- package/plugin/skills/agentcrm-install/references/plans.md +45 -0
- package/plugin/skills/agentcrm-install/references/s3.md +24 -0
- package/plugin/skills/agentcrm-manage/SKILL.md +108 -0
- package/plugin/skills/agentcrm-manage/references/cron.md +11 -0
- package/plugin/skills/agentcrm-manage/references/doctor.md +18 -0
- package/plugin/skills/agentcrm-sales/SKILL.md +92 -0
- package/plugin/skills/agentcrm-sales/references/enrichment.md +13 -0
- package/plugin/skills/agentcrm-sales/references/playbooks.md +29 -0
- package/plugin/skills/agentcrm-sales/references/weekly-report.md +27 -0
- package/types/agentcrm-runtime.d.ts +894 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{r as e,g as p}from"./index.esm2017-EOzKbpUS.js";import{F as n,S as t,D as _,_ as m,a as v,b as A,c as g,d,e as l,f as S,h as b,i as c,j as E,k as F,l as f,m as C,n as L,o as D,p as N,s as O}from"./index.esm2017-EOzKbpUS.js";var s="firebase",a="11.10.0";/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2020 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
|
+
*/e(s,a,"app");export{n as FirebaseError,t as SDK_VERSION,_ as _DEFAULT_ENTRY_NAME,m as _addComponent,v as _addOrOverwriteComponent,A as _apps,g as _clearComponents,d as _components,l as _getProvider,S as _isFirebaseApp,b as _isFirebaseServerApp,c as _registerComponent,E as _removeServiceInstance,F as _serverApps,f as deleteApp,C as getApp,p as getApps,L as initializeApp,D as initializeServerApp,N as onLog,e as registerVersion,O as setLogLevel};
|
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
const Ee=()=>{};var Z={};/**
|
|
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
|
+
*/const oe=function(t){const e=[];let n=0;for(let r=0;r<t.length;r++){let s=t.charCodeAt(r);s<128?e[n++]=s:s<2048?(e[n++]=s>>6|192,e[n++]=s&63|128):(s&64512)===55296&&r+1<t.length&&(t.charCodeAt(r+1)&64512)===56320?(s=65536+((s&1023)<<10)+(t.charCodeAt(++r)&1023),e[n++]=s>>18|240,e[n++]=s>>12&63|128,e[n++]=s>>6&63|128,e[n++]=s&63|128):(e[n++]=s>>12|224,e[n++]=s>>6&63|128,e[n++]=s&63|128)}return e},Ce=function(t){const e=[];let n=0,r=0;for(;n<t.length;){const s=t[n++];if(s<128)e[r++]=String.fromCharCode(s);else if(s>191&&s<224){const i=t[n++];e[r++]=String.fromCharCode((s&31)<<6|i&63)}else if(s>239&&s<365){const i=t[n++],o=t[n++],l=t[n++],c=((s&7)<<18|(i&63)<<12|(o&63)<<6|l&63)-65536;e[r++]=String.fromCharCode(55296+(c>>10)),e[r++]=String.fromCharCode(56320+(c&1023))}else{const i=t[n++],o=t[n++];e[r++]=String.fromCharCode((s&15)<<12|(i&63)<<6|o&63)}}return e.join("")},ae={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 s=0;s<t.length;s+=3){const i=t[s],o=s+1<t.length,l=o?t[s+1]:0,c=s+2<t.length,u=c?t[s+2]:0,v=i>>2,p=(i&3)<<4|l>>4;let a=(l&15)<<2|u>>6,f=u&63;c||(f=64,o||(a=64)),r.push(n[v],n[p],n[a],n[f])}return r.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(oe(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):Ce(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let s=0;s<t.length;){const i=n[t.charAt(s++)],l=s<t.length?n[t.charAt(s)]:0;++s;const u=s<t.length?n[t.charAt(s)]:64;++s;const p=s<t.length?n[t.charAt(s)]:64;if(++s,i==null||l==null||u==null||p==null)throw new we;const a=i<<2|l>>4;if(r.push(a),u!==64){const f=l<<4&240|u>>2;if(r.push(f),p!==64){const _=u<<6&192|p;r.push(_)}}}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)}}};class we extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const Ie=function(t){const e=oe(t);return ae.encodeByteArray(e,!0)},O=function(t){return Ie(t).replace(/\./g,"")},ce=function(t){try{return ae.decodeString(t,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/**
|
|
17
|
+
* @license
|
|
18
|
+
* Copyright 2022 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
|
+
*/function De(){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.")}/**
|
|
32
|
+
* @license
|
|
33
|
+
* Copyright 2022 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
|
+
*/const Se=()=>De().__FIREBASE_DEFAULTS__,Ae=()=>{if(typeof process>"u"||typeof Z>"u")return;const t=Z.__FIREBASE_DEFAULTS__;if(t)return JSON.parse(t)},Oe=()=>{if(typeof document>"u")return;let t;try{t=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=t&&ce(t[1]);return e&&JSON.parse(e)},R=()=>{try{return Ee()||Se()||Ae()||Oe()}catch(t){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${t}`);return}},Be=t=>{var e,n;return(n=(e=R())===null||e===void 0?void 0:e.emulatorHosts)===null||n===void 0?void 0:n[t]},tn=t=>{const e=Be(t);if(!e)return;const n=e.lastIndexOf(":");if(n<=0||n+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const r=parseInt(e.substring(n+1),10);return e[0]==="["?[e.substring(1,n-1),r]:[e.substring(0,n),r]},le=()=>{var t;return(t=R())===null||t===void 0?void 0:t.config},nn=t=>{var e;return(e=R())===null||e===void 0?void 0:e[`_${t}`]};/**
|
|
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
|
+
*/class Te{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))}}}/**
|
|
62
|
+
* @license
|
|
63
|
+
* Copyright 2025 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
|
+
*/function Me(t){try{return(t.startsWith("http://")||t.startsWith("https://")?new URL(t).hostname:t).endsWith(".cloudworkstations.dev")}catch{return!1}}async function rn(t){return(await fetch(t,{credentials:"include"})).ok}/**
|
|
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 sn(t,e){if(t.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n={alg:"none",type:"JWT"},r=e||"demo-project",s=t.iat||0,i=t.sub||t.user_id;if(!i)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const o=Object.assign({iss:`https://securetoken.google.com/${r}`,aud:r,iat:s,exp:s+3600,auth_time:s,sub:i,user_id:i,firebase:{sign_in_provider:"custom",identities:{}}},t);return[O(JSON.stringify(n)),O(JSON.stringify(o)),""].join(".")}const E={};function Re(){const t={prod:[],emulator:[]};for(const e of Object.keys(E))E[e]?t.emulator.push(e):t.prod.push(e);return t}function xe(t){let e=document.getElementById(t),n=!1;return e||(e=document.createElement("div"),e.setAttribute("id",t),n=!0),{created:n,element:e}}let Y=!1;function on(t,e){if(typeof window>"u"||typeof document>"u"||!Me(window.location.host)||E[t]===e||E[t]||Y)return;E[t]=e;function n(a){return`__firebase__banner__${a}`}const r="__firebase__banner",i=Re().prod.length>0;function o(){const a=document.getElementById(r);a&&a.remove()}function l(a){a.style.display="flex",a.style.background="#7faaf0",a.style.position="fixed",a.style.bottom="5px",a.style.left="5px",a.style.padding=".5em",a.style.borderRadius="5px",a.style.alignItems="center"}function c(a,f){a.setAttribute("width","24"),a.setAttribute("id",f),a.setAttribute("height","24"),a.setAttribute("viewBox","0 0 24 24"),a.setAttribute("fill","none"),a.style.marginLeft="-6px"}function u(){const a=document.createElement("span");return a.style.cursor="pointer",a.style.marginLeft="16px",a.style.fontSize="24px",a.innerHTML=" ×",a.onclick=()=>{Y=!0,o()},a}function v(a,f){a.setAttribute("id",f),a.innerText="Learn more",a.href="https://firebase.google.com/docs/studio/preview-apps#preview-backend",a.setAttribute("target","__blank"),a.style.paddingLeft="5px",a.style.textDecoration="underline"}function p(){const a=xe(r),f=n("text"),_=document.getElementById(f)||document.createElement("span"),G=n("learnmore"),J=document.getElementById(G)||document.createElement("a"),K=n("preprendIcon"),S=document.getElementById(K)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(a.created){const x=a.element;l(x),v(J,G);const _e=u();c(S,K),x.append(S,_,J,_e),document.body.appendChild(x)}i?(_.innerText="Preview backend disconnected.",S.innerHTML=`<g clip-path="url(#clip0_6013_33858)">
|
|
92
|
+
<path d="M4.8 17.6L12 5.6L19.2 17.6H4.8ZM6.91667 16.4H17.0833L12 7.93333L6.91667 16.4ZM12 15.6C12.1667 15.6 12.3056 15.5444 12.4167 15.4333C12.5389 15.3111 12.6 15.1667 12.6 15C12.6 14.8333 12.5389 14.6944 12.4167 14.5833C12.3056 14.4611 12.1667 14.4 12 14.4C11.8333 14.4 11.6889 14.4611 11.5667 14.5833C11.4556 14.6944 11.4 14.8333 11.4 15C11.4 15.1667 11.4556 15.3111 11.5667 15.4333C11.6889 15.5444 11.8333 15.6 12 15.6ZM11.4 13.6H12.6V10.4H11.4V13.6Z" fill="#212121"/>
|
|
93
|
+
</g>
|
|
94
|
+
<defs>
|
|
95
|
+
<clipPath id="clip0_6013_33858">
|
|
96
|
+
<rect width="24" height="24" fill="white"/>
|
|
97
|
+
</clipPath>
|
|
98
|
+
</defs>`):(S.innerHTML=`<g clip-path="url(#clip0_6083_34804)">
|
|
99
|
+
<path d="M11.4 15.2H12.6V11.2H11.4V15.2ZM12 10C12.1667 10 12.3056 9.94444 12.4167 9.83333C12.5389 9.71111 12.6 9.56667 12.6 9.4C12.6 9.23333 12.5389 9.09444 12.4167 8.98333C12.3056 8.86111 12.1667 8.8 12 8.8C11.8333 8.8 11.6889 8.86111 11.5667 8.98333C11.4556 9.09444 11.4 9.23333 11.4 9.4C11.4 9.56667 11.4556 9.71111 11.5667 9.83333C11.6889 9.94444 11.8333 10 12 10ZM12 18.4C11.1222 18.4 10.2944 18.2333 9.51667 17.9C8.73889 17.5667 8.05556 17.1111 7.46667 16.5333C6.88889 15.9444 6.43333 15.2611 6.1 14.4833C5.76667 13.7056 5.6 12.8778 5.6 12C5.6 11.1111 5.76667 10.2833 6.1 9.51667C6.43333 8.73889 6.88889 8.06111 7.46667 7.48333C8.05556 6.89444 8.73889 6.43333 9.51667 6.1C10.2944 5.76667 11.1222 5.6 12 5.6C12.8889 5.6 13.7167 5.76667 14.4833 6.1C15.2611 6.43333 15.9389 6.89444 16.5167 7.48333C17.1056 8.06111 17.5667 8.73889 17.9 9.51667C18.2333 10.2833 18.4 11.1111 18.4 12C18.4 12.8778 18.2333 13.7056 17.9 14.4833C17.5667 15.2611 17.1056 15.9444 16.5167 16.5333C15.9389 17.1111 15.2611 17.5667 14.4833 17.9C13.7167 18.2333 12.8889 18.4 12 18.4ZM12 17.2C13.4444 17.2 14.6722 16.6944 15.6833 15.6833C16.6944 14.6722 17.2 13.4444 17.2 12C17.2 10.5556 16.6944 9.32778 15.6833 8.31667C14.6722 7.30555 13.4444 6.8 12 6.8C10.5556 6.8 9.32778 7.30555 8.31667 8.31667C7.30556 9.32778 6.8 10.5556 6.8 12C6.8 13.4444 7.30556 14.6722 8.31667 15.6833C9.32778 16.6944 10.5556 17.2 12 17.2Z" fill="#212121"/>
|
|
100
|
+
</g>
|
|
101
|
+
<defs>
|
|
102
|
+
<clipPath id="clip0_6083_34804">
|
|
103
|
+
<rect width="24" height="24" fill="white"/>
|
|
104
|
+
</clipPath>
|
|
105
|
+
</defs>`,_.innerText="Preview backend running in this workspace."),_.setAttribute("id",f)}document.readyState==="loading"?window.addEventListener("DOMContentLoaded",p):p()}/**
|
|
106
|
+
* @license
|
|
107
|
+
* Copyright 2017 Google LLC
|
|
108
|
+
*
|
|
109
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
110
|
+
* you may not use this file except in compliance with the License.
|
|
111
|
+
* You may obtain a copy of the License at
|
|
112
|
+
*
|
|
113
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
114
|
+
*
|
|
115
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
116
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
117
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
118
|
+
* See the License for the specific language governing permissions and
|
|
119
|
+
* limitations under the License.
|
|
120
|
+
*/function de(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function an(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(de())}function Ne(){var t;const e=(t=R())===null||t===void 0?void 0:t.forceEnvironment;if(e==="node")return!0;if(e==="browser")return!1;try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function Le(){return typeof window<"u"||ue()}function ue(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function cn(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function ln(){const t=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof t=="object"&&t.id!==void 0}function dn(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function un(){const t=de();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}function hn(){return!Ne()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function $e(){try{return typeof indexedDB=="object"}catch{return!1}}function He(){return new Promise((t,e)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",s=self.indexedDB.open(r);s.onsuccess=()=>{s.result.close(),n||self.indexedDB.deleteDatabase(r),t(!0)},s.onupgradeneeded=()=>{n=!1},s.onerror=()=>{var i;e(((i=s.error)===null||i===void 0?void 0:i.message)||"")}}catch(n){e(n)}})}/**
|
|
121
|
+
* @license
|
|
122
|
+
* Copyright 2017 Google LLC
|
|
123
|
+
*
|
|
124
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
125
|
+
* you may not use this file except in compliance with the License.
|
|
126
|
+
* You may obtain a copy of the License at
|
|
127
|
+
*
|
|
128
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
129
|
+
*
|
|
130
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
131
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
132
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
133
|
+
* See the License for the specific language governing permissions and
|
|
134
|
+
* limitations under the License.
|
|
135
|
+
*/const Pe="FirebaseError";class D extends Error{constructor(e,n,r){super(n),this.code=e,this.customData=r,this.name=Pe,Object.setPrototypeOf(this,D.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,he.prototype.create)}}class he{constructor(e,n,r){this.service=e,this.serviceName=n,this.errors=r}create(e,...n){const r=n[0]||{},s=`${this.service}/${e}`,i=this.errors[e],o=i?ke(i,r):"Error",l=`${this.serviceName}: ${o} (${s}).`;return new D(s,l,r)}}function ke(t,e){return t.replace(Fe,(n,r)=>{const s=e[r];return s!=null?String(s):`<${r}?>`})}const Fe=/\{\$([^}]+)}/g;function fn(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function k(t,e){if(t===e)return!0;const n=Object.keys(t),r=Object.keys(e);for(const s of n){if(!r.includes(s))return!1;const i=t[s],o=e[s];if(q(i)&&q(o)){if(!k(i,o))return!1}else if(i!==o)return!1}for(const s of r)if(!n.includes(s))return!1;return!0}function q(t){return t!==null&&typeof t=="object"}/**
|
|
136
|
+
* @license
|
|
137
|
+
* Copyright 2017 Google LLC
|
|
138
|
+
*
|
|
139
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
140
|
+
* you may not use this file except in compliance with the License.
|
|
141
|
+
* You may obtain a copy of the License at
|
|
142
|
+
*
|
|
143
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
144
|
+
*
|
|
145
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
146
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
147
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
148
|
+
* See the License for the specific language governing permissions and
|
|
149
|
+
* limitations under the License.
|
|
150
|
+
*/function pn(t){const e=[];for(const[n,r]of Object.entries(t))Array.isArray(r)?r.forEach(s=>{e.push(encodeURIComponent(n)+"="+encodeURIComponent(s))}):e.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}function mn(t){const e={};return t.replace(/^\?/,"").split("&").forEach(r=>{if(r){const[s,i]=r.split("=");e[decodeURIComponent(s)]=decodeURIComponent(i)}}),e}function gn(t){const e=t.indexOf("?");if(!e)return"";const n=t.indexOf("#",e);return t.substring(e,n>0?n:void 0)}function bn(t,e){const n=new je(t,e);return n.subscribe.bind(n)}class je{constructor(e,n){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=n,this.task.then(()=>{e(this)}).catch(r=>{this.error(r)})}next(e){this.forEachObserver(n=>{n.next(e)})}error(e){this.forEachObserver(n=>{n.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,n,r){let s;if(e===void 0&&n===void 0&&r===void 0)throw new Error("Missing Observer.");ze(e,["next","error","complete"])?s=e:s={next:e,error:n,complete:r},s.next===void 0&&(s.next=N),s.error===void 0&&(s.error=N),s.complete===void 0&&(s.complete=N);const i=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?s.error(this.finalError):s.complete()}catch{}}),this.observers.push(s),i}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 n=0;n<this.observers.length;n++)this.sendOne(n,e)}sendOne(e,n){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{n(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 ze(t,e){if(typeof t!="object"||t===null)return!1;for(const n of e)if(n in t&&typeof t[n]=="function")return!0;return!1}function N(){}/**
|
|
151
|
+
* @license
|
|
152
|
+
* Copyright 2021 Google LLC
|
|
153
|
+
*
|
|
154
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
155
|
+
* you may not use this file except in compliance with the License.
|
|
156
|
+
* You may obtain a copy of the License at
|
|
157
|
+
*
|
|
158
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
159
|
+
*
|
|
160
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
161
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
162
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
163
|
+
* See the License for the specific language governing permissions and
|
|
164
|
+
* limitations under the License.
|
|
165
|
+
*/function yn(t){return t&&t._delegate?t._delegate:t}class B{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}}/**
|
|
166
|
+
* @license
|
|
167
|
+
* Copyright 2019 Google LLC
|
|
168
|
+
*
|
|
169
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
170
|
+
* you may not use this file except in compliance with the License.
|
|
171
|
+
* You may obtain a copy of the License at
|
|
172
|
+
*
|
|
173
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
174
|
+
*
|
|
175
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
176
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
177
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
178
|
+
* See the License for the specific language governing permissions and
|
|
179
|
+
* limitations under the License.
|
|
180
|
+
*/const b="[DEFAULT]";/**
|
|
181
|
+
* @license
|
|
182
|
+
* Copyright 2019 Google LLC
|
|
183
|
+
*
|
|
184
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
185
|
+
* you may not use this file except in compliance with the License.
|
|
186
|
+
* You may obtain a copy of the License at
|
|
187
|
+
*
|
|
188
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
189
|
+
*
|
|
190
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
191
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
192
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
193
|
+
* See the License for the specific language governing permissions and
|
|
194
|
+
* limitations under the License.
|
|
195
|
+
*/class Ue{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 Te;if(this.instancesDeferred.set(n,r),this.isInitialized(n)||this.shouldAutoInitialize())try{const s=this.getOrInitializeService({instanceIdentifier:n});s&&r.resolve(s)}catch{}}return this.instancesDeferred.get(n).promise}getImmediate(e){var n;const r=this.normalizeInstanceIdentifier(e==null?void 0:e.identifier),s=(n=e==null?void 0:e.optional)!==null&&n!==void 0?n:!1;if(this.isInitialized(r)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:r})}catch(i){if(s)return null;throw i}else{if(s)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(We(e))try{this.getOrInitializeService({instanceIdentifier:b})}catch{}for(const[n,r]of this.instancesDeferred.entries()){const s=this.normalizeInstanceIdentifier(n);try{const i=this.getOrInitializeService({instanceIdentifier:s});r.resolve(i)}catch{}}}}clearInstance(e=b){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=b){return this.instances.has(e)}getOptions(e=b){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 s=this.getOrInitializeService({instanceIdentifier:r,options:n});for(const[i,o]of this.instancesDeferred.entries()){const l=this.normalizeInstanceIdentifier(i);r===l&&o.resolve(s)}return s}onInit(e,n){var r;const s=this.normalizeInstanceIdentifier(n),i=(r=this.onInitCallbacks.get(s))!==null&&r!==void 0?r:new Set;i.add(e),this.onInitCallbacks.set(s,i);const o=this.instances.get(s);return o&&e(o,s),()=>{i.delete(e)}}invokeOnInitCallbacks(e,n){const r=this.onInitCallbacks.get(n);if(r)for(const s of r)try{s(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:Ve(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=b){return this.component?this.component.multipleInstances?e:b:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function Ve(t){return t===b?void 0:t}function We(t){return t.instantiationMode==="EAGER"}/**
|
|
196
|
+
* @license
|
|
197
|
+
* Copyright 2019 Google LLC
|
|
198
|
+
*
|
|
199
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
200
|
+
* you may not use this file except in compliance with the License.
|
|
201
|
+
* You may obtain a copy of the License at
|
|
202
|
+
*
|
|
203
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
204
|
+
*
|
|
205
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
206
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
207
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
208
|
+
* See the License for the specific language governing permissions and
|
|
209
|
+
* limitations under the License.
|
|
210
|
+
*/class fe{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 Ue(e,this);return this.providers.set(e,n),n}getProviders(){return Array.from(this.providers.values())}}/**
|
|
211
|
+
* @license
|
|
212
|
+
* Copyright 2017 Google LLC
|
|
213
|
+
*
|
|
214
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
215
|
+
* you may not use this file except in compliance with the License.
|
|
216
|
+
* You may obtain a copy of the License at
|
|
217
|
+
*
|
|
218
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
219
|
+
*
|
|
220
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
221
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
222
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
223
|
+
* See the License for the specific language governing permissions and
|
|
224
|
+
* limitations under the License.
|
|
225
|
+
*/const V=[];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 pe={debug:d.DEBUG,verbose:d.VERBOSE,info:d.INFO,warn:d.WARN,error:d.ERROR,silent:d.SILENT},Ge=d.INFO,Je={[d.DEBUG]:"log",[d.VERBOSE]:"log",[d.INFO]:"info",[d.WARN]:"warn",[d.ERROR]:"error"},Ke=(t,e,...n)=>{if(e<t.logLevel)return;const r=new Date().toISOString(),s=Je[e];if(s)console[s](`[${r}] ${t.name}:`,...n);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)};class Ze{constructor(e){this.name=e,this._logLevel=Ge,this._logHandler=Ke,this._userLogHandler=null,V.push(this)}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"?pe[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)}}function Ye(t){V.forEach(e=>{e.setLogLevel(t)})}function qe(t,e){for(const n of V){let r=null;e&&e.level&&(r=pe[e.level]),t===null?n.userLogHandler=null:n.userLogHandler=(s,i,...o)=>{const l=o.map(c=>{if(c==null)return null;if(typeof c=="string")return c;if(typeof c=="number"||typeof c=="boolean")return c.toString();if(c instanceof Error)return c.message;try{return JSON.stringify(c)}catch{return null}}).filter(c=>c).join(" ");i>=(r??s.logLevel)&&t({level:d[i].toLowerCase(),message:l,args:o,type:s.name})}}}const Xe=(t,e)=>e.some(n=>t instanceof n);let X,Q;function Qe(){return X||(X=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function et(){return Q||(Q=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const me=new WeakMap,F=new WeakMap,ge=new WeakMap,L=new WeakMap,W=new WeakMap;function tt(t){const e=new Promise((n,r)=>{const s=()=>{t.removeEventListener("success",i),t.removeEventListener("error",o)},i=()=>{n(g(t.result)),s()},o=()=>{r(t.error),s()};t.addEventListener("success",i),t.addEventListener("error",o)});return e.then(n=>{n instanceof IDBCursor&&me.set(n,t)}).catch(()=>{}),W.set(e,t),e}function nt(t){if(F.has(t))return;const e=new Promise((n,r)=>{const s=()=>{t.removeEventListener("complete",i),t.removeEventListener("error",o),t.removeEventListener("abort",o)},i=()=>{n(),s()},o=()=>{r(t.error||new DOMException("AbortError","AbortError")),s()};t.addEventListener("complete",i),t.addEventListener("error",o),t.addEventListener("abort",o)});F.set(t,e)}let j={get(t,e,n){if(t instanceof IDBTransaction){if(e==="done")return F.get(t);if(e==="objectStoreNames")return t.objectStoreNames||ge.get(t);if(e==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return g(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 rt(t){j=t(j)}function st(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...n){const r=t.call($(this),e,...n);return ge.set(r,e.sort?e.sort():[e]),g(r)}:et().includes(t)?function(...e){return t.apply($(this),e),g(me.get(this))}:function(...e){return g(t.apply($(this),e))}}function it(t){return typeof t=="function"?st(t):(t instanceof IDBTransaction&&nt(t),Xe(t,Qe())?new Proxy(t,j):t)}function g(t){if(t instanceof IDBRequest)return tt(t);if(L.has(t))return L.get(t);const e=it(t);return e!==t&&(L.set(t,e),W.set(e,t)),e}const $=t=>W.get(t);function ot(t,e,{blocked:n,upgrade:r,blocking:s,terminated:i}={}){const o=indexedDB.open(t,e),l=g(o);return r&&o.addEventListener("upgradeneeded",c=>{r(g(o.result),c.oldVersion,c.newVersion,g(o.transaction),c)}),n&&o.addEventListener("blocked",c=>n(c.oldVersion,c.newVersion,c)),l.then(c=>{i&&c.addEventListener("close",()=>i()),s&&c.addEventListener("versionchange",u=>s(u.oldVersion,u.newVersion,u))}).catch(()=>{}),l}const at=["get","getKey","getAll","getAllKeys","count"],ct=["put","add","delete","clear"],H=new Map;function ee(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(H.get(e))return H.get(e);const n=e.replace(/FromIndex$/,""),r=e!==n,s=ct.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(s||at.includes(n)))return;const i=async function(o,...l){const c=this.transaction(o,s?"readwrite":"readonly");let u=c.store;return r&&(u=u.index(l.shift())),(await Promise.all([u[n](...l),s&&c.done]))[0]};return H.set(e,i),i}rt(t=>({...t,get:(e,n,r)=>ee(e,n)||t.get(e,n,r),has:(e,n)=>!!ee(e,n)||t.has(e,n)}));/**
|
|
226
|
+
* @license
|
|
227
|
+
* Copyright 2019 Google LLC
|
|
228
|
+
*
|
|
229
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
230
|
+
* you may not use this file except in compliance with the License.
|
|
231
|
+
* You may obtain a copy of the License at
|
|
232
|
+
*
|
|
233
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
234
|
+
*
|
|
235
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
236
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
237
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
238
|
+
* See the License for the specific language governing permissions and
|
|
239
|
+
* limitations under the License.
|
|
240
|
+
*/class lt{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(dt(n)){const r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}}function dt(t){const e=t.getComponent();return(e==null?void 0:e.type)==="VERSION"}const T="@firebase/app",z="0.13.2";/**
|
|
241
|
+
* @license
|
|
242
|
+
* Copyright 2019 Google LLC
|
|
243
|
+
*
|
|
244
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
245
|
+
* you may not use this file except in compliance with the License.
|
|
246
|
+
* You may obtain a copy of the License at
|
|
247
|
+
*
|
|
248
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
249
|
+
*
|
|
250
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
251
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
252
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
253
|
+
* See the License for the specific language governing permissions and
|
|
254
|
+
* limitations under the License.
|
|
255
|
+
*/const m=new Ze("@firebase/app"),ut="@firebase/app-compat",ht="@firebase/analytics-compat",ft="@firebase/analytics",pt="@firebase/app-check-compat",mt="@firebase/app-check",gt="@firebase/auth",bt="@firebase/auth-compat",yt="@firebase/database",vt="@firebase/data-connect",_t="@firebase/database-compat",Et="@firebase/functions",Ct="@firebase/functions-compat",wt="@firebase/installations",It="@firebase/installations-compat",Dt="@firebase/messaging",St="@firebase/messaging-compat",At="@firebase/performance",Ot="@firebase/performance-compat",Bt="@firebase/remote-config",Tt="@firebase/remote-config-compat",Mt="@firebase/storage",Rt="@firebase/storage-compat",xt="@firebase/firestore",Nt="@firebase/ai",Lt="@firebase/firestore-compat",$t="firebase",Ht="11.10.0";/**
|
|
256
|
+
* @license
|
|
257
|
+
* Copyright 2019 Google LLC
|
|
258
|
+
*
|
|
259
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
260
|
+
* you may not use this file except in compliance with the License.
|
|
261
|
+
* You may obtain a copy of the License at
|
|
262
|
+
*
|
|
263
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
264
|
+
*
|
|
265
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
266
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
267
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
268
|
+
* See the License for the specific language governing permissions and
|
|
269
|
+
* limitations under the License.
|
|
270
|
+
*/const M="[DEFAULT]",Pt={[T]:"fire-core",[ut]:"fire-core-compat",[ft]:"fire-analytics",[ht]:"fire-analytics-compat",[mt]:"fire-app-check",[pt]:"fire-app-check-compat",[gt]:"fire-auth",[bt]:"fire-auth-compat",[yt]:"fire-rtdb",[vt]:"fire-data-connect",[_t]:"fire-rtdb-compat",[Et]:"fire-fn",[Ct]:"fire-fn-compat",[wt]:"fire-iid",[It]:"fire-iid-compat",[Dt]:"fire-fcm",[St]:"fire-fcm-compat",[At]:"fire-perf",[Ot]:"fire-perf-compat",[Bt]:"fire-rc",[Tt]:"fire-rc-compat",[Mt]:"fire-gcs",[Rt]:"fire-gcs-compat",[xt]:"fire-fst",[Lt]:"fire-fst-compat",[Nt]:"fire-vertex","fire-js":"fire-js",[$t]:"fire-js-all"};/**
|
|
271
|
+
* @license
|
|
272
|
+
* Copyright 2019 Google LLC
|
|
273
|
+
*
|
|
274
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
275
|
+
* you may not use this file except in compliance with the License.
|
|
276
|
+
* You may obtain a copy of the License at
|
|
277
|
+
*
|
|
278
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
279
|
+
*
|
|
280
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
281
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
282
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
283
|
+
* See the License for the specific language governing permissions and
|
|
284
|
+
* limitations under the License.
|
|
285
|
+
*/const y=new Map,C=new Map,w=new Map;function te(t,e){try{t.container.addComponent(e)}catch(n){m.debug(`Component ${e.name} failed to register with FirebaseApp ${t.name}`,n)}}function vn(t,e){t.container.addOrOverwriteComponent(e)}function U(t){const e=t.name;if(w.has(e))return m.debug(`There were multiple attempts to register component ${e}.`),!1;w.set(e,t);for(const n of y.values())te(n,t);for(const n of C.values())te(n,t);return!0}function kt(t,e){const n=t.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),t.container.getProvider(e)}function _n(t,e,n=M){kt(t,e).clearInstance(n)}function Ft(t){return t.options!==void 0}function En(t){return t==null?!1:t.settings!==void 0}function Cn(){w.clear()}/**
|
|
286
|
+
* @license
|
|
287
|
+
* Copyright 2019 Google LLC
|
|
288
|
+
*
|
|
289
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
290
|
+
* you may not use this file except in compliance with the License.
|
|
291
|
+
* You may obtain a copy of the License at
|
|
292
|
+
*
|
|
293
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
294
|
+
*
|
|
295
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
296
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
297
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
298
|
+
* See the License for the specific language governing permissions and
|
|
299
|
+
* limitations under the License.
|
|
300
|
+
*/const jt={"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","server-app-deleted":"Firebase Server App has been 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}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},h=new he("app","Firebase",jt);/**
|
|
301
|
+
* @license
|
|
302
|
+
* Copyright 2019 Google LLC
|
|
303
|
+
*
|
|
304
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
305
|
+
* you may not use this file except in compliance with the License.
|
|
306
|
+
* You may obtain a copy of the License at
|
|
307
|
+
*
|
|
308
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
309
|
+
*
|
|
310
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
311
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
312
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
313
|
+
* See the License for the specific language governing permissions and
|
|
314
|
+
* limitations under the License.
|
|
315
|
+
*/class be{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 B("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 h.create("app-deleted",{appName:this._name})}}/**
|
|
316
|
+
* @license
|
|
317
|
+
* Copyright 2023 Google LLC
|
|
318
|
+
*
|
|
319
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
320
|
+
* you may not use this file except in compliance with the License.
|
|
321
|
+
* You may obtain a copy of the License at
|
|
322
|
+
*
|
|
323
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
324
|
+
*
|
|
325
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
326
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
327
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
328
|
+
* See the License for the specific language governing permissions and
|
|
329
|
+
* limitations under the License.
|
|
330
|
+
*/function ne(t,e){const n=ce(t.split(".")[1]);if(n===null){console.error(`FirebaseServerApp ${e} is invalid: second part could not be parsed.`);return}if(JSON.parse(n).exp===void 0){console.error(`FirebaseServerApp ${e} is invalid: expiration claim could not be parsed`);return}const s=JSON.parse(n).exp*1e3,i=new Date().getTime();s-i<=0&&console.error(`FirebaseServerApp ${e} is invalid: the token has expired.`)}class zt extends be{constructor(e,n,r,s){const i=n.automaticDataCollectionEnabled!==void 0?n.automaticDataCollectionEnabled:!0,o={name:r,automaticDataCollectionEnabled:i};if(e.apiKey!==void 0)super(e,o,s);else{const l=e;super(l.options,o,s)}this._serverConfig=Object.assign({automaticDataCollectionEnabled:i},n),this._serverConfig.authIdToken&&ne(this._serverConfig.authIdToken,"authIdToken"),this._serverConfig.appCheckToken&&ne(this._serverConfig.appCheckToken,"appCheckToken"),this._finalizationRegistry=null,typeof FinalizationRegistry<"u"&&(this._finalizationRegistry=new FinalizationRegistry(()=>{this.automaticCleanup()})),this._refCount=0,this.incRefCount(this._serverConfig.releaseOnDeref),this._serverConfig.releaseOnDeref=void 0,n.releaseOnDeref=void 0,A(T,z,"serverapp")}toJSON(){}get refCount(){return this._refCount}incRefCount(e){this.isDeleted||(this._refCount++,e!==void 0&&this._finalizationRegistry!==null&&this._finalizationRegistry.register(e,this))}decRefCount(){return this.isDeleted?0:--this._refCount}automaticCleanup(){Vt(this)}get settings(){return this.checkDestroyed(),this._serverConfig}checkDestroyed(){if(this.isDeleted)throw h.create("server-app-deleted")}}/**
|
|
331
|
+
* @license
|
|
332
|
+
* Copyright 2019 Google LLC
|
|
333
|
+
*
|
|
334
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
335
|
+
* you may not use this file except in compliance with the License.
|
|
336
|
+
* You may obtain a copy of the License at
|
|
337
|
+
*
|
|
338
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
339
|
+
*
|
|
340
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
341
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
342
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
343
|
+
* See the License for the specific language governing permissions and
|
|
344
|
+
* limitations under the License.
|
|
345
|
+
*/const wn=Ht;function Ut(t,e={}){let n=t;typeof e!="object"&&(e={name:e});const r=Object.assign({name:M,automaticDataCollectionEnabled:!0},e),s=r.name;if(typeof s!="string"||!s)throw h.create("bad-app-name",{appName:String(s)});if(n||(n=le()),!n)throw h.create("no-options");const i=y.get(s);if(i){if(k(n,i.options)&&k(r,i.config))return i;throw h.create("duplicate-app",{appName:s})}const o=new fe(s);for(const c of w.values())o.addComponent(c);const l=new be(n,r,o);return y.set(s,l),l}function In(t,e){if(Le()&&!ue())throw h.create("invalid-server-app-environment");e.automaticDataCollectionEnabled===void 0&&(e.automaticDataCollectionEnabled=!0);let n;Ft(t)?n=t.options:n=t;const r=Object.assign(Object.assign({},e),n);r.releaseOnDeref!==void 0&&delete r.releaseOnDeref;const s=u=>[...u].reduce((v,p)=>Math.imul(31,v)+p.charCodeAt(0)|0,0);if(e.releaseOnDeref!==void 0&&typeof FinalizationRegistry>"u")throw h.create("finalization-registry-not-supported",{});const i=""+s(JSON.stringify(r)),o=C.get(i);if(o)return o.incRefCount(e.releaseOnDeref),o;const l=new fe(i);for(const u of w.values())l.addComponent(u);const c=new zt(n,e,i,l);return C.set(i,c),c}function Dn(t=M){const e=y.get(t);if(!e&&t===M&&le())return Ut();if(!e)throw h.create("no-app",{appName:t});return e}function Sn(){return Array.from(y.values())}async function Vt(t){let e=!1;const n=t.name;y.has(n)?(e=!0,y.delete(n)):C.has(n)&&t.decRefCount()<=0&&(C.delete(n),e=!0),e&&(await Promise.all(t.container.getProviders().map(r=>r.delete())),t.isDeleted=!0)}function A(t,e,n){var r;let s=(r=Pt[t])!==null&&r!==void 0?r:t;n&&(s+=`-${n}`);const i=s.match(/\s|\//),o=e.match(/\s|\//);if(i||o){const l=[`Unable to register library "${s}" with version "${e}":`];i&&l.push(`library name "${s}" contains illegal characters (whitespace or "/")`),i&&o&&l.push("and"),o&&l.push(`version name "${e}" contains illegal characters (whitespace or "/")`),m.warn(l.join(" "));return}U(new B(`${s}-version`,()=>({library:s,version:e}),"VERSION"))}function An(t,e){if(t!==null&&typeof t!="function")throw h.create("invalid-log-argument");qe(t,e)}function On(t){Ye(t)}/**
|
|
346
|
+
* @license
|
|
347
|
+
* Copyright 2021 Google LLC
|
|
348
|
+
*
|
|
349
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
350
|
+
* you may not use this file except in compliance with the License.
|
|
351
|
+
* You may obtain a copy of the License at
|
|
352
|
+
*
|
|
353
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
354
|
+
*
|
|
355
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
356
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
357
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
358
|
+
* See the License for the specific language governing permissions and
|
|
359
|
+
* limitations under the License.
|
|
360
|
+
*/const Wt="firebase-heartbeat-database",Gt=1,I="firebase-heartbeat-store";let P=null;function ye(){return P||(P=ot(Wt,Gt,{upgrade:(t,e)=>{switch(e){case 0:try{t.createObjectStore(I)}catch(n){console.warn(n)}}}}).catch(t=>{throw h.create("idb-open",{originalErrorMessage:t.message})})),P}async function Jt(t){try{const n=(await ye()).transaction(I),r=await n.objectStore(I).get(ve(t));return await n.done,r}catch(e){if(e instanceof D)m.warn(e.message);else{const n=h.create("idb-get",{originalErrorMessage:e==null?void 0:e.message});m.warn(n.message)}}}async function re(t,e){try{const r=(await ye()).transaction(I,"readwrite");await r.objectStore(I).put(e,ve(t)),await r.done}catch(n){if(n instanceof D)m.warn(n.message);else{const r=h.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});m.warn(r.message)}}}function ve(t){return`${t.name}!${t.options.appId}`}/**
|
|
361
|
+
* @license
|
|
362
|
+
* Copyright 2021 Google LLC
|
|
363
|
+
*
|
|
364
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
365
|
+
* you may not use this file except in compliance with the License.
|
|
366
|
+
* You may obtain a copy of the License at
|
|
367
|
+
*
|
|
368
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
369
|
+
*
|
|
370
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
371
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
372
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
373
|
+
* See the License for the specific language governing permissions and
|
|
374
|
+
* limitations under the License.
|
|
375
|
+
*/const Kt=1024,Zt=30;class Yt{constructor(e){this.container=e,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new Xt(n),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){var e,n;try{const s=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),i=se();if(((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((n=this._heartbeatsCache)===null||n===void 0?void 0:n.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===i||this._heartbeatsCache.heartbeats.some(o=>o.date===i))return;if(this._heartbeatsCache.heartbeats.push({date:i,agent:s}),this._heartbeatsCache.heartbeats.length>Zt){const o=Qt(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(o,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(r){m.warn(r)}}async getHeartbeatsHeader(){var e;try{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 n=se(),{heartbeatsToSend:r,unsentEntries:s}=qt(this._heartbeatsCache.heartbeats),i=O(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=n,s.length>0?(this._heartbeatsCache.heartbeats=s,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),i}catch(n){return m.warn(n),""}}}function se(){return new Date().toISOString().substring(0,10)}function qt(t,e=Kt){const n=[];let r=t.slice();for(const s of t){const i=n.find(o=>o.agent===s.agent);if(i){if(i.dates.push(s.date),ie(n)>e){i.dates.pop();break}}else if(n.push({agent:s.agent,dates:[s.date]}),ie(n)>e){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}class Xt{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return $e()?He().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await Jt(this.app);return n!=null&&n.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){var n;if(await this._canUseIndexedDBPromise){const s=await this.read();return re(this.app,{lastSentHeartbeatDate:(n=e.lastSentHeartbeatDate)!==null&&n!==void 0?n:s.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){var n;if(await this._canUseIndexedDBPromise){const s=await this.read();return re(this.app,{lastSentHeartbeatDate:(n=e.lastSentHeartbeatDate)!==null&&n!==void 0?n:s.lastSentHeartbeatDate,heartbeats:[...s.heartbeats,...e.heartbeats]})}else return}}function ie(t){return O(JSON.stringify({version:2,heartbeats:t})).length}function Qt(t){if(t.length===0)return-1;let e=0,n=t[0].date;for(let r=1;r<t.length;r++)t[r].date<n&&(n=t[r].date,e=r);return e}/**
|
|
376
|
+
* @license
|
|
377
|
+
* Copyright 2019 Google LLC
|
|
378
|
+
*
|
|
379
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
380
|
+
* you may not use this file except in compliance with the License.
|
|
381
|
+
* You may obtain a copy of the License at
|
|
382
|
+
*
|
|
383
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
384
|
+
*
|
|
385
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
386
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
387
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
388
|
+
* See the License for the specific language governing permissions and
|
|
389
|
+
* limitations under the License.
|
|
390
|
+
*/function en(t){U(new B("platform-logger",e=>new lt(e),"PRIVATE")),U(new B("heartbeat",e=>new Yt(e),"PRIVATE")),A(T,z,t),A(T,z,"esm2017"),A("fire-js","")}en("");export{hn as A,de as B,B as C,M as D,nn as E,D as F,Be as G,pn as H,he as I,mn as J,gn as K,Ze as L,un as M,fn as N,an as O,dn as P,ln as Q,ce as R,wn as S,cn as T,bn as U,te as _,vn as a,y as b,Cn as c,w as d,kt as e,Ft as f,Sn as g,En as h,U as i,_n as j,C as k,Vt as l,Dn as m,Ut as n,In as o,An as p,yn as q,A as r,On as s,tn as t,Me as u,rn as v,on as w,sn as x,k as y,d as z};
|