PageSourceSearch

https://ibhavikmakwana.dev/assets/firebase-Cu8NuBFT.js

js ibhavikmakwana.dev collected 2026-10-05 06:52:26 UTC 308,702 bytes, 1 lines download raw bytes

1var e={};const t=function(e){const t=[];let n=0;for(let i=0;i<e.length;i++){let r=e.charCodeAt(i);r<128?t[n++]=r:r<2048?(t[n++]=r>>6|192,t[n++]=63&r|128):55296==(64512&r)&&i+1<e.length&&56320==(64512&e.charCodeAt(i+1))?(r=65536+((1023&r)<<10)+(1023&e.charCodeAt(++i)),t[n++]=r>>18|240,t[n++]=r>>12&63|128,t[n++]=r>>6&63|128,t[n++]=63&r|128):(t[n++]=r>>12|224,t[n++]=r>>6&63|128,t[n++]=63&r|128)}return t},n={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:"function"==typeof atob,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_,i=[];for(let r=0;r<e.length;r+=3){const t=e[r],s=r+1<e.length,o=s?e[r+1]:0,a=r+2<e.length,c=a?e[r+2]:0,h=t>>2,l=(3&t)<<4|o>>4;let u=(15&o)<<2|c>>6,d=63&c;a||(d=64,s||(u=64)),i.push(n[h],n[l],n[u],n[d])}return i.join("")},encodeString(e,n){return this.HAS_NATIVE_SUPPORT&&!n?btoa(e):this.encodeByteArray(t(e),n)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){const t=[];let n=0,i=0;for(;n<e.length;){const r=e[n++];if(r<128)t[i++]=String.fromCharCode(r);else if(r>191&&r<224){const s=e[n++];t[i++]=String.fromCharCode((31&r)<<6|63&s)}else if(r>239&&r<365){const s=((7&r)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536;t[i++]=String.fromCharCode(55296+(s>>10)),t[i++]=String.fromCharCode(56320+(1023&s))}else{const s=e[n++],o=e[n++];t[i++]=String.fromCharCode((15&r)<<12|(63&s)<<6|63&o)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let s=0;s<e.length;){const t=n[e.charAt(s++)],o=s<e.length?n[e.charAt(s)]:0;++s;const a=s<e.length?n[e.charAt(s)]:64;++s;const c=s<e.length?n[e.charAt(s)]:64;if(++s,null==t||null==o||null==a||null==c)throw new i;const h=t<<2|o>>4;if(r.push(h),64!==a){const e=o<<4&240|a>>2;if(r.push(e),64!==c){const e=a<<6&192|c;r.push(e)}}}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 i extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const r=function(e){return function(e){const i=t(e);return n.encodeByteArray(i,!0)}(e).replace(/\./g,"")},s=function(e){try{return n.decodeString(e,!0)}catch(t){}return null};const o=()=>function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("Unable to locate global object.")}().__FIREBASE_DEFAULTS__,a=()=>{try{return o()||(()=>{if("undefined"==typeof process)return;const t=e.__FIREBASE_DEFAULTS__;return t?JSON.parse(t):void 0})()||(()=>{if("undefined"==typeof document)return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(n){return}const t=e&&s(e[1]);return t&&JSON.parse(t)})()}catch(t){return}},c=e=>a()?.emulatorHosts?.[e],h=()=>a()?.config,l=e=>a()?.[`_${e}`];class u{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,n)=>{t?this.reject(t):this.resolve(n),"function"==typeof e&&(this.promise.catch(()=>{}),1===e.length?e(t):e(t,n))}}}function d(e){try{return(e.startsWith("http://")||e.startsWith("https://")?new URL(e).hostname:e).endsWith(".cloudworkstations.dev")}catch{return!1}}async function f(e){return(await fetch(e,{credentials:"include"})).ok}const p={};let g=!1;function m(e,t){if("undefined"==typeof window||"undefined"==typeof document||!d(window.location.host)||p[e]===t||p[e]||g)return;function n(e){return`__firebase__banner__${e}`}p[e]=t;const i="__firebase__banner",r=function(){const e={prod:[],emulator:[]};for(const t of Object.keys(p))p[t]?e.emulator.push(t):e.prod.push(t);return e}().prod.length>0;function s(){const e=document.createElement("span");
1return e.style.cursor="pointer",e.style.marginLeft="16px",e.style.fontSize="24px",e.innerHTML=" &times;",e.onclick=()=>{g=!0,function(){const e=document.getElementById(i);e&&e.remove()}()},e}function o(){const e=function(e){let t=document.getElementById(e),n=!1;return t||(t=document.createElement("div"),t.setAttribute("id",e),n=!0),{created:n,element:t}}(i),t=n("text"),o=document.getElementById(t)||document.createElement("span"),a=n("learnmore"),c=document.getElementById(a)||document.createElement("a"),h=n("preprendIcon"),l=document.getElementById(h)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(e.created){const t=e.element;!function(e){e.style.display="flex",e.style.background="#7faaf0",e.style.position="fixed",e.style.bottom="5px",e.style.left="5px",e.style.padding=".5em",e.style.borderRadius="5px",e.style.alignItems="center"}(t),function(e,t){e.setAttribute("id",t),e.innerText="Learn more",e.href="https://firebase.google.com/docs/studio/preview-apps#preview-backend",e.setAttribute("target","__blank"),e.style.paddingLeft="5px",e.style.textDecoration="underline"}(c,a);const n=s();!function(e,t){e.setAttribute("width","24"),e.setAttribute("id",t),e.setAttribute("height","24"),e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("fill","none"),e.style.marginLeft="-6px"}(l,h),t.append(l,o,c,n),document.body.appendChild(t)}r?(o.innerText="Preview backend disconnected.",l.innerHTML='<g clip-path="url(#clip0_6013_33858)">\n<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"/>\n</g>\n<defs>\n<clipPath id="clip0_6013_33858">\n<rect width="24" height="24" fill="white"/>\n</clipPath>\n</defs>'):(l.innerHTML='<g clip-path="url(#clip0_6083_34804)">\n<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"/>\n</g>\n<defs>\n<clipPath id="clip0_6083_34804">\n<rect width="24" height="24" fill="white"/>\n</clipPath>\n</defs>',o.innerText="Preview backend running in this workspace."),o.setAttribute("id",t)}"loading"===document.readyState?window.addEventListener("DOMContentLoaded",o):o()}function y(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function v(){const e="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof e&&void 0!==e.id}function w(){return!function(){const e=a()?.forceEnvironment;if("node"===e)return!0;
1if("browser"===e)return!1;try{return"[object process]"===Object.prototype.toString.call(global.process)}catch(t){return!1}}()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function _(){try{return"object"==typeof indexedDB}catch(e){return!1}}function b(){return new Promise((e,t)=>{try{let n=!0;const i="validate-browser-context-for-indexeddb-analytics-module",r=self.indexedDB.open(i);r.onsuccess=()=>{r.result.close(),n||self.indexedDB.deleteDatabase(i),e(!0)},r.onupgradeneeded=()=>{n=!1},r.onerror=()=>{t(r.error?.message||"")}}catch(n){t(n)}})}class I extends Error{constructor(e,t,n){super(t),this.code=e,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,I.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,T.prototype.create)}}class T{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e,...t){const n=t[0]||{},i=`${this.service}/${e}`,r=this.errors[e],s=r?function(e,t){return e.replace(E,(e,n)=>{const i=t[n];return null!=i?String(i):`<${n}?>`})}(r,n):"Error",o=`${this.serviceName}: ${s} (${i}).`;return new I(i,o,n)}}const E=/\{\$([^}]+)}/g;function S(e,t){if(e===t)return!0;const n=Object.keys(e),i=Object.keys(t);for(const r of n){if(!i.includes(r))return!1;const n=e[r],s=t[r];if(C(n)&&C(s)){if(!S(n,s))return!1}else if(n!==s)return!1}for(const r of i)if(!n.includes(r))return!1;return!0}function C(e){return null!==e&&"object"==typeof e}function A(e){const t=[];for(const[n,i]of Object.entries(e))Array.isArray(i)?i.forEach(e=>{t.push(encodeURIComponent(n)+"="+encodeURIComponent(e))}):t.push(encodeURIComponent(n)+"="+encodeURIComponent(i));return t.length?"&"+t.join("&"):""}class k{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(e=>{this.error(e)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,n){let i;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");i=function(e,t){if("object"!=typeof e||null===e)return!1;for(const n of t)if(n in e&&"function"==typeof e[n])return!0;return!1}(e,["next","error","complete"])?e:{next:e,error:t,complete:n},void 0===i.next&&(i.next=N),void 0===i.error&&(i.error=N),void 0===i.complete&&(i.complete=N);const r=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch(e){}}),this.observers.push(i),r}unsubscribeOne(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(void 0!==this.observers&&void 0!==this.observers[e])try{t(this.observers[e])}catch(n){"undefined"!=typeof console&&console.error}})}close(e){this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function N(){}function D(e,t=1e3,n=2){const i=t*Math.pow(n,e),r=Math.round(.5*i*(Math.random()-.5)*2);return Math.min(144e5,i+r)}function R(e){return e&&e._delegate?e._delegate:e}class P{constructor(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}const O="[DEFAULT]";class L{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const e=new u;if(this.instancesDeferred.set(t,e),this.isInitialized(t)||this.shouldAutoInitialize())try{const n=this.getOrInitializeService({instanceIdentifier:t});n&&e.resolve(n)}catch(n){}}return this.instancesDeferred.get(t).promise}getImmediate(e){const t=this.normalizeInstanceIdentifier(e?.identifier),n=e?.optional??!1;if(!this.isInitialized(t)&&!this.shouldAutoInitialize()){if(n)return null;throw Error(`Service ${this.name} is not available`)}try{return this.getOrInitializeService({instanceIdentifier:t})}catch(i){if(n)return null;throw i}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,this.shouldAutoInitialize()){if(function(e){return"EAGER"===e.instantiationMode}(e))try{this.getOrInitializeService({instanceIdentifier:O})}catch(t){}for(const[e,n]of this.instancesDeferred.entries()){const i=this.normalizeInstanceIdentifier(e);try{const e=this.getOrInitializeService({instanceIdentifier:i});n.resolve(e)}catch(t){}}}}clearInstance(e=O){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(e=>"INTERNAL"in e).map(e=>e.INTERNAL.delete()),...e.filter(e=>"_delete"in e).map(e=>e._delete())])}isComponentSet(){return null!=this.component}isInitialized(e=O){return this.instances.has(e)}getOptions(e=O){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=e,n=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(n))throw Error(`${this.name}(${n}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const i=this.getOrInitializeService({instanceIdentifier:n,options:t});for(const[r,s]of this.instancesDeferred.entries()){n===this.normalizeInstanceIdentifier(r)&&s.resolve(i)}return i}onInit(e,t){const n=this.normalizeInstanceIdentifier(t),i=this.onInitCallbacks.get(n)??new Set;i.add(e),this.onInitCallbacks.set(n,i);const r=this.instances.get(n);return r&&e(r,n),()=>{i.delete(e)}}invokeOnInitCallbacks(e,t){const n=this.onInitCallbacks.get(t);if(n)for(const i of n)try{i(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let n=this.instances.get(e);if(!n&&this.component&&(n=this.component.instanceFactory(this.container,{instanceIdentifier:(i=e,i===O?void 0:i),options:t}),this.instances.set(e,n),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(n,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,n)}catch{}var i;return n||null}normalizeInstanceIdentifier(e=O){return this.component?this.component.multipleInstances?e:O:e}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class x{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new L(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}var M,U;(U=M||(M={}))[U.DEBUG=0]="DEBUG",U[U.VERBOSE=1]="VERBOSE",U[U.INFO=2]="INFO",U[U.WARN=3]="WARN",U[U.ERROR=4]="ERROR",U[U.SILENT=5]="SILENT";const V={debug:M.DEBUG,verbose:M.VERBOSE,info:M.INFO,warn:M.WARN,error:M.ERROR,silent:M.SILENT},F=M.INFO,j={[M.DEBUG]:"log",[M.VERBOSE]:"log",[M.INFO]:"info",[M.WARN]:"warn",[M.ERROR]:"error"},B=(e,t,...n)=>{if(t<e.logLevel)return;(new Date).toISOString();if(!j[t])throw new Error(`Attempted to log a message with an invali
1d logType (value: ${t})`)};class ${constructor(e){this.name=e,this._logLevel=F,this._logHandler=B,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in M))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?V[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,M.DEBUG,...e),this._logHandler(this,M.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,M.VERBOSE,...e),this._logHandler(this,M.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,M.INFO,...e),this._logHandler(this,M.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,M.WARN,...e),this._logHandler(this,M.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,M.ERROR,...e),this._logHandler(this,M.ERROR,...e)}}let z,q;const H=new WeakMap,G=new WeakMap,K=new WeakMap,W=new WeakMap,Q=new WeakMap;let J={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return G.get(e);if("objectStoreNames"===t)return e.objectStoreNames||K.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return Z(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function X(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(q||(q=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(ee(this),t),Z(H.get(this))}:function(...t){return Z(e.apply(ee(this),t))}:function(t,...n){const i=e.call(ee(this),t,...n);return K.set(i,t.sort?t.sort():[t]),Z(i)}}function Y(e){return"function"==typeof e?X(e):(e instanceof IDBTransaction&&function(e){if(G.has(e))return;const t=new Promise((t,n)=>{const i=()=>{e.removeEventListener("complete",r),e.removeEventListener("error",s),e.removeEventListener("abort",s)},r=()=>{t(),i()},s=()=>{n(e.error||new DOMException("AbortError","AbortError")),i()};e.addEventListener("complete",r),e.addEventListener("error",s),e.addEventListener("abort",s)});G.set(e,t)}(e),t=e,(z||(z=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some(e=>t instanceof e)?new Proxy(e,J):e);var t}function Z(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,n)=>{const i=()=>{e.removeEventListener("success",r),e.removeEventListener("error",s)},r=()=>{t(Z(e.result)),i()},s=()=>{n(e.error),i()};e.addEventListener("success",r),e.addEventListener("error",s)});return t.then(t=>{t instanceof IDBCursor&&H.set(t,e)}).catch(()=>{}),Q.set(t,e),t}(e);if(W.has(e))return W.get(e);const t=Y(e);return t!==e&&(W.set(e,t),Q.set(t,e)),t}const ee=e=>Q.get(e);function te(e,t,{blocked:n,upgrade:i,blocking:r,terminated:s}={}){const o=indexedDB.open(e,t),a=Z(o);return i&&o.addEventListener("upgradeneeded",e=>{i(Z(o.result),e.oldVersion,e.newVersion,Z(o.transaction),e)}),n&&o.addEventListener("blocked",e=>n(e.oldVersion,e.newVersion,e)),a.then(e=>{s&&e.addEventListener("close",()=>s()),r&&e.addEventListener("versionchange",e=>r(e.oldVersion,e.newVersion,e))}).catch(()=>{}),a}const ne=["get","getKey","getAll","getAllKeys","count"],ie=["put","add","delete","clear"],re=new Map;function se(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(re.get(t))return re.get(t);const n=t.replace(/FromIndex$/,""),i=t!==n,r=ie.includes(n);if(!(n in(i?IDBIndex:IDBObjectStore).prototype)||!r&&!ne.includes(n))return;const s=async function(e,...t){const s=this.transaction(e,r?"readwrite":"readonly");let o=s.store;return i&&(o=o.index(t.shift())),(await Promise.all([o[n](...t),r&&s.done]))[0]};return re.set(t,s),s}J=(e=>({...e,get:(t,n,i)=>se(t,n)||e.get(t,n,i),has:(t,n)=>!!se(t,n)||e.has(t,n)}))(J);class oe{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(e=>{if(function(e){const t=e.getComponent();return"VERSION"===t?.type}(e)){const t=e.getImmediate();return`${t.library}/${t.version}`}return null}).filter(e=>e).join(" ")}}const ae="@firebase/app",ce="0.14.7",he=new $("@firebase/app"),le="@firebase/app-compat",ue="@firebase/analytics-compat",de="@firebase/analytics",fe="@firebase/app-check-compat",pe="@firebase/app-check",ge="@firebase/auth",me="@firebase/auth-compat",ye="@firebase/database",ve="@firebase/data-connect",we="@firebase/database-compat",_e="@firebase/functions",be="@firebase/functions-compat",Ie="@firebase/installations",Te="@firebase/installations-compat",Ee="@firebase/messaging",Se="@firebase/messaging-compat",Ce="@firebase/performance",Ae="@firebase/performance-compat",ke="@firebase/remote-config",Ne="@firebase/remote-config-compat",De="@firebase/storage",Re="@firebase/storage-compat",Pe="@firebase/firestore",Oe="@firebase/ai",Le="@firebase/firestore-compat",xe
vendor: 1,778 bytes, line 1
1="firebase",Me="[DEFAULT]",Ue={[ae]:"fire-core",[le]:"fire-core-compat",[de]:"fire-analytics",[ue]:"fire-analytics-compat",[pe]:"fire-app-check",[fe]:"fire-app-check-compat",[ge]:"fire-auth",[me]:"fire-auth-compat",[ye]:"fire-rtdb",[ve]:"fire-data-connect",[we]:"fire-rtdb-compat",[_e]:"fire-fn",[be]:"fire-fn-compat",[Ie]:"fire-iid",[Te]:"fire-iid-compat",[Ee]:"fire-fcm",[Se]:"fire-fcm-compat",[Ce]:"fire-perf",[Ae]:"fire-perf-compat",[ke]:"fire-rc",[Ne]:"fire-rc-compat",[De]:"fire-gcs",[Re]:"fire-gcs-compat",[Pe]:"fire-fst",[Le]:"fire-fst-compat",[Oe]:"fire-vertex","fire-js":"fire-js",[xe]:"fire-js-all"},Ve=new Map,Fe=new Map,je=new Map;function Be(e,t){try{e.container.addComponent(t)}catch(n){he.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function $e(e){const t=e.name;if(je.has(t))return he.debug(`There were multiple attempts to register component ${t}.`),!1;je.set(t,e);for(const n of Ve.values())Be(n,e);for(const n of Fe.values())Be(n,e);return!0}function ze(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}function qe(e){return null!=e&&void 0!==e.settings}const He=new T("app","Firebase",{"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invali
1d-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."});class Ge{constructor(e,t,n){this._isDeleted=!1,this._options={...e},this._config={...t},this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new P("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw He.create("app-deleted",{appName:this._name})}}const Ke="12.8.0";function We(e,t={}){let n=e;if("object"!=typeof t){t={name:t}}const i={name:Me,automaticDataCollectionEnabled:!0,...t},r=i.name;if("string"!=typeof r||!r)throw He.create("bad-app-name",{appName:String(r)});if(n||(n=h()),!n)throw He.create("no-options");const s=Ve.get(r);if(s){if(S(n,s.options)&&S(i,s.config))return s;throw He.create("duplicate-app",{appName:r})}const o=new x(r);for(const c of je.values())o.addComponent(c);const a=new Ge(n,i,o);return Ve.set(r,a),a}function Qe(e=Me){const t=Ve.get(e);if(!t&&e===Me&&h())return We();if(!t)throw He.create("no-app",{appName:e});return t}function Je(e,t,n){let i=Ue[e]??e;n&&(i+=`-${n}`);const r=i.match(/\s|\//),s=t.match(/\s|\//);if(r||s){const e=[`Unable to register library "${i}" with version "${t}":`];return r&&e.push(`library name "${i}" contains illegal characters (whitespace or "/")`),r&&s&&e.push("and"),s&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),void he.warn(e.join(" "))}$e(new P(`${i}-version`,()=>({library:i,version:t}),"VERSION"))}const Xe="firebase-heartbeat-store";let Ye=null;function Ze(){return Ye||(Ye=te("firebase-heartbeat-database",1,{upgrade:(e,t)=>{if(0===t)try{e.createObjectStore(Xe)}catch(n){}}}).catch(e=>{throw He.create("idb-open",{originalErrorMessage:e.message})})),Ye}async function et(e,t){try{const n=(await Ze()).transaction(Xe,"readwrite"),i=n.objectStore(Xe);await i.put(t,tt(e)),await n.done}catch(n){if(n instanceof I)he.warn(n.message);else{const e=He.create("idb-set",{originalErrorMessage:n?.message});he.warn(e.message)}}}function tt(e){return`${e.name}!${e.options.appId}`}class nt{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new rt(t),this._heartbeatsCachePromise=this._storage.read().then(e=>(this._heartbeatsCache=e,e))}async triggerHeartbeat(){try{const e=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),t=it();if(null==this._heartbeatsCache?.heartbeats&&(this._heartbeatsCache=await this._heartbeatsCachePromise,null==this._heartbeatsCache?.heartbeats))return;if(this._heartbeatsCache.lastSentHeartbeatDate===t||this._heartbeatsCache.heartbeats.some(e=>e.date===t))return;if(this._heartbeatsCache.heartbeats.push({date:t,agent:e}),this._heartbeatsCache.heartbeats.length>30){const e=function(e){if(0===e.length)return-1;let t=0,n=e[0].date;for(let i=1;i<e.length;i++)e[i].date<n&&(n=e[i].date,t=i);return t}(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(e,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(e){he.warn(e)}}async getHeartbeatsHeader(){try{if(null===this._heartbeatsCache&&await this._heartbeatsCachePromise,null==this._heartbeatsCache?.heartbeats||0===this._heartbeatsCache.heartbeats.length)return"";const e=it(),{heartbeatsToSend:t,unsentEntries:n}=function(e,t=1024){const n=[];let i=e.slice();for(const r of e){const e=n.find(e=>e.agent===r.agent);if(e){if(e.dates.push(r.date),st(n)>t){e.dates.pop();break}}else if(n.push({agent:r.agent,dates:[r.date]}),st(n)>t){n.pop();break}i=i.slice(1)}return{heartbeatsToSend:n,unsentEntries:i}}(this._heartbeatsCache.heartbeats),i=r(JSON.stringify({version:2,heartbeats:t}));return this._heartbeatsCache.lastSentHeartbeatDate=e,n.length>0?(this._heartbeatsCache.heartbeats=n,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),i}catch(e){return he.warn(e),""}}}function it(){return(new Date).toISOString().substring(0,10)}class rt{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return!!_()&&b().then(()=>!0).catch(()=>!1)}async read(){if(await this._canUseIndexedDBPromise){const e=await async function(e){try{const t=(await Ze()).transaction(Xe),n=await t.objectStore(Xe).get(tt(e));return await t.done,n}catch(t){if(t instanceof I)he.warn(t.message);else{const e=He.create("idb-get",{originalErrorMessage:t?.message});he.warn(e.message)}}}(this.app);return e?.heartbeats?e:{heartbeats:[]}}return{heartbeats:[]}}async overwrite(e){if(await this._canUseIndexedDBPromise){const t=await this.read();return et(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??t.lastSentHeartbeatDate,heartbeats:e.heartbeats})}}async add(e){if(await this._canUseIndexedDBPromise){const t=await this.read();return et(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??t.lastSentHeartbeatDate,heartbeats:[...t.heartbeats,...e.heartbeats]})}}}function st(e){return r(JSON.stringify({version:2,heartbeats:e})).length}var ot;ot="",$e(new P("platform-logger",e=>new oe(e),"PRIVATE")),$e(new P("heartbeat",e=>new nt(e),"PRIVATE")),Je(ae,ce,ot),Je(ae,ce,"esm2020"),Je("fire-js","");Je("firebase","12.8.0","app");const at="@firebase/installations",ct="0.6.19",ht=1e4,lt=`w:${ct}`,ut="FIS_v2",dt=36e5,ft=new T("installations","Installations",{"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."});function pt(e){return e instanceof I&&e.code.includes("request-failed")}function gt({projectId:e}){return`https://firebaseinstallations.googleapis.com/v1/projects/${e}/installations`}
vendor: 4,637 bytes, line 1
1function mt(e){return{token:e.token,requestStatus:2,expiresIn:(t=e.expiresIn,Number(t.replace("s","000"))),creationTime:Date.now()};var t}async function yt(e,t){const n=(await t.json()).error;return ft.create("request-failed",{requestName:e,serverCode:n.code,serverMessage:n.message,serverStatus:n.status})}function vt({apiKey:e}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e})}function wt(e,{refreshToken:t}){const n=vt(e);return n.append("Authorization",function(e){return`${ut} ${e}`}(t)),n}async function _t(e){const t=await e();return t.status>=500&&t.status<600?e():t}function bt(e){return new Promise(t=>{setTimeout(t,e)})}const It=/^[cdef][\w-]{21}$/;function Tt(){try{const e=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(e),e[0]=112+e[0]%16;const t=function(e){const t=(n=e,btoa(String.fromCharCode(...n)).replace(/\+/g,"-").replace(/\//g,"_"));var n;return t.substr(0,22)}(e);return It.test(t)?t:""}catch{return""}}function Et(e){return`${e.appName}!${e.appId}`}const St=new Map;function Ct(e,t){const n=Et(e);At(n,t),function(e,t){const n=function(){!kt&&"BroadcastChannel"in self&&(kt=new BroadcastChannel("[Firebase] FID Change"),kt.onmessage=e=>{At(e.data.key,e.data.fid)});return kt}();n&&n.postMessage({key:e,fid:t});0===St.size&&kt&&(kt.close(),kt=null)}(n,t)}function At(e,t){const n=St.get(e);if(n)for(const i of n)i(t)}let kt=null;const Nt="firebase-installations-store";let Dt=null;function Rt(){return Dt||(Dt=te("firebase-installations-database",1,{upgrade:(e,t)=>{if(0===t)e.createObjectStore(Nt)}})),Dt}async function Pt(e,t){const n=Et(e),i=(await Rt()).transaction(Nt,"readwrite"),r=i.objectStore(Nt),s=await r.get(n);return await r.put(t,n),await i.done,s&&s.fid===t.fid||Ct(e,t.fid),t}async function Ot(e){const t=Et(e),n=(await Rt()).transaction(Nt,"readwrite");await n.objectStore(Nt).delete(t),await n.done}async function Lt(e,t){const n=Et(e),i=(await Rt()).transaction(Nt,"readwrite"),r=i.objectStore(Nt),s=await r.get(n),o=t(s);return void 0===o?await r.delete(n):await r.put(o,n),await i.done,!o||s&&s.fid===o.fid||Ct(e,o.fid),o}async function xt(e){let t;const n=await Lt(e.appConfig,n=>{const i=function(e){const t=e||{fid:Tt(),registrationStatus:0};return Vt(t)}(n),r=function(e,t){if(0===t.registrationStatus){if(!navigator.onLine){return{installationEntry:t,registrationPromise:Promise.reject(ft.create("app-offline"))}}const n={fid:t.fid,registrationStatus:1,registrationTime:Date.now()},i=async function(e,t){try{const n=await async function({appConfig:e,heartbeatServiceProvider:t},{fid:n}){const i=gt(e),r=vt(e),s=t.getImmediate({optional:!0});if(s){const e=await s.getHeartbeatsHeader();e&&r.append("x-firebase-client",e)}const o={fid:n,authVersion:ut,appId:e.appId,sdkVersion:lt},a={method:"POST",headers:r,body:JSON.stringify(o)},c=await _t(()=>fetch(i,a));if(c.ok){const e=await c.json();return{fid:e.fid||n,registrationStatus:2,refreshToken:e.refreshToken,authToken:mt(e.authToken)}}throw await yt("Create Installation",c)}(e,t);return Pt(e.appConfig,n)}catch(n){throw pt(n)&&409===n.customData.serverCode?await Ot(e.appConfig):await Pt(e.appConfig,{fid:t.fid,registrationStatus:0}),n}}(e,n);return{installationEntry:n,registrationPromise:i}}return 1===t.registrationStatus?{installationEntry:t,registrationPromise:Mt(e)}:{installationEntry:t}}(e,i);return t=r.registrationPromise,r.installationEntry});return""===n.fid?{installationEntry:await t}:{installationEntry:n,registrationPromise:t}}async function Mt(e){let t=await Ut(e.appConfig);for(;1===t.registrationStatus;)await bt(100),t=await Ut(e.appConfig);if(0===t.registrationStatus){const{installationEntry:t,registrationPromise:n}=await xt(e);return n||t}return t}function Ut(e){return Lt(e,e=>{if(!e)throw ft.create("installation-not-found");return Vt(e)})}function Vt(e){return 1===(t=e).registrationStatus&&t.registrationTime+ht<Date.now()?{fid:e.fid,registrationStatus:0}:e;var t}async function Ft({appConfig:e,heartbeatServiceProvider:t},n){const i=function(e,{fid:t}){return`${gt(e)}/${t}/authTokens:generate`}(e,n),r=wt(e,n),s=t.getImmediate({optional:!0});if(s){const e=await s.getHeartbeatsHeader();e&&r.append("x-firebase-client",e)}const o={installation:{sdkVersion:lt,appId:e.appId}},a={method:"POST",headers:r,body:JSON.stringify(o)},c=await _t(()=>fetch(i,a));if(c.ok){return mt(await c.json())}throw await yt("Generate Auth Token",c)}async function jt(e,t=!1){let n;const i=await Lt(e.appConfig,i=>{if(!$t(i))throw ft.create("not-registered");const r=i.authToken;if(!t&&function(e){return 2===e.requestStatus&&!function(e){const t=Date.now();
1return t<e.creationTime||e.creationTime+e.expiresIn<t+dt}(e)}(r))return i;if(1===r.requestStatus)return n=async function(e,t){let n=await Bt(e.appConfig);for(;1===n.authToken.requestStatus;)await bt(100),n=await Bt(e.appConfig);const i=n.authToken;return 0===i.requestStatus?jt(e,t):i}(e,t),i;{if(!navigator.onLine)throw ft.create("app-offline");const t=function(e){const t={requestStatus:1,requestTime:Date.now()};return{...e,authToken:t}}(i);return n=async function(e,t){try{const n=await Ft(e,t),i={...t,authToken:n};return await Pt(e.appConfig,i),n}catch(n){if(!pt(n)||401!==n.customData.serverCode&&404!==n.customData.serverCode){const n={...t,authToken:{requestStatus:0}};await Pt(e.appConfig,n)}else await Ot(e.appConfig);throw n}}(e,t),t}});return n?await n:i.authToken}function Bt(e){return Lt(e,e=>{if(!$t(e))throw ft.create("not-registered");const t=e.authToken;return 1===(n=t).requestStatus&&n.requestTime+ht<Date.now()?{...e,authToken:{requestStatus:0}}:e;var n})}function $t(e){return void 0!==e&&2===e.registrationStatus}async function zt(e,t=!1){const n=e;await async function(e){const{registrationPromise:t}=await xt(e);t&&await t}(n);return(await jt(n,t)).token}function qt(e){return ft.create("missing-app-config-values",{valueName:e})}const Ht="installations",Gt=e=>{const t=ze(e.getProvider("app").getImmediate(),Ht).getImmediate();return{getId:()=>async function(e){const t=e,{installationEntry:n,registrationPromise:i}=await xt(t);return i?i.catch(console.error):jt(t).catch(console.error),n.fid}(t),getToken:e=>zt(t,e)}};$e(new P(Ht,e=>{const t=e.getProvider("app").getImmediate(),n=function(e){if(!e||!e.options)throw qt("App Configuration");if(!e.name)throw qt("App Name");const t=["projectId","apiKey","appId"];for(const n of t)if(!e.options[n])throw qt(n);return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}(t);return{app:t,appConfig:n,heartbeatServiceProvider:ze(t,"heartbeat"),_delete:()=>Promise.resolve()}},"PUBLIC")),$e(new P("installations-internal",Gt,"PRIVATE")),Je(at,ct),Je(at,ct,"esm2020");const Kt="analytics",Wt="https://www.googletagmanager.com/gtag/js",Qt=new $("@firebase/analytics"),Jt=new T("analytics","Analytics",{"already-exists":"A Firebase Analytics instance with the appId {$id}  already exists. Only one Firebase Analytics instance can be created for each appId.","already-initialized":"initializeAnalytics() cannot be called again with different options than those it was initially called with. It can be called again with the same options to return the existing instance, or getAnalytics() can be used to get a reference to the already-initialized instance.","already-initialized-settings":"Firebase Analytics has already been initialized.settings() must be called before initializing any Analytics instanceor it will have no effect.","interop-component-reg-failed":"Firebase Analytics Interop Component failed to instantiate: {$reason}","invalid-analytics-context":"Firebase Analytics is not supported in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}","indexeddb-unavailable":"IndexedDB unavailable or restricted in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}","fetch-throttle":"The config fetch request timed out while in an exponential backoff state. Unix timestamp in milliseconds when fetch request throttling ends: {$throttleEndTimeMillis}.","config-fetch-failed":"Dynamic config fetch failed: [{$httpStatus}] {$responseMessage}","no-api-key":'The "apiKey" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid API key.',"no-app-id":'The "appId" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid app ID.',"no-client-id":'The "client_id" field is empty.',"invalid-gtag-resource":"Trusted Types detected an invalid gtag resource: {$gtagURL}."});function Xt(e){if(!e.startsWith(Wt)){const t=Jt.create("invalid-gtag-resource",{gtagURL:e});return Qt.warn(t.message),""}return e}function Yt(e){return Promise.all(e.map(e=>e.catch(e=>e)))}function Zt(e,t){const n=function(e,t){let n;return window.trustedTypes&&(n=window.trustedTypes.createPolicy(e,t)),n}("firebase-js-sdk-policy",{createScriptURL:Xt}),i=document.createElement("script"),r=`${Wt}?l=${e}
1&id=${t}`;i.src=n?n?.createScriptURL(r):r,i.async=!0,document.head.appendChild(i)}function en(e,t,n,i){return async function(r,...s){try{if("event"===r){const[i,r]=s;await async function(e,t,n,i,r){try{let s=[];if(r&&r.send_to){let e=r.send_to;Array.isArray(e)||(e=[e]);const i=await Yt(n);for(const n of e){const e=i.find(e=>e.measurementId===n),r=e&&t[e.appId];if(!r){s=[];break}s.push(r)}}0===s.length&&(s=Object.values(t)),await Promise.all(s),e("event",i,r||{})}catch(s){Qt.error(s)}}(e,t,n,i,r)}else if("config"===r){const[r,o]=s;await async function(e,t,n,i,r,s){const o=i[r];try{if(o)await t[o];else{const e=(await Yt(n)).find(e=>e.measurementId===r);e&&await t[e.appId]}}catch(a){Qt.error(a)}e("config",r,s)}(e,t,n,i,r,o)}else if("consent"===r){const[t,n]=s;e("consent",t,n)}else if("get"===r){const[t,n,i]=s;e("get",t,n,i)}else if("set"===r){const[t]=s;e("set",t)}else e(r,...s)}catch(o){Qt.error(o)}}}const tn=new class{constructor(e={},t=1e3){this.throttleMetadata=e,this.intervalMillis=t}getThrottleMetadata(e){return this.throttleMetadata[e]}setThrottleMetadata(e,t){this.throttleMetadata[e]=t}deleteThrottleMetadata(e){delete this.throttleMetadata[e]}};function nn(e){return new Headers({Accept:"application/json","x-goog-api-key":e})}async function rn(e,t=tn,n){const{appId:i,apiKey:r,measurementId:s}=e.options;if(!i)throw Jt.create("no-app-id");if(!r){if(s)return{measurementId:s,appId:i};throw Jt.create("no-api-key")}const o=t.getThrottleMetadata(i)||{backoffCount:0,throttleEndTimeMillis:Date.now()},a=new on;return setTimeout(async()=>{a.abort()},6e4),sn({appId:i,apiKey:r,measurementId:s},o,a,t)}async function sn(e,{throttleEndTimeMillis:t,backoffCount:n},i,r=tn){const{appId:s,measurementId:o}=e;try{await function(e,t){return new Promise((n,i)=>{const r=Math.max(t-Date.now(),0),s=setTimeout(n,r);e.addEventListener(()=>{clearTimeout(s),i(Jt.create("fetch-throttle",{throttleEndTimeMillis:t}))})})}(i,t)}catch(a){if(o)return Qt.warn(`Timed out fetching this Firebase app's measurement ID from the server. Falling back to the measurement ID ${o} provided in the "measurementId" field in the local Firebase config. [${a?.message}]`),{appId:s,measurementId:o};throw a}try{const t=await async function(e){const{appId:t,apiKey:n}=e,i={method:"GET",headers:nn(n)},r="https://firebase.googleapis.com/v1alpha/projects/-/apps/{app-id}/webConfig".replace("{app-id}",t),s=await fetch(r,i);if(200!==s.status&&304!==s.status){let e="";try{const t=await s.json();t.error?.message&&(e=t.error.message)}catch(o){}throw Jt.create("config-fetch-failed",{httpStatus:s.status,responseMessage:e})}return s.json()}(e);return r.deleteThrottleMetadata(s),t}catch(a){const t=a;if(!function(e){if(!(e instanceof I&&e.customData))return!1;const t=Number(e.customData.httpStatus);return 429===t||500===t||503===t||504===t}(t)){if(r.deleteThrottleMetadata(s),o)return Qt.warn(`Failed to fetch this Firebase app's measurement ID from the server. Falling back to the measurement ID ${o} provided in the "measurementId" field in the local Firebase config. [${t?.message}]`),{appId:s,measurementId:o};throw a}const c=503===Number(t?.customData?.httpStatus)?D(n,r.intervalMillis,30):D(n,r.intervalMillis),h={throttleEndTimeMillis:Date.now()+c,backoffCount:n+1};return r.setThrottleMetadata(s,h),Qt.debug(`Calling attemptFetch again in ${c} millis`),sn(e,h,i,r)}}class on{constructor(){this.listeners=[]}addEventListener(e){this.listeners.push(e)}abort(){this.listeners.forEach(e=>e())}}async function an(e,t,n,i,r,s,o){const a=rn(e);a.then(t=>{n[t.measurementId]=t.appId,e.options.measurementId&&t.measurementId!==e.options.measurementId&&Qt.warn(`The measurement ID in the local Firebase config (${e.options.measurementId}) does not match the measurement ID fetched from the server (${t.measurementId}). To ensure analytics events are always sent to the correct Analytics property, update the measurement ID field in the local config or remove it from the local config.`)}).catch(e=>Qt.error(e)),t.push(a);const c=async function(){if(!_())return Qt.warn(Jt.create("indexeddb-unavailable",{errorInfo:"IndexedDB is not available in this environment."}).message),!1;try{await b()}catch(e){return Qt.warn(Jt.create("indexeddb-unavailable",{errorInfo:e?.toString()}).message),!1}return!0}().then(e=>e?i.getId():void 0),[h,l]=await Promise.all([a,c]);(function(e){const t=window.document.getElementsByTagName("script");for(const n of Object.values(t))if(n.src&&n.src.includes(Wt)&&n.src.includes(e))return n;return null})(s)||Zt(s,h.measurementId),r("js",new Date);const u=o?.config??{};return u.origin="firebase",u.update=!0,null!=l&&(u.firebase_id=l),r("config",h.measurementId,u),h.measurementId}class cn{constructor(e){this.app=e}_delete(){return delete hn[this.app.options.appId],Promise.resolve()}}let hn={},ln=[];const un={};let dn,fn,pn="dataLayer",gn=!1;function mn(){const e=[];
1if(v()&&e.push("This is a browser extension environment."),"undefined"!=typeof navigator&&navigator.cookieEnabled||e.push("Cookies are not available."),e.length>0){const t=e.map((e,t)=>`(${t+1}) ${e}`).join(" "),n=Jt.create("invalid-analytics-context",{errorInfo:t});Qt.warn(n.message)}}function yn(e,t,n){mn();const i=e.options.appId;if(!i)throw Jt.create("no-app-id");if(!e.options.apiKey){if(!e.options.measurementId)throw Jt.create("no-api-key");Qt.warn(`The "apiKey" field is empty in the local Firebase config. This is needed to fetch the latest measurement ID for this Firebase app. Falling back to the measurement ID ${e.options.measurementId} provided in the "measurementId" field in the local Firebase config.`)}if(null!=hn[i])throw Jt.create("already-exists",{id:i});if(!gn){!function(e){let t=[];Array.isArray(window[e])?t=window[e]:window[e]=t}(pn);const{wrappedGtag:e,gtagCore:t}=function(e,t,n,i,r){let s=function(...e){window[i].push(arguments)};return window[r]&&"function"==typeof window[r]&&(s=window[r]),window[r]=en(s,e,t,n),{gtagCore:s,wrappedGtag:window[r]}}(hn,ln,un,pn,"gtag");fn=e,dn=t,gn=!0}hn[i]=an(e,ln,un,t,dn,pn,n);return new cn(e)}function vn(e=Qe()){const t=ze(e=R(e),Kt);return t.isInitialized()?t.getImmediate():function(e,t={}){const n=ze(e,Kt);if(n.isInitialized()){const e=n.getImmediate();if(S(t,n.getOptions()))return e;throw Jt.create("already-initialized")}const i=n.initialize({options:t});return i}(e)}function wn(e,t,n){e=R(e),async function(e,t,n,i){if(i&&i.global){const t={};for(const e of Object.keys(n))t[`user_properties.${e}`]=n[e];return e("set",t),Promise.resolve()}e("config",await t,{update:!0,user_properties:n})}(fn,hn[e.app.options.appId],t,n).catch(e=>Qt.error(e))}function _n(e,t,n,i){e=R(e),async function(e,t,n,i,r){if(r&&r.global)e("event",n,i);else{const r=await t;e("event",n,{...i,send_to:r})}}(fn,hn[e.app.options.appId],t,n,i).catch(e=>Qt.error(e))}const bn="@firebase/analytics",In="0.10.19";$e(new P(Kt,(e,{options:t})=>yn(e.getProvider("app").getImmediate(),e.getProvider("installations-internal").getImmediate(),t),"PUBLIC")),$e(new P("analytics-internal",function(e){try{const t=e.getProvider(Kt).getImmediate();return{logEvent:(e,n,i)=>_n(t,e,n,i),setUserProperties:(e,n)=>wn(t,e,n)}}catch(t){throw Jt.create("interop-component-reg-failed",{reason:t})}},"PRIVATE")),Je(bn,In),Je(bn,In,"esm2020");var Tn,En="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};(function(){var e;function t(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.C=Array(this.blockSize),this.o=this.h=0,this.u()}function n(e,t,n){n||(n=0);const i=Array(16);if("string"==typeof t)for(var r=0;r<16;++r)i[r]=t.charCodeAt(n++)|t.charCodeAt(n++)<<8|t.charCodeAt(n++)<<16|t.charCodeAt(n++)<<24;else for(r=0;r<16;++r)i[r]=t[n++]|t[n++]<<8|t[n++]<<16|t[n++]<<24;t=e.g[0],n=e.g[1],r=e.g[2];let s,o=e.g[3];s=t+(o^n&(r^o))+i[0]+3614090360&4294967295,s=o+(r^(t=n+(s<<7&4294967295|s>>>25))&(n^r))+i[1]+3905402710&4294967295,o=t+(s<<12&4294967295|s>>>20),s=r+(n^o&(t^n))+i[2]+606105819&4294967295,s=n+(t^(r=o+(s<<17&4294967295|s>>>15))&(o^t))+i[3]+3250441966&4294967295,s=t+(o^(n=r+(s<<22&4294967295|s>>>10))&(r^o))+i[4]+4118548399&4294967295,s=o+(r^(t=n+(s<<7&4294967295|s>>>25))&(n^r))+i[5]+1200080426&4294967295,o=t+(s<<12&4294967295|s>>>20),s=r+(n^o&(t^n))+i[6]+2821735955&4294967295,s=n+(t^(r=o+(s<<17&4294967295|s>>>15))&(o^t))+i[7]+4249261313&4294967295,s=t+(o^(n=r+(s<<22&4294967295|s>>>10))&(r^o))+i[8]+1770035416&4294967295,s=o+(r^(t=n+(s<<7&4294967295|s>>>25))&(n^r))+i[9]+2336552879&4294967295,o=t+(s<<12&4294967295|s>>>20),s=r+(n^o&(t^n))+i[10]+4294925233&4294967295,s=n+(t^(r=o+(s<<17&4294967295|s>>>15))&(o^t))+i[11]+2304563134&4294967295,s=t+(o^(n=r+(s<<22&4294967295|s>>>10))&(r^o))+i[12]+1804603682&4294967295,s=o+(r^(t=n+(s<<7&4294967295|s>>>25))&(n^r))+i[13]+4254626195&4294967295,o=t+(s<<12&4294967295|s>>>20),s=r+(n^o&(t^n))+i[14]+2792965006&4294967295,s=n+(t^(r=o+(s<<17&4294967295|s>>>15))&(o^t))+i[15]+1236535329&4294967295,s=t+(r^o&((n=r+(s<<22&4294967295|s>>>10))^r))+i[1]+4129170786&4294967295,s=o+(n^r&((t=n+(s<<5&4294967295|s>>>27))^n))+i[6]+3225465664&4294967295,o=t+(s<<9&4294967295|s>>>23),s=r+(t^n&(o^t))+i[11]+643717713&4294967295,s=n+(o^t&((r=o+(s<<14&4294967295|s>>>18))^o))+i[0]+3921069994&4294967295,s=t+(r^o&((n=r+(s<<20&4294967295|s>>>
112))^r))+i[5]+3593408605&4294967295,s=o+(n^r&((t=n+(s<<5&4294967295|s>>>27))^n))+i[10]+38016083&4294967295,o=t+(s<<9&4294967295|s>>>23),s=r+(t^n&(o^t))+i[15]+3634488961&4294967295,s=n+(o^t&((r=o+(s<<14&4294967295|s>>>18))^o))+i[4]+3889429448&4294967295,s=t+(r^o&((n=r+(s<<20&4294967295|s>>>12))^r))+i[9]+568446438&4294967295,s=o+(n^r&((t=n+(s<<5&4294967295|s>>>27))^n))+i[14]+3275163606&4294967295,o=t+(s<<9&4294967295|s>>>23),s=r+(t^n&(o^t))+i[3]+4107603335&4294967295,s=n+(o^t&((r=o+(s<<14&4294967295|s>>>18))^o))+i[8]+1163531501&4294967295,s=t+(r^o&((n=r+(s<<20&4294967295|s>>>12))^r))+i[13]+2850285829&4294967295,s=o+(n^r&((t=n+(s<<5&4294967295|s>>>27))^n))+i[2]+4243563512&4294967295,o=t+(s<<9&4294967295|s>>>23),s=r+(t^n&(o^t))+i[7]+1735328473&4294967295,s=n+(o^t&((r=o+(s<<14&4294967295|s>>>18))^o))+i[12]+2368359562&4294967295,s=t+((n=r+(s<<20&4294967295|s>>>12))^r^o)+i[5]+4294588738&4294967295,s=o+((t=n+(s<<4&4294967295|s>>>28))^n^r)+i[8]+2272392833&4294967295,o=t+(s<<11&4294967295|s>>>21),s=r+(o^t^n)+i[11]+1839030562&4294967295,s=n+((r=o+(s<<16&4294967295|s>>>16))^o^t)+i[14]+4259657740&4294967295,s=t+((n=r+(s<<23&4294967295|s>>>9))^r^o)+i[1]+2763975236&4294967295,s=o+((t=n+(s<<4&4294967295|s>>>28))^n^r)+i[4]+1272893353&4294967295,o=t+(s<<11&4294967295|s>>>21),s=r+(o^t^n)+i[7]+4139469664&4294967295,s=n+((r=o+(s<<16&4294967295|s>>>16))^o^t)+i[10]+3200236656&4294967295,s=t+((n=r+(s<<23&4294967295|s>>>9))^r^o)+i[13]+681279174&4294967295,s=o+((t=n+(s<<4&4294967295|s>>>28))^n^r)+i[0]+3936430074&4294967295,o=t+(s<<11&4294967295|s>>>21),s=r+(o^t^n)+i[3]+3572445317&4294967295,s=n+((r=o+(s<<16&4294967295|s>>>16))^o^t)+i[6]+76029189&4294967295,s=t+((n=r+(s<<23&4294967295|s>>>9))^r^o)+i[9]+3654602809&4294967295,s=o+((t=n+(s<<4&4294967295|s>>>28))^n^r)+i[12]+3873151461&4294967295,o=t+(s<<11&4294967295|s>>>21),s=r+(o^t^n)+i[15]+530742520&4294967295,s=n+((r=o+(s<<16&4294967295|s>>>16))^o^t)+i[2]+3299628645&4294967295,s=t+(r^((n=r+(s<<23&4294967295|s>>>9))|~o))+i[0]+4096336452&4294967295,s=o+(n^((t=n+(s<<6&4294967295|s>>>26))|~r))+i[7]+1126891415&4294967295,o=t+(s<<10&4294967295|s>>>22),s=r+(t^(o|~n))+i[14]+2878612391&4294967295,s=n+(o^((r=o+(s<<15&4294967295|s>>>17))|~t))+i[5]+4237533241&4294967295,s=t+(r^((n=r+(s<<21&4294967295|s>>>11))|~o))+i[12]+1700485571&4294967295,s=o+(n^((t=n+(s<<6&4294967295|s>>>26))|~r))+i[3]+2399980690&4294967295,o=t+(s<<10&4294967295|s>>>22),s=r+(t^(o|~n))+i[10]+4293915773&4294967295,s=n+(o^((r=o+(s<<15&4294967295|s>>>17))|~t))+i[1]+2240044497&4294967295,s=t+(r^((n=r+(s<<21&4294967295|s>>>11))|~o))+i[8]+1873313359&4294967295,s=o+(n^((t=n+(s<<6&4294967295|s>>>26))|~r))+i[15]+4264355552&4294967295,o=t+(s<<10&4294967295|s>>>22),s=r+(t^(o|~n))+i[6]+2734768916&4294967295,s=n+(o^((r=o+(s<<15&4294967295|s>>>17))|~t))+i[13]+1309151649&4294967295,s=t+(r^((n=r+(s<<21&4294967295|s>>>11))|~o))+i[4]+4149444226&4294967295,s=o+(n^((t=n+(s<<6&4294967295|s>>>26))|~r))+i[11]+3174756917&4294967295,o=t+(s<<10&4294967295|s>>>22),s=r+(t^(o|~n))+i[2]+718787259&4294967295,s=n+(o^((r=o+(s<<15&4294967295|s>>>17))|~t))+i[9]+3951481745&4294967295,e.g[0]=e.g[0]+t&4294967295,e.g[1]=e.g[1]+(r+(s<<21&4294967295|s>>>11))&4294967295,e.g[2]=e.g[2]+r&4294967295,e.g[3]=e.g[3]+o&4294967295}function i(e,t){this.h=t;const n=[];let i=!0;for(let r=e.length-1;r>=0;r--){const s=0|e[r];i&&s==t||(n[r]=s,i=!1)}this.g=n}!function(e,t){function n(){}n.prototype=t.prototype,e.F=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.D=function(e,n,i){for(var r=Array(arguments.length-2),s=2;s<arguments.length;s++)r[s-2]=arguments[s];return t.prototype[n].apply(e,r)}}(t,function(){this.blockSize=-1}),t.prototype.u=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.o=this.h=0},t.prototype.v=function(e,t){void 0===t&&(t=e.length);const i=t-this.blockSize,r=this.C;let s=this.h,o=0;for(;o<t;){if(0==s)for(;o<=i;)n(this,e,o),o+=this.blockSize;if("string"==typeof e){for(;o<t;)if(r[s++]=e.charCodeAt(o++),s==this.blockSize){n(this,r),s=0;break}}else for(;o<t;)if(r[s++]=e[o++],s==this.blockSize){n(this,r),s=0;break}}this.h=s,this.o+=t},t.prototype.A=function(){var e=Array((this.h<56?this.blockSize:2*this.blockSize)-this.h);e[0]=128;for(var t=1;t<e.length-8;++t)e[t]=0;t=8*this.o;for(var n=e.length-8;n<e.length;++n)e[n]=255&t,t/=256;for(this.v(e),e=Array(16),t=0,n=0;n<4;++n)for(let i=0;i<32;i+=8)e[t++]=this.g[n]>>>i&255;return e};var r={};function s(e){return-128<=e&&e<128?function(e,t){var n=r;return Object.prototype.hasOwnProperty.call(n,e)?n[e]:n[e]=t(e)}(e,function(e){return new i([0|e],e<0?-1:0)}):new i([0|e],e<0?-1:0)}function o(e){if(isNaN(e)||!isFinite(e))return a;
vendor: 9,601 bytes, line 1
1if(e<0)return d(o(-e));const t=[];let n=1;for(let i=0;e>=n;i++)t[i]=e/n|0,n*=4294967296;return new i(t,0)}var a=s(0),c=s(1),h=s(16777216);function l(e){if(0!=e.h)return!1;for(let t=0;t<e.g.length;t++)if(0!=e.g[t])return!1;return!0}function u(e){return-1==e.h}function d(e){const t=e.g.length,n=[];for(let i=0;i<t;i++)n[i]=~e.g[i];return new i(n,~e.h).add(c)}function f(e,t){return e.add(d(t))}function p(e,t){for(;(65535&e[t])!=e[t];)e[t+1]+=e[t]>>>16,e[t]&=65535,t++}function g(e,t){this.g=e,this.h=t}function m(e,t){if(l(t))throw Error("division by zero");if(l(e))return new g(a,a);if(u(e))return t=m(d(e),t),new g(d(t.g),d(t.h));if(u(t))return t=m(e,d(t)),new g(d(t.g),t.h);if(e.g.length>30){if(u(e)||u(t))throw Error("slowDivide_ only works with positive integers.");for(var n=c,i=t;i.l(e)<=0;)n=y(n),i=y(i);var r=v(n,1),s=v(i,1);for(i=v(i,2),n=v(n,2);!l(i);){var h=s.add(i);h.l(e)<=0&&(r=r.add(n),s=h),i=v(i,1),n=v(n,1)}return t=f(e,r.j(t)),new g(r,t)}for(r=a;e.l(t)>=0;){for(n=Math.max(1,Math.floor(e.m()/t.m())),i=(i=Math.ceil(Math.log(n)/Math.LN2))<=48?1:Math.pow(2,i-48),h=(s=o(n)).j(t);u(h)||h.l(e)>0;)h=(s=o(n-=i)).j(t);l(s)&&(s=c),r=r.add(s),e=f(e,h)}return new g(r,e)}function y(e){const t=e.g.length+1,n=[];for(let i=0;i<t;i++)n[i]=e.i(i)<<1|e.i(i-1)>>>31;return new i(n,e.h)}function v(e,t){const n=t>>5;t%=32;const r=e.g.length-n,s=[];for(let i=0;i<r;i++)s[i]=t>0?e.i(i+n)>>>t|e.i(i+n+1)<<32-t:e.i(i+n);return new i(s,e.h)}(e=i.prototype).m=function(){if(u(this))return-d(this).m();let e=0,t=1;for(let n=0;n<this.g.length;n++){const i=this.i(n);e+=(i>=0?i:4294967296+i)*t,t*=4294967296}return e},e.toString=function(e){if((e=e||10)<2||36<e)throw Error("radix out of range: "+e);if(l(this))return"0";if(u(this))return"-"+d(this).toString(e);const t=o(Math.pow(e,6));var n=this;let i="";for(;;){const r=m(n,t).g;let s=(((n=f(n,r.j(t))).g.length>0?n.g[0]:n.h)>>>0).toString(e);if(l(n=r))return s+i;for(;s.length<6;)s="0"+s;i=s+i}},e.i=function(e){return e<0?0:e<this.g.length?this.g[e]:this.h},e.l=function(e){return u(e=f(this,e))?-1:l(e)?0:1},e.abs=function(){return u(this)?d(this):this},e.add=function(e){const t=Math.max(this.g.length,e.g.length),n=[];let r=0;for(let i=0;i<=t;i++){let t=r+(65535&this.i(i))+(65535&e.i(i)),s=(t>>>16)+(this.i(i)>>>16)+(e.i(i)>>>16);r=s>>>16,t&=65535,s&=65535,n[i]=s<<16|t}return new i(n,-2147483648&n[n.length-1]?-1:0)},e.j=function(e){if(l(this)||l(e))return a;if(u(this))return u(e)?d(this).j(d(e)):d(d(this).j(e));if(u(e))return d(this.j(d(e)));if(this.l(h)<0&&e.l(h)<0)return o(this.m()*e.m());const t=this.g.length+e.g.length,n=[];for(var r=0;r<2*t;r++)n[r]=0;for(r=0;r<this.g.length;r++)for(let t=0;t<e.g.length;t++){const i=this.i(r)>>>16,s=65535&this.i(r),o=e.i(t)>>>16,a=65535&e.i(t);n[2*r+2*t]+=s*a,p(n,2*r+2*t),n[2*r+2*t+1]+=i*a,p(n,2*r+2*t+1),n[2*r+2*t+1]+=s*o,p(n,2*r+2*t+1),n[2*r+2*t+2]+=i*o,p(n,2*r+2*t+2)}for(e=0;e<t;e++)n[e]=n[2*e+1]<<16|n[2*e];for(e=t;e<2*t;e++)n[e]=0;return new i(n,0)},e.B=function(e){return m(this,e).h},e.and=function(e){const t=Math.max(this.g.length,e.g.length),n=[];for(let i=0;i<t;i++)n[i]=this.i(i)&e.i(i);return new i(n,this.h&e.h)},e.or=function(e){const t=Math.max(this.g.length,e.g.length),n=[];for(let i=0;i<t;i++)n[i]=this.i(i)|e.i(i);return new i(n,this.h|e.h)},e.xor=function(e){const t=Math.max(this.g.length,e.g.length),n=[];for(let i=0;i<t;i++)n[i]=this.i(i)^e.i(i);return new i(n,this.h^e.h)},t.prototype.digest=t.prototype.A,t.prototype.reset=t.prototype.u,t.prototype.update=t.prototype.v,i.prototype.add=i.prototype.add,i.prototype.multiply=i.prototype.j,i.prototype.modulo=i.prototype.B,i.prototype.compare=i.prototype.l,i.prototype.toNumber=i.prototype.m,i.prototype.toString=i.prototype.toString,i.prototype.getBits=i.prototype.i,i.fromNumber=o,i.fromString=function e(t,n){if(0==t.length)throw Error("number format error: empty string");if((n=n||10)<2||36<n)throw Error("radix out of range: "+n);if("-"==t.charAt(0))return d(e(t.substring(1),n));if(t.indexOf("-")>=0)throw Error('number format error: interior "-" character');const i=o(Math.pow(n,8));let r=a;for(let a=0;a<t.length;a+=8){var s=Math.min(8,t.length-a);const e=parseInt(t.substring(a,a+s),n);s<8?(s=o(Math.pow(n,s)),r=r.j(s).add(o(e))):(r=r.j(i),r=r.add(o(e)))}return r},Tn=i}).apply(void 0!==En?En:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var Sn,Cn,An,kn,Nn,Dn,Rn,Pn,On="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};(function(){var e,t=Object.defineProperty;var n=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof On&&On];for(var t=0;t<e.length;++t){var n=e[t];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function i(e,i){if(i)e:{var r=n;e=e.split(".");for(var s=0;s<e.length-1;s++){var o=e[s];if(!(o in r))break e;r=r[o]}(i=i(s=r[e=e[e.length-1]]))!=s&&null!=i&&t(r,e,{configurable:!0,writable:!0,value:i})}}i("Symbol.dispose",function(e){return e||Symbol("Symbol.dispose")}),i("Array.prototype.values",function(e){return e||function(){return this[Symbol.iterator]()}}),i("Object.entries",function(e){return e||function(e){var t,n=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.push([t,e[t]]);return n}});var r=r||{},s=this||self;function o(e){var t=typeof e;return"object"==t&&null!=e||"function"==t}function a(e,t,n){return e.call.apply(e.bind,arguments)}function c(e,t,n){return(c=a).apply(null,arguments)}function h(e,t){var n=Array.prototype.slice.call(arguments,1);return function(){var t=n.slice();return t.push.apply(t,arguments),e.apply(this,t)}}function l(e,t){function n(){}n.prototype=t.prototype,e.Z=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.Ob=function(e,n,i){for(var r=Array(arguments.length-2),s=2;s<arguments.length;s++)r[s-2]=arguments[s];return t.prototype[n].apply(e,r)}}var u="undefined"!=typeof AsyncContext&&"function"==typeof AsyncContext.Snapshot?e=>e&&AsyncContext.Snapshot.wrap(e):e=>e;function d(e){const t=e.length;if(t>0){const n=Array(t);for(let i=0;i<t;i++)n[i]=e[i];return n}return[]}function f(e,t){for(let i=1;i<arguments.length;i++){const t=arguments[i];var n=typeof t;if("array"==(n="object"!=n?n:t?Array.isArray(t)?"array":n:"null")||"object"==n&&"number"==typeof t.length){n=e.length||0;const i=t.length||0;e.length=n+i;for(let r=0;r<i;r++)e[n+r]=t[r]}else e.push(t)}}function p(e){s.setTimeout(()=>{throw e},0)}function g(){var e=_;let t=null;return e.g&&(t=e.g,e.g=e.g.next,e.g||(e.h=null),t.next=null),t}var m=new class{constructor(e,t){this.i=e,this.j=t,this.h=0,this.g=null}get(){let e;return this.h>0?(this.h--,e=this.g,this.g=e.next,e.next=null):e=this.i(),e}}(()=>new y,e=>e.reset());class y{constructor(){this.next=this.g=this.h=null}set(e,t){this.h=e,this.g=t,this.next=null}reset(){this.next=this.g=this.h=null}}let v,w=!1,_=new class{constructor(){this.h=this.g=null}add(e,t){const n=m.get();n.set(e,t),this.h?this.h.next=n:this.g=n,this.h=n}},b=()=>{const e=Promise.resolve(void 0);v=()=>{e.then(I)}};function I(){for(var e;e=g();){try{e.h.call(e.g)}catch(n){p(n)}var t=m;t.j(e),t.h<100&&(t.h++,e.next=t.g,t.g=e)}w=!1}function T(){this.u=this.u,this.C=this.C}function E(e,t){this.type=e,this.g=this.target=t,this.defaultPrevented=!1}T.prototype.u=!1,T.prototype.dispose=function(){this.u||(this.u=!0,this.N())},T.prototype[Symbol.dispose]=function(){this.dispose()},T.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()},E.prototype.h=function(){this.defaultPrevented=!0};var S=function(){if(!s.addEventListener||!Object.defineProperty)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});try{const e=()=>{};s.addEventListener("test",e,t),s.removeEventListener("test",e,t)}catch(n){}return e}();function C(e){return/^[\s\xa0]*$/.test(e)}function A(e,t){E.call(this,e?e.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,e&&this.init(e,t)}l(A,E),A.prototype.init=function(e,t){const n=this.type=e.type,i=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:null;this.target=e.target||e.srcElement,this.g=t,(t=e.relatedTarget)||("mouseover"==n?t=e.fromElement:"mouseout"==n&&(t=e.toElement)),this.relatedTarget=t,i?(this.clientX=void 0!==i.clientX?i.clientX:i.pageX,this.clientY=void 0!==i.clientY?i.clientY:i.pageY,this.screenX=i.screenX||0,this.screenY=i.screenY||0):(this.clientX=void 0!==e.clientX?e.clientX:e.pageX,this.clientY=void 0!==e.clientY?e.clientY:e.pageY,this.screenX=e.screenX||0,this.screenY=e.screenY||0),this.button=e.button,this.key=e.key||"",this.ctrlKey=e.ctrlKey,this.altKey=e.altKey,this.shiftKey=e.shiftKey,this.metaKey=e.metaKey,this.pointerId=e.pointerId||0,this.pointerType=e.pointerType,this.state=e.state,this.i=e,e.defaultPrevented&&A.Z.h.call(this)},A.prototype.h=function(){A.Z.h.call(this);const e=this.i;e.preventDefault?e.preventDefault():e.returnValue=!1};var k="closure_listenable_"+(1e6*Math.random()|0),N=0;function D(e,t,n,i,r){this.listener=e,this.proxy=null,this.src=t,this.type=n,this.capture=!!i,this.ha=r,this.key=++N,this.da=this.fa=!1}function R(e){e.da=!0,e.listener=null,e.proxy=null,e.src=null,e.ha=null}function P(e,t,n){for(const i in e)t.call(n,e[i],i,e)}function O(e){const t={};for(const n in e)t[n]=e[n];return t}const L="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleStr
1ing toString valueOf".split(" ");function x(e,t){let n,i;for(let r=1;r<arguments.length;r++){for(n in i=arguments[r],i)e[n]=i[n];for(let t=0;t<L.length;t++)n=L[t],Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}}function M(e){this.src=e,this.g={},this.h=0}function U(e,t){const n=t.type;if(n in e.g){var i,r=e.g[n],s=Array.prototype.indexOf.call(r,t,void 0);(i=s>=0)&&Array.prototype.splice.call(r,s,1),i&&(R(t),0==e.g[n].length&&(delete e.g[n],e.h--))}}function V(e,t,n,i){for(let r=0;r<e.length;++r){const s=e[r];if(!s.da&&s.listener==t&&s.capture==!!n&&s.ha==i)return r}return-1}M.prototype.add=function(e,t,n,i,r){const s=e.toString();(e=this.g[s])||(e=this.g[s]=[],this.h++);const o=V(e,t,i,r);return o>-1?(t=e[o],n||(t.fa=!1)):((t=new D(t,this.src,s,!!i,r)).fa=n,e.push(t)),t};var F="closure_lm_"+(1e6*Math.random()|0),j={};function B(e,t,n,i,r){if(Array.isArray(t)){for(let s=0;s<t.length;s++)B(e,t[s],n,i,r);return null}return n=W(n),e&&e[k]?e.J(t,n,!!o(i)&&!!i.capture,r):function(e,t,n,i,r,s){if(!t)throw Error("Invalid event type");const a=o(r)?!!r.capture:!!r;let c=G(e);if(c||(e[F]=c=new M(e)),n=c.add(t,n,i,a,s),n.proxy)return n;if(i=function(){function e(n){return t.call(e.src,e.listener,n)}const t=H;return e}(),n.proxy=i,i.src=e,i.listener=n,e.addEventListener)S||(r=a),void 0===r&&(r=!1),e.addEventListener(t.toString(),i,r);else if(e.attachEvent)e.attachEvent(q(t.toString()),i);else{if(!e.addListener||!e.removeListener)throw Error("addEventListener and attachEvent are unavailable.");e.addListener(i)}return n}(e,t,n,!1,i,r)}function $(e,t,n,i,r){if(Array.isArray(t))for(var s=0;s<t.length;s++)$(e,t[s],n,i,r);else i=o(i)?!!i.capture:!!i,n=W(n),e&&e[k]?(e=e.i,(s=String(t).toString())in e.g&&((n=V(t=e.g[s],n,i,r))>-1&&(R(t[n]),Array.prototype.splice.call(t,n,1),0==t.length&&(delete e.g[s],e.h--)))):e&&(e=G(e))&&(t=e.g[t.toString()],e=-1,t&&(e=V(t,n,i,r)),(n=e>-1?t[e]:null)&&z(n))}function z(e){if("number"!=typeof e&&e&&!e.da){var t=e.src;if(t&&t[k])U(t.i,e);else{var n=e.type,i=e.proxy;t.removeEventListener?t.removeEventListener(n,i,e.capture):t.detachEvent?t.detachEvent(q(n),i):t.addListener&&t.removeListener&&t.removeListener(i),(n=G(t))?(U(n,e),0==n.h&&(n.src=null,t[F]=null)):R(e)}}}function q(e){return e in j?j[e]:j[e]="on"+e}function H(e,t){if(e.da)e=!0;else{t=new A(t,this);const n=e.listener,i=e.ha||e.src;e.fa&&z(e),e=n.call(i,t)}return e}function G(e){return(e=e[F])instanceof M?e:null}var K="__closure_events_fn_"+(1e9*Math.random()>>>0);function W(e){return"function"==typeof e?e:(e[K]||(e[K]=function(t){return e.handleEvent(t)}),e[K])}function Q(){T.call(this),this.i=new M(this),this.M=this,this.G=null}function J(e,t){var n,i=e.G;if(i)for(n=[];i;i=i.G)n.push(i);if(e=e.M,i=t.type||t,"string"==typeof t)t=new E(t,e);else if(t instanceof E)t.target=t.target||e;else{var r=t;x(t=new E(i,e),r)}let s,o;if(r=!0,n)for(o=n.length-1;o>=0;o--)s=t.g=n[o],r=X(s,i,!0,t)&&r;if(s=t.g=e,r=X(s,i,!0,t)&&r,r=X(s,i,!1,t)&&r,n)for(o=0;o<n.length;o++)s=t.g=n[o],r=X(s,i,!1,t)&&r}function X(e,t,n,i){if(!(t=e.i.g[String(t)]))return!0;t=t.concat();let r=!0;for(let s=0;s<t.length;++s){const o=t[s];if(o&&!o.da&&o.capture==n){const t=o.listener,n=o.ha||o.src;o.fa&&U(e.i,o),r=!1!==t.call(n,i)&&r}}return r&&!i.defaultPrevented}function Y(e){e.g=function(e,t){if("function"!=typeof e){if(!e||"function"!=typeof e.handleEvent)throw Error("Invalid listener argument");e=c(e.handleEvent,e)}return Number(t)>2147483647?-1:s.setTimeout(e,t||0)}(()=>{e.g=null,e.i&&(e.i=!1,Y(e))},e.l);const t=e.h;e.h=null,e.m.apply(null,t)}l(Q,T),Q.prototype[k]=!0,Q.prototype.removeEventListener=function(e,t,n,i){$(this,e,t,n,i)},Q.prototype.N=function(){if(Q.Z.N.call(this),this.i){var e=this.i;for(const t in e.g){const n=e.g[t];for(let e=0;e<n.length;e++)R(n[e]);delete e.g[t],e.h--}}this.G=null},Q.prototype.J=function(e,t,n,i){return this.i.add(String(e),t,!1,n,i)},Q.prototype.K=function(e,t,n,i){return this.i.add(String(e),t,!0,n,i)};class Z extends T{constructor(e,t){super(),this.m=e,this.l=t,this.h=null,this.i=!1,this.g=null}j(e){this.h=arguments,this.g?this.i=!0:Y(this)}N(){super.N(),this.g&&(s.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function ee(e){T.call(this),this.h=e,this.g={}}l(ee,T);var te=[];function ne(e){P(e.g,function(e,t){this.g.hasOwnProperty(t)&&z(e)},e),e.g={}}ee.prototype.N=function(){ee.Z.N.call(this),ne(this)},ee.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var ie=s.JSON.stringify,re=s.JSON.parse,se=class{stringify(e){return s.JSON.stringify(e,void 0)}parse(e){return s.JSON.parse(e,void 0)}};function oe(){}function ae(){}var ce={OPEN:"a",hb:"b",ERROR:"c",tb:"d"};function he(){E.call(this,"d")}function le(){E.call(this,"c")}l(he,E),l(le,E);var ue={},de=null;function fe(){return de=de||new Q}function pe(e){E.call(this,ue.Ia,e)}function ge(e){const t=fe();J(t,new pe(t))}function me(e,t){E.call(this,ue.STAT_EVENT,e),this.stat=t}function ye(e){const t=fe();J(t,new me(t,e))}function ve(e,t){E.call(this,ue.Ja,e),this.size=t}function we(e,t){if("function"!=typeof e)throw Error("Fn must not be null and must be a function");return s.setTimeout(function(){e()},t)}function _e(){this.g=!0}function be(e,t,n,i){e.info(function(){return"XMLHTTP TEXT ("+t+"): "+function(e,t){if(!e.g)return t;if(!t)return null;try{const s=JSON.parse(t);if(s)for(e=0;e<s.length;e++)if(Array.isArray(s[e])){var n=s[e];if(!(n.length<2)){var i=n[1];if(Array.isArray(i)&&!(i.length<1)){var r=i[0];if("noop"!=r&&"stop"!=r&&"close"!=r)for(let e=1;e<i.length;e++)i[e]=""}}}return ie(s)}catch(s){return t}}(e,n)+(i?" "+i:"")})}ue.Ia="serverreachability",l(pe,E),ue.STAT_EVENT="statevent",l(me,E),ue.Ja="timingevent",l(ve,E),_e.prototype.ua=function(){this.g=!1},_e.prototype.info=function(){};var Ie,Te={NO_ERROR:0,cb:1,qb:2,pb:3,kb:4,ob:5,rb:6,Ga:7,TIMEOUT:8,ub:9},Ee={ib:"complete",Fb:"success",ERROR:"error",Ga:"abort",xb:"ready",yb:"readystatechange",TIMEOUT:"timeout",sb:"incrementaldata",wb:"progress",lb:"downloadprogress",Nb:"uploadprogress"};function Se(){}function Ce(e){return encodeURIComponent(String(e))}function Ae(e){var t=1;e=e.split(":");const n=[];for(;t>0&&e.length;)n.push(e.shift()),t--;return e.length&&n.push(e.join(":")),n}function ke(e,t,n,i){this.j=e,this.i=t,this.l=n,this.S=i||1,this.V=new ee(this),this.H=45e3,this.J=null,this.o=!1,this.u=this.B=this.A=this.M=this.F=this.T=this.D=null,this.G=[],this.g=null,this.C=0,this.m=this.v=null,this.X=-1,this.K=!1,this.P=0,this.O=null,this.W=this.L=this.U=this.R=!1,this.h=new Ne}function Ne(){this.i=null,this.g="",this.h=!1}l(Se,oe),Se.prototype.g=function(){return new XMLHttpRequest},Ie=new Se;var De={},Re={};function Pe(e,t,n){e.M=1,e.A=it(Ye(t)),e.u=n,e.R=!0,Oe(e,null)}function Oe(e,t){e.F=Date.now(),Me(e),e.B=Ye(e.A);var n=e.B,i=e.S;Array.isArray(i)||(i=[String(i)]),yt(n.i,"t",i),e.C=0,n=e.j.L,e.h=new Ne,e.g=rn(e.j,n?t:null,!e.u),e.P>0&&(e.O=new Z(c(e.Y,e,e.g),e.P)),t=e.V,n=e.g,i=e.ba;var r="readystatechange";Array.isArray(r)||(r&&(te[0]=r.toString()),r=te);for(let s=0;s<r.length;s++){const e=B(n,r[s],i||t.handleEvent,!1,t.h||t);if(!e)break;t.g[e.key]=e}t=e.J?O(e.J):{},e.u?(e.v||(e.v="POST"),t["Content-Type"]="application/x-www-form-urlencoded",e.g.ea(e.B,e.v,e.u,t)):(e.v="GET",e.g.ea(e.B,e.v,null,t)),ge(),function(e,t,n,i,r,s){e.info(function(){if(e.g)if(s){var o="",a=s.split("&");for(let e=0;e<a.length;e++){var c=a[e].split("=");if(c.length>1){const e=c[0];c=c[1];const t=e.split("_");o=t.length>=2&&"type"==t[1]?o+(e+"=")+c+"&":o+(e+"=redacted&")}}}else o=null;else o=s;return"XMLHTTP REQ ("+i+") [attempt "+r+"]: "+t+"\n"+n+"\n"+o})}(e.i,e.v,e.B,e.l,e.S,e.u)}function Le(e){return!!e.g&&("GET"==e.v&&2!=e.M&&e.j.Aa)}function xe(e,t){var n=e.C,i=t.indexOf("\n",n);
vendor: 26,638 bytes, line 1
1return-1==i?Re:(n=Number(t.substring(n,i)),isNaN(n)?De:(i+=1)+n>t.length?Re:(t=t.slice(i,i+n),e.C=i+n,t))}function Me(e){e.T=Date.now()+e.H,Ue(e,e.H)}function Ue(e,t){if(null!=e.D)throw Error("WatchDog timer not null");e.D=we(c(e.aa,e),t)}function Ve(e){e.D&&(s.clearTimeout(e.D),e.D=null)}function Fe(e){0==e.j.I||e.K||Yt(e.j,e)}function je(e){Ve(e);var t=e.O;t&&"function"==typeof t.dispose&&t.dispose(),e.O=null,ne(e.V),e.g&&(t=e.g,e.g=null,t.abort(),t.dispose())}function Be(e,t){try{var n=e.j;if(0!=n.I&&(n.g==e||Ge(n.h,e)))if(!e.L&&Ge(n.h,e)&&3==n.I){try{var i=n.Ba.g.parse(t)}catch(l){i=null}if(Array.isArray(i)&&3==i.length){var r=i;if(0==r[0]){e:if(!n.v){if(n.g){if(!(n.g.F+3e3<e.F))break e;Xt(n),Bt(n)}Wt(n),ye(18)}}else n.xa=r[1],0<n.xa-n.K&&r[2]<37500&&n.F&&0==n.A&&!n.C&&(n.C=we(c(n.Va,n),6e3));He(n.h)<=1&&n.ta&&(n.ta=void 0)}else en(n,11)}else if((e.L||n.g==e)&&Xt(n),!C(t))for(r=n.Ba.g.parse(t),t=0;t<r.length;t++){let c=r[t];const l=c[0];if(!(l<=n.K))if(n.K=l,c=c[1],2==n.I)if("c"==c[0]){n.M=c[1],n.ba=c[2];const t=c[3];null!=t&&(n.ka=t,n.j.info("VER="+n.ka));const r=c[4];null!=r&&(n.za=r,n.j.info("SVER="+n.za));const l=c[5];null!=l&&"number"==typeof l&&l>0&&(i=1.5*l,n.O=i,n.j.info("backChannelRequestTimeoutMs_="+i)),i=n;const u=e.g;if(u){const e=u.g?u.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(e){var s=i.h;s.g||-1==e.indexOf("spdy")&&-1==e.indexOf("quic")&&-1==e.indexOf("h2")||(s.j=s.l,s.g=new Set,s.h&&(Ke(s,s.h),s.h=null))}if(i.G){const e=u.g?u.g.getResponseHeader("X-HTTP-Session-Id"):null;e&&(i.wa=e,nt(i.J,i.G,e))}}n.I=3,n.l&&n.l.ra(),n.aa&&(n.T=Date.now()-e.F,n.j.info("Handshake RTT: "+n.T+"ms"));var o=e;if((i=n).na=nn(i,i.L?i.ba:null,i.W),o.L){We(i.h,o);var a=o,h=i.O;h&&(a.H=h),a.D&&(Ve(a),Me(a)),i.g=o}else Kt(i);n.i.length>0&&zt(n)}else"stop"!=c[0]&&"close"!=c[0]||en(n,7);else 3==n.I&&("stop"==c[0]||"close"==c[0]?"stop"==c[0]?en(n,7):jt(n):"noop"!=c[0]&&n.l&&n.l.qa(c),n.A=0)}ge()}catch(l){}}ke.prototype.ba=function(e){e=e.target;const t=this.O;t&&3==Mt(e)?t.j():this.Y(e)},ke.prototype.Y=function(e){try{if(e==this.g)e:{const c=Mt(this.g),h=this.g.ya();this.g.ca();if(!(c<3)&&(3!=c||this.g&&(this.h.h||this.g.la()||Ut(this.g)))){this.K||4!=c||7==h||ge(),Ve(this);var t=this.g.ca();this.X=t;var n=function(e){if(!Le(e))return e.g.la();const t=Ut(e.g);if(""===t)return"";let n="";const i=t.length,r=4==Mt(e.g);if(!e.h.i){if("undefined"==typeof TextDecoder)return je(e),Fe(e),"";e.h.i=new s.TextDecoder}for(let s=0;s<i;s++)e.h.h=!0,n+=e.h.i.decode(t[s],{stream:!(r&&s==i-1)});return t.length=0,e.h.g+=n,e.C=0,e.h.g}(this);if(this.o=200==t,function(e,t,n,i,r,s,o){e.info(function(){return"XMLHTTP RESP ("+i+") [ attempt "+r+"]: "+t+"\n"+n+"\n"+s+" "+o})}(this.i,this.v,this.B,this.l,this.S,c,t),this.o){if(this.U&&!this.L){t:{if(this.g){var i,r=this.g;if((i=r.g?r.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!C(i)){var o=i;break t}}o=null}if(!(e=o)){this.o=!1,this.m=3,ye(12),je(this),Fe(this);break e}be(this.i,this.l,e,"Initial handshake response via X-HTTP-Initial-Response"),this.L=!0,Be(this,e)}if(this.R){let t;for(e=!0;!this.K&&this.C<n.length;){if(t=xe(this,n),t==Re){4==c&&(this.m=4,ye(14),e=!1),be(this.i,this.l,null,"[Incomplete Response]");break}if(t==De){this.m=4,ye(15),be(this.i,this.l,n,"[Invalid Chunk]"),e=!1;break}be(this.i,this.l,t,null),Be(this,t)}if(Le(this)&&0!=this.C&&(this.h.g=this.h.g.slice(this.C),this.C=0),4!=c||0!=n.length||this.h.h||(this.m=1,ye(16),e=!1),this.o=this.o&&e,e){if(n.length>0&&!this.W){this.W=!0;var a=this.j;a.g==this&&a.aa&&!a.P&&(a.j.info("Great, no buffering proxy detected. Bytes received: "+n.length),Qt(a),a.P=!0,ye(11))}}else be(this.i,this.l,n,"[Invalid Chunked Response]"),je(this),Fe(this)}else be(this.i,this.l,n,null),Be(this,n);4==c&&je(this),this.o&&!this.K&&(4==c?Yt(this.j,this):(this.o=!1,Me(this)))}else(function(e){const t={};e=(e.g&&Mt(e)>=2&&e.g.getAllResponseHeaders()||"").split("\r\n");for(let i=0;i<e.length;i++){if(C(e[i]))continue;var n=Ae(e[i]);const r=n[0];if("string"!=typeof(n=n[1]))continue;n=n.trim();const s=t[r]||[];t[r]=s,s.push(n)}!function(e,t){for(const n in e)t.call(void 0,e[n],n,e)}(t,function(e){return e.join(", ")})})(this.g),400==t&&n.indexOf("Unknown SID")>0?(this.m=3,ye(12)):(this.m=0,ye(13)),je(this),Fe(this)}}}catch(c){}},ke.prototype.cancel=function(){this.K=!0,je(this)},ke.prototype.aa=function(){this.D=null;const e=Date.now();e-this.T>=0?(function(e,t){e.info(function(){return"TIMEOUT: "+t})}(this.i,this.B),2!=this.M&&(ge(),ye(17)),je(this),this.m=2,Fe(this)):Ue(this,this.T-e)};var $e=class{constructor(e,t){this.g=e,this.map=t}};function ze(e){this.l=e||10,s.PerformanceNavigationTiming?e=(e=s.performance.getEntriesByType("navigation")).length>0&&("hq"==e[0].nextHopProtocol||"h2"==e[0].nextHopProtocol):e=!!(s.chrome&&s.chrome.loadTimes&&s.chrome.loadTimes()&&s.chrome.loadTimes().wasFetchedViaSpdy),this.j=e?this.l:1,this.g=null,this.j>1&&(this.g=new Set),this.h=null,this.i=[]}function qe(e){return!!e.h||!!e.g&&e.g.size>=e.j}function He(e){return e.h?1:e.g?e.g.size:0}function Ge(e,t){return e.h?e.h==t:!!e.g&&e.g.has(t)}function Ke(e,t){e.g?e.g.add(t):e.h=t}function We(e,t){e.h&&e.h==t?e.h=null:e.g&&e.g.has(t)&&e.g.delete(t)}function Qe(e){if(null!=e.h)return e.i.concat(e.h.G);if(null!=e.g&&0!==e.g.size){let t=e.i;for(const n of e.g.values())t=t.concat(n.G);return t}return d(e.i)}ze.prototype.cancel=function(){if(this.i=Qe(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){for(const e of this.g.values())e.cancel();this.g.clear()}};var Je=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function Xe(e){let t;this.g=this.o=this.j="",this.u=null,this.m=this.h="",this.l=!1,e instanceof Xe?(this.l=e.l,Ze(this,e.j),this.o=e.o,this.g=e.g,et(this,e.u),this.h=e.h,tt(this,vt(e.i)),this.m=e.m):e&&(t=String(e).match(Je))?(this.l=!1,Ze(this,t[1]||"",!0),this.o=rt(t[2]||""),this.g=rt(t[3]||"",!0),et(this,t[4]),this.h=rt(t[5]||"",!0),tt(this,t[6]||"",!0),this.m=rt(t[7]||"")):(this.l=!1,this.i=new dt(null,this.l))}function Ye(e){return new Xe(e)}function Ze(e,t,n){e.j=n?rt(t,!0):t,e.j&&(e.j=e.j.replace(/:$/,""))}function et(e,t){if(t){if(t=Number(t),isNaN(t)||t<0)throw Error("Bad port number "+t);e.u=t}else e.u=null}function tt(e,t,n){t instanceof dt?(e.i=t,function(e,t){t&&!e.j&&(ft(e),e.i=null,e.g.forEach(function(e,t){const n=t.toLowerCase();t!=n&&(pt(this,t),yt(this,n,e))},e)),e.j=t}(e.i,e.l)):(n||(t=st(t,lt)),e.i=new dt(t,e.l))}function nt(e,t,n){e.i.set(t,n)}function it(e){return nt(e,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),e}function rt(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function st(e,t,n){return"string"==typeof e?(e=encodeURI(e).replace(t,ot),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function ot(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}Xe.prototype.toString=function(){const e=[];var t=this.j;t&&e.push(st(t,at,!0),":");var n=this.g;return(n||"file"==t)&&(e.push("//"),(t=this.o)&&e.push(st(t,at,!0),"@"),e.push(Ce(n).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.u)&&e.push(":",String(n))),(n=this.h)&&(this.g&&"/"!=n.charAt(0)&&e.push("/"),e.push(st(n,"/"==n.charAt(0)?ht:ct,!0))),(n=this.i.toString())&&e.push("?",n),(n=this.m)&&e.push("#",st(n,ut)),e.join("")},Xe.prototype.resolve=function(e){const t=Ye(this);let n=!!e.j;n?Ze(t,e.j):n=!!e.o,n?t.o=e.o:n=!!e.g,n?t.g=e.g:n=null!=e.u;var i=e.h;if(n)et(t,e.u);else if(n=!!e.h){if("/"!=i.charAt(0))if(this.g&&!this.h)i="/"+i;else{var r=t.h.lastIndexOf("/");-1!=r&&(i=t.h.slice(0,r+1)+i)}if(".."==(r=i)||"."==r)i="";else if(-1!=r.indexOf("./")||-1!=r.indexOf("/.")){i=0==r.lastIndexOf("/",0),r=r.split("/");const e=[];for(let t=0;t<r.length;){const n=r[t++];"."==n?i&&t==r.length&&e.push(""):".."==n?((e.length>1||1==e.length&&""!=e[0])&&e.pop(),i&&t==r.length&&e.push("")):(e.push(n),i=!0)}i=e.join("/")}else i=r}return n?t.h=i:n=""!==e.i.toString(),n?tt(t,vt(e.i)):n=!!e.m,n&&(t.m=e.m),t};var at=/[#\/\?@]/g,ct=/[#\?:]/g,ht=/[#\?]/g,lt=/[#\?@]/g,ut=/#/g;function dt(e,t){this.h=this.g=null,this.i=e||null,this.j=!!t}function ft(e){e.g||(e.g=new Map,e.h=0,e.i&&function(e,t){if(e){e=e.split("&");for(let n=0;n<e.length;n++){const i=e[n].indexOf("=");let r,s=null;i>=0?(r=e[n].substring(0,i),s=e[n].substring(i+1)):r=e[n],t(r,s?decodeURIComponent(s.replace(/\+/g," ")):"")}}}(e.i,function(t,n){e.add(decodeURIComponent(t.replace(/\+/g," ")),n)}))}function pt(e,t){ft(e),t=wt(e,t),e.g.has(t)&&(e.i=null,e.h-=e.g.get(t).length,e.g.delete(t))}function gt(e,t){return ft(e),t=wt(e,t),e.g.has(t)}function mt(e,t){ft(e);let n=[];if("string"==typeof t)gt(e,t)&&(n=n.concat(e.g.get(wt(e,t))));else for(e=Array.from(e.g.values()),t=0;t<e.length;t++)n=n.concat(e[t]);return n}function yt(e,t,n){pt(e,t),n.length>0&&(e.i=null,e.g.set(wt(e,t),d(n)),e.h+=n.length)}function vt(e){const t=new dt;return t.i=e.i,e.g&&(t.g=new Map(e.g),t.h=e.h),t}function wt(e,t){return t=String(t),e.j&&(t=t.toLowerCase()),t}function _t(e,t,n,i,r){try{r&&(r.onload=null,r.onerror=null,r.onabort=null,r.ontimeout=null),i(n)}catch(s){}}function bt(){this.g=new se}function It(e){this.i=e.Sb||null,this.h=e.ab||!1}function Tt(e,t){Q.call(this),this.H=e,this.o=t,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.A=new Headers,this.h=null,this.F="GET",this.D="",this.g=!1,this.B=this.j=this.l=null,this.v=new AbortController}function Et(e){e.j.read().then(e.Ma.bind(e)).catch(e.ga.bind(e))}function St(e){e.readyState=4,e.l=null,e.j=null,e.B=null,Ct(e)}function Ct(e){e.onreadystatechange&&e.onreadystatechange.call(e)}function At(e){let t="";return P(e,function(e,n){t+=n,t+=":",t+=e,t+="\r\n"}),t}function kt(e,t,n){e:{for(i in n){var i=!1;break e}i=!0}i||(n=At(n),"string"==typeof e?null!=n&&Ce(n):nt(e,t,n))}function Nt(e){Q.call(this),this.headers=new Map,this.L=e||null,this.h=!1,this.g=null,this.D="",this.o=0,this.l="",this.j=this.B=this.v=this.A=!1,this.m=null,this.F="",this.H=!1}(e=dt.prototype).add=function(e,t){ft(this),this.i=null,e=wt(this,e);let n=this.g.get(e);return n||this.g.set(e,n=[]),n.push(t),this.h+=1,this},e.forEach=function(e,t){ft(this),this.g.forEach(function(n,i){n.forEach(function(n){e.call(t,n,i,this)},this)},this)},e.set=function(e,t){return ft(this),this.i=null,gt(this,e=wt(this,e))&&(this.h-=this.g.get(e).length),this.g.set(e,[t]),this.h+=1,this},e.get=function(e,t){return e&&(e=mt(this,e)).length>0?String(e[0]):t},e.toString=function(){if(this.i)return this.i;if(!this.g)return"";const e=[],t=Array.from(this.g.keys());for(let i=0;i<t.length;i++){var n=t[i];const r=Ce(n);n=mt(this,n);for(let t=0;t<n.length;t++){let i=r;""!==n[t]&&(i+="="+Ce(n[t])),e.push(i)}}return this.i=e.join("&")},l(It,oe),It.prototype.g=function(){return new Tt(this.i,this.h)},l(Tt,Q),(e=Tt.prototype).open=function(e,t){if(0!=this.readyState)throw this.abort(),Error("Error reopening a connection");this.F=e,this.D=t,this.readyState=1,Ct(this)},e.send=function(e){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");if(this.v.signal.aborted)throw this.abort(),Error("Request was aborted.");this.g=!0;const t={headers:this.A,method:this.F,credentials:this.m,cache:void 0,signal:this.v.signal};e&&(t.body=e),(this.H||s).fetch(new Request(this.D,t)).then(this.Pa.bind(this),this.ga.bind(this))},e.abort=function(){this.response=this.responseText="",this.A=new Headers,this.status=0,this.v.abort(),this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),this.readyState>=1&&this.g&&4!=this.readyState&&(this.g=!1,St(this)),this.readyState=0},e.Pa=function(e){if(this.g&&(this.l=e,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=e.headers,this.readyState=2,Ct(this)),this.g&&(this.readyState=3,Ct(this),this.g)))if("arraybuffer"===this.responseType)e.arrayBuffer().then(this.Na.bind(this),this.ga.bind(this));else if(void 0!==s.ReadableStream&&"body"in e){if(this.j=e.body.getReader(),this.o){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.B=new TextDecoder;Et(this)}else e.text().then(this.Oa.bind(this),this.ga.bind(this))},e.Ma=function(e){if(this.g){if(this.o&&e.value)this.response.push(e.value);else if(!this.o){var t=e.value?e.value:new Uint8Array(0);(t=this.B.decode(t,{stream:!e.done}))&&(this.response=this.responseText+=t)}e.done?St(this):Ct(this),3==this.readyState&&Et(this)}},e.Oa=function(e){this.g&&(this.response=this.responseText=e,St(this))},e.Na=function(e){this.g&&(this.response=e,St(this))},e.ga=function(){this.g&&St(this)},e.setRequestHeader=function(e,t){this.A.append(e,t)},e.getResponseHeader=function(e){return this.h&&this.h.get(e.toLowerCase())||""},e.getAllResponseHeaders=function(){if(!this.h)return"";const e=[],t=this.h.entries();for(var n=t.next();!n.done;)n=n.value,e.push(n[0]+": "+n[1]),n=t.next();return e.join("\r\n")},Object.defineProperty(Tt.prototype,"withCredentials",{get:function(){return"include"===this.m},set:function(e){this.m=e?"include":"same-origin"}}),l(Nt,Q);var Dt=/^https?$/i,Rt=["POST","PUT"];function Pt(e,t){e.h=!1,e.g&&(e.j=!0,e.g.abort(),e.j=!1),e.l=t,e.o=5,Ot(e),xt(e)}function Ot(e){e.A||(e.A=!0,J(e,"complete"),J(e,"error"))}function Lt(e){if(e.h&&void 0!==r)if(e.v&&4==Mt(e))setTimeout(e.Ca.bind(e),0);else if(J(e,"readystatechange"),4==Mt(e)){e.h=!1;try{const r=e.ca();e:switch(r){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var t=!0;break e;default:t=!1}var n;if(!(n=t)){var i;if(i=0===r){let t=String(e.D).match(Je)[1]||null;!t&&s.self&&s.self.location&&(t=s.self.location.protocol.slice(0,-1)),i=!Dt.test(t?t.toLowerCase():"")}n=i}if(n)J(e,"complete"),J(e,"success");else{e.o=6;try{var o=Mt(e)>2?e.g.statusText:""}catch(a){o=""}e.l=o+" ["+e.ca()+"]",Ot(e)}}finally{xt(e)}}}function xt(e,t){if(e.g){e.m&&(clearTimeout(e.m),e.m=null);const i=e.g;e.g=null,t||J(e,"ready");try{i.onreadystatechange=null}catch(n){}}}function Mt(e){return e.g?e.g.readyState:0}function Ut(e){try{if(!e.g)return null;if("response"in e.g)return e.g.response;switch(e.F){case"":case"text":return e.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in e.g)return e.g.mozResponseArrayBuffer}return null}catch(t){return null}}function Vt(e,t,n){return n&&n.internalChannelParams&&n.internalChannelParams[e]||t}function Ft(e){this.za=0,this.i=[],this.j=new _e,this.ba=this.na=this.J=this.W=this.g=this.wa=this.G=this.H=this.u=this.U=this.o=null,this.Ya=this.V=0,this.Sa=Vt("failFast",!1,e),this.F=this.C=this.v=this.m=this.l=null,this.X=!0,this.xa=this.K=-1,this.Y=this.A=this.D=0,this.Qa=Vt("baseRetryDelayMs",5e3,e),this.Za=Vt("retryDelaySeedMs",1e4,e),this.Ta=Vt("forwardChannelMaxRetries",2,e),this.va=Vt("forwardChannelRequestTimeoutMs",2e4,e),this.ma=e&&e.xmlHttpFactory||void 0,this.Ua=e&&e.Rb||void 0,this.Aa=e&&e.useFetchStreams||!1,this.O=void 0,this.L=e&&e.supportsCrossDomainXhr||!1,this.M="",this.h=new ze(e&&e.concurrentRequestLimit),this.Ba=new bt,this.S=e&&e.fastHandshake||!1,this.R=e&&e.encodeInitMessageHeaders||!1,this.S&&this.R&&(this.R=!1),this.Ra=e&&e.Pb||!1,e&&e.ua&&this.j.ua(),e&&e.forceLongPolling&&(this.X=!1),this.aa=!this.S&&this.X&&e&&e.detectBufferingProxy||!1,this.ia=void 0,e&&e.longPollingTimeout&&e.longPollingTimeout>0&&(this.ia=e.longPollingTimeout),this.ta=void 0,this.T=0,this.P=!1,this.ja=this.B=null}function jt(e){if($t(e),3==e.I){var t=e.V++,n=Ye(e.J);if(nt(n,"SID",e.M),nt(n,"RID",t),nt(n,"TYPE","terminate"),Ht(e,n),(t=new ke(e,e.j,t)).M=2,t.A=it(Ye(n)),n=!1,s.navigator&&s.navigator.sendBeacon)try{n=s.navigator.sendBeacon(t.A.toString(),"")}catch(i){}!n&&s.Image&&((new Image).src=t.A,n=!0),n||(t.g=rn(t.j,null),t.g.ea(t.A)),t.F=Date.now(),Me(t)}tn(e)}function Bt(e){e.g&&(Qt(e),e.g.cancel(),e.g=null)}function $t(e){Bt(e),e.v&&(s.clearTimeout(e.v),e.v=null),Xt(e),e.h.cancel(),e.m&&("number"==typeof e.m&&s.clearTimeout(e.m),e.m=null)}function zt(e){if(!qe(e.h)&&!e.m){e.m=!0;var t=e.Ea;v||b(),w||(v(),w=!0),_.add(t,e),e.D=0}}function qt(e,t){var n;n=t?t.l:e.V++;const i=Ye(e.J);nt(i,"SID",e.M),nt(i,"RID",n),nt(i,"AID",e.K),Ht(e,i),e.u&&e.o&&kt(i,e.u,e.o),n=new ke(e,e.j,n,e.D+1),null===e.u&&(n.J=e.o),t&&(e.i=t.G.concat(e.i)),t=Gt(e,n,1e3),n.H=Math.round(.5*e.va)+Math.round(.5*e.va*Math.random()),Ke(e.h,n),Pe(n,i,t)}function Ht(e,t){e.H&&P(e.H,function(e,n){nt(t,n,e)}),e.l&&P({},function(e,n){nt(t,n,e)})}function Gt(e,t,n){n=Math.min(e.i.length,n);const i=e.l?c(e.l.Ka,e.l,e):null;e:{var r=e.i;let t=-1;for(;;){const e=["count="+n];-1==t?n>0?(t=r[0].g,e.push("ofs="+t)):t=0:e.push("ofs="+t);let c=!0;for(let l=0;l<n;l++){var s=r[l].g;const n=r[l].map;if((s-=t)<0)t=Math.max(0,r[l].g-100),c=!1;else try{s="req"+s+"_"||"";try{var a=n instanceof Map?n:Object.entries(n);for(const[t,n]of a){let i=n;o(n)&&(i=ie(n)),e.push(s+t+"="+encodeURIComponent(i))}}catch(h){throw e.push(s+"type="+encodeURIComponent("_badmap")),h}}catch(h){i&&i(n)}}if(c){a=e.join("&");break e}}a=void 0}return e=e.i.splice(0,n),t.G=e,a}function Kt(e){if(!e.g&&!e.v){e.Y=1;var t=e.Da;v||b(),w||(v(),w=!0),_.add(t,e),e.A=0}}function Wt(e){return!(e.g||e.v||e.A>=3)&&(e.Y++,e.v=we(c(e.Da,e),Zt(e,e.A)),e.A++,!0)}function Qt(e){null!=e.B&&(s.clearTimeout(e.B),e.B=null)}function Jt(e){e.g=new ke(e,e.j,"rpc",e.Y),null===e.u&&(e.g.J=e.o),e.g.P=0;var t=Ye(e.na);nt(t,"RID","rpc"),nt(t,"SID",e.M),nt(t,"AID",e.K),nt(t,"CI",e.F?"0":"1"),!e.F&&e.ia&&nt(t,"TO",e.ia),nt(t,"TYPE","xmlhttp"),Ht(e,t),e.u&&e.o&&kt(t,e.u,e.o),e.O&&(e.g.H=e.O);var n=e.g;e=e.ba,n.M=1,n.A=it(Ye(t)),n.u=null,n.R=!0,Oe(n,e)}function Xt(e){null!=e.C&&(s.clearTimeout(e.C),e.C=null)}function Yt(e,t){var n=null;if(e.g==t){Xt(e),Qt(e),e.g=null;var i=2}else{if(!Ge(e.h,t))return;n=t.G,We(e.h,t),i=1}if(0!=e.I)if(t.o)if(1==i){n=t.u?t.u.length:0,t=Date.now()-t.F;var r=e.D;J(i=fe(),new ve(i,n)),zt(e)}else Kt(e);else if(3==(r=t.m)||0==r&&t.X>0||!(1==i&&function(e,t){return!(He(e.h)>=e.h.j-(e.m?1:0)||(e.m?(e.i=t.G.concat(e.i),0):1==e.I||2==e.I||e.D>=(e.Sa?0:e.Ta)||(e.m=we(c(e.Ea,e,t),Zt(e,e.D)),e.D++,0)))}(e,t)||2==i&&Wt(e)))switch(n&&n.length>0&&(t=e.h,t.i=t.i.concat(n)),r){case 1:en(e,5);break;case 4:en(e,10);break;case 3:en(e,6);break;default:en(e,2)}}function Zt(e,t){let n=e.Qa+Math.floor(Math.random()*e.Za);return e.isActive()||(n*=2),n*t}function en(e,t){if(e.j.info("Error code "+t),2==t){var n=c(e.bb,e),i=e.Ua;const t=!i;i=new Xe(i||"//www.google.com/images/cleardot.gif"),s.location&&"http"==s.location.protocol||Ze(i,"https"),it(i),t?function(e,t){const n=new _e;if(s.Image){const i=new Image;i.onload=h(_t,n,"TestLoadImage: loaded",!0,t,i),i.onerror=h(_t,n,"TestLoadImage: error",!1,t,i),i.onabort=h(_t,n,"TestLoadImage: abort",!1,t,i),i.ontimeout=h(_t,n,"TestLoadImage: timeout",!1,t,i),s.setTimeout(function(){i.ontimeout&&i.ontimeout()},1e4),i.src=e}else t(!1)}(i.toString(),n):function(e,t){new _e;const n=new AbortController,i=setTimeout(()=>{n.abort(),_t(0,0,!1,t)},1e4);fetch(e,{signal:n.signal}).then(e=>{clearTimeout(i),e.ok?_t(0,0,!0,t):_t(0,0,!1,t)}).catch(()=>{clearTimeout(i),_t(0,0,!1,t)})}(i.toString(),n)}else ye(2);e.I=0,e.l&&e.l.pa(t),tn(e),$t(e)}function tn(e){if(e.I=0,e.ja=[],e.l){const t=Qe(e.h);0==t.length&&0==e.i.length||(f(e.ja,t),f(e.ja,e.i),e.h.i.length=0,d(e.i),e.i.length=0),e.l.oa()}}function nn(e,t,n){var i=n instanceof Xe?Ye(n):new Xe(n);if(""!=i.g)t&&(i.g=t+"."+i.g),et(i,i.u);else{var r=s.location;i=r.protocol,t=t?t+"."+r.hostname:r.hostname,r=+r.port;const e=new Xe(null);i&&Ze(e,i),t&&(e.g=t),r&&et(e,r),n&&(e.h=n),i=e}return n=e.G,t=e.wa,n&&t&&nt(i,n,t),nt(i,"VER",e.ka),Ht(e,i),i}function rn(e,t,n){if(t&&!e.L)throw Error("Can't create secondary domain capable XhrIo object.");return(t=e.Aa&&!e.ma?new Nt(new It({ab:n})):new Nt(e.ma)).Fa(e.L),t}function sn(){}function on(){}function an(e,t){Q.call(this),this.g=new Ft(t),this.l=e,this.h=t&&t.messageUrlParams||null,e=t&&t.messageHeaders||null,t&&t.clientProtocolHeaderRequired&&(e?e["X-Client-Protocol"]="webchannel":e={"X-Client-Protocol":"webchannel"}),this.g.o=e,e=t&&t.initMessageHeaders||null,t&&t.messageContentType&&(e?e["X-WebChannel-Content-Type"]=t.messageContentType:e={"X-WebChannel-Content-Type":t.messageContentType}),t&&t.sa&&(e?e["X-WebChannel-Client-Profile"]=t.sa:e={"X-WebChannel-Client-Profile":t.sa}),this.g.U=e,(e=t&&t.Qb)&&!C(e)&&(this.g.u=e),this.A=t&&t.supportsCrossDomainXhr||!1,this.v=t&&t.sendRawJson||!1,(t=t&&t.httpSessionIdParam)&&!C(t)&&(this.g.G=t,null!==(e=this.h)&&t in e&&(t in(e=this.h)&&delete e[t])),this.j=new ln(this)}function cn(e){he.call(this),e.__headers__&&(this.headers=e.__headers__,this.statusCode=e.__status__,delete e.__headers__,delete e.__status__);var t=e.__sm__;if(t){e:{for(const n in t){e=n;break e}e=void 0}(this.i=e)&&(e=this.i,t=null!==t&&e in t?t[e]:void 0),this.data=t}else this.data=e}function hn(){le.call(this),this.status=1}function ln(e){this.g=e}(e=Nt.prototype).Fa=function(e){this.H=e},e.ea=function(e,t,n,i){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+e);t=t?t.toUpperCase():"GET",this.D=e,this.l="",this.o=0,this.A=!1,this.h=!0,this.g=this.L?this.L.g():Ie.g(),this.g.onreadystatechange=u(c(this.Ca,this));try{this.B=!0,this.g.open(t,String(e),!0),this.B=!1}catch(o){return void Pt(this,o)}if(e=n||"",n=new Map(this.headers),i)if(Object.getPrototypeOf(i)===Object.prototype)for(var r in i)n.set(r,i[r]);else{if("function"!=typeof i.keys||"function"!=typeof i.get)throw Error("Unknown input type for opt_headers: "+String(i));for(const e of i.keys())n.set(e,i.get(e))}i=Array.from(n.keys()).find(e=>"content-type"==e.toLowerCase()),r=s.FormData&&e instanceof s.FormData,!(Array.prototype.indexOf.call(Rt,t,void 0)>=0)||i||r||n.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[s,a]of n)this.g.setRequestHeader(s,a);this.F&&(this.g.responseType=this.F),"withCredentials"in this.g&&this.g.withCredentials!==this.H&&(this.g.withCredentials=this.H);try{this.m&&(clearTimeout(this.m),this.m=null),this.v=!0,this.g.send(e),this.v=!1}catch(o){Pt(this,o)}},e.abort=function(e){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.o=e||7,J(this,"complete"),J(this,"abort"),xt(this))},e.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),xt(this,!0)),Nt.Z.N.call(this)},e.Ca=function(){this.u||(this.B||this.v||this.j?Lt(this):this.Xa())},e.Xa=function(){Lt(this)},e.isActive=function(){return!!this.g},e.ca=function(){try{return Mt(this)>2?this.g.status:-1}catch(e){return-1}},e.la=function(){try{return this.g?this.g.responseText:""}catch(e){return""}},e.La=function(e){if(this.g){var t=this.g.responseText;return e&&0==t.indexOf(e)&&(t=t.substring(e.length)),re(t)}},e.ya=function(){return this.o},e.Ha=function(){return"string"==typeof this.l?this.l:String(this.l)},(e=Ft.prototype).ka=8,e.I=1,e.connect=function(e,t,n,i){ye(0),this.W=e,this.H=t||{},n&&void 0!==i&&(this.H.OSID=n,this.H.OAID=i),this.F=this.X,this.J=nn(this,null,this.W),zt(this)},e.Ea=function(e){if(this.m)if(this.m=null,1==this.I){if(!e){this.V=Math.floor(1e5*Math.random()),e=this.V++;const r=new ke(this,this.j,e);let s=this.o;if(this.U&&(s?(s=O(s),x(s,this.U)):s=this.U),null!==this.u||this.R||(r.J=s,s=null),this.S)e:{for(var t=0,n=0;n<this.i.length;n++){var i=this.i[n];if(void 0===(i="__data__"in i.map&&"string"==typeof(i=i.map.__data__)?i.length:void 0))break;if((t+=i)>4096){t=n;break e}if(4096===t||n===this.i.length-1){t=n+1;break e}}t=1e3}else t=1e3;t=Gt(this,r,t),nt(n=Ye(this.J),"RID",e),nt(n,"CVER",22),this.G&&nt(n,"X-HTTP-Session-Id",this.G),Ht(this,n),s&&(this.R?t="headers="+Ce(At(s))+"&"+t:this.u&&kt(n,this.u,s)),Ke(this.h,r),this.Ra&&nt(n,"TYPE","init"),this.S?(nt(n,"$req",t),nt(n,"SID","null"),r.U=!0,Pe(r,n,null)):Pe(r,n,t),this.I=2}}else 3==this.I&&(e?qt(this,e):0==this.i.length||qe(this.h)||qt(this))},e.Da=function(){if(this.v=null,Jt(this),this.aa&&!(this.P||null==this.g||this.T<=0)){var e=4*this.T;this.j.info("BP detection timer enabled: "+e),this.B=we(c(this.Wa,this),e)}},e.Wa=function(){this.B&&(this.B=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.P=!0,ye(10),Bt(this),Jt(this))},e.Va=function(){null!=this.C&&(this.C=null,Bt(this),Wt(this),ye(19))},e.bb=function(e){e?(this.j.info("Successfully pinged google.com"),ye(2)):(this.j.info("Failed to ping google.com"),ye(1))},e.isActive=function(){return!!this.l&&this.l.isActive(this)},(e=sn.prototype).ra=function(){},e.qa=function(){},e.pa=function(){},e.oa=function(){},e.isActive=function(){return!0},e.Ka=function(){},on.prototype.g=function(e,t){return new an(e,t)},l(an,Q),an.prototype.m=function(){this.g.l=this.j,this.A&&(this.g.L=!0),this.g.connect(this.l,this.h||void 0)},an.prototype.close=function(){jt(this.g)},an.prototype.o=function(e){var t=this.g;if("string"==typeof e){var n={};n.__data__=e,e=n}else this.v&&((n={}).__data__=ie(e),e=n);t.i.push(new $e(t.Ya++,e)),3==t.I&&zt(t)},an.prototype.N=function(){this.g.l=null,delete this.j,jt(this.g),delete this.g,an.Z.N.call(this)},l(cn,he),l(hn,le),l(ln,sn),ln.prototype.ra=function(){J(this.g,"a")},ln.prototype.qa=function(e){J(this.g,new cn(e))},ln.prototype.pa=function(e){J(this.g,new hn)},ln.prototype.oa=function(){J(this.g,"b")},on.prototype.createWebChannel=on.prototype.g,an.prototype.send=an.prototype.o,an.prototype.open=an.prototype.m,an.prototype.close=an.prototype.close,Pn=function(){return new on},Rn=function(){return fe()},Dn=ue,Nn={jb:0,mb:1,nb:2,Hb:3,Mb:4,Jb:5,Kb:6,Ib:7,Gb:8,Lb:9,PROXY:10,NOPROXY:11,Eb:12,Ab:13,Bb:14,zb:15,Cb:16,Db:17,fb:18,eb:19,gb:20},Te.NO_ERROR=0,Te.TIMEOUT=8,Te.HTTP_ERROR=6,kn=Te,Ee.COMPLETE="complete",An=Ee,ae.EventType=ce,ce.OPEN="a",ce.CLOSE="b",ce.ERROR="c",ce.MESSAGE="d",Q.prototype.listen=Q.prototype.J,Cn=ae,Nt.prototype.listenOnce=Nt.prototype.K,Nt.prototype.getLastError=Nt.prototype.Ha,Nt.prototype.getLastErrorCode=Nt.prototype.ya,Nt.prototype.getStatus=Nt.prototype.ca,Nt.prototype.getResponseJson=Nt.prototype.La,Nt.prototype.getResponseText=Nt.prototype.la,Nt.prototype.send=Nt.prototype.ea,Nt.prototype.setWithCredentials=Nt.prototype.Fa,Sn=Nt}).apply(void 0!==On?On:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});class Ln{constructor(e){this.uid=e}isAuthenticated(){return null!=this.uid}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(e){return e.uid===this.uid}}
1Ln.UNAUTHENTICATED=new Ln(null),Ln.GOOGLE_CREDENTIALS=new Ln("google-credentials-uid"),Ln.FIRST_PARTY=new Ln("first-party-uid"),Ln.MOCK_USER=new Ln("mock-user");let xn="12.8.0";const Mn=new $("@firebase/firestore");function Un(){return Mn.logLevel}function Vn(e,...t){if(Mn.logLevel<=M.DEBUG){const n=t.map(Bn);Mn.debug(`Firestore (${xn}): ${e}`,...n)}}function Fn(e,...t){if(Mn.logLevel<=M.ERROR){const n=t.map(Bn);Mn.error(`Firestore (${xn}): ${e}`,...n)}}function jn(e,...t){if(Mn.logLevel<=M.WARN){const n=t.map(Bn);Mn.warn(`Firestore (${xn}): ${e}`,...n)}}function Bn(e){if("string"==typeof e)return e;try{return t=e,JSON.stringify(t)}catch(n){return e}var t}function $n(e,t,n){let i="Unexpected state";"string"==typeof t?i=t:n=t,zn(e,i,n)}function zn(e,t,n){let i=`FIRESTORE (${xn}) INTERNAL ASSERTION FAILED: ${t} (ID: ${e.toString(16)})`;if(void 0!==n)try{i+=" CONTEXT: "+JSON.stringify(n)}catch(r){i+=" CONTEXT: "+n}throw Fn(i),new Error(i)}function qn(e,t,n,i){let r="Unexpected state";"string"==typeof n?r=n:i=n,e||zn(t,r,i)}function Hn(e,t){return e}const Gn={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class Kn extends I{constructor(e,t){super(e,t),this.code=e,this.message=t,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}class Wn{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}class Qn{constructor(e,t){this.user=t,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class Jn{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,t){e.enqueueRetryable(()=>t(Ln.UNAUTHENTICATED))}shutdown(){}}class Xn{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,t){this.changeListener=t,e.enqueueRetryable(()=>t(this.token.user))}shutdown(){this.changeListener=null}}class Yn{constructor(e){this.t=e,this.currentUser=Ln.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,t){qn(void 0===this.o,42304);let n=this.i;const i=e=>this.i!==n?(n=this.i,t(e)):Promise.resolve();let r=new Wn;this.o=()=>{this.i++,this.currentUser=this.u(),r.resolve(),r=new Wn,e.enqueueRetryable(()=>i(this.currentUser))};const s=()=>{const t=r;e.enqueueRetryable(async()=>{await t.promise,await i(this.currentUser)})},o=e=>{Vn("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=e,this.o&&(this.auth.addAuthTokenListener(this.o),s())};this.t.onInit(e=>o(e)),setTimeout(()=>{if(!this.auth){const e=this.t.getImmediate({optional:!0});e?o(e):(Vn("FirebaseAuthCredentialsProvider","Auth not yet detected"),r.resolve(),r=new Wn)}},0),s()}getToken(){const e=this.i,t=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(t).then(t=>this.i!==e?(Vn("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):t?(qn("string"==typeof t.accessToken,31837,{l:t}),new Qn(t.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.o&&this.auth.removeAuthTokenListener(this.o),this.o=void 0}u(){const e=this.auth&&this.auth.getUid();return qn(null===e||"string"==typeof e,2055,{h:e}),new Ln(e)}}class Zn{constructor(e,t,n){this.P=e,this.T=t,this.I=n,this.type="FirstParty",this.user=Ln.FIRST_PARTY,this.R=new Map}A(){return this.I?this.I():null}get headers(){this.R.set("X-Goog-AuthUser",this.P);const e=this.A();return e&&this.R.set("Authorization",e),this.T&&this.R.set("X-Goog-Iam-Authorization-Token",this.T),this.R}}class ei{constructor(e,t,n){this.P=e,this.T=t,this.I=n}getToken(){return Promise.resolve(new Zn(this.P,this.T,this.I))}start(e,t){e.enqueueRetryable(()=>t(Ln.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class ti{constructor(e){this.value=e,this.type="AppCheck",this.headers=new Map,e&&e.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class ni{constructor(e,t){this.V=t,this.forceRefresh=!1,this.appCheck=null,this.m=null,this.p=null,qe(e)&&e.settings.appCheckToken&&(this.p=e.settings.appCheckToken)}start(e,t){qn(void 0===this.o,3512);const n=e=>{null!=e.error&&Vn("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${e.error.message}`);const n=e.token!==this.m;return this.m=e.token,Vn("FirebaseAppCheckTokenProvider",`Received ${n?"new":"existing"} token.`),n?t(e.token):Promise.resolve()};this.o=t=>{e.enqueueRetryable(()=>n(t))};const i=e=>{Vn("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=e,this.o&&this.appCheck.addTokenListener(this.o)};this.V.onInit(e=>i(e)),setTimeout(()=>{if(!this.appCheck){const e=this.V.getImmediate({optional:!0});e?i(e):Vn("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){if(this.p)return Promise.resolve(new ti(this.p));const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(e=>e?(qn("string"==typeof e.token,44558,{tokenResult:e}),this.m=e.token,new ti(e.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.o&&this.appCheck.removeTokenListener(this.o),this.o=void 0}}function ii(e){const t="undefined"!=typeof self&&(self.crypto||self.msCrypto),n=new Uint8Array(e);if(t&&"function"==typeof t.getRandomValues)t.getRandomValues(n);else for(let i=0;i<e;
vendor: 7,886 bytes, line 1
1i++)n[i]=Math.floor(256*Math.random());return n}class ri{static newId(){const e=62*Math.floor(256/62);let t="";for(;t.length<20;){const n=ii(40);for(let i=0;i<n.length;++i)t.length<20&&n[i]<e&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(n[i]%62))}return t}}function si(e,t){return e<t?-1:e>t?1:0}function oi(e,t){const n=Math.min(e.length,t.length);for(let i=0;i<n;i++){const n=e.charAt(i),r=t.charAt(i);if(n!==r)return hi(n)===hi(r)?si(n,r):hi(n)?1:-1}return si(e.length,t.length)}const ai=55296,ci=57343;function hi(e){const t=e.charCodeAt(0);return t>=ai&&t<=ci}function li(e,t,n){return e.length===t.length&&e.every((e,i)=>n(e,t[i]))}const ui="__name__";class di{constructor(e,t,n){void 0===t?t=0:t>e.length&&$n(637,{offset:t,range:e.length}),void 0===n?n=e.length-t:n>e.length-t&&$n(1746,{length:n,range:e.length-t}),this.segments=e,this.offset=t,this.len=n}get length(){return this.len}isEqual(e){return 0===di.comparator(this,e)}child(e){const t=this.segments.slice(this.offset,this.limit());return e instanceof di?e.forEach(e=>{t.push(e)}):t.push(e),this.construct(t)}limit(){return this.offset+this.length}popFirst(e){return e=void 0===e?1:e,this.construct(this.segments,this.offset+e,this.length-e)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(e){return this.segments[this.offset+e]}isEmpty(){return 0===this.length}isPrefixOf(e){if(e.length<this.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}isImmediateParentOf(e){if(this.length+1!==e.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}forEach(e){for(let t=this.offset,n=this.limit();t<n;t++)e(this.segments[t])}toArray(){return this.segments.slice(this.offset,this.limit())}static comparator(e,t){const n=Math.min(e.length,t.length);for(let i=0;i<n;i++){const n=di.compareSegments(e.get(i),t.get(i));if(0!==n)return n}return si(e.length,t.length)}static compareSegments(e,t){const n=di.isNumericId(e),i=di.isNumericId(t);return n&&!i?-1:!n&&i?1:n&&i?di.extractNumericId(e).compare(di.extractNumericId(t)):oi(e,t)}static isNumericId(e){return e.startsWith("__id")&&e.endsWith("__")}static extractNumericId(e){return Tn.fromString(e.substring(4,e.length-2))}}class fi extends di{construct(e,t,n){return new fi(e,t,n)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}toUriEncodedString(){return this.toArray().map(encodeURIComponent).join("/")}static fromString(...e){const t=[];for(const n of e){if(n.indexOf("//")>=0)throw new Kn(Gn.INVALID_ARGUMENT,`Invalid segment (${n}). Paths must not contain // in them.`);t.push(...n.split("/").filter(e=>e.length>0))}return new fi(t)}static emptyPath(){return new fi([])}}const pi=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class gi extends di{construct(e,t,n){return new gi(e,t,n)}static isValidIdentifier(e){return pi.test(e)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),gi.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return 1===this.length&&this.get(0)===ui}static keyField(){return new gi([ui])}static fromServerFormat(e){const t=[];let n="",i=0;const r=()=>{if(0===n.length)throw new Kn(Gn.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);t.push(n),n=""};let s=!1;for(;i<e.length;){const t=e[i];if("\\"===t){if(i+1===e.length)throw new Kn(Gn.INVALID_ARGUMENT,"Path has trailing escape character: "+e);const t=e[i+1];if("\\"!==t&&"."!==t&&"`"!==t)throw new Kn(Gn.INVALID_ARGUMENT,"Path has invalid escape sequence: "+e);n+=t,i+=2}else"`"===t?(s=!s,i++):"."!==t||s?(n+=t,i++):(r(),i++)}if(r(),s)throw new Kn(Gn.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new gi(t)}static emptyPath(){return new gi([])}}class mi{constructor(e){this.path=e}static fromPath(e){return new mi(fi.fromString(e))}static fromName(e){return new mi(fi.fromString(e).popFirst(5))}static empty(){return new mi(fi.emptyPath())}get collectionGroup(){return this.path.popLast().lastSegment()}hasCollectionId(e){return this.path.length>=2&&this.path.get(this.path.length-2)===e}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(e){return null!==e&&0===fi.comparator(this.path,e.path)}toString(){return this.path.toString()}static comparator(e,t){return fi.comparator(e.path,t.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new mi(new fi(e.slice()))}}function yi(e,t,n){if(!n)throw new Kn(Gn.INVALID_ARGUMENT,`Function ${e}() cannot be called with an empty ${t}.`)}function vi(e){if(!mi.isDocumentKey(e))throw new Kn(Gn.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${e} has ${e.length}.`)}function wi(e){if(mi.isDocumentKey(e))throw new Kn(Gn.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${e} has ${e.length}.`)}function _i(e){return"object"==typeof e&&null!==e&&(Object.getPrototypeOf(e)===Object.prototype||null===Object.getPrototypeOf(e))}function bi(e){if(void 0===e)return"undefined";if(null===e)return"null";if("string"==typeof e)return e.length>20&&(e=`${e.substring(0,20)}...`),JSON.stringify(e);if("number"==typeof e||"boolean"==typeof e)return""+e;if("object"==typeof e){if(e instanceof Array)return"an array";{const n=(t=e).constructor?t.constructor.name:null;return n?`a custom ${n} object`:"an object"}}var t;return"function"==typeof e?"a function":$n(12329,{type:typeof e})}function Ii(e,t){if("_delegate"in e&&(e=e._delegate),!(e instanceof t)){if(t.name===e.constructor.name)throw new Kn(Gn.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=bi(e);throw new Kn(Gn.INVALID_ARGUMENT,`Expected type '${t.name}', but it was: ${n}`)}}return e}function Ti(e,t){const n={typeString:e};return t&&(n.value=t),n}function Ei(e,t){if(!_i(e))throw new Kn(Gn.INVALID_ARGUMENT,"JSON must be an object");let n;for(const i in t)if(t[i]){const r=t[i].typeString,s="value"in t[i]?{value:t[i].value}:void 0;if(!(i in e)){n=`JSON missing required field: '${i}'`;break}const o=e[i];if(r&&typeof o!==r){n=`JSON field '${i}' must be a ${r}.`;break}if(void 0!==s&&o!==s.value){n=`Expected '${i}' field to equal '${s.value}'`;break}}if(n)throw new Kn(Gn.INVALID_ARGUMENT,n);return!0}const Si=-62135596800,Ci=1e6;class Ai{static now(){return Ai.fromMillis(Date.now())}static fromDate(e){return Ai.fromMillis(e.getTime())}static fromMillis(e){const t=Math.floor(e/1e3),n=Math.floor((e-1e3*t)*Ci);return new Ai(t,n)}constructor(e,t){if(this.seconds=e,this.nanoseconds=t,t<0)throw new Kn(Gn.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(t>=1e9)throw new Kn(Gn.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(e<Si)throw new Kn(Gn.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new Kn(Gn.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/Ci}_compareTo(e){return this.seconds===e.seconds?si(this.nanoseconds,e.nanoseconds):si(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{type:Ai._jsonSchemaVersion,seconds:this.seconds,nanoseconds:this.nanoseconds}}static fromJSON(e){if(Ei(e,Ai._jsonSchema))return new Ai(e.seconds,e.nanoseconds)}valueOf(){const e=this.seconds-Si;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}
1}Ai._jsonSchemaVersion="firestore/timestamp/1.0",Ai._jsonSchema={type:Ti("string",Ai._jsonSchemaVersion),seconds:Ti("number"),nanoseconds:Ti("number")};class ki{static fromTimestamp(e){return new ki(e)}static min(){return new ki(new Ai(0,0))}static max(){return new ki(new Ai(253402300799,999999999))}constructor(e){this.timestamp=e}compareTo(e){return this.timestamp._compareTo(e.timestamp)}isEqual(e){return this.timestamp.isEqual(e.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}}function Ni(e){return new Di(e.readTime,e.key,-1)}class Di{constructor(e,t,n){this.readTime=e,this.documentKey=t,this.largestBatchId=n}static min(){return new Di(ki.min(),mi.empty(),-1)}static max(){return new Di(ki.max(),mi.empty(),-1)}}function Ri(e,t){let n=e.readTime.compareTo(t.readTime);return 0!==n?n:(n=mi.comparator(e.documentKey,t.documentKey),0!==n?n:si(e.largestBatchId,t.largestBatchId))}class Pi{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(e=>e())}}async function Oi(e){if(e.code!==Gn.FAILED_PRECONDITION||"The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab."!==e.message)throw e;Vn("LocalStore","Unexpectedly lost primary lease")}class Li{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(e=>{this.isDone=!0,this.result=e,this.nextCallback&&this.nextCallback(e)},e=>{this.isDone=!0,this.error=e,this.catchCallback&&this.catchCallback(e)})}catch(e){return this.next(void 0,e)}next(e,t){return this.callbackAttached&&$n(59440),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(t,this.error):this.wrapSuccess(e,this.result):new Li((n,i)=>{this.nextCallback=t=>{this.wrapSuccess(e,t).next(n,i)},this.catchCallback=e=>{this.wrapFailure(t,e).next(n,i)}})}toPromise(){return new Promise((e,t)=>{this.next(e,t)})}wrapUserFunction(e){try{const t=e();return t instanceof Li?t:Li.resolve(t)}catch(t){return Li.reject(t)}}wrapSuccess(e,t){return e?this.wrapUserFunction(()=>e(t)):Li.resolve(t)}wrapFailure(e,t){return e?this.wrapUserFunction(()=>e(t)):Li.reject(t)}static resolve(e){return new Li((t,n)=>{t(e)})}static reject(e){return new Li((t,n)=>{n(e)})}static waitFor(e){return new Li((t,n)=>{let i=0,r=0,s=!1;e.forEach(e=>{++i,e.next(()=>{++r,s&&r===i&&t()},e=>n(e))}),s=!0,r===i&&t()})}static or(e){let t=Li.resolve(!1);for(const n of e)t=t.next(e=>e?Li.resolve(e):n());return t}static forEach(e,t){const n=[];return e.forEach((e,i)=>{n.push(t.call(this,e,i))}),this.waitFor(n)}static mapArray(e,t){return new Li((n,i)=>{const r=e.length,s=new Array(r);let o=0;for(let a=0;a<r;a++){const c=a;t(e[c]).next(e=>{s[c]=e,++o,o===r&&n(s)},e=>i(e))}})}static doWhile(e,t){return new Li((n,i)=>{const r=()=>{!0===e()?t().next(()=>{r()},i):n()};r()})}}function xi(e){return"IndexedDbTransactionError"===e.name}class Mi{constructor(e,t){this.previousValue=e,t&&(t.sequenceNumberHandler=e=>this.ae(e),this.ue=e=>t.writeSequenceNumber(e))}ae(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){const e=++this.previousValue;return this.ue&&this.ue(e),e}}Mi.ce=-1;function Ui(e){return null==e}function Vi(e){return 0===e&&1/e==-1/0}function Fi(e,t){let n=t;const i=e.length;for(let r=0;r<i;r++){const t=e.charAt(r);switch(t){case"\0":n+="��";break;case"�":n+="��";break;default:n+=t}}return n}function ji(e){return e+"��"}function Bi(e){let t=0;for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function $i(e,t){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t(n,e[n])}function zi(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}class qi{constructor(e,t){this.comparator=e,this.root=t||Gi.EMPTY}insert(e,t){return new qi(this.comparator,this.root.insert(e,t,this.comparator).copy(null,null,Gi.BLACK,null,
vendor: 4,564 bytes, line 1
1null))}remove(e){return new qi(this.comparator,this.root.remove(e,this.comparator).copy(null,null,Gi.BLACK,null,null))}get(e){let t=this.root;for(;!t.isEmpty();){const n=this.comparator(e,t.key);if(0===n)return t.value;n<0?t=t.left:n>0&&(t=t.right)}return null}indexOf(e){let t=0,n=this.root;for(;!n.isEmpty();){const i=this.comparator(e,n.key);if(0===i)return t+n.left.size;i<0?n=n.left:(t+=n.left.size+1,n=n.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal((t,n)=>(e(t,n),!1))}toString(){const e=[];return this.inorderTraversal((t,n)=>(e.push(`${t}:${n}`),!1)),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new Hi(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new Hi(this.root,e,this.comparator,!1)}getReverseIterator(){return new Hi(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new Hi(this.root,e,this.comparator,!0)}}class Hi{constructor(e,t,n,i){this.isReverse=i,this.nodeStack=[];let r=1;for(;!e.isEmpty();)if(r=t?n(e.key,t):1,t&&i&&(r*=-1),r<0)e=this.isReverse?e.left:e.right;else{if(0===r){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop();const t={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return t}hasNext(){return this.nodeStack.length>0}peek(){if(0===this.nodeStack.length)return null;const e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}class Gi{constructor(e,t,n,i,r){this.key=e,this.value=t,this.color=null!=n?n:Gi.RED,this.left=null!=i?i:Gi.EMPTY,this.right=null!=r?r:Gi.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,t,n,i,r){return new Gi(null!=e?e:this.key,null!=t?t:this.value,null!=n?n:this.color,null!=i?i:this.left,null!=r?r:this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,t,n){let i=this;const r=n(e,i.key);return i=r<0?i.copy(null,null,null,i.left.insert(e,t,n),null):0===r?i.copy(null,t,null,null,null):i.copy(null,null,null,null,i.right.insert(e,t,n)),i.fixUp()}removeMin(){if(this.left.isEmpty())return Gi.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),e=e.copy(null,null,null,e.left.removeMin(),null),e.fixUp()}remove(e,t){let n,i=this;if(t(e,i.key)<0)i.left.isEmpty()||i.left.isRed()||i.left.left.isRed()||(i=i.moveRedLeft()),i=i.copy(null,null,null,i.left.remove(e,t),null);else{if(i.left.isRed()&&(i=i.rotateRight()),i.right.isEmpty()||i.right.isRed()||i.right.left.isRed()||(i=i.moveRedRight()),0===t(e,i.key)){if(i.right.isEmpty())return Gi.EMPTY;n=i.right.min(),i=i.copy(n.key,n.value,null,null,i.right.removeMin())}i=i.copy(null,null,null,null,i.right.remove(e,t))}return i.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){const e=this.copy(null,null,Gi.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,Gi.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){const e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw $n(43730,{key:this.key,value:this.value});if(this.right.isRed())throw $n(14113,{key:this.key,value:this.value});const e=this.left.check();if(e!==this.right.check())throw $n(27949);return e+(this.isRed()?0:1)}}
1Gi.EMPTY=null,Gi.RED=!0,Gi.BLACK=!1,Gi.EMPTY=new class{constructor(){this.size=0}get key(){throw $n(57766)}get value(){throw $n(16141)}get color(){throw $n(16727)}get left(){throw $n(29726)}get right(){throw $n(36894)}copy(e,t,n,i,r){return this}insert(e,t,n){return new Gi(e,t)}remove(e,t){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};class Ki{constructor(e){this.comparator=e,this.data=new qi(this.comparator)}has(e){return null!==this.data.get(e)}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal((t,n)=>(e(t),!1))}forEachInRange(e,t){const n=this.data.getIteratorFrom(e[0]);for(;n.hasNext();){const i=n.getNext();if(this.comparator(i.key,e[1])>=0)return;t(i.key)}}forEachWhile(e,t){let n;for(n=void 0!==t?this.data.getIteratorFrom(t):this.data.getIterator();n.hasNext();)if(!e(n.getNext().key))return}firstAfterOrEqual(e){const t=this.data.getIteratorFrom(e);return t.hasNext()?t.getNext().key:null}getIterator(){return new Wi(this.data.getIterator())}getIteratorFrom(e){return new Wi(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let t=this;return t.size<e.size&&(t=e,e=this),e.forEach(e=>{t=t.add(e)}),t}isEqual(e){if(!(e instanceof Ki))return!1;if(this.size!==e.size)return!1;const t=this.data.getIterator(),n=e.data.getIterator();for(;t.hasNext();){const e=t.getNext().key,i=n.getNext().key;if(0!==this.comparator(e,i))return!1}return!0}toArray(){const e=[];return this.forEach(t=>{e.push(t)}),e}toString(){const e=[];return this.forEach(t=>e.push(t)),"SortedSet("+e.toString()+")"}copy(e){const t=new Ki(this.comparator);return t.data=e,t}}class Wi{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}class Qi{constructor(e){this.fields=e,e.sort(gi.comparator)}static empty(){return new Qi([])}unionWith(e){let t=new Ki(gi.comparator);for(const n of this.fields)t=t.add(n);for(const n of e)t=t.add(n);return new Qi(t.toArray())}covers(e){for(const t of this.fields)if(t.isPrefixOf(e))return!0;return!1}isEqual(e){return li(this.fields,e.fields,(e,t)=>e.isEqual(t))}}class Ji extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}class Xi{constructor(e){this.binaryString=e}static fromBase64String(e){const t=function(e){try{return atob(e)}catch(t){throw"undefined"!=typeof DOMException&&t instanceof DOMException?new Ji("Invalid base64 string: "+t):t}}(e);return new Xi(t)}static fromUint8Array(e){const t=function(e){let t="";for(let n=0;n<e.length;++n)t+=String.fromCharCode(e[n]);return t}(e);return new Xi(t)}[Symbol.iterator](){let e=0;return{next:()=>e<this.binaryString.length?{value:this.binaryString.charCodeAt(e++),done:!1}:{value:void 0,done:!0}}}toBase64(){return e=this.binaryString,btoa(e);var e}toUint8Array(){return function(e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(e){return si(this.binaryString,e.binaryString)}isEqual(e){return this.binaryString===e.binaryString}}Xi.EMPTY_BYTE_STRING=new Xi("");const Yi=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function Zi(e){if(qn(!!e,39018),"string"==typeof e){let t=0;const n=Yi.exec(e);if(qn(!!n,46558,{timestamp:e}),n[1]){let e=n[1];e=(e+"000000000").substr(0,9),t=Number(e)}const i=new Date(e);return{seconds:Math.floor(i.getTime()/1e3),nanos:t}}return{seconds:er(e.seconds),nanos:er(e.nanos)}}function er(e){return"number"==typeof e?e:"string"==typeof e?Number(e):0}function tr(e){return"string"==typeof e?Xi.fromBase64String(e):Xi.fromUint8Array(e)}const nr="server_timestamp",ir="__type__",rr="__previous_value__",sr="__local_write_time__";function or(e){const t=(e?.mapValue?.fields||{})[ir]?.stringValue;return t===nr}function ar(e){const t=e.mapValue.fields[rr];return or(t)?ar(t):t}function cr(e){const t=Zi(e.mapValue.fields[sr].timestampValue);return new Ai(t.seconds,t.nanos)}class hr{constructor(e,t,n,i,r,s,o,a,c,h,l){this.databaseId=e,this.appId=t,this.persistenceKey=n,this.host=i,this.ssl=r,this.forceLongPolling=s,this.autoDetectLongPolling=o,this.longPollingOptions=a,this.useFetchStreams=c,this.isUsingEmulator=h,this.apiKey=l}}const lr="(default)";class ur{constructor(e,t){this.projectId=e,this.database=t||lr}static empty(){return new ur("","")}get isDefaultDatabase(){return this.database===lr}isEqual(e){return e instanceof ur&&e.projectId===this.projectId&&e.database===this.database}}const dr="__type__",fr="__max__",pr={},gr="__vector__",mr="value";function yr(e){return"nullValue"in e?0:"booleanValue"in e?1:"integerValue"in e||"doubleValue"in e?2:"timestampValue"in e?3:"stringValue"in e?5:"bytesValue"in e?6:"referenceValue"in e?7:"geoPointValue"in e?8:"arrayValue"in e?9:"mapValue"in e?or(e)?4:function(e){return(((e.mapValue||{}).fields||{}).__type__||{}).stringValue===fr}(e)?9007199254740991:function(e){const t=(e?.mapValue?.fields||{})[dr]?.stringValue;return t===gr}(e)?10:11:$n(28295,{value:e})}function vr(e,t){if(e===t)return!0;const n=yr(e);
1if(n!==yr(t))return!1;switch(n){case 0:case 9007199254740991:return!0;case 1:return e.booleanValue===t.booleanValue;case 4:return cr(e).isEqual(cr(t));case 3:return function(e,t){if("string"==typeof e.timestampValue&&"string"==typeof t.timestampValue&&e.timestampValue.length===t.timestampValue.length)return e.timestampValue===t.timestampValue;const n=Zi(e.timestampValue),i=Zi(t.timestampValue);return n.seconds===i.seconds&&n.nanos===i.nanos}(e,t);case 5:return e.stringValue===t.stringValue;case 6:return i=t,tr(e.bytesValue).isEqual(tr(i.bytesValue));case 7:return e.referenceValue===t.referenceValue;case 8:return function(e,t){return er(e.geoPointValue.latitude)===er(t.geoPointValue.latitude)&&er(e.geoPointValue.longitude)===er(t.geoPointValue.longitude)}(e,t);case 2:return function(e,t){if("integerValue"in e&&"integerValue"in t)return er(e.integerValue)===er(t.integerValue);if("doubleValue"in e&&"doubleValue"in t){const n=er(e.doubleValue),i=er(t.doubleValue);return n===i?Vi(n)===Vi(i):isNaN(n)&&isNaN(i)}return!1}(e,t);case 9:return li(e.arrayValue.values||[],t.arrayValue.values||[],vr);case 10:case 11:return function(e,t){const n=e.mapValue.fields||{},i=t.mapValue.fields||{};if(Bi(n)!==Bi(i))return!1;for(const r in n)if(n.hasOwnProperty(r)&&(void 0===i[r]||!vr(n[r],i[r])))return!1;return!0}(e,t);default:return $n(52216,{left:e})}var i}function wr(e,t){return void 0!==(e.values||[]).find(e=>vr(e,t))}function _r(e,t){if(e===t)return 0;const n=yr(e),i=yr(t);if(n!==i)return si(n,i);switch(n){case 0:case 9007199254740991:return 0;case 1:return si(e.booleanValue,t.booleanValue);case 2:return function(e,t){const n=er(e.integerValue||e.doubleValue),i=er(t.integerValue||t.doubleValue);return n<i?-1:n>i?1:n===i?0:isNaN(n)?isNaN(i)?0:-1:1}(e,t);case 3:return br(e.timestampValue,t.timestampValue);case 4:return br(cr(e),cr(t));case 5:return oi(e.stringValue,t.stringValue);case 6:return function(e,t){const n=tr(e),i=tr(t);return n.compareTo(i)}(e.bytesValue,t.bytesValue);case 7:return function(e,t){const n=e.split("/"),i=t.split("/");for(let r=0;r<n.length&&r<i.length;r++){const e=si(n[r],i[r]);if(0!==e)return e}return si(n.length,i.length)}(e.referenceValue,t.referenceValue);case 8:return function(e,t){const n=si(er(e.latitude),er(t.latitude));return 0!==n?n:si(er(e.longitude),er(t.longitude))}(e.geoPointValue,t.geoPointValue);case 9:return Ir(e.arrayValue,t.arrayValue);case 10:return function(e,t){const n=e.fields||{},i=t.fields||{},r=n[mr]?.arrayValue,s=i[mr]?.arrayValue,o=si(r?.values?.length||0,s?.values?.length||0);return 0!==o?o:Ir(r,s)}(e.mapValue,t.mapValue);case 11:return function(e,t){if(e===pr&&t===pr)return 0;if(e===pr)return 1;if(t===pr)return-1;const n=e.fields||{},i=Object.keys(n),r=t.fields||{},s=Object.keys(r);i.sort(),s.sort();for(let o=0;o<i.length&&o<s.length;++o){const e=oi(i[o],s[o]);if(0!==e)return e;const t=_r(n[i[o]],r[s[o]]);if(0!==t)return t}return si(i.length,s.length)}(e.mapValue,t.mapValue);default:throw $n(23264,{he:n})}}function br(e,t){if("string"==typeof e&&"string"==typeof t&&e.length===t.length)return si(e,t);const n=Zi(e),i=Zi(t),r=si(n.seconds,i.seconds);return 0!==r?r:si(n.nanos,i.nanos)}function Ir(e,t){const n=e.values||[],i=t.values||[];for(let r=0;r<n.length&&r<i.length;++r){const e=_r(n[r],i[r]);if(e)return e}return si(n.length,i.length)}function Tr(e){return Er(e)}function Er(e){return"nullValue"in e?"null":"booleanValue"in e?""+e.booleanValue:"integerValue"in e?""+e.integerValue:"doubleValue"in e?""+e.doubleValue:"timestampValue"in e?function(e){const t=Zi(e);return`time(${t.seconds},${t.nanos})`}(e.timestampValue):"stringValue"in e?e.stringValue:"bytesValue"in e?tr(e.bytesValue).toBase64():"referenceValue"in e?function(e){return mi.fromName(e).toString()}(e.referenceValue):"geoPointValue"in e?function(e){return`geo(${e.latitude},${e.longitude})`}(e.geoPointValue):"arrayValue"in e?function(e){let t="[",n=!0;for(const i of e.values||[])n?n=!1:t+=",",t+=Er(i);return t+"]"}(e.arrayValue):"mapValue"in e?function(e){const t=Object.keys(e.fields||{}).sort();let n="{",i=!0;for(const r of t)i?i=!1:n+=",",n+=`${r}:${Er(e.fields[r])}`;return n+"}"}(e.mapValue):$n(61005,{value:e})}function Sr(e){switch(yr(e)){case 0:case 1:return 4;case 2:return 8;case 3:case 8:return 16;case 4:const t=ar(e);return t?16+Sr(t):16;case 5:return 2*e.stringValue.length;case 6:return tr(e.bytesValue).approximateByteSize();case 7:return e.referenceValue.length;case 9:return(e.arrayValue.values||[]).reduce((e,t)=>
vendor: 5,324 bytes, line 1
1e+Sr(t),0);case 10:case 11:return function(e){let t=0;return $i(e.fields,(e,n)=>{t+=e.length+Sr(n)}),t}(e.mapValue);default:throw $n(13486,{value:e})}}function Cr(e){return!!e&&"integerValue"in e}function Ar(e){return!!e&&"arrayValue"in e}function kr(e){return!!e&&"mapValue"in e}function Nr(e){if(e.geoPointValue)return{geoPointValue:{...e.geoPointValue}};if(e.timestampValue&&"object"==typeof e.timestampValue)return{timestampValue:{...e.timestampValue}};if(e.mapValue){const t={mapValue:{fields:{}}};return $i(e.mapValue.fields,(e,n)=>t.mapValue.fields[e]=Nr(n)),t}if(e.arrayValue){const t={arrayValue:{values:[]}};for(let n=0;n<(e.arrayValue.values||[]).length;++n)t.arrayValue.values[n]=Nr(e.arrayValue.values[n]);return t}return{...e}}class Dr{constructor(e){this.value=e}static empty(){return new Dr({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let t=this.value;for(let n=0;n<e.length-1;++n)if(t=(t.mapValue.fields||{})[e.get(n)],!kr(t))return null;return t=(t.mapValue.fields||{})[e.lastSegment()],t||null}}set(e,t){this.getFieldsMap(e.popLast())[e.lastSegment()]=Nr(t)}setAll(e){let t=gi.emptyPath(),n={},i=[];e.forEach((e,r)=>{if(!t.isImmediateParentOf(r)){const e=this.getFieldsMap(t);this.applyChanges(e,n,i),n={},i=[],t=r.popLast()}e?n[r.lastSegment()]=Nr(e):i.push(r.lastSegment())});const r=this.getFieldsMap(t);this.applyChanges(r,n,i)}delete(e){const t=this.field(e.popLast());kr(t)&&t.mapValue.fields&&delete t.mapValue.fields[e.lastSegment()]}isEqual(e){return vr(this.value,e.value)}getFieldsMap(e){let t=this.value;t.mapValue.fields||(t.mapValue={fields:{}});for(let n=0;n<e.length;++n){let i=t.mapValue.fields[e.get(n)];kr(i)&&i.mapValue.fields||(i={mapValue:{fields:{}}},t.mapValue.fields[e.get(n)]=i),t=i}return t.mapValue.fields}applyChanges(e,t,n){$i(t,(t,n)=>e[t]=n);for(const i of n)delete e[i]}clone(){return new Dr(Nr(this.value))}}function Rr(e){const t=[];return $i(e.fields,(e,n)=>{const i=new gi([e]);if(kr(n)){const e=Rr(n.mapValue).fields;if(0===e.length)t.push(i);else for(const n of e)t.push(i.child(n))}else t.push(i)}),new Qi(t)}class Pr{constructor(e,t,n,i,r,s,o){this.key=e,this.documentType=t,this.version=n,this.readTime=i,this.createTime=r,this.data=s,this.documentState=o}static newInvalidDocument(e){return new Pr(e,0,ki.min(),ki.min(),ki.min(),Dr.empty(),0)}static newFoundDocument(e,t,n,i){return new Pr(e,1,t,ki.min(),n,i,0)}static newNoDocument(e,t){return new Pr(e,2,t,ki.min(),ki.min(),Dr.empty(),0)}static newUnknownDocument(e,t){return new Pr(e,3,t,ki.min(),ki.min(),Dr.empty(),2)}convertToFoundDocument(e,t){return!this.createTime.isEqual(ki.min())||2!==this.documentType&&0!==this.documentType||(this.createTime=e),this.version=e,this.documentType=1,this.data=t,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=Dr.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=Dr.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=ki.min(),this}setReadTime(e){return this.readTime=e,this}get hasLocalMutations(){return 1===this.documentState}get hasCommittedMutations(){return 2===this.documentState}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return 0!==this.documentType}isFoundDocument(){return 1===this.documentType}isNoDocument(){return 2===this.documentType}isUnknownDocument(){return 3===this.documentType}isEqual(e){return e instanceof Pr&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.documentType===e.documentType&&this.documentState===e.documentState&&this.data.isEqual(e.data)}mutableCopy(){return new Pr(this.key,this.documentType,this.version,this.readTime,this.createTime,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {createTime: ${this.createTime}}), {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}}class Or{constructor(e,t){this.position=e,this.inclusive=t}}function Lr(e,t,n){let i=0;for(let r=0;r<e.position.length;r++){const s=t[r],o=e.position[r];if(i=s.field.isKeyField()?mi.comparator(mi.fromName(o.referenceValue),n.key):_r(o,n.data.field(s.field)),"desc"===s.dir&&(i*=-1),0!==i)break}return i}function xr(e,t){if(null===e)return null===t;if(null===t)return!1;if(e.inclusive!==t.inclusive||e.position.length!==t.position.length)return!1;for(let n=0;n<e.position.length;n++)if(!vr(e.position[n],t.position[n]))return!1;return!0}class Mr{constructor(e,t="asc"){this.field=e,this.dir=t}}function Ur(e,t){return e.dir===t.dir&&e.field.isEqual(t.field)}class Vr{}class Fr extends Vr{constructor(e,t,n){super(),this.field=e,this.op=t,this.value=n}static create(e,t,n){return e.isKeyField()?"in"===t||"not-in"===t?this.createKeyFieldInFilter(e,t,n):new Gr(e,t,n):"array-contains"===t?new Jr(e,n):"in"===t?new Xr(e,n):"not-in"===t?new Yr(e,n):"array-contains-any"===t?new Zr(e,n):new Fr(e,t,n)}static createKeyFieldInFilter(e,t,n){return"in"===t?new Kr(e,n):new Wr(e,n)}matches(e){const t=e.data.field(this.field);return"!="===this.op?null!==t&&void 0===t.nullValue&&this.matchesComparison(_r(t,this.value)):null!==t&&yr(this.value)===yr
1(t)&&this.matchesComparison(_r(t,this.value))}matchesComparison(e){switch(this.op){case"<":return e<0;case"<=":return e<=0;case"==":return 0===e;case"!=":return 0!==e;case">":return e>0;case">=":return e>=0;default:return $n(47266,{operator:this.op})}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class jr extends Vr{constructor(e,t){super(),this.filters=e,this.op=t,this.Pe=null}static create(e,t){return new jr(e,t)}matches(e){return Br(this)?void 0===this.filters.find(t=>!t.matches(e)):void 0!==this.filters.find(t=>t.matches(e))}getFlattenedFilters(){return null!==this.Pe||(this.Pe=this.filters.reduce((e,t)=>e.concat(t.getFlattenedFilters()),[])),this.Pe}getFilters(){return Object.assign([],this.filters)}}function Br(e){return"and"===e.op}function $r(e){return function(e){for(const t of e.filters)if(t instanceof jr)return!1;return!0}(e)&&Br(e)}function zr(e){if(e instanceof Fr)return e.field.canonicalString()+e.op.toString()+Tr(e.value);if($r(e))return e.filters.map(e=>zr(e)).join(",");{const t=e.filters.map(e=>zr(e)).join(",");return`${e.op}(${t})`}}function qr(e,t){return e instanceof Fr?(n=e,(i=t)instanceof Fr&&n.op===i.op&&n.field.isEqual(i.field)&&vr(n.value,i.value)):e instanceof jr?function(e,t){return t instanceof jr&&e.op===t.op&&e.filters.length===t.filters.length&&e.filters.reduce((e,n,i)=>e&&qr(n,t.filters[i]),!0)}(e,t):void $n(19439);var n,i}function Hr(e){return e instanceof Fr?`${(t=e).field.canonicalString()} ${t.op} ${Tr(t.value)}`:e instanceof jr?function(e){return e.op.toString()+" {"+e.getFilters().map(Hr).join(" ,")+"}"}(e):"Filter";var t}class Gr extends Fr{constructor(e,t,n){super(e,t,n),this.key=mi.fromName(n.referenceValue)}matches(e){const t=mi.comparator(e.key,this.key);return this.matchesComparison(t)}}class Kr extends Fr{constructor(e,t){super(e,"in",t),this.keys=Qr("in",t)}matches(e){return this.keys.some(t=>t.isEqual(e.key))}}class Wr extends Fr{constructor(e,t){super(e,"not-in",t),this.keys=Qr("not-in",t)}matches(e){return!this.keys.some(t=>t.isEqual(e.key))}}function Qr(e,t){return(t.arrayValue?.values||[]).map(e=>mi.fromName(e.referenceValue))}class Jr extends Fr{constructor(e,t){super(e,"array-contains",t)}matches(e){const t=e.data.field(this.field);return Ar(t)&&wr(t.arrayValue,this.value)}}class Xr extends Fr{constructor(e,t){super(e,"in",t)}matches(e){const t=e.data.field(this.field);return null!==t&&wr(this.value.arrayValue,t)}}class Yr extends Fr{constructor(e,t){super(e,"not-in",t)}matches(e){if(wr(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const t=e.data.field(this.field);return null!==t&&void 0===t.nullValue&&!wr(this.value.arrayValue,t)}}class Zr extends Fr{constructor(e,t){super(e,"array-contains-any",t)}matches(e){const t=e.data.field(this.field);return!(!Ar(t)||!t.arrayValue.values)&&t.arrayValue.values.some(e=>wr(this.value.arrayValue,e))}}class es{constructor(e,t=null,n=[],i=[],r=null,s=null,o=null){this.path=e,this.collectionGroup=t,this.orderBy=n,this.filters=i,this.limit=r,this.startAt=s,this.endAt=o,this.Te=null}}function ts(e,t=null,n=[],i=[],r=null,s=null,o=null){return new es(e,t,n,i,r,s,o)}function ns(e){const t=Hn(e);if(null===t.Te){let e=t.path.canonicalString();null!==t.collectionGroup&&(e+="|cg:"+t.collectionGroup),e+="|f:",e+=t.filters.map(e=>zr(e)).join(","),e+="|ob:",e+=t.orderBy.map(e=>{return(t=e).field.canonicalString()+t.dir;var t}).join(","),Ui(t.limit)||(e+="|l:",e+=t.limit),t.startAt&&(e+="|lb:",e+=t.startAt.inclusive?"b:":"a:",e+=t.startAt.position.map(e=>Tr(e)).join(",")),t.endAt&&(e+="|ub:",e+=t.endAt.inclusive?"a:":"b:",e+=t.endAt.position.map(e=>Tr(e)).join(",")),t.Te=e}return t.Te}function is(e,t){if(e.limit!==t.limit)return!1;if(e.orderBy.length!==t.orderBy.length)return!1;for(let n=0;n<e.orderBy.length;n++)if(!Ur(e.orderBy[n],t.orderBy[n]))return!1;if(e.filters.length!==t.filters.length)return!1;for(let n=0;n<e.filters.length;n++)if(!qr(e.filters[n],t.filters[n]))return!1;return e.collectionGroup===t.collectionGroup&&!!e.path.isEqual(t.path)&&!!xr(e.startAt,t.startAt)&&xr(e.endAt,t.endAt)}class rs{constructor(e,t=null,n=[],i=[],r=null,s="F",o=null,a=null){this.path=e,this.collectionGroup=t,this.explicitOrderBy=n,this.filters=i,this.limit=r,this.limitType=s,this.startAt=o,this.endAt=a,this.Ie=null,this.Ee=null,this.Re=null,this.startAt,this.endAt}}function ss(e){return 0===e.filters.length&&null===e.limit&&null==e.startAt&&null==e.endAt&&(0===e.explicitOrderBy.length||1===e.explicitOrderBy.length&&e.explicitOrderBy[0].field.isKeyField())}function os(e){const t=Hn(e);if(null===t.Ie){t.Ie=[];const e=new Set;for(const i of t.explicitOrderBy)t.Ie.push(i),e.add(i.field.canonicalString());const n=t.explicitOrderBy.length>0?t.explicitOrderBy[t.explicitOrderBy.length-1].dir:"asc";(function(e){let t=new Ki(gi.comparator);
1return e.filters.forEach(e=>{e.getFlattenedFilters().forEach(e=>{e.isInequality()&&(t=t.add(e.field))})}),t})(t).forEach(i=>{e.has(i.canonicalString())||i.isKeyField()||t.Ie.push(new Mr(i,n))}),e.has(gi.keyField().canonicalString())||t.Ie.push(new Mr(gi.keyField(),n))}return t.Ie}function as(e){const t=Hn(e);return t.Ee||(t.Ee=function(e,t){if("F"===e.limitType)return ts(e.path,e.collectionGroup,t,e.filters,e.limit,e.startAt,e.endAt);{t=t.map(e=>{const t="desc"===e.dir?"asc":"desc";return new Mr(e.field,t)});const n=e.endAt?new Or(e.endAt.position,e.endAt.inclusive):null,i=e.startAt?new Or(e.startAt.position,e.startAt.inclusive):null;return ts(e.path,e.collectionGroup,t,e.filters,e.limit,n,i)}}(t,os(e))),t.Ee}function cs(e,t,n){return new rs(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),t,n,e.startAt,e.endAt)}function hs(e,t){return is(as(e),as(t))&&e.limitType===t.limitType}function ls(e){return`${ns(as(e))}|lt:${e.limitType}`}function us(e){return`Query(target=${function(e){let t=e.path.canonicalString();return null!==e.collectionGroup&&(t+=" collectionGroup="+e.collectionGroup),e.filters.length>0&&(t+=`, filters: [${e.filters.map(e=>Hr(e)).join(", ")}]`),Ui(e.limit)||(t+=", limit: "+e.limit),e.orderBy.length>0&&(t+=`, orderBy: [${e.orderBy.map(e=>{return`${(t=e).field.canonicalString()} (${t.dir})`;var t}).join(", ")}]`),e.startAt&&(t+=", startAt: ",t+=e.startAt.inclusive?"b:":"a:",t+=e.startAt.position.map(e=>Tr(e)).join(",")),e.endAt&&(t+=", endAt: ",t+=e.endAt.inclusive?"a:":"b:",t+=e.endAt.position.map(e=>Tr(e)).join(",")),`Target(${t})`}(as(e))}; limitType=${e.limitType})`}function ds(e,t){return t.isFoundDocument()&&function(e,t){const n=t.key.path;return null!==e.collectionGroup?t.key.hasCollectionId(e.collectionGroup)&&e.path.isPrefixOf(n):mi.isDocumentKey(e.path)?e.path.isEqual(n):e.path.isImmediateParentOf(n)}(e,t)&&function(e,t){for(const n of os(e))if(!n.field.isKeyField()&&null===t.data.field(n.field))return!1;return!0}(e,t)&&function(e,t){for(const n of e.filters)if(!n.matches(t))return!1;return!0}(e,t)&&(i=t,!((n=e).startAt&&!function(e,t,n){const i=Lr(e,t,n);return e.inclusive?i<=0:i<0}(n.startAt,os(n),i)||n.endAt&&!function(e,t,n){const i=Lr(e,t,n);return e.inclusive?i>=0:i>0}(n.endAt,os(n),i)));var n,i}function fs(e,t,n){const i=e.field.isKeyField()?mi.comparator(t.key,n.key):function(e,t,n){const i=t.data.field(e),r=n.data.field(e);return null!==i&&null!==r?_r(i,r):$n(42886)}(e.field,t,n);switch(e.dir){case"asc":return i;case"desc":return-1*i;default:return $n(19790,{direction:e.dir})}}class ps{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.innerSize=0}get(e){const t=this.mapKeyFn(e),n=this.inner[t];if(void 0!==n)for(const[i,r]of n)if(this.equalsFn(i,e))return r}has(e){return void 0!==this.get(e)}set(e,t){const n=this.mapKeyFn(e),i=this.inner[n];if(void 0===i)return this.inner[n]=[[e,t]],void this.innerSize++;for(let r=0;r<i.length;r++)if(this.equalsFn(i[r][0],e))return void(i[r]=[e,t]);i.push([e,t]),this.innerSize++}delete(e){const t=this.mapKeyFn(e),n=this.inner[t];if(void 0===n)return!1;for(let i=0;i<n.length;i++)if(this.equalsFn(n[i][0],e))return 1===n.length?delete this.inner[t]:n.splice(i,1),this.innerSize--,!0;return!1}forEach(e){$i(this.inner,(t,n)=>{for(const[i,r]of n)e(i,r)})}isEmpty(){return zi(this.inner)}size(){return this.innerSize}}const gs=new qi(mi.comparator);function ms(){return gs}const ys=new qi(mi.comparator);function vs(...e){let t=ys;for(const n of e)t=t.insert(n.key,n);return t}function ws(e){let t=ys;return e.forEach((e,n)=>t=t.insert(e,n.overlayedDocument)),t}function _s(){return Is()}function bs(){return Is()}function Is(){return new ps(e=>e.toString(),(e,t)=>e.isEqual(t))}const Ts=new qi(mi.comparator),Es=new Ki(mi.comparator);function Ss(...e){let t=Es;for(const n of e)t=t.add(n);return t}const Cs=new Ki(si);function As(e,t){if(e.useProto3Json){if(isNaN(t))return{doubleValue:"NaN"};if(t===1/0)return{doubleValue:"Infinity"};if(t===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:Vi(t)?"-0":t}}function ks(e){return{integerValue:""+e}}function Ns(e,t){return function(e){return"number"==typeof e&&Number.isInteger(e)&&!Vi(e)&&e<=Number.MAX_SAFE_INTEGER&&e>=Number.MIN_SAFE_INTEGER}(t)?ks(t):As(e,t)}class Ds{constructor(){this._=void 0}}function Rs(e,t,n){return e instanceof Ls?function(e,t){const n={fields:{[ir]:{stringValue:nr},[sr]:{timestampValue:{seconds:e.seconds,nanos:e.nanoseconds}}}};return t&&or(t)&&(t=ar(t)),t&&(n.fields[rr]=t),{mapValue:n}}(n,t):e instanceof xs?Ms(e,t):e instanceof Us?Vs(e,t):function(e,t){const n=Os(e,t),i=js(n)+js(e.Ae);return Cr(n)&&Cr(e.Ae)?ks(i):As(e.serializer,i)}(e,t)}function Ps(e,t,n){return e instanceof xs?Ms(e,t):e instanceof Us?Vs(e,t):n}function Os(e,t){return e instanceof Fs?Cr(n=t)||(i=n)&&"doubleValue"in i?t:{integerValue:0}:null;var n,i}class Ls extends Ds{}class xs extends Ds{constructor(e){super(),this.elements=e}}function Ms(e,t){const n=Bs(t);for(const i of e.elements)n.some(e=>vr(e,i))||n.push(i);return{arrayValue:{values:n}}}class Us extends Ds{constructor(e){super(),this.elements=e}}function Vs(e,t){let n=Bs(t);for(const i of e.elements)n=n.filter(e=>!vr(e,i));return{arrayValue:{values:n}}}
1class Fs extends Ds{constructor(e,t){super(),this.serializer=e,this.Ae=t}}function js(e){return er(e.integerValue||e.doubleValue)}function Bs(e){return Ar(e)&&e.arrayValue.values?e.arrayValue.values.slice():[]}class $s{constructor(e,t){this.field=e,this.transform=t}}class zs{constructor(e,t){this.version=e,this.transformResults=t}}class qs{constructor(e,t){this.updateTime=e,this.exists=t}static none(){return new qs}static exists(e){return new qs(void 0,e)}static updateTime(e){return new qs(e)}get isNone(){return void 0===this.updateTime&&void 0===this.exists}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}}function Hs(e,t){return void 0!==e.updateTime?t.isFoundDocument()&&t.version.isEqual(e.updateTime):void 0===e.exists||e.exists===t.isFoundDocument()}class Gs{}function Ks(e,t){if(!e.hasLocalMutations||t&&0===t.fields.length)return null;if(null===t)return e.isNoDocument()?new io(e.key,qs.none()):new Ys(e.key,e.data,qs.none());{const n=e.data,i=Dr.empty();let r=new Ki(gi.comparator);for(let e of t.fields)if(!r.has(e)){let t=n.field(e);null===t&&e.length>1&&(e=e.popLast(),t=n.field(e)),null===t?i.delete(e):i.set(e,t),r=r.add(e)}return new Zs(e.key,i,new Qi(r.toArray()),qs.none())}}function Ws(e,t,n){var i;e instanceof Ys?function(e,t,n){const i=e.value.clone(),r=to(e.fieldTransforms,t,n.transformResults);i.setAll(r),t.convertToFoundDocument(n.version,i).setHasCommittedMutations()}(e,t,n):e instanceof Zs?function(e,t,n){if(!Hs(e.precondition,t))return void t.convertToUnknownDocument(n.version);const i=to(e.fieldTransforms,t,n.transformResults),r=t.data;r.setAll(eo(e)),r.setAll(i),t.convertToFoundDocument(n.version,r).setHasCommittedMutations()}(e,t,n):(i=n,t.convertToNoDocument(i.version).setHasCommittedMutations())}function Qs(e,t,n,i){return e instanceof Ys?function(e,t,n,i){if(!Hs(e.precondition,t))return n;const r=e.value.clone(),s=no(e.fieldTransforms,i,t);return r.setAll(s),t.convertToFoundDocument(t.version,r).setHasLocalMutations(),null}(e,t,n,i):e instanceof Zs?function(e,t,n,i){if(!Hs(e.precondition,t))return n;const r=no(e.fieldTransforms,i,t),s=t.data;return s.setAll(eo(e)),s.setAll(r),t.convertToFoundDocument(t.version,s).setHasLocalMutations(),null===n?null:n.unionWith(e.fieldMask.fields).unionWith(e.fieldTransforms.map(e=>e.field))}(e,t,n,i):(r=t,s=n,Hs(e.precondition,r)?(r.convertToNoDocument(r.version).setHasLocalMutations(),null):s);var r,s}function Js(e,t){let n=null;for(const i of e.fieldTransforms){const e=t.data.field(i.field),r=Os(i.transform,e||null);null!=r&&(null===n&&(n=Dr.empty()),n.set(i.field,r))}return n||null}function Xs(e,t){return e.type===t.type&&!!e.key.isEqual(t.key)&&!!e.precondition.isEqual(t.precondition)&&(n=e.fieldTransforms,i=t.fieldTransforms,!!(void 0===n&&void 0===i||n&&i&&li(n,i,(e,t)=>function(e,t){return e.field.isEqual(t.field)&&(n=e.transform,i=t.transform,n instanceof xs&&i instanceof xs||n instanceof Us&&i instanceof Us?li(n.elements,i.elements,vr):n instanceof Fs&&i instanceof Fs?vr(n.Ae,i.Ae):n instanceof Ls&&i instanceof Ls);var n,i}(e,t)))&&(0===e.type?e.value.isEqual(t.value):1!==e.type||e.data.isEqual(t.data)&&e.fieldMask.isEqual(t.fieldMask)));var n,i}class Ys extends Gs{constructor(e,t,n,i=[]){super(),this.key=e,this.value=t,this.precondition=n,this.fieldTransforms=i,this.type=0}getFieldMask(){return null}}class Zs extends Gs{constructor(e,t,n,i,r=[]){super(),this.key=e,this.data=t,this.fieldMask=n,this.precondition=i,this.fieldTransforms=r,this.type=1}getFieldMask(){return this.fieldMask}}function eo(e){const t=new Map;return e.fieldMask.fields.forEach(n=>{if(!n.isEmpty()){const i=e.data.field(n);t.set(n,i)}}),t}function to(e,t,n){const i=new Map;qn(e.length===n.length,32656,{Ve:n.length,de:e.length});for(let r=0;r<n.length;r++){const s=e[r],o=s.transform,a=t.data.field(s.field);i.set(s.field,Ps(o,a,n[r]))}return i}function no(e,t,n){const i=new Map;for(const r of e){const e=r.transform,s=n.data.field(r.field);i.set(r.field,Rs(e,s,t))}return i}class io extends Gs{constructor(e,t){super(),this.key=e,this.prec
1ondition=t,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}}class ro extends Gs{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}}class so{constructor(e,t,n,i){this.batchId=e,this.localWriteTime=t,this.baseMutations=n,this.mutations=i}applyToRemoteDocument(e,t){const n=t.mutationResults;for(let i=0;i<this.mutations.length;i++){const t=this.mutations[i];t.key.isEqual(e.key)&&Ws(t,e,n[i])}}applyToLocalView(e,t){for(const n of this.baseMutations)n.key.isEqual(e.key)&&(t=Qs(n,e,t,this.localWriteTime));for(const n of this.mutations)n.key.isEqual(e.key)&&(t=Qs(n,e,t,this.localWriteTime));return t}applyToLocalDocumentSet(e,t){const n=bs();return this.mutations.forEach(i=>{const r=e.get(i.key),s=r.overlayedDocument;let o=this.applyToLocalView(s,r.mutatedFields);o=t.has(i.key)?null:o;const a=Ks(s,o);null!==a&&n.set(i.key,a),s.isValidDocument()||s.convertToNoDocument(ki.min())}),n}keys(){return this.mutations.reduce((e,t)=>e.add(t.key),Ss())}isEqual(e){return this.batchId===e.batchId&&li(this.mutations,e.mutations,(e,t)=>Xs(e,t))&&li(this.baseMutations,e.baseMutations,(e,t)=>Xs(e,t))}}class oo{constructor(e,t,n,i){this.batch=e,this.commitVersion=t,this.mutationResults=n,this.docVersions=i}static from(e,t,n){qn(e.mutations.length===n.length,58842,{me:e.mutations.length,fe:n.length});let i=function(){return Ts}();const r=e.mutations;for(let s=0;s<r.length;s++)i=i.insert(r[s].key,n[s].version);return new oo(e,t,n,i)}}class ao{constructor(e,t){this.largestBatchId=e,this.mutation=t}getKey(){return this.mutation.key}isEqual(e){return null!==e&&this.mutation===e.mutation}toString(){return`Overlay{\n      largestBatchId: ${this.largestBatchId},\n      mutation: ${this.mutation.toString()}\n    }`}}var co,ho;(ho=co||(co={}))[ho.OK=0]="OK",ho[ho.CANCELLED=1]="CANCELLED",ho[ho.UNKNOWN=2]="UNKNOWN",ho[ho.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",ho[ho.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",ho[ho.NOT_FOUND=5]="NOT_FOUND",ho[ho.ALREADY_EXISTS=6]="ALREADY_EXISTS",ho[ho.PERMISSION_DENIED=7]="PERMISSION_DENIED",ho[ho.UNAUTHENTICATED=16]="UNAUTHENTICATED",ho[ho.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",ho[ho.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",ho[ho.ABORTED=10]="ABORTED",ho[ho.OUT_OF_RANGE=11]="OUT_OF_RANGE",ho[ho.UNIMPLEMENTED=12]="UNIMPLEMENTED",ho[ho.INTERNAL=13]="INTERNAL",ho[ho.UNAVAILABLE=14]="UNAVAILABLE",ho[ho.DATA_LOSS=15]="DATA_LOSS",new Tn([4294967295,4294967295],0);class lo{constructor(e,t){this.databaseId=e,this.useProto3Json=t}}function uo(e,t){return e.useProto3Json?`${new Date(1e3*t.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+t.nanoseconds).slice(-9)}Z`:{seconds:""+t.seconds,nanos:t.nanoseconds}}function fo(e,t){return e.useProto3Json?t.toBase64():t.toUint8Array()}function po(e,t){return uo(e,t.toTimestamp())}function go(e){return qn(!!e,49232),ki.fromTimestamp(function(e){const t=Zi(e);return new Ai(t.seconds,t.nanos)}(e))}function mo(e,t){return yo(e,t).canonicalString()}function yo(e,t){const n=(i=e,new fi(["projects",i.projectId,"databases",i.database])).child("documents");var i;return void 0===t?n:n.child(t)}function vo(e,t){return mo(e.databaseId,t.path)}function wo(e){const t=function(e){const t=fi.fromString(e);return qn(function(e){return e.length>=4&&"projects"===e.get(0)&&"databases"===e.get(2)}(t),10190,{key:t.toString()}),t}(e);return 4===t.length?fi.emptyPath():function(e){return qn(e.length>4&&"documents"===e.get(4),29091,{key:e.toString()}),e.popFirst(5)}(t)}function _o(e,t,n){return{name:vo(e,t),fields:n.value.mapValue.fields}}function bo(e){let t=wo(e.parent);const n=e.structuredQuery,i=n.from?n.from.length:0;let r=null;if(i>0){qn(1===i,65062);const e=n.from[0];e.allDescendants?r=e.collectionId:t=t.child(e.collectionId)}let s=[];n.where&&(s=function(e){const t=Io(e);return t instanceof jr&&$r(t)?t.getFilters():[t]}(n.where));let o=[];n.orderBy&&(o=n.orderBy.map(e=>{return new Mr(To((t=e).field),function(e){switch(e){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(t.direction));var t}));let a=null;n.limit&&(a=function(e){let t;return t="object"==typeof e?e.value:e,Ui(t)?null:t}(n.limit));let c=null;n.startAt&&(c=function(e){const t=!!e.before,n=e.values||[];return new Or(n,t)}(n.startAt));let h=null;return n.endAt&&(h=function(e){const t=!e.before,n=e.values||[];return new Or(n,t)}(n.endAt)),function(e,t,n,i,r,s,o,a){return new rs(e,t,n,i,r,s,o,a)}(t,r,o,s,a,"F",c,h)}function Io(e){return void 0!==e.unaryFilter?function(e){switch(e.unaryFilter.op){case"IS_NAN":const t=To(e.unaryFilter.field);return Fr.create(t,"==",{doubleValue:NaN});case"IS_NULL":const n=To(e.unaryFilter.field);return Fr.create(n,"==",{nullValue:"NULL_VALUE"});
1case"IS_NOT_NAN":const i=To(e.unaryFilter.field);return Fr.create(i,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const r=To(e.unaryFilter.field);return Fr.create(r,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":return $n(61313);default:return $n(60726)}}(e):void 0!==e.fieldFilter?(t=e,Fr.create(To(t.fieldFilter.field),function(e){switch(e){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";case"OPERATOR_UNSPECIFIED":return $n(58110);default:return $n(50506)}}(t.fieldFilter.op),t.fieldFilter.value)):void 0!==e.compositeFilter?function(e){return jr.create(e.compositeFilter.filters.map(e=>Io(e)),function(e){switch(e){case"AND":return"and";case"OR":return"or";default:return $n(1026)}}(e.compositeFilter.op))}(e):$n(30097,{filter:e});var t}function To(e){return gi.fromServerFormat(e.fieldPath)}function Eo(e){const t=[];return e.fields.forEach(e=>t.push(e.canonicalString())),{fieldPaths:t}}function So(e){return!!e&&"function"==typeof e._toProto&&"ProtoValue"===e._protoValueType}class Co{constructor(e){this.yt=e}}function Ao(e){const t=bo({parent:e.parent,structuredQuery:e.structuredQuery});return"LAST"===e.limitType?cs(t,t.limit,"L"):t}class ko{constructor(){this.Sn=new No}addToCollectionParentIndex(e,t){return this.Sn.add(t),Li.resolve()}getCollectionParents(e,t){return Li.resolve(this.Sn.getEntries(t))}addFieldIndex(e,t){return Li.resolve()}deleteFieldIndex(e,t){return Li.resolve()}deleteAllFieldIndexes(e){return Li.resolve()}createTargetIndexes(e,t){return Li.resolve()}getDocumentsMatchingTarget(e,t){return Li.resolve(null)}getIndexType(e,t){return Li.resolve(0)}getFieldIndexes(e,t){return Li.resolve([])}getNextCollectionGroupToUpdate(e){return Li.resolve(null)}getMinOffset(e,t){return Li.resolve(Di.min())}getMinOffsetFromCollectionGroup(e,t){return Li.resolve(Di.min())}updateCollectionGroup(e,t,n){return Li.resolve()}updateIndexEntries(e,t){return Li.resolve()}}class No{constructor(){this.index={}}add(e){const t=e.lastSegment(),n=e.popLast(),i=this.index[t]||new Ki(fi.comparator),r=!i.has(n);return this.index[t]=i.add(n),r}has(e){const t=e.lastSegment(),n=e.popLast(),i=this.index[t];return i&&i.has(n)}getEntries(e){return(this.index[e]||new Ki(fi.comparator)).toArray()}}const Do={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0},Ro=41943040;class Po{static withCacheSize(e){return new Po(e,Po.DEFAULT_COLLECTION_PERCENTILE,Po.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}constructor(e,t,n){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=t,this.maximumSequenceNumbersToCollect=n}}Po.DEFAULT_COLLECTION_PERCENTILE=10,Po.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,Po.DEFAULT=new Po(Ro,Po.DEFAULT_COLLECTION_PERCENTILE,Po.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),Po.DISABLED=new Po(-1,0,0);class Oo{constructor(e){this.sr=e}next(){return this.sr+=2,this.sr}static _r(){return new Oo(0)}static ar(){return new Oo(-1)}}const Lo="LruGarbageCollector";function xo([e,t],[n,i]){const r=si(e,n);return 0===r?si(t,i):r}class Mo{constructor(e){this.Pr=e,this.buffer=new Ki(xo),this.Tr=0}Ir(){return++this.Tr}Er(e){const t=[e,this.Ir()];if(this.buffer.size<this.Pr)this.buffer=this.buffer.add(t);else{const e=this.buffer.last();xo(t,e)<0&&(this.buffer=this.buffer.delete(e).add(t))}}get maxValue(){return this.buffer.last()[0]}}class Uo{constructor(e,t,n){this.garbageCollector=e,this.asyncQueue=t,this.localStore=n,this.Rr=null}start(){-1!==this.garbageCollector.params.cacheSizeCollectionThreshold&&this.Ar(6e4)}stop(){this.Rr&&(this.Rr.cancel(),this.Rr=null)}get started(){return null!==this.Rr}Ar(e){Vn(Lo,`Garbage collection scheduled in ${e}ms`),this.Rr=this.asyncQueue.enqueueAfterDelay("lru_garbage_collection",e,async()=>{this.Rr=null;try{await this.localStore.collectGarbage(this.garbageCollector)}catch(e){xi(e)?Vn(Lo,"Ignoring IndexedDB error during garbage collection: ",e):await Oi(e)}await this.Ar(3e5)})}}class Vo{constructor(e,t){this.Vr=e,this.params=t}calculateTargetCount(e,t){return this.Vr.dr(e).next(e=>Math.floor(t/100*e))}nthSequenceNumber(e,t){if(0===t)return Li.resolve(Mi.ce);const n=new Mo(t);return this.Vr.forEachTarget(e,e=>n.Er(e.sequenceNumber)).next(()=>this.Vr.mr(e,e=>n.Er(e))).next(()=>n.maxValue)}removeTargets(e,t,n){return this.Vr.removeTargets(e,t,n)}removeOrphanedDocuments(e,t){return this.Vr.removeOrphanedDocuments(e,t)}collect(e,t){return-1===this.params.cacheSizeCollectionThreshold?(Vn("LruGarbageCollector","Garbage collection skipped; disabled"),Li.resolve(Do)):this.getCacheSize(e).next(n=>n<this.params.cacheSizeCollectionThreshold?(Vn("LruGarbageCollector",`Garbage collection skipped; Cache size ${n} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`),Do):this.gr(e,t))}getCacheSize(e){return this.Vr.getCacheSize(e)}gr(e,t){let n,i,r,s,o,a,c;const h=Date.now();return this.calculateTargetCount(e,this.params.percentileToCollect).next(t=>(t>this.params.maximumSequenceNumbersToCollect?(Vn("LruGarbageCollector",`C
1apping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${t}`),i=this.params.maximumSequenceNumbersToCollect):i=t,s=Date.now(),this.nthSequenceNumber(e,i))).next(i=>(n=i,o=Date.now(),this.removeTargets(e,n,t))).next(t=>(r=t,a=Date.now(),this.removeOrphanedDocuments(e,n))).next(e=>(c=Date.now(),Un()<=M.DEBUG&&Vn("LruGarbageCollector",`LRU Garbage Collection\n\tCounted targets in ${s-h}ms\n\tDetermined least recently used ${i} in `+(o-s)+`ms\n\tRemoved ${r} targets in `+(a-o)+`ms\n\tRemoved ${e} documents in `+(c-a)+`ms\nTotal Duration: ${c-h}ms`),Li.resolve({didRun:!0,sequenceNumbersCollected:i,targetsRemoved:r,documentsRemoved:e})))}}class Fo{constructor(){this.changes=new ps(e=>e.toString(),(e,t)=>e.isEqual(t)),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,t){this.assertNotApplied(),this.changes.set(e,Pr.newInvalidDocument(e).setReadTime(t))}getEntry(e,t){this.assertNotApplied();const n=this.changes.get(t);return void 0!==n?Li.resolve(n):this.getFromCache(e,t)}getEntries(e,t){return this.getAllFromCache(e,t)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}}class jo{constructor(e,t){this.overlayedDocument=e,this.mutatedFields=t}}class Bo{constructor(e,t,n,i){this.remoteDocumentCache=e,this.mutationQueue=t,this.documentOverlayCache=n,this.indexManager=i}getDocument(e,t){let n=null;return this.documentOverlayCache.getOverlay(e,t).next(i=>(n=i,this.remoteDocumentCache.getEntry(e,t))).next(e=>(null!==n&&Qs(n.mutation,e,Qi.empty(),Ai.now()),e))}getDocuments(e,t){return this.remoteDocumentCache.getEntries(e,t).next(t=>this.getLocalViewOfDocuments(e,t,Ss()).next(()=>t))}getLocalViewOfDocuments(e,t,n=Ss()){const i=_s();return this.populateOverlays(e,i,t).next(()=>this.computeViews(e,t,i,n).next(e=>{let t=vs();return e.forEach((e,n)=>{t=t.insert(e,n.overlayedDocument)}),t}))}getOverlayedDocuments(e,t){const n=_s();return this.populateOverlays(e,n,t).next(()=>this.computeViews(e,t,n,Ss()))}populateOverlays(e,t,n){const i=[];return n.forEach(e=>{t.has(e)||i.push(e)}),this.documentOverlayCache.getOverlays(e,i).next(e=>{e.forEach((e,n)=>{t.set(e,n)})})}computeViews(e,t,n,i){let r=ms();const s=Is(),o=Is();return t.forEach((e,t)=>{const o=n.get(t.key);i.has(t.key)&&(void 0===o||o.mutation instanceof Zs)?r=r.insert(t.key,t):void 0!==o?(s.set(t.key,o.mutation.getFieldMask()),Qs(o.mutation,t,o.mutation.getFieldMask(),Ai.now())):s.set(t.key,Qi.empty())}),this.recalculateAndSaveOverlays(e,r).next(e=>(e.forEach((e,t)=>s.set(e,t)),t.forEach((e,t)=>o.set(e,new jo(t,s.get(e)??null))),o))}recalculateAndSaveOverlays(e,t){const n=Is();let i=new qi((e,t)=>e-t),r=Ss();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,t).next(e=>{for(const r of e)r.keys().forEach(e=>{const s=t.get(e);if(null===s)return;let o=n.get(e)||Qi.empty();o=r.applyToLocalView(s,o),n.set(e,o);const a=(i.get(r.batchId)||Ss()).add(e);i=i.insert(r.batchId,a)})}).next(()=>{const s=[],o=i.getReverseIterator();for(;o.hasNext();){const i=o.getNext(),a=i.key,c=i.value,h=bs();c.forEach(e=>{if(!r.has(e)){const i=Ks(t.get(e),n.get(e));null!==i&&h.set(e,i),r=r.add(e)}}),s.push(this.documentOverlayCache.saveOverlays(e,a,h))}return Li.waitFor(s)}).next(()=>n)}recalculateAndSaveOverlaysForDocumentKeys(e,t){return this.remoteDocumentCache.getEntries(e,t).next(t=>this.recalculateAndSaveOverlays(e,t))}getDocumentsMatchingQuery(e,t,n,i){return function(e){return mi.isDocumentKey(e.path)&&null===e.collectionGroup&&0===e.filters.length}(t)?this.getDocumentsMatchingDocumentQuery(e,t.path):function(e){return null!==e.collectionGroup}(t)?this.getDocumentsMatchingCollectionGroupQuery(e,t,n,i):this.getDocumentsMatchingCollectionQuery(e,t,n,i)}getNextDocuments(e,t,n,i){return this.remoteDocumentCache.getAllFromCollectionGroup(e,t,n,i).next(r=>{const s=i-r.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,t,n.largestBatchId,i-r.size):Li.resolve(_s());let o=-1,a=r;return s.next(t=>Li.forEach(t,(t,n)=>(o<n.largestBatchId&&(o=n.largestBatchId),r.get(t)?Li.resolve():this.remoteDocumentCache.getEntry(e,t).next(e=>{a=a.insert(t,e)}))).next(()=>this.populateOverlays(e,t,r)).next(()=>this.computeViews(e,a,t,Ss())).next(e=>({batchId:o,changes:ws(e)})))})}getDocumentsMatchingDocumentQuery(e,t){return this.getDocument(e,new mi(t)).next(e=>{let t=vs();
1return e.isFoundDocument()&&(t=t.insert(e.key,e)),t})}getDocumentsMatchingCollectionGroupQuery(e,t,n,i){const r=t.collectionGroup;let s=vs();return this.indexManager.getCollectionParents(e,r).next(o=>Li.forEach(o,o=>{const a=(c=t,h=o.child(r),new rs(h,null,c.explicitOrderBy.slice(),c.filters.slice(),c.limit,c.limitType,c.startAt,c.endAt));var c,h;return this.getDocumentsMatchingCollectionQuery(e,a,n,i).next(e=>{e.forEach((e,t)=>{s=s.insert(e,t)})})}).next(()=>s))}getDocumentsMatchingCollectionQuery(e,t,n,i){let r;return this.documentOverlayCache.getOverlaysForCollection(e,t.path,n.largestBatchId).next(s=>(r=s,this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,n,r,i))).next(e=>{r.forEach((t,n)=>{const i=n.getKey();null===e.get(i)&&(e=e.insert(i,Pr.newInvalidDocument(i)))});let n=vs();return e.forEach((e,i)=>{const s=r.get(e);void 0!==s&&Qs(s.mutation,i,Qi.empty(),Ai.now()),ds(t,i)&&(n=n.insert(e,i))}),n})}}class $o{constructor(e){this.serializer=e,this.Nr=new Map,this.Br=new Map}getBundleMetadata(e,t){return Li.resolve(this.Nr.get(t))}saveBundleMetadata(e,t){return this.Nr.set(t.id,{id:(n=t).id,version:n.version,createTime:go(n.createTime)}),Li.resolve();var n}getNamedQuery(e,t){return Li.resolve(this.Br.get(t))}saveNamedQuery(e,t){return this.Br.set(t.name,{name:(n=t).name,query:Ao(n.bundledQuery),readTime:go(n.readTime)}),Li.resolve();var n}}class zo{constructor(){this.overlays=new qi(mi.comparator),this.Lr=new Map}getOverlay(e,t){return Li.resolve(this.overlays.get(t))}getOverlays(e,t){const n=_s();return Li.forEach(t,t=>this.getOverlay(e,t).next(e=>{null!==e&&n.set(t,e)})).next(()=>n)}saveOverlays(e,t,n){return n.forEach((n,i)=>{this.bt(e,t,i)}),Li.resolve()}removeOverlaysForBatchId(e,t,n){const i=this.Lr.get(n);return void 0!==i&&(i.forEach(e=>this.overlays=this.overlays.remove(e)),this.Lr.delete(n)),Li.resolve()}getOverlaysForCollection(e,t,n){const i=_s(),r=t.length+1,s=new mi(t.child("")),o=this.overlays.getIteratorFrom(s);for(;o.hasNext();){const e=o.getNext().value,s=e.getKey();if(!t.isPrefixOf(s.path))break;s.path.length===r&&e.largestBatchId>n&&i.set(e.getKey(),e)}return Li.resolve(i)}getOverlaysForCollectionGroup(e,t,n,i){let r=new qi((e,t)=>e-t);const s=this.overlays.getIterator();for(;s.hasNext();){const e=s.getNext().value;if(e.getKey().getCollectionGroup()===t&&e.largestBatchId>n){let t=r.get(e.largestBatchId);null===t&&(t=_s(),r=r.insert(e.largestBatchId,t)),t.set(e.getKey(),e)}}const o=_s(),a=r.getIterator();for(;a.hasNext()&&(a.getNext().value.forEach((e,t)=>o.set(e,t)),!(o.size()>=i)););return Li.resolve(o)}bt(e,t,n){const i=this.overlays.get(n.key);if(null!==i){const e=this.Lr.get(i.largestBatchId).delete(n.key);this.Lr.set(i.largestBatchId,e)}this.overlays=this.overlays.insert(n.key,new ao(t,n));let r=this.Lr.get(t);void 0===r&&(r=Ss(),this.Lr.set(t,r)),this.Lr.set(t,r.add(n.key))}}class qo{constructor(){this.sessionToken=Xi.EMPTY_BYTE_STRING}getSessionToken(e){return Li.resolve(this.sessionToken)}setSessionToken(e,t){return this.sessionToken=t,Li.resolve()}}class Ho{constructor(){this.kr=new Ki(Go.Kr),this.qr=new Ki(Go.Ur)}isEmpty(){return this.kr.isEmpty()}addReference(e,t){const n=new Go(e,t);this.kr=this.kr.add(n),this.qr=this.qr.add(n)}$r(e,t){e.forEach(e=>this.addReference(e,t))}removeReference(e,t){this.Wr(new Go(e,t))}Qr(e,t){e.forEach(e=>this.removeReference(e,t))}Gr(e){const t=new mi(new fi([])),n=new Go(t,e),i=new Go(t,e+1),r=[];return this.qr.forEachInRange([n,i],e=>{this.Wr(e),r.push(e.key)}),r}zr(){this.kr.forEach(e=>this.Wr(e))}Wr(e){this.kr=this.kr.delete(e),this.qr=this.qr.delete(e)}jr(e){const t=new mi(new fi([])),n=new Go(t,e),i=new Go(t,e+1);let r=Ss();return this.qr.forEachInRange([n,i],e=>{r=r.add(e.key)}),r}containsKey(e){const t=new Go(e,0),n=this.kr.firstAfterOrEqual(t);return null!==n&&e.isEqual(n.key)}}class Go{constructor(e,t){this.key=e,this.Hr=t}static Kr(e,t){return mi.comparator(e.key,t.key)||si(e.Hr,t.Hr)}static Ur(e,t){return si(e.Hr,t.Hr)||mi.comparator(e.key,t.key)}}class Ko{constructor(e,t){this.indexManager=e,this.referenceDelegate=t,this.mutationQueue=[],this.Yn=1,this.Jr=new Ki(Go.Kr)}
1checkEmpty(e){return Li.resolve(0===this.mutationQueue.length)}addMutationBatch(e,t,n,i){const r=this.Yn;this.Yn++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const s=new so(r,t,n,i);this.mutationQueue.push(s);for(const o of i)this.Jr=this.Jr.add(new Go(o.key,r)),this.indexManager.addToCollectionParentIndex(e,o.key.path.popLast());return Li.resolve(s)}lookupMutationBatch(e,t){return Li.resolve(this.Zr(t))}getNextMutationBatchAfterBatchId(e,t){const n=t+1,i=this.Xr(n),r=i<0?0:i;return Li.resolve(this.mutationQueue.length>r?this.mutationQueue[r]:null)}getHighestUnacknowledgedBatchId(){return Li.resolve(0===this.mutationQueue.length?-1:this.Yn-1)}getAllMutationBatches(e){return Li.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,t){const n=new Go(t,0),i=new Go(t,Number.POSITIVE_INFINITY),r=[];return this.Jr.forEachInRange([n,i],e=>{const t=this.Zr(e.Hr);r.push(t)}),Li.resolve(r)}getAllMutationBatchesAffectingDocumentKeys(e,t){let n=new Ki(si);return t.forEach(e=>{const t=new Go(e,0),i=new Go(e,Number.POSITIVE_INFINITY);this.Jr.forEachInRange([t,i],e=>{n=n.add(e.Hr)})}),Li.resolve(this.Yr(n))}getAllMutationBatchesAffectingQuery(e,t){const n=t.path,i=n.length+1;let r=n;mi.isDocumentKey(r)||(r=r.child(""));const s=new Go(new mi(r),0);let o=new Ki(si);return this.Jr.forEachWhile(e=>{const t=e.key.path;return!!n.isPrefixOf(t)&&(t.length===i&&(o=o.add(e.Hr)),!0)},s),Li.resolve(this.Yr(o))}Yr(e){const t=[];return e.forEach(e=>{const n=this.Zr(e);null!==n&&t.push(n)}),t}removeMutationBatch(e,t){qn(0===this.ei(t.batchId,"removed"),55003),this.mutationQueue.shift();let n=this.Jr;return Li.forEach(t.mutations,i=>{const r=new Go(i.key,t.batchId);return n=n.delete(r),this.referenceDelegate.markPotentiallyOrphaned(e,i.key)}).next(()=>{this.Jr=n})}nr(e){}containsKey(e,t){const n=new Go(t,0),i=this.Jr.firstAfterOrEqual(n);return Li.resolve(t.isEqual(i&&i.key))}performConsistencyCheck(e){return this.mutationQueue.length,Li.resolve()}ei(e,t){return this.Xr(e)}Xr(e){return 0===this.mutationQueue.length?0:e-this.mutationQueue[0].batchId}Zr(e){const t=this.Xr(e);return t<0||t>=this.mutationQueue.length?null:this.mutationQueue[t]}}class Wo{constructor(e){this.ti=e,this.docs=new qi(mi.comparator),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,t){const n=t.key,i=this.docs.get(n),r=i?i.size:0,s=this.ti(t);return this.docs=this.docs.insert(n,{document:t.mutableCopy(),size:s}),this.size+=s-r,this.indexManager.addToCollectionParentIndex(e,n.path.popLast())}removeEntry(e){const t=this.docs.get(e);t&&(this.docs=this.docs.remove(e),this.size-=t.size)}getEntry(e,t){const n=this.docs.get(t);return Li.resolve(n?n.document.mutableCopy():Pr.newInvalidDocument(t))}getEntries(e,t){let n=ms();return t.forEach(e=>{const t=this.docs.get(e);n=n.insert(e,t?t.document.mutableCopy():Pr.newInvalidDocument(e))}),Li.resolve(n)}getDocumentsMatchingQuery(e,t,n,i){let r=ms();const s=t.path,o=new mi(s.child("__id-9223372036854775808__")),a=this.docs.getIteratorFrom(o);for(;a.hasNext();){const{key:e,value:{document:o}}=a.getNext();if(!s.isPrefixOf(e.path))break;e.path.length>
vendor: 4,076 bytes, line 1
1s.length+1||Ri(Ni(o),n)<=0||(i.has(o.key)||ds(t,o))&&(r=r.insert(o.key,o.mutableCopy()))}return Li.resolve(r)}getAllFromCollectionGroup(e,t,n,i){$n(9500)}ni(e,t){return Li.forEach(this.docs,e=>t(e))}newChangeBuffer(e){return new Qo(this)}getSize(e){return Li.resolve(this.size)}}class Qo extends Fo{constructor(e){super(),this.Mr=e}applyChanges(e){const t=[];return this.changes.forEach((n,i)=>{i.isValidDocument()?t.push(this.Mr.addEntry(e,i)):this.Mr.removeEntry(n)}),Li.waitFor(t)}getFromCache(e,t){return this.Mr.getEntry(e,t)}getAllFromCache(e,t){return this.Mr.getEntries(e,t)}}class Jo{constructor(e){this.persistence=e,this.ri=new ps(e=>ns(e),is),this.lastRemoteSnapshotVersion=ki.min(),this.highestTargetId=0,this.ii=0,this.si=new Ho,this.targetCount=0,this.oi=Oo._r()}forEachTarget(e,t){return this.ri.forEach((e,n)=>t(n)),Li.resolve()}getLastRemoteSnapshotVersion(e){return Li.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return Li.resolve(this.ii)}allocateTargetId(e){return this.highestTargetId=this.oi.next(),Li.resolve(this.highestTargetId)}setTargetsMetadata(e,t,n){return n&&(this.lastRemoteSnapshotVersion=n),t>this.ii&&(this.ii=t),Li.resolve()}lr(e){this.ri.set(e.target,e);const t=e.targetId;t>this.highestTargetId&&(this.oi=new Oo(t),this.highestTargetId=t),e.sequenceNumber>this.ii&&(this.ii=e.sequenceNumber)}addTargetData(e,t){return this.lr(t),this.targetCount+=1,Li.resolve()}updateTargetData(e,t){return this.lr(t),Li.resolve()}removeTargetData(e,t){return this.ri.delete(t.target),this.si.Gr(t.targetId),this.targetCount-=1,Li.resolve()}removeTargets(e,t,n){let i=0;const r=[];return this.ri.forEach((s,o)=>{o.sequenceNumber<=t&&null===n.get(o.targetId)&&(this.ri.delete(s),r.push(this.removeMatchingKeysForTargetId(e,o.targetId)),i++)}),Li.waitFor(r).next(()=>i)}getTargetCount(e){return Li.resolve(this.targetCount)}getTargetData(e,t){const n=this.ri.get(t)||null;return Li.resolve(n)}addMatchingKeys(e,t,n){return this.si.$r(t,n),Li.resolve()}removeMatchingKeys(e,t,n){this.si.Qr(t,n);const i=this.persistence.referenceDelegate,r=[];return i&&t.forEach(t=>{r.push(i.markPotentiallyOrphaned(e,t))}),Li.waitFor(r)}removeMatchingKeysForTargetId(e,t){return this.si.Gr(t),Li.resolve()}getMatchingKeysForTargetId(e,t){const n=this.si.jr(t);return Li.resolve(n)}containsKey(e,t){return Li.resolve(this.si.containsKey(t))}}class Xo{constructor(e,t){this._i={},this.overlays={},this.ai=new Mi(0),this.ui=!1,this.ui=!0,this.ci=new qo,this.referenceDelegate=e(this),this.li=new Jo(this),this.indexManager=new ko,this.remoteDocumentCache=new Wo(e=>this.referenceDelegate.hi(e)),this.serializer=new Co(t),this.Pi=new $o(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.ui=!1,Promise.resolve()}get started(){return this.ui}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let t=this.overlays[e.toKey()];return t||(t=new zo,this.overlays[e.toKey()]=t),t}getMutationQueue(e,t){let n=this._i[e.toKey()];return n||(n=new Ko(t,this.referenceDelegate),this._i[e.toKey()]=n),n}getGlobalsCache(){return this.ci}getTargetCache(){return this.li}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Pi}runTransaction(e,t,n){Vn("MemoryPersistence","Starting transaction:",e);const i=new Yo(this.ai.next());return this.referenceDelegate.Ti(),n(i).next(e=>this.referenceDelegate.Ii(i).next(()=>e)).toPromise().then(e=>(i.raiseOnCommittedEvent(),e))}Ei(e,t){return Li.or(Object.values(this._i).map(n=>()=>n.containsKey(e,t)))}}class Yo extends Pi{constructor(e){super(),this.currentSequenceNumber=e}}class Zo{constructor(e){this.persistence=e,this.Ri=new Ho,this.Ai=null}static Vi(e){return new Zo(e)}get di(){if(this.Ai)return this.Ai;throw $n(60996)}addReference(e,t,n){return this.Ri.addReference(n,t),this.di.delete(n.toString()),Li.resolve()}removeReference(e,t,n){return this.Ri.removeReference(n,t),this.di.add(n.toString()),Li.resolve()}markPotentiallyOrphaned(e,t){return this.di.add(t.toString()),Li.resolve()}
1removeTarget(e,t){this.Ri.Gr(t.targetId).forEach(e=>this.di.add(e.toString()));const n=this.persistence.getTargetCache();return n.getMatchingKeysForTargetId(e,t.targetId).next(e=>{e.forEach(e=>this.di.add(e.toString()))}).next(()=>n.removeTargetData(e,t))}Ti(){this.Ai=new Set}Ii(e){const t=this.persistence.getRemoteDocumentCache().newChangeBuffer();return Li.forEach(this.di,n=>{const i=mi.fromPath(n);return this.mi(e,i).next(e=>{e||t.removeEntry(i,ki.min())})}).next(()=>(this.Ai=null,t.apply(e)))}updateLimboDocument(e,t){return this.mi(e,t).next(e=>{e?this.di.delete(t.toString()):this.di.add(t.toString())})}hi(e){return 0}mi(e,t){return Li.or([()=>Li.resolve(this.Ri.containsKey(t)),()=>this.persistence.getTargetCache().containsKey(e,t),()=>this.persistence.Ei(e,t)])}}class ea{constructor(e,t){this.persistence=e,this.fi=new ps(e=>function(e){let t="";for(let n=0;n<e.length;n++)t.length>0&&(t=ji(t)),t=Fi(e.get(n),t);return ji(t)}(e.path),(e,t)=>e.isEqual(t)),this.garbageCollector=function(e,t){return new Vo(e,t)}(this,t)}static Vi(e,t){return new ea(e,t)}Ti(){}Ii(e){return Li.resolve()}forEachTarget(e,t){return this.persistence.getTargetCache().forEachTarget(e,t)}dr(e){const t=this.pr(e);return this.persistence.getTargetCache().getTargetCount(e).next(e=>t.next(t=>e+t))}pr(e){let t=0;return this.mr(e,e=>{t++}).next(()=>t)}mr(e,t){return Li.forEach(this.fi,(n,i)=>this.wr(e,n,i).next(e=>e?Li.resolve():t(i)))}removeTargets(e,t,n){return this.persistence.getTargetCache().removeTargets(e,t,n)}removeOrphanedDocuments(e,t){let n=0;const i=this.persistence.getRemoteDocumentCache(),r=i.newChangeBuffer();return i.ni(e,i=>this.wr(e,i,t).next(e=>{e||(n++,r.removeEntry(i,ki.min()))})).next(()=>r.apply(e)).next(()=>n)}markPotentiallyOrphaned(e,t){return this.fi.set(t,e.currentSequenceNumber),Li.resolve()}removeTarget(e,t){const n=t.withSequenceNumber(e.currentSequenceNumber);return this.persistence.getTargetCache().updateTargetData(e,n)}addReference(e,t,n){return this.fi.set(n,e.currentSequenceNumber),Li.resolve()}removeReference(e,t,n){return this.fi.set(n,e.currentSequenceNumber),Li.resolve()}updateLimboDocument(e,t){return this.fi.set(t,e.currentSequenceNumber),Li.resolve()}hi(e){let t=e.key.toString().length;return e.isFoundDocument()&&(t+=Sr(e.data.value)),t}wr(e,t,n){return Li.or([()=>this.persistence.Ei(e,t),()=>this.persistence.getTargetCache().containsKey(e,t),()=>{const e=this.fi.get(t);return Li.resolve(void 0!==e&&e>n)}])}getCacheSize(e){return this.persistence.getRemoteDocumentCache().getSize(e)}}class ta{constructor(e,t,n,i){this.targetId=e,this.fromCache=t,this.Ts=n,this.Is=i}static Es(e,t){let n=Ss(),i=Ss();for(const r of t.docChanges)switch(r.type){case 0:n=n.add(r.doc.key);break;case 1:i=i.add(r.doc.key)}return new ta(e,t.fromCache,n,i)}}class na{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(e){this._documentReadCount+=e}}class ia{constructor(){this.Rs=!1,this.As=!1,this.Vs=100,this.ds=w()?8:function(e){const t=e.match(/Android ([\d.]+)/i),n=t?t[1].split(".").slice(0,2).join("."):"-1";return Number(n)}(y())>0?6:4}initialize(e,t){this.fs=e,this.indexManager=t,this.Rs=!0}getDocumentsMatchingQuery(e,t,n,i){const r={result:null};return this.gs(e,t).next(e=>{r.result=e}).next(()=>{if(!r.result)return this.ps(e,t,i,n).next(e=>{r.result=e})}).next(()=>{if(r.result)return;const n=new na;return this.ys(e,t,n).next(i=>{if(r.result=i,this.As)return this.ws(e,t,n,i.size)})}).next(()=>r.result)}ws(e,t,n,i){return n.documentReadCount<this.Vs?(Un()<=M.DEBUG&&Vn("QueryEngine","SDK will not create cache indexes for query:",us(t),"since it only creates cache indexes for collection contains","more than or equal to",this.Vs,"documents"),Li.resolve()):(Un()<=M.DEBUG&&Vn("QueryEngine","Query:",us(t),"scans",n.documentReadCount,"local documents and returns",i,"documents as results."),n.documentReadCount>this.ds*i?(Un()<=M.DEBUG&&Vn("QueryEngine","The SDK decides to create cache indexes for query:",us(t),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,as(t))):Li.resolve())}gs(e,t){if(ss(t))return Li.resolve(null);let n=as(t);return this.indexManager.getIndexType(e,n).next(i=>0===i?null:(null!==t.limit&&1===i&&(t=cs(t,null,"F"),n=as(t)),this.indexManager.getDocumentsMatchingTarget(e,n).next(i=>{const r=Ss(...i);return this.fs.getDocuments(e,r).next(i=>this.indexManager.getMinOffset(e,n).next(n=>{const s=this.bs(t,i);return this.Ss(t,s,r,n.readTime)?this.gs(e,cs(t,null,"F")):this.Ds(e,s,t,n)}))})))}ps(e,t,n,i){return ss(t)||i.isEqual(ki.min())?Li.resolve(null):this.fs.getDocuments(e,n).next(r=>{const s=this.bs(t,r);return this.Ss(t,s,n,i)?Li.resolve(null):(Un()<=M.DEBUG&&Vn("QueryEngine","Re-using previous result from %s to execute query: %s",i.toString(),us(t)),this.Ds(e,s,t,function(e,t){const n=e.toTimestamp().seconds,i=e.toTimestamp().nanoseconds+1,r=ki.fromTimestamp(1e9===i?new Ai(n+1,
10):new Ai(n,i));return new Di(r,mi.empty(),t)}(i,-1)).next(e=>e))})}bs(e,t){let n=new Ki(function(e){return(t,n)=>{let i=!1;for(const r of os(e)){const e=fs(r,t,n);if(0!==e)return e;i=i||r.field.isKeyField()}return 0}}(e));return t.forEach((t,i)=>{ds(e,i)&&(n=n.add(i))}),n}Ss(e,t,n,i){if(null===e.limit)return!1;if(n.size!==t.size)return!0;const r="F"===e.limitType?t.last():t.first();return!!r&&(r.hasPendingWrites||r.version.compareTo(i)>0)}ys(e,t,n){return Un()<=M.DEBUG&&Vn("QueryEngine","Using full collection scan to execute query:",us(t)),this.fs.getDocumentsMatchingQuery(e,t,Di.min(),n)}Ds(e,t,n,i){return this.fs.getDocumentsMatchingQuery(e,n,i).next(e=>(t.forEach(t=>{e=e.insert(t.key,t)}),e))}}class ra{constructor(e,t,n,i){this.persistence=e,this.Cs=t,this.serializer=i,this.vs=new qi(si),this.Fs=new ps(e=>ns(e),is),this.Ms=new Map,this.xs=e.getRemoteDocumentCache(),this.li=e.getTargetCache(),this.Pi=e.getBundleCache(),this.Os(n)}Os(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new Bo(this.xs,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.xs.setIndexManager(this.indexManager),this.Cs.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",t=>e.collect(t,this.vs))}}async function sa(e,t){const n=Hn(e);return await n.persistence.runTransaction("Handle user change","readonly",e=>{let i;
1return n.mutationQueue.getAllMutationBatches(e).next(r=>(i=r,n.Os(t),n.mutationQueue.getAllMutationBatches(e))).next(t=>{const r=[],s=[];let o=Ss();for(const e of i){r.push(e.batchId);for(const t of e.mutations)o=o.add(t.key)}for(const e of t){s.push(e.batchId);for(const t of e.mutations)o=o.add(t.key)}return n.localDocuments.getDocuments(e,o).next(e=>({Ns:e,removedBatchIds:r,addedBatchIds:s}))})})}function oa(e,t){const n=Hn(e);return n.persistence.runTransaction("Get next mutation batch","readonly",e=>(void 0===t&&(t=-1),n.mutationQueue.getNextMutationBatchAfterBatchId(e,t)))}class aa{constructor(){this.activeTargetIds=Cs}Qs(e){this.activeTargetIds=this.activeTargetIds.add(e)}Gs(e){this.activeTargetIds=this.activeTargetIds.delete(e)}Ws(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class ca{constructor(){this.vo=new aa,this.Fo={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,t,n){}addLocalQueryTarget(e,t=!0){return t&&this.vo.Qs(e),this.Fo[e]||"not-current"}updateQueryState(e,t,n){this.Fo[e]=t}removeLocalQueryTarget(e){this.vo.Gs(e)}isLocalQueryTarget(e){return this.vo.activeTargetIds.has(e)}clearQueryState(e){delete this.Fo[e]}getAllActiveQueryTargets(){return this.vo.activeTargetIds}isActiveQueryTarget(e){return this.vo.activeTargetIds.has(e)}start(){return this.vo=new aa,Promise.resolve()}handleUserChange(e,t,n){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}class ha{Mo(e){}shutdown(){}}const la="ConnectivityMonitor";class ua{constructor(){this.xo=()=>this.Oo(),this.No=()=>this.Bo(),this.Lo=[],this.ko()}Mo(e){this.Lo.push(e)}shutdown(){window.removeEventListener("online",this.xo),window.removeEventListener("offline",this.No)}ko(){window.addEventListener("online",this.xo),window.addEventListener("offline",this.No)}Oo(){Vn(la,"Network connectivity changed: AVAILABLE");for(const e of this.Lo)e(0)}Bo(){Vn(la,"Network connectivity changed: UNAVAILABLE");for(const e of this.Lo)e(1)}static v(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener}}let da=null;function fa(){return null===da?da=268435456+Math.round(2147483648*Math.random()):da++,"0x"+da.toString(16)}const pa="RestConnection",ga={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery",ExecutePipeline:"executePipeline"};class ma{get Ko(){return!1}constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;const t=e.ssl?"https":"http",n=encodeURIComponent(this.databaseId.projectId),i=encodeURIComponent(this.databaseId.database);this.qo=t+"://"+e.host,this.Uo=`projects/${n}/databases/${i}`,this.$o=this.databaseId.database===lr?`project_id=${n}`:`project_id=${n}&database_id=${i}`}Wo(e,t,n,i,r){const s=fa(),o=this.Qo(e,t.toUriEncodedString());Vn(pa,`Sending RPC '${e}' ${s}:`,o,n);const a={"google-cloud-resource-prefix":this.Uo,"x-goog-request-params":this.$o};this.Go(a,i,r);const{host:c}=new URL(o),h=d(c);return this.zo(e,o,a,n,h).then(t=>(Vn(pa,`Received RPC '${e}' ${s}: `,t),t),t=>{throw jn(pa,`RPC '${e}' ${s} failed with error: `,t,"url: ",o,"request:",n),t})}jo(e,t,n,i,r,s){return this.Wo(e,t,n,i,r)}Go(e,t,n){e["X-Goog-Api-Client"]="gl-js/ fire/"+xn,e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),t&&t.headers.forEach((t,n)=>e[n]=t),n&&n.headers.forEach((t,n)=>e[n]=t)}Qo(e,t){const n=ga[e];let i=`${this.qo}/v1/${t}:${n}`;return this.databaseInfo.apiKey&&(i=`${i}?key=${encodeURIComponent(this.databaseInfo.apiKey)}`),i}terminate(){}}class ya{constructor(e){this.Ho=e.Ho,this.Jo=e.Jo}Zo(e){this.Xo=e}Yo(e){this.e_=e}t_(e){this.n_=e}onMessage(e){this.r_=e}close(){this.Jo()}send(e){this.Ho(e)}i_(){this.Xo()}s_(){this.e_()}o_(e){this.n_(e)}__(e){this.r_(e)}}const va="WebChannelConnection",wa=(e,t,n)=>{e.listen(t,e=>{try{n(e)}catch(t){setTimeout(()=>{throw t},0)}})};class _a extends ma{constructor(e){super(e),this.a_=[],this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}static u_(){if(!_a.c_){const e=Rn();wa(e,Dn.STAT_EVENT,e=>{e.stat===Nn.PROXY?Vn(va,"STAT_EVENT: detected buffering proxy"):e.stat===Nn.NOPROXY&&Vn(va,"STAT_EVENT: detected no buffering proxy")}),_a.c_=!0}}zo(e,t,n,i,r){const s=fa();return new Promise((r,o)=>{const a=new Sn;a.setWithCredentials(!0),a.listenOnce(An.COMPLETE,()=>{try{switch(a.getLastErrorCode()){case kn.NO_ERROR:const t=a.getResponseJson();Vn(va,`XHR for RPC '${e}' ${s} received:`,JSON.stringify(t)),r(t);break;case kn.TIMEOUT:Vn(va,`RPC '${e}' ${s} timed out`),o(new Kn(Gn.DEADLINE_EXCEEDED,"Request time out"));break;case kn.HTTP_ERROR:const n=a.getStatus();if(Vn(va,`RPC '${e}' ${s} failed with status:`,n,"response text:",a.getResponseText()),n>0){let e=a.getResponseJson();Array.isArray(e)&&(e=e[0]);const t=e?.error;if(t&&t.status&&t.message){const e=function(e){const t=e.toLowerCase().replace(/_/g,"-");return Object.values(Gn).indexOf(t)>=0?t:Gn.UNKNOWN}(t.status);o(new Kn(e,t.message))}else o(new Kn(Gn.UNKNOWN,"Server responded with status "+a.getStatus()))}else o(new Kn(Gn.UNAVAILABLE,"Connection failed."));break;default:$n(9055,{l_:e,streamId:s,h_:a.getLastErrorCode(),P_:a.getLastError()})}}finally{Vn(va,`RPC '${e}' ${s} completed.`)}});const c=JSON.stringify(i);Vn(va,`RPC '${e}' ${s} sending request:`,i),a.send(t,"POST",c,n,15)})}T_(e,t,n){const i=fa(),r=[this.qo,"/","google.firestore.v1.Firestore","/",e,"/channel"],s=this.createWebChannelTransport(),o={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`}
1,sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},a=this.longPollingOptions.timeoutSeconds;void 0!==a&&(o.longPollingTimeout=Math.round(1e3*a)),this.useFetchStreams&&(o.useFetchStreams=!0),this.Go(o.initMessageHeaders,t,n),o.encodeInitMessageHeaders=!0;const c=r.join("");Vn(va,`Creating RPC '${e}' stream ${i}: ${c}`,o);const h=s.createWebChannel(c,o);this.I_(h);let l=!1,u=!1;const d=new ya({Ho:t=>{u?Vn(va,`Not sending because RPC '${e}' stream ${i} is closed:`,t):(l||(Vn(va,`Opening RPC '${e}' stream ${i} transport.`),h.open(),l=!0),Vn(va,`RPC '${e}' stream ${i} sending:`,t),h.send(t))},Jo:()=>h.close()});return wa(h,Cn.EventType.OPEN,()=>{u||(Vn(va,`RPC '${e}' stream ${i} transport opened.`),d.i_())}),wa(h,Cn.EventType.CLOSE,()=>{u||(u=!0,Vn(va,`RPC '${e}' stream ${i} transport closed`),d.o_(),this.E_(h))}),wa(h,Cn.EventType.ERROR,t=>{u||(u=!0,jn(va,`RPC '${e}' stream ${i} transport errored. Name:`,t.name,"Message:",t.message),d.o_(new Kn(Gn.UNAVAILABLE,"The operation could not be completed")))}),wa(h,Cn.EventType.MESSAGE,t=>{if(!u){const n=t.data[0];qn(!!n,16349);const r=n,s=r?.error||r[0]?.error;if(s){Vn(va,`RPC '${e}' stream ${i} received error:`,s);const t=s.status;let n=function(e){const t=co[e];if(void 0!==t)return function(e){if(void 0===e)return Fn("GRPC error has no .code"),Gn.UNKNOWN;switch(e){case co.OK:return Gn.OK;case co.CANCELLED:return Gn.CANCELLED;case co.UNKNOWN:return Gn.UNKNOWN;case co.DEADLINE_EXCEEDED:return Gn.DEADLINE_EXCEEDED;case co.RESOURCE_EXHAUSTED:return Gn.RESOURCE_EXHAUSTED;case co.INTERNAL:return Gn.INTERNAL;case co.UNAVAILABLE:return Gn.UNAVAILABLE;case co.UNAUTHENTICATED:return Gn.UNAUTHENTICATED;case co.INVALID_ARGUMENT:return Gn.INVALID_ARGUMENT;case co.NOT_FOUND:return Gn.NOT_FOUND;case co.ALREADY_EXISTS:return Gn.ALREADY_EXISTS;case co.PERMISSION_DENIED:return Gn.PERMISSION_DENIED;case co.FAILED_PRECONDITION:return Gn.FAILED_PRECONDITION;case co.ABORTED:return Gn.ABORTED;case co.OUT_OF_RANGE:return Gn.OUT_OF_RANGE;case co.UNIMPLEMENTED:return Gn.UNIMPLEMENTED;case co.DATA_LOSS:return Gn.DATA_LOSS;default:return $n(39323,{code:e})}}(t)}(t),r=s.message;void 0===n&&(n=Gn.INTERNAL,r="Unknown error status: "+t+" with message "+s.message),u=!0,d.o_(new Kn(n,r)),h.close()}else Vn(va,`RPC '${e}' stream ${i} received:`,n),d.__(n)}}),_a.u_(),setTimeout(()=>{d.s_()},0),d}terminate(){this.a_.forEach(e=>e.close()),this.a_=[]}I_(e){this.a_.push(e)}E_(e){this.a_=this.a_.filter(t=>t===e)}Go(e,t,n){super.Go(e,t,n),this.databaseInfo.apiKey&&(e["x-goog-api-key"]=this.databaseInfo.apiKey)}createWebChannelTransport(){return Pn()}}function ba(){return"undefined"!=typeof document?document:null}function Ia(e){return new lo(e,!0)}_a.c_=!1;class Ta{constructor(e,t,n=1e3,i=1.5,r=6e4){this.Ci=e,this.timerId=t,this.R_=n,this.A_=i,this.V_=r,this.d_=0,this.m_=null,this.f_=Date.now(),this.reset()}reset(){this.d_=0}g_(){this.d_=this.V_}p_(e){this.cancel();const t=Math.floor(this.d_+this.y_()),n=Math.max(0,Date.now()-this.f_),i=Math.max(0,t-n);i>0&&Vn("ExponentialBackoff",`Backing off for ${i} ms (base delay: ${this.d_} ms, delay with jitter: ${t} ms, last attempt: ${n} ms ago)`),this.m_=this.Ci.enqueueAfterDelay(this.timerId,i,()=>(this.f_=Date.now(),e())),this.d_*=this.A_,this.d_<this.R_&&(this.d_=this.R_),this.d_>this.V_&&(this.d_=this.V_)}w_(){null!==this.m_&&(this.m_.skipDelay(),this.m_=null)}cancel(){null!==this.m_&&(this.m_.cancel(),this.m_=null)}y_(){return(Math.random()-.5)*this.d_}}const Ea="PersistentStream";class Sa{constructor(e,t,n,i,r,s,o,a){this.Ci=e,this.b_=n,this.S_=i,this.connection=r,this.authCredentialsProvider=s,this.appCheckCredentialsProvider=o,this.listener=a,this.state=0,this.D_=0,this.C_=null,this.v_=null,this.stream=null,this.F_=0,this.M_=new Ta(e,t)}x_(){return 1===this.state||5===this.state||this.O_()}O_(){return 2===this.state||3===this.state}start(){this.F_=0,4!==this.state?this.auth():this.N_()}async stop(){this.x_()&&await this.close(0)}B_(){this.state=0,this.M_.reset()}L_(){this.O_()&&null===this.C_&&(this.C_=this.Ci.enqueueAfterDelay(this.b_,6e4,()=>this.k_()))}K_(e){this.q_(),this.stream.send(e)}
1async k_(){if(this.O_())return this.close(0)}q_(){this.C_&&(this.C_.cancel(),this.C_=null)}U_(){this.v_&&(this.v_.cancel(),this.v_=null)}async close(e,t){this.q_(),this.U_(),this.M_.cancel(),this.D_++,4!==e?this.M_.reset():t&&t.code===Gn.RESOURCE_EXHAUSTED?(Fn(t.toString()),Fn("Using maximum backoff delay to prevent overloading the backend."),this.M_.g_()):t&&t.code===Gn.UNAUTHENTICATED&&3!==this.state&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),null!==this.stream&&(this.W_(),this.stream.close(),this.stream=null),this.state=e,await this.listener.t_(t)}W_(){}auth(){this.state=1;const e=this.Q_(this.D_),t=this.D_;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([e,n])=>{this.D_===t&&this.G_(e,n)},t=>{e(()=>{const e=new Kn(Gn.UNKNOWN,"Fetching auth token failed: "+t.message);return this.z_(e)})})}G_(e,t){const n=this.Q_(this.D_);this.stream=this.j_(e,t),this.stream.Zo(()=>{n(()=>this.listener.Zo())}),this.stream.Yo(()=>{n(()=>(this.state=2,this.v_=this.Ci.enqueueAfterDelay(this.S_,1e4,()=>(this.O_()&&(this.state=3),Promise.resolve())),this.listener.Yo()))}),this.stream.t_(e=>{n(()=>this.z_(e))}),this.stream.onMessage(e=>{n(()=>1==++this.F_?this.H_(e):this.onNext(e))})}N_(){this.state=5,this.M_.p_(async()=>{this.state=0,this.start()})}z_(e){return Vn(Ea,`close with error: ${e}`),this.stream=null,this.close(4,e)}Q_(e){return t=>{this.Ci.enqueueAndForget(()=>this.D_===e?t():(Vn(Ea,"stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class Ca extends Sa{constructor(e,t,n,i,r,s){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",t,n,i,s),this.serializer=r}get Y_(){return this.F_>0}start(){this.lastStreamToken=void 0,super.start()}W_(){this.Y_&&this.ea([])}j_(e,t){return this.connection.T_("Write",e,t)}H_(e){return qn(!!e.streamToken,31322),this.lastStreamToken=e.streamToken,qn(!e.writeResults||0===e.writeResults.length,55816),this.listener.ta()}onNext(e){qn(!!e.streamToken,12678),this.lastStreamToken=e.streamToken,this.M_.reset();const t=function(e,t){return e&&e.length>0?(qn(void 0!==t,14353),e.map(e=>function(e,t){let n=e.updateTime?go(e.updateTime):go(t);return n.isEqual(ki.min())&&(n=go(t)),new zs(n,e.transformResults||[])}(e,t))):[]}(e.writeResults,e.commitTime),n=go(e.commitTime);return this.listener.na(n,t)}ra(){const e={};e.database=function(e){return new fi(["projects",e.databaseId.projectId,"databases",e.databaseId.database]).canonicalString()}(this.serializer),this.K_(e)}ea(e){const t={streamToken:this.lastStreamToken,writes:e.map(e=>function(e,t){let n;if(t instanceof Ys)n={update:_o(e,t.key,t.value)};else if(t instanceof io)n={delete:vo(e,t.key)};else if(t instanceof Zs)n={update:_o(e,t.key,t.data),updateMask:Eo(t.fieldMask)};else{if(!(t instanceof ro))return $n(16599,{dt:t.type});n={verify:vo(e,t.key)}}return t.fieldTransforms.length>0&&(n.updateTransforms=t.fieldTransforms.map(e=>function(e,t){const n=t.transform;if(n instanceof Ls)return{fieldPath:t.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(n instanceof xs)return{fieldPath:t.field.canonicalString(),appendMissingElements:{values:n.elements}};if(n instanceof Us)return{fieldPath:t.field.canonicalString(),removeAllFromArray:{values:n.elements}};if(n instanceof Fs)return{fieldPath:t.field.canonicalString(),increment:n.Ae};throw $n(20930,{transform:t.transform})}(0,e))),t.precondition.isNone||(n.currentDocument=(i=e,void 0!==(r=t.precondition).updateTime?{updateTime:po(i,r.updateTime)}:void 0!==r.exists?{exists:r.exists}:$n(27497))),n;var i,r}(this.serializer,e))};this.K_(t)}}class Aa{}class ka extends Aa{constructor(e,t,n,i){super(),this.authCredentials=e,this.appCheckCredentials=t,this.connection=n,this.serializer=i,this.ia=!1}sa(){if(this.ia)throw new Kn(Gn.FAILED_PRECONDITION,"The client has already been terminated.")}Wo(e,t,n,i){return this.sa(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([r,s])=>this.connection.Wo(e,yo(t,n),i,r,s)).catch(e=>{throw"FirebaseError"===e.name?(e.code===Gn.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),e):new Kn(Gn.UNKNOWN,e.toString())})}jo(e,t,n,i,r){return this.sa(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([s,o])=>this.connection.jo(e,yo(t,n),i,s,o,r)).catch(e=>{throw"FirebaseError"===e.name?(e.code===Gn.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),e):new Kn(Gn.UNKNOWN,e.toString())})}terminate(){this.ia=!0,this.connection.terminate()}}class Na{constructor(e,t){this.asyncQueue=e,this.onlineStateHandler=t,this.state="Unknown",this.oa=0,this._a=null,this.aa=!0}ua(){0===this.oa&&(this.ca("Unknown"),this._a=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this._a=null,this.la("Backend didn't respond within 10 seconds."),this.ca("Offline"),Promise.resolve())))}ha(e){"Online"===this.state?this.ca("Unknown"):(this.oa++,this.oa>=1&&(this.Pa(),this.la(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.ca("Offline")))}set(e){this.Pa(),this.oa=0,"Online"===e&&(this.aa=!1),this.ca(e)}ca(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}la(e){const t=`Could not reach Cloud Firestore backend. ${e}\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;this.aa?(Fn(t),this.aa=!1):Vn("OnlineStateTracker",t)}Pa(){null!==this._a&&(this._a.cancel(),this._a=null)}}const Da="RemoteStore";class Ra{constructor(e,t,n,i,r){this.localStore=e,this.datastore=t,this.asyncQueue=n,this.remoteSyncer={},this.Ta=[],this.Ia=new Map,this.Ea=new Set,this.Ra=[],this.Aa=r,this.Aa.Mo(e=>{n.enqueueAndForget(async()=>
1{La(this)&&(Vn(Da,"Restarting streams for network reachability change."),await async function(e){const t=Hn(e);t.Ea.add(4),await Oa(t),t.Va.set("Unknown"),t.Ea.delete(4),await Pa(t)}(this))})}),this.Va=new Na(n,i)}}async function Pa(e){if(La(e))for(const t of e.Ra)await t(!0)}async function Oa(e){for(const t of e.Ra)await t(!1)}function La(e){return 0===Hn(e).Ea.size}async function xa(e,t,n){if(!xi(t))throw t;e.Ea.add(1),await Oa(e),e.Va.set("Offline"),n||(n=()=>function(e){const t=Hn(e);return t.persistence.runTransaction("Get last remote snapshot version","readonly",e=>t.li.getLastRemoteSnapshotVersion(e))}(e.localStore)),e.asyncQueue.enqueueRetryable(async()=>{Vn(Da,"Retrying IndexedDB access"),await n(),e.Ea.delete(1),await Pa(e)})}function Ma(e,t){return t().catch(n=>xa(e,n,t))}async function Ua(e){const t=Hn(e),n=Ka(t);let i=t.Ta.length>0?t.Ta[t.Ta.length-1].batchId:-1;for(;Va(t);)try{const e=await oa(t.localStore,i);if(null===e){0===t.Ta.length&&n.L_();break}i=e.batchId,Fa(t,e)}catch(r){await xa(t,r)}ja(t)&&Ba(t)}function Va(e){return La(e)&&e.Ta.length<10}function Fa(e,t){e.Ta.push(t);const n=Ka(e);n.O_()&&n.Y_&&n.ea(t.mutations)}function ja(e){return La(e)&&!Ka(e).x_()&&e.Ta.length>0}function Ba(e){Ka(e).start()}async function $a(e){Ka(e).ra()}async function za(e){const t=Ka(e);for(const n of e.Ta)t.ea(n.mutations)}async function qa(e,t,n){const i=e.Ta.shift(),r=oo.from(i,t,n);await Ma(e,()=>e.remoteSyncer.applySuccessfulWrite(r)),await Ua(e)}async function Ha(e,t){t&&Ka(e).Y_&&await async function(e,t){if(function(e){switch(e){case Gn.OK:return $n(64938);case Gn.CANCELLED:case Gn.UNKNOWN:case Gn.DEADLINE_EXCEEDED:case Gn.RESOURCE_EXHAUSTED:case Gn.INTERNAL:case Gn.UNAVAILABLE:case Gn.UNAUTHENTICATED:return!1;case Gn.INVALID_ARGUMENT:case Gn.NOT_FOUND:case Gn.ALREADY_EXISTS:case Gn.PERMISSION_DENIED:case Gn.FAILED_PRECONDITION:case Gn.ABORTED:case Gn.OUT_OF_RANGE:case Gn.UNIMPLEMENTED:case Gn.DATA_LOSS:return!0;default:return $n(15467,{code:e})}}(n=t.code)&&n!==Gn.ABORTED){const n=e.Ta.shift();Ka(e).B_(),await Ma(e,()=>e.remoteSyncer.rejectFailedWrite(n.batchId,t)),await Ua(e)}var n}(e,t),ja(e)&&Ba(e)}async function Ga(e,t){const n=Hn(e);n.asyncQueue.verifyOperationInProgress(),Vn(Da,"RemoteStore received new credentials");const i=La(n);n.Ea.add(3),await Oa(n),i&&n.Va.set("Unknown"),await n.remoteSyncer.handleCredentialChange(t),n.Ea.delete(3),await Pa(n)}function Ka(e){return e.fa||(e.fa=function(e,t,n){const i=Hn(e);return i.sa(),new Ca(t,i.connection,i.authCredentials,i.appCheckCredentials,i.serializer,n)}(e.datastore,e.asyncQueue,{Zo:()=>Promise.resolve(),Yo:$a.bind(null,e),t_:Ha.bind(null,e),ta:za.bind(null,e),na:qa.bind(null,e)}),e.Ra.push(async t=>{t?(e.fa.B_(),await Ua(e)):(await e.fa.stop(),e.Ta.length>0&&(Vn(Da,`Stopping write stream with ${e.Ta.length} pending writes`),e.Ta=[]))})),e.fa}class Wa{constructor(e,t,n,i,r){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=n,this.op=i,this.removalCallback=r,this.deferred=new Wn,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(e=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,t,n,i,r){const s=Date.now()+n,o=new Wa(e,t,s,i,r);return o.start(n),o}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new Kn(Gn.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>null!==this.timerHandle?(this.clearTimeout(),this.op().then(e=>this.deferred.resolve(e))):Promise.resolve())}clearTimeout(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function Qa(e,t){if(Fn("AsyncQueue",`${t}: ${e}`),xi(e))return new Kn(Gn.UNAVAILABLE,`${t}: ${e}`);throw e}class Ja{constructor(){this.queries=Xa(),this.onlineState="Unknown",this.Ca=new Set}terminate(){!function(e,t){const n=Hn(e),i=n.queries;n.queries=Xa(),i.forEach((e,n)=>{for(const i of n.ba)i.onError(t)})}(this,new Kn(Gn.ABORTED,"Firestore shutting down"))}}function Xa(){return new ps(e=>ls(e),hs)}var Ya,Za;(Za=Ya||(Ya={})).Ma="default",Za.Cache="cache";class ec{constructor(e,t,n,i,r,s){this.localStore=e,this.remoteStore=t,this.eventManager=n,this.sharedCl
1ientState=i,this.currentUser=r,this.maxConcurrentLimboResolutions=s,this.Pu={},this.Tu=new ps(e=>ls(e),hs),this.Iu=new Map,this.Eu=new Set,this.Ru=new qi(mi.comparator),this.Au=new Map,this.Vu=new Ho,this.du={},this.mu=new Map,this.fu=Oo.ar(),this.onlineState="Unknown",this.gu=void 0}get isPrimaryClient(){return!0===this.gu}}async function tc(e,t,n){const i=function(e){const t=Hn(e);return t.remoteStore.remoteSyncer.applySuccessfulWrite=ic.bind(null,t),t.remoteStore.remoteSyncer.rejectFailedWrite=rc.bind(null,t),t}(e);try{const e=await function(e,t){const n=Hn(e),i=Ai.now(),r=t.reduce((e,t)=>e.add(t.key),Ss());let s,o;return n.persistence.runTransaction("Locally write mutations","readwrite",e=>{let a=ms(),c=Ss();return n.xs.getEntries(e,r).next(e=>{a=e,a.forEach((e,t)=>{t.isValidDocument()||(c=c.add(e))})}).next(()=>n.localDocuments.getOverlayedDocuments(e,a)).next(r=>{s=r;const o=[];for(const e of t){const t=Js(e,s.get(e.key).overlayedDocument);null!=t&&o.push(new Zs(e.key,t,Rr(t.value.mapValue),qs.exists(!0)))}
1return n.mutationQueue.addMutationBatch(e,i,o,t)}).next(t=>{o=t;const i=t.applyToLocalDocumentSet(s,c);return n.documentOverlayCache.saveOverlays(e,t.batchId,i)})}).then(()=>({batchId:o.batchId,changes:ws(s)}))}(i.localStore,t);i.sharedClientState.addPendingMutation(e.batchId),function(e,t,n){let i=e.du[e.currentUser.toKey()];i||(i=new qi(si)),i=i.insert(t,n),e.du[e.currentUser.toKey()]=i}(i,e.batchId,n),await ac(i,e.changes),await Ua(i.remoteStore)}catch(r){const e=Qa(r,"Failed to persist write");n.reject(e)}}function nc(e,t,n){const i=Hn(e);if(i.isPrimaryClient&&0===n||!i.isPrimaryClient&&1===n){const e=[];i.Tu.forEach((n,i)=>{const r=i.view.va(t);r.snapshot&&e.push(r.snapshot)}),function(e,t){const n=Hn(e);n.onlineState=t;let i=!1;n.queries.forEach((e,n)=>{for(const r of n.ba)r.va(t)&&(i=!0)}),i&&function(e){e.Ca.forEach(e=>{e.next()})}(n)}(i.eventManager,t),e.length&&i.Pu.J_(e),i.onlineState=t,i.isPrimaryClient&&i.sharedClientState.setOnlineState(t)}}async function ic(e,t){const n=Hn(e),i=t.batch.batchId;try{const e=await function(e,t){const n=Hn(e);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",e=>{const i=t.batch.keys(),r=n.xs.newChangeBuffer({trackRemovals:!0});return function(e,t,n,i){const r=n.batch,s=r.keys();let o=Li.resolve();return s.forEach(e=>{o=o.next(()=>i.getEntry(t,e)).next(t=>{const s=n.docVersions.get(e);qn(null!==s,48541),t.version.compareTo(s)<0&&(r.applyToRemoteDocument(t,n),t.isValidDocument()&&(t.setReadTime(n.commitVersion),i.addEntry(t)))})}),o.next(()=>e.mutationQueue.removeMutationBatch(t,r))}(n,e,t,r).next(()=>r.apply(e)).next(()=>n.mutationQueue.performConsistencyCheck(e)).next(()=>n.documentOverlayCache.removeOverlaysForBatchId(e,i,t.batch.batchId)).next(()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(e,function(e){let t=Ss();for(let n=0;n<e.mutationResults.length;++n)e.mutationResults[n].transformResults.length>0&&(t=t.add(e.batch.mutations[n].key));return t}(t))).next(()=>n.localDocuments.getDocuments(e,i))})}(n.localStore,t);oc(n,i,null),sc(n,i),n.sharedClientState.updateMutationState(i,"acknowledged"),await ac(n,e)}catch(r){await Oi(r)}}async function rc(e,t,n){const i=Hn(e);try{const e=await function(e,t){const n=Hn(e);return n.persistence.runTransaction("Reject batch","readwrite-primary",e=>{let i;
1return n.mutationQueue.lookupMutationBatch(e,t).next(t=>(qn(null!==t,37113),i=t.keys(),n.mutationQueue.removeMutationBatch(e,t))).next(()=>n.mutationQueue.performConsistencyCheck(e)).next(()=>n.documentOverlayCache.removeOverlaysForBatchId(e,i,t)).next(()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(e,i)).next(()=>n.localDocuments.getDocuments(e,i))})}(i.localStore,t);oc(i,t,n),sc(i,t),i.sharedClientState.updateMutationState(t,"rejected",n),await ac(i,e)}catch(r){await Oi(r)}}function sc(e,t){(e.mu.get(t)||[]).forEach(e=>{e.resolve()}),e.mu.delete(t)}function oc(e,t,n){const i=Hn(e);let r=i.du[i.currentUser.toKey()];if(r){const e=r.get(t);e&&(n?e.reject(n):e.resolve(),r=r.remove(t)),i.du[i.currentUser.toKey()]=r}}async function ac(e,t,n){const i=Hn(e),r=[],s=[],o=[];i.Tu.isEmpty()||(i.Tu.forEach((e,a)=>{o.push(i.pu(a,t,n).then(e=>{if((e||n)&&i.isPrimaryClient){const t=e?!e.fromCache:n?.targetChanges.get(a.targetId)?.current;i.sharedClientState.updateQueryState(a.targetId,t?"current":"not-current")}if(e){r.push(e);const t=ta.Es(a.targetId,e);s.push(t)}}))}),await Promise.all(o),i.Pu.J_(r),await async function(e,t){const n=Hn(e);try{await n.persistence.runTransaction("notifyLocalViewChanges","readwrite",e=>Li.forEach(t,t=>Li.forEach(t.Ts,i=>n.persistence.referenceDelegate.addReference(e,t.targetId,i)).next(()=>Li.forEach(t.Is,i=>n.persistence.referenceDelegate.removeReference(e,t.targetId,i)))))}catch(i){if(!xi(i))throw i;Vn("LocalStore","Failed to update sequence numbers: "+i)}for(const r of t){const e=r.targetId;if(!r.fromCache){const t=n.vs.get(e),i=t.snapshotVersion,r=t.withLastLimboFreeSnapshotVersion(i);n.vs=n.vs.insert(e,r)}}}(i.localStore,s))}async function cc(e,t){const n=Hn(e);if(!n.currentUser.isEqual(t)){Vn("SyncEngine","User change. New user:",t.toKey());const e=await sa(n.localStore,t);n.currentUser=t,r="'waitForPendingWrites' promise is rejected due to a user change.",(i=n).mu.forEach(e=>{e.forEach(e=>{e.reject(new Kn(Gn.CANCELLED,r))})}),i.mu.clear(),n.sharedClientState.handleUserChange(t,e.removedBatchIds,e.addedBatchIds),await ac(n,e.Ns)}var i,r}class hc{constructor(){this.kind="memory",this.synchronizeTabs=!1}async initialize(e){this.serializer=Ia(e.databaseInfo.databaseId),this.sharedClientState=this.Du(e),this.persistence=this.Cu(e),await this.persistence.start(),this.localStore=this.vu(e),this.gcScheduler=this.Fu(e,this.localStore),this.indexBackfillerScheduler=this.Mu(e,this.localStore)}Fu(e,t){return null}Mu(e,t){return null}vu(e){return function(e,t,n,i){return new ra(e,t,n,i)}(this.persistence,new ia,e.initialUser,this.serializer)}Cu(e){return new Xo(Zo.Vi,this.serializer)}Du(e){return new ca}async terminate(){this.gcScheduler?.stop(),this.indexBackfillerScheduler?.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}hc.provider={build:()=>new hc};class lc extends hc{constructor(e){super(),this.cacheSizeBytes=e}Fu(e,t){qn(this.persistence.referenceDelegate instanceof ea,46915);const n=this.persistence.referenceDelegate.garbageCollector;return new Uo(n,e.asyncQueue,t)}Cu(e){const t=void 0!==this.cacheSizeBytes?Po.withCacheSize(this.cacheSizeBytes):Po.DEFAULT;return new Xo(e=>ea.Vi(e,t),this.serializer)}}class uc{async initialize(e,t){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(t),this.remoteStore=this.createRemoteStore(t),this.eventManager=this.createEventManager(t),this.syncEngine=this.createSyncEngine(t,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=e=>nc(this.syncEngine,e,1),this.remoteStore.remoteSyncer.handleCredentialChange=cc.bind(null,this.syncEngine),await async function(e,t){const n=Hn(e);t?(n.Ea.delete(2),await Pa(n)):t||(n.Ea.add(2),await Oa(n),n.Va.set("Unknown"))}(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return new Ja}createDatastore(e){const t=Ia(e.databaseInfo.databaseId),n=function(e){return new _a(e)}(e.databaseInfo);return function(e,t,n,i){return new ka(e,t,n,i)}(e.authCredentials,e.appCheckCredentials,n,t)}createRemoteStore(e){return t=this.localStore,n=this.datastore,i=e.asyncQueue,r=e=>nc(this.syncEngine,e,0),s=ua.v()?new ua:new ha,new Ra(t,n,i,r,s);var t,n,i,r,s}createSyncEngine(e,t){return function(e,t,n,i,r,s,o){const a=new ec(e,t,n,i,r,s);return o&&(a.gu=!0),a}(this.localStore,this.remoteStore,this.eventManager,this.sharedCl
1ientState,e.initialUser,e.maxConcurrentLimboResolutions,t)}async terminate(){await async function(e){const t=Hn(e);Vn(Da,"RemoteStore shutting down."),t.Ea.add(5),await Oa(t),t.Aa.shutdown(),t.Va.set("Unknown")}(this.remoteStore),this.datastore?.terminate(),this.eventManager?.terminate()}}uc.provider={build:()=>new uc};const dc="FirestoreClient";class fc{constructor(e,t,n,i,r){this.authCredentials=e,this.appCheckCredentials=t,this.asyncQueue=n,this._databaseInfo=i,this.user=Ln.UNAUTHENTICATED,this.clientId=ri.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=r,this.authCredentials.start(n,async e=>{Vn(dc,"Received user=",e.uid),await this.authCredentialListener(e),this.user=e}),this.appCheckCredentials.start(n,e=>(Vn(dc,"Received new app check token=",e),this.appCheckCredentialListener(e,this.user)))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this._databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}terminate(){this.asyncQueue.enterRestrictedMode();const e=new Wn;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(t){const n=Qa(t,"Failed to shutdown persistence");e.reject(n)}}),e.promise}}async function pc(e,t){e.asyncQueue.verifyOperationInProgress(),Vn(dc,"Initializing OfflineComponentProvider");const n=e.configuration;await t.initialize(n);let i=n.initialUser;e.setCredentialChangeListener(async e=>{i.isEqual(e)||(await sa(t.localStore,e),i=e)}),t.persistence.setDatabaseDeletedListener(()=>e.terminate()),e._offlineComponents=t}async function gc(e,t){e.asyncQueue.verifyOperationInProgress();const n=await async function(e){if(!e._offlineComponents)if(e._uninitializedComponentsProvider){Vn(dc,"Using user provided OfflineComponentProvider");try{await pc(e,e._uninitializedComponentsProvider._offline)}catch(t){const r=t;if(!("FirebaseError"===(n=r).name?n.code===Gn.FAILED_PRECONDITION||n.code===Gn.UNIMPLEMENTED:!("undefined"!=typeof DOMException&&n instanceof DOMException)||22===n.code||20===n.code||11===n.code))throw r;jn("Error using user provided cache. Falling back to memory cache: "+r),await pc(e,new hc)}}else Vn(dc,"Using default OfflineComponentProvider"),await pc(e,new lc(void 0));var n;return e._offlineComponents}(e);Vn(dc,"Initializing OnlineComponentProvider"),await t.initialize(n,e.configuration),e.setCredentialChangeListener(e=>Ga(t.remoteStore,e)),e.setAppCheckTokenChangeListener((e,n)=>Ga(t.remoteStore,n)),e._onlineComponents=t}function mc(e){return async function(e){return e._onlineComponents||(e._uninitializedComponentsProvider?(Vn(dc,"Using user provided OnlineComponentProvider"),await gc(e,e._uninitializedComponentsProvider._online)):(Vn(dc,"Using default OnlineComponentProvider"),await gc(e,new uc))),e._onlineComponents}(e).then(e=>e.syncEngine)}function yc(e){const t={};return void 0!==e.timeoutSeconds&&(t.timeoutSeconds=e.timeoutSeconds),t}const vc=new Map;const wc="firestore.googleapis.com",_c=!0;class bc{constructor(e){if(void 0===e.host){if(void 0!==e.ssl)throw new Kn(Gn.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host=wc,this.ssl=_c}else this.host=e.host,this.ssl=e.ssl??_c;if(this.isUsingEmulator=void 0!==e.emulatorOptions,this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,void 0===e.cacheSizeBytes)this.cacheSizeBytes=Ro;else{if(-1!==e.cacheSizeBytes&&e.cacheSizeBytes<1048576)throw new Kn(Gn.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}(function(e,t,n,i){if(!0===t&&!0===i)throw new Kn(Gn.INVALID_ARGUMENT,`${e} and ${n} cannot be used together.`)})("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:void 0===e.experimentalAutoDetectLongPolling?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=yc(e.experimentalLongPollingOptions??{}),function(e){if(void 0!==e.timeoutSeconds){if(isNaN(e.timeoutSeconds))throw new Kn(Gn.INVALID_ARGUMENT,`invalid long polling timeout: ${e.timeoutSeconds} (must not be NaN)`);if(e.timeoutSeconds<5)throw new Kn(Gn.INVALID_ARGUMENT,`invalid long polling timeout: ${e.timeoutSeconds} (minimum allowed value is 5)`);if(e.timeoutSeconds>30)throw new Kn(Gn.INVALID_ARGUMENT,`invalid long polling timeout: ${e.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&(t=this.experimentalLongPollingOptions,n=e.experimentalLongPollingOptions,t.timeoutSeconds===n.timeoutSeconds)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams;var t,n}}class Ic{constructor(e,t,n,i){this._authCredentials=e,this._appCheckCredentials=t,this._databaseId=n,this._app=i,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new bc({}),this._settingsFrozen=!1,this._emulatorOptions={},this._terminateTask="notTerminated"}get app(){if(!this._app)throw new Kn(Gn.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return"notTerminated"!==this._terminateTask}_setSettings(e){if(this._settingsFrozen)throw new Kn(Gn.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new bc(e),this._emulatorOptions=e.emulatorOptions||{},void 0!==e.credentials&&(this._authCredentials=function(e){if(!e)return new Jn;switch(e.type){case"firstParty":return new ei(e.sessionIndex||"0",e.iamToken||null,e.authTokenFactory||null);case"provider":return e.client;default:throw new Kn(Gn.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invali
1d credential type")}}(e.credentials))}_getSettings(){return this._settings}_getEmulatorOptions(){return this._emulatorOptions}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return"notTerminated"===this._terminateTask&&(this._terminateTask=this._terminate()),this._terminateTask}async _restart(){"notTerminated"===this._terminateTask?await this._terminate():this._terminateTask="notTerminated"}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(e){const t=vc.get(e);t&&(Vn("ComponentProvider","Removing Datastore"),vc.delete(e),t.terminate())}(this),Promise.resolve()}}function Tc(e,t,n,i={}){e=Ii(e,Ic);const s=d(t),o=e._getSettings(),a={...o,emulatorOptions:e._getEmulatorOptions()},c=`${t}:${n}`;s&&(f(`https://${c}`),m("Firestore",!0)),o.host!==wc&&o.host!==c&&jn("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used.");const h={...o,host:c,ssl:s,emulatorOptions:i};if(!S(h,a)&&(e._setSettings(h),i.mockUserToken)){let t,n;if("string"==typeof i.mockUserToken)t=i.mockUserToken,n=Ln.MOCK_USER;else{t=function(e,t){if(e.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n=t||"demo-project",i=e.iat||0,s=e.sub||e.user_id;if(!s)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const o={iss:`https://securetoken.google.com/${n}`,aud:n,iat:i,exp:i+3600,auth_time:i,sub:s,user_id:s,firebase:{sign_in_provider:"custom",identities:{}},...e};return[r(JSON.stringify({alg:"none",type:"JWT"})),r(JSON.stringify(o)),""].join(".")}(i.mockUserToken,e._app?.options.projectId);const s=i.mockUserToken.sub||i.mockUserToken.user_id;if(!s)throw new Kn(Gn.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");n=new Ln(s)}e._authCredentials=new Xn(new Qn(t,n))}}class Ec{constructor(e,t,n){this.converter=t,this._query=n,this.type="query",this.firestore=e}withConverter(e){return new Ec(this.firestore,e,this._query)}}class Sc{constructor(e,t,n){this.converter=t,this._key=n,this.type="document",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new Cc(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new Sc(this.firestore,e,this._key)}toJSON(){return{type:Sc._jsonSchemaVersion,referencePath:this._key.toString()}}static fromJSON(e,t,n){if(Ei(t,Sc._jsonSchema))return new Sc(e,n||null,new mi(fi.fromString(t.referencePath)))}}Sc._jsonSchemaVersion="firestore/documentReference/1.0",Sc._jsonSchema={type:Ti("string",Sc._jsonSchemaVersion),referencePath:Ti("string")};class Cc extends Ec{constructor(e,t,n){super(e,t,function(e){return new rs(e)}(n)),this._path=n,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const e=this._path.popLast();return e.isEmpty()?null:new Sc(this.firestore,null,new mi(e))}withConverter(e){return new Cc(this.firestore,e,this._path)}}function Ac(e,t,...n){if(e=R(e),yi("collection","path",t),e instanceof Ic){const i=fi.fromString(t,...n);return wi(i),new Cc(e,null,i)}{if(!(e instanceof Sc||e instanceof Cc))throw new Kn(Gn.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const i=e._path.child(fi.fromString(t,...n));return wi(i),new Cc(e.firestore,null,i)}}const kc="AsyncQueue";class Nc{constructor(e=Promise.resolve()){this.Yu=[],this.ec=!1,this.tc=[],this.nc=null,this.rc=!1,this.sc=!1,this.oc=[],this.M_=new Ta(this,"async_queue_retry"),this._c=()=>{const e=ba();e&&Vn(kc,"Visibility state changed to "+e.visibilityState),this.M_.w_()},this.ac=e;const t=ba();t&&"function"==typeof t.addEventListener&&t.addEventListener("visibilitychange",this._c)}get isShuttingDown(){return this.ec}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.uc(),this.cc(e)}enterRestrictedMode(e){if(!this.ec){this.ec=!0,this.sc=e||!1;const t=ba();t&&"function"==typeof t.removeEventListener&&t.removeEventListener("visibilitychange",this._c)}}enqueue(e){if(this.uc(),this.ec)return new Promise(()=>{});const t=new Wn;return this.cc(()=>this.ec&&this.sc?Promise.resolve():(e().then(t.resolve,t.reject),t.promise)).then(()=>t.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.Yu.push(e),this.lc()))}async lc(){if(0!==this.Yu.length){try{await this.Yu[0](),this.Yu.shift(),this.M_.reset()}catch(e){if(!xi(e))throw e;Vn(kc,"Operation failed with retryable error: "+e)}this.Yu.length>0&&this.M_.p_(()=>this.lc())}}cc(e){const t=this.ac.then(()=>(this.rc=!0,e().catch(e=>{throw this.nc=e,this.rc=!1,Fn("INTERNAL UNHANDLED ERROR: ",Dc(e)),e}).then(e=>(this.rc=!1,e))));return this.ac=t,t}enqueueAfterDelay(e,t,n){this.uc(),this.oc.indexOf(e)>-1&&(t=0);const i=Wa.createAndSchedule(this,e,t,n,e=>this.hc(e));return this.tc.push(i),i}uc(){this.nc&&$n(47125,{Pc:Dc(this.nc)})}verifyOperationInProgress(){}async Tc(){let e;do{e=this.ac,await e}while(e!==this.ac)}Ic(e){for(const t of this.tc)if(t.timerId===e)return!0;return!1}Ec(e){return this.Tc().then(()=>{this.tc.sort((e,t)=>
1e.targetTimeMs-t.targetTimeMs);for(const t of this.tc)if(t.skipDelay(),"all"!==e&&t.timerId===e)break;return this.Tc()})}Rc(e){this.oc.push(e)}hc(e){const t=this.tc.indexOf(e);this.tc.splice(t,1)}}function Dc(e){let t=e.message||"";return e.stack&&(t=e.stack.includes(e.message)?e.stack:e.message+"\n"+e.stack),t}class Rc extends Ic{constructor(e,t,n,i){super(e,t,n,i),this.type="firestore",this._queue=new Nc,this._persistenceKey=i?.name||"[DEFAULT]"}async _terminate(){if(this._firestoreClient){const e=this._firestoreClient.terminate();this._queue=new Nc(e),this._firestoreClient=void 0,await e}}}function Pc(e,t){const n="object"==typeof e?e:Qe(),i="string"==typeof e?e:lr,r=ze(n,"firestore").getImmediate({identifier:i});if(!r._initialized){const e=(e=>{const t=c(e);if(!t)return;const n=t.lastIndexOf(":");if(n<=0||n+1===t.length)throw new Error(`Invalid host ${t} with no separate hostname and port!`);const i=parseInt(t.substring(n+1),10);return"["===t[0]?[t.substring(1,n-1),i]:[t.substring(0,n),i]})("firestore");e&&Tc(r,...e)}return r}function Oc(e){if(e._terminated)throw new Kn(Gn.FAILED_PRECONDITION,"The client has already been terminated.");return e._firestoreClient||function(e){const t=e._freezeSettings(),n=function(e,t,n,i,r){return new hr(e,t,n,r.host,r.ssl,r.experimentalForceLongPolling,r.experimentalAutoDetectLongPolling,yc(r.experimentalLongPollingOptions),r.useFetchStreams,r.isUsingEmulator,i)}(e._databaseId,e._app?.options.appId||"",e._persistenceKey,e._app?.options.apiKey,t);e._componentsProvider||t.localCache?._offlineComponentProvider&&t.localCache?._onlineComponentProvider&&(e._componentsProvider={_offline:t.localCache._offlineComponentProvider,_online:t.localCache._onlineComponentProvider}),e._firestoreClient=new fc(e._authCredentials,e._appCheckCredentials,e._queue,n,e._componentsProvider&&function(e){const t=e?._online.build();return{_offline:e?._offline.build(t),_online:t}}(e._componentsProvider))}(e),e._firestoreClient}class Lc{constructor(e){this._byteString=e}static fromBase64String(e){try{return new Lc(Xi.fromBase64String(e))}catch(t){throw new Kn(Gn.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+t)}}static fromUint8Array(e){return new Lc(Xi.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}toJSON(){return{type:Lc._jsonSchemaVersion,bytes:this.toBase64()}}static fromJSON(e){if(Ei(e,Lc._jsonSchema))return Lc.fromBase64String(e.bytes)}}Lc._jsonSchemaVersion="firestore/bytes/1.0",Lc._jsonSchema={type:Ti("string",Lc._jsonSchemaVersion),bytes:Ti("string")};class xc{constructor(...e){for(let t=0;t<e.length;++t)if(0===e[t].length)throw new Kn(Gn.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new gi(e)}isEqual(e){return this._internalPath.isEqual(e._internalPath)}}class Mc{constructor(e){this._methodName=e}}class Uc{constructor(e,t){if(!isFinite(e)||e<-90||e>90)throw new Kn(Gn.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new Kn(Gn.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+t);this._lat=e,this._long=t}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}_compareTo(e){return si(this._lat,e._lat)||si(this._long,e._long)}toJSON(){return{latitude:this._lat,longitude:this._long,type:Uc._jsonSchemaVersion}}static fromJSON(e){if(Ei(e,Uc._jsonSchema))return new Uc(e.latitude,e.longitude)}}Uc._jsonSchemaVersion="firestore/geoPoint/1.0",Uc._jsonSchema={type:Ti("string",Uc._jsonSchemaVersion),latitude:Ti("number"),longitude:Ti("number")};class Vc{constructor(e){this._values=(e||[]).map(e=>e)}toArray(){return this._values.map(e=>e)}isEqual(e){return function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(e[n]!==t[n])return!1;return!0}(this._values,e._values)}toJSON(){return{type:Vc._jsonSchemaVersion,vectorValues:this._values}}
1static fromJSON(e){if(Ei(e,Vc._jsonSchema)){if(Array.isArray(e.vectorValues)&&e.vectorValues.every(e=>"number"==typeof e))return new Vc(e.vectorValues);throw new Kn(Gn.INVALID_ARGUMENT,"Expected 'vectorValues' field to be a number array")}}}Vc._jsonSchemaVersion="firestore/vectorValue/1.0",Vc._jsonSchema={type:Ti("string",Vc._jsonSchemaVersion),vectorValues:Ti("object")};const Fc=/^__.*__$/;class jc{constructor(e,t,n){this.data=e,this.fieldMask=t,this.fieldTransforms=n}toMutation(e,t){return null!==this.fieldMask?new Zs(e,this.data,this.fieldMask,t,this.fieldTransforms):new Ys(e,this.data,t,this.fieldTransforms)}}function Bc(e){switch(e){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw $n(40011,{dataSource:e})}}class $c{constructor(e,t,n,i,r,s){this.settings=e,this.databaseId=t,this.serializer=n,this.ignoreUndefinedProperties=i,void 0===r&&this.validatePath(),this.fieldTransforms=r||[],this.fieldMask=s||[]}get path(){return this.settings.path}get dataSource(){return this.settings.dataSource}contextWith(e){return new $c({...this.settings,...e},this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}childContextForField(e){const t=this.path?.child(e),n=this.contextWith({path:t,arrayElement:!1});return n.validatePathSegment(e),n}childContextForFieldPath(e){const t=this.path?.child(e),n=this.contextWith({path:t,arrayElement:!1});return n.validatePath(),n}childContextForArray(e){return this.contextWith({path:void 0,arrayElement:!0})}createError(e){return Yc(e,this.settings.methodName,this.settings.hasConverter||!1,this.path,this.settings.targetDoc)}contains(e){return void 0!==this.fieldMask.find(t=>e.isPrefixOf(t))||void 0!==this.fieldTransforms.find(t=>e.isPrefixOf(t.field))}validatePath(){if(this.path)for(let e=0;e<this.path.length;e++)this.validatePathSegment(this.path.get(e))}validatePathSegment(e){if(0===e.length)throw this.createError("Document fields must not be empty");if(Bc(this.dataSource)&&Fc.test(e))throw this.createError('Document fields cannot begin and end with "__"')}}class zc{constructor(e,t,n){this.databaseId=e,this.ignoreUndefinedProperties=t,this.serializer=n||Ia(e)}createContext(e,t,n,i=!1){return new $c({dataSource:e,methodName:t,targetDoc:n,path:gi.emptyPath(),arrayElement:!1,hasConverter:i},this.databaseId,this.serializer,this.ignoreUndefinedProperties)}}function qc(e,t,n,i,r,s={}){const o=e.createContext(s.merge||s.mergeFields?2:0,t,n,r);Qc("Data must be an object, but it was:",o,i);const a=Kc(i,o);let c,h;if(s.merge)c=new Qi(o.fieldMask),h=o.fieldTransforms;else if(s.mergeFields){const e=[];for(const i of s.mergeFields){const r=Jc(t,i,n);if(!o.contains(r))throw new Kn(Gn.INVALID_ARGUMENT,`Field '${r}' is specified in your field mask but missing from your input data.`);Zc(e,r)||e.push(r)}c=new Qi(e),h=o.fieldTransforms.filter(e=>c.covers(e.field))}else c=null,h=o.fieldTransforms;return new jc(new Dr(a),c,h)}class Hc extends Mc{_toFieldTransform(e){return new $s(e.path,new Ls)}isEqual(e){return e instanceof Hc}}function Gc(e,t){if(Wc(e=R(e)))return Qc("Unsupported field value:",t,e),Kc(e,t);if(e instanceof Mc)return function(e,t){if(!Bc(t.dataSource))throw t.createError(`${e._methodName}() can only be used with update() and set()`);if(!t.path)throw t.createError(`${e._methodName}() is not currently supported inside arrays`);const n=e._toFieldTransform(t);n&&t.fieldTransforms.push(n)}(e,t),null;if(void 0===e&&t.ignoreUndefinedProperties)return null;if(t.path&&t.fieldMask.push(t.path),e instanceof Array){if(t.settings.arrayElement&&4!==t.dataSource)throw t.createError("Nested arrays are not supported");return function(e,t){const n=[];let i=0;for(const r of e){let e=Gc(r,t.childContextForArray(i));null==e&&(e={nullValue:"NULL_VALUE"}),n.push(e),i++}return{arrayValue:{values:n}}}(e,t)}return function(e,t){if(null===(e=R(e)))return{nullValue:"NULL_VALUE"};if("number"==typeof e)return Ns(t.serializer,e);if("boolean"==typeof e)return{booleanValue:e};if("string"==typeof e)return{stringValue:e};if(e instanceof Date){const n=Ai.fromDate(e);return{timestampValue:uo(t.serializer,n)}}if(e instanceof Ai){const n=new Ai(e.seconds,1e3*Math.floor(e.nanoseconds/1e3));return{timestampValue:uo(t.serializer,n)}}if(e instanceof Uc)return{geoPointValue:{latitude:e.latitude,longitude:e.longitude}};if(e instanceof Lc)return{bytesValue:fo(t.serializer,e._byteString)};if(e instanceof Sc){const n=t.databaseId,i=e.firestore._databaseId;if(!i.isEqual(n))throw t.createError(`Document reference is for database ${i.projectId}/${i.database} but should be for database ${n.projectId}/${n.database}`);return{referenceValue:mo(e.firestore._databaseId||t.databaseId,e._key.path)}}if(e instanceof Vc)return function(e,t){const n=e instanceof Vc?e.toArray():e;return{mapValue:{fields:{[dr]:{stringValue:gr},[mr]:{arrayValue:{values:n.map(e=>{if("number"!=typeof e)throw t.createError("VectorValues must only contain numeric values.");return As(t.serializer,e)})}}}}}}(e,t);if(So(e))return e._toProto(t.serializer);throw t.createError(`Unsupported field value: ${bi(e)}`)}(e,t)}function Kc(e,t){const n={};return zi(e)?t.path&&t.path.length>0&&t.fieldMask.push(t.path):$i(e,(e,i)=>{const r=Gc(i,t.childContextForField(e));null!=r&&(n[e]=r)}),{mapValue:{fields:n}}}function Wc(e){return!("object"!=typeof e||null===e||e instanceof Array||e instanceof Date||e instanceof Ai||e instanceof Uc||e instanceof Lc||e instanceof Sc||e instanceof Mc||e instanceof Vc||So(e))}function Qc(e,t,n){if(!Wc(n)||!_i(n)){const i=bi(n);throw"an object"===i?t.createError(e+" a custom object"):t.createError(e+" "+i)}}
1function Jc(e,t,n){if((t=R(t))instanceof xc)return t._internalPath;if("string"==typeof t)return function(e,t,n){if(t.search(Xc)>=0)throw Yc(`Invalid field path (${t}). Paths must not contain '~', '*', '/', '[', or ']'`,e,!1,void 0,n);try{return new xc(...t.split("."))._internalPath}catch(i){throw Yc(`Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,e,!1,void 0,n)}}(e,t);throw Yc("Field path arguments must be of type string or ",e,!1,void 0,n)}const Xc=new RegExp("[~\\*/\\[\\]]");function Yc(e,t,n,i,r){const s=i&&!i.isEmpty(),o=void 0!==r;let a=`Function ${t}() called with invalid data`;n&&(a+=" (via `toFirestore()`)"),a+=". ";let c="";return(s||o)&&(c+=" (found",s&&(c+=` in field ${i}`),o&&(c+=` in document ${r}`),c+=")"),new Kn(Gn.INVALID_ARGUMENT,a+e+c)}function Zc(e,t){return e.some(e=>e.isEqual(t))}function eh(){return new Hc("serverTimestamp")}const th="@firebase/firestore",nh="4.10.0";class ih{constructor(e,t,n,i,r){this._firestore=e,this._userDataWriter=t,this._key=n,this._document=i,this._converter=r}get id(){return this._key.path.lastSegment()}get ref(){return new Sc(this._firestore,this._converter,this._key)}exists(){return null!==this._document}data(){if(this._document){if(this._converter){const e=new rh(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}_fieldsProto(){return this._document?.data.clone().value.mapValue.fields??void 0}get(e){if(this._document){const t=this._document.data.field(Jc("DocumentSnapshot.get",e));if(null!==t)return this._userDataWriter.convertValue(t)}}}class rh extends ih{data(){return super.data()}}class sh{constructor(e,t){this.hasPendingWrites=e,this.fromCache=t}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class oh extends ih{constructor(e,t,n,i,r,s){super(e,t,n,i,s),this._firestore=e,this._firestoreImpl=e,this.metadata=r}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const t=new ah(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(t,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,t={}){if(this._document){const n=this._document.data.field(Jc("DocumentSnapshot.get",e));if(null!==n)return this._userDataWriter.convertValue(n,t.serverTimestamps)}}toJSON(){if(this.metadata.hasPendingWrites)throw new Kn(Gn.FAILED_PRECONDITION,"DocumentSnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e=this._document,t={};return t.type=oh._jsonSchemaVersion,t.bundle="",t.bundleSource="DocumentSnapshot",t.bundleName=this._key.toString(),e&&e.isValidDocument()&&e.isFoundDocument()?(this._userDataWriter.convertObjectMap(e.data.value.mapValue.fields,"previous"),t.bundle=(this._firestore,this.ref.path,"NOT SUPPORTED"),t):t}}oh._jsonSchemaVersion="firestore/documentSnapshot/1.0",oh._jsonSchema={type:Ti("string",oh._jsonSchemaVersion),bundleSource:Ti("string","DocumentSnapshot"),bundleName:Ti("string"),bundle:Ti("string")};class ah extends oh{data(e={}){return super.data(e)}}class ch{constructor(e,t,n,i){this._firestore=e,this._userDataWriter=t,this._snapshot=i,this.metadata=new sh(i.hasPendingWrites,i.fromCache),this.query=n}get docs(){const e=[];return this.forEach(t=>e.push(t)),e}get size(){return this._snapshot.docs.size}get empty(){return 0===this.size}forEach(e,t){this._snapshot.docs.forEach(n=>{e.call(t,new ah(this._firestore,this._userDataWriter,n.key,n,new sh(this._snapshot.mutatedKeys.has(n.key),this._snapshot.fromCache),this.query.converter))})}docChanges(e={}){const t=!!e.includeMetadataChanges;if(t&&this._snapshot.excludesMetadataChanges)throw new Kn(Gn.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===t||(this._cachedChanges=function(e,t){if(e._snapshot.oldDocs.isEmpty()){let t=0;return e._snapshot.docChanges.map(n=>{const i=new ah(e._firestore,e._userDataWriter,n.doc.key,n.doc,new sh(e._snapshot.mutatedKeys.has(n.doc.key),e._snapshot.fromCache),e.query.converter);return n.doc,{type:"added",doc:i,oldIndex:-1,newIndex:t++}})}{let n=e._snapshot.oldDocs;return e._snapshot.docChanges.filter(e=>t||3!==e.type).map(t=>{const i=new ah(e._firestore,e._userDataWriter,t.doc.key,t.doc,new sh(e._snapshot.mutatedKeys.has(t.doc.key),e._snapshot.fromCache),e.query.converter);let r=-1,s=-1;return 0!==t.type&&(r=n.indexOf(t.doc.key),n=n.delete(t.doc.key)),1!==t.type&&(n=n.add(t.doc),s=n.indexOf(t.doc.key)),{type:hh(t.type),doc:i,oldIndex:r,newIndex:s}})}}(this,t),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges}toJSON(){if(this.metadata.hasPendingWrites)throw new Kn(Gn.FAILED_PRECONDITION,"QuerySnapsh
1ot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e={};e.type=ch._jsonSchemaVersion,e.bundleSource="QuerySnapshot",e.bundleName=ri.newId(),this._firestore._databaseId.database,this._firestore._databaseId.projectId;const t=[],n=[],i=[];return this.docs.forEach(e=>{null!==e._document&&(t.push(e._document),n.push(this._userDataWriter.convertObjectMap(e._document.data.value.mapValue.fields,"previous")),i.push(e.ref.path))}),e.bundle=(this._firestore,this.query._query,e.bundleName,"NOT SUPPORTED"),e}}function hh(e){switch(e){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return $n(61501,{type:e})}}function lh(e,t){const n=Ii(e.firestore,Rc),i=function(e,t,...n){if(e=R(e),1===arguments.length&&(t=ri.newId()),yi("doc","path",t),e instanceof Ic){const i=fi.fromString(t,...n);return vi(i),new Sc(e,null,new mi(i))}{if(!(e instanceof Sc||e instanceof Cc))throw new Kn(Gn.INVALID_ARGUMENT,"Expected first argument to doc() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const i=e._path.child(fi.fromString(t,...n));return vi(i),new Sc(e.firestore,e instanceof Cc?e.converter:null,new mi(i))}}(e),r=function(e,t){let n;return n=e?e.toFirestore(t):t,n}(e.converter,t),s=function(e){const t=e._freezeSettings(),n=Ia(e._databaseId);return new zc(e._databaseId,!!t.ignoreUndefinedProperties,n)}(e.firestore);return function(e,t){const n=Oc(e);return function(e,t){const n=new Wn;return e.asyncQueue.enqueueAndForget(async()=>tc(await mc(e),t,n)),n.promise}(n,t)}(n,[qc(s,"addDoc",i._key,r,null!==e.converter,{}).toMutation(i._key,qs.exists(!1))]).then(()=>i)}function uh(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}ch._jsonSchemaVersion="firestore/querySnapshot/1.0",ch._jsonSchema={type:Ti("string",ch._jsonSchemaVersion),bundleSource:Ti("string","QuerySnapshot"),bundleName:Ti("string"),bundle:Ti("string")},function(e,t=!0){xn=Ke,$e(new P("firestore",(e,{instanceIdentifier:n,options:i})=>{const r=e.getProvider("app").getImmediate(),s=new Rc(new Yn(e.getProvider("auth-internal")),new ni(r,e.getProvider("app-check-internal")),function(e,t){if(!Object.prototype.hasOwnProperty.apply(e.options,["projectId"]))throw new Kn(Gn.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new ur(e.options.projectId,t)}(r,n),r);return i={useFetchStreams:t,...i},s._setSettings(i),s},"PUBLIC").setMultipleInstances(!0)),Je(th,nh,e),Je(th,nh,"esm2020")}();const dh=uh,fh=new T("auth","Firebase",{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}),ph=new $("@firebase/auth");function gh(e,...t){ph.logLevel<=M.ERROR&&ph.error(`Auth (${Ke}): ${e}`,...t)}function mh(e,...t){throw _h(e,...t)}function yh(e,...t){return _h(e,...t)}function vh(e,t,n){const i={...dh(),[t]:n};return new T("auth","Firebase",i).create(t,{appName:e.name})}function wh(e){return vh(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function _h(e,...t){if("string"!=typeof e){const n=t[0],i=[...t.slice(1)];return i[0]&&(i[0].appName=e.name),e._errorFactory.create(n,...i)}return fh.create(e,...t)}function bh(e,t,...n){if(!e)throw _h(t,...n)}function Ih(e){const t="INTERNAL ASSERTION FAILED: "+e;throw gh(t),new Error(t)}function Th(e,t){e||Ih(t)}function Eh(){return"undefined"!=typeof self&&self.location?.href||""}function Sh(){return"undefined"!=typeof self&&self.location?.protocol||null}function Ch(){return"undefined"==typeof navigator||!navigator||!("onLine"in navigator)||"boolean"!=typeof navigator.onLine||"http:"!==Sh()&&"https:"!==Sh()&&!v()&&!("connection"in navigator)||navigator.onLine}class Ah{constructor(e,t){this.shortDelay=e,this.longDelay=t,Th(t>
1e,"Short delay should be less than long delay!"),this.isMobile="undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(y())||"object"==typeof navigator&&"ReactNative"===navigator.product}get(){return Ch()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}function kh(e,t){Th(e.emulator,"Emulator should always be set here");const{url:n}=e.emulator;return t?`${n}${t.startsWith("/")?t.slice(1):t}`:n}class Nh{static initialize(e,t,n){this.fetchImpl=e,t&&(this.headersImpl=t),n&&(this.responseImpl=n)}static fetch(){return this.fetchImpl?this.fetchImpl:"undefined"!=typeof self&&"fetch"in self?self.fetch:"undefined"!=typeof globalThis&&globalThis.fetch?globalThis.fetch:"undefined"!=typeof fetch?fetch:void Ih("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){return this.headersImpl?this.headersImpl:"undefined"!=typeof self&&"Headers"in self?self.Headers:"undefined"!=typeof globalThis&&globalThis.Headers?globalThis.Headers:"undefined"!=typeof Headers?Headers:void Ih("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){return this.responseImpl?this.responseImpl:"undefined"!=typeof self&&"Response"in self?self.Response:"undefined"!=typeof globalThis&&globalThis.Response?globalThis.Response:"undefined"!=typeof Response?Response:void Ih("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}const Dh={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"},Rh=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],Ph=new Ah(3e4,6e4);function Oh(e,t){return e.tenantId&&!t.tenantId?{...t,tenantId:e.tenantId}:t}async function Lh(e,t,n,i,r={}){return xh(e,r,async()=>{let r={},s={};i&&("GET"===t?s=i:r={body:JSON.stringify(i)});const o=A({key:e.config.apiKey,...s}).slice(1),a=await e._getAdditionalHeaders();a["Content-Type"]="application/json",e.languageCode&&(a["X-Firebase-Locale"]=e.languageCode);const c={method:t,headers:a,...r};return"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||(c.referrerPolicy="no-referrer"),e.emulatorConfig&&d(e.emulatorConfig.host)&&(c.credentials="include"),Nh.fetch()(await Mh(e,e.config.apiHost,n,o),c)})}async function xh(e,t,n){e._canInitEmulator=!1;const i={...Dh,...t};try{const t=new Uh(e),r=await Promise.race([n(),t.promise]);t.clearNetworkTimeout();const s=await r.json();if("needConfirmation"in s)throw Vh(e,"account-exists-with-different-credential",s);if(r.ok&&!("errorMessage"in s))return s;{const t=r.ok?s.errorMessage:s.error.message,[n,o]=t.split(" : ");if("FEDERATED_USER_ID_ALREADY_LINKED"===n)throw Vh(e,"credential-already-in-use",s);if("EMAIL_EXISTS"===n)throw Vh(e,"email-already-in-use",s);if("USER_DISABLED"===n)throw Vh(e,"user-disabled",s);const a=i[n]||n.toLowerCase().replace(/[_\s]+/g,"-");if(o)throw vh(e,a,o);mh(e,a)}}catch(r){if(r instanceof I)throw r;mh(e,"network-request-failed",{message:String(r)})}}async function Mh(e,t,n,i){const r=`${t}${n}?${i}`,s=e,o=s.config.emulator?kh(e.config,r):`${e.config.apiScheme}://${r}`;
1if(Rh.includes(n)&&(await s._persistenceManagerAvailable,"COOKIE"===s._getPersistenceType())){return s._getPersistence()._getFinalTarget(o).toString()}return o}class Uh{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((e,t)=>{this.timer=setTimeout(()=>t(yh(this.auth,"network-request-failed")),Ph.get())})}}function Vh(e,t,n){const i={appName:e.name};n.email&&(i.email=n.email),n.phoneNumber&&(i.phoneNumber=n.phoneNumber);const r=yh(e,t,i);return r.customData._tokenResponse=n,r}async function Fh(e,t){return Lh(e,"POST","/v1/accounts:lookup",t)}function jh(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch(t){}}function Bh(e){return 1e3*Number(e)}function $h(e){const[t,n,i]=e.split(".");if(void 0===t||void 0===n||void 0===i)return gh("JWT malformed, contained fewer than 3 sections"),null;try{const e=s(n);return e?JSON.parse(e):(gh("Failed to decode base64 JWT payload"),null)}catch(r){return gh("Caught error parsing JWT payload as JSON",r?.toString()),null}}function zh(e){const t=$h(e);return bh(t,"internal-error"),bh(void 0!==t.exp,"internal-error"),bh(void 0!==t.iat,"internal-error"),Number(t.exp)-Number(t.iat)}async function qh(e,t,n=!1){if(n)return t;try{return await t}catch(i){throw i instanceof I&&function({code:e}){return"auth/user-disabled"===e||"auth/user-token-expired"===e}(i)&&e.auth.currentUser===e&&await e.auth.signOut(),i}}class Hh{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,null!==this.timerId&&clearTimeout(this.timerId))}getInterval(e){if(e){const e=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),e}{this.errorBackoff=3e4;const e=(this.user.stsTokenManager.expirationTime??0)-Date.now()-3e5;return Math.max(0,e)}}schedule(e=!1){if(!this.isRunning)return;const t=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},t)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){return void("auth/network-request-failed"===e?.code&&this.schedule(!0))}this.schedule()}}class Gh{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=jh(this.lastLoginAt),this.creationTime=jh(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}async function Kh(e){const t=e.auth,n=await e.getIdToken(),i=await qh(e,Fh(t,{idToken:n}));bh(i?.users.length,t,"internal-error");const r=i.users[0];e._notifyReloadListener(r);const s=r.providerUserInfo?.length?Wh(r.providerUserInfo):[],o=(a=e.providerData,c=s,[...a.filter(e=>!c.some(t=>t.providerId===e.providerId)),...c]);var a,c;const h=e.isAnonymous,l=!(e.email&&r.passwordHash||o?.length),u=!!h&&l,d={uid:r.localId,displayName:r.displayName||null,photoURL:r.photoUrl||null,email:r.email||null,emailVerified:r.emailVerified||!1,phoneNumber:r.phoneNumber||null,tenantId:r.tenantId||null,providerData:o,metadata:new Gh(r.createdAt,r.lastLoginAt),isAnonymous:u};Object.assign(e,d)}function Wh(e){return e.map(({providerId:e,...t})=>({providerId:e,uid:t.rawId||"",displayName:t.displayName||null,email:t.email||null,phoneNumber:t.phoneNumber||null,photoURL:t.photoUrl||null}))}class Qh{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){bh(e.idToken,"internal-error"),bh(void 0!==e.idToken,"internal-error"),bh(void 0!==e.refreshToken,"internal-error");const t="expiresIn"in e&&void 0!==e.expiresIn?Number(e.expiresIn):zh(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}updateFromIdToken(e){bh(0!==e.length,"internal-error");const t=zh(e);this.updateTokensAndExpiration(e,null,t)}async getToken(e,t=!1){return t||!this.accessToken||this.isExpired?(bh(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null):this.accessToken}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){const{accessToken:n,refreshToken:i,expiresIn:r}=await async function(e,t){const n=await xh(e,{},async()=>{const n=A({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:i,apiKey:r}=e.config,s=await Mh(e,i,"/v1/token",`key=${r}`),o=await e._getAdditionalHeaders();o["Content-Type"]="application/x-www-form-urlencoded";const a={method:"POST",headers:o,body:n};return e.emulatorConfig&&d(e.emulatorConfig.host)&&(a.credentials="include"),Nh.fetch()(s,a)});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}(e,t);this.updateTokensAndExpiration(n,i,Number(r))}updateTokensAndExpiration(e,t,n){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+1e3*n}static fromJSON(e,t){const{refreshToken:n,accessToken:i,expirationTime:r}=t,s=new Qh;return n&&(bh("string"==typeof n,"internal-error",{appName:e}),s.refreshToken=n),i&&(bh("string"==typeof i,"internal-error",{appName:e}),s.accessToken=i),r&&(bh("number"==typeof r,"internal-error",{appName:e}),s.expirationTime=r),s}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new Qh,this.toJSON())}_performRefresh(){return Ih("not implemented")}}function Jh(e,t){bh("string"==typeof e||void 0===e,"internal-error",{appName:t})}class Xh{constructor({uid:e,auth:t,stsTokenManager:n,...i}){this.providerId="firebase",this.proactiveRefresh=new Hh(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=e,this.auth=t,this.stsTokenManager=n,this.accessToken=n.accessToken,this.displayName=i.displayName||null,this.email=i.email||null,this.emailVerified=i.emailVerified||!1,this.phoneNumber=i.phoneNumber||null,this.photoURL=i.photoURL||null,this.isAnonymous=i.isAnonymous||!1,this.tenantId=i.tenantId||null,this.providerData=i.providerData?[...i.providerData]:[],this.metadata=new Gh(i.createdAt||void 0,i.lastLoginAt||void 0)}async getIdToken(e){const t=await qh(this,this.stsTokenManager.getToken(this.auth,e));return bh(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return async function(e,t=!1){const n=R(e),i=await n.getIdToken(t),r=$h(i);bh(r&&r.exp&&r.auth_time&&r.iat,n.auth,"internal-error");const s="object"==typeof r.firebase?r.firebase:void 0,o=s?.sign_in_provider;return{claims:r,token:i,authTime:jh(Bh(r.auth_time)),issuedAtTime:jh(Bh(r.iat)),expirationTime:jh(Bh(r.exp)),signInProvider:o||null,signInSecondFactor:s?.sign_in_second_factor||null}}(this,e)}reload(){return async function(e){const t=R(e);await Kh(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}(this)}_assign(e){this!==e&&(bh(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.ph
1otoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(e=>({...e})),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const t=new Xh({...this,auth:e,stsTokenManager:this.stsTokenManager._clone()});return t.metadata._copy(this.metadata),t}_onReload(e){bh(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let n=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),n=!0),t&&await Kh(this),await this.auth._persistUserIfCurrent(this),n&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(qe(this.auth.app))return Promise.reject(wh(this.auth));const e=await this.getIdToken();return await qh(this,async function(e,t){return Lh(e,"POST","/v1/accounts:delete",t)}(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return{uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>({...e})),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId,...this.metadata.toJSON(),apiKey:this.auth.config.apiKey,appName:this.auth.name}}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){const n=t.displayName??void 0,i=t.email??void 0,r=t.phoneNumber??void 0,s=t.photoURL??void 0,o=t.tenantId??void 0,a=t._redirectEventId??void 0,c=t.createdAt??void 0,h=t.lastLoginAt??void 0,{uid:l,emailVerified:u,isAnonymous:d,providerData:f,stsTokenManager:p}=t;bh(l&&p,e,"internal-error");const g=Qh.fromJSON(this.name,p);bh("string"==typeof l,e,"internal-error"),Jh(n,e.name),Jh(i,e.name),bh("boolean"==typeof u,e,"internal-error"),bh("boolean"==typeof d,e,"internal-error"),Jh(r,e.name),Jh(s,e.name),Jh(o,e.name),Jh(a,e.name),Jh(c,e.name),Jh(h,e.name);const m=new Xh({uid:l,auth:e,email:i,emailVerified:u,displayName:n,isAnonymous:d,photoURL:s,phoneNumber:r,tenantId:o,stsTokenManager:g,createdAt:c,lastLoginAt:h});return f&&Array.isArray(f)&&(m.providerData=f.map(e=>({...e}))),a&&(m._redirectEventId=a),m}static async _fromIdTokenResponse(e,t,n=!1){const i=new Qh;i.updateFromServerResponse(t);const r=new Xh({uid:t.localId,auth:e,stsTokenManager:i,isAnonymous:n});return await Kh(r),r}static async _fromGetAccountInfoResponse(e,t,n){const i=t.users[0];bh(void 0!==i.localId,"internal-error");const r=void 0!==i.providerUserInfo?Wh(i.providerUserInfo):[],s=!(i.email&&i.passwordHash||r?.length),o=new Qh;o.updateFromIdToken(n);const a=new Xh({uid:i.localId,auth:e,stsTokenManager:o,isAnonymous:s}),c={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:r,metadata:new Gh(i.createdAt,i.lastLoginAt),isAnonymous:!(i.email&&i.passwordHash||r?.length)};return Object.assign(a,c),a}}const Yh=new Map;function Zh(e){Th(e instanceof Function,"Expected a class definition");let t=Yh.get(e);return t?(Th(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,Yh.set(e,t),t)}class el{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){const t=this.storage[e];return void 0===t?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}el.type="NONE";const tl=el;function nl(e,t,n){return`firebase:${e}:${t}:${n}`}class il{constructor(e,t,n){this.persistence=e,this.auth=t,this.userKey=n;const{config:i,name:r}=this.auth;this.fullUserKey=nl(this.userKey,i.apiKey,r),this.fullPersistenceKey=nl("persistence",i.apiKey,r),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);if(!e)return null;if("string"==typeof e){const t=await Fh(this.auth,{idToken:e}).catch(()=>{});return t?Xh._fromGetAccountInfoResponse(this.auth,t,e):null}return Xh._fromJSON(this.auth,e)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const t=await this.getCurrentUser();return await this.removeCurrentUser(),this.persistence=e,t?this.setCurrentUser(t):void 0}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,t,n="authUser"){if(!t.length)return new il(Zh(tl),e,n);const i=(await Promise.all(t.map(async e=>{if(await e._isAvailable())return e}))).filter(e=>e);let r=i[0]||Zh(tl);const s=nl(n,e.config.apiKey,e.name);let o=null;for(const c of t)try{const t=await c._get(s);if(t){let n;if("string"==typeof t){const i=await Fh(e,{idToken:t}).catch(()=>{});if(!i)break;n=await Xh._fromGetAccountInfoResponse(e,i,t)}else n=Xh._fromJSON(e,t);c!==r&&(o=n),r=c;break}}catch{}const a=i.filter(e=>e._shouldAllowMigration);return r._shouldAllowMigration&&a.length?(r=a[0],o&&await r._set(s,o.toJSON()),await Promise.all(t.map(async e=>{if(e!==r)try{await e._remove(s)}catch{}})),new il(r,e,n)):new il(r,e,n)}}function rl(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(cl(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(sl(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(ll(t))return"Blackberry";if(ul(t))return"Webos";if(ol(t))return"Safari";if((t.includes("chrome/")||al(t))&&!t.includes("edge/"))return"Chrome";if(hl(t))return"Android";{const t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,n=e.match(t);if(2===n?.length)return n[1]}return"Other"}function sl(e=y()){return/firefox\//i.test(e)}function ol(e=y()){const t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function al(e=y()){return/crios\//i.test(e)}function cl(e=y()){return/iemobile/i.test(e)}function hl(e=y()){return/android/i.test(e)}function ll(e=y()){return/blackberry/i.test(e)}function ul(e=y()){return/webos/i.test(e)}function dl(e=y()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function fl(){return function(){const e=y();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}()&&10===document.documentMode}function pl(e=y()){return dl(e)||hl(e)||ul(e)||ll(e)||/windows phone/i.test(e)||cl(e)}
vendor: 4,430 bytes, line 1
1function gl(e,t=[]){let n;switch(e){case"Browser":n=rl(y());break;case"Worker":n=`${rl(y())}-${e}`;break;default:n=e}const i=t.length?t.join(","):"FirebaseCore-web";return`${n}/JsCore/${Ke}/${i}`}class ml{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){const n=t=>new Promise((n,i)=>{try{n(e(t))}catch(r){i(r)}});n.onAbort=t,this.queue.push(n);const i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const t=[];try{for(const n of this.queue)await n(e),n.onAbort&&t.push(n.onAbort)}catch(n){t.reverse();for(const e of t)try{e()}catch(i){}throw this.auth._errorFactory.create("login-blocked",{originalMessage:n?.message})}}}class yl{constructor(e){const t=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=t.minPasswordLength??6,t.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=t.maxPasswordLength),void 0!==t.containsLowercaseCharacter&&(this.customStrengthOptions.containsLowercaseLetter=t.containsLowercaseCharacter),void 0!==t.containsUppercaseCharacter&&(this.customStrengthOptions.containsUppercaseLetter=t.containsUppercaseCharacter),void 0!==t.containsNumericCharacter&&(this.customStrengthOptions.containsNumericCharacter=t.containsNumericCharacter),void 0!==t.containsNonAlphanumericCharacter&&(this.customStrengthOptions.containsNonAlphanumericCharacter=t.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,"ENFORCEMENT_STATE_UNSPECIFIED"===this.enforcementState&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=e.allowedNonAlphanumericCharacters?.join("")??"",this.forceUpgradeOnSignin=e.forceUpgradeOnSignin??!1,this.schemaVersion=e.schemaVersion}validatePassword(e){const t={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,t),this.validatePasswordCharacterOptions(e,t),t.isValid&&(t.isValid=t.meetsMinPasswordLength??!0),t.isValid&&(t.isValid=t.meetsMaxPasswordLength??!0),t.isValid&&(t.isValid=t.containsLowercaseLetter??!0),t.isValid&&(t.isValid=t.containsUppercaseLetter??!0),t.isValid&&(t.isValid=t.containsNumericCharacter??!0),t.isValid&&(t.isValid=t.containsNonAlphanumericCharacter??!0),t}validatePasswordLengthOptions(e,t){const n=this.customStrengthOptions.minPasswordLength,i=this.customStrengthOptions.maxPasswordLength;n&&(t.meetsMinPasswordLength=e.length>=n),i&&(t.meetsMaxPasswordLength=e.length<=i)}validatePasswordCharacterOptions(e,t){let n;this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);for(let i=0;i<e.length;i++)n=e.charAt(i),this.updatePasswordCharacterOptionsStatuses(t,n>="a"&&n<="z",n>="A"&&n<="Z",n>="0"&&n<="9",this.allowedNonAlphanumericCharacters.includes(n))}updatePasswordCharacterOptionsStatuses(e,t,n,i,r){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=n)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=i)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=r))}}class vl{constructor(e,t,n,i){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=n,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new _l(this),this.idTokenSubscription=new _l(this),this.beforeStateQueue=new ml(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=fh,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=i.sdkClientVersion,this._persistenceManagerAvailable=new Promise(e=>this._resolvePersistenceManagerAvailable=e)}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=Zh(t)),this._initializationPromise=this.queue(async()=>
1{if(!this._deleted&&(this.persistenceManager=await il.create(this,e),this._resolvePersistenceManagerAvailable?.(),!this._deleted)){if(this._popupRedirectResolver?._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch(n){}await this.initializeCurrentUser(t),this.lastNotifiedUid=this.currentUser?.uid||null,this._deleted||(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();return this.currentUser||e?this.currentUser&&e&&this.currentUser.uid===e.uid?(this._currentUser._assign(e),void(await this.currentUser.getIdToken())):void(await this._updateCurrentUser(e,!0)):void 0}async initializeCurrentUserFromIdToken(e){try{const t=await Fh(this,{idToken:e}),n=await Xh._fromGetAccountInfoResponse(this,t,e);await this.directlySetCurrentUser(n)}catch(t){await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){if(qe(this.app)){const e=this.app.settings.authIdToken;return e?new Promise(t=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(e).then(t,t))}):this.directlySetCurrentUser(null)}const t=await this.assertedPersistence.getCurrentUser();let n=t,i=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const t=this.redirectUser?._redirectEventId,r=n?._redirectEventId,s=await this.tryRedirectSignIn(e);t&&t!==r||!s?.user||(n=s.user,i=!0)}if(!n)return this.directlySetCurrentUser(null);if(!n._redirectEventId){if(i)try{await this.beforeStateQueue.runMiddleware(n)}catch(r){n=t,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(r))}return n?this.reloadAndSetCurrentUserOrClear(n):this.directlySetCurrentUser(null)}return bh(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===n._redirectEventId?this.directlySetCurrentUser(n):this.reloadAndSetCurrentUserOrClear(n)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch(n){await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await Kh(e)}catch(t){if("auth/network-request-failed"!==t?.code)return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=function(){if("undefined"==typeof navigator)return null;const e=navigator;return e.languages&&e.languages[0]||e.language||null}()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(qe(this.app))return Promise.reject(wh(this));const t=e?R(e):null;return t&&bh(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&bh(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return qe(this.app)?Promise.reject(wh(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return qe(this.app)?Promise.reject(wh(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(Zh(e))})}_getRecaptchaConfig(){return null==this.tenantId?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):t.validatePassword(e)}_getPasswordPolicyInternal(){return null===this.tenantId?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await async function(e,t={}){return Lh(e,"GET","/v2/passwordPolicy",Oh(e,t))}(this),t=new yl(e);null===this.tenantId?this._projectPasswordPolicy=t:this._tenantPasswordPolicies[this.tenantId]=t}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new T("auth","Firebase",e())}onAuthStateChanged(e,t,n){return this.registerStateListener(this.authStateSubscription,e,t,n)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,n){return this.registerStateListener(this.idTokenSubscription,e,t,n)}authStateReady(){return new Promise((e,t)=>
1{if(this.currentUser)e();else{const n=this.onAuthStateChanged(()=>{n(),e()},t)}})}async revokeAccessToken(e){if(this.currentUser){const t={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:await this.currentUser.getIdToken()};null!=this.tenantId&&(t.tenantId=this.tenantId),await async function(e,t){return Lh(e,"POST","/v2/accounts:revokeToken",Oh(e,t))}(this,t)}}toJSON(){return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:this._currentUser?.toJSON()}}async _setRedirectUser(e,t){const n=await this.getOrInitRedirectPersistenceManager(t);return null===e?n.removeCurrentUser():n.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const t=e&&Zh(e)||this._popupRedirectResolver;bh(t,this,"argument-error"),this.redirectPersistenceManager=await il.create(this,[Zh(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){return this._isInitialized&&await this.queue(async()=>{}),this._currentUser?._redirectEventId===e?this._currentUser:this.redirectUser?._redirectEventId===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const e=this.currentUser?.uid??null;this.lastNotifiedUid!==e&&(this.lastNotifiedUid=e,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,n,i){if(this._deleted)return()=>{};const r="function"==typeof t?t:t.next.bind(t);let s=!1;const o=this._isInitialized?Promise.resolve():this._initializationPromise;if(bh(o,this,"internal-error"),o.then(()=>{s||r(this.currentUser)}),"function"==typeof t){const r=e.addObserver(t,n,i);return()=>{s=!0,r()}}{const n=e.addObserver(t);return()=>{s=!0,n()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return bh(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){e&&!this.frameworks.includes(e)&&(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=gl(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){const e={"X-Client-Version":this.clientVersion};this.app.options.appId&&(e["X-Firebase-gmpid"]=this.app.options.appId);const t=await(this.heartbeatServiceProvider.getImmediate({optional:!0})?.getHeartbeatsHeader());t&&(e["X-Firebase-Client"]=t);const n=await this._getAppCheckToken();return n&&(e["X-Firebase-AppCheck"]=n),e}async _getAppCheckToken(){if(qe(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const e=await(this.appCheckServiceProvider.getImmediate({optional:!0})?.getToken());return e?.error&&function(e,...t){ph.logLevel<=M.WARN&&ph.warn(`Auth (${Ke}): ${e}`,...t)}(`Error while retrieving App Check token: ${e.error}`),e?.token}}function wl(e){return R(e)}class _l{constructor(e){this.auth=e,this.observer=null,this.addObserver=function(e,t){const n=new k(e,t);return n.subscribe.bind(n)}(e=>this.observer=e)}get next(){return bh(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}let bl={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function Il(e,t,n){const i=wl(e);bh(/^https?:\/\//.test(t),i,"invalid-emulator-scheme");const r=Tl(t),{host:s,port:o}=function(e){const t=Tl(e),n=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!n)return{host:"",port:null};const i=n[2].split("@").pop()||"",r=/^(\[[^\]]+\])(:|$)/.exec(i);if(r){const e=r[1];return{host:e,port:El(i.substr(e.length+1))}}{const[e,t]=i.split(":");return{host:e,port:El(t)}}}(t),a=null===o?"":`:${o}`,c={url:`${r}//${s}${a}/`},h=Object.freeze({host:s,port:o,protocol:r.replace(":",""),options:Object.freeze({disableWarnings:!1})});if(!i._canInitEmulator)return bh(i.config.emulator&&i.emulatorConfig,i,"emulator-config-failed"),void bh(S(c,i.config.emulator)&&S(h,i.emulatorConfig),i,"emulator-config-failed");i.config.emulator=c,i.emulatorConfig=h,i.settings.appVerificationDisabledForTesting=!0,d(s)?(f(`${r}//${s}${a}`),m("Auth",!0)):function(){function e(){const e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}"undefined"!=typeof console&&console.info;"undefined"!=typeof window&&"undefined"!=typeof document&&("loading"===document.readyState?window.addEventListener("DOMContentLoaded",e):e())}()}function Tl(e){const t=e.indexOf(":");
vendor: 1,141 bytes, line 1
1return t<0?"":e.substr(0,t+1)}function El(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}class Sl{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return Ih("not implemented")}_getIdTokenResponse(e){return Ih("not implemented")}_linkToIdToken(e,t){return Ih("not implemented")}_getReauthenticationResolver(e){return Ih("not implemented")}}async function Cl(e,t){return async function(e,t,n,i,r={}){const s=await Lh(e,t,n,i,r);return"mfaPendingCredential"in s&&mh(e,"multi-factor-auth-required",{_serverResponse:s}),s}(e,"POST","/v1/accounts:signInWithIdp",Oh(e,t))}class Al extends Sl{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new Al(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):mh("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,n
vendor: 4,599 bytes, line 1
1once:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const t="string"==typeof e?JSON.parse(e):e,{providerId:n,signInMethod:i,...r}=t;if(!n||!i)return null;const s=new Al(n,i);return s.idToken=r.idToken||void 0,s.accessToken=r.accessToken||void 0,s.secret=r.secret,s.nonce=r.nonce,s.pendingToken=r.pendingToken||null,s}_getIdTokenResponse(e){return Cl(e,this.buildRequest())}_linkToIdToken(e,t){const n=this.buildRequest();return n.idToken=t,Cl(e,n)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,Cl(e,t)}buildRequest(){const e={requestUri:"http://localhost",returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=A(t)}return e}}class kl{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}class Nl extends kl{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}class Dl extends Nl{constructor(){super("facebook.com")}static credential(e){return Al._fromParams({providerId:Dl.PROVIDER_ID,signInMethod:Dl.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Dl.credentialFromTaggedObject(e)}static credentialFromError(e){return Dl.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e))return null;if(!e.oauthAccessToken)return null;try{return Dl.credential(e.oauthAccessToken)}catch{return null}}}Dl.FACEBOOK_SIGN_IN_METHOD="facebook.com",Dl.PROVIDER_ID="facebook.com";class Rl extends Nl{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return Al._fromParams({providerId:Rl.PROVIDER_ID,signInMethod:Rl.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return Rl.credentialFromTaggedObject(e)}static credentialFromError(e){return Rl.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:t,oauthAccessToken:n}=e;if(!t&&!n)return null;try{return Rl.credential(t,n)}catch{return null}}}Rl.GOOGLE_SIGN_IN_METHOD="google.com",Rl.PROVIDER_ID="google.com";class Pl extends Nl{constructor(){super("github.com")}static credential(e){return Al._fromParams({providerId:Pl.PROVIDER_ID,signInMethod:Pl.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Pl.credentialFromTaggedObject(e)}static credentialFromError(e){return Pl.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e))return null;if(!e.oauthAccessToken)return null;try{return Pl.credential(e.oauthAccessToken)}catch{return null}}}Pl.GITHUB_SIGN_IN_METHOD="github.com",Pl.PROVIDER_ID="github.com";class Ol extends Nl{constructor(){super("twitter.com")}static credential(e,t){return Al._fromParams({providerId:Ol.PROVIDER_ID,signInMethod:Ol.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return Ol.credentialFromTaggedObject(e)}static credentialFromError(e){return Ol.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:t,oauthTokenSecret:n}=e;if(!t||!n)return null;try{return Ol.credential(t,n)}catch{return null}}}Ol.TWITTER_SIGN_IN_METHOD="twitter.com",Ol.PROVIDER_ID="twitter.com";class Ll{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,n,i=!1){const r=await Xh._fromIdTokenResponse(e,n,i),s=xl(n);return new Ll({user:r,providerId:s,_tokenResponse:n,operationType:t})}static async _forOperation(e,t,n){await e._updateTokensIfNecessary(n,!0);const i=xl(n);return new Ll({user:e,providerId:i,_tokenResponse:n,operationType:t})}}function xl(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}class Ml extends I{constructor(e,t,n,i){super(t.code,t.message),this.operationType=n,this.user=i,Object.setPrototypeOf(this,Ml.prototype),this.customData={appName:e.n
1ame,tenantId:e.tenantId??void 0,_serverResponse:t.customData._serverResponse,operationType:n}}static _fromErrorAndOperation(e,t,n,i){return new Ml(e,t,n,i)}}function Ul(e,t,n,i){return("reauthenticate"===t?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch(n=>{if("auth/multi-factor-auth-required"===n.code)throw Ml._fromErrorAndOperation(e,n,t,i);throw n})}const Vl="__sak";class Fl{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(Vl,"1"),this.storage.removeItem(Vl),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){const t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}class jl extends Fl{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=pl(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const t of Object.keys(this.listeners)){const n=this.storage.getItem(t),i=this.localCache[t];n!==i&&e(t,i,n)}}onStorageEvent(e,t=!1){if(!e.key)return void this.forAllChangedKeys((e,t,n)=>{this.notifyListeners(e,n)});const n=e.key;t?this.detachListener():this.stopPolling();const i=()=>{const e=this.storage.getItem(n);(t||this.localCache[n]!==e)&&this.notifyListeners(n,e)},r=this.storage.getItem(n);fl()&&r!==e.newValue&&e.newValue!==e.oldValue?setTimeout(i,10):i()}notifyListeners(e,t){this.localCache[e]=t;const n=this.listeners[e];if(n)for(const i of Array.from(n))i(t?JSON.parse(t):t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,n)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:n}),!0)})},1e3)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){0===Object.keys(this.listeners).length&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){const t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}jl.type="LOCAL";const Bl=jl;class $l extends Fl{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}$l.type="SESSION";const zl=$l;class ql{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const t=this.receivers.find(t=>t.isListeningto(e));if(t)return t;const n=new ql(e);return this.receivers.push(n),n}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const t=e,{eventId:n,eventType:i,data:r}=t.data,s=this.handlersMap[i];if(!s?.size)return;t.ports[0].postMessage({status:"ack",eventId:n,eventType:i});const o=Array.from(s).map(async e=>e(t.origin,r)),a=await function(e){return Promise.all(e.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(t){return{fulfilled:!1,reason:t}}}))}(o);t.ports[0].postMessage({status:"done",eventId:n,eventType:i,response:a})}_subscribe(e,t){0===Object.keys(this.handlersMap).length&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),t&&0!==this.handlersMap[e].size||delete this.handlersMap[e],0===Object.keys(this.handlersMap).length&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}function Hl(e="",t=10){let n="";for(let i=0;i<t;i++)n+=Math.floor(10*Math.random());return e+n}ql.receivers=[];class Gl{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,t,n=50){const i="undefined"!=typeof MessageChannel?new MessageChannel:null;if(!i)throw new Error("connection_unavailable");let r,s;return new Promise((o,a)=>{const c=Hl("",20);i.port1.start();const h=setTimeout(()=>{a(new Error("unsupported_event"))},n);s={messageChannel:i,onMessage(e){const t=e;if(t.data.eventId===c)switch(t.data.status){case"ack":clearTimeout(h),r=setTimeout(()=>{a(new Error("timeout"))},3e3);break;case"done":clearTimeout(r),o(t.data.response);break;default:clearTimeout(h),clearTimeout(r),a(new Error("invalid_response"))}}},this.handlers.add(s),i.port1.addEventListener("message",s.onMessage),this.target.postMessage({eventType:e,eventId:c,data:t},[i.port2])}).finally(()=>{s&&this.removeMessageHandler(s)})}}function Kl(){return window}
1function Wl(){return void 0!==Kl().WorkerGlobalScope&&"function"==typeof Kl().importScripts}const Ql="firebaseLocalStorageDb",Jl="firebaseLocalStorage",Xl="fbase_key";class Yl{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{t(this.request.error)})})}}function Zl(e,t){return e.transaction([Jl],t?"readwrite":"readonly").objectStore(Jl)}function eu(){const e=indexedDB.open(Ql,1);return new Promise((t,n)=>{e.addEventListener("error",()=>{n(e.error)}),e.addEventListener("upgradeneeded",()=>{const t=e.result;try{t.createObjectStore(Jl,{keyPath:Xl})}catch(i){n(i)}}),e.addEventListener("success",async()=>{const n=e.result;n.objectStoreNames.contains(Jl)?t(n):(n.close(),await function(){const e=indexedDB.deleteDatabase(Ql);return new Yl(e).toPromise()}(),t(await eu()))})})}async function tu(e,t,n){const i=Zl(e,!0).put({[Xl]:t,value:n});return new Yl(i).toPromise()}function nu(e,t){const n=Zl(e,!0).delete(t);return new Yl(n).toPromise()}class iu{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db||(this.db=await eu()),this.db}async _withRetries(e){let t=0;for(;;)try{const t=await this._openDb();return await e(t)}catch(n){if(t++>3)throw n;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return Wl()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=ql._getInstance(Wl()?self:null),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){if(this.activeServiceWorker=await async function(){if(!navigator?.serviceWorker)return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}(),!this.activeServiceWorker)return;this.sender=new Gl(this.activeServiceWorker);const e=await this.sender._send("ping",{},800);e&&e[0]?.fulfilled&&e[0]?.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(this.sender&&this.activeServiceWorker&&(navigator?.serviceWorker?.controller||null)===this.activeServiceWorker)try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await eu();return await tu(e,Vl,"1"),await nu(e,Vl),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(n=>tu(n,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){const t=await this._withRetries(t=>async function(e,t){const n=Zl(e,!1).get(t),i=await new Yl(n).toPromise();return void 0===i?null:i.value}(t,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>nu(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(e=>{const t=Zl(e,!1).getAll();return new Yl(t).toPromise()});if(!e)return[];if(0!==this.pendingWrites)return[];const t=[],n=new Set;if(0!==e.length)for(const{fbase_key:i,value:r}of e)n.add(i),JSON.stringify(this.localCache[i])!==JSON.stringify(r)&&(this.notifyListeners(i,r),t.push(i));for(const i of Object.keys(this.localCache))this.localCache[i]&&!n.has(i)&&(this.notifyListeners(i,null),t.push(i));return t}notifyListeners(e,t){this.localCache[e]=t;const n=this.listeners[e];if(n)for(const i of Array.from(n))i(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),800)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){0===Object.keys(this.listeners).length&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&this.stopPolling()}}iu.type="LOCAL";const ru=iu;new Ah(3e4,6e4);class su extends Sl{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return Cl(e,this._buildIdpRequest())}_linkToIdToken(e,t){return Cl(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return Cl(e,this._buildIdpRequest())}_buildIdpRequest(e){const t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}function ou(e){return async function(e,t,n=!1){if(qe(e.app))return Promise.reject(wh(e));const i="signIn",r=await Ul(e,i,t),s=await Ll._fromIdTokenResponse(e,i,r);return n||await e._updateCurrentUser(s.user),s}(e.auth,new su(e),e.bypassAuthState)}function au(e){const{auth:t,user:n}=e;return bh(n,t,"internal-error"),async function(e,t,n=!1){const{auth:i}=e;if(qe(i.app))return Promise.reject(wh(i));const r="reauthenticate";try{const s=await qh(e,Ul(i,r,t,e),n);bh(s.idToken,i,"internal-error");const o=$h(s.idToken);bh(o,i,"internal-error");const{sub:a}=o;return bh(e.uid===a,i,"user-mismatch"),Ll._forOperation(e,r,s)}catch(s){throw"auth/user-not-found"===s?.code&&mh(i,"user-mismatch"),s}}(n,new su(e),e.bypassAuthState)}async function cu(e){const{auth:t,user:n}=e;return bh(n,t,"internal-error"),async function(e,t,n=!1){const i=await qh(e,t._linkToIdToken(e.auth,await e.getIdToken()),n);return Ll._forOperation(e,"link",i)}(n,new su(e),e.bypassAuthState)}class hu{constructor(e,t,n,i,r=!1){this.auth=e,this.resolver=n,this.user=i,this.bypassAuthState=r,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise(async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(n){this.reject(n)}})}async onAuthEvent(e){const{urlResponse:t,sessionId:n,postBody:i,tenantId:r,error:s,type:o}=e;if(s)return void this.reject(s);const a={auth:this.auth,requestUri:t,sessionId:n,tenantId:r||void 0,postBody:i||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(o)(a))}catch(c){this.reject(c)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return ou;case"linkViaPopup":case"linkViaRedirect":return cu;case"reauthViaPopup":case"reauthViaRedirect":return au;default:mh(this.auth,"internal-error")}}resolve(e){Th(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){Th(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}const lu=new Ah(2e3,1e4);class uu extends hu{constructor(e,t,n,i,r){super(e,t,i,r),this.provider=n,this.authWindow=null,this.pollId=null,uu.currentPopupAction&&uu.currentPopupAction.cancel(),uu.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return bh(e,this.auth,"internal-error"),e}async onExecution(){Th(1===this.filter.length,"Popup operations only handle one event");const e=Hl();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(e=>{this.reject(e)}),this.resolver._isIframeWebStorageSupported(this.auth,e=>{e||this.reject(yh(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){return this.authWindow?.associatedEvent||null}cancel(){this.reject(yh(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,uu.currentPopupAction=null}pollUserCancellation(){const e=()=>{this.authWindow?.window?.closed?this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(yh(this.auth,"popup-closed-by-user"))},8e3):this.pollId=window.setTimeout(e,lu.get())};e()}}uu.currentPopupAction=null;const du="pendingRedirect",fu=new Map;class pu extends hu{constructor(e,t,n=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,n),this.eventId=null}async execute(){let e=fu.get(this.auth._key());if(!e){try{const t=await async function(e,t){const n=function(e){return nl(du,e.config.apiKey,e.name)}(t),i=function(e){return Zh(e._redirectPersistence)}(e);if(!(await i._isAvailable()))return!1;const r="true"===await i._get(n);return await i._remove(n),r}(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(t)}catch(t){e=()=>Promise.reject(t)}fu.set(this.auth._key(),e)}return this.bypassAuthState||fu.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if("signInViaRedirect"===e.type)return super.onAuthEvent(e);
1if("unknown"!==e.type){if(e.eventId){const t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}else this.resolve(null)}async onExecution(){}cleanUp(){}}function gu(e,t){fu.set(e._key(),t)}async function mu(e,t,n=!1){if(qe(e.app))return Promise.reject(wh(e));const i=wl(e),r=function(e,t){return t?Zh(t):(bh(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}(i,t),s=new pu(i,r,n),o=await s.execute();return o&&!n&&(delete o.user._redirectEventId,await i._persistUserIfCurrent(o.user),await i._setRedirectUser(null,t)),o}class yu{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach(n=>{this.isEventForConsumer(e,n)&&(t=!0,this.sendToConsumer(e,n),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!function(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return wu(e);default:return!1}}(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){if(e.error&&!wu(e)){const n=e.error.code?.split("auth/")[1]||"internal-error";t.onError(yh(this.auth,n))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const n=null===t.eventId||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&n}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has(vu(e))}saveEventToCache(e){this.cachedEventUids.add(vu(e)),this.lastProcessedEventTime=Date.now()}}function vu(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(e=>e).join("-")}function wu({type:e,error:t}){return"unknown"===e&&"auth/no-auth-event"===t?.code}const _u=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,bu=/^https?/;async function Iu(e){if(e.config.emulator)return;const{authorizedDomains:t}=await async function(e,t={}){return Lh(e,"GET","/v1/projects",t)}(e);for(const n of t)try{if(Tu(n))return}catch{}mh(e,"unauthorized-domain")}function Tu(e){const t=Eh(),{protocol:n,hostname:i}=new URL(t);if(e.startsWith("chrome-extension://")){const r=new URL(e);return""===r.hostname&&""===i?"chrome-extension:"===n&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):"chrome-extension:"===n&&r.hostname===i}if(!bu.test(n))return!1;if(_u.test(e))return i===e;const r=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+r+"|"+r+")$","i").test(i)}const Eu=new Ah(3e4,6e4);function Su(){const e=Kl().___jsl;if(e?.H)for(const t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let n=0;n<e.CP.length;n++)e.CP[n]=null}function Cu(e){return new Promise((t,n)=>{function i(){Su(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{Su(),n(yh(e,"network-request-failed"))},timeout:Eu.get()})}if(Kl().gapi?.iframes?.Iframe)t(gapi.iframes.getContext());else{if(!Kl().gapi?.load){const t=`__${"iframefcb"}${Math.floor(1e6*Math.random())}`;return Kl()[t]=()=>{gapi.load?i():n(yh(e,"network-request-failed"))},(r=`${bl.gapiScript}?onload=${t}`,bl.loadJS(r)).catch(e=>n(e))}i()}var r}).catch(e=>{throw Au=null,e})}let Au=null;const ku=new Ah(5e3,15e3),Nu={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},Du=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function Ru(e){const t=e.config;bh(t.authDomain,e,"auth-domain-config-required");const n=t.emulator?kh(t,"emulator/auth/iframe"):`https://${e.config.authDomain}
1/__/auth/iframe`,i={apiKey:t.apiKey,appName:e.name,v:Ke},r=Du.get(e.config.apiHost);r&&(i.eid=r);const s=e._getFrameworks();return s.length&&(i.fw=s.join(",")),`${n}?${A(i).slice(1)}`}async function Pu(e){const t=await function(e){return Au=Au||Cu(e),Au}(e),n=Kl().gapi;return bh(n,e,"internal-error"),t.open({where:document.body,url:Ru(e),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:Nu,dontclear:!0},t=>new Promise(async(n,i)=>{await t.restyle({setHideOnLeave:!1});const r=yh(e,"network-request-failed"),s=Kl().setTimeout(()=>{i(r)},ku.get());function o(){Kl().clearTimeout(s),n(t)}t.ping(o).then(o,()=>{i(r)})}))}const Ou={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"};class Lu{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch(e){}}}function xu(e,t,n,i=500,r=600){const s=Math.max((window.screen.availHeight-r)/2,0).toString(),o=Math.max((window.screen.availWidth-i)/2,0).toString();let a="";const c={...Ou,width:i.toString(),height:r.toString(),top:s,left:o},h=y().toLowerCase();n&&(a=al(h)?"_blank":n),sl(h)&&(t=t||"http://localhost",c.scrollbars="yes");const l=Object.entries(c).reduce((e,[t,n])=>`${e}${t}=${n},`,"");if(function(e=y()){return dl(e)&&!!window.navigator?.standalone}(h)&&"_self"!==a)return function(e,t){const n=document.createElement("a");n.href=e,n.target=t;const i=document.createEvent("MouseEvent");i.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(i)}(t||"",a),new Lu(null);const u=window.open(t||"",a,l);bh(u,e,"popup-blocked");try{u.focus()}catch(d){}return new Lu(u)}const Mu="__/auth/handler",Uu="emulator/auth/handler",Vu=encodeURIComponent("fac");async function Fu(e,t,n,i,r,s){bh(e.config.authDomain,e,"auth-domain-config-required"),bh(e.config.apiKey,e,"invalid-api-key");const o={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:i,v:Ke,eventId:r};if(t instanceof kl){t.setDefaultLanguage(e.languageCode),o.providerId=t.providerId||"",function(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}(t.getCustomParameters())||(o.customParameters=JSON.stringify(t.getCustomParameters()));for(const[e,t]of Object.entries({}))o[e]=t}if(t instanceof Nl){const e=t.getScopes().filter(e=>""!==e);e.length>0&&(o.scopes=e.join(","))}e.tenantId&&(o.tid=e.tenantId);const a=o;for(const l of Object.keys(a))void 0===a[l]&&delete a[l];const c=await e._getAppCheckToken(),h=c?`#${Vu}=${encodeURIComponent(c)}`:"";return`${function({config:e}){if(!e.emulator)return`https://${e.authDomain}/${Mu}`;return kh(e,Uu)}(e)}?${A(a).slice(1)}${h}`}const ju="webStorageSupport";const Bu=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=zl,this._completeRedirectFn=mu,this._overrideRedirectResult=gu}async _openPopup(e,t,n,i){Th(this.eventManagers[e._key()]?.manager,"_initialize() not called before _openPopup()");return xu(e,await Fu(e,t,n,Eh(),i),Hl())}async _openRedirect(e,t,n,i){await this._originValidation(e);return function(e){Kl().location.href=e}(await Fu(e,t,n,Eh(),i)),new Promise(()=>{})}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:e,promise:n}=this.eventManagers[t];return e?Promise.resolve(e):(Th(n,"If manager is not set, promise should be"),n)}const n=this.initAndGetManager(e);return this.eventManagers[t]={promise:n},n.catch(()=>{delete this.eventManagers[t]}),n}async initAndGetManager(e){const t=await Pu(e),n=new yu(e);return t.register("authEvent",t=>{bh(t?.authEvent,e,"invalid-auth-event");return{status:n.onEvent(t.authEvent)?"ACK":"ERROR"}},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:n},this.iframes[e._key()]=t,n}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(ju,{type:ju},n=>{const i=n?.[0]?.[ju];void 0!==i&&t(!!i),mh(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=Iu(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return pl()||ol()||dl()}};var $u="@firebase/auth",zu="1.12.0";
1class qu{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){return this.assertAuthConfigured(),this.auth.currentUser?.uid||null}async getToken(e){if(this.assertAuthConfigured(),await this.auth._initializationPromise,!this.auth.currentUser)return null;return{accessToken:await this.auth.currentUser.getIdToken(e)}}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const t=this.auth.onIdTokenChanged(t=>{e(t?.stsTokenManager.accessToken||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){bh(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}const Hu=l("authIdTokenMaxAge")||300;let Gu=null;function Ku(e=Qe()){const t=ze(e,"auth");if(t.isInitialized())return t.getImmediate();const n=function(e,t){const n=ze(e,"auth");if(n.isInitialized()){const e=n.getImmediate();if(S(n.getOptions(),t??{}))return e;mh(e,"already-initialized")}return n.initialize({options:t})}(e,{popupRedirectResolver:Bu,persistence:[ru,Bl,zl]}),i=l("authTokenSyncURL");if(i&&"boolean"==typeof isSecureContext&&isSecureContext){const e=new URL(i,location.origin);if(location.origin===e.origin){const t=(r=e.toString(),async e=>{const t=e&&await e.getIdTokenResult(),n=t&&((new Date).getTime()-Date.parse(t.issuedAtTime))/1e3;if(n&&n>Hu)return;const i=t?.token;Gu!==i&&(Gu=i,await fetch(r,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))});!function(e,t,n){R(e).beforeAuthStateChanged(t,n)}(n,t,()=>t(n.currentUser)),function(e,t,n,i){R(e).onIdTokenChanged(t,n,i)}(n,e=>t(e))}}var r;const s=c("auth");return s&&Il(n,`http://${s}`),n}var Wu;bl={loadJS:e=>new Promise((t,n)=>{const i=document.createElement("script");i.setAttribute("src",e),i.onload=t,i.onerror=e=>{const t=yh("internal-error");t.customData=e,n(t)},i.type="text/javascript",i.charset="UTF-8",(document.getElementsByTagName("head")?.[0]??document).appendChild(i)}),gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="},Wu="Browser",$e(new P("auth",(e,{options:t})=>{const n=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),r=e.getProvider("app-check-internal"),{apiKey:s,authDomain:o}=n.options;bh(s&&!s.includes(":"),"invalid-api-key",{appName:n.name});const a={apiKey:s,authDomain:o,clientPlatform:Wu,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:gl(Wu)},c=new vl(n,i,r,a);return function(e,t){const n=t?.persistence||[],i=(Array.isArray(n)?n:[n]).map(Zh);t?.errorMap&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(i,t?.popupRedirectResolver)}(c,t),c},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,n)=>{e.getProvider("auth-internal").initialize()})),$e(new P("auth-internal",e=>{const t=wl(e.getProvider("auth").getImmediate());return new qu(t)},"PRIVATE").setInstantiationMode("EXPLICIT")),Je($u,zu,function(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}(Wu)),Je($u,zu,"esm2020");export{Rl as G,Pc as a,Ku as b,lh as c,Ac as d,vn as g,We as i,_n as l,eh as s};

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.