diff --git a/.firebaserc b/.firebaserc deleted file mode 100644 index 98857542..00000000 --- a/.firebaserc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "projects": { - "default": "io-pinball" - } -} diff --git a/firebase.json b/firebase.json index 99025785..80e2ae69 100644 --- a/firebase.json +++ b/firebase.json @@ -1,7 +1,11 @@ { "hosting": { "public": "build/web", - "site": "io-pinball", - "ignore": ["firebase.json", "**/.*", "**/node_modules/**"] + "site": "ashehwkdkdjruejdnensjsjdne", + "ignore": [ + "firebase.json", + "**/.*", + "**/node_modules/**" + ] } } diff --git a/web/__/firebase/8.10.1/firebase-app.js b/web/__/firebase/8.10.1/firebase-app.js new file mode 100644 index 00000000..c688d1c4 --- /dev/null +++ b/web/__/firebase/8.10.1/firebase-app.js @@ -0,0 +1,2 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).firebase=t()}(this,function(){"use strict";var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};var n=function(){return(n=Object.assign||function(e){for(var t,n=1,r=arguments.length;na[0]&&t[1]=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function f(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||0"})):"Error",e=this.serviceName+": "+e+" ("+o+").";return new c(o,e,i)},v);function v(e,t,n){this.service=e,this.serviceName=t,this.errors=n}var m=/\{\$([^}]+)}/g;function y(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function g(e,t){t=new b(e,t);return t.subscribe.bind(t)}var b=(I.prototype.next=function(t){this.forEachObserver(function(e){e.next(t)})},I.prototype.error=function(t){this.forEachObserver(function(e){e.error(t)}),this.close(t)},I.prototype.complete=function(){this.forEachObserver(function(e){e.complete()}),this.close()},I.prototype.subscribe=function(e,t,n){var r,i=this;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");void 0===(r=function(e,t){if("object"!=typeof e||null===e)return!1;for(var n=0,r=t;n=(null!=o?o:e.logLevel)&&a({level:R[t].toLowerCase(),message:i,args:n,type:e.name})}}(n[e])}var H=((H={})["no-app"]="No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()",H["bad-app-name"]="Illegal App name: '{$appName}",H["duplicate-app"]="Firebase App named '{$appName}' already exists",H["app-deleted"]="Firebase App named '{$appName}' already deleted",H["invalid-app-argument"]="firebase.{$appName}() takes either no argument or a Firebase App instance.",H["invalid-log-argument"]="First argument to `onLog` must be null or a function.",H),V=new d("app","Firebase",H),B="@firebase/app",M="[DEFAULT]",U=((H={})[B]="fire-core",H["@firebase/analytics"]="fire-analytics",H["@firebase/app-check"]="fire-app-check",H["@firebase/auth"]="fire-auth",H["@firebase/database"]="fire-rtdb",H["@firebase/functions"]="fire-fn",H["@firebase/installations"]="fire-iid",H["@firebase/messaging"]="fire-fcm",H["@firebase/performance"]="fire-perf",H["@firebase/remote-config"]="fire-rc",H["@firebase/storage"]="fire-gcs",H["@firebase/firestore"]="fire-fst",H["fire-js"]="fire-js",H["firebase-wrapper"]="fire-js-all",H),W=new z("@firebase/app"),G=(Object.defineProperty($.prototype,"automaticDataCollectionEnabled",{get:function(){return this.checkDestroyed_(),this.automaticDataCollectionEnabled_},set:function(e){this.checkDestroyed_(),this.automaticDataCollectionEnabled_=e},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"name",{get:function(){return this.checkDestroyed_(),this.name_},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"options",{get:function(){return this.checkDestroyed_(),this.options_},enumerable:!1,configurable:!0}),$.prototype.delete=function(){var t=this;return new Promise(function(e){t.checkDestroyed_(),e()}).then(function(){return t.firebase_.INTERNAL.removeApp(t.name_),Promise.all(t.container.getProviders().map(function(e){return e.delete()}))}).then(function(){t.isDeleted_=!0})},$.prototype._getService=function(e,t){void 0===t&&(t=M),this.checkDestroyed_();var n=this.container.getProvider(e);return n.isInitialized()||"EXPLICIT"!==(null===(e=n.getComponent())||void 0===e?void 0:e.instantiationMode)||n.initialize(),n.getImmediate({identifier:t})},$.prototype._removeServiceInstance=function(e,t){void 0===t&&(t=M),this.container.getProvider(e).clearInstance(t)},$.prototype._addComponent=function(t){try{this.container.addComponent(t)}catch(e){W.debug("Component "+t.name+" failed to register with FirebaseApp "+this.name,e)}},$.prototype._addOrOverwriteComponent=function(e){this.container.addOrOverwriteComponent(e)},$.prototype.toJSON=function(){return{name:this.name,automaticDataCollectionEnabled:this.automaticDataCollectionEnabled,options:this.options}},$.prototype.checkDestroyed_=function(){if(this.isDeleted_)throw V.create("app-deleted",{appName:this.name_})},$);function $(e,t,n){var r=this;this.firebase_=n,this.isDeleted_=!1,this.name_=t.name,this.automaticDataCollectionEnabled_=t.automaticDataCollectionEnabled||!1,this.options_=h(void 0,e),this.container=new S(t.name),this._addComponent(new O("app",function(){return r},"PUBLIC")),this.firebase_.INTERNAL.components.forEach(function(e){return r._addComponent(e)})}G.prototype.name&&G.prototype.options||G.prototype.delete||console.log("dc");var K="8.10.1";function Y(a){var s={},l=new Map,c={__esModule:!0,initializeApp:function(e,t){void 0===t&&(t={});"object"==typeof t&&null!==t||(t={name:t});var n=t;void 0===n.name&&(n.name=M);t=n.name;if("string"!=typeof t||!t)throw V.create("bad-app-name",{appName:String(t)});if(y(s,t))throw V.create("duplicate-app",{appName:t});n=new a(e,n,c);return s[t]=n},app:u,registerVersion:function(e,t,n){var r=null!==(i=U[e])&&void 0!==i?i:e;n&&(r+="-"+n);var i=r.match(/\s|\//),e=t.match(/\s|\//);i||e?(n=['Unable to register library "'+r+'" with version "'+t+'":'],i&&n.push('library name "'+r+'" contains illegal characters (whitespace or "/")'),i&&e&&n.push("and"),e&&n.push('version name "'+t+'" contains illegal characters (whitespace or "/")'),W.warn(n.join(" "))):o(new O(r+"-version",function(){return{library:r,version:t}},"VERSION"))},setLogLevel:T,onLog:function(e,t){if(null!==e&&"function"!=typeof e)throw V.create("invalid-log-argument");x(e,t)},apps:null,SDK_VERSION:K,INTERNAL:{registerComponent:o,removeApp:function(e){delete s[e]},components:l,useAsService:function(e,t){return"serverAuth"!==t?t:null}}};function u(e){if(!y(s,e=e||M))throw V.create("no-app",{appName:e});return s[e]}function o(n){var e,r=n.name;if(l.has(r))return W.debug("There were multiple attempts to register component "+r+"."),"PUBLIC"===n.type?c[r]:null;l.set(r,n),"PUBLIC"===n.type&&(e=function(e){if("function"!=typeof(e=void 0===e?u():e)[r])throw V.create("invalid-app-argument",{appName:r});return e[r]()},void 0!==n.serviceProps&&h(e,n.serviceProps),c[r]=e,a.prototype[r]=function(){for(var e=[],t=0;t>>0),i=0;function r(t,e,n){return t.call.apply(t.bind,arguments)}function g(e,n,t){if(!e)throw Error();if(2/g,Q=/"/g,tt=/'/g,et=/\x00/g,nt=/[\x00&<>"']/;function it(t,e){return-1!=t.indexOf(e)}function rt(t,e){return t"}else o=void 0===t?"undefined":null===t?"null":typeof t;D("Argument is not a %s (or a non-Element, non-Location mock); got: %s",e,o)}}function dt(t,e){this.a=t===gt&&e||"",this.b=mt}function pt(t){return t instanceof dt&&t.constructor===dt&&t.b===mt?t.a:(D("expected object of type Const, got '"+t+"'"),"type_error:Const")}dt.prototype.ta=!0,dt.prototype.sa=function(){return this.a},dt.prototype.toString=function(){return"Const{"+this.a+"}"};var vt,mt={},gt={};function bt(){if(void 0===vt){var t=null,e=l.trustedTypes;if(e&&e.createPolicy){try{t=e.createPolicy("goog#html",{createHTML:I,createScript:I,createScriptURL:I})}catch(t){l.console&&l.console.error(t.message)}vt=t}else vt=t}return vt}function yt(t,e){this.a=e===At?t:""}function wt(t){return t instanceof yt&&t.constructor===yt?t.a:(D("expected object of type TrustedResourceUrl, got '"+t+"' of type "+d(t)),"type_error:TrustedResourceUrl")}function It(t,n){var e,i=pt(t);if(!Et.test(i))throw Error("Invalid TrustedResourceUrl format: "+i);return t=i.replace(Tt,function(t,e){if(!Object.prototype.hasOwnProperty.call(n,e))throw Error('Found marker, "'+e+'", in format string, "'+i+'", but no valid label mapping found in args: '+JSON.stringify(n));return(t=n[e])instanceof dt?pt(t):encodeURIComponent(String(t))}),e=t,t=bt(),new yt(e=t?t.createScriptURL(e):e,At)}yt.prototype.ta=!0,yt.prototype.sa=function(){return this.a.toString()},yt.prototype.toString=function(){return"TrustedResourceUrl{"+this.a+"}"};var Tt=/%{(\w+)}/g,Et=/^((https:)?\/\/[0-9a-z.:[\]-]+\/|\/[^/\\]|[^:/\\%]+\/|[^:/\\%]*[?#]|about:blank#)/i,At={};function kt(t,e){this.a=e===Dt?t:""}function St(t){return t instanceof kt&&t.constructor===kt?t.a:(D("expected object of type SafeUrl, got '"+t+"' of type "+d(t)),"type_error:SafeUrl")}kt.prototype.ta=!0,kt.prototype.sa=function(){return this.a.toString()},kt.prototype.toString=function(){return"SafeUrl{"+this.a+"}"};var Nt=/^(?:audio\/(?:3gpp2|3gpp|aac|L16|midi|mp3|mp4|mpeg|oga|ogg|opus|x-m4a|x-matroska|x-wav|wav|webm)|font\/\w+|image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp|x-icon)|text\/csv|video\/(?:mpeg|mp4|ogg|webm|quicktime|x-matroska))(?:;\w+=(?:\w+|"[\w;,= ]+"))*$/i,_t=/^data:(.*);base64,[a-z0-9+\/]+=*$/i,Ot=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i;function Ct(t){return t instanceof kt?t:(t="object"==typeof t&&t.ta?t.sa():String(t),t=Ot.test(t)||(e=(t=(t=String(t)).replace(/(%0A|%0D)/g,"")).match(_t))&&Nt.test(e[1])?new kt(t,Dt):null);var e}function Rt(t){return t instanceof kt?t:(t="object"==typeof t&&t.ta?t.sa():String(t),new kt(t=!Ot.test(t)?"about:invalid#zClosurez":t,Dt))}var Dt={},Pt=new kt("about:invalid#zClosurez",Dt);function Lt(t,e,n){this.a=n===xt?t:""}Lt.prototype.ta=!0,Lt.prototype.sa=function(){return this.a.toString()},Lt.prototype.toString=function(){return"SafeHtml{"+this.a+"}"};var xt={};function Mt(t,e,n,i){return t=t instanceof kt?t:Rt(t),e=e||l,n=n instanceof dt?pt(n):n||"",e.open(St(t),n,i,void 0)}function jt(t){for(var e=t.split("%s"),n="",i=Array.prototype.slice.call(arguments,1);i.length&&1")?t.replace(Z,">"):t).indexOf('"')?t.replace(Q,"""):t).indexOf("'")?t.replace(tt,"'"):t).indexOf("\0")&&(t=t.replace(et,"�"))),t}function Vt(t){return Vt[" "](t),t}Vt[" "]=a;var Ft,qt=at("Opera"),Ht=at("Trident")||at("MSIE"),Kt=at("Edge"),Gt=Kt||Ht,Bt=at("Gecko")&&!(it(J.toLowerCase(),"webkit")&&!at("Edge"))&&!(at("Trident")||at("MSIE"))&&!at("Edge"),Wt=it(J.toLowerCase(),"webkit")&&!at("Edge");function Xt(){var t=l.document;return t?t.documentMode:void 0}t:{var Jt="",Yt=(Yt=J,Bt?/rv:([^\);]+)(\)|;)/.exec(Yt):Kt?/Edge\/([\d\.]+)/.exec(Yt):Ht?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(Yt):Wt?/WebKit\/(\S+)/.exec(Yt):qt?/(?:Version)[ \/]?(\S+)/.exec(Yt):void 0);if(Yt&&(Jt=Yt?Yt[1]:""),Ht){Yt=Xt();if(null!=Yt&&Yt>parseFloat(Jt)){Ft=String(Yt);break t}}Ft=Jt}var zt={};function $t(s){return t=s,e=function(){for(var t=0,e=Y(String(Ft)).split("."),n=Y(String(s)).split("."),i=Math.max(e.length,n.length),r=0;0==t&&r"),i=i.join("")),i=ae(n,i),r&&("string"==typeof r?i.className=r:Array.isArray(r)?i.className=r.join(" "):ee(i,r)),2>>0);function ln(e){return v(e)?e:(e[hn]||(e[hn]=function(t){return e.handleEvent(t)}),e[hn])}function fn(){Pe.call(this),this.v=new Je(this),(this.bc=this).hb=null}function dn(t,e,n,i,r){t.v.add(String(e),n,!1,i,r)}function pn(t,e,n,i,r){t.v.add(String(e),n,!0,i,r)}function vn(t,e,n,i){if(!(e=t.v.a[String(e)]))return!0;e=e.concat();for(var r=!0,o=0;o>4&15).toString(16)+(15&t).toString(16)}An.prototype.toString=function(){var t=[],e=this.c;e&&t.push(Pn(e,xn,!0),":");var n=this.a;return!n&&"file"!=e||(t.push("//"),(e=this.l)&&t.push(Pn(e,xn,!0),"@"),t.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.g)&&t.push(":",String(n))),(n=this.f)&&(this.a&&"/"!=n.charAt(0)&&t.push("/"),t.push(Pn(n,"/"==n.charAt(0)?jn:Mn,!0))),(n=this.b.toString())&&t.push("?",n),(n=this.h)&&t.push("#",Pn(n,Vn)),t.join("")},An.prototype.resolve=function(t){var e=new An(this),n=!!t.c;n?kn(e,t.c):n=!!t.l,n?e.l=t.l:n=!!t.a,n?e.a=t.a:n=null!=t.g;var i=t.f;if(n)Sn(e,t.g);else if(n=!!t.f)if("/"!=i.charAt(0)&&(this.a&&!this.f?i="/"+i:-1!=(r=e.f.lastIndexOf("/"))&&(i=e.f.substr(0,r+1)+i)),".."==(r=i)||"."==r)i="";else if(it(r,"./")||it(r,"/.")){for(var i=0==r.lastIndexOf("/",0),r=r.split("/"),o=[],a=0;a2*t.c&&In(t)))}function Gn(t,e){return qn(t),e=Xn(t,e),Tn(t.a.b,e)}function Bn(t,e,n){Kn(t,e),0',t=new Lt(t=(i=bt())?i.createHTML(t):t,0,xt),i=a.document)&&(i.write((o=t)instanceof Lt&&o.constructor===Lt?o.a:(D("expected object of type SafeHtml, got '"+o+"' of type "+d(o)),"type_error:SafeHtml")),i.close())):(a=Mt(e,i,n,a))&&t.noopener&&(a.opener=null),a)try{a.focus()}catch(t){}return a}var oi=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,ai=/^[^@]+@[^@]+$/;function si(){var e=null;return new fe(function(t){"complete"==l.document.readyState?t():(e=function(){t()},en(window,"load",e))}).o(function(t){throw nn(window,"load",e),t})}function ui(t){return t=t||bi(),!("file:"!==Ei()&&"ionic:"!==Ei()||!t.toLowerCase().match(/iphone|ipad|ipod|android/))}function ci(){var t=l.window;try{return t&&t!=t.top}catch(t){return}}function hi(){return void 0!==l.WorkerGlobalScope&&"function"==typeof l.importScripts}function li(){return Zl.default.INTERNAL.hasOwnProperty("reactNative")?"ReactNative":Zl.default.INTERNAL.hasOwnProperty("node")?"Node":hi()?"Worker":"Browser"}function fi(){var t=li();return"ReactNative"===t||"Node"===t}var di="Firefox",pi="Chrome";function vi(t){var e=t.toLowerCase();return it(e,"opera/")||it(e,"opr/")||it(e,"opios/")?"Opera":it(e,"iemobile")?"IEMobile":it(e,"msie")||it(e,"trident/")?"IE":it(e,"edge/")?"Edge":it(e,"firefox/")?di:it(e,"silk/")?"Silk":it(e,"blackberry")?"Blackberry":it(e,"webos")?"Webos":!it(e,"safari/")||it(e,"chrome/")||it(e,"crios/")||it(e,"android")?!it(e,"chrome/")&&!it(e,"crios/")||it(e,"edge/")?it(e,"android")?"Android":(t=t.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/))&&2==t.length?t[1]:"Other":pi:"Safari"}var mi={md:"FirebaseCore-web",od:"FirebaseUI-web"};function gi(t,e){e=e||[];var n,i=[],r={};for(n in mi)r[mi[n]]=!0;for(n=0;n>4),64!=a&&(t(o<<4&240|a>>2),64!=s&&t(a<<6&192|s))}}(t,function(t){e.push(t)}),e}function Pr(t){var e=xr(t);if(!(e&&e.sub&&e.iss&&e.aud&&e.exp))throw Error("Invalid JWT");this.h=t,this.a=e.exp,this.i=e.sub,t=Date.now()/1e3,this.g=e.iat||(t>this.a?this.a:t),this.b=e.provider_id||e.firebase&&e.firebase.sign_in_provider||null,this.f=e.firebase&&e.firebase.tenant||null,this.c=!!e.is_anonymous||"anonymous"==this.b}function Lr(t){try{return new Pr(t)}catch(t){return null}}function xr(t){if(!t)return null;if(3!=(t=t.split(".")).length)return null;for(var e=(4-(t=t[1]).length%4)%4,n=0;n>10)),t[n++]=String.fromCharCode(56320+(1023&a))):(r=i[e++],o=i[e++],t[n++]=String.fromCharCode((15&s)<<12|(63&r)<<6|63&o))}return JSON.parse(t.join(""))}catch(t){}return null}Pr.prototype.T=function(){return this.f},Pr.prototype.l=function(){return this.c},Pr.prototype.toString=function(){return this.h};var Mr="oauth_consumer_key oauth_nonce oauth_signature oauth_signature_method oauth_timestamp oauth_token oauth_version".split(" "),jr=["client_id","response_type","scope","redirect_uri","state"],Ur={nd:{Ja:"locale",va:700,ua:600,fa:"facebook.com",Ya:jr},pd:{Ja:null,va:500,ua:750,fa:"github.com",Ya:jr},qd:{Ja:"hl",va:515,ua:680,fa:"google.com",Ya:jr},wd:{Ja:"lang",va:485,ua:705,fa:"twitter.com",Ya:Mr},kd:{Ja:"locale",va:640,ua:600,fa:"apple.com",Ya:[]}};function Vr(t){for(var e in Ur)if(Ur[e].fa==t)return Ur[e];return null}function Fr(t){var e={};e["facebook.com"]=Br,e["google.com"]=Xr,e["github.com"]=Wr,e["twitter.com"]=Jr;var n=t&&t[Hr];try{if(n)return new(e[n]||Gr)(t);if(void 0!==t[qr])return new Kr(t)}catch(t){}return null}var qr="idToken",Hr="providerId";function Kr(t){var e,n=t[Hr];if(n||!t[qr]||(e=Lr(t[qr]))&&e.b&&(n=e.b),!n)throw Error("Invalid additional user info!");e=!1,void 0!==t.isNewUser?e=!!t.isNewUser:"identitytoolkit#SignupNewUserResponse"===t.kind&&(e=!0),Fi(this,"providerId",n="anonymous"==n||"custom"==n?null:n),Fi(this,"isNewUser",e)}function Gr(t){Kr.call(this,t),Fi(this,"profile",Ki((t=Ni(t.rawUserInfo||"{}"))||{}))}function Br(t){if(Gr.call(this,t),"facebook.com"!=this.providerId)throw Error("Invalid provider ID!")}function Wr(t){if(Gr.call(this,t),"github.com"!=this.providerId)throw Error("Invalid provider ID!");Fi(this,"username",this.profile&&this.profile.login||null)}function Xr(t){if(Gr.call(this,t),"google.com"!=this.providerId)throw Error("Invalid provider ID!")}function Jr(t){if(Gr.call(this,t),"twitter.com"!=this.providerId)throw Error("Invalid provider ID!");Fi(this,"username",t.screenName||null)}function Yr(t){var e=On(i=Cn(t),"link"),n=On(Cn(e),"link"),i=On(i,"deep_link_id");return On(Cn(i),"link")||i||n||e||t}function zr(t,e){if(!t&&!e)throw new T("internal-error","Internal assert: no raw session string available");if(t&&e)throw new T("internal-error","Internal assert: unable to determine the session type");this.a=t||null,this.b=e||null,this.type=this.a?$r:Zr}w(Gr,Kr),w(Br,Gr),w(Wr,Gr),w(Xr,Gr),w(Jr,Gr);var $r="enroll",Zr="signin";function Qr(){}function to(t,n){return t.then(function(t){if(t[Ka]){var e=Lr(t[Ka]);if(!e||n!=e.i)throw new T("user-mismatch");return t}throw new T("user-mismatch")}).o(function(t){throw t&&t.code&&t.code==k+"user-not-found"?new T("user-mismatch"):t})}function eo(t,e){if(!e)throw new T("internal-error","failed to construct a credential");this.a=e,Fi(this,"providerId",t),Fi(this,"signInMethod",t)}function no(t){return{pendingToken:t.a,requestUri:"http://localhost"}}function io(t){if(t&&t.providerId&&t.signInMethod&&0==t.providerId.indexOf("saml.")&&t.pendingToken)try{return new eo(t.providerId,t.pendingToken)}catch(t){}return null}function ro(t,e,n){if(this.a=null,e.idToken||e.accessToken)e.idToken&&Fi(this,"idToken",e.idToken),e.accessToken&&Fi(this,"accessToken",e.accessToken),e.nonce&&!e.pendingToken&&Fi(this,"nonce",e.nonce),e.pendingToken&&(this.a=e.pendingToken);else{if(!e.oauthToken||!e.oauthTokenSecret)throw new T("internal-error","failed to construct a credential");Fi(this,"accessToken",e.oauthToken),Fi(this,"secret",e.oauthTokenSecret)}Fi(this,"providerId",t),Fi(this,"signInMethod",n)}function oo(t){var e={};return t.idToken&&(e.id_token=t.idToken),t.accessToken&&(e.access_token=t.accessToken),t.secret&&(e.oauth_token_secret=t.secret),e.providerId=t.providerId,t.nonce&&!t.a&&(e.nonce=t.nonce),e={postBody:Hn(e).toString(),requestUri:"http://localhost"},t.a&&(delete e.postBody,e.pendingToken=t.a),e}function ao(t){if(t&&t.providerId&&t.signInMethod){var e={idToken:t.oauthIdToken,accessToken:t.oauthTokenSecret?null:t.oauthAccessToken,oauthTokenSecret:t.oauthTokenSecret,oauthToken:t.oauthTokenSecret&&t.oauthAccessToken,nonce:t.nonce,pendingToken:t.pendingToken};try{return new ro(t.providerId,e,t.signInMethod)}catch(t){}}return null}function so(t,e){this.Qc=e||[],qi(this,{providerId:t,isOAuthProvider:!0}),this.Jb={},this.qb=(Vr(t)||{}).Ja||null,this.pb=null}function uo(t){if("string"!=typeof t||0!=t.indexOf("saml."))throw new T("argument-error",'SAML provider IDs must be prefixed with "saml."');so.call(this,t,[])}function co(t){so.call(this,t,jr),this.a=[]}function ho(){co.call(this,"facebook.com")}function lo(t){if(!t)throw new T("argument-error","credential failed: expected 1 argument (the OAuth access token).");var e=t;return m(t)&&(e=t.accessToken),(new ho).credential({accessToken:e})}function fo(){co.call(this,"github.com")}function po(t){if(!t)throw new T("argument-error","credential failed: expected 1 argument (the OAuth access token).");var e=t;return m(t)&&(e=t.accessToken),(new fo).credential({accessToken:e})}function vo(){co.call(this,"google.com"),this.Ca("profile")}function mo(t,e){var n=t;return m(t)&&(n=t.idToken,e=t.accessToken),(new vo).credential({idToken:n,accessToken:e})}function go(){so.call(this,"twitter.com",Mr)}function bo(t,e){var n=t;if(!(n=!m(n)?{oauthToken:t,oauthTokenSecret:e}:n).oauthToken||!n.oauthTokenSecret)throw new T("argument-error","credential failed: expected 2 arguments (the OAuth access token and secret).");return new ro("twitter.com",n,"twitter.com")}function yo(t,e,n){this.a=t,this.f=e,Fi(this,"providerId","password"),Fi(this,"signInMethod",n===Io.EMAIL_LINK_SIGN_IN_METHOD?Io.EMAIL_LINK_SIGN_IN_METHOD:Io.EMAIL_PASSWORD_SIGN_IN_METHOD)}function wo(t){return t&&t.email&&t.password?new yo(t.email,t.password,t.signInMethod):null}function Io(){qi(this,{providerId:"password",isOAuthProvider:!1})}function To(t,e){if(!(e=Eo(e)))throw new T("argument-error","Invalid email link!");return new yo(t,e.code,Io.EMAIL_LINK_SIGN_IN_METHOD)}function Eo(t){return(t=yr(t=Yr(t)))&&t.operation===Qi?t:null}function Ao(t){if(!(t.fb&&t.eb||t.La&&t.ea))throw new T("internal-error");this.a=t,Fi(this,"providerId","phone"),this.fa="phone",Fi(this,"signInMethod","phone")}function ko(e){if(e&&"phone"===e.providerId&&(e.verificationId&&e.verificationCode||e.temporaryProof&&e.phoneNumber)){var n={};return V(["verificationId","verificationCode","temporaryProof","phoneNumber"],function(t){e[t]&&(n[t]=e[t])}),new Ao(n)}return null}function So(t){return t.a.La&&t.a.ea?{temporaryProof:t.a.La,phoneNumber:t.a.ea}:{sessionInfo:t.a.fb,code:t.a.eb}}function No(t){try{this.a=t||Zl.default.auth()}catch(t){throw new T("argument-error","Either an instance of firebase.auth.Auth must be passed as an argument to the firebase.auth.PhoneAuthProvider constructor, or the default firebase App instance must be initialized via firebase.initializeApp().")}qi(this,{providerId:"phone",isOAuthProvider:!1})}function _o(t,e){if(!t)throw new T("missing-verification-id");if(!e)throw new T("missing-verification-code");return new Ao({fb:t,eb:e})}function Oo(t){if(t.temporaryProof&&t.phoneNumber)return new Ao({La:t.temporaryProof,ea:t.phoneNumber});var e=t&&t.providerId;if(!e||"password"===e)return null;var n=t&&t.oauthAccessToken,i=t&&t.oauthTokenSecret,r=t&&t.nonce,o=t&&t.oauthIdToken,a=t&&t.pendingToken;try{switch(e){case"google.com":return mo(o,n);case"facebook.com":return lo(n);case"github.com":return po(n);case"twitter.com":return bo(n,i);default:return n||i||o||a?a?0==e.indexOf("saml.")?new eo(e,a):new ro(e,{pendingToken:a,idToken:t.oauthIdToken,accessToken:t.oauthAccessToken},e):new co(e).credential({idToken:o,accessToken:n,rawNonce:r}):null}}catch(t){return null}}function Co(t){if(!t.isOAuthProvider)throw new T("invalid-oauth-provider")}function Ro(t,e,n,i,r,o,a){if(this.c=t,this.b=e||null,this.g=n||null,this.f=i||null,this.i=o||null,this.h=a||null,this.a=r||null,!this.g&&!this.a)throw new T("invalid-auth-event");if(this.g&&this.a)throw new T("invalid-auth-event");if(this.g&&!this.f)throw new T("invalid-auth-event")}function Do(t){return(t=t||{}).type?new Ro(t.type,t.eventId,t.urlResponse,t.sessionId,t.error&&E(t.error),t.postBody,t.tenantId):null}function Po(){this.b=null,this.a=[]}zr.prototype.Ha=function(){return this.a?ye(this.a):ye(this.b)},zr.prototype.w=function(){return this.type==$r?{multiFactorSession:{idToken:this.a}}:{multiFactorSession:{pendingCredential:this.b}}},Qr.prototype.ka=function(){},Qr.prototype.b=function(){},Qr.prototype.c=function(){},Qr.prototype.w=function(){},eo.prototype.ka=function(t){return ls(t,no(this))},eo.prototype.b=function(t,e){var n=no(this);return n.idToken=e,fs(t,n)},eo.prototype.c=function(t,e){return to(ds(t,no(this)),e)},eo.prototype.w=function(){return{providerId:this.providerId,signInMethod:this.signInMethod,pendingToken:this.a}},ro.prototype.ka=function(t){return ls(t,oo(this))},ro.prototype.b=function(t,e){var n=oo(this);return n.idToken=e,fs(t,n)},ro.prototype.c=function(t,e){return to(ds(t,oo(this)),e)},ro.prototype.w=function(){var t={providerId:this.providerId,signInMethod:this.signInMethod};return this.idToken&&(t.oauthIdToken=this.idToken),this.accessToken&&(t.oauthAccessToken=this.accessToken),this.secret&&(t.oauthTokenSecret=this.secret),this.nonce&&(t.nonce=this.nonce),this.a&&(t.pendingToken=this.a),t},so.prototype.Ka=function(t){return this.Jb=ct(t),this},w(uo,so),w(co,so),co.prototype.Ca=function(t){return K(this.a,t)||this.a.push(t),this},co.prototype.Rb=function(){return X(this.a)},co.prototype.credential=function(t,e){e=m(t)?{idToken:t.idToken||null,accessToken:t.accessToken||null,nonce:t.rawNonce||null}:{idToken:t||null,accessToken:e||null};if(!e.idToken&&!e.accessToken)throw new T("argument-error","credential failed: must provide the ID token and/or the access token.");return new ro(this.providerId,e,this.providerId)},w(ho,co),Fi(ho,"PROVIDER_ID","facebook.com"),Fi(ho,"FACEBOOK_SIGN_IN_METHOD","facebook.com"),w(fo,co),Fi(fo,"PROVIDER_ID","github.com"),Fi(fo,"GITHUB_SIGN_IN_METHOD","github.com"),w(vo,co),Fi(vo,"PROVIDER_ID","google.com"),Fi(vo,"GOOGLE_SIGN_IN_METHOD","google.com"),w(go,so),Fi(go,"PROVIDER_ID","twitter.com"),Fi(go,"TWITTER_SIGN_IN_METHOD","twitter.com"),yo.prototype.ka=function(t){return this.signInMethod==Io.EMAIL_LINK_SIGN_IN_METHOD?Js(t,Is,{email:this.a,oobCode:this.f}):Js(t,Ks,{email:this.a,password:this.f})},yo.prototype.b=function(t,e){return this.signInMethod==Io.EMAIL_LINK_SIGN_IN_METHOD?Js(t,Ts,{idToken:e,email:this.a,oobCode:this.f}):Js(t,xs,{idToken:e,email:this.a,password:this.f})},yo.prototype.c=function(t,e){return to(this.ka(t),e)},yo.prototype.w=function(){return{email:this.a,password:this.f,signInMethod:this.signInMethod}},qi(Io,{PROVIDER_ID:"password"}),qi(Io,{EMAIL_LINK_SIGN_IN_METHOD:"emailLink"}),qi(Io,{EMAIL_PASSWORD_SIGN_IN_METHOD:"password"}),Ao.prototype.ka=function(t){return t.gb(So(this))},Ao.prototype.b=function(t,e){var n=So(this);return n.idToken=e,Js(t,Bs,n)},Ao.prototype.c=function(t,e){var n=So(this);return n.operation="REAUTH",to(t=Js(t,Ws,n),e)},Ao.prototype.w=function(){var t={providerId:"phone"};return this.a.fb&&(t.verificationId=this.a.fb),this.a.eb&&(t.verificationCode=this.a.eb),this.a.La&&(t.temporaryProof=this.a.La),this.a.ea&&(t.phoneNumber=this.a.ea),t},No.prototype.gb=function(i,r){var o=this.a.a;return ye(r.verify()).then(function(e){if("string"!=typeof e)throw new T("argument-error","An implementation of firebase.auth.ApplicationVerifier.prototype.verify() must return a firebase.Promise that resolves with a string.");if("recaptcha"!==r.type)throw new T("argument-error",'Only firebase.auth.ApplicationVerifiers with type="recaptcha" are currently supported.');var t=m(i)?i.session:null,n=m(i)?i.phoneNumber:i,t=t&&t.type==$r?t.Ha().then(function(t){return Js(o,js,{idToken:t,phoneEnrollmentInfo:{phoneNumber:n,recaptchaToken:e}}).then(function(t){return t.phoneSessionInfo.sessionInfo})}):t&&t.type==Zr?t.Ha().then(function(t){return t={mfaPendingCredential:t,mfaEnrollmentId:i.multiFactorHint&&i.multiFactorHint.uid||i.multiFactorUid,phoneSignInInfo:{recaptchaToken:e}},Js(o,Us,t).then(function(t){return t.phoneResponseInfo.sessionInfo})}):Js(o,Ps,{phoneNumber:n,recaptchaToken:e});return t.then(function(t){return"function"==typeof r.reset&&r.reset(),t},function(t){throw"function"==typeof r.reset&&r.reset(),t})})},qi(No,{PROVIDER_ID:"phone"}),qi(No,{PHONE_SIGN_IN_METHOD:"phone"}),Ro.prototype.getUid=function(){var t=[];return t.push(this.c),this.b&&t.push(this.b),this.f&&t.push(this.f),this.h&&t.push(this.h),t.join("-")},Ro.prototype.T=function(){return this.h},Ro.prototype.w=function(){return{type:this.c,eventId:this.b,urlResponse:this.g,sessionId:this.f,postBody:this.i,tenantId:this.h,error:this.a&&this.a.w()}};var Lo,xo=null;function Mo(t){var e="unauthorized-domain",n=void 0,i=Cn(t);t=i.a,"chrome-extension"==(i=i.c)?n=jt("This chrome extension ID (chrome-extension://%s) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.",t):"http"==i||"https"==i?n=jt("This domain (%s) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.",t):e="operation-not-supported-in-this-environment",T.call(this,e,n)}function jo(t,e,n){T.call(this,t,n),(t=e||{}).Kb&&Fi(this,"email",t.Kb),t.ea&&Fi(this,"phoneNumber",t.ea),t.credential&&Fi(this,"credential",t.credential),t.$b&&Fi(this,"tenantId",t.$b)}function Uo(t){if(t.code){var e=t.code||"";0==e.indexOf(k)&&(e=e.substring(k.length));var n={credential:Oo(t),$b:t.tenantId};if(t.email)n.Kb=t.email;else if(t.phoneNumber)n.ea=t.phoneNumber;else if(!n.credential)return new T(e,t.message||void 0);return new jo(e,n,t.message)}return null}function Vo(){}function Fo(t){return t.c||(t.c=t.b())}function qo(){}function Ho(t){if(t.f||"undefined"!=typeof XMLHttpRequest||"undefined"==typeof ActiveXObject)return t.f;for(var e=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],n=0;n=function t(e){return e.c||(e.a?t(e.a):(D("Root logger has no level set."),null))}(this).value)for(v(e)&&(e=e()),t=new Wo(t,String(e),this.f),n&&(t.a=n),n=this;n;)n=n.a};var Qo,ta={},ea=null;function na(t){var e,n,i;return ea||(ea=new Xo(""),(ta[""]=ea).c=$o),(e=ta[t])||(e=new Xo(t),i=t.lastIndexOf("."),n=t.substr(i+1),(i=na(t.substr(0,i))).b||(i.b={}),(i.b[n]=e).a=i,ta[t]=e),e}function ia(t,e){t&&t.log(Zo,e,void 0)}function ra(t){this.f=t}function oa(t){fn.call(this),this.u=t,this.h=void 0,this.readyState=aa,this.status=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.l=new Headers,this.b=null,this.s="GET",this.f="",this.a=!1,this.i=na("goog.net.FetchXmlHttp"),this.m=this.c=this.g=null}w(ra,Vo),ra.prototype.a=function(){return new oa(this.f)},ra.prototype.b=(Qo={},function(){return Qo}),w(oa,fn);var aa=0;function sa(t){t.c.read().then(t.pc.bind(t)).catch(t.Va.bind(t))}function ua(t){t.readyState=4,t.g=null,t.c=null,t.m=null,ca(t)}function ca(t){t.onreadystatechange&&t.onreadystatechange.call(t)}function ha(t){fn.call(this),this.headers=new wn,this.D=t||null,this.c=!1,this.C=this.a=null,this.h=this.P=this.l="",this.f=this.N=this.i=this.J=!1,this.g=0,this.s=null,this.m=la,this.u=this.S=!1}(t=oa.prototype).open=function(t,e){if(this.readyState!=aa)throw this.abort(),Error("Error reopening a connection");this.s=t,this.f=e,this.readyState=1,ca(this)},t.send=function(t){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.a=!0;var e={headers:this.l,method:this.s,credentials:this.h,cache:void 0};t&&(e.body=t),this.u.fetch(new Request(this.f,e)).then(this.uc.bind(this),this.Va.bind(this))},t.abort=function(){this.response=this.responseText="",this.l=new Headers,this.status=0,this.c&&this.c.cancel("Request was aborted."),1<=this.readyState&&this.a&&4!=this.readyState&&(this.a=!1,ua(this)),this.readyState=aa},t.uc=function(t){this.a&&(this.g=t,this.b||(this.status=this.g.status,this.statusText=this.g.statusText,this.b=t.headers,this.readyState=2,ca(this)),this.a&&(this.readyState=3,ca(this),this.a&&("arraybuffer"===this.responseType?t.arrayBuffer().then(this.sc.bind(this),this.Va.bind(this)):void 0!==l.ReadableStream&&"body"in t?(this.response=this.responseText="",this.c=t.body.getReader(),this.m=new TextDecoder,sa(this)):t.text().then(this.tc.bind(this),this.Va.bind(this)))))},t.pc=function(t){var e;this.a&&((e=this.m.decode(t.value||new Uint8Array(0),{stream:!t.done}))&&(this.response=this.responseText+=e),(t.done?ua:ca)(this),3==this.readyState&&sa(this))},t.tc=function(t){this.a&&(this.response=this.responseText=t,ua(this))},t.sc=function(t){this.a&&(this.response=t,ua(this))},t.Va=function(t){var e=this.i;e&&e.log(zo,"Failed to fetch url "+this.f,t instanceof Error?t:Error(t)),this.a&&ua(this)},t.setRequestHeader=function(t,e){this.l.append(t,e)},t.getResponseHeader=function(t){return this.b?this.b.get(t.toLowerCase())||"":((t=this.i)&&t.log(zo,"Attempting to get response header but no headers have been received for url: "+this.f,void 0),"")},t.getAllResponseHeaders=function(){if(!this.b){var t=this.i;return t&&t.log(zo,"Attempting to get all response headers but no headers have been received for url: "+this.f,void 0),""}for(var t=[],e=this.b.entries(),n=e.next();!n.done;)n=n.value,t.push(n[0]+": "+n[1]),n=e.next();return t.join("\r\n")},Object.defineProperty(oa.prototype,"withCredentials",{get:function(){return"include"===this.h},set:function(t){this.h=t?"include":"same-origin"}}),w(ha,fn);var la="";ha.prototype.b=na("goog.net.XhrIo");var fa=/^https?$/i,da=["POST","PUT"];function pa(e,t,n,i,r){if(e.a)throw Error("[goog.net.XhrIo] Object is active with another request="+e.l+"; newUri="+t);n=n?n.toUpperCase():"GET",e.l=t,e.h="",e.P=n,e.J=!1,e.c=!0,e.a=(e.D||Lo).a(),e.C=e.D?Fo(e.D):Fo(Lo),e.a.onreadystatechange=b(e.Wb,e);try{ia(e.b,Ea(e,"Opening Xhr")),e.N=!0,e.a.open(n,String(t),!0),e.N=!1}catch(t){return ia(e.b,Ea(e,"Error opening Xhr: "+t.message)),void ma(e,t)}t=i||"";var o,a=new wn(e.headers);r&&function(t,e){if(t.forEach&&"function"==typeof t.forEach)t.forEach(e,void 0);else if(p(t)||"string"==typeof t)V(t,e,void 0);else for(var n=yn(t),i=bn(t),r=i.length,o=0;o>>7|r<<25)^(r>>>18|r<<14)^r>>>3)|0,a=(0|n[e-7])+((i>>>17|i<<15)^(i>>>19|i<<13)^i>>>10)|0;n[e]=o+a|0}i=0|t.a[0],r=0|t.a[1];var s=0|t.a[2],u=0|t.a[3],c=0|t.a[4],h=0|t.a[5],l=0|t.a[6];for(o=0|t.a[7],e=0;e<64;e++){var f=((i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10))+(i&r^i&s^r&s)|0;a=(o=o+((c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7))|0)+((a=(a=c&h^~c&l)+(0|Zu[e])|0)+(0|n[e])|0)|0,o=l,l=h,h=c,c=u+a|0,u=s,s=r,r=i,i=a+f|0}t.a[0]=t.a[0]+i|0,t.a[1]=t.a[1]+r|0,t.a[2]=t.a[2]+s|0,t.a[3]=t.a[3]+u|0,t.a[4]=t.a[4]+c|0,t.a[5]=t.a[5]+h|0,t.a[6]=t.a[6]+l|0,t.a[7]=t.a[7]+o|0}function uc(t,e,n){void 0===n&&(n=e.length);var i=0,r=t.c;if("string"==typeof e)for(;i>r&255;return q(t,function(t){return 1<(t=t.toString(16)).length?t:"0"+t}).join("")}function vc(t,e){for(var n=0;nt.f&&(t.a=t.f),e)}function oh(t){this.f=t,this.b=this.a=null,this.c=Date.now()}function ah(t,e){void 0===e&&(e=t.b?(e=t.b).a-e.g:0),t.c=Date.now()+1e3*e}function sh(t,e){t.b=Lr(e[Ka]||""),t.a=e.refreshToken,ah(t,void 0!==(e=e.expiresIn)?Number(e):void 0)}function uh(e,t){return i=e.f,r=t,new fe(function(e,n){"refresh_token"==r.grant_type&&r.refresh_token||"authorization_code"==r.grant_type&&r.code?Za(i,i.l+"?key="+encodeURIComponent(i.c),function(t){t?t.error?n(zs(t)):t.access_token&&t.refresh_token?e(t):n(new T("internal-error")):n(new T("network-request-failed"))},"POST",Hn(r).toString(),i.g,i.m.get()):n(new T("internal-error"))}).then(function(t){return e.b=Lr(t.access_token),e.a=t.refresh_token,ah(e,t.expires_in),{accessToken:e.b.toString(),refreshToken:e.a}}).o(function(t){throw"auth/user-token-expired"==t.code&&(e.a=null),t});var i,r}function ch(t,e){this.a=t||null,this.b=e||null,qi(this,{lastSignInTime:Li(e||null),creationTime:Li(t||null)})}function hh(t,e,n,i,r,o){qi(this,{uid:t,displayName:i||null,photoURL:r||null,email:n||null,phoneNumber:o||null,providerId:e})}function lh(t,e,n){this.N=[],this.l=t.apiKey,this.m=t.appName,this.s=t.authDomain||null;var i,r=Zl.default.SDK_VERSION?gi(Zl.default.SDK_VERSION):null;this.a=new qa(this.l,_(A),r),(this.u=t.emulatorConfig||null)&&Ya(this.a,this.u),this.h=new oh(this.a),wh(this,e[Ka]),sh(this.h,e),Fi(this,"refreshToken",this.h.a),Eh(this,n||{}),fn.call(this),this.P=!1,this.s&&Ii()&&(this.b=xc(this.s,this.l,this.m,this.u)),this.W=[],this.i=null,this.D=(i=this,new ih(function(){return i.I(!0)},function(t){return!(!t||"auth/network-request-failed"!=t.code)},function(){var t=i.h.c-Date.now()-3e5;return 0this.c-3e4?this.a?uh(this,{grant_type:"refresh_token",refresh_token:this.a}):ye(null):ye({accessToken:this.b.toString(),refreshToken:this.a})},ch.prototype.w=function(){return{lastLoginAt:this.b,createdAt:this.a}},w(lh,fn),lh.prototype.xa=function(t){this.za=t,Ja(this.a,t)},lh.prototype.la=function(){return this.za},lh.prototype.Ga=function(){return X(this.aa)},lh.prototype.ib=function(){this.D.b&&(this.D.stop(),this.D.start())},Fi(lh.prototype,"providerId","firebase"),(t=lh.prototype).reload=function(){var t=this;return Vh(this,kh(this).then(function(){return Rh(t).then(function(){return Ih(t)}).then(Ah)}))},t.oc=function(t){return this.I(t).then(function(t){return new Bc(t)})},t.I=function(t){var e=this;return Vh(this,kh(this).then(function(){return e.h.getToken(t)}).then(function(t){if(!t)throw new T("internal-error");return t.accessToken!=e.Aa&&(wh(e,t.accessToken),e.dispatchEvent(new th("tokenChanged"))),Oh(e,"refreshToken",t.refreshToken),t.accessToken}))},t.Kc=function(t){if(!(t=t.users)||!t.length)throw new T("internal-error");Eh(this,{uid:(t=t[0]).localId,displayName:t.displayName,photoURL:t.photoUrl,email:t.email,emailVerified:!!t.emailVerified,phoneNumber:t.phoneNumber,lastLoginAt:t.lastLoginAt,createdAt:t.createdAt,tenantId:t.tenantId});for(var e,n=(e=(e=t).providerUserInfo)&&e.length?q(e,function(t){return new hh(t.rawId,t.providerId,t.email,t.displayName,t.photoUrl,t.phoneNumber)}):[],i=0;i=xl.length)throw new T("internal-error","Argument validator received an unsupported number of arguments.");n=xl[r],i=(i?"":n+" argument ")+(e.name?'"'+e.name+'" ':"")+"must be "+e.K+".";break t}i=null}}if(i)throw new T("argument-error",t+" failed: "+i)}(t=kl.prototype).Ia=function(){var e=this;return this.f||(this.f=Rl(this,ye().then(function(){if(Ti()&&!hi())return si();throw new T("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment.")}).then(function(){return e.m.g(e.u())}).then(function(t){return e.g=t,Js(e.s,Rs,{})}).then(function(t){e.a[_l]=t.recaptchaSiteKey}).o(function(t){throw e.f=null,t})))},t.render=function(){Dl(this);var n=this;return Rl(this,this.Ia().then(function(){var t,e;return null===n.c&&(e=n.v,n.i||(t=te(e),e=oe("DIV"),t.appendChild(e)),n.c=n.g.render(e,n.a)),n.c}))},t.verify=function(){Dl(this);var r=this;return Rl(this,this.render().then(function(e){return new fe(function(n){var i,t=r.g.getResponse(e);t?n(t):(r.l.push(i=function(t){var e;t&&(e=i,B(r.l,function(t){return t==e}),n(t))}),r.i&&r.g.execute(r.c))})}))},t.reset=function(){Dl(this),null!==this.c&&this.g.reset(this.c)},t.clear=function(){Dl(this),this.J=!0,this.m.c();for(var t,e=0;es[0]&&e[1]>6|192:(55296==(64512&i)&&r+1>18|240,e[n++]=i>>12&63|128):e[n++]=i>>12|224,e[n++]=i>>6&63|128),e[n++]=63&i|128)}return e}function u(t){return function(t){t=i(t);return o.encodeByteArray(t,!0)}(t).replace(/\./g,"")}var o={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray:function(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();for(var n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[],i=0;i>6,c=63&c;u||(c=64,s||(h=64)),r.push(n[o>>2],n[(3&o)<<4|a>>4],n[h],n[c])}return r.join("")},encodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(i(t),e)},decodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):function(t){for(var e=[],n=0,r=0;n>10)),e[r++]=String.fromCharCode(56320+(1023&i))):(o=t[n++],s=t[n++],e[r++]=String.fromCharCode((15&a)<<12|(63&o)<<6|63&s))}return e.join("")}(this.decodeStringToByteArray(t,e))},decodeStringToByteArray:function(t,e){this.init_();for(var n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[],i=0;i>4),64!==a&&(r.push(s<<4&240|a>>2),64!==u&&r.push(a<<6&192|u))}return r},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var t=0;t=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}};function h(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function c(){return!function(){try{return"[object process]"===Object.prototype.toString.call(global.process)}catch(t){return}}()&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}var l,f="FirebaseError",d=(n(p,l=Error),p);function p(t,e,n){e=l.call(this,e)||this;return e.code=t,e.customData=n,e.name=f,Object.setPrototypeOf(e,p.prototype),Error.captureStackTrace&&Error.captureStackTrace(e,m.prototype.create),e}var m=(v.prototype.create=function(t){for(var e=[],n=1;n"})):"Error",t=this.serviceName+": "+t+" ("+o+").";return new d(o,t,i)},v);function v(t,e,n){this.service=t,this.serviceName=e,this.errors=n}var w,b=/\{\$([^}]+)}/g;function E(t){return t&&t._delegate?t._delegate:t}(k=w=w||{})[k.DEBUG=0]="DEBUG",k[k.VERBOSE=1]="VERBOSE",k[k.INFO=2]="INFO",k[k.WARN=3]="WARN",k[k.ERROR=4]="ERROR",k[k.SILENT=5]="SILENT";function T(t,e){for(var n=[],r=2;r=t.length?void 0:t)&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}var k,R="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},x={},O=R||self;function L(){}function P(t){var e=typeof t;return"array"==(e="object"!=e?e:t?Array.isArray(t)?"array":e:"null")||"object"==e&&"number"==typeof t.length}function M(t){var e=typeof t;return"object"==e&&null!=t||"function"==e}var F="closure_uid_"+(1e9*Math.random()>>>0),V=0;function U(t,e,n){return t.call.apply(t.bind,arguments)}function q(e,n,t){if(!e)throw Error();if(2parseFloat(yt)){at=String(gt);break t}}at=yt}var mt={};function vt(){return t=function(){for(var t=0,e=J(String(at)).split("."),n=J("9").split("."),r=Math.max(e.length,n.length),i=0;0==t&&i>>0);function qt(e){return"function"==typeof e?e:(e[Ut]||(e[Ut]=function(t){return e.handleEvent(t)}),e[Ut])}function Bt(){G.call(this),this.i=new Nt(this),(this.P=this).I=null}function jt(t,e){var n,r=t.I;if(r)for(n=[];r;r=r.I)n.push(r);if(t=t.P,r=e.type||e,"string"==typeof e?e=new Et(e,t):e instanceof Et?e.target=e.target||t:(s=e,ot(e=new Et(r,t),s)),s=!0,n)for(var i=n.length-1;0<=i;i--)var o=e.g=n[i],s=Kt(o,r,!0,e)&&s;if(s=Kt(o=e.g=t,r,!0,e)&&s,s=Kt(o,r,!1,e)&&s,n)for(i=0;io.length?Pe:(o=o.substr(a,s),i.C=a+s,o)))==Pe){4==e&&(t.o=4,be(14),u=!1),de(t.j,t.m,null,"[Incomplete Response]");break}if(r==Le){t.o=4,be(15),de(t.j,t.m,n,"[Invalid Chunk]"),u=!1;break}de(t.j,t.m,r,null),Qe(t,r)}Ve(t)&&r!=Pe&&r!=Le&&(t.h.g="",t.C=0),4!=e||0!=n.length||t.h.h||(t.o=1,be(16),u=!1),t.i=t.i&&u,u?0>4&15).toString(16)+(15&t).toString(16)}$e.prototype.toString=function(){var t=[],e=this.j;e&&t.push(an(e,cn,!0),":");var n=this.i;return!n&&"file"!=e||(t.push("//"),(e=this.s)&&t.push(an(e,cn,!0),"@"),t.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.m)&&t.push(":",String(n))),(n=this.l)&&(this.i&&"/"!=n.charAt(0)&&t.push("/"),t.push(an(n,"/"==n.charAt(0)?ln:hn,!0))),(n=this.h.toString())&&t.push("?",n),(n=this.o)&&t.push("#",an(n,dn)),t.join("")};var cn=/[#\/\?@]/g,hn=/[#\?:]/g,ln=/[#\?]/g,fn=/[#\?@]/g,dn=/#/g;function pn(t,e){this.h=this.g=null,this.i=t||null,this.j=!!e}function yn(n){n.g||(n.g=new ze,n.h=0,n.i&&function(t,e){if(t){t=t.split("&");for(var n=0;n2*t.i&&We(t)))}function mn(t,e){return yn(t),e=wn(t,e),Ye(t.g.h,e)}function vn(t,e,n){gn(t,e),0=t.j}function Sn(t){return t.h?1:t.g?t.g.size:0}function An(t,e){return t.h?t.h==e:t.g&&t.g.has(e)}function Dn(t,e){t.g?t.g.add(e):t.h=e}function Nn(t,e){t.h&&t.h==e?t.h=null:t.g&&t.g.has(e)&&t.g.delete(e)}function Cn(t){var e,n;if(null!=t.h)return t.i.concat(t.h.D);if(null==t.g||0===t.g.size)return Y(t.i);var r=t.i;try{for(var i=C(t.g.values()),o=i.next();!o.done;o=i.next())var s=o.value,r=r.concat(s.D)}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}function kn(){}function Rn(){this.g=new kn}function xn(t,e,n,r,i){try{e.onload=null,e.onerror=null,e.onabort=null,e.ontimeout=null,i(r)}catch(t){}}function On(t){this.l=t.$b||null,this.j=t.ib||!1}function Ln(t,e){Bt.call(this),this.D=t,this.u=e,this.m=void 0,this.readyState=Pn,this.status=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.v=new Headers,this.h=null,this.C="GET",this.B="",this.g=!1,this.A=this.j=this.l=null}En.prototype.cancel=function(){var e,t;if(this.i=Cn(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){try{for(var n=C(this.g.values()),r=n.next();!r.done;r=n.next())r.value.cancel()}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}this.g.clear()}},kn.prototype.stringify=function(t){return O.JSON.stringify(t,void 0)},kn.prototype.parse=function(t){return O.JSON.parse(t,void 0)},K(On,_e),On.prototype.g=function(){return new Ln(this.l,this.j)},On.prototype.i=(Tn={},function(){return Tn}),K(Ln,Bt);var Pn=0;function Mn(t){t.j.read().then(t.Sa.bind(t)).catch(t.ha.bind(t))}function Fn(t){t.readyState=4,t.l=null,t.j=null,t.A=null,Vn(t)}function Vn(t){t.onreadystatechange&&t.onreadystatechange.call(t)}(k=Ln.prototype).open=function(t,e){if(this.readyState!=Pn)throw this.abort(),Error("Error reopening a connection");this.C=t,this.B=e,this.readyState=1,Vn(this)},k.send=function(t){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.g=!0;var e={headers:this.v,method:this.C,credentials:this.m,cache:void 0};t&&(e.body=t),(this.D||O).fetch(new Request(this.B,e)).then(this.Va.bind(this),this.ha.bind(this))},k.abort=function(){this.response=this.responseText="",this.v=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted."),1<=this.readyState&&this.g&&4!=this.readyState&&(this.g=!1,Fn(this)),this.readyState=Pn},k.Va=function(t){if(this.g&&(this.l=t,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=t.headers,this.readyState=2,Vn(this)),this.g&&(this.readyState=3,Vn(this),this.g)))if("arraybuffer"===this.responseType)t.arrayBuffer().then(this.Ta.bind(this),this.ha.bind(this));else if(void 0!==O.ReadableStream&&"body"in t){if(this.j=t.body.getReader(),this.u){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.A=new TextDecoder;Mn(this)}else t.text().then(this.Ua.bind(this),this.ha.bind(this))},k.Sa=function(t){var e;this.g&&(this.u&&t.value?this.response.push(t.value):this.u||(e=t.value||new Uint8Array(0),(e=this.A.decode(e,{stream:!t.done}))&&(this.response=this.responseText+=e)),(t.done?Fn:Vn)(this),3==this.readyState&&Mn(this))},k.Ua=function(t){this.g&&(this.response=this.responseText=t,Fn(this))},k.Ta=function(t){this.g&&(this.response=t,Fn(this))},k.ha=function(){this.g&&Fn(this)},k.setRequestHeader=function(t,e){this.v.append(t,e)},k.getResponseHeader=function(t){return this.h&&this.h.get(t.toLowerCase())||""},k.getAllResponseHeaders=function(){if(!this.h)return"";for(var t=[],e=this.h.entries(),n=e.next();!n.done;)n=n.value,t.push(n[0]+": "+n[1]),n=e.next();return t.join("\r\n")},Object.defineProperty(Ln.prototype,"withCredentials",{get:function(){return"include"===this.m},set:function(t){this.m=t?"include":"same-origin"}});var Un=O.JSON.parse;function qn(t){Bt.call(this),this.headers=new ze,this.u=t||null,this.h=!1,this.C=this.g=null,this.H="",this.m=0,this.j="",this.l=this.F=this.v=this.D=!1,this.B=0,this.A=null,this.J=Bn,this.K=this.L=!1}K(qn,Bt);var Bn="",jn=/^https?$/i,Kn=["POST","PUT"];function Gn(t){return"content-type"==t.toLowerCase()}function Qn(t,e){t.h=!1,t.g&&(t.l=!0,t.g.abort(),t.l=!1),t.j=e,t.m=5,Hn(t),Wn(t)}function Hn(t){t.D||(t.D=!0,jt(t,"complete"),jt(t,"error"))}function zn(t){if(t.h&&void 0!==x&&(!t.C[1]||4!=Xn(t)||2!=t.ba()))if(t.v&&4==Xn(t))ie(t.Fa,0,t);else if(jt(t,"readystatechange"),4==Xn(t)){t.h=!1;try{var e,n,r,i,o=t.ba();t:switch(o){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var s=!0;break t;default:s=!1}if((e=s)||((n=0===o)&&(!(i=String(t.H).match(Xe)[1]||null)&&O.self&&O.self.location&&(i=(r=O.self.location.protocol).substr(0,r.length-1)),n=!jn.test(i?i.toLowerCase():"")),e=n),e)jt(t,"complete"),jt(t,"success");else{t.m=6;try{var a=2=r.i.j-(r.m?1:0)||(r.m?(r.l=i.D.concat(r.l),0):1==r.G||2==r.G||r.C>=(r.Xa?0:r.Ya)||(r.m=Te(B(r.Ha,r,i),yr(r,r.C)),r.C++,0))))&&(2!=s||!hr(t)))switch(o&&0e.length?1:0},vi),ci=(n(mi,ui=R),mi.prototype.construct=function(t,e,n){return new mi(t,e,n)},mi.prototype.canonicalString=function(){return this.toArray().join("/")},mi.prototype.toString=function(){return this.canonicalString()},mi.fromString=function(){for(var t=[],e=0;et.length&&zr(),void 0===n?n=t.length-e:n>t.length-e&&zr(),this.segments=t,this.offset=e,this.len=n}di.EMPTY_BYTE_STRING=new di("");var wi=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function bi(t){if(Wr(!!t),"string"!=typeof t)return{seconds:Ei(t.seconds),nanos:Ei(t.nanos)};var e=0,n=wi.exec(t);Wr(!!n),n[1]&&(n=((n=n[1])+"000000000").substr(0,9),e=Number(n));t=new Date(t);return{seconds:Math.floor(t.getTime()/1e3),nanos:e}}function Ei(t){return"number"==typeof t?t:"string"==typeof t?Number(t):0}function Ti(t){return"string"==typeof t?di.fromBase64String(t):di.fromUint8Array(t)}function Ii(t){return"server_timestamp"===(null===(t=((null===(t=null==t?void 0:t.mapValue)||void 0===t?void 0:t.fields)||{}).__type__)||void 0===t?void 0:t.stringValue)}function _i(t){t=bi(t.mapValue.fields.__local_write_time__.timestampValue);return new ti(t.seconds,t.nanos)}function Si(t){return null==t}function Ai(t){return 0===t&&1/t==-1/0}function Di(t){return"number"==typeof t&&Number.isInteger(t)&&!Ai(t)&&t<=Number.MAX_SAFE_INTEGER&&t>=Number.MIN_SAFE_INTEGER}var Ni=(Ci.fromPath=function(t){return new Ci(ci.fromString(t))},Ci.fromName=function(t){return new Ci(ci.fromString(t).popFirst(5))},Ci.prototype.hasCollectionId=function(t){return 2<=this.path.length&&this.path.get(this.path.length-2)===t},Ci.prototype.isEqual=function(t){return null!==t&&0===ci.comparator(this.path,t.path)},Ci.prototype.toString=function(){return this.path.toString()},Ci.comparator=function(t,e){return ci.comparator(t.path,e.path)},Ci.isDocumentKey=function(t){return t.length%2==0},Ci.fromSegments=function(t){return new Ci(new ci(t.slice()))},Ci);function Ci(t){this.path=t}function ki(t){return"nullValue"in t?0:"booleanValue"in t?1:"integerValue"in t||"doubleValue"in t?2:"timestampValue"in t?3:"stringValue"in t?5:"bytesValue"in t?6:"referenceValue"in t?7:"geoPointValue"in t?8:"arrayValue"in t?9:"mapValue"in t?Ii(t)?4:10:zr()}function Ri(r,i){var t,e,n=ki(r);if(n!==ki(i))return!1;switch(n){case 0:return!0;case 1:return r.booleanValue===i.booleanValue;case 4:return _i(r).isEqual(_i(i));case 3:return function(t){if("string"==typeof r.timestampValue&&"string"==typeof t.timestampValue&&r.timestampValue.length===t.timestampValue.length)return r.timestampValue===t.timestampValue;var e=bi(r.timestampValue),t=bi(t.timestampValue);return e.seconds===t.seconds&&e.nanos===t.nanos}(i);case 5:return r.stringValue===i.stringValue;case 6:return e=i,Ti(r.bytesValue).isEqual(Ti(e.bytesValue));case 7:return r.referenceValue===i.referenceValue;case 8:return t=i,Ei((e=r).geoPointValue.latitude)===Ei(t.geoPointValue.latitude)&&Ei(e.geoPointValue.longitude)===Ei(t.geoPointValue.longitude);case 2:return function(t,e){if("integerValue"in t&&"integerValue"in e)return Ei(t.integerValue)===Ei(e.integerValue);if("doubleValue"in t&&"doubleValue"in e){t=Ei(t.doubleValue),e=Ei(e.doubleValue);return t===e?Ai(t)===Ai(e):isNaN(t)&&isNaN(e)}return!1}(r,i);case 9:return Jr(r.arrayValue.values||[],i.arrayValue.values||[],Ri);case 10:return function(){var t,e=r.mapValue.fields||{},n=i.mapValue.fields||{};if(ii(e)!==ii(n))return!1;for(t in e)if(e.hasOwnProperty(t)&&(void 0===n[t]||!Ri(e[t],n[t])))return!1;return!0}();default:return zr()}}function xi(t,e){return void 0!==(t.values||[]).find(function(t){return Ri(t,e)})}function Oi(t,e){var n,r,i,o=ki(t),s=ki(e);if(o!==s)return $r(o,s);switch(o){case 0:return 0;case 1:return $r(t.booleanValue,e.booleanValue);case 2:return r=e,i=Ei(t.integerValue||t.doubleValue),r=Ei(r.integerValue||r.doubleValue),i":return 0=":return 0<=t;default:return zr()}},to.prototype.g=function(){return 0<=["<","<=",">",">=","!=","not-in"].indexOf(this.op)},to);function to(t,e,n){var r=this;return(r=Ji.call(this)||this).field=t,r.op=e,r.value=n,r}var eo,no,ro,io=(n(co,ro=Zi),co.prototype.matches=function(t){t=Ni.comparator(t.key,this.key);return this.m(t)},co),oo=(n(uo,no=Zi),uo.prototype.matches=function(e){return this.keys.some(function(t){return t.isEqual(e.key)})},uo),so=(n(ao,eo=Zi),ao.prototype.matches=function(e){return!this.keys.some(function(t){return t.isEqual(e.key)})},ao);function ao(t,e){var n=this;return(n=eo.call(this,t,"not-in",e)||this).keys=ho(0,e),n}function uo(t,e){var n=this;return(n=no.call(this,t,"in",e)||this).keys=ho(0,e),n}function co(t,e,n){var r=this;return(r=ro.call(this,t,e,n)||this).key=Ni.fromName(n.referenceValue),r}function ho(t,e){return((null===(e=e.arrayValue)||void 0===e?void 0:e.values)||[]).map(function(t){return Ni.fromName(t.referenceValue)})}var lo,fo,po,yo,go=(n(_o,yo=Zi),_o.prototype.matches=function(t){t=t.data.field(this.field);return Vi(t)&&xi(t.arrayValue,this.value)},_o),mo=(n(Io,po=Zi),Io.prototype.matches=function(t){t=t.data.field(this.field);return null!==t&&xi(this.value.arrayValue,t)},Io),vo=(n(To,fo=Zi),To.prototype.matches=function(t){if(xi(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;t=t.data.field(this.field);return null!==t&&!xi(this.value.arrayValue,t)},To),wo=(n(Eo,lo=Zi),Eo.prototype.matches=function(t){var e=this,t=t.data.field(this.field);return!(!Vi(t)||!t.arrayValue.values)&&t.arrayValue.values.some(function(t){return xi(e.value.arrayValue,t)})},Eo),bo=function(t,e){this.position=t,this.before=e};function Eo(t,e){return lo.call(this,t,"array-contains-any",e)||this}function To(t,e){return fo.call(this,t,"not-in",e)||this}function Io(t,e){return po.call(this,t,"in",e)||this}function _o(t,e){return yo.call(this,t,"array-contains",e)||this}function So(t){return(t.before?"b":"a")+":"+t.position.map(Pi).join(",")}var Ao=function(t,e){void 0===e&&(e="asc"),this.field=t,this.dir=e};function Do(t,e,n){for(var r=0,i=0;i":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},ga=function(t,e){this.databaseId=t,this.I=e};function ma(t,e){return t.I?new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")+"."+("000000000"+e.nanoseconds).slice(-9)+"Z":{seconds:""+e.seconds,nanos:e.nanoseconds}}function va(t,e){return t.I?e.toBase64():e.toUint8Array()}function wa(t){return Wr(!!t),ei.fromTimestamp((t=bi(t),new ti(t.seconds,t.nanos)))}function ba(t,e){return new ci(["projects",t.projectId,"databases",t.database]).child("documents").child(e).canonicalString()}function Ea(t){t=ci.fromString(t);return Wr(Ba(t)),t}function Ta(t,e){return ba(t.databaseId,e.path)}function Ia(t,e){e=Ea(e);if(e.get(1)!==t.databaseId.projectId)throw new Ur(Vr.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+e.get(1)+" vs "+t.databaseId.projectId);if(e.get(3)!==t.databaseId.database)throw new Ur(Vr.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+e.get(3)+" vs "+t.databaseId.database);return new Ni(Da(e))}function _a(t,e){return ba(t.databaseId,e)}function Sa(t){t=Ea(t);return 4===t.length?ci.emptyPath():Da(t)}function Aa(t){return new ci(["projects",t.databaseId.projectId,"databases",t.databaseId.database]).canonicalString()}function Da(t){return Wr(4";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";case"OPERATOR_UNSPECIFIED":default:return zr()}}(),t.fieldFilter.value)}function qa(t){switch(t.unaryFilter.op){case"IS_NAN":var e=Va(t.unaryFilter.field);return Zi.create(e,"==",{doubleValue:NaN});case"IS_NULL":e=Va(t.unaryFilter.field);return Zi.create(e,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":var n=Va(t.unaryFilter.field);return Zi.create(n,"!=",{doubleValue:NaN});case"IS_NOT_NULL":n=Va(t.unaryFilter.field);return Zi.create(n,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":default:return zr()}}function Ba(t){return 4<=t.length&&"projects"===t.get(0)&&"databases"===t.get(2)}function ja(t){for(var e="",n=0;n",t),this.store.put(t));return Au(t)},Su.prototype.add=function(t){return Kr("SimpleDb","ADD",this.store.name,t,t),Au(this.store.add(t))},Su.prototype.get=function(e){var n=this;return Au(this.store.get(e)).next(function(t){return Kr("SimpleDb","GET",n.store.name,e,t=void 0===t?null:t),t})},Su.prototype.delete=function(t){return Kr("SimpleDb","DELETE",this.store.name,t),Au(this.store.delete(t))},Su.prototype.count=function(){return Kr("SimpleDb","COUNT",this.store.name),Au(this.store.count())},Su.prototype.Nt=function(t,e){var e=this.cursor(this.options(t,e)),n=[];return this.xt(e,function(t,e){n.push(e)}).next(function(){return n})},Su.prototype.kt=function(t,e){Kr("SimpleDb","DELETE ALL",this.store.name);e=this.options(t,e);e.Ft=!1;e=this.cursor(e);return this.xt(e,function(t,e,n){return n.delete()})},Su.prototype.$t=function(t,e){e?n=t:(n={},e=t);var n=this.cursor(n);return this.xt(n,e)},Su.prototype.Ot=function(r){var t=this.cursor({});return new fu(function(n,e){t.onerror=function(t){t=Nu(t.target.error);e(t)},t.onsuccess=function(t){var e=t.target.result;e?r(e.primaryKey,e.value).next(function(t){t?e.continue():n()}):n()}})},Su.prototype.xt=function(t,i){var o=[];return new fu(function(r,e){t.onerror=function(t){e(t.target.error)},t.onsuccess=function(t){var e,n=t.target.result;n?(e=new yu(n),(t=i(n.primaryKey,n.value,e))instanceof fu&&(t=t.catch(function(t){return e.done(),fu.reject(t)}),o.push(t)),e.isDone?r():null===e.Dt?n.continue():n.continue(e.Dt)):r()}}).next(function(){return fu.waitFor(o)})},Su.prototype.options=function(t,e){var n;return void 0!==t&&("string"==typeof t?n=t:e=t),{index:n,range:e}},Su.prototype.cursor=function(t){var e="next";if(t.reverse&&(e="prev"),t.index){var n=this.store.index(t.index);return t.Ft?n.openKeyCursor(t.range,e):n.openCursor(t.range,e)}return this.store.openCursor(t.range,e)},Su);function Su(t){this.store=t}function Au(t){return new fu(function(e,n){t.onsuccess=function(t){t=t.target.result;e(t)},t.onerror=function(t){t=Nu(t.target.error);n(t)}})}var Du=!1;function Nu(t){var e=pu._t(h());if(12.2<=e&&e<13){e="An internal error was encountered in the Indexed Database server";if(0<=t.message.indexOf(e)){var n=new Ur("internal","IOS_INDEXEDDB_BUG1: IndexedDb has thrown '"+e+"'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.");return Du||(Du=!0,setTimeout(function(){throw n},0)),n}}return t}var Cu,ku=(n(Ru,Cu=R),Ru);function Ru(t,e){var n=this;return(n=Cu.call(this)||this).Mt=t,n.currentSequenceNumber=e,n}function xu(t,e){return pu.It(t.Mt,e)}var Ou=(Uu.prototype.applyToRemoteDocument=function(t,e){for(var n,r,i,o,s,a,u=e.mutationResults,c=0;c=i),o=Hu(r.R,e)),n.done()}).next(function(){return o})},dc.prototype.getHighestUnacknowledgedBatchId=function(t){var e=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]),r=-1;return yc(t).$t({index:Wa.userMutationsIndex,range:e,reverse:!0},function(t,e,n){r=e.batchId,n.done()}).next(function(){return r})},dc.prototype.getAllMutationBatches=function(t){var e=this,n=IDBKeyRange.bound([this.userId,-1],[this.userId,Number.POSITIVE_INFINITY]);return yc(t).Nt(Wa.userMutationsIndex,n).next(function(t){return t.map(function(t){return Hu(e.R,t)})})},dc.prototype.getAllMutationBatchesAffectingDocumentKey=function(o,s){var a=this,t=Ya.prefixForPath(this.userId,s.path),t=IDBKeyRange.lowerBound(t),u=[];return gc(o).$t({range:t},function(t,e,n){var r=t[0],i=t[1],t=t[2],i=Ga(i);if(r===a.userId&&s.path.isEqual(i))return yc(o).get(t).next(function(t){if(!t)throw zr();Wr(t.userId===a.userId),u.push(Hu(a.R,t))});n.done()}).next(function(){return u})},dc.prototype.getAllMutationBatchesAffectingDocumentKeys=function(e,t){var s=this,a=new Qs($r),n=[];return t.forEach(function(o){var t=Ya.prefixForPath(s.userId,o.path),t=IDBKeyRange.lowerBound(t),t=gc(e).$t({range:t},function(t,e,n){var r=t[0],i=t[1],t=t[2],i=Ga(i);r===s.userId&&o.path.isEqual(i)?a=a.add(t):n.done()});n.push(t)}),fu.waitFor(n).next(function(){return s.Wt(e,a)})},dc.prototype.getAllMutationBatchesAffectingQuery=function(t,e){var o=this,s=e.path,a=s.length+1,e=Ya.prefixForPath(this.userId,s),e=IDBKeyRange.lowerBound(e),u=new Qs($r);return gc(t).$t({range:e},function(t,e,n){var r=t[0],i=t[1],t=t[2],i=Ga(i);r===o.userId&&s.isPrefixOf(i)?i.length===a&&(u=u.add(t)):n.done()}).next(function(){return o.Wt(t,u)})},dc.prototype.Wt=function(e,t){var n=this,r=[],i=[];return t.forEach(function(t){i.push(yc(e).get(t).next(function(t){if(null===t)throw zr();Wr(t.userId===n.userId),r.push(Hu(n.R,t))}))}),fu.waitFor(i).next(function(){return r})},dc.prototype.removeMutationBatch=function(e,n){var r=this;return hc(e.Mt,this.userId,n).next(function(t){return e.addOnCommittedListener(function(){r.Gt(n.batchId)}),fu.forEach(t,function(t){return r.referenceDelegate.markPotentiallyOrphaned(e,t)})})},dc.prototype.Gt=function(t){delete this.Kt[t]},dc.prototype.performConsistencyCheck=function(e){var i=this;return this.checkEmpty(e).next(function(t){if(!t)return fu.resolve();var t=IDBKeyRange.lowerBound(Ya.prefixForUser(i.userId)),r=[];return gc(e).$t({range:t},function(t,e,n){t[0]===i.userId?(t=Ga(t[1]),r.push(t)):n.done()}).next(function(){Wr(0===r.length)})})},dc.prototype.containsKey=function(t,e){return pc(t,this.userId,e)},dc.prototype.zt=function(t){var e=this;return mc(t).get(this.userId).next(function(t){return t||new za(e.userId,-1,"")})},dc);function dc(t,e,n,r){this.userId=t,this.R=e,this.Ut=n,this.referenceDelegate=r,this.Kt={}}function pc(t,o,e){var e=Ya.prefixForPath(o,e.path),s=e[1],e=IDBKeyRange.lowerBound(e),a=!1;return gc(t).$t({range:e,Ft:!0},function(t,e,n){var r=t[0],i=t[1];t[2],r===o&&i===s&&(a=!0),n.done()}).next(function(){return a})}function yc(t){return xu(t,Wa.store)}function gc(t){return xu(t,Ya.store)}function mc(t){return xu(t,za.store)}var vc=(Ec.prototype.next=function(){return this.Ht+=2,this.Ht},Ec.Jt=function(){return new Ec(0)},Ec.Yt=function(){return new Ec(-1)},Ec),wc=(bc.prototype.allocateTargetId=function(n){var r=this;return this.Xt(n).next(function(t){var e=new vc(t.highestTargetId);return t.highestTargetId=e.next(),r.Zt(n,t).next(function(){return t.highestTargetId})})},bc.prototype.getLastRemoteSnapshotVersion=function(t){return this.Xt(t).next(function(t){return ei.fromTimestamp(new ti(t.lastRemoteSnapshotVersion.seconds,t.lastRemoteSnapshotVersion.nanoseconds))})},bc.prototype.getHighestSequenceNumber=function(t){return this.Xt(t).next(function(t){return t.highestListenSequenceNumber})},bc.prototype.setTargetsMetadata=function(e,n,r){var i=this;return this.Xt(e).next(function(t){return t.highestListenSequenceNumber=n,r&&(t.lastRemoteSnapshotVersion=r.toTimestamp()),n>t.highestListenSequenceNumber&&(t.highestListenSequenceNumber=n),i.Zt(e,t)})},bc.prototype.addTargetData=function(e,n){var r=this;return this.te(e,n).next(function(){return r.Xt(e).next(function(t){return t.targetCount+=1,r.ee(n,t),r.Zt(e,t)})})},bc.prototype.updateTargetData=function(t,e){return this.te(t,e)},bc.prototype.removeTargetData=function(e,t){var n=this;return this.removeMatchingKeysForTargetId(e,t.targetId).next(function(){return Tc(e).delete(t.targetId)}).next(function(){return n.Xt(e)}).next(function(t){return Wr(0e.highestTargetId&&(e.highestTargetId=t.targetId,n=!0),t.sequenceNumber>e.highestListenSequenceNumber&&(e.highestListenSequenceNumber=t.sequenceNumber,n=!0),n},bc.prototype.getTargetCount=function(t){return this.Xt(t).next(function(t){return t.targetCount})},bc.prototype.getTargetData=function(t,r){var e=Yi(r),e=IDBKeyRange.bound([e,Number.NEGATIVE_INFINITY],[e,Number.POSITIVE_INFINITY]),i=null;return Tc(t).$t({range:e,index:eu.queryTargetsIndexName},function(t,e,n){e=zu(e);Xi(r,e.target)&&(i=e,n.done())}).next(function(){return i})},bc.prototype.addMatchingKeys=function(n,t,r){var i=this,o=[],s=_c(n);return t.forEach(function(t){var e=ja(t.path);o.push(s.put(new nu(r,e))),o.push(i.referenceDelegate.addReference(n,r,t))}),fu.waitFor(o)},bc.prototype.removeMatchingKeys=function(n,t,r){var i=this,o=_c(n);return fu.forEach(t,function(t){var e=ja(t.path);return fu.waitFor([o.delete([r,e]),i.referenceDelegate.removeReference(n,r,t)])})},bc.prototype.removeMatchingKeysForTargetId=function(t,e){t=_c(t),e=IDBKeyRange.bound([e],[e+1],!1,!0);return t.delete(e)},bc.prototype.getMatchingKeysForTargetId=function(t,e){var e=IDBKeyRange.bound([e],[e+1],!1,!0),t=_c(t),r=Zs();return t.$t({range:e,Ft:!0},function(t,e,n){t=Ga(t[1]),t=new Ni(t);r=r.add(t)}).next(function(){return r})},bc.prototype.containsKey=function(t,e){var e=ja(e.path),e=IDBKeyRange.bound([e],[Zr(e)],!1,!0),i=0;return _c(t).$t({index:nu.documentTargetsIndex,Ft:!0,range:e},function(t,e,n){var r=t[0];t[1],0!==r&&(i++,n.done())}).next(function(){return 0h.params.maximumSequenceNumbersToCollect?(Kr("LruGarbageCollector","Capping sequence numbers to collect down to the maximum of "+h.params.maximumSequenceNumbersToCollect+" from "+t),h.params.maximumSequenceNumbersToCollect):t,s=Date.now(),h.nthSequenceNumber(e,i)}).next(function(t){return r=t,a=Date.now(),h.removeTargets(e,r,n)}).next(function(t){return o=t,u=Date.now(),h.removeOrphanedDocuments(e,r)}).next(function(t){return c=Date.now(),jr()<=w.DEBUG&&Kr("LruGarbageCollector","LRU Garbage Collection\n\tCounted targets in "+(s-l)+"ms\n\tDetermined least recently used "+i+" in "+(a-s)+"ms\n\tRemoved "+o+" targets in "+(u-a)+"ms\n\tRemoved "+t+" documents in "+(c-u)+"ms\nTotal Duration: "+(c-l)+"ms"),fu.resolve({didRun:!0,sequenceNumbersCollected:i,targetsRemoved:o,documentsRemoved:t})})},xc),kc=(Rc.prototype.he=function(t){var n=this.de(t);return this.db.getTargetCache().getTargetCount(t).next(function(e){return n.next(function(t){return e+t})})},Rc.prototype.de=function(t){var e=0;return this.le(t,function(t){e++}).next(function(){return e})},Rc.prototype.forEachTarget=function(t,e){return this.db.getTargetCache().forEachTarget(t,e)},Rc.prototype.le=function(t,n){return this.we(t,function(t,e){return n(e)})},Rc.prototype.addReference=function(t,e,n){return Pc(t,n)},Rc.prototype.removeReference=function(t,e,n){return Pc(t,n)},Rc.prototype.removeTargets=function(t,e,n){return this.db.getTargetCache().removeTargets(t,e,n)},Rc.prototype.markPotentiallyOrphaned=Pc,Rc.prototype._e=function(t,e){return r=e,i=!1,mc(n=t).Ot(function(t){return pc(n,t,r).next(function(t){return t&&(i=!0),fu.resolve(!t)})}).next(function(){return i});var n,r,i},Rc.prototype.removeOrphanedDocuments=function(n,r){var i=this,o=this.db.getRemoteDocumentCache().newChangeBuffer(),s=[],a=0;return this.we(n,function(e,t){t<=r&&(t=i._e(n,e).next(function(t){if(!t)return a++,o.getEntry(n,e).next(function(){return o.removeEntry(e),_c(n).delete([0,ja(e.path)])})}),s.push(t))}).next(function(){return fu.waitFor(s)}).next(function(){return o.apply(n)}).next(function(){return a})},Rc.prototype.removeTarget=function(t,e){e=e.withSequenceNumber(t.currentSequenceNumber);return this.db.getTargetCache().updateTargetData(t,e)},Rc.prototype.updateLimboDocument=Pc,Rc.prototype.we=function(t,r){var i,t=_c(t),o=Pr.o;return t.$t({index:nu.documentTargetsIndex},function(t,e){var n=t[0];t[1];t=e.path,e=e.sequenceNumber;0===n?(o!==Pr.o&&r(new Ni(Ga(i)),o),o=e,i=t):o=Pr.o}).next(function(){o!==Pr.o&&r(new Ni(Ga(i)),o)})},Rc.prototype.getCacheSize=function(t){return this.db.getRemoteDocumentCache().getSize(t)},Rc);function Rc(t,e){this.db=t,this.garbageCollector=new Cc(this,e)}function xc(t,e){this.ae=t,this.params=e}function Oc(t,e){this.garbageCollector=t,this.asyncQueue=e,this.oe=!1,this.ce=null}function Lc(t){this.ne=t,this.buffer=new Qs(Ac),this.se=0}function Pc(t,e){return _c(t).put((t=t.currentSequenceNumber,new nu(0,ja(e.path),t)))}var Mc,Fc=(Kc.prototype.get=function(t){var e=this.mapKeyFn(t),e=this.inner[e];if(void 0!==e)for(var n=0,r=e;n "+n),1))},Jc.prototype.We=function(){var t=this;null!==this.document&&"function"==typeof this.document.addEventListener&&(this.Fe=function(){t.Se.enqueueAndForget(function(){return t.inForeground="visible"===t.document.visibilityState,t.je()})},this.document.addEventListener("visibilitychange",this.Fe),this.inForeground="visible"===this.document.visibilityState)},Jc.prototype.an=function(){this.Fe&&(this.document.removeEventListener("visibilitychange",this.Fe),this.Fe=null)},Jc.prototype.Ge=function(){var t,e=this;"function"==typeof(null===(t=this.window)||void 0===t?void 0:t.addEventListener)&&(this.ke=function(){e.un(),c()&&navigator.appVersion.match("Version/14")&&e.Se.enterRestrictedMode(!0),e.Se.enqueueAndForget(function(){return e.shutdown()})},this.window.addEventListener("pagehide",this.ke))},Jc.prototype.hn=function(){this.ke&&(this.window.removeEventListener("pagehide",this.ke),this.ke=null)},Jc.prototype.cn=function(t){var e;try{var n=null!==(null===(e=this.Qe)||void 0===e?void 0:e.getItem(this.on(t)));return Kr("IndexedDbPersistence","Client '"+t+"' "+(n?"is":"is not")+" zombied in LocalStorage"),n}catch(t){return Gr("IndexedDbPersistence","Failed to get zombied client id.",t),!1}},Jc.prototype.un=function(){if(this.Qe)try{this.Qe.setItem(this.on(this.clientId),String(Date.now()))}catch(t){Gr("Failed to set zombie client id.",t)}},Jc.prototype.ln=function(){if(this.Qe)try{this.Qe.removeItem(this.on(this.clientId))}catch(t){}},Jc.prototype.on=function(t){return"firestore_zombie_"+this.persistenceKey+"_"+t},Jc);function Jc(t,e,n,r,i,o,s,a,u,c){if(this.allowTabSynchronization=t,this.persistenceKey=e,this.clientId=n,this.Se=i,this.window=o,this.document=s,this.De=u,this.Ce=c,this.Ne=null,this.xe=!1,this.isPrimary=!1,this.networkEnabled=!0,this.ke=null,this.inForeground=!1,this.Fe=null,this.$e=null,this.Oe=Number.NEGATIVE_INFINITY,this.Me=function(t){return Promise.resolve()},!Jc.yt())throw new Ur(Vr.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.referenceDelegate=new kc(this,r),this.Le=e+"main",this.R=new Mu(a),this.Be=new pu(this.Le,11,new zc(this.R)),this.qe=new wc(this.referenceDelegate,this.R),this.Ut=new nc,this.Ue=(e=this.R,a=this.Ut,new Vc(e,a)),this.Ke=new Xu,this.window&&this.window.localStorage?this.Qe=this.window.localStorage:(this.Qe=null,!1===c&&Gr("IndexedDbPersistence","LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."))}function Zc(t){return xu(t,Qa.store)}function th(t){return xu(t,ou.store)}function eh(t,e){var n=t.projectId;return t.isDefaultDatabase||(n+="."+t.database),"firestore/"+e+"/"+n+"/"}function nh(t,e){this.progress=t,this.wn=e}var rh=(hh.prototype.mn=function(e,n){var r=this;return this._n.getAllMutationBatchesAffectingDocumentKey(e,n).next(function(t){return r.yn(e,n,t)})},hh.prototype.yn=function(t,e,r){return this.Ue.getEntry(t,e).next(function(t){for(var e=0,n=r;ee?this._n[e]:null)},Kh.prototype.getHighestUnacknowledgedBatchId=function(){return fu.resolve(0===this._n.length?-1:this.ss-1)},Kh.prototype.getAllMutationBatches=function(t){return fu.resolve(this._n.slice())},Kh.prototype.getAllMutationBatchesAffectingDocumentKey=function(t,e){var n=this,r=new Dh(e,0),e=new Dh(e,Number.POSITIVE_INFINITY),i=[];return this.rs.forEachInRange([r,e],function(t){t=n.os(t.ns);i.push(t)}),fu.resolve(i)},Kh.prototype.getAllMutationBatchesAffectingDocumentKeys=function(t,e){var n=this,r=new Qs($r);return e.forEach(function(t){var e=new Dh(t,0),t=new Dh(t,Number.POSITIVE_INFINITY);n.rs.forEachInRange([e,t],function(t){r=r.add(t.ns)})}),fu.resolve(this.us(r))},Kh.prototype.getAllMutationBatchesAffectingQuery=function(t,e){var n=e.path,r=n.length+1,e=n;Ni.isDocumentKey(e)||(e=e.child(""));var e=new Dh(new Ni(e),0),i=new Qs($r);return this.rs.forEachWhile(function(t){var e=t.key.path;return!!n.isPrefixOf(e)&&(e.length===r&&(i=i.add(t.ns)),!0)},e),fu.resolve(this.us(i))},Kh.prototype.us=function(t){var e=this,n=[];return t.forEach(function(t){t=e.os(t);null!==t&&n.push(t)}),n},Kh.prototype.removeMutationBatch=function(n,r){var i=this;Wr(0===this.hs(r.batchId,"removed")),this._n.shift();var o=this.rs;return fu.forEach(r.mutations,function(t){var e=new Dh(t.key,r.batchId);return o=o.delete(e),i.referenceDelegate.markPotentiallyOrphaned(n,t.key)}).next(function(){i.rs=o})},Kh.prototype.Gt=function(t){},Kh.prototype.containsKey=function(t,e){var n=new Dh(e,0),n=this.rs.firstAfterOrEqual(n);return fu.resolve(e.isEqual(n&&n.key))},Kh.prototype.performConsistencyCheck=function(t){return this._n.length,fu.resolve()},Kh.prototype.hs=function(t,e){return this.cs(t)},Kh.prototype.cs=function(t){return 0===this._n.length?0:t-this._n[0].batchId},Kh.prototype.os=function(t){t=this.cs(t);return t<0||t>=this._n.length?null:this._n[t]},Kh),Ch=(jh.prototype.addEntry=function(t,e,n){var r=e.key,i=this.docs.get(r),o=i?i.size:0,i=this.ls(e);return this.docs=this.docs.insert(r,{document:e.clone(),size:i,readTime:n}),this.size+=i-o,this.Ut.addToCollectionParentIndex(t,r.path.popLast())},jh.prototype.removeEntry=function(t){var e=this.docs.get(t);e&&(this.docs=this.docs.remove(t),this.size-=e.size)},jh.prototype.getEntry=function(t,e){var n=this.docs.get(e);return fu.resolve(n?n.document.clone():Qi.newInvalidDocument(e))},jh.prototype.getEntries=function(t,e){var n=this,r=zs;return e.forEach(function(t){var e=n.docs.get(t);r=r.insert(t,e?e.document.clone():Qi.newInvalidDocument(t))}),fu.resolve(r)},jh.prototype.getDocumentsMatchingQuery=function(t,e,n){for(var r=zs,i=new Ni(e.path.child("")),o=this.docs.getIteratorFrom(i);o.hasNext();){var s=o.getNext(),a=s.key,u=s.value,s=u.document,u=u.readTime;if(!e.path.isPrefixOf(a.path))break;u.compareTo(n)<=0||Ko(e,s)&&(r=r.insert(s.key,s.clone()))}return fu.resolve(r)},jh.prototype.fs=function(t,e){return fu.forEach(this.docs,function(t){return e(t)})},jh.prototype.newChangeBuffer=function(t){return new kh(this)},jh.prototype.getSize=function(t){return fu.resolve(this.size)},jh),kh=(n(Bh,_h=A),Bh.prototype.applyChanges=function(n){var r=this,i=[];return this.changes.forEach(function(t,e){e.document.isValidDocument()?i.push(r.Ie.addEntry(n,e.document,r.getReadTime(t))):r.Ie.removeEntry(t)}),fu.waitFor(i)},Bh.prototype.getFromCache=function(t,e){return this.Ie.getEntry(t,e)},Bh.prototype.getAllFromCache=function(t,e){return this.Ie.getEntries(t,e)},Bh),Rh=(qh.prototype.forEachTarget=function(t,n){return this.ds.forEach(function(t,e){return n(e)}),fu.resolve()},qh.prototype.getLastRemoteSnapshotVersion=function(t){return fu.resolve(this.lastRemoteSnapshotVersion)},qh.prototype.getHighestSequenceNumber=function(t){return fu.resolve(this.ws)},qh.prototype.allocateTargetId=function(t){return this.highestTargetId=this.ys.next(),fu.resolve(this.highestTargetId)},qh.prototype.setTargetsMetadata=function(t,e,n){return n&&(this.lastRemoteSnapshotVersion=n),e>this.ws&&(this.ws=e),fu.resolve()},qh.prototype.te=function(t){this.ds.set(t.target,t);var e=t.targetId;e>this.highestTargetId&&(this.ys=new vc(e),this.highestTargetId=e),t.sequenceNumber>this.ws&&(this.ws=t.sequenceNumber)},qh.prototype.addTargetData=function(t,e){return this.te(e),this.targetCount+=1,fu.resolve()},qh.prototype.updateTargetData=function(t,e){return this.te(e),fu.resolve()},qh.prototype.removeTargetData=function(t,e){return this.ds.delete(e.target),this._s.Zn(e.targetId),--this.targetCount,fu.resolve()},qh.prototype.removeTargets=function(n,r,i){var o=this,s=0,a=[];return this.ds.forEach(function(t,e){e.sequenceNumber<=r&&null===i.get(e.targetId)&&(o.ds.delete(t),a.push(o.removeMatchingKeysForTargetId(n,e.targetId)),s++)}),fu.waitFor(a).next(function(){return s})},qh.prototype.getTargetCount=function(t){return fu.resolve(this.targetCount)},qh.prototype.getTargetData=function(t,e){e=this.ds.get(e)||null;return fu.resolve(e)},qh.prototype.addMatchingKeys=function(t,e,n){return this._s.Jn(e,n),fu.resolve()},qh.prototype.removeMatchingKeys=function(e,t,n){this._s.Xn(t,n);var r=this.persistence.referenceDelegate,i=[];return r&&t.forEach(function(t){i.push(r.markPotentiallyOrphaned(e,t))}),fu.waitFor(i)},qh.prototype.removeMatchingKeysForTargetId=function(t,e){return this._s.Zn(e),fu.resolve()},qh.prototype.getMatchingKeysForTargetId=function(t,e){e=this._s.es(e);return fu.resolve(e)},qh.prototype.containsKey=function(t,e){return fu.resolve(this._s.containsKey(e))},qh),xh=(Uh.prototype.start=function(){return Promise.resolve()},Uh.prototype.shutdown=function(){return this.xe=!1,Promise.resolve()},Object.defineProperty(Uh.prototype,"started",{get:function(){return this.xe},enumerable:!1,configurable:!0}),Uh.prototype.setDatabaseDeletedListener=function(){},Uh.prototype.setNetworkEnabled=function(){},Uh.prototype.getIndexManager=function(){return this.Ut},Uh.prototype.getMutationQueue=function(t){var e=this.gs[t.toKey()];return e||(e=new Nh(this.Ut,this.referenceDelegate),this.gs[t.toKey()]=e),e},Uh.prototype.getTargetCache=function(){return this.qe},Uh.prototype.getRemoteDocumentCache=function(){return this.Ue},Uh.prototype.getBundleCache=function(){return this.Ke},Uh.prototype.runTransaction=function(t,e,n){var r=this;Kr("MemoryPersistence","Starting transaction:",t);var i=new Oh(this.Ne.next());return this.referenceDelegate.Es(),n(i).next(function(t){return r.referenceDelegate.Ts(i).next(function(){return t})}).toPromise().then(function(t){return i.raiseOnCommittedEvent(),t})},Uh.prototype.Is=function(e,n){return fu.or(Object.values(this.gs).map(function(t){return function(){return t.containsKey(e,n)}}))},Uh),Oh=(n(Vh,Ih=R),Vh),Lh=(Fh.bs=function(t){return new Fh(t)},Object.defineProperty(Fh.prototype,"vs",{get:function(){if(this.Rs)return this.Rs;throw zr()},enumerable:!1,configurable:!0}),Fh.prototype.addReference=function(t,e,n){return this.As.addReference(n,e),this.vs.delete(n.toString()),fu.resolve()},Fh.prototype.removeReference=function(t,e,n){return this.As.removeReference(n,e),this.vs.add(n.toString()),fu.resolve()},Fh.prototype.markPotentiallyOrphaned=function(t,e){return this.vs.add(e.toString()),fu.resolve()},Fh.prototype.removeTarget=function(t,e){var n=this;this.As.Zn(e.targetId).forEach(function(t){return n.vs.add(t.toString())});var r=this.persistence.getTargetCache();return r.getMatchingKeysForTargetId(t,e.targetId).next(function(t){t.forEach(function(t){return n.vs.add(t.toString())})}).next(function(){return r.removeTargetData(t,e)})},Fh.prototype.Es=function(){this.Rs=new Set},Fh.prototype.Ts=function(n){var r=this,i=this.persistence.getRemoteDocumentCache().newChangeBuffer();return fu.forEach(this.vs,function(t){var e=Ni.fromPath(t);return r.Ps(n,e).next(function(t){t||i.removeEntry(e)})}).next(function(){return r.Rs=null,i.apply(n)})},Fh.prototype.updateLimboDocument=function(t,e){var n=this;return this.Ps(t,e).next(function(t){t?n.vs.delete(e.toString()):n.vs.add(e.toString())})},Fh.prototype.ps=function(t){return 0},Fh.prototype.Ps=function(t,e){var n=this;return fu.or([function(){return fu.resolve(n.As.containsKey(e))},function(){return n.persistence.getTargetCache().containsKey(t,e)},function(){return n.persistence.Is(t,e)}])},Fh),Ph=(Mh.prototype.isAuthenticated=function(){return null!=this.uid},Mh.prototype.toKey=function(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"},Mh.prototype.isEqual=function(t){return t.uid===this.uid},Mh);function Mh(t){this.uid=t}function Fh(t){this.persistence=t,this.As=new Ah,this.Rs=null}function Vh(t){var e=this;return(e=Ih.call(this)||this).currentSequenceNumber=t,e}function Uh(t,e){var n=this;this.gs={},this.Ne=new Pr(0),this.xe=!1,this.xe=!0,this.referenceDelegate=t(this),this.qe=new Rh(this),this.Ut=new tc,this.Ue=(t=this.Ut,new Ch(t,function(t){return n.referenceDelegate.ps(t)})),this.R=new Mu(e),this.Ke=new Sh(this.R)}function qh(t){this.persistence=t,this.ds=new Fc(Yi,Xi),this.lastRemoteSnapshotVersion=ei.min(),this.highestTargetId=0,this.ws=0,this._s=new Ah,this.targetCount=0,this.ys=vc.Jt()}function Bh(t){var e=this;return(e=_h.call(this)||this).Ie=t,e}function jh(t,e){this.Ut=t,this.ls=e,this.docs=new Vs(Ni.comparator),this.size=0}function Kh(t,e){this.Ut=t,this.referenceDelegate=e,this._n=[],this.ss=1,this.rs=new Qs(Dh.Gn)}function Gh(t,e){this.key=t,this.ns=e}function Qh(){this.Wn=new Qs(Dh.Gn),this.zn=new Qs(Dh.Hn)}function Hh(t){this.R=t,this.Qn=new Map,this.jn=new Map}function zh(t,e){return"firestore_clients_"+t+"_"+e}function Wh(t,e,n){n="firestore_mutations_"+t+"_"+n;return e.isAuthenticated()&&(n+="_"+e.uid),n}function Yh(t,e){return"firestore_targets_"+t+"_"+e}Ph.UNAUTHENTICATED=new Ph(null),Ph.GOOGLE_CREDENTIALS=new Ph("google-credentials-uid"),Ph.FIRST_PARTY=new Ph("first-party-uid"),Ph.MOCK_USER=new Ph("mock-user");var Xh,$h=(bl.Vs=function(t,e,n){var r,i=JSON.parse(n),o="object"==typeof i&&-1!==["pending","acknowledged","rejected"].indexOf(i.state)&&(void 0===i.error||"object"==typeof i.error);return o&&i.error&&(o="string"==typeof i.error.message&&"string"==typeof i.error.code)&&(r=new Ur(i.error.code,i.error.message)),o?new bl(t,e,i.state,r):(Gr("SharedClientState","Failed to parse mutation state for ID '"+e+"': "+n),null)},bl.prototype.Ss=function(){var t={state:this.state,updateTimeMs:Date.now()};return this.error&&(t.error={code:this.error.code,message:this.error.message}),JSON.stringify(t)},bl),Jh=(wl.Vs=function(t,e){var n,r=JSON.parse(e),i="object"==typeof r&&-1!==["not-current","current","rejected"].indexOf(r.state)&&(void 0===r.error||"object"==typeof r.error);return i&&r.error&&(i="string"==typeof r.error.message&&"string"==typeof r.error.code)&&(n=new Ur(r.error.code,r.error.message)),i?new wl(t,r.state,n):(Gr("SharedClientState","Failed to parse target state for ID '"+t+"': "+e),null)},wl.prototype.Ss=function(){var t={state:this.state,updateTimeMs:Date.now()};return this.error&&(t.error={code:this.error.code,message:this.error.message}),JSON.stringify(t)},wl),Zh=(vl.Vs=function(t,e){for(var n=JSON.parse(e),r="object"==typeof n&&n.activeTargetIds instanceof Array,i=ta,o=0;r&&othis.Bi&&(this.qi=this.Bi)},Vl.prototype.Gi=function(){null!==this.Ui&&(this.Ui.skipDelay(),this.Ui=null)},Vl.prototype.cancel=function(){null!==this.Ui&&(this.Ui.cancel(),this.Ui=null)},Vl.prototype.Wi=function(){return(Math.random()-.5)*this.qi},Vl),A=(Fl.prototype.tr=function(){return 1===this.state||2===this.state||4===this.state},Fl.prototype.er=function(){return 2===this.state},Fl.prototype.start=function(){3!==this.state?this.auth():this.nr()},Fl.prototype.stop=function(){return y(this,void 0,void 0,function(){return g(this,function(t){switch(t.label){case 0:return this.tr()?[4,this.close(0)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})},Fl.prototype.sr=function(){this.state=0,this.Zi.reset()},Fl.prototype.ir=function(){var t=this;this.er()&&null===this.Xi&&(this.Xi=this.Se.enqueueAfterDelay(this.zi,6e4,function(){return t.rr()}))},Fl.prototype.cr=function(t){this.ur(),this.stream.send(t)},Fl.prototype.rr=function(){return y(this,void 0,void 0,function(){return g(this,function(t){return this.er()?[2,this.close(0)]:[2]})})},Fl.prototype.ur=function(){this.Xi&&(this.Xi.cancel(),this.Xi=null)},Fl.prototype.close=function(e,n){return y(this,void 0,void 0,function(){return g(this,function(t){switch(t.label){case 0:return this.ur(),this.Zi.cancel(),this.Yi++,3!==e?this.Zi.reset():n&&n.code===Vr.RESOURCE_EXHAUSTED?(Gr(n.toString()),Gr("Using maximum backoff delay to prevent overloading the backend."),this.Zi.Qi()):n&&n.code===Vr.UNAUTHENTICATED&&this.Ji.invalidateToken(),null!==this.stream&&(this.ar(),this.stream.close(),this.stream=null),this.state=e,[4,this.listener.Ri(n)];case 1:return t.sent(),[2]}})})},Fl.prototype.ar=function(){},Fl.prototype.auth=function(){var n=this;this.state=1;var t=this.hr(this.Yi),e=this.Yi;this.Ji.getToken().then(function(t){n.Yi===e&&n.lr(t)},function(e){t(function(){var t=new Ur(Vr.UNKNOWN,"Fetching auth token failed: "+e.message);return n.dr(t)})})},Fl.prototype.lr=function(t){var e=this,n=this.hr(this.Yi);this.stream=this.wr(t),this.stream.Ii(function(){n(function(){return e.state=2,e.listener.Ii()})}),this.stream.Ri(function(t){n(function(){return e.dr(t)})}),this.stream.onMessage(function(t){n(function(){return e.onMessage(t)})})},Fl.prototype.nr=function(){var t=this;this.state=4,this.Zi.ji(function(){return y(t,void 0,void 0,function(){return g(this,function(t){return this.state=0,this.start(),[2]})})})},Fl.prototype.dr=function(t){return Kr("PersistentStream","close with error: "+t),this.stream=null,this.close(3,t)},Fl.prototype.hr=function(e){var n=this;return function(t){n.Se.enqueueAndForget(function(){return n.Yi===e?t():(Kr("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())})}},Fl),Cl=(n(Ml,Dl=A),Ml.prototype.wr=function(t){return this.Hi.Oi("Listen",t)},Ml.prototype.onMessage=function(t){this.Zi.reset();var e=function(t,e){if("targetChange"in e){e.targetChange;var n="NO_CHANGE"===(o=e.targetChange.targetChangeType||"NO_CHANGE")?0:"ADD"===o?1:"REMOVE"===o?2:"CURRENT"===o?3:"RESET"===o?4:zr(),r=e.targetChange.targetIds||[],i=(s=e.targetChange.resumeToken,t.I?(Wr(void 0===s||"string"==typeof s),di.fromBase64String(s||"")):(Wr(void 0===s||s instanceof Uint8Array),di.fromUint8Array(s||new Uint8Array))),o=(a=e.targetChange.cause)&&(u=void 0===(c=a).code?Vr.UNKNOWN:Fs(c.code),new Ur(u,c.message||"")),s=new oa(n,r,i,o||null)}else if("documentChange"in e){e.documentChange,(n=e.documentChange).document,n.document.name,n.document.updateTime;var r=Ia(t,n.document.name),i=wa(n.document.updateTime),a=new Ki({mapValue:{fields:n.document.fields}}),u=(o=Qi.newFoundDocument(r,i,a),n.targetIds||[]),c=n.removedTargetIds||[];s=new ra(u,c,o.key,o)}else if("documentDelete"in e)e.documentDelete,(n=e.documentDelete).document,r=Ia(t,n.document),i=n.readTime?wa(n.readTime):ei.min(),a=Qi.newNoDocument(r,i),o=n.removedTargetIds||[],s=new ra([],o,a.key,a);else if("documentRemove"in e)e.documentRemove,(n=e.documentRemove).document,r=Ia(t,n.document),i=n.removedTargetIds||[],s=new ra([],i,r,null);else{if(!("filter"in e))return zr();e.filter;e=e.filter;e.targetId,n=e.count||0,r=new Ns(n),i=e.targetId,s=new ia(i,r)}return s}(this.R,t),t=function(t){if(!("targetChange"in t))return ei.min();t=t.targetChange;return(!t.targetIds||!t.targetIds.length)&&t.readTime?wa(t.readTime):ei.min()}(t);return this.listener._r(e,t)},Ml.prototype.mr=function(t){var e,n,r,i={};i.database=Aa(this.R),i.addTarget=(e=this.R,(r=$i(r=(n=t).target)?{documents:xa(e,r)}:{query:Oa(e,r)}).targetId=n.targetId,0this.query.limit;){var n=xo(this.query)?h.last():h.first(),h=h.delete(n.key),c=c.delete(n.key);a.track({type:1,doc:n})}return{fo:h,mo:a,Nn:l,mutatedKeys:c}},Pf.prototype.yo=function(t,e){return t.hasLocalMutations&&e.hasCommittedMutations&&!e.hasLocalMutations},Pf.prototype.applyChanges=function(t,e,n){var o=this,r=this.fo;this.fo=t.fo,this.mutatedKeys=t.mutatedKeys;var i=t.mo.jr();i.sort(function(t,e){return r=t.type,i=e.type,n(r)-n(i)||o.lo(t.doc,e.doc);function n(t){switch(t){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return zr()}}var r,i}),this.po(n);var s=e?this.Eo():[],n=0===this.ho.size&&this.current?1:0,e=n!==this.ao;return this.ao=n,0!==i.length||e?{snapshot:new lf(this.query,t.fo,r,i,t.mutatedKeys,0==n,e,!1),To:s}:{To:s}},Pf.prototype.zr=function(t){return this.current&&"Offline"===t?(this.current=!1,this.applyChanges({fo:this.fo,mo:new hf,mutatedKeys:this.mutatedKeys,Nn:!1},!1)):{To:[]}},Pf.prototype.Io=function(t){return!this.uo.has(t)&&!!this.fo.has(t)&&!this.fo.get(t).hasLocalMutations},Pf.prototype.po=function(t){var e=this;t&&(t.addedDocuments.forEach(function(t){return e.uo=e.uo.add(t)}),t.modifiedDocuments.forEach(function(t){}),t.removedDocuments.forEach(function(t){return e.uo=e.uo.delete(t)}),this.current=t.current)},Pf.prototype.Eo=function(){var e=this;if(!this.current)return[];var n=this.ho;this.ho=Zs(),this.fo.forEach(function(t){e.Io(t.key)&&(e.ho=e.ho.add(t.key))});var r=[];return n.forEach(function(t){e.ho.has(t)||r.push(new Cf(t))}),this.ho.forEach(function(t){n.has(t)||r.push(new Nf(t))}),r},Pf.prototype.Ao=function(t){this.uo=t.Bn,this.ho=Zs();t=this._o(t.documents);return this.applyChanges(t,!0)},Pf.prototype.Ro=function(){return lf.fromInitialDocuments(this.query,this.fo,this.mutatedKeys,0===this.ao)},Pf),Rf=function(t,e,n){this.query=t,this.targetId=e,this.view=n},xf=function(t){this.key=t,this.bo=!1},Of=(Object.defineProperty(Lf.prototype,"isPrimaryClient",{get:function(){return!0===this.$o},enumerable:!1,configurable:!0}),Lf);function Lf(t,e,n,r,i,o){this.localStore=t,this.remoteStore=e,this.eventManager=n,this.sharedClientState=r,this.currentUser=i,this.maxConcurrentLimboResolutions=o,this.vo={},this.Po=new Fc(Bo,qo),this.Vo=new Map,this.So=new Set,this.Do=new Vs(Ni.comparator),this.Co=new Map,this.No=new Ah,this.xo={},this.ko=new Map,this.Fo=vc.Yt(),this.onlineState="Unknown",this.$o=void 0}function Pf(t,e){this.query=t,this.uo=e,this.ao=null,this.current=!1,this.ho=Zs(),this.mutatedKeys=Zs(),this.lo=Go(t),this.fo=new cf(this.lo)}function Mf(i,o,s,a){return y(this,void 0,void 0,function(){var e,n,r;return g(this,function(t){switch(t.label){case 0:return i.Oo=function(t,e,n){return function(r,i,o,s){return y(this,void 0,void 0,function(){var e,n;return g(this,function(t){switch(t.label){case 0:return(e=i.view._o(o)).Nn?[4,wh(r.localStore,i.query,!1).then(function(t){t=t.documents;return i.view._o(t,e)})]:[3,2];case 1:e=t.sent(),t.label=2;case 2:return n=s&&s.targetChanges.get(i.targetId),n=i.view.applyChanges(e,r.isPrimaryClient,n),[2,(Hf(r,i.targetId,n.To),n.snapshot)]}})})}(i,t,e,n)},[4,wh(i.localStore,o,!0)];case 1:return n=t.sent(),r=new kf(o,n.Bn),e=r._o(n.documents),n=na.createSynthesizedTargetChangeForCurrentChange(s,a&&"Offline"!==i.onlineState),n=r.applyChanges(e,i.isPrimaryClient,n),Hf(i,s,n.To),r=new Rf(o,s,r),[2,(i.Po.set(o,r),i.Vo.has(s)?i.Vo.get(s).push(o):i.Vo.set(s,[o]),n.snapshot)]}})})}function Ff(f,d,p){return y(this,void 0,void 0,function(){var s,l;return g(this,function(t){switch(t.label){case 0:l=ed(f),t.label=1;case 1:return t.trys.push([1,5,,6]),[4,(i=l.localStore,a=d,c=i,h=ti.now(),o=a.reduce(function(t,e){return t.add(e.key)},Zs()),c.persistence.runTransaction("Locally write mutations","readwrite",function(s){return c.Mn.pn(s,o).next(function(t){u=t;for(var e=[],n=0,r=a;n, or >=) must be on the same field. But you have inequality filters on '"+n.toString()+"' and '"+e.field.toString()+"'");n=Lo(t);null!==n&&ag(0,e.field,n)}t=function(t,e){for(var n=0,r=t.filters;ns.length)throw new Ur(Vr.INVALID_ARGUMENT,"Too many arguments provided to "+r+"(). The number of arguments must be less than or equal to the number of orderBy() clauses");for(var a=[],u=0;u, or >=) on field '"+e.toString()+"' and so you must also use '"+e.toString()+"' as your first argument to orderBy(), but your first orderBy() is on field '"+n.toString()+"' instead.")}ug.prototype.convertValue=function(t,e){switch(void 0===e&&(e="none"),ki(t)){case 0:return null;case 1:return t.booleanValue;case 2:return Ei(t.integerValue||t.doubleValue);case 3:return this.convertTimestamp(t.timestampValue);case 4:return this.convertServerTimestamp(t,e);case 5:return t.stringValue;case 6:return this.convertBytes(Ti(t.bytesValue));case 7:return this.convertReference(t.referenceValue);case 8:return this.convertGeoPoint(t.geoPointValue);case 9:return this.convertArray(t.arrayValue,e);case 10:return this.convertObject(t.mapValue,e);default:throw zr()}},ug.prototype.convertObject=function(t,n){var r=this,i={};return oi(t.fields,function(t,e){i[t]=r.convertValue(e,n)}),i},ug.prototype.convertGeoPoint=function(t){return new Lp(Ei(t.latitude),Ei(t.longitude))},ug.prototype.convertArray=function(t,e){var n=this;return(t.values||[]).map(function(t){return n.convertValue(t,e)})},ug.prototype.convertServerTimestamp=function(t,e){switch(e){case"previous":var n=function t(e){e=e.mapValue.fields.__previous_value__;return Ii(e)?t(e):e}(t);return null==n?null:this.convertValue(n,e);case"estimate":return this.convertTimestamp(_i(t));default:return null}},ug.prototype.convertTimestamp=function(t){t=bi(t);return new ti(t.seconds,t.nanos)},ug.prototype.convertDocumentKey=function(t,e){var n=ci.fromString(t);Wr(Ba(n));t=new Fd(n.get(1),n.get(3)),n=new Ni(n.popFirst(5));return t.isEqual(e)||Gr("Document "+n+" contains a document reference within a different database ("+t.projectId+"/"+t.database+") which is not supported. It will be treated as a reference in the current database ("+e.projectId+"/"+e.database+") instead."),n},A=ug;function ug(){}function cg(t,e,n){return t?n&&(n.merge||n.mergeFields)?t.toFirestore(e,n):t.toFirestore(e):e}var hg,lg=(n(pg,hg=A),pg.prototype.convertBytes=function(t){return new xp(t)},pg.prototype.convertReference=function(t){t=this.convertDocumentKey(t,this.firestore._databaseId);return new ap(this.firestore,null,t)},pg),fg=(dg.prototype.set=function(t,e,n){this._verifyNotCommitted();t=yg(t,this._firestore),e=cg(t.converter,e,n),n=Yp(this._dataReader,"WriteBatch.set",t._key,e,null!==t.converter,n);return this._mutations.push(n.toMutation(t._key,ds.none())),this},dg.prototype.update=function(t,e,n){for(var r=[],i=3;i