@entropic-bond/firebase 1.13.28 → 1.13.29

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.
@@ -40,5 +40,5 @@ Content-Type: `+l.contentType+`\r
40
40
  \r
41
41
  `,f=`\r
42
42
  --`+c+`--`,p=_C.getBlob(d,r,f);if(p===null)throw ES();let m={name:l.fullPath},h=KS(a,e.host,e._protocol),g=e.maxUploadRetryTime,ee=new MC(h,`POST`,PC(e,n),g);return ee.urlParams=m,ee.headers=o,ee.body=p.uploadData(),ee.errorHandler=IC(t),ee}var WC=class{constructor(e,t,n,r){this.current=e,this.total=t,this.finalized=!!n,this.metadata=r||null}};function GC(e,t){let n=null;try{n=e.getResponseHeader(`X-Goog-Upload-Status`)}catch{NC(!1)}return NC(!!n&&(t||[`active`]).indexOf(n)!==-1),n}function KC(e,t,n,r,i){let a=t.bucketOnlyServerUrl(),o=HC(t,r,i),s={name:o.fullPath},c=KS(a,e.host,e._protocol),l={"X-Goog-Upload-Protocol":`resumable`,"X-Goog-Upload-Command":`start`,"X-Goog-Upload-Header-Content-Length":`${r.size()}`,"X-Goog-Upload-Header-Content-Type":o.contentType,"Content-Type":`application/json; charset=utf-8`},u=jC(o,n),d=e.maxUploadRetryTime;function f(e){GC(e);let t;try{t=e.getResponseHeader(`X-Goog-Upload-URL`)}catch{NC(!1)}return NC(HS(t)),t}let p=new MC(c,`POST`,f,d);return p.urlParams=s,p.headers=l,p.body=u,p.errorHandler=IC(t),p}function qC(e,t,n,r){let i={"X-Goog-Upload-Command":`query`};function a(e){let t=GC(e,[`active`,`final`]),n=null;try{n=e.getResponseHeader(`X-Goog-Upload-Size-Received`)}catch{NC(!1)}n||NC(!1);let i=Number(n);return NC(!isNaN(i)),new WC(i,r.size(),t===`final`)}let o=e.maxUploadRetryTime,s=new MC(n,`POST`,a,o);return s.headers=i,s.errorHandler=IC(t),s}var JC=256*1024;function YC(e,t,n,r,i,a,o,s){let c=new WC(0,0);if(o?(c.current=o.current,c.total=o.total):(c.current=0,c.total=r.size()),r.size()!==c.total)throw DS();let l=c.total-c.current,u=l;i>0&&(u=Math.min(u,i));let d=c.current,f=d+u,p=``;p=u===0?`finalize`:l===u?`upload, finalize`:`upload`;let m={"X-Goog-Upload-Command":p,"X-Goog-Upload-Offset":`${c.current}`},h=r.slice(d,f);if(h===null)throw ES();function g(e,n){let i=GC(e,[`active`,`final`]),o=c.current+u,s=r.size(),l;return l=i===`final`?PC(t,a)(e,n):null,new WC(o,s,i===`final`,l)}let ee=t.maxUploadRetryTime,te=new MC(n,`POST`,g,ee);return te.headers=m,te.body=h.uploadData(),te.progressCallback=s||null,te.errorHandler=IC(e),te}var XC={RUNNING:`running`,PAUSED:`paused`,SUCCESS:`success`,CANCELED:`canceled`,ERROR:`error`};function ZC(e){switch(e){case`running`:case`pausing`:case`canceling`:return XC.RUNNING;case`paused`:return XC.PAUSED;case`success`:return XC.SUCCESS;case`canceled`:return XC.CANCELED;case`error`:return XC.ERROR;default:return XC.ERROR}}var QC=class{constructor(e,t,n){if(BS(e)||t!=null||n!=null)this.next=e,this.error=t??void 0,this.complete=n??void 0;else{let t=e;this.next=t.next,this.error=t.error,this.complete=t.complete}}};function $C(e){return(...t)=>{Promise.resolve().then(()=>e(...t))}}var ew=class{constructor(){this.sent_=!1,this.xhr_=new XMLHttpRequest,this.initXhr(),this.errorCode_=JS.NO_ERROR,this.sendPromise_=new Promise(e=>{this.xhr_.addEventListener(`abort`,()=>{this.errorCode_=JS.ABORT,e()}),this.xhr_.addEventListener(`error`,()=>{this.errorCode_=JS.NETWORK_ERROR,e()}),this.xhr_.addEventListener(`load`,()=>{e()})})}send(e,t,n,r,i){if(this.sent_)throw PS(`cannot .send() more than once`);if(Oe(e)&&n&&(this.xhr_.withCredentials=!0),this.sent_=!0,this.xhr_.open(t,e,!0),i!==void 0)for(let e in i)i.hasOwnProperty(e)&&this.xhr_.setRequestHeader(e,i[e].toString());return r===void 0?this.xhr_.send():this.xhr_.send(r),this.sendPromise_}getErrorCode(){if(!this.sent_)throw PS(`cannot .getErrorCode() before sending`);return this.errorCode_}getStatus(){if(!this.sent_)throw PS(`cannot .getStatus() before sending`);try{return this.xhr_.status}catch{return-1}}getResponse(){if(!this.sent_)throw PS(`cannot .getResponse() before sending`);return this.xhr_.response}getErrorText(){if(!this.sent_)throw PS(`cannot .getErrorText() before sending`);return this.xhr_.statusText}abort(){this.xhr_.abort()}getResponseHeader(e){return this.xhr_.getResponseHeader(e)}addUploadProgressListener(e){this.xhr_.upload!=null&&this.xhr_.upload.addEventListener(`progress`,e)}removeUploadProgressListener(e){this.xhr_.upload!=null&&this.xhr_.upload.removeEventListener(`progress`,e)}},tw=class extends ew{initXhr(){this.xhr_.responseType=`text`}};function nw(){return new tw}var rw=class{isExponentialBackoffExpired(){return this.sleepTime>this.maxSleepTime}constructor(e,t,n=null){this._transferred=0,this._needToFetchStatus=!1,this._needToFetchMetadata=!1,this._observers=[],this._error=void 0,this._uploadUrl=void 0,this._request=void 0,this._chunkMultiplier=1,this._resolve=void 0,this._reject=void 0,this._ref=e,this._blob=t,this._metadata=n,this._mappings=EC(),this._resumable=this._shouldDoResumable(this._blob),this._state=`running`,this._errorHandler=e=>{if(this._request=void 0,this._chunkMultiplier=1,e._codeEquals(Q.CANCELED))this._needToFetchStatus=!0,this.completeTransitions_();else{let t=this.isExponentialBackoffExpired();if(YS(e.status,[]))if(t)e=xS();else{this.sleepTime=Math.max(this.sleepTime*2,pS),this._needToFetchStatus=!0,this.completeTransitions_();return}this._error=e,this._transition(`error`)}},this._metadataErrorHandler=e=>{this._request=void 0,e._codeEquals(Q.CANCELED)?this.completeTransitions_():(this._error=e,this._transition(`error`))},this.sleepTime=0,this.maxSleepTime=this._ref.storage.maxUploadRetryTime,this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t,this._start()}),this._promise.then(null,()=>{})}_makeProgressCallback(){let e=this._transferred;return t=>this._updateProgress(e+t)}_shouldDoResumable(e){return e.size()>256*1024}_start(){this._state===`running`&&this._request===void 0&&(this._resumable?this._uploadUrl===void 0?this._createResumable():this._needToFetchStatus?this._fetchStatus():this._needToFetchMetadata?this._fetchMetadata():this.pendingTimeout=setTimeout(()=>{this.pendingTimeout=void 0,this._continueUpload()},this.sleepTime):this._oneShotUpload())}_resolveToken(e){Promise.all([this._ref.storage._getAuthToken(),this._ref.storage._getAppCheckToken()]).then(([t,n])=>{switch(this._state){case`running`:e(t,n);break;case`canceling`:this._transition(`canceled`);break;case`pausing`:this._transition(`paused`);break}})}_createResumable(){this._resolveToken((e,t)=>{let n=KC(this._ref.storage,this._ref._location,this._mappings,this._blob,this._metadata),r=this._ref.storage._makeRequest(n,nw,e,t);this._request=r,r.getPromise().then(e=>{this._request=void 0,this._uploadUrl=e,this._needToFetchStatus=!1,this.completeTransitions_()},this._errorHandler)})}_fetchStatus(){let e=this._uploadUrl;this._resolveToken((t,n)=>{let r=qC(this._ref.storage,this._ref._location,e,this._blob),i=this._ref.storage._makeRequest(r,nw,t,n);this._request=i,i.getPromise().then(e=>{e=e,this._request=void 0,this._updateProgress(e.current),this._needToFetchStatus=!1,e.finalized&&(this._needToFetchMetadata=!0),this.completeTransitions_()},this._errorHandler)})}_continueUpload(){let e=JC*this._chunkMultiplier,t=new WC(this._transferred,this._blob.size()),n=this._uploadUrl;this._resolveToken((r,i)=>{let a;try{a=YC(this._ref._location,this._ref.storage,n,this._blob,e,this._mappings,t,this._makeProgressCallback())}catch(e){this._error=e,this._transition(`error`);return}let o=this._ref.storage._makeRequest(a,nw,r,i,!1);this._request=o,o.getPromise().then(e=>{this._increaseMultiplier(),this._request=void 0,this._updateProgress(e.current),e.finalized?(this._metadata=e.metadata,this._transition(`success`)):this.completeTransitions_()},this._errorHandler)})}_increaseMultiplier(){JC*this._chunkMultiplier*2<32*1024*1024&&(this._chunkMultiplier*=2)}_fetchMetadata(){this._resolveToken((e,t)=>{let n=RC(this._ref.storage,this._ref._location,this._mappings),r=this._ref.storage._makeRequest(n,nw,e,t);this._request=r,r.getPromise().then(e=>{this._request=void 0,this._metadata=e,this._transition(`success`)},this._metadataErrorHandler)})}_oneShotUpload(){this._resolveToken((e,t)=>{let n=UC(this._ref.storage,this._ref._location,this._mappings,this._blob,this._metadata),r=this._ref.storage._makeRequest(n,nw,e,t);this._request=r,r.getPromise().then(e=>{this._request=void 0,this._metadata=e,this._updateProgress(this._blob.size()),this._transition(`success`)},this._errorHandler)})}_updateProgress(e){let t=this._transferred;this._transferred=e,this._transferred!==t&&this._notifyObservers()}_transition(e){if(this._state!==e)switch(e){case`canceling`:case`pausing`:this._state=e,this._request===void 0?this.pendingTimeout&&(clearTimeout(this.pendingTimeout),this.pendingTimeout=void 0,this.completeTransitions_()):this._request.cancel();break;case`running`:let t=this._state===`paused`;this._state=e,t&&(this._notifyObservers(),this._start());break;case`paused`:this._state=e,this._notifyObservers();break;case`canceled`:this._error=SS(),this._state=e,this._notifyObservers();break;case`error`:this._state=e,this._notifyObservers();break;case`success`:this._state=e,this._notifyObservers();break}}completeTransitions_(){switch(this._state){case`pausing`:this._transition(`paused`);break;case`canceling`:this._transition(`canceled`);break;case`running`:this._start();break}}get snapshot(){let e=ZC(this._state);return{bytesTransferred:this._transferred,totalBytes:this._blob.size(),state:e,metadata:this._metadata,task:this,ref:this._ref}}on(e,t,n,r){let i=new QC(t||void 0,n||void 0,r||void 0);return this._addObserver(i),()=>{this._removeObserver(i)}}then(e,t){return this._promise.then(e,t)}catch(e){return this.then(null,e)}_addObserver(e){this._observers.push(e),this._notifyObserver(e)}_removeObserver(e){let t=this._observers.indexOf(e);t!==-1&&this._observers.splice(t,1)}_notifyObservers(){this._finishPromise(),this._observers.slice().forEach(e=>{this._notifyObserver(e)})}_finishPromise(){if(this._resolve!==void 0){let e=!0;switch(ZC(this._state)){case XC.SUCCESS:$C(this._resolve.bind(null,this.snapshot))();break;case XC.CANCELED:case XC.ERROR:let t=this._reject;$C(t.bind(null,this._error))();break;default:e=!1;break}e&&(this._resolve=void 0,this._reject=void 0)}}_notifyObserver(e){switch(ZC(this._state)){case XC.RUNNING:case XC.PAUSED:e.next&&$C(e.next.bind(e,this.snapshot))();break;case XC.SUCCESS:e.complete&&$C(e.complete.bind(e))();break;case XC.CANCELED:case XC.ERROR:e.error&&$C(e.error.bind(e,this._error))();break;default:e.error&&$C(e.error.bind(e,this._error))()}}resume(){let e=this._state===`paused`||this._state===`pausing`;return e&&this._transition(`running`),e}pause(){let e=this._state===`running`;return e&&this._transition(`pausing`),e}cancel(){let e=this._state===`running`||this._state===`pausing`;return e&&this._transition(`canceling`),e}},iw=class e{constructor(e,t){this._service=e,t instanceof FS?this._location=t:this._location=FS.makeFromUrl(t,e.host)}toString(){return`gs://`+this._location.bucket+`/`+this._location.path}_newRef(t,n){return new e(t,n)}get root(){let e=new FS(this._location.bucket,``);return this._newRef(this._service,e)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return xC(this._location.path)}get storage(){return this._service}get parent(){let t=yC(this._location.path);if(t===null)return null;let n=new FS(this._location.bucket,t);return new e(this._service,n)}_throwIfRoot(e){if(this._location.path===``)throw MS(e)}};function aw(e,t,n){return e._throwIfRoot(`uploadBytesResumable`),new rw(e,new _C(t),n)}function ow(e){e._throwIfRoot(`getDownloadURL`);let t=zC(e.storage,e._location,EC());return e.storage.makeRequestWithTokens(t,nw).then(e=>{if(e===null)throw OS();return e})}function sw(e){e._throwIfRoot(`deleteObject`);let t=BC(e.storage,e._location);return e.storage.makeRequestWithTokens(t,nw)}function cw(e,t){let n=bC(e._location.path,t),r=new FS(e._location.bucket,n);return new iw(e.storage,r)}function lw(e){return/^[A-Za-z]+:\/\//.test(e)}function uw(e,t){return new iw(e,t)}function dw(e,t){if(e instanceof hw){let n=e;if(n._bucket==null)throw TS();let r=new iw(n,n._bucket);return t==null?r:dw(r,t)}else if(t!==void 0)return cw(e,t);else return e}function fw(e,t){if(t&&lw(t)){if(e instanceof hw)return uw(e,t);throw AS(`To use ref(service, url), the first argument must be a Storage instance.`)}else return dw(e,t)}function pw(e,t){let n=t?.[uS];return n==null?null:FS.makeFromBucketSpec(n,e)}function mw(e,t,n,r={}){e.host=`${t}:${n}`;let i=Oe(t);i&&ke(`https://${e.host}/b`),e._isUsingEmulator=!0,e._protocol=i?`https`:`http`;let{mockUserToken:a}=r;a&&(e._overrideAuthToken=typeof a==`string`?a:ne(a,e.app.options.projectId))}var hw=class{constructor(e,t,n,r,i,a=!1){this.app=e,this._authProvider=t,this._appCheckProvider=n,this._url=r,this._firebaseVersion=i,this._isUsingEmulator=a,this._bucket=null,this._host=lS,this._protocol=`https`,this._appId=null,this._deleted=!1,this._maxOperationRetryTime=dS,this._maxUploadRetryTime=fS,this._requests=new Set,r==null?this._bucket=pw(this._host,this.app.options):this._bucket=FS.makeFromBucketSpec(r,this._host)}get host(){return this._host}set host(e){this._host=e,this._url==null?this._bucket=pw(e,this.app.options):this._bucket=FS.makeFromBucketSpec(this._url,e)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){GS(`time`,0,1/0,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){GS(`time`,0,1/0,e),this._maxOperationRetryTime=e}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;let e=this._authProvider.getImmediate({optional:!0});if(e){let t=await e.getToken();if(t!==null)return t.accessToken}return null}async _getAppCheckToken(){if(y(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;let e=this._appCheckProvider.getImmediate({optional:!0});return e?(await e.getToken()).token:null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(e=>e.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(e){return new iw(this,e)}_makeRequest(e,t,n,r,i=!0){if(this._deleted)return new IS(jS());{let a=nC(e,this._appId,n,r,t,this._firebaseVersion,i,this._isUsingEmulator);return this._requests.add(a),a.getPromise().then(()=>this._requests.delete(a),()=>this._requests.delete(a)),a}}async makeRequestWithTokens(e,t){let[n,r]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(e,t,n,r).getPromise()}},gw=`@firebase/storage`,_w=`0.14.3`,vw=`storage`;function yw(e,t,n){return e=_(e),aw(e,t,n)}function bw(e){return e=_(e),ow(e)}function xw(e){return e=_(e),sw(e)}function Sw(e,t){return e=_(e),fw(e,t)}function Cw(e=tn(),t){e=_(e);let n=Xt(e,vw).getImmediate({identifier:t}),r=h(`storage`);return r&&ww(n,...r),n}function ww(e,t,n,r={}){mw(e,t,n,r)}function Tw(e,{instanceIdentifier:t}){return new hw(e.getProvider(`app`).getImmediate(),e.getProvider(`auth-internal`),e.getProvider(`app-check-internal`),t,$t)}function Ew(){Yt(new Ae(vw,Tw,`PUBLIC`).setMultipleInstances(!0)),nn(gw,_w,``),nn(gw,_w,`esm2020`)}Ew();var Dw=`type.googleapis.com/google.protobuf.Int64Value`,Ow=`type.googleapis.com/google.protobuf.UInt64Value`;function kw(e,t){let n={};for(let r in e)e.hasOwnProperty(r)&&(n[r]=t(e[r]));return n}function Aw(e){if(e==null)return null;if(e instanceof Number&&(e=e.valueOf()),typeof e==`number`&&isFinite(e)||e===!0||e===!1||Object.prototype.toString.call(e)===`[object String]`)return e;if(e instanceof Date)return e.toISOString();if(Array.isArray(e))return e.map(e=>Aw(e));if(typeof e==`function`||typeof e==`object`)return kw(e,e=>Aw(e));throw Error(`Data cannot be encoded in JSON: `+e)}function jw(e){if(e==null)return e;if(e[`@type`])switch(e[`@type`]){case Dw:case Ow:{let t=Number(e.value);if(isNaN(t))throw Error(`Data cannot be decoded from JSON: `+e);return t}default:throw Error(`Data cannot be decoded from JSON: `+e)}return Array.isArray(e)?e.map(e=>jw(e)):typeof e==`function`||typeof e==`object`?kw(e,e=>jw(e)):e}var Mw=`functions`,Nw={OK:`ok`,CANCELLED:`cancelled`,UNKNOWN:`unknown`,INVALID_ARGUMENT:`invalid-argument`,DEADLINE_EXCEEDED:`deadline-exceeded`,NOT_FOUND:`not-found`,ALREADY_EXISTS:`already-exists`,PERMISSION_DENIED:`permission-denied`,UNAUTHENTICATED:`unauthenticated`,RESOURCE_EXHAUSTED:`resource-exhausted`,FAILED_PRECONDITION:`failed-precondition`,ABORTED:`aborted`,OUT_OF_RANGE:`out-of-range`,UNIMPLEMENTED:`unimplemented`,INTERNAL:`internal`,UNAVAILABLE:`unavailable`,DATA_LOSS:`data-loss`},Pw=class e extends me{constructor(t,n,r){super(`${Mw}/${t}`,n||``),this.details=r,Object.setPrototypeOf(this,e.prototype)}};function Fw(e){if(e>=200&&e<300)return`ok`;switch(e){case 0:return`internal`;case 400:return`invalid-argument`;case 401:return`unauthenticated`;case 403:return`permission-denied`;case 404:return`not-found`;case 409:return`aborted`;case 429:return`resource-exhausted`;case 499:return`cancelled`;case 500:return`internal`;case 501:return`unimplemented`;case 503:return`unavailable`;case 504:return`deadline-exceeded`}return`unknown`}function Iw(e,t){let n=Fw(e),r=n,i;try{let e=t&&t.error;if(e){let t=e.status;if(typeof t==`string`){if(!Nw[t])return new Pw(`internal`,`internal`);n=Nw[t],r=t}let a=e.message;typeof a==`string`&&(r=a),i=e.details,i!==void 0&&(i=jw(i))}}catch{}return n===`ok`?null:new Pw(n,r,i)}var Lw=class{constructor(e,t,n,r){this.app=e,this.auth=null,this.messaging=null,this.appCheck=null,this.serverAppAppCheckToken=null,y(e)&&e.settings.appCheckToken&&(this.serverAppAppCheckToken=e.settings.appCheckToken),this.auth=t.getImmediate({optional:!0}),this.messaging=n.getImmediate({optional:!0}),this.auth||t.get().then(e=>this.auth=e,()=>{}),this.messaging||n.get().then(e=>this.messaging=e,()=>{}),this.appCheck||r?.get().then(e=>this.appCheck=e,()=>{})}async getAuthToken(){if(this.auth)try{return(await this.auth.getToken())?.accessToken}catch{return}}async getMessagingToken(){if(!(!this.messaging||!(`Notification`in self)||Notification.permission!==`granted`))try{return await this.messaging.getToken()}catch{return}}async getAppCheckToken(e){if(this.serverAppAppCheckToken)return this.serverAppAppCheckToken;if(this.appCheck){let t=e?await this.appCheck.getLimitedUseToken():await this.appCheck.getToken();return t.error?null:t.token}return null}async getContext(e){return{authToken:await this.getAuthToken(),messagingToken:await this.getMessagingToken(),appCheckToken:await this.getAppCheckToken(e)}}},Rw=`us-central1`,zw=/^data: (.*?)(?:\n|$)/;function Bw(e){let t=null;return{promise:new Promise((n,r)=>{t=setTimeout(()=>{r(new Pw(`deadline-exceeded`,`deadline-exceeded`))},e)}),cancel:()=>{t&&clearTimeout(t)}}}var Vw=class{constructor(e,t,n,r,i=Rw,a=(...e)=>fetch(...e)){this.app=e,this.fetchImpl=a,this.emulatorOrigin=null,this.contextProvider=new Lw(e,t,n,r),this.cancelAllRequests=new Promise(e=>{this.deleteService=()=>Promise.resolve(e())});try{let e=new URL(i);this.customDomain=e.origin+(e.pathname===`/`?``:e.pathname),this.region=Rw}catch{this.customDomain=null,this.region=i}}_delete(){return this.deleteService()}_url(e){let t=this.app.options.projectId;return this.emulatorOrigin===null?this.customDomain===null?`https://${this.region}-${t}.cloudfunctions.net/${e}`:`${this.customDomain}/${e}`:`${this.emulatorOrigin}/${t}/${this.region}/${e}`}};function Hw(e,t,n){let r=Oe(t);e.emulatorOrigin=`http${r?`s`:``}://${t}:${n}`,r&&ke(e.emulatorOrigin+`/backends`)}function Uw(e,t,n){let r=r=>qw(e,t,r,n||{});return r.stream=(n,r)=>Yw(e,t,n,r),r}function Ww(e){return e.emulatorOrigin&&Oe(e.emulatorOrigin)?`include`:void 0}async function Gw(e,t,n,r,i){n[`Content-Type`]=`application/json`;let a;try{a=await r(e,{method:`POST`,body:JSON.stringify(t),headers:n,credentials:Ww(i)})}catch{return{status:0,json:null}}let o=null;try{o=await a.json()}catch{}return{status:a.status,json:o}}async function Kw(e,t){let n={},r=await e.contextProvider.getContext(t.limitedUseAppCheckTokens);return r.authToken&&(n.Authorization=`Bearer `+r.authToken),r.messagingToken&&(n[`Firebase-Instance-ID-Token`]=r.messagingToken),r.appCheckToken!==null&&(n[`X-Firebase-AppCheck`]=r.appCheckToken),n}function qw(e,t,n,r){return Jw(e,e._url(t),n,r)}async function Jw(e,t,n,r){n=Aw(n);let i={data:n},a=await Kw(e,r),o=Bw(r.timeout||7e4),s=await Promise.race([Gw(t,i,a,e.fetchImpl,e),o.promise,e.cancelAllRequests]);if(o.cancel(),!s)throw new Pw(`cancelled`,`Firebase Functions instance was deleted.`);let c=Iw(s.status,s.json);if(c)throw c;if(!s.json)throw new Pw(`internal`,`Response is not valid JSON object.`);let l=s.json.data;if(l===void 0&&(l=s.json.result),l===void 0)throw new Pw(`internal`,`Response is missing data field.`);return{data:jw(l)}}function Yw(e,t,n,r){return Xw(e,e._url(t),n,r||{})}async function Xw(e,t,n,r){n=Aw(n);let i={data:n},a=await Kw(e,r);a[`Content-Type`]=`application/json`,a.Accept=`text/event-stream`;let o;try{o=await e.fetchImpl(t,{method:`POST`,body:JSON.stringify(i),headers:a,signal:r?.signal,credentials:Ww(e)})}catch(e){if(e instanceof Error&&e.name===`AbortError`){let e=new Pw(`cancelled`,`Request was cancelled.`);return{data:Promise.reject(e),stream:{[Symbol.asyncIterator](){return{next(){return Promise.reject(e)}}}}}}let t=Iw(0,null);return{data:Promise.reject(t),stream:{[Symbol.asyncIterator](){return{next(){return Promise.reject(t)}}}}}}let s,c,l=new Promise((e,t)=>{s=e,c=t});r?.signal?.addEventListener(`abort`,()=>{let e=new Pw(`cancelled`,`Request was cancelled.`);c(e)});let u=Zw(o.body.getReader(),s,c,r?.signal);return{stream:{[Symbol.asyncIterator](){let e=u.getReader();return{async next(){let{value:t,done:n}=await e.read();return{value:t,done:n}},async return(){return await e.cancel(),{done:!0,value:void 0}}}}},data:l}}function Zw(e,t,n,r){let i=(e,r)=>{let i=e.match(zw);if(!i)return;let a=i[1];try{let e=JSON.parse(a);if(`result`in e){t(jw(e.result));return}if(`message`in e){r.enqueue(jw(e.message));return}if(`error`in e){let t=Iw(0,e);r.error(t),n(t);return}}catch(e){if(e instanceof Pw){r.error(e),n(e);return}}},a=new TextDecoder;return new ReadableStream({start(t){let o=``;return s();async function s(){if(r?.aborted){let e=new Pw(`cancelled`,`Request was cancelled`);return t.error(e),n(e),Promise.resolve()}try{let{value:c,done:l}=await e.read();if(l){o.trim()&&i(o.trim(),t),t.close();return}if(r?.aborted){let r=new Pw(`cancelled`,`Request was cancelled`);t.error(r),n(r),await e.cancel();return}o+=a.decode(c,{stream:!0});let u=o.split(`
43
- `);o=u.pop()||``;for(let e of u)e.trim()&&i(e.trim(),t);return s()}catch(e){let r=e instanceof Pw?e:Iw(0,null);t.error(r),n(r)}}},cancel(){return e.cancel()}})}var Qw=`@firebase/functions`,$w=`0.13.5`,eT=`auth-internal`,tT=`app-check-internal`,nT=`messaging-internal`;function rT(e){Yt(new Ae(Mw,(e,{instanceIdentifier:t})=>new Vw(e.getProvider(`app`).getImmediate(),e.getProvider(eT),e.getProvider(nT),e.getProvider(tT),t),`PUBLIC`).setMultipleInstances(!0)),nn(Qw,$w,e),nn(Qw,$w,`esm2020`)}function iT(e=tn(),t=Rw){let n=Xt(_(e),Mw).getImmediate({identifier:t}),r=h(`functions`);return r&&aT(n,...r),n}function aT(e,t,n){Hw(_(e),t,n)}function oT(e,t,n){return Uw(_(e),t,n)}rT();var $=class e{static setFirebaseConfig(t){e._firebaseConfig=t}static{this.defaultEmulatorConfig={host:`localhost`,firestorePort:8080,storagePort:9199,authPort:9099,functionsPort:5001,emulate:!1}}static useEmulator(t){this._emulatorConfig={...e.defaultEmulatorConfig,emulate:!0,...t}}static get emulator(){return this._emulatorConfig}constructor(){if(!e._firebaseConfig)throw Error(`You should set a firebase config object before using Firebase`);this._firebaseApp=en(e._firebaseConfig)}static get instance(){return this._instance||=new e}firestore(){return Rh(this._firebaseApp)}storage(){return Cw(this._firebaseApp)}auth(){return sS(this._firebaseApp)}functions(){return iT(this._firebaseApp,e._region)}static setRegion(e){this._region=e}static{this._emulatorConfig=e.defaultEmulatorConfig}},sT=class extends Yg{constructor(e){if(super(),this._lastLimit=0,e&&$.useEmulator(e),$.emulator?.emulate){let{host:e,firestorePort:t}=$.emulator;Ol($.instance.firestore(),e,t)}}findById(e,t){let n=$.instance.firestore();return new Promise(async r=>{try{r((await Dg(Nl(n,t,e))).data())}catch(e){return console.log(e),null}})}save(e){let t=$.instance.firestore(),n=Ng(t);return Object.entries(e).forEach(([e,r])=>{r?.forEach(r=>{let i=Nl(t,e,r.id);n.set(i,r)})}),n.commit()}find(e,t){let n=this.queryObjectToQueryConstraints(e,t);return this.getFromQuery(n)}async count(e,t){return(await vg(this.queryObjectToQueryConstraints(e,t))).data().count}delete(e,t){return kg(Nl($.instance.firestore(),t,e))}next(e){if(!this._lastConstraints||!this._lastCollectionName)throw Error(`You should perform a query prior to using method next`);if(!this._lastDocRetrieved)return Promise.resolve([]);let t=$.instance.firestore();this._lastLimit=e||this._lastLimit;let n=this._lastConstraints.nonFilterConstraints.concat(cg(this._lastLimit),ug(this._lastDocRetrieved));return this.getFromQuery($h(Ml(t,this._lastCollectionName),rg(...this._lastConstraints.orConstraints,ig(...this._lastConstraints.andConstraints)),...n))}onCollectionChange(e,t,n){return Ag(this.queryObjectToQueryConstraints(e,t),e=>{n(e.docChanges().map(e=>({after:e.doc.data(),type:e.type===`added`?`create`:e.type===`removed`?`delete`:`update`,before:void 0,params:{}})))})}onDocumentChange(e,t,n){return Ag(Nl($.instance.firestore(),e,t),t=>{n({type:`update`,before:void 0,after:t.data(),params:t.metadata,collectionPath:e})})}onDocumentTemplateChange(e,t){throw Error(`Method not implemented.`)}queryObjectToQueryConstraints(e,t){let n=$.instance.firestore(),r=[],i=[],a=[];return Yg.toPropertyPathOperations(e.operations).forEach(e=>{let t=this.toFirebaseOperator(e.operator);e.aggregate?i.push(tg(e.property,t,e.value)):r.push(tg(e.property,t,e.value))}),e.sort?.propertyName&&a.push(og(e.sort.propertyName,e.sort.order)),this._lastConstraints={orConstraints:i,andConstraints:r,nonFilterConstraints:a},this._lastCollectionName=t,e.limit&&(this._lastLimit=e.limit,a.push(cg(e.limit))),$h(Ml(n,t),rg(...i,ig(...r)),...a)}toFirebaseOperator(e){switch(e){case`==`:case`!=`:case`<`:case`<=`:case`>`:case`>=`:return e;case`contains`:return`array-contains`;case`containsAny`:return`array-contains-any`;default:return e}}getFromQuery(e){return new Promise(async t=>{let n=await Og(e);n.empty?(this._lastDocRetrieved=void 0,t([])):(this._lastDocRetrieved=n.docs[n.docs.length-1],t(n.docs.map(e=>e.data())))})}resolveCollectionPaths(e){throw Error(`Method not implemented.`)}};function cT(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var lT=class extends Xg{constructor(e){if(super(),e&&$.useEmulator(e),$.emulator?.emulate){let{host:e,storagePort:t}=$.emulator;ww($.instance.storage(),e,t)}}save(e,t,n){let r=$.instance.storage();return new Promise((i,a)=>{if(this._uploadTask=yw(Sw(r,e),t),n)var o=this._uploadTask.on(`state_changed`,e=>{n(e.bytesTransferred,e.totalBytes)},null,()=>o());this._uploadTask.then(()=>i(e)).catch(e=>a(e))})}getUrl(e){return e?bw(Sw($.instance.storage(),e)):Promise.reject(`needs a reference`)}uploadControl(){if(!this._uploadTask)throw Error(`You should call save() before uploadControl()`);return{cancel:()=>this._uploadTask?.cancel(),pause:()=>this._uploadTask?.pause(),resume:()=>this._uploadTask?.resume(),onProgress:e=>this._uploadTask?.on(`state_changed`,t=>{e&&e(t.bytesTransferred,t.totalBytes)})}}delete(e){return xw(Sw($.instance.storage(),e))}};lT=cT([Zg(`FirebaseCloudStorage`,()=>new lT)],lT);var uT={twitter:()=>new Dy,facebook:()=>new wy,google:()=>new Ty},dT=class e extends e_{constructor(e){if(super(),this.credentialProviders={},e&&$.useEmulator(e),$.emulator?.emulate){let{host:e,authPort:t}=$.emulator;if(!e||!t)throw Error(`You should define a host and an auth emulator port to use the emulator`);Yv($.instance.auth(),`http://${e}:${t}`)}this.registerCredentialProviders()}signUp(e){let{authProvider:t,verificationLink:n}=e;return t.slice(0,5)===`email`?new Promise(async(r,i)=>{try{let i=this.credentialProviders[`email-sign-up`];if(!i)throw Error(`The provider ${t} is not registered`);let a=await i(e);e.name&&await Jy(a.user,{displayName:e.name}),n&&await Ky(a.user,{url:n}),r(await this.toUserCredentials(a.user))}catch(e){i({code:n_(e.code.slice(5)),message:e.message})}}):this.login(e)}login(e){let{authProvider:t}=e;return new Promise(async(n,r)=>{try{let r=this.credentialProviders[t];if(!r)throw Error(`The provider ${t} is not registered`);let i=await r(e);n(await this.toUserCredentials(i.user))}catch(e){r({code:e.code===400?`missingPassword`:n_(e.code.slice(5)),message:e.message})}})}logout(){return $.instance.auth().signOut()}resetEmailPassword(e){return new Promise(async(t,n)=>{try{await Uy($.instance.auth(),e),t()}catch(e){n({code:n_(e.code.slice(5)),message:e.message})}})}resendVerificationEmail(e,t,n){return new Promise(async(r,i)=>{try{await Gy($.instance.auth(),e,t);let a=$.instance.auth().currentUser;if(!a){i({code:`userNotFound`,message:`There is no logged in user`});return}await Ky(a,{url:n}),r()}catch(e){i({code:n_(e.code.slice(5)),message:n})}})}refreshToken(){return $.instance.auth().currentUser?.getIdToken(!0)}onAuthStateChange(e){$.instance.auth().onAuthStateChanged(async t=>{e(t?await this.toUserCredentials(t):void 0)})}linkAdditionalProvider(e){let t=uT[e](),n=$.instance.auth().currentUser;if(!n)throw Error(`There is no logged in user`);return $b(n,t)}unlinkProvider(e){let{currentUser:t}=$.instance.auth();if(!t)throw Error(`There is no logged in user`);return t.providerData,Fy(t,uT[e]().providerId)}async toUserCredentials(t){if(!t)throw Error(`The user in user credentials is not defined`);let n=(await t.getIdTokenResult()).claims;return e.convertCredentials(t,n)}static convertCredentials(e,t){return{id:e.uid,email:e.email??``,name:e.displayName??void 0,pictureUrl:e.photoURL??void 0,phoneNumber:e.phoneNumber??void 0,emailVerified:e.emailVerified,customData:{...t},lastLogin:Date.now(),creationDate:e.metadata.creationTime?new Date(e.metadata.creationTime).getTime():void 0}}registerCredentialProvider(e,t){this.credentialProviders[e]=t}registerCredentialProviders(){this.registerCredentialProvider(`email-sign-up`,e=>{if(!e.email||!e.password)throw Error(`Email and password are required`);return Wy($.instance.auth(),e.email,e.password)}),this.registerCredentialProvider(`email`,e=>{if(!e.email||!e.password)throw Error(`Email and password are required`);return Gy($.instance.auth(),e.email,e.password)}),this.registerCredentialProvider(`google`,()=>Qb($.instance.auth(),new Ty)),this.registerCredentialProvider(`facebook`,()=>Qb($.instance.auth(),new wy)),this.registerCredentialProvider(`twitter`,()=>Qb($.instance.auth(),new Dy)),this.registerCredentialProvider(`link-twitter`,()=>{let e=$.instance.auth().currentUser;if(!e)throw Error(`There is no logged in user`);return $b(e,new Dy)}),this.registerCredentialProvider(`anonymous`,()=>jy($.instance.auth()))}},fT=class{constructor(e,t){if(e&&$.setRegion(e),t&&$.useEmulator(t),$.emulator?.emulate){let{host:e,functionsPort:t}=$.emulator;aT($.instance.functions(),e,t)}}retrieveFunction(e){return oT($.instance.functions(),e)}async callFunction(e,t){return(await e(t)).data}};e.FirebaseAuth=dT,e.FirebaseCloudFunctions=fT,Object.defineProperty(e,"FirebaseCloudStorage",{enumerable:!0,get:function(){return lT}}),e.FirebaseDatasource=sT,e.FirebaseHelper=$});
43
+ `);o=u.pop()||``;for(let e of u)e.trim()&&i(e.trim(),t);return s()}catch(e){let r=e instanceof Pw?e:Iw(0,null);t.error(r),n(r)}}},cancel(){return e.cancel()}})}var Qw=`@firebase/functions`,$w=`0.13.5`,eT=`auth-internal`,tT=`app-check-internal`,nT=`messaging-internal`;function rT(e){Yt(new Ae(Mw,(e,{instanceIdentifier:t})=>new Vw(e.getProvider(`app`).getImmediate(),e.getProvider(eT),e.getProvider(nT),e.getProvider(tT),t),`PUBLIC`).setMultipleInstances(!0)),nn(Qw,$w,e),nn(Qw,$w,`esm2020`)}function iT(e=tn(),t=Rw){let n=Xt(_(e),Mw).getImmediate({identifier:t}),r=h(`functions`);return r&&aT(n,...r),n}function aT(e,t,n){Hw(_(e),t,n)}function oT(e,t,n){return Uw(_(e),t,n)}rT();var $=class e{static setFirebaseConfig(t){e._firebaseConfig=t}static{this.defaultEmulatorConfig={host:`localhost`,firestorePort:8080,storagePort:9199,authPort:9099,functionsPort:5001,emulate:!1}}static useEmulator(t){this._emulatorConfig={...e.defaultEmulatorConfig,emulate:!0,...t}}static get emulator(){return this._emulatorConfig}constructor(){if(!e._firebaseConfig)throw Error(`You should set a firebase config object before using Firebase`);this._firebaseApp=en(e._firebaseConfig)}static get instance(){return this._instance||=new e}firestore(){return Rh(this._firebaseApp)}storage(){return Cw(this._firebaseApp)}auth(){return sS(this._firebaseApp)}functions(){return iT(this._firebaseApp,e._region)}static setRegion(e){this._region=e}static{this._emulatorConfig=e.defaultEmulatorConfig}},sT=class extends Yg{constructor(e){if(super(),this._lastLimit=0,e&&$.useEmulator(e),$.emulator?.emulate){let{host:e,firestorePort:t}=$.emulator;Ol($.instance.firestore(),e,t)}}findById(e,t){let n=$.instance.firestore();return new Promise(async r=>{try{r((await Dg(Nl(n,t,e))).data())}catch(e){return console.log(e),null}})}save(e){let t=$.instance.firestore(),n=Ng(t);return Object.entries(e).forEach(([e,r])=>{r?.forEach(r=>{let i=Nl(t,e,r.id);n.set(i,r)})}),n.commit()}find(e,t){let n=this.queryObjectToQueryConstraints(e,t);return this.getFromQuery(n)}async count(e,t){return(await vg(this.queryObjectToQueryConstraints(e,t))).data().count}delete(e,t){return kg(Nl($.instance.firestore(),t,e))}next(e){if(!this._lastConstraints||!this._lastCollectionName)throw Error(`You should perform a query prior to using method next`);if(!this._lastDocRetrieved)return Promise.resolve([]);let t=$.instance.firestore();this._lastLimit=e||this._lastLimit;let n=this._lastConstraints.nonFilterConstraints.concat(cg(this._lastLimit),ug(this._lastDocRetrieved));return this.getFromQuery($h(Ml(t,this._lastCollectionName),rg(...this._lastConstraints.orConstraints,ig(...this._lastConstraints.andConstraints)),...n))}onCollectionChange(e,t,n){return Ag(this.queryObjectToQueryConstraints(e,t),e=>{n(e.docChanges().map(e=>({after:e.doc.data(),type:e.type===`added`?`create`:e.type===`removed`?`delete`:`update`,before:void 0,params:{}})))})}onDocumentChange(e,t,n){return Ag(Nl($.instance.firestore(),e,t),t=>{n({type:`update`,before:void 0,after:t.data(),params:t.metadata,collectionPath:e})})}onDocumentTemplateChange(e,t){throw Error(`Method not implemented.`)}queryObjectToQueryConstraints(e,t){let n=$.instance.firestore(),r=[],i=[],a=[];return Yg.toPropertyPathOperations(e.operations).forEach(e=>{let t=this.toFirebaseOperator(e.operator);e.aggregate?i.push(tg(e.property,t,e.value)):r.push(tg(e.property,t,e.value))}),e.sort?.propertyName&&a.push(og(e.sort.propertyName,e.sort.order)),this._lastConstraints={orConstraints:i,andConstraints:r,nonFilterConstraints:a},this._lastCollectionName=t,e.limit&&(this._lastLimit=e.limit,a.push(cg(e.limit))),$h(Ml(n,t),rg(...i,ig(...r)),...a)}toFirebaseOperator(e){switch(e){case`==`:case`!=`:case`<`:case`<=`:case`>`:case`>=`:return e;case`contains`:return`array-contains`;case`containsAny`:return`array-contains-any`;default:return e}}getFromQuery(e){return new Promise(async t=>{let n=await Og(e);n.empty?(this._lastDocRetrieved=void 0,t([])):(this._lastDocRetrieved=n.docs[n.docs.length-1],t(n.docs.map(e=>e.data())))})}resolveCollectionPaths(e){throw Error(`Method not implemented.`)}};function cT(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var lT=class extends Xg{constructor(e){if(super(),e&&$.useEmulator(e),$.emulator?.emulate){let{host:e,storagePort:t}=$.emulator;ww($.instance.storage(),e,t)}}save(e,t,n){let r=$.instance.storage();return new Promise((i,a)=>{if(this._uploadTask=yw(Sw(r,e),t),n)var o=this._uploadTask.on(`state_changed`,e=>{n(e.bytesTransferred,e.totalBytes)},null,()=>o());this._uploadTask.then(()=>i(e)).catch(e=>a(e))})}getUrl(e){return e?bw(Sw($.instance.storage(),e)):Promise.reject(`needs a reference`)}uploadControl(){if(!this._uploadTask)throw Error(`You should call save() before uploadControl()`);return{cancel:()=>this._uploadTask?.cancel(),pause:()=>this._uploadTask?.pause(),resume:()=>this._uploadTask?.resume(),onProgress:e=>this._uploadTask?.on(`state_changed`,t=>{e&&e(t.bytesTransferred,t.totalBytes)})}}delete(e){return xw(Sw($.instance.storage(),e))}};lT=cT([Zg(`FirebaseCloudStorage`,()=>new lT)],lT);var uT={twitter:()=>new Dy,facebook:()=>new wy,google:()=>new Ty},dT=class e extends e_{constructor(e){if(super(),this.credentialProviders={},e&&$.useEmulator(e),$.emulator?.emulate){let{host:e,authPort:t}=$.emulator;if(!e||!t)throw Error(`You should define a host and an auth emulator port to use the emulator`);Yv($.instance.auth(),`http://${e}:${t}`)}this.registerCredentialProviders()}signUp(e){let{authProvider:t,verificationLink:n}=e;return t.slice(0,5)===`email`?new Promise(async(r,i)=>{try{let i=this.credentialProviders[`email-sign-up`];if(!i)throw Error(`The provider ${t} is not registered`);let a=await i(e);e.name&&await Jy(a.user,{displayName:e.name}),n&&await Ky(a.user,{url:n}),r(await this.toUserCredentials(a.user))}catch(e){let{code:t,message:n}=e;i({code:n_(t.slice(5)),message:n})}}):this.login(e)}login(e){let{authProvider:t}=e;return new Promise(async(n,r)=>{try{let r=this.credentialProviders[t];if(!r)throw Error(`The provider ${t} is not registered`);let i=await r(e);n(await this.toUserCredentials(i.user))}catch(e){let{code:t,message:n}=e;r({code:t===400?`missingPassword`:n_(t.slice(5)),message:n})}})}logout(){return $.instance.auth().signOut()}resetEmailPassword(e){return new Promise(async(t,n)=>{try{await Uy($.instance.auth(),e),t()}catch(e){let{code:t,message:r}=e;n({code:n_(t.slice(5)),message:r})}})}resendVerificationEmail(e,t,n){return new Promise(async(r,i)=>{try{await Gy($.instance.auth(),e,t);let a=$.instance.auth().currentUser;if(!a){i({code:`userNotFound`,message:`There is no logged in user`});return}await Ky(a,{url:n}),r()}catch(e){let{code:t}=e;i({code:n_(t.slice(5)),message:n})}})}refreshToken(){return $.instance.auth().currentUser?.getIdToken(!0)}onAuthStateChange(e){$.instance.auth().onAuthStateChanged(async t=>{e(t?await this.toUserCredentials(t):void 0)})}linkAdditionalProvider(e){let t=uT[e];if(!t)throw Error(`Provider ${e} doesn't support link`);let n=t(),r=$.instance.auth().currentUser;if(!r)throw Error(`There is no logged in user`);return $b(r,n)}unlinkProvider(e){let t=uT[e];if(!t)throw Error(`Provider ${e} doesn't support unlink`);let{currentUser:n}=$.instance.auth();if(!n)throw Error(`There is no logged in user`);return Fy(n,t().providerId)}async toUserCredentials(t){if(!t)throw Error(`The user in user credentials is not defined`);let n=(await t.getIdTokenResult()).claims;return e.convertCredentials(t,n)}static convertCredentials(e,t){return{id:e.uid,email:e.email??``,name:e.displayName??void 0,pictureUrl:e.photoURL??void 0,phoneNumber:e.phoneNumber??void 0,emailVerified:e.emailVerified,customData:{...t},lastLogin:Date.now(),creationDate:e.metadata.creationTime?new Date(e.metadata.creationTime).getTime():void 0}}registerCredentialProvider(e,t){this.credentialProviders[e]=t}registerCredentialProviders(){this.registerCredentialProvider(`email-sign-up`,e=>{if(!e.email||!e.password)throw Error(`Email and password are required`);return Wy($.instance.auth(),e.email,e.password)}),this.registerCredentialProvider(`email`,e=>{if(!e.email||!e.password)throw Error(`Email and password are required`);return Gy($.instance.auth(),e.email,e.password)}),this.registerCredentialProvider(`google`,()=>Qb($.instance.auth(),new Ty)),this.registerCredentialProvider(`facebook`,()=>Qb($.instance.auth(),new wy)),this.registerCredentialProvider(`twitter`,()=>Qb($.instance.auth(),new Dy)),this.registerCredentialProvider(`link-twitter`,()=>{let e=$.instance.auth().currentUser;if(!e)throw Error(`There is no logged in user`);return $b(e,new Dy)}),this.registerCredentialProvider(`anonymous`,()=>jy($.instance.auth()))}},fT=class{constructor(e,t){if(e&&$.setRegion(e),t&&$.useEmulator(t),$.emulator?.emulate){let{host:e,functionsPort:t}=$.emulator;aT($.instance.functions(),e,t)}}retrieveFunction(e){return oT($.instance.functions(),e)}async callFunction(e,t){return(await e(t)).data}};e.FirebaseAuth=dT,e.FirebaseCloudFunctions=fT,Object.defineProperty(e,"FirebaseCloudStorage",{enumerable:!0,get:function(){return lT}}),e.FirebaseDatasource=sT,e.FirebaseHelper=$});
44
44
  //# sourceMappingURL=entropic-bond-firebase.umd.cjs.map