1const Qt=()=>{};var Pe={};/** 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 rt=function(e){const t=[];let n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=i&63|128):(i&64512)===55296&&r+1<e.length&&(e.charCodeAt(r+1)&64512)===56320?(i=65536+((i&1023)<<10)+(e.charCodeAt(++r)&1023),t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128)}return t},en=function(e){const t=[];let n=0,r=0;for(;n<e.length;){const i=e[n++];if(i<128)t[r++]=String.fromCharCode(i);else if(i>191&&i<224){const o=e[n++];t[r++]=String.fromCharCode((i&31)<<6|o&63)}else if(i>239&&i<365){const o=e[n++],s=e[n++],a=e[n++],c=((i&7)<<18|(o&63)<<12|(s&63)<<6|a&63)-65536;t[r++]=String.fromCharCode(55296+(c>>10)),t[r++]=String.fromCharCode(56320+(c&1023))}else{const o=e[n++],s=e[n++];t[r++]=String.fromCharCode((i&15)<<12|(o&63)<<6|s&63)}}return t.join("")},it={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(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let i=0;i<e.length;i+=3){const o=e[i],s=i+1<e.length,a=s?e[i+1]:0,c=i+2<e.length,u=c?e[i+2]:0,d=o>>2,p=(o&3)<<4|a>>4;let l=(a&15)<<2|u>>6,m=u&63;c||(m=64,s||(l=64)),r.push(n[d],n[p],n[l],n[m])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(rt(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):en(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let i=0;i<e.length;){const o=n[e.charAt(i++)],a=i<e.length?n[e.charAt(i)]:0;++i;const u=i<e.length?n[e.charAt(i)]:64;++i;const p=i<e.length?n[e.charAt(i)]:64;if(++i,o==null||a==null||u==null||p==null)throw new tn;const l=o<<2|a>>4;if(r.push(l),u!==64){const m=a<<4&240|u>>2;if(r.push(m),p!==64){const B=u<<6&192|p;r.push(B)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class tn extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const nn=function(e){const t=rt(e);return it.encodeByteArray(t,!0)},ot=function(e){return nn(e).replace(/\./g,"")},st=function(e){try{return it.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}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, softw
26are 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 rn(){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 on=()=>rn().__FIREBASE_DEFAULTS__,sn=()=>{if(typeof process>"u"||typeof Pe>"u")return;const e=Pe.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},an=()=>{if(typeof document>"u")return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const t=e&&st(e[1]);return t&&JSON.parse(t)},me=()=>{try{return Qt()||on()||sn()||an()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},$o=e=>{var t,n;return(n=(t=me())===null||t===void 0?void 0:t.emulatorHosts)===null||n===void 0?void 0:n[e]},at=()=>{var e;return(e=me())===null||e===void 0?void 0:e.config},Lo=e=>{var t;return(t=me())===null||t===void 0?void 0:t[`_${e}`]};/** 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 cn{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((t,n)=>{this.resolve=t,this.reject=n})}wrapCallback(t){return(n,r)=>{n?this.reject(n):this.resolve(r),typeof t=="function"&&(this.promise.catch(()=>{}),t.length===1?t(n):t(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 un(e){try{return(e.startsWith("http://")||e.startsWith("https://")?new URL(e).hostname:e).endsWith(".cloudworkstations.dev")}catch{return!1}}async function xo(e){return(await fetch(e,{credentials:"include"})).ok}const L={};function dn(){const e={prod:[],emulator:[]};for(const t of Object.keys(L))L[t]?e.emulator.push(t):e.prod.push(t);return e}function ln(e){let t=document.getElementById(e),n=!1;return t||(t=document.createElement("div"),t.setAttribute("id",e),n=!0),{created:n,element:t}}let Be=!1;function jo(e,t){if(typeof window>"u"||typeof document>"u"||!un(window.location.host)||L[e]===t||L[e]||Be)return;L[e]=t;function n(l){return`__firebase__banner__${l}`}const r="__firebase__banner",o=dn().prod.length>0;function s(){const l=document.getElementById(r);l&&l.remove()}function a(l){l.style.display="flex",l.style.background="#7faaf0",l.style.position="fixed",l.style.bottom="5px",l.style.left="5px",l.style.padding=".5em",l.style.borderRadius="5px",l.style.alignItems="center"}function c(l,m){l.setAttribute("width","24"),l.setAttribute("id",m),l.setAttribute("height","24"),l.setAttribute("viewBox","0 0 24 24"),l.setAttribute("fill","none"),l.style.marginLeft="-6px"}function u(){const l=document.createElement("span");
76return l.style.cursor="pointer",l.style.marginLeft="16px",l.style.fontSize="24px",l.innerHTML=" ×",l.onclick=()=>{Be=!0,s()},l}function d(l,m){l.setAttribute("id",m),l.innerText="Learn more",l.href="https://firebase.google.com/docs/studio/preview-apps#preview-backend",l.setAttribute("target","__blank"),l.style.paddingLeft="5px",l.style.textDecoration="underline"}function p(){const l=ln(r),m=n("text"),B=document.getElementById(m)||document.createElement("span"),Ne=n("learnmore"),Re=document.getElementById(Ne)||document.createElement("a"),Me=n("preprendIcon"),K=document.getElementById(Me)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(l.created){const Z=l.element;a(Z),d(Re,Ne);const Xt=u();c(K,Me),Z.append(K,B,Re,Xt),document.body.appendChild(Z)}o?(B.innerText="Preview backend disconnected.",K.innerHTML=`<g clip-path="url(#clip0_6013_33858)"> 77<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"/> 78</g> 79<defs> 80<clipPath id="clip0_6013_33858"> 81<rect width="24" height="24" fill="white"/> 82</clipPath> 83</defs>`):(K.innerHTML=`<g clip-path="url(#clip0_6083_34804)"> 84<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"/> 85</g> 86<defs> 87<clipPath id="clip0_6083_34804"> 88<rect width="24" height="24" fill="white"/> 89</clipPath> 90</defs>`,B.innerText="Preview backend running in this workspace."),B.setAttribute("id",m)}document.readyState==="loading"?window.addEventListener("DOMContentLoaded",p):p()}/** 91 * @license 92 * Copyright 2017 Google LLC 93 * 94 * Licensed under the Apache License, Version 2.0 (the "License"); 95 * you may not use this file except in compliance with the License. 96 * You may obtain a copy of the License at 97 * 98 * http://www.apache.org/licenses/LICENSE-2.0 99 * 100 * Unless required by applicable law or agreed to in writing, software 101 * distributed under the License is distributed on an "AS IS" BASIS, 102 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 103 * See the License for the specific language governing permissions and 104 * limitations under the License. 105 */function ct(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function Ho(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(ct())}function fn(){return typeof window<"u"||ut()}function ut(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function Uo(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function Vo(){const e=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof e=="object"&&e.id!==void 0}function Ko(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function Wo(){const e=ct();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function dt(){try{return typeof indexedDB=="object"}catch{return!1}}function lt(){return new Promise((e,t)=>
105{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),n||self.indexedDB.deleteDatabase(r),e(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{var o;t(((o=i.error)===null||o===void 0?void 0:o.message)||"")}}catch(n){t(n)}})}function pn(){return!(typeof navigator>"u"||!navigator.cookieEnabled)}/** 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 */const hn="FirebaseError";class P extends Error{constructor(t,n,r){super(n),this.code=t,this.customData=r,this.name=hn,Object.setPrototypeOf(this,P.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,q.prototype.create)}}class q{constructor(t,n,r){this.service=t,this.serviceName=n,this.errors=r}create(t,...n){const r=n[0]||{},i=`${this.service}/${t}`,o=this.errors[t],s=o?gn(o,r):"Error",a=`${this.serviceName}: ${s} (${i}).`;return new P(i,a,r)}}function gn(e,t){return e.replace(mn,(n,r)=>{const i=t[r];return i!=null?String(i):`<${r}?>`})}const mn=/\{\$([^}]+)}/g;function zo(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function ue(e,t){if(e===t)return!0;const n=Object.keys(e),r=Object.keys(t);for(const i of n){if(!r.includes(i))return!1;const o=e[i],s=t[i];if(Fe(o)&&Fe(s)){if(!ue(o,s))return!1}else if(o!==s)return!1}for(const i of r)if(!n.includes(i))return!1;return!0}function Fe(e){return e!==null&&typeof e=="object"}/** 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 */function qo(e){const t=[];for(const[n,r]of Object.entries(e))Array.isArray(r)?r.forEach(i=>{t.push(encodeURIComponent(n)+"="+encodeURIComponent(i))}):t.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return t.length?"&"+t.join("&"):""}function Go(e){const t={};return e.replace(/^\?/,"").split("&").forEach(r=>{if(r){const[i,o]=r.split("=");
135t[decodeURIComponent(i)]=decodeURIComponent(o)}}),t}function Jo(e){const t=e.indexOf("?");if(!t)return"";const n=e.indexOf("#",t);return e.substring(t,n>0?n:void 0)}function Yo(e,t){const n=new bn(e,t);return n.subscribe.bind(n)}class bn{constructor(t,n){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=n,this.task.then(()=>{t(this)}).catch(r=>{this.error(r)})}next(t){this.forEachObserver(n=>{n.next(t)})}error(t){this.forEachObserver(n=>{n.error(t)}),this.close(t)}complete(){this.forEachObserver(t=>{t.complete()}),this.close()}subscribe(t,n,r){let i;if(t===void 0&&n===void 0&&r===void 0)throw new Error("Missing Observer.");wn(t,["next","error","complete"])?i=t:i={next:t,error:n,complete:r},i.next===void 0&&(i.next=X),i.error===void 0&&(i.error=X),i.complete===void 0&&(i.complete=X);const o=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch{}}),this.observers.push(i),o}unsubscribeOne(t){this.observers===void 0||this.observers[t]===void 0||(delete this.observers[t],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(t){if(!this.finalized)for(let n=0;n<this.observers.length;n++)this.sendOne(n,t)}sendOne(t,n){this.task.then(()=>{if(this.observers!==void 0&&this.observers[t]!==void 0)try{n(this.observers[t])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(t){this.finalized||(this.finalized=!0,t!==void 0&&(this.finalError=t),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function wn(e,t){if(typeof e!="object"||e===null)return!1;for(const n of t)if(n in e&&typeof e[n]=="function")return!0;return!1}function X(){}/** 136 * @license 137 * Copyright 2021 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 be(e){return e&&e._delegate?e._delegate:e}class A{constructor(t,n,r){this.name=t,this.instanceFactory=n,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(t){return this.instantiationMode=t,this}setMultipleInstances(t){return this.multipleInstances=t,this}setServiceProps(t){return this.serviceProps=t,this}setInstanceCreatedCallback(t){return this.onInstanceCreated=t,this}}/** 151 * @license 152 * Copyright 2019 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 */const D="[DEFAULT]";/** 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 */class yn{constructor(t,n){this.name=t,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(t){const n=this.normalizeInstanceIdentifier(t);if(!this.instancesDeferred.has(n)){const r=new cn;if(this.instancesDeferred.set(n,r),this.isInitialized(n)||this.shouldAutoInitialize())try{const i=this.getOrInitializeService({instanceIdentifier:n});i&&r.resolve(i)}catch{}}return this.instancesDeferred.get(n).promise}getImmediate(t){var n;const r=this.normalizeInstanceIdentifier(t?.identifier),i=(n=t?.optional)!==null&&n!==void 0?n:!1;if(this.isInitialized(r)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:r})}catch(o){if(i)return null;throw o}else{if(i)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(t){if(t.name!==this.name)throw Error(`Mismatching Component ${t.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=t,!!this.shouldAutoInitialize()){if(_n(t))try{this.getOrInitializeService({instanceIdentifier:D})}catch{}for(const[n,r]of this.instancesDeferred.entries()){const i=this.normalizeInstanceIdentifier(n);try{const o=this.getOrInitializeService({instanceIdentifier:i});r.resolve(o)}catch{}}}}clearInstance(t=D){this.instancesDeferred.delete(t),this.instancesOptions.delete(t),this.instances.delete(t)}async delete(){const t=Array.from(this.instances.values());await Promise.all([...t.filter(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...t.filter(n=>"_delete"in n).map(n=>n._delete())])}isComponentSet(){return this.component!=null}isInitialized(t=D){return this.instances.has(t)}getOptions(t=D){return this.instancesOptions.get(t)||{}}initialize(t={}){const{options:n={}}=t,r=this.normalizeInstanceIdentifier(t.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const i=this.getOrInitializeService({instanceIdentifier:r,options:n});for(const[o,s]of this.instancesDeferred.entries()){const a=this.normalizeInstanceIdentifier(o);r===a&&s.resolve(i)}return i}onInit(t,n){var r;const i=this.normalizeInstanceIdentifier(n),o=(r=this.onInitCallbacks.get(i))!==null&&r!==void 0?r:new Set;o.add(t),this.onInitCallbacks.set(i,o);const s=this.instances.get(i);return s&&t(s,i),()=>{o.delete(t)}}invokeOnInitCallbacks(t,n){const r=this.onInitCallbacks.get(n);if(r)for(const i of r)try{i(t,n)}catch{}}getOrInitializeService({instanceIdentifier:t,options:n={}}){let r=this.instances.get(t);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:vn(t),options:n}),this.instances.set(t,r),this.instancesOptions.set(t,n),this.invokeOnInitCallbacks(r,t),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,t,r)}catch{}return r||null}normalizeInstanceIdentifier(t=D){return this.component?this.component.multipleInstances?t:D:t}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function vn(e){return e===D?void 0:e}function _n(e){return e.instantiationMode==="EAGER"}/** 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 ft{constructor(t){this.name=t,this.providers=new Map}addComponent(t){const n=this.getProvider(t.name);if(n.isComponentSet())throw new Error(`Component ${t.name} has already been registered with ${this.name}`);n.setComponent(t)}addOrOverwriteComponent(t){this.getProvider(t.name).isComponentSet()&&this.providers.delete(t.name),this.addComponent(t)}getProvider(t){if(this.providers.has(t))return this.providers.get(t);const n=new yn(t,this);return this.providers.set(t,n),n}getProviders(){return Array.from(this.providers.values())}}/** 196 * @license 197 * Copyright 2017 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 */const we=[];var f;(function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"})(f||(f={}));const pt={debug:f.DEBUG,verbose:f.VERBOSE,info:f.INFO,warn:f.WARN,error:f.ERROR,silent:f.SILENT},En=f.INFO,Sn={[f.DEBUG]:"log",[f.VERBOSE]:"log",[f.INFO]:"info",[f.WARN]:"warn",[f.ERROR]:"error"},In=(e,t,...n)=>{if(t<e.logLevel)return;const r=new Date().toISOString(),i=Sn[t];if(i)console[i](`[${r}] ${e.name}:`,...n);else throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`)};class Cn{constructor(t){this.name=t,this._logLevel=En,this._logHandler=In,this._userLogHandler=null,we.push(this)}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in f))throw new TypeError(`Invalid value "${t}" assigned to \`logLevel\``);this._logLevel=t}setLogLevel(t){this._logLevel=typeof t=="string"?pt[t]:t}get logHandler(){return this._logHandler}set logHandler(t){if(typeof t!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t}get userLogHandler(){return this._userLogHandler}set userLogHandler(t){this._userLogHandler=t}debug(...t){this._userLogHandler&&this._userLogHandler(this,f.DEBUG,...t),this._logHandler(this,f.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,f.VERBOSE,...t),this._logHandler(this,f.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,f.INFO,...t),this._logHandler(this,f.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,f.WARN,...t),this._logHandler(this,f.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,f.ERROR,...t),this._logHandler(this,f.ERROR,...t)}}function An(e){we.forEach(t=>{t.setLogLevel(e)})}function Tn(e,t){for(const n of we){let r=null;t&&t.level&&(r=pt[t.level]),e===null?n.userLogHandler=null:n.userLogHandler=(i,o,...s)=>{const a=s.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(" ");o>=(r??i.logLevel)&&e({level:f[o].toLowerCase(),message:a,args:s,type:i.name})}}}const kn=(e,t)=>t.some(n=>e instanceof n);let $e,Le;function Dn(){return $e||($e=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function On(){return Le||(Le=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const ht=new WeakMap,de=new WeakMap,gt=new WeakMap,Q=new WeakMap,ye=new WeakMap;function Nn(e){const t=new Promise((n,r)=>{const i=()=>{e.removeEventListener("success",o),e.removeEventListener("error",s)},o=()=>{n(_(e.result)),i()},s=()=>{r(e.error),i()};e.addEventListener("success",o),e.addEventListener("error",s)});return t.then(n=>
210{n instanceof IDBCursor&&ht.set(n,e)}).catch(()=>{}),ye.set(t,e),t}function Rn(e){if(de.has(e))return;const t=new Promise((n,r)=>{const i=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",s),e.removeEventListener("abort",s)},o=()=>{n(),i()},s=()=>{r(e.error||new DOMException("AbortError","AbortError")),i()};e.addEventListener("complete",o),e.addEventListener("error",s),e.addEventListener("abort",s)});de.set(e,t)}let le={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return de.get(e);if(t==="objectStoreNames")return e.objectStoreNames||gt.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return _(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function Mn(e){le=e(le)}function Pn(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...n){const r=e.call(ee(this),t,...n);return gt.set(r,t.sort?t.sort():[t]),_(r)}:On().includes(e)?function(...t){return e.apply(ee(this),t),_(ht.get(this))}:function(...t){return _(e.apply(ee(this),t))}}function Bn(e){return typeof e=="function"?Pn(e):(e instanceof IDBTransaction&&Rn(e),kn(e,Dn())?new Proxy(e,le):e)}function _(e){if(e instanceof IDBRequest)return Nn(e);if(Q.has(e))return Q.get(e);const t=Bn(e);return t!==e&&(Q.set(e,t),ye.set(t,e)),t}const ee=e=>ye.get(e);function G(e,t,{blocked:n,upgrade:r,blocking:i,terminated:o}={}){const s=indexedDB.open(e,t),a=_(s);return r&&s.addEventListener("upgradeneeded",c=>{r(_(s.result),c.oldVersion,c.newVersion,_(s.transaction),c)}),n&&s.addEventListener("blocked",c=>n(c.oldVersion,c.newVersion,c)),a.then(c=>{o&&c.addEventListener("close",()=>o()),i&&c.addEventListener("versionchange",u=>i(u.oldVersion,u.newVersion,u))}).catch(()=>{}),a}function te(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",r=>t(r.oldVersion,r)),_(n).then(()=>{})}const Fn=["get","getKey","getAll","getAllKeys","count"],$n=["put","add","delete","clear"],ne=new Map;function xe(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(ne.get(t))return ne.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,i=$n.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||Fn.includes(n)))return;const o=async function(s,...a){const c=this.transaction(s,i?"readwrite":"readonly");let u=c.store;return r&&(u=u.index(a.shift())),(await Promise.all([u[n](...a),i&&c.done]))[0]};return ne.set(t,o),o}Mn(e=>({...e,get:(t,n,r)=>xe(t,n)||e.get(t,n,r),has:(t,n)=>!!xe(t,n)||e.has(t,n)}));/** 211 * @license 212 * Copyright 2019 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 */class Ln{constructor(t){this.container=t}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(xn(n)){const r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}}function xn(e){const t=e.getComponent();return t?.type==="VERSION"}const W="@firebase/app",fe="0.13.2";/** 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 */const E=new Cn("@firebase/app"),jn="@firebase/app-compat",Hn="@firebase/analytics-compat",Un="@firebase/analytics",Vn="@firebase/app-check-compat",Kn="@firebase/app-check",Wn="@firebase/auth",zn="@firebase/auth-compat",qn="@firebase/database",Gn="@firebase/data-connect",Jn="@f
240irebase/database-compat",Yn="@firebase/functions",Zn="@firebase/functions-compat",Xn="@firebase/installations",Qn="@firebase/installations-compat",er="@firebase/messaging",tr="@firebase/messaging-compat",nr="@firebase/performance",rr="@firebase/performance-compat",ir="@firebase/remote-config",or="@firebase/remote-config-compat",sr="@firebase/storage",ar="@firebase/storage-compat",cr="@firebase/firestore",ur="@firebase/ai",dr="@firebase/firestore-compat",lr="firebase",fr="11.10.0";/** 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 x="[DEFAULT]",pr={[W]:"fire-core",[jn]:"fire-core-compat",[Un]:"fire-analytics",[Hn]:"fire-analytics-compat",[Kn]:"fire-app-check",[Vn]:"fire-app-check-compat",[Wn]:"fire-auth",[zn]:"fire-auth-compat",[qn]:"fire-rtdb",[Gn]:"fire-data-connect",[Jn]:"fire-rtdb-compat",[Yn]:"fire-fn",[Zn]:"fire-fn-compat",[Xn]:"fire-iid",[Qn]:"fire-iid-compat",[er]:"fire-fcm",[tr]:"fire-fcm-compat",[nr]:"fire-perf",[rr]:"fire-perf-compat",[ir]:"fire-rc",[or]:"fire-rc-compat",[sr]:"fire-gcs",[ar]:"fire-gcs-compat",[cr]:"fire-fst",[dr]:"fire-fst-compat",[ur]:"fire-vertex","fire-js":"fire-js",[lr]:"fire-js-all"};/** 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 T=new Map,F=new Map,$=new Map;function pe(e,t){try{e.container.addComponent(t)}catch(n){E.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function hr(e,t){e.container.addOrOverwriteComponent(t)}function k(e){const t=e.name;if($.has(t))return E.debug(`There were multiple attempts to register component ${t}.`),!1;$.set(t,e);for(const n of T.values())pe(n,e);for(const n of F.values())pe(n,e);return!0}function V(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}function gr(e,t,n=x){V(e,t).clearInstance(n)}function mt(e){return e.options!==void 0}function mr(e){return e==null?!1:e.settings!==void 0}function br(){$.clear()}/** 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 wr={"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.","invali
285d-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."},g=new q("app","Firebase",wr);/** 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 */class bt{constructor(t,n,r){this._isDeleted=!1,this._options=Object.assign({},t),this._config=Object.assign({},n),this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new A("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(t){this.checkDestroyed(),this._automaticDataCollectionEnabled=t}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(t){this._isDeleted=t}checkDestroyed(){if(this.isDeleted)throw g.create("app-deleted",{appName:this._name})}}/** 301 * @license 302 * Copyright 2023 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 */function je(e,t){const n=st(e.split(".")[1]);if(n===null){console.error(`FirebaseServerApp ${t} is invalid: second part could not be parsed.`);return}if(JSON.parse(n).exp===void 0){console.error(`FirebaseServerApp ${t} is invalid: expiration claim could not be parsed`);return}const i=JSON.parse(n).exp*1e3,o=new Date().getTime();i-o<=0&&console.error(`FirebaseServerApp ${t} is invalid: the token has expired.`)}class yr extends bt{constructor(t,n,r,i){const o=n.automaticDataCollectionEnabled!==void 0?n.automaticDataCollectionEnabled:!0,s={name:r,automaticDataCollectionEnabled:o};if(t.apiKey!==void 0)super(t,s,i);else{const a=t;super(a.options,s,i)}this._serverConfig=Object.assign({automaticDataCollectionEnabled:o},n),this._serverConfig.authIdToken&&je(this._serverConfig.authIdToken,"authIdToken"),this._serverConfig.appCheckToken&&je(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,b(W,fe,"serverapp")}toJSON(){}get refCount(){return this._refCount}incRefCount(t){this.isDeleted||(this._refCount++,t!==void 0&&this._finalizationRegistry!==null&&this._finalizationRegistry.register(t,this))}decRefCount(){return this.isDeleted?0:--this._refCount}automaticCleanup(){yt(this)}get settings(){return this.checkDestroyed(),this._serverConfig}checkDestroyed(){if(this.isDeleted)throw g.create("server-app-deleted")}}/** 316 * @license 317 * Copyright 2019 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 */const vr=fr;function ve(e,t={}){let n=e;typeof t!="object"&&(t={name:t});const r=Object.assign({name:x,automaticDataCollectionEnabled:!0},t),i=r.name;if(typeof i!="string"||!i)throw g.create("bad-app-name",{appName:String(i)});if(n||(n=at()),!n)throw g.create("no-options");const o=T.get(i);if(o){if(ue(n,o.options)&&ue(r,o.config))return o;throw g.create("duplicate-app",{appName:i})}const s=new ft(i);for(const c of $.values())s.addComponent(c);const a=new bt(n,r,s);return T.set(i,a),a}function _r(e,t){if(fn()&&!ut())throw g.create("invalid-server-app-environment");t.automaticDataCollectionEnabled===void 0&&(t.automaticDataCollectionEnabled=!0);let n;mt(e)?n=e.options:n=e;const r=Object.assign(Object.assign({},t),n);r.releaseOnDeref!==void 0&&delete r.releaseOnDeref;const i=u=>[...u].reduce((d,p)=>Math.imul(31,d)+p.charCodeAt(0)|0,0);if(t.releaseOnDeref!==void 0&&typeof FinalizationRegistry>"u")throw g.create("finalization-registry-not-supported",{});const o=""+i(JSON.stringify(r)),s=F.get(o);if(s)return s.incRefCount(t.releaseOnDeref),s;const a=new ft(o);for(const u of $.values())a.addComponent(u);const c=new yr(n,t,o,a);return F.set(o,c),c}function _e(e=x){const t=T.get(e);if(!t&&e===x&&at())return ve();if(!t)throw g.create("no-app",{appName:e});return t}function wt(){return Array.from(T.values())}async function yt(e){let t=!1;const n=e.name;T.has(n)?(t=!0,T.delete(n)):F.has(n)&&e.decRefCount()<=0&&(F.delete(n),t=!0),t&&(await Promise.all(e.container.getProviders().map(r=>r.delete())),e.isDeleted=!0)}function b(e,t,n){var r;let i=(r=pr[e])!==null&&r!==void 0?r:e;n&&(i+=`-${n}`);const o=i.match(/\s|\//),s=t.match(/\s|\//);if(o||s){const a=[`Unable to register library "${i}" with version "${t}":`];o&&a.push(`library name "${i}" contains illegal characters (whitespace or "/")`),o&&s&&a.push("and"),s&&a.push(`version name "${t}" contains illegal characters (whitespace or "/")`),E.warn(a.join(" "));return}k(new A(`${i}-version`,()=>({library:i,version:t}),"VERSION"))}function Er(e,t){if(e!==null&&typeof e!="function")throw g.create("invalid-log-argument");Tn(e,t)}function Sr(e){An(e)}/** 331 * @license 332 * Copyright 2021 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 Ir="firebase-heartbeat-database",Cr=1,j="firebase-heartbeat-store";let re=null;function vt(){return re||(re=G(Ir,Cr,{upgrade:(e,t)=>{switch(t){case 0:try{e.createObjectStore(j)}catch(n){console.warn(n)}}}}).catch(e=>{throw g.create("idb-open",{originalErrorMessage:e.message})})),re}async function Ar(e){try{const n=(await vt()).transaction(j),r=await n.objectStore(j).get(_t(e));return await n.done,r}catch(t){if(t instanceof P)E.warn(t.message);else{const n=g.create("idb-get",{originalErrorMessage:t?.message});E.warn(n.message)}}}async function He(e,t){try{const r=(await vt()).transaction(j,"readwrite");await r.objectStore(j).put(t,_t(e)),await r.done}catch(n){if(n instanceof P)E.warn(n.message);else{const r=g.create("idb-set",{originalErrorMessage:n?.message});E.warn(r.message)}}}function _t(e){return`${e.name}!${e.options.appId}`}/** 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 Tr=1024,kr=30;class Dr{constructor(t){this.container=t,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new Nr(n),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){var t,n;try{const i=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),o=Ue();if(((t=this._heartbeatsCache)===null||t===void 0?void 0:t.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((n=this._heartbeatsCache)===null||n===void 0?void 0:n.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===o||this._heartbeatsCache.heartbeats.some(s=>s.date===o))return;if(this._heartbeatsCache.heartbeats.push({date:o,agent:i}),this._heartbeatsCache.heartbeats.length>kr){const s=Rr(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(s,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(r){E.warn(r)}}async getHeartbeatsHeader(){var t;try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((t=this._heartbeatsCache)===null||t===void 0?void 0:t.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const n=Ue(),{heartbeatsToSend:r,unsentEntries:i}=Or(this._heartbeatsCache.heartbeats),o=ot(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=n,i.length>0?(this._heartbeatsCache.heartbeats=i,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),o}catch(n){return E.warn(n),""}}}function Ue(){return new Date().toISOString().substring(0,10)}function Or(e,t=Tr){const n=[];let r=e.slice();for(const i of e){const o=n.find(s=>s.agent===i.agent);if(o){if(o.dates.push(i.date),Ve(n)>t){o.dates.pop();break}}else if(n.push({agent:i.agent,dates:[i.date]}),Ve(n)>t){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}class Nr{constructor(t){this.app=t,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return dt()?lt().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await Ar(this.app);return n?.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(t){var n;if(await this._canUseIndexedDBPromise){const i=await this.read();return He(this.app,{lastSentHeartbeatDate:(n=t.lastSentHeartbeatDate)!==null&&n!==void 0?n:i.lastSentHeartbeatDate,heartbeats:t.heartbeats})}else return}async add(t){var n;if(await this._canUseIndexedDBPromise){const i=await this.read();return He(this.app,{lastSentHeartbeatDate:(n=t.lastSentHeartbeatDate)!==null&&n!==void 0?n:i.lastSentHeartbeatDate,heartbeats:[...i.heartbeats,...t.heartbeats]})}else return}}function Ve(e){return ot(JSON.stringify({version:2,heartbeats:e})).length}function Rr(e){if(e.length===0)return-1;let t=0,n=e[0].date;for(let r=1;r<e.length;r++)e[r].date<n&&(n=e[r].date,t=r);return t}/** 361 * @license 362 * Copyright 2019 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 */function Mr(e){k(new A("platform-logger",t=>new Ln(t),"PRIVATE")),k(new A("heartbeat",t=>new Dr(t),"PRIVATE")),b(W,fe,e),b(W,fe,"esm2017"),b("fire-js","")}Mr("");var Pr="firebase",Br="11.10.0";/** 376 * @license 377 * Copyright 2020 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 */b(Pr,Br,"app");const Zo=Object.freeze(Object.defineProperty({__proto__:null,FirebaseError:P,SDK_VERSION:vr,_DEFAULT_ENTRY_NAME:x,_addComponent:pe,_addOrOverwriteComponent:hr,_apps:T,_clearComponents:br,_components:$,_getProvider:V,_isFirebaseApp:mt,_isFirebaseServerApp:mr,_registerComponent:k,_removeServiceInstance:gr,_serverApps:F,deleteApp:yt,getApp:_e,getApps:wt,initializeApp:ve,initializeServerApp:_r,onLog:Er,registerVersion:b,setLogLevel:Sr},Symbol.toStringTag,{value:"Module"})),Et="@firebase/installations",Ee="0.6.18";/** 391 * @license 392 * Copyright 2019 Google LLC 393 * 394 * Licensed under the Apache License, Version 2.0 (the "License"); 395 * you may not use this file except in compliance with the License. 396 * You may obtain a copy of the License at 397 * 398 * http://www.apache.org/licenses/LICENSE-2.0 399 * 400 * Unless required by applicable law or agreed to in writing, software 401 * distributed under the License is distributed on an "AS IS" BASIS, 402 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 403 * See the License for the specific language governing permissions and 404 * limitations under the License. 405 */const St=1e4,It=`w:${Ee}`,Ct="FIS_v2",Fr="https://firebaseinstallations.googleapis.com/v1",$r=3600*1e3,Lr="installations",xr="Installations";/** 406 * @license 407 * Copyright 2019 Google LLC 408 * 409 * Licensed under the Apache License, Version 2.0 (the "License"); 410 * you may not use this file except in compliance with the License. 411 * You may obtain a copy of the License at 412 * 413 * http://www.apache.org/licenses/LICENSE-2.0 414 * 415 * Unless required by applicable law or agreed to in writing, software 416 * distributed under the License is distributed on an "AS IS" BASIS, 417 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 418 * See the License for the specific language governing permissions and 419 * limitations under the License. 420 */const jr={"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."},R=new q(Lr,xr,jr);function At(e){return e instanceof P&&e.code.includes("request-failed")}/** 421 * @license 422 * Copyright 2019 Google LLC 423 * 424 * Licensed under the Apache License, Version 2.0 (the "License"); 425 * you may not use this file except in compliance with the License. 426 * You may obtain a copy of the License at 427 * 428 * http://www.apache.org/licenses/LICENSE-2.0 429 * 430 * Unless required by applicable law or agreed to in writing, software 431 * distributed under the License is distributed on an "AS IS" BASIS, 432 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 433 * See the License for the specific language governing permissions and 434 * limitations under the License. 435 */function Tt({projectId:e}){return`${Fr}/projects/${e}/installations`}function kt(e){return{token:e.token,requestStatus:2,expiresIn:Ur(e.expiresIn),creationTime:Date.now()}}async function Dt(e,t){const r=(await t.json()).error;return R.create("request-failed",{requestName:e,serverCode:r.code,serverMessage:r.message,serverStatus:r.status})}function Ot({apiKey:e}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e})}function Hr(e,{refreshToken:t}){const n=Ot(e);return n.append("Authorization",Vr(t)),n}async function Nt(e){const t=await e();return t.status>=500&&t.status<600?e():t}function Ur(e){return Number(e.replace("s","000"))}function Vr(e){return`${Ct} ${e}`}/** 436 * @license 437 * Copyright 2019 Google LLC 438 * 439 * Licensed under the Apache License, Version 2.0 (the "License");
440 * you may not use this file except in compliance with the License. 441 * You may obtain a copy of the License at 442 * 443 * http://www.apache.org/licenses/LICENSE-2.0 444 * 445 * Unless required by applicable law or agreed to in writing, software 446 * distributed under the License is distributed on an "AS IS" BASIS, 447 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 448 * See the License for the specific language governing permissions and 449 * limitations under the License. 450 */async function Kr({appConfig:e,heartbeatServiceProvider:t},{fid:n}){const r=Tt(e),i=Ot(e),o=t.getImmediate({optional:!0});if(o){const u=await o.getHeartbeatsHeader();u&&i.append("x-firebase-client",u)}const s={fid:n,authVersion:Ct,appId:e.appId,sdkVersion:It},a={method:"POST",headers:i,body:JSON.stringify(s)},c=await Nt(()=>fetch(r,a));if(c.ok){const u=await c.json();return{fid:u.fid||n,registrationStatus:2,refreshToken:u.refreshToken,authToken:kt(u.authToken)}}else throw await Dt("Create Installation",c)}/** 451 * @license 452 * Copyright 2019 Google LLC 453 * 454 * Licensed under the Apache License, Version 2.0 (the "License"); 455 * you may not use this file except in compliance with the License. 456 * You may obtain a copy of the License at 457 * 458 * http://www.apache.org/licenses/LICENSE-2.0 459 * 460 * Unless required by applicable law or agreed to in writing, software 461 * distributed under the License is distributed on an "AS IS" BASIS, 462 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 463 * See the License for the specific language governing permissions and 464 * limitations under the License. 465 */function Rt(e){return new Promise(t=>{setTimeout(t,e)})}/** 466 * @license 467 * Copyright 2019 Google LLC 468 * 469 * Licensed under the Apache License, Version 2.0 (the "License"); 470 * you may not use this file except in compliance with the License. 471 * You may obtain a copy of the License at 472 * 473 * http://www.apache.org/licenses/LICENSE-2.0 474 * 475 * Unless required by applicable law or agreed to in writing, software 476 * distributed under the License is distributed on an "AS IS" BASIS, 477 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 478 * See the License for the specific language governing permissions and 479 * limitations under the License. 480 */function Wr(e){return btoa(String.fromCharCode(...e)).replace(/\+/g,"-").replace(/\//g,"_")}/** 481 * @license 482 * Copyright 2019 Google LLC 483 * 484 * Licensed under the Apache License, Version 2.0 (the "License"); 485 * you may not use this file except in compliance with the License. 486 * You may obtain a copy of the License at 487 * 488 * http://www.apache.org/licenses/LICENSE-2.0 489 * 490 * Unless required by applicable law or agreed to in writing, software 491 * distributed under the License is distributed on an "AS IS" BASIS, 492 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 493 * See the License for the specific language governing permissions and 494 * limitations under the License. 495 */const zr=/^[cdef][\w-]{21}$/,he="";function qr(){try{const e=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(e),e[0]=112+e[0]%16;const n=Gr(e);return zr.test(n)?n:he}catch{return he}}function Gr(e){return Wr(e).substr(0,22)}/** 496 * @license 497 * Copyright 2019 Google LLC 498 * 499 * Licensed under the Apache License, Version 2.0 (the "License"); 500 * you may not use this file except in compliance with the License. 501 * You may obtain a copy of the License at 502 * 503 * http://www.apache.org/licenses/LICENSE-2.0 504 * 505 * Unless required by applicable law or agreed to in writing, software 506 * distributed under the License is distributed on an "AS IS" BASIS, 507 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 508 * See the License for the specific language governing permissions and 509 * limitations under the License. 510 */function J(e){return`${e.appName}!${e.appId}`}/** 511 * @license 512 * Copyright 2019 Google LLC 513 * 514 * Licensed under the Apache License, Version 2.0 (the "License"); 515 * you may not use this file except in compliance with the License. 516 * You may obtain a copy of the License at 517 * 518 * http://www.apache.org/licenses/LICENSE-2.0 519 * 520 * Unless required by applicable law or agreed to in writing, softw
520are 521 * distributed under the License is distributed on an "AS IS" BASIS, 522 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 523 * See the License for the specific language governing permissions and 524 * limitations under the License. 525 */const Mt=new Map;function Pt(e,t){const n=J(e);Bt(n,t),Jr(n,t)}function Bt(e,t){const n=Mt.get(e);if(n)for(const r of n)r(t)}function Jr(e,t){const n=Yr();n&&n.postMessage({key:e,fid:t}),Zr()}let N=null;function Yr(){return!N&&"BroadcastChannel"in self&&(N=new BroadcastChannel("[Firebase] FID Change"),N.onmessage=e=>{Bt(e.data.key,e.data.fid)}),N}function Zr(){Mt.size===0&&N&&(N.close(),N=null)}/** 526 * @license 527 * Copyright 2019 Google LLC 528 * 529 * Licensed under the Apache License, Version 2.0 (the "License"); 530 * you may not use this file except in compliance with the License. 531 * You may obtain a copy of the License at 532 * 533 * http://www.apache.org/licenses/LICENSE-2.0 534 * 535 * Unless required by applicable law or agreed to in writing, software 536 * distributed under the License is distributed on an "AS IS" BASIS, 537 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 538 * See the License for the specific language governing permissions and 539 * limitations under the License. 540 */const Xr="firebase-installations-database",Qr=1,M="firebase-installations-store";let ie=null;function Se(){return ie||(ie=G(Xr,Qr,{upgrade:(e,t)=>{switch(t){case 0:e.createObjectStore(M)}}})),ie}async function z(e,t){const n=J(e),i=(await Se()).transaction(M,"readwrite"),o=i.objectStore(M),s=await o.get(n);return await o.put(t,n),await i.done,(!s||s.fid!==t.fid)&&Pt(e,t.fid),t}async function Ft(e){const t=J(e),r=(await Se()).transaction(M,"readwrite");await r.objectStore(M).delete(t),await r.done}async function Y(e,t){const n=J(e),i=(await Se()).transaction(M,"readwrite"),o=i.objectStore(M),s=await o.get(n),a=t(s);return a===void 0?await o.delete(n):await o.put(a,n),await i.done,a&&(!s||s.fid!==a.fid)&&Pt(e,a.fid),a}/** 541 * @license 542 * Copyright 2019 Google LLC 543 * 544 * Licensed under the Apache License, Version 2.0 (the "License"); 545 * you may not use this file except in compliance with the License. 546 * You may obtain a copy of the License at 547 * 548 * http://www.apache.org/licenses/LICENSE-2.0 549 * 550 * Unless required by applicable law or agreed to in writing, software 551 * distributed under the License is distributed on an "AS IS" BASIS, 552 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 553 * See the License for the specific language governing permissions and 554 * limitations under the License. 555 */async function Ie(e){let t;const n=await Y(e.appConfig,r=>{const i=ei(r),o=ti(e,i);return t=o.registrationPromise,o.installationEntry});return n.fid===he?{installationEntry:await t}:{installationEntry:n,registrationPromise:t}}function ei(e){const t=e||{fid:qr(),registrationStatus:0};return $t(t)}function ti(e,t){if(t.registrationStatus===0){if(!navigator.onLine){const i=Promise.reject(R.create("app-offline"));return{installationEntry:t,registrationPromise:i}}const n={fid:t.fid,registrationStatus:1,registrationTime:Date.now()},r=ni(e,n);return{installationEntry:n,registrationPromise:r}}else return t.registrationStatus===1?{installationEntry:t,registrationPromise:ri(e)}:{installationEntry:t}}async function ni(e,t){try{const n=await Kr(e,t);return z(e.appConfig,n)}catch(n){throw At(n)&&n.customData.serverCode===409?await Ft(e.appConfig):await z(e.appConfig,{fid:t.fid,registrationStatus:0}),n}}async function ri(e){let t=await Ke(e.appConfig);for(;t.registrationStatus===1;)await Rt(100),t=await Ke(e.appConfig);if(t.registrationStatus===0){const{installationEntry:n,registrationPromise:r}=await Ie(e);return r||n}return t}function Ke(e){return Y(e,t=>{if(!t)throw R.create("installation-not-found");return $t(t)})}function $t(e){return ii(e)?{fid:e.fid,registrationStatus:0}:e}function ii(e){return e.registrationStatus===1&&e.registrationTime+St<Date.now()}/** 556 * @license 557 * Copyright 2019 Google LLC 558 * 559 * Licensed under the Apache License, Version 2.0 (the "License"); 560 * you may not use this file except in compliance with the License. 561 * You may obtain a copy of the License at 562 * 563 * http://www.apache.org/licenses/LICENSE-2.0 564 * 565 * Unless required by applicable law or agreed to in writing, softw
565are 566 * distributed under the License is distributed on an "AS IS" BASIS, 567 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 568 * See the License for the specific language governing permissions and 569 * limitations under the License. 570 */async function oi({appConfig:e,heartbeatServiceProvider:t},n){const r=si(e,n),i=Hr(e,n),o=t.getImmediate({optional:!0});if(o){const u=await o.getHeartbeatsHeader();u&&i.append("x-firebase-client",u)}const s={installation:{sdkVersion:It,appId:e.appId}},a={method:"POST",headers:i,body:JSON.stringify(s)},c=await Nt(()=>fetch(r,a));if(c.ok){const u=await c.json();return kt(u)}else throw await Dt("Generate Auth Token",c)}function si(e,{fid:t}){return`${Tt(e)}/${t}/authTokens:generate`}/** 571 * @license 572 * Copyright 2019 Google LLC 573 * 574 * Licensed under the Apache License, Version 2.0 (the "License"); 575 * you may not use this file except in compliance with the License. 576 * You may obtain a copy of the License at 577 * 578 * http://www.apache.org/licenses/LICENSE-2.0 579 * 580 * Unless required by applicable law or agreed to in writing, software 581 * distributed under the License is distributed on an "AS IS" BASIS, 582 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 583 * See the License for the specific language governing permissions and 584 * limitations under the License. 585 */async function Ce(e,t=!1){let n;const r=await Y(e.appConfig,o=>{if(!Lt(o))throw R.create("not-registered");const s=o.authToken;if(!t&&ui(s))return o;if(s.requestStatus===1)return n=ai(e,t),o;{if(!navigator.onLine)throw R.create("app-offline");const a=li(o);return n=ci(e,a),a}});return n?await n:r.authToken}async function ai(e,t){let n=await We(e.appConfig);for(;n.authToken.requestStatus===1;)await Rt(100),n=await We(e.appConfig);const r=n.authToken;return r.requestStatus===0?Ce(e,t):r}function We(e){return Y(e,t=>{if(!Lt(t))throw R.create("not-registered");const n=t.authToken;return fi(n)?Object.assign(Object.assign({},t),{authToken:{requestStatus:0}}):t})}async function ci(e,t){try{const n=await oi(e,t),r=Object.assign(Object.assign({},t),{authToken:n});return await z(e.appConfig,r),n}catch(n){if(At(n)&&(n.customData.serverCode===401||n.customData.serverCode===404))await Ft(e.appConfig);else{const r=Object.assign(Object.assign({},t),{authToken:{requestStatus:0}});await z(e.appConfig,r)}throw n}}function Lt(e){return e!==void 0&&e.registrationStatus===2}function ui(e){return e.requestStatus===2&&!di(e)}function di(e){const t=Date.now();return t<e.creationTime||e.creationTime+e.expiresIn<t+$r}function li(e){const t={requestStatus:1,requestTime:Date.now()};return Object.assign(Object.assign({},e),{authToken:t})}function fi(e){return e.requestStatus===1&&e.requestTime+St<Date.now()}/** 586 * @license 587 * Copyright 2019 Google LLC 588 * 589 * Licensed under the Apache License, Version 2.0 (the "License"); 590 * you may not use this file except in compliance with the License. 591 * You may obtain a copy of the License at 592 * 593 * http://www.apache.org/licenses/LICENSE-2.0 594 * 595 * Unless required by applicable law or agreed to in writing, software 596 * distributed under the License is distributed on an "AS IS" BASIS, 597 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 598 * See the License for the specific language governing permissions and 599 * limitations under the License. 600 */async function pi(e){const t=e,{installationEntry:n,registrationPromise:r}=await Ie(t);return r?r.catch(console.error):Ce(t).catch(console.error),n.fid}/** 601 * @license 602 * Copyright 2019 Google LLC 603 * 604 * Licensed under the Apache License, Version 2.0 (the "License"); 605 * you may not use this file except in compliance with the License. 606 * You may obtain a copy of the License at 607 * 608 * http://www.apache.org/licenses/LICENSE-2.0 609 * 610 * Unless required by applicable law or agreed to in writing, software 611 * distributed under the License is distributed on an "AS IS" BASIS, 612 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 613 * See the License for the specific language governing permissions and 614 * limitations under the License. 615 */async function hi(e,t=!1){const n=e;return await gi(n),(await Ce(n,t)).token}async function gi(e){const{registrationPromise:t}=await Ie(e);t&&await t}/** 616 * @license 617 * Copyright 2019 Google LLC 618 * 619 * Licensed under the Apache License, Version 2.0 (the "License");
620 * you may not use this file except in compliance with the License. 621 * You may obtain a copy of the License at 622 * 623 * http://www.apache.org/licenses/LICENSE-2.0 624 * 625 * Unless required by applicable law or agreed to in writing, software 626 * distributed under the License is distributed on an "AS IS" BASIS, 627 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 628 * See the License for the specific language governing permissions and 629 * limitations under the License. 630 */function mi(e){if(!e||!e.options)throw oe("App Configuration");if(!e.name)throw oe("App Name");const t=["projectId","apiKey","appId"];for(const n of t)if(!e.options[n])throw oe(n);return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}function oe(e){return R.create("missing-app-config-values",{valueName:e})}/** 631 * @license 632 * Copyright 2020 Google LLC 633 * 634 * Licensed under the Apache License, Version 2.0 (the "License"); 635 * you may not use this file except in compliance with the License. 636 * You may obtain a copy of the License at 637 * 638 * http://www.apache.org/licenses/LICENSE-2.0 639 * 640 * Unless required by applicable law or agreed to in writing, software 641 * distributed under the License is distributed on an "AS IS" BASIS, 642 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 643 * See the License for the specific language governing permissions and 644 * limitations under the License. 645 */const xt="installations",bi="installations-internal",wi=e=>{const t=e.getProvider("app").getImmediate(),n=mi(t),r=V(t,"heartbeat");return{app:t,appConfig:n,heartbeatServiceProvider:r,_delete:()=>Promise.resolve()}},yi=e=>{const t=e.getProvider("app").getImmediate(),n=V(t,xt).getImmediate();return{getId:()=>pi(n),getToken:i=>hi(n,i)}};function vi(){k(new A(xt,wi,"PUBLIC")),k(new A(bi,yi,"PRIVATE"))}vi();b(Et,Ee);b(Et,Ee,"esm2017");/** 646 * @license 647 * Copyright 2019 Google LLC 648 * 649 * Licensed under the Apache License, Version 2.0 (the "License"); 650 * you may not use this file except in compliance with the License. 651 * You may obtain a copy of the License at 652 * 653 * http://www.apache.org/licenses/LICENSE-2.0 654 * 655 * Unless required by applicable law or agreed to in writing, software 656 * distributed under the License is distributed on an "AS IS" BASIS, 657 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 658 * See the License for the specific language governing permissions and 659 * limitations under the License. 660 */const _i="/firebase-messaging-sw.js",Ei="/firebase-cloud-messaging-push-scope",jt="BDOU99-h67HcA6JeFXHbSNMu7e2yNNu3RzoMj8TM4W88jITfq7ZmPvIM1Iv-4_l2LxQcYwhqby2xGpWwzjfAnG4",Si="https://fcmregistrations.googleapis.com/v1",Ht="google.c.a.c_id",Ii="google.c.a.c_l",Ci="google.c.a.ts",Ai="google.c.a.e",ze=1e4;var qe;(function(e){e[e.DATA_MESSAGE=1]="DATA_MESSAGE",e[e.DISPLAY_NOTIFICATION=3]="DISPLAY_NOTIFICATION"})(qe||(qe={}));/** 661 * @license 662 * Copyright 2018 Google LLC 663 * 664 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 665 * in compliance with the License. You may obtain a copy of the License at 666 * 667 * http://www.apache.org/licenses/LICENSE-2.0 668 * 669 * Unless required by applicable law or agreed to in writing, software distributed under the License 670 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 671 * or implied. See the License for the specific language governing permissions and limitations under 672 * the License. 673 */var H;(function(e){e.PUSH_RECEIVED="push-received",e.NOTIFICATION_CLICKED="notification-clicked"})(H||(H={}));/** 674 * @license 675 * Copyright 2017 Google LLC 676 * 677 * Licensed under the Apache License, Version 2.0 (the "License"); 678 * you may not use this file except in compliance with the License. 679 * You may obtain a copy of the License at 680 * 681 * http://www.apache.org/licenses/LICENSE-2.0 682 * 683 * Unless required by applicable law or agreed to in writing, software 684 * distributed under the License is distributed on an "AS IS" BASIS, 685 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 686 * See the License for the specific language governing permissions and 687 * limitations under the License. 688 */function y(e){const t=new Uint8Array(e);return btoa(String.fromCharCode(...t)).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Ti(e){const t="=".repeat((4-e.length%4)%4),n=(e+t).replace(/\-/g,"+").replace(/_/g,"/"),r=atob(n),i=new Uint8Array(r.length);for(let o=0;o<r.length;++o)i[o]=r.charCodeAt(o);return i}/** 689 * @license 690 * Copyright 2019 Google LLC 691 * 692 * Licensed under the Apache License, Version 2.0 (the "License");
693 * you may not use this file except in compliance with the License. 694 * You may obtain a copy of the License at 695 * 696 * http://www.apache.org/licenses/LICENSE-2.0 697 * 698 * Unless required by applicable law or agreed to in writing, software 699 * distributed under the License is distributed on an "AS IS" BASIS, 700 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 701 * See the License for the specific language governing permissions and 702 * limitations under the License. 703 */const se="fcm_token_details_db",ki=5,Ge="fcm_token_object_Store";async function Di(e){if("databases"in indexedDB&&!(await indexedDB.databases()).map(o=>o.name).includes(se))return null;let t=null;return(await G(se,ki,{upgrade:async(r,i,o,s)=>{var a;if(i<2||!r.objectStoreNames.contains(Ge))return;const c=s.objectStore(Ge),u=await c.index("fcmSenderId").get(e);if(await c.clear(),!!u){if(i===2){const d=u;if(!d.auth||!d.p256dh||!d.endpoint)return;t={token:d.fcmToken,createTime:(a=d.createTime)!==null&&a!==void 0?a:Date.now(),subscriptionOptions:{auth:d.auth,p256dh:d.p256dh,endpoint:d.endpoint,swScope:d.swScope,vapidKey:typeof d.vapidKey=="string"?d.vapidKey:y(d.vapidKey)}}}else if(i===3){const d=u;t={token:d.fcmToken,createTime:d.createTime,subscriptionOptions:{auth:y(d.auth),p256dh:y(d.p256dh),endpoint:d.endpoint,swScope:d.swScope,vapidKey:y(d.vapidKey)}}}else if(i===4){const d=u;t={token:d.fcmToken,createTime:d.createTime,subscriptionOptions:{auth:y(d.auth),p256dh:y(d.p256dh),endpoint:d.endpoint,swScope:d.swScope,vapidKey:y(d.vapidKey)}}}}}})).close(),await te(se),await te("fcm_vapid_details_db"),await te("undefined"),Oi(t)?t:null}function Oi(e){if(!e||!e.subscriptionOptions)return!1;const{subscriptionOptions:t}=e;return typeof e.createTime=="number"&&e.createTime>0&&typeof e.token=="string"&&e.token.length>0&&typeof t.auth=="string"&&t.auth.length>0&&typeof t.p256dh=="string"&&t.p256dh.length>0&&typeof t.endpoint=="string"&&t.endpoint.length>0&&typeof t.swScope=="string"&&t.swScope.length>0&&typeof t.vapidKey=="string"&&t.vapidKey.length>0}/** 704 * @license 705 * Copyright 2019 Google LLC 706 * 707 * Licensed under the Apache License, Version 2.0 (the "License"); 708 * you may not use this file except in compliance with the License. 709 * You may obtain a copy of the License at 710 * 711 * http://www.apache.org/licenses/LICENSE-2.0 712 * 713 * Unless required by applicable law or agreed to in writing, software 714 * distributed under the License is distributed on an "AS IS" BASIS, 715 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 716 * See the License for the specific language governing permissions and 717 * limitations under the License. 718 */const Ni="firebase-messaging-database",Ri=1,U="firebase-messaging-store";let ae=null;function Ut(){return ae||(ae=G(Ni,Ri,{upgrade:(e,t)=>{switch(t){case 0:e.createObjectStore(U)}}})),ae}async function Mi(e){const t=Vt(e),r=await(await Ut()).transaction(U).objectStore(U).get(t);if(r)return r;{const i=await Di(e.appConfig.senderId);if(i)return await Ae(e,i),i}}async function Ae(e,t){const n=Vt(e),i=(await Ut()).transaction(U,"readwrite");return await i.objectStore(U).put(t,n),await i.done,t}function Vt({appConfig:e}){return e.appId}/** 719 * @license 720 * Copyright 2017 Google LLC 721 * 722 * Licensed under the Apache License, Version 2.0 (the "License"); 723 * you may not use this file except in compliance with the License. 724 * You may obtain a copy of the License at 725 * 726 * http://www.apache.org/licenses/LICENSE-2.0 727 * 728 * Unless required by applicable law or agreed to in writing, software 729 * distributed under the License is distributed on an "AS IS" BASIS, 730 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 731 * See the License for the specific language governing permissions and 732 * limitations under the License. 733 */const Pi={"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"only-available-in-window":"This method is available in a Window context.","only-available-in-sw":"This method is available in a service worker context.","permission-default":"The notification permission was not granted and dismissed instead.","permission-blocked":"The notification permission was not granted and blocked instead.","unsupported-browser":"This browser doesn't support the API's required to use the Firebase SDK.","indexed-db-unsupported":"This browser doesn't support indexedDb.open() (ex. Safari iFrame, Firefox Private Browsing, etc)","failed-service-worker-registration":"We are unable to register the default service worker. {$browserErrorMessage}","token-subscribe-failed":"A problem occurred while subscribing the user to FCM: {$errorInfo}","token-subscribe-no-token":"FCM returned no token when subscribing the user to push.","token-unsubscribe-failed":"A problem occurred while unsubscribing the user from FCM: {$errorInfo}","token-update-failed":"A problem occurred while updating the user from FCM: {$errorInfo}","token-update-no-token":"FCM returned no token when updating the user to push.","use-sw-after-get-token":"The useServiceWorker() method may only be called once and must be called before calling getToken() to ensure your service worker is used.","invali
733d-sw-registration":"The input to useServiceWorker() must be a ServiceWorkerRegistration.","invalid-bg-handler":"The input to setBackgroundMessageHandler() must be a function.","invalid-vapid-key":"The public VAPID key must be a string.","use-vapid-key-after-get-token":"The usePublicVapidKey() method may only be called once and must be called before calling getToken() to ensure your VAPID key is used."},h=new q("messaging","Messaging",Pi);/** 734 * @license 735 * Copyright 2019 Google LLC 736 * 737 * Licensed under the Apache License, Version 2.0 (the "License"); 738 * you may not use this file except in compliance with the License. 739 * You may obtain a copy of the License at 740 * 741 * http://www.apache.org/licenses/LICENSE-2.0 742 * 743 * Unless required by applicable law or agreed to in writing, software 744 * distributed under the License is distributed on an "AS IS" BASIS, 745 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 746 * See the License for the specific language governing permissions and 747 * limitations under the License. 748 */async function Bi(e,t){const n=await ke(e),r=Kt(t),i={method:"POST",headers:n,body:JSON.stringify(r)};let o;try{o=await(await fetch(Te(e.appConfig),i)).json()}catch(s){throw h.create("token-subscribe-failed",{errorInfo:s?.toString()})}if(o.error){const s=o.error.message;throw h.create("token-subscribe-failed",{errorInfo:s})}if(!o.token)throw h.create("token-subscribe-no-token");return o.token}async function Fi(e,t){const n=await ke(e),r=Kt(t.subscriptionOptions),i={method:"PATCH",headers:n,body:JSON.stringify(r)};let o;try{o=await(await fetch(`${Te(e.appConfig)}/${t.token}`,i)).json()}catch(s){throw h.create("token-update-failed",{errorInfo:s?.toString()})}if(o.error){const s=o.error.message;throw h.create("token-update-failed",{errorInfo:s})}if(!o.token)throw h.create("token-update-no-token");return o.token}async function $i(e,t){const r={method:"DELETE",headers:await ke(e)};try{const o=await(await fetch(`${Te(e.appConfig)}/${t}`,r)).json();if(o.error){const s=o.error.message;throw h.create("token-unsubscribe-failed",{errorInfo:s})}}catch(i){throw h.create("token-unsubscribe-failed",{errorInfo:i?.toString()})}}function Te({projectId:e}){return`${Si}/projects/${e}/registrations`}async function ke({appConfig:e,installations:t}){const n=await t.getToken();return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e.apiKey,"x-goog-firebase-installations-auth":`FIS ${n}`})}function Kt({p256dh:e,auth:t,endpoint:n,vapidKey:r}){const i={web:{endpoint:n,auth:t,p256dh:e}};return r!==jt&&(i.web.applicationPubKey=r),i}/** 749 * @license 750 * Copyright 2019 Google LLC 751 * 752 * Licensed under the Apache License, Version 2.0 (the "License"); 753 * you may not use this file except in compliance with the License. 754 * You may obtain a copy of the License at 755 * 756 * http://www.apache.org/licenses/LICENSE-2.0 757 * 758 * Unless required by applicable law or agreed to in writing, software 759 * distributed under the License is distributed on an "AS IS" BASIS, 760 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 761 * See the License for the specific language governing permissions and 762 * limitations under the License. 763 */const Li=10080*60*1e3;async function xi(e){const t=await Hi(e.swRegistration,e.vapidKey),n={vapidKey:e.vapidKey,swScope:e.swRegistration.scope,endpoint:t.endpoint,auth:y(t.getKey("auth")),p256dh:y(t.getKey("p256dh"))},r=await Mi(e.firebaseDependencies);if(r){if(Ui(r.subscriptionOptions,n))return Date.now()>=r.createTime+Li?ji(e,{token:r.token,createTime:Date.now(),subscriptionOptions:n}):r.token;try{await $i(e.firebaseDependencies,r.token)}catch(i){console.warn(i)}return Je(e.firebaseDependencies,n)}else return Je(e.firebaseDependencies,n)}async function ji(e,t){try{const n=await Fi(e.firebaseDependencies,t),r=Object.assign(Object.assign({},t),{token:n,createTime:Date.now()});return await Ae(e.firebaseDependencies,r),n}catch(n){throw n}}async function Je(e,t){const r={token:await Bi(e,t),createTime:Date.now(),subscriptionOptions:t};return await Ae(e,r),r.token}async function Hi(e,t){const n=await e.pushManager.getSubscription();return n||e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:Ti(t)})}function Ui(e,t){const n=t.vapidKey===e.vapidKey,r=t.endpoint===e.endpoint,i=t.auth===e.auth,o=t.p256dh===e.p256dh;return n&&r&&i&&o}/** 764 * @license 765 * Copyright 2020 Google LLC 766 * 767 * Licensed under the Apache License, Version 2.0 (the "License");
768 * you may not use this file except in compliance with the License. 769 * You may obtain a copy of the License at 770 * 771 * http://www.apache.org/licenses/LICENSE-2.0 772 * 773 * Unless required by applicable law or agreed to in writing, software 774 * distributed under the License is distributed on an "AS IS" BASIS, 775 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 776 * See the License for the specific language governing permissions and 777 * limitations under the License. 778 */function Ye(e){const t={from:e.from,collapseKey:e.collapse_key,messageId:e.fcmMessageId};return Vi(t,e),Ki(t,e),Wi(t,e),t}function Vi(e,t){if(!t.notification)return;e.notification={};const n=t.notification.title;n&&(e.notification.title=n);const r=t.notification.body;r&&(e.notification.body=r);const i=t.notification.image;i&&(e.notification.image=i);const o=t.notification.icon;o&&(e.notification.icon=o)}function Ki(e,t){t.data&&(e.data=t.data)}function Wi(e,t){var n,r,i,o,s;if(!t.fcmOptions&&!(!((n=t.notification)===null||n===void 0)&&n.click_action))return;e.fcmOptions={};const a=(i=(r=t.fcmOptions)===null||r===void 0?void 0:r.link)!==null&&i!==void 0?i:(o=t.notification)===null||o===void 0?void 0:o.click_action;a&&(e.fcmOptions.link=a);const c=(s=t.fcmOptions)===null||s===void 0?void 0:s.analytics_label;c&&(e.fcmOptions.analyticsLabel=c)}/** 779 * @license 780 * Copyright 2019 Google LLC 781 * 782 * Licensed under the Apache License, Version 2.0 (the "License"); 783 * you may not use this file except in compliance with the License. 784 * You may obtain a copy of the License at 785 * 786 * http://www.apache.org/licenses/LICENSE-2.0 787 * 788 * Unless required by applicable law or agreed to in writing, software 789 * distributed under the License is distributed on an "AS IS" BASIS, 790 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 791 * See the License for the specific language governing permissions and 792 * limitations under the License. 793 */function zi(e){return typeof e=="object"&&!!e&&Ht in e}/** 794 * @license 795 * Copyright 2019 Google LLC 796 * 797 * Licensed under the Apache License, Version 2.0 (the "License"); 798 * you may not use this file except in compliance with the License. 799 * You may obtain a copy of the License at 800 * 801 * http://www.apache.org/licenses/LICENSE-2.0 802 * 803 * Unless required by applicable law or agreed to in writing, software 804 * distributed under the License is distributed on an "AS IS" BASIS, 805 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 806 * See the License for the specific language governing permissions and 807 * limitations under the License. 808 */function qi(e){if(!e||!e.options)throw ce("App Configuration Object");if(!e.name)throw ce("App Name");const t=["projectId","apiKey","appId","messagingSenderId"],{options:n}=e;for(const r of t)if(!n[r])throw ce(r);return{appName:e.name,projectId:n.projectId,apiKey:n.apiKey,appId:n.appId,senderId:n.messagingSenderId}}function ce(e){return h.create("missing-app-config-values",{valueName:e})}/** 809 * @license 810 * Copyright 2020 Google LLC 811 * 812 * Licensed under the Apache License, Version 2.0 (the "License"); 813 * you may not use this file except in compliance with the License. 814 * You may obtain a copy of the License at 815 * 816 * http://www.apache.org/licenses/LICENSE-2.0 817 * 818 * Unless required by applicable law or agreed to in writing, software 819 * distributed under the License is distributed on an "AS IS" BASIS, 820 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 821 * See the License for the specific language governing permissions and 822 * limitations under the License. 823 */class Gi{constructor(t,n,r){this.deliveryMetricsExportedToBigQueryEnabled=!1,this.onBackgroundMessageHandler=null,this.onMessageHandler=null,this.logEvents=[],this.isLogServiceStarted=!1;const i=qi(t);this.firebaseDependencies={app:t,appConfig:i,installations:n,analyticsProvider:r}}_delete(){return Promise.resolve()}}/** 824 * @license 825 * Copyright 2020 Google LLC 826 * 827 * Licensed under the Apache License, Version 2.0 (the "License"); 828 * you may not use this file except in compliance with the License. 829 * You may obtain a copy of the License at 830 * 831 * http://www.apache.org/licenses/LICENSE-2.0 832 * 833 * Unless required by applicable law or agreed to in writing, softw
833are 834 * distributed under the License is distributed on an "AS IS" BASIS, 835 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 836 * See the License for the specific language governing permissions and 837 * limitations under the License. 838 */async function Ji(e){try{e.swRegistration=await navigator.serviceWorker.register(_i,{scope:Ei}),e.swRegistration.update().catch(()=>{}),await Yi(e.swRegistration)}catch(t){throw h.create("failed-service-worker-registration",{browserErrorMessage:t?.message})}}async function Yi(e){return new Promise((t,n)=>{const r=setTimeout(()=>n(new Error(`Service worker not registered after ${ze} ms`)),ze),i=e.installing||e.waiting;e.active?(clearTimeout(r),t()):i?i.onstatechange=o=>{var s;((s=o.target)===null||s===void 0?void 0:s.state)==="activated"&&(i.onstatechange=null,clearTimeout(r),t())}:(clearTimeout(r),n(new Error("No incoming service worker found.")))})}/** 839 * @license 840 * Copyright 2020 Google LLC 841 * 842 * Licensed under the Apache License, Version 2.0 (the "License"); 843 * you may not use this file except in compliance with the License. 844 * You may obtain a copy of the License at 845 * 846 * http://www.apache.org/licenses/LICENSE-2.0 847 * 848 * Unless required by applicable law or agreed to in writing, software 849 * distributed under the License is distributed on an "AS IS" BASIS, 850 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 851 * See the License for the specific language governing permissions and 852 * limitations under the License. 853 */async function Zi(e,t){if(!t&&!e.swRegistration&&await Ji(e),!(!t&&e.swRegistration)){if(!(t instanceof ServiceWorkerRegistration))throw h.create("invalid-sw-registration");e.swRegistration=t}}/** 854 * @license 855 * Copyright 2020 Google LLC 856 * 857 * Licensed under the Apache License, Version 2.0 (the "License"); 858 * you may not use this file except in compliance with the License. 859 * You may obtain a copy of the License at 860 * 861 * http://www.apache.org/licenses/LICENSE-2.0 862 * 863 * Unless required by applicable law or agreed to in writing, software 864 * distributed under the License is distributed on an "AS IS" BASIS, 865 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 866 * See the License for the specific language governing permissions and 867 * limitations under the License. 868 */async function Xi(e,t){t?e.vapidKey=t:e.vapidKey||(e.vapidKey=jt)}/** 869 * @license 870 * Copyright 2020 Google LLC 871 * 872 * Licensed under the Apache License, Version 2.0 (the "License"); 873 * you may not use this file except in compliance with the License. 874 * You may obtain a copy of the License at 875 * 876 * http://www.apache.org/licenses/LICENSE-2.0 877 * 878 * Unless required by applicable law or agreed to in writing, software 879 * distributed under the License is distributed on an "AS IS" BASIS, 880 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 881 * See the License for the specific language governing permissions and 882 * limitations under the License. 883 */async function Wt(e,t){if(!navigator)throw h.create("only-available-in-window");if(Notification.permission==="default"&&await Notification.requestPermission(),Notification.permission!=="granted")throw h.create("permission-blocked");return await Xi(e,t?.vapidKey),await Zi(e,t?.serviceWorkerRegistration),xi(e)}/** 884 * @license 885 * Copyright 2019 Google LLC 886 * 887 * Licensed under the Apache License, Version 2.0 (the "License"); 888 * you may not use this file except in compliance with the License. 889 * You may obtain a copy of the License at 890 * 891 * http://www.apache.org/licenses/LICENSE-2.0 892 * 893 * Unless required by applicable law or agreed to in writing, software 894 * distributed under the License is distributed on an "AS IS" BASIS, 895 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 896 * See the License for the specific language governing permissions and 897 * limitations under the License. 898 */async function Qi(e,t,n){const r=eo(t);(await e.firebaseDependencies.analyticsProvider.get()).logEvent(r,{message_id:n[Ht],message_name:n[Ii],message_time:n[Ci],message_device_time:Math.floor(Date.now()/1e3)})}function eo(e){switch(e){case H.NOTIFICATION_CLICKED:return"notification_open";case H.PUSH_RECEIVED:return"notification_foreground";default:throw new Error}}/** 899 * @license 900 * Copyright 2017 Google LLC 901 * 902 * Licensed under the Apache License, Version 2.0 (the "License");
903 * you may not use this file except in compliance with the License. 904 * You may obtain a copy of the License at 905 * 906 * http://www.apache.org/licenses/LICENSE-2.0 907 * 908 * Unless required by applicable law or agreed to in writing, software 909 * distributed under the License is distributed on an "AS IS" BASIS, 910 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 911 * See the License for the specific language governing permissions and 912 * limitations under the License. 913 */async function to(e,t){const n=t.data;if(!n.isFirebaseMessaging)return;e.onMessageHandler&&n.messageType===H.PUSH_RECEIVED&&(typeof e.onMessageHandler=="function"?e.onMessageHandler(Ye(n)):e.onMessageHandler.next(Ye(n)));const r=n.data;zi(r)&&r[Ai]==="1"&&await Qi(e,n.messageType,r)}const Ze="@firebase/messaging",Xe="0.12.22";/** 914 * @license 915 * Copyright 2020 Google LLC 916 * 917 * Licensed under the Apache License, Version 2.0 (the "License"); 918 * you may not use this file except in compliance with the License. 919 * You may obtain a copy of the License at 920 * 921 * http://www.apache.org/licenses/LICENSE-2.0 922 * 923 * Unless required by applicable law or agreed to in writing, software 924 * distributed under the License is distributed on an "AS IS" BASIS, 925 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 926 * See the License for the specific language governing permissions and 927 * limitations under the License. 928 */const no=e=>{const t=new Gi(e.getProvider("app").getImmediate(),e.getProvider("installations-internal").getImmediate(),e.getProvider("analytics-internal"));return navigator.serviceWorker.addEventListener("message",n=>to(t,n)),t},ro=e=>{const t=e.getProvider("messaging").getImmediate();return{getToken:r=>Wt(t,r)}};function io(){k(new A("messaging",no,"PUBLIC")),k(new A("messaging-internal",ro,"PRIVATE")),b(Ze,Xe),b(Ze,Xe,"esm2017")}/** 929 * @license 930 * Copyright 2020 Google LLC 931 * 932 * Licensed under the Apache License, Version 2.0 (the "License"); 933 * you may not use this file except in compliance with the License. 934 * You may obtain a copy of the License at 935 * 936 * http://www.apache.org/licenses/LICENSE-2.0 937 * 938 * Unless required by applicable law or agreed to in writing, software 939 * distributed under the License is distributed on an "AS IS" BASIS, 940 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 941 * See the License for the specific language governing permissions and 942 * limitations under the License. 943 */async function zt(){try{await lt()}catch{return!1}return typeof window<"u"&&dt()&&pn()&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window&&"fetch"in window&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey")}/** 944 * @license 945 * Copyright 2020 Google LLC 946 * 947 * Licensed under the Apache License, Version 2.0 (the "License"); 948 * you may not use this file except in compliance with the License. 949 * You may obtain a copy of the License at 950 * 951 * http://www.apache.org/licenses/LICENSE-2.0 952 * 953 * Unless required by applicable law or agreed to in writing, software 954 * distributed under the License is distributed on an "AS IS" BASIS, 955 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 956 * See the License for the specific language governing permissions and 957 * limitations under the License. 958 */function oo(e,t){if(!navigator)throw h.create("only-available-in-window");return e.onMessageHandler=t,()=>{e.onMessageHandler=null}}/** 959 * @license 960 * Copyright 2017 Google LLC 961 * 962 * Licensed under the Apache License, Version 2.0 (the "License"); 963 * you may not use this file except in compliance with the License. 964 * You may obtain a copy of the License at 965 * 966 * http://www.apache.org/licenses/LICENSE-2.0 967 * 968 * Unless required by applicable law or agreed to in writing, software 969 * distributed under the License is distributed on an "AS IS" BASIS, 970 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 971 * See the License for the specific language governing permissions and 972 * limitations under the License. 973 */function so(e=_e()){return zt().then(t=>{if(!t)throw h.create("unsupported-browser")},t=>{throw h.create("indexed-db-unsupported")}),V(be(e),"messaging").getImmediate()}async function ao(e,t){return e=be(e),Wt(e,t)}function co(e,t){return e=be(e),oo(e,t)}io();const uo={BASE_URL:"/build/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};let Qe=!1,S=null;const I=e=>typeof document>"u"?null:document.querySelector(`meta[name="${e}"]`)?.getAttribute("content")?.trim()||null,C=e=>{const n=uo[e];return typeof n=="string"&&n.trim()!==""?n:null},lo=()=>
973{if(Qe)return S;if(Qe=!0,typeof document>"u")return S=null,S;const t=document.querySelector("[data-page]")?.getAttribute("data-page");if(!t)return S=null,S;try{S=JSON.parse(t).props??null}catch{S=null}return S},fo=()=>{const t=lo()?.pub_id;if(typeof t=="string"&&t.trim()!=="")return t;if(typeof t=="number")return String(t);const n=I("radarjp:pub-id");if(n)return n;const r=C("PUBLISHER_ID");return r||null},qt=()=>{const e=(typeof document<"u"?I("radarjp:firebase-api-key"):null)??C("FIREBASE_API_KEY"),t=(typeof document<"u"?I("radarjp:firebase-auth-domain"):null)??C("FIREBASE_AUTH_DOMAIN"),n=(typeof document<"u"?I("radarjp:firebase-project-id"):null)??C("FIREBASE_PROJECT_ID"),r=(typeof document<"u"?I("radarjp:firebase-messaging-sender-id"):null)??C("FIREBASE_MESSAGING_SENDER_ID"),i=(typeof document<"u"?I("radarjp:firebase-app-id"):null)??C("FIREBASE_APP_ID"),o=[];return e||o.push("FIREBASE_API_KEY"),t||o.push("FIREBASE_AUTH_DOMAIN"),n||o.push("FIREBASE_PROJECT_ID"),r||o.push("FIREBASE_MESSAGING_SENDER_ID"),i||o.push("FIREBASE_APP_ID"),o.length>0?(console.warn("FCM disabled: missing required Firebase configuration.",{missingKeys:o}),null):{apiKey:String(e),authDomain:String(t),projectId:String(n),messagingSenderId:String(r),appId:String(i),storageBucket:(typeof document<"u"?I("radarjp:firebase-storage-bucket"):null)??C("FIREBASE_STORAGE_BUCKET")??void 0}},po=()=>{const e=(typeof document<"u"?I("radarjp:firebase-vapid-key"):null)??C("FIREBASE_VAPID_KEY");return e||(console.warn("FCM disabled: missing VAPID key."),null)},ho="/api/content/v1/fcm-token",go=async e=>{const t=await fetch(ho,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({token:e})}),n=await t.json().catch(()=>null);if(!t.ok)throw new Error(n?.message||`Request register FCM gagal (${t.status}).`);return!!n?.registerFcmToken},mo=async e=>{if(!e.trim())return{ok:!1,code:"rejected",message:"Token FCM kosong."};try{return await go(e)?{ok:!0,code:"ok",message:"Token FCM berhasil disinkronkan ke backend."}:{ok:!1,code:"rejected",message:"Backend menolak atau gagal subscribe token ke topic."}}catch(t){return console.error("Failed to register FCM token.",t),{ok:!1,co
973de:"request-failed",message:t instanceof Error?t.message:"Request register FCM gagal."}}},bo="fcm:last-registered-token",Gt="fcm:last-registration-context",wo="fcm:permission-state",yo="fcm:token-sync-state",De="fcm:last-sync-debug",Jt="fcm:seen-messages",vo="/firebase-messaging-sw.js",_o=3e3,et=15e3;let tt=!1;const v=e=>{if(!e)return null;const t=e.trim().replace(/^`+|`+$/g,"").trim();return t||null},Eo=e=>{const t=v(e?.url);if(t)return t;const n=v(e?.click_action);if(n)return n;const r=v(e?.slug)||v(e?.article_slug);return r?`/article/${r}`:"/"},So=e=>{const t=e.data??{};return[e.messageId,t.message_id,t["google.c.a.c_id"],t.gcm_message_id,e.notification?.title,e.notification?.body,t.url,t.click_action,t.slug,t.article_slug].map(r=>v(r)??"").filter(Boolean).join("|")},Io=()=>{if(typeof window>"u")return{};const e=localStorage.getItem(Jt);if(!e)return{};try{return JSON.parse(e)}catch{return{}}},Co=e=>{typeof window>"u"||localStorage.setItem(Jt,JSON.stringify(e))},Ao=e=>{if(typeof window>"u")return!1;const t=So(e);if(!t)return!1;const n=Date.now(),r=Io(),i=Object.fromEntries(Object.entries(r).filter(([,s])=>n-s<et)),o=i[t];return o&&n-o<et?!0:(i[t]=n,Co(i),!1)},To=async e=>{if(typeof window>"u"||Notification.permission!=="granted")return;if(Ao(e)){console.info("[FCM] Duplicate foreground notification suppressed.");return}const t=e.notification?.title||"Notifikasi terbaru",n=e.notification?.body||"",r=e.data??{},i=Eo(r),o={body:n,icon:v(r.icon)??"/apple-touch-icon.png",badge:v(r.badge)??"/apple-touch-icon.png",data:{...r,targetUrl:i,slug:v(r.slug)||v(r.article_slug)||""}};try{await(await navigator.serviceWorker.ready).showNotification(t,o)}catch(s){try{const a=new Notification(t,o);a.onclick=()=>{const c=new URL(i,window.location.origin).href;window.open(c,"_blank")}}catch(a){console.warn("[FCM] Failed to show foreground system notification.",{error:s,fallbackError:a})}}},Oe=()=>{if(typeof window>"u")return!1;const e="Notification"in window,t="serviceWorker"in navigator,n="PushManager"in window,r=e&&t&&n;return r||console.warn("[FCM] Web push unsupported.",{hasNotification:e,hasServiceWorker:t,hasPushManager:n}),r},ko=()=>{const e=qt();return e?wt().length>0?_e():ve(e):null},Do=()=>{const e=qt();if(!e)return null;const t=new URLSearchParams({apiKey:e.apiKey,projectId:e.projectId,messagingSenderId:e.messagingSenderId,appId:e.appId});return e.authDomain&&t.set("authDomain",e.authDomain),e.storageBucket&&t.set("storageBucket",e.storageBucket),`${vo}?${t.toString()}`},Oo=e=>{typeof window>"u"||localStorage.setItem(bo,e)},No=()=>{if(typeof window>"u")return null;const e=localStorage.getItem(Gt);if(!e)return null;try{const t=JSON.parse(e);return!t.token||!t.pubId||!t.topic?null:{token:t.token,pubId:t.pubId,topic:t.to
973pic}}catch{return null}},Ro=e=>{typeof window>"u"||localStorage.setItem(Gt,JSON.stringify(e))},O=e=>{typeof window>"u"||localStorage.setItem(wo,e)},Yt=e=>{typeof window>"u"||localStorage.setItem(yo,e)},Mo=e=>{typeof window>"u"||localStorage.setItem(De,JSON.stringify(e))},Po=()=>{typeof window>"u"||localStorage.removeItem(De)},Bo=()=>{if(typeof window>"u")return null;const e=localStorage.getItem(De);if(!e)return null;try{return JSON.parse(e)}catch{return null}},w=(e,t,n)=>{if(Yt("failed"),Mo({code:e,message:t,at:new Date().toISOString()}),n){console.error(`[FCM] ${t}`,n);return}console.warn(`[FCM] ${t}`)},nt=()=>{Yt("synced"),Po()},ge=async()=>{if(!Oe())return w("unsupported","Browser tidak mendukung web push."),!1;if(!await zt())return w("firebase-unsupported","Firebase Messaging tidak didukung di browser ini."),!1;const t=ko(),n=po(),r=Do();if(!t||!n||!r)return w("missing-config","Konfigurasi Firebase atau service worker belum lengkap."),!1;let i;try{i=await navigator.serviceWorker.register(r),await navigator.serviceWorker.ready}catch(p){return w("service-worker-registration-failed","Gagal mendaftarkan service worker FCM.",p),!1}const o=so(t);tt||(tt=!0,co(o,p=>{To(p)}));let s="";try{s=await ao(o,{vapidKey:n,serviceWorkerRegistration:i})}catch(p){return w("get-token-failed","Gagal mengambil token FCM dari browser.",p),!1}if(!s)return w("empty-token","Firebase mengembalikan token kosong."),!1;const a=fo();if(!a)return w("missing-publisher-id","Publisher ID tidak tersedia untuk subscription topic."),!1;const c=`web-notification-${a}`,u=No();if(u&&u.token===s&&u.pubId===a&&u.topic===c)return nt(),!0;const d=await mo(s);return d.ok?(Oo(s),Ro({token:s,pubId:a,topic:c}),nt()):w(d.code,d.message),d.ok},Zt=async()=>{if(!Oe())return O("unsupported"),"unsupported";const e=Notification.permission;if(e==="granted"){const t=await ge();return O(t?"granted":"error"),t?"granted":"error"}if(e==="denied")return O("blocked"),"blocked";try{const t=await Notification.requestPermission();if(t==="granted"){const r=await ge();return O(r?"granted":"error"),r?"granted":"error"}const n=t==="denied"?"denied":"skipped";return O(n),n}catch(t){return console.error("[FCM] Failed while requesting permission.",t),O("error"),w("permission-request-failed","Gagal meminta izin notifikasi ke browser.",t),"error"}},Fo=async()=>{if(Oe()){if(Notification.permission==="granted"){const e=await ge();O(e?"granted":"error");return}Notification.permission==="default"&&window.setTimeout(()=>{Zt()},_o)}},Xo=Object.freeze(Object.defineProperty({__proto__:null,bootstrapWebPush:Fo,getFcmSyncDebug:Bo,requestPushPermissionAndRegisterToken:Zt},Symbol.toStringTag,{value:"Module"}));export{Zo as A,Xo as B,A as C,q as E,P as F,Cn as L,vr as S,mr as _,_e as a,qo as b,be as c,ct as d,Jo as e,ue as f,Bo as g,V as h,un as i,Lo as j,$o as k,Wo as l,zo as m,st as n,f as o,xo as p,Go as q,Zt as r,Ho as s,Ko as t,jo as u,Vo as v,Uo as w,k as x,b as y,Yo as z};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.