ozmoz 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +230 -0
- package/dist/cli.cjs +475 -0
- package/dist/index.js +319 -0
- package/dist/ozmoz-mcp.js +197 -0
- package/dist/ozmoz.iife.js +319 -0
- package/index.d.ts +131 -0
- package/package.json +39 -0
- package/scripts/setup-lib.cjs +748 -0
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
(()=>{var Xo=Object.defineProperty;var F=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(r){throw n=[r],r}};var Xr=(t,e)=>{for(var n in e)Xo(t,n,{get:e[n],enumerable:!0})};var Zr,Qr=F(()=>{Zr=()=>{}});function ea(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}function S(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function ii(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(S())}function si(){return typeof window<"u"||En()}function En(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function oi(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function ai(){let t=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof t=="object"&&t.id!==void 0}function ci(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function li(){let t=S();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}function ui(){try{return typeof indexedDB=="object"}catch{return!1}}function di(){return new Promise((t,e)=>{try{let n=!0,r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),n||self.indexedDB.deleteDatabase(r),t(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{e(i.error?.message||"")}}catch(n){e(n)}})}function sa(t,e){return t.replace(oa,(n,r)=>{let i=e[r];return i!=null?String(i):`<${r}?>`})}function hi(t){for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function re(t,e){if(t===e)return!0;let n=Object.keys(t),r=Object.keys(e);for(let i of n){if(!r.includes(i))return!1;let s=t[i],a=e[i];if(ei(s)&&ei(a)){if(!re(s,a))return!1}else if(s!==a)return!1}for(let i of r)if(!n.includes(i))return!1;return!0}function ei(t){return t!==null&&typeof t=="object"}function de(t){let e=[];for(let[n,r]of Object.entries(t))Array.isArray(r)?r.forEach(i=>{e.push(encodeURIComponent(n)+"="+encodeURIComponent(i))}):e.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}function ve(t){let e={};return t.replace(/^\?/,"").split("&").forEach(r=>{if(r){let[i,s]=r.split("=");e[decodeURIComponent(i)]=decodeURIComponent(s)}}),e}function Ae(t){let e=t.indexOf("?");if(!e)return"";let n=t.indexOf("#",e);return t.substring(e,n>0?n:void 0)}function fi(t,e){let n=new _n(t,e);return n.subscribe.bind(n)}function aa(t,e){if(typeof t!="object"||t===null)return!1;for(let n of e)if(n in t&&typeof t[n]=="function")return!0;return!1}function mn(){}function p(t){return t&&t._delegate?t._delegate:t}function mt(t){try{return(t.startsWith("http://")||t.startsWith("https://")?new URL(t).hostname:t).endsWith(".cloudworkstations.dev")}catch{return!1}}async function pi(t){return(await fetch(t,{credentials:"include"})).ok}var ti,Zo,ni,gn,Qo,In,Be,ta,na,ra,yn,ri,pt,bn,Te,ia,L,q,oa,_n,zu,Se=F(()=>{Qr();ti=function(t){let e=[],n=0;for(let r=0;r<t.length;r++){let i=t.charCodeAt(r);i<128?e[n++]=i:i<2048?(e[n++]=i>>6|192,e[n++]=i&63|128):(i&64512)===55296&&r+1<t.length&&(t.charCodeAt(r+1)&64512)===56320?(i=65536+((i&1023)<<10)+(t.charCodeAt(++r)&1023),e[n++]=i>>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=i&63|128):(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=i&63|128)}return e},Zo=function(t){let e=[],n=0,r=0;for(;n<t.length;){let i=t[n++];if(i<128)e[r++]=String.fromCharCode(i);else if(i>191&&i<224){let s=t[n++];e[r++]=String.fromCharCode((i&31)<<6|s&63)}else if(i>239&&i<365){let s=t[n++],a=t[n++],c=t[n++],l=((i&7)<<18|(s&63)<<12|(a&63)<<6|c&63)-65536;e[r++]=String.fromCharCode(55296+(l>>10)),e[r++]=String.fromCharCode(56320+(l&1023))}else{let s=t[n++],a=t[n++];e[r++]=String.fromCharCode((i&15)<<12|(s&63)<<6|a&63)}}return e.join("")},ni={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();let n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let i=0;i<t.length;i+=3){let s=t[i],a=i+1<t.length,c=a?t[i+1]:0,l=i+2<t.length,o=l?t[i+2]:0,d=s>>2,f=(s&3)<<4|c>>4,h=(c&15)<<2|o>>6,I=o&63;l||(I=64,a||(h=64)),r.push(n[d],n[f],n[h],n[I])}return r.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(ti(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):Zo(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();let n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let i=0;i<t.length;){let s=n[t.charAt(i++)],c=i<t.length?n[t.charAt(i)]:0;++i;let o=i<t.length?n[t.charAt(i)]:64;++i;let f=i<t.length?n[t.charAt(i)]:64;if(++i,s==null||c==null||o==null||f==null)throw new gn;let h=s<<2|c>>4;if(r.push(h),o!==64){let I=c<<4&240|o>>2;if(r.push(I),f!==64){let b=o<<6&192|f;r.push(b)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t<this.ENCODED_VALS.length;t++)this.byteToCharMap_[t]=this.ENCODED_VALS.charAt(t),this.charToByteMap_[this.byteToCharMap_[t]]=t,this.byteToCharMapWebSafe_[t]=this.ENCODED_VALS_WEBSAFE.charAt(t),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[t]]=t,t>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}},gn=class extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}},Qo=function(t){let e=ti(t);return ni.encodeByteArray(e,!0)},In=function(t){return Qo(t).replace(/\./g,"")},Be=function(t){try{return ni.decodeString(t,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};ta=()=>ea().__FIREBASE_DEFAULTS__,na=()=>{if(typeof process>"u"||typeof process.env>"u")return;let t=process.env.__FIREBASE_DEFAULTS__;if(t)return JSON.parse(t)},ra=()=>{if(typeof document>"u")return;let t;try{t=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}let e=t&&Be(t[1]);return e&&JSON.parse(e)},yn=()=>{try{return Zr()||ta()||na()||ra()}catch(t){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${t}`);return}},ri=t=>yn()?.emulatorHosts?.[t],pt=()=>yn()?.config,bn=t=>yn()?.[`_${t}`];Te=class{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}wrapCallback(e){return(n,r)=>{n?this.reject(n):this.resolve(r),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(n):e(n,r))}}};ia="FirebaseError",L=class t extends Error{constructor(e,n,r){super(n),this.code=e,this.customData=r,this.name=ia,Object.setPrototypeOf(this,t.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,q.prototype.create)}},q=class{constructor(e,n,r){this.service=e,this.serviceName=n,this.errors=r}create(e,...n){let r=n[0]||{},i=`${this.service}/${e}`,s=this.errors[e],a=s?sa(s,r):"Error",c=`${this.serviceName}: ${a} (${i}).`;return new L(i,c,r)}};oa=/\{\$([^}]+)}/g;_n=class{constructor(e,n){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=n,this.task.then(()=>{e(this)}).catch(r=>{this.error(r)})}next(e){this.forEachObserver(n=>{n.next(e)})}error(e){this.forEachObserver(n=>{n.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,n,r){let i;if(e===void 0&&n===void 0&&r===void 0)throw new Error("Missing Observer.");aa(e,["next","error","complete"])?i=e:i={next:e,error:n,complete:r},i.next===void 0&&(i.next=mn),i.error===void 0&&(i.error=mn),i.complete===void 0&&(i.complete=mn);let s=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch{}}),this.observers.push(i),s}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let n=0;n<this.observers.length;n++)this.sendOne(n,e)}sendOne(e,n){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{n(this.observers[e])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}};zu=14400*1e3;});function ca(t){return t===he?void 0:t}function la(t){return t.instantiationMode==="EAGER"}var W,he,wn,ze,gt=F(()=>{Se();W=class{constructor(e,n,r){this.name=e,this.instanceFactory=n,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}};he="[DEFAULT]";wn=class{constructor(e,n){this.name=e,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){let n=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(n)){let r=new Te;if(this.instancesDeferred.set(n,r),this.isInitialized(n)||this.shouldAutoInitialize())try{let i=this.getOrInitializeService({instanceIdentifier:n});i&&r.resolve(i)}catch{}}return this.instancesDeferred.get(n).promise}getImmediate(e){let n=this.normalizeInstanceIdentifier(e?.identifier),r=e?.optional??!1;if(this.isInitialized(n)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:n})}catch(i){if(r)return null;throw i}else{if(r)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(la(e))try{this.getOrInitializeService({instanceIdentifier:he})}catch{}for(let[n,r]of this.instancesDeferred.entries()){let i=this.normalizeInstanceIdentifier(n);try{let s=this.getOrInitializeService({instanceIdentifier:i});r.resolve(s)}catch{}}}}clearInstance(e=he){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){let e=Array.from(this.instances.values());await Promise.all([...e.filter(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...e.filter(n=>"_delete"in n).map(n=>n._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=he){return this.instances.has(e)}getOptions(e=he){return this.instancesOptions.get(e)||{}}initialize(e={}){let{options:n={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);let i=this.getOrInitializeService({instanceIdentifier:r,options:n});for(let[s,a]of this.instancesDeferred.entries()){let c=this.normalizeInstanceIdentifier(s);r===c&&a.resolve(i)}return i}onInit(e,n){let r=this.normalizeInstanceIdentifier(n),i=this.onInitCallbacks.get(r)??new Set;i.add(e),this.onInitCallbacks.set(r,i);let s=this.instances.get(r);return s&&e(s,r),()=>{i.delete(e)}}invokeOnInitCallbacks(e,n){let r=this.onInitCallbacks.get(n);if(r)for(let i of r)try{i(e,n)}catch{}}getOrInitializeService({instanceIdentifier:e,options:n={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:ca(e),options:n}),this.instances.set(e,r),this.instancesOptions.set(e,n),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=he){return this.component?this.component.multipleInstances?e:he:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}};ze=class{constructor(e){this.name=e,this.providers=new Map}addComponent(e){let n=this.getProvider(e.name);if(n.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);n.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);let n=new wn(e,this);return this.providers.set(e,n),n}getProviders(){return Array.from(this.providers.values())}}});function gi(t){Tn.forEach(e=>{e.setLogLevel(t)})}function _i(t,e){for(let n of Tn){let r=null;e&&e.level&&(r=mi[e.level]),t===null?n.userLogHandler=null:n.userLogHandler=(i,s,...a)=>{let c=a.map(l=>{if(l==null)return null;if(typeof l=="string")return l;if(typeof l=="number"||typeof l=="boolean")return l.toString();if(l instanceof Error)return l.message;try{return JSON.stringify(l)}catch{return null}}).filter(l=>l).join(" ");s>=(r??i.logLevel)&&t({level:m[s].toLowerCase(),message:c,args:a,type:i.name})}}}var Tn,m,mi,ua,da,ha,ke,_t=F(()=>{Tn=[];(function(t){t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT"})(m||(m={}));mi={debug:m.DEBUG,verbose:m.VERBOSE,info:m.INFO,warn:m.WARN,error:m.ERROR,silent:m.SILENT},ua=m.INFO,da={[m.DEBUG]:"log",[m.VERBOSE]:"log",[m.INFO]:"info",[m.WARN]:"warn",[m.ERROR]:"error"},ha=(t,e,...n)=>{if(e<t.logLevel)return;let r=new Date().toISOString(),i=da[e];if(i)console[i](`[${r}] ${t.name}:`,...n);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)},ke=class{constructor(e){this.name=e,this._logLevel=ua,this._logHandler=ha,this._userLogHandler=null,Tn.push(this)}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=typeof e=="string"?mi[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,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)}}});function pa(){return Ii||(Ii=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function ma(){return yi||(yi=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}function ga(t){let e=new Promise((n,r)=>{let i=()=>{t.removeEventListener("success",s),t.removeEventListener("error",a)},s=()=>{n(B(t.result)),i()},a=()=>{r(t.error),i()};t.addEventListener("success",s),t.addEventListener("error",a)});return e.then(n=>{n instanceof IDBCursor&&bi.set(n,t)}).catch(()=>{}),kn.set(e,t),e}function _a(t){if(An.has(t))return;let e=new Promise((n,r)=>{let i=()=>{t.removeEventListener("complete",s),t.removeEventListener("error",a),t.removeEventListener("abort",a)},s=()=>{n(),i()},a=()=>{r(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",s),t.addEventListener("error",a),t.addEventListener("abort",a)});An.set(t,e)}function wi(t){Sn=t(Sn)}function Ia(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...n){let r=t.call(It(this),e,...n);return Ei.set(r,e.sort?e.sort():[e]),B(r)}:ma().includes(t)?function(...e){return t.apply(It(this),e),B(bi.get(this))}:function(...e){return B(t.apply(It(this),e))}}function ya(t){return typeof t=="function"?Ia(t):(t instanceof IDBTransaction&&_a(t),fa(t,pa())?new Proxy(t,Sn):t)}function B(t){if(t instanceof IDBRequest)return ga(t);if(vn.has(t))return vn.get(t);let e=ya(t);return e!==t&&(vn.set(t,e),kn.set(e,t)),e}var fa,Ii,yi,bi,An,Ei,vn,kn,Sn,It,Pn=F(()=>{fa=(t,e)=>e.some(n=>t instanceof n);bi=new WeakMap,An=new WeakMap,Ei=new WeakMap,vn=new WeakMap,kn=new WeakMap;Sn={get(t,e,n){if(t instanceof IDBTransaction){if(e==="done")return An.get(t);if(e==="objectStoreNames")return t.objectStoreNames||Ei.get(t);if(e==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return B(t[e])},set(t,e,n){return t[e]=n,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};It=t=>kn.get(t)});function vi(t,e,{blocked:n,upgrade:r,blocking:i,terminated:s}={}){let a=indexedDB.open(t,e),c=B(a);return r&&a.addEventListener("upgradeneeded",l=>{r(B(a.result),l.oldVersion,l.newVersion,B(a.transaction),l)}),n&&a.addEventListener("blocked",l=>n(l.oldVersion,l.newVersion,l)),c.then(l=>{s&&l.addEventListener("close",()=>s()),i&&l.addEventListener("versionchange",o=>i(o.oldVersion,o.newVersion,o))}).catch(()=>{}),c}function Ti(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(Rn.get(e))return Rn.get(e);let n=e.replace(/FromIndex$/,""),r=e!==n,i=Ea.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||ba.includes(n)))return;let s=async function(a,...c){let l=this.transaction(a,i?"readwrite":"readonly"),o=l.store;return r&&(o=o.index(c.shift())),(await Promise.all([o[n](...c),i&&l.done]))[0]};return Rn.set(e,s),s}var ba,Ea,Rn,Ai=F(()=>{Pn();Pn();ba=["get","getKey","getAll","getAllKeys","count"],Ea=["put","add","delete","clear"],Rn=new Map;wi(t=>({...t,get:(e,n,r)=>Ti(e,n)||t.get(e,n,r),has:(e,n)=>!!Ti(e,n)||t.has(e,n)}))});function wa(t){return t.getComponent()?.type==="VERSION"}function Dn(t,e){try{t.container.addComponent(e)}catch(n){K.debug(`Component ${e.name} failed to register with FirebaseApp ${t.name}`,n)}}function Xa(t,e){t.container.addOrOverwriteComponent(e)}function fe(t){let e=t.name;if(Re.has(e))return K.debug(`There were multiple attempts to register component ${e}.`),!1;Re.set(e,t);for(let n of ie.values())Dn(n,t);for(let n of Pe.values())Dn(n,t);return!0}function Ge(t,e){let n=t.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),t.container.getProvider(e)}function Za(t,e,n=$e){Ge(t,e).clearInstance(n)}function Fn(t){return t.options!==void 0}function Ci(t){return Fn(t)?!1:"authIdToken"in t||"appCheckToken"in t||"releaseOnDeref"in t||"automaticDataCollectionEnabled"in t}function y(t){return t==null?!1:t.settings!==void 0}function Qa(){Re.clear()}function Si(t,e){let n=Be(t.split(".")[1]);if(n===null){console.error(`FirebaseServerApp ${e} is invalid: second part could not be parsed.`);return}if(JSON.parse(n).exp===void 0){console.error(`FirebaseServerApp ${e} is invalid: expiration claim could not be parsed`);return}let i=JSON.parse(n).exp*1e3,s=new Date().getTime();i-s<=0&&console.error(`FirebaseServerApp ${e} is invalid: the token has expired.`)}function Oi(t,e={}){let n=t;typeof e!="object"&&(e={name:e});let r={name:$e,automaticDataCollectionEnabled:!0,...e},i=r.name;if(typeof i!="string"||!i)throw N.create("bad-app-name",{appName:String(i)});if(n||(n=pt()),!n)throw N.create("no-options");let s=ie.get(i);if(s){if(re(n,s.options)&&re(r,s.config))return s;throw N.create("duplicate-app",{appName:i})}let a=new ze(i);for(let l of Re.values())a.addComponent(l);let c=new bt(n,r,a);return ie.set(i,c),c}function tc(t,e={}){if(si()&&!En())throw N.create("invalid-server-app-environment");let n,r=e||{};if(t&&(Fn(t)?n=t.options:Ci(t)?r=t:n=t),r.automaticDataCollectionEnabled===void 0&&(r.automaticDataCollectionEnabled=!0),n||(n=pt()),!n)throw N.create("no-options");let i={...r,...n};i.releaseOnDeref!==void 0&&delete i.releaseOnDeref;let s=d=>[...d].reduce((f,h)=>Math.imul(31,f)+h.charCodeAt(0)|0,0);if(r.releaseOnDeref!==void 0&&typeof FinalizationRegistry>"u")throw N.create("finalization-registry-not-supported",{});let a=""+s(JSON.stringify(i)),c=Pe.get(a);if(c)return c.incRefCount(r.releaseOnDeref),c;let l=new ze(a);for(let d of Re.values())l.addComponent(d);let o=new Ln(n,r,a,l);return Pe.set(a,o),o}function xn(t=$e){let e=ie.get(t);if(!e&&t===$e&&pt())return Oi();if(!e)throw N.create("no-app",{appName:t});return e}function nc(){return Array.from(ie.values())}async function Ni(t){let e=!1,n=t.name;ie.has(n)?(e=!0,ie.delete(n)):Pe.has(n)&&t.decRefCount()<=0&&(Pe.delete(n),e=!0),e&&(await Promise.all(t.container.getProviders().map(r=>r.delete())),t.isDeleted=!0)}function z(t,e,n){let r=Ya[t]??t;n&&(r+=`-${n}`);let i=r.match(/\s|\//),s=e.match(/\s|\//);if(i||s){let a=[`Unable to register library "${r}" with version "${e}":`];i&&a.push(`library name "${r}" contains illegal characters (whitespace or "/")`),i&&s&&a.push("and"),s&&a.push(`version name "${e}" contains illegal characters (whitespace or "/")`),K.warn(a.join(" "));return}fe(new W(`${r}-version`,()=>({library:r,version:e}),"VERSION"))}function rc(t,e){if(t!==null&&typeof t!="function")throw N.create("invalid-log-argument");_i(t,e)}function ic(t){gi(t)}function Di(){return Cn||(Cn=vi(sc,oc,{upgrade:(t,e)=>{switch(e){case 0:try{t.createObjectStore(je)}catch(n){console.warn(n)}}}}).catch(t=>{throw N.create("idb-open",{originalErrorMessage:t.message})})),Cn}async function ac(t){try{let n=(await Di()).transaction(je),r=await n.objectStore(je).get(Li(t));return await n.done,r}catch(e){if(e instanceof L)K.warn(e.message);else{let n=N.create("idb-get",{originalErrorMessage:e?.message});K.warn(n.message)}}}async function ki(t,e){try{let r=(await Di()).transaction(je,"readwrite");await r.objectStore(je).put(e,Li(t)),await r.done}catch(n){if(n instanceof L)K.warn(n.message);else{let r=N.create("idb-set",{originalErrorMessage:n?.message});K.warn(r.message)}}}function Li(t){return`${t.name}!${t.options.appId}`}function Pi(){return new Date().toISOString().substring(0,10)}function uc(t,e=cc){let n=[],r=t.slice();for(let i of t){let s=n.find(a=>a.agent===i.agent);if(s){if(s.dates.push(i.date),Ri(n)>e){s.dates.pop();break}}else if(n.push({agent:i.agent,dates:[i.date]}),Ri(n)>e){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}function Ri(t){return In(JSON.stringify({version:2,heartbeats:t})).length}function dc(t){if(t.length===0)return-1;let e=0,n=t[0].date;for(let r=1;r<t.length;r++)t[r].date<n&&(n=t[r].date,e=r);return e}function hc(t){fe(new W("platform-logger",e=>new On(e),"PRIVATE")),fe(new W("heartbeat",e=>new Mn(e),"PRIVATE")),z(yt,Nn,t),z(yt,Nn,"esm2020"),z("fire-js","")}var On,yt,Nn,K,Ta,va,Aa,Sa,ka,Pa,Ra,Ca,Oa,Na,Da,La,Ma,Ua,Fa,xa,Va,Ha,Wa,Ba,za,$a,ja,Ga,qa,Ka,Ja,$e,Ya,ie,Pe,Re,ec,N,bt,Ln,pe,sc,oc,je,Cn,cc,lc,Mn,Un,qe=F(()=>{gt();_t();Se();Se();Ai();On=class{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(wa(n)){let r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}};yt="@firebase/app",Nn="0.15.1";K=new ke("@firebase/app"),Ta="@firebase/app-compat",va="@firebase/analytics-compat",Aa="@firebase/analytics",Sa="@firebase/app-check-compat",ka="@firebase/app-check",Pa="@firebase/auth",Ra="@firebase/auth-compat",Ca="@firebase/database",Oa="@firebase/data-connect",Na="@firebase/database-compat",Da="@firebase/functions",La="@firebase/functions-compat",Ma="@firebase/installations",Ua="@firebase/installations-compat",Fa="@firebase/messaging",xa="@firebase/messaging-compat",Va="@firebase/performance",Ha="@firebase/performance-compat",Wa="@firebase/remote-config",Ba="@firebase/remote-config-compat",za="@firebase/storage",$a="@firebase/storage-compat",ja="@firebase/firestore",Ga="@firebase/ai",qa="@firebase/firestore-compat",Ka="firebase",Ja="12.16.0";$e="[DEFAULT]",Ya={[yt]:"fire-core",[Ta]:"fire-core-compat",[Aa]:"fire-analytics",[va]:"fire-analytics-compat",[ka]:"fire-app-check",[Sa]:"fire-app-check-compat",[Pa]:"fire-auth",[Ra]:"fire-auth-compat",[Ca]:"fire-rtdb",[Oa]:"fire-data-connect",[Na]:"fire-rtdb-compat",[Da]:"fire-fn",[La]:"fire-fn-compat",[Ma]:"fire-iid",[Ua]:"fire-iid-compat",[Fa]:"fire-fcm",[xa]:"fire-fcm-compat",[Va]:"fire-perf",[Ha]:"fire-perf-compat",[Wa]:"fire-rc",[Ba]:"fire-rc-compat",[za]:"fire-gcs",[$a]:"fire-gcs-compat",[ja]:"fire-fst",[qa]:"fire-fst-compat",[Ga]:"fire-vertex","fire-js":"fire-js",[Ka]:"fire-js-all"};ie=new Map,Pe=new Map,Re=new Map;ec={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},N=new q("app","Firebase",ec);bt=class{constructor(e,n,r){this._isDeleted=!1,this._options={...e},this._config={...n},this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new W("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 N.create("app-deleted",{appName:this._name})}};Ln=class extends bt{constructor(e,n,r,i){let s=n.automaticDataCollectionEnabled!==void 0?n.automaticDataCollectionEnabled:!0,a={name:r,automaticDataCollectionEnabled:s};if(e.apiKey!==void 0)super(e,a,i);else{let c=e;super(c.options,a,i)}this._serverConfig={automaticDataCollectionEnabled:s,...n},this._serverConfig.authIdToken&&Si(this._serverConfig.authIdToken,"authIdToken"),this._serverConfig.appCheckToken&&Si(this._serverConfig.appCheckToken,"appCheckToken"),this._finalizationRegistry=null,typeof FinalizationRegistry<"u"&&(this._finalizationRegistry=new FinalizationRegistry(()=>{this.automaticCleanup()})),this._refCount=0,this.incRefCount(this._serverConfig.releaseOnDeref),this._serverConfig.releaseOnDeref=void 0,n.releaseOnDeref=void 0,z(yt,Nn,"serverapp")}toJSON(){}get refCount(){return this._refCount}incRefCount(e){this.isDeleted||(this._refCount++,e!==void 0&&this._finalizationRegistry!==null&&this._finalizationRegistry.register(e,this))}decRefCount(){return this.isDeleted?0:--this._refCount}automaticCleanup(){Ni(this)}get settings(){return this.checkDestroyed(),this._serverConfig}checkDestroyed(){if(this.isDeleted)throw N.create("server-app-deleted")}};pe=Ja;sc="firebase-heartbeat-database",oc=1,je="firebase-heartbeat-store",Cn=null;cc=1024,lc=30,Mn=class{constructor(e){this.container=e,this._heartbeatsCache=null;let n=this.container.getProvider("app").getImmediate();this._storage=new Un(n),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){try{let n=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),r=Pi();if(this._heartbeatsCache?.heartbeats==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,this._heartbeatsCache?.heartbeats==null)||this._heartbeatsCache.lastSentHeartbeatDate===r||this._heartbeatsCache.heartbeats.some(i=>i.date===r))return;if(this._heartbeatsCache.heartbeats.push({date:r,agent:n}),this._heartbeatsCache.heartbeats.length>lc){let i=dc(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(i,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(e){K.warn(e)}}async getHeartbeatsHeader(){try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,this._heartbeatsCache?.heartbeats==null||this._heartbeatsCache.heartbeats.length===0)return"";let e=Pi(),{heartbeatsToSend:n,unsentEntries:r}=uc(this._heartbeatsCache.heartbeats),i=In(JSON.stringify({version:2,heartbeats:n}));return this._heartbeatsCache.lastSentHeartbeatDate=e,r.length>0?(this._heartbeatsCache.heartbeats=r,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),i}catch(e){return K.warn(e),""}}};Un=class{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return ui()?di().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){let n=await ac(this.app);return n?.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){if(await this._canUseIndexedDBPromise){let r=await this.read();return ki(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){if(await this._canUseIndexedDBPromise){let r=await this.read();return ki(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...e.heartbeats]})}else return}};hc("")});var Mi={};Xr(Mi,{FirebaseError:()=>L,SDK_VERSION:()=>pe,_DEFAULT_ENTRY_NAME:()=>$e,_addComponent:()=>Dn,_addOrOverwriteComponent:()=>Xa,_apps:()=>ie,_clearComponents:()=>Qa,_components:()=>Re,_getProvider:()=>Ge,_isFirebaseApp:()=>Fn,_isFirebaseServerApp:()=>y,_isFirebaseServerAppSettings:()=>Ci,_registerComponent:()=>fe,_removeServiceInstance:()=>Za,_serverApps:()=>Pe,deleteApp:()=>Ni,getApp:()=>xn,getApps:()=>nc,initializeApp:()=>Oi,initializeServerApp:()=>tc,onLog:()=>rc,registerVersion:()=>z,setLogLevel:()=>ic});var fc,pc,Ui=F(()=>{qe();qe();fc="firebase",pc="12.16.0";z(fc,pc,"app")});function mc(){return{"admin-restricted-operation":"This operation is restricted to administrators only.","argument-error":"","app-not-authorized":"This app, identified by the domain where it's hosted, is not authorized to use Firebase Authentication with the provided API key. Review your key configuration in the Google API console.","app-not-installed":"The requested mobile application corresponding to the identifier (Android package name or iOS bundle ID) provided is not installed on this device.","captcha-check-failed":"The reCAPTCHA response token provided is either invalid, expired, already used or the domain associated with it does not match the list of whitelisted domains.","code-expired":"The SMS code has expired. Please re-send the verification code to try again.","cordova-not-ready":"Cordova framework is not ready.","cors-unsupported":"This browser is not supported.","credential-already-in-use":"This credential is already associated with a different user account.","custom-token-mismatch":"The custom token corresponds to a different audience.","requires-recent-login":"This operation is sensitive and requires recent authentication. Log in again before retrying this request.","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.","dynamic-link-not-activated":"Please activate Dynamic Links in the Firebase Console and agree to the terms and conditions.","email-change-needs-verification":"Multi-factor users must always have a verified email.","email-already-in-use":"The email address is already in use by another account.","emulator-config-failed":'Auth instance has already been used to make a network call. Auth can no longer be configured to use the emulator. Try calling "connectAuthEmulator()" sooner.',"expired-action-code":"The action code has expired.","cancelled-popup-request":"This operation has been cancelled due to another conflicting popup being opened.","internal-error":"An internal AuthError has occurred.","invalid-app-credential":"The phone verification request contains an invalid application verifier. The reCAPTCHA token response is either invalid or expired.","invalid-app-id":"The mobile app identifier is not registered for the current project.","invalid-user-token":"This user's credential isn't valid for this project. This can happen if the user's token has been tampered with, or if the user isn't for the project associated with this API key.","invalid-auth-event":"An internal AuthError has occurred.","invalid-verification-code":"The SMS verification code used to create the phone auth credential is invalid. Please resend the verification code sms and be sure to use the verification code provided by the user.","invalid-continue-uri":"The continue URL provided in the request is invalid.","invalid-cordova-configuration":"The following Cordova plugins must be installed to enable OAuth sign-in: cordova-plugin-buildinfo, cordova-universal-links-plugin, cordova-plugin-browsertab, cordova-plugin-inappbrowser and cordova-plugin-customurlscheme.","invalid-custom-token":"The custom token format is incorrect. Please check the documentation.","invalid-dynamic-link-domain":"The provided dynamic link domain is not configured or authorized for the current project.","invalid-email":"The email address is badly formatted.","invalid-emulator-scheme":"Emulator URL must start with a valid scheme (http:// or https://).","invalid-api-key":"Your API key is invalid, please check you have copied it correctly.","invalid-cert-hash":"The SHA-1 certificate hash provided is invalid.","invalid-credential":"The supplied auth credential is incorrect, malformed or has expired.","invalid-message-payload":"The email template corresponding to this action contains invalid characters in its message. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-multi-factor-session":"The request does not contain a valid proof of first factor successful sign-in.","invalid-oauth-provider":"EmailAuthProvider is not supported for this operation. This operation only supports OAuth providers.","invalid-oauth-client-id":"The OAuth client ID provided is either invalid or does not match the specified API key.","unauthorized-domain":"This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console.","invalid-action-code":"The action code is invalid. This can happen if the code is malformed, expired, or has already been used.","wrong-password":"The password is invalid or the user does not have a password.","invalid-persistence-type":"The specified persistence type is invalid. It can only be local, session or none.","invalid-phone-number":"The format of the phone number provided is incorrect. Please enter the phone number in a format that can be parsed into E.164 format. E.164 phone numbers are written in the format [+][country code][subscriber number including area code].","invalid-provider-id":"The specified provider ID is invalid.","invalid-recipient-email":"The email corresponding to this action failed to send as the provided recipient email address is invalid.","invalid-sender":"The email template corresponding to this action contains an invalid sender email or name. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-verification-id":"The verification ID used to create the phone auth credential is invalid.","invalid-tenant-id":"The Auth instance's tenant ID is invalid.","login-blocked":"Login blocked by user-provided method: {$originalMessage}","missing-android-pkg-name":"An Android Package Name must be provided if the Android App is required to be installed.","auth-domain-config-required":"Be sure to include authDomain when calling firebase.initializeApp(), by following the instructions in the Firebase console.","missing-app-credential":"The phone verification request is missing an application verifier assertion. A reCAPTCHA response token needs to be provided.","missing-verification-code":"The phone auth credential was created with an empty SMS verification code.","missing-continue-uri":"A continue URL must be provided in the request.","missing-iframe-start":"An internal AuthError has occurred.","missing-ios-bundle-id":"An iOS Bundle ID must be provided if an App Store ID is provided.","missing-or-invalid-nonce":"The request does not contain a valid nonce. This can occur if the SHA-256 hash of the provided raw nonce does not match the hashed nonce in the ID token payload.","missing-password":"A non-empty password must be provided","missing-multi-factor-info":"No second factor identifier is provided.","missing-multi-factor-session":"The request is missing proof of first factor successful sign-in.","missing-phone-number":"To send verification codes, provide a phone number for the recipient.","missing-verification-id":"The phone auth credential was created with an empty verification ID.","app-deleted":"This instance of FirebaseApp has been deleted.","multi-factor-info-not-found":"The user does not have a second factor matching the identifier provided.","multi-factor-auth-required":"Proof of ownership of a second factor is required to complete sign-in.","account-exists-with-different-credential":"An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address.","network-request-failed":"A network AuthError (such as timeout, interrupted connection or unreachable host) has occurred.","no-auth-event":"An internal AuthError has occurred.","no-such-provider":"User was not linked to an account with the given provider.","null-user":"A null user object was provided as the argument for an operation which requires a non-null user object.","operation-not-allowed":"The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section.","operation-not-supported-in-this-environment":'This operation is not supported in the environment this application is running on. "location.protocol" must be http, https or chrome-extension and web storage must be enabled.',"popup-blocked":"Unable to establish a connection with the popup. It may have been blocked by the browser.","popup-closed-by-user":"The popup has been closed by the user before finalizing the operation.","provider-already-linked":"User can only be linked to one identity for the given provider.","quota-exceeded":"The project's quota for this operation has been exceeded.","redirect-cancelled-by-user":"The redirect operation has been cancelled by the user before finalizing.","redirect-operation-pending":"A redirect sign-in operation is already pending.","rejected-credential":"The request contains malformed or mismatching credentials.","second-factor-already-in-use":"The second factor is already enrolled on this account.","maximum-second-factor-count-exceeded":"The maximum allowed number of second factors on a user has been exceeded.","tenant-id-mismatch":"The provided tenant ID does not match the Auth instance's tenant ID",timeout:"The operation has timed out.","user-token-expired":"The user's credential is no longer valid. The user must sign in again.","too-many-requests":"We have blocked all requests from this device due to unusual activity. Try again later.","unauthorized-continue-uri":"The domain of the continue URL is not whitelisted. Please whitelist the domain in the Firebase console.","unsupported-first-factor":"Enrolling a second factor or signing in with a multi-factor account requires sign-in with a supported first factor.","unsupported-persistence-type":"The current environment does not support the specified persistence type.","unsupported-tenant-operation":"This operation is not supported in a multi-tenant context.","unverified-email":"The operation requires a verified email.","user-cancelled":"The user did not grant your application the permissions it requested.","user-not-found":"There is no user record corresponding to this identifier. The user may have been deleted.","user-disabled":"The user account has been disabled by an administrator.","user-mismatch":"The supplied credentials do not correspond to the previously signed in user.","user-signed-out":"","weak-password":"The password must be 6 characters long or more.","web-storage-unsupported":"This browser is not supported or 3rd party cookies and data may be disabled.","already-initialized":"initializeAuth() has already been called with different options. To avoid this error, call initializeAuth() with the same options as when it was originally called, or call getAuth() to return the already initialized instance.","missing-recaptcha-token":"The reCAPTCHA token is missing when sending request to the backend.","invalid-recaptcha-token":"The reCAPTCHA token is invalid when sending request to the backend.","invalid-recaptcha-action":"The reCAPTCHA action is invalid when sending request to the backend.","recaptcha-not-enabled":"reCAPTCHA Enterprise integration is not enabled for this project.","missing-client-type":"The reCAPTCHA client type is missing when sending request to the backend.","missing-recaptcha-version":"The reCAPTCHA version is missing when sending request to the backend.","invalid-req-type":"Invalid request parameters.","invalid-recaptcha-version":"The reCAPTCHA version is invalid when sending request to the backend.","unsupported-password-policy-schema-version":"The password policy received from the backend uses a schema version that is not supported by this version of the Firebase SDK.","password-does-not-meet-requirements":"The password does not meet the requirements.","invalid-hosting-link-domain":"The provided Hosting link domain is not configured in Firebase Hosting or is not owned by the current project. This cannot be a default Hosting domain (`web.app` or `firebaseapp.com`)."}}function cs(){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."}}function gc(t,...e){kt.logLevel<=m.WARN&&kt.warn(`Auth (${pe}): ${t}`,...e)}function Tt(t,...e){kt.logLevel<=m.ERROR&&kt.error(`Auth (${pe}): ${t}`,...e)}function R(t,...e){throw br(t,...e)}function k(t,...e){return br(t,...e)}function yr(t,e,n){let r={...Ir(),[e]:n};return new q("auth","Firebase",r).create(e,{appName:t.name})}function A(t){return yr(t,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function Fe(t,e,n){let r=n;if(!(e instanceof r))throw r.name!==e.constructor.name&&R(t,"argument-error"),yr(t,"argument-error",`Type of ${e.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function br(t,...e){if(typeof t!="string"){let n=e[0],r=[...e.slice(1)];return r[0]&&(r[0].appName=t.name),t._errorFactory.create(n,...r)}return us.create(t,...e)}function u(t,e,...n){if(!t)throw br(e,...n)}function $(t){let e="INTERNAL ASSERTION FAILED: "+t;throw Tt(e),new Error(e)}function X(t,e){t||$(e)}function et(){return typeof self<"u"&&self.location?.href||""}function Er(){return Fi()==="http:"||Fi()==="https:"}function Fi(){return typeof self<"u"&&self.location?.protocol||null}function _c(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(Er()||ai()||"connection"in navigator)?navigator.onLine:!0}function Ic(){if(typeof navigator>"u")return null;let t=navigator;return t.languages&&t.languages[0]||t.language||null}function wr(t,e){X(t.emulator,"Emulator should always be set here");let{url:n}=t.emulator;return e?`${n}${e.startsWith("/")?e.slice(1):e}`:n}function g(t,e){return t.tenantId&&!e.tenantId?{...e,tenantId:t.tenantId}:e}async function _(t,e,n,r,i={}){return hs(t,i,async()=>{let s={},a={};r&&(e==="GET"?a=r:s={body:JSON.stringify(r)});let c=de({...a,key:t.config.apiKey}).slice(1),l=await t._getAdditionalHeaders();l["Content-Type"]="application/json",t.languageCode&&(l["X-Firebase-Locale"]=t.languageCode);let o={method:e,headers:l,...s};return oi()||(o.referrerPolicy="strict-origin-when-cross-origin"),t.emulatorConfig&&mt(t.emulatorConfig.host)&&(o.credentials="include"),Pt.fetch()(await fs(t,t.config.apiHost,n,c),o)})}async function hs(t,e,n){t._canInitEmulator=!1;let r={...yc,...e};try{let i=new Gn(t),s=await Promise.race([n(),i.promise]);i.clearNetworkTimeout();let a=await s.json();if("needConfirmation"in a)throw Je(t,"account-exists-with-different-credential",a);if(s.ok&&!("errorMessage"in a))return a;{let c=s.ok?a.errorMessage:a.error.message,[l,o]=c.split(" : ");if(l==="FEDERATED_USER_ID_ALREADY_LINKED")throw Je(t,"credential-already-in-use",a);if(l==="EMAIL_EXISTS")throw Je(t,"email-already-in-use",a);if(l==="USER_DISABLED")throw Je(t,"user-disabled",a);let d=r[l]||l.toLowerCase().replace(/[_\s]+/g,"-");if(o)throw yr(t,d,o);R(t,d)}}catch(i){if(i instanceof L)throw i;R(t,"network-request-failed",{message:String(i)})}}async function te(t,e,n,r,i={}){let s=await _(t,e,n,r,i);return"mfaPendingCredential"in s&&R(t,"multi-factor-auth-required",{_serverResponse:s}),s}async function fs(t,e,n,r){let i=`${e}${n}?${r}`,s=t,a=s.config.emulator?wr(t.config,i):`${t.config.apiScheme}://${i}`;return bc.includes(n)&&(await s._persistenceManagerAvailable,s._getPersistenceType()==="COOKIE")?s._getPersistence()._getFinalTarget(a).toString():a}function wc(t){switch(t){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}function Je(t,e,n){let r={appName:t.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);let i=k(t,e,r);return i.customData._tokenResponse=n,i}function xi(t){return t!==void 0&&t.getResponse!==void 0}function Vi(t){return t!==void 0&&t.enterprise!==void 0}async function Tc(t){return(await _(t,"GET","/v1/recaptchaParams")).recaptchaSiteKey||""}async function ps(t,e){return _(t,"GET","/v2/recaptchaConfig",g(t,e))}async function vc(t,e){return _(t,"POST","/v1/accounts:delete",e)}async function Ac(t,e){return _(t,"POST","/v1/accounts:update",e)}async function Ct(t,e){return _(t,"POST","/v1/accounts:lookup",e)}function Ye(t){if(t)try{let e=new Date(Number(t));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}function ms(t,e=!1){return p(t).getIdToken(e)}async function Tr(t,e=!1){let n=p(t),r=await n.getIdToken(e),i=Qt(r);u(i&&i.exp&&i.auth_time&&i.iat,n.auth,"internal-error");let s=typeof i.firebase=="object"?i.firebase:void 0,a=s?.sign_in_provider;return{claims:i,token:r,authTime:Ye(Vn(i.auth_time)),issuedAtTime:Ye(Vn(i.iat)),expirationTime:Ye(Vn(i.exp)),signInProvider:a||null,signInSecondFactor:s?.sign_in_second_factor||null}}function Vn(t){return Number(t)*1e3}function Qt(t){let[e,n,r]=t.split(".");if(e===void 0||n===void 0||r===void 0)return Tt("JWT malformed, contained fewer than 3 sections"),null;try{let i=Be(n);return i?JSON.parse(i):(Tt("Failed to decode base64 JWT payload"),null)}catch(i){return Tt("Caught error parsing JWT payload as JSON",i?.toString()),null}}function Hi(t){let e=Qt(t);return u(e,"internal-error"),u(typeof e.exp<"u","internal-error"),u(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}async function Z(t,e,n=!1){if(n)return e;try{return await e}catch(r){throw r instanceof L&&Sc(r)&&t.auth.currentUser===t&&await t.auth.signOut(),r}}function Sc({code:t}){return t==="auth/user-disabled"||t==="auth/user-token-expired"}async function nt(t){let e=t.auth,n=await t.getIdToken(),r=await Z(t,Ct(e,{idToken:n}));u(r?.users.length,e,"internal-error");let i=r.users[0];t._notifyReloadListener(i);let s=i.providerUserInfo?.length?gs(i.providerUserInfo):[],a=kc(t.providerData,s),c=t.isAnonymous,l=!(t.email&&i.passwordHash)&&!a?.length,o=c?l:!1,d={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:a,metadata:new tt(i.createdAt,i.lastLoginAt),isAnonymous:o};Object.assign(t,d)}async function vr(t){let e=p(t);await nt(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function kc(t,e){return[...t.filter(r=>!e.some(i=>i.providerId===r.providerId)),...e]}function gs(t){return t.map(({providerId:e,...n})=>({providerId:e,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}))}async function Pc(t,e){let n=await hs(t,{},async()=>{let r=de({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:s}=t.config,a=await fs(t,i,"/v1/token",`key=${s}`),c=await t._getAdditionalHeaders();c["Content-Type"]="application/x-www-form-urlencoded";let l={method:"POST",headers:c,body:r};return t.emulatorConfig&&mt(t.emulatorConfig.host)&&(l.credentials="include"),Pt.fetch()(a,l)});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}async function Rc(t,e){return _(t,"POST","/v2/accounts:revokeToken",g(t,e))}function se(t,e){u(typeof t=="string"||typeof t>"u","internal-error",{appName:e})}function J(t){X(t instanceof Function,"Expected a class definition");let e=Wi.get(t);return e?(X(e instanceof t,"Instance stored in cache mismatched with class"),e):(e=new t,Wi.set(t,e),e)}function vt(t,e,n){return`firebase:${t}:${e}:${n}`}function Bi(t){let e=t.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(bs(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(_s(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(ws(e))return"Blackberry";if(Ts(e))return"Webos";if(Is(e))return"Safari";if((e.includes("chrome/")||ys(e))&&!e.includes("edge/"))return"Chrome";if(Es(e))return"Android";{let n=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=t.match(n);if(r?.length===2)return r[1]}return"Other"}function _s(t=S()){return/firefox\//i.test(t)}function Is(t=S()){let e=t.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function ys(t=S()){return/crios\//i.test(t)}function bs(t=S()){return/iemobile/i.test(t)}function Es(t=S()){return/android/i.test(t)}function ws(t=S()){return/blackberry/i.test(t)}function Ts(t=S()){return/webos/i.test(t)}function Ar(t=S()){return/iphone|ipad|ipod/i.test(t)||/macintosh/i.test(t)&&/mobile/i.test(t)}function Cc(t=S()){return Ar(t)&&!!window.navigator?.standalone}function Oc(){return li()&&document.documentMode===10}function vs(t=S()){return Ar(t)||Es(t)||Ts(t)||ws(t)||/windows phone/i.test(t)||bs(t)}function As(t,e=[]){let n;switch(t){case"Browser":n=Bi(S());break;case"Worker":n=`${Bi(S())}-${t}`;break;default:n=t}let r=e.length?e.join(","):"FirebaseCore-web";return`${n}/JsCore/${pe}/${r}`}async function Nc(t,e={}){return _(t,"GET","/v2/passwordPolicy",g(t,e))}function E(t){return p(t)}function Lc(t){lt=t}function Sr(t){return lt.loadJS(t)}function Mc(){return lt.recaptchaV2Script}function Uc(){return lt.recaptchaEnterpriseScript}function Fc(){return lt.gapiScript}function Ss(t){return`__${t}${Math.floor(Math.random()*1e6)}`}function Hc(t){let e=[],n="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(let r=0;r<t;r++)e.push(n.charAt(Math.floor(Math.random()*n.length)));return e.join("")}async function Ke(t,e,n,r=!1,i=!1){let s=new rt(t),a;if(i)a=Ze;else try{a=await s.verify(n)}catch{a=await s.verify(n,!0)}let c={...e};if(n==="mfaSmsEnrollment"||n==="mfaSmsSignIn"){if("phoneEnrollmentInfo"in c){let l=c.phoneEnrollmentInfo.phoneNumber,o=c.phoneEnrollmentInfo.recaptchaToken;Object.assign(c,{phoneEnrollmentInfo:{phoneNumber:l,recaptchaToken:o,captchaResponse:a,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}else if("phoneSignInInfo"in c){let l=c.phoneSignInInfo.recaptchaToken;Object.assign(c,{phoneSignInInfo:{recaptchaToken:l,captchaResponse:a,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}return c}return r?Object.assign(c,{captchaResp:a}):Object.assign(c,{captchaResponse:a}),Object.assign(c,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(c,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),c}async function ae(t,e,n,r,i){if(i==="EMAIL_PASSWORD_PROVIDER")if(t._getRecaptchaConfig()?.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){let s=await Ke(t,e,n,n==="getOobCode");return r(t,s)}else return r(t,e).catch(async s=>{if(s.code==="auth/missing-recaptcha-token"){console.log(`${n} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);let a=await Ke(t,e,n,n==="getOobCode");return r(t,a)}else return Promise.reject(s)});else if(i==="PHONE_PROVIDER")if(t._getRecaptchaConfig()?.isProviderEnabled("PHONE_PROVIDER")){let s=await Ke(t,e,n);return r(t,s).catch(async a=>{if(t._getRecaptchaConfig()?.getProviderEnforcementState("PHONE_PROVIDER")==="AUDIT"&&(a.code==="auth/missing-recaptcha-token"||a.code==="auth/invalid-app-credential")){console.log(`Failed to verify with reCAPTCHA Enterprise. Automatically triggering the reCAPTCHA v2 flow to complete the ${n} flow.`);let c=await Ke(t,e,n,!1,!0);return r(t,c)}return Promise.reject(a)})}else{let s=await Ke(t,e,n,!1,!0);return r(t,s)}else return Promise.reject(i+" provider is not supported.")}async function ks(t){let e=E(t),n=await ps(e,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}),r=new Rt(n);e.tenantId==null?e._agentRecaptchaConfig=r:e._tenantRecaptchaConfigs[e.tenantId]=r,r.isAnyProviderEnabled()&&new rt(e).verify()}function kr(t,e){let n=Ge(t,"auth");if(n.isInitialized()){let i=n.getImmediate(),s=n.getOptions();if(re(s,e??{}))return i;R(i,"already-initialized")}return n.initialize({options:e})}function Bc(t,e){let n=e?.persistence||[],r=(Array.isArray(n)?n:[n]).map(J);e?.errorMap&&t._updateErrorMap(e.errorMap),t._initializeWithPersistence(r,e?.popupRedirectResolver)}function Pr(t,e,n){let r=E(t);u(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");let i=!!n?.disableWarnings,s=Ps(e),{host:a,port:c}=zc(e),l=c===null?"":`:${c}`,o={url:`${s}//${a}${l}/`},d=Object.freeze({host:a,port:c,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:i})});if(!r._canInitEmulator){u(r.config.emulator&&r.emulatorConfig,r,"emulator-config-failed"),u(re(o,r.config.emulator)&&re(d,r.emulatorConfig),r,"emulator-config-failed");return}r.config.emulator=o,r.emulatorConfig=d,r.settings.appVerificationDisabledForTesting=!0,mt(a)?pi(`${s}//${a}${l}`):i||$c()}function Ps(t){let e=t.indexOf(":");return e<0?"":t.substr(0,e+1)}function zc(t){let e=Ps(t),n=/(\/\/)?([^?#/]+)/.exec(t.substr(e.length));if(!n)return{host:"",port:null};let r=n[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){let s=i[1];return{host:s,port:$i(r.substr(s.length+1))}}else{let[s,a]=r.split(":");return{host:s,port:$i(a)}}}function $i(t){if(!t)return null;let e=Number(t);return isNaN(e)?null:e}function $c(){function t(){let e=document.createElement("p"),n=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",n.position="fixed",n.width="100%",n.backgroundColor="#ffffff",n.border=".1em solid #000000",n.color="#b50000",n.bottom="0px",n.left="0px",n.margin="0px",n.zIndex="10000",n.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",t):t())}async function Rs(t,e){return _(t,"POST","/v1/accounts:resetPassword",g(t,e))}async function jc(t,e){return _(t,"POST","/v1/accounts:update",e)}async function Gc(t,e){return _(t,"POST","/v1/accounts:signUp",e)}async function qc(t,e){return _(t,"POST","/v1/accounts:update",g(t,e))}async function Kc(t,e){return te(t,"POST","/v1/accounts:signInWithPassword",g(t,e))}async function en(t,e){return _(t,"POST","/v1/accounts:sendOobCode",g(t,e))}async function Jc(t,e){return en(t,e)}async function Yc(t,e){return en(t,e)}async function Xc(t,e){return en(t,e)}async function Zc(t,e){return en(t,e)}async function Qc(t,e){return te(t,"POST","/v1/accounts:signInWithEmailLink",g(t,e))}async function el(t,e){return te(t,"POST","/v1/accounts:signInWithEmailLink",g(t,e))}async function Y(t,e){return te(t,"POST","/v1/accounts:signInWithIdp",g(t,e))}async function ji(t,e){return _(t,"POST","/v1/accounts:sendVerificationCode",g(t,e))}async function nl(t,e){return te(t,"POST","/v1/accounts:signInWithPhoneNumber",g(t,e))}async function rl(t,e){let n=await te(t,"POST","/v1/accounts:signInWithPhoneNumber",g(t,e));if(n.temporaryProof)throw Je(t,"account-exists-with-different-credential",n);return n}async function sl(t,e){let n={...e,operation:"REAUTH"};return te(t,"POST","/v1/accounts:signInWithPhoneNumber",g(t,n),il)}function ol(t){switch(t){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}function al(t){let e=ve(Ae(t)).link,n=e?ve(Ae(e)).deep_link_id:null,r=ve(Ae(t)).deep_link_id;return(r?ve(Ae(r)).link:null)||r||n||e||t}function Cs(t){return _e.parseLink(t)}async function Os(t,e){return te(t,"POST","/v1/accounts:signUp",g(t,e))}function Gi(t){return t.providerId?t.providerId:"phoneNumber"in t?"phone":null}async function Ns(t){if(y(t.app))return Promise.reject(A(t));let e=E(t);if(await e._initializationPromise,e.currentUser?.isAnonymous)return new V({user:e.currentUser,providerId:null,operationType:"signIn"});let n=await Os(e,{returnSecureToken:!0}),r=await V._fromIdTokenResponse(e,"signIn",n,!0);return await e._updateCurrentUser(r.user),r}function Ds(t,e,n,r){return(e==="reauthenticate"?n._getReauthenticationResolver(t):n._getIdTokenResponse(t)).catch(s=>{throw s.code==="auth/multi-factor-auth-required"?tr._fromErrorAndOperation(t,s,e,r):s})}function Ls(t){return new Set(t.map(({providerId:e})=>e).filter(e=>!!e))}async function Ms(t,e){let n=p(t);await tn(!0,n,e);let{providerUserInfo:r}=await Ac(n.auth,{idToken:await n.getIdToken(),deleteProvider:[e]}),i=Ls(r||[]);return n.providerData=n.providerData.filter(s=>i.has(s.providerId)),i.has("phone")||(n.phoneNumber=null),await n.auth._persistUserIfCurrent(n),n}async function Rr(t,e,n=!1){let r=await Z(t,e._linkToIdToken(t.auth,await t.getIdToken()),n);return V._forOperation(t,"link",r)}async function tn(t,e,n){await nt(e);let r=Ls(e.providerData),i=t===!1?"provider-already-linked":"no-such-provider";u(r.has(n)===t,e.auth,i)}async function Us(t,e,n=!1){let{auth:r}=t;if(y(r.app))return Promise.reject(A(r));let i="reauthenticate";try{let s=await Z(t,Ds(r,i,e,t),n);u(s.idToken,r,"internal-error");let a=Qt(s.idToken);u(a,r,"internal-error");let{sub:c}=a;return u(t.uid===c,r,"user-mismatch"),V._forOperation(t,i,s)}catch(s){throw s?.code==="auth/user-not-found"&&R(r,"user-mismatch"),s}}async function Fs(t,e,n=!1){if(y(t.app))return Promise.reject(A(t));let r="signIn",i=await Ds(t,r,e),s=await V._fromIdTokenResponse(t,r,i);return n||await t._updateCurrentUser(s.user),s}async function ut(t,e){return Fs(E(t),e)}async function Cr(t,e){let n=p(t);return await tn(!1,n,e.providerId),Rr(n,e)}async function Or(t,e){return Us(p(t),e)}async function ul(t,e){return te(t,"POST","/v1/accounts:signInWithCustomToken",g(t,e))}async function xs(t,e){if(y(t.app))return Promise.reject(A(t));let n=E(t),r=await ul(n,{token:e,returnSecureToken:!0}),i=await V._fromIdTokenResponse(n,"signIn",r);return await n._updateCurrentUser(i.user),i}function nn(t,e,n){u(n.url?.length>0,t,"invalid-continue-uri"),u(typeof n.dynamicLinkDomain>"u"||n.dynamicLinkDomain.length>0,t,"invalid-dynamic-link-domain"),u(typeof n.linkDomain>"u"||n.linkDomain.length>0,t,"invalid-hosting-link-domain"),e.continueUrl=n.url,e.dynamicLinkDomain=n.dynamicLinkDomain,e.linkDomain=n.linkDomain,e.canHandleCodeInApp=n.handleCodeInApp,n.iOS&&(u(n.iOS.bundleId.length>0,t,"missing-ios-bundle-id"),e.iOSBundleId=n.iOS.bundleId),n.android&&(u(n.android.packageName.length>0,t,"missing-android-pkg-name"),e.androidInstallApp=n.android.installApp,e.androidMinimumVersionCode=n.android.minimumVersion,e.androidPackageName=n.android.packageName)}async function Nr(t){let e=E(t);e._getPasswordPolicyInternal()&&await e._updatePasswordPolicy()}async function Vs(t,e,n){let r=E(t),i={requestType:"PASSWORD_RESET",email:e,clientType:"CLIENT_TYPE_WEB"};n&&nn(r,i,n),await ae(r,i,"getOobCode",Yc,"EMAIL_PASSWORD_PROVIDER")}async function Hs(t,e,n){await Rs(p(t),{oobCode:e,newPassword:n}).catch(async r=>{throw r.code==="auth/password-does-not-meet-requirements"&&Nr(t),r})}async function Ws(t,e){await qc(p(t),{oobCode:e})}async function Dr(t,e){let n=p(t),r=await Rs(n,{oobCode:e}),i=r.requestType;switch(u(i,n,"internal-error"),i){case"EMAIL_SIGNIN":break;case"VERIFY_AND_CHANGE_EMAIL":u(r.newEmail,n,"internal-error");break;case"REVERT_SECOND_FACTOR_ADDITION":u(r.mfaInfo,n,"internal-error");default:u(r.email,n,"internal-error")}let s=null;return r.mfaInfo&&(s=Ie._fromServerResponse(E(n),r.mfaInfo)),{data:{email:(r.requestType==="VERIFY_AND_CHANGE_EMAIL"?r.newEmail:r.email)||null,previousEmail:(r.requestType==="VERIFY_AND_CHANGE_EMAIL"?r.email:r.newEmail)||null,multiFactorInfo:s},operation:i}}async function Bs(t,e){let{data:n}=await Dr(p(t),e);return n.email}async function zs(t,e,n){if(y(t.app))return Promise.reject(A(t));let r=E(t),a=await ae(r,{returnSecureToken:!0,email:e,password:n,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",Os,"EMAIL_PASSWORD_PROVIDER").catch(l=>{throw l.code==="auth/password-does-not-meet-requirements"&&Nr(t),l}),c=await V._fromIdTokenResponse(r,"signIn",a);return await r._updateCurrentUser(c.user),c}function $s(t,e,n){return y(t.app)?Promise.reject(A(t)):ut(p(t),ee.credential(e,n)).catch(async r=>{throw r.code==="auth/password-does-not-meet-requirements"&&Nr(t),r})}async function js(t,e,n){let r=E(t),i={requestType:"EMAIL_SIGNIN",email:e,clientType:"CLIENT_TYPE_WEB"};function s(a,c){u(c.handleCodeInApp,r,"argument-error"),c&&nn(r,a,c)}s(i,n),await ae(r,i,"getOobCode",Xc,"EMAIL_PASSWORD_PROVIDER")}function Gs(t,e){return _e.parseLink(e)?.operation==="EMAIL_SIGNIN"}async function qs(t,e,n){if(y(t.app))return Promise.reject(A(t));let r=p(t),i=ee.credentialWithLink(e,n||et());return u(i._tenantId===(r.tenantId||null),r,"tenant-id-mismatch"),ut(r,i)}async function dl(t,e){return _(t,"POST","/v1/accounts:createAuthUri",g(t,e))}async function Ks(t,e){let n=Er()?et():"http://localhost",r={identifier:e,continueUri:n},{signinMethods:i}=await dl(p(t),r);return i||[]}async function Js(t,e){let n=p(t),i={requestType:"VERIFY_EMAIL",idToken:await t.getIdToken()};e&&nn(n.auth,i,e);let{email:s}=await Jc(n.auth,i);s!==t.email&&await t.reload()}async function Ys(t,e,n){let r=p(t),s={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:await t.getIdToken(),newEmail:e};n&&nn(r.auth,s,n);let{email:a}=await Zc(r.auth,s);a!==t.email&&await t.reload()}async function hl(t,e){return _(t,"POST","/v1/accounts:update",e)}async function Xs(t,{displayName:e,photoURL:n}){if(e===void 0&&n===void 0)return;let r=p(t),s={idToken:await r.getIdToken(),displayName:e,photoUrl:n,returnSecureToken:!0},a=await Z(r,hl(r.auth,s));r.displayName=a.displayName||null,r.photoURL=a.photoUrl||null;let c=r.providerData.find(({providerId:l})=>l==="password");c&&(c.displayName=r.displayName,c.photoURL=r.photoURL),await r._updateTokensIfNecessary(a)}function Zs(t,e){let n=p(t);return y(n.auth.app)?Promise.reject(A(n.auth)):eo(n,e,null)}function Qs(t,e){return eo(p(t),null,e)}async function eo(t,e,n){let{auth:r}=t,s={idToken:await t.getIdToken(),returnSecureToken:!0};e&&(s.email=e),n&&(s.password=n);let a=await Z(t,jc(r,s));await t._updateTokensIfNecessary(a,!0)}function fl(t){if(!t)return null;let{providerId:e}=t,n=t.rawUserInfo?JSON.parse(t.rawUserInfo):{},r=t.isNewUser||t.kind==="identitytoolkit#SignupNewUserResponse";if(!e&&t?.idToken){let i=Qt(t.idToken)?.firebase?.sign_in_provider;if(i){let s=i!=="anonymous"&&i!=="custom"?i:null;return new ce(r,s)}}if(!e)return null;switch(e){case"facebook.com":return new ir(r,n);case"github.com":return new sr(r,n);case"google.com":return new or(r,n);case"twitter.com":return new ar(r,n,t.screenName||null);case"custom":case"anonymous":return new ce(r,null);default:return new ce(r,e,n)}}function to(t){let{user:e,_tokenResponse:n}=t;return e.isAnonymous&&!n?{providerId:null,isNewUser:!1,profile:null}:fl(n)}function no(t,e){return p(t).setPersistence(e)}function ro(t){return ks(t)}async function io(t,e){return E(t).validatePassword(e)}function Lr(t,e,n,r){return p(t).onIdTokenChanged(e,n,r)}function Mr(t,e,n){return p(t).beforeAuthStateChanged(e,n)}function so(t,e,n,r){return p(t).onAuthStateChanged(e,n,r)}function oo(t){p(t).useDeviceLanguage()}function ao(t,e){return p(t).updateCurrentUser(e)}function co(t){return p(t).signOut()}function lo(t,e){return E(t).revokeAccessToken(e)}async function uo(t){return p(t).delete()}function ho(t,e){let n=p(t),r=e;return u(e.customData.operationType,n,"argument-error"),u(r.customData._serverResponse?.mfaPendingCredential,n,"argument-error"),cr._fromError(n,r)}function qi(t,e){return _(t,"POST","/v2/accounts/mfaEnrollment:start",g(t,e))}function pl(t,e){return _(t,"POST","/v2/accounts/mfaEnrollment:finalize",g(t,e))}function ml(t,e){return _(t,"POST","/v2/accounts/mfaEnrollment:start",g(t,e))}function gl(t,e){return _(t,"POST","/v2/accounts/mfaEnrollment:finalize",g(t,e))}function _l(t,e){return _(t,"POST","/v2/accounts/mfaEnrollment:withdraw",g(t,e))}function fo(t){let e=p(t);return Hn.has(e)||Hn.set(e,lr._fromUser(e)),Hn.get(e)}function Wn(t){let e=t.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),n=RegExp(`${e}=([^;]+)`);return document.cookie.match(n)?.[1]??null}function Bn(t){return`${window.location.protocol==="http:"?"__dev_":"__HOST-"}FIREBASE_${t.split(":")[3]}`}function El(t){return Promise.all(t.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(n){return{fulfilled:!1,reason:n}}}))}function sn(t="",e=10){let n="";for(let r=0;r<e;r++)n+=Math.floor(Math.random()*10);return t+n}function w(){return window}function wl(t){w().location.href=t}function Fr(){return typeof w().WorkerGlobalScope<"u"&&typeof w().importScripts=="function"}async function Tl(){if(!navigator?.serviceWorker)return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function vl(){return navigator?.serviceWorker?.controller||null}function Al(){return Fr()?self:null}function on(t,e){return t.transaction([Gt],e?"readwrite":"readonly").objectStore(Gt)}function kl(){let t=indexedDB.deleteDatabase(mo);return new ye(t).toPromise()}function _o(){let t=indexedDB.open(mo,Sl);return new Promise((e,n)=>{t.addEventListener("error",()=>{n(t.error)}),t.addEventListener("upgradeneeded",()=>{let r=t.result;try{r.createObjectStore(Gt,{keyPath:go})}catch(i){n(i)}}),t.addEventListener("success",async()=>{let r=t.result;r.objectStoreNames.contains(Gt)?e(r):(r.close(),await kl(),e(await _o()))})})}async function Ki(t,e,n){let r=on(t,!0).put({[go]:e,value:n});return new ye(r).toPromise()}async function Pl(t,e){let n=on(t,!1).get(e),r=await new ye(n).toPromise();return r===void 0?null:r.value}function Ji(t,e){let n=on(t,!0).delete(e);return new ye(n).toPromise()}function Yi(t,e){return _(t,"POST","/v2/accounts/mfaSignIn:start",g(t,e))}function Ol(t,e){return _(t,"POST","/v2/accounts/mfaSignIn:finalize",g(t,e))}function Nl(t,e){return _(t,"POST","/v2/accounts/mfaSignIn:finalize",g(t,e))}function Ll(t){return t.length<=6&&/^\s*[a-zA-Z0-9\-]*\s*$/.test(t)}function Ul(){let t=null;return new Promise(e=>{if(document.readyState==="complete"){e();return}t=()=>e(),window.addEventListener("load",t)}).catch(e=>{throw t&&window.removeEventListener("load",t),e})}async function Io(t,e,n){if(y(t.app))return Promise.reject(A(t));let r=E(t),i=await an(r,e,p(n));return new it(i,s=>ut(r,s))}async function yo(t,e,n){let r=p(t);await tn(!1,r,"phone");let i=await an(r.auth,e,p(n));return new it(i,s=>Cr(r,s))}async function bo(t,e,n){let r=p(t);if(y(r.auth.app))return Promise.reject(A(r.auth));let i=await an(r.auth,e,p(n));return new it(i,s=>Or(r,s))}async function an(t,e,n){if(!t._getRecaptchaConfig())try{await ks(t)}catch{console.log("Failed to initialize reCAPTCHA Enterprise config. Triggering the reCAPTCHA v2 verification.")}try{let r;if(typeof e=="string"?r={phoneNumber:e}:r=e,"session"in r){let i=r.session;if("phoneNumber"in r){u(i.type==="enroll",t,"internal-error");let s={idToken:i.credential,phoneEnrollmentInfo:{phoneNumber:r.phoneNumber,clientType:"CLIENT_TYPE_WEB"}};return(await ae(t,s,"mfaSmsEnrollment",async(o,d)=>{if(d.phoneEnrollmentInfo.captchaResponse===Ze){u(n?.type===Qe,o,"argument-error");let f=await $n(o,d,n);return qi(o,f)}return qi(o,d)},"PHONE_PROVIDER").catch(o=>Promise.reject(o))).phoneSessionInfo.sessionInfo}else{u(i.type==="signin",t,"internal-error");let s=r.multiFactorHint?.uid||r.multiFactorUid;u(s,t,"missing-multi-factor-info");let a={mfaPendingCredential:i.credential,mfaEnrollmentId:s,phoneSignInInfo:{clientType:"CLIENT_TYPE_WEB"}};return(await ae(t,a,"mfaSmsSignIn",async(d,f)=>{if(f.phoneSignInInfo.captchaResponse===Ze){u(n?.type===Qe,d,"argument-error");let h=await $n(d,f,n);return Yi(d,h)}return Yi(d,f)},"PHONE_PROVIDER").catch(d=>Promise.reject(d))).phoneResponseInfo.sessionInfo}}else{let i={phoneNumber:r.phoneNumber,clientType:"CLIENT_TYPE_WEB"};return(await ae(t,i,"sendVerificationCode",async(l,o)=>{if(o.captchaResponse===Ze){u(n?.type===Qe,l,"argument-error");let d=await $n(l,o,n);return ji(l,d)}return ji(l,o)},"PHONE_PROVIDER").catch(l=>Promise.reject(l))).sessionInfo}}finally{n?._reset()}}async function Eo(t,e){let n=p(t);if(y(n.auth.app))return Promise.reject(A(n.auth));await Rr(n,e)}async function $n(t,e,n){u(n.type===Qe,t,"argument-error");let r=await n.verify();u(typeof r=="string",t,"argument-error");let i={...e};if("phoneEnrollmentInfo"in i){let s=i.phoneEnrollmentInfo.phoneNumber,a=i.phoneEnrollmentInfo.captchaResponse,c=i.phoneEnrollmentInfo.clientType,l=i.phoneEnrollmentInfo.recaptchaVersion;return Object.assign(i,{phoneEnrollmentInfo:{phoneNumber:s,recaptchaToken:r,captchaResponse:a,clientType:c,recaptchaVersion:l}}),i}else if("phoneSignInInfo"in i){let s=i.phoneSignInInfo.captchaResponse,a=i.phoneSignInInfo.clientType,c=i.phoneSignInInfo.recaptchaVersion;return Object.assign(i,{phoneSignInInfo:{recaptchaToken:r,captchaResponse:s,clientType:a,recaptchaVersion:c}}),i}else return Object.assign(i,{recaptchaToken:r}),i}function be(t,e){return e?J(e):(u(t._popupRedirectResolver,t,"argument-error"),t._popupRedirectResolver)}function Fl(t){return Fs(t.auth,new st(t),t.bypassAuthState)}function xl(t){let{auth:e,user:n}=t;return u(n,e,"internal-error"),Us(n,new st(t),t.bypassAuthState)}async function Vl(t){let{auth:e,user:n}=t;return u(n,e,"internal-error"),Rr(n,new st(t),t.bypassAuthState)}async function wo(t,e,n){if(y(t.app))return Promise.reject(k(t,"operation-not-supported-in-this-environment"));let r=E(t);Fe(t,e,x);let i=be(r,n);return new Ue(r,"signInViaPopup",e,i).executeNotNull()}async function To(t,e,n){let r=p(t);if(y(r.auth.app))return Promise.reject(k(r.auth,"operation-not-supported-in-this-environment"));Fe(r.auth,e,x);let i=be(r.auth,n);return new Ue(r.auth,"reauthViaPopup",e,i,r).executeNotNull()}async function vo(t,e,n){let r=p(t);Fe(r.auth,e,x);let i=be(r.auth,n);return new Ue(r.auth,"linkViaPopup",e,i,r).executeNotNull()}async function Bl(t,e){let n=So(e),r=Ao(t);if(!await r._isAvailable())return!1;let i=await r._get(n)==="true";return await r._remove(n),i}async function Vr(t,e){return Ao(t)._set(So(e),"true")}function zl(t,e){At.set(t._key(),e)}function Ao(t){return J(t._redirectPersistence)}function So(t){return vt(Wl,t.config.apiKey,t.name)}function ko(t,e,n){return $l(t,e,n)}async function $l(t,e,n){if(y(t.app))return Promise.reject(A(t));let r=E(t);Fe(t,e,x),await r._initializationPromise;let i=be(r,n);return await Vr(i,r),i._openRedirect(r,e,"signInViaRedirect")}function Po(t,e,n){return jl(t,e,n)}async function jl(t,e,n){let r=p(t);if(Fe(r.auth,e,x),y(r.auth.app))return Promise.reject(A(r.auth));await r.auth._initializationPromise;let i=be(r.auth,n);await Vr(i,r.auth);let s=await No(r);return i._openRedirect(r.auth,e,"reauthViaRedirect",s)}function Ro(t,e,n){return Gl(t,e,n)}async function Gl(t,e,n){let r=p(t);Fe(r.auth,e,x),await r.auth._initializationPromise;let i=be(r.auth,n);await tn(!1,r,e.providerId),await Vr(i,r.auth);let s=await No(r);return i._openRedirect(r.auth,e,"linkViaRedirect",s)}async function Co(t,e){return await E(t)._initializationPromise,Oo(t,e,!1)}async function Oo(t,e,n=!1){if(y(t.app))return Promise.reject(A(t));let r=E(t),i=be(r,e),a=await new fr(r,i,n).execute();return a&&!n&&(delete a.user._redirectEventId,await r._persistUserIfCurrent(a.user),await r._setRedirectUser(null,e)),a}async function No(t){let e=sn(`${t.uid}:::`);return t._redirectEventId=e,await t.auth._setRedirectUser(t),await t.auth._persistUserIfCurrent(t),e}function Xi(t){return[t.type,t.eventId,t.sessionId,t.tenantId].filter(e=>e).join("-")}function Do({type:t,error:e}){return t==="unknown"&&e?.code==="auth/no-auth-event"}function Kl(t){switch(t.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return Do(t);default:return!1}}async function Jl(t,e={}){return _(t,"GET","/v1/projects",e)}async function Zl(t){if(t.config.emulator)return;let{authorizedDomains:e}=await Jl(t);for(let n of e)try{if(Ql(n))return}catch{}R(t,"unauthorized-domain")}function Ql(t){let e=et(),{protocol:n,hostname:r}=new URL(e);if(t.startsWith("chrome-extension://")){let a=new URL(t);return a.hostname===""&&r===""?n==="chrome-extension:"&&t.replace("chrome-extension://","")===e.replace("chrome-extension://",""):n==="chrome-extension:"&&a.hostname===r}if(!Xl.test(n))return!1;if(Yl.test(t))return r===t;let i=t.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}function Zi(){let t=w().___jsl;if(t?.H){for(let e of Object.keys(t.H))if(t.H[e].r=t.H[e].r||[],t.H[e].L=t.H[e].L||[],t.H[e].r=[...t.H[e].L],t.CP)for(let n=0;n<t.CP.length;n++)t.CP[n]=null}}function tu(t){return new Promise((e,n)=>{function r(){Zi(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{Zi(),n(k(t,"network-request-failed"))},timeout:eu.get()})}if(w().gapi?.iframes?.Iframe)e(gapi.iframes.getContext());else if(w().gapi?.load)r();else{let i=Ss("iframefcb");return w()[i]=()=>{gapi.load?r():n(k(t,"network-request-failed"))},Sr(`${Fc()}?onload=${i}`).catch(s=>n(s))}}).catch(e=>{throw St=null,e})}function nu(t){return St=St||tu(t),St}function cu(t){let e=t.config;u(e.authDomain,t,"auth-domain-config-required");let n=e.emulator?wr(e,su):`https://${t.config.authDomain}/${iu}`,r={apiKey:e.apiKey,appName:t.name,v:pe},i=au.get(t.config.apiHost);i&&(r.eid=i);let s=t._getFrameworks();return s.length&&(r.fw=s.join(",")),`${n}?${de(r).slice(1)}`}async function lu(t){let e=await nu(t),n=w().gapi;return u(n,t,"internal-error"),e.open({where:document.body,url:cu(t),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:ou,dontclear:!0},r=>new Promise(async(i,s)=>{await r.restyle({setHideOnLeave:!1});let a=k(t,"network-request-failed"),c=w().setTimeout(()=>{s(a)},ru.get());function l(){w().clearTimeout(c),i(r)}r.ping(l).then(l,()=>{s(a)})}))}function mu(t,e,n,r=du,i=hu){let s=Math.max((window.screen.availHeight-i)/2,0).toString(),a=Math.max((window.screen.availWidth-r)/2,0).toString(),c="",l={...uu,width:r.toString(),height:i.toString(),top:s,left:a},o=S().toLowerCase();n&&(c=ys(o)?fu:n),_s(o)&&(e=e||pu,l.scrollbars="yes");let d=Object.entries(l).reduce((h,[I,b])=>`${h}${I}=${b},`,"");if(Cc(o)&&c!=="_self")return gu(e||"",c),new Yt(null);let f=window.open(e||"",c,d);u(f,t,"popup-blocked");try{f.focus()}catch{}return new Yt(f)}function gu(t,e){let n=document.createElement("a");n.href=t,n.target=e;let r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}async function Qi(t,e,n,r,i,s){u(t.config.authDomain,t,"auth-domain-config-required"),u(t.config.apiKey,t,"invalid-api-key");let a={apiKey:t.config.apiKey,appName:t.name,authType:n,redirectUrl:r,v:pe,eventId:i};if(e instanceof x){e.setDefaultLanguage(t.languageCode),a.providerId=e.providerId||"",hi(e.getCustomParameters())||(a.customParameters=JSON.stringify(e.getCustomParameters()));for(let[d,f]of Object.entries(s||{}))a[d]=f}if(e instanceof le){let d=e.getScopes().filter(f=>f!=="");d.length>0&&(a.scopes=d.join(","))}t.tenantId&&(a.tid=t.tenantId);let c=a;for(let d of Object.keys(c))c[d]===void 0&&delete c[d];let l=await t._getAppCheckToken(),o=l?`#${yu}=${encodeURIComponent(l)}`:"";return`${bu(t)}?${de(c).slice(1)}${o}`}function bu({config:t}){return t.emulator?wr(t,Iu):`https://${t.authDomain}/${_u}`}function wt(t){return typeof t>"u"||t?.length===0}function Eu(t){switch(t){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function wu(t){fe(new W("auth",(e,{options:n})=>{let r=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),s=e.getProvider("app-check-internal"),{apiKey:a,authDomain:c}=r.options;u(a&&!a.includes(":"),"invalid-api-key",{appName:r.name});let l={apiKey:a,authDomain:c,clientPlatform:t,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:As(t)},o=new Yn(r,i,s,l);return Bc(o,n),o},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,n,r)=>{e.getProvider("auth-internal").initialize()})),fe(new W("auth-internal",e=>{let n=E(e.getProvider("auth").getImmediate());return(r=>new _r(r))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),z(es,ts,Eu(t)),z(es,ts,"esm2020")}function Lo(t=xn()){let e=Ge(t,"auth");if(e.isInitialized())return e.getImmediate();let n=kr(t,{popupRedirectResolver:Hr,persistence:[xr,Ur,rn]}),r=bn("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){let s=new URL(r,location.origin);if(location.origin===s.origin){let a=Au(s.toString());Mr(n,a,()=>a(n.currentUser)),Lr(n,c=>a(c))}}let i=ri("auth");return i&&Pr(n,`http://${i}`),n}function Su(){return document.getElementsByTagName("head")?.[0]??document}var rs,is,ss,os,as,ls,Ir,us,ds,kt,me,Pt,yc,bc,Ec,Gn,Rt,qn,tt,Xe,oe,Wi,Ot,Nt,Dt,Kn,Dc,Jn,Yn,Lt,lt,xc,Vc,Et,Xn,Zn,Qn,er,Wc,Ze,zi,rt,Q,Ce,tl,j,il,ge,_e,ee,x,le,Mt,Oe,Ne,De,cl,Ut,ll,Ft,Le,V,tr,Ie,nr,rr,ce,xt,ir,sr,or,ar,Vt,cr,lr,Hn,Ht,Wt,Il,yl,Bt,Ur,bl,zt,po,$t,rn,jt,ur,mo,Sl,Gt,go,ye,Rl,Cl,qt,xr,zn,Dl,dr,hr,Qe,Ml,Kt,it,Me,st,Jt,Hl,Ue,Wl,At,fr,ql,pr,Yl,Xl,eu,St,ru,iu,su,ou,au,uu,du,hu,fu,pu,Yt,_u,Iu,yu,jn,mr,Hr,Xt,gr,ot,at,Zt,ct,es,ts,_r,Tu,vu,ns,Au,Mo=F(()=>{qe();Se();_t();gt();rs={PHONE:"phone",TOTP:"totp"},is={FACEBOOK:"facebook.com",GITHUB:"github.com",GOOGLE:"google.com",PASSWORD:"password",PHONE:"phone",TWITTER:"twitter.com"},ss={EMAIL_LINK:"emailLink",EMAIL_PASSWORD:"password",FACEBOOK:"facebook.com",GITHUB:"github.com",GOOGLE:"google.com",PHONE:"phone",TWITTER:"twitter.com"},os={LINK:"link",REAUTHENTICATE:"reauthenticate",SIGN_IN:"signIn"},as={EMAIL_SIGNIN:"EMAIL_SIGNIN",PASSWORD_RESET:"PASSWORD_RESET",RECOVER_EMAIL:"RECOVER_EMAIL",REVERT_SECOND_FACTOR_ADDITION:"REVERT_SECOND_FACTOR_ADDITION",VERIFY_AND_CHANGE_EMAIL:"VERIFY_AND_CHANGE_EMAIL",VERIFY_EMAIL:"VERIFY_EMAIL"};ls=mc,Ir=cs,us=new q("auth","Firebase",cs()),ds={ADMIN_ONLY_OPERATION:"auth/admin-restricted-operation",ARGUMENT_ERROR:"auth/argument-error",APP_NOT_AUTHORIZED:"auth/app-not-authorized",APP_NOT_INSTALLED:"auth/app-not-installed",CAPTCHA_CHECK_FAILED:"auth/captcha-check-failed",CODE_EXPIRED:"auth/code-expired",CORDOVA_NOT_READY:"auth/cordova-not-ready",CORS_UNSUPPORTED:"auth/cors-unsupported",CREDENTIAL_ALREADY_IN_USE:"auth/credential-already-in-use",CREDENTIAL_MISMATCH:"auth/custom-token-mismatch",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"auth/requires-recent-login",DEPENDENT_SDK_INIT_BEFORE_AUTH:"auth/dependent-sdk-initialized-before-auth",DYNAMIC_LINK_NOT_ACTIVATED:"auth/dynamic-link-not-activated",EMAIL_CHANGE_NEEDS_VERIFICATION:"auth/email-change-needs-verification",EMAIL_EXISTS:"auth/email-already-in-use",EMULATOR_CONFIG_FAILED:"auth/emulator-config-failed",EXPIRED_OOB_CODE:"auth/expired-action-code",EXPIRED_POPUP_REQUEST:"auth/cancelled-popup-request",INTERNAL_ERROR:"auth/internal-error",INVALID_API_KEY:"auth/invalid-api-key",INVALID_APP_CREDENTIAL:"auth/invalid-app-credential",INVALID_APP_ID:"auth/invalid-app-id",INVALID_AUTH:"auth/invalid-user-token",INVALID_AUTH_EVENT:"auth/invalid-auth-event",INVALID_CERT_HASH:"auth/invalid-cert-hash",INVALID_CODE:"auth/invalid-verification-code",INVALID_CONTINUE_URI:"auth/invalid-continue-uri",INVALID_CORDOVA_CONFIGURATION:"auth/invalid-cordova-configuration",INVALID_CUSTOM_TOKEN:"auth/invalid-custom-token",INVALID_DYNAMIC_LINK_DOMAIN:"auth/invalid-dynamic-link-domain",INVALID_EMAIL:"auth/invalid-email",INVALID_EMULATOR_SCHEME:"auth/invalid-emulator-scheme",INVALID_IDP_RESPONSE:"auth/invalid-credential",INVALID_LOGIN_CREDENTIALS:"auth/invalid-credential",INVALID_MESSAGE_PAYLOAD:"auth/invalid-message-payload",INVALID_MFA_SESSION:"auth/invalid-multi-factor-session",INVALID_OAUTH_CLIENT_ID:"auth/invalid-oauth-client-id",INVALID_OAUTH_PROVIDER:"auth/invalid-oauth-provider",INVALID_OOB_CODE:"auth/invalid-action-code",INVALID_ORIGIN:"auth/unauthorized-domain",INVALID_PASSWORD:"auth/wrong-password",INVALID_PERSISTENCE:"auth/invalid-persistence-type",INVALID_PHONE_NUMBER:"auth/invalid-phone-number",INVALID_PROVIDER_ID:"auth/invalid-provider-id",INVALID_RECIPIENT_EMAIL:"auth/invalid-recipient-email",INVALID_SENDER:"auth/invalid-sender",INVALID_SESSION_INFO:"auth/invalid-verification-id",INVALID_TENANT_ID:"auth/invalid-tenant-id",MFA_INFO_NOT_FOUND:"auth/multi-factor-info-not-found",MFA_REQUIRED:"auth/multi-factor-auth-required",MISSING_ANDROID_PACKAGE_NAME:"auth/missing-android-pkg-name",MISSING_APP_CREDENTIAL:"auth/missing-app-credential",MISSING_AUTH_DOMAIN:"auth/auth-domain-config-required",MISSING_CODE:"auth/missing-verification-code",MISSING_CONTINUE_URI:"auth/missing-continue-uri",MISSING_IFRAME_START:"auth/missing-iframe-start",MISSING_IOS_BUNDLE_ID:"auth/missing-ios-bundle-id",MISSING_OR_INVALID_NONCE:"auth/missing-or-invalid-nonce",MISSING_MFA_INFO:"auth/missing-multi-factor-info",MISSING_MFA_SESSION:"auth/missing-multi-factor-session",MISSING_PHONE_NUMBER:"auth/missing-phone-number",MISSING_PASSWORD:"auth/missing-password",MISSING_SESSION_INFO:"auth/missing-verification-id",MODULE_DESTROYED:"auth/app-deleted",NEED_CONFIRMATION:"auth/account-exists-with-different-credential",NETWORK_REQUEST_FAILED:"auth/network-request-failed",NULL_USER:"auth/null-user",NO_AUTH_EVENT:"auth/no-auth-event",NO_SUCH_PROVIDER:"auth/no-such-provider",OPERATION_NOT_ALLOWED:"auth/operation-not-allowed",OPERATION_NOT_SUPPORTED:"auth/operation-not-supported-in-this-environment",POPUP_BLOCKED:"auth/popup-blocked",POPUP_CLOSED_BY_USER:"auth/popup-closed-by-user",PROVIDER_ALREADY_LINKED:"auth/provider-already-linked",QUOTA_EXCEEDED:"auth/quota-exceeded",REDIRECT_CANCELLED_BY_USER:"auth/redirect-cancelled-by-user",REDIRECT_OPERATION_PENDING:"auth/redirect-operation-pending",REJECTED_CREDENTIAL:"auth/rejected-credential",SECOND_FACTOR_ALREADY_ENROLLED:"auth/second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"auth/maximum-second-factor-count-exceeded",TENANT_ID_MISMATCH:"auth/tenant-id-mismatch",TIMEOUT:"auth/timeout",TOKEN_EXPIRED:"auth/user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"auth/too-many-requests",UNAUTHORIZED_DOMAIN:"auth/unauthorized-continue-uri",UNSUPPORTED_FIRST_FACTOR:"auth/unsupported-first-factor",UNSUPPORTED_PERSISTENCE:"auth/unsupported-persistence-type",UNSUPPORTED_TENANT_OPERATION:"auth/unsupported-tenant-operation",UNVERIFIED_EMAIL:"auth/unverified-email",USER_CANCELLED:"auth/user-cancelled",USER_DELETED:"auth/user-not-found",USER_DISABLED:"auth/user-disabled",USER_MISMATCH:"auth/user-mismatch",USER_SIGNED_OUT:"auth/user-signed-out",WEAK_PASSWORD:"auth/weak-password",WEB_STORAGE_UNSUPPORTED:"auth/web-storage-unsupported",ALREADY_INITIALIZED:"auth/already-initialized",RECAPTCHA_NOT_ENABLED:"auth/recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"auth/missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"auth/invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"auth/invalid-recaptcha-action",MISSING_CLIENT_TYPE:"auth/missing-client-type",MISSING_RECAPTCHA_VERSION:"auth/missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"auth/invalid-recaptcha-version",INVALID_REQ_TYPE:"auth/invalid-req-type",INVALID_HOSTING_LINK_DOMAIN:"auth/invalid-hosting-link-domain"};kt=new ke("@firebase/auth");me=class{constructor(e,n){this.shortDelay=e,this.longDelay=n,X(n>e,"Short delay should be less than long delay!"),this.isMobile=ii()||ci()}get(){return _c()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}};Pt=class{static initialize(e,n,r){this.fetchImpl=e,n&&(this.headersImpl=n),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;$("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;$("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;$("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}};yc={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"};bc=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],Ec=new me(3e4,6e4);Gn=class{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(k(this.auth,"network-request-failed")),Ec.get())})}};Rt=class{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],e.recaptchaKey===void 0)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||this.recaptchaEnforcementState.length===0)return null;for(let n of this.recaptchaEnforcementState)if(n.provider&&n.provider===e)return wc(n.enforcementState);return null}isProviderEnabled(e){return this.getProviderEnforcementState(e)==="ENFORCE"||this.getProviderEnforcementState(e)==="AUDIT"}isAnyProviderEnabled(){return this.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")||this.isProviderEnabled("PHONE_PROVIDER")}};qn=class{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(e){if(e){let n=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),n}else{this.errorBackoff=3e4;let r=(this.user.stsTokenManager.expirationTime??0)-Date.now()-3e5;return Math.max(0,r)}}schedule(e=!1){if(!this.isRunning)return;let n=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},n)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){e?.code==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}};tt=class{constructor(e,n){this.createdAt=e,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=Ye(this.lastLoginAt),this.creationTime=Ye(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}};Xe=class t{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){u(e.idToken,"internal-error"),u(typeof e.idToken<"u","internal-error"),u(typeof e.refreshToken<"u","internal-error");let n="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):Hi(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,n)}updateFromIdToken(e){u(e.length!==0,"internal-error");let n=Hi(e);this.updateTokensAndExpiration(e,null,n)}async getToken(e,n=!1){return!n&&this.accessToken&&!this.isExpired?this.accessToken:(u(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(e,n){let{accessToken:r,refreshToken:i,expiresIn:s}=await Pc(e,n);this.updateTokensAndExpiration(r,i,Number(s))}updateTokensAndExpiration(e,n,r){this.refreshToken=n||null,this.accessToken=e||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(e,n){let{refreshToken:r,accessToken:i,expirationTime:s}=n,a=new t;return r&&(u(typeof r=="string","internal-error",{appName:e}),a.refreshToken=r),i&&(u(typeof i=="string","internal-error",{appName:e}),a.accessToken=i),s&&(u(typeof s=="number","internal-error",{appName:e}),a.expirationTime=s),a}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 t,this.toJSON())}_performRefresh(){return $("not implemented")}};oe=class t{constructor({uid:e,auth:n,stsTokenManager:r,...i}){this.providerId="firebase",this.proactiveRefresh=new qn(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=e,this.auth=n,this.stsTokenManager=r,this.accessToken=r.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 tt(i.createdAt||void 0,i.lastLoginAt||void 0)}async getIdToken(e){let n=await Z(this,this.stsTokenManager.getToken(this.auth,e));return u(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n}getIdTokenResult(e){return Tr(this,e)}reload(){return vr(this)}_assign(e){this!==e&&(u(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(n=>({...n})),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){let n=new t({...this,auth:e,stsTokenManager:this.stsTokenManager._clone()});return n.metadata._copy(this.metadata),n}_onReload(e){u(!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,n=!1){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),n&&await nt(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(y(this.auth.app))return Promise.reject(A(this.auth));let e=await this.getIdToken();return await Z(this,vc(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,n){let r=n.displayName??void 0,i=n.email??void 0,s=n.phoneNumber??void 0,a=n.photoURL??void 0,c=n.tenantId??void 0,l=n._redirectEventId??void 0,o=n.createdAt??void 0,d=n.lastLoginAt??void 0,{uid:f,emailVerified:h,isAnonymous:I,providerData:b,stsTokenManager:C}=n;u(f&&C,e,"internal-error");let H=Xe.fromJSON(this.name,C);u(typeof f=="string",e,"internal-error"),se(r,e.name),se(i,e.name),u(typeof h=="boolean",e,"internal-error"),u(typeof I=="boolean",e,"internal-error"),se(s,e.name),se(a,e.name),se(c,e.name),se(l,e.name),se(o,e.name),se(d,e.name);let P=new t({uid:f,auth:e,email:i,emailVerified:h,displayName:r,isAnonymous:I,photoURL:a,phoneNumber:s,tenantId:c,stsTokenManager:H,createdAt:o,lastLoginAt:d});return b&&Array.isArray(b)&&(P.providerData=b.map(O=>({...O}))),l&&(P._redirectEventId=l),P}static async _fromIdTokenResponse(e,n,r=!1){let i=new Xe;i.updateFromServerResponse(n);let s=new t({uid:n.localId,auth:e,stsTokenManager:i,isAnonymous:r});return await nt(s),s}static async _fromGetAccountInfoResponse(e,n,r){let i=n.users[0];u(i.localId!==void 0,"internal-error");let s=i.providerUserInfo!==void 0?gs(i.providerUserInfo):[],a=!(i.email&&i.passwordHash)&&!s?.length,c=new Xe;c.updateFromIdToken(r);let l=new t({uid:i.localId,auth:e,stsTokenManager:c,isAnonymous:a}),o={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:s,metadata:new tt(i.createdAt,i.lastLoginAt),isAnonymous:!(i.email&&i.passwordHash)&&!s?.length};return Object.assign(l,o),l}};Wi=new Map;Ot=class{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,n){this.storage[e]=n}async _get(e){let n=this.storage[e];return n===void 0?null:n}async _remove(e){delete this.storage[e]}_addListener(e,n){}_removeListener(e,n){}};Ot.type="NONE";Nt=Ot;Dt=class t{constructor(e,n,r){this.persistence=e,this.auth=n,this.userKey=r;let{config:i,name:s}=this.auth;this.fullUserKey=vt(this.userKey,i.apiKey,s),this.fullPersistenceKey=vt("persistence",i.apiKey,s),this.boundEventHandler=n._onStorageEvent.bind(n),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){let e=await this.persistence._get(this.fullUserKey);if(!e)return null;if(typeof e=="string"){let n=await Ct(this.auth,{idToken:e}).catch(()=>{});return n?oe._fromGetAccountInfoResponse(this.auth,n,e):null}return oe._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;let n=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,n)return this.setCurrentUser(n)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,n,r="authUser"){if(!n.length)return new t(J(Nt),e,r);let i=(await Promise.all(n.map(async o=>{if(await o._isAvailable())return o}))).filter(o=>o),s=i[0]||J(Nt),a=vt(r,e.config.apiKey,e.name),c=null;for(let o of n)try{let d=await o._get(a);if(d){let f;if(typeof d=="string"){let h=await Ct(e,{idToken:d}).catch(()=>{});if(!h)break;f=await oe._fromGetAccountInfoResponse(e,h,d)}else f=oe._fromJSON(e,d);o!==s&&(c=f),s=o;break}}catch{}let l=i.filter(o=>o._shouldAllowMigration);return!s._shouldAllowMigration||!l.length?new t(s,e,r):(s=l[0],c&&await s._set(a,c.toJSON()),await Promise.all(n.map(async o=>{if(o!==s)try{await o._remove(a)}catch{}})),new t(s,e,r))}};Kn=class{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,n){let r=s=>new Promise((a,c)=>{try{let l=e(s);a(l)}catch(l){c(l)}});r.onAbort=n,this.queue.push(r);let i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;let n=[];try{for(let r of this.queue)await r(e),r.onAbort&&n.push(r.onAbort)}catch(r){n.reverse();for(let i of n)try{i()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:r?.message})}}};Dc=6,Jn=class{constructor(e){let n=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=n.minPasswordLength??Dc,n.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=n.maxPasswordLength),n.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=n.containsLowercaseCharacter),n.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=n.containsUppercaseCharacter),n.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=n.containsNumericCharacter),n.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=n.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=e.allowedNonAlphanumericCharacters?.join("")??"",this.forceUpgradeOnSignin=e.forceUpgradeOnSignin??!1,this.schemaVersion=e.schemaVersion}validatePassword(e){let n={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,n),this.validatePasswordCharacterOptions(e,n),n.isValid&&(n.isValid=n.meetsMinPasswordLength??!0),n.isValid&&(n.isValid=n.meetsMaxPasswordLength??!0),n.isValid&&(n.isValid=n.containsLowercaseLetter??!0),n.isValid&&(n.isValid=n.containsUppercaseLetter??!0),n.isValid&&(n.isValid=n.containsNumericCharacter??!0),n.isValid&&(n.isValid=n.containsNonAlphanumericCharacter??!0),n}validatePasswordLengthOptions(e,n){let r=this.customStrengthOptions.minPasswordLength,i=this.customStrengthOptions.maxPasswordLength;r&&(n.meetsMinPasswordLength=e.length>=r),i&&(n.meetsMaxPasswordLength=e.length<=i)}validatePasswordCharacterOptions(e,n){this.updatePasswordCharacterOptionsStatuses(n,!1,!1,!1,!1);let r;for(let i=0;i<e.length;i++)r=e.charAt(i),this.updatePasswordCharacterOptionsStatuses(n,r>="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(e,n,r,i,s){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=n)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=i)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=s))}};Yn=class{constructor(e,n,r,i){this.app=e,this.heartbeatServiceProvider=n,this.appCheckServiceProvider=r,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new Lt(this),this.idTokenSubscription=new Lt(this),this.beforeStateQueue=new Kn(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=us,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(s=>this._resolvePersistenceManagerAvailable=s)}_initializeWithPersistence(e,n){return n&&(this._popupRedirectResolver=J(n)),this._initializationPromise=this.queue(async()=>{if(!this._deleted&&(this.persistenceManager=await Dt.create(this,e),this._resolvePersistenceManagerAvailable?.(),!this._deleted)){if(this._popupRedirectResolver?._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(n),this.lastNotifiedUid=this.currentUser?.uid||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;let e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUserFromIdToken(e){try{let n=await Ct(this,{idToken:e}),r=await oe._fromGetAccountInfoResponse(this,n,e);await this.directlySetCurrentUser(r)}catch(n){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",n),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){if(y(this.app)){let s=this.app.settings.authIdToken;return s?new Promise(a=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(s).then(a,a))}):this.directlySetCurrentUser(null)}let n=await this.assertedPersistence.getCurrentUser(),r=n,i=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();let s=this.redirectUser?._redirectEventId,a=r?._redirectEventId,c=await this.tryRedirectSignIn(e);(!s||s===a)&&c?.user&&(r=c.user,i=!0)}if(!r)return this.directlySetCurrentUser(null);if(!r._redirectEventId){if(i)try{await this.beforeStateQueue.runMiddleware(r)}catch(s){r=n,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(s))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return u(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===r._redirectEventId?this.directlySetCurrentUser(r):this.reloadAndSetCurrentUserOrClear(r)}async tryRedirectSignIn(e){let n=null;try{n=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return n}async reloadAndSetCurrentUserOrClear(e){try{await nt(e)}catch(n){if(n?.code!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=Ic()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(y(this.app))return Promise.reject(A(this));let n=e?p(e):null;return n&&u(n.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(n&&n._clone(this))}async _updateCurrentUser(e,n=!1){if(!this._deleted)return e&&u(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),n||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return y(this.app)?Promise.reject(A(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return y(this.app)?Promise.reject(A(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(J(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();let n=this._getPasswordPolicyInternal();return n.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):n.validatePassword(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){let e=await Nc(this),n=new Jn(e);this.tenantId===null?this._projectPasswordPolicy=n:this._tenantPasswordPolicies[this.tenantId]=n}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new q("auth","Firebase",e())}onAuthStateChanged(e,n,r){return this.registerStateListener(this.authStateSubscription,e,n,r)}beforeAuthStateChanged(e,n){return this.beforeStateQueue.pushCallback(e,n)}onIdTokenChanged(e,n,r){return this.registerStateListener(this.idTokenSubscription,e,n,r)}authStateReady(){return new Promise((e,n)=>{if(this.currentUser)e();else{let r=this.onAuthStateChanged(()=>{r(),e()},n)}})}async revokeAccessToken(e){if(this.currentUser){let n=await this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:n};this.tenantId!=null&&(r.tenantId=this.tenantId),await Rc(this,r)}}toJSON(){return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:this._currentUser?.toJSON()}}async _setRedirectUser(e,n){let r=await this.getOrInitRedirectPersistenceManager(n);return e===null?r.removeCurrentUser():r.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){let n=e&&J(e)||this._popupRedirectResolver;u(n,this,"argument-error"),this.redirectPersistenceManager=await Dt.create(this,[J(n._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);let e=this.currentUser?.uid??null;this.lastNotifiedUid!==e&&(this.lastNotifiedUid=e,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,n,r,i){if(this._deleted)return()=>{};let s=typeof n=="function"?n:n.next.bind(n),a=!1,c=this._isInitialized?Promise.resolve():this._initializationPromise;if(u(c,this,"internal-error"),c.then(()=>{a||s(this.currentUser)}),typeof n=="function"){let l=e.addObserver(n,r,i);return()=>{a=!0,l()}}else{let l=e.addObserver(n);return()=>{a=!0,l()}}}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 u(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=As(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){let e={"X-Client-Version":this.clientVersion};this.app.options.appId&&(e["X-Firebase-gmpid"]=this.app.options.appId);let n=await this.heartbeatServiceProvider.getImmediate({optional:!0})?.getHeartbeatsHeader();n&&(e["X-Firebase-Client"]=n);let r=await this._getAppCheckToken();return r&&(e["X-Firebase-AppCheck"]=r),e}async _getAppCheckToken(){if(y(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;let e=await this.appCheckServiceProvider.getImmediate({optional:!0})?.getToken();return e?.error&&gc(`Error while retrieving App Check token: ${e.error}`),e?.token}};Lt=class{constructor(e){this.auth=e,this.observer=null,this.addObserver=fi(n=>this.observer=n)}get next(){return u(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}};lt={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};xc=500,Vc=6e4,Et=1e12,Xn=class{constructor(e){this.auth=e,this.counter=Et,this._widgets=new Map}render(e,n){let r=this.counter;return this._widgets.set(r,new er(e,this.auth.name,n||{})),this.counter++,r}reset(e){let n=e||Et;this._widgets.get(n)?.delete(),this._widgets.delete(n)}getResponse(e){let n=e||Et;return this._widgets.get(n)?.getResponse()||""}async execute(e){let n=e||Et;return this._widgets.get(n)?.execute(),""}},Zn=class{constructor(){this.enterprise=new Qn}ready(e){e()}execute(e,n){return Promise.resolve("token")}render(e,n){return""}},Qn=class{ready(e){e()}execute(e,n){return Promise.resolve("token")}render(e,n){return""}},er=class{constructor(e,n,r){this.params=r,this.timerId=null,this.deleted=!1,this.responseToken=null,this.clickHandler=()=>{this.execute()};let i=typeof e=="string"?document.getElementById(e):e;u(i,"argument-error",{appName:n}),this.container=i,this.isVisible=this.params.size!=="invisible",this.isVisible?this.execute():this.container.addEventListener("click",this.clickHandler)}getResponse(){return this.checkIfDeleted(),this.responseToken}delete(){this.checkIfDeleted(),this.deleted=!0,this.timerId&&(clearTimeout(this.timerId),this.timerId=null),this.container.removeEventListener("click",this.clickHandler)}execute(){this.checkIfDeleted(),!this.timerId&&(this.timerId=window.setTimeout(()=>{this.responseToken=Hc(50);let{callback:e,"expired-callback":n}=this.params;if(e)try{e(this.responseToken)}catch{}this.timerId=window.setTimeout(()=>{if(this.timerId=null,this.responseToken=null,n)try{n()}catch{}this.isVisible&&this.execute()},Vc)},xc))}checkIfDeleted(){if(this.deleted)throw new Error("reCAPTCHA mock was already deleted!")}};Wc="recaptcha-enterprise",Ze="NO_RECAPTCHA",zi="onFirebaseAuthREInstanceReady",rt=class t{constructor(e){this.type=Wc,this.auth=E(e)}async verify(e="verify",n=!1){async function r(s){if(!n){if(s.tenantId==null&&s._agentRecaptchaConfig!=null)return s._agentRecaptchaConfig.siteKey;if(s.tenantId!=null&&s._tenantRecaptchaConfigs[s.tenantId]!==void 0)return s._tenantRecaptchaConfigs[s.tenantId].siteKey}return new Promise(async(a,c)=>{ps(s,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(l=>{if(l.recaptchaKey===void 0)c(new Error("recaptcha Enterprise site key undefined"));else{let o=new Rt(l);return s.tenantId==null?s._agentRecaptchaConfig=o:s._tenantRecaptchaConfigs[s.tenantId]=o,a(o.siteKey)}}).catch(l=>{c(l)})})}function i(s,a,c){let l=window.grecaptcha;Vi(l)?l.enterprise.ready(()=>{l.enterprise.execute(s,{action:e}).then(o=>{a(o)}).catch(()=>{a(Ze)})}):c(Error("No reCAPTCHA enterprise script loaded."))}return this.auth.settings.appVerificationDisabledForTesting?new Zn().execute("siteKey",{action:"verify"}):new Promise((s,a)=>{r(this.auth).then(async c=>{if(!n&&Vi(window.grecaptcha)&&t.scriptInjectionDeferred)await t.scriptInjectionDeferred.promise,i(c,s,a);else{if(typeof window>"u"){a(new Error("RecaptchaVerifier is only supported in browser"));return}let l=Uc();l.length!==0&&(l+=c+`&onload=${zi}`),t.scriptInjectionDeferred=new Te,window[zi]=()=>{t.scriptInjectionDeferred?.resolve()},Sr(l).then(()=>t.scriptInjectionDeferred?.promise).then(()=>{i(c,s,a)}).catch(o=>{a(o)})}}).catch(c=>{a(c)})})}};rt.scriptInjectionDeferred=null;Q=class{constructor(e,n){this.providerId=e,this.signInMethod=n}toJSON(){return $("not implemented")}_getIdTokenResponse(e){return $("not implemented")}_linkToIdToken(e,n){return $("not implemented")}_getReauthenticationResolver(e){return $("not implemented")}};Ce=class t extends Q{constructor(e,n,r,i=null){super("password",r),this._email=e,this._password=n,this._tenantId=i}static _fromEmailAndPassword(e,n){return new t(e,n,"password")}static _fromEmailAndCode(e,n,r=null){return new t(e,n,"emailLink",r)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){let n=typeof e=="string"?JSON.parse(e):e;if(n?.email&&n?.password){if(n.signInMethod==="password")return this._fromEmailAndPassword(n.email,n.password);if(n.signInMethod==="emailLink")return this._fromEmailAndCode(n.email,n.password,n.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":let n={returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return ae(e,n,"signInWithPassword",Kc,"EMAIL_PASSWORD_PROVIDER");case"emailLink":return Qc(e,{email:this._email,oobCode:this._password});default:R(e,"internal-error")}}async _linkToIdToken(e,n){switch(this.signInMethod){case"password":let r={idToken:n,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return ae(e,r,"signUpPassword",Gc,"EMAIL_PASSWORD_PROVIDER");case"emailLink":return el(e,{idToken:n,email:this._email,oobCode:this._password});default:R(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}};tl="http://localhost",j=class t extends Q{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){let n=new t(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(n.idToken=e.idToken),e.accessToken&&(n.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(n.nonce=e.nonce),e.pendingToken&&(n.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(n.accessToken=e.oauthToken,n.secret=e.oauthTokenSecret):R("argument-error"),n}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){let n=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:i,...s}=n;if(!r||!i)return null;let a=new t(r,i);return a.idToken=s.idToken||void 0,a.accessToken=s.accessToken||void 0,a.secret=s.secret,a.nonce=s.nonce,a.pendingToken=s.pendingToken||null,a}_getIdTokenResponse(e){let n=this.buildRequest();return Y(e,n)}_linkToIdToken(e,n){let r=this.buildRequest();return r.idToken=n,Y(e,r)}_getReauthenticationResolver(e){let n=this.buildRequest();return n.autoCreate=!1,Y(e,n)}buildRequest(){let e={requestUri:tl,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{let n={};this.idToken&&(n.id_token=this.idToken),this.accessToken&&(n.access_token=this.accessToken),this.secret&&(n.oauth_token_secret=this.secret),n.providerId=this.providerId,this.nonce&&!this.pendingToken&&(n.nonce=this.nonce),e.postBody=de(n)}return e}};il={USER_NOT_FOUND:"user-not-found"};ge=class t extends Q{constructor(e){super("phone","phone"),this.params=e}static _fromVerification(e,n){return new t({verificationId:e,verificationCode:n})}static _fromTokenResponse(e,n){return new t({phoneNumber:e,temporaryProof:n})}_getIdTokenResponse(e){return nl(e,this._makeVerificationRequest())}_linkToIdToken(e,n){return rl(e,{idToken:n,...this._makeVerificationRequest()})}_getReauthenticationResolver(e){return sl(e,this._makeVerificationRequest())}_makeVerificationRequest(){let{temporaryProof:e,phoneNumber:n,verificationId:r,verificationCode:i}=this.params;return e&&n?{temporaryProof:e,phoneNumber:n}:{sessionInfo:r,code:i}}toJSON(){let e={providerId:this.providerId};return this.params.phoneNumber&&(e.phoneNumber=this.params.phoneNumber),this.params.temporaryProof&&(e.temporaryProof=this.params.temporaryProof),this.params.verificationCode&&(e.verificationCode=this.params.verificationCode),this.params.verificationId&&(e.verificationId=this.params.verificationId),e}static fromJSON(e){typeof e=="string"&&(e=JSON.parse(e));let{verificationId:n,verificationCode:r,phoneNumber:i,temporaryProof:s}=e;return!r&&!n&&!i&&!s?null:new t({verificationId:n,verificationCode:r,phoneNumber:i,temporaryProof:s})}};_e=class t{constructor(e){let n=ve(Ae(e)),r=n.apiKey??null,i=n.oobCode??null,s=ol(n.mode??null);u(r&&i&&s,"argument-error"),this.apiKey=r,this.operation=s,this.code=i,this.continueUrl=n.continueUrl??null,this.languageCode=n.lang??null,this.tenantId=n.tenantId??null}static parseLink(e){let n=al(e);try{return new t(n)}catch{return null}}};ee=class t{constructor(){this.providerId=t.PROVIDER_ID}static credential(e,n){return Ce._fromEmailAndPassword(e,n)}static credentialWithLink(e,n){let r=_e.parseLink(n);return u(r,"argument-error"),Ce._fromEmailAndCode(e,r.code,r.tenantId)}};ee.PROVIDER_ID="password";ee.EMAIL_PASSWORD_SIGN_IN_METHOD="password";ee.EMAIL_LINK_SIGN_IN_METHOD="emailLink";x=class{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}};le=class extends x{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}},Mt=class t extends le{static credentialFromJSON(e){let n=typeof e=="string"?JSON.parse(e):e;return u("providerId"in n&&"signInMethod"in n,"argument-error"),j._fromParams(n)}credential(e){return this._credential({...e,nonce:e.rawNonce})}_credential(e){return u(e.idToken||e.accessToken,"argument-error"),j._fromParams({...e,providerId:this.providerId,signInMethod:this.providerId})}static credentialFromResult(e){return t.oauthCredentialFromTaggedObject(e)}static credentialFromError(e){return t.oauthCredentialFromTaggedObject(e.customData||{})}static oauthCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{oauthIdToken:n,oauthAccessToken:r,oauthTokenSecret:i,pendingToken:s,nonce:a,providerId:c}=e;if(!r&&!i&&!n&&!s||!c)return null;try{return new t(c)._credential({idToken:n,accessToken:r,nonce:a,pendingToken:s})}catch{return null}}};Oe=class t extends le{constructor(){super("facebook.com")}static credential(e){return j._fromParams({providerId:t.PROVIDER_ID,signInMethod:t.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return t.credentialFromTaggedObject(e)}static credentialFromError(e){return t.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return t.credential(e.oauthAccessToken)}catch{return null}}};Oe.FACEBOOK_SIGN_IN_METHOD="facebook.com";Oe.PROVIDER_ID="facebook.com";Ne=class t extends le{constructor(){super("google.com"),this.addScope("profile")}static credential(e,n){return j._fromParams({providerId:t.PROVIDER_ID,signInMethod:t.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:n})}static credentialFromResult(e){return t.credentialFromTaggedObject(e)}static credentialFromError(e){return t.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{oauthIdToken:n,oauthAccessToken:r}=e;if(!n&&!r)return null;try{return t.credential(n,r)}catch{return null}}};Ne.GOOGLE_SIGN_IN_METHOD="google.com";Ne.PROVIDER_ID="google.com";De=class t extends le{constructor(){super("github.com")}static credential(e){return j._fromParams({providerId:t.PROVIDER_ID,signInMethod:t.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return t.credentialFromTaggedObject(e)}static credentialFromError(e){return t.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return t.credential(e.oauthAccessToken)}catch{return null}}};De.GITHUB_SIGN_IN_METHOD="github.com";De.PROVIDER_ID="github.com";cl="http://localhost",Ut=class t extends Q{constructor(e,n){super(e,e),this.pendingToken=n}_getIdTokenResponse(e){let n=this.buildRequest();return Y(e,n)}_linkToIdToken(e,n){let r=this.buildRequest();return r.idToken=n,Y(e,r)}_getReauthenticationResolver(e){let n=this.buildRequest();return n.autoCreate=!1,Y(e,n)}toJSON(){return{signInMethod:this.signInMethod,providerId:this.providerId,pendingToken:this.pendingToken}}static fromJSON(e){let n=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:i,pendingToken:s}=n;return!r||!i||!s||r!==i?null:new t(r,s)}static _create(e,n){return new t(e,n)}buildRequest(){return{requestUri:cl,returnSecureToken:!0,pendingToken:this.pendingToken}}};ll="saml.",Ft=class t extends x{constructor(e){u(e.startsWith(ll),"argument-error"),super(e)}static credentialFromResult(e){return t.samlCredentialFromTaggedObject(e)}static credentialFromError(e){return t.samlCredentialFromTaggedObject(e.customData||{})}static credentialFromJSON(e){let n=Ut.fromJSON(e);return u(n,"argument-error"),n}static samlCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{pendingToken:n,providerId:r}=e;if(!n||!r)return null;try{return Ut._create(r,n)}catch{return null}}};Le=class t extends le{constructor(){super("twitter.com")}static credential(e,n){return j._fromParams({providerId:t.PROVIDER_ID,signInMethod:t.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:n})}static credentialFromResult(e){return t.credentialFromTaggedObject(e)}static credentialFromError(e){return t.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{oauthAccessToken:n,oauthTokenSecret:r}=e;if(!n||!r)return null;try{return t.credential(n,r)}catch{return null}}};Le.TWITTER_SIGN_IN_METHOD="twitter.com";Le.PROVIDER_ID="twitter.com";V=class t{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,n,r,i=!1){let s=await oe._fromIdTokenResponse(e,r,i),a=Gi(r);return new t({user:s,providerId:a,_tokenResponse:r,operationType:n})}static async _forOperation(e,n,r){await e._updateTokensIfNecessary(r,!0);let i=Gi(r);return new t({user:e,providerId:i,_tokenResponse:r,operationType:n})}};tr=class t extends L{constructor(e,n,r,i){super(n.code,n.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,t.prototype),this.customData={appName:e.name,tenantId:e.tenantId??void 0,_serverResponse:n.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,n,r,i){return new t(e,n,r,i)}};Ie=class{constructor(e,n){this.factorId=e,this.uid=n.mfaEnrollmentId,this.enrollmentTime=new Date(n.enrolledAt).toUTCString(),this.displayName=n.displayName}static _fromServerResponse(e,n){return"phoneInfo"in n?nr._fromServerResponse(e,n):"totpInfo"in n?rr._fromServerResponse(e,n):R(e,"internal-error")}},nr=class t extends Ie{constructor(e){super("phone",e),this.phoneNumber=e.phoneInfo}static _fromServerResponse(e,n){return new t(n)}},rr=class t extends Ie{constructor(e){super("totp",e)}static _fromServerResponse(e,n){return new t(n)}};ce=class{constructor(e,n,r={}){this.isNewUser=e,this.providerId=n,this.profile=r}},xt=class extends ce{constructor(e,n,r,i){super(e,n,r),this.username=i}},ir=class extends ce{constructor(e,n){super(e,"facebook.com",n)}},sr=class extends xt{constructor(e,n){super(e,"github.com",n,typeof n?.login=="string"?n?.login:null)}},or=class extends ce{constructor(e,n){super(e,"google.com",n)}},ar=class extends xt{constructor(e,n,r){super(e,"twitter.com",n,r)}};Vt=class t{constructor(e,n,r){this.type=e,this.credential=n,this.user=r}static _fromIdtoken(e,n){return new t("enroll",e,n)}static _fromMfaPendingCredential(e){return new t("signin",e)}toJSON(){return{multiFactorSession:{[this.type==="enroll"?"idToken":"pendingCredential"]:this.credential}}}static fromJSON(e){if(e?.multiFactorSession){if(e.multiFactorSession?.pendingCredential)return t._fromMfaPendingCredential(e.multiFactorSession.pendingCredential);if(e.multiFactorSession?.idToken)return t._fromIdtoken(e.multiFactorSession.idToken)}return null}};cr=class t{constructor(e,n,r){this.session=e,this.hints=n,this.signInResolver=r}static _fromError(e,n){let r=E(e),i=n.customData._serverResponse,s=(i.mfaInfo||[]).map(c=>Ie._fromServerResponse(r,c));u(i.mfaPendingCredential,r,"internal-error");let a=Vt._fromMfaPendingCredential(i.mfaPendingCredential);return new t(a,s,async c=>{let l=await c._process(r,a);delete i.mfaInfo,delete i.mfaPendingCredential;let o={...i,idToken:l.idToken,refreshToken:l.refreshToken};switch(n.operationType){case"signIn":let d=await V._fromIdTokenResponse(r,n.operationType,o);return await r._updateCurrentUser(d.user),d;case"reauthenticate":return u(n.user,r,"internal-error"),V._forOperation(n.user,n.operationType,o);default:R(r,"internal-error")}})}async resolveSignIn(e){let n=e;return this.signInResolver(n)}};lr=class t{constructor(e){this.user=e,this.enrolledFactors=[],e._onReload(n=>{n.mfaInfo&&(this.enrolledFactors=n.mfaInfo.map(r=>Ie._fromServerResponse(e.auth,r)))})}static _fromUser(e){return new t(e)}async getSession(){return Vt._fromIdtoken(await this.user.getIdToken(),this.user)}async enroll(e,n){let r=e,i=await this.getSession(),s=await Z(this.user,r._process(this.user.auth,i,n));return await this.user._updateTokensIfNecessary(s),this.user.reload()}async unenroll(e){let n=typeof e=="string"?e:e.uid,r=await this.user.getIdToken();try{let i=await Z(this.user,_l(this.user.auth,{idToken:r,mfaEnrollmentId:n}));this.enrolledFactors=this.enrolledFactors.filter(({uid:s})=>s!==n),await this.user._updateTokensIfNecessary(i),await this.user.reload()}catch(i){throw i}}},Hn=new WeakMap;Ht="__sak";Wt=class{constructor(e,n){this.storageRetriever=e,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(Ht,"1"),this.storage.removeItem(Ht),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,n){return this.storage.setItem(e,JSON.stringify(n)),Promise.resolve()}_get(e){let n=this.storage.getItem(e);return Promise.resolve(n?JSON.parse(n):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}};Il=1e3,yl=10,Bt=class extends Wt{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,n)=>this.onStorageEvent(e,n),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=vs(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(let n of Object.keys(this.listeners)){let r=this.storage.getItem(n),i=this.localCache[n];r!==i&&e(n,i,r)}}onStorageEvent(e,n=!1){if(!e.key){this.forAllChangedKeys((a,c,l)=>{this.notifyListeners(a,l)});return}let r=e.key;n?this.detachListener():this.stopPolling();let i=()=>{let a=this.storage.getItem(r);!n&&this.localCache[r]===a||this.notifyListeners(r,a)},s=this.storage.getItem(r);Oc()&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(i,yl):i()}notifyListeners(e,n){this.localCache[e]=n;let r=this.listeners[e];if(r)for(let i of Array.from(r))i(n&&JSON.parse(n))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,n,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:n,newValue:r}),!0)})},Il)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,n){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,n){await super._set(e,n),this.localCache[e]=JSON.stringify(n)}async _get(e){let n=await super._get(e);return this.localCache[e]=JSON.stringify(n),n}async _remove(e){await super._remove(e),delete this.localCache[e]}};Bt.type="LOCAL";Ur=Bt;bl=1e3;zt=class{constructor(){this.type="COOKIE",this.listenerUnsubscribes=new Map}_getFinalTarget(e){if(typeof window===void 0)return e;let n=new URL(`${window.location.origin}/__cookies__`);return n.searchParams.set("finalTarget",e),n}async _isAvailable(){return typeof isSecureContext=="boolean"&&!isSecureContext||typeof navigator>"u"||typeof document>"u"?!1:navigator.cookieEnabled??!0}async _set(e,n){}async _get(e){if(!this._isAvailable())return null;let n=Bn(e);return window.cookieStore?(await window.cookieStore.get(n))?.value:Wn(n)}async _remove(e){if(!this._isAvailable()||!await this._get(e))return;let r=Bn(e);document.cookie=`${r}=;Max-Age=34560000;Partitioned;Secure;SameSite=Strict;Path=/;Priority=High`,await fetch("/__cookies__",{method:"DELETE"}).catch(()=>{})}_addListener(e,n){if(!this._isAvailable())return;let r=Bn(e);if(window.cookieStore){let c=(o=>{let d=o.changed.find(h=>h.name===r);d&&n(d.value),o.deleted.find(h=>h.name===r)&&n(null)}),l=()=>window.cookieStore.removeEventListener("change",c);return this.listenerUnsubscribes.set(n,l),window.cookieStore.addEventListener("change",c)}let i=Wn(r),s=setInterval(()=>{let c=Wn(r);c!==i&&(n(c),i=c)},bl),a=()=>clearInterval(s);this.listenerUnsubscribes.set(n,a)}_removeListener(e,n){let r=this.listenerUnsubscribes.get(n);r&&(r(),this.listenerUnsubscribes.delete(n))}};zt.type="COOKIE";po=zt;$t=class extends Wt{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,n){}_removeListener(e,n){}};$t.type="SESSION";rn=$t;jt=class t{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){let n=this.receivers.find(i=>i.isListeningto(e));if(n)return n;let r=new t(e);return this.receivers.push(r),r}isListeningto(e){return this.eventTarget===e}async handleEvent(e){let n=e,{eventId:r,eventType:i,data:s}=n.data,a=this.handlersMap[i];if(!a?.size)return;n.ports[0].postMessage({status:"ack",eventId:r,eventType:i});let c=Array.from(a).map(async o=>o(n.origin,s)),l=await El(c);n.ports[0].postMessage({status:"done",eventId:r,eventType:i,response:l})}_subscribe(e,n){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(n)}_unsubscribe(e,n){this.handlersMap[e]&&n&&this.handlersMap[e].delete(n),(!n||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}};jt.receivers=[];ur=class{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,n,r=50){let i=typeof MessageChannel<"u"?new MessageChannel:null;if(!i)throw new Error("connection_unavailable");let s,a;return new Promise((c,l)=>{let o=sn("",20);i.port1.start();let d=setTimeout(()=>{l(new Error("unsupported_event"))},r);a={messageChannel:i,onMessage(f){let h=f;if(h.data.eventId===o)switch(h.data.status){case"ack":clearTimeout(d),s=setTimeout(()=>{l(new Error("timeout"))},3e3);break;case"done":clearTimeout(s),c(h.data.response);break;default:clearTimeout(d),clearTimeout(s),l(new Error("invalid_response"));break}}},this.handlers.add(a),i.port1.addEventListener("message",a.onMessage),this.target.postMessage({eventType:e,eventId:o,data:n},[i.port2])}).finally(()=>{a&&this.removeMessageHandler(a)})}};mo="firebaseLocalStorageDb",Sl=1,Gt="firebaseLocalStorage",go="fbase_key",ye=class{constructor(e){this.request=e}toPromise(){return new Promise((e,n)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{n(this.request.error)})})}};Rl=800,Cl=3,qt=class{constructor(){this.type="LOCAL",this.dbPromise=null,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.dbPromise?this.dbPromise:(this.dbPromise=_o(),this.dbPromise.catch(()=>{this.dbPromise=null}),this.dbPromise)}async _withRetries(e){let n=0;for(;;)try{let r=await this._openDb();return await e(r)}catch(r){if(n++>Cl)throw r;this.dbPromise&&((await this.dbPromise).close(),this.dbPromise=null)}}async initializeServiceWorkerMessaging(){return Fr()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=jt._getInstance(Al()),this.receiver._subscribe("keyChanged",async(e,n)=>({keyProcessed:(await this._poll()).includes(n.key)})),this.receiver._subscribe("ping",async(e,n)=>["keyChanged"])}async initializeSender(){if(this.activeServiceWorker=await Tl(),!this.activeServiceWorker)return;this.sender=new ur(this.activeServiceWorker);let 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||vl()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{return indexedDB?(await this._withRetries(async e=>{await Ki(e,Ht,"1"),await Ji(e,Ht)}),!0):!1}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,n){return this._withPendingWrite(async()=>(await this._withRetries(r=>Ki(r,e,n)),this.localCache[e]=n,this.notifyServiceWorker(e)))}async _get(e){let n=await this._withRetries(r=>Pl(r,e));return this.localCache[e]=n,n}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(n=>Ji(n,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){let e=await this._withRetries(i=>{let s=on(i,!1).getAll();return new ye(s).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];let n=[],r=new Set;if(e.length!==0)for(let{fbase_key:i,value:s}of e)r.add(i),JSON.stringify(this.localCache[i])!==JSON.stringify(s)&&(this.notifyListeners(i,s),n.push(i));for(let i of Object.keys(this.localCache))this.localCache[i]&&!r.has(i)&&(this.notifyListeners(i,null),n.push(i));return n}notifyListeners(e,n){this.localCache[e]=n;let r=this.listeners[e];if(r)for(let i of Array.from(r))i(n)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),Rl)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,n){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&this.stopPolling()}};qt.type="LOCAL";xr=qt;zn=Ss("rcb"),Dl=new me(3e4,6e4),dr=class{constructor(){this.hostLanguage="",this.counter=0,this.librarySeparatelyLoaded=!!w().grecaptcha?.render}load(e,n=""){return u(Ll(n),e,"argument-error"),this.shouldResolveImmediately(n)&&xi(w().grecaptcha)?Promise.resolve(w().grecaptcha):new Promise((r,i)=>{let s=w().setTimeout(()=>{i(k(e,"network-request-failed"))},Dl.get());w()[zn]=()=>{w().clearTimeout(s),delete w()[zn];let c=w().grecaptcha;if(!c||!xi(c)){i(k(e,"internal-error"));return}let l=c.render;c.render=(o,d)=>{let f=l(o,d);return this.counter++,f},this.hostLanguage=n,r(c)};let a=`${Mc()}?${de({onload:zn,render:"explicit",hl:n})}`;Sr(a).catch(()=>{clearTimeout(s),i(k(e,"internal-error"))})})}clearedOneInstance(){this.counter--}shouldResolveImmediately(e){return!!w().grecaptcha?.render&&(e===this.hostLanguage||this.counter>0||this.librarySeparatelyLoaded)}};hr=class{async load(e){return new Xn(e)}clearedOneInstance(){}};Qe="recaptcha",Ml={theme:"light",type:"image"},Kt=class{constructor(e,n,r={...Ml}){this.parameters=r,this.type=Qe,this.destroyed=!1,this.widgetId=null,this.tokenChangeListeners=new Set,this.renderPromise=null,this.recaptcha=null,this.auth=E(e),this.isInvisible=this.parameters.size==="invisible",u(typeof document<"u",this.auth,"operation-not-supported-in-this-environment");let i=typeof n=="string"?document.getElementById(n):n;u(i,this.auth,"argument-error"),this.container=i,this.parameters.callback=this.makeTokenCallback(this.parameters.callback),this._recaptchaLoader=this.auth.settings.appVerificationDisabledForTesting?new hr:new dr,this.validateStartingState()}async verify(){this.assertNotDestroyed();let e=await this.render(),n=this.getAssertedRecaptcha(),r=n.getResponse(e);return r||new Promise(i=>{let s=a=>{a&&(this.tokenChangeListeners.delete(s),i(a))};this.tokenChangeListeners.add(s),this.isInvisible&&n.execute(e)})}render(){try{this.assertNotDestroyed()}catch(e){return Promise.reject(e)}return this.renderPromise?this.renderPromise:(this.renderPromise=this.makeRenderPromise().catch(e=>{throw this.renderPromise=null,e}),this.renderPromise)}_reset(){this.assertNotDestroyed(),this.widgetId!==null&&this.getAssertedRecaptcha().reset(this.widgetId)}clear(){this.assertNotDestroyed(),this.destroyed=!0,this._recaptchaLoader.clearedOneInstance(),this.isInvisible||this.container.childNodes.forEach(e=>{this.container.removeChild(e)})}validateStartingState(){u(!this.parameters.sitekey,this.auth,"argument-error"),u(this.isInvisible||!this.container.hasChildNodes(),this.auth,"argument-error"),u(typeof document<"u",this.auth,"operation-not-supported-in-this-environment")}makeTokenCallback(e){return n=>{if(this.tokenChangeListeners.forEach(r=>r(n)),typeof e=="function")e(n);else if(typeof e=="string"){let r=w()[e];typeof r=="function"&&r(n)}}}assertNotDestroyed(){u(!this.destroyed,this.auth,"internal-error")}async makeRenderPromise(){if(await this.init(),!this.widgetId){let e=this.container;if(!this.isInvisible){let n=document.createElement("div");e.appendChild(n),e=n}this.widgetId=this.getAssertedRecaptcha().render(e,this.parameters)}return this.widgetId}async init(){u(Er()&&!Fr(),this.auth,"internal-error"),await Ul(),this.recaptcha=await this._recaptchaLoader.load(this.auth,this.auth.languageCode||void 0);let e=await Tc(this.auth);u(e,this.auth,"internal-error"),this.parameters.sitekey=e}getAssertedRecaptcha(){return u(this.recaptcha,this.auth,"internal-error"),this.recaptcha}};it=class{constructor(e,n){this.verificationId=e,this.onConfirmation=n}confirm(e){let n=ge._fromVerification(this.verificationId,e);return this.onConfirmation(n)}};Me=class t{constructor(e){this.providerId=t.PROVIDER_ID,this.auth=E(e)}verifyPhoneNumber(e,n){return an(this.auth,e,p(n))}static credential(e,n){return ge._fromVerification(e,n)}static credentialFromResult(e){let n=e;return t.credentialFromTaggedObject(n)}static credentialFromError(e){return t.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{phoneNumber:n,temporaryProof:r}=e;return n&&r?ge._fromTokenResponse(n,r):null}};Me.PROVIDER_ID="phone";Me.PHONE_SIGN_IN_METHOD="phone";st=class extends Q{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return Y(e,this._buildIdpRequest())}_linkToIdToken(e,n){return Y(e,this._buildIdpRequest(n))}_getReauthenticationResolver(e){return Y(e,this._buildIdpRequest())}_buildIdpRequest(e){let n={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&&(n.idToken=e),n}};Jt=class{constructor(e,n,r,i,s=!1){this.auth=e,this.resolver=r,this.user=i,this.bypassAuthState=s,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(n)?n:[n]}execute(){return new Promise(async(e,n)=>{this.pendingPromise={resolve:e,reject:n};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}})}async onAuthEvent(e){let{urlResponse:n,sessionId:r,postBody:i,tenantId:s,error:a,type:c}=e;if(a){this.reject(a);return}let l={auth:this.auth,requestUri:n,sessionId:r,tenantId:s||void 0,postBody:i||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(c)(l))}catch(o){this.reject(o)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return Fl;case"linkViaPopup":case"linkViaRedirect":return Vl;case"reauthViaPopup":case"reauthViaRedirect":return xl;default:R(this.auth,"internal-error")}}resolve(e){X(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){X(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()}};Hl=new me(2e3,1e4);Ue=class t extends Jt{constructor(e,n,r,i,s){super(e,n,i,s),this.provider=r,this.authWindow=null,this.pollId=null,t.currentPopupAction&&t.currentPopupAction.cancel(),t.currentPopupAction=this}async executeNotNull(){let e=await this.execute();return u(e,this.auth,"internal-error"),e}async onExecution(){X(this.filter.length===1,"Popup operations only handle one event");let e=sn();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(n=>{this.reject(n)}),this.resolver._isIframeWebStorageSupported(this.auth,n=>{n||this.reject(k(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){return this.authWindow?.associatedEvent||null}cancel(){this.reject(k(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,t.currentPopupAction=null}pollUserCancellation(){let e=()=>{if(this.authWindow?.window?.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(k(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,Hl.get())};e()}};Ue.currentPopupAction=null;Wl="pendingRedirect",At=new Map,fr=class extends Jt{constructor(e,n,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,r),this.eventId=null}async execute(){let e=At.get(this.auth._key());if(!e){try{let r=await Bl(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(r)}catch(n){e=()=>Promise.reject(n)}At.set(this.auth._key(),e)}return this.bypassAuthState||At.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if(e.type==="signInViaRedirect")return super.onAuthEvent(e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){let n=await this.auth._redirectUserForId(e.eventId);if(n)return this.user=n,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}};ql=600*1e3,pr=class{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 n=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(e,r)&&(n=!0,this.sendToConsumer(e,r),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!Kl(e)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=e,n=!0)),n}sendToConsumer(e,n){if(e.error&&!Do(e)){let r=e.error.code?.split("auth/")[1]||"internal-error";n.onError(k(this.auth,r))}else n.onAuthEvent(e)}isEventForConsumer(e,n){let r=n.eventId===null||!!e.eventId&&e.eventId===n.eventId;return n.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=ql&&this.cachedEventUids.clear(),this.cachedEventUids.has(Xi(e))}saveEventToCache(e){this.cachedEventUids.add(Xi(e)),this.lastProcessedEventTime=Date.now()}};Yl=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Xl=/^https?/;eu=new me(3e4,6e4);St=null;ru=new me(5e3,15e3),iu="__/auth/iframe",su="emulator/auth/iframe",ou={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},au=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);uu={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},du=500,hu=600,fu="_blank",pu="http://localhost",Yt=class{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}};_u="__/auth/handler",Iu="emulator/auth/handler",yu=encodeURIComponent("fac");jn="webStorageSupport",mr=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=rn,this._completeRedirectFn=Oo,this._overrideRedirectResult=zl}async _openPopup(e,n,r,i){X(this.eventManagers[e._key()]?.manager,"_initialize() not called before _openPopup()");let s=await Qi(e,n,r,et(),i);return mu(e,s,sn())}async _openRedirect(e,n,r,i){await this._originValidation(e);let s=await Qi(e,n,r,et(),i);return wl(s),new Promise(()=>{})}_initialize(e){let n=e._key();if(this.eventManagers[n]){let{manager:i,promise:s}=this.eventManagers[n];return i?Promise.resolve(i):(X(s,"If manager is not set, promise should be"),s)}let r=this.initAndGetManager(e);return this.eventManagers[n]={promise:r},r.catch(()=>{delete this.eventManagers[n]}),r}async initAndGetManager(e){let n=await lu(e),r=new pr(e);return n.register("authEvent",i=>(u(i?.authEvent,e,"invalid-auth-event"),{status:r.onEvent(i.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=n,r}_isIframeWebStorageSupported(e,n){this.iframes[e._key()].send(jn,{type:jn},i=>{let s=i?.[0]?.[jn];s!==void 0&&n(!!s),R(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){let n=e._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=Zl(e)),this.originValidationPromises[n]}get _shouldInitProactively(){return vs()||Is()||Ar()}},Hr=mr,Xt=class{constructor(e){this.factorId=e}_process(e,n,r){switch(n.type){case"enroll":return this._finalizeEnroll(e,n.credential,r);case"signin":return this._finalizeSignIn(e,n.credential);default:return $("unexpected MultiFactorSessionType")}}},gr=class t extends Xt{constructor(e){super("phone"),this.credential=e}static _fromCredential(e){return new t(e)}_finalizeEnroll(e,n,r){return pl(e,{idToken:n,displayName:r,phoneVerificationInfo:this.credential._makeVerificationRequest()})}_finalizeSignIn(e,n){return Ol(e,{mfaPendingCredential:n,phoneVerificationInfo:this.credential._makeVerificationRequest()})}},ot=class{constructor(){}static assertion(e){return gr._fromCredential(e)}};ot.FACTOR_ID="phone";at=class{static assertionForEnrollment(e,n){return Zt._fromSecret(e,n)}static assertionForSignIn(e,n){return Zt._fromEnrollmentId(e,n)}static async generateSecret(e){let n=e;u(typeof n.user?.auth<"u","internal-error");let r=await ml(n.user.auth,{idToken:n.credential,totpEnrollmentInfo:{}});return ct._fromStartTotpMfaEnrollmentResponse(r,n.user.auth)}};at.FACTOR_ID="totp";Zt=class t extends Xt{constructor(e,n,r){super("totp"),this.otp=e,this.enrollmentId=n,this.secret=r}static _fromSecret(e,n){return new t(n,void 0,e)}static _fromEnrollmentId(e,n){return new t(n,e)}async _finalizeEnroll(e,n,r){return u(typeof this.secret<"u",e,"argument-error"),gl(e,{idToken:n,displayName:r,totpVerificationInfo:this.secret._makeTotpVerificationInfo(this.otp)})}async _finalizeSignIn(e,n){u(this.enrollmentId!==void 0&&this.otp!==void 0,e,"argument-error");let r={verificationCode:this.otp};return Nl(e,{mfaPendingCredential:n,mfaEnrollmentId:this.enrollmentId,totpVerificationInfo:r})}},ct=class t{constructor(e,n,r,i,s,a,c){this.sessionInfo=a,this.auth=c,this.secretKey=e,this.hashingAlgorithm=n,this.codeLength=r,this.codeIntervalSeconds=i,this.enrollmentCompletionDeadline=s}static _fromStartTotpMfaEnrollmentResponse(e,n){return new t(e.totpSessionInfo.sharedSecretKey,e.totpSessionInfo.hashingAlgorithm,e.totpSessionInfo.verificationCodeLength,e.totpSessionInfo.periodSec,new Date(e.totpSessionInfo.finalizeEnrollmentTime).toUTCString(),e.totpSessionInfo.sessionInfo,n)}_makeTotpVerificationInfo(e){return{sessionInfo:this.sessionInfo,verificationCode:e}}generateQrCodeUrl(e,n){let r=!1;return(wt(e)||wt(n))&&(r=!0),r&&(wt(e)&&(e=this.auth.currentUser?.email||"unknownuser"),wt(n)&&(n=this.auth.name)),`otpauth://totp/${n}:${e}?secret=${this.secretKey}&issuer=${n}&algorithm=${this.hashingAlgorithm}&digits=${this.codeLength}`}};es="@firebase/auth",ts="1.13.3";_r=class{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){return this.assertAuthConfigured(),this.auth.currentUser?.uid||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;let n=this.auth.onIdTokenChanged(r=>{e(r?.stsTokenManager.accessToken||null)});this.internalListeners.set(e,n),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();let n=this.internalListeners.get(e);n&&(this.internalListeners.delete(e),n(),this.updateProactiveRefresh())}assertAuthConfigured(){u(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}};Tu=300,vu=bn("authIdTokenMaxAge")||Tu,ns=null,Au=t=>async e=>{let n=e&&await e.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>vu)return;let i=n?.token;ns!==i&&(ns=i,await fetch(t,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};Lc({loadJS(t){return new Promise((e,n)=>{let r=document.createElement("script");r.setAttribute("src",t),r.onload=e,r.onerror=i=>{let s=k("internal-error");s.customData=i,n(s)},r.type="text/javascript",r.charset="UTF-8",Su().appendChild(r)})},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")});var Uo=F(()=>{Mo();qe();Se();_t();gt()});var cn={};Xr(cn,{ActionCodeOperation:()=>as,ActionCodeURL:()=>_e,AuthCredential:()=>Q,AuthErrorCodes:()=>ds,EmailAuthCredential:()=>Ce,EmailAuthProvider:()=>ee,FacebookAuthProvider:()=>Oe,FactorId:()=>rs,GithubAuthProvider:()=>De,GoogleAuthProvider:()=>Ne,OAuthCredential:()=>j,OAuthProvider:()=>Mt,OperationType:()=>os,PhoneAuthCredential:()=>ge,PhoneAuthProvider:()=>Me,PhoneMultiFactorGenerator:()=>ot,ProviderId:()=>is,RecaptchaVerifier:()=>Kt,SAMLAuthProvider:()=>Ft,SignInMethod:()=>ss,TotpMultiFactorGenerator:()=>at,TotpSecret:()=>ct,TwitterAuthProvider:()=>Le,applyActionCode:()=>Ws,beforeAuthStateChanged:()=>Mr,browserCookiePersistence:()=>po,browserLocalPersistence:()=>Ur,browserPopupRedirectResolver:()=>Hr,browserSessionPersistence:()=>rn,checkActionCode:()=>Dr,confirmPasswordReset:()=>Hs,connectAuthEmulator:()=>Pr,createUserWithEmailAndPassword:()=>zs,debugErrorMap:()=>ls,deleteUser:()=>uo,fetchSignInMethodsForEmail:()=>Ks,getAdditionalUserInfo:()=>to,getAuth:()=>Lo,getIdToken:()=>ms,getIdTokenResult:()=>Tr,getMultiFactorResolver:()=>ho,getRedirectResult:()=>Co,inMemoryPersistence:()=>Nt,indexedDBLocalPersistence:()=>xr,initializeAuth:()=>kr,initializeRecaptchaConfig:()=>ro,isSignInWithEmailLink:()=>Gs,linkWithCredential:()=>Cr,linkWithPhoneNumber:()=>yo,linkWithPopup:()=>vo,linkWithRedirect:()=>Ro,multiFactor:()=>fo,onAuthStateChanged:()=>so,onIdTokenChanged:()=>Lr,parseActionCodeURL:()=>Cs,prodErrorMap:()=>Ir,reauthenticateWithCredential:()=>Or,reauthenticateWithPhoneNumber:()=>bo,reauthenticateWithPopup:()=>To,reauthenticateWithRedirect:()=>Po,reload:()=>vr,revokeAccessToken:()=>lo,sendEmailVerification:()=>Js,sendPasswordResetEmail:()=>Vs,sendSignInLinkToEmail:()=>js,setPersistence:()=>no,signInAnonymously:()=>Ns,signInWithCredential:()=>ut,signInWithCustomToken:()=>xs,signInWithEmailAndPassword:()=>$s,signInWithEmailLink:()=>qs,signInWithPhoneNumber:()=>Io,signInWithPopup:()=>wo,signInWithRedirect:()=>ko,signOut:()=>co,unlink:()=>Ms,updateCurrentUser:()=>ao,updateEmail:()=>Zs,updatePassword:()=>Qs,updatePhoneNumber:()=>Eo,updateProfile:()=>Xs,useDeviceLanguage:()=>oo,validatePassword:()=>io,verifyBeforeUpdateEmail:()=>Ys,verifyPasswordResetCode:()=>Bs});var ln=F(()=>{Uo()});var ku={apiKey:"AIzaSyAC5ROxI3bnIO1DyNflMhFRrtnR-45p4RE",authDomain:"myapp-259bf.firebaseapp.com",projectId:"myapp-259bf"},Wr=null,un=null;async function Ee(){return typeof window>"u"?null:(Wr||(Wr=(async()=>{let{initializeApp:t,getApps:e}=await Promise.resolve().then(()=>(Ui(),Mi)),{getAuth:n,signInAnonymously:r,onAuthStateChanged:i}=await Promise.resolve().then(()=>(ln(),cn)),s=e().length?e()[0]:t(ku);if(un=n(s),!await new Promise(c=>{let l=i(un,o=>{l(),c(o)})}))try{await r(un)}catch(c){console.warn("[oZ Auth] Anonymous session created in offline mode or delayed:",c.message)}return un})()),Wr)}async function Fo(){try{let t=await Ee();return!t||!t.currentUser?null:await t.currentUser.getIdToken()}catch(t){return console.error("[oZ Auth Debug]",t),null}}async function dn(t){let e=await Ee(),{signInWithCustomToken:n}=await Promise.resolve().then(()=>(ln(),cn)),r=await n(e,t);return{uid:r.user.uid,email:r.user.email,isAnonymous:r.user.isAnonymous}}async function xo(){let t=await Ee(),{signOut:e,signInAnonymously:n}=await Promise.resolve().then(()=>(ln(),cn));return await e(t),await n(t),!0}async function Vo(){let t=await Ee();return!t||!t.currentUser?null:{uid:t.currentUser.uid,email:t.currentUser.email,isAnonymous:t.currentUser.isAnonymous}}async function Ho(t=!1){try{let e=await Ee();return!e||!e.currentUser?!1:(await e.currentUser.getIdTokenResult(t)).claims.elog===!0}catch(e){return console.error("[oZ Auth Debug]",e),!1}}var Pu="oz_proto",Br="proto_user",fn=new Map,Wo=(t,e)=>`${Pu}:${t||"app"}:${e}`,D=t=>t===void 0?t:JSON.parse(JSON.stringify(t)),Bo=()=>`proto_${typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`}`,jr=t=>{let e=t?._id??t?.id??t?.documentId;return e==null?null:String(e)},zr=new Set;function ne(t,e){let n=Wo(t,e);if(zr.has(n))return D(fn.get(n));try{if(typeof localStorage<"u"){let r=localStorage.getItem(n);if(r!==null){let i=JSON.parse(r);if(Array.isArray(i))return i}}}catch{}return fn.has(n)?D(fn.get(n)):null}function dt(t,e,n){let r=Wo(t,e);fn.set(r,D(n));try{if(typeof localStorage<"u"){localStorage.setItem(r,JSON.stringify(n)),zr.delete(r);return}}catch{}zr.add(r)}var $r=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch{return{}}return t&&typeof t=="object"?t:{}};function Ru(t,e,n){let r=String(e).split("."),i=t;r.forEach((s,a)=>{a===r.length-1?i[s]=n:((typeof i[s]!="object"||i[s]===null)&&(i[s]={}),i=i[s])})}function Cu(t){let e={...D($r(t))};return e._id=jr(e)||Bo(),e}var hn=(t,e)=>t.findIndex(n=>jr(n)===String(e));function zo(t,e,n){let r=ne(t,e);if(r!==null)return{success:!0,seeded:!1,isPrototype:!0,count:r.length};let i=(Array.isArray(n)?n:[]).map(Cu);return dt(t,e,i),{success:!0,seeded:!0,isPrototype:!0,count:i.length}}function $o(t,e,n){let r=e||{},i=r.fleetboTable;switch(t){case"getdocsg":case"getdocsu":return{success:!0,data:D(ne(n,i)||[])};case"getdoc":{let s=ne(n,i)||[],a=s[hn(s,r.id)];return a?{success:!0,data:D(a)}:{success:!1,notFound:!0,message:"Document not found."}}case"add":case"addwithmedia":{let s=ne(n,i)||[],a=$r(r.jsonData),c={...D(a),_id:jr(a)||Bo(),userId:Br,createdAt:new Date().toISOString()};if(t==="addwithmedia"){let l=typeof r.fileBase64=="string"&&r.fileBase64||a.mediaUrl||a.image||"";c.mediaUrl=c.image=c.imageUrl=c.coverImage=l}return s.push(c),dt(n,i,s),t==="addwithmedia"?{success:!0,id:c._id,mediaUrl:c.mediaUrl,isPrototype:!0}:{success:!0,documentId:c._id,isPrototype:!0}}case"addwithuserid":case"addwithid":{let s=ne(n,i)||[],a=t==="addwithuserid"?Br:String(r.id),c=D($r(r.jsonData)),l=hn(s,a),o={...l>=0?s[l]:{createdAt:new Date().toISOString()},...c,_id:a,userId:Br,updatedAt:new Date().toISOString()};return l>=0?s[l]=o:s.push(o),dt(n,i,s),t==="addwithuserid"?{success:!0,documentId:a,isPrototype:!0}:{success:!0,id:a,isPrototype:!0}}case"update":{let s=ne(n,i)||[],a=hn(s,r.id);if(a<0)return{success:!1,documentId:r.id,error:"Document not found."};let{fleetboTable:c,id:l,...o}=r,d=D(s[a]);for(let[f,h]of Object.entries(o))Ru(d,f,D(h));return d.updatedAt=new Date().toISOString(),s[a]=d,dt(n,i,s),{success:!0,documentId:String(r.id),isPrototype:!0}}case"delete":{let s=ne(n,i)||[],a=hn(s,r.id);return a>=0&&(s.splice(a,1),dt(n,i,s)),{success:!0,documentId:String(r.id),isPrototype:!0}}case"join":{let s=r.joinOptions?.innerJoin;if(!s||!s.collection||!Array.isArray(s.on)||s.on.length!==3)return{success:!1,error:"La clause 'on' doit contenir 3 \xE9l\xE9ments."};let[a,,c]=s.on,l=s.as||"joinedData",o=ne(n,s.collection)||[],d=h=>{if(!Array.isArray(s.select)||s.select.length===0)return D(h);let I={_id:h._id};return s.select.forEach(b=>{b in h&&(I[b]=D(h[b]))}),I};return{success:!0,data:(ne(n,i)||[]).map(h=>{let I=h[a],b=o.filter(C=>{if(I==null)return!1;let H=c==="id"?C._id??C.id:C[c];return String(H)===String(I)});return{...D(h),[l]:b.map(d)}})}}default:return null}}var M={},Ou="https://fleetbo-gatekeeper.fleetbo.workers.dev/",ht=()=>typeof globalThis<"u"&&globalThis.OZ_CONFIG?globalThis.OZ_CONFIG:typeof window<"u"&&window.OZ_CONFIG?window.OZ_CONFIG:{},Gr=()=>!!(typeof M<"u"&&M.env&&M.env.OZ_PROTOTYPE==="true"||typeof process<"u"&&process.env&&process.env.OZ_PROTOTYPE==="true"||ht().prototype===!0||ht().prototype==="true"),qr=()=>(typeof M<"u"&&M.env?M.env.OZ_DB_KEY:typeof process<"u"?process.env.OZ_DB_KEY:void 0)||ht().dbKey||"",Nu=()=>(typeof M<"u"&&M.env?M.env.OZ_ENTERPRISE_ID:typeof process<"u"?process.env.OZ_ENTERPRISE_ID:void 0)||ht().enterpriseId||"",Du=()=>!!(typeof M<"u"&&M.env&&M.env.OZ_DEBUG==="true"||typeof process<"u"&&process.env&&process.env.OZ_DEBUG==="true"||ht().debug===!0),ft=async(t,e=null)=>{try{let n=qr(),r=Nu(),i=Gr(),s=String(t).replace("https://","").split("-")[0]||"add",a=e?.operation||s,c=s==="crud"?"crud":a;if(i){let ue=$o(a.toLowerCase(),e,n);if(ue!=null)return ue}let l={"Content-Type":"application/json"};i&&(l["x-fleetbo-prototype"]="true",l["x-oz-prototype"]="true");let o=Du()?Date.now():0,d=await Fo(),f=o?Date.now():0;d&&(l.Authorization=`Bearer ${d}`);let h=null;if(e?.jsonData!==void 0)h=e.jsonData;else if(a==="update"){let{fleetboTable:ue,id:xu,operation:Vu,...Yo}=e||{};h=Yo}let I={targetFunction:c,operation:a,enterpriseID:r,fleetboDB:n,fleetboTable:e?.fleetboTable||null,jsonData:h,_prototype:i,data:{fleetboDB:n,enterpriseID:r,operation:a,...e}},b=await fetch(Ou,{method:"POST",headers:l,body:JSON.stringify(I)}),C=await b.json(),H=C.result||C;if(o){let ue=Date.now();console.debug(`[ozmoZ] ${c}(${e?.fleetboTable||""}) ${ue-o} ms : auth ${f-o} ms, cloud ${ue-f} ms, HTTP ${b.status}`)}let P=H?.error||(b.ok?null:H?.message||`HTTP ${b.status}`),O=P&&typeof P=="object"?P.message||JSON.stringify(P):P?String(P):void 0;return{success:!!(b.ok&&!O),...H||{},error:O}}catch(n){return{success:!1,error:n?.message||String(n)}}},jo=ft,Go=ft,qo=ft;var We={},T=ft||jo||Go||qo,Jo=Gr||(()=>!1),Mu=qr||(()=>"");if(typeof window<"u"&&typeof customElements<"u"){class t extends HTMLElement{static get observedAttributes(){return["value","fallback"]}get value(){return this.getAttribute("value")}set value(o){o==null?this.removeAttribute("value"):this.setAttribute("value",String(o))}get fallback(){return this.getAttribute("fallback")}set fallback(o){o==null?this.removeAttribute("fallback"):this.setAttribute("fallback",String(o))}attributeChangedCallback(){this.render()}connectedCallback(){this.render()}render(){let o=this.getAttribute("value"),d=this.getAttribute("fallback")||"\u2014",f=o!=null&&o.trim()!==""&&o!=="null"&&o!=="undefined";this.textContent=f?o:d}}class e extends HTMLElement{static get observedAttributes(){return["value","invalid-fallback","currency"]}get value(){return this.getAttribute("value")}set value(o){o==null||o===""?this.removeAttribute("value"):this.setAttribute("value",String(o))}get currency(){return this.getAttribute("currency")}set currency(o){o==null?this.removeAttribute("currency"):this.setAttribute("currency",String(o))}get invalidFallback(){return this.getAttribute("invalid-fallback")}set invalidFallback(o){o==null?this.removeAttribute("invalid-fallback"):this.setAttribute("invalid-fallback",String(o))}get"invalid-fallback"(){return this.invalidFallback}set"invalid-fallback"(o){this.invalidFallback=o}attributeChangedCallback(){this.render()}connectedCallback(){this.render()}render(){let o=this.getAttribute("value"),d=this.getAttribute("invalid-fallback")||"0";if(o==null||o===""||o==="null"||o==="undefined"){this.textContent=d;return}let f=Number(o);if(Number.isNaN(f)){this.textContent=d;return}let h=this.getAttribute("currency");if(h)try{this.textContent=new Intl.NumberFormat("en-US",{style:"currency",currency:h}).format(f)}catch{this.textContent=`${f} ${h}`}else this.textContent=String(f)}}class n extends HTMLElement{static get observedAttributes(){return["value","label-true","label-false","invalid-fallback"]}get value(){return this.getAttribute("value")}set value(o){o==null?this.removeAttribute("value"):this.setAttribute("value",String(o))}get labelTrue(){return this.getAttribute("label-true")}set labelTrue(o){o==null?this.removeAttribute("label-true"):this.setAttribute("label-true",String(o))}get"label-true"(){return this.labelTrue}set"label-true"(o){this.labelTrue=o}get labelFalse(){return this.getAttribute("label-false")}set labelFalse(o){o==null?this.removeAttribute("label-false"):this.setAttribute("label-false",String(o))}get"label-false"(){return this.labelFalse}set"label-false"(o){this.labelFalse=o}get invalidFallback(){return this.getAttribute("invalid-fallback")}set invalidFallback(o){o==null?this.removeAttribute("invalid-fallback"):this.setAttribute("invalid-fallback",String(o))}get"invalid-fallback"(){return this.invalidFallback}set"invalid-fallback"(o){this.invalidFallback=o}attributeChangedCallback(){this.render()}connectedCallback(){this.render()}render(){let o=this.getAttribute("value"),d=this.getAttribute("label-true")||"Yes",f=this.getAttribute("label-false")||"No",h=this.getAttribute("invalid-fallback")||"Unknown";o==="true"||o==="1"?this.textContent=d:o==="false"||o==="0"?this.textContent=f:this.textContent=h}}class r extends HTMLElement{static get observedAttributes(){return["value","locale","invalid-fallback"]}get value(){return this.getAttribute("value")}set value(o){o==null||o===""?this.removeAttribute("value"):o&&typeof o=="object"&&typeof o.toISOString=="function"?this.setAttribute("value",o.toISOString()):this.setAttribute("value",String(o))}get locale(){return this.getAttribute("locale")}set locale(o){o==null?this.removeAttribute("locale"):this.setAttribute("locale",String(o))}get invalidFallback(){return this.getAttribute("invalid-fallback")}set invalidFallback(o){o==null?this.removeAttribute("invalid-fallback"):this.setAttribute("invalid-fallback",String(o))}get"invalid-fallback"(){return this.invalidFallback}set"invalid-fallback"(o){this.invalidFallback=o}attributeChangedCallback(){this.render()}connectedCallback(){this.render()}render(){let o=this.getAttribute("value"),d=this.getAttribute("invalid-fallback")||"Invalid date",f=this.getAttribute("locale")||"en-US";if(!o||o==="null"||o==="undefined"||o===""){this.textContent=d;return}let h=new Date(o);if(Number.isNaN(h.getTime())){this.textContent=d;return}try{this.textContent=h.toLocaleDateString(f)}catch{this.textContent=h.toLocaleDateString("en-US")}}}class i extends HTMLElement{static get observedAttributes(){return["value","allowed","invalid-fallback"]}get value(){return this.getAttribute("value")}set value(o){o==null?this.removeAttribute("value"):this.setAttribute("value",String(o))}get allowed(){return this.getAttribute("allowed")}set allowed(o){o==null?this.removeAttribute("allowed"):Array.isArray(o)?this.setAttribute("allowed",o.join(",")):this.setAttribute("allowed",String(o))}get invalidFallback(){return this.getAttribute("invalid-fallback")}set invalidFallback(o){o==null?this.removeAttribute("invalid-fallback"):this.setAttribute("invalid-fallback",String(o))}get"invalid-fallback"(){return this.invalidFallback}set"invalid-fallback"(o){this.invalidFallback=o}attributeChangedCallback(){this.render()}connectedCallback(){this.render()}render(){let o=this.getAttribute("value"),d=(this.getAttribute("allowed")||"").split(",").map(h=>h.trim()).filter(Boolean),f=this.getAttribute("invalid-fallback")||"Not allowed";if(!o||o==="null"||o==="undefined"||!d.includes(o)){this.textContent=f;return}this.textContent=String(o)}}class s extends HTMLElement{static get observedAttributes(){return["value","alt","fallback"]}get value(){return this.getAttribute("value")}set value(o){o==null?this.removeAttribute("value"):this.setAttribute("value",String(o))}get alt(){return this.getAttribute("alt")}set alt(o){o==null?this.removeAttribute("alt"):this.setAttribute("alt",String(o))}get fallback(){return this.getAttribute("fallback")}set fallback(o){o==null?this.removeAttribute("fallback"):this.setAttribute("fallback",String(o))}attributeChangedCallback(){this.render()}connectedCallback(){this.render()}render(){let o=this.getAttribute("value"),d=this.getAttribute("fallback")||"",f=this.getAttribute("alt")||"Media";this.innerHTML="";let h=document.createElement("img"),I=o&&o!=="null"&&o!=="undefined"&&o.trim()!=="";h.src=I?o:d,h.alt=f,this.appendChild(h)}}class a extends HTMLElement{static get observedAttributes(){return["table","id","field","orphan-fallback","loading-fallback","malformed-fallback"]}get table(){return this.getAttribute("table")}set table(o){o==null?this.removeAttribute("table"):this.setAttribute("table",String(o))}get id(){return this.getAttribute("id")}set id(o){o==null?this.removeAttribute("id"):this.setAttribute("id",String(o))}get field(){return this.getAttribute("field")}set field(o){o==null?this.removeAttribute("field"):this.setAttribute("field",String(o))}get orphanFallback(){return this.getAttribute("orphan-fallback")}set orphanFallback(o){o==null?this.removeAttribute("orphan-fallback"):this.setAttribute("orphan-fallback",String(o))}get"orphan-fallback"(){return this.orphanFallback}set"orphan-fallback"(o){this.orphanFallback=o}get loadingFallback(){return this.getAttribute("loading-fallback")}set loadingFallback(o){o==null?this.removeAttribute("loading-fallback"):this.setAttribute("loading-fallback",String(o))}get"loading-fallback"(){return this.loadingFallback}set"loading-fallback"(o){this.loadingFallback=o}get malformedFallback(){return this.getAttribute("malformed-fallback")}set malformedFallback(o){o==null?this.removeAttribute("malformed-fallback"):this.setAttribute("malformed-fallback",String(o))}get"malformed-fallback"(){return this.malformedFallback}set"malformed-fallback"(o){this.malformedFallback=o}attributeChangedCallback(){this.fetchAndRender()}connectedCallback(){this.fetchAndRender()}async fetchAndRender(){let o=this.getAttribute("table"),d=this.getAttribute("id"),f=this.getAttribute("field")||"name",h=this.getAttribute("orphan-fallback")||"Deleted",I=this.getAttribute("loading-fallback")||"Loading...",b=this.getAttribute("malformed-fallback")||"Invalid ID";if(!d||typeof d!="string"||d.trim()===""||d==="null"||d==="undefined"){this.textContent=b;return}if(!o){this.textContent=b;return}this.textContent=I;try{let C=typeof window<"u"?window:null,H=typeof globalThis<"u"?globalThis:null,P=C&&C.oz||H&&H.oz;if(!P||typeof P.getDoc!="function"){this.textContent=h;return}let O=await P.getDoc(o,d);O&&O[f]!==void 0?this.textContent=String(O[f]):O?this.textContent=O.name||O.title||O.label||JSON.stringify(O):this.textContent=h}catch{this.textContent=h}}}let c=(l,o)=>{customElements.get(l)||customElements.define(l,o)};c("oz-text",t),c("oz-number",e),c("oz-toggle",n),c("oz-date",r),c("oz-enum",i),c("oz-media",s),c("oz-reference",a)}var Jr={Text:"oz-text",Number:"oz-number",Toggle:"oz-toggle",Date:"oz-date",Enum:"oz-enum",Media:"oz-media",Reference:"oz-reference"};function xe(t){typeof window>"u"&&typeof process<"u"&&process.env}var Uu=()=>!!(typeof We<"u"&&We.env&&We.env.DEV===!0||typeof process<"u"&&process.env&&!1),Ko=null;async function U(t){if(t&&t._schemaVersion&&t._schemaData){let e=t._schemaVersion,n=t._schemaData;typeof window<"u"?Uu()&&String(e)!==Ko&&(Ko=String(e),fetch("/__ozmoz_sync_schema",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({schema:n,version:e})}).catch(()=>{})):typeof process<"u"&&process.env}return t}var v=t=>`https://${t.toLowerCase()}-jqycakhlxa-uc.a.run.app`,pn=(t,e,n)=>{if(!n||n.success!==!1||n.notFound)return;let r=n.error,i=(r&&typeof r=="object"?r.message||r.status:r)||n.message||"unknown error";console.error(`[ozmoZ] ${t}('${e}') failed: ${i}`)};var Ve=(t,e,n)=>{if(!n||n.success!==!1)return n;let r=n.error,i=(r&&typeof r=="object"?r.message||r.status:r)||n.message||"unknown error";return console.error(`[ozmoZ] ${t}('${e}') failed: ${i}`),n},we=null;function Kr(){if(typeof window>"u")return Promise.resolve(null);let t=window;return t.FB&&t.__ozmoz_fb_ready?Promise.resolve(t.FB):we||(we=new Promise((e,n)=>{let r=setTimeout(()=>{we=null,n(new Error("The Facebook service is not responding. Check your tracker blockers."))},8e3),i=typeof We<"u"&&We.env&&We.env.OZ_FACEBOOK_APP_ID||typeof process<"u"&&process.env&&process.env.OZ_FACEBOOK_APP_ID||"1392432699758138",s=()=>{try{return t.__ozmoz_fb_ready?!0:!t.FB||typeof t.FB.init!="function"?!1:(t.FB.init({appId:String(i).trim(),cookie:!0,xfbml:!1,version:"v22.0"}),t.__ozmoz_fb_ready=!0,clearTimeout(r),e(t.FB),!0)}catch(l){return clearTimeout(r),we=null,n(l),!1}};if(t.FB&&typeof t.FB.init=="function"&&s())return;let a=t.fbAsyncInit;if(t.fbAsyncInit=function(){if(typeof a=="function")try{a()}catch{}s()},document.getElementById("facebook-jssdk"))return;let c=document.createElement("script");c.id="facebook-jssdk",c.src="https://connect.facebook.net/fr_FR/sdk.js",c.async=!0,c.defer=!0,c.crossOrigin="anonymous",c.onerror=()=>{clearTimeout(r),we=null,n(new Error("Could not load the Facebook script."))},document.head.appendChild(c)}),we)}typeof window<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{Kr()}):Kr());var Fu=()=>new Proxy({},{get(t,e){let n=String(e);return async(r={})=>{let i=await T(v("call"),{functionName:n,payload:r});return U(i)}}}),G=t=>t&&(Array.isArray(t)?t.map(e=>e&&e._id&&!e.id?{...e,id:String(e._id)}:e):typeof t=="object"&&t._id&&!t.id?{...t,id:String(t._id)}:t),He=(t,e,n)=>{(!n||typeof n!="object"||!n.desc&&!n.guard&&!n.role)&&console.warn(`[ozmoZ] ${t}('${e}') : no {desc, guard, role} metadata provided \u2014 'npx ozmoz sync' will require it.`)},Yr={...Jr,call:Fu(),getUser:Vo,add:async(t,e,n={})=>{xe(t),He("add",t,n);let r=await T(v("crud"),{operation:"add",fleetboTable:t,jsonData:e});return Ve("add",t,await U(r))},addWithId:async(t,e,n,r={})=>{xe(t),He("addWithId",t,r);let i=await T(v("crud"),{operation:"addWithId",fleetboTable:t,id:n,jsonData:e});return Ve("addWithId",t,await U(i))},addWithUserId:async(t,e,n={})=>{xe(t),He("addWithUserId",t,n);let r=await T(v("crud"),{operation:"addWithUserId",fleetboTable:t,jsonData:e});return Ve("addWithUserId",t,await U(r))},addWithMedia:async(t,e,n,r,i={})=>{xe(t),He("addWithMedia",t,i);let s=await T(v("crud"),{operation:"addWithMedia",fleetboTable:t,jsonData:e,fileBase64:n,fileName:r});return Ve("addWithMedia",t,await U(s))},update:async(t,e,n,r={})=>{He("update",t,r);let i=await T(v("crud"),{operation:"update",fleetboTable:t,id:e,...n});return Ve("update",t,await U(i))},delete:async(t,e,n={})=>{He("delete",t,n);let r=await T(v("crud"),{operation:"delete",fleetboTable:t,id:e});return Ve("delete",t,await U(r))},getDocsG:async t=>{let e=await T(v("crud"),{operation:"getDocsG",fleetboTable:t}),n=await U(e);return pn("getDocsG",t,n),Array.isArray(n)?G(n):n&&Array.isArray(n.data)?G(n.data):[]},getDocsU:async t=>{let e=await T(v("crud"),{operation:"getDocsU",fleetboTable:t}),n=await U(e);return pn("getDocsU",t,n),Array.isArray(n)?G(n):n&&Array.isArray(n.data)?G(n.data):[]},getDoc:async(t,e)=>{let n=await T(v("crud"),{operation:"getDoc",fleetboTable:t,id:e}),r=await U(n);return pn("getDoc",t,r),r?r.data!==void 0?G(r.data):r.success===!1?null:G(r):null},getAuthUser:async()=>{let t=await T(v("crud"),{operation:"getAuthUser"}),e=await U(t);return e?e.data!==void 0?G(e.data):e.success===!1?null:G(e):null},join:async(t,e)=>{xe(t),e?.innerJoin?.collection&&xe(e.innerJoin.collection);let n=await T(v("crud"),{operation:"join",fleetboTable:t,joinOptions:e}),r=await U(n);return pn("join",t,r),Array.isArray(r)?G(r):r&&Array.isArray(r.data)?G(r.data):[]},seed:async(t,e)=>Jo()?zo(Mu(),t,e):{success:!0,seeded:!1,isPrototype:!1},sendotpsvro:async t=>{let e=typeof t=="string"?{email:t}:t||{};return await T(v("sendOtpSvro"),e)},verifyotpsvro:async(t,e)=>{let n=await T(v("verifyOtpSvro"),{email:t,code:e});if(n.success&&n.customToken)try{return{success:!0,user:await dn(n.customToken)}}catch(r){return{success:!1,error:r.message}}return n},sendOtpByPhone:async t=>{let e=typeof t=="string"?{phoneNumber:t}:t||{};return await T(v("sendOtpByPhone"),e)},verifyOtpPhoneSvro:async(t,e)=>{let n=await T(v("verifyOtpPhoneSvro"),{phoneNumber:t,code:e});if(n.success&&n.customToken)try{return{success:!0,user:await dn(n.customToken)}}catch(r){return{success:!1,error:r.message}}return n},verifyFacebookAuth:(t={})=>new Promise(e=>{let n=typeof t=="string"?t:t?.accessToken,r=async c=>{try{let l=await T(v("verifyFacebookAuth"),{accessToken:c}),o=l.customToken||l.token;if(l.success&&o){let d=await dn(o);e({success:!0,user:d,profile:l.profile||null,projects:l.projects||[]})}else e(l)}catch(l){e({success:!1,error:l.message})}};if(n){r(n);return}if(typeof window>"u")return e({success:!1,error:"Not a browser environment."});let i=window;if(!i.FB||!i.__ozmoz_fb_ready||typeof i.FB.login!="function")return Kr(),e({success:!1,error:"The Meta service is starting up. Click the button again."});let s=setTimeout(()=>{e({success:!1,cancelled:!0,error:"Login timed out. The window was closed or blocked."})},12e4),a=t?.scope||"public_profile,email";try{i.FB.login(c=>{if(clearTimeout(s),!c||c.error)return e({success:!1,error:c?.error||"Window closed."});if(c.status==="unknown"||!c.authResponse?.accessToken)return e({success:!1,cancelled:!0,error:"Facebook sign-in cancelled."});r(c.authResponse.accessToken)},{scope:a,return_scopes:!0})}catch(c){clearTimeout(s),e({success:!1,error:c.message})}}),isAuthenticated:async(t=!1)=>await Ho(t),logout:async()=>{try{return await xo(),{success:!0}}catch(t){return{success:!1,error:t.message}}},acl:{grant:async(t,e,n,r="*")=>await T(v("grantAcl"),{targetUserId:t,action:e,resourceTable:n,resourceId:r}),revoke:async(t,e,n,r="*")=>await T(v("revokeAcl"),{targetUserId:t,action:e,resourceTable:n,resourceId:r}),can:async(t,e,n="*")=>{let r=await T(v("checkAcl"),{action:t,resourceTable:e,resourceId:n});return!!(r&&(r.allowed===!0||r.can===!0))}}},vd=Yr;typeof window<"u"&&(window.oz=Yr,window.OzUI=Jr);typeof globalThis<"u"&&(globalThis.oz=Yr,globalThis.OzUI=Jr);if(typeof window<"u"&&typeof document<"u"){let t=()=>setTimeout(()=>{Jo()||Ee().catch(()=>{})},400);document.readyState==="complete"?t():window.addEventListener("load",t,{once:!0})}})();
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
@firebase/util/dist/index.esm.js:
|
|
5
|
+
(**
|
|
6
|
+
* @license
|
|
7
|
+
* Copyright 2017 Google LLC
|
|
8
|
+
*
|
|
9
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
+
* you may not use this file except in compliance with the License.
|
|
11
|
+
* You may obtain a copy of the License at
|
|
12
|
+
*
|
|
13
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
*
|
|
15
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
16
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
+
* See the License for the specific language governing permissions and
|
|
19
|
+
* limitations under the License.
|
|
20
|
+
*)
|
|
21
|
+
(**
|
|
22
|
+
* @license
|
|
23
|
+
* Copyright 2022 Google LLC
|
|
24
|
+
*
|
|
25
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
26
|
+
* you may not use this file except in compliance with the License.
|
|
27
|
+
* You may obtain a copy of the License at
|
|
28
|
+
*
|
|
29
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
30
|
+
*
|
|
31
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
32
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
33
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
34
|
+
* See the License for the specific language governing permissions and
|
|
35
|
+
* limitations under the License.
|
|
36
|
+
*)
|
|
37
|
+
(**
|
|
38
|
+
* @license
|
|
39
|
+
* Copyright 2021 Google LLC
|
|
40
|
+
*
|
|
41
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
42
|
+
* you may not use this file except in compliance with the License.
|
|
43
|
+
* You may obtain a copy of the License at
|
|
44
|
+
*
|
|
45
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
46
|
+
*
|
|
47
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
48
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
49
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
50
|
+
* See the License for the specific language governing permissions and
|
|
51
|
+
* limitations under the License.
|
|
52
|
+
*)
|
|
53
|
+
(**
|
|
54
|
+
* @license
|
|
55
|
+
* Copyright 2019 Google LLC
|
|
56
|
+
*
|
|
57
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
58
|
+
* you may not use this file except in compliance with the License.
|
|
59
|
+
* You may obtain a copy of the License at
|
|
60
|
+
*
|
|
61
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
62
|
+
*
|
|
63
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
64
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
65
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
66
|
+
* See the License for the specific language governing permissions and
|
|
67
|
+
* limitations under the License.
|
|
68
|
+
*)
|
|
69
|
+
(**
|
|
70
|
+
* @license
|
|
71
|
+
* Copyright 2020 Google LLC
|
|
72
|
+
*
|
|
73
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
74
|
+
* you may not use this file except in compliance with the License.
|
|
75
|
+
* You may obtain a copy of the License at
|
|
76
|
+
*
|
|
77
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
78
|
+
*
|
|
79
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
80
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
81
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
82
|
+
* See the License for the specific language governing permissions and
|
|
83
|
+
* limitations under the License.
|
|
84
|
+
*)
|
|
85
|
+
(**
|
|
86
|
+
* @license
|
|
87
|
+
* Copyright 2025 Google LLC
|
|
88
|
+
*
|
|
89
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
90
|
+
* you may not use this file except in compliance with the License.
|
|
91
|
+
* You may obtain a copy of the License at
|
|
92
|
+
*
|
|
93
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
94
|
+
*
|
|
95
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
96
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
97
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
98
|
+
* See the License for the specific language governing permissions and
|
|
99
|
+
* limitations under the License.
|
|
100
|
+
*)
|
|
101
|
+
|
|
102
|
+
@firebase/component/dist/esm/index.esm.js:
|
|
103
|
+
(**
|
|
104
|
+
* @license
|
|
105
|
+
* Copyright 2019 Google LLC
|
|
106
|
+
*
|
|
107
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
108
|
+
* you may not use this file except in compliance with the License.
|
|
109
|
+
* You may obtain a copy of the License at
|
|
110
|
+
*
|
|
111
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
112
|
+
*
|
|
113
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
114
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
115
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
116
|
+
* See the License for the specific language governing permissions and
|
|
117
|
+
* limitations under the License.
|
|
118
|
+
*)
|
|
119
|
+
|
|
120
|
+
@firebase/logger/dist/esm/index.esm.js:
|
|
121
|
+
(**
|
|
122
|
+
* @license
|
|
123
|
+
* Copyright 2017 Google LLC
|
|
124
|
+
*
|
|
125
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
126
|
+
* you may not use this file except in compliance with the License.
|
|
127
|
+
* You may obtain a copy of the License at
|
|
128
|
+
*
|
|
129
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
130
|
+
*
|
|
131
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
132
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
133
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
134
|
+
* See the License for the specific language governing permissions and
|
|
135
|
+
* limitations under the License.
|
|
136
|
+
*)
|
|
137
|
+
|
|
138
|
+
@firebase/app/dist/esm/index.esm.js:
|
|
139
|
+
(**
|
|
140
|
+
* @license
|
|
141
|
+
* Copyright 2019 Google LLC
|
|
142
|
+
*
|
|
143
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
144
|
+
* you may not use this file except in compliance with the License.
|
|
145
|
+
* You may obtain a copy of the License at
|
|
146
|
+
*
|
|
147
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
148
|
+
*
|
|
149
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
150
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
151
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
152
|
+
* See the License for the specific language governing permissions and
|
|
153
|
+
* limitations under the License.
|
|
154
|
+
*)
|
|
155
|
+
(**
|
|
156
|
+
* @license
|
|
157
|
+
* Copyright 2023 Google LLC
|
|
158
|
+
*
|
|
159
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
160
|
+
* you may not use this file except in compliance with the License.
|
|
161
|
+
* You may obtain a copy of the License at
|
|
162
|
+
*
|
|
163
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
164
|
+
*
|
|
165
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
166
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
167
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
168
|
+
* See the License for the specific language governing permissions and
|
|
169
|
+
* limitations under the License.
|
|
170
|
+
*)
|
|
171
|
+
(**
|
|
172
|
+
* @license
|
|
173
|
+
* Copyright 2021 Google LLC
|
|
174
|
+
*
|
|
175
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
176
|
+
* you may not use this file except in compliance with the License.
|
|
177
|
+
* You may obtain a copy of the License at
|
|
178
|
+
*
|
|
179
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
180
|
+
*
|
|
181
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
182
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
183
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
184
|
+
* See the License for the specific language governing permissions and
|
|
185
|
+
* limitations under the License.
|
|
186
|
+
*)
|
|
187
|
+
|
|
188
|
+
firebase/app/dist/esm/index.esm.js:
|
|
189
|
+
(**
|
|
190
|
+
* @license
|
|
191
|
+
* Copyright 2020 Google LLC
|
|
192
|
+
*
|
|
193
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
194
|
+
* you may not use this file except in compliance with the License.
|
|
195
|
+
* You may obtain a copy of the License at
|
|
196
|
+
*
|
|
197
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
198
|
+
*
|
|
199
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
200
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
201
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
202
|
+
* See the License for the specific language governing permissions and
|
|
203
|
+
* limitations under the License.
|
|
204
|
+
*)
|
|
205
|
+
|
|
206
|
+
@firebase/auth/dist/esm/index-d90d2ee5.js:
|
|
207
|
+
(**
|
|
208
|
+
* @license
|
|
209
|
+
* Copyright 2021 Google LLC
|
|
210
|
+
*
|
|
211
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
212
|
+
* you may not use this file except in compliance with the License.
|
|
213
|
+
* You may obtain a copy of the License at
|
|
214
|
+
*
|
|
215
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
216
|
+
*
|
|
217
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
218
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
219
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
220
|
+
* See the License for the specific language governing permissions and
|
|
221
|
+
* limitations under the License.
|
|
222
|
+
*)
|
|
223
|
+
(**
|
|
224
|
+
* @license
|
|
225
|
+
* Copyright 2020 Google LLC
|
|
226
|
+
*
|
|
227
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
228
|
+
* you may not use this file except in compliance with the License.
|
|
229
|
+
* You may obtain a copy of the License at
|
|
230
|
+
*
|
|
231
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
232
|
+
*
|
|
233
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
234
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
235
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
236
|
+
* See the License for the specific language governing permissions and
|
|
237
|
+
* limitations under the License.
|
|
238
|
+
*)
|
|
239
|
+
(**
|
|
240
|
+
* @license
|
|
241
|
+
* Copyright 2019 Google LLC
|
|
242
|
+
*
|
|
243
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
244
|
+
* you may not use this file except in compliance with the License.
|
|
245
|
+
* You may obtain a copy of the License at
|
|
246
|
+
*
|
|
247
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
248
|
+
*
|
|
249
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
250
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
251
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
252
|
+
* See the License for the specific language governing permissions and
|
|
253
|
+
* limitations under the License.
|
|
254
|
+
*)
|
|
255
|
+
(**
|
|
256
|
+
* @license
|
|
257
|
+
* Copyright 2022 Google LLC
|
|
258
|
+
*
|
|
259
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
260
|
+
* you may not use this file except in compliance with the License.
|
|
261
|
+
* You may obtain a copy of the License at
|
|
262
|
+
*
|
|
263
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
264
|
+
*
|
|
265
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
266
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
267
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
268
|
+
* See the License for the specific language governing permissions and
|
|
269
|
+
* limitations under the License.
|
|
270
|
+
*)
|
|
271
|
+
(**
|
|
272
|
+
* @license
|
|
273
|
+
* Copyright 2023 Google LLC
|
|
274
|
+
*
|
|
275
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
276
|
+
* you may not use this file except in compliance with the License.
|
|
277
|
+
* You may obtain a copy of the License at
|
|
278
|
+
*
|
|
279
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
280
|
+
*
|
|
281
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
282
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
283
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
284
|
+
* See the License for the specific language governing permissions and
|
|
285
|
+
* limitations under the License.
|
|
286
|
+
*)
|
|
287
|
+
(**
|
|
288
|
+
* @license
|
|
289
|
+
* Copyright 2025 Google LLC
|
|
290
|
+
*
|
|
291
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
292
|
+
* you may not use this file except in compliance with the License.
|
|
293
|
+
* You may obtain a copy of the License at
|
|
294
|
+
*
|
|
295
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
296
|
+
*
|
|
297
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
298
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
299
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
300
|
+
* See the License for the specific language governing permissions and
|
|
301
|
+
* limitations under the License.
|
|
302
|
+
*)
|
|
303
|
+
(**
|
|
304
|
+
* @license
|
|
305
|
+
* Copyright 2020 Google LLC.
|
|
306
|
+
*
|
|
307
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
308
|
+
* you may not use this file except in compliance with the License.
|
|
309
|
+
* You may obtain a copy of the License at
|
|
310
|
+
*
|
|
311
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
312
|
+
*
|
|
313
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
314
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
315
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
316
|
+
* See the License for the specific language governing permissions and
|
|
317
|
+
* limitations under the License.
|
|
318
|
+
*)
|
|
319
|
+
*/
|