function getFirebaseToken(){messaging.getToken().then(n=>{n?(cookie_manager.set_cookie("notify_token",n,3650),cookie_manager.set_cookie("subscribe_site","1",3650),apiRecallAfterSubscribe!==undefined&&apiRecallAfterSubscribe!==null&&$.ajax({url:apiRecallAfterSubscribe,xhrFields:{withCredentials:!0},method:"POST",success:function(n){console.log(n)}})):requestPermission()}).catch(n=>{console.log("An error occurred while retrieving token. ",n)})}function requestPermission(){var n=cookie_manager.get_cookie("subscribe_site");(n===null||n===undefined||n==="")&&$(".notifycation-container").animate({top:"0px"},1e3)}var firebaseConfig,subscribe;!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(n="undefined"!=typeof globalThis?globalThis:n||self).firebase=t()}(this,function(){"use strict";function et(n,t,i,r){return new(i=i||Promise)(function(u,f){function o(n){try{e(r.next(n))}catch(n){f(n)}}function s(n){try{e(r.throw(n))}catch(n){f(n)}}function e(n){var t;n.done?u(n.value):((t=n.value)instanceof i?t:new i(function(n){n(t)})).then(o,s)}e((r=r.apply(n,t||[])).next())})}function bt(n,t){function e(e){return function(o){return function(e){if(f)throw new TypeError("Generator is already executing.");for(;r;)try{if(f=1,u&&(i=2&e[0]?u.return:e[0]?u.throw||((i=u.return)&&i.call(u),0):u.next)&&!(i=i.call(u,e[1])).done)return i;switch(u=0,(e=i?[2&e[0],i.value]:e)[0]){case 0:case 1:i=e;break;case 4:return r.label++,{value:e[1],done:!1};case 5:r.label++;u=e[1];e=[0];continue;case 7:e=r.ops.pop();r.trys.pop();continue;default:if(!(i=0<(i=r.trys).length&&i[i.length-1])&&(6===e[0]||2===e[0])){r=0;continue}if(3===e[0]&&(!i||e[1]>i[0]&&e[1]<i[3])){r.label=e[1];break}if(6===e[0]&&r.label<i[1]){r.label=i[1];i=e;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(e);break}i[2]&&r.ops.pop();r.trys.pop();continue}e=t.call(n,r)}catch(o){e=[6,o];u=0}finally{f=i=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,o])}}var f,u,i,r={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o={next:e(0),"throw":e(1),"return":e(2)};return"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o}function d(n){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&n[t],r=0;if(i)return i.call(n);if(n&&"number"==typeof n.length)return{next:function(){return{value:(n=n&&r>=n.length?void 0:n)&&n[r++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.");}function p(n,t){var i="function"==typeof Symbol&&n[Symbol.iterator],r,f,u,e;if(!i)return n;u=i.call(n);e=[];try{for(;(void 0===t||0<t--)&&!(r=u.next()).done;)e.push(r.value)}catch(n){f={error:n}}finally{try{r&&!r.done&&(i=u.return)&&i.call(u)}finally{if(f)throw f.error;}}return e}function u(n,t){for(var i=0,u=t.length,r=n.length;i<u;i++,r++)n[r]=t[i];return n}function l(n,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:void 0===n&&(n={});break;case Array:n=[];break;default:return t}for(var i in t)t.hasOwnProperty(i)&&"__proto__"!==i&&(n[i]=l(n[i],t[i]));return n}function ot(){var n=this;this.reject=function(){};this.resolve=function(){};this.promise=new Promise(function(t,i){n.resolve=t;n.reject=i})}function g(n,t,i){return t=st.call(this,t)||this,t.code=n,t.customData=i,t.name=dt,Object.setPrototypeOf(t,g.prototype),Error.captureStackTrace&&Error.captureStackTrace(t,nt.prototype.create),t}function ht(n,t,i){this.service=n;this.serviceName=t;this.errors=i}function ct(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function ti(n,t){return t=new ii(n,t),t.subscribe.bind(t)}function o(n,t){var i=this;this.observers=[];this.unsubscribes=[];this.observerCount=0;this.task=Promise.resolve();this.finalized=!1;this.onNoObservers=t;this.task.then(function(){n(i)}).catch(function(n){i.error(n)})}function tt(){}function a(n,t,i){this.name=n;this.instanceFactory=t;this.type=i;this.multipleInstances=!1;this.serviceProps={};this.instantiationMode="LAZY";this.onInstanceCreated=null}function i(n,t){this.name=n;this.container=t;this.component=null;this.instances=new Map;this.instancesDeferred=new Map;this.onInitCallbacks=new Map}function v(n){this.name=n;this.providers=new Map}function fi(n,t){for(var e,f,r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];if(!(t<n.logLevel)){if(e=(new Date).toISOString(),f=oi[t],!f)throw new Error("Attempted to log a message with an invalid logType (value: "+t+")");console[f].apply(console,u(["["+e+"]  "+n.name+":"],r))}}function e(n){this.name=n;this._logLevel=ei;this._logHandler=fi;this._userLogHandler=null;rt.push(this)}function si(n){rt.forEach(function(t){t.setLogLevel(n)})}function hi(n,i){for(var r=0,u=rt;r<u.length;r++)!function(r){var u=null;i&&i.level&&(u=lt[i.level]);r.userLogHandler=null===n?null:function(i,r){for(var o,e=[],f=2;f<arguments.length;f++)e[f-2]=arguments[f];o=e.map(function(n){if(null==n)return null;if("string"==typeof n)return n;if("number"==typeof n||"boolean"==typeof n)return n.toString();if(n instanceof Error)return n.message;try{return JSON.stringify(n)}catch(n){return null}}).filter(function(n){return n}).join(" ");r>=(null!=u?u:i.logLevel)&&n({level:t[r].toLowerCase(),message:o,args:e,type:i.name})}}(u[r])}function f(n,t,i){var r=this;this.firebase_=i;this.isDeleted_=!1;this.name_=t.name;this.automaticDataCollectionEnabled_=t.automaticDataCollectionEnabled||!1;this.options_=l(void 0,n);this.container=new ui(t.name);this._addComponent(new it("app",function(){return r},"PUBLIC"));this.firebase_.INTERNAL.components.forEach(function(n){return r._addComponent(n)})}function li(n){function u(n){if(!ct(t,n=n||w))throw h.create("no-app",{appName:n});return t[n]}function f(f){var s,e=f.name,o,a,v;if(r.has(e))return c.debug("There were multiple attempts to register component "+e+"."),"PUBLIC"===f.type?i[e]:null;for(r.set(e,f),"PUBLIC"===f.type&&(s=function(n){if("function"!=typeof(n=void 0===n?u():n)[e])throw h.create("invalid-app-argument",{appName:e});return n[e]()},void 0!==f.serviceProps&&l(s,f.serviceProps),i[e]=s,n.prototype[e]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this._getService.bind(this,e).apply(this,f.multipleInstances?t:[])}),o=0,a=Object.keys(t);o<a.length;o++)v=a[o],t[v]._addComponent(f);return"PUBLIC"===f.type?i[e]:null}var t={},r=new Map,i={__esModule:!0,initializeApp:function(r,u){void 0===u&&(u={});"object"==typeof u&&null!==u||(u={name:u});var f=u;if(void 0===f.name&&(f.name=w),u=f.name,"string"!=typeof u||!u)throw h.create("bad-app-name",{appName:String(u)});if(ct(t,u))throw h.create("duplicate-app",{appName:u});return f=new n(r,f,i),t[u]=f},app:u,registerVersion:function(n,t,i){var u=null!==(r=ci[n])&&void 0!==r?r:n,r,n;i&&(u+="-"+i);r=u.match(/\s|\//);n=t.match(/\s|\//);r||n?(i=['Unable to register library "'+u+'" with version "'+t+'":'],r&&i.push('library name "'+u+'" contains illegal characters (whitespace or "/")'),r&&n&&i.push("and"),n&&i.push('version name "'+t+'" contains illegal characters (whitespace or "/")'),c.warn(i.join(" "))):f(new it(u+"-version",function(){return{library:u,version:t}},"VERSION"))},setLogLevel:si,onLog:function(n,t){if(null!==n&&"function"!=typeof n)throw h.create("invalid-log-argument");hi(n,t)},apps:null,SDK_VERSION:vt,INTERNAL:{registerComponent:f,removeApp:function(n){delete t[n]},components:r,useAsService:function(n,t){return"serverAuth"!==t?t:null}}};return i.default=i,Object.defineProperty(i,"apps",{get:function(){return Object.keys(t).map(function(n){return t[n]})}}),u.App=n,i}function pt(n){this.container=n}var ft=function(n,t){return(ft=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])})(n,t)},k=function(){return(k=Object.assign||function(n){for(var r,i,t=1,u=arguments.length;t<u;t++)for(i in r=arguments[t])Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i]);return n}).apply(this,arguments)},kt=(ot.prototype.wrapCallback=function(n){var t=this;return function(i,r){i?t.reject(i):t.resolve(r);"function"==typeof n&&(t.promise.catch(function(){}),1===n.length?n(i):n(i,r))}},ot),st,dt="FirebaseError",gt=(function(n,t){function i(){this.constructor=n}if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");ft(n,t);n.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(g,st=Error),g),nt=(ht.prototype.create=function(n){for(var i=[],t=1;t<arguments.length;t++)i[t-1]=arguments[t];var r,u=i[0]||{},f=this.service+"/"+n,n=this.errors[n],n=n?(r=u,n.replace(ni,function(n,t){var i=r[t];return null!=i?String(i):"<"+t+"?>"})):"Error",n=this.serviceName+": "+n+" ("+f+").";return new gt(f,n,u)},ht),ni=/\{\$([^}]+)}/g,ii=(o.prototype.next=function(n){this.forEachObserver(function(t){t.next(n)})},o.prototype.error=function(n){this.forEachObserver(function(t){t.error(n)});this.close(n)},o.prototype.complete=function(){this.forEachObserver(function(n){n.complete()});this.close()},o.prototype.subscribe=function(n,t,i){var r,u=this;if(void 0===n&&void 0===t&&void 0===i)throw new Error("Missing Observer.");return void 0===(r=function(n,t){var i,r,u;if("object"!=typeof n||null===n)return!1;for(i=0,r=t;i<r.length;i++)if(u=r[i],u in n&&"function"==typeof n[u])return!0;return!1}(n,["next","error","complete"])?n:{next:n,error:t,complete:i}).next&&(r.next=tt),void 0===r.error&&(r.error=tt),void 0===r.complete&&(r.complete=tt),i=this.unsubscribeOne.bind(this,this.observers.length),this.finalized&&this.task.then(function(){try{u.finalError?r.error(u.finalError):r.complete()}catch(n){}}),this.observers.push(r),i},o.prototype.unsubscribeOne=function(n){void 0!==this.observers&&void 0!==this.observers[n]&&(delete this.observers[n],--this.observerCount,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))},o.prototype.forEachObserver=function(n){if(!this.finalized)for(var t=0;t<this.observers.length;t++)this.sendOne(t,n)},o.prototype.sendOne=function(n,t){var i=this;this.task.then(function(){if(void 0!==i.observers&&void 0!==i.observers[n])try{t(i.observers[n])}catch(n){"undefined"!=typeof console&&console.error&&console.error(n)}})},o.prototype.close=function(n){var t=this;this.finalized||(this.finalized=!0,void 0!==n&&(this.finalError=n),this.task.then(function(){t.observers=void 0;t.onNoObservers=void 0}))},o),it=(a.prototype.setInstantiationMode=function(n){return this.instantiationMode=n,this},a.prototype.setMultipleInstances=function(n){return this.multipleInstances=n,this},a.prototype.setServiceProps=function(n){return this.serviceProps=n,this},a.prototype.setInstanceCreatedCallback=function(n){return this.onInstanceCreated=n,this},a),s="[DEFAULT]",ri=(i.prototype.get=function(n){var t=this.normalizeInstanceIdentifier(n),i;if(!this.instancesDeferred.has(t)&&(n=new kt,this.instancesDeferred.set(t,n),this.isInitialized(t)||this.shouldAutoInitialize()))try{i=this.getOrInitializeService({instanceIdentifier:t});i&&n.resolve(i)}catch(n){}return this.instancesDeferred.get(t).promise},i.prototype.getImmediate=function(n){var t=this.normalizeInstanceIdentifier(null==n?void 0:n.identifier),n=null!==(n=null==n?void 0:n.optional)&&void 0!==n&&n;if(!this.isInitialized(t)&&!this.shouldAutoInitialize()){if(n)return null;throw Error("Service "+this.name+" is not available");}try{return this.getOrInitializeService({instanceIdentifier:t})}catch(t){if(n)return null;throw t;}},i.prototype.getComponent=function(){return this.component},i.prototype.setComponent=function(n){var r,u,i,t,e;if(n.name!==this.name)throw Error("Mismatching Component "+n.name+" for Provider "+this.name+".");if(this.component)throw Error("Component for "+this.name+" has already been provided");if(this.component=n,this.shouldAutoInitialize()){if("EAGER"===n.instantiationMode)try{this.getOrInitializeService({instanceIdentifier:s})}catch(n){}try{for(i=d(this.instancesDeferred.entries()),t=i.next();!t.done;t=i.next()){var f=p(t.value,2),o=f[0],h=f[1],c=this.normalizeInstanceIdentifier(o);try{e=this.getOrInitializeService({instanceIdentifier:c});h.resolve(e)}catch(n){}}}catch(n){r={error:n}}finally{try{t&&!t.done&&(u=i.return)&&u.call(i)}finally{if(r)throw r.error;}}}},i.prototype.clearInstance=function(n){this.instancesDeferred.delete(n=void 0===n?s:n);this.instances.delete(n)},i.prototype.delete=function(){return et(this,void 0,void 0,function(){var n;return bt(this,function(t){switch(t.label){case 0:return n=Array.from(this.instances.values()),[4,Promise.all(u(u([],p(n.filter(function(n){return"INTERNAL"in n}).map(function(n){return n.INTERNAL.delete()}))),p(n.filter(function(n){return"_delete"in n}).map(function(n){return n._delete()}))))];case 1:return t.sent(),[2]}})})},i.prototype.isComponentSet=function(){return null!=this.component},i.prototype.isInitialized=function(n){return this.instances.has(n=void 0===n?s:n)},i.prototype.initialize=function(n){var f,o,e=(n=void 0===n?{}:n).options,e=void 0===e?{}:e,i=this.normalizeInstanceIdentifier(n.instanceIdentifier),u,r,t;if(this.isInitialized(i))throw Error(this.name+"("+i+") has already been initialized");if(!this.isComponentSet())throw Error("Component "+this.name+" has not been registered yet");u=this.getOrInitializeService({instanceIdentifier:i,options:e});try{for(r=d(this.instancesDeferred.entries()),t=r.next();!t.done;t=r.next()){var s=p(t.value,2),h=s[0],c=s[1];i===this.normalizeInstanceIdentifier(h)&&c.resolve(u)}}catch(n){f={error:n}}finally{try{t&&!t.done&&(o=r.return)&&o.call(r)}finally{if(f)throw f.error;}}return this.invokeOnInitCallbacks(u,i),u},i.prototype.onInit=function(n,t){var i=this.normalizeInstanceIdentifier(t),r=null!==(t=this.onInitCallbacks.get(i))&&void 0!==t?t:new Set;return r.add(n),this.onInitCallbacks.set(i,r),t=this.instances.has(i),t&&n(t,i),function(){r.delete(n)}},i.prototype.invokeOnInitCallbacks=function(n,t){var u,f,e=this.onInitCallbacks.get(t),r,i,o;if(e)try{for(r=d(e),i=r.next();!i.done;i=r.next()){o=i.value;try{o(n,t)}catch(n){}}}catch(n){u={error:n}}finally{try{i&&!i.done&&(f=r.return)&&f.call(r)}finally{if(u)throw u.error;}}},i.prototype.getOrInitializeService=function(n){var t=n.instanceIdentifier,i=n.options,r=void 0===i?{}:i,n=this.instances.get(t);if(!n&&this.component&&(n=this.component.instanceFactory(this.container,{instanceIdentifier:(i=t)===s?void 0:i,options:r}),this.instances.set(t,n),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,t,n)}catch(n){}return n||null},i.prototype.normalizeInstanceIdentifier=function(n){return void 0===n&&(n=s),!this.component||this.component.multipleInstances?n:s},i.prototype.shouldAutoInitialize=function(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode},i),ui=(v.prototype.addComponent=function(n){var t=this.getProvider(n.name);if(t.isComponentSet())throw new Error("Component "+n.name+" has already been registered with "+this.name);t.setComponent(n)},v.prototype.addOrOverwriteComponent=function(n){this.getProvider(n.name).isComponentSet()&&this.providers.delete(n.name);this.addComponent(n)},v.prototype.getProvider=function(n){if(this.providers.has(n))return this.providers.get(n);var t=new ri(n,this);return this.providers.set(n,t),t},v.prototype.getProviders=function(){return Array.from(this.providers.values())},v),t,rt=[],vt,n,yt,wt,ut,ai,y;(r=t=t||{})[r.DEBUG=0]="DEBUG";r[r.VERBOSE=1]="VERBOSE";r[r.INFO=2]="INFO";r[r.WARN=3]="WARN";r[r.ERROR=4]="ERROR";r[r.SILENT=5]="SILENT";var lt={debug:t.DEBUG,verbose:t.VERBOSE,info:t.INFO,warn:t.WARN,error:t.ERROR,silent:t.SILENT},ei=t.INFO,oi=((n={})[t.DEBUG]="log",n[t.VERBOSE]="log",n[t.INFO]="info",n[t.WARN]="warn",n[t.ERROR]="error",n),r=(Object.defineProperty(e.prototype,"logLevel",{get:function(){return this._logLevel},set:function(n){if(!(n in t))throw new TypeError('Invalid value "'+n+'" assigned to `logLevel`');this._logLevel=n},enumerable:!1,configurable:!0}),e.prototype.setLogLevel=function(n){this._logLevel="string"==typeof n?lt[n]:n},Object.defineProperty(e.prototype,"logHandler",{get:function(){return this._logHandler},set:function(n){if("function"!=typeof n)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userLogHandler",{get:function(){return this._userLogHandler},set:function(n){this._userLogHandler=n},enumerable:!1,configurable:!0}),e.prototype.debug=function(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,u([this,t.DEBUG],i));this._logHandler.apply(this,u([this,t.DEBUG],i))},e.prototype.log=function(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,u([this,t.VERBOSE],i));this._logHandler.apply(this,u([this,t.VERBOSE],i))},e.prototype.info=function(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,u([this,t.INFO],i));this._logHandler.apply(this,u([this,t.INFO],i))},e.prototype.warn=function(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,u([this,t.WARN],i));this._logHandler.apply(this,u([this,t.WARN],i))},e.prototype.error=function(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,u([this,t.ERROR],i));this._logHandler.apply(this,u([this,t.ERROR],i))},e);var n=((n={})["no-app"]="No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()",n["bad-app-name"]="Illegal App name: '{$appName}",n["duplicate-app"]="Firebase App named '{$appName}' already exists",n["app-deleted"]="Firebase App named '{$appName}' already deleted",n["invalid-app-argument"]="firebase.{$appName}() takes either no argument or a Firebase App instance.",n["invalid-log-argument"]="First argument to `onLog` must be null or a function.",n),h=new nt("app","Firebase",n),at="@firebase/app",w="[DEFAULT]",ci=((n={})[at]="fire-core",n["@firebase/analytics"]="fire-analytics",n["@firebase/app-check"]="fire-app-check",n["@firebase/auth"]="fire-auth",n["@firebase/database"]="fire-rtdb",n["@firebase/functions"]="fire-fn",n["@firebase/installations"]="fire-iid",n["@firebase/messaging"]="fire-fcm",n["@firebase/performance"]="fire-perf",n["@firebase/remote-config"]="fire-rc",n["@firebase/storage"]="fire-gcs",n["@firebase/firestore"]="fire-fst",n["fire-js"]="fire-js",n["firebase-wrapper"]="fire-js-all",n),c=new r("@firebase/app"),b=(Object.defineProperty(f.prototype,"automaticDataCollectionEnabled",{get:function(){return this.checkDestroyed_(),this.automaticDataCollectionEnabled_},set:function(n){this.checkDestroyed_();this.automaticDataCollectionEnabled_=n},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"name",{get:function(){return this.checkDestroyed_(),this.name_},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"options",{get:function(){return this.checkDestroyed_(),this.options_},enumerable:!1,configurable:!0}),f.prototype.delete=function(){var n=this;return new Promise(function(t){n.checkDestroyed_();t()}).then(function(){return n.firebase_.INTERNAL.removeApp(n.name_),Promise.all(n.container.getProviders().map(function(n){return n.delete()}))}).then(function(){n.isDeleted_=!0})},f.prototype._getService=function(n,t){void 0===t&&(t=w);this.checkDestroyed_();var i=this.container.getProvider(n);return i.isInitialized()||"EXPLICIT"!==(null===(n=i.getComponent())||void 0===n?void 0:n.instantiationMode)||i.initialize(),i.getImmediate({identifier:t})},f.prototype._removeServiceInstance=function(n,t){void 0===t&&(t=w);this.container.getProvider(n).clearInstance(t)},f.prototype._addComponent=function(n){try{this.container.addComponent(n)}catch(t){c.debug("Component "+n.name+" failed to register with FirebaseApp "+this.name,t)}},f.prototype._addOrOverwriteComponent=function(n){this.container.addOrOverwriteComponent(n)},f.prototype.toJSON=function(){return{name:this.name,automaticDataCollectionEnabled:this.automaticDataCollectionEnabled,options:this.options}},f.prototype.checkDestroyed_=function(){if(this.isDeleted_)throw h.create("app-deleted",{appName:this.name_});},f);return b.prototype.name&&b.prototype.options||b.prototype.delete||console.log("dc"),vt="8.6.7",n=function et(){var n=li(b);return n.INTERNAL=k(k({},n.INTERNAL),{createFirebaseNamespace:et,extendNamespace:function(t){l(n,t)},createSubscribe:ti,ErrorFactory:nt,deepExtend:l}),n}(),yt=(pt.prototype.getPlatformInfoString=function(){return this.container.getProviders().map(function(n){return function(n){return n=n.getComponent(),"VERSION"===(null==n?void 0:n.type)}(n)?(n=n.getImmediate(),n.library+"/"+n.version):null}).filter(function(n){return n}).join(" ")},pt),"object"==typeof self&&self.self===self&&void 0!==self.firebase&&(c.warn("\n    Warning: Firebase is already defined in the global scope. Please make sure\n    Firebase library is only loaded once.\n  "),(r=self.firebase.SDK_VERSION)&&0<=r.indexOf("LITE")&&c.warn("\n    Warning: You are trying to load Firebase while using Firebase Performance standalone script.\n    You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.\n    ")),wt=n.initializeApp,n.initializeApp=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return function(){try{return"[object process]"===Object.prototype.toString.call(global.process)}catch(n){return}}()&&c.warn('\n      Warning: This is a browser-targeted Firebase bundle but it appears it is being\n      run in a Node environment.  If running in a Node environment, make sure you\n      are using the bundle specified by the "main" field in package.json.\n      \n      If you are using Webpack, you can specify "main" as the first item in\n      "resolve.mainFields":\n      https://webpack.js.org/configuration/resolve/#resolvemainfields\n      \n      If using Rollup, use the @rollup/plugin-node-resolve plugin and specify "main"\n      as the first item in "mainFields", e.g. [\'main\', \'module\'].\n      https://github.com/rollup/@rollup/plugin-node-resolve\n      '),wt.apply(void 0,t)},y=n,(ut=y).INTERNAL.registerComponent(new it("platform-logger",function(n){return new yt(n)},"PRIVATE")),ut.registerVersion(at,"0.6.26",ai),ut.registerVersion("fire-js",""),y.registerVersion("firebase","8.6.7","app"),y.SDK_VERSION="8.6.7",y});!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("@firebase/app")):"function"==typeof define&&define.amd?define(["@firebase/app"],t):t((n="undefined"!=typeof globalThis?globalThis:n||self).firebase)}(this,function(n){"use strict";try{!function(){function vu(n){return n&&"object"==typeof n&&"default"in n?n:{"default":n}}function t(n,t,i,r){return new(i=i||Promise)(function(u,f){function o(n){try{e(r.next(n))}catch(n){f(n)}}function s(n){try{e(r.throw(n))}catch(n){f(n)}}function e(n){var t;n.done?u(n.value):((t=n.value)instanceof i?t:new i(function(n){n(t)})).then(o,s)}e((r=r.apply(n,t||[])).next())})}function i(n,t){function e(e){return function(o){return function(e){if(f)throw new TypeError("Generator is already executing.");for(;r;)try{if(f=1,u&&(i=2&e[0]?u.return:e[0]?u.throw||((i=u.return)&&i.call(u),0):u.next)&&!(i=i.call(u,e[1])).done)return i;switch(u=0,(e=i?[2&e[0],i.value]:e)[0]){case 0:case 1:i=e;break;case 4:return r.label++,{value:e[1],done:!1};case 5:r.label++;u=e[1];e=[0];continue;case 7:e=r.ops.pop();r.trys.pop();continue;default:if(!(i=0<(i=r.trys).length&&i[i.length-1])&&(6===e[0]||2===e[0])){r=0;continue}if(3===e[0]&&(!i||e[1]>i[0]&&e[1]<i[3])){r.label=e[1];break}if(6===e[0]&&r.label<i[1]){r.label=i[1];i=e;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(e);break}i[2]&&r.ops.pop();r.trys.pop();continue}e=t.call(n,r)}catch(o){e=[6,o];u=0}finally{f=i=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,o])}}var f,u,i,r={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o={next:e(0),"throw":e(1),"return":e(2)};return"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o}function d(n){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&n[t],r=0;if(i)return i.call(n);if(n&&"number"==typeof n.length)return{next:function(){return{value:(n=n&&r>=n.length?void 0:n)&&n[r++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.");}function yi(n,t){var i="function"==typeof Symbol&&n[Symbol.iterator],r,f,u,e;if(!i)return n;u=i.call(n);e=[];try{for(;(void 0===t||0<t--)&&!(r=u.next()).done;)e.push(r.value)}catch(n){f={error:n}}finally{try{r&&!r.done&&(i=u.return)&&i.call(u)}finally{if(f)throw f.error;}}return e}function pi(n,t){for(var i=0,u=t.length,r=n.length;i<u;i++,r++)n[r]=t[i];return n}function at(n,t,i){return t=wi.call(this,t)||this,t.code=n,t.customData=i,t.name=yu,Object.setPrototypeOf(t,at.prototype),Error.captureStackTrace&&Error.captureStackTrace(t,vt.prototype.create),t}function ki(n,t,i){this.service=n;this.serviceName=t;this.errors=i}function g(n,t,i){this.name=n;this.instanceFactory=t;this.type=i;this.multipleInstances=!1;this.serviceProps={};this.instantiationMode="LAZY";this.onInstanceCreated=null}function gi(n){return new Promise(function(t,i){n.onsuccess=function(){t(n.result)};n.onerror=function(){i(n.error)}})}function ut(n,t,i){var r,u=new Promise(function(u,f){gi(r=n[t].apply(n,i)).then(u,f)});return u.request=r,u}function w(n,t,i){i.forEach(function(i){Object.defineProperty(n.prototype,i,{get:function(){return this[t][i]},set:function(n){this[t][i]=n}})})}function yt(n,t,i,r){r.forEach(function(r){r in i.prototype&&(n.prototype[r]=function(){return ut(this[t],r,arguments)})})}function ft(n,t,i,r){r.forEach(function(r){r in i.prototype&&(n.prototype[r]=function(){return this[t][r].apply(this[t],arguments)})})}function nr(n,t,i,r){r.forEach(function(r){r in i.prototype&&(n.prototype[r]=function(){return n=this[t],(i=ut(n,r,arguments)).then(function(n){if(n)return new nt(n,i.request)});var n,i})})}function c(n){this._index=n}function nt(n,t){this._cursor=n;this._request=t}function s(n){this._store=n}function tt(n){this._tx=n;this.complete=new Promise(function(t,i){n.oncomplete=function(){t()};n.onerror=function(){i(n.error)};n.onabort=function(){i(n.error)}})}function et(n,t,i){this._db=n;this.oldVersion=t;this.transaction=new tt(i)}function ot(n){this._db=n}function pt(n,t,i){var t=ut(indexedDB,"open",[n,t]),r=t.request;return r&&(r.onupgradeneeded=function(n){i&&i(new et(r.result,n.oldVersion,r.transaction))}),t.then(function(n){return new ot(n)})}function wt(n){return ut(indexedDB,"deleteDatabase",[n])}function fr(n){return n instanceof bi&&n.code.includes("request-failed")}function bt(n){return n=n.projectId,wu+"/projects/"+n+"/installations"}function er(n){return{token:n.token,requestStatus:2,expiresIn:(n=n.expiresIn,Number(n.replace("s","000"))),creationTime:Date.now()}}function kt(n,r){return t(this,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return[4,r.json()];case 1:return t=i.sent(),t=t.error,[2,h.create("request-failed",{requestName:n,serverCode:t.code,serverMessage:t.message,serverStatus:t.status})]}})})}function or(n){return n=n.apiKey,new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":n})}function sr(n,t){return t=t.refreshToken,n=or(n),n.append("Authorization",ur+" "+t),n}function dt(n){return t(this,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return[4,n()];case 1:return 500<=(t=i.sent()).status&&t.status<600?[2,n()]:[2,t]}})})}function hr(n){return new Promise(function(t){setTimeout(t,n)})}function ku(){var n,t;try{return n=new Uint8Array(17),(self.crypto||self.msCrypto).getRandomValues(n),n[0]=112+n[0]%16,t=function(n){return btoa(String.fromCharCode.apply(String,pi([],yi(n)))).replace(/\+/g,"-").replace(/\//g,"_")}(n).substr(0,22),cr.test(t)?t:st}catch(n){return st}}function b(n){return n.appName+"!"+n.appId}function lr(n,t){n=b(n);ar(n,t),function(n,t){var i=vr();i&&i.postMessage({key:n,fid:t});yr()}(n,t)}function ar(n,t){var u,f,n=l.get(n),r,i;if(n)try{for(r=d(n),i=r.next();!i.done;i=r.next())i.value(t)}catch(n){u={error:n}}finally{try{i&&!i.done&&(f=r.return)&&f.call(r)}finally{if(u)throw u.error;}}}function vr(){return!a&&"BroadcastChannel"in self&&((a=new BroadcastChannel("[Firebase] FID Change")).onmessage=function(n){ar(n.data.key,n.data.fid)}),a}function yr(){0===l.size&&a&&(a.close(),a=null)}function gt(){return wr=wr||pt(du,gu,function(n){0===n.oldVersion&&n.createObjectStore(v)})}function ht(n,r){return t(this,void 0,void 0,function(){var u,f,t,e;return i(this,function(i){switch(i.label){case 0:return u=b(n),[4,gt()];case 1:return t=i.sent(),f=t.transaction(v,"readwrite"),[4,(t=f.objectStore(v)).get(u)];case 2:return e=i.sent(),[4,t.put(r,u)];case 3:return i.sent(),[4,f.complete];case 4:return i.sent(),e&&e.fid===r.fid||lr(n,r.fid),[2,r]}})})}function ni(n){return t(this,void 0,void 0,function(){var r,t;return i(this,function(i){switch(i.label){case 0:return r=b(n),[4,gt()];case 1:return t=i.sent(),[4,(t=t.transaction(v,"readwrite")).objectStore(v).delete(r)];case 2:return i.sent(),[4,t.complete];case 3:return i.sent(),[2]}})})}function it(n,r){return t(this,void 0,void 0,function(){var f,o,u,e,t;return i(this,function(i){switch(i.label){case 0:return f=b(n),[4,gt()];case 1:return u=i.sent(),o=u.transaction(v,"readwrite"),[4,(u=o.objectStore(v)).get(f)];case 2:return e=i.sent(),void 0!==(t=r(e))?[3,4]:[4,u.delete(f)];case 3:return i.sent(),[3,6];case 4:return[4,u.put(t,f)];case 5:i.sent();i.label=6;case 6:return[4,o.complete];case 7:return i.sent(),!t||e&&e.fid===t.fid||lr(n,t.fid),[2,t]}})})}function ti(n){return t(this,void 0,void 0,function(){var r,f,u;return i(this,function(e){switch(e.label){case 0:return[4,it(n,function(u){return u=kr(u||{fid:ku(),registrationStatus:0}),u=function(n,r){if(0!==r.registrationStatus)return 1===r.registrationStatus?{installationEntry:r,registrationPromise:function(n){return t(this,void 0,void 0,function(){var t,u,r;return i(this,function(i){switch(i.label){case 0:return[4,br(n)];case 1:t=i.sent();i.label=2;case 2:return 1!==t.registrationStatus?[3,5]:[4,hr(100)];case 3:return i.sent(),[4,br(n)];case 4:return t=i.sent(),[3,2];case 5:return 0!==t.registrationStatus?[3,7]:[4,ti(n)];case 6:return r=i.sent(),u=r.installationEntry,(r=r.registrationPromise)?[2,r]:[2,u];case 7:return[2,t]}})})}(n)}:{installationEntry:r};if(!navigator.onLine){var u=Promise.reject(h.create("app-offline"));return{installationEntry:r,registrationPromise:u}}return r={fid:r.fid,registrationStatus:1,registrationTime:Date.now()},n=function(n,r){return t(this,void 0,void 0,function(){var f,u;return i(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,7]),[4,function(n,r){var u=r.fid;return t(this,void 0,void 0,function(){var f,e,o,r,t;return i(this,function(i){switch(i.label){case 0:return f=bt(n),e=or(n),t={fid:u,authVersion:ur,appId:n.appId,sdkVersion:rr},o={method:"POST",headers:e,body:JSON.stringify(t)},[4,dt(function(){return fetch(f,o)})];case 1:return(r=i.sent()).ok?[4,r.json()]:[3,3];case 2:return t=i.sent(),[2,{fid:t.fid||u,registrationStatus:2,refreshToken:t.refreshToken,authToken:er(t.authToken)}];case 3:return[4,kt("Create Installation",r)];case 4:throw i.sent();}})})}(n,r)];case 1:return f=e.sent(),[2,ht(n,f)];case 2:return fr(u=e.sent())&&409===u.customData.serverCode?[4,ni(n)]:[3,4];case 3:return e.sent(),[3,6];case 4:return[4,ht(n,{fid:r.fid,registrationStatus:0})];case 5:e.sent();e.label=6;case 6:throw u;case 7:return[2]}})})}(n,r),{installationEntry:r,registrationPromise:n}}(n,u),r=u.registrationPromise,u.installationEntry})];case 1:return(f=e.sent()).fid!==st?[3,3]:(u={},[4,r]);case 2:return[2,(u.installationEntry=e.sent(),u)];case 3:return[2,{installationEntry:f,registrationPromise:r}]}})})}function br(n){return it(n,function(n){if(!n)throw h.create("installation-not-found");return kr(n)})}function kr(n){return 1===(t=n).registrationStatus&&t.registrationTime+ir<Date.now()?{fid:n.fid,registrationStatus:0}:n;var t}function nf(n,r){var u=n.appConfig,f=n.platformLoggerProvider;return t(this,void 0,void 0,function(){var o,t,s,e,n;return i(this,function(i){switch(i.label){case 0:return o=function(n,t){return t=t.fid,bt(n)+"/"+t+"/authTokens:generate"}(u,r),t=sr(u,r),(n=f.getImmediate({optional:!0}))&&t.append("x-firebase-client",n.getPlatformInfoString()),n={installation:{sdkVersion:rr}},s={method:"POST",headers:t,body:JSON.stringify(n)},[4,dt(function(){return fetch(o,s)})];case 1:return(e=i.sent()).ok?[4,e.json()]:[3,3];case 2:return n=i.sent(),[2,er(n)];case 3:return[4,kt("Generate Auth Token",e)];case 4:throw i.sent();}})})}function ii(n,r){return void 0===r&&(r=!1),t(this,void 0,void 0,function(){var u,e,f;return i(this,function(s){switch(s.label){case 0:return[4,it(n.appConfig,function(f){if(!gr(f))throw h.create("not-registered");var s,e=f.authToken;if(r||2!==(s=e).requestStatus||function(n){var t=Date.now();return t<n.creationTime||n.creationTime+n.expiresIn<t+bu}(s)){if(1===e.requestStatus)return u=function(n,r){return t(this,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return[4,dr(n.appConfig)];case 1:t=i.sent();i.label=2;case 2:return 1!==t.authToken.requestStatus?[3,5]:[4,hr(100)];case 3:return i.sent(),[4,dr(n.appConfig)];case 4:return t=i.sent(),[3,2];case 5:return 0===(t=t.authToken).requestStatus?[2,ii(n,r)]:[2,t]}})})}(n,r),f;if(!navigator.onLine)throw h.create("app-offline");return e=(s=f,e={requestStatus:1,requestTime:Date.now()},o(o({},s),{authToken:e})),u=function(n,r){return t(this,void 0,void 0,function(){var f,t,u;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,8]),[4,nf(n,r)];case 1:return f=i.sent(),u=o(o({},r),{authToken:f}),[4,ht(n.appConfig,u)];case 2:return i.sent(),[2,f];case 3:return!fr(t=i.sent())||401!==t.customData.serverCode&&404!==t.customData.serverCode?[3,5]:[4,ni(n.appConfig)];case 4:return i.sent(),[3,7];case 5:return u=o(o({},r),{authToken:{requestStatus:0}}),[4,ht(n.appConfig,u)];case 6:i.sent();i.label=7;case 7:throw t;case 8:return[2]}})})}(n,e),e}return f})];case 1:return e=s.sent(),u?[4,u]:[3,3];case 2:return f=s.sent(),[3,4];case 3:f=e.authToken;s.label=4;case 4:return[2,f]}})})}function dr(n){return it(n,function(n){if(!gr(n))throw h.create("not-registered");var t=n.authToken;return 1===(t=t).requestStatus&&t.requestTime+ir<Date.now()?o(o({},n),{authToken:{requestStatus:0}}):n})}function gr(n){return void 0!==n&&2===n.registrationStatus}function tf(n,r){return void 0===r&&(r=!1),t(this,void 0,void 0,function(){return i(this,function(u){switch(u.label){case 0:return[4,function(n){return t(this,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return[4,ti(n)];case 1:return(t=i.sent().registrationPromise)?[4,t]:[3,3];case 2:i.sent();i.label=3;case 3:return[2]}})})}(n.appConfig)];case 1:return u.sent(),[4,ii(n,r)];case 2:return[2,u.sent().token]}})})}function rf(n,r){return t(this,void 0,void 0,function(){var u,f,t;return i(this,function(i){switch(i.label){case 0:return u=function(n,t){return t=t.fid,bt(n)+"/"+t}(n,r),t=sr(n,r),f={method:"DELETE",headers:t},[4,dt(function(){return fetch(u,f)})];case 1:return(t=i.sent()).ok?[3,3]:[4,kt("Delete Installation",t)];case 2:throw i.sent();case 3:return[2]}})})}function uf(n,t){var i=n.appConfig;return function(n,t){vr();var i=b(n);(n=l.get(i))||(n=new Set,l.set(i,n));n.add(t)}(i,t),function(){var n,u,r;u=t;r=b(n=i);(n=l.get(r))&&(n.delete(u),0===n.size&&l.delete(r),yr())}}function ri(n){return h.create("missing-app-config-values",{valueName:n})}function k(n){return n=new Uint8Array(n),btoa(String.fromCharCode.apply(String,pi([],yi(n)))).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function of(n){return t(this,void 0,void 0,function(){var u,r,f=this;return i(this,function(e){switch(e.label){case 0:return"databases"in indexedDB?[4,indexedDB.databases()]:[3,2];case 1:if(u=e.sent(),!u.map(function(n){return n.name}).includes(ui))return[2,null];e.label=2;case 2:return r=null,[4,pt(ui,ef,function(u){return t(f,void 0,void 0,function(){var e,t,f;return i(this,function(i){switch(i.label){case 0:return u.oldVersion<2?[2]:u.objectStoreNames.contains(iu)?[4,(f=u.transaction.objectStore(iu)).index("fcmSenderId").get(n)]:[2];case 1:return e=i.sent(),[4,f.clear()];case 2:if(i.sent(),!e)return[2];if(2===u.oldVersion){if(!(t=e).auth||!t.p256dh||!t.endpoint)return[2];r={token:t.fcmToken,createTime:null!==(f=t.createTime)&&void 0!==f?f:Date.now(),subscriptionOptions:{auth:t.auth,p256dh:t.p256dh,endpoint:t.endpoint,swScope:t.swScope,vapidKey:"string"==typeof t.vapidKey?t.vapidKey:k(t.vapidKey)}}}else(3===u.oldVersion||4===u.oldVersion)&&(r={token:(t=e).fcmToken,createTime:t.createTime,subscriptionOptions:{auth:k(t.auth),p256dh:k(t.p256dh),endpoint:t.endpoint,swScope:t.swScope,vapidKey:k(t.vapidKey)}});return[2]}})})})];case 3:return e.sent().close(),[4,wt(ui)];case 4:return e.sent(),[4,wt("fcm_vapid_details_db")];case 5:return e.sent(),[4,wt("undefined")];case 6:return e.sent(),[2,function(n){if(!n||!n.subscriptionOptions)return!1;var t=n.subscriptionOptions;return"number"==typeof n.createTime&&0<n.createTime&&"string"==typeof n.token&&0<n.token.length&&"string"==typeof t.auth&&0<t.auth.length&&"string"==typeof t.p256dh&&0<t.p256dh.length&&"string"==typeof t.endpoint&&0<t.endpoint.length&&"string"==typeof t.swScope&&0<t.swScope.length&&"string"==typeof t.vapidKey&&0<t.vapidKey.length}(r)?r:null]}})})}function fi(){return ru=ru||pt(sf,hf,function(n){0===n.oldVersion&&n.createObjectStore(p)})}function lt(n){return t(this,void 0,void 0,function(){var t,r;return i(this,function(i){switch(i.label){case 0:return t=oi(n),[4,fi()];case 1:return[4,i.sent().transaction(p).objectStore(p).get(t)];case 2:return(t=i.sent())?[2,t]:[3,3];case 3:return[4,of(n.appConfig.senderId)];case 4:return(r=i.sent())?[4,ei(n,r)]:[3,6];case 5:return i.sent(),[2,r];case 6:return[2]}})})}function ei(n,r){return t(this,void 0,void 0,function(){var u,t;return i(this,function(i){switch(i.label){case 0:return u=oi(n),[4,fi()];case 1:return t=i.sent(),[4,(t=t.transaction(p,"readwrite")).objectStore(p).put(r,u)];case 2:return i.sent(),[4,t.complete];case 3:return i.sent(),[2,r]}})})}function oi(n){return n.appConfig.appId}function uu(n,r){return t(this,void 0,void 0,function(){var t,f;return i(this,function(i){switch(i.label){case 0:return[4,hi(n)];case 1:t=i.sent();t={method:"DELETE",headers:t};i.label=2;case 2:return i.trys.push([2,5,,6]),[4,fetch(si(n.appConfig)+"/"+r,t)];case 3:return[4,i.sent().json()];case 4:if((t=i.sent()).error)throw f=t.error.message,u.create("token-unsubscribe-failed",{errorInfo:f});return[3,6];case 5:throw f=i.sent(),u.create("token-unsubscribe-failed",{errorInfo:f});case 6:return[2]}})})}function si(n){return n=n.projectId,ff+"/projects/"+n+"/registrations"}function hi(n){var r=n.appConfig,u=n.installations;return t(this,void 0,void 0,function(){var n;return i(this,function(t){switch(t.label){case 0:return[4,u.getToken()];case 1:return n=t.sent(),[2,new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":r.apiKey,"x-goog-firebase-installations-auth":"FIS "+n})]}})})}function fu(n){var t=n.p256dh,i=n.auth,r=n.endpoint,n=n.vapidKey,t={web:{endpoint:r,auth:i,p256dh:t}};return n!==ct&&(t.web.applicationPubKey=n),t}function ci(n,r,f){return t(this,void 0,void 0,function(){var s,e,h;return i(this,function(c){switch(c.label){case 0:if("granted"!==Notification.permission)throw u.create("permission-blocked");return[4,function(n,r){return t(this,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return[4,n.pushManager.getSubscription()];case 1:return(t=i.sent())?[2,t]:[2,n.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:function(n){for(var n=(n+"=".repeat((4-n.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),i=atob(n),r=new Uint8Array(i.length),t=0;t<i.length;++t)r[t]=i.charCodeAt(t);return r}(r)})]}})})}(r,f)];case 1:return h=c.sent(),[4,lt(n)];case 2:return s=c.sent(),e={vapidKey:f,swScope:r.scope,endpoint:h.endpoint,auth:k(h.getKey("auth")),p256dh:k(h.getKey("p256dh"))},s?[3,3]:[2,eu(n,e)];case 3:if(l=s.subscriptionOptions,a=e.vapidKey===l.vapidKey,v=e.endpoint===l.endpoint,y=e.auth===l.auth,l=e.p256dh===l.p256dh,a&&v&&y&&l)return[3,8];c.label=4;case 4:return c.trys.push([4,6,,7]),[4,uu(n,s.token)];case 5:return c.sent(),[3,7];case 6:return h=c.sent(),console.warn(h),[3,7];case 7:return[2,eu(n,e)];case 8:return Date.now()>=s.createTime+6048e5?[2,function(n,r,f){return t(this,void 0,void 0,function(){var e,s,h;return i(this,function(c){switch(c.label){case 0:return c.trys.push([0,3,,5]),[4,function(n,r){return t(this,void 0,void 0,function(){var o,f,t,e;return i(this,function(i){switch(i.label){case 0:return[4,hi(n)];case 1:o=i.sent();f=fu(r.subscriptionOptions);f={method:"PATCH",headers:o,body:JSON.stringify(f)};i.label=2;case 2:return i.trys.push([2,5,,6]),[4,fetch(si(n.appConfig)+"/"+r.token,f)];case 3:return[4,i.sent().json()];case 4:return t=i.sent(),[3,6];case 5:throw e=i.sent(),u.create("token-update-failed",{errorInfo:e});case 6:if(t.error)throw e=t.error.message,u.create("token-update-failed",{errorInfo:e});if(!t.token)throw u.create("token-update-no-token");return[2,t.token]}})})}(r,n)];case 1:return e=c.sent(),s=o(o({},n),{token:e,createTime:Date.now()}),[4,ei(r,s)];case 2:return c.sent(),[2,e];case 3:return h=c.sent(),[4,rt(r,f)];case 4:throw c.sent(),h;case 5:return[2]}})})}({token:s.token,createTime:Date.now(),subscriptionOptions:e},n,r)]:[2,s.token];case 9:return[2]}var l,a,v,y})})}function rt(n,r){return t(this,void 0,void 0,function(){var u;return i(this,function(f){switch(f.label){case 0:return[4,lt(n)];case 1:return(u=f.sent())?[4,uu(n,u.token)]:[3,4];case 2:return f.sent(),[4,function(n){return t(this,void 0,void 0,function(){var r,t;return i(this,function(i){switch(i.label){case 0:return r=oi(n),[4,fi()];case 1:return t=i.sent(),[4,(t=t.transaction(p,"readwrite")).objectStore(p).delete(r)];case 2:return i.sent(),[4,t.complete];case 3:return i.sent(),[2]}})})}(n)];case 3:f.sent();f.label=4;case 4:return[4,r.pushManager.getSubscription()];case 5:return(u=f.sent())?[2,u.unsubscribe()]:[2,!0]}})})}function eu(n,r){return t(this,void 0,void 0,function(){var f;return i(this,function(e){switch(e.label){case 0:return[4,function(n,r){return t(this,void 0,void 0,function(){var o,f,t,e;return i(this,function(i){switch(i.label){case 0:return[4,hi(n)];case 1:o=i.sent();f=fu(r);f={method:"POST",headers:o,body:JSON.stringify(f)};i.label=2;case 2:return i.trys.push([2,5,,6]),[4,fetch(si(n.appConfig),f)];case 3:return[4,i.sent().json()];case 4:return t=i.sent(),[3,6];case 5:throw e=i.sent(),u.create("token-subscribe-failed",{errorInfo:e});case 6:if(t.error)throw e=t.error.message,u.create("token-subscribe-failed",{errorInfo:e});if(!t.token)throw u.create("token-subscribe-no-token");return[2,t.token]}})})}(n,r)];case 1:return f=e.sent(),f={token:f,createTime:Date.now(),subscriptionOptions:r},[4,ei(n,f)];case 2:return e.sent(),[2,f.token]}})})}function ou(n){return"object"==typeof n&&n&&tu in n}function su(n){return new Promise(function(t){setTimeout(t,n)})}function e(n){var t=this;this.firebaseDependencies=n;this.isOnBackgroundMessageUsed=null;this.vapidKey=null;this.bgMessageHandler=null;self.addEventListener("push",function(n){n.waitUntil(t.onPush(n))});self.addEventListener("pushsubscriptionchange",function(n){n.waitUntil(t.onSubChange(n))});self.addEventListener("notificationclick",function(n){n.waitUntil(t.onNotificationClick(n))})}function cu(){return self.clients.matchAll({type:"window",includeUncontrolled:!0})}function f(n){var t=this;this.firebaseDependencies=n;this.vapidKey=null;this.onMessageCallback=null;navigator.serviceWorker.addEventListener("message",function(n){return t.messageEventListener(n)})}function li(n){return u.create("missing-app-config-values",{valueName:n})}function au(){return self&&"ServiceWorkerGlobalScope"in self?"indexedDB"in self&&null!==indexedDB&&"PushManager"in self&&"Notification"in self&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey"):"indexedDB"in window&&null!==indexedDB&&navigator.cookieEnabled&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window&&"fetch"in window&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey")}var ai=vu(n),vi=function(n,t){return(vi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])})(n,t)},o=function(){return(o=Object.assign||function(n){for(var r,i,t=1,u=arguments.length;t<u;t++)for(i in r=arguments[t])Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i]);return n}).apply(this,arguments)},wi,yu="FirebaseError",bi=(function(n,t){function i(){this.constructor=n}if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");vi(n,t);n.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(at,wi=Error),at),vt=(ki.prototype.create=function(n){for(var i=[],t=1;t<arguments.length;t++)i[t-1]=arguments[t];var r,u=i[0]||{},f=this.service+"/"+n,n=this.errors[n],n=n?(r=u,n.replace(pu,function(n,t){var i=r[t];return null!=i?String(i):"<"+t+"?>"})):"Error",n=this.serviceName+": "+n+" ("+f+").";return new bi(f,n,u)},ki),pu=/\{\$([^}]+)}/g,di=(g.prototype.setInstantiationMode=function(n){return this.instantiationMode=n,this},g.prototype.setMultipleInstances=function(n){return this.multipleInstances=n,this},g.prototype.setServiceProps=function(n){return this.serviceProps=n,this},g.prototype.setInstanceCreatedCallback=function(n){return this.onInstanceCreated=n,this},g),cr,st,l,a,hu,lu;w(c,"_index",["name","keyPath","multiEntry","unique"]);yt(c,"_index",IDBIndex,["get","getKey","getAll","getAllKeys","count"]);nr(c,"_index",IDBIndex,["openCursor","openKeyCursor"]);w(nt,"_cursor",["direction","key","primaryKey","value"]);yt(nt,"_cursor",IDBCursor,["update","delete"]);["advance","continue","continuePrimaryKey"].forEach(function(n){n in IDBCursor.prototype&&(nt.prototype[n]=function(){var t=this,i=arguments;return Promise.resolve().then(function(){return t._cursor[n].apply(t._cursor,i),gi(t._request).then(function(n){if(n)return new nt(n,t._request)})})})});s.prototype.createIndex=function(){return new c(this._store.createIndex.apply(this._store,arguments))};s.prototype.index=function(){return new c(this._store.index.apply(this._store,arguments))};w(s,"_store",["name","keyPath","indexNames","autoIncrement"]);yt(s,"_store",IDBObjectStore,["put","add","delete","clear","get","getAll","getKey","getAllKeys","count"]);nr(s,"_store",IDBObjectStore,["openCursor","openKeyCursor"]);ft(s,"_store",IDBObjectStore,["deleteIndex"]);tt.prototype.objectStore=function(){return new s(this._tx.objectStore.apply(this._tx,arguments))};w(tt,"_tx",["objectStoreNames","mode"]);ft(tt,"_tx",IDBTransaction,["abort"]);et.prototype.createObjectStore=function(){return new s(this._db.createObjectStore.apply(this._db,arguments))};w(et,"_db",["name","version","objectStoreNames"]);ft(et,"_db",IDBDatabase,["deleteObjectStore","close"]);ot.prototype.transaction=function(){return new tt(this._db.transaction.apply(this._db,arguments))};w(ot,"_db",["name","version","objectStoreNames"]);ft(ot,"_db",IDBDatabase,["close"]);["openCursor","openKeyCursor"].forEach(function(n){[s,c].forEach(function(t){n in t.prototype&&(t.prototype[n.replace("open","iterate")]=function(){var i=(t=arguments,Array.prototype.slice.call(t)),u=i[i.length-1],t=this._store||this._index,r=t[n].apply(t,i.slice(0,-1));r.onsuccess=function(){u(r.result)}})})});[c,s].forEach(function(n){n.prototype.getAll||(n.prototype.getAll=function(n,t){var r=this,i=[];return new Promise(function(u){r.iterateCursor(n,function(n){n?(i.push(n.value),void 0===t||i.length!=t?n.continue():u(i)):u(i)})})})});var tr="0.4.28",ir=1e4,rr="w:"+tr,ur="FIS_v2",wu="https://firebaseinstallations.googleapis.com/v1",bu=36e5,r=((r={})["missing-app-config-values"]='Missing App configuration value: "{$valueName}"',r["not-registered"]="Firebase Installation is not registered.",r["installation-not-found"]="Firebase Installation not found.",r["request-failed"]='{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',r["app-offline"]="Could not process request. Application offline.",r["delete-pending-registration"]="Can't delete installation while there is a pending registration request.",r),h=new vt("installations","Installations",r);cr=/^[cdef][\w-]{21}$/;st="";l=new Map;a=null;var pr,du="firebase-installations-database",gu=1,v="firebase-installations-store",wr=null;(pr=ai.default).INTERNAL.registerComponent(new di("installations",function(n){var u=n.getProvider("app").getImmediate(),r={appConfig:function(n){var r,f,i,t,u;if(!n||!n.options)throw ri("App Configuration");if(!n.name)throw ri("App Name");try{for(i=d(["projectId","apiKey","appId"]),t=i.next();!t.done;t=i.next())if(u=t.value,!n.options[u])throw ri(u);}catch(n){r={error:n}}finally{try{t&&!t.done&&(f=i.return)&&f.call(i)}finally{if(r)throw r.error;}}return{appName:n.name,projectId:n.options.projectId,apiKey:n.options.apiKey,appId:n.options.appId}}(u),platformLoggerProvider:n.getProvider("platform-logger")};return{app:u,getId:function(){return function(n){return t(this,void 0,void 0,function(){var t,r;return i(this,function(i){switch(i.label){case 0:return[4,ti(n.appConfig)];case 1:return t=i.sent(),r=t.installationEntry,(t.registrationPromise||ii(n)).catch(console.error),[2,r.fid]}})})}(r)},getToken:function(n){return tf(r,n)},"delete":function(){return function(n){return t(this,void 0,void 0,function(){var r,t;return i(this,function(i){switch(i.label){case 0:return[4,it(r=n.appConfig,function(n){if(!n||0!==n.registrationStatus)return n})];case 1:if(!(t=i.sent()))return[3,6];if(1!==t.registrationStatus)return[3,2];throw h.create("delete-pending-registration");case 2:if(2!==t.registrationStatus)return[3,6];if(navigator.onLine)return[3,3];throw h.create("app-offline");case 3:return[4,rf(r,t)];case 4:return i.sent(),[4,ni(r)];case 5:i.sent();i.label=6;case 6:return[2]}})})}(r)},onIdChange:function(n){return uf(r,n)}}},"PUBLIC"));pr.registerVersion("@firebase/installations",tr);var y,r=((r={})["missing-app-config-values"]='Missing App configuration value: "{$valueName}"',r["only-available-in-window"]="This method is available in a Window context.",r["only-available-in-sw"]="This method is available in a service worker context.",r["permission-default"]="The notification permission was not granted and dismissed instead.",r["permission-blocked"]="The notification permission was not granted and blocked instead.",r["unsupported-browser"]="This browser doesn't support the API's required to use the firebase SDK.",r["failed-service-worker-registration"]="We are unable to register the default service worker. {$browserErrorMessage}",r["token-subscribe-failed"]="A problem occurred while subscribing the user to FCM: {$errorInfo}",r["token-subscribe-no-token"]="FCM returned no token when subscribing the user to push.",r["token-unsubscribe-failed"]="A problem occurred while unsubscribing the user from FCM: {$errorInfo}",r["token-update-failed"]="A problem occurred while updating the user from FCM: {$errorInfo}",r["token-update-no-token"]="FCM returned no token when updating the user to push.",r["use-sw-after-get-token"]="The useServiceWorker() method may only be called once and must be called before calling getToken() to ensure your service worker is used.",r["invalid-sw-registration"]="The input to useServiceWorker() must be a ServiceWorkerRegistration.",r["invalid-bg-handler"]="The input to setBackgroundMessageHandler() must be a function.",r["invalid-vapid-key"]="The public VAPID key must be a string.",r["use-vapid-key-after-get-token"]="The usePublicVapidKey() method may only be called once and must be called before calling getToken() to ensure your VAPID key is used.",r),u=new vt("messaging","Messaging",r),ct="BDOU99-h67HcA6JeFXHbSNMu7e2yNNu3RzoMj8TM4W88jITfq7ZmPvIM1Iv-4_l2LxQcYwhqby2xGpWwzjfAnG4",ff="https://fcmregistrations.googleapis.com/v1",nu="FCM_MSG",tu="google.c.a.c_id";(r=y=y||{}).PUSH_RECEIVED="push-received";r.NOTIFICATION_CLICKED="notification-clicked";var ui="fcm_token_details_db",ef=5,iu="fcm_token_object_Store";var sf="firebase-messaging-database",hf=1,p="firebase-messaging-store",ru=null;hu=(Object.defineProperty(e.prototype,"app",{get:function(){return this.firebaseDependencies.app},enumerable:!1,configurable:!0}),e.prototype.setBackgroundMessageHandler=function(n){if(this.isOnBackgroundMessageUsed=!1,!n||"function"!=typeof n)throw u.create("invalid-bg-handler");this.bgMessageHandler=n},e.prototype.onBackgroundMessage=function(n){var t=this;return this.isOnBackgroundMessageUsed=!0,this.bgMessageHandler=n,function(){t.bgMessageHandler=null}},e.prototype.getToken=function(){var n;return t(this,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return this.vapidKey?[3,2]:[4,lt(this.firebaseDependencies)];case 1:t=i.sent();this.vapidKey=null!==(n=null===(n=null==t?void 0:t.subscriptionOptions)||void 0===n?void 0:n.vapidKey)&&void 0!==n?n:ct;i.label=2;case 2:return[2,ci(this.firebaseDependencies,self.registration,this.vapidKey)]}})})},e.prototype.deleteToken=function(){return rt(this.firebaseDependencies,self.registration)},e.prototype.requestPermission=function(){throw u.create("only-available-in-window");},e.prototype.usePublicVapidKey=function(n){if(null!==this.vapidKey)throw u.create("use-vapid-key-after-get-token");if("string"!=typeof n||0===n.length)throw u.create("invalid-vapid-key");this.vapidKey=n},e.prototype.useServiceWorker=function(){throw u.create("only-available-in-window");},e.prototype.onMessage=function(){throw u.create("only-available-in-window");},e.prototype.onTokenRefresh=function(){throw u.create("only-available-in-window");},e.prototype.onPush=function(n){return t(this,void 0,void 0,function(){var u,r,t;return i(this,function(i){switch(i.label){case 0:return(t=function(n){if(n=n.data,!n)return null;try{return n.json()}catch(n){return null}}(n))?[4,cu()]:(console.debug("FirebaseMessaging: failed to get parsed MessagePayload from the PushEvent. Skip handling the push."),[2]);case 1:return(u=i.sent()).some(function(n){return"visible"===n.visibilityState&&!n.url.startsWith("chrome-extension://")})?[2,function(n,t){var u,f,r,i;t.isFirebaseMessaging=!0;t.messageType=y.PUSH_RECEIVED;try{for(r=d(n),i=r.next();!i.done;i=r.next())i.value.postMessage(t)}catch(n){u={error:n}}finally{try{i&&!i.done&&(f=r.return)&&f.call(r)}finally{if(u)throw u.error;}}}(u,t)]:(r=!1,t.notification?[4,function(n){var i=n.actions,t=Notification.maxActions;return i&&t&&i.length>t&&console.warn("This browser only supports "+t+" actions. The remaining actions will not be displayed."),self.registration.showNotification(null!==(t=n.title)&&void 0!==t?t:"",n)}(((h=o({},(e=t).notification)).data=((f={})[nu]=e,f),h))]:[3,3]);case 2:i.sent();r=!0;i.label=3;case 3:return!0===r&&!1===this.isOnBackgroundMessageUsed?[2]:(this.bgMessageHandler&&(c={from:(s=t).from,collapseKey:s.collapse_key},e=c,(f=s).notification&&(e.notification={},(h=f.notification.title)&&(e.notification.title=h),(h=f.notification.body)&&(e.notification.body=h),(f=f.notification.image)&&(e.notification.image=f)),e=c,(f=s).data&&(e.data=f.data),e=c,(f=s).fcmOptions&&(e.fcmOptions={},(s=f.fcmOptions.link)&&(e.fcmOptions.link=s),(f=f.fcmOptions.analytics_label)&&(e.fcmOptions.analyticsLabel=f)),t=c,"function"==typeof this.bgMessageHandler?this.bgMessageHandler(t):this.bgMessageHandler.next(t)),[4,su(1e3)]);case 4:return i.sent(),[2]}var s,c,e,f,h})})},e.prototype.onSubChange=function(n){var r;return t(this,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return n.newSubscription?[3,2]:[4,rt(this.firebaseDependencies,self.registration)];case 1:return i.sent(),[2];case 2:return[4,lt(this.firebaseDependencies)];case 3:return t=i.sent(),[4,rt(this.firebaseDependencies,self.registration)];case 4:return i.sent(),[4,ci(this.firebaseDependencies,self.registration,null!==(r=null===(r=null==t?void 0:t.subscriptionOptions)||void 0===r?void 0:r.vapidKey)&&void 0!==r?r:ct)];case 5:return i.sent(),[2]}})})},e.prototype.onNotificationClick=function(n){var r;return t(this,void 0,void 0,function(){var f,e,o,s,u;return i(this,function(h){switch(h.label){case 0:return(f=null===(r=null===(r=n.notification)||void 0===r?void 0:r.data)||void 0===r?void 0:r[nu])?n.action?[2]:(n.stopImmediatePropagation(),n.notification.close(),(e=function(n){var t,i=null!==(t=null===(t=n.fcmOptions)||void 0===t?void 0:t.link)&&void 0!==t?t:null===(i=n.notification)||void 0===i?void 0:i.click_action;return i?i:ou(n.data)?self.location.origin:null}(f))?(o=new URL(e,self.location.href),s=new URL(self.location.origin),o.host!==s.host?[2]:[4,function(n){return t(this,void 0,void 0,function(){var e,r,t,u,o,f,s;return i(this,function(i){switch(i.label){case 0:return[4,cu()];case 1:e=i.sent();try{for(r=d(e),t=r.next();!t.done;t=r.next())if(u=t.value,o=new URL(u.url,self.location.href),n.host===o.host)return[2,u]}catch(i){f={error:i}}finally{try{t&&!t.done&&(s=r.return)&&s.call(r)}finally{if(f)throw f.error;}}return[2,null]}})})}(o)]):[2]):[2];case 1:return(u=h.sent())?[3,4]:[4,self.clients.openWindow(e)];case 2:return u=h.sent(),[4,su(3e3)];case 3:return h.sent(),[3,6];case 4:return[4,u.focus()];case 5:u=h.sent();h.label=6;case 6:return u?(f.messageType=y.NOTIFICATION_CLICKED,f.isFirebaseMessaging=!0,[2,u.postMessage(f)]):[2]}})})},e);lu=(Object.defineProperty(f.prototype,"app",{get:function(){return this.firebaseDependencies.app},enumerable:!1,configurable:!0}),f.prototype.messageEventListener=function(n){return t(this,void 0,void 0,function(){var t,r;return i(this,function(i){switch(i.label){case 0:return(t=n.data).isFirebaseMessaging?(this.onMessageCallback&&t.messageType===y.PUSH_RECEIVED&&("function"==typeof this.onMessageCallback?this.onMessageCallback((delete(u=Object.assign({},t)).messageType,delete u.isFirebaseMessaging,u)):this.onMessageCallback.next(Object.assign({},t))),ou(r=t.data)&&"1"===r["google.c.a.e"]?[4,this.logEvent(t.messageType,r)]:[3,2]):[2];case 1:i.sent();i.label=2;case 2:return[2]}var u})})},f.prototype.getVapidKey=function(){return this.vapidKey},f.prototype.getSwReg=function(){return this.swRegistration},f.prototype.getToken=function(n){return t(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return"default"!==Notification.permission?[3,2]:[4,Notification.requestPermission()];case 1:t.sent();t.label=2;case 2:if("granted"!==Notification.permission)throw u.create("permission-blocked");return[4,this.updateVapidKey(null==n?void 0:n.vapidKey)];case 3:return t.sent(),[4,this.updateSwReg(null==n?void 0:n.serviceWorkerRegistration)];case 4:return t.sent(),[2,ci(this.firebaseDependencies,this.swRegistration,this.vapidKey)]}})})},f.prototype.updateVapidKey=function(n){return t(this,void 0,void 0,function(){return i(this,function(){return n?this.vapidKey=n:this.vapidKey||(this.vapidKey=ct),[2]})})},f.prototype.updateSwReg=function(n){return t(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return n||this.swRegistration?[3,2]:[4,this.registerDefaultSw()];case 1:t.sent();t.label=2;case 2:if(!n&&this.swRegistration)return[2];if(!(n instanceof ServiceWorkerRegistration))throw u.create("invalid-sw-registration");return this.swRegistration=n,[2]}})})},f.prototype.registerDefaultSw=function(){return t(this,void 0,void 0,function(){var n;return i(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),n=this,[4,navigator.serviceWorker.register("/firebase-messaging-sw.js",{scope:"/firebase-cloud-messaging-push-scope"})];case 1:return n.swRegistration=t.sent(),this.swRegistration.update().catch(function(){}),[3,3];case 2:throw n=t.sent(),u.create("failed-service-worker-registration",{browserErrorMessage:n.message});case 3:return[2]}})})},f.prototype.deleteToken=function(){return t(this,void 0,void 0,function(){return i(this,function(n){switch(n.label){case 0:return this.swRegistration?[3,2]:[4,this.registerDefaultSw()];case 1:n.sent();n.label=2;case 2:return[2,rt(this.firebaseDependencies,this.swRegistration)]}})})},f.prototype.requestPermission=function(){return t(this,void 0,void 0,function(){var n;return i(this,function(t){switch(t.label){case 0:return"granted"===Notification.permission?[2]:[4,Notification.requestPermission()];case 1:if("granted"===(n=t.sent()))return[2];throw"denied"===n?u.create("permission-blocked"):u.create("permission-default");}})})},f.prototype.usePublicVapidKey=function(n){if(null!==this.vapidKey)throw u.create("use-vapid-key-after-get-token");if("string"!=typeof n||0===n.length)throw u.create("invalid-vapid-key");this.vapidKey=n},f.prototype.useServiceWorker=function(n){if(!(n instanceof ServiceWorkerRegistration))throw u.create("invalid-sw-registration");if(this.swRegistration)throw u.create("use-sw-after-get-token");this.swRegistration=n},f.prototype.onMessage=function(n){var t=this;return this.onMessageCallback=n,function(){t.onMessageCallback=null}},f.prototype.setBackgroundMessageHandler=function(){throw u.create("only-available-in-sw");},f.prototype.onBackgroundMessage=function(){throw u.create("only-available-in-sw");},f.prototype.onTokenRefresh=function(){return function(){}},f.prototype.logEvent=function(n,r){return t(this,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return t=function(n){switch(n){case y.NOTIFICATION_CLICKED:return"notification_open";case y.PUSH_RECEIVED:return"notification_foreground";default:throw new Error;}}(n),[4,this.firebaseDependencies.analyticsProvider.get()];case 1:return i.sent().logEvent(t,{message_id:r[tu],message_name:r["google.c.a.c_l"],message_time:r["google.c.a.ts"],message_device_time:Math.floor(Date.now()/1e3)}),[2]}})})},f);r={isSupported:au};ai.default.INTERNAL.registerComponent(new di("messaging",function(n){var t=n.getProvider("app").getImmediate(),n={app:t,appConfig:function(n){var u,e,t,r,i,f;if(!n||!n.options)throw li("App Configuration Object");if(!n.name)throw li("App Name");t=n.options;try{for(r=d(["projectId","apiKey","appId","messagingSenderId"]),i=r.next();!i.done;i=r.next())if(f=i.value,!t[f])throw li(f);}catch(n){u={error:n}}finally{try{i&&!i.done&&(e=r.return)&&e.call(r)}finally{if(u)throw u.error;}}return{appName:n.name,projectId:t.projectId,apiKey:t.apiKey,appId:t.appId,senderId:t.messagingSenderId}}(t),installations:n.getProvider("installations").getImmediate(),analyticsProvider:n.getProvider("analytics-internal")};if(!au())throw u.create("unsupported-browser");return new(self&&"ServiceWorkerGlobalScope"in self?hu:lu)(n)},"PUBLIC").setServiceProps(r))}.apply(this,arguments)}catch(t){throw console.error(t),new Error("Cannot instantiate firebase-messaging.js - be sure to load firebase-app.js first.");}});!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("@firebase/app")):"function"==typeof define&&define.amd?define(["@firebase/app"],t):t((n="undefined"!=typeof globalThis?globalThis:n||self).firebase)}(this,function(n){"use strict";try{!function(){function su(n){return n&&"object"==typeof n&&"default"in n?n:{"default":n}}function i(n,t,i,r){return new(i=i||Promise)(function(u,f){function o(n){try{e(r.next(n))}catch(n){f(n)}}function s(n){try{e(r.throw(n))}catch(n){f(n)}}function e(n){var t;n.done?u(n.value):((t=n.value)instanceof i?t:new i(function(n){n(t)})).then(o,s)}e((r=r.apply(n,t||[])).next())})}function r(n,t){function e(e){return function(o){return function(e){if(f)throw new TypeError("Generator is already executing.");for(;r;)try{if(f=1,u&&(i=2&e[0]?u.return:e[0]?u.throw||((i=u.return)&&i.call(u),0):u.next)&&!(i=i.call(u,e[1])).done)return i;switch(u=0,(e=i?[2&e[0],i.value]:e)[0]){case 0:case 1:i=e;break;case 4:return r.label++,{value:e[1],done:!1};case 5:r.label++;u=e[1];e=[0];continue;case 7:e=r.ops.pop();r.trys.pop();continue;default:if(!(i=0<(i=r.trys).length&&i[i.length-1])&&(6===e[0]||2===e[0])){r=0;continue}if(3===e[0]&&(!i||e[1]>i[0]&&e[1]<i[3])){r.label=e[1];break}if(6===e[0]&&r.label<i[1]){r.label=i[1];i=e;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(e);break}i[2]&&r.ops.pop();r.trys.pop();continue}e=t.call(n,r)}catch(o){e=[6,o];u=0}finally{f=i=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,o])}}var f,u,i,r={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o={next:e(0),"throw":e(1),"return":e(2)};return"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o}function yi(n){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&n[t],r=0;if(i)return i.call(n);if(n&&"number"==typeof n.length)return{next:function(){return{value:(n=n&&r>=n.length?void 0:n)&&n[r++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.");}function s(n,t){for(var i=0,u=t.length,r=n.length;i<u;i++,r++)n[r]=t[i];return n}function pi(){var n="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof n&&void 0!==n.id}function wi(){return"indexedDB"in self&&null!=indexedDB}function bi(){return new Promise(function(n,t){try{var r=!0,u="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(u);i.onsuccess=function(){i.result.close();r||self.indexedDB.deleteDatabase(u);n(!0)};i.onupgradeneeded=function(){r=!1};i.onerror=function(){var n;t((null===(n=i.error)||void 0===n?void 0:n.message)||"")}}catch(n){t(n)}})}function ki(){return!(!navigator||!navigator.cookieEnabled)}function vt(n,t,i){return t=di.call(this,t)||this,t.code=n,t.customData=i,t.name=hu,Object.setPrototypeOf(t,vt.prototype),Error.captureStackTrace&&Error.captureStackTrace(t,yt.prototype.create),t}function gi(n,t,i){this.service=n;this.serviceName=t;this.errors=i}function nr(n,t,i){return void 0===i&&(i=au),i=(t=void 0===t?lu:t)*Math.pow(i,n),n=Math.round(yu*i*(Math.random()-.5)*2),Math.min(vu,i+n)}function nt(n,t,i){this.name=n;this.instanceFactory=t;this.type=i;this.multipleInstances=!1;this.serviceProps={};this.instantiationMode="LAZY";this.onInstanceCreated=null}function tr(n){return new Promise(function(t,i){n.onsuccess=function(){t(n.result)};n.onerror=function(){i(n.error)}})}function wt(n,t,i){var r,u=new Promise(function(u,f){tr(r=n[t].apply(n,i)).then(u,f)});return u.request=r,u}function d(n,t,i){i.forEach(function(i){Object.defineProperty(n.prototype,i,{get:function(){return this[t][i]},set:function(n){this[t][i]=n}})})}function bt(n,t,i,r){r.forEach(function(r){r in i.prototype&&(n.prototype[r]=function(){return wt(this[t],r,arguments)})})}function ft(n,t,i,r){r.forEach(function(r){r in i.prototype&&(n.prototype[r]=function(){return this[t][r].apply(this[t],arguments)})})}function ir(n,t,i,r){r.forEach(function(r){r in i.prototype&&(n.prototype[r]=function(){return n=this[t],(i=wt(n,r,arguments)).then(function(n){if(n)return new tt(n,i.request)});var n,i})})}function p(n){this._index=n}function tt(n,t){this._cursor=n;this._request=t}function l(n){this._store=n}function it(n){this._tx=n;this.complete=new Promise(function(t,i){n.oncomplete=function(){t()};n.onerror=function(){i(n.error)};n.onabort=function(){i(n.error)}})}function et(n,t,i){this._db=n;this.oldVersion=t;this.transaction=new it(i)}function ot(n){this._db=n}function or(n){return n instanceof at&&n.code.includes("request-failed")}function kt(n){return n=n.projectId,pu+"/projects/"+n+"/installations"}function sr(n){return{token:n.token,requestStatus:2,expiresIn:(n=n.expiresIn,Number(n.replace("s","000"))),creationTime:Date.now()}}function dt(n,t){return i(this,void 0,void 0,function(){var i;return r(this,function(r){switch(r.label){case 0:return[4,t.json()];case 1:return i=r.sent(),i=i.error,[2,v.create("request-failed",{requestName:n,serverCode:i.code,serverMessage:i.message,serverStatus:i.status})]}})})}function hr(n){return n=n.apiKey,new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":n})}function cr(n,t){return t=t.refreshToken,n=hr(n),n.append("Authorization",er+" "+t),n}function gt(n){return i(this,void 0,void 0,function(){var t;return r(this,function(i){switch(i.label){case 0:return[4,n()];case 1:return 500<=(t=i.sent()).status&&t.status<600?[2,n()]:[2,t]}})})}function lr(n){return new Promise(function(t){setTimeout(t,n)})}function bu(n){return btoa(String.fromCharCode.apply(String,s([],function(n,t){var i="function"==typeof Symbol&&n[Symbol.iterator],r,f,u,e;if(!i)return n;u=i.call(n);e=[];try{for(;(void 0===t||0<t--)&&!(r=u.next()).done;)e.push(r.value)}catch(n){f={error:n}}finally{try{r&&!r.done&&(i=u.return)&&i.call(u)}finally{if(f)throw f.error;}}return e}(n)))).replace(/\+/g,"-").replace(/\//g,"_")}function ku(){var n,t;try{return n=new Uint8Array(17),(self.crypto||self.msCrypto).getRandomValues(n),n[0]=112+n[0]%16,t=bu(n).substr(0,22),ar.test(t)?t:st}catch(n){return st}}function g(n){return n.appName+"!"+n.appId}function vr(n,t){n=g(n);yr(n,t),function(n,t){var i=pr();i&&i.postMessage({key:n,fid:t});wr()}(n,t)}function yr(n,t){var u,f,n=w.get(n),r,i;if(n)try{for(r=yi(n),i=r.next();!i.done;i=r.next())i.value(t)}catch(n){u={error:n}}finally{try{i&&!i.done&&(f=r.return)&&f.call(r)}finally{if(u)throw u.error;}}}function pr(){return!b&&"BroadcastChannel"in self&&((b=new BroadcastChannel("[Firebase] FID Change")).onmessage=function(n){yr(n.data.key,n.data.fid)}),b}function wr(){0===w.size&&b&&(b.close(),b=null)}function ti(){var t,i,n;return ni||(t=kr,i=function(n){0===n.oldVersion&&n.createObjectStore(k)},(n=(t=wt(indexedDB,"open",[du,kr])).request)&&(n.onupgradeneeded=function(t){i&&i(new et(n.result,t.oldVersion,n.transaction))}),ni=t.then(function(n){return new ot(n)})),ni}function ht(n,t){return i(this,void 0,void 0,function(){var u,f,i,e;return r(this,function(r){switch(r.label){case 0:return u=g(n),[4,ti()];case 1:return i=r.sent(),f=i.transaction(k,"readwrite"),[4,(i=f.objectStore(k)).get(u)];case 2:return e=r.sent(),[4,i.put(t,u)];case 3:return r.sent(),[4,f.complete];case 4:return r.sent(),e&&e.fid===t.fid||vr(n,t.fid),[2,t]}})})}function ii(n){return i(this,void 0,void 0,function(){var i,t;return r(this,function(r){switch(r.label){case 0:return i=g(n),[4,ti()];case 1:return t=r.sent(),[4,(t=t.transaction(k,"readwrite")).objectStore(k).delete(i)];case 2:return r.sent(),[4,t.complete];case 3:return r.sent(),[2]}})})}function rt(n,t){return i(this,void 0,void 0,function(){var f,o,u,e,i;return r(this,function(r){switch(r.label){case 0:return f=g(n),[4,ti()];case 1:return u=r.sent(),o=u.transaction(k,"readwrite"),[4,(u=o.objectStore(k)).get(f)];case 2:return e=r.sent(),void 0!==(i=t(e))?[3,4]:[4,u.delete(f)];case 3:return r.sent(),[3,6];case 4:return[4,u.put(i,f)];case 5:r.sent();r.label=6;case 6:return[4,o.complete];case 7:return r.sent(),!i||e&&e.fid===i.fid||vr(n,i.fid),[2,i]}})})}function ri(n){return i(this,void 0,void 0,function(){var t,f,u;return r(this,function(e){switch(e.label){case 0:return[4,rt(n,function(u){return u=gr(u||{fid:ku(),registrationStatus:0}),u=function(n,t){if(0!==t.registrationStatus)return 1===t.registrationStatus?{installationEntry:t,registrationPromise:function(n){return i(this,void 0,void 0,function(){var t,u,i;return r(this,function(r){switch(r.label){case 0:return[4,dr(n)];case 1:t=r.sent();r.label=2;case 2:return 1!==t.registrationStatus?[3,5]:[4,lr(100)];case 3:return r.sent(),[4,dr(n)];case 4:return t=r.sent(),[3,2];case 5:return 0!==t.registrationStatus?[3,7]:[4,ri(n)];case 6:return i=r.sent(),u=i.installationEntry,(i=i.registrationPromise)?[2,i]:[2,u];case 7:return[2,t]}})})}(n)}:{installationEntry:t};if(!navigator.onLine){var u=Promise.reject(v.create("app-offline"));return{installationEntry:t,registrationPromise:u}}return t={fid:t.fid,registrationStatus:1,registrationTime:Date.now()},n=function(n,t){return i(this,void 0,void 0,function(){var f,u;return r(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,7]),[4,function(n,t){var u=t.fid;return i(this,void 0,void 0,function(){var f,e,o,i,t;return r(this,function(r){switch(r.label){case 0:return f=kt(n),e=hr(n),t={fid:u,authVersion:er,appId:n.appId,sdkVersion:fr},o={method:"POST",headers:e,body:JSON.stringify(t)},[4,gt(function(){return fetch(f,o)})];case 1:return(i=r.sent()).ok?[4,i.json()]:[3,3];case 2:return t=r.sent(),[2,{fid:t.fid||u,registrationStatus:2,refreshToken:t.refreshToken,authToken:sr(t.authToken)}];case 3:return[4,dt("Create Installation",i)];case 4:throw r.sent();}})})}(n,t)];case 1:return f=e.sent(),[2,ht(n,f)];case 2:return or(u=e.sent())&&409===u.customData.serverCode?[4,ii(n)]:[3,4];case 3:return e.sent(),[3,6];case 4:return[4,ht(n,{fid:t.fid,registrationStatus:0})];case 5:e.sent();e.label=6;case 6:throw u;case 7:return[2]}})})}(n,t),{installationEntry:t,registrationPromise:n}}(n,u),t=u.registrationPromise,u.installationEntry})];case 1:return(f=e.sent()).fid!==st?[3,3]:(u={},[4,t]);case 2:return[2,(u.installationEntry=e.sent(),u)];case 3:return[2,{installationEntry:f,registrationPromise:t}]}})})}function dr(n){return rt(n,function(n){if(!n)throw v.create("installation-not-found");return gr(n)})}function gr(n){return 1===(t=n).registrationStatus&&t.registrationTime+ur<Date.now()?{fid:n.fid,registrationStatus:0}:n;var t}function gu(n,t){var u=n.appConfig,f=n.platformLoggerProvider;return i(this,void 0,void 0,function(){var o,i,s,e,n;return r(this,function(r){switch(r.label){case 0:return o=function(n,t){return t=t.fid,kt(n)+"/"+t+"/authTokens:generate"}(u,t),i=cr(u,t),(n=f.getImmediate({optional:!0}))&&i.append("x-firebase-client",n.getPlatformInfoString()),n={installation:{sdkVersion:fr}},s={method:"POST",headers:i,body:JSON.stringify(n)},[4,gt(function(){return fetch(o,s)})];case 1:return(e=r.sent()).ok?[4,e.json()]:[3,3];case 2:return n=r.sent(),[2,sr(n)];case 3:return[4,dt("Generate Auth Token",e)];case 4:throw r.sent();}})})}function ui(n,t){return void 0===t&&(t=!1),i(this,void 0,void 0,function(){var u,e,f;return r(this,function(o){switch(o.label){case 0:return[4,rt(n.appConfig,function(f){if(!tu(f))throw v.create("not-registered");var o,e=f.authToken;if(t||2!==(o=e).requestStatus||function(n){var t=Date.now();return t<n.creationTime||n.creationTime+n.expiresIn<t+wu}(o)){if(1===e.requestStatus)return u=function(n,t){return i(this,void 0,void 0,function(){var i;return r(this,function(r){switch(r.label){case 0:return[4,nu(n.appConfig)];case 1:i=r.sent();r.label=2;case 2:return 1!==i.authToken.requestStatus?[3,5]:[4,lr(100)];case 3:return r.sent(),[4,nu(n.appConfig)];case 4:return i=r.sent(),[3,2];case 5:return 0===(i=i.authToken).requestStatus?[2,ui(n,t)]:[2,i]}})})}(n,t),f;if(!navigator.onLine)throw v.create("app-offline");return e=(o=f,e={requestStatus:1,requestTime:Date.now()},c(c({},o),{authToken:e})),u=function(n,t){return i(this,void 0,void 0,function(){var f,i,u;return r(this,function(r){switch(r.label){case 0:return r.trys.push([0,3,,8]),[4,gu(n,t)];case 1:return f=r.sent(),u=c(c({},t),{authToken:f}),[4,ht(n.appConfig,u)];case 2:return r.sent(),[2,f];case 3:return!or(i=r.sent())||401!==i.customData.serverCode&&404!==i.customData.serverCode?[3,5]:[4,ii(n.appConfig)];case 4:return r.sent(),[3,7];case 5:return u=c(c({},t),{authToken:{requestStatus:0}}),[4,ht(n.appConfig,u)];case 6:r.sent();r.label=7;case 7:throw i;case 8:return[2]}})})}(n,e),e}return f})];case 1:return e=o.sent(),u?[4,u]:[3,3];case 2:return f=o.sent(),[3,4];case 3:f=e.authToken;o.label=4;case 4:return[2,f]}})})}function nu(n){return rt(n,function(n){if(!tu(n))throw v.create("not-registered");var t=n.authToken;return 1===(t=t).requestStatus&&t.requestTime+ur<Date.now()?c(c({},n),{authToken:{requestStatus:0}}):n})}function tu(n){return void 0!==n&&2===n.registrationStatus}function nf(n,t){return void 0===t&&(t=!1),i(this,void 0,void 0,function(){return r(this,function(u){switch(u.label){case 0:return[4,function(n){return i(this,void 0,void 0,function(){var t;return r(this,function(i){switch(i.label){case 0:return[4,ri(n)];case 1:return(t=i.sent().registrationPromise)?[4,t]:[3,3];case 2:i.sent();i.label=3;case 3:return[2]}})})}(n.appConfig)];case 1:return u.sent(),[4,ui(n,t)];case 2:return[2,u.sent().token]}})})}function tf(n,t){return i(this,void 0,void 0,function(){var u,f,i;return r(this,function(r){switch(r.label){case 0:return u=function(n,t){return t=t.fid,kt(n)+"/"+t}(n,t),i=cr(n,t),f={method:"DELETE",headers:i},[4,gt(function(){return fetch(u,f)})];case 1:return(i=r.sent()).ok?[3,3]:[4,dt("Delete Installation",i)];case 2:throw r.sent();case 3:return[2]}})})}function rf(n,t){var i=n.appConfig;return function(n,t){pr();var i=g(n);(n=w.get(i))||(n=new Set,w.set(i,n));n.add(t)}(i,t),function(){var n,u,r;u=t;r=g(n=i);(n=w.get(r))&&(n.delete(u),0===n.size&&w.delete(r),wr())}}function fi(n){return v.create("missing-app-config-values",{valueName:n})}function uf(n,t){for(var f,u,r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];if(!(t<n.logLevel)){if(f=(new Date).toISOString(),u=of[t],!u)throw new Error("Attempted to log a message with an invalid logType (value: "+t+")");console[u].apply(console,s(["["+f+"]  "+n.name+":"],r))}}function a(n){this.name=n;this._logLevel=ef;this._logHandler=uf;this._userLogHandler=null}function af(n,t,u,f){return function(s,h,c){return i(this,void 0,void 0,function(){var l;return r(this,function(a){switch(a.label){case 0:return a.trys.push([0,6,,7]),s!==o.EVENT?[3,2]:[4,function(n,t,u,f,s){return i(this,void 0,void 0,function(){var h,a,v,c,l,y,i;return r(this,function(r){switch(r.label){case 0:return(r.trys.push([0,4,,5]),h=[],s&&s.send_to)?(i=s.send_to,Array.isArray(i)||(i=[i]),[4,Promise.all(u)]):[3,2];case 1:for(a=r.sent(),v=function(n){var i=a.find(function(t){return t.measurementId===n}),i=i&&t[i.appId];if(!i)return h=[],"break";h.push(i)},c=0,l=i;c<l.length&&(y=l[c],"break"!==v(y));c++);r.label=2;case 2:return 0===h.length&&(h=Object.values(t)),[4,Promise.all(h)];case 3:return r.sent(),n(o.EVENT,f,s||{}),[3,5];case 4:return i=r.sent(),e.error(i),[3,5];case 5:return[2]}})})}(n,t,u,h,c)];case 1:return a.sent(),[3,5];case 2:return s!==o.CONFIG?[3,4]:[4,function(n,t,u,f,s,h){return i(this,void 0,void 0,function(){var c,i;return r(this,function(r){switch(r.label){case 0:c=f[s];r.label=1;case 1:return r.trys.push([1,7,,8]),c?[4,t[c]]:[3,3];case 2:return r.sent(),[3,6];case 3:return[4,Promise.all(u)];case 4:return i=r.sent(),(i=i.find(function(n){return n.measurementId===s}))?[4,t[i.appId]]:[3,6];case 5:r.sent();r.label=6;case 6:return[3,8];case 7:return i=r.sent(),e.error(i),[3,8];case 8:return n(o.CONFIG,s,h),[2]}})})}(n,t,u,f,h,c)];case 3:return a.sent(),[3,5];case 4:n(o.SET,h);a.label=5;case 5:return[3,7];case 6:return l=a.sent(),e.error(l),[3,7];case 7:return[2]}})})}}function ct(n,t){void 0===t&&(t=1e3);this.throttleMetadata=n=void 0===n?{}:n;this.intervalMillis=t}function yf(n){var t;return i(this,void 0,void 0,function(){var f,u,e,i;return r(this,function(r){switch(r.label){case 0:return f=n.appId,i=n.apiKey,i={method:"GET",headers:new Headers({Accept:"application/json","x-goog-api-key":i})},f=lf.replace("{app-id}",f),[4,fetch(f,i)];case 1:if(200===(u=r.sent()).status||304===u.status)return[3,6];e="";r.label=2;case 2:return r.trys.push([2,4,,5]),[4,u.json()];case 3:return i=r.sent(),null!==(t=i.error)&&void 0!==t&&t.message&&(e=i.error.message),[3,5];case 4:return r.sent(),[3,5];case 5:throw h.create("config-fetch-failed",{httpStatus:u.status,responseMessage:e});case 6:return[2,u.json()]}})})}function pf(n,t,u){return void 0===t&&(t=oi),i(this,void 0,void 0,function(){var o,c,s,f,l,a=this;return r(this,function(){if(f=n.options,o=f.appId,c=f.apiKey,s=f.measurementId,!o)throw h.create("no-app-id");if(c)return f=t.getThrottleMetadata(o)||{backoffCount:0,throttleEndTimeMillis:Date.now()},l=new ru,setTimeout(function(){return i(a,void 0,void 0,function(){return r(this,function(){return l.abort(),[2]})})},void 0!==u?u:cf),[2,function a(n,t,u,f){var s=t.throttleEndTimeMillis,o=t.backoffCount;return void 0===f&&(f=oi),i(this,void 0,void 0,function(){var i,t,l,h,c;return r(this,function(r){switch(r.label){case 0:i=n.appId;t=n.measurementId;r.label=1;case 1:return r.trys.push([1,3,,4]),[4,wf(u,s)];case 2:return r.sent(),[3,4];case 3:if(h=r.sent(),t)return e.warn("Timed out fetching this Firebase app's measurement ID from the server. Falling back to the measurement ID "+t+' provided in the "measurementId" field in the local Firebase config. ['+h.message+"]"),[2,{appId:i,measurementId:t}];throw h;case 4:return r.trys.push([4,6,,7]),[4,yf(n)];case 5:return c=r.sent(),f.deleteThrottleMetadata(i),[2,c];case 6:if(bf(l=r.sent()))return h=503===Number(l.customData.httpStatus)?nr(o,f.intervalMillis,vf):nr(o,f.intervalMillis),c={throttleEndTimeMillis:Date.now()+h,backoffCount:o+1},f.setThrottleMetadata(i,c),e.debug("Calling attemptFetch again in "+h+" millis"),[2,a(n,c,u,f)];if(f.deleteThrottleMetadata(i),t)return e.warn("Failed to fetch this Firebase app's measurement ID from the server. Falling back to the measurement ID "+t+' provided in the "measurementId" field in the local Firebase config. ['+l.message+"]"),[2,{appId:i,measurementId:t}];throw l;case 7:return[2]}})})}({appId:o,apiKey:c,measurementId:s},f,l,t)];if(s)return[2,{measurementId:s,appId:o}];throw h.create("no-api-key");})})}function wf(n,t){return new Promise(function(i,r){var u=Math.max(t-Date.now(),0),f=setTimeout(i,u);n.addEventListener(function(){clearTimeout(f);r(h.create("fetch-throttle",{throttleEndTimeMillis:t}))})})}function bf(n){if(n instanceof at&&n.customData)return n=Number(n.customData.httpStatus),429===n||500===n||503===n||504===n}function si(){this.listeners=[]}function kf(n,t,u,f,s,c){return i(this,void 0,void 0,function(){var a,v,l;return r(this,function(y){switch(y.label){case 0:return(a=pf(n)).then(function(t){u[t.measurementId]=t.appId;n.options.measurementId&&t.measurementId!==n.options.measurementId&&e.warn("The measurement ID in the local Firebase config ("+n.options.measurementId+") does not match the measurement ID fetched from the server ("+t.measurementId+"). To ensure analytics events are always sent to the correct Analytics property, update the measurement ID field in the local config or remove it from the local config.")}).catch(function(n){return e.error(n)}),t.push(a),v=function(){return i(this,void 0,void 0,function(){var n;return r(this,function(t){switch(t.label){case 0:return wi()?[3,1]:(e.warn(h.create("indexeddb-unavailable",{errorInfo:"IndexedDB is not available in this environment."}).message),[2,!1]);case 1:return t.trys.push([1,3,,4]),[4,bi()];case 2:return t.sent(),[3,4];case 3:return n=t.sent(),e.warn(h.create("indexeddb-unavailable",{errorInfo:n}).message),[2,!1];case 4:return[2,!0]}})})}().then(function(n){if(n)return f.getId()}),[4,Promise.all([a,v])];case 1:return l=y.sent(),a=l[0],v=l[1],function(){for(var n,r=window.document.getElementsByTagName("script"),t=0,i=Object.values(r);t<i.length;t++)if(n=i[t],n.src&&n.src.includes(iu))return n}()||(w=c,b=a.measurementId,(p=document.createElement("script")).src=iu+"?l="+w+"&id="+b,p.async=!0,document.head.appendChild(p)),s("js",new Date),(l={})[hf]="firebase",l.update=!0,l=l,null!=v&&(l[sf]=v),s(o.CONFIG,a.measurementId,l),[2,a.measurementId]}var w,b,p})})}function df(n){if(hi)throw h.create("already-initialized");n.dataLayerName&&(lt=n.dataLayerName);n.gtagName&&(ou=n.gtagName)}function gf(n,t){u=[];pi()&&u.push("This is a browser extension environment.");ki()||u.push("Cookies are not available.");0<u.length&&(u=u.map(function(n,t){return"("+(t+1)+") "+n}).join(" "),u=h.create("invalid-analytics-context",{errorInfo:u}),e.warn(u.message));var l,f,u,s=n.options.appId;if(!s)throw h.create("no-app-id");if(!n.options.apiKey){if(!n.options.measurementId)throw h.create("no-api-key");e.warn('The "apiKey" field is empty in the local Firebase config. This is needed to fetch the latest measurement ID for this Firebase app. Falling back to the measurement ID '+n.options.measurementId+' provided in the "measurementId" field in the local Firebase config.')}if(null!=y[s])throw h.create("already-exists",{id:s});return hi||(f=lt,u=[],Array.isArray(window[f])?u=window[f]:window[f]=u,l=lt,f=ou,u=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];window[l].push(arguments)},window[f]&&"function"==typeof window[f]&&(u=window[f]),window[f]=af(u,y,fu,eu),f={gtagCore:u,wrappedGtag:window[f]},ut=f.wrappedGtag,uu=f.gtagCore,hi=!0),y[s]=kf(n,fu,eu,t,uu,lt),{app:n,logEvent:function(n,t,u){!function(n,t,u,f,e){return i(this,void 0,void 0,function(){var i;return r(this,function(r){switch(r.label){case 0:return e&&e.global?(n(o.EVENT,u,f),[2]):[3,1];case 1:return[4,t];case 2:i=r.sent();i=c(c({},f),{send_to:i});n(o.EVENT,u,i);r.label=3;case 3:return[2]}})})}(ut,y[s],n,t,u).catch(function(n){return e.error(n)})},setCurrentScreen:function(n,t){!function(n,t,u,f){return i(this,void 0,void 0,function(){var i;return r(this,function(r){switch(r.label){case 0:return f&&f.global?(n(o.SET,{screen_name:u}),[2,Promise.resolve()]):[3,1];case 1:return[4,t];case 2:i=r.sent();n(o.CONFIG,i,{update:!0,screen_name:u});r.label=3;case 3:return[2]}})})}(ut,y[s],n,t).catch(function(n){return e.error(n)})},setUserId:function(n,t){!function(n,t,u,f){return i(this,void 0,void 0,function(){var i;return r(this,function(r){switch(r.label){case 0:return f&&f.global?(n(o.SET,{user_id:u}),[2,Promise.resolve()]):[3,1];case 1:return[4,t];case 2:i=r.sent();n(o.CONFIG,i,{update:!0,user_id:u});r.label=3;case 3:return[2]}})})}(ut,y[s],n,t).catch(function(n){return e.error(n)})},setUserProperties:function(n,t){!function(n,t,u,f){return i(this,void 0,void 0,function(){var e,i,s,h,c;return r(this,function(r){switch(r.label){case 0:if(!f||!f.global)return[3,1];for(e={},i=0,s=Object.keys(u);i<s.length;i++)h=s[i],e["user_properties."+h]=u[h];return n(o.SET,e),[2,Promise.resolve()];case 1:return[4,t];case 2:c=r.sent();n(o.CONFIG,c,{update:!0,user_properties:u});r.label=3;case 3:return[2]}})})}(ut,y[s],n,t).catch(function(n){return e.error(n)})},setAnalyticsCollectionEnabled:function(n){!function(n,t){return i(this,void 0,void 0,function(){var i;return r(this,function(r){switch(r.label){case 0:return[4,n];case 1:return i=r.sent(),window["ga-disable-"+i]=!t,[2]}})})}(y[s],n).catch(function(n){return e.error(n)})},INTERNAL:{"delete":function(){return delete y[s],Promise.resolve()}}}}function ne(){return i(this,void 0,void 0,function(){return r(this,function(n){switch(n.label){case 0:if(pi())return[2,!1];if(!ki())return[2,!1];if(!wi())return[2,!1];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,bi()];case 2:return[2,n.sent()];case 3:return n.sent(),[2,!1];case 4:return[2]}})})}var ai=su(n),vi=function(n,t){return(vi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])})(n,t)},c=function(){return(c=Object.assign||function(n){for(var r,i,t=1,u=arguments.length;t<u;t++)for(i in r=arguments[t])Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i]);return n}).apply(this,arguments)},di,hu="FirebaseError",at=(function(n,t){function i(){this.constructor=n}if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");vi(n,t);n.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(vt,di=Error),vt),yt=(gi.prototype.create=function(n){for(var i=[],t=1;t<arguments.length;t++)i[t-1]=arguments[t];var r,u=i[0]||{},f=this.service+"/"+n,n=this.errors[n],n=n?(r=u,n.replace(cu,function(n,t){var i=r[t];return null!=i?String(i):"<"+t+"?>"})):"Error",n=this.serviceName+": "+n+" ("+f+").";return new at(f,n,u)},gi),cu=/\{\$([^}]+)}/g,lu=1e3,au=2,vu=144e5,yu=.5,pt=(nt.prototype.setInstantiationMode=function(n){return this.instantiationMode=n,this},nt.prototype.setMultipleInstances=function(n){return this.multipleInstances=n,this},nt.prototype.setServiceProps=function(n){return this.serviceProps=n,this},nt.prototype.setInstanceCreatedCallback=function(n){return this.onInstanceCreated=n,this},nt),ar,st,w,b,e,oi,ru,ci,li;d(p,"_index",["name","keyPath","multiEntry","unique"]);bt(p,"_index",IDBIndex,["get","getKey","getAll","getAllKeys","count"]);ir(p,"_index",IDBIndex,["openCursor","openKeyCursor"]);d(tt,"_cursor",["direction","key","primaryKey","value"]);bt(tt,"_cursor",IDBCursor,["update","delete"]);["advance","continue","continuePrimaryKey"].forEach(function(n){n in IDBCursor.prototype&&(tt.prototype[n]=function(){var t=this,i=arguments;return Promise.resolve().then(function(){return t._cursor[n].apply(t._cursor,i),tr(t._request).then(function(n){if(n)return new tt(n,t._request)})})})});l.prototype.createIndex=function(){return new p(this._store.createIndex.apply(this._store,arguments))};l.prototype.index=function(){return new p(this._store.index.apply(this._store,arguments))};d(l,"_store",["name","keyPath","indexNames","autoIncrement"]);bt(l,"_store",IDBObjectStore,["put","add","delete","clear","get","getAll","getKey","getAllKeys","count"]);ir(l,"_store",IDBObjectStore,["openCursor","openKeyCursor"]);ft(l,"_store",IDBObjectStore,["deleteIndex"]);it.prototype.objectStore=function(){return new l(this._tx.objectStore.apply(this._tx,arguments))};d(it,"_tx",["objectStoreNames","mode"]);ft(it,"_tx",IDBTransaction,["abort"]);et.prototype.createObjectStore=function(){return new l(this._db.createObjectStore.apply(this._db,arguments))};d(et,"_db",["name","version","objectStoreNames"]);ft(et,"_db",IDBDatabase,["deleteObjectStore","close"]);ot.prototype.transaction=function(){return new it(this._db.transaction.apply(this._db,arguments))};d(ot,"_db",["name","version","objectStoreNames"]);ft(ot,"_db",IDBDatabase,["close"]);["openCursor","openKeyCursor"].forEach(function(n){[l,p].forEach(function(t){n in t.prototype&&(t.prototype[n.replace("open","iterate")]=function(){var i=(t=arguments,Array.prototype.slice.call(t)),u=i[i.length-1],t=this._store||this._index,r=t[n].apply(t,i.slice(0,-1));r.onsuccess=function(){u(r.result)}})})});[p,l].forEach(function(n){n.prototype.getAll||(n.prototype.getAll=function(n,t){var r=this,i=[];return new Promise(function(u){r.iterateCursor(n,function(n){n?(i.push(n.value),void 0===t||i.length!=t?n.continue():u(i)):u(i)})})})});var rr="0.4.28",ur=1e4,fr="w:"+rr,er="FIS_v2",pu="https://firebaseinstallations.googleapis.com/v1",wu=36e5,t=((u={})["missing-app-config-values"]='Missing App configuration value: "{$valueName}"',u["not-registered"]="Firebase Installation is not registered.",u["installation-not-found"]="Firebase Installation not found.",u["request-failed"]='{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',u["app-offline"]="Could not process request. Application offline.",u["delete-pending-registration"]="Can't delete installation while there is a pending registration request.",u),v=new yt("installations","Installations",t);ar=/^[cdef][\w-]{21}$/;st="";w=new Map;b=null;var br,f,du="firebase-installations-database",kr=1,k="firebase-installations-store",ni=null;(br=ai.default).INTERNAL.registerComponent(new pt("installations",function(n){var u=n.getProvider("app").getImmediate(),t={appConfig:function(n){var r,f,i,t,u;if(!n||!n.options)throw fi("App Configuration");if(!n.name)throw fi("App Name");try{for(i=yi(["projectId","apiKey","appId"]),t=i.next();!t.done;t=i.next())if(u=t.value,!n.options[u])throw fi(u);}catch(n){r={error:n}}finally{try{t&&!t.done&&(f=i.return)&&f.call(i)}finally{if(r)throw r.error;}}return{appName:n.name,projectId:n.options.projectId,apiKey:n.options.apiKey,appId:n.options.appId}}(u),platformLoggerProvider:n.getProvider("platform-logger")};return{app:u,getId:function(){return function(n){return i(this,void 0,void 0,function(){var t,i;return r(this,function(r){switch(r.label){case 0:return[4,ri(n.appConfig)];case 1:return t=r.sent(),i=t.installationEntry,(t.registrationPromise||ui(n)).catch(console.error),[2,i.fid]}})})}(t)},getToken:function(n){return nf(t,n)},"delete":function(){return function(n){return i(this,void 0,void 0,function(){var i,t;return r(this,function(r){switch(r.label){case 0:return[4,rt(i=n.appConfig,function(n){if(!n||0!==n.registrationStatus)return n})];case 1:if(!(t=r.sent()))return[3,6];if(1!==t.registrationStatus)return[3,2];throw v.create("delete-pending-registration");case 2:if(2!==t.registrationStatus)return[3,6];if(navigator.onLine)return[3,3];throw v.create("app-offline");case 3:return[4,tf(i,t)];case 4:return r.sent(),[4,ii(i)];case 5:r.sent();r.label=6;case 6:return[2]}})})}(t)},onIdChange:function(n){return rf(t,n)}}},"PUBLIC"));br.registerVersion("@firebase/installations",rr);(u=f=f||{})[u.DEBUG=0]="DEBUG";u[u.VERBOSE=1]="VERBOSE";u[u.INFO=2]="INFO";u[u.WARN=3]="WARN";u[u.ERROR=4]="ERROR";u[u.SILENT=5]="SILENT";var ff={debug:f.DEBUG,verbose:f.VERBOSE,info:f.INFO,warn:f.WARN,error:f.ERROR,silent:f.SILENT},ef=f.INFO,of=((t={})[f.DEBUG]="log",t[f.VERBOSE]="log",t[f.INFO]="info",t[f.WARN]="warn",t[f.ERROR]="error",t),u=(Object.defineProperty(a.prototype,"logLevel",{get:function(){return this._logLevel},set:function(n){if(!(n in f))throw new TypeError('Invalid value "'+n+'" assigned to `logLevel`');this._logLevel=n},enumerable:!1,configurable:!0}),a.prototype.setLogLevel=function(n){this._logLevel="string"==typeof n?ff[n]:n},Object.defineProperty(a.prototype,"logHandler",{get:function(){return this._logHandler},set:function(n){if("function"!=typeof n)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=n},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"userLogHandler",{get:function(){return this._userLogHandler},set:function(n){this._userLogHandler=n},enumerable:!1,configurable:!0}),a.prototype.debug=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,s([this,f.DEBUG],t));this._logHandler.apply(this,s([this,f.DEBUG],t))},a.prototype.log=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,s([this,f.VERBOSE],t));this._logHandler.apply(this,s([this,f.VERBOSE],t))},a.prototype.info=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,s([this,f.INFO],t));this._logHandler.apply(this,s([this,f.INFO],t))},a.prototype.warn=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,s([this,f.WARN],t));this._logHandler.apply(this,s([this,f.WARN],t))},a.prototype.error=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,s([this,f.ERROR],t));this._logHandler.apply(this,s([this,f.ERROR],t))},a);var o,ei,sf="firebase_id",hf="origin",cf=6e4,lf="https://firebase.googleapis.com/v1alpha/projects/-/apps/{app-id}/webConfig",iu="https://www.googletagmanager.com/gtag/js";(t=o=o||{}).EVENT="event";t.SET="set";t.CONFIG="config";(t=ei=ei||{}).ADD_SHIPPING_INFO="add_shipping_info";t.ADD_PAYMENT_INFO="add_payment_info";t.ADD_TO_CART="add_to_cart";t.ADD_TO_WISHLIST="add_to_wishlist";t.BEGIN_CHECKOUT="begin_checkout";t.CHECKOUT_PROGRESS="checkout_progress";t.EXCEPTION="exception";t.GENERATE_LEAD="generate_lead";t.LOGIN="login";t.PAGE_VIEW="page_view";t.PURCHASE="purchase";t.REFUND="refund";t.REMOVE_FROM_CART="remove_from_cart";t.SCREEN_VIEW="screen_view";t.SEARCH="search";t.SELECT_CONTENT="select_content";t.SELECT_ITEM="select_item";t.SELECT_PROMOTION="select_promotion";t.SET_CHECKOUT_OPTION="set_checkout_option";t.SHARE="share";t.SIGN_UP="sign_up";t.TIMING_COMPLETE="timing_complete";t.VIEW_CART="view_cart";t.VIEW_ITEM="view_item";t.VIEW_ITEM_LIST="view_item_list";t.VIEW_PROMOTION="view_promotion";t.VIEW_SEARCH_RESULTS="view_search_results";e=new u("@firebase/analytics");var u=((u={})["already-exists"]="A Firebase Analytics instance with the appId {$id}  already exists. Only one Firebase Analytics instance can be created for each appId.",u["already-initialized"]="Firebase Analytics has already been initialized.settings() must be called before initializing any Analytics instanceor it will have no effect.",u["interop-component-reg-failed"]="Firebase Analytics Interop Component failed to instantiate: {$reason}",u["invalid-analytics-context"]="Firebase Analytics is not supported in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}",u["indexeddb-unavailable"]="IndexedDB unavailable or restricted in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}",u["fetch-throttle"]="The config fetch request timed out while in an exponential backoff state. Unix timestamp in milliseconds when fetch request throttling ends: {$throttleEndTimeMillis}.",u["config-fetch-failed"]="Dynamic config fetch failed: [{$httpStatus}] {$responseMessage}",u["no-api-key"]='The "apiKey" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid API key.',u["no-app-id"]='The "appId" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid app ID.',u),h=new yt("analytics","Analytics",u),vf=30;oi=new(ct.prototype.getThrottleMetadata=function(n){return this.throttleMetadata[n]},ct.prototype.setThrottleMetadata=function(n,t){this.throttleMetadata[n]=t},ct.prototype.deleteThrottleMetadata=function(n){delete this.throttleMetadata[n]},ct);ru=(si.prototype.addEventListener=function(n){this.listeners.push(n)},si.prototype.abort=function(){this.listeners.forEach(function(n){return n()})},si);var uu,ut,y={},fu=[],eu={},lt="dataLayer",ou="gtag",hi=!1;li="analytics";(ci=ai.default).INTERNAL.registerComponent(new pt(li,function(n){return gf(n.getProvider("app").getImmediate(),n.getProvider("installations").getImmediate())},"PUBLIC").setServiceProps({settings:df,EventName:ei,isSupported:ne}));ci.INTERNAL.registerComponent(new pt("analytics-internal",function(n){try{return{logEvent:n.getProvider(li).getImmediate().logEvent}}catch(n){throw h.create("interop-component-reg-failed",{reason:n});}},"PRIVATE"));ci.registerVersion("@firebase/analytics","0.6.12")}.apply(this,arguments)}catch(t){throw console.error(t),new Error("Cannot instantiate firebase-analytics.js - be sure to load firebase-app.js first.");}});!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("@firebase/app")):"function"==typeof define&&define.amd?define(["@firebase/app"],t):t((n="undefined"!=typeof globalThis?globalThis:n||self).firebase)}(this,function(n){"use strict";try{!function(){function i(n){return n&&"object"==typeof n&&"default"in n?n:{"default":n}}var t=i(n);!function(){function tk(n){var t,i,r="undefined"!=typeof Symbol&&Symbol.iterator&&n[Symbol.iterator];return r?r.call(n):{next:(t=n,i=0,function(){return i<t.length?{done:!1,value:t[i++]}:{done:!0}})}}function ik(n){return(n=n.querySelector&&n.querySelector("script[nonce]"))&&(n=n.nonce||n.getAttribute("nonce"))&&not.test(n)?n:""}function ei(){}function ne(n){var t=typeof n;return"object"!=t?t:n?Array.isArray(n)?"array":t:"null"}function te(n){var t=ne(n);return"array"==t||"object"==t&&"number"==typeof n.length}function wi(n){return"function"==ne(n)}function tt(n){var t=typeof n;return"object"==t&&null!=n||"function"==t}function tot(n){return n.call.apply(n.bind,arguments)}function iot(n,t){if(!n)throw Error();if(2<arguments.length){var i=Array.prototype.slice.call(arguments,2);return function(){var r=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(r,i),n.apply(t,r)}}return function(){return n.apply(t,arguments)}}function o(){return(o=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?tot:iot).apply(null,arguments)}function cu(n){var t=Array.prototype.slice.call(arguments,1);return function(){var i=t.slice();return i.push.apply(i,arguments),n.apply(this,i)}}function s(n,t){function i(){}i.prototype=t.prototype;n.ab=t.prototype;n.prototype=new i;n.prototype.constructor=n}function fl(n){return n}function i(n,t,i){this.code=re+n;this.message=t||rot[n]||"";this.a=i||null}function uk(n){var t=n&&n.code;return t?new i(t.substring(re.length),n.message,n.serverResponse):null}function ue(n){for(var t in el)if(el[t].id===n)return n=el[t],{firebaseEndpoint:n.Ta,secureTokenEndpoint:n.Za,identityPlatformEndpoint:n.Wa};return null}function fk(n){if(n)try{return n.$goog_Thenable}catch(n){return}}function at(n){var t;Error.captureStackTrace?Error.captureStackTrace(this,at):(t=Error().stack)&&(this.stack=t);n&&(this.message=String(n))}function ol(n,t){for(var r="",u=(n=n.split("%s")).length-1,i=0;i<u;i++)r+=n[i]+(i<t.length?t[i]:"%s");at.call(this,r+n[u])}function lu(n){throw new ol("Failure"+(n?": "+n:""),Array.prototype.slice.call(arguments,1));}function sl(n,t){this.c=n;this.f=t;this.b=0;this.a=null}function ek(n,t){n.f(t);n.b<100&&(n.b++,t.next=n.a,n.a=t)}function ok(){this.b=this.a=null}function cl(){this.next=this.b=this.a=null}function bi(n,t){return 0<=sk(n,t)}function is(n,t){var i;return(i=0<=(t=sk(n,t)))&&Array.prototype.splice.call(n,t,1),i}function ni(n,t){!function(n,t){for(var r="string"==typeof n?n.split(""):n,i=n.length-1;0<=i;--i)i in r&&t.call(void 0,r[i],i,n)}(n,function(i,r){t.call(void 0,i,r,n)&&1==Array.prototype.splice.call(n,r,1).length&&0})}function ll(){return Array.prototype.concat.apply([],arguments)}function cr(n){var i=n.length,r,t;if(0<i){for(r=Array(i),t=0;t<i;t++)r[t]=n[t];return r}return[]}function a(n,t){return-1!=n.indexOf(t)}function al(n,t){return n<t?-1:t<n?1:0}function it(n){return a(au,n)}function ck(n,t){for(var i in n)t.call(void 0,n[i],i,n)}function lr(n){for(var t in n)return;return 1}function ir(n){var t,i={};for(t in n)i[t]=n[t];return i}function ot(n){for(var t,i,u,r=1;r<arguments.length;r++){for(t in i=arguments[r])n[t]=i[t];for(u=0;u<vl.length;u++)t=vl[u],Object.prototype.hasOwnProperty.call(i,t)&&(n[t]=i[t])}}function lk(n,t){var u,f,i,e;n:{try{if(f=n&&n.ownerDocument,(u=(u=f&&(f.defaultView||f.parentWindow))||r).Element&&u.Location){i=u;break n}}catch(n){}i=null}if(i&&void 0!==i[t]&&(!n||!(n instanceof i[t])&&(n instanceof i.Location||n instanceof i.Element))){if(tt(n))try{e=n.constructor.displayName||n.constructor.name||Object.prototype.toString.call(n)}catch(n){e="<object could not be stringified>"}else e=void 0===n?"undefined":null===n?"null":typeof n;lu("Argument is not a %s (or a non-Element, non-Location mock); got: %s",t,e)}}function oi(n,t){this.a=n===fe&&t||"";this.b=pl}function yl(n){return n instanceof oi&&n.constructor===oi&&n.b===pl?n.a:(lu("expected object of type Const, got '"+n+"'"),"type_error:Const")}function ak(){if(void 0===rs){var n=null,t=r.trustedTypes;if(t&&t.createPolicy){try{n=t.createPolicy("goog#html",{createHTML:fl,createScript:fl,createScriptURL:fl})}catch(n){r.console&&r.console.error(n.message)}rs=n}else rs=n}return rs}function yu(n,t){this.a=t===yk?n:""}function vk(n){return n instanceof yu&&n.constructor===yu?n.a:(lu("expected object of type TrustedResourceUrl, got '"+n+"' of type "+ne(n)),"type_error:TrustedResourceUrl")}function wl(n,t){var i,r=yl(n);if(!yot.test(r))throw Error("Invalid TrustedResourceUrl format: "+r);return n=r.replace(vot,function(n,i){if(!Object.prototype.hasOwnProperty.call(t,i))throw Error('Found marker, "'+i+'", in format string, "'+r+'", but no valid label mapping found in args: '+JSON.stringify(t));return(n=t[i])instanceof oi?yl(n):encodeURIComponent(String(n))}),i=n,n=ak(),new yu(i=n?n.createScriptURL(i):i,yk)}function vt(n,t){this.a=t===ee?n:""}function us(n){return n instanceof vt&&n.constructor===vt?n.a:(lu("expected object of type SafeUrl, got '"+n+"' of type "+ne(n)),"type_error:SafeUrl")}function wk(n){return n instanceof vt?n:(n="object"==typeof n&&n.sa?n.ra():String(n),n=pk.test(n)||(t=(n=(n=String(n)).replace(/(%0A|%0D)/g,"")).match(wot))&&pot.test(t[1])?new vt(n,ee):null);var t}function bk(n){return n instanceof vt?n:(n="object"==typeof n&&n.sa?n.ra():String(n),new vt(n=pk.test(n)?n:"about:invalid#zClosurez",ee))}function pu(n,t,i){this.a=i===kl?n:""}function kk(n,t,i,u){return n=n instanceof vt?n:bk(n),t=t||r,i=i instanceof oi?yl(i):i||"",t.open(us(n),i,u,void 0)}function dk(n){for(var t=n.split("%s"),i="",r=Array.prototype.slice.call(arguments,1);r.length&&1<t.length;)i+=t.shift()+r.shift();return i+t.join("%s")}function dl(n){return aot.test(n)&&-1!=(n=-1!=(n=-1!=(n=-1!=(n=-1!=(n=-1!=n.indexOf("&")?n.replace(eot,"&amp;"):n).indexOf("<")?n.replace(oot,"&lt;"):n).indexOf(">")?n.replace(sot,"&gt;"):n).indexOf('"')?n.replace(hot,"&quot;"):n).indexOf("'")?n.replace(cot,"&#39;"):n).indexOf("\0")&&(n=n.replace(lot,"&#0;")),n}function gl(n){return gl[" "](n),n}function td(){var n=r.document;if(n)return n.documentMode}function rd(n){return t=n,r=function(){for(var t,i,r=0,f=hk(String(fs)).split("."),e=hk(String(n)).split("."),o=Math.max(f.length,e.length),u=0;0==r&&u<o;u++)for(t=f[u]||"",i=e[u]||"";t=/(\d*)(\D*)(.*)/.exec(t)||["","","",""],i=/(\d*)(\D*)(.*)/.exec(i)||["","","",""],(0!=t[0].length||0!=i[0].length)&&(r=al(0==t[1].length?0:parseInt(t[1],10),0==i[1].length?0:parseInt(i[1],10))||al(0==t[2].length,0==i[2].length)||al(t[2],i[2]),t=t[3],i=i[3],0==r););return 0<=r},i=id,Object.prototype.hasOwnProperty.call(i,t)?i[t]:i[t]=r(t);var t,r,i}function oe(n){var t=document;return"string"==typeof n?t.getElementById(n):n}function fd(n,t){ck(t,function(t,i){t&&"object"==typeof t&&t.sa&&(t=t.ra());"style"==i?n.style.cssText=t:"class"==i?n.className=t:"for"==i?n.htmlFor=t:ta.hasOwnProperty(i)?n.setAttribute(ta[i],t):0==i.lastIndexOf("aria-",0)||0==i.lastIndexOf("data-",0)?n.setAttribute(i,t):n[i]=t})}function got(){var r,i=arguments,u=document,t=String(i[0]),n=i[1];return!ud&&n&&(n.name||n.type)&&(t=["<",t],n.name&&t.push(' name="',dl(n.name),'"'),n.type&&(t.push(' type="',dl(n.type),'"'),ot(r={},n),delete r.type,n=r),t.push(">"),t=t.join("")),t=os(u,t),n&&("string"==typeof n?t.className=n:Array.isArray(n)?t.className=n.join(" "):fd(t,n)),2<i.length&&function(n,t,i){function e(i){i&&t.appendChild("string"==typeof i?n.createTextNode(i):i)}for(var r,f,u=2;u<i.length;u++)if(r=i[u],!te(r)||tt(r)&&0<r.nodeType)e(r);else{n:{if(r&&"number"==typeof r.length){if(tt(r)){f="function"==typeof r.item||"string"==typeof r.item;break n}if(wi(r)){f="function"==typeof r.item;break n}}f=!1}p(f?cr(r):r,e)}}(u,t,i),t}function os(n,t){return t=String(t),"application/xhtml+xml"===n.contentType&&(t=t.toLowerCase()),n.createElement(t)}function od(n){r.setTimeout(function(){throw n;},0)}function ss(n,t){na||function(){var n;na=r.Promise&&r.Promise.resolve?(n=r.Promise.resolve(void 0),function(){n.then(sd)}):function(){var n=sd;!wi(r.setImmediate)||r.Window&&r.Window.prototype&&!it("Edge")&&r.Window.prototype.setImmediate==r.setImmediate?(ed=ed||function(){var t=r.MessageChannel;if(void 0===(t=void 0===t&&"undefined"!=typeof window&&window.postMessage&&window.addEventListener&&!it("Presto")?function(){var n=os(document,"IFRAME"),t,r,i;n.style.display="none";document.documentElement.appendChild(n);t=n.contentWindow;(n=t.document).open();n.close();r="callImmediate"+Math.random();i="file:"==t.location.protocol?"*":t.location.protocol+"//"+t.location.host;n=o(function(n){"*"!=i&&n.origin!=i||n.data!=r||this.port1.onmessage()},this);t.addEventListener("message",n,!1);this.port1={};this.port2={postMessage:function(){t.postMessage(r,i)}}}:t)||it("Trident")||it("MSIE"))return function(n){r.setTimeout(n,0)};var u=new t,n={},i=n;return u.port1.onmessage=function(){var t;void 0!==n.next&&(t=(n=n.next).Gb,n.Gb=null,t())},function(n){i.next={Gb:n};i=i.next;u.port2.postMessage(0)}}())(n):r.setImmediate(n)}}();hs||(na(),hs=!0);ia.add(n,t)}function sd(){for(var t,n;n=t=void 0,n=null,(t=ia).a&&(n=t.a,t.a=t.a.next,t.a||(t.b=null),n.next=null),n=n;){try{n.a.call(n.b)}catch(t){od(t)}ek(hl,n)}hs=!1}function c(n,t){if(this.a=ar,this.i=void 0,this.f=this.b=this.c=null,this.g=this.h=!1,n!=ei)try{var i=this;n.call(t,function(n){vr(i,se,n)},function(n){if(!(n instanceof wu))try{if(n instanceof Error)throw n;throw Error("Promise rejected.");}catch(n){}vr(i,di,n)})}catch(n){vr(this,di,n)}}function hd(){this.next=this.f=this.b=this.g=this.a=null;this.c=!1}function ua(n,t,i){var r=ra.get();return r.g=n,r.b=t,r.f=i,r}function e(n){if(n instanceof c)return n;var t=new c(ei);return vr(t,se,n),t}function v(n){return new c(function(t,i){i(n)})}function cd(n,t,i){vd(n,t,i,null)||ss(cu(t,n))}function ld(n){return new c(function(t){var r=n.length,u=[],f,i;if(r)for(f=function(n,i,f){r--;u[n]=i?{Pb:!0,value:f}:{Pb:!1,reason:f};0==r&&t(u)},i=0;i<n.length;i++)cd(n[i],cu(f,i,!0),cu(f,i,!1));else t(u)})}function fa(n,t){n.b||n.a!=se&&n.a!=di||yd(n);n.f?n.f.next=t:n.b=t;n.f=t}function ad(n,t,i,r){var u=ua(null,null,null);return u.a=new c(function(n,f){u.g=t?function(i){try{var u=t.call(r,i);n(u)}catch(i){f(i)}}:n;u.b=i?function(t){try{var u=i.call(r,t);void 0===u&&t instanceof wu?f(t):n(u)}catch(t){f(t)}}:f}),fa(u.a.c=n,u),u.a}function vr(n,t,i){var r,u;n.a==ar&&(n===i&&(t=di,i=new TypeError("Promise cannot resolve to itself")),n.a=1,vd(i,n.$c,n.ad,n)||(n.i=i,n.a=t,n.c=null,yd(n),t!=di||i instanceof wu||(u=i,(r=n).g=!0,ss(function(){r.g&&ea.call(null,u)}))))}function vd(n,t,i,r){if(n instanceof c)return fa(n,ua(t||ei,i||null,r)),1;if(fk(n))return n.then(t,i,r),1;if(tt(n))try{var u=n.then;if(wi(u))return function(n,t,i,r,u){function e(n){f||(f=!0,r.call(u,n))}var f=!1;try{t.call(n,function(n){f||(f=!0,i.call(u,n))},e)}catch(n){e(n)}}(n,u,t,i,r),1}catch(n){return i.call(r,n),1}}function yd(n){n.h||(n.h=!0,ss(n.gc,n))}function pd(n){var t=null;return n.b&&(t=n.b,n.b=t.next,t.next=null),n.b||(n.f=null),t}function wd(n,t,i,r){if(i==di&&t.b&&!t.c)for(;n&&n.g;n=n.c)n.g=!1;if(t.a)t.a.c=null,bd(t,i,r);else try{t.c?t.g.call(t.f):bd(t,i,r)}catch(n){ea.call(null,n)}ek(ra,t)}function bd(n,t,i){t==se?n.g.call(n.f,i):n.b&&n.b.call(n.f,i)}function wu(n){at.call(this,n)}function cs(){this.xa=this.xa;this.pa=this.pa}function dd(n){n.xa||(n.xa=!0,n.Da(),0==kd)||(n=n,Object.prototype.hasOwnProperty.call(n,ns)&&n[ns]||(n[ns]=++rk))}function ht(n,t){this.type=n;this.b=this.target=t;this.defaultPrevented=!1}function yr(n,t){var r,i,u;if(ht.call(this,n?n.type:""),this.relatedTarget=this.b=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.pointerId=0,this.pointerType="",this.a=null,n){if(r=this.type=n.type,i=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:null,this.target=n.target||n.srcElement,this.b=t,t=n.relatedTarget){if(nd){n:{try{gl(t.nodeName);u=!0;break n}catch(n){}u=!1}u||(t=null)}}else"mouseover"==r?t=n.fromElement:"mouseout"==r&&(t=n.toElement);this.relatedTarget=t;i?(this.clientX=void 0!==i.clientX?i.clientX:i.pageX,this.clientY=void 0!==i.clientY?i.clientY:i.pageY,this.screenX=i.screenX||0,this.screenY=i.screenY||0):(this.clientX=void 0!==n.clientX?n.clientX:n.pageX,this.clientY=void 0!==n.clientY?n.clientY:n.pageY,this.screenX=n.screenX||0,this.screenY=n.screenY||0);this.button=n.button;this.key=n.key||"";this.ctrlKey=n.ctrlKey;this.altKey=n.altKey;this.shiftKey=n.shiftKey;this.metaKey=n.metaKey;this.pointerId=n.pointerId||0;this.pointerType="string"==typeof n.pointerType?n.pointerType:ng[n.pointerType]||"";(this.a=n).defaultPrevented&&this.preventDefault()}}function rst(n,t,i,r,u){this.listener=n;this.proxy=null;this.src=t;this.type=i;this.capture=!!r;this.Va=u;this.key=++tg;this.va=this.Pa=!1}function ls(n){n.va=!0;n.listener=null;n.proxy=null;n.src=null;n.Va=null}function as(n){this.src=n;this.a={};this.b=0}function oa(n,t){var i=t.type;i in n.a&&is(n.a[i],t)&&(ls(t),0==n.a[i].length&&(delete n.a[i],n.b--))}function sa(n,t,i,r){for(var f,u=0;u<n.length;++u)if(f=n[u],!f.va&&f.listener==t&&f.capture==!!i&&f.Va==r)return u;return-1}function bt(n,t,i,r,u){if(r&&r.once)ha(n,t,i,r,u);else if(Array.isArray(t))for(var f=0;f<t.length;f++)bt(n,t[f],i,r,u);else i=ca(i),n&&n[bu]?og(n,t,i,tt(r)?!!r.capture:!!r,u):ig(n,t,i,!1,r,u)}function ig(n,t,i,r,u,f){if(!t)throw Error("Invalid event type");var o,e,h=tt(u)?!!u.capture:!!u,s=ps(n);if(s||(n[vs]=s=new as(n)),!(i=s.add(t,i,r,h,f)).proxy)if(o=ust,e=gd?function(n){return o.call(e.src,e.listener,n)}:function(n){if(!(n=o.call(e.src,e.listener,n)))return n},(i.proxy=r=e).src=n,r.listener=i,n.addEventListener)void 0===(u=ist?u:h)&&(u=!1),n.addEventListener(t.toString(),r,u);else if(n.attachEvent)n.attachEvent(ug(t.toString()),r);else{if(!n.addListener||!n.removeListener)throw Error("addEventListener and attachEvent are unavailable.");n.addListener(r)}}function ha(n,t,i,r,u){if(Array.isArray(t))for(var f=0;f<t.length;f++)ha(n,t[f],i,r,u);else i=ca(i),n&&n[bu]?la(n,t,i,tt(r)?!!r.capture:!!r,u):ig(n,t,i,!0,r,u)}function yt(n,t,i,r,u){if(Array.isArray(t))for(var f=0;f<t.length;f++)yt(n,t[f],i,r,u);else r=tt(r)?!!r.capture:!!r,i=ca(i),n&&n[bu]?(n=n.v,(t=String(t).toString())in n.a&&-1<(i=sa(f=n.a[t],i,r,u))&&(ls(f[i]),Array.prototype.splice.call(f,i,1),0==f.length&&(delete n.a[t],n.b--))):(n=n&&ps(n))&&(t=n.a[t.toString()],(i=(n=-1)<(n=t?sa(t,i,r,u):n)?t[n]:null)&&rg(i))}function rg(n){var t,i,r;"number"!=typeof n&&n&&!n.va&&((t=n.src)&&t[bu]?oa(t.v,n):(i=n.type,r=n.proxy,t.removeEventListener?t.removeEventListener(i,r,n.capture):t.detachEvent?t.detachEvent(ug(i),r):t.addListener&&t.removeListener&&t.removeListener(r),(i=ps(t))?(oa(i,n),0==i.b&&(i.src=null,t[vs]=null)):ls(n)))}function ug(n){return n in ys?ys[n]:ys[n]="on"+n}function fg(n,t,i,r){var f=!0,u;if((n=ps(n))&&(t=n.a[t.toString()]))for(t=t.concat(),n=0;n<t.length;n++)u=t[n],u&&u.capture==i&&!u.va&&(u=eg(u,r),f=f&&!1!==u);return f}function eg(n,t){var i=n.listener,r=n.Va||n.src;return n.Pa&&rg(n),i.call(r,t)}function ust(n,t){var i,u,e,f;if(n.va)return!0;if(gd)return eg(n,new yr(t,this));if(!t)n:{for(t=["window","event"],f=r,i=0;i<t.length;i++)if(null==(f=f[t[i]])){t=null;break n}t=f}if(t=new yr(i=t,this),f=!0,!(i.keyCode<0||null!=i.returnValue)){n:{if(u=!1,0==i.keyCode)try{i.keyCode=-1;break n}catch(n){u=!0}(u||null==i.returnValue)&&(i.returnValue=!0)}for(i=[],u=t.b;u;u=u.parentNode)i.push(u);for(n=n.type,u=i.length-1;0<=u;u--)t.b=i[u],e=fg(i[u],n,!0,t),f=f&&e;for(u=0;u<i.length;u++)t.b=i[u],e=fg(i[u],n,!1,t),f=f&&e}return f}function ps(n){return(n=n[vs])instanceof as?n:null}function ca(n){return wi(n)?n:(n[ws]||(n[ws]=function(t){return n.handleEvent(t)}),n[ws])}function ft(){cs.call(this);this.v=new as(this);(this.ac=this).gb=null}function og(n,t,i,r,u){n.v.add(String(t),i,!1,r,u)}function la(n,t,i,r,u){n.v.add(String(t),i,!0,r,u)}function bs(n,t,i,r){var f,e,o,s,u;if(!(t=n.v.a[String(t)]))return!0;for(t=t.concat(),f=!0,e=0;e<t.length;++e)u=t[e],u&&!u.va&&u.capture==i&&(o=u.listener,s=u.Va||u.src,u.Pa&&oa(n.v,u),f=!1!==o.call(s,r)&&f);return f&&!r.defaultPrevented}function aa(n,t,i){if(wi(n))i&&(n=o(n,i));else{if(!n||"function"!=typeof n.handleEvent)throw Error("Invalid listener argument");n=o(n.handleEvent,n)}return 2147483647<Number(t)?-1:r.setTimeout(n,t||0)}function ku(n){var t=null;return new c(function(i,r){-1==(t=aa(function(){i(void 0)},n))&&r(Error("Failed to schedule timer."))}).o(function(n){throw r.clearTimeout(t),n;})}function sg(n){if(n.W&&"function"==typeof n.W)return n.W();if("string"==typeof n)return n.split("");if(te(n)){for(var t=[],r=n.length,i=0;i<r;i++)t.push(n[i]);return t}for(i in t=[],r=0,n)t[r++]=n[i];return t}function hg(n){var t,i,r;if(n.Y&&"function"==typeof n.Y)return n.Y();if(!n.W||"function"!=typeof n.W){if(te(n)||"string"==typeof n){for(t=[],n=n.length,i=0;i<n;i++)t.push(i);return t}for(r in t=[],i=0,n)t[i++]=r;return t}}function du(n){var i,t;if(this.b={},this.a=[],this.c=0,i=arguments.length,1<i){if(i%2)throw Error("Uneven number of arguments");for(t=0;t<i;t+=2)this.set(arguments[t],arguments[t+1])}else if(n)if(n instanceof du)for(i=n.Y(),t=0;t<i.length;t++)this.set(i[t],n.get(i[t]));else for(t in n)this.set(t,n[t])}function va(n){var t,r,u,i;if(n.c!=n.a.length){for(t=0,i=0;t<n.a.length;)r=n.a[t],pr(n.b,r)&&(n.a[i++]=r),t++;n.a.length=i}if(n.c!=n.a.length){for(u={},i=t=0;t<n.a.length;)pr(u,r=n.a[t])||(u[n.a[i++]=r]=1),t++;n.a.length=i}}function pr(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function rr(n,t){var i;this.a=this.l=this.c="";this.g=null;this.h=this.f="";this.i=!1;n instanceof rr?(this.i=void 0!==t?t:n.i,he(this,n.c),this.l=n.l,this.a=n.a,ce(this,n.g),this.f=n.f,pa(this,vg(n.b)),this.h=n.h):n&&(i=String(n).match(ya))?(this.i=!!t,he(this,i[1]||"",!0),this.l=le(i[2]||""),this.a=le(i[3]||"",!0),ce(this,i[4]),this.f=le(i[5]||"",!0),pa(this,i[6]||"",!0),this.h=le(i[7]||"")):(this.i=!!t,this.b=new wr(null,this.i))}function he(n,t,i){n.c=i?le(t,!0):t;n.c&&(n.c=n.c.replace(/:$/,""))}function ce(n,t){if(t){if(t=Number(t),isNaN(t)||t<0)throw Error("Bad port number "+t);n.g=t}else n.g=null}function pa(n,t,i){var r,u;t instanceof wr?(n.b=t,r=n.b,(u=n.i)&&!r.f&&(ur(r),r.c=null,r.a.forEach(function(n,t){var i=t.toLowerCase();t!=i&&(si(this,t),ag(this,i,n))},r)),r.f=u):(i||(t=ae(t,sst)),n.b=new wr(t,n.i))}function k(n,t,i){n.b.set(t,i)}function kt(n,t){return n.b.get(t)}function ct(n){return n instanceof rr?new rr(n):new rr(n,void 0)}function ks(n,t,i,r){var u=new rr(null,void 0);return n&&he(u,n),t&&(u.a=t),i&&ce(u,i),r&&(u.f=r),u}function le(n,t){return n?t?decodeURI(n.replace(/%25/g,"%2525")):decodeURIComponent(n):""}function ae(n,t,i){return"string"==typeof n?(n=encodeURI(n).replace(t,fst),n=i?n.replace(/%25([0-9a-fA-F]{2})/g,"%$1"):n):null}function fst(n){return"%"+((n=n.charCodeAt(0))>>4&15).toString(16)+(15&n).toString(16)}function wr(n,t){this.b=this.a=null;this.c=n||null;this.f=!!t}function ur(n){n.a||(n.a=new du,n.b=0,n.c&&function(n,t){var i,f,r,u;if(n)for(n=n.split("&"),i=0;i<n.length;i++)r=n[i].indexOf("="),u=null,0<=r?(f=n[i].substring(0,r),u=n[i].substring(r+1)):f=n[i],t(f,u?decodeURIComponent(u.replace(/\+/g," ")):"")}(n.c,function(t,i){n.add(decodeURIComponent(t.replace(/\+/g," ")),i)}))}function lg(n){var u=hg(n),i,t,f,r;if(void 0===u)throw Error("Keys are undefined");for(i=new wr(null,void 0),n=sg(n),t=0;t<u.length;t++)f=u[t],r=n[t],Array.isArray(r)?ag(i,f,r):i.add(f,r);return i}function si(n,t){ur(n);t=gu(n,t);pr(n.a.b,t)&&(n.c=null,n.b-=n.a.get(t).length,pr((n=n.a).b,t)&&(delete n.b[t],n.c--,n.a.length>2*n.c&&va(n)))}function wa(n,t){return ur(n),t=gu(n,t),pr(n.a.b,t)}function ag(n,t,i){si(n,t);0<i.length&&(n.c=null,n.a.set(gu(n,t),cr(i)),n.b+=i.length)}function vg(n){var t=new wr;return t.c=n.c,n.a&&(t.a=new du(n.a),t.b=n.b),t}function gu(n,t){return t=String(t),t=n.f?t.toLowerCase():t}function yg(n){var t=[];return function n(t,i,r){var u,e,f;if(null==i)r.push("null");else{if("object"==typeof i){if(Array.isArray(i)){for(u=i,i=u.length,r.push("["),e="",f=0;f<i;f++)r.push(e),n(t,u[f],r),e=",";return void r.push("]")}if(!(i instanceof String||i instanceof Number||i instanceof Boolean)){for(u in r.push("{"),e="",i)Object.prototype.hasOwnProperty.call(i,u)&&(f=i[u],"function"!=typeof f&&(r.push(e),wg(u,r),r.push(":"),n(t,f,r),e=","));return void r.push("}")}i=i.valueOf()}switch(typeof i){case"string":wg(i,r);break;case"number":r.push(isFinite(i)&&!isNaN(i)?String(i):"null");break;case"boolean":r.push(String(i));break;case"function":r.push("null");break;default:throw Error("Unknown type: "+typeof i);}}}(new cst,n,t),t.join("")}function cst(){}function wg(n,t){t.push('"',n.replace(pg,function(n){var t=ba[n];return t||(t="\\u"+(65536|n.charCodeAt(0)).toString(16).substr(1),ba[n]=t),t}),'"')}function ka(){var n=ut();return ti&&ki&&11==ki||/Edge\/\d+/.test(n)}function ve(){return r.window&&r.window.location.href||self&&self.location&&self.location.href||""}function bg(n,t){t=t||r.window;var i="about:blank";n&&(i=us(wk(n)||bl));t.location.href=i}function kg(n){return!!((n=(n||ut()).toLowerCase()).match(/android/)||n.match(/webos/)||n.match(/iphone|ipad|ipod/)||n.match(/blackberry/)||n.match(/windows phone/)||n.match(/iemobile/))}function br(n){n=n||r.window;try{n.close()}catch(n){}}function dg(n,t,i){var u=Math.floor(1e9*Math.random()).toString(),e,f,r;t=t||500;i=i||600;e=(window.screen.availHeight-i)/2;f=(window.screen.availWidth-t)/2;for(r in t={width:t,height:i,top:0<e?e:0,left:0<f?f:0,location:!0,resizable:!0,statusbar:!0,toolbar:!1},i=ut().toLowerCase(),u&&(t.target=u,a(i,"crios/")&&(t.target="_blank")),nf(ut())==gs&&(n=n||"http://localhost",t.scrollbars=!0),i=n||"",(n=t)||(n={}),u=window,t=i instanceof vt?i:wk(void 0!==i.href?i.href:String(i))||bl,i=n.target||i.target,e=[],n)switch(r){case"width":case"height":case"top":case"left":e.push(r+"="+n[r]);break;case"target":case"noopener":case"noreferrer":break;default:e.push(r+"="+(n[r]?1:0))}if(r=e.join(","),(it("iPhone")&&!it("iPod")&&!it("iPad")||it("iPad")||it("iPod"))&&u.navigator&&u.navigator.standalone&&i&&"_self"!=i?(lk(r=os(document,"A"),"HTMLAnchorElement"),t=t instanceof vt?t:bk(t),r.href=us(t),r.setAttribute("target",i),n.noreferrer&&r.setAttribute("rel","noreferrer"),(n=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,u,1),r.dispatchEvent(n),r={}):n.noreferrer?(r=kk("",u,i,r),n=us(t),r&&(kot&&a(n,";")&&(n="'"+n.replace(/'/g,"%27")+"'"),r.opener=null,n='<meta name="referrer" content="no-referrer"><meta http-equiv="refresh" content="0; url='+dl(n)+'">',n=new pu(n=(u=ak())?u.createHTML(n):n,0,kl),u=r.document)&&(u.write((f=n)instanceof pu&&f.constructor===pu?f.a:(lu("expected object of type SafeHtml, got '"+f+"' of type "+ne(f)),"type_error:SafeHtml")),u.close())):(r=kk(t,u,i,r))&&n.noopener&&(r.opener=null),r)try{r.focus()}catch(n){}return r}function ds(){var n=null;return new c(function(t){"complete"==r.document.readyState?t():(n=function(){t()},ha(window,"load",n))}).o(function(t){throw yt(window,"load",n),t;})}function da(n){return n=n||ut(),!("file:"!==rf()&&"ionic:"!==rf()||!n.toLowerCase().match(/iphone|ipad|ipod|android/))}function ga(){var n=r.window;try{return n&&n!=n.top}catch(n){return}}function ii(){return void 0!==r.WorkerGlobalScope&&"function"==typeof r.importScripts}function hi(){return t.default.INTERNAL.hasOwnProperty("reactNative")?"ReactNative":t.default.INTERNAL.hasOwnProperty("node")?"Node":ii()?"Worker":"Browser"}function tn(){var n=hi();return"ReactNative"===n||"Node"===n}function nf(n){var t=n.toLowerCase();return a(t,"opera/")||a(t,"opr/")||a(t,"opios/")?"Opera":a(t,"iemobile")?"IEMobile":a(t,"msie")||a(t,"trident/")?"IE":a(t,"edge/")?"Edge":a(t,"firefox/")?gs:a(t,"silk/")?"Silk":a(t,"blackberry")?"Blackberry":a(t,"webos")?"Webos":!a(t,"safari/")||a(t,"chrome/")||a(t,"crios/")||a(t,"android")?!a(t,"chrome/")&&!a(t,"crios/")||a(t,"edge/")?a(t,"android")?"Android":(n=n.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/))&&2==n.length?n[1]:"Other":nv:"Safari"}function tf(n,t){t=t||[];var r,i=[],u={};for(r in tv)u[tv[r]]=!0;for(r=0;r<t.length;r++)void 0!==u[t[r]]&&(delete u[t[r]],i.push(t[r]));return i.sort(),(t=i).length||(t=["FirebaseCore-web"]),"Browser"===(i=hi())?i=nf(u=ut()):"Worker"===i&&(i=nf(u=ut())+"-"+i),i+"/JsCore/"+n+"/"+t.join(",")}function ut(){return r.navigator&&r.navigator.userAgent||""}function y(n,t){n=n.split(".");t=t||r;for(var i=0;i<n.length&&"object"==typeof t&&null!=t;i++)t=t[n[i]];if(i==n.length)return t}function iv(){try{var n=r.localStorage,t=dr();if(n)return n.setItem(t,"1"),n.removeItem(t),!ka()||!!r.indexedDB}catch(n){return ii()&&!!r.indexedDB}return!1}function kr(){return(nh()||"chrome-extension:"===rf()||da())&&!tn()&&iv()&&!ii()}function nh(){return"http:"===rf()||"https:"===rf()}function rf(){return r.location&&r.location.protocol||null}function ye(n){return!kg(n=n||ut())&&nf(n)!=gs}function pe(n){return void 0===n?null:yg(n)}function rn(n){var t,i={};for(t in n)n.hasOwnProperty(t)&&null!==n[t]&&void 0!==n[t]&&(i[t]=n[t]);return i}function uf(n){if(null!==n)return JSON.parse(n)}function dr(n){return n||Math.floor(1e9*Math.random()).toString()}function un(n){return"Safari"!=nf(n=n||ut())&&!n.toLowerCase().match(/iphone|ipad|ipod/)}function fn(){var n=r.___jsl,t,i;if(n&&n.H)for(t in n.H)if(n.H[t].r=n.H[t].r||[],n.H[t].L=n.H[t].L||[],n.H[t].r=n.H[t].L.concat(),n.CP)for(i=0;i<n.CP.length;i++)n.CP[i]=null}function fr(n,t){if(t<n)throw Error("Short delay should be less than long delay!");this.a=n;this.c=t;n=ut();t=hi();this.b=kg(n)||"ReactNative"===t}function rv(){var n=r.document;return!n||void 0===n.visibilityState||"visible"==n.visibilityState}function lst(){var n=r.document,t=null;return rv()||!n?e():new c(function(i){t=function(){rv()&&(n.removeEventListener("visibilitychange",t,!1),i())};n.addEventListener("visibilitychange",t,!1)}).o(function(i){throw n.removeEventListener("visibilitychange",t,!1),i;})}function we(n){try{var t=new Date(parseInt(n,10));if(!isNaN(t.getTime())&&!/[^0-9]/.test(n))return t.toUTCString()}catch(n){}return null}function en(){return y("fireauth.oauthhelper",r)||y("fireauth.iframe",r)}function ev(n){fv[n]||(fv[n]=!0,"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(n))}function f(n,t,i){uv?Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:i}):n[t]=i}function et(n,t){if(t)for(var i in t)t.hasOwnProperty(i)&&f(n,i,t[i])}function ci(n){var t={};return et(t,n),t}function ov(n){var t=n,i;if("object"==typeof n&&null!=n)for(i in t="length"in n?[]:{},n)f(t,i,ov(n[i]));return t}function sv(n){var r=n&&(n[av]?"phone":null),t;if(!(r&&n&&n[lv]))throw new i("internal-error","Internal assert: invalid MultiFactorInfo object");f(this,"uid",n[lv]);f(this,"displayName",n[on]||null);t=null;f(this,"enrollmentTime",t=n[cv]?new Date(n[cv]).toUTCString():t);f(this,"factorId",r)}function hv(n){try{var t=new be(n)}catch(n){t=null}return t}function be(n){sv.call(this,n);f(this,"phoneNumber",n[av])}function ast(n){var t={},r=n[vst],u=n[pst],i=n[wst];if(n=hv(n[yst]),!i||i!=ih&&i!=ke&&!r||i==ke&&!u||i==vv&&!n)throw Error("Invalid checkActionCode response!");i==ke?(t[hn]=r||null,t[cn]=r||null,t[sn]=u):(t[hn]=u||null,t[cn]=u||null,t[sn]=r||null);t[bst]=n||null;f(this,dst,i);f(this,kst,ov(t))}function yv(n){var r=kt(n=ct(n),ln)||null,u=kt(n,an)||null,t=(t=kt(n,vn)||null)&&iht[t]||null;if(!r||!u||!t)throw new i("argument-error",ln+", "+an+"and "+vn+" are required in a valid action code URL.");et(this,{apiKey:r,operation:t,code:u,continueUrl:kt(n,gst)||null,languageCode:kt(n,nht)||null,tenantId:kt(n,tht)||null})}function yn(n){try{return new yv(n)}catch(n){return null}}function rh(n){if(void 0===(t=n[rht]))throw new i("missing-continue-uri");if("string"!=typeof t||"string"==typeof t&&!t.length)throw new i("invalid-continue-uri");if(this.h=t,this.b=this.a=null,this.g=!1,(r=n[pn])&&"object"==typeof r){var t=r[gn],u=r[kn],r=r[dn];if("string"==typeof t&&t.length){if(this.a=t,void 0!==u&&"boolean"!=typeof u)throw new i("argument-error",kn+" property must be a boolean when specified.");if(this.g=!!u,void 0!==r&&("string"!=typeof r||"string"==typeof r&&!r.length))throw new i("argument-error",dn+" property must be a non empty string when specified.");this.b=r||null}else{if(void 0!==t)throw new i("argument-error",gn+" property must be a non empty string when specified.");if(void 0!==u||void 0!==r)throw new i("missing-android-pkg-name");}}else if(void 0!==r)throw new i("argument-error",pn+" property must be a non null object when specified.");if(this.f=null,(t=n[bn])&&"object"==typeof t){if("string"==typeof(t=t[ntt])&&t.length)this.f=t;else if(void 0!==t)throw new i("argument-error",ntt+" property must be a non empty string when specified.");}else if(void 0!==t)throw new i("argument-error",bn+" property must be a non null object when specified.");if(void 0!==(t=n[pv])&&"boolean"!=typeof t)throw new i("argument-error",pv+" property must be a boolean when specified.");if(this.c=!!t,void 0!==(n=n[wn])&&("string"!=typeof n||"string"==typeof n&&!n.length))throw new i("argument-error",wn+" property must be a non empty string when specified.");this.i=n||null}function uh(n){var i,t={};for(i in t.continueUrl=n.h,t.canHandleCodeInApp=n.c,(t.androidPackageName=n.a)&&(t.androidMinimumVersion=n.b,t.androidInstallApp=n.g),t.iOSBundleId=n.f,t.dynamicLinkDomain=n.i,t)null===t[i]&&delete t[i];return t}function uht(n){var t=[];return function(n,t){function i(t){for(;r<n.length;){var i=n.charAt(r++),u=ff[i];if(null!=u)return u;if(!/^[\s\xa0]*$/.test(i))throw Error("Unknown base64 encoding at char: "+i);}return t}var r;for(!function(){var i,n,r;if(!ff){ff={};for(var u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),f=["+/=","+/","-_=","-_.","-_"],t=0;t<5;t++)for(i=u.concat(f[t].split("")),n=0;n<i.length;n++)r=i[n],void 0===ff[r]&&(ff[r]=n)}}(),r=0;;){var e=i(-1),o=i(0),u=i(64),f=i(64);if(64===f&&-1===e)break;t(e<<2|o>>4);64!=u&&(t(o<<4&240|u>>2),64!=f&&t(u<<6&192|f))}}(n,function(n){t.push(n)}),t}function fh(n){var t=ttt(n);if(!(t&&t.sub&&t.iss&&t.aud&&t.exp))throw Error("Invalid JWT");this.h=n;this.a=t.exp;this.i=t.sub;n=Date.now()/1e3;this.g=t.iat||(n>this.a?this.a:n);this.b=t.provider_id||t.firebase&&t.firebase.sign_in_provider||null;this.f=t.firebase&&t.firebase.tenant||null;this.c=!!t.is_anonymous||"anonymous"==this.b}function eh(n){try{return new fh(n)}catch(n){return null}}function ttt(n){var t,r,u,f,e,o,i;if(!n||3!=(n=n.split(".")).length)return null;for(t=(4-(n=n[1]).length%4)%4,r=0;r<t;r++)n+=".";try{for(u=uht(n),n=[],r=t=0;t<u.length;)i=u[t++],i<128?n[r++]=String.fromCharCode(i):191<i&&i<224?(f=u[t++],n[r++]=String.fromCharCode((31&i)<<6|63&f)):239<i&&i<365?(o=((7&i)<<18|(63&(f=u[t++]))<<12|(63&(e=u[t++]))<<6|63&u[t++])-65536,n[r++]=String.fromCharCode(55296+(o>>10)),n[r++]=String.fromCharCode(56320+(1023&o))):(f=u[t++],e=u[t++],n[r++]=String.fromCharCode((15&i)<<12|(63&f)<<6|63&e));return JSON.parse(n.join(""))}catch(n){}return null}function bv(n){for(var t in wv)if(wv[t].fa==n)return wv[t];return null}function rtt(n){var t={},i;t["facebook.com"]=utt;t["google.com"]=ett;t["github.com"]=ftt;t["twitter.com"]=ott;i=n&&n[kv];try{if(i)return new(t[i]||li)(n);if(void 0!==n[sh])return new dv(n)}catch(n){}return null}function dv(n){var t,i=n[kv];if(i||!n[sh]||(t=eh(n[sh]))&&t.b&&(i=t.b),!i)throw Error("Invalid additional user info!");t=!1;void 0!==n.isNewUser?t=!!n.isNewUser:"identitytoolkit#SignupNewUserResponse"===n.kind&&(t=!0);f(this,"providerId",i="anonymous"==i||"custom"==i?null:i);f(this,"isNewUser",t)}function li(n){dv.call(this,n);f(this,"profile",ov((n=uf(n.rawUserInfo||"{}"))||{}))}function utt(n){if(li.call(this,n),"facebook.com"!=this.providerId)throw Error("Invalid provider ID!");}function ftt(n){if(li.call(this,n),"github.com"!=this.providerId)throw Error("Invalid provider ID!");f(this,"username",this.profile&&this.profile.login||null)}function ett(n){if(li.call(this,n),"google.com"!=this.providerId)throw Error("Invalid provider ID!");}function ott(n){if(li.call(this,n),"twitter.com"!=this.providerId)throw Error("Invalid provider ID!");f(this,"username",n.screenName||null)}function stt(n){var i=kt(t=ct(n),"link"),r=kt(ct(i),"link"),t=kt(t,"deep_link_id");return kt(ct(t),"link")||t||r||i||n}function hh(n,t){if(!n&&!t)throw new i("internal-error","Internal assert: no raw session string available");if(n&&t)throw new i("internal-error","Internal assert: unable to determine the session type");this.a=n||null;this.b=t||null;this.type=this.a?ef:de}function of(){}function sf(n,t){return n.then(function(n){if(n[fi]){var r=eh(n[fi]);if(!r||t!=r.i)throw new i("user-mismatch");return n}throw new i("user-mismatch");}).o(function(n){throw n&&n.code&&n.code==re+"user-not-found"?new i("user-mismatch"):n;})}function gr(n,t){if(!t)throw new i("internal-error","failed to construct a credential");this.a=t;f(this,"providerId",n);f(this,"signInMethod",n)}function gv(n){return{pendingToken:n.a,requestUri:"http://localhost"}}function fht(n){if(n&&n.providerId&&n.signInMethod&&0==n.providerId.indexOf("saml.")&&n.pendingToken)try{return new gr(n.providerId,n.pendingToken)}catch(n){}return null}function gi(n,t,r){if(this.a=null,t.idToken||t.accessToken)t.idToken&&f(this,"idToken",t.idToken),t.accessToken&&f(this,"accessToken",t.accessToken),t.nonce&&!t.pendingToken&&f(this,"nonce",t.nonce),t.pendingToken&&(this.a=t.pendingToken);else{if(!t.oauthToken||!t.oauthTokenSecret)throw new i("internal-error","failed to construct a credential");f(this,"accessToken",t.oauthToken);f(this,"secret",t.oauthTokenSecret)}f(this,"providerId",n);f(this,"signInMethod",r)}function ny(n){var t={};return n.idToken&&(t.id_token=n.idToken),n.accessToken&&(t.access_token=n.accessToken),n.secret&&(t.oauth_token_secret=n.secret),t.providerId=n.providerId,n.nonce&&!n.a&&(t.nonce=n.nonce),t={postBody:lg(t).toString(),requestUri:"http://localhost"},n.a&&(delete t.postBody,t.pendingToken=n.a),t}function eht(n){if(n&&n.providerId&&n.signInMethod){var t={idToken:n.oauthIdToken,accessToken:n.oauthTokenSecret?null:n.oauthAccessToken,oauthTokenSecret:n.oauthTokenSecret,oauthToken:n.oauthTokenSecret&&n.oauthAccessToken,nonce:n.nonce,pendingToken:n.pendingToken};try{return new gi(n.providerId,t,n.signInMethod)}catch(n){}}return null}function nu(n,t){this.Qc=t||[];et(this,{providerId:n,isOAuthProvider:!0});this.Ib={};this.pb=(bv(n)||{}).Ja||null;this.ob=null}function htt(n){if("string"!=typeof n||0!=n.indexOf("saml."))throw new i("argument-error",'SAML provider IDs must be prefixed with "saml."');nu.call(this,n,[])}function pt(n){nu.call(this,n,oh);this.a=[]}function tu(){pt.call(this,"facebook.com")}function ctt(n){if(!n)throw new i("argument-error","credential failed: expected 1 argument (the OAuth access token).");var t=n;return tt(n)&&(t=n.accessToken),(new tu).credential({accessToken:t})}function iu(){pt.call(this,"github.com")}function ltt(n){if(!n)throw new i("argument-error","credential failed: expected 1 argument (the OAuth access token).");var t=n;return tt(n)&&(t=n.accessToken),(new iu).credential({accessToken:t})}function ru(){pt.call(this,"google.com");this.Ca("profile")}function att(n,t){var i=n;return tt(n)&&(i=n.idToken,t=n.accessToken),(new ru).credential({idToken:i,accessToken:t})}function hf(){nu.call(this,"twitter.com",itt)}function vtt(n,t){var r=n;if(!(r=tt(r)?r:{oauthToken:n,oauthTokenSecret:t}).oauthToken||!r.oauthTokenSecret)throw new i("argument-error","credential failed: expected 2 arguments (the OAuth access token and secret).");return new gi("twitter.com",r,"twitter.com")}function er(n,t,i){this.a=n;this.f=t;f(this,"providerId","password");f(this,"signInMethod",i===dt.EMAIL_LINK_SIGN_IN_METHOD?dt.EMAIL_LINK_SIGN_IN_METHOD:dt.EMAIL_PASSWORD_SIGN_IN_METHOD)}function oht(n){return n&&n.email&&n.password?new er(n.email,n.password,n.signInMethod):null}function dt(){et(this,{providerId:"password",isOAuthProvider:!1})}function ytt(n,t){if(!(t=ty(t)))throw new i("argument-error","Invalid email link!");return new er(n,t.code,dt.EMAIL_LINK_SIGN_IN_METHOD)}function ty(n){return(n=yn(n=stt(n)))&&n.operation===ih?n:null}function or(n){if(!(n.eb&&n.cb||n.La&&n.ea))throw new i("internal-error");this.a=n;f(this,"providerId","phone");this.fa="phone";f(this,"signInMethod","phone")}function sht(n){if(n&&"phone"===n.providerId&&(n.verificationId&&n.verificationCode||n.temporaryProof&&n.phoneNumber)){var t={};return p(["verificationId","verificationCode","temporaryProof","phoneNumber"],function(i){n[i]&&(t[i]=n[i])}),new or(t)}return null}function ge(n){return n.a.La&&n.a.ea?{temporaryProof:n.a.La,phoneNumber:n.a.ea}:{sessionInfo:n.a.eb,code:n.a.cb}}function nr(n){try{this.a=n||t.default.auth()}catch(n){throw new i("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().");}et(this,{providerId:"phone",isOAuthProvider:!1})}function ptt(n,t){if(!n)throw new i("missing-verification-id");if(!t)throw new i("missing-verification-code");return new or({eb:n,cb:t})}function iy(n){var t;if(n.temporaryProof&&n.phoneNumber)return new or({La:n.temporaryProof,ea:n.phoneNumber});if(t=n&&n.providerId,!t||"password"===t)return null;var i=n&&n.oauthAccessToken,f=n&&n.oauthTokenSecret,e=n&&n.nonce,u=n&&n.oauthIdToken,r=n&&n.pendingToken;try{switch(t){case"google.com":return att(u,i);case"facebook.com":return ctt(i);case"github.com":return ltt(i);case"twitter.com":return vtt(i,f);default:return i||f||u||r?r?0==t.indexOf("saml.")?new gr(t,r):new gi(t,{pendingToken:r,idToken:n.oauthIdToken,accessToken:n.oauthAccessToken},t):new pt(t).credential({idToken:u,accessToken:i,rawNonce:e}):null}}catch(n){return null}}function ry(n){if(!n.isOAuthProvider)throw new i("invalid-oauth-provider");}function ri(n,t,r,u,f,e,o){if(this.c=n,this.b=t||null,this.g=r||null,this.f=u||null,this.i=e||null,this.h=o||null,this.a=f||null,!this.g&&!this.a)throw new i("invalid-auth-event");if(this.g&&this.a)throw new i("invalid-auth-event");if(this.g&&!this.f)throw new i("invalid-auth-event");}function wtt(n){return(n=n||{}).type?new ri(n.type,n.eventId,n.urlResponse,n.sessionId,n.error&&uk(n.error),n.postBody,n.tenantId):null}function hht(){this.b=null;this.a=[]}function fy(n){var u="unauthorized-domain",r=void 0,t=ct(n);n=t.a;"chrome-extension"==(t=t.c)?r=dk("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.",n):"http"==t||"https"==t?r=dk("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.",n):u="operation-not-supported-in-this-environment";i.call(this,u,r)}function no(n,t,r){i.call(this,n,r);(n=t||{}).Jb&&f(this,"email",n.Jb);n.ea&&f(this,"phoneNumber",n.ea);n.credential&&f(this,"credential",n.credential);n.Zb&&f(this,"tenantId",n.Zb)}function lh(n){var t,r;if(n.code){if(t=n.code||"",0==t.indexOf(re)&&(t=t.substring(re.length)),r={credential:iy(n),Zb:n.tenantId},n.email)r.Jb=n.email;else if(n.phoneNumber)r.ea=n.phoneNumber;else if(!r.credential)return new i(t,n.message||void 0);return new no(t,r,n.message)}return null}function to(){}function btt(n){return n.c||(n.c=n.b())}function ah(){}function ktt(n){var i,t,r;if(n.f||"undefined"!=typeof XMLHttpRequest||"undefined"==typeof ActiveXObject)return n.f;for(i=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],t=0;t<i.length;t++){r=i[t];try{return new ActiveXObject(r),n.f=r}catch(n){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed");}function vh(){}function dtt(){this.a=new XDomainRequest;this.readyState=0;this.onreadystatechange=null;this.responseType=this.responseText=this.response="";this.status=-1;this.statusText="";this.a.onload=o(this.qc,this);this.a.onerror=o(this.Sb,this);this.a.onprogress=o(this.rc,this);this.a.ontimeout=o(this.vc,this)}function ey(n,t){n.readyState=t;n.onreadystatechange&&n.onreadystatechange()}function oy(n,t,i){this.reset(n,t,i,void 0,void 0)}function sy(n){this.f=n;this.b=this.c=this.a=null}function io(n,t){this.name=n;this.value=t}function cy(n){var i,r,t;return ph||(ph=new sy(""),(yh[""]=ph).c=cht),(i=yh[n])||(i=new sy(n),t=n.lastIndexOf("."),r=n.substr(t+1),(t=cy(n.substr(0,t))).b||(t.b={}),(t.b[r]=i).a=t,yh[n]=i),i}function gt(n,t){n&&n.log(lht,t,void 0)}function wh(n){this.f=n}function bh(n){ft.call(this);this.u=n;this.h=void 0;this.readyState=kh;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=cy("goog.net.FetchXmlHttp");this.m=this.c=this.g=null}function tit(n){n.c.read().then(n.pc.bind(n)).catch(n.Ua.bind(n))}function ro(n){n.readyState=4;n.g=null;n.c=null;n.m=null;uo(n)}function uo(n){n.onreadystatechange&&n.onreadystatechange.call(n)}function fo(n){ft.call(this);this.headers=new du;this.D=n||null;this.c=!1;this.C=this.a=null;this.h=this.R=this.l="";this.f=this.O=this.i=this.J=!1;this.g=0;this.s=null;this.m=ly;this.u=this.S=!1}function aht(n,t,i,u,f){if(n.a)throw Error("[goog.net.XhrIo] Object is active with another request="+n.l+"; newUri="+t);i=i?i.toUpperCase():"GET";n.l=t;n.h="";n.R=i;n.J=!1;n.c=!0;n.a=(n.D||uy).a();n.C=n.D?btt(n.D):btt(uy);n.a.onreadystatechange=o(n.Vb,n);try{gt(n.b,tr(n,"Opening Xhr"));n.O=!0;n.a.open(i,String(t),!0);n.O=!1}catch(t){return gt(n.b,tr(n,"Error opening Xhr: "+t.message)),void uit(n,t)}t=u||"";var s,e=new du(n.headers);f&&function(n,t){if(n.forEach&&"function"==typeof n.forEach)n.forEach(t,void 0);else if(te(n)||"string"==typeof n)p(n,t,void 0);else for(var r=hg(n),u=sg(n),f=u.length,i=0;i<f;i++)t.call(void 0,u[i],r&&r[i],n)}(f,function(n,t){e.set(t,n)});f=function(n){n:{for(var t=vht,u=n.length,r="string"==typeof n?n.split(""):n,i=0;i<u;i++)if(i in r&&t.call(void 0,r[i],i,n)){t=i;break n}t=-1}return t<0?null:"string"==typeof n?n.charAt(t):n[t]}(e.Y());u=r.FormData&&t instanceof r.FormData;!bi(rit,i)||f||u||e.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");e.forEach(function(n,t){this.a.setRequestHeader(t,n)},n);n.m&&(n.a.responseType=n.m);"withCredentials"in n.a&&n.a.withCredentials!==n.S&&(n.a.withCredentials=n.S);try{oit(n);0<n.g&&(n.u=(s=n.a,ti&&rd(9)&&"number"==typeof s.timeout&&void 0!==s.ontimeout),gt(n.b,tr(n,"Will abort after "+n.g+"ms if incomplete, xhr2 "+n.u)),n.u?(n.a.timeout=n.g,n.a.ontimeout=o(n.Ma,n)):n.s=aa(n.Ma,n.g,n));gt(n.b,tr(n,"Sending request"));n.i=!0;n.a.send(t);n.i=!1}catch(t){gt(n.b,tr(n,"Send error: "+t.message));uit(n,t)}}function vht(n){return"content-type"==n.toLowerCase()}function uit(n,t){n.c=!1;n.a&&(n.f=!0,n.a.abort(),n.f=!1);n.h=t;fit(n);dh(n)}function fit(n){n.J||(n.J=!0,n.dispatchEvent("complete"),n.dispatchEvent("error"))}function eit(n){var t,u,s,i,f,e,o;if(n.c&&void 0!==rl)if(n.C[1]&&4==eo(n)&&2==gh(n))gt(n.b,tr(n,"Local request error detected and ignored"));else if(n.i&&4==eo(n))aa(n.Vb,0,n);else if(n.dispatchEvent("readystatechange"),4==eo(n)){gt(n.b,tr(n,"Request complete"));n.c=!1;try{f=gh(n);n:switch(f){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:e=!0;break n;default:e=!1}if((t=e)||((u=0===f)&&(!(i=String(n.l).match(ya)[1]||null)&&r.self&&r.self.location&&(i=(s=r.self.location.protocol).substr(0,s.length-1)),u=!iit.test(i?i.toLowerCase():"")),t=u),t)n.dispatchEvent("complete"),n.dispatchEvent("success");else{try{o=2<eo(n)?n.a.statusText:""}catch(t){gt(n.b,"Can not get status: "+t.message);o=""}n.h=o+" ["+gh(n)+"]";fit(n)}}finally{dh(n)}}}function dh(n,t){if(n.a){oit(n);var i=n.a,r=n.C[0]?ei:null;n.a=null;n.C=null;t||n.dispatchEvent("ready");try{i.onreadystatechange=r}catch(t){(n=n.b)&&n.log(gtt,"Problem encountered resetting onreadystatechange: "+t.message,void 0)}}}function oit(n){n.a&&n.u&&(n.a.ontimeout=null);n.s&&(r.clearTimeout(n.s),n.s=null)}function eo(n){return n.a?n.a.readyState:0}function gh(n){try{return 2<eo(n)?n.a.status:-1}catch(n){return-1}}function tr(n,t){return t+" ["+n.R+" "+n.l+" "+gh(n)+"]"}function uu(n){var t=yht;this.g=[];this.u=t;this.s=n||null;this.f=this.a=!1;this.c=void 0;this.v=this.C=this.i=!1;this.h=0;this.b=null;this.l=0}function oo(n,t,i){n.a=!0;n.c=i;n.f=!t;hit(n)}function nc(n){if(n.a){if(!n.v)throw new tc;n.v=!1}}function ay(n,t,i,r){n.g.push([t,i,r]);n.a&&hit(n)}function sit(n){return fot(n.g,function(n){return wi(n[1])})}function hit(n){var f,t,u,i;for(n.h&&n.a&&sit(n)&&(t=n.h,(f=ho[t])&&(r.clearTimeout(f.a),delete ho[t]),n.h=0),n.b&&(n.b.l--,delete n.b),t=n.c,u=f=!1;n.g.length&&!n.i;){var s=(e=n.g.shift())[0],h=e[1],e=e[2];if(s=n.f?h:s)try{i=s.call(e||n.s,t);void 0!==i&&(n.f=n.f&&(i==t||i instanceof Error),n.c=t=i);(fk(t)||"function"==typeof r.Promise&&t instanceof r.Promise)&&(u=!0,n.i=!0)}catch(u){t=u;n.f=!0;sit(n)||(f=!0)}}n.c=t;u&&(i=o(n.m,n,!0),u=o(n.m,n,!1),t instanceof uu?(ay(t,i,u),t.C=!0):t.then(i,u));f&&(t=new cit(t),ho[t.a]=t,n.h=t.a)}function tc(){at.call(this)}function so(){at.call(this)}function cit(n){this.a=r.setTimeout(o(this.c,this),0);this.b=n}function vy(n){var f=document,o=vk(n).toString(),t=os(document,"SCRIPT"),i={Wb:t,Ma:void 0},u=new uu(i),e=window.setTimeout(function(){ic(t,!0);var n=new yy(ait,"Timeout reached for loading script "+o);nc(u);oo(u,!1,n)},5e3);return i.Ma=e,t.onload=t.onreadystatechange=function(){t.readyState&&"loaded"!=t.readyState&&"complete"!=t.readyState||(ic(t,!1,e),nc(u),oo(u,!0,null))},t.onerror=function(){ic(t,!0,e);var n=new yy(lit,"Error while loading script "+o);nc(u);oo(u,!1,n)},ot(i={},{type:"text/javascript",charset:"UTF-8"}),fd(t,i),i=n,lk(n=t,"HTMLScriptElement"),n.src=vk(i),(i=(i=n.ownerDocument&&n.ownerDocument.defaultView)&&i!=r?ik(i.document):ul=null===ul?ik(r.document):ul)&&n.setAttribute("nonce",i),((f=((i=f)||document).getElementsByTagName("HEAD"))&&0!=f.length?f[0]:i.documentElement).appendChild(t),u}function yht(){var n;this&&this.Wb&&(n=this.Wb)&&"SCRIPT"==n.tagName&&ic(n,!0,this.Ma)}function ic(n,t,i){null!=i&&r.clearTimeout(i);n.onload=ei;n.onerror=ei;n.onreadystatechange=ei;t&&window.setTimeout(function(){n&&n.parentNode&&n.parentNode.removeChild(n)},0)}function yy(n,t){var i="Jsloader error (code #"+n+")";t&&(i+=": "+t);at.call(this,i);this.code=n}function rc(n){this.f=n}function ui(n,u,f){if(this.c=n,this.l=(n=u||{}).secureTokenEndpoint||"https://securetoken.googleapis.com/v1/token",this.m=n.secureTokenTimeout||pht,this.g=ir(n.secureTokenHeaders||wht),this.h=n.firebaseEndpoint||"https://www.googleapis.com/identitytoolkit/v3/relyingparty/",this.i=n.identityPlatformEndpoint||"https://identitytoolkit.googleapis.com/v2/",this.v=n.firebaseTimeout||bht,this.a=ir(n.firebaseHeaders||kht),f&&(this.a["X-Client-Version"]=f,this.g["X-Client-Version"]=f),f="Node"==hi(),!(f=r.XMLHttpRequest||f&&t.default.INTERNAL.node&&t.default.INTERNAL.node.XMLHttpRequest)&&!ii())throw new i("internal-error","The XMLHttpRequest compatibility library was not found.");this.f=void 0;this.f=ii()?new wh(self):tn()?new rc(f):new vh;this.b=null}function vit(n,t){t?n.a["X-Firebase-Locale"]=t:delete n.a["X-Firebase-Locale"]}function cf(n,t){t&&(n.l=wy("https://securetoken.googleapis.com/v1/token",t),n.h=wy("https://www.googleapis.com/identitytoolkit/v3/relyingparty/",t),n.i=wy("https://identitytoolkit.googleapis.com/v2/",t))}function wy(n,t){return n=ct(n),t=ct(t.url),n.f=n.a+n.f,he(n,t.c),n.a=t.a,ce(n,t.g),n.toString()}function yit(n,t){t?(n.a["X-Client-Version"]=t,n.g["X-Client-Version"]=t):(delete n.a["X-Client-Version"],delete n.g["X-Client-Version"])}function pit(n,t,i,u,f,e,s){var h;(n=((h=nf(h=ut())==nv&&(h=h.match(/\sChrome\/(\d+)/i))&&2==h.length?parseInt(h[1],10):null)&&h<30||ti&&ki&&!(9<ki))&&!ii()?(py=py||new c(function(n,t){var i,u;i=n;u=t;((window.gapi||{}).client||{}).request?i():(r[by]=function(){((window.gapi||{}).client||{}).request?i():u(Error("CORS_UNSUPPORTED"))},function(n,t){ay(n,null,t,void 0)}(vy(wl(wit,{onload:by})),function(){u(Error("CORS_UNSUPPORTED"))}))}),o(n.s,n)):o(n.u,n))(t,i,u,f,e,s)}function dht(n,t,r,u,f,e,o){var s=ct(t+r),l,h;if(k(s,"key",n.c),o&&k(s,"cb",Date.now().toString()),l="GET"==u,l)for(h in f)f.hasOwnProperty(h)&&k(s,h,f[h]);return new c(function(t,r){pit(n,s.toString(),function(n){n?n.error?r(up(n,e||{})):t(n):r(new i("network-request-failed"))},u,l?void 0:yg(rn(f)),n.a,n.v.get())})}function fu(n){if("string"!=typeof(n=n.email)||!nn.test(n))throw new i("invalid-email");}function bit(n){"email"in n&&fu(n)}function lt(n){if(!n[fi]){if(n.mfaPendingCredential)throw new i("multi-factor-auth-required",null,ir(n));throw new i("internal-error");}}function ky(n){if(n.phoneNumber||n.temporaryProof){if(!n.phoneNumber||!n.temporaryProof)throw new i("internal-error");}else{if(!n.sessionInfo)throw new i("missing-verification-id");if(!n.code)throw new i("missing-verification-code");}}function dit(n){if(!n.phoneVerificationInfo)throw new i("internal-error");if(!n.phoneVerificationInfo.sessionInfo)throw new i("missing-verification-id");if(!n.phoneVerificationInfo.code)throw new i("missing-verification-code");}function dy(n){if(!n.requestUri||!n.sessionId&&!n.postBody&&!n.pendingToken)throw new i("internal-error");}function gy(n,t){return t.oauthIdToken&&t.providerId&&0==t.providerId.indexOf("oidc.")&&!t.pendingToken&&(n.sessionId?t.nonce=n.sessionId:n.postBody&&wa(n=new wr(n.postBody),"nonce")&&(t.nonce=n.get("nonce"))),t}function git(n){var t=null;if(n.needConfirmation?(n.code="account-exists-with-different-credential",t=lh(n)):"FEDERATED_USER_ID_ALREADY_LINKED"==n.errorMessage?(n.code="credential-already-in-use",t=lh(n)):"EMAIL_EXISTS"==n.errorMessage?(n.code="email-already-in-use",t=lh(n)):n.errorMessage&&(t=rrt(n.errorMessage)),t)throw t;lt(n)}function np(n,t){return t.returnIdpCredential=!0,l(n,nlt,t)}function tp(n,t){return t.returnIdpCredential=!0,l(n,ilt,t)}function ip(n,t){return t.returnIdpCredential=!0,t.autoCreate=!1,l(n,tlt,t)}function rp(n){if(!n.oobCode)throw new i("invalid-action-code");}function l(n,t,r){if(!function(n,t){var i,r;if(!t||!t.length)return 1;if(n){for(i=0;i<t.length;i++)if(r=n[t[i]],null==r||""===r)return;return 1}}(r,t.N))return v(new i("internal-error"));var u,f=!!t.Na,o=t.Ub||"POST";return e(r).then(t.A).then(function(){return t.V&&(r.returnSecureToken=!0),t.B&&n.b&&void 0===r.tenantId&&(r.tenantId=n.b),dht(n,f?n.i:n.h,t.endpoint,o,r,t.Hb,t.lb||!1)}).then(function(n){return u=n,t.Ya?t.Ya(r,u):u}).then(t.G).then(function(){if(!t.Z)return u;if(!(t.Z in u))throw new i("internal-error");return u[t.Z]})}function rrt(n){return up({error:{errors:[{message:n}],code:400,message:n}})}function up(n,t){var f,r=(n.error&&n.error.errors&&n.error.errors[0]||{}).reason||"",u={keyInvalid:"invalid-api-key",ipRefererBlocked:"app-not-authorized"};if(r=u[r]?new i(u[r]):null)return r;for(f in r=n.error&&n.error.message||"",ot(u={INVALID_CUSTOM_TOKEN:"invalid-custom-token",CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_EMAIL:"invalid-email",INVALID_PASSWORD:"wrong-password",USER_DISABLED:"user-disabled",MISSING_PASSWORD:"internal-error",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_OR_INVALID_NONCE:"missing-or-invalid-nonce",INVALID_MESSAGE_PAYLOAD:"invalid-message-payload",INVALID_RECIPIENT_EMAIL:"invalid-recipient-email",INVALID_SENDER:"invalid-sender",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",INVALID_PROVIDER_ID:"invalid-provider-id",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",CORS_UNSUPPORTED:"cors-unsupported",DYNAMIC_LINK_NOT_ACTIVATED:"dynamic-link-not-activated",INVALID_APP_ID:"invalid-app-id",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",WEAK_PASSWORD:"weak-password",OPERATION_NOT_ALLOWED:"operation-not-allowed",USER_CANCELLED:"user-cancelled",CAPTCHA_CHECK_FAILED:"captcha-check-failed",INVALID_APP_CREDENTIAL:"invalid-app-credential",INVALID_CODE:"invalid-verification-code",INVALID_PHONE_NUMBER:"invalid-phone-number",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_APP_CREDENTIAL:"missing-app-credential",MISSING_CODE:"missing-verification-code",MISSING_PHONE_NUMBER:"missing-phone-number",MISSING_SESSION_INFO:"missing-verification-id",QUOTA_EXCEEDED:"quota-exceeded",SESSION_EXPIRED:"code-expired",REJECTED_CREDENTIAL:"rejected-credential",INVALID_CONTINUE_URI:"invalid-continue-uri",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",MISSING_IOS_BUNDLE_ID:"missing-ios-bundle-id",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_DYNAMIC_LINK_DOMAIN:"invalid-dynamic-link-domain",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",INVALID_CERT_HASH:"invalid-cert-hash",UNSUPPORTED_TENANT_OPERATION:"unsupported-tenant-operation",INVALID_TENANT_ID:"invalid-tenant-id",TENANT_ID_MISMATCH:"tenant-id-mismatch",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",EMAIL_CHANGE_NEEDS_VERIFICATION:"email-change-needs-verification",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",UNSUPPORTED_FIRST_FACTOR:"unsupported-first-factor",UNVERIFIED_EMAIL:"unverified-email"},t||{}),t=(t=r.match(/^[^\s]+\s*:\s*([\s\S]*)$/))&&1<t.length?t[1]:void 0,u)if(0===r.indexOf(f))return new i(u[f],t);return new i("internal-error",t=!t&&n?pe(n):t)}function slt(n){var t;this.b=n;this.a=null;this.rb=(t=this,(fp=fp||new c(function(n,t){function u(){fn();y("gapi.load")("gapi.iframes",{callback:n,ontimeout:function(){fn();t(Error("Network Error"))},timeout:clt.get()})}var i;y("gapi.iframes.Iframe")?n():y("gapi.load")?u():(i="__iframefcb"+Math.floor(1e6*Math.random()).toString(),r[i]=function(){y("gapi.load")?u():t(Error("Network Error"))},e(vy(i=wl(hlt,{onload:i}))).o(function(){t(Error("Network Error"))}))}).o(function(n){throw fp=null,n;})).then(function(){return new c(function(n,i){y("gapi.iframes.getContext")().open({where:document.body,url:t.b,messageHandlersFilter:y("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"),attributes:{style:{position:"absolute",top:"-100px",width:"1px",height:"1px"}},dontclear:!0},function(r){function u(){clearTimeout(f);n()}t.a=r;t.a.restyle({setHideOnLeave:!1});var f=setTimeout(function(){i(Error("Network Error"))},llt.get());r.ping(u).then(u,function(){i(Error("Network Error"))})})})}))}function urt(n,t,i,r){this.l=n;this.h=t;this.i=i;this.g=r;this.f=null;n=this.g?ks((n=ct(this.g.url)).c,n.a,n.g,"/emulator/auth/iframe"):ks("https",this.l,null,"/__/auth/iframe");this.a=n;k(this.a,"apiKey",this.h);k(this.a,"appName",this.i);this.b=null;this.c=[]}function ep(n,t,i,r,u,f){this.u=n;this.s=t;this.c=i;this.m=r;this.v=f;this.i=this.g=this.l=null;this.a=u;this.h=this.f=null}function op(n){try{return t.default.app(n).auth().Ga()}catch(n){return[]}}function frt(n,t,i,r,u,f){this.s=n;this.g=t;this.b=i;this.f=f;this.c=r||null;this.i=u||null;this.l=this.u=this.C=null;this.h=[];this.m=this.a=null}function ert(n){var t=ve();return l(n,yct,{}).then(function(n){return n.authorizedDomains||[]}).then(function(n){n:{for(var o=(u=ct(t)).c,u=u.a,f=0;f<n.length;f++){var i=n[f],r=u,e=o;if(r=0==i.indexOf("chrome-extension://")?ct(i).a==r&&"chrome-extension"==e:("http"==e||"https"==e)&&(gg.test(i)?r==i:(i=i.split(".").join("\\."),new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)))){n=!0;break n}}n=!1}if(!n)throw new fy(ve());})}function ort(n){return n.m||(n.m=ds().then(function(){var i,r,u,t;n.u||(i=n.c,r=n.i,u=op(n.b),(t=new urt(n.s,n.g,n.b,n.f)).f=i,t.b=r,t.c=cr(u||[]),n.u=t.toString());n.v=new slt(n.u),function(n){if(!n.v)throw Error("IfcHandler must be initialized!");!function(n,t){n.rb.then(function(){n.a.register("authEvent",t,y("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))})}(n.v,function(t){var i={},r;if(t&&t.authEvent){for(r=!1,t=wtt(t.authEvent),i=0;i<n.h.length;i++)r=n.h[i](t)||r;return(i={}).status=r?"ACK":"ERROR",e(i)}return i.status="ERROR",e(i)})}(n)}),n.m)}function srt(n){return n.l||(n.C=n.c?tf(n.c,op(n.b)):null,n.l=new ui(n.g,ue(n.i),n.C),n.f&&cf(n.l,n.f)),n.l}function co(n,t,i,r,u,f,e,o,s,h,c,l){return(n=new ep(n,t,i,r,u,l)).l=f,n.g=e,n.i=o,n.b=ir(s||null),n.f=h,n.yb(c).toString()}function hrt(n){if(this.a=n||t.default.INTERNAL.reactNative&&t.default.INTERNAL.reactNative.AsyncStorage,!this.a)throw new i("internal-error","The React Native compatibility library was not found.");this.type="asyncStorage"}function crt(n){this.b=n;this.a={};this.f=o(this.c,this)}function lrt(n,t,i){lr(n.a)&&n.b.addEventListener("message",n.f);void 0===n.a[t]&&(n.a[t]=[]);n.a[t].push(i)}function art(n){this.a=n}function vrt(n){this.c=n;this.b=!1;this.a=[]}function yrt(n,t,i,r){var e,h,o,s,a=i||{},f=null,l,u;return n.b?v(Error("connection_unavailable")):(l=r?800:50,u="undefined"!=typeof MessageChannel?new MessageChannel:null,new c(function(i,r){u?(e=Math.floor(Math.random()*Math.pow(10,20)).toString(),u.port1.start(),o=setTimeout(function(){r(Error("unsupported_event"))},l),f={messageChannel:u,onMessage:h=function(n){n.data.eventId===e&&("ack"===n.data.status?(clearTimeout(o),s=setTimeout(function(){r(Error("timeout"))},3e3)):"done"===n.data.status?(clearTimeout(s),void 0!==n.data.response?i(n.data.response):r(Error("unknown_error"))):(clearTimeout(o),clearTimeout(s),r(Error("invalid_response"))))}},n.a.push(f),u.port1.addEventListener("message",h),n.c.postMessage({eventType:t,eventId:e,data:a},[u.port2])):r(Error("connection_unavailable"))}).then(function(t){return cp(n,f),t}).o(function(t){throw cp(n,f),t;}))}function cp(n,t){var i,r;t&&(i=t.messageChannel,r=t.onMessage,i&&(i.port1.removeEventListener("message",r),i.port1.close()),ni(n.a,function(n){return n==t}))}function prt(){if(!ap())throw new i("web-storage-unsupported");this.c={};this.a=[];this.b=0;this.m=r.indexedDB;this.type="indexedDB";this.g=this.v=this.f=this.l=null;this.s=!1;this.h=null;var u,t,f,n=this;ii()&&self?(this.v=(f=ii()?self:null,p(hp,function(n){n.b==f&&(t=n)}),t||(t=new crt(f),hp.push(t)),t),lrt(this.v,"keyChanged",function(t,i){return krt(n).then(function(t){return 0<t.length&&p(n.a,function(n){n(t)}),{keyProcessed:bi(t,i.key)}})}),lrt(this.v,"ping",function(){return e(["keyChanged"])})):((u=r.navigator)&&u.serviceWorker?e().then(function(){return u.serviceWorker.ready}).then(function(n){return n.active||null}).o(function(){return null}):e(null)).then(function(t){(n.h=t)&&(n.g=new vrt(new art(t)),yrt(n.g,"ping",null,!0).then(function(t){t[0].fulfilled&&bi(t[0].value,"keyChanged")&&(n.s=!0)}).o(function(){}))})}function wrt(n){return new c(function(t,i){var r=n.m.open("firebaseLocalStorageDb",1);r.onerror=function(n){try{n.preventDefault()}catch(n){}i(Error(n.target.error))};r.onupgradeneeded=function(n){n=n.target.result;try{n.createObjectStore("firebaseLocalStorage",{keyPath:"fbase_key"})}catch(n){i(n)}};r.onsuccess=function(r){var u;(r=r.target.result).objectStoreNames.contains("firebaseLocalStorage")?t(r):(u=n,new c(function(n,t){var i=u.m.deleteDatabase("firebaseLocalStorageDb");i.onsuccess=function(){n()};i.onerror=function(n){t(Error(n.target.error))}}).then(function(){return wrt(n)}).then(function(n){t(n)}).o(function(n){i(n)}))}})}function lp(n){return n.i||(n.i=wrt(n)),n.i}function uc(n,t){var i=0;return new c(function r(u,f){lp(n).then(t).then(u).o(function(t){return 3<++i?void f(t):lp(n).then(function(t){return t.close(),n.i=void 0,r(u,f)}).o(function(n){f(n)})})})}function ap(){try{return r.indexedDB}catch(n){return}}function lo(n){return n.objectStore("firebaseLocalStorage")}function ao(n,t){return n.transaction(["firebaseLocalStorage"],t?"readwrite":"readonly")}function lf(n){return new c(function(t,i){n.onsuccess=function(n){n&&n.target?t(n.target.result):t()};n.onerror=function(n){i(n.target.error)}})}function brt(n,t){return n.g&&n.h&&((i=r.navigator)&&i.serviceWorker&&i.serviceWorker.controller||null)===n.h?yrt(n.g,"keyChanged",{key:t},n.s).then(function(){}).o(function(){}):e();var i}function krt(n){return lp(n).then(function(n){var t=lo(ao(n,!1));return t.getAll?lf(t.getAll()):new c(function(n,i){var r=[],u=t.openCursor();u.onsuccess=function(t){(t=t.target.result)?(r.push(t.value),t.continue()):n(r)};u.onerror=function(n){i(n.target.error)}})}).then(function(t){var r={},i=[];if(0==n.b){for(i=0;i<t.length;i++)r[t[i].fbase_key]=t[i].value;i=function t(n,i){var r,u=[];for(r in n)r in i&&typeof n[r]==typeof i[r]?"object"==typeof n[r]&&null!=n[r]&&null!=i[r]?0<t(n[r],i[r]).length&&u.push(r):n[r]!==i[r]&&u.push(r):u.push(r);for(r in i)r in n||u.push(r);return u}(n.c,r);n.c=r}return i})}function drt(n){n.l&&n.l.cancel("STOP_EVENT");n.f&&(clearTimeout(n.f),n.f=null)}function grt(n){var t=this,i=null;this.a=[];this.type="indexedDB";this.c=n;this.b=e().then(function(){if(ap()){var n=dr(),r="__sak"+n;return sp=sp||new prt,(i=sp).set(r,n).then(function(){return i.get(r)}).then(function(t){if(t!==n)throw Error("indexedDB not supported!");return i.U(r)}).then(function(){return i}).o(function(){return t.c})}return t.c}).then(function(n){return t.type=n.type,n.ca(function(n){p(t.a,function(t){t(n)})}),n})}function vo(){this.a={};this.type="inMemory"}function fc(){if(!function(){var n="Node"==hi();if(!(n=nut()||n&&t.default.INTERNAL.node&&t.default.INTERNAL.node.localStorage))return!1;try{return n.setItem("__sak","1"),n.removeItem("__sak"),!0}catch(n){return!1}}()){if("Node"==hi())throw new i("internal-error","The LocalStorage compatibility library was not found.");throw new i("web-storage-unsupported");}this.a=nut()||t.default.INTERNAL.node.localStorage;this.type="localStorage"}function nut(){try{var n=r.localStorage,t=dr();return n&&(n.setItem(t,"1"),n.removeItem(t)),n}catch(n){return null}}function vp(){this.type="nullStorage"}function yp(){if(!function(){var n="Node"==hi();if(!(n=tut()||n&&t.default.INTERNAL.node&&t.default.INTERNAL.node.sessionStorage))return!1;try{return n.setItem("__sak","1"),n.removeItem("__sak"),!0}catch(n){return!1}}()){if("Node"==hi())throw new i("internal-error","The SessionStorage compatibility library was not found.");throw new i("web-storage-unsupported");}this.a=tut()||t.default.INTERNAL.node.sessionStorage;this.type="sessionStorage"}function tut(){try{var n=r.sessionStorage,t=dr();return n&&(n.setItem(t,"1"),n.removeItem(t)),n}catch(n){return null}}function alt(){var n={};n.Browser=vlt;n.Node=ylt;n.ReactNative=plt;n.Worker=wlt;this.a=n[hi()]}function uut(){var n=!(un(ut())||!ga()),t=ye(),i=iv();this.m=n;this.h=t;this.l=i;this.a={};n=iut=iut||new alt;try{this.g=!ka()&&en()||!r.indexedDB?new n.a.F:new grt(new(ii()?vo:n.a.F))}catch(n){this.g=new vo;this.h=!0}try{this.i=new n.a.bb}catch(n){this.i=new vo}this.v=new vo;this.f=o(this.Yb,this);this.b={}}function yo(){return rut=rut||new uut}function eu(n,t){switch(t){case"session":return n.i;case"none":return n.v;default:return n.g}}function vf(n,t){return"firebase:"+n.name+(t?":"+t:"")}function yf(n,t,i){return i=vf(t,i),"local"==t.F&&(n.b[i]=null),eu(n,t.F).U(i)}function pp(n){n.c&&(clearInterval(n.c),n.c=null)}function blt(n){this.a=n;this.b=yo()}function klt(){this.a=yo()}function oc(n,t){this.b=fut;this.f=r.Uint8Array?new Uint8Array(this.b):Array(this.b);this.g=this.c=0;this.a=[];this.i=n;this.h=t;this.l=r.Int32Array?new Int32Array(64):Array(64);void 0===wp&&(wp=r.Int32Array?new Int32Array(nw):nw);this.reset()}function dp(n){for(var a,i=n.f,f=n.l,t=0,r=0;r<i.length;)f[t++]=i[r]<<24|i[r+1]<<16|i[r+2]<<8|i[r+3],r=4*t;for(i=16;i<64;i++){var r=0|f[i-15],t=0|f[i-2],e=(0|f[i-16])+((r>>>7|r<<25)^(r>>>18|r<<14)^r>>>3)|0,o=(0|f[i-7])+((t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)|0;f[i]=e+o|0}t=0|n.a[0];r=0|n.a[1];var s=0|n.a[2],l=0|n.a[3],u=0|n.a[4],h=0|n.a[5],c=0|n.a[6];for(e=0|n.a[7],i=0;i<64;i++)a=((t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10))+(t&r^t&s^r&s)|0,o=(e=e+((u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))|0)+((o=(o=u&h^~u&c)+(0|wp[i])|0)+(0|f[i])|0)|0,e=c,c=h,h=u,u=l+o|0,l=s,s=r,r=t,t=o+a|0;n.a[0]=n.a[0]+t|0;n.a[1]=n.a[1]+r|0;n.a[2]=n.a[2]+s|0;n.a[3]=n.a[3]+l|0;n.a[4]=n.a[4]+u|0;n.a[5]=n.a[5]+h|0;n.a[6]=n.a[6]+c|0;n.a[7]=n.a[7]+e|0}function gp(n,t,i){var f,r,u;if(void 0===i&&(i=t.length),f=0,r=n.c,"string"==typeof t)for(;f<i;)n.f[r++]=t.charCodeAt(f++),r==n.b&&(dp(n),r=0);else{if(!te(t))throw Error("message must be string or array");for(;f<i;){if(u=t[f++],!("number"==typeof u&&0<=u&&u<=255&&u==(0|u)))throw Error("message must be a byte array");n.f[r++]=u;r==n.b&&(dp(n),r=0)}}n.c=r;n.g+=i}function out(){oc.call(this,8,sut)}function hut(n,t,i,r,u,f){this.v=n;this.i=t;this.l=i;this.m=r||null;this.u=u||null;this.s=f;this.h=t+":"+i;this.C=new klt;this.g=new blt(this.h);this.f=null;this.b=[];this.a=this.c=null}function sc(n){return new i("invalid-cordova-configuration",n)}function glt(n){var t=new out,r,i,u;for(gp(t,n),n=[],r=8*t.g,t.c<56?gp(t,kp,56-t.c):gp(t,kp,t.b-(t.c-56)),i=63;56<=i;i--)t.f[i]=255&r,r/=256;for(dp(t),i=r=0;i<t.i;i++)for(u=24;0<=u;u-=8)n[r++]=t.a[i]>>u&255;return ts(n,function(n){return 1<(n=n.toString(16)).length?n:"0"+n}).join("")}function cut(n,t){for(var i=0;i<n.b.length;i++)try{n.b[i](t)}catch(n){}}function lut(n){return n.f||(n.f=n.ma().then(function(){return new c(function(t){function h(n){e=!0;o&&o.cancel();tw(u).then(function(t){var i,r=f;t&&n&&n.url&&(i=null,r=(i=-1!=(r=stt(n.url)).indexOf("/__/auth/callback")?(i="object"==typeof(i=uf(kt(i=ct(r),"firebaseError")||null))?uk(i):null)?new ri(t.c,t.b,null,null,i,null,t.T()):new ri(t.c,t.b,r,t.f,null,null,t.T()):i)||f);cut(u,r)})}var u,f,e,o,s;n.Ea(function e(i){return t(i),n.Sa(e),!1});u=n;f=new ri("unknown",null,null,null,new i("no-auth-event"));e=!1;o=ku(500).then(function(){return tw(u).then(function(){e||cut(u,f)})});s=r.handleOpenURL;r.handleOpenURL=function(n){if(0==n.toLowerCase().indexOf(y("BuildInfo.packageName",r).toLowerCase()+"://")&&h({url:n}),"function"==typeof s)try{s(n)}catch(n){console.error(n)}};ch=ch||new hht,function(n){var t=ch;t.a.push(n);t.b||(t.b=function(n){for(var i=0;i<t.a.length;i++)t.a[i](n)},"function"==typeof(n=y("universalLinks.subscribe",r))&&n(null,t.b))}(h)})})),n.f}function tw(n){var t,i=null;return(t=n.g).b.get(ec,t.a).then(wtt).then(function(t){return i=t,yf((t=n.g).b,ec,t.a)}).then(function(){return i})}function nat(n){this.a=n;this.b=yo()}function iw(n){return yf(n.b,hc,n.a)}function cc(n,t,i,r){this.i={};this.u=0;this.D=n;this.v=t;this.m=i;this.J=r;this.h=[];this.f=!1;this.l=o(this.s,this);this.b=new ac;this.C=new uft;this.g=new nat(nft(this.v,this.m));this.c={};this.c.unknown=this.b;this.c.signInViaRedirect=this.b;this.c.linkViaRedirect=this.b;this.c.reauthViaRedirect=this.b;this.c.signInViaPopup=this.C;this.c.linkViaPopup=this.C;this.c.reauthViaPopup=this.C;this.a=aut(this.D,this.v,this.m,ie,this.J)}function aut(n,i,r,u,f){var e=t.default.SDK_VERSION||null;return new(da()?hut:frt)(n,i,r,e,u,f)}function vut(n){n.f||(n.f=!0,n.a.Ea(n.l));var t=n.a;return n.a.ma().o(function(i){throw n.a==t&&n.reset(),i;})}function yut(n){n.a.Xb()&&vut(n).o(function(t){var r=new ri("unknown",null,null,null,new i("operation-not-supported-in-this-environment"));uw(t)&&n.s(r)});n.a.Tb()||ift(n.b)}function rw(n,t){bi(n.h,t)||n.h.push(t);n.f||(t=n.g).b.get(hc,t.a).then(function(n){return"pending"==n}).then(function(t){t?iw(n.g).then(function(){vut(n).o(function(t){var r=new ri("unknown",null,null,null,new i("operation-not-supported-in-this-environment"));uw(t)&&n.s(r)})}):yut(n)}).o(function(){yut(n)})}function put(n,t){ni(n.h,function(n){return n==t})}function kut(n,t,i,r,u,f,e){return n.a.Mb(t,i,r,function(){n.f||(n.f=!0,n.a.Ea(n.l))},function(){n.reset()},u,f,e)}function uw(n){return!(!n||"auth/cordova-not-ready"!=n.code)}function dut(n,t,r,u,f){var e,o;return(o=n.g).b.set(hc,"pending",o.a).then(function(){return n.a.Nb(t,r,u,f).o(function(t){if(uw(t))throw new i("operation-not-supported-in-this-environment");return e=t,iw(n.g).then(function(){throw e;})}).then(function(){return n.a.$b()?new c(function(){}):iw(n.g).then(function(){return n.qa()}).then(function(){}).o(function(){})})})}function gut(n,t,i,r,u){return n.a.Ob(r,function(n){t.na(i,null,n,u)},wut.get())}function nft(n,t,i){return n=n+":"+t,n=i?n+":"+i.url:n}function tft(n,t,i,r){var u=nft(t,i,r);return lc[u]||(lc[u]=new cc(n,t,i,r)),lc[u]}function ac(){this.b=null;this.f=[];this.c=[];this.a=null;this.i=this.g=!1}function ift(n){n.g||(n.g=!0,ou(n,!1,null,null))}function vc(n){n.g&&!n.i&&ou(n,!1,null,null)}function rft(n,t){if(n.b=function(){return e(t)},n.f.length)for(var i=0;i<n.f.length;i++)n.f[i](t)}function ou(n,t,i,r){t?r?function(n,t){if(n.b=function(){return v(t)},n.c.length)for(var i=0;i<n.c.length;i++)n.c[i](t)}(n,r):rft(n,i):rft(n,{user:null});n.f=[];n.c=[]}function uft(){}function fft(){this.ib=!1;Object.defineProperty(this,"appVerificationDisabled",{get:function(){return this.ib},set:function(n){this.ib=n},enumerable:!1})}function fw(n,t){this.a=t;f(this,"verificationId",n)}function ew(n,t,i,r){return new nr(n).fb(t,i).then(function(n){return new fw(n,r)})}function tat(n){var t=ttt(n);if(!(t&&t.exp&&t.auth_time&&t.iat))throw new i("internal-error","An internal error occurred. The token obtained by Firebase appears to be malformed. Please retry the operation.");et(this,{token:n,expirationTime:we(1e3*t.exp),authTime:we(1e3*t.auth_time),issuedAtTime:we(1e3*t.iat),signInProvider:t.firebase&&t.firebase.sign_in_provider?t.firebase.sign_in_provider:null,signInSecondFactor:t.firebase&&t.firebase.sign_in_second_factor?t.firebase.sign_in_second_factor:null,claims:t})}function ow(n,t,r){var u=t&&t[hw],e;if(!u)throw new i("argument-error","Internal assert: Invalid MultiFactorResolver");this.a=n;this.f=ir(t);this.g=r;this.c=new hh(null,u);this.b=[];e=this;p(t[sw]||[],function(n){(n=hv(n))&&e.b.push(n)});f(this,"auth",this.a);f(this,"session",this.c);f(this,"hints",this.b)}function cw(n,t,r,u){i.call(this,"multi-factor-auth-required",u,t);this.b=new ow(n,t,r);f(this,"resolver",this.b)}function eft(n,t,i){if(n&&tt(n.serverResponse)&&"auth/multi-factor-auth-required"===n.code)try{return new cw(t,n.serverResponse,i,n.message)}catch(n){}return null}function oft(){}function lw(n){f(this,"factorId",n.fa);this.a=n}function sft(n){if(lw.call(this,n),this.a.fa!=nr.PROVIDER_ID)throw new i("argument-error","firebase.auth.PhoneMultiFactorAssertion requires a valid firebase.auth.PhoneAuthCredential");}function pf(n,t){for(var i in ht.call(this,n),t)this[i]=t[i]}function aw(n,t){this.a=n;this.b=[];this.c=o(this.yc,this);bt(this.a,"userReloaded",this.c);var i=[];t&&t.multiFactor&&t.multiFactor.enrolledFactors&&p(t.multiFactor.enrolledFactors,function(n){var r=null,t={};if(n){n.uid&&(t[lv]=n.uid);n.displayName&&(t[on]=n.displayName);n.enrollmentTime&&(t[cv]=new Date(n.enrollmentTime).toISOString());n.phoneNumber&&(t[av]=n.phoneNumber);try{r=new be(t)}catch(n){}n=r}else n=null;n&&i.push(n)});yc(this,i)}function yc(n,t){n.b=t;f(n,"enrolledFactors",t)}function vw(n,t,i){if(this.h=n,this.i=t,this.g=i,this.c=3e4,this.f=96e4,this.b=null,this.a=this.c,this.f<this.c)throw Error("Proactive refresh lower bound greater than upper bound!");}function iat(n,t){return t?(n.a=n.c,n.g()):(t=n.a,n.a*=2,n.a>n.f&&(n.a=n.f),t)}function yw(n){this.f=n;this.b=this.a=null;this.c=Date.now()}function hft(n,t){void 0===t&&(t=n.b?(t=n.b).a-t.g:0);n.c=Date.now()+1e3*t}function cft(n,t){n.b=eh(t[fi]||"");n.a=t.refreshToken;hft(n,void 0!==(t=t.expiresIn)?Number(t):void 0)}function rat(n,t){return r=n.f,u=t,new c(function(n,t){"refresh_token"==u.grant_type&&u.refresh_token||"authorization_code"==u.grant_type&&u.code?pit(r,r.l+"?key="+encodeURIComponent(r.c),function(r){r?r.error?t(up(r)):r.access_token&&r.refresh_token?n(r):t(new i("internal-error")):t(new i("network-request-failed"))},"POST",lg(u).toString(),r.g,r.m.get()):t(new i("internal-error"))}).then(function(t){return n.b=eh(t.access_token),n.a=t.refresh_token,hft(n,t.expires_in),{accessToken:n.b.toString(),refreshToken:n.a}}).o(function(t){throw"auth/user-token-expired"==t.code&&(n.a=null),t;});var r,u}function pc(n,t){this.a=n||null;this.b=t||null;et(this,{lastSignInTime:we(t||null),creationTime:we(n||null)})}function uat(n,t,i,r,u,f){et(this,{uid:n,displayName:r||null,photoURL:u||null,email:i||null,phoneNumber:f||null,providerId:t})}function wt(n,i,r){var e,s,u;this.J=[];this.l=n.apiKey;this.m=n.appName;this.s=n.authDomain||null;s=t.default.SDK_VERSION?tf(t.default.SDK_VERSION):null;this.a=new ui(this.l,ue(ie),s);n.emulatorConfig&&cf(this.a,n.emulatorConfig);this.b=new yw(this.a);gw(this,i[fi]);cft(this.b,i);f(this,"refreshToken",this.b.a);aft(this,r||{});ft.call(this);this.R=!1;this.s&&kr()&&(this.i=tft(this.s,this.l,this.m));this.S=[];this.h=null;this.u=(e=this,new vw(function(){return e.I(!0)},function(n){return!(!n||"auth/network-request-failed"!=n.code)},function(){var n=e.b.c-Date.now()-3e5;return 0<n?n:0}));this.aa=o(this.hb,this);u=this;this.ya=null;this.Oa=function(n){u.wa(n.h)};this.ja=null;this.Aa=function(n){cf(u.a,n.c)};this.X=null;this.$=[];this.Ba=function(n){po(u,n.f)};this.ba=null;this.O=new aw(this,r);f(this,"multiFactor",this.O)}function pw(n,t){n.ja&&yt(n.ja,"languageCodeChanged",n.Oa);(n.ja=t)&&bt(t,"languageCodeChanged",n.Oa)}function ww(n,t){n.X&&yt(n.X,"emulatorConfigChanged",n.Aa);(n.X=t)&&bt(t,"emulatorConfigChanged",n.Aa)}function po(n,i){n.$=i;yit(n.a,t.default.SDK_VERSION?tf(t.default.SDK_VERSION,n.$):null)}function bw(n,t){n.ba&&yt(n.ba,"frameworkChanged",n.Ba);(n.ba=t)&&bt(t,"frameworkChanged",n.Ba)}function kw(n){try{return t.default.app(n.m).auth()}catch(r){throw new i("internal-error","No firebase.auth.Auth instance is available for the Firebase App '"+n.m+"'!");}}function lft(n){n.D||n.u.b||(n.u.start(),yt(n,"tokenChanged",n.aa),bt(n,"tokenChanged",n.aa))}function dw(n){yt(n,"tokenChanged",n.aa);n.u.stop()}function gw(n,t){n.za=t;f(n,"_lat",t)}function su(n){for(var i=[],t=0;t<n.S.length;t++)i.push(n.S[t](n));return ld(i).then(function(){return n})}function wo(n){n.i&&!n.R&&(n.R=!0,rw(n.i,n))}function aft(n,t){et(n,{uid:t.uid,displayName:t.displayName||null,photoURL:t.photoURL||null,email:t.email||null,emailVerified:t.emailVerified||!1,phoneNumber:t.phoneNumber||null,isAnonymous:t.isAnonymous||!1,tenantId:t.tenantId||null,metadata:new pc(t.createdAt,t.lastLoginAt),providerData:[]});n.a.b=n.tenantId}function vft(){}function nb(n){return e().then(function(){if(n.D)throw new i("app-deleted");})}function tb(n){return ts(n.providerData,function(n){return n.providerId})}function ib(n,t){t&&(yft(n,t.providerId),n.providerData.push(t))}function yft(n,t){ni(n.providerData,function(n){return n.providerId==t})}function sr(n,t,i){("uid"!=t||i)&&n.hasOwnProperty(t)&&f(n,t,i)}function wc(n,t){var r,i;n!=t&&(et(n,{uid:t.uid,displayName:t.displayName,photoURL:t.photoURL,email:t.email,emailVerified:t.emailVerified,phoneNumber:t.phoneNumber,isAnonymous:t.isAnonymous,tenantId:t.tenantId,providerData:[]}),t.metadata?f(n,"metadata",new pc((i=t.metadata).a,i.b)):f(n,"metadata",new pc),p(t.providerData,function(t){ib(n,t)}),r=n.b,i=t.b,r.b=i.b,r.a=i.a,r.c=i.c,f(n,"refreshToken",n.b.a),yc(n.O,t.O.b))}function rb(n){return n.I().then(function(t){var i,r=n.isAnonymous;return l((i=n).a,hct,{idToken:t}).then(o(i.Kc,i)).then(function(){return r||sr(n,"isAnonymous",!1),t})})}function ai(n,t){t[fi]&&n.za!=t[fi]&&(cft(n.b,t),n.dispatchEvent(new pf("tokenChanged")),gw(n,t[fi]),sr(n,"refreshToken",n.b.a))}function bc(n,t){return rb(n).then(function(){if(bi(tb(n),t))return su(n).then(function(){throw new i("provider-already-linked");})})}function bo(n,t,i){return ci({user:n,credential:iy(t),additionalUserInfo:t=rtt(t),operationType:i})}function pft(n,t){return ai(n,t),n.reload().then(function(){return n})}function wft(n,r,u,f,e){if(!kr())return v(new i("operation-not-supported-in-this-environment"));if(n.h&&!e)return v(n.h);var s=bv(u.providerId),h=dr(n.uid+":::"),l=null,o=dg(l=(!ye()||ga())&&n.s&&u.isOAuthProvider?co(n.s,n.l,n.m,r,u,null,h,t.default.SDK_VERSION||null,null,null,n.tenantId):l,s&&s.ua,s&&s.ta);return f=f().then(function(){if(kft(n),!e)return n.I().then(function(){})}).then(function(){return kut(n.i,o,r,u,h,!!l,n.tenantId)}).then(function(){return new c(function(t,u){n.na(r,null,new i("cancelled-popup-request"),n.g||null);n.f=t;n.C=u;n.g=h;n.c=gut(n.i,n,r,o,h)})}).then(function(n){return o&&br(o),n?ci(n):null}).o(function(n){throw o&&br(o),n;}),rt(n,f,e)}function bft(n,t,r,u,f){if(!kr())return v(new i("operation-not-supported-in-this-environment"));if(n.h&&!f)return v(n.h);var e=null,o=dr(n.uid+":::");return u=u().then(function(){if(kft(n),!f)return n.I().then(function(){})}).then(function(){return n.ga=o,su(n)}).then(function(t){return n.ha?(t=n.ha).b.set(kc,n.w(),t.a):t}).then(function(){return dut(n.i,t,r,o,n.tenantId)}).o(function(t){if(e=t,n.ha)return gft(n.ha);throw e;}).then(function(){if(e)throw e;}),rt(n,u,f)}function kft(n){if(!n.i||!n.R){if(n.i&&!n.R)throw new i("internal-error");throw new i("auth-domain-config-required");}}function rt(n,t,i){var r,u=(t=t,i=i,(r=n).h&&!i?(t.cancel(),v(r.h)):t.o(function(n){throw!n||"auth/user-disabled"!=n.code&&"auth/user-token-expired"!=n.code||(r.h||r.dispatchEvent(new pf("userInvalidated")),r.h=n),n;}));return n.J.push(u),u.oa(function(){is(n.J,u)}),u.o(function(t){var i=null;throw(i=t&&"auth/multi-factor-auth-required"===t.code?eft(t.w(),kw(n),o(n.jc,n)):i)||t;})}function dft(n){var u,t,r,i;return n.apiKey?(u={apiKey:n.apiKey,authDomain:n.authDomain,appName:n.appName,emulatorConfig:n.emulatorConfig},t={},!n.stsTokenManager||!n.stsTokenManager.accessToken)?null:(t[fi]=n.stsTokenManager.accessToken,t.refreshToken=n.stsTokenManager.refreshToken||null,r=n.stsTokenManager.expirationTime,r&&(t.expiresIn=(r-Date.now())/1e3),i=new wt(u,t,n),n.providerData&&p(n.providerData,function(n){n&&ib(i,ci(n))}),n.redirectEventId&&(i.ga=n.redirectEventId),i):null}function fat(n){this.a=n;this.b=yo()}function gft(n){return yf(n.b,kc,n.a)}function ub(n){var t,i,u,f;this.a=n;this.b=yo();this.c=null;this.f=(i=vi("local"),u=vi("session"),f=vi("none"),function(n,t,i){var u=vf(t,i),f=eu(n,t.F);return n.get(t,i).then(function(e){var o=null;try{o=uf(r.localStorage.getItem(u))}catch(e){}if(o&&!e)return r.localStorage.removeItem(u),n.set(t,o,i);o&&e&&"localStorage"!=f.type&&r.localStorage.removeItem(u)})}((t=this).b,i,t.a).then(function(){return t.b.get(u,t.a)}).then(function(n){return n?u:t.b.get(f,t.a).then(function(n){return n?f:t.b.get(i,t.a).then(function(n){return n?i:t.b.get(dc,t.a).then(function(n){return n?vi(n):i})})})}).then(function(n){return t.c=n,fb(t,n.F)}).o(function(){t.c||(t.c=i)}));this.b.addListener(vi("local"),this.a,o(this.g,this))}function fb(n,t){var r,i,u=[];for(r in af)af[r]!==t&&u.push(yf(n.b,vi(af[r]),n.a));return u.push(yf(n.b,dc,n.a)),i=u,new c(function(n,t){var u=i.length,f=[];if(u)for(var e=function(t,i){u--;f[t]=i;0==u&&n(f)},o=function(n){t(n)},r=0;r<i.length;r++)cd(i[r],cu(e,r),o);else n(f)})}function vi(n){return{name:"authUser",F:n}}function net(n,t){return wf(n,function(){return n.b.set(n.c,t.w(),n.a)})}function tet(n){return wf(n,function(){return yf(n.b,n.c,n.a)})}function iet(n,t,i){return wf(n,function(){return n.b.get(n.c,n.a).then(function(n){return n&&t&&(n.authDomain=t),n&&i&&(n.emulatorConfig=i),dft(n||{})})})}function wf(n,t){return n.f=n.f.then(t,t),n.f}function yi(n){if(this.l=!1,f(this,"settings",new fft),f(this,"app",n),!this.app.options||!this.app.options.apiKey)throw new i("invalid-api-key");var u,c,e,r,s,l;n=t.default.SDK_VERSION?tf(t.default.SDK_VERSION):null;this.a=new ui(this.app.options&&this.app.options.apiKey,ue(ie),n);this.R=[];this.s=[];this.O=[];this.hb=t.default.INTERNAL.createSubscribe(o(this.zc,this));this.X=void 0;this.bc=t.default.INTERNAL.createSubscribe(o(this.Ac,this));bf(this,null);this.i=new ub(this.app.options.apiKey+":"+this.app.name);this.D=new fat(this.app.options.apiKey+":"+this.app.name);this.$=b(this,(c=(u=this).app.options.authDomain,n=function(n){var t=function(n,t){return n.b.get(kc,n.a).then(function(n){return n&&t&&(n.authDomain=t),dft(n||{})})}(n.D,n.app.options.authDomain).then(function(t){return(n.m=t)&&(t.ha=n.D),gft(n.D)});return b(n,t)}(u).then(function(){return iet(u.i,c,u.P)}).then(function(n){return n?(n.ha=u.D,u.m&&(u.m.ga||null)==(n.ga||null)?n:n.reload().then(function(){return net(u.i,n).then(function(){return n})}).o(function(t){return"auth/network-request-failed"==t.code?n:tet(u.i)})):null}).then(function(n){bf(u,n||null)}),b(u,n)));this.h=b(this,(e=this).$.then(function(){return eet(e)}).o(function(){}).then(function(){if(!e.l)return e.ja()}).o(function(){}).then(function(){var n;e.l||(e.ba=!0,(n=e.i).b.addListener(vi("local"),n.a,e.ja))}));this.ba=!1;this.ja=o(this.Zc,this);this.Ba=o(this.da,this);this.ya=o(this.mc,this);this.za=o(this.wc,this);this.Aa=o(this.xc,this);this.b=null;s=(r=this).app.options.authDomain;l=r.app.options.apiKey;s&&kr()&&(r.Oa=r.$.then(function(){var n;if(!r.l)return r.b=tft(s,l,r.app.name,r.P),rw(r.b,r),h(r)&&wo(h(r)),r.m&&(wo(r.m),(n=r.m).wa(r.la()),pw(n,r),po(n=r.m,r.J),bw(n,r),cf((n=r.m).a,r.P),ww(n,r),r.m=null),r.b}));this.INTERNAL={};this.INTERNAL.delete=o(this.delete,this);this.INTERNAL.logFramework=o(this.Gc,this);this.u=0;ft.call(this);n=this;Object.defineProperty(n,"lc",{get:function(){return this.la()},set:function(n){this.wa(n)},enumerable:!1});n.aa=null;Object.defineProperty(n,"ti",{get:function(){return this.T()},set:function(n){this.yb(n)},enumerable:!1});n.S=null;Object.defineProperty(n,"emulatorConfig",{get:function(){var n;return this.P?ci({protocol:(n=ct(this.P.url)).c,host:n.a,port:n.g,options:ci({disableWarnings:this.P.ec})}):null},enumerable:!1});this.J=[];this.P=null}function ret(n){ht.call(this,"languageCodeChanged");this.h=n}function uet(n){ht.call(this,"emulatorConfigChanged");this.c=n}function fet(n){ht.call(this,"frameworkChanged");this.f=n}function eb(n){return n.Oa||v(new i("auth-domain-config-required"))}function eet(n){if(!kr())return v(new i("operation-not-supported-in-this-environment"));var t=eb(n).then(function(){return n.b.qa()}).then(function(n){return n?ci(n):null});return b(n,t)}function eat(n,t){var i={};return i.apiKey=n.app.options.apiKey,i.authDomain=n.app.options.authDomain,i.appName=n.app.name,n.P&&(i.emulatorConfig=n.P),n.$.then(function(){return e=i,o=t,u=n.D,f=n.Ga(),r=new wt(e,o),u&&(r.ha=u),f&&po(r,f),r.reload().then(function(){return r});var e,o,u,f,r}).then(function(t){return h(n)&&t.uid==h(n).uid?wc(h(n),t):(bf(n,t),wo(t)),n.da(t)}).then(function(){ko(n)})}function bf(n,t){var i,r;h(n)&&(i=h(n),r=n.Ba,ni(i.S,function(n){return n==r}),yt(h(n),"tokenChanged",n.ya),yt(h(n),"userDeleted",n.za),yt(h(n),"userInvalidated",n.Aa),dw(h(n)));t&&(t.S.push(n.Ba),bt(t,"tokenChanged",n.ya),bt(t,"userDeleted",n.za),bt(t,"userInvalidated",n.Aa),0<n.u&&lft(t));f(n,"currentUser",t);t&&(t.wa(n.la()),pw(t,n),po(t,n.J),bw(t,n),cf(t.a,n.P),ww(t,n))}function hu(n,t){var i=null,r=null;return b(n,t.then(function(t){return i=iy(t),r=rtt(t),eat(n,t)},function(t){var i=null;throw(i=t&&"auth/multi-factor-auth-required"===t.code?eft(t.w(),n,o(n.kc,n)):i)||t;}).then(function(){return ci({user:h(n),credential:i,additionalUserInfo:r,operationType:"signIn"})}))}function h(n){return n.currentUser}function gc(n){return h(n)&&h(n)._lat||null}function ko(n){if(n.ba){for(var t=0;t<n.s.length;t++)n.s[t]&&n.s[t](gc(n));if(n.X!==n.getUid()&&n.O.length)for(n.X=n.getUid(),t=0;t<n.O.length;t++)n.O[t]&&n.O[t](gc(n))}}function b(n,t){return n.R.push(t),t.oa(function(){is(n.R,t)}),t}function go(){}function kf(){this.a={};this.b=1e12}function sb(n,t){return(t=oet(t))&&n.a[t]||null}function oet(n){return(n=void 0===n?1e12:n)?n.toString():null}function nl(n,t){this.g=!1;this.c=t;this.a=this.b=null;this.h="invisible"!==this.c.size;this.f=oe(n);var i=this;this.i=function(){i.execute()};this.h?this.execute():bt(this.f,"click",this.i)}function hb(n){if(n.g)throw Error("reCAPTCHA mock was already deleted!");}function cb(){}function lb(){}function vb(){this.b=r.grecaptcha?1/0:0;this.f=null;this.a="__rcb"+Math.floor(1e6*Math.random()).toString()}function pb(n,t,u,e,o,s,h){var a,c,l;if(f(this,"type","recaptcha"),this.c=this.f=null,this.D=!1,this.v=t,this.g=null,h=h?ab=ab||new lb:yb=yb||new vb,this.m=h,this.a=u||{theme:"light",type:"image"},this.h=[],this.a[vet])throw new i("argument-error","sitekey should not be provided for reCAPTCHA as one is automatically provisioned for the current project.");if(this.i="invisible"===this.a[oat],!r.document)throw new i("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment with DOM support.");if(!oe(t)||!this.i&&oe(t).hasChildNodes())throw new i("argument-error","reCAPTCHA container is either not found or already contains inner elements!");this.s=new ui(n,s||null,o||null);this.u=e||function(){return null};a=this;this.l=[];c=this.a[cet];this.a[cet]=function(n){var t;yet(a,n);"function"==typeof c?c(n):"string"!=typeof c||"function"==typeof(t=y(c,r))&&t(n)};l=this.a[aet];this.a[aet]=function(){var n;yet(a,null);"function"==typeof l?l():"string"!=typeof l||"function"==typeof(n=y(l,r))&&n()}}function yet(n,t){for(var i=0;i<n.l.length;i++)try{n.l[i](t)}catch(n){}}function wb(n,t){return n.h.push(t),t.oa(function(){is(n.h,t)}),t}function tl(n){if(n.D)throw new i("internal-error","RecaptchaVerifier instance has been destroyed.");}function bb(n,r,u){var e=!1,o,f;try{this.b=u||t.default.app()}catch(n){throw new i("argument-error","No firebase.app.App instance is currently initialized.");}if(!this.b.options||!this.b.options.apiKey)throw new i("invalid-api-key");u=this.b.options.apiKey;o=this;f=null;try{f=this.b.auth().Ga()}catch(n){}try{e=this.b.auth().settings.appVerificationDisabledForTesting}catch(n){}f=t.default.SDK_VERSION?tf(t.default.SDK_VERSION,f):null;pb.call(this,u,n,r,function(){try{var n=o.b.auth().la()}catch(t){n=null}return n},f,ue(ie),e)}function pet(n,t,r,u){n:{r=Array.prototype.slice.call(r);for(var f=0,e=!1,o=0;o<t.length;o++)if(t[o].optional)e=!0;else{if(e)throw new i("internal-error","Argument validator encountered a required argument after an optional argument.");f++}if(e=t.length,r.length<f||e<r.length)u="Expected "+(f==e?1==f?"1 argument":f+" arguments":f+"-"+e+" arguments")+" but got "+r.length+".";else{for(f=0;f<r.length;f++)if(e=t[f].optional&&void 0===r[f],!t[f].M(r[f])&&!e){if(t=t[f],f<0||f>=kb.length)throw new i("internal-error","Argument validator received an unsupported number of arguments.");r=kb[f];u=(u?"":r+" argument ")+(t.name?'"'+t.name+'" ':"")+"must be "+t.K+".";break n}u=null}}if(u)throw new i("argument-error",n+" failed: "+u);}function u(n,t){return{name:n||"",K:"a valid string",optional:!!t,M:function(n){return"string"==typeof n}}}function db(n,t){return{name:n||"",K:"a boolean",optional:!!t,M:function(n){return"boolean"==typeof n}}}function nt(n,t){return{name:n||"",K:"a valid object",optional:!!t,M:tt}}function df(n,t){return{name:n||"",K:"a function",optional:!!t,M:function(n){return"function"==typeof n}}}function pi(n,t){return{name:n||"",K:"null",optional:!!t,M:function(n){return null===n}}}function hr(n){return{name:n?n+"Credential":"credential",K:n?"a valid "+n+" credential":"a valid credential",optional:!1,M:function(t){if(!t)return!1;var i=!n||t.providerId===n;return!(!t.ka||!i)}}}function wet(){return{name:"multiFactorAssertion",K:"a valid multiFactorAssertion",optional:!1,M:function(n){return!!n&&!!n.sb}}}function gf(){return{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(n){return!!(n&&n.providerId&&n.hasOwnProperty&&n.hasOwnProperty("isOAuthProvider"))}}}function gb(n,t){return tt(n)&&"string"==typeof n.type&&n.type===t&&"function"==typeof n.Ha}function bet(n){return tt(n)&&"string"==typeof n.uid}function il(){return{name:"applicationVerifier",K:"an implementation of firebase.auth.ApplicationVerifier",optional:!1,M:function(n){return!(!n||"string"!=typeof n.type||"function"!=typeof n.verify)}}}function d(n,t,i,r){return{name:i||"",K:n.K+" or "+t.K,optional:!!r,M:function(i){return n.M(i)||t.M(i)}}}function w(n,t){var i,r;for(i in t)r=t[i].name,n[r]=det(r,n[i],t[i].j)}function ket(n,t){var i,r;for(i in t)r=t[i].name,r!==i&&Object.defineProperty(n,r,{get:cu(function(n){return this[n]},i),set:cu(function(n,t,i,r){pet(n,[i],[r],!0);this[t]=r},r,i,t[i].kb),enumerable:!0})}function g(n,t,i,r){n[t]=det(t,i,r)}function det(n,t,i){function u(){var n=Array.prototype.slice.call(arguments);return pet(f,i,n),t.apply(this,n)}if(!i)return t;var r,f=(n=(n=n).split("."))[n.length-1];for(r in t)u[r]=t[r];for(r in t.prototype)u.prototype[r]=t.prototype[r];return u}var n,get="function"==typeof Object.defineProperties?Object.defineProperty:function(n,t,i){n!=Array.prototype&&n!=Object.prototype&&(n[t]=i.value)},nk=function(n){var t,i;for(n=["object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global,n],t=0;t<n.length;++t)if(i=n[t],i&&i.Math==Math)return i;return globalThis}(this),ns,rk,hl,vu,vl,rs,pl,fe,ee,bl,kl,es,st,id,ki,ud,ed,na,ta,hs,ia,ra,ea,kd,ng,bu,tg,vs,ys,ws,ya,ba,pg,gg,nn,gs,nv,tv,uv,fv,th,ff,sh,kv,ef,de,uy,ch,nit,yh,ph,kh,ly,iit,rit,ho,lit,ait,wit,by,kit,sp,hp,wp,ec,kp,nw,sut,hc,wut,but,lc,sw,hw,kc,dc,ob,ab,set,het,yb,kb;!function(n,t){var i,r,u;if(t){for(i=nk,n=n.split("."),r=0;r<n.length-1;r++)u=n[r],u in i||(i[u]={}),i=i[u];(t=t(r=i[n=n[n.length-1]]))!=r&&null!=t&&get(i,n,{configurable:!0,writable:!0,value:t})}}("Promise",function(n){function t(n){this.b=0;this.c=void 0;this.a=[];var t=this.f();try{n(t.resolve,t.reject)}catch(n){t.reject(n)}}function i(){this.a=null}function r(n){return n instanceof t?n:new t(function(t){t(n)})}var f,u;return n?n:(i.prototype.b=function(n){var t;null==this.a&&(this.a=[],(t=this).c(function(){t.g()}));this.a.push(n)},f=nk.setTimeout,i.prototype.c=function(n){f(n,0)},i.prototype.g=function(){for(var n,t,i;this.a&&this.a.length;)for(n=this.a,this.a=[],t=0;t<n.length;++t){i=n[t];n[t]=null;try{i()}catch(n){this.f(n)}}this.a=null},i.prototype.f=function(n){this.c(function(){throw n;})},t.prototype.f=function(){function n(n){return function(r){t||(t=!0,n.call(i,r))}}var i=this,t=!1;return{resolve:n(this.m),reject:n(this.g)}},t.prototype.m=function(n){if(n===this)this.g(new TypeError("A Promise cannot resolve to itself"));else if(n instanceof t)this.s(n);else{n:switch(typeof n){case"object":var i=null!=n;break n;case"function":i=!0;break n;default:i=!1}i?this.v(n):this.h(n)}},t.prototype.v=function(n){var t=void 0;try{t=n.then}catch(n){return void this.g(n)}"function"==typeof t?this.u(t,n):this.h(n)},t.prototype.g=function(n){this.i(2,n)},t.prototype.h=function(n){this.i(1,n)},t.prototype.i=function(n,t){if(0!=this.b)throw Error("Cannot settle("+n+", "+t+"): Promise already settled in state"+this.b);this.b=n;this.c=t;this.l()},t.prototype.l=function(){if(null!=this.a){for(var n=0;n<this.a.length;++n)u.b(this.a[n]);this.a=null}},u=new i,t.prototype.s=function(n){var t=this.f();n.Qa(t.resolve,t.reject)},t.prototype.u=function(n,t){var i=this.f();try{n.call(t,i.resolve,i.reject)}catch(n){i.reject(n)}},t.prototype.then=function(n,i){function f(n,t){return"function"==typeof n?function(t){try{r(n(t))}catch(t){u(t)}}:t}var r,u,e=new t(function(n,t){r=n;u=t});return this.Qa(f(n,r),f(i,u)),e},t.prototype.catch=function(n){return this.then(void 0,n)},t.prototype.Qa=function(n,t){function r(){switch(i.b){case 1:n(i.c);break;case 2:t(i.c);break;default:throw Error("Unexpected state: "+i.b);}}var i=this;null==this.a?u.b(r):this.a.push(r)},t.resolve=r,t.reject=function(n){return new t(function(t,i){i(n)})},t.race=function(n){return new t(function(t,i){for(var f=tk(n),u=f.next();!u.done;u=f.next())r(u.value).Qa(t,i)})},t.all=function(n){var u=tk(n),i=u.next();return i.done?r([]):new t(function(n,t){for(var f=[],e=0;f.push(void 0),e++,r(i.value).Qa(function(t){return function(i){f[t]=i;0==--e&&n(f)}}(f.length-1),t),!(i=u.next()).done;);})},t)});var rl=rl||{},r=this||self,not=/^[\w+/_-]+[=]{0,2}$/,ul=null;ns="closure_uid_"+(1e9*Math.random()>>>0);rk=0;s(i,Error);i.prototype.w=function(){var n={code:this.code,message:this.message};return this.a&&(n.serverResponse=this.a),n};i.prototype.toJSON=function(){return this.w()};var ie,re="auth/",rot={"admin-restricted-operation":"This operation is restricted to administrators only.","argument-error":"","app-not-authorized":"This app, identified by the domain where it's hosted, is not authorized to use Firebase Authentication with the provided API key. Review your key configuration in the Google API console.","app-not-installed":"The requested mobile application corresponding to the identifier (Android package name or iOS bundle ID) provided is not installed on this device.","captcha-check-failed":"The reCAPTCHA response token provided is either invalid, expired, already used or the domain associated with it does not match the list of whitelisted domains.","code-expired":"The SMS code has expired. Please re-send the verification code to try again.","cordova-not-ready":"Cordova framework is not ready.","cors-unsupported":"This browser is not supported.","credential-already-in-use":"This credential is already associated with a different user account.","custom-token-mismatch":"The custom token corresponds to a different audience.","requires-recent-login":"This operation is sensitive and requires recent authentication. Log in again before retrying this request.","dynamic-link-not-activated":"Please activate Dynamic Links in the Firebase Console and agree to the terms and conditions.","email-change-needs-verification":"Multi-factor users must always have a verified email.","email-already-in-use":"The email address is already in use by another account.","expired-action-code":"The action code has expired. ","cancelled-popup-request":"This operation has been cancelled due to another conflicting popup being opened.","internal-error":"An internal error has occurred.","invalid-app-credential":"The phone verification request contains an invalid application verifier. The reCAPTCHA token response is either invalid or expired.","invalid-app-id":"The mobile app identifier is not registed for the current project.","invalid-user-token":"This user's credential isn't valid for this project. This can happen if the user's token has been tampered with, or if the user isn't for the project associated with this API key.","invalid-auth-event":"An internal error has occurred.","invalid-verification-code":"The SMS verification code used to create the phone auth credential is invalid. Please resend the verification code sms and be sure to use the verification code provided by the user.","invalid-continue-uri":"The continue URL provided in the request is invalid.","invalid-cordova-configuration":"The following Cordova plugins must be installed to enable OAuth sign-in: cordova-plugin-buildinfo, cordova-universal-links-plugin, cordova-plugin-browsertab, cordova-plugin-inappbrowser and cordova-plugin-customurlscheme.","invalid-custom-token":"The custom token format is incorrect. Please check the documentation.","invalid-dynamic-link-domain":"The provided dynamic link domain is not configured or authorized for the current project.","invalid-email":"The email address is badly formatted.","invalid-api-key":"Your API key is invalid, please check you have copied it correctly.","invalid-cert-hash":"The SHA-1 certificate hash provided is invalid.","invalid-credential":"The supplied auth credential is malformed or has expired.","invalid-message-payload":"The email template corresponding to this action contains invalid characters in its message. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-multi-factor-session":"The request does not contain a valid proof of first factor successful sign-in.","invalid-oauth-provider":"EmailAuthProvider is not supported for this operation. This operation only supports OAuth providers.","invalid-oauth-client-id":"The OAuth client ID provided is either invalid or does not match the specified API key.","unauthorized-domain":"This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console.","invalid-action-code":"The action code is invalid. This can happen if the code is malformed, expired, or has already been used.","wrong-password":"The password is invalid or the user does not have a password.","invalid-persistence-type":"The specified persistence type is invalid. It can only be local, session or none.","invalid-phone-number":"The format of the phone number provided is incorrect. Please enter the phone number in a format that can be parsed into E.164 format. E.164 phone numbers are written in the format [+][country code][subscriber number including area code].","invalid-provider-id":"The specified provider ID is invalid.","invalid-recipient-email":"The email corresponding to this action failed to send as the provided recipient email address is invalid.","invalid-sender":"The email template corresponding to this action contains an invalid sender email or name. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-verification-id":"The verification ID used to create the phone auth credential is invalid.","invalid-tenant-id":"The Auth instance's tenant ID is invalid.","multi-factor-info-not-found":"The user does not have a second factor matching the identifier provided.","multi-factor-auth-required":"Proof of ownership of a second factor is required to complete sign-in.","missing-android-pkg-name":"An Android Package Name must be provided if the Android App is required to be installed.","auth-domain-config-required":"Be sure to include authDomain when calling firebase.initializeApp(), by following the instructions in the Firebase console.","missing-app-credential":"The phone verification request is missing an application verifier assertion. A reCAPTCHA response token needs to be provided.","missing-verification-code":"The phone auth credential was created with an empty SMS verification code.","missing-continue-uri":"A continue URL must be provided in the request.","missing-iframe-start":"An internal error has occurred.","missing-ios-bundle-id":"An iOS Bundle ID must be provided if an App Store ID is provided.","missing-multi-factor-info":"No second factor identifier is provided.","missing-multi-factor-session":"The request is missing proof of first factor successful sign-in.","missing-or-invalid-nonce":"The request does not contain a valid nonce. This can occur if the SHA-256 hash of the provided raw nonce does not match the hashed nonce in the ID token payload.","missing-phone-number":"To send verification codes, provide a phone number for the recipient.","missing-verification-id":"The phone auth credential was created with an empty verification ID.","app-deleted":"This instance of FirebaseApp has been deleted.","account-exists-with-different-credential":"An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address.","network-request-failed":"A network error (such as timeout, interrupted connection or unreachable host) has occurred.","no-auth-event":"An internal error has occurred.","no-such-provider":"User was not linked to an account with the given provider.","null-user":"A null user object was provided as the argument for an operation which requires a non-null user object.","operation-not-allowed":"The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section.","operation-not-supported-in-this-environment":'This operation is not supported in the environment this application is running on. "location.protocol" must be http, https or chrome-extension and web storage must be enabled.',"popup-blocked":"Unable to establish a connection with the popup. It may have been blocked by the browser.","popup-closed-by-user":"The popup has been closed by the user before finalizing the operation.","provider-already-linked":"User can only be linked to one identity for the given provider.","quota-exceeded":"The project's quota for this operation has been exceeded.","redirect-cancelled-by-user":"The redirect operation has been cancelled by the user before finalizing.","redirect-operation-pending":"A redirect sign-in operation is already pending.","rejected-credential":"The request contains malformed or mismatching credentials.","second-factor-already-in-use":"The second factor is already enrolled on this account.","maximum-second-factor-count-exceeded":"The maximum allowed number of second factors on a user has been exceeded.","tenant-id-mismatch":"The provided tenant ID does not match the Auth instance's tenant ID",timeout:"The operation has timed out.","user-token-expired":"The user's credential is no longer valid. The user must sign in again.","too-many-requests":"We have blocked all requests from this device due to unusual activity. Try again later.","unauthorized-continue-uri":"The domain of the continue URL is not whitelisted.  Please whitelist the domain in the Firebase console.","unsupported-first-factor":"Enrolling a second factor or signing in with a multi-factor account requires sign-in with a supported first factor.","unsupported-persistence-type":"The current environment does not support the specified persistence type.","unsupported-tenant-operation":"This operation is not supported in a multi-tenant context.","unverified-email":"The operation requires a verified email.","user-cancelled":"The user did not grant your application the permissions it requested.","user-not-found":"There is no user record corresponding to this identifier. The user may have been deleted.","user-disabled":"The user account has been disabled by an administrator.","user-mismatch":"The supplied credentials do not correspond to the previously signed in user.","user-signed-out":"","weak-password":"The password must be 6 characters long or more.","web-storage-unsupported":"This browser is not supported or 3rd party cookies and data may be disabled."},el={ld:{Ta:"https://staging-identitytoolkit.sandbox.googleapis.com/identitytoolkit/v3/relyingparty/",Za:"https://staging-securetoken.sandbox.googleapis.com/v1/token",Wa:"https://staging-identitytoolkit.sandbox.googleapis.com/v2/",id:"b"},sd:{Ta:"https://www.googleapis.com/identitytoolkit/v3/relyingparty/",Za:"https://securetoken.googleapis.com/v1/token",Wa:"https://identitytoolkit.googleapis.com/v2/",id:"p"},ud:{Ta:"https://staging-www.sandbox.googleapis.com/identitytoolkit/v3/relyingparty/",Za:"https://staging-securetoken.sandbox.googleapis.com/v1/token",Wa:"https://staging-identitytoolkit.sandbox.googleapis.com/v2/",id:"s"},vd:{Ta:"https://www-googleapis-test.sandbox.google.com/identitytoolkit/v3/relyingparty/",Za:"https://test-securetoken.sandbox.googleapis.com/v1/token",Wa:"https://test-identitytoolkit.sandbox.googleapis.com/v2/",id:"t"}};ie=ue("__EID__")?"__EID__":void 0;s(at,Error);at.prototype.name="CustomError";s(ol,at);ol.prototype.name="AssertionError";sl.prototype.get=function(){var n;return 0<this.b?(this.b--,n=this.a,this.a=n.next,n.next=null):n=this.c(),n};hl=new sl(function(){return new cl},function(n){n.reset()});ok.prototype.add=function(n,t){var i=hl.get();i.set(n,t);this.b?this.b.next=i:this.a=i;this.b=i};cl.prototype.set=function(n,t){this.a=n;this.b=t;this.next=null};cl.prototype.reset=function(){this.next=this.b=this.a=null};var sk=Array.prototype.indexOf?function(n,t){return Array.prototype.indexOf.call(n,t,void 0)}:function(n,t){if("string"==typeof n)return"string"!=typeof t||1!=t.length?-1:n.indexOf(t,0);for(var i=0;i<n.length;i++)if(i in n&&n[i]===t)return i;return-1},p=Array.prototype.forEach?function(n,t,i){Array.prototype.forEach.call(n,t,i)}:function(n,t,i){for(var f=n.length,u="string"==typeof n?n.split(""):n,r=0;r<f;r++)r in u&&t.call(i,u[r],r,n)},uot=Array.prototype.filter?function(n,t){return Array.prototype.filter.call(n,t,void 0)}:function(n,t){for(var r,e=n.length,u=[],o=0,f="string"==typeof n?n.split(""):n,i=0;i<e;i++)i in f&&(r=f[i],t.call(void 0,r,i,n)&&(u[o++]=r));return u},ts=Array.prototype.map?function(n,t){return Array.prototype.map.call(n,t,void 0)}:function(n,t){for(var r=n.length,u=Array(r),f="string"==typeof n?n.split(""):n,i=0;i<r;i++)i in f&&(u[i]=t.call(void 0,f[i],i,n));return u},fot=Array.prototype.some?function(n,t){return Array.prototype.some.call(n,t,void 0)}:function(n,t){for(var u=n.length,r="string"==typeof n?n.split(""):n,i=0;i<u;i++)if(i in r&&t.call(void 0,r[i],i,n))return!0;return!1};var au,hk=String.prototype.trim?function(n){return n.trim()}:function(n){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(n)[1]},eot=/&/g,oot=/</g,sot=/>/g,hot=/"/g,cot=/'/g,lot=/\x00/g,aot=/[\x00&<>"']/;n:{if(vu=r.navigator,vu&&(vu=vu.userAgent,vu)){au=vu;break n}au=""}vl="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");oi.prototype.sa=!0;oi.prototype.ra=function(){return this.a};oi.prototype.toString=function(){return"Const{"+this.a+"}"};pl={};fe={};yu.prototype.sa=!0;yu.prototype.ra=function(){return this.a.toString()};yu.prototype.toString=function(){return"TrustedResourceUrl{"+this.a+"}"};var vot=/%{(\w+)}/g,yot=/^((https:)?\/\/[0-9a-z.:[\]-]+\/|\/[^/\\]|[^:/\\%]+\/|[^:/\\%]*[?#]|about:blank#)/i,yk={};vt.prototype.sa=!0;vt.prototype.ra=function(){return this.a.toString()};vt.prototype.toString=function(){return"SafeUrl{"+this.a+"}"};var pot=/^(?: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,wot=/^data:(.*);base64,[a-z0-9+\/]+=*$/i,pk=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i;ee={};bl=new vt("about:invalid#zClosurez",ee);pu.prototype.sa=!0;pu.prototype.ra=function(){return this.a.toString()};pu.prototype.toString=function(){return"SafeHtml{"+this.a+"}"};kl={};gl[" "]=ei;var fs,bot=it("Opera"),ti=it("Trident")||it("MSIE"),gk=it("Edge"),kot=gk||ti,nd=it("Gecko")&&!(a(au.toLowerCase(),"webkit")&&!it("Edge"))&&!(it("Trident")||it("MSIE"))&&!it("Edge"),dot=a(au.toLowerCase(),"webkit")&&!it("Edge");n:{if(es="",st=(st=au,nd?/rv:([^\);]+)(\)|;)/.exec(st):gk?/Edge\/([\d\.]+)/.exec(st):ti?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(st):dot?/WebKit\/(\S+)/.exec(st):bot?/(?:Version)[ \/]?(\S+)/.exec(st):void 0),(st&&(es=st?st[1]:""),ti)&&(st=td(),null!=st&&st>parseFloat(es))){fs=String(st);break n}fs=es}id={};ki=r.document&&ti&&(td()||parseInt(fs,10))||void 0;try{new self.OffscreenCanvas(0,0).getContext("2d")}catch(n){}ud=!ti||9<=Number(ki);ta={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",frameborder:"frameBorder",height:"height",maxlength:"maxLength",nonce:"nonce",role:"role",rowspan:"rowSpan",type:"type",usemap:"useMap",valign:"vAlign",width:"width"};hs=!1;ia=new ok;var ar=0,se=2,di=3;hd.prototype.reset=function(){this.f=this.b=this.g=this.a=null;this.c=!1};ra=new sl(function(){return new hd},function(n){n.reset()});c.prototype.then=function(n,t,i){return ad(this,wi(n)?n:null,wi(t)?t:null,i)};c.prototype.$goog_Thenable=!0;(n=c.prototype).oa=function(n,t){return(n=ua(n,n,t)).c=!0,fa(this,n),this};n.o=function(n,t){return ad(this,null,n,t)};n.cancel=function(n){var t;this.a==ar&&(t=new wu(n),ss(function(){!function n(t,i){var r;if(t.a==ar)if(t.c){if(r=t.c,r.b){for(var u=0,e=null,o=null,f=r.b;f&&(f.c||(u++,!((e=f.a==t?f:e)&&1<u)));f=f.next)e||(o=f);e&&(r.a==ar&&1==u?n(r,i):(o?((u=o).next==r.f&&(r.f=u),u.next=u.next.next):pd(r),wd(r,e,di,i)))}t.c=null}else vr(t,di,i)}(this,t)},this))};n.$c=function(n){this.a=ar;vr(this,se,n)};n.ad=function(n){this.a=ar;vr(this,di,n)};n.gc=function(){for(var n;n=pd(this);)wd(this,n,this.a,this.i);this.h=!1};ea=od;s(wu,at);kd=0;cs.prototype.xa=!(wu.prototype.name="cancel");cs.prototype.Da=function(){if(this.pa)for(;this.pa.length;)this.pa.shift()()};var nst=Object.freeze||function(n){return n},gd=!ti||9<=Number(ki),tst=ti&&!rd("9"),ist=function(){if(!r.addEventListener||!Object.defineProperty)return!1;var n=!1,t=Object.defineProperty({},"passive",{get:function(){n=!0}});try{r.addEventListener("test",ei,t);r.removeEventListener("test",ei,t)}catch(n){}return n}();ht.prototype.preventDefault=function(){this.defaultPrevented=!0};s(yr,ht);ng=nst({2:"touch",3:"pen",4:"mouse"});yr.prototype.preventDefault=function(){yr.ab.preventDefault.call(this);var n=this.a;if(n.preventDefault)n.preventDefault();else if(n.returnValue=!1,tst)try{(n.ctrlKey||112<=n.keyCode&&n.keyCode<=123)&&(n.keyCode=-1)}catch(n){}};yr.prototype.g=function(){return this.a};bu="closure_listenable_"+(1e6*Math.random()|0);tg=0;as.prototype.add=function(n,t,i,r,u){var f=n.toString(),e;return(n=this.a[f])||(n=this.a[f]=[],this.b++),e=sa(n,t,r,u),-1<e?(t=n[e],i||(t.Pa=!1)):((t=new rst(t,this.src,f,!!r,u)).Pa=i,n.push(t)),t};vs="closure_lm_"+(1e6*Math.random()|0);ys={};ws="__closure_events_fn_"+(1e9*Math.random()>>>0);s(ft,cs);ft.prototype[bu]=!0;ft.prototype.addEventListener=function(n,t,i,r){bt(this,n,t,i,r)};ft.prototype.removeEventListener=function(n,t,i,r){yt(this,n,t,i,r)};ft.prototype.dispatchEvent=function(n){var r,i,f,u,e,t;if(i=this.gb)for(r=[];i;i=i.gb)r.push(i);if(i=this.ac,f=n.type||n,"string"==typeof n?n=new ht(n,i):n instanceof ht?n.target=n.target||i:(t=n,ot(n=new ht(f,i),t)),t=!0,r)for(u=r.length-1;0<=u;u--)e=n.b=r[u],t=bs(e,f,!0,n)&&t;if(t=bs(e=n.b=i,f,!0,n)&&t,t=bs(e,f,!1,n)&&t,r)for(u=0;u<r.length;u++)t=bs(e=n.b=r[u],f,!1,n)&&t;return t};ft.prototype.Da=function(){var i,n,r,t;if(ft.ab.Da.call(this),this.v){n=this.v;for(i in n.a){for(r=n.a[i],t=0;t<r.length;t++)ls(r[t]);delete n.a[i];n.b--}}this.gb=null};(n=du.prototype).W=function(){va(this);for(var t=[],n=0;n<this.a.length;n++)t.push(this.b[this.a[n]]);return t};n.Y=function(){return va(this),this.a.concat()};n.clear=function(){this.b={};this.c=this.a.length=0};n.get=function(n,t){return pr(this.b,n)?this.b[n]:t};n.set=function(n,t){pr(this.b,n)||(this.c++,this.a.push(n));this.b[n]=t};n.forEach=function(n,t){for(var u,f,r=this.Y(),i=0;i<r.length;i++)u=r[i],f=this.get(u),n.call(t,f,u,this)};ya=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^\\/?#]*)@)?([^\\/?#]*?)(?::([0-9]+))?(?=[\\/?#]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;rr.prototype.toString=function(){var t=[],i=this.c,n;return i&&t.push(ae(i,cg,!0),":"),n=this.a,!n&&"file"!=i||(t.push("//"),(i=this.l)&&t.push(ae(i,cg,!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(ae(n,"/"==n.charAt(0)?ost:est,!0))),(n=this.b.toString())&&t.push("?",n),(n=this.h)&&t.push("#",ae(n,hst)),t.join("")};rr.prototype.resolve=function(n){var u=new rr(this),i=!!n.c,t,o;if(i?he(u,n.c):i=!!n.l,i?u.l=n.l:i=!!n.a,i?u.a=n.a:i=null!=n.g,t=n.f,i)ce(u,n.g);else if(i=!!n.f)if("/"!=t.charAt(0)&&(this.a&&!this.f?t="/"+t:-1!=(r=u.f.lastIndexOf("/"))&&(t=u.f.substr(0,r+1)+t)),".."==(r=t)||"."==r)t="";else if(a(r,"./")||a(r,"/.")){for(var t=0==r.lastIndexOf("/",0),r=r.split("/"),f=[],e=0;e<r.length;)o=r[e++],"."==o?t&&e==r.length&&f.push(""):".."==o?((1<f.length||1==f.length&&""!=f[0])&&f.pop(),t&&e==r.length&&f.push("")):(f.push(o),t=!0);t=f.join("/")}else t=r;return i?u.f=t:i=""!==n.b.toString(),i?pa(u,vg(n.b)):i=!!n.h,i&&(u.h=n.h),u};var cg=/[#\/\?@]/g,est=/[#\?:]/g,ost=/[#\?]/g,sst=/[#\?@]/g,hst=/#/g;(n=wr.prototype).add=function(n,t){ur(this);this.c=null;n=gu(this,n);var i=this.a.get(n);return i||this.a.set(n,i=[]),i.push(t),this.b+=1,this};n.clear=function(){this.a=this.c=null;this.b=0};n.forEach=function(n,t){ur(this);this.a.forEach(function(i,r){p(i,function(i){n.call(t,i,r,this)},this)},this)};n.Y=function(){var u,t;ur(this);for(var f=this.a.W(),i=this.a.Y(),r=[],n=0;n<i.length;n++)for(u=f[n],t=0;t<u.length;t++)r.push(i[n]);return r};n.W=function(n){var t,i;if(ur(this),t=[],"string"==typeof n)wa(this,n)&&(t=ll(t,this.a.get(gu(this,n))));else for(n=this.a.W(),i=0;i<n.length;i++)t=ll(t,n[i]);return t};n.set=function(n,t){return ur(this),this.c=null,wa(this,n=gu(this,n))&&(this.b-=this.a.get(n).length),this.a.set(n,[t]),this.b+=1,this};n.get=function(n,t){return n&&0<(n=this.W(n)).length?String(n[0]):t};n.toString=function(){var r;if(this.c)return this.c;if(!this.a)return"";for(var u=[],f=this.a.Y(),i=0;i<f.length;i++)for(var n=f[i],e=encodeURIComponent(String(n)),n=this.W(n),t=0;t<n.length;t++)r=e,""!==n[t]&&(r+="="+encodeURIComponent(String(n[t]))),u.push(r);return this.c=u.join("&")};ba={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\u000b"};pg=/\uffff/.test("￿")?/[\\"\x00-\x1f\x7f-\uffff]/g:/[\\"\x00-\x1f\x7f-\xff]/g;gg=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;nn=/^[^@]+@[^@]+$/;gs="Firefox";nv="Chrome";tv={md:"FirebaseCore-web",od:"FirebaseUI-web"};fr.prototype.get=function(){var n=r.navigator;return!n||"boolean"!=typeof n.onLine||!nh()&&"chrome-extension:"!==rf()&&void 0===n.connection||n.onLine?this.b?this.c:this.a:Math.min(5e3,this.a)};fv={};try{th={};Object.defineProperty(th,"abcd",{configurable:!0,enumerable:!0,value:1});Object.defineProperty(th,"abcd",{configurable:!0,enumerable:!0,value:2});uv=2==th.abcd}catch(n){uv=!1}sv.prototype.w=function(){return{uid:this.uid,displayName:this.displayName,factorId:this.factorId,enrollmentTime:this.enrollmentTime}};var on="displayName",cv="enrolledAt",lv="mfaEnrollmentId",av="phoneInfo";s(be,sv);be.prototype.w=function(){var n=be.ab.w.call(this);return n.phoneNumber=this.phoneNumber,n};var vv="REVERT_SECOND_FACTOR_ADDITION",ih="EMAIL_SIGNIN",ke="VERIFY_AND_CHANGE_EMAIL",vst="email",yst="mfaInfo",pst="newEmail",wst="requestType",sn="email",hn="fromEmail",bst="multiFactorInfo",cn="previousEmail",kst="data",dst="operation";var ln="apiKey",an="oobCode",gst="continueUrl",nht="languageCode",vn="mode",tht="tenantId",iht={recoverEmail:"RECOVER_EMAIL",resetPassword:"PASSWORD_RESET",revertSecondFactorAddition:vv,signIn:ih,verifyAndChangeEmail:ke,verifyEmail:"VERIFY_EMAIL"};var pn="android",wn="dynamicLinkDomain",pv="handleCodeInApp",bn="iOS",rht="url",kn="installApp",dn="minimumVersion",gn="packageName",ntt="bundleId";ff=null;fh.prototype.T=function(){return this.f};fh.prototype.l=function(){return this.c};fh.prototype.toString=function(){return this.h};var itt="oauth_consumer_key oauth_nonce oauth_signature oauth_signature_method oauth_timestamp oauth_token oauth_version".split(" "),oh=["client_id","response_type","scope","redirect_uri","state"],wv={nd:{Ja:"locale",ua:700,ta:600,fa:"facebook.com",Xa:oh},pd:{Ja:null,ua:500,ta:750,fa:"github.com",Xa:oh},qd:{Ja:"hl",ua:515,ta:680,fa:"google.com",Xa:oh},wd:{Ja:"lang",ua:485,ta:705,fa:"twitter.com",Xa:itt},kd:{Ja:"locale",ua:640,ta:600,fa:"apple.com",Xa:[]}};sh="idToken";kv="providerId";s(li,dv);s(utt,li);s(ftt,li);s(ett,li);s(ott,li);ef="enroll";de="signin";hh.prototype.Ha=function(){return this.a?e(this.a):e(this.b)};hh.prototype.w=function(){return this.type==ef?{multiFactorSession:{idToken:this.a}}:{multiFactorSession:{pendingCredential:this.b}}};of.prototype.ka=function(){};of.prototype.b=function(){};of.prototype.c=function(){};of.prototype.w=function(){};gr.prototype.ka=function(n){return np(n,gv(this))};gr.prototype.b=function(n,t){var i=gv(this);return i.idToken=t,tp(n,i)};gr.prototype.c=function(n,t){return sf(ip(n,gv(this)),t)};gr.prototype.w=function(){return{providerId:this.providerId,signInMethod:this.signInMethod,pendingToken:this.a}};gi.prototype.ka=function(n){return np(n,ny(this))};gi.prototype.b=function(n,t){var i=ny(this);return i.idToken=t,tp(n,i)};gi.prototype.c=function(n,t){return sf(ip(n,ny(this)),t)};gi.prototype.w=function(){var n={providerId:this.providerId,signInMethod:this.signInMethod};return this.idToken&&(n.oauthIdToken=this.idToken),this.accessToken&&(n.oauthAccessToken=this.accessToken),this.secret&&(n.oauthTokenSecret=this.secret),this.nonce&&(n.nonce=this.nonce),this.a&&(n.pendingToken=this.a),n};nu.prototype.Ka=function(n){return this.Ib=ir(n),this};s(htt,nu);s(pt,nu);pt.prototype.Ca=function(n){return bi(this.a,n)||this.a.push(n),this};pt.prototype.Qb=function(){return cr(this.a)};pt.prototype.credential=function(n,t){if(t=tt(n)?{idToken:n.idToken||null,accessToken:n.accessToken||null,nonce:n.rawNonce||null}:{idToken:n||null,accessToken:t||null},!t.idToken&&!t.accessToken)throw new i("argument-error","credential failed: must provide the ID token and/or the access token.");return new gi(this.providerId,t,this.providerId)};s(tu,pt);f(tu,"PROVIDER_ID","facebook.com");f(tu,"FACEBOOK_SIGN_IN_METHOD","facebook.com");s(iu,pt);f(iu,"PROVIDER_ID","github.com");f(iu,"GITHUB_SIGN_IN_METHOD","github.com");s(ru,pt);f(ru,"PROVIDER_ID","google.com");f(ru,"GOOGLE_SIGN_IN_METHOD","google.com");s(hf,nu);f(hf,"PROVIDER_ID","twitter.com");f(hf,"TWITTER_SIGN_IN_METHOD","twitter.com");er.prototype.ka=function(n){return this.signInMethod==dt.EMAIL_LINK_SIGN_IN_METHOD?l(n,fct,{email:this.a,oobCode:this.f}):l(n,irt,{email:this.a,password:this.f})};er.prototype.b=function(n,t){return this.signInMethod==dt.EMAIL_LINK_SIGN_IN_METHOD?l(n,ect,{idToken:t,email:this.a,oobCode:this.f}):l(n,trt,{idToken:t,email:this.a,password:this.f})};er.prototype.c=function(n,t){return sf(this.ka(n),t)};er.prototype.w=function(){return{email:this.a,password:this.f,signInMethod:this.signInMethod}};et(dt,{PROVIDER_ID:"password"});et(dt,{EMAIL_LINK_SIGN_IN_METHOD:"emailLink"});et(dt,{EMAIL_PASSWORD_SIGN_IN_METHOD:"password"});or.prototype.ka=function(n){return n.fb(ge(this))};or.prototype.b=function(n,t){var i=ge(this);return i.idToken=t,l(n,flt,i)};or.prototype.c=function(n,t){var i=ge(this);return i.operation="REAUTH",sf(n=l(n,elt,i),t)};or.prototype.w=function(){var n={providerId:"phone"};return this.a.eb&&(n.verificationId=this.a.eb),this.a.cb&&(n.verificationCode=this.a.cb),this.a.La&&(n.temporaryProof=this.a.La),this.a.ea&&(n.phoneNumber=this.a.ea),n};nr.prototype.fb=function(n,t){var r=this.a.a;return e(t.verify()).then(function(u){if("string"!=typeof u)throw new i("argument-error","An implementation of firebase.auth.ApplicationVerifier.prototype.verify() must return a firebase.Promise that resolves with a string.");if("recaptcha"!==t.type)throw new i("argument-error",'Only firebase.auth.ApplicationVerifiers with type="recaptcha" are currently supported.');var f=tt(n)?n.session:null,e=tt(n)?n.phoneNumber:n,f=f&&f.type==ef?f.Ha().then(function(n){return l(r,dct,{idToken:n,phoneEnrollmentInfo:{phoneNumber:e,recaptchaToken:u}}).then(function(n){return n.phoneSessionInfo.sessionInfo})}):f&&f.type==de?f.Ha().then(function(t){return t={mfaPendingCredential:t,mfaEnrollmentId:n.multiFactorHint&&n.multiFactorHint.uid||n.multiFactorUid,phoneSignInInfo:{recaptchaToken:u}},l(r,gct,t).then(function(n){return n.phoneResponseInfo.sessionInfo})}):l(r,bct,{phoneNumber:e,recaptchaToken:u});return f.then(function(n){return"function"==typeof t.reset&&t.reset(),n},function(n){throw"function"==typeof t.reset&&t.reset(),n;})})};et(nr,{PROVIDER_ID:"phone"});et(nr,{PHONE_SIGN_IN_METHOD:"phone"});ri.prototype.getUid=function(){var n=[];return n.push(this.c),this.b&&n.push(this.b),this.f&&n.push(this.f),this.h&&n.push(this.h),n.join("-")};ri.prototype.T=function(){return this.h};ri.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()}};ch=null;s(fy,i);s(no,i);no.prototype.w=function(){var n={code:this.code,message:this.message},t;return this.email&&(n.email=this.email),this.phoneNumber&&(n.phoneNumber=this.phoneNumber),this.tenantId&&(n.tenantId=this.tenantId),t=this.credential&&this.credential.w(),t&&ot(n,t),n};no.prototype.toJSON=function(){return this.w()};to.prototype.c=null;s(ah,to);ah.prototype.a=function(){var n=ktt(this);return n?new ActiveXObject(n):new XMLHttpRequest};ah.prototype.b=function(){var n={};return ktt(this)&&(n[0]=!0,n[1]=!0),n};uy=new ah;s(vh,to);vh.prototype.a=function(){var n=new XMLHttpRequest;if("withCredentials"in n)return n;if("undefined"!=typeof XDomainRequest)return new dtt;throw Error("Unsupported browser");};vh.prototype.b=function(){return{}};(n=dtt.prototype).open=function(n,t,i){if(null!=i&&!i)throw Error("Only async requests are supported.");this.a.open(n,t)};n.send=function(n){if(n){if("string"!=typeof n)throw Error("Only string data is supported");this.a.send(n)}else this.a.send()};n.abort=function(){this.a.abort()};n.setRequestHeader=function(){};n.getResponseHeader=function(n){return"content-type"==n.toLowerCase()?this.a.contentType:""};n.qc=function(){this.status=200;this.response=this.responseText=this.a.responseText;ey(this,4)};n.Sb=function(){this.status=500;this.response=this.responseText="";ey(this,4)};n.vc=function(){this.Sb()};n.rc=function(){this.status=200;ey(this,1)};n.getAllResponseHeaders=function(){return"content-type: "+this.a.contentType};oy.prototype.a=null;oy.prototype.reset=function(){delete this.a};io.prototype.toString=function(){return this.name};var gtt=new io("SEVERE",1e3),hy=new io("WARNING",900),cht=new io("CONFIG",700),lht=new io("FINE",500);sy.prototype.log=function(n,t,i){if(n.value>=function n(t){return t.c||(t.a?n(t.a):(lu("Root logger has no level set."),null))}(this).value)for(wi(t)&&(t=t()),n=new oy(n,String(t),this.f),i&&(n.a=i),i=this;i;)i=i.a};yh={};ph=null;s(wh,to);wh.prototype.a=function(){return new bh(this.f)};wh.prototype.b=(nit={},function(){return nit});s(bh,ft);kh=0;(n=bh.prototype).open=function(n,t){if(this.readyState!=kh)throw this.abort(),Error("Error reopening a connection");this.s=n;this.f=t;this.readyState=1;uo(this)};n.send=function(n){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.a=!0;var t={headers:this.l,method:this.s,credentials:this.h,cache:void 0};n&&(t.body=n);this.u.fetch(new Request(this.f,t)).then(this.uc.bind(this),this.Ua.bind(this))};n.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,ro(this));this.readyState=kh};n.uc=function(n){this.a&&(this.g=n,this.b||(this.status=this.g.status,this.statusText=this.g.statusText,this.b=n.headers,this.readyState=2,uo(this)),this.a&&(this.readyState=3,uo(this),this.a&&("arraybuffer"===this.responseType?n.arrayBuffer().then(this.sc.bind(this),this.Ua.bind(this)):void 0!==r.ReadableStream&&"body"in n?(this.response=this.responseText="",this.c=n.body.getReader(),this.m=new TextDecoder,tit(this)):n.text().then(this.tc.bind(this),this.Ua.bind(this)))))};n.pc=function(n){var t;this.a&&((t=this.m.decode(n.value||new Uint8Array(0),{stream:!n.done}))&&(this.response=this.responseText+=t),(n.done?ro:uo)(this),3==this.readyState&&tit(this))};n.tc=function(n){this.a&&(this.response=this.responseText=n,ro(this))};n.sc=function(n){this.a&&(this.response=n,ro(this))};n.Ua=function(n){var t=this.i;t&&t.log(hy,"Failed to fetch url "+this.f,n instanceof Error?n:Error(n));this.a&&ro(this)};n.setRequestHeader=function(n,t){this.l.append(n,t)};n.getResponseHeader=function(n){return this.b?this.b.get(n.toLowerCase())||"":((n=this.i)&&n.log(hy,"Attempting to get response header but no headers have been received for url: "+this.f,void 0),"")};n.getAllResponseHeaders=function(){var t;if(!this.b)return t=this.i,t&&t.log(hy,"Attempting to get all response headers but no headers have been received for url: "+this.f,void 0),"";for(var t=[],i=this.b.entries(),n=i.next();!n.done;)n=n.value,t.push(n[0]+": "+n[1]),n=i.next();return t.join("\r\n")};Object.defineProperty(bh.prototype,"withCredentials",{get:function(){return"include"===this.h},set:function(n){this.h=n?"include":"same-origin"}});s(fo,ft);ly="";fo.prototype.b=cy("goog.net.XhrIo");iit=/^https?$/i;rit=["POST","PUT"];(n=fo.prototype).Ma=function(){void 0!==rl&&this.a&&(this.h="Timed out after "+this.g+"ms, aborting",gt(this.b,tr(this,this.h)),this.dispatchEvent("timeout"),this.abort(8))};n.abort=function(){this.a&&this.c&&(gt(this.b,tr(this,"Aborting")),this.c=!1,this.f=!0,this.a.abort(),this.f=!1,this.dispatchEvent("complete"),this.dispatchEvent("abort"),dh(this))};n.Da=function(){this.a&&(this.c&&(this.c=!1,this.f=!0,this.a.abort(),this.f=!1),dh(this,!0));fo.ab.Da.call(this)};n.Vb=function(){this.xa||(this.O||this.i||this.f?eit(this):this.Jc())};n.Jc=function(){eit(this)};n.getResponse=function(){try{if(!this.a)return null;if("response"in this.a)return this.a.response;switch(this.m){case ly:case"text":return this.a.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in this.a)return this.a.mozResponseArrayBuffer}var n=this.b;return n&&n.log(gtt,"Response type "+this.m+" is not supported on this browser",void 0),null}catch(n){return gt(this.b,"Can not get response: "+n.message),null}};uu.prototype.cancel=function(n){var t;this.a?this.c instanceof uu&&this.c.cancel():(this.b&&(t=this.b,delete this.b,n?t.cancel(n):(t.l--,t.l<=0&&t.cancel())),this.u?this.u.call(this.s,this):this.v=!0,this.a||(n=new so,nc(this),oo(this,!1,n)))};uu.prototype.m=function(n,t){this.i=!1;oo(this,n,t)};uu.prototype.then=function(n,t,i){var r,u,f=new c(function(n,t){r=n;u=t});return ay(this,r,function(n){n instanceof so?f.cancel():u(n)}),f.then(n,t,i)};uu.prototype.$goog_Thenable=!0;s(tc,at);tc.prototype.message="Deferred has already fired";tc.prototype.name="AlreadyCalledError";s(so,at);so.prototype.message="Deferred was canceled";so.prototype.name="CanceledError";cit.prototype.c=function(){throw delete ho[this.a],this.b;};ho={};lit=0;ait=1;s(yy,at);s(rc,to);rc.prototype.a=function(){return new this.f};rc.prototype.b=function(){return{}};var py,fi="idToken",pht=new fr(3e4,6e4),wht={"Content-Type":"application/x-www-form-urlencoded"},bht=new fr(3e4,6e4),kht={"Content-Type":"application/json"};ui.prototype.T=function(){return this.b};ui.prototype.u=function(n,t,u,f,e,o){if(ii()&&(void 0===r.fetch||void 0===r.Headers||void 0===r.Request))throw new i("operation-not-supported-in-this-environment","fetch, Headers and Request native APIs or equivalent Polyfills must be available to support HTTP requests from a Worker environment.");var s,h=new fo(this.f);o&&(h.g=Math.max(0,o),s=setTimeout(function(){h.dispatchEvent("timeout")},o));og(h,"complete",function(){s&&clearTimeout(s);var n=null;try{n=JSON.parse(function(n){try{return n.a?n.a.responseText:""}catch(t){return gt(n.b,"Can not get responseText: "+t.message),""}}(this))||null}catch(i){n=null}t&&t(n)});la(h,"ready",function(){s&&clearTimeout(s);dd(this)});la(h,"timeout",function(){s&&clearTimeout(s);dd(this);t&&t(null)});aht(h,n,u,f,e)};wit=new oi(fe,"https://apis.google.com/js/client.js?onload=%{onload}");by="__fcb"+Math.floor(1e6*Math.random()).toString();ui.prototype.s=function(n,t,i,r,u){var f=this;py.then(function(){window.gapi.client.setApiKey(f.c);var e=window.gapi.auth.getToken();window.gapi.auth.setToken(null);window.gapi.client.request({path:n,method:i,body:r,headers:u,authType:"none",callback:function(n){window.gapi.auth.setToken(e);t&&t(n)}})}).o(function(n){t&&t({error:{message:n&&n.message||"CORS_UNSUPPORTED"}})})};ui.prototype.zb=function(){return l(this,kct,{})};ui.prototype.Bb=function(n,t){return l(this,nrt,{idToken:n,email:t})};ui.prototype.Cb=function(n,t){return l(this,trt,{idToken:n,password:t})};kit={displayName:"DISPLAY_NAME",photoUrl:"PHOTO_URL"};(n=ui.prototype).Db=function(n,t){var i={idToken:n},r=[];return ck(kit,function(n,u){var f=t[u];null===f?r.push(n):u in t&&(i[u]=f)}),r.length&&(i.deleteAttribute=r),l(this,nrt,i)};n.vb=function(n,t){return ot(n={requestType:"PASSWORD_RESET",email:n},t),l(this,vct,n)};n.wb=function(n,t){return ot(n={requestType:"EMAIL_SIGNIN",email:n},t),l(this,cct,n)};n.ub=function(n,t){return ot(n={requestType:"VERIFY_EMAIL",idToken:n},t),l(this,lct,n)};n.Eb=function(n,t,i){return ot(n={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:n,newEmail:t},i),l(this,act,n)};n.fb=function(n){return l(this,ult,n)};n.nb=function(n,t){return l(this,wct,{oobCode:n,newPassword:t})};n.Ra=function(n){return l(this,nct,{oobCode:n})};n.jb=function(n){return l(this,ght,{oobCode:n})};var ght={endpoint:"setAccountInfo",A:rp,Z:"email",B:!0},nct={endpoint:"resetPassword",A:rp,G:function(n){var t=n.requestType;if(!t||!n.email&&"EMAIL_SIGNIN"!=t&&"VERIFY_AND_CHANGE_EMAIL"!=t)throw new i("internal-error");},B:!0},tct={endpoint:"signupNewUser",A:function(n){if(fu(n),!n.password)throw new i("weak-password");},G:lt,V:!0,B:!0},ict={endpoint:"createAuthUri",B:!0},rct={endpoint:"deleteAccount",N:["idToken"]},uct={endpoint:"setAccountInfo",N:["idToken","deleteProvider"],A:function(n){if(!Array.isArray(n.deleteProvider))throw new i("internal-error");}},fct={endpoint:"emailLinkSignin",N:["email","oobCode"],A:fu,G:lt,V:!0,B:!0},ect={endpoint:"emailLinkSignin",N:["idToken","email","oobCode"],A:fu,G:lt,V:!0},oct={endpoint:"accounts/mfaEnrollment:finalize",N:["idToken","phoneVerificationInfo"],A:dit,G:lt,B:!0,Na:!0},sct={endpoint:"accounts/mfaSignIn:finalize",N:["mfaPendingCredential","phoneVerificationInfo"],A:dit,G:lt,B:!0,Na:!0},hct={endpoint:"getAccountInfo"},cct={endpoint:"getOobConfirmationCode",N:["requestType"],A:function(n){if("EMAIL_SIGNIN"!=n.requestType)throw new i("internal-error");fu(n)},Z:"email",B:!0},lct={endpoint:"getOobConfirmationCode",N:["idToken","requestType"],A:function(n){if("VERIFY_EMAIL"!=n.requestType)throw new i("internal-error");},Z:"email",B:!0},act={endpoint:"getOobConfirmationCode",N:["idToken","newEmail","requestType"],A:function(n){if("VERIFY_AND_CHANGE_EMAIL"!=n.requestType)throw new i("internal-error");},Z:"email",B:!0},vct={endpoint:"getOobConfirmationCode",N:["requestType"],A:function(n){if("PASSWORD_RESET"!=n.requestType)throw new i("internal-error");fu(n)},Z:"email",B:!0},yct={lb:!0,endpoint:"getProjectConfig",Ub:"GET"},pct={lb:!0,endpoint:"getRecaptchaParam",Ub:"GET",G:function(n){if(!n.recaptchaSiteKey)throw new i("internal-error");}},wct={endpoint:"resetPassword",A:rp,Z:"email",B:!0},bct={endpoint:"sendVerificationCode",N:["phoneNumber","recaptchaToken"],Z:"sessionInfo",B:!0},nrt={endpoint:"setAccountInfo",N:["idToken"],A:bit,V:!0},trt={endpoint:"setAccountInfo",N:["idToken"],A:function(n){if(bit(n),!n.password)throw new i("weak-password");},G:lt,V:!0},kct={endpoint:"signupNewUser",G:lt,V:!0,B:!0},dct={endpoint:"accounts/mfaEnrollment:start",N:["idToken","phoneEnrollmentInfo"],A:function(n){if(!n.phoneEnrollmentInfo)throw new i("internal-error");if(!n.phoneEnrollmentInfo.phoneNumber)throw new i("missing-phone-number");if(!n.phoneEnrollmentInfo.recaptchaToken)throw new i("missing-app-credential");},G:function(n){if(!n.phoneSessionInfo||!n.phoneSessionInfo.sessionInfo)throw new i("internal-error");},B:!0,Na:!0},gct={endpoint:"accounts/mfaSignIn:start",N:["mfaPendingCredential","mfaEnrollmentId","phoneSignInInfo"],A:function(n){if(!n.phoneSignInInfo||!n.phoneSignInInfo.recaptchaToken)throw new i("missing-app-credential");},G:function(n){if(!n.phoneResponseInfo||!n.phoneResponseInfo.sessionInfo)throw new i("internal-error");},B:!0,Na:!0},nlt={endpoint:"verifyAssertion",A:dy,Ya:gy,G:git,V:!0,B:!0},tlt={endpoint:"verifyAssertion",A:dy,Ya:gy,G:function(n){if(n.errorMessage&&"USER_NOT_FOUND"==n.errorMessage)throw new i("user-not-found");if(n.errorMessage)throw rrt(n.errorMessage);lt(n)},V:!0,B:!0},ilt={endpoint:"verifyAssertion",A:function(n){if(dy(n),!n.idToken)throw new i("internal-error");},Ya:gy,G:git,V:!0},rlt={endpoint:"verifyCustomToken",A:function(n){if(!n.token)throw new i("invalid-custom-token");},G:lt,V:!0,B:!0},irt={endpoint:"verifyPassword",A:function(n){if(fu(n),!n.password)throw new i("wrong-password");},G:lt,V:!0,B:!0},ult={endpoint:"verifyPhoneNumber",A:ky,G:lt,B:!0},flt={endpoint:"verifyPhoneNumber",A:function(n){if(!n.idToken)throw new i("internal-error");ky(n)},G:function(n){if(n.temporaryProof)throw n.code="credential-already-in-use",lh(n);lt(n)}},elt={Hb:{USER_NOT_FOUND:"user-not-found"},endpoint:"verifyPhoneNumber",A:ky,G:lt,B:!0},olt={endpoint:"accounts/mfaEnrollment:withdraw",N:["idToken","mfaEnrollmentId"],G:function(n){if(!!n[fi]^!!n.refreshToken)throw new i("internal-error");},B:!0,Na:!0};var hlt=new oi(fe,"https://apis.google.com/js/api.js?onload=%{onload}"),clt=new fr(3e4,6e4),llt=new fr(5e3,15e3),fp=null;urt.prototype.toString=function(){return this.f?k(this.a,"v",this.f):si(this.a.b,"v"),this.b?k(this.a,"eid",this.b):si(this.a.b,"eid"),this.c.length?k(this.a,"fw",this.c.join(",")):si(this.a.b,"fw"),this.a.toString()};ep.prototype.yb=function(n){return this.h=n,this};ep.prototype.toString=function(){var n,i,r,o,u;if(k(n=this.v?ks((n=ct(this.v.url)).c,n.a,n.g,"/emulator/auth/handler"):ks("https",this.u,null,"/__/auth/handler"),"apiKey",this.s),k(n,"appName",this.c),k(n,"authType",this.m),this.a.isOAuthProvider){i=this.a;try{r=t.default.app(this.c).auth().la()}catch(n){r=null}for(f in i.ob=r,k(n,"providerId",this.a.providerId),i=rn((r=this.a).Ib))i[f]=i[f].toString();for(var f=r.Qc,i=ir(i),e=0;e<f.length;e++)o=f[e],o in i&&delete i[o];r.pb&&r.ob&&!i[r.pb]&&(i[r.pb]=r.ob);lr(i)||k(n,"customParameters",pe(i))}if("function"==typeof this.a.Qb&&(r=this.a.Qb()).length&&k(n,"scopes",r.join(",")),this.l?k(n,"redirectUrl",this.l):si(n.b,"redirectUrl"),this.g?k(n,"eventId",this.g):si(n.b,"eventId"),this.i?k(n,"v",this.i):si(n.b,"v"),this.b)for(u in this.b)this.b.hasOwnProperty(u)&&!kt(n,u)&&k(n,u,this.b[u]);return this.h?k(n,"tid",this.h):si(n.b,"tid"),this.f?k(n,"eid",this.f):si(n.b,"eid"),(u=op(this.c)).length&&k(n,"fw",u.join(",")),n.toString()};(n=frt.prototype).Ob=function(n,t,r){var f=new i("popup-closed-by-user"),e=new i("web-storage-unsupported"),o=this,u=!1;return this.ma().then(function(){var i,r;r={type:"webStorageSupport"};ort(i=o).then(function(){return n=i.v,t=r,n.rb.then(function(){return new c(function(i){n.a.send(t.type,t,i,y("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))})});var n,t}).then(function(n){if(n&&n.length&&void 0!==n[0].webStorageSupport)return n[0].webStorageSupport;throw Error();}).then(function(i){i||(n&&br(n),t(e),u=!0)})}).o(function(){}).then(function(){if(!u)return t=n,new c(function(n){return function i(){ku(2e3).then(function(){return t&&!t.closed?i():void n()})}()});var t}).then(function(){if(!u)return ku(r).then(function(){t(f)})})};n.Xb=function(){var n=ut();return!ye(n)&&!un(n)};n.Tb=function(){return!1};n.Mb=function(n,t,r,u,f,o,s,h){if(!n)return v(new i("popup-blocked"));if(s&&!ye())return this.ma().o(function(t){br(n);f(t)}),u(),e();this.a||(this.a=ert(srt(this)));var c=this;return this.a.then(function(){var t=c.ma().o(function(t){throw br(n),f(t),t;});return u(),t}).then(function(){ry(r);s||bg(co(c.s,c.g,c.b,t,r,null,o,c.c,void 0,c.i,h,c.f),n)}).o(function(n){throw"auth/network-request-failed"==n.code&&(c.a=null),n;})};n.Nb=function(n,t,i,r){this.a||(this.a=ert(srt(this)));var u=this;return this.a.then(function(){ry(t);bg(co(u.s,u.g,u.b,n,t,ve(),i,u.c,void 0,u.i,r,u.f))}).o(function(n){throw"auth/network-request-failed"==n.code&&(u.a=null),n;})};n.ma=function(){var n=this;return ort(this).then(function(){return n.v.rb}).o(function(){throw n.a=null,new i("network-request-failed");})};n.$b=function(){return!0};n.Ea=function(n){this.h.push(n)};n.Sa=function(n){ni(this.h,function(t){return t==n})};(n=hrt.prototype).get=function(n){return e(this.a.getItem(n)).then(function(n){return n&&uf(n)})};n.set=function(n,t){return e(this.a.setItem(n,pe(t)))};n.U=function(n){return e(this.a.removeItem(n))};n.ca=function(){};n.ia=function(){};hp=[];crt.prototype.c=function(n){var t,i=n.data.eventType,u=n.data.eventId,r=this.a[i];r&&0<r.length&&(n.ports[0].postMessage({status:"ack",eventId:u,eventType:i,response:null}),t=[],p(r,function(i){t.push(e().then(function(){return i(n.origin,n.data.data)}))}),ld(t).then(function(t){var r=[];p(t,function(n){r.push({fulfilled:n.Pb,value:n.value,reason:n.reason?n.reason.message:void 0})});p(r,function(n){for(var t in n)void 0===n[t]&&delete n[t]});n.ports[0].postMessage({status:"done",eventId:u,eventType:i,response:r})}))};art.prototype.postMessage=function(n,t){this.a.postMessage(n,t)};vrt.prototype.close=function(){for(;0<this.a.length;)cp(this,this.a[0]);this.b=!0};(n=prt.prototype).set=function(n,t){var i=this,r=!1;return uc(this,function(t){return lf((t=lo(ao(t,!0))).get(n))}).then(function(u){return uc(i,function(f){if(f=lo(ao(f,!0)),u)return u.value=t,lf(f.put(u));i.b++;r=!0;var e={};return e.fbase_key=n,e.value=t,lf(f.add(e))})}).then(function(){return i.c[n]=t,brt(i,n)}).oa(function(){r&&i.b--})};n.get=function(n){return uc(this,function(t){return lf(lo(ao(t,!1)).get(n))}).then(function(n){return n&&n.value})};n.U=function(n){var t=this,i=!1;return uc(this,function(r){return i=!0,t.b++,lf(lo(ao(r,!0)).delete(n))}).then(function(){return delete t.c[n],brt(t,n)}).oa(function(){i&&t.b--})};n.ca=function(n){var t;0==this.a.length&&(drt(t=this),function i(){t.f=setTimeout(function(){t.l=krt(t).then(function(n){0<n.length&&p(t.a,function(t){t(n)})}).then(function(){i()}).o(function(n){"STOP_EVENT"!=n.message&&i()})},800)}());this.a.push(n)};n.ia=function(n){ni(this.a,function(t){return t==n});0==this.a.length&&drt(this)};(n=grt.prototype).get=function(n){return this.b.then(function(t){return t.get(n)})};n.set=function(n,t){return this.b.then(function(i){return i.set(n,t)})};n.U=function(n){return this.b.then(function(t){return t.U(n)})};n.ca=function(n){this.a.push(n)};n.ia=function(n){ni(this.a,function(t){return t==n})};(n=vo.prototype).get=function(n){return e(this.a[n])};n.set=function(n,t){return this.a[n]=t,e()};n.U=function(n){return delete this.a[n],e()};n.ca=function(){};n.ia=function(){};(n=fc.prototype).get=function(n){var t=this;return e().then(function(){return uf(t.a.getItem(n))})};n.set=function(n,t){var i=this;return e().then(function(){var r=pe(t);null===r?i.U(n):i.a.setItem(n,r)})};n.U=function(n){var t=this;return e().then(function(){t.a.removeItem(n)})};n.ca=function(n){r.window&&bt(r.window,"storage",n)};n.ia=function(n){r.window&&yt(r.window,"storage",n)};(n=vp.prototype).get=function(){return e(null)};n.set=function(){return e()};n.U=function(){return e()};n.ca=function(){};n.ia=function(){};(n=yp.prototype).get=function(n){var t=this;return e().then(function(){return uf(t.a.getItem(n))})};n.set=function(n,t){var i=this;return e().then(function(){var r=pe(t);null===r?i.U(n):i.a.setItem(n,r)})};n.U=function(n){var t=this;return e().then(function(){t.a.removeItem(n)})};n.ca=function(){};n.ia=function(){};var iut,rut,vlt={F:fc,bb:yp},ylt={F:fc,bb:yp},plt={F:hrt,bb:vp},wlt={F:fc,bb:vp},af={rd:"local",NONE:"none",td:"session"};(n=uut.prototype).get=function(n,t){return eu(this,n.F).get(vf(n,t))};n.set=function(n,t,i){var r=vf(n,i),f=this,u=eu(this,n.F);return u.set(r,t).then(function(){return u.get(r)}).then(function(t){"local"==n.F&&(f.b[r]=t)})};n.addListener=function(n,t,i){var u;n=vf(n,t);this.l&&(this.b[n]=r.localStorage.getItem(n));lr(this.a)&&(eu(this,"local").ca(this.f),this.h||(ka()||!en())&&r.indexedDB||!this.l||(pp(u=this),u.c=setInterval(function(){var t,n,i;for(t in u.a)n=r.localStorage.getItem(t),i=u.b[t],n!=i&&(u.b[t]=n,n=new yr({type:"storage",key:t,target:window,oldValue:i,newValue:n,a:!0}),u.Yb(n))},1e3)));this.a[n]||(this.a[n]=[]);this.a[n].push(i)};n.removeListener=function(n,t,i){n=vf(n,t);this.a[n]&&(ni(this.a[n],function(n){return n==i}),0==this.a[n].length&&delete this.a[n]);lr(this.a)&&(eu(this,"local").ia(this.f),pp(this))};n.Yb=function(n){var t,u,e,f,i;if(n&&n.g){if(t=n.a.key,null==t)for(i in this.a)u=this.b[i],void 0===u&&(u=null),e=r.localStorage.getItem(i),e!==u&&(this.b[i]=e,this.mb(i));else if(0==t.indexOf("firebase:")&&this.a[t]){if(void 0!==n.a.a?eu(this,"local").ia(this.f):pp(this),this.m)if(i=r.localStorage.getItem(t),(u=n.a.newValue)!==i)null!==u?r.localStorage.setItem(t,u):r.localStorage.removeItem(t);else if(this.b[t]===u&&void 0===n.a.a)return;f=this;i=function(){void 0===n.a.a&&f.b[t]===r.localStorage.getItem(t)||(f.b[t]=r.localStorage.getItem(t),f.mb(t))};ti&&ki&&10==ki&&r.localStorage.getItem(t)!==n.a.newValue&&n.a.newValue!==n.a.oldValue?setTimeout(i,10):i()}}else p(n,o(this.mb,this))};n.mb=function(n){this.a[n]&&p(this.a[n],function(n){n()})};ec={name:"authEvent",F:"local"};s(oc,function(){this.b=-1});for(var fut=64,dlt=fut-1,eut=[],bp=0;bp<dlt;bp++)eut[bp]=0;kp=ll(128,eut);oc.prototype.reset=function(){this.g=this.c=0;this.a=r.Int32Array?new Int32Array(this.h):cr(this.h)};nw=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];s(out,oc);sut=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];(n=hut.prototype).ma=function(){return this.Ia||(this.Ia=(da(void 0)?ds().then(function(){return new c(function(n,t){var i=r.document,u=setTimeout(function(){t(Error("Cordova framework is not ready."))},1e3);i.addEventListener("deviceready",function(){clearTimeout(u);n()},!1)})}):v(Error("Cordova must run in an Android or iOS file scheme."))).then(function(){if("function"!=typeof y("universalLinks.subscribe",r))throw sc("cordova-universal-links-plugin-fix is not installed");if(void 0===y("BuildInfo.packageName",r))throw sc("cordova-plugin-buildinfo is not installed");if("function"!=typeof y("cordova.plugins.browsertab.openUrl",r))throw sc("cordova-plugin-browsertab is not installed");if("function"!=typeof y("cordova.InAppBrowser.open",r))throw sc("cordova-plugin-inappbrowser is not installed");},function(){throw new i("cordova-not-ready");}))};n.Ob=function(n,t){return t(new i("operation-not-supported-in-this-environment")),e()};n.Mb=function(){return v(new i("operation-not-supported-in-this-environment"))};n.$b=function(){return!1};n.Xb=function(){return!0};n.Tb=function(){return!0};n.Nb=function(n,t,u,f){if(this.c)return v(new i("redirect-operation-pending"));var o=this,h=r.document,l=null,a=null,s=null,p=null;return this.c=e().then(function(){return ry(t),lut(o)}).then(function(){return function(n,t,u,f,e){var s=function(){for(var n=20,t=[];0<n;)t.push("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(Math.floor(62*Math.random()))),n--;return t.join("")}(),a=new ri(t,f,null,s,new i("no-auth-event"),null,e),h=y("BuildInfo.packageName",r),c,o,l;if("string"!=typeof h)throw new i("invalid-cordova-configuration");if(c=y("BuildInfo.displayName",r),o={},ut().toLowerCase().match(/iphone|ipad|ipod/))o.ibi=h;else{if(!ut().toLowerCase().match(/android/))return v(new i("operation-not-supported-in-this-environment"));o.apn=h}return c&&(o.appDisplayName=c),s=glt(s),o.sessionId=s,l=co(n.v,n.i,n.l,t,u,null,f,n.m,o,n.u,e,n.s),n.ma().then(function(){var t=n.h;return n.C.a.set(ec,a.w(),t)}).then(function(){var u=y("cordova.plugins.browsertab.isAvailable",r),t;if("function"!=typeof u)throw new i("invalid-cordova-configuration");t=null;u(function(u){if(u){if("function"!=typeof(t=y("cordova.plugins.browsertab.openUrl",r)))throw new i("invalid-cordova-configuration");t(l)}else{if("function"!=typeof(t=y("cordova.InAppBrowser.open",r)))throw new i("invalid-cordova-configuration");u=ut();n.a=t(l,u.match(/(iPad|iPhone|iPod).*OS 7_\d/i)||u.match(/(iPad|iPhone|iPod).*OS 8_\d/i)?"_blank":"_system","location=yes")}})})}(o,n,t,u,f)}).then(function(){return new c(function(n,t){a=function(){var t=y("cordova.plugins.browsertab.close",r);return n(),"function"==typeof t&&t(),o.a&&"function"==typeof o.a.close&&(o.a.close(),o.a=null),!1};o.Ea(a);s=function(){l=l||ku(2e3).then(function(){t(new i("redirect-cancelled-by-user"))})};p=function(){rv()&&s()};h.addEventListener("resume",s,!1);ut().toLowerCase().match(/android/)||h.addEventListener("visibilitychange",p,!1)}).o(function(n){return tw(o).then(function(){throw n;})})}).oa(function(){s&&h.removeEventListener("resume",s,!1);p&&h.removeEventListener("visibilitychange",p,!1);l&&l.cancel();a&&o.Sa(a);o.c=null})};n.Ea=function(n){this.b.push(n);lut(this).o(function(t){"auth/invalid-cordova-configuration"===t.code&&(t=new ri("unknown",null,null,null,new i("no-auth-event")),n(t))})};n.Sa=function(n){ni(this.b,function(t){return t==n})};hc={name:"pendingRedirect",F:"session"};cc.prototype.reset=function(){this.f=!1;this.a.Sa(this.l);this.a=aut(this.D,this.v,this.m,null,this.J);this.i={}};cc.prototype.s=function(n){var t,r,u;if(!n)throw new i("invalid-auth-event");if(6e5<=Date.now()-this.u&&(this.i={},this.u=0),n&&n.getUid()&&this.i.hasOwnProperty(n.getUid()))return!1;for(t=!1,r=0;r<this.h.length;r++)if(u=this.h[r],u.Fb(n.c,n.b)){(t=this.c[n.c])&&(t.h(n,u),n&&(n.f||n.b)&&(this.i[n.getUid()]=!0,this.u=Date.now()));t=!0;break}return ift(this.b),t};wut=new fr(2e3,1e4);but=new fr(3e4,6e4);cc.prototype.qa=function(){return this.b.qa()};lc={};ac.prototype.reset=function(){this.b=null;this.a&&(this.a.cancel(),this.a=null)};ac.prototype.h=function(n,t){var r,o,u,f;n?(this.reset(),this.g=!0,r=n.c,o=n.b,u=n.a&&"auth/web-storage-unsupported"==n.a.code,f=n.a&&"auth/operation-not-supported-in-this-environment"==n.a.code,this.i=!(!u&&!f),"unknown"!=r||u||f?n.a?(ou(this,!0,null,n.a),e()):t.Fa(r,o)?function(n,t,i){i=i.Fa(t.c,t.b);var u=t.g,f=t.f,e=t.i,o=t.T(),r=!!t.c.match(/Redirect$/);i(u,f,o,e).then(function(t){ou(n,r,t,null)}).o(function(t){ou(n,r,null,t)})}(this,n,t):v(new i("invalid-auth-event")):(ou(this,!1,null,null),e())):v(new i("invalid-auth-event"))};ac.prototype.qa=function(){var n=this;return new c(function(t,r){var u,f;n.b?n.b().then(t,r):(n.f.push(t),n.c.push(r),u=n,f=new i("timeout"),u.a&&u.a.cancel(),u.a=ku(but.get()).then(function(){u.b||(u.g=!0,ou(u,!0,null,f))}))})};uft.prototype.h=function(n,t){var o,s,r,u,f;n?(o=n.c,s=n.b,n.a?(t.na(n.c,null,n.a,n.b),e()):t.Fa(o,s)?(r=t,u=(n=n).b,f=n.c,r.Fa(f,u)(n.g,n.f,n.T(),n.i).then(function(n){r.na(f,n,null,u)}).o(function(n){r.na(f,null,n,u)})):v(new i("invalid-auth-event"))):v(new i("invalid-auth-event"))};fw.prototype.confirm=function(n){return n=ptt(this.verificationId,n),this.a(n)};sw="mfaInfo";hw="mfaPendingCredential";ow.prototype.Rc=function(n){var t=this;return n.sb(this.a.a,this.c).then(function(n){var i=ir(t.f);return delete i[sw],delete i[hw],ot(i,n),t.g(i)})};s(cw,i);oft.prototype.sb=function(n,t,i){return t.type==ef?(e=this,o=n,r=i,t.Ha().then(function(n){return n={idToken:n},void 0!==r&&(n.displayName=r),ot(n,{phoneVerificationInfo:ge(e.a)}),l(o,oct,n)})):(u=this,f=n,t.Ha().then(function(n){return ot(n={mfaPendingCredential:n},{phoneVerificationInfo:ge(u.a)}),l(f,sct,n)}));var u,f,e,o,r};s(lw,oft);s(sft,lw);s(pf,ht);(n=aw.prototype).yc=function(n){var t;yc(this,(n=n.hd,t=[],p(n.mfaInfo||[],function(n){(n=hv(n))&&t.push(n)}),t))};n.Rb=function(){return this.a.I().then(function(n){return new hh(n,null)})};n.fc=function(n,t){var i=this,r=this.a.a;return this.Rb().then(function(i){return n.sb(r,i,t)}).then(function(n){return ai(i.a,n),i.a.reload()})};n.bd=function(n){var t=this,i="string"==typeof n?n:n.uid,r=this.a.a;return this.a.I().then(function(n){return l(r,olt,{idToken:n,mfaEnrollmentId:i})}).then(function(n){var r=uot(t.b,function(n){return n.uid!=i});return yc(t,r),ai(t.a,n),t.a.reload().o(function(n){if("auth/user-token-expired"!=n.code)throw n;})})};n.w=function(){return{multiFactor:{enrolledFactors:ts(this.b,function(n){return n.w()})}}};vw.prototype.start=function(){this.a=this.c,function n(t,i){t.stop();t.b=ku(iat(t,i)).then(lst).then(function(){return t.h()}).then(function(){n(t,!0)}).o(function(i){t.i(i)&&n(t,!1)})}(this,!0)};vw.prototype.stop=function(){this.b&&(this.b.cancel(),this.b=null)};yw.prototype.w=function(){return{apiKey:this.f.c,refreshToken:this.a,accessToken:this.b&&this.b.toString(),expirationTime:this.c}};yw.prototype.getToken=function(n){return n=!!n,this.b&&!this.a?v(new i("user-token-expired")):n||!this.b||Date.now()>this.c-3e4?this.a?rat(this,{grant_type:"refresh_token",refresh_token:this.a}):e(null):e({accessToken:this.b.toString(),refreshToken:this.a})};pc.prototype.w=function(){return{lastLoginAt:this.b,createdAt:this.a}};s(wt,ft);wt.prototype.wa=function(n){this.ya=n;vit(this.a,n)};wt.prototype.la=function(){return this.ya};wt.prototype.Ga=function(){return cr(this.$)};wt.prototype.hb=function(){this.u.b&&(this.u.stop(),this.u.start())};f(wt.prototype,"providerId","firebase");(n=wt.prototype).reload=function(){var n=this;return rt(this,nb(this).then(function(){return rb(n).then(function(){return su(n)}).then(vft)}))};n.oc=function(n){return this.I(n).then(function(n){return new tat(n)})};n.I=function(n){var t=this;return rt(this,nb(this).then(function(){return t.b.getToken(n)}).then(function(n){if(!n)throw new i("internal-error");return n.accessToken!=t.za&&(gw(t,n.accessToken),t.dispatchEvent(new pf("tokenChanged"))),sr(t,"refreshToken",n.refreshToken),n.accessToken}))};n.Kc=function(n){if(!(n=n.users)||!n.length)throw new i("internal-error");aft(this,{uid:(n=n[0]).localId,displayName:n.displayName,photoURL:n.photoUrl,email:n.email,emailVerified:!!n.emailVerified,phoneNumber:n.phoneNumber,lastLoginAt:n.lastLoginAt,createdAt:n.createdAt,tenantId:n.tenantId});for(var t,u=(t=(t=n).providerUserInfo)&&t.length?ts(t,function(n){return new uat(n.rawId,n.providerId,n.email,n.displayName,n.photoUrl,n.phoneNumber)}):[],r=0;r<u.length;r++)ib(this,u[r]);sr(this,"isAnonymous",!(this.email&&n.passwordHash||this.providerData&&this.providerData.length));this.dispatchEvent(new pf("userReloaded",{hd:n}))};n.Lc=function(n){return ev("firebase.User.prototype.reauthenticateAndRetrieveDataWithCredential is deprecated. Please use firebase.User.prototype.reauthenticateWithCredential instead."),this.tb(n)};n.tb=function(n){var t=this,i=null;return rt(this,n.c(this.a,this.uid).then(function(n){return ai(t,n),i=bo(t,n,"reauthenticate"),t.h=null,t.reload()}).then(function(){return i}),!0)};n.Cc=function(n){return ev("firebase.User.prototype.linkAndRetrieveDataWithCredential is deprecated. Please use firebase.User.prototype.linkWithCredential instead."),this.qb(n)};n.qb=function(n){var t=this,i=null;return rt(this,bc(this,n.providerId).then(function(){return t.I()}).then(function(i){return n.b(t.a,i)}).then(function(n){return i=bo(t,n,"link"),pft(t,n)}).then(function(){return i}))};n.Dc=function(n,t){var i=this;return rt(this,bc(this,"phone").then(function(){return ew(kw(i),n,t,o(i.qb,i))}))};n.Mc=function(n,t){var i=this;return rt(this,e().then(function(){return ew(kw(i),n,t,o(i.tb,i))}),!0)};n.Bb=function(n){var t=this;return rt(this,this.I().then(function(i){return t.a.Bb(i,n)}).then(function(n){return ai(t,n),t.reload()}))};n.ed=function(n){var t=this;return rt(this,this.I().then(function(i){return n.b(t.a,i)}).then(function(n){return ai(t,n),t.reload()}))};n.Cb=function(n){var t=this;return rt(this,this.I().then(function(i){return t.a.Cb(i,n)}).then(function(n){return ai(t,n),t.reload()}))};n.Db=function(n){if(void 0===n.displayName&&void 0===n.photoURL)return nb(this);var t=this;return rt(this,this.I().then(function(i){return t.a.Db(i,{displayName:n.displayName,photoUrl:n.photoURL})}).then(function(n){return ai(t,n),sr(t,"displayName",n.displayName||null),sr(t,"photoURL",n.photoUrl||null),p(t.providerData,function(n){"password"===n.providerId&&(f(n,"displayName",t.displayName),f(n,"photoURL",t.photoURL))}),su(t)}).then(vft))};n.cd=function(n){var t=this;return rt(this,rb(this).then(function(r){return bi(tb(t),n)?l(t.a,uct,{idToken:r,deleteProvider:[n]}).then(function(n){var i={};return p(n.providerUserInfo||[],function(n){i[n.providerId]=!0}),p(tb(t),function(n){i[n]||yft(t,n)}),i[nr.PROVIDER_ID]||f(t,"phoneNumber",null),su(t)}):su(t).then(function(){throw new i("no-such-provider");})}))};n.delete=function(){var n=this;return rt(this,this.I().then(function(t){return l(n.a,rct,{idToken:t})}).then(function(){n.dispatchEvent(new pf("userDeleted"))})).then(function(){for(var t=0;t<n.J.length;t++)n.J[t].cancel("app-deleted");pw(n,null);ww(n,null);bw(n,null);n.J=[];n.D=!0;dw(n);f(n,"refreshToken",null);n.i&&put(n.i,n)})};n.Fb=function(n,t){return!!("linkViaPopup"==n&&(this.g||null)==t&&this.f||"reauthViaPopup"==n&&(this.g||null)==t&&this.f||"linkViaRedirect"==n&&(this.ga||null)==t||"reauthViaRedirect"==n&&(this.ga||null)==t)};n.na=function(n,t,i,r){"linkViaPopup"!=n&&"reauthViaPopup"!=n||r!=(this.g||null)||(i&&this.C?this.C(i):t&&!i&&this.f&&this.f(t),this.c&&(this.c.cancel(),this.c=null),delete this.f,delete this.C)};n.Fa=function(n,t){return"linkViaPopup"==n&&t==(this.g||null)?o(this.Kb,this):"reauthViaPopup"==n&&t==(this.g||null)?o(this.Lb,this):"linkViaRedirect"==n&&(this.ga||null)==t?o(this.Kb,this):"reauthViaRedirect"==n&&(this.ga||null)==t?o(this.Lb,this):null};n.Ec=function(n){var t=this;return wft(this,"linkViaPopup",n,function(){return bc(t,n.providerId).then(function(){return su(t)})},!1)};n.Nc=function(n){return wft(this,"reauthViaPopup",n,function(){return e()},!0)};n.Fc=function(n){var t=this;return bft(this,"linkViaRedirect",n,function(){return bc(t,n.providerId)},!1)};n.Oc=function(n){return bft(this,"reauthViaRedirect",n,function(){return e()},!0)};n.Kb=function(n,t,i,r){var u=this,f;return this.c&&(this.c.cancel(),this.c=null),f=null,i=this.I().then(function(i){return tp(u.a,{requestUri:n,postBody:r,sessionId:t,idToken:i})}).then(function(n){return f=bo(u,n,"link"),pft(u,n)}).then(function(){return f}),rt(this,i)};n.Lb=function(n,t,i,r){var u=this,f;return this.c&&(this.c.cancel(),this.c=null),f=null,rt(this,e().then(function(){return sf(ip(u.a,{requestUri:n,sessionId:t,postBody:r,tenantId:i}),u.uid)}).then(function(n){return f=bo(u,n,"reauthenticate"),ai(u,n),u.h=null,u.reload()}).then(function(){return f}),!0)};n.ub=function(n){var t=this,i=null;return rt(this,this.I().then(function(t){return i=t,void 0===n||lr(n)?{}:uh(new rh(n))}).then(function(n){return t.a.ub(i,n)}).then(function(n){if(t.email!=n)return t.reload()}).then(function(){}))};n.Eb=function(n,t){var i=this,r=null;return rt(this,this.I().then(function(n){return r=n,void 0===t||lr(t)?{}:uh(new rh(t))}).then(function(t){return i.a.Eb(r,n,t)}).then(function(n){if(i.email!=n)return i.reload()}).then(function(){}))};n.jc=function(n){var i=null,t=this;return rt(this,n=sf(e(n),t.uid).then(function(n){return i=bo(t,n,"reauthenticate"),ai(t,n),t.h=null,t.reload()}).then(function(){return i}),!0)};n.toJSON=function(){return this.w()};n.w=function(){var n={uid:this.uid,displayName:this.displayName,photoURL:this.photoURL,email:this.email,emailVerified:this.emailVerified,phoneNumber:this.phoneNumber,isAnonymous:this.isAnonymous,tenantId:this.tenantId,providerData:[],apiKey:this.l,appName:this.m,authDomain:this.s,stsTokenManager:this.b.w(),redirectEventId:this.ga||null};return this.metadata&&ot(n,this.metadata.w()),p(this.providerData,function(t){n.providerData.push(function(n){var t,i={};for(t in n)n.hasOwnProperty(t)&&(i[t]=n[t]);return i}(t))}),ot(n,this.O.w()),n};kc={name:"redirectUser",F:"session"};ub.prototype.g=function(){var n=this,t=vi("local");wf(this,function(){return e().then(function(){return n.c&&"local"!=n.c.F?n.b.get(t,n.a):null}).then(function(i){if(i)return fb(n,"local").then(function(){n.c=t})})})};dc={name:"persistence",F:"session"};ub.prototype.xb=function(n){var r=null,t=this;return function(n){var u=new i("invalid-persistence-type"),r=new i("unsupported-persistence-type"),t;n:{for(t in af)if(af[t]==n){t=!0;break n}t=!1}if(!t||"string"!=typeof n)throw u;switch(hi()){case"ReactNative":if("session"===n)throw r;break;case"Node":if("none"!==n)throw r;break;case"Worker":if("session"===n||!ap()&&"none"!==n)throw r;break;default:if(!iv()&&"none"!==n)throw r;}}(n),wf(this,function(){return n!=t.c.F?t.b.get(t.c,t.a).then(function(i){return r=i,fb(t,n)}).then(function(){if(t.c=vi(n),r)return t.b.set(t.c,r,t.a)}):e()})};s(yi,ft);s(ret,ht);s(uet,ht);s(fet,ht);(n=yi.prototype).xb=function(n){return n=this.i.xb(n),b(this,n)};n.wa=function(n){this.aa===n||this.l||(this.aa=n,vit(this.a,this.aa),this.dispatchEvent(new ret(this.la())))};n.la=function(){return this.aa};n.fd=function(){var n=r.navigator;this.wa(n&&(n.languages&&n.languages[0]||n.language||n.userLanguage)||null)};n.gd=function(n,t){if(!this.P){if(!/^https?:\/\//.test(n))throw new i("argument-error","Emulator URL must start with a valid scheme (http:// or https://).");t=!!t&&!!t.disableWarnings;u=t;"undefined"!=typeof console&&"function"==typeof console.info&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only.  Do not use with production credentials.");r.document&&!u&&ds().then(function(){var n=r.document.createElement("div");n.innerText="Running in emulator mode. Do not use with production credentials.";n.style.position="fixed";n.style.width="100%";n.style.backgroundColor="#ffffff";n.style.border=".1em solid #000000";n.style.color="#b50000";n.style.bottom="0px";n.style.left="0px";n.style.margin="0px";n.style.zIndex=1e4;n.style.textAlign="center";n.classList.add("firebase-emulator-warning");r.document.body.appendChild(n)});this.P={url:n,ec:t};this.settings.ib=!0;cf(this.a,this.P);this.dispatchEvent(new uet(this.P))}var u};n.Gc=function(n){this.J.push(n);yit(this.a,t.default.SDK_VERSION?tf(t.default.SDK_VERSION,this.J):null);this.dispatchEvent(new fet(this.J))};n.Ga=function(){return cr(this.J)};n.yb=function(n){this.S===n||this.l||(this.S=n,this.a.b=this.S)};n.T=function(){return this.S};n.toJSON=function(){return{apiKey:this.app.options.apiKey,authDomain:this.app.options.authDomain,appName:this.app.name,currentUser:h(this)&&h(this).w()}};n.Fb=function(n,t){switch(n){case"unknown":case"signInViaRedirect":return!0;case"signInViaPopup":return this.g==t&&!!this.f;default:return!1}};n.na=function(n,t,i,r){"signInViaPopup"==n&&this.g==r&&(i&&this.C?this.C(i):t&&!i&&this.f&&this.f(t),this.c&&(this.c.cancel(),this.c=null),delete this.f,delete this.C)};n.Fa=function(n,t){return"signInViaRedirect"==n||"signInViaPopup"==n&&this.g==t&&this.f?o(this.ic,this):null};n.ic=function(n,t,i,r){var u=this,f={requestUri:n,postBody:r,sessionId:t,tenantId:i};return this.c&&(this.c.cancel(),this.c=null),u.$.then(function(){return hu(u,np(u.a,f))})};n.Xc=function(n){if(!kr())return v(new i("operation-not-supported-in-this-environment"));var r=this,f=bv(n.providerId),e=dr(),o=null,u=dg(o=(!ye()||ga())&&this.app.options.authDomain&&n.isOAuthProvider?co(this.app.options.authDomain,this.app.options.apiKey,this.app.name,"signInViaPopup",n,null,e,t.default.SDK_VERSION||null,null,null,this.T(),this.P):o,f&&f.ua,f&&f.ta);return b(this,f=eb(this).then(function(t){return kut(t,u,"signInViaPopup",n,e,!!o,r.T())}).then(function(){return new c(function(n,t){r.na("signInViaPopup",null,new i("cancelled-popup-request"),r.g);r.f=n;r.C=t;r.g=e;r.c=gut(r.b,r,"signInViaPopup",u,e)})}).then(function(n){return u&&br(u),n?ci(n):null}).o(function(n){throw u&&br(u),n;}))};n.Yc=function(n){if(!kr())return v(new i("operation-not-supported-in-this-environment"));var t=this;return b(this,eb(this).then(function(){return wf(n=t.i,function(){return n.b.set(dc,n.c.F,n.a)});var n}).then(function(){return dut(t.b,"signInViaRedirect",n,void 0,t.T())}))};n.qa=function(){var n=this;return eet(this).then(function(t){return n.b&&vc(n.b.b),t}).o(function(t){throw n.b&&vc(n.b.b),t;})};n.dd=function(n){var t,r,f,u,s,c,o,e;return n?this.S!=n.tenantId?v(new i("tenant-id-mismatch")):(t=this,r={},r.apiKey=this.app.options.apiKey,r.authDomain=this.app.options.authDomain,r.appName=this.app.name,e=(f=n,u=r,s=t.D,c=t.Ga(),o=f.b,(r={})[fi]=o.b&&o.b.toString(),r.refreshToken=o.a,u=new wt(u||{apiKey:f.l,authDomain:f.s,appName:f.m},r),s&&(u.ha=s),c&&po(u,c),wc(u,f),u),b(this,this.h.then(function(){if(t.app.options.apiKey!=n.l)return e.reload()}).then(function(){return h(t)&&n.uid==h(t).uid?(wc(h(t),n),t.da(n)):(bf(t,e),wo(e),t.da(e))}).then(function(){ko(t)}))):v(new i("null-user"))};n.Ab=function(){var n=this,t=this.h.then(function(){return n.b&&vc(n.b.b),h(n)?(bf(n,null),tet(n.i).then(function(){ko(n)})):e()});return b(this,t)};n.Zc=function(){var n=this;return iet(this.i,this.app.options.authDomain).then(function(t){if(!n.l){var i,r;if((i=h(n)&&t)&&(i=h(n).uid,r=t.uid,i=null!=i&&""!==i&&null!=r&&""!==r&&i==r),i)return wc(h(n),t),h(n).I();(h(n)||t)&&(bf(n,t),t&&(wo(t),t.ha=n.D),n.b&&rw(n.b,n),ko(n))}})};n.da=function(n){return net(this.i,n)};n.mc=function(){ko(this);this.da(h(this))};n.wc=function(){this.Ab()};n.xc=function(){this.Ab()};n.kc=function(n){var t=this;return this.h.then(function(){return hu(t,e(n))})};n.zc=function(n){var t=this;this.addAuthTokenListener(function(){n.next(h(t))})};n.Ac=function(n){var t,i,r=this;i=function(){n.next(h(r))};(t=this).O.push(i);b(t,t.h.then(function(){!t.l&&bi(t.O,i)&&t.X!==t.getUid()&&(t.X=t.getUid(),i(gc(t)))}))};n.Ic=function(n,t,i){var r=this;return this.ba&&Promise.resolve().then(function(){"function"==typeof n?n(h(r)):"function"==typeof n.next&&n.next(h(r))}),this.hb(n,t,i)};n.Hc=function(n,t,i){var r=this;return this.ba&&Promise.resolve().then(function(){r.X=r.getUid();"function"==typeof n?n(h(r)):"function"==typeof n.next&&n.next(h(r))}),this.bc(n,t,i)};n.nc=function(n){var t=this,i=this.h.then(function(){return h(t)?h(t).I(n).then(function(n){return{accessToken:n}}):null});return b(this,i)};n.Tc=function(n){var t=this;return this.h.then(function(){return hu(t,l(t.a,rlt,{token:n}))}).then(function(n){var i=n.user;return sr(i,"isAnonymous",!1),t.da(i),n})};n.Uc=function(n,t){var i=this;return this.h.then(function(){return hu(i,l(i.a,irt,{email:n,password:t}))})};n.dc=function(n,t){var i=this;return this.h.then(function(){return hu(i,l(i.a,tct,{email:n,password:t}))})};n.$a=function(n){var t=this;return this.h.then(function(){return hu(t,n.ka(t.a))})};n.Sc=function(n){return ev("firebase.auth.Auth.prototype.signInAndRetrieveDataWithCredential is deprecated. Please use firebase.auth.Auth.prototype.signInWithCredential instead."),this.$a(n)};n.zb=function(){var n=this;return this.h.then(function(){var t=h(n),i;return t&&t.isAnonymous?(i=ci({providerId:null,isNewUser:!1}),ci({user:t,credential:null,additionalUserInfo:i,operationType:"signIn"})):hu(n,n.a.zb()).then(function(t){var i=t.user;return sr(i,"isAnonymous",!0),n.da(i),t})})};n.getUid=function(){return h(this)&&h(this).uid||null};n.cc=function(n){this.addAuthTokenListener(n);this.u++;0<this.u&&h(this)&&lft(h(this))};n.Pc=function(n){var t=this;p(this.s,function(i){i==n&&t.u--});this.u<0&&(this.u=0);0==this.u&&h(this)&&dw(h(this));this.removeAuthTokenListener(n)};n.addAuthTokenListener=function(n){var t=this;this.s.push(n);b(this,this.h.then(function(){t.l||bi(t.s,n)&&n(gc(t))}))};n.removeAuthTokenListener=function(n){ni(this.s,function(t){return t==n})};n.delete=function(){this.l=!0;for(var n=0;n<this.R.length;n++)this.R[n].cancel("app-deleted");return this.R=[],this.i&&(n=this.i).b.removeListener(vi("local"),n.a,this.ja),this.b&&(put(this.b,this),vc(this.b.b)),Promise.resolve()};n.hc=function(n){return b(this,l(this.a,ict,{identifier:n,continueUri:nh()?ve():"http://localhost"}).then(function(n){return n.signinMethods||[]}))};n.Bc=function(n){return!!ty(n)};n.wb=function(n,t){var r=this;return b(this,e().then(function(){var n=new rh(t);if(!n.c)throw new i("argument-error",pv+" must be true when sending sign in link to email");return uh(n)}).then(function(t){return r.a.wb(n,t)}).then(function(){}))};n.jd=function(n){return this.Ra(n).then(function(n){return n.data.email})};n.nb=function(n,t){return b(this,this.a.nb(n,t).then(function(){}))};n.Ra=function(n){return b(this,this.a.Ra(n).then(function(n){return new ast(n)}))};n.jb=function(n){return b(this,this.a.jb(n).then(function(){}))};n.vb=function(n,t){var i=this;return b(this,e().then(function(){return void 0===t||lr(t)?{}:uh(new rh(t))}).then(function(t){return i.a.vb(n,t)}).then(function(){}))};n.Wc=function(n,t){return b(this,ew(this,n,t,o(this.$a,this)))};n.Vc=function(n,t){var r=this;return b(this,e().then(function(){var u=t||ve(),f=ytt(n,u);if(!(u=ty(u)))throw new i("argument-error","Invalid email link!");if(u.tenantId!==r.T())throw new i("tenant-id-mismatch");return r.$a(f)}))};go.prototype.render=function(){};go.prototype.reset=function(){};go.prototype.getResponse=function(){};go.prototype.execute=function(){};ob=null;kf.prototype.render=function(n,t){return this.a[this.b.toString()]=new nl(n,t),this.b++};kf.prototype.reset=function(n){var t=sb(this,n);n=oet(n);t&&n&&(t.delete(),delete this.a[n])};kf.prototype.getResponse=function(n){return(n=sb(this,n))?n.getResponse():null};kf.prototype.execute=function(n){(n=sb(this,n))&&n.execute()};nl.prototype.getResponse=function(){return hb(this),this.b};nl.prototype.execute=function(){hb(this);var n=this;this.a||(this.a=setTimeout(function(){n.b=function(){for(var n=50,t=[];0<n;)t.push("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(Math.floor(62*Math.random()))),n--;return t.join("")}();var t=n.c.callback,i=n.c["expired-callback"];if(t)try{t(n.b)}catch(t){}n.a=setTimeout(function(){if(n.a=null,n.b=null,i)try{i()}catch(t){}n.h&&n.execute()},6e4)},500))};nl.prototype.delete=function(){hb(this);this.g=!0;clearTimeout(this.a);this.a=null;yt(this.f,"click",this.i)};f(cb,"FACTOR_ID","phone");lb.prototype.g=function(){return e(ob=ob||new kf)};lb.prototype.c=function(){};ab=null;set=new oi(fe,"https://www.google.com/recaptcha/api.js?onload=%{onload}&render=explicit&hl=%{hl}");het=new fr(3e4,6e4);vb.prototype.g=function(n){var t=this;return new c(function(u,f){var o=setTimeout(function(){f(new i("network-request-failed"))},het.get());!r.grecaptcha||n!==t.f&&!t.b?(r[t.a]=function(){var e;r.grecaptcha?(t.f=n,e=r.grecaptcha.render,r.grecaptcha.render=function(n,i){return n=e(n,i),t.b++,n},clearTimeout(o),u(r.grecaptcha)):(clearTimeout(o),f(new i("internal-error")));delete r[t.a]},e(vy(wl(set,{onload:t.a,hl:n||""}))).o(function(){clearTimeout(o);f(new i("internal-error","Unable to load external reCAPTCHA dependencies!"))})):(clearTimeout(o),u(r.grecaptcha))})};vb.prototype.c=function(){this.b--};yb=null;var cet="callback",aet="expired-callback",vet="sitekey",oat="size";(n=pb.prototype).Ia=function(){var n=this;return this.f||(this.f=wb(this,e().then(function(){if(nh()&&!ii())return ds();throw new i("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment.");}).then(function(){return n.m.g(n.u())}).then(function(t){return n.g=t,l(n.s,pct,{})}).then(function(t){n.a[vet]=t.recaptchaSiteKey}).o(function(t){throw n.f=null,t;})))};n.render=function(){tl(this);var n=this;return wb(this,this.Ia().then(function(){var i,t;return null===n.c&&(t=n.v,n.i||(i=oe(t),t=got("DIV"),i.appendChild(t)),n.c=n.g.render(t,n.a)),n.c}))};n.verify=function(){tl(this);var n=this;return wb(this,this.render().then(function(t){return new c(function(i){var r,u=n.g.getResponse(t);u?i(u):(n.l.push(r=function(t){var u;t&&(u=r,ni(n.l,function(n){return n==u}),i(t))}),n.i&&n.g.execute(n.c))})}))};n.reset=function(){tl(this);null!==this.c&&this.g.reset(this.c)};n.clear=function(){tl(this);this.D=!0;this.m.c();for(var t,n=0;n<this.h.length;n++)this.h[n].cancel("RecaptchaVerifier instance has been destroyed.");if(!this.i)for(n=oe(this.v);t=n.firstChild;)n.removeChild(t)};s(bb,pb);kb="First Second Third Fourth Fifth Sixth Seventh Eighth Ninth".split(" ");w(yi.prototype,{jb:{name:"applyActionCode",j:[u("code")]},Ra:{name:"checkActionCode",j:[u("code")]},nb:{name:"confirmPasswordReset",j:[u("code"),u("newPassword")]},dc:{name:"createUserWithEmailAndPassword",j:[u("email"),u("password")]},hc:{name:"fetchSignInMethodsForEmail",j:[u("email")]},qa:{name:"getRedirectResult",j:[]},Bc:{name:"isSignInWithEmailLink",j:[u("emailLink")]},Hc:{name:"onAuthStateChanged",j:[d(nt(),df(),"nextOrObserver"),df("opt_error",!0),df("opt_completed",!0)]},Ic:{name:"onIdTokenChanged",j:[d(nt(),df(),"nextOrObserver"),df("opt_error",!0),df("opt_completed",!0)]},vb:{name:"sendPasswordResetEmail",j:[u("email"),d(nt("opt_actionCodeSettings",!0),pi(null,!0),"opt_actionCodeSettings",!0)]},wb:{name:"sendSignInLinkToEmail",j:[u("email"),nt("actionCodeSettings")]},xb:{name:"setPersistence",j:[u("persistence")]},Sc:{name:"signInAndRetrieveDataWithCredential",j:[hr()]},zb:{name:"signInAnonymously",j:[]},$a:{name:"signInWithCredential",j:[hr()]},Tc:{name:"signInWithCustomToken",j:[u("token")]},Uc:{name:"signInWithEmailAndPassword",j:[u("email"),u("password")]},Vc:{name:"signInWithEmailLink",j:[u("email"),u("emailLink",!0)]},Wc:{name:"signInWithPhoneNumber",j:[u("phoneNumber"),il()]},Xc:{name:"signInWithPopup",j:[gf()]},Yc:{name:"signInWithRedirect",j:[gf()]},dd:{name:"updateCurrentUser",j:[d({name:"user",K:"an instance of Firebase User",optional:!1,M:function(n){return!!(n&&n instanceof wt)}},pi(),"user")]},Ab:{name:"signOut",j:[]},toJSON:{name:"toJSON",j:[u(null,!0)]},fd:{name:"useDeviceLanguage",j:[]},gd:{name:"useEmulator",j:[u("url"),nt("options",!0)]},jd:{name:"verifyPasswordResetCode",j:[u("code")]}});ket(yi.prototype,{lc:{name:"languageCode",kb:d(u(),pi(),"languageCode")},ti:{name:"tenantId",kb:d(u(),pi(),"tenantId")}});(yi.Persistence=af).LOCAL="local";yi.Persistence.SESSION="session";yi.Persistence.NONE="none";w(wt.prototype,{"delete":{name:"delete",j:[]},oc:{name:"getIdTokenResult",j:[db("opt_forceRefresh",!0)]},I:{name:"getIdToken",j:[db("opt_forceRefresh",!0)]},Cc:{name:"linkAndRetrieveDataWithCredential",j:[hr()]},qb:{name:"linkWithCredential",j:[hr()]},Dc:{name:"linkWithPhoneNumber",j:[u("phoneNumber"),il()]},Ec:{name:"linkWithPopup",j:[gf()]},Fc:{name:"linkWithRedirect",j:[gf()]},Lc:{name:"reauthenticateAndRetrieveDataWithCredential",j:[hr()]},tb:{name:"reauthenticateWithCredential",j:[hr()]},Mc:{name:"reauthenticateWithPhoneNumber",j:[u("phoneNumber"),il()]},Nc:{name:"reauthenticateWithPopup",j:[gf()]},Oc:{name:"reauthenticateWithRedirect",j:[gf()]},reload:{name:"reload",j:[]},ub:{name:"sendEmailVerification",j:[d(nt("opt_actionCodeSettings",!0),pi(null,!0),"opt_actionCodeSettings",!0)]},toJSON:{name:"toJSON",j:[u(null,!0)]},cd:{name:"unlink",j:[u("provider")]},Bb:{name:"updateEmail",j:[u("email")]},Cb:{name:"updatePassword",j:[u("password")]},ed:{name:"updatePhoneNumber",j:[hr("phone")]},Db:{name:"updateProfile",j:[nt("profile")]},Eb:{name:"verifyBeforeUpdateEmail",j:[u("email"),d(nt("opt_actionCodeSettings",!0),pi(null,!0),"opt_actionCodeSettings",!0)]}});w(kf.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}});w(go.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}});w(c.prototype,{oa:{name:"finally"},o:{name:"catch"},then:{name:"then"}});ket(fft.prototype,{appVerificationDisabled:{name:"appVerificationDisabledForTesting",kb:db("appVerificationDisabledForTesting")}});w(fw.prototype,{confirm:{name:"confirm",j:[u("verificationCode")]}});g(of,"fromJSON",function(n){n="string"==typeof n?JSON.parse(n):n;for(var i,r=[eht,oht,sht,fht],t=0;t<r.length;t++)if(i=r[t](n))return i;return null},[d(u(),nt(),"json")]);g(dt,"credential",function(n,t){return new er(n,t)},[u("email"),u("password")]);w(er.prototype,{w:{name:"toJSON",j:[u(null,!0)]}});w(tu.prototype,{Ca:{name:"addScope",j:[u("scope")]},Ka:{name:"setCustomParameters",j:[nt("customOAuthParameters")]}});g(tu,"credential",ctt,[d(u(),nt(),"token")]);g(dt,"credentialWithLink",ytt,[u("email"),u("emailLink")]);w(iu.prototype,{Ca:{name:"addScope",j:[u("scope")]},Ka:{name:"setCustomParameters",j:[nt("customOAuthParameters")]}});g(iu,"credential",ltt,[d(u(),nt(),"token")]);w(ru.prototype,{Ca:{name:"addScope",j:[u("scope")]},Ka:{name:"setCustomParameters",j:[nt("customOAuthParameters")]}});g(ru,"credential",att,[d(u(),d(nt(),pi()),"idToken"),d(u(),pi(),"accessToken",!0)]);w(hf.prototype,{Ka:{name:"setCustomParameters",j:[nt("customOAuthParameters")]}});g(hf,"credential",vtt,[d(u(),nt(),"token"),u("secret",!0)]);w(pt.prototype,{Ca:{name:"addScope",j:[u("scope")]},credential:{name:"credential",j:[d(u(),d(nt(),pi()),"optionsOrIdToken"),d(u(),pi(),"accessToken",!0)]},Ka:{name:"setCustomParameters",j:[nt("customOAuthParameters")]}});w(gi.prototype,{w:{name:"toJSON",j:[u(null,!0)]}});w(gr.prototype,{w:{name:"toJSON",j:[u(null,!0)]}});g(nr,"credential",ptt,[u("verificationId"),u("verificationCode")]);w(nr.prototype,{fb:{name:"verifyPhoneNumber",j:[d(u(),{name:"phoneInfoOptions",K:"valid phone info options",optional:!1,M:function(n){return!!n&&(n.session&&n.phoneNumber?gb(n.session,ef)&&"string"==typeof n.phoneNumber:n.session&&n.multiFactorHint?gb(n.session,de)&&bet(n.multiFactorHint):n.session&&n.multiFactorUid?gb(n.session,de)&&"string"==typeof n.multiFactorUid:!!n.phoneNumber&&"string"==typeof n.phoneNumber)}},"phoneInfoOptions"),il()]}});w(or.prototype,{w:{name:"toJSON",j:[u(null,!0)]}});w(i.prototype,{toJSON:{name:"toJSON",j:[u(null,!0)]}});w(no.prototype,{toJSON:{name:"toJSON",j:[u(null,!0)]}});w(fy.prototype,{toJSON:{name:"toJSON",j:[u(null,!0)]}});w(cw.prototype,{toJSON:{name:"toJSON",j:[u(null,!0)]}});w(ow.prototype,{Rc:{name:"resolveSignIn",j:[wet()]}});w(aw.prototype,{Rb:{name:"getSession",j:[]},fc:{name:"enroll",j:[wet(),u("displayName",!0)]},bd:{name:"unenroll",j:[d({name:"multiFactorInfo",K:"a valid multiFactorInfo",optional:!1,M:bet},u(),"multiFactorInfoIdentifier")]}});w(bb.prototype,{clear:{name:"clear",j:[]},render:{name:"render",j:[]},verify:{name:"verify",j:[]}});g(yv,"parseLink",yn,[u("link")]);g(cb,"assertion",function(n){return new sft(n)},[hr("phone")]),function(){if(void 0===t.default||!t.default.INTERNAL||!t.default.INTERNAL.registerComponent)throw Error("Cannot find the firebase namespace; be sure to include firebase-app.js before this library.");var n={ActionCodeInfo:{Operation:{EMAIL_SIGNIN:ih,PASSWORD_RESET:"PASSWORD_RESET",RECOVER_EMAIL:"RECOVER_EMAIL",REVERT_SECOND_FACTOR_ADDITION:vv,VERIFY_AND_CHANGE_EMAIL:ke,VERIFY_EMAIL:"VERIFY_EMAIL"}},Auth:yi,AuthCredential:of,Error:i};g(n,"EmailAuthProvider",dt,[]);g(n,"FacebookAuthProvider",tu,[]);g(n,"GithubAuthProvider",iu,[]);g(n,"GoogleAuthProvider",ru,[]);g(n,"TwitterAuthProvider",hf,[]);g(n,"OAuthProvider",pt,[u("providerId")]);g(n,"SAMLAuthProvider",htt,[u("providerId")]);g(n,"PhoneAuthProvider",nr,[{name:"auth",K:"an instance of Firebase Auth",optional:!0,M:function(n){return!!(n&&n instanceof yi)}}]);g(n,"RecaptchaVerifier",bb,[d(u(),{name:"",K:"an HTML element",optional:!1,M:function(n){return!!(n&&n instanceof Element)}},"recaptchaContainer"),nt("recaptchaParameters",!0),{name:"app",K:"an instance of Firebase App",optional:!0,M:function(n){return!!(n&&n instanceof t.default.app.App)}}]);g(n,"ActionCodeURL",yv,[]);g(n,"PhoneMultiFactorGenerator",cb,[]);t.default.INTERNAL.registerComponent({name:"auth",instanceFactory:function(n){return new yi(n=n.getProvider("app").getImmediate())},multipleInstances:!1,serviceProps:n,instantiationMode:"LAZY",type:"PUBLIC"});t.default.INTERNAL.registerComponent({name:"auth-internal",instanceFactory:function(n){return{getUid:o((n=n.getProvider("auth").getImmediate()).getUid,n),getToken:o(n.nc,n),addAuthTokenListener:o(n.cc,n),removeAuthTokenListener:o(n.Pc,n)}},multipleInstances:!1,instantiationMode:"LAZY",type:"PRIVATE"});t.default.registerVersion("@firebase/auth","0.16.6");t.default.INTERNAL.extendNamespace({User:wt})}()}.apply("undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})}.apply(this,arguments)}catch(t){throw console.error(t),new Error("Cannot instantiate firebase-auth.js - be sure to load firebase-app.js first.");}});!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("@firebase/app")):"function"==typeof define&&define.amd?define(["@firebase/app"],t):t((n="undefined"!=typeof globalThis?globalThis:n||self).firebase)}(this,function(n){"use strict";try{!function(){function rgt(n){return n&&"object"==typeof n&&"default"in n?n:{"default":n}}function c(n,t){function i(){this.constructor=n}if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");pft(n,t);n.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}function r(n,t,i,r){return new(i=i||Promise)(function(u,f){function o(n){try{e(r.next(n))}catch(n){f(n)}}function s(n){try{e(r.throw(n))}catch(n){f(n)}}function e(n){var t;n.done?u(n.value):((t=n.value)instanceof i?t:new i(function(n){n(t)})).then(o,s)}e((r=r.apply(n,t||[])).next())})}function i(n,t){function e(e){return function(o){return function(e){if(f)throw new TypeError("Generator is already executing.");for(;r;)try{if(f=1,u&&(i=2&e[0]?u.return:e[0]?u.throw||((i=u.return)&&i.call(u),0):u.next)&&!(i=i.call(u,e[1])).done)return i;switch(u=0,(e=i?[2&e[0],i.value]:e)[0]){case 0:case 1:i=e;break;case 4:return r.label++,{value:e[1],done:!1};case 5:r.label++;u=e[1];e=[0];continue;case 7:e=r.ops.pop();r.trys.pop();continue;default:if(!(i=0<(i=r.trys).length&&i[i.length-1])&&(6===e[0]||2===e[0])){r=0;continue}if(3===e[0]&&(!i||e[1]>i[0]&&e[1]<i[3])){r.label=e[1];break}if(6===e[0]&&r.label<i[1]){r.label=i[1];i=e;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(e);break}i[2]&&r.ops.pop();r.trys.pop();continue}e=t.call(n,r)}catch(o){e=[6,o];u=0}finally{f=i=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,o])}}var f,u,i,r={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o={next:e(0),"throw":e(1),"return":e(2)};return"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o}function g(n,t){for(var i=0,u=t.length,r=n.length;i<u;i++,r++)n[r]=t[i];return n}function wo(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function ed(n,t,i){return t=kft.call(this,t)||this,t.code=n,t.customData=i,t.name=fgt,Object.setPrototypeOf(t,ed.prototype),Error.captureStackTrace&&Error.captureStackTrace(t,ogt.prototype.create),t}function dft(n,t,i){this.service=n;this.serviceName=t;this.errors=i}function yt(n){return n&&n._delegate?n._delegate:n}function hgt(n,t){for(var f,u,r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];if(!(t<n.logLevel)){if(f=(new Date).toISOString(),u=agt[t],!u)throw new Error("Attempted to log a message with an invalid logType (value: "+t+")");console[u].apply(console,g(["["+f+"]  "+n.name+":"],r))}}function ff(n){this.name=n;this._logLevel=lgt;this._logHandler=hgt;this._userLogHandler=null}function gft(n){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&n[t],r=0;if(i)return i.call(n);if(n&&"number"==typeof n.length)return{next:function(){return{value:(n=n&&r>=n.length?void 0:n)&&n[r++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.");}function vy(){}function sd(n){var t=typeof n;return"array"==(t="object"!=t?t:n?Array.isArray(n)?"array":t:"null")||"object"==t&&"number"==typeof n.length}function kl(n){var t=typeof n;return"object"==t&&null!=n||"function"==t}function vgt(n){return n.call.apply(n.bind,arguments)}function ygt(n,t){if(!n)throw Error();if(2<arguments.length){var i=Array.prototype.slice.call(arguments,2);return function(){var r=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(r,i),n.apply(t,r)}}return function(){return n.apply(t,arguments)}}function pr(){return(pr=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?vgt:ygt).apply(null,arguments)}function py(n){var t=Array.prototype.slice.call(arguments,1);return function(){var i=t.slice();return i.push.apply(i,arguments),n.apply(this,i)}}function ef(){return Date.now()}function li(n,t){function i(){}i.prototype=t.prototype;n.X=t.prototype;n.prototype=new i;(n.prototype.constructor=n).Pb=function(n,i){for(var u=Array(arguments.length-2),r=2;r<arguments.length;r++)u[r-2]=arguments[r];return t.prototype[i].apply(n,u)}}function le(){this.j=this.j;this.i=this.i}function iet(){return Array.prototype.concat.apply([],arguments)}function ld(n){var i=n.length,r,t;if(0<i){for(r=Array(i),t=0;t<i;t++)r[t]=n[t];return r}return[]}function wy(n){return/^[\s\xa0]*$/.test(n)}function ur(n,t){return-1!=n.indexOf(t)}function vd(n,t){return n<t?-1:t<n?1:0}function yd(n,t,i){for(var r in n)t.call(i,n[r],r,n)}function ret(n){var t,i={};for(t in n)i[t]=n[t];return i}function uet(n){for(var t,i,u,r=1;r<arguments.length;r++){for(t in i=arguments[r])n[t]=i[t];for(u=0;u<pd.length;u++)t=pd[u],Object.prototype.hasOwnProperty.call(i,t)&&(n[t]=i[t])}}function wd(n){return wd[" "](n),n}function oet(){var n=v.document;if(n)return n.documentMode}function het(n){return t=n,r=function(){for(var t,i,r=0,f=ad(String(by)).split("."),e=ad(String(n)).split("."),o=Math.max(f.length,e.length),u=0;0==r&&u<o;u++)for(t=f[u]||"",i=e[u]||"";t=/(\d*)(\D*)(.*)/.exec(t)||["","","",""],i=/(\d*)(\D*)(.*)/.exec(i)||["","","",""],(0!=t[0].length||0!=i[0].length)&&(r=vd(0==t[1].length?0:parseInt(t[1],10),0==i[1].length?0:parseInt(i[1],10))||vd(0==t[2].length,0==i[2].length)||vd(t[2],i[2]),t=t[3],i=i[3],0==r););return 0<=r},i=set,Object.prototype.hasOwnProperty.call(i,t)?i[t]:i[t]=r(t);var t,r,i}function nr(n,t){this.type=n;this.a=this.target=t;this.defaultPrevented=!1}function dl(n,t){var r,i,u;if(nr.call(this,n?n.type:""),this.relatedTarget=this.a=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.pointerId=0,this.pointerType="",this.c=null,n){if(r=this.type=n.type,i=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:null,this.target=n.target||n.srcElement,this.a=t,t=n.relatedTarget){if(eet){n:{try{wd(t.nodeName);u=!0;break n}catch(n){}u=!1}u||(t=null)}}else"mouseover"==r?t=n.fromElement:"mouseout"==r&&(t=n.toElement);this.relatedTarget=t;i?(this.clientX=void 0!==i.clientX?i.clientX:i.pageX,this.clientY=void 0!==i.clientY?i.clientY:i.pageY,this.screenX=i.screenX||0,this.screenY=i.screenY||0):(this.clientX=void 0!==n.clientX?n.clientX:n.pageX,this.clientY=void 0!==n.clientY?n.clientY:n.pageY,this.screenX=n.screenX||0,this.screenY=n.screenY||0);this.button=n.button;this.key=n.key||"";this.ctrlKey=n.ctrlKey;this.altKey=n.altKey;this.shiftKey=n.shiftKey;this.metaKey=n.metaKey;this.pointerId=n.pointerId||0;this.pointerType="string"==typeof n.pointerType?n.pointerType:aet[n.pointerType]||"";(this.c=n).defaultPrevented&&this.b()}}function dgt(n,t,i,r,u){this.listener=n;this.proxy=null;this.src=t;this.type=i;this.capture=!!r;this.da=u;this.key=++vet;this.Y=this.Z=!1}function dy(n){n.Y=!0;n.listener=null;n.proxy=null;n.src=null;n.da=null}function gy(n){this.src=n;this.a={};this.b=0}function dd(n,t){var r,u,f,i=t.type;i in n.a&&(r=n.a[i],(f=0<=(u=hd(r,t)))&&Array.prototype.splice.call(r,u,1),f&&(dy(t),0==n.a[i].length&&(delete n.a[i],n.b--)))}function gd(n,t,i,r){for(var f,u=0;u<n.length;++u)if(f=n[u],!f.Y&&f.listener==t&&f.capture==!!i&&f.da==r)return u;return-1}function ng(n,t,i,r,u){if(r&&r.once)return function n(t,i,r,u,f){if(Array.isArray(i)){for(var e=0;e<i.length;e++)n(t,i[e],r,u,f);return null}return r=rg(r),t&&t[lh]?t.xa(i,r,kl(u)?!!u.capture:!!u,f):yet(t,i,r,!0,u,f)}(n,t,i,r,u);if(Array.isArray(t)){for(var f=0;f<t.length;f++)ng(n,t[f],i,r,u);return null}return i=rg(i),n&&n[lh]?n.wa(t,i,kl(r)?!!r.capture:!!r,u):yet(n,t,i,!1,r,u)}function yet(n,t,i,r,u,f){var o,h,e,s;if(!t)throw Error("Invalid event type");if(o=kl(u)?!!u.capture:!!u,o&&!kd)return null;if(s=ig(n),s||(n[np]=s=new gy(n)),(i=s.add(t,i,r,o,f)).proxy)return i;if(h=ggt,e=kd?function(n){return h.call(e.src,e.listener,n)}:function(n){if(!(n=h.call(e.src,e.listener,n)))return n},(i.proxy=r=e).src=n,r.listener=i,n.addEventListener)void 0===(u=kgt?u:o)&&(u=!1),n.addEventListener(t.toString(),r,u);else if(n.attachEvent)n.attachEvent(pet(t.toString()),r);else{if(!n.addListener||!n.removeListener)throw Error("addEventListener and attachEvent are unavailable.");n.addListener(r)}return i}function tg(n){var t,i,r;"number"!=typeof n&&n&&!n.Y&&((t=n.src)&&t[lh]?dd(t.c,n):(i=n.type,r=n.proxy,t.removeEventListener?t.removeEventListener(i,r,n.capture):t.detachEvent?t.detachEvent(pet(i),r):t.addListener&&t.removeListener&&t.removeListener(r),(i=ig(t))?(dd(i,n),0==i.b&&(i.src=null,t[np]=null)):dy(n)))}function pet(n){return n in tp?tp[n]:tp[n]="on"+n}function wet(n,t){var i=n.listener,r=n.da||n.src;return n.Z&&tg(n),i.call(r,t)}function ggt(n,t){if(n.Y)return!0;if(kd)return wet(n,new dl(t,this));if(!t)n:{t=["window","event"];for(var i=v,r=0;r<t.length;r++)if(null==(i=i[t[r]])){t=null;break n}t=i}return wet(n,t=new dl(t,this))}function ig(n){return(n=n[np])instanceof gy?n:null}function rg(n){return"function"==typeof n?n:(n[ip]||(n[ip]=function(t){return n.handleEvent(t)}),n[ip])}function fr(){le.call(this);this.c=new gy(this);(this.J=this).D=null}function ai(n,t){var u,i=n.D,f,e,r;if(i)for(u=[];i;i=i.D)u.push(i);if(n=n.J,i=t.type||t,"string"==typeof t?t=new nr(t,n):t instanceof nr?t.target=t.target||n:(r=t,uet(t=new nr(i,n),r)),r=!0,u)for(f=u.length-1;0<=f;f--)e=t.a=u[f],r=rp(e,i,!0,t)&&r;if(r=rp(e=t.a=n,i,!0,t)&&r,r=rp(e,i,!1,t)&&r,u)for(f=0;f<u.length;f++)r=rp(e=t.a=u[f],i,!1,t)&&r}function rp(n,t,i,r){var f,e,o,s,u;if(!(t=n.c.a[String(t)]))return!0;for(t=t.concat(),f=!0,e=0;e<t.length;++e)u=t[e],u&&!u.Y&&u.capture==i&&(o=u.listener,s=u.da||u.src,u.Z&&dd(n.c,u),f=!1!==o.call(s,r)&&f);return f&&!r.defaultPrevented}function bet(){this.b=this.a=null}function ket(n,t){this.c=n;this.f=t;this.b=0;this.a=null}function eg(){this.next=this.b=this.a=null}function det(n,t){var i;ug||(i=v.Promise.resolve(void 0),ug=function(){i.then(nnt)});fp||(ug(),fp=!0);og.add(n,t)}function nnt(){for(var n,t;t=n=void 0,t=null,(n=og).a&&(t=n.a,n.a=n.a.next,n.a||(n.b=null),t.next=null),n=t;){try{n.a.call(n.b)}catch(n){!function(n){v.setTimeout(function(){throw n;},0)}(n)}t=fg;t.f(n);t.b<100&&(t.b++,n.next=t.a,t.a=n)}fp=!1}function ep(n,t){fr.call(this);this.b=n||1;this.a=t||v;this.f=pr(this.eb,this);this.g=ef()}function sg(n){n.aa=!1;n.M&&(n.a.clearTimeout(n.M),n.M=null)}function hg(n,t,i){if("function"==typeof n)i&&(n=pr(n,i));else{if(!n||"function"!=typeof n.handleEvent)throw Error("Invalid listener argument");n=pr(n.handleEvent,n)}return 2147483647<Number(t)?-1:v.setTimeout(n,t||0)}function not(){this.constructor=lg}function sp(n,t){var i=cg.call(this)||this;return i.g=n,i.h=t,i.b=null,i.c=!1,i.a=null,i}function gl(n){le.call(this);this.b=n;this.a={}}function tot(n,t,i,r){var u,f;for(Array.isArray(i)||(i&&(ag[0]=i.toString()),i=ag),u=0;u<i.length;u++){if(f=ng(t,i[u],r||n.handleEvent,!1,n.b||n),!f)break;n.a[f.key]=f}}function iot(n){yd(n.a,function(n,t){this.a.hasOwnProperty(t)&&tg(n)},n);n.a={}}function vg(){this.a=!0}function ah(n,t,i,r){n.info(function(){return"XMLHTTP TEXT ("+t+"): "+function(n,t){var i,e,r,u,f;if(!n.a)return t;if(!t)return null;try{if(i=JSON.parse(t),i)for(n=0;n<i.length;n++)if(Array.isArray(i[n])&&(e=i[n],!(e.length<2)&&(r=e[1],Array.isArray(r)&&!(r.length<1)&&(u=r[0],"noop"!=u&&"stop"!=u&&"close"!=u))))for(f=1;f<r.length;f++)r[f]="";return up(i)}catch(n){return t}}(n,i)+(r?" "+r:"")})}function hp(){return yg=yg||new fr}function rot(n){nr.call(this,ve.Ga,n)}function cp(){var n=hp();ai(n,new rot(n))}function uot(n,t){nr.call(this,ve.STAT_EVENT,n);this.stat=t}function er(n){var t=hp();ai(t,new uot(t,n))}function fot(n){nr.call(this,ve.Ha,n)}function na(n,t){if("function"!=typeof n)throw Error("Fn must not be null and must be a function");return v.setTimeout(function(){n()},t)}function pg(){}function eot(n){return n.b||(n.b=n.c())}function oot(){}function wg(){nr.call(this,"d")}function bg(){nr.call(this,"c")}function lp(){}function ta(n,t,i,r){this.g=n;this.c=t;this.f=i;this.S=r||1;this.J=new gl(this);this.P=tnt;this.R=new ep(n=bd?125:void 0);this.B=null;this.b=!1;this.j=this.l=this.i=this.G=this.u=this.T=this.o=null;this.s=[];this.a=null;this.D=0;this.h=this.m=null;this.N=-1;this.A=!1;this.O=0;this.F=null;this.V=this.C=this.U=this.I=!1}function dg(n,t,i){n.G=1;n.i=bp(kf(t));n.j=i;n.I=!0;cot(n,null)}function cot(n,t){n.u=ef();ia(n);n.l=kf(n.i);var u,f,e,o,s,i,h=n.l,r=n.S;Array.isArray(r)||(r=[String(r)]);bot(h.b,"t",r);n.D=0;n.a=gst(n.g,n.g.C?t:null);0<n.O&&(n.F=new get(pr(n.Da,n,n.a),n.O));tot(n.J,n.a,"readystatechange",n.bb);t=n.B?ret(n.B):{};n.j?(n.m||(n.m="POST"),t["Content-Type"]="application/x-www-form-urlencoded",n.a.ba(n.l,n.m,n.j,t)):(n.m="GET",n.a.ba(n.l,n.m,null,t));cp();u=n.c;f=n.m;e=n.l;o=n.f;s=n.S;i=n.j;u.info(function(){var r,l,t;if(u.a)if(i)for(var n="",c=i.split("&"),h=0;h<c.length;h++)t=c[h].split("="),1<t.length&&(r=t[0],t=t[1],n=2<=(l=r.split("_")).length&&"type"==l[1]?n+(r+"=")+t+"&":n+(r+"=redacted&"));else n=null;else n=i;return"XMLHTTP REQ ("+o+") [attempt "+s+"]: "+f+"\n"+e+"\n"+n})}function lot(n,t,i){for(var o,u,f,r,e=!0;!n.A&&n.D<i.length;){if(r=(r=i,f=u=void 0,u=(o=n).D,-1==(f=r.indexOf("\n",u))?kg:(u=Number(r.substring(u,f)),isNaN(u)?hot:(f+=1)+u>r.length?kg:(r=r.substr(f,u),o.D=f+u,r))),r==kg){4==t&&(n.h=4,er(14),e=!1);ah(n.c,n.f,null,"[Incomplete Response]");break}if(r==hot){n.h=4;er(15);ah(n.c,n.f,i,"[Invalid Chunk]");e=!1;break}ah(n.c,n.f,r,null);gg(n,r)}4==t&&0==i.length&&(n.h=1,er(16),e=!1);n.b=n.b&&e;e?0<i.length&&!n.V&&(n.V=!0,(t=n.g).a==n&&t.U&&!t.F&&(t.c.info("Great, no buffering proxy detected. Bytes received: "+i.length),ln(t),t.F=!0,er(11))):(ah(n.c,n.f,i,"[Invalid Chunked Response]"),vh(n),vp(n))}function ia(n){n.T=ef()+n.P;aot(n,n.P)}function aot(n,t){if(null!=n.o)throw Error("WatchDog timer not null");n.o=na(pr(n.$a,n),t)}function ap(n){n.o&&(v.clearTimeout(n.o),n.o=null)}function vp(n){0==n.g.v||n.A||wst(n.g,n)}function vh(n){ap(n);var t=n.F;t&&"function"==typeof t.ka&&t.ka();n.F=null;sg(n.R);iot(n.J);n.a&&(t=n.a,n.a=null,t.abort(),t.ka())}function gg(n,t){var v,y,c,u,o,l,e,a,s,h,p,i,f,r;try{if(i=n.g,0!=i.v&&(i.a==n||un(i.b,n)))if(i.I=n.N,!n.C&&un(i.b,n)&&3==i.v){try{f=i.la.a.parse(t)}catch(n){f=null}if(Array.isArray(f)&&3==f.length){if(r=f,0==r[0]){n:if(!i.j){if(i.a){if(!(i.a.u+3e3<n.u))break n;tw(i);gp(i)}cn(i);er(18)}}else i.pa=r[1],0<i.pa-i.P&&r[2]<37500&&i.G&&0==i.o&&!i.m&&(i.m=na(pr(i.Xa,i),6e3));if(tst(i.b)<=1&&i.fa){try{i.fa()}catch(n){}i.fa=void 0}}else go(i,11)}else if(!n.C&&i.a!=n||tw(i),!wy(t))for(t=f=i.la.a.parse(t),f=0;f<t.length;f++)r=t[f],i.P=r[0],r=r[1],2==i.v?"c"==r[0]?(i.J=r[1],i.ha=r[2],null!=(v=r[3])&&(i.ia=v,i.c.info("VER="+i.ia)),null!=(y=r[4])&&(i.qa=y,i.c.info("SVER="+i.qa)),null!=(c=r[5])&&"number"==typeof c&&0<c&&(u=1.5*c,i.D=u,i.c.info("backChannelRequestTimeoutMs_="+u)),u=i,(o=n.a)&&(!(l=o.a?o.a.getResponseHeader("X-Client-Wire-Protocol"):null)||!(e=u.b).a&&(ur(l,"spdy")||ur(l,"quic")||ur(l,"h2"))&&(e.f=e.g,e.a=new Set,e.b&&(fn(e,e.b),e.b=null)),!u.A||(a=o.a?o.a.getResponseHeader("X-HTTP-Session-Id"):null)&&(u.oa=a,et(u.B,u.A,a))),i.v=3,i.f&&i.f.ua(),i.U&&(i.N=ef()-n.u,i.c.info("Handshake RTT: "+i.N+"ms")),s=n,(u=i).ma=dst(u,u.C?u.ha:null,u.ga),s.C?(ist(u.b,s),h=s,(p=u.D)&&h.setTimeout(p),h.o&&(ap(h),ia(h)),u.a=s):yst(u),0<i.g.length&&nw(i)):"stop"!=r[0]&&"close"!=r[0]||go(i,7):3==i.v&&("stop"==r[0]||"close"==r[0]?"stop"==r[0]?go(i,7):sn(i):"noop"!=r[0]&&i.f&&i.f.ta(r),i.o=0);cp()}catch(n){}}function nn(n,t){var i,r,f;if(n.forEach&&"function"==typeof n.forEach)n.forEach(t,void 0);else if(sd(n)||"string"==typeof n)cd(n,t,void 0);else{if(n.L&&"function"==typeof n.L)i=n.L();else if(n.K&&"function"==typeof n.K)i=void 0;else if(sd(n)||"string"==typeof n)for(var i=[],u=n.length,r=0;r<u;r++)i.push(r);else for(r in i=[],u=0,n)i[u++]=r;for(r=(u=function(n){if(n.K&&"function"==typeof n.K)return n.K();if("string"==typeof n)return n.split("");if(sd(n)){for(var t=[],r=n.length,i=0;i<r;i++)t.push(n[i]);return t}for(i in t=[],r=0,n)t[r++]=n[i];return t}(n)).length,f=0;f<r;f++)t.call(void 0,u[f],i&&i[f],n)}}function yh(n){var i,t;if(this.b={},this.a=[],this.c=0,i=arguments.length,1<i){if(i%2)throw Error("Uneven number of arguments");for(t=0;t<i;t+=2)this.set(arguments[t],arguments[t+1])}else if(n)if(n instanceof yh)for(i=n.L(),t=0;t<i.length;t++)this.set(i[t],n.get(i[t]));else for(t in n)this.set(t,n[t])}function tn(n){var t,r,u,i;if(n.c!=n.a.length){for(t=0,i=0;t<n.a.length;)r=n.a[t],bo(n.b,r)&&(n.a[i++]=r),t++;n.a.length=i}if(n.c!=n.a.length){for(u={},i=t=0;t<n.a.length;)bo(u,r=n.a[t])||(u[n.a[i++]=r]=1),t++;n.a.length=i}}function bo(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function ko(n,t){var i;this.c=this.j=this.f="";this.h=null;this.i=this.g="";this.a=!1;n instanceof ko?(this.a=void 0!==t?t:n.a,yp(this,n.f),this.j=n.j,pp(this,n.c),wp(this,n.h),this.g=n.g,t=n.b,(i=new fa).c=t.c,t.a&&(i.a=new yh(t.a),i.b=t.b),vot(this,i),this.i=n.i):n&&(i=String(n).match(rn))?(this.a=!!t,yp(this,i[1]||"",!0),this.j=ra(i[2]||""),pp(this,i[3]||"",!0),wp(this,i[4]),this.g=ra(i[5]||"",!0),vot(this,i[6]||"",!0),this.i=ra(i[7]||"")):(this.a=!!t,this.b=new fa(null,this.a))}function kf(n){return new ko(n)}function yp(n,t,i){n.f=i?ra(t,!0):t;n.f&&(n.f=n.f.replace(/:$/,""))}function pp(n,t,i){n.c=i?ra(t,!0):t}function wp(n,t){if(t){if(t=Number(t),isNaN(t)||t<0)throw Error("Bad port number "+t);n.h=t}else n.h=null}function vot(n,t,i){var r,u;t instanceof fa?(n.b=t,r=n.b,(u=n.a)&&!r.f&&(ye(r),r.c=null,r.a.forEach(function(n,t){var i=t.toLowerCase();t!=i&&(pot(this,t),bot(this,i,n))},r)),r.f=u):(i||(t=ua(t,fnt)),n.b=new fa(t,n.a))}function et(n,t,i){n.b.set(t,i)}function bp(n){return et(n,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^ef()).toString(36)),n}function ra(n,t){return n?t?decodeURI(n.replace(/%25/g,"%2525")):decodeURIComponent(n):""}function ua(n,t,i){return"string"==typeof n?(n=encodeURI(n).replace(t,int),n=i?n.replace(/%25([0-9a-fA-F]{2})/g,"%$1"):n):null}function int(n){return"%"+((n=n.charCodeAt(0))>>4&15).toString(16)+(15&n).toString(16)}function fa(n,t){this.b=this.a=null;this.c=n||null;this.f=!!t}function ye(n){n.a||(n.a=new yh,n.b=0,n.c&&function(n,t){var i,f,r,u;if(n)for(n=n.split("&"),i=0;i<n.length;i++)r=n[i].indexOf("="),u=null,0<=r?(f=n[i].substring(0,r),u=n[i].substring(r+1)):f=n[i],t(f,u?decodeURIComponent(u.replace(/\+/g," ")):"")}(n.c,function(t,i){n.add(decodeURIComponent(t.replace(/\+/g," ")),i)}))}function pot(n,t){ye(n);t=ph(n,t);bo(n.a.b,t)&&(n.c=null,n.b-=n.a.get(t).length,bo((n=n.a).b,t)&&(delete n.b[t],n.c--,n.a.length>2*n.c&&tn(n)))}function wot(n,t){return ye(n),t=ph(n,t),bo(n.a.b,t)}function bot(n,t,i){pot(n,t);0<i.length&&(n.c=null,n.a.set(ph(n,t),ld(i)),n.b+=i.length)}function ph(n,t){return t=String(t),t=n.f?t.toLowerCase():t}function dot(n){this.g=n||got;n=v.PerformanceNavigationTiming?0<(n=v.performance.getEntriesByType("navigation")).length&&("hq"==n[0].nextHopProtocol||"h2"==n[0].nextHopProtocol):!!(v.ja&&v.ja.za&&v.ja.za()&&v.ja.za().Qb);this.f=n?this.g:1;this.a=null;1<this.f&&(this.a=new Set);this.b=null;this.c=[]}function nst(n){return n.b||n.a&&n.a.size>=n.f}function tst(n){return n.b?1:n.a?n.a.size:0}function un(n,t){return n.b?n.b==t:n.a&&n.a.has(t)}function fn(n,t){n.a?n.a.add(t):n.b=t}function ist(n,t){n.b&&n.b==t?n.b=null:n.a&&n.a.has(t)&&n.a.delete(t)}function rst(n){var u,f,i,t,e,r;if(null!=n.b)return n.c.concat(n.b.s);if(null==n.a||0===n.a.size)return ld(n.c);r=n.c;try{for(i=gft(n.a.values()),t=i.next();!t.done;t=i.next())e=t.value,r=r.concat(e.s)}catch(n){u={error:n}}finally{try{t&&!t.done&&(f=i.return)&&f.call(i)}finally{if(u)throw u.error;}}return r}function en(){}function ont(){this.a=new en}function kp(n,t,i,r,u){try{t.onload=null;t.onerror=null;t.onabort=null;t.ontimeout=null;u(r)}catch(n){}}function kt(n){fr.call(this);this.headers=new yh;this.l=n||null;this.b=!1;this.u=this.a=null;this.C="";this.h=0;this.f="";this.g=this.B=this.m=this.A=!1;this.s=0;this.o=null;this.I=snt;this.F=this.G=!1}function lnt(n){return"content-type"==n.toLowerCase()}function est(n,t){n.b=!1;n.a&&(n.g=!0,n.a.abort(),n.g=!1);n.f=t;n.h=5;ost(n);dp(n)}function ost(n){n.A||(n.A=!0,ai(n,"complete"),ai(n,"error"))}function sst(n){var i,r,o,t,u,f,e;if(n.b&&void 0!==net&&(!n.u[1]||4!=pe(n)||2!=n.W()))if(n.m&&4==pe(n))hg(n.Aa,0,n);else if(ai(n,"readystatechange"),4==pe(n)){n.b=!1;try{u=n.W();n:switch(u){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:f=!0;break n;default:f=!1}if((i=f)||((r=0===u)&&(!(t=String(n.C).match(rn)[1]||null)&&v.self&&v.self.location&&(t=(o=v.self.location.protocol).substr(0,o.length-1)),r=!hnt.test(t?t.toLowerCase():"")),i=r),i)ai(n,"complete"),ai(n,"success");else{n.h=6;try{e=2<pe(n)?n.a.statusText:""}catch(u){e=""}n.f=e+" ["+n.W()+"]";ost(n)}}finally{dp(n)}}}function dp(n,t){if(n.a){hst(n);var i=n.a,r=n.u[0]?vy:null;n.a=null;n.u=null;t||ai(n,"ready");try{i.onreadystatechange=r}catch(n){}}}function hst(n){n.a&&n.F&&(n.a.ontimeout=null);n.o&&(v.clearTimeout(n.o),n.o=null)}function pe(n){return n.a?n.a.readyState:0}function on(n,t,i){var u,r;n:{for(u in i){u=!1;break n}u=!0}u||(r="",yd(i,function(n,t){r+=t;r+=":";r+=n;r+="\r\n"}),i=r,"string"==typeof n?null!=i&&encodeURIComponent(String(i)):et(n,t,i))}function ea(n,t,i){return i&&i.internalChannelParams&&i.internalChannelParams[n]||t}function cst(n){this.qa=0;this.g=[];this.c=new vg;this.ha=this.ma=this.B=this.ga=this.a=this.oa=this.A=this.V=this.i=this.O=this.l=null;this.Pa=this.R=0;this.Ma=ea("failFast",!1,n);this.G=this.m=this.j=this.h=this.f=null;this.S=!0;this.I=this.pa=this.P=-1;this.T=this.o=this.u=0;this.Ia=ea("baseRetryDelayMs",5e3,n);this.Sa=ea("retryDelaySeedMs",1e4,n);this.Na=ea("forwardChannelMaxRetries",2,n);this.na=ea("forwardChannelRequestTimeoutMs",2e4,n);this.Oa=n&&n.xmlHttpFactory||void 0;this.D=void 0;this.C=n&&n.supportsCrossDomainXhr||!1;this.J="";this.b=new dot(n&&n.concurrentRequestLimit);this.la=new ont;this.ea=n&&n.fastHandshake||!1;this.Ja=n&&n.b||!1;n&&n.f&&(this.c.a=!1);n&&n.forceLongPolling&&(this.S=!1);this.U=!this.ea&&this.S&&n&&n.detectBufferingProxy||!1;this.fa=void 0;this.N=0;this.F=!1;this.s=null;(this.La=n&&n.c||!1)&&this.c.info("Opt-in to enable Chrome Origin Trials.")}function sn(n){var t,i;lst(n);3==n.v&&(t=n.R++,et(i=kf(n.B),"SID",n.J),et(i,"RID",t),et(i,"TYPE","terminate"),oa(n,i),(t=new ta(n,n.c,t,void 0)).G=2,t.i=bp(kf(i)),i=!1,!(i=v.navigator&&v.navigator.sendBeacon?v.navigator.sendBeacon(t.i.toString(),""):i)&&v.Image&&((new Image).src=t.i,i=!0),i||(t.a=gst(t.g,null),t.a.ba(t.i)),t.u=ef(),ia(t));kst(n)}function gp(n){n.a&&(ln(n),n.a.cancel(),n.a=null)}function lst(n){gp(n);n.j&&(v.clearTimeout(n.j),n.j=null);tw(n);n.b.cancel();n.h&&("number"==typeof n.h&&v.clearTimeout(n.h),n.h=null)}function hn(n,t){n.g.push(new kot(n.Pa++,t));3==n.v&&nw(n)}function nw(n){nst(n.b)||n.h||(n.h=!0,det(n.Ca,n),n.u=0)}function ast(n,t){var i=t?t.f:n.R++,r=kf(n.B);et(r,"SID",n.J);et(r,"RID",i);et(r,"AID",n.P);oa(n,r);n.i&&n.l&&on(r,n.i,n.l);i=new ta(n,n.c,i,n.u+1);null===n.i&&(i.B=n.l);t&&(n.g=t.s.concat(n.g));t=vst(n,i,1e3);i.setTimeout(Math.round(.5*n.na)+Math.round(.5*n.na*Math.random()));fn(n.b,i);dg(i,r,t)}function oa(n,t){n.f&&nn({},function(n,i){et(t,i,n)})}function vst(n,t,i){var f,e,r,o,s,u,h,c;i=Math.min(n.g.length,i);f=n.f?pr(n.f.Ka,n.f,n):null;n:for(e=n.g,r=-1;;){for(o=["count="+i],-1==r?0<i?(r=e[0].b,o.push("ofs="+r)):r=0:o.push("ofs="+r),s=!0,u=0;u<i;u++)if(h=e[u].b,c=e[u].a,(h-=r)<0)r=Math.max(0,e[u].b-100),s=!1;else try{!function(n,t,i){var r=i||"";try{nn(n,function(n,i){var u=n;kl(n)&&(u=up(n));t.push(r+i+"="+encodeURIComponent(u))})}catch(n){throw t.push(r+"type="+encodeURIComponent("_badmap")),n;}}(c,o,"req"+h+"_")}catch(n){f&&f(c)}if(s){f=o.join("&");break n}}return n=n.g.splice(0,i),t.s=n,f}function yst(n){n.a||n.j||(n.T=1,det(n.Ba,n),n.o=0)}function cn(n){return!(n.a||n.j||3<=n.o)&&(n.T++,n.j=na(pr(n.Ba,n),bst(n,n.o)),n.o++,1)}function ln(n){null!=n.s&&(v.clearTimeout(n.s),n.s=null)}function pst(n){var t,i;n.a=new ta(n,n.c,"rpc",n.T);null===n.i&&(n.a.B=n.l);n.a.O=0;t=kf(n.ma);et(t,"RID","rpc");et(t,"SID",n.J);et(t,"CI",n.G?"0":"1");et(t,"AID",n.P);oa(n,t);et(t,"TYPE","xmlhttp");n.i&&n.l&&on(t,n.i,n.l);n.D&&n.a.setTimeout(n.D);i=n.a;n=n.ha;i.G=1;i.i=bp(kf(t));i.j=null;i.I=!0;cot(i,n)}function tw(n){null!=n.m&&(v.clearTimeout(n.m),n.m=null)}function wst(n,t){var f,i,e,u=null,r;if(n.a==t)tw(n),ln(n),n.a=null,r=2;else{if(!un(n.b,t))return;u=t.s;ist(n.b,t);r=1}if(n.I=t.N,0!=n.v)if(t.b)1==r?(u=t.j?t.j.length:0,t=ef()-t.u,f=n.u,ai(r=hp(),new fot(r)),nw(n)):yst(n);else if(3==(f=t.h)||0==f&&0<n.I||(1!=r||(e=t,tst((i=n).b)>=i.b.f-(i.h?1:0)||(i.h?(i.g=e.s.concat(i.g),0):1==i.v||2==i.v||i.u>=(i.Ma?0:i.Na)||(i.h=na(pr(i.Ca,i,e),bst(i,i.u)),i.u++,0))))&&(2!=r||!cn(n)))switch(u&&0<u.length&&(t=n.b,t.c=t.c.concat(u)),f){case 1:go(n,5);break;case 4:go(n,10);break;case 3:go(n,6);break;default:go(n,2)}}function bst(n,t){var i=n.Ia+Math.floor(Math.random()*n.Sa);return n.f||(i*=2),i*t}function go(n,t){var f,i,r,u;n.c.info("Error code "+t);2==t?(i=null,n.f&&(i=null),u=pr(n.cb,n),i||(i=new ko("//www.google.com/images/cleardot.gif"),v.location&&"http"==v.location.protocol||yp(i,"https"),bp(i)),f=i.toString(),i=u,u=new vg,v.Image?((r=new Image).onload=py(kp,u,r,"TestLoadImage: loaded",!0,i),r.onerror=py(kp,u,r,"TestLoadImage: error",!1,i),r.onabort=py(kp,u,r,"TestLoadImage: abort",!1,i),r.ontimeout=py(kp,u,r,"TestLoadImage: timeout",!1,i),v.setTimeout(function(){r.ontimeout&&r.ontimeout()},1e4),r.src=f):i(!1)):er(2);n.v=0;n.f&&n.f.sa(t);kst(n);lst(n)}function kst(n){n.v=0;n.I=-1;n.f&&(0==rst(n.b).length&&0==n.g.length||(n.b.c.length=0,ld(n.g),n.g.length=0),n.f.ra())}function dst(n,t,i){var e,o,s,f,r,u=(f=i)instanceof ko?kf(f):new ko(f,void 0);return""!=u.c?(t&&pp(u,t+"."+u.c),wp(u,u.h)):(r=v.location,e=r.protocol,o=t?t+"."+r.hostname:r.hostname,s=+r.port,f=i,r=new ko(null,void 0),e&&yp(r,e),o&&pp(r,o),s&&wp(r,s),f&&(r.g=f),u=r),n.V&&yd(n.V,function(n,t){et(u,t,n)}),t=n.A,i=n.oa,t&&i&&et(u,t,i),et(u,"VER",n.ia),oa(n,u),u}function gst(n,t){if(t&&!n.C)throw Error("Can't create secondary domain capable XhrIo object.");return(t=new kt(n.Oa)).G=n.C,t}function nht(){}function iw(){if(ae&&!(10<=Number(cet)))throw Error("Environmental error: no available transport.");}function wu(n,t){fr.call(this);this.a=new cst(t);this.g=n;this.b=t&&t.messageUrlParams||null;n=t&&t.messageHeaders||null;t&&t.clientProtocolHeaderRequired&&(n?n["X-Client-Protocol"]="webchannel":n={"X-Client-Protocol":"webchannel"});this.a.l=n;n=t&&t.initMessageHeaders||null;t&&t.messageContentType&&(n?n["X-WebChannel-Content-Type"]=t.messageContentType:n={"X-WebChannel-Content-Type":t.messageContentType});t&&t.a&&(n?n["X-WebChannel-Client-Profile"]=t.a:n={"X-WebChannel-Client-Profile":t.a});this.a.O=n;(n=t&&t.httpHeadersOverwriteParam)&&!wy(n)&&(this.a.i=n);this.o=t&&t.supportsCrossDomainXhr||!1;this.m=t&&t.sendRawJson||!1;(t=t&&t.httpSessionIdParam)&&!wy(t)&&(this.a.A=t,null!==(n=this.b)&&t in n&&t in(n=this.b)&&delete n[t]);this.f=new wh(this)}function tht(n){var t,i;if(wg.call(this),t=n.__sm__,t){n:{for(i in t){n=i;break n}n=void 0}(this.c=n)?(n=this.c,this.data=null!==t&&n in t?t[n]:void 0):this.data=t}else this.data=n}function iht(){bg.call(this);this.status=1}function wh(n){this.a=n}function rw(n){this.f=n}function uw(n){fr.call(this);this.u=n;this.h=void 0;this.readyState=fw;this.status=0;this.responseType=this.responseText=this.statusText="";this.onreadystatechange=null;this.l=new Headers;this.b=null;this.s="GET";this.o="";this.a=!1;this.m=this.f=this.g=null}function rht(n){n.f.read().then(n.Ta.bind(n)).catch(n.ca.bind(n))}function sa(n){n.readyState=4;n.g=null;n.f=null;n.m=null;ha(n)}function ha(n){n.onreadystatechange&&n.onreadystatechange.call(n)}function vn(n,t){var i=this;this.previousValue=n;t&&(t.sequenceNumberHandler=function(n){return i.t(n)},this.i=function(n){return t.writeSequenceNumber(n)})}function fht(n,t){var i=this;return(i=uht.call(this,t)||this).code=n,i.message=t,i.name="FirebaseError",i.toString=function(){return i.name+": [code="+i.code+"]: "+i.message},i}function yn(){return bu.logLevel}function e(n){for(var i,r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];bu.logLevel<=nt.DEBUG&&(i=r.map(pn),bu.debug.apply(bu,g(["Firestore (8.6.7): "+n],i)))}function pt(n){for(var i,r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];bu.logLevel<=nt.ERROR&&(i=r.map(pn),bu.error.apply(bu,g(["Firestore (8.6.7): "+n],i)))}function ca(n){for(var i,r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];bu.logLevel<=nt.WARN&&(i=r.map(pn),bu.warn.apply(bu,g(["Firestore (8.6.7): "+n],i)))}function pn(n){if("string"==typeof n)return n;try{return JSON.stringify(n)}catch(t){return n}}function s(n){n="FIRESTORE (8.6.7) INTERNAL ASSERTION FAILED: "+(n=void 0===n?"Unexpected state":n);throw pt(n),new Error(n);}function a(n){n||s()}function eht(){}function w(n,t){return n<t?-1:t<n?1:0}function bh(n,t,i){return n.length===t.length&&n.every(function(n,r){return i(n,t[r])})}function oht(n){return n+"\0"}function of(n){this.timestamp=n}function br(n,i){if(this.seconds=n,(this.nanoseconds=i)<0)throw new u(t.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+i);if(1e9<=i)throw new u(t.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+i);if(n<-62135596800)throw new u(t.INVALID_ARGUMENT,"Timestamp seconds out of range: "+n);if(253402300800<=n)throw new u(t.INVALID_ARGUMENT,"Timestamp seconds out of range: "+n);}function sht(n){var t,i=0;for(t in n)Object.prototype.hasOwnProperty.call(n,t)&&i++;return i}function ns(n,t){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&t(i,n[i])}function hht(n){for(var t in n)if(Object.prototype.hasOwnProperty.call(n,t))return!1;return!0}function sf(n){this.binaryString=n}function dn(n){(this.fields=n).sort(ku.comparator)}function hr(){return null!==bn&&bn.apply(this,arguments)||this}function hf(){return null!==kn&&kn.apply(this,arguments)||this}function ii(n,t,i){void 0===t?t=0:t>n.length&&s();void 0===i?i=n.length-t:i>n.length-t&&s();this.segments=n;this.offset=t;this.len=i}function df(n){if(a(!!n),"string"!=typeof n)return{seconds:wt(n.seconds),nanos:wt(n.nanos)};var i=0,t=cht.exec(n);return a(!!t),t[1]&&(t=((t=t[1])+"000000000").substr(0,9),i=Number(t)),n=new Date(n),{seconds:Math.floor(n.getTime()/1e3),nanos:i}}function wt(n){return"number"==typeof n?n:"string"==typeof n?Number(n):0}function dh(n){return"string"==typeof n?sr.fromBase64String(n):sr.fromUint8Array(n)}function gn(n){return"server_timestamp"===(null===(n=((null===(n=null==n?void 0:n.mapValue)||void 0===n?void 0:n.fields)||{}).__type__)||void 0===n?void 0:n.stringValue)}function la(n){return n=df(n.mapValue.fields.__local_write_time__.timestampValue),new or(n.seconds,n.nanos)}function ts(n){return null==n}function ow(n){return 0===n&&1/n==-1/0}function lht(n){return"number"==typeof n&&Number.isInteger(n)&&!ow(n)&&n<=Number.MAX_SAFE_INTEGER&&n>=Number.MIN_SAFE_INTEGER}function cu(n){this.path=n}function is(n){return"nullValue"in n?0:"booleanValue"in n?1:"integerValue"in n||"doubleValue"in n?2:"timestampValue"in n?3:"stringValue"in n?5:"bytesValue"in n?6:"referenceValue"in n?7:"geoPointValue"in n?8:"arrayValue"in n?9:"mapValue"in n?gn(n)?4:10:s()}function cf(n,t){var r,i,u=is(n);if(u!==is(t))return!1;switch(u){case 0:return!0;case 1:return n.booleanValue===t.booleanValue;case 4:return la(n).isEqual(la(t));case 3:return function(t){if("string"==typeof n.timestampValue&&"string"==typeof t.timestampValue&&n.timestampValue.length===t.timestampValue.length)return n.timestampValue===t.timestampValue;var i=df(n.timestampValue),t=df(t.timestampValue);return i.seconds===t.seconds&&i.nanos===t.nanos}(t);case 5:return n.stringValue===t.stringValue;case 6:return i=t,dh(n.bytesValue).isEqual(dh(i.bytesValue));case 7:return n.referenceValue===t.referenceValue;case 8:return r=t,wt((i=n).geoPointValue.latitude)===wt(r.geoPointValue.latitude)&&wt(i.geoPointValue.longitude)===wt(r.geoPointValue.longitude);case 2:return function(n,t){return"integerValue"in n&&"integerValue"in t?wt(n.integerValue)===wt(t.integerValue):"doubleValue"in n&&"doubleValue"in t?(n=wt(n.doubleValue),t=wt(t.doubleValue),n===t?ow(n)===ow(t):isNaN(n)&&isNaN(t)):!1}(n,t);case 9:return bh(n.arrayValue.values||[],t.arrayValue.values||[],cf);case 10:return function(){var i,r=n.mapValue.fields||{},u=t.mapValue.fields||{};if(sht(r)!==sht(u))return!1;for(i in r)if(r.hasOwnProperty(i)&&(void 0===u[i]||!cf(r[i],u[i])))return!1;return!0}();default:return s()}}function aa(n,t){return void 0!==(n.values||[]).find(function(n){return cf(n,t)})}function gh(n,t){var u,i,r,f=is(n),e=is(t);if(f!==e)return w(f,e);switch(f){case 0:return 0;case 1:return w(n.booleanValue,t.booleanValue);case 2:return i=t,r=wt(n.integerValue||n.doubleValue),i=wt(i.integerValue||i.doubleValue),r<i?-1:i<r?1:r===i?0:isNaN(r)?isNaN(i)?0:-1:1;case 3:return aht(n.timestampValue,t.timestampValue);case 4:return aht(la(n),la(t));case 5:return w(n.stringValue,t.stringValue);case 6:return function(n,t){return n=dh(n),t=dh(t),n.compareTo(t)}(n.bytesValue,t.bytesValue);case 7:return function(n,t){for(var f,r=n.split("/"),u=t.split("/"),i=0;i<r.length&&i<u.length;i++)if(f=w(r[i],u[i]),0!==f)return f;return w(r.length,u.length)}(n.referenceValue,t.referenceValue);case 8:return u=n.geoPointValue,r=t.geoPointValue,0!==(i=w(wt(u.latitude),wt(r.latitude)))?i:w(wt(u.longitude),wt(r.longitude));case 9:return function(n,t){for(var f,r=n.values||[],u=t.values||[],i=0;i<r.length&&i<u.length;++i)if(f=gh(r[i],u[i]),f)return f;return w(r.length,u.length)}(n.arrayValue,t.arrayValue);case 10:return function(n,t){var e=n.fields||{},r=Object.keys(e),o=t.fields||{},u=Object.keys(o),i,f;for(r.sort(),u.sort(),i=0;i<r.length&&i<u.length;++i)if((f=w(r[i],u[i]),0!==f)||(f=gh(e[r[i]],o[u[i]]),0!==f))return f;return w(r.length,u.length)}(n.mapValue,t.mapValue);default:throw s();}}function aht(n,t){if("string"==typeof n&&"string"==typeof t&&n.length===t.length)return w(n,t);var i=df(n),n=df(t),t=w(i.seconds,n.seconds);return 0!==t?t:w(i.nanos,n.nanos)}function ntt(n){return function t(n){return"nullValue"in n?"null":"booleanValue"in n?""+n.booleanValue:"integerValue"in n?""+n.integerValue:"doubleValue"in n?""+n.doubleValue:"timestampValue"in n?function(n){return n=df(n),"time("+n.seconds+","+n.nanos+")"}(n.timestampValue):"stringValue"in n?n.stringValue:"bytesValue"in n?dh(n.bytesValue).toBase64():"referenceValue"in n?(i=n.referenceValue,h.fromName(i).toString()):"geoPointValue"in n?"geo("+(i=n.geoPointValue).latitude+","+i.longitude+")":"arrayValue"in n?function(n){for(var i="[",u=!0,r=0,f=n.values||[];r<f.length;r++)u?u=!1:i+=",",i+=t(f[r]);return i+"]"}(n.arrayValue):"mapValue"in n?function(n){for(var u,i="{",f=!0,r=0,e=Object.keys(n.fields||{}).sort();r<e.length;r++)u=e[r],f?f=!1:i+=",",i+=u+":"+t(n.fields[u]);return i+"}"}(n.mapValue):s();var i}(n)}function sw(n,t){return{referenceValue:"projects/"+n.projectId+"/databases/"+n.database+"/documents/"+t.path.canonicalString()}}function ttt(n){return n&&"integerValue"in n}function itt(n){return!!n&&"arrayValue"in n}function vht(n){return n&&"nullValue"in n}function yht(n){return n&&"doubleValue"in n&&isNaN(Number(n.doubleValue))}function hw(n){return n&&"mapValue"in n}function va(n){var i,r,t;if(n.geoPointValue)return{geoPointValue:Object.assign({},n.geoPointValue)};if(n.timestampValue)return{timestampValue:Object.assign({},df(n.timestampValue))};if(n.mapValue)return i={mapValue:{fields:{}}},ns(n.mapValue.fields,function(n,t){return i.mapValue.fields[n]=va(t)}),i;if(n.arrayValue){for(r={arrayValue:{values:[]}},t=0;t<(n.arrayValue.values||[]).length;++t)r.arrayValue.values[t]=va(n.arrayValue.values[t]);return r}return Object.assign({},n)}function lu(n){this.value=n}function ut(n,t,i,r,u){this.key=n;this.documentType=t;this.version=i;this.data=r;this.documentState=u}function wht(n,t,i,r,u,f,e){return new pht(n,t=void 0===t?null:t,i=void 0===i?[]:i,r=void 0===r?[]:r,u=void 0===u?null:u,f=void 0===f?null:f,e=void 0===e?null:e)}function ya(n){var t=n;return null===t.h&&(n=t.path.canonicalString(),null!==t.collectionGroup&&(n+="|cg:"+t.collectionGroup),n+="|f:",n+=t.filters.map(function(n){return(n=n).field.canonicalString()+n.op.toString()+ntt(n.value)}).join(","),n+="|ob:",n+=t.orderBy.map(function(n){return(n=n).field.canonicalString()+n.dir}).join(","),ts(t.limit)||(n+="|l:",n+=t.limit),t.startAt&&(n+="|lb:",n+=aw(t.startAt)),t.endAt&&(n+="|ub:",n+=aw(t.endAt)),t.h=n),t.h}function cw(n,t){var e,o,i,u,f,r;if(n.limit!==t.limit||n.orderBy.length!==t.orderBy.length)return!1;for(i=0;i<n.orderBy.length;i++)if(e=n.orderBy[i],o=t.orderBy[i],e.dir!==o.dir||!e.field.isEqual(o.field))return!1;if(n.filters.length!==t.filters.length)return!1;for(r=0;r<n.filters.length;r++)if(u=n.filters[r],f=t.filters[r],u.op!==f.op||!u.field.isEqual(f.field)||!cf(u.value,f.value))return!1;return n.collectionGroup===t.collectionGroup&&!!n.path.isEqual(t.path)&&!!ect(n.startAt,t.startAt)&&ect(n.endAt,t.endAt)}function lw(n){return h.isDocumentKey(n.path)&&null===n.collectionGroup&&0===n.filters.length}function we(n,t,i){var r=this;return(r=bht.call(this)||this).field=n,r.op=t,r.value=i,r}function rtt(n,t){var i=this;return(i=kht.call(this,n,"not-in",t)||this).keys=nct(0,t),i}function utt(n,t){var i=this;return(i=dht.call(this,n,"in",t)||this).keys=nct(0,t),i}function ftt(n,t,i){var r=this;return(r=ght.call(this,n,t,i)||this).key=h.fromName(i.referenceValue),r}function nct(n,t){return((null===(t=t.arrayValue)||void 0===t?void 0:t.values)||[]).map(function(n){return h.fromName(n.referenceValue)})}function ett(n,t){return tct.call(this,n,"array-contains-any",t)||this}function ott(n,t){return ict.call(this,n,"not-in",t)||this}function stt(n,t){return rct.call(this,n,"in",t)||this}function htt(n,t){return uct.call(this,n,"array-contains",t)||this}function aw(n){return(n.before?"b":"a")+":"+n.position.map(ntt).join(",")}function fct(n,t,i){for(var r=0,u=0;u<n.position.length;u++){var f=t[u],e=n.position[u],r=f.field.isKeyField()?h.comparator(h.fromName(e.referenceValue),i.key):gh(e,i.data.field(f.field));if("desc"===f.dir&&(r*=-1),0!==r)break}return n.before?r<=0:r<0}function ect(n,t){if(null===n)return null===t;if(null===t||n.before!==t.before||n.position.length!==t.position.length)return!1;for(var i=0;i<n.position.length;i++)if(!cf(n.position[i],t.position[i]))return!1;return!0}function oct(n,t,i,r,u,f,e,o){return new lf(n,t,i,r,u,f,e,o)}function nc(n){return new lf(n)}function vw(n){return!ts(n.limit)&&"F"===n.limitType}function yw(n){return!ts(n.limit)&&"L"===n.limitType}function ctt(n){return 0<n.explicitOrderBy.length?n.explicitOrderBy[0].field:null}function ltt(n){for(var r,t=0,i=n.filters;t<i.length;t++)if(r=i[t],r.g())return r.field;return null}function att(n){return null!==n.collectionGroup}function tc(n){var t=n,i,n,u;if(null===t.p)if(t.p=[],i=ltt(t),n=ctt(t),null!==i&&null===n)i.isKeyField()||t.p.push(new rs(i)),t.p.push(new rs(ku.keyField(),"asc"));else{for(var f=!1,r=0,e=t.explicitOrderBy;r<e.length;r++)u=e[r],t.p.push(u),u.field.isKeyField()&&(f=!0);f||(i=0<t.explicitOrderBy.length?t.explicitOrderBy[t.explicitOrderBy.length-1].dir:"asc",t.p.push(new rs(ku.keyField(),i)))}return t.p}function au(n){var t=n,r,e,o,n;if(!t.T)if("F"===t.limitType)t.T=wht(t.path,t.collectionGroup,tc(t),t.filters,t.limit,t.startAt,t.endAt);else{for(var u=[],i=0,f=tc(t);i<f.length;i++)r=f[i],e="desc"===r.dir?"asc":"desc",u.push(new rs(r.field,e));o=t.endAt?new pa(t.endAt.position,!t.endAt.before):null;n=t.startAt?new pa(t.startAt.position,!t.startAt.before):null;t.T=wht(t.path,t.collectionGroup,u,t.filters,t.limit,o,n)}return t.T}function sct(n,t,i){return new lf(n.path,n.collectionGroup,n.explicitOrderBy.slice(),n.filters.slice(),t,i,n.startAt,n.endAt)}function wa(n,t){return cw(au(n),au(t))&&n.limitType===t.limitType}function hct(n){return ya(au(n))+"|lt:"+n.limitType}function vtt(n){return"Query(target="+(t=au(n),i=t.path.canonicalString(),null!==t.collectionGroup&&(i+=" collectionGroup="+t.collectionGroup),0<t.filters.length&&(i+=", filters: ["+t.filters.map(function(n){return(n=n).field.canonicalString()+" "+n.op+" "+ntt(n.value)}).join(", ")+"]"),ts(t.limit)||(i+=", limit: "+t.limit),0<t.orderBy.length&&(i+=", orderBy: ["+t.orderBy.map(function(n){return(n=n).field.canonicalString()+" ("+n.dir+")"}).join(", ")+"]"),t.startAt&&(i+=", startAt: "+aw(t.startAt)),t.endAt&&(i+=", endAt: "+aw(t.endAt)),"Target("+i+")")+"; limitType="+n.limitType+")";var t,i}function ba(n,t){return t.isFoundDocument()&&(i=n,r=t.key.path,null!==i.collectionGroup?t.key.hasCollectionId(i.collectionGroup)&&i.path.isPrefixOf(r):h.isDocumentKey(i.path)?i.path.isEqual(r):i.path.isImmediateParentOf(r))&&function(t){for(var u,i=0,r=n.explicitOrderBy;i<r.length;i++)if(u=r[i],!u.field.isKeyField()&&null===t.data.field(u.field))return;return 1}(t)&&function(t){for(var i=0,r=n.filters;i<r.length;i++)if(!r[i].matches(t))return;return 1}(t)&&(r=t,(!(t=n).startAt||fct(t.startAt,tc(t),r))&&(!t.endAt||!fct(t.endAt,tc(t),r)));var i,r}function cct(n){return function(t,i){for(var u,f,e=!1,r=0,o=tc(n);r<o.length;r++){if(u=o[r],f=function(n,t,i){var r=n.field.isKeyField()?h.comparator(t.key,i.key):function(n,i){var r=t.data.field(n),n=i.data.field(n);return null!==r&&null!==n?gh(r,n):s()}(n.field,i);switch(n.dir){case"asc":return r;case"desc":return-1*r;default:return s()}}(u,t,i),0!==f)return f;e=e||u.field.isKeyField()}return 0}}function lct(n,t){if(n.I){if(isNaN(t))return{doubleValue:"NaN"};if(t===1/0)return{doubleValue:"Infinity"};if(t===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:ow(t)?"-0":t}}function act(n){return{integerValue:""+n}}function vct(n,t){return lht(t)?act(t):lct(n,t)}function yct(n,t){return n instanceof fs?ttt(n=t)||n&&"doubleValue"in n?t:{integerValue:0}:null}function wct(n){var t=this;return(t=pct.call(this)||this).elements=n,t}function bct(){return null!==ytt&&ytt.apply(this,arguments)||this}function kct(n,t){for(var i=ult(t),r=0,u=n.elements;r<u.length;r++)!function(n){i.some(function(t){return cf(t,n)})||i.push(n)}(u[r]);return{arrayValue:{values:i}}}function gct(n){var t=this;return(t=dct.call(this)||this).elements=n,t}function nlt(n,t){for(var i=ult(t),r=0,u=n.elements;r<u.length;r++)!function(n){i=i.filter(function(t){return!cf(t,n)})}(u[r]);return{arrayValue:{values:i}}}function ilt(n,t){var i=this;return(i=tlt.call(this)||this).R=n,i.A=t,i}function rlt(n){return wt(n.integerValue||n.doubleValue)}function ult(n){return itt(n)&&n.arrayValue.values?n.arrayValue.values.slice():[]}function eti(n,t){this.version=n;this.transformResults=t}function gf(n,t){this.updateTime=n;this.exists=t}function pw(n,t){return void 0!==n.updateTime?t.isFoundDocument()&&t.version.isEqual(n.updateTime):void 0===n.exists||n.exists===t.isFoundDocument()}function ptt(n,t,i){var e,r,u,f;n instanceof rc?(r=t,u=i,pw((e=n).precondition,r)&&(f=e.value.clone(),u=vlt(e.fieldTransforms,u,r),f.setAll(u),r.convertToFoundDocument(elt(r),f).setHasLocalMutations())):n instanceof ne?(u=t,r=i,pw((f=n).precondition,u)&&(i=vlt(f.fieldTransforms,r,u),(r=u.data).setAll(llt(f)),r.setAll(i),u.convertToFoundDocument(elt(u),r).setHasLocalMutations())):(t=t,pw(n.precondition,t)&&t.convertToNoDocument(y.min()))}function flt(n,t){return n.type===t.type&&!!n.key.isEqual(t.key)&&!!n.precondition.isEqual(t.precondition)&&(i=n.fieldTransforms,r=t.fieldTransforms,!!(void 0===i&&void 0===r||i&&r&&bh(i,r,function(n,t){return t=t,(n=n).field.isEqual(t.field)&&(n=n.transform,t=t.transform,n instanceof be&&t instanceof be||n instanceof ke&&t instanceof ke?bh(n.elements,t.elements,cf):n instanceof fs&&t instanceof fs?cf(n.A,t.A):n instanceof us&&t instanceof us)})))&&(0===n.type?n.value.isEqual(t.value):1!==n.type||n.data.isEqual(t.data)&&n.fieldMask.isEqual(t.fieldMask));var i,r}function elt(n){return n.isFoundDocument()?n.version:y.min()}function hlt(n,t,i,r,u){void 0===u&&(u=[]);var f=this;return(f=olt.call(this)||this).key=n,f.data=t,f.fieldMask=i,f.precondition=r,f.fieldTransforms=u,f.type=1,f}function clt(n,t,i,r){void 0===r&&(r=[]);var u=this;return(u=slt.call(this)||this).key=n,u.value=t,u.precondition=i,u.fieldTransforms=r,u.type=0,u}function llt(n){var t=new Map;return n.fieldMask.fields.forEach(function(i){var r;i.isEmpty()||(r=n.data.field(i),t.set(i,r))}),t}function alt(n,t,i){var o=new Map,u;for(a(n.length===i.length),u=0;u<i.length;u++){var r=n[u],f=r.transform,e=t.data.field(r.field);o.set(r.field,(r=f,f=e,e=i[u],r instanceof be?kct(r,f):r instanceof ke?nlt(r,f):e))}return o}function vlt(n,t,i){for(var u,s=new Map,o=0,h=n;o<h.length;o++){var e=h[o],r=e.transform,f=i.data.field(e.field);s.set(e.field,(u=f,e=t,f=void 0,(r=r)instanceof us?(f={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:e.seconds,nanos:e.nanoseconds}}}},u&&(f.fields.__previous_value__=u),{mapValue:f}):r instanceof be?kct(r,u):r instanceof ke?nlt(r,u):(r=yct(f=r,u),u=rlt(r)+rlt(f.A),ttt(r)&&ttt(f.A)?act(u):lct(f.R,u))))}return s}function oti(n){this.count=n}function wlt(n,t){var i=this;return(i=ylt.call(this)||this).key=n,i.precondition=t,i.type=3,i.fieldTransforms=[],i}function blt(n,t){var i=this;return(i=plt.call(this)||this).key=n,i.precondition=t,i.type=2,i.fieldTransforms=[],i}function klt(n){switch(n){case t.OK:return s(),0;case t.CANCELLED:case t.UNKNOWN:case t.DEADLINE_EXCEEDED:case t.RESOURCE_EXHAUSTED:case t.INTERNAL:case t.UNAVAILABLE:case t.UNAUTHENTICATED:return;case t.INVALID_ARGUMENT:case t.NOT_FOUND:case t.ALREADY_EXISTS:case t.PERMISSION_DENIED:case t.FAILED_PRECONDITION:case t.ABORTED:case t.OUT_OF_RANGE:case t.UNIMPLEMENTED:case t.DATA_LOSS:return 1;default:return s(),0}}function dlt(n){if(void 0===n)return pt("GRPC error has no .code"),t.UNKNOWN;switch(n){case bt.OK:return t.OK;case bt.CANCELLED:return t.CANCELLED;case bt.UNKNOWN:return t.UNKNOWN;case bt.DEADLINE_EXCEEDED:return t.DEADLINE_EXCEEDED;case bt.RESOURCE_EXHAUSTED:return t.RESOURCE_EXHAUSTED;case bt.INTERNAL:return t.INTERNAL;case bt.UNAVAILABLE:return t.UNAVAILABLE;case bt.UNAUTHENTICATED:return t.UNAUTHENTICATED;case bt.INVALID_ARGUMENT:return t.INVALID_ARGUMENT;case bt.NOT_FOUND:return t.NOT_FOUND;case bt.ALREADY_EXISTS:return t.ALREADY_EXISTS;case bt.PERMISSION_DENIED:return t.PERMISSION_DENIED;case bt.FAILED_PRECONDITION:return t.FAILED_PRECONDITION;case bt.ABORTED:return t.ABORTED;case bt.OUT_OF_RANGE:return t.OUT_OF_RANGE;case bt.UNIMPLEMENTED:return t.UNIMPLEMENTED;case bt.DATA_LOSS:return t.DATA_LOSS;default:return s()}}function it(n,t,i,r,u){this.key=n;this.value=t;this.color=null!=i?i:it.RED;this.left=null!=r?r:it.EMPTY;this.right=null!=u?u:it.EMPTY;this.size=this.left.size+1+this.right.size}function kw(n,t,i,r){this.isReverse=r;this.nodeStack=[];for(var u=1;!n.isEmpty();)if(u=t?i(n.key,t):1,r&&(u*=-1),u<0)n=this.isReverse?n.left:n.right;else{if(0===u){this.nodeStack.push(n);break}this.nodeStack.push(n);n=this.isReverse?n.right:n.left}}function dt(n,t){this.comparator=n;this.root=t||de.EMPTY}function pi(){this.size=0}function wtt(n){this.iter=n}function ct(n){this.comparator=n;this.data=new tr(this.comparator)}function tt(){for(var f,i,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var i=sti,r=0,u=t;r<u.length;r++)f=u[r],i=i.add(f);return i}function wi(n){this.W=n;this.G=new Map;this.H=vu;this.J=uat();this.Y=new gt(w)}function uu(){this.S=0;this.D=fat();this.C=sr.EMPTY_BYTE_STRING;this.N=!1;this.F=!0}function gtt(n,t,i,r,u){this.resumeToken=n;this.current=t;this.addedDocuments=i;this.modifiedDocuments=r;this.removedDocuments=u}function nit(n,t,i,r,u){this.snapshotVersion=n;this.targetChanges=t;this.targetMismatches=i;this.documentUpdates=r;this.resolvedLimboDocuments=u}function uat(){return new tr(h.comparator)}function fat(){return new tr(h.comparator)}function ka(n,t){return n.I?new Date(1e3*t.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")+"."+("000000000"+t.nanoseconds).slice(-9)+"Z":{seconds:""+t.seconds,nanos:t.nanoseconds}}function eat(n,t){return n.I?t.toBase64():t.toUint8Array()}function ui(n){return a(!!n),y.fromTimestamp((n=df(n),new or(n.seconds,n.nanos)))}function tit(n,t){return new k(["projects",n.projectId,"databases",n.database]).child("documents").child(t).canonicalString()}function oat(n){return n=k.fromString(n),a(kat(n)),n}function da(n,t){return tit(n.databaseId,t.path)}function af(n,i){if(i=oat(i),i.get(1)!==n.databaseId.projectId)throw new u(t.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+i.get(1)+" vs "+n.databaseId.projectId);if(i.get(3)!==n.databaseId.database)throw new u(t.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+i.get(3)+" vs "+n.databaseId.database);return new h(hat(i))}function iit(n,t){return tit(n.databaseId,t)}function sat(n){return n=oat(n),4===n.length?k.emptyPath():hat(n)}function ga(n){return new k(["projects",n.databaseId.projectId,"databases",n.databaseId.database]).canonicalString()}function hat(n){return a(4<n.length&&"documents"===n.get(4)),n.popFirst(5)}function cat(n,t,i){return{name:da(n,t),fields:i.value.mapValue.fields}}function lat(n,t,i){var r=af(n,t.name),n=ui(t.updateTime),t=new kr({mapValue:{fields:t.fields}}),t=ri.newFoundDocument(r,n,t);return i&&t.setHasCommittedMutations(),i?t.setHasCommittedMutations():t}function nb(n,t){var i,u,r;if(t instanceof rc)i={update:cat(n,t.key,t.value)};else if(t instanceof uc)i={"delete":da(n,t.key)};else if(t instanceof ne)i={update:cat(n,t.key,t.data),updateMask:(u=t.fieldMask,r=[],u.fields.forEach(function(n){return r.push(n.canonicalString())}),{fieldPaths:r})};else{if(!(t instanceof ww))return s();i={verify:da(n,t.key)}}return 0<t.fieldTransforms.length&&(i.updateTransforms=t.fieldTransforms.map(function(n){var t=n.transform;if(t instanceof us)return{fieldPath:n.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(t instanceof be)return{fieldPath:n.field.canonicalString(),appendMissingElements:{values:t.elements}};if(t instanceof ke)return{fieldPath:n.field.canonicalString(),removeAllFromArray:{values:t.elements}};if(t instanceof fs)return{fieldPath:n.field.canonicalString(),increment:t.A};throw s();})),t.precondition.isNone||(i.currentDocument=void 0!==(t=t.precondition).updateTime?{updateTime:ka(n,t.updateTime.toTimestamp())}:void 0!==t.exists?{exists:t.exists}:s()),i}function aat(n,t){var r=t.currentDocument?void 0!==(i=t.currentDocument).updateTime?yi.updateTime(ui(i.updateTime)):void 0!==i.exists?yi.exists(i.exists):yi.none():yi.none(),u=t.updateTransforms?t.updateTransforms.map(function(t){return function(n,t){var r,i=null;return"setToServerValue"in t?(a("REQUEST_TIME"===t.setToServerValue),i=new us):"appendMissingElements"in t?(r=t.appendMissingElements.values||[],i=new be(r)):"removeAllFromArray"in t?(r=t.removeAllFromArray.values||[],i=new ke(r)):"increment"in t?i=new fs(n,t.increment):s(),t=ku.fromServerFormat(t.fieldPath),new ic(t,i)}(n,t)}):[],f,e,i;return t.update?(t.update.name,f=af(n,t.update.name),e=new kr({mapValue:{fields:t.update.fields}}),t.updateMask)?(i=(i=t.updateMask.fieldPaths||[],new kh(i.map(function(n){return ku.fromServerFormat(n)}))),new ne(f,e,i,r,u)):new rc(f,e,r,u):t.delete?(u=af(n,t.delete),new uc(u,r)):t.verify?(t=af(n,t.verify),new ww(t,r)):s()}function vat(n,t){return{documents:[iit(n,t.path)]}}function yat(n,t){var r={structuredQuery:{}},i=t.path;return null!==t.collectionGroup?(r.parent=iit(n,i),r.structuredQuery.from=[{collectionId:t.collectionGroup,allDescendants:!0}]):(r.parent=iit(n,i.popLast()),r.structuredQuery.from=[{collectionId:i.lastSegment()}]),i=function(n){if(0!==n.length)return n=n.map(function(n){if("=="===n.op){if(yht(n.value))return{unaryFilter:{field:fc(n.field),op:"IS_NAN"}};if(vht(n.value))return{unaryFilter:{field:fc(n.field),op:"IS_NULL"}}}else if("!="===n.op){if(yht(n.value))return{unaryFilter:{field:fc(n.field),op:"IS_NOT_NAN"}};if(vht(n.value))return{unaryFilter:{field:fc(n.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:fc(n.field),op:(t=n.op,lti[t]),value:n.value}};var t}),1===n.length?n[0]:{compositeFilter:{op:"AND",filters:n}}}(t.filters),i&&(r.structuredQuery.where=i),i=function(n){if(0!==n.length)return n.map(function(n){return{field:fc((n=n).field),direction:(n=n.dir,cti[n])}})}(t.orderBy),i&&(r.structuredQuery.orderBy=i),i=t.limit,i=n.I||ts(i)?i:{value:i},null!==i&&(r.structuredQuery.limit=i),t.startAt&&(r.structuredQuery.startAt=wat(t.startAt)),t.endAt&&(r.structuredQuery.endAt=wat(t.endAt)),r}function pat(n){var u=sat(n.parent),t=n.structuredQuery,f=t.from?t.from.length:0,e=null,i;0<f&&(a(1===f),(r=t.from[0]).allDescendants?e=r.collectionId:u=u.child(r.collectionId));i=[];t.where&&(i=function u(n){return n?void 0!==n.unaryFilter?[yti(n)]:void 0!==n.fieldFilter?[vti(n)]:void 0!==n.compositeFilter?n.compositeFilter.filters.map(function(n){return u(n)}).reduce(function(n,t){return n.concat(t)}):s():[]}(t.where));var o=[],n=null,f=null,r=null;return oct(u,e,o=t.orderBy?t.orderBy.map(function(n){return new rs(ec((t=n).field),function(){switch(t.direction){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}());var t}):o,i,n=t.limit?ts(i="object"==typeof(i=t.limit)?i.value:i)?null:i:n,"F",f=t.startAt?bat(t.startAt):f,r=t.endAt?bat(t.endAt):r)}function wat(n){return{before:n.before,values:n.position}}function bat(n){var t=!!n.before,n=n.values||[];return new pa(n,t)}function fc(n){return{fieldPath:n.canonicalString()}}function ec(n){return ku.fromServerFormat(n.fieldPath)}function vti(n){return dr.create(ec(n.fieldFilter.field),function(){switch(n.fieldFilter.op){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";case"OPERATOR_UNSPECIFIED":default:return s()}}(),n.fieldFilter.value)}function yti(n){var t,i;switch(n.unaryFilter.op){case"IS_NAN":return t=ec(n.unaryFilter.field),dr.create(t,"==",{doubleValue:NaN});case"IS_NULL":return t=ec(n.unaryFilter.field),dr.create(t,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":return i=ec(n.unaryFilter.field),dr.create(i,"!=",{doubleValue:NaN});case"IS_NOT_NULL":return i=ec(n.unaryFilter.field),dr.create(i,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":default:return s()}}function kat(n){return 4<=n.length&&"projects"===n.get(0)&&"databases"===n.get(2)}function du(n){for(var t="",i=0;i<n.length;i++)0<t.length&&(t=dat(t)),t=function(n,t){for(var u,i=t,f=n.length,r=0;r<f;r++){u=n.charAt(r);switch(u){case"\0":i+="\x01\x10";break;case"\x01":i+="\x01\x11";break;default:i+=u}}return i}(n.get(i),t);return dat(t)}function dat(n){return n+"\x01\x01"}function te(n){var u=n.length,t,e,f;if(a(2<=u),2===u)return a("\x01"===n.charAt(0)&&"\x01"===n.charAt(1)),k.emptyPath();for(var h=u-2,o=[],i="",r=0;r<u;){t=n.indexOf("\x01",r);switch((t<0||h<t)&&s(),n.charAt(t+1)){case"\x01":e=n.substring(r,t);f=void 0;0===i.length?f=e:(f=i+=e,i="");o.push(f);break;case"\x10":i+=n.substring(r,t);i+="\0";break;case"\x11":i+=n.substring(r,t+1);break;default:s()}r=t+2}return new k(o)}function fu(n,t,i){this.ownerId=n;this.allowTabSynchronization=t;this.leaseTimestampMs=i}function ge(n,t,i){this.userId=n;this.lastAcknowledgedBatchId=t;this.lastStreamToken=i}function ft(n,t,i,r,u){this.userId=n;this.batchId=t;this.localWriteTimeMs=i;this.baseMutations=r;this.mutations=u}function tb(){}function pti(n,t){this.path=n;this.readTime=t}function wti(n,t){this.path=n;this.version=t}function vf(n){this.byteSize=n}function gr(n,t,i,r,u,f,e){this.targetId=n;this.canonicalId=t;this.readTime=i;this.resumeToken=r;this.lastListenSequenceNumber=u;this.lastLimboFreeSnapshotVersion=f;this.query=e}function eu(n,t,i,r){this.highestTargetId=n;this.highestListenSequenceNumber=t;this.lastRemoteSnapshotVersion=i;this.targetCount=r}function es(n,t){this.collectionId=n;this.parent=t}function ie(n,t,i,r){this.clientId=n;this.updateTimeMs=t;this.networkEnabled=i;this.inForeground=r}function oc(n,t,i){this.bundleId=n;this.createTime=t;this.version=i}function sc(n,t,i){this.name=n;this.readTime=t;this.bundledQuery=i}function rvt(n,i){var r=this;return(r=nvt.call(this,t.UNAVAILABLE,"IndexedDB transaction '"+n+"' failed: "+i)||this).name="IndexedDbTransactionError",r}function os(n){this.Pt=n;this.Vt=!1;this.St=null}function lr(n,t,i){this.name=n;this.version=t;this.wt=i;12.2===lr._t(wo())&&pt("Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.")}function cc(n,t){var i=this;this.action=n;this.transaction=t;this.aborted=!1;this.ft=new cr;this.transaction.oncomplete=function(){i.ft.resolve()};this.transaction.onabort=function(){t.error?i.ft.reject(new nv(n,t.error)):i.ft.resolve()};this.transaction.onerror=function(t){t=fit(t.target.error);i.ft.reject(new nv(n,t))}}function st(n){var t=this;this.nextCallback=null;this.catchCallback=null;this.result=void 0;this.error=void 0;this.isDone=!1;this.callbackAttached=!1;n(function(n){t.isDone=!0;t.result=n;t.nextCallback&&t.nextCallback(n)},function(n){t.isDone=!0;t.error=n;t.catchCallback&&t.catchCallback(n)})}function rit(){this.onCommittedListeners=[]}function ss(n){return"IndexedDbTransactionError"===n.name}function ou(n){this.store=n}function hs(n){return new f(function(t,i){n.onsuccess=function(n){n=n.target.result;t(n)};n.onerror=function(n){n=fit(n.target.error);i(n)}})}function fit(n){var t=hc._t(wo()),i;return 12.2<=t&&t<13&&(t="An internal error was encountered in the Indexed Database server",0<=n.message.indexOf(t))?(i=new u("internal","IOS_INDEXEDDB_BUG1: IndexedDb has thrown '"+t+"'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround."),uit||(uit=!0,setTimeout(function(){throw i;},0)),i):n}function evt(n,t){var i=this;return(i=fvt.call(this)||this).Mt=n,i.currentSequenceNumber=t,i}function nu(n,t){return hc.It(n.Mt,t)}function cs(n,t,i,r,u,f,e){void 0===u&&(u=y.min());void 0===f&&(f=y.min());void 0===e&&(e=sr.EMPTY_BYTE_STRING);this.target=n;this.targetId=t;this.purpose=i;this.sequenceNumber=r;this.snapshotVersion=u;this.lastLimboFreeSnapshotVersion=f;this.resumeToken=e}function sit(n,t,i,r){this.batch=n;this.commitVersion=t;this.mutationResults=i;this.docVersions=r}function lc(n,t,i,r){this.batchId=n;this.localWriteTime=t;this.baseMutations=i;this.mutations=r}function hit(n,t){if(t.document)return lat(n.Lt,t.document,!!t.hasCommittedMutations);if(t.noDocument){var i=h.fromSegments(t.noDocument.path),r=vc(t.noDocument.readTime),i=ri.newNoDocument(i,r);return t.hasCommittedMutations?i.setHasCommittedMutations():i}return t.unknownDocument?(i=h.fromSegments(t.unknownDocument.path),r=vc(t.unknownDocument.version),ri.newUnknownDocument(i,r)):s()}function svt(n,t,i){var f=cit(i),i=t.key.path.popLast().toArray(),e,r;if(t.isFoundDocument())return e={name:da(r=n.Lt,(u=t).key),fields:u.data.value.mapValue.fields,updateTime:ka(r,u.version.toTimestamp())},r=t.hasCommittedMutations,new ot(null,null,e,r,f,i);if(t.isNoDocument()){var u=t.key.path.toArray(),e=ac(t.version),r=t.hasCommittedMutations;return new ot(null,new pti(u,e),null,r,f,i)}return t.isUnknownDocument()?(r=t.key.path.toArray(),t=ac(t.version),new ot(new wti(r,t),null,null,!0,f,i)):s()}function cit(n){return n=n.toTimestamp(),[n.seconds,n.nanoseconds]}function hvt(n){return n=new or(n[0],n[1]),y.fromTimestamp(n)}function ac(n){return n=n.toTimestamp(),new gat(n.seconds,n.nanoseconds)}function vc(n){return n=new or(n.seconds,n.nanoseconds),y.fromTimestamp(n)}function yc(n,t){for(var u,f,e,o,r=(t.baseMutations||[]).map(function(t){return aat(n.Lt,t)}),i=0;i<t.mutations.length-1;++i)f=t.mutations[i],i+1<t.mutations.length&&void 0!==t.mutations[i+1].transform&&(u=t.mutations[i+1],f.updateTransforms=u.transform.fieldTransforms,t.mutations.splice(i+1,1),++i);return e=t.mutations.map(function(t){return aat(n.Lt,t)}),o=or.fromMillis(t.localWriteTimeMs),new oit(t.batchId,o,r,e)}function tv(n){var i=vc(n.readTime),r=void 0!==n.lastLimboFreeSnapshotVersion?vc(n.lastLimboFreeSnapshotVersion):y.min(),t=void 0!==n.query.documents?(a(1===(t=n.query).documents.length),au(nc(sat(t.documents[0])))):au(pat(n.query));return new ib(t,n.targetId,0,n.lastListenSequenceNumber,i,r,sr.fromBase64String(n.resumeToken))}function cvt(n,t){var i=ac(t.snapshotVersion),r=ac(t.lastLimboFreeSnapshotVersion),u=(lw(t.target)?vat:yat)(n.Lt,t.target),n=t.resumeToken.toBase64();return new gr(t.targetId,ya(t.target),i,n,t.sequenceNumber,r,u)}function lit(n){var t=pat({parent:n.parent,structuredQuery:n.structuredQuery});return"LAST"===n.limitType?sct(t,t.limit,"L"):t}function iv(){}function avt(n){return nu(n,oc.store)}function vvt(n){return nu(n,sc.store)}function vit(){this.qt=new ait}function rb(){this.index={}}function yit(){this.Bt=new ait}function yvt(n){return nu(n,es.store)}function rv(n,t,i){this.cacheSizeCollectionThreshold=n;this.percentileToCollect=t;this.maximumSequenceNumbersToCollect=i}function pvt(n,t,i){var l=n.store(ft.store),v=n.store(bi.store),r=[],n=IDBKeyRange.only(i.batchId),o=0,n=l.$t({range:n},function(n,t,i){return o++,i.delete()}),e,c;r.push(n.next(function(){a(1===o)}));for(var s=[],u=0,h=i.mutations;u<h.length;u++)e=h[u],c=bi.key(t,e.key.path,i.batchId),r.push(v.delete(c)),s.push(e.key);return f.waitFor(r).next(function(){return s})}function ub(n){if(!n)return 0;var t;if(n.document)t=n.document;else if(n.unknownDocument)t=n.unknownDocument;else{if(!n.noDocument)throw s();t=n.noDocument}return JSON.stringify(t).length}function ni(n,t,i,r){this.userId=n;this.R=t;this.Ut=i;this.referenceDelegate=r;this.Qt={}}function bvt(n,t,i){var i=bi.prefixForPath(t,i.path),u=i[1],i=IDBKeyRange.lowerBound(i),r=!1;return pc(n).$t({range:i,kt:!0},function(n,i,f){var e=n[0],o=n[1];n[2];e===t&&o===u&&(r=!0);f.done()}).next(function(){return r})}function no(n){return nu(n,ft.store)}function pc(n){return nu(n,bi.store)}function kvt(n){return nu(n,ge.store)}function lt(n,t){this.referenceDelegate=n;this.R=t}function wc(n){this.Ht=n}function bc(n){return nu(n,gr.store)}function gvt(n){return nu(n,eu.store)}function to(n){return nu(n,fi.store)}function ls(n){return r(this,void 0,void 0,function(){return i(this,function(){if(n.code!==t.FAILED_PRECONDITION||n.message!==tvt)throw n;return e("LocalStore","Unexpectedly lost primary lease"),[2]})})}function nyt(n,t){var i=n[0],r=n[1],n=t[0],t=t[1],n=w(i,n);return 0===n?w(r,t):n}function ar(n,t){this.db=n;this.garbageCollector=new rii(this,t)}function io(n,t){this.ae=n;this.params=t}function fv(n,t){this.garbageCollector=n;this.asyncQueue=t;this.oe=!1;this.ce=null}function fb(n){this.ne=n;this.buffer=new gt(nyt);this.se=0}function eb(n,t){return to(n).put((n=n.currentSequenceNumber,new fi(0,du(t.path),n)))}function ev(n,t){var i=this;return(i=tyt.call(this)||this).Ie=n,i.trackRemovals=t,i.Ae=new kc(function(n){return n.toString()},function(n,t){return n.isEqual(t)}),i}function vr(n,t){this.R=n;this.Ut=t}function ro(){this.changes=new kc(function(n){return n.toString()},function(n,t){return n.isEqual(t)});this.changesApplied=!1}function as(n,t){this.mapKeyFn=n;this.equalsFn=t;this.inner={}}function iyt(n){return nu(n,vf.store)}function uo(n){return nu(n,ot.store)}function ob(n){return n.path.toArray()}function vs(n){this.R=n}function uyt(n){n.createObjectStore(fi.store,{keyPath:fi.keyPath}).createIndex(fi.documentTargetsIndex,fi.documentTargetsKeyPath,{unique:!0});n.createObjectStore(gr.store,{keyPath:gr.keyPath}).createIndex(gr.queryTargetsIndexName,gr.queryTargetsKeyPath,{unique:!0});n.createObjectStore(eu.store)}function b(n,i,r,f,e,o,s,h,c,l){if(this.allowTabSynchronization=n,this.persistenceKey=i,this.clientId=r,this.Se=e,this.window=o,this.document=s,this.De=c,this.Ce=l,this.Ne=null,this.xe=!1,this.isPrimary=!1,this.networkEnabled=!0,this.Fe=null,this.inForeground=!1,this.ke=null,this.$e=null,this.Oe=Number.NEGATIVE_INFINITY,this.Me=function(){return Promise.resolve()},!b.yt())throw new u(t.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.referenceDelegate=new uii(this,f);this.Le=i+"main";this.R=new ovt(h);this.Be=new hc(this.Le,11,new ryt(this.R));this.qe=new dvt(this.referenceDelegate,this.R);this.Ut=new nii;this.Ue=(i=this.R,h=this.Ut,new fii(i,h));this.Qe=new lvt;this.window&&this.window.localStorage?this.Ke=this.window.localStorage:(this.Ke=null,!1===l&&pt("IndexedDbPersistence","LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."))}function ov(n){return nu(n,fu.store)}function hb(n){return nu(n,ie.store)}function wit(n,t){var i=n.projectId;return n.isDefaultDatabase||(i+="."+n.database),"firestore/"+t+"/"+i+"/"}function oii(n,t){this.progress=n;this.wn=t}function syt(n,t,i,r){this.persistence=n;this.xn=t;this.R=r;this.Fn=new tr(w);this.kn=new kc(ya,cw);this.$n=y.min();this._n=n.getMutationQueue(i);this.On=n.getRemoteDocumentCache();this.qe=n.getTargetCache();this.Mn=new eyt(this.On,this._n,this.persistence.getIndexManager());this.Qe=n.getBundleCache();this.xn.Vn(this.Mn)}function dc(){}function bit(n,t,i,r){this.targetId=n;this.fromCache=t;this.bn=i;this.vn=r}function nf(n,t,i){this.Ue=n;this._n=t;this.Ut=i}function hyt(n,t,i,r){return new hii(n,t,i,r)}function cyt(n,t){return r(this,void 0,void 0,function(){var r,u,f,e;return i(this,function(i){switch(i.label){case 0:return u=(r=n)._n,f=r.Mn,[4,r.persistence.runTransaction("Handle user change","readonly",function(n){var i;return r._n.getAllMutationBatches(n).next(function(e){return i=e,u=r.persistence.getMutationQueue(t),f=new eyt(r.On,u,r.persistence.getIndexManager()),u.getAllMutationBatches(n)}).next(function(t){for(var h,u,c,b,e,l,a,o,v,k,y=[],p=[],r=tt(),s=0,w=i;s<w.length;s++)for(h=w[s],y.push(h.batchId),u=0,c=h.mutations;u<c.length;u++)b=c[u],r=r.add(b.key);for(e=0,l=t;e<l.length;e++)for(a=l[e],p.push(a.batchId),o=0,v=a.mutations;o<v.length;o++)k=v[o],r=r.add(k.key);return f.pn(n,r).next(function(n){return{Ln:n,removedBatchIds:y,addedBatchIds:p}})})})];case 1:return e=i.sent(),[2,(r._n=u,r.Mn=f,r.xn.Vn(r.Mn),e)]}})})}function cii(n,t){var i=n;return i.persistence.runTransaction("Acknowledge batch","readwrite-primary",function(n){var h,o,r,s,u,c,e,v=t.batch.keys(),l=i.On.newChangeBuffer({trackRemovals:!0});return h=i,o=n,s=l,u=(r=t).batch,c=u.keys(),e=f.resolve(),c.forEach(function(n){e=e.next(function(){return s.getEntry(o,n)}).next(function(t){var i=r.docVersions.get(n);a(null!==i);t.version.compareTo(i)<0&&(u.applyToRemoteDocument(t,r),t.isValidDocument()&&s.addEntry(t,r.commitVersion))})}),e.next(function(){return h._n.removeMutationBatch(o,u)}).next(function(){return l.apply(n)}).next(function(){return i._n.performConsistencyCheck(n)}).next(function(){return i.Mn.pn(n,v)})})}function lyt(n){var t=n;return t.persistence.runTransaction("Get last remote snapshot version","readonly",function(n){return t.qe.getLastRemoteSnapshotVersion(n)})}function lii(n,t){var i=n,u=t.snapshotVersion,r=i.Fn;return i.persistence.runTransaction("Apply remote event","readwrite-primary",function(n){var s=i.On.newChangeBuffer({trackRemovals:!0}),e,h,o;return r=i.Fn,e=[],t.targetChanges.forEach(function(t,f){var h,c,o,s=r.get(f);s&&(e.push(i.qe.removeMatchingKeys(n,t.removedDocuments,f).next(function(){return i.qe.addMatchingKeys(n,t.addedDocuments,f)})),0<(o=t.resumeToken).approximateByteSize()&&(h=s.withResumeToken(o,u).withSequenceNumber(n.currentSequenceNumber),r=r.insert(f,h),c=s,o=t,a(0<(s=h).resumeToken.approximateByteSize()),(0===c.resumeToken.approximateByteSize()||3e8<=s.snapshotVersion.toMicroseconds()-c.snapshotVersion.toMicroseconds()||0<o.addedDocuments.size+o.modifiedDocuments.size+o.removedDocuments.size)&&e.push(i.qe.updateTargetData(n,h))))}),o=vu,t.documentUpdates.forEach(function(r){t.resolvedLimboDocuments.has(r)&&e.push(i.persistence.referenceDelegate.updateLimboDocument(n,r))}),e.push(ayt(n,s,t.documentUpdates,u,void 0).next(function(n){o=n})),u.isEqual(y.min())||(h=i.qe.getLastRemoteSnapshotVersion(n).next(function(){return i.qe.setTargetsMetadata(n,n.currentSequenceNumber,u)}),e.push(h)),f.waitFor(e).next(function(){return s.apply(n)}).next(function(){return i.Mn.En(n,o)}).next(function(){return o})}).then(function(n){return i.Fn=r,n})}function ayt(n,t,i,r,u){var f=tt();return i.forEach(function(n){return f=f.add(n)}),t.getEntries(n,f).next(function(n){var f=vu;return i.forEach(function(i,o){var s=n.get(i),h=(null==u?void 0:u.get(i))||r;o.isNoDocument()&&o.version.isEqual(y.min())?(t.removeEntry(i,h),f=f.insert(i,o)):!s.isValidDocument()||0<o.version.compareTo(s.version)||0===o.version.compareTo(s.version)&&s.hasPendingWrites?(t.addEntry(o,h),f=f.insert(i,o)):e("LocalStore","Ignoring outdated watch update for ",i,". Current version:",s.version," Watch version:",o.version)}),f})}function gc(n,t){var i=n;return i.persistence.runTransaction("Allocate target","readwrite",function(n){var r;return i.qe.getTargetData(n,t).next(function(u){return u?(r=u,f.resolve(r)):i.qe.allocateTargetId(n).next(function(u){return r=new ib(t,u,0,n.currentSequenceNumber),i.qe.addTargetData(n,r).next(function(){return r})})})}).then(function(n){var r=i.Fn.get(n.targetId);return(null===r||0<n.snapshotVersion.compareTo(r.snapshotVersion))&&(i.Fn=i.Fn.insert(n.targetId,n),i.kn.set(t,n.targetId)),n})}function nl(n,t,u){return r(this,void 0,void 0,function(){var r,o,f;return i(this,function(i){switch(i.label){case 0:o=(r=n).Fn.get(t);f=u?"readwrite":"readwrite-primary";i.label=1;case 1:return i.trys.push([1,4,,5]),u?[3,3]:[4,r.persistence.runTransaction("Release target",f,function(n){return r.persistence.referenceDelegate.removeTarget(n,o)})];case 2:i.sent();i.label=3;case 3:return[3,5];case 4:if(!ss(f=i.sent()))throw f;return e("LocalStore","Failed to update sequence numbers for target "+t+": "+f),[3,5];case 5:return r.Fn=r.Fn.remove(t),r.kn.delete(o.target),[2]}})})}function cb(n,t,i){var r=n,e=y.min(),u=tt();return r.persistence.runTransaction("Execute query","readonly",function(n){return o=r,c=n,s=au(t),(void 0!==(o=(h=o).kn.get(s))?f.resolve(h.Fn.get(o)):h.qe.getTargetData(c,s)).next(function(t){if(t)return e=t.lastLimboFreeSnapshotVersion,r.qe.getMatchingKeysForTargetId(n,t.targetId).next(function(n){u=n})}).next(function(){return r.xn.getDocumentsMatchingQuery(n,t,i?e:y.min(),i?u:tt())}).next(function(n){return{documents:n,Bn:u}});var o,c,s,h})}function vyt(n,t){var i=n,r=i.qe,n=i.Fn.get(t);return n?Promise.resolve(n.target):i.persistence.runTransaction("Get target data","readonly",function(n){return r.lt(n,t).next(function(n){return n?n.target:null})})}function yyt(n){var t=n;return t.persistence.runTransaction("Get new document changes","readonly",function(n){return f=t.On,i=n,n=t.$n,e=f,r=vu,u=cit(n),n=uo(i),i=IDBKeyRange.lowerBound(u,!0),n.$t({index:ot.readTimeIndex,range:i},function(n,t){var i=hit(e.R,t);r=r.insert(i.key,i);u=t.readTime}).next(function(){return{wn:r,readTime:hvt(u)}});var f,i,e,r,u}).then(function(n){var i=n.wn,n=n.readTime;return t.$n=n,i})}function aii(n){return r(this,void 0,void 0,function(){var t;return i(this,function(){return[2,(t=n).persistence.runTransaction("Synchronize last document change read time","readonly",function(n){return n=uo(n),t=y.min(),n.$t({index:ot.readTimeIndex,reverse:!0},function(n,i,r){i.readTime&&(t=hvt(i.readTime));r.done()}).next(function(){return t});var t}).then(function(n){t.$n=n})]})})}function lb(n){this.uid=n}function su(n){this.persistence=n;this.As=new kit;this.Rs=null}function byt(n){var t=this;return(t=pyt.call(this)||this).currentSequenceNumber=n,t}function hu(n,t){var i=this;this.gs={};this.Ne=new ru(0);this.xe=!1;this.xe=!0;this.referenceDelegate=n(this);this.qe=new bii(this);this.Ut=new gti;this.Ue=(n=this.Ut,new pii(n,function(n){return i.referenceDelegate.ps(n)}));this.R=new ovt(t);this.Qe=new vii(this.R)}function oi(n){this.persistence=n;this.ds=new kc(ya,cw);this.lastRemoteSnapshotVersion=y.min();this.highestTargetId=0;this.ws=0;this._s=new kit;this.targetCount=0;this.ys=uv.Jt()}function sv(n){var t=this;return(t=wyt.call(this)||this).Ie=n,t}function re(n,t){this.Ut=n;this.ls=t;this.docs=new tr(h.comparator);this.size=0}function si(n,t){this.Ut=n;this.referenceDelegate=t;this._n=[];this.ss=1;this.rs=new gt(ei.Gn)}function dit(n,t){this.key=n;this.ns=t}function tf(){this.Wn=new gt(ei.Gn);this.zn=new gt(ei.Hn)}function hv(n){this.R=n;this.Kn=new Map;this.jn=new Map}function kyt(n,t){return"firestore_clients_"+n+"_"+t}function dyt(n,t,i){return i="firestore_mutations_"+n+"_"+i,t.isAuthenticated()&&(i+="_"+t.uid),i}function git(n,t){return"firestore_targets_"+n+"_"+t}function ab(n){var t=this;return(t=gyt.call(this,n)||this).forceLongPolling=n.forceLongPolling,t.autoDetectLongPolling=n.autoDetectLongPolling,t.useFetchStreams=n.useFetchStreams,t}function cv(n){this.databaseInfo=n;this.databaseId=n.databaseId;var t=n.ssl?"https":"http";this.Di=t+"://"+n.host;this.Ci="projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database+"/documents"}function ue(n){this.Ei=n.Ei;this.Ti=n.Ti}function ys(){var n=this;this.wi=function(){return n._i()};this.mi=function(){return n.yi()};this.gi=[];this.pi()}function rrt(){}function ir(){this.li=new trt;this.fi={};this.onlineStateHandler=null;this.sequenceNumberHandler=null}function p(n,t,i,r,u){this.window=n;this.Se=t;this.persistenceKey=i;this.Ns=r;this.syncEngine=null;this.onlineStateHandler=null;this.sequenceNumberHandler=null;this.xs=this.Fs.bind(this);this.ks=new tr(w);this.started=!1;this.$s=[];i=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");this.storage=this.window.localStorage;this.currentUser=u;this.Os=kyt(this.persistenceKey,this.Ns);this.Ms="firestore_sequence_number_"+this.persistenceKey;this.ks=this.ks.insert(this.Ns,new trt);this.Ls=new RegExp("^firestore_clients_"+i+"_([^_]*)$");this.Bs=new RegExp("^firestore_mutations_"+i+"_(\\d+)(?:_(.*))?$");this.qs=new RegExp("^firestore_targets_"+i+"_(\\d+)$");this.Us="firestore_online_state_"+this.persistenceKey;this.Qs="firestore_bundle_loaded_"+this.persistenceKey;this.window.addEventListener("storage",this.xs)}function vb(){this.activeTargetIds=dw}function urt(n,t){this.clientId=n;this.onlineState=t}function frt(n,t){this.clientId=n;this.activeTargetIds=t}function yb(n,t,i){this.targetId=n;this.state=t;this.error=i}function pb(n,t,i,r){this.user=n;this.batchId=t;this.state=i;this.error=r}function upt(){return"undefined"!=typeof window?window:null}function wb(){return"undefined"!=typeof document?document:null}function lv(n){return new ati(n,!0)}function fri(n,t,u,f,o){var s=this;this.localStore=n;this.datastore=t;this.asyncQueue=u;this.remoteSyncer={};this.kr=[];this.$r=new Map;this.Or=new Set;this.Mr=[];this.Lr=o;this.Lr.di(function(){u.enqueueAndForget(function(){return r(s,void 0,void 0,function(){return i(this,function(n){switch(n.label){case 0:return fo(this)?(e("RemoteStore","Restarting streams for network reachability change."),[4,function(n){return r(this,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return(t=n).Or.add(4),[4,rl(t)];case 1:return i.sent(),t.Br.set("Unknown"),t.Or.delete(4),[4,av(t)];case 2:return i.sent(),[2]}})})}(this)]):[3,2];case 1:n.sent();n.label=2;case 2:return[2]}})})})});this.Br=new hri(u,f)}function ps(n,t){this.asyncQueue=n;this.onlineStateHandler=t;this.state="Unknown";this.vr=0;this.Pr=null;this.Vr=!0}function tl(n,t,i){var r=this;return(r=fpt.call(this)||this).credentials=n,r.Hi=t,r.R=i,r.Rr=!1,r}function fe(n,t,i,r,u){var f=this;return(f=ert.call(this,n,"write_stream_connection_backoff","write_stream_idle",t,i,u)||this).R=r,f.gr=!1,f}function il(n,t,i,r,u){var f=this;return(f=ept.call(this,n,"listen_stream_connection_backoff","listen_stream_idle",t,i,u)||this).R=r,f}function ki(n,t,i,r,u,f){this.Se=n;this.zi=i;this.Hi=r;this.Ji=u;this.listener=f;this.state=0;this.Yi=0;this.Xi=null;this.stream=null;this.Zi=new ort(n,t)}function ws(n,t,i,r,u){void 0===i&&(i=1e3);void 0===r&&(r=1.5);void 0===u&&(u=6e4);this.Se=n;this.timerId=t;this.Mi=i;this.Li=r;this.Bi=u;this.qi=0;this.Ui=null;this.Qi=Date.now();this.reset()}function av(n){return r(this,void 0,void 0,function(){var t,r;return i(this,function(i){switch(i.label){case 0:if(!fo(n))return[3,4];t=0;r=n.Mr;i.label=1;case 1:return t<r.length?[4,r[t](!0)]:[3,4];case 2:i.sent();i.label=3;case 3:return t++,[3,1];case 4:return[2]}})})}function rl(n){return r(this,void 0,void 0,function(){var t,r;return i(this,function(i){switch(i.label){case 0:t=0;r=n.Mr;i.label=1;case 1:return t<r.length?[4,r[t](!1)]:[3,4];case 2:i.sent();i.label=3;case 3:return t++,[3,1];case 4:return[2]}})})}function bb(n,t){n.$r.has(t.targetId)||(n.$r.set(t.targetId,t),crt(n)?hrt(n):fl(n).er()&&srt(n,t))}function vv(n,t){var i=n,n=fl(i);i.$r.delete(t);n.er()&&opt(i,t);0===i.$r.size&&(n.er()?n.ir():fo(i)&&i.Br.set("Unknown"))}function srt(n,t){n.qr.U(t.targetId);fl(n).mr(t)}function opt(n,t){n.qr.U(t);fl(n).yr(t)}function hrt(n){n.qr=new hti({getRemoteKeysForTarget:function(t){return n.remoteSyncer.getRemoteKeysForTarget(t)},lt:function(t){return n.$r.get(t)||null}});fl(n).start();n.Br.Sr()}function crt(n){return fo(n)&&!fl(n).tr()&&0<n.$r.size}function fo(n){return 0===n.Or.size}function spt(n){n.qr=void 0}function cri(n,t,u){return r(this,void 0,void 0,function(){var o,f;return i(this,function(s){switch(s.label){case 0:if(n.Br.set("Online"),!(t instanceof iat&&2===t.state&&t.cause))return[3,6];s.label=1;case 1:return s.trys.push([1,3,,5]),[4,function(n,t){return r(this,void 0,void 0,function(){var e,u,f,r;return i(this,function(i){switch(i.label){case 0:e=t.cause;u=0;f=t.targetIds;i.label=1;case 1:return u<f.length?(r=f[u],n.$r.has(r)?[4,n.remoteSyncer.rejectListen(r,e)]:[3,3]):[3,5];case 2:i.sent();n.$r.delete(r);n.qr.removeTarget(r);i.label=3;case 3:i.label=4;case 4:return u++,[3,1];case 5:return[2]}})})}(n,t)];case 2:return s.sent(),[3,5];case 3:return o=s.sent(),e("RemoteStore","Failed to remove targets %s: %s ",t.targetIds.join(","),o),[4,kb(n,o)];case 4:return s.sent(),[3,5];case 5:return[3,13];case 6:if(t instanceof gw?n.qr.X(t):t instanceof tat?n.qr.rt(t):n.qr.et(t),u.isEqual(y.min()))return[3,13];s.label=7;case 7:return s.trys.push([7,11,,13]),[4,lyt(n.localStore)];case 8:return f=s.sent(),0<=u.compareTo(f)?[4,(c=u,(l=(h=n).qr.ut(c)).targetChanges.forEach(function(n,t){var i;0<n.resumeToken.approximateByteSize()&&(i=h.$r.get(t))&&h.$r.set(t,i.withResumeToken(n.resumeToken,c))}),l.targetMismatches.forEach(function(n){var t=h.$r.get(n);t&&(h.$r.set(n,t.withResumeToken(sr.EMPTY_BYTE_STRING,t.snapshotVersion)),opt(h,n),t=new ib(t.target,n,1,t.sequenceNumber),srt(h,t))}),h.remoteSyncer.applyRemoteEvent(l))]:[3,10];case 9:s.sent();s.label=10;case 10:return[3,13];case 11:return e("RemoteStore","Failed to raise snapshot:",f=s.sent()),[4,kb(n,f)];case 12:return s.sent(),[3,13];case 13:return[2]}var h,c,l})})}function kb(n,t,u){return r(this,void 0,void 0,function(){var f=this;return i(this,function(o){switch(o.label){case 0:if(!ss(t))throw t;return n.Or.add(1),[4,rl(n)];case 1:return o.sent(),n.Br.set("Offline"),u=u||function(){return lyt(n.localStore)},n.asyncQueue.enqueueRetryable(function(){return r(f,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return e("RemoteStore","Retrying IndexedDB access"),[4,u()];case 1:return t.sent(),n.Or.delete(1),[4,av(n)];case 2:return t.sent(),[2]}})})}),[2]}})})}function hpt(n,t){return t().catch(function(i){return kb(n,i,t)})}function ul(n){return r(this,void 0,void 0,function(){var t,f,u,r;return i(this,function(i){switch(i.label){case 0:f=eo(t=n);u=0<t.kr.length?t.kr[t.kr.length-1].batchId:-1;i.label=1;case 1:if(!(fo(t)&&t.kr.length<10))return[3,7];i.label=2;case 2:return i.trys.push([2,4,,6]),[4,(o=t.localStore,e=u,(s=o).persistence.runTransaction("Get next mutation batch","readonly",function(n){return void 0===e&&(e=-1),s._n.getNextMutationBatchAfterBatchId(n,e)}))];case 3:return null===(r=i.sent())?(0===t.kr.length&&f.ir(),[3,7]):(u=r.batchId,function(n,t){n.kr.push(t);n=eo(n);n.er()&&n.pr&&n.Er(t.mutations)}(t,r),[3,6]);case 4:return r=i.sent(),[4,kb(t,r)];case 5:return i.sent(),[3,6];case 6:return[3,1];case 7:return cpt(t)&&lpt(t),[2]}var o,e,s})})}function cpt(n){return fo(n)&&!eo(n).tr()&&0<n.kr.length}function lpt(n){eo(n).start()}function lrt(n,t){return r(this,void 0,void 0,function(){var r;return i(this,function(i){switch(i.label){case 0:return r=n,t?(r.Or.delete(2),[4,av(r)]):[3,2];case 1:return i.sent(),[3,5];case 2:return t?[3,4]:(r.Or.add(2),[4,rl(r)]);case 3:i.sent();r.Br.set("Unknown");i.label=4;case 4:i.label=5;case 5:return[2]}})})}function fl(n){var t,u,f,e=this;return n.Ur||(n.Ur=(t=n.datastore,u=n.asyncQueue,f={Ii:function(n){return r(this,void 0,void 0,function(){return i(this,function(){return n.$r.forEach(function(t){srt(n,t)}),[2]})})}.bind(null,n),Ri:function(n,t){return r(this,void 0,void 0,function(){return i(this,function(){return spt(n),crt(n)?(n.Br.Nr(t),hrt(n)):n.Br.set("Unknown"),[2]})})}.bind(null,n),_r:cri.bind(null,n)},t.br(),new eri(u,t.Hi,t.credentials,t.R,f)),n.Mr.push(function(t){return r(e,void 0,void 0,function(){return i(this,function(i){switch(i.label){case 0:return t?(n.Ur.sr(),crt(n)?hrt(n):n.Br.set("Unknown"),[3,3]):[3,1];case 1:return[4,n.Ur.stop()];case 2:i.sent();spt(n);i.label=3;case 3:return[2]}})})})),n.Ur}function eo(n){var u,f,o,s=this;return n.Qr||(n.Qr=(u=n.datastore,f=n.asyncQueue,o={Ii:function(n){return r(this,void 0,void 0,function(){return i(this,function(){return eo(n).Ar(),[2]})})}.bind(null,n),Ri:function(n,u){return r(this,void 0,void 0,function(){return i(this,function(f){switch(f.label){case 0:return u&&eo(n).pr?[4,function(n,u){return r(this,void 0,void 0,function(){var r,f;return i(this,function(i){switch(i.label){case 0:return klt(f=u.code)&&f!==t.ABORTED?(r=n.kr.shift(),eo(n).sr(),[4,hpt(n,function(){return n.remoteSyncer.rejectFailedWrite(r.batchId,u)})]):[3,3];case 1:return i.sent(),[4,ul(n)];case 2:i.sent();i.label=3;case 3:return[2]}})})}(n,u)]:[3,2];case 1:f.sent();f.label=2;case 2:return cpt(n)&&lpt(n),[2]}})})}.bind(null,n),Ir:function(n){return r(this,void 0,void 0,function(){var u,t,r,f;return i(this,function(){for(u=eo(n),t=0,r=n.kr;t<r.length;t++)f=r[t],u.Er(f.mutations);return[2]})})}.bind(null,n),Tr:function(n,t,u){return r(this,void 0,void 0,function(){var r,f;return i(this,function(i){switch(i.label){case 0:return r=n.kr.shift(),f=dti.from(r,t,u),[4,hpt(n,function(){return n.remoteSyncer.applySuccessfulWrite(f)})];case 1:return i.sent(),[4,ul(n)];case 2:return i.sent(),[2]}})})}.bind(null,n)},u.br(),new ori(f,u.Hi,u.credentials,u.R,o)),n.Mr.push(function(t){return r(s,void 0,void 0,function(){return i(this,function(i){switch(i.label){case 0:return t?(n.Qr.sr(),[4,ul(n)]):[3,2];case 1:return i.sent(),[3,4];case 2:return[4,n.Qr.stop()];case 3:i.sent();0<n.kr.length&&(e("RemoteStore","Stopping write stream with "+n.kr.length+" pending writes"),n.kr=[]);i.label=4;case 4:return[2]}})})})),n.Qr}function oo(n,t,i,r,u){this.asyncQueue=n;this.timerId=t;this.targetTimeMs=i;this.op=r;this.removalCallback=u;this.deferred=new cr;this.then=this.deferred.promise.then.bind(this.deferred.promise);this.deferred.promise.catch(function(){})}function el(n,i){if(pt("AsyncQueue",i+": "+n),ss(n))return new u(t.UNAVAILABLE,i+": "+n);throw n;}function lri(){this.queries=new kc(hct,wa);this.onlineState="Unknown";this.Gr=new Set}function yv(n,t,i,r,u,f,e,o){this.query=n;this.docs=t;this.oldDocs=i;this.docChanges=r;this.mutatedKeys=u;this.fromCache=f;this.syncStateChanged=e;this.excludesMetadataChanges=o}function art(){this.Kr=new tr(h.comparator)}function hi(n){this.comparator=n?function(t,i){return n(t,i)||h.comparator(t.key,i.key)}:function(n,t){return h.comparator(n.key,t.key)};this.keyedMap=btt;this.sortedSet=new tr(this.comparator)}function vrt(n,t){return r(this,void 0,void 0,function(){var u,e,o,r,f;return i(this,function(i){switch(i.label){case 0:if(u=n,e=t.query,o=!1,(r=u.queries.get(e))||(o=!0,r=new ari),!o)return[3,4];i.label=1;case 1:return i.trys.push([1,3,,4]),f=r,[4,u.onListen(e)];case 2:return f.Wr=i.sent(),[3,4];case 3:return f=i.sent(),f=el(f,"Initialization of query '"+vtt(t.query)+"' failed"),[2,void t.onError(f)];case 4:return u.queries.set(e,r),r.listeners.push(t),t.zr(u.onlineState),r.Wr&&t.Hr(r.Wr)&&prt(u),[2]}})})}function yrt(n,t){return r(this,void 0,void 0,function(){var r,u,e,f,o;return i(this,function(){return r=n,u=t.query,e=!1,(f=r.queries.get(u))&&0<=(o=f.listeners.indexOf(t))&&(f.listeners.splice(o,1),e=0===f.listeners.length),e?[2,(r.queries.delete(u),r.onUnlisten(u))]:[2]})})}function prt(n){n.Gr.forEach(function(n){n.next()})}function gb(n,t,i){this.ro=n;this.localStore=t;this.R=i;this.queries=[];this.documents=[];this.progress=bpt(n)}function nk(n){this.R=n}function wpt(n,t){this.payload=n;this.byteLength=t}function bs(n,t,i){this.query=n;this.Jr=t;this.Yr=!1;this.Xr=null;this.onlineState="Unknown";this.options=i||{}}function bpt(n){return{taskState:"Running",documentsLoaded:0,bytesLoaded:0,totalDocuments:n.totalDocuments,totalBytes:n.totalBytes}}function nwt(n,t,i,r,u,f){this.localStore=n;this.remoteStore=t;this.eventManager=i;this.sharedClientState=r;this.currentUser=u;this.maxConcurrentLimboResolutions=f;this.vo={};this.Po=new kc(hct,wa);this.Vo=new Map;this.So=new Set;this.Do=new tr(h.comparator);this.Co=new Map;this.No=new kit;this.xo={};this.Fo=new Map;this.ko=uv.Yt();this.onlineState="Unknown";this.$o=void 0}function rf(n,t){this.query=n;this.uo=t;this.ao=null;this.current=!1;this.ho=tt();this.mutatedKeys=tt();this.lo=cct(n);this.fo=new vpt(this.lo)}function brt(n,t,u,f){return r(this,void 0,void 0,function(){var s,e,o;return i(this,function(h){switch(h.label){case 0:return n.Oo=function(t,u,f){return function(n,t,u,f){return r(this,void 0,void 0,function(){var e,r;return i(this,function(i){switch(i.label){case 0:return(e=t.view._o(u)).Nn?[4,cb(n.localStore,t.query,!1).then(function(n){return n=n.documents,t.view._o(n,e)})]:[3,2];case 1:e=i.sent();i.label=2;case 2:return r=f&&f.targetChanges.get(t.targetId),r=t.view.applyChanges(e,n.isPrimaryClient,r),[2,(grt(n,t.targetId,r.To),r.snapshot)]}})})}(n,t,u,f)},[4,cb(n.localStore,t,!0)];case 1:return e=h.sent(),o=new gpt(t,e.Bn),s=o._o(e.documents),e=dtt.createSynthesizedTargetChangeForCurrentChange(u,f&&"Offline"!==n.onlineState),e=o.applyChanges(s,n.isPrimaryClient,e),grt(n,u,e.To),o=new pri(t,u,o),[2,(n.Po.set(t,o),n.Vo.has(u)?n.Vo.get(u).push(t):n.Vo.set(u,[t]),e.snapshot)]}})})}function kri(n,t,u){return r(this,void 0,void 0,function(){var f,r;return i(this,function(i){switch(i.label){case 0:r=iut(n);i.label=1;case 1:return i.trys.push([1,5,,6]),[4,(e=r.localStore,s=t,c=e,v=or.now(),y=s.reduce(function(n,t){return n.add(t.key)},tt()),c.persistence.runTransaction("Locally write mutations","readwrite",function(n){return c.Mn.pn(n,y).next(function(t){var i,r;h=t;for(var f=[],u=0,e=s;u<e.length;u++)i=e[u],r=function(n,t){for(var i=null,r=0,e=n.fieldTransforms;r<e.length;r++){var u=e[r],f=t.data.field(u.field),f=yct(u.transform,f||null);null!=f&&(i=null==i?kr.empty():i).set(u.field,f)}return i||null}(i,h.get(i.key)),null!=r&&f.push(new ne(i.key,r,function n(t){var i=[];return ns(t.fields,function(t,r){var f=new ku([t]),u,e,o;if(hw(r))if(0===(r=n(r.mapValue).fields).length)i.push(f);else for(u=0,e=r;u<e.length;u++)o=e[u],i.push(f.child(o));else i.push(f)}),new kh(i)}(r.value.mapValue),yi.exists(!0)));return c._n.addMutationBatch(n,v,f,s)})}).then(function(n){return n.applyToLocalDocumentSet(h),{batchId:n.batchId,changes:h}}))];case 2:return f=i.sent(),r.sharedClientState.addPendingMutation(f.batchId),o=r,l=f.batchId,a=u,e=(e=(e=o.xo[o.currentUser.toKey()])||new tr(w)).insert(l,a),o.xo[o.currentUser.toKey()]=e,[4,ee(r,f.changes)];case 3:return i.sent(),[4,ul(r.remoteStore)];case 4:return i.sent(),[3,6];case 5:return r=i.sent(),r=el(r,"Failed to persist write"),u.reject(r),[3,6];case 6:return[2]}var o,l,a,e,s,h,c,v,y})})}function twt(n,t){return r(this,void 0,void 0,function(){var r,u;return i(this,function(i){switch(i.label){case 0:r=n;i.label=1;case 1:return i.trys.push([1,4,,6]),[4,lii(r.localStore,t)];case 2:return u=i.sent(),t.targetChanges.forEach(function(n,t){t=r.Co.get(t);t&&(a(n.addedDocuments.size+n.modifiedDocuments.size+n.removedDocuments.size<=1),0<n.addedDocuments.size?t.bo=!0:0<n.modifiedDocuments.size?a(t.bo):0<n.removedDocuments.size&&(a(t.bo),t.bo=!1))}),[4,ee(r,u,t)];case 3:return i.sent(),[3,6];case 4:return[4,ls(i.sent())];case 5:return i.sent(),[3,6];case 6:return[2]}})})}function iwt(n,t,i){var r,n=n;(n.isPrimaryClient&&0===i||!n.isPrimaryClient&&1===i)&&(r=[],n.Po.forEach(function(n,i){i=i.view.zr(t);i.snapshot&&r.push(i.snapshot)}),function(n,t){n.onlineState=t;var i=!1;n.queries.forEach(function(n,r){for(var u=0,f=r.listeners;u<f.length;u++)f[u].zr(t)&&(i=!0)});i&&prt(n)}(n.eventManager,t),r.length&&n.vo._r(r),n.onlineState=t,n.isPrimaryClient&&n.sharedClientState.setOnlineState(t))}function dri(n,t,u){return r(this,void 0,void 0,function(){var r,f;return i(this,function(i){switch(i.label){case 0:r=n;i.label=1;case 1:return i.trys.push([1,4,,6]),[4,(o=r.localStore,s=t,(e=o).persistence.runTransaction("Reject batch","readwrite-primary",function(n){var t;return e._n.lookupMutationBatch(n,s).next(function(i){return a(null!==i),t=i.keys(),e._n.removeMutationBatch(n,i)}).next(function(){return e._n.performConsistencyCheck(n)}).next(function(){return e.Mn.pn(n,t)})}))];case 2:return f=i.sent(),drt(r,t,u),krt(r,t),r.sharedClientState.updateMutationState(t,"rejected",u),[4,ee(r,f)];case 3:return i.sent(),[3,6];case 4:return[4,ls(i.sent())];case 5:return i.sent(),[3,6];case 6:return[2]}var o,s,e})})}function gri(n,t){return r(this,void 0,void 0,function(){var u,f,r;return i(this,function(i){switch(i.label){case 0:fo((u=n).remoteStore)||e("SyncEngine","The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled.");i.label=1;case 1:return i.trys.push([1,3,,4]),[4,(o=u.localStore).persistence.runTransaction("Get highest unacknowledged batch id","readonly",function(n){return o._n.getHighestUnacknowledgedBatchId(n)})];case 2:return-1===(f=i.sent())?[2,void t.resolve()]:((r=u.Fo.get(f)||[]).push(t),u.Fo.set(f,r),[3,4]);case 3:return r=i.sent(),r=el(r,"Initialization of waitForPendingWrites() operation failed"),t.reject(r),[3,4];case 4:return[2]}var o})})}function krt(n,t){(n.Fo.get(t)||[]).forEach(function(n){n.resolve()});n.Fo.delete(t)}function drt(n,t,i){var u=n,r=u.xo[u.currentUser.toKey()];r&&((n=r.get(t))&&(i?n.reject(i):n.resolve(),r=r.remove(t)),u.xo[u.currentUser.toKey()]=r)}function ol(n,t,i){var r,u,f;for(void 0===i&&(i=null),n.sharedClientState.removeLocalQueryTarget(t),r=0,u=n.Vo.get(t);r<u.length;r++)f=u[r],n.Po.delete(f),i&&n.vo.Mo(f,i);n.Vo.delete(t);n.isPrimaryClient&&n.No.Zn(t).forEach(function(t){n.No.containsKey(t)||rwt(n,t)})}function rwt(n,t){n.So.delete(t.path.canonicalString());var i=n.Do.get(t);null!==i&&(vv(n.remoteStore,i),n.Do=n.Do.remove(t),n.Co.delete(i),nut(n))}function grt(n,t,i){for(var u,f,o,r,h=0,c=i;h<c.length;h++)r=c[h],r instanceof kpt?(n.No.addReference(r.key,t),u=n,o=void 0,f=(o=(f=r).key).path.canonicalString(),u.Do.get(o)||u.So.has(f)||(e("SyncEngine","New document in limbo: "+o),u.So.add(f),nut(u))):r instanceof dpt?(e("SyncEngine","Document no longer in limbo: "+r.key),n.No.removeReference(r.key,t),n.No.containsKey(r.key)||rwt(n,r.key)):s()}function nut(n){for(var i,t;0<n.So.size&&n.Do.size<n.maxConcurrentLimboResolutions;)t=n.So.values().next().value,n.So.delete(t),i=new h(k.fromString(t)),t=n.ko.next(),n.Co.set(t,new wri(i)),n.Do=n.Do.insert(i,t),bb(n.remoteStore,new ib(au(nc(i.path)),t,2,ru.o))}function ee(n,t,u){return r(this,void 0,void 0,function(){var o,s,h,c;return i(this,function(l){switch(l.label){case 0:return s=[],h=[],c=[],(o=n).Po.isEmpty()?[3,3]:(o.Po.forEach(function(n,i){c.push(o.Oo(i,t,u).then(function(n){n&&(o.isPrimaryClient&&o.sharedClientState.updateQueryState(i.targetId,n.fromCache?"not-current":"current"),s.push(n),n=sii.Pn(i.targetId,n),h.push(n))}))}),[4,Promise.all(c)]);case 1:return l.sent(),o.vo._r(s),[4,function(n,t){return r(this,void 0,void 0,function(){var r,s,o,h,c,l,u;return i(this,function(i){switch(i.label){case 0:r=n;i.label=1;case 1:return i.trys.push([1,3,,4]),[4,r.persistence.runTransaction("notifyLocalViewChanges","readwrite",function(n){return f.forEach(t,function(t){return f.forEach(t.bn,function(i){return r.persistence.referenceDelegate.addReference(n,t.targetId,i)}).next(function(){return f.forEach(t.vn,function(i){return r.persistence.referenceDelegate.removeReference(n,t.targetId,i)})})})})];case 2:return i.sent(),[3,4];case 3:if(!ss(s=i.sent()))throw s;return e("LocalStore","Failed to update sequence numbers: "+s),[3,4];case 4:for(o=0,h=t;o<h.length;o++)u=h[o],c=u.targetId,u.fromCache||(l=r.Fn.get(c),u=l.snapshotVersion,u=l.withLastLimboFreeSnapshotVersion(u),r.Fn=r.Fn.insert(c,u));return[2]}})})}(o.localStore,h)];case 2:l.sent();l.label=3;case 3:return[2]}})})}function nui(n,f){return r(this,void 0,void 0,function(){var r,o;return i(this,function(i){switch(i.label){case 0:return(r=n).currentUser.isEqual(f)?[3,3]:(e("SyncEngine","User change. New user:",f.toKey()),[4,cyt(r.localStore,f)]);case 1:return o=i.sent(),r.currentUser=f,(s=r).Fo.forEach(function(n){n.forEach(function(n){n.reject(new u(t.CANCELLED,"'waitForPendingWrites' promise is rejected due to a user change."))})}),s.Fo.clear(),r.sharedClientState.handleUserChange(f,o.removedBatchIds,o.addedBatchIds),[4,ee(r,o.Ln)];case 2:i.sent();i.label=3;case 3:return[2]}var s})})}function tui(n,t,u,o){return r(this,void 0,void 0,function(){var r,h;return i(this,function(i){switch(i.label){case 0:return[4,(l=(r=n).localStore,a=t,v=(c=l)._n,c.persistence.runTransaction("Lookup mutation documents","readonly",function(n){return v.jt(n,a).next(function(t){return t?c.Mn.pn(n,t):f.resolve(null)})}))];case 1:return null===(h=i.sent())?[3,6]:"pending"!==u?[3,3]:[4,ul(r.remoteStore)];case 2:return i.sent(),[3,4];case 3:"acknowledged"===u||"rejected"===u?(drt(r,t,o||null),krt(r,t),r.localStore._n.Gt(t)):s();i.label=4;case 4:return[4,ee(r,h)];case 5:return i.sent(),[3,7];case 6:e("SyncEngine","Cannot apply mutation batch with id: "+t);i.label=7;case 7:return[2]}var l,a,c,v})})}function iui(n,t){return r(this,void 0,void 0,function(){var r,s,c,u,e,l,o,f;return i(this,function(i){switch(i.label){case 0:return tut(r=n),iut(r),!0!==t||!0===r.$o?[3,3]:(s=r.sharedClientState.getAllActiveQueryTargets(),[4,uwt(r,s.toArray())]);case 1:return c=i.sent(),r.$o=!0,[4,lrt(r.remoteStore,!0)];case 2:for(i.sent(),u=0,e=c;u<e.length;u++)l=e[u],bb(r.remoteStore,l);return[3,7];case 3:return!1!==t||!1===r.$o?[3,7]:(o=[],f=Promise.resolve(),r.Vo.forEach(function(n,t){r.sharedClientState.isLocalQueryTarget(t)?o.push(t):f=f.then(function(){return ol(r,t),nl(r.localStore,t,!0)});vv(r.remoteStore,t)}),[4,f]);case 4:return i.sent(),[4,uwt(r,o)];case 5:return i.sent(),(a=r).Co.forEach(function(n,t){vv(a.remoteStore,t)}),a.No.ts(),a.Co=new Map,a.Do=new tr(h.comparator),r.$o=!1,[4,lrt(r.remoteStore,!1)];case 6:i.sent();i.label=7;case 7:return[2]}var a})})}function uwt(n,t){return r(this,void 0,void 0,function(){var u,l,a,e,v,o,s,h,c,y,f,p;return i(this,function(w){switch(w.label){case 0:u=n;l=[];a=[];e=0;v=t;w.label=1;case 1:return e<v.length?(o=v[e],s=void 0,(h=u.Vo.get(o))&&0!==h.length?[4,gc(u.localStore,au(h[0]))]:[3,7]):[3,13];case 2:s=w.sent();c=0;y=h;w.label=3;case 3:return c<y.length?(f=y[c],f=u.Po.get(f),[4,function(n,t){return r(this,void 0,void 0,function(){var u,r;return i(this,function(i){switch(i.label){case 0:return[4,cb((u=n).localStore,t.query,!0)];case 1:return r=i.sent(),r=t.view.Ao(r),[2,(u.isPrimaryClient&&grt(u,t.targetId,r.To),r)]}})})}(u,f)]):[3,6];case 4:(f=w.sent()).snapshot&&a.push(f.snapshot);w.label=5;case 5:return c++,[3,3];case 6:return[3,11];case 7:return[4,vyt(u.localStore,o)];case 8:return p=w.sent(),[4,gc(u.localStore,p)];case 9:return s=w.sent(),[4,brt(u,fwt(p),o,!1)];case 10:w.sent();w.label=11;case 11:l.push(s);w.label=12;case 12:return e++,[3,1];case 13:return[2,(u.vo._r(a),l)]}})})}function fwt(n){return oct(n.path,n.collectionGroup,n.orderBy,n.filters,n.limit,"F",n.startAt,n.endAt)}function tut(n){return n.remoteStore.remoteSyncer.applyRemoteEvent=twt.bind(null,n),n.remoteStore.remoteSyncer.getRemoteKeysForTarget=function(n,t){var u=n,i,r,f;if((n=u.Co.get(t))&&n.bo)return tt().add(n.key);if(i=tt(),!(t=u.Vo.get(t)))return i;for(r=0,f=t;r<f.length;r++)var e=f[r],e=u.Po.get(e),i=i.unionWith(e.view.wo);return i}.bind(null,n),n.remoteStore.remoteSyncer.rejectListen=function(n,t,u){return r(this,void 0,void 0,function(){var r,e,o,f;return i(this,function(i){switch(i.label){case 0:return(r=n).sharedClientState.updateQueryState(t,"rejected",u),f=r.Co.get(t),(e=f&&f.key)?(o=(o=new tr(h.comparator)).insert(e,ri.newNoDocument(e,y.min())),f=tt().add(e),f=new ktt(y.min(),new Map,new gt(w),o,f),[4,twt(r,f)]):[3,2];case 1:return i.sent(),r.Do=r.Do.remove(e),r.Co.delete(t),nut(r),[3,4];case 2:return[4,nl(r.localStore,t,!1).then(function(){return ol(r,t,u)}).catch(ls)];case 3:i.sent();i.label=4;case 4:return[2]}})})}.bind(null,n),n.vo._r=function(n,t){for(var r,e,o=n,s=!1,u=0,h=t;u<h.length;u++){var f=h[u],i=f.query,i=o.queries.get(i);if(i){for(r=0,e=i.listeners;r<e.length;r++)e[r].Hr(f)&&(s=!0);i.Wr=f}}s&&prt(o)}.bind(null,n.eventManager),n.vo.Mo=function(n,t,i){var f=n,r,u;if(n=f.queries.get(t))for(r=0,u=n.listeners;r<u.length;r++)u[r].onError(i);f.queries.delete(t)}.bind(null,n.eventManager),n}function iut(n){return n.remoteStore.remoteSyncer.applySuccessfulWrite=function(n,t){return r(this,void 0,void 0,function(){var r,u,f;return i(this,function(i){switch(i.label){case 0:r=n;u=t.batch.batchId;i.label=1;case 1:return i.trys.push([1,4,,6]),[4,cii(r.localStore,t)];case 2:return f=i.sent(),drt(r,u,null),krt(r,u),r.sharedClientState.updateMutationState(u,"acknowledged"),[4,ee(r,f)];case 3:return i.sent(),[3,6];case 4:return[4,ls(i.sent())];case 5:return i.sent(),[3,6];case 6:return[2]}})})}.bind(null,n),n.remoteStore.remoteSyncer.rejectFailedWrite=dri.bind(null,n),n}function rui(n,t,u){var f=n;!function(n,t,u){return r(this,void 0,void 0,function(){var r,o,e,s,f;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,14,,15]),[4,t.getMetadata()];case 1:return r=i.sent(),[4,(h=n.localStore,c=h,y=ui((v=r).createTime),c.persistence.runTransaction("hasNewerBundle","readonly",function(n){return c.Qe.getBundleMetadata(n,v.id)}).then(function(n){return!!n&&0<=n.createTime.compareTo(y)}))];case 2:return i.sent()?[4,t.close()]:[3,4];case 3:return[2,(i.sent(),void u._completeWith({taskState:"Success",documentsLoaded:r.totalDocuments,bytesLoaded:r.totalBytes,totalDocuments:r.totalDocuments,totalBytes:r.totalBytes}))];case 4:return u._updateProgress(bpt(r)),o=new yri(r,n.localStore,t.R),[4,t.Lo()];case 5:e=i.sent();i.label=6;case 6:return e?[4,o.oo(e)]:[3,10];case 7:return(s=i.sent())&&u._updateProgress(s),[4,t.Lo()];case 8:e=i.sent();i.label=9;case 9:return[3,6];case 10:return[4,o.complete()];case 11:return f=i.sent(),[4,ee(n,f.wn,void 0)];case 12:return i.sent(),[4,(h=n.localStore,l=r,(a=h).persistence.runTransaction("Save bundle","readwrite",function(n){return a.Qe.saveBundleMetadata(n,l)}))];case 13:return i.sent(),u._completeWith(f.progress),[3,15];case 14:return ca("SyncEngine","Loading bundle failed with "+(f=i.sent())),u._failWith(f),[3,15];case 15:return[2]}var l,a,h,v,c,y})})}(f,t,u).then(function(){f.sharedClientState.notifyBundleLoaded()})}function ks(){}function tk(n,t){var i=this;return(i=rut.call(this,n,t,!1)||this).Ko=n,i.cacheSizeBytes=t,i.synchronizeTabs=!0,i}function ds(n,t,i){var r=this;return(r=uut.call(this)||this).Ko=n,r.cacheSizeBytes=t,r.forceOwnership=i,r.synchronizeTabs=!1,r}function gs(){this.synchronizeTabs=!1}function swt(n,t){void 0===t&&(t=10240);var u=0;return{read:function(){return r(this,void 0,void 0,function(){var r;return i(this,function(){return u<n.byteLength?(r={value:n.slice(u,u+t),done:!1},[2,(u+=t,r)]):[2,{done:!0}]})})},cancel:function(){return r(this,void 0,void 0,function(){return i(this,function(){return[2]})})},releaseLock:function(){},closed:Promise.reject("unimplemented")}}function pv(n,t,u){var f=this;this.credentials=n;this.asyncQueue=t;this.databaseInfo=u;this.user=tu.UNAUTHENTICATED;this.clientId=wn.u();this.credentialListener=function(){return Promise.resolve()};this.credentials.setChangeListener(t,function(n){return r(f,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return e("FirestoreClient","Received user=",n.uid),[4,this.credentialListener(n)];case 1:return t.sent(),this.user=n,[2]}})})})}function sl(n,t,i,r){this.asyncQueue=n;this.datastore=t;this.updateFunction=i;this.deferred=r;this.ec=5;this.Zi=new ort(this.asyncQueue,"transaction_retry")}function uf(n){this.datastore=n;this.readVersions=new Map;this.mutations=[];this.committed=!1;this.lastWriteError=null;this.writtenDocs=new Set}function yf(n,t){var i=this;this.Go=n;this.R=t;this.metadata=new cr;this.buffer=new Uint8Array;this.zo=new TextDecoder("utf-8");this.Ho().then(function(n){n&&n.io()?i.metadata.resolve(n.payload.metadata):i.metadata.reject(new Error("The first element of the bundle is not a metadata, it is\n             "+JSON.stringify(null==n?void 0:n.payload)))},function(n){return i.metadata.reject(n)})}function wv(n){this.observer=n;this.muted=!1}function hwt(n,t){return r(this,void 0,void 0,function(){var u,f,o=this;return i(this,function(s){switch(s.label){case 0:return n.asyncQueue.verifyOperationInProgress(),e("FirestoreClient","Initializing OfflineComponentProvider"),[4,n.getConfiguration()];case 1:return u=s.sent(),[4,t.initialize(u)];case 2:return s.sent(),f=u.initialUser,n.setCredentialChangeListener(function(n){return r(o,void 0,void 0,function(){return i(this,function(i){switch(i.label){case 0:return f.isEqual(n)?[3,2]:[4,cyt(t.localStore,n)];case 1:i.sent();f=n;i.label=2;case 2:return[2]}})})}),t.persistence.setDatabaseDeletedListener(function(){return n.terminate()}),n.offlineComponents=t,[2]}})})}function cwt(n,t){return r(this,void 0,void 0,function(){var u,f;return i(this,function(o){switch(o.label){case 0:return n.asyncQueue.verifyOperationInProgress(),[4,eut(n)];case 1:return u=o.sent(),e("FirestoreClient","Initializing OnlineComponentProvider"),[4,n.getConfiguration()];case 2:return f=o.sent(),[4,t.initialize(u,f)];case 3:return o.sent(),n.setCredentialChangeListener(function(n){return function(n,t){return r(this,void 0,void 0,function(){var r,u;return i(this,function(i){switch(i.label){case 0:return(r=n).asyncQueue.verifyOperationInProgress(),e("RemoteStore","RemoteStore received new credentials"),u=fo(r),r.Or.add(3),[4,rl(r)];case 1:return i.sent(),u&&r.Br.set("Unknown"),[4,r.remoteSyncer.handleCredentialChange(t)];case 2:return i.sent(),r.Or.delete(3),[4,av(r)];case 3:return i.sent(),[2]}})})}(t.remoteStore,n)}),n.onlineComponents=t,[2]}})})}function eut(n){return r(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return n.offlineComponents?[3,2]:(e("FirestoreClient","Using default OfflineComponentProvider"),[4,hwt(n,new ewt)]);case 1:t.sent();t.label=2;case 2:return[2,n.offlineComponents]}})})}function rk(n){return r(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return n.onlineComponents?[3,2]:(e("FirestoreClient","Using default OnlineComponentProvider"),[4,cwt(n,new fut)]);case 1:t.sent();t.label=2;case 2:return[2,n.onlineComponents]}})})}function lwt(n){return eut(n).then(function(n){return n.persistence})}function out(n){return eut(n).then(function(n){return n.localStore})}function awt(n){return rk(n).then(function(n){return n.remoteStore})}function sut(n){return rk(n).then(function(n){return n.syncEngine})}function hl(n){return r(this,void 0,void 0,function(){var t,u;return i(this,function(f){switch(f.label){case 0:return[4,rk(n)];case 1:return t=f.sent(),[2,((u=t.eventManager).onListen=function(n,t){return r(this,void 0,void 0,function(){var r,f,o,e,u;return i(this,function(i){switch(i.label){case 0:return r=tut(n),(u=r.Po.get(t))?(f=u.targetId,r.sharedClientState.addLocalQueryTarget(f),o=u.view.Ro(),[3,4]):[3,1];case 1:return[4,gc(r.localStore,au(t))];case 2:return e=i.sent(),u=r.sharedClientState.addLocalQueryTarget(e.targetId),f=e.targetId,[4,brt(r,t,f,"current"===u)];case 3:o=i.sent();r.isPrimaryClient&&bb(r.remoteStore,e);i.label=4;case 4:return[2,o]}})})}.bind(null,t.syncEngine),u.onUnlisten=function(n,t){return r(this,void 0,void 0,function(){var r,u,f;return i(this,function(i){switch(i.label){case 0:return u=(r=n).Po.get(t),1<(f=r.Vo.get(u.targetId)).length?[2,(r.Vo.set(u.targetId,f.filter(function(n){return!wa(n,t)})),void r.Po.delete(t))]:r.isPrimaryClient?(r.sharedClientState.removeLocalQueryTarget(u.targetId),r.sharedClientState.isActiveQueryTarget(u.targetId)?[3,2]:[4,nl(r.localStore,u.targetId,!1).then(function(){r.sharedClientState.clearQueryState(u.targetId);vv(r.remoteStore,u.targetId);ol(r,u.targetId)}).catch(ls)]):[3,3];case 1:i.sent();i.label=2;case 2:return[3,5];case 3:return ol(r,u.targetId),[4,nl(r.localStore,u.targetId,!0)];case 4:i.sent();i.label=5;case 5:return[2]}})})}.bind(null,t.syncEngine),u)]}})})}function vwt(n,f,e){var s=this,o;return void 0===e&&(e={}),o=new cr,n.asyncQueue.enqueueAndForget(function(){return r(s,void 0,void 0,function(){var r;return i(this,function(i){switch(i.label){case 0:return r=function(n,i,r,f,e){var s=new ik({next:function(s){i.enqueueAndForget(function(){return yrt(n,o)});var h=s.docs.has(r);!h&&s.fromCache?e.reject(new u(t.UNAVAILABLE,"Failed to get document because the client is offline.")):h&&s.fromCache&&f&&"server"===f.source?e.reject(new u(t.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):e.resolve(s)},error:function(n){return e.reject(n)}}),o=new wrt(nc(r.path),s,{includeMetadataChanges:!0,so:!0});return vrt(n,o)},[4,hl(n)];case 1:return[2,r.apply(void 0,[i.sent(),n.asyncQueue,f,e,o])]}})})}),o.promise}function ywt(n,f,e){var s=this,o;return void 0===e&&(e={}),o=new cr,n.asyncQueue.enqueueAndForget(function(){return r(s,void 0,void 0,function(){var r;return i(this,function(i){switch(i.label){case 0:return r=function(n,i,r,f,e){var s=new ik({next:function(r){i.enqueueAndForget(function(){return yrt(n,o)});r.fromCache&&"server"===f.source?e.reject(new u(t.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):e.resolve(r)},error:function(n){return e.reject(n)}}),o=new wrt(r,s,{includeMetadataChanges:!0,so:!0});return vrt(n,o)},[4,hl(n)];case 1:return[2,r.apply(void 0,[i.sent(),n.asyncQueue,f,e,o])]}})})}),o.promise}function pwt(n,t){this.user=t;this.type="OAuth";this.authHeaders={};this.authHeaders.Authorization="Bearer "+n}function bv(n,t,i){this.hc=n;this.lc=t;this.fc=i}function kwt(n,t,i){this.hc=n;this.lc=t;this.fc=i;this.type="FirstParty";this.user=tu.FIRST_PARTY}function cl(n){function i(n){e("FirebaseCredentialsProvider","Auth detected");t.auth=n;t.auth.addAuthTokenListener(t.uc)}var t=this;this.currentUser=tu.UNAUTHENTICATED;this.oc=new cr;this.cc=0;this.forceRefresh=!1;this.auth=null;this.asyncQueue=null;this.uc=function(){t.cc++;t.currentUser=t.ac();t.oc.resolve();t.changeListener&&t.asyncQueue.enqueueRetryable(function(){return t.changeListener(t.currentUser)})};n.onInit(i);setTimeout(function(){var r;t.auth||((r=n.getImmediate({optional:!0}))?i(r):(e("FirebaseCredentialsProvider","Auth not yet detected"),t.oc.resolve()))},0)}function kv(n){this.token=n;this.changeListener=null}function dv(){this.changeListener=null}function fk(n,t){this.projectId=n;this.database=t||"(default)"}function hut(n,i,r){if(!r)throw new u(t.INVALID_ARGUMENT,"Function "+n+"() cannot be called with an empty "+i+".");}function cut(n,i){if(void 0===i)return{merge:!1};if(void 0!==i.mergeFields&&void 0!==i.merge)throw new u(t.INVALID_ARGUMENT,"Invalid options passed to function "+n+'(): You cannot specify both "merge" and "mergeFields".');return i}function dwt(n,i,r,f){if(!0===i&&!0===f)throw new u(t.INVALID_ARGUMENT,n+" and "+r+" cannot be used together.");}function gwt(n){if(!h.isDocumentKey(n))throw new u(t.INVALID_ARGUMENT,"Invalid document reference. Document references must have an even number of segments, but "+n+" has "+n.length+".");}function nbt(n){if(h.isDocumentKey(n))throw new u(t.INVALID_ARGUMENT,"Invalid collection reference. Collection references must have an odd number of segments, but "+n+" has "+n.length+".");}function ek(n){if(void 0===n)return"undefined";if(null===n)return"null";if("string"==typeof n)return 20<n.length&&(n=n.substring(0,20)+"..."),JSON.stringify(n);if("number"==typeof n||"boolean"==typeof n)return""+n;if("object"!=typeof n)return"function"==typeof n?"a function":s();if(n instanceof Array)return"an array";var t=function(){if(n.constructor){var t=/function\s+([^\s(]+)\s*\(/.exec(n.constructor.toString());if(t&&1<t.length)return t[1]}return null}();return t?"a custom "+t+" object":"an object"}function d(n,i){if((n="_delegate"in n?n._delegate:n)instanceof i)return n;if(i.name===n.constructor.name)throw new u(t.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");n=ek(n);throw new u(t.INVALID_ARGUMENT,"Expected type '"+i.name+"', but it was: "+n);}function tbt(n,i){if(i<=0)throw new u(t.INVALID_ARGUMENT,"Function "+n+"() requires a positive number, but it was: "+i+".");}function nh(n,t,i){var r=this;return(r=ibt.call(this,n,t,nc(i))||this)._path=i,r.type="collection",r}function lut(n,t,i){this.converter=t;this._query=i;this.type="query";this.firestore=n}function th(n,t,i){this.converter=t;this._key=i;this.type="document";this.firestore=n}function pf(n,i){this.type="firestore-lite";this._persistenceKey="(lite)";this._settings=new rbt({});this._settingsFrozen=!1;n instanceof uk?(this._databaseId=n,this._credentials=new bwt):(this._app=n,this._databaseId=function(n){if(!Object.prototype.hasOwnProperty.apply(n.options,["projectId"]))throw new u(t.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new uk(n.options.projectId)}(n),this._credentials=new lui(i))}function ubt(n){var i;if(void 0===n.host){if(void 0!==n.ssl)throw new u(t.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com";this.ssl=!0}else this.host=n.host,this.ssl=null===(i=n.ssl)||void 0===i||i;if(this.credentials=n.credentials,this.ignoreUndefinedProperties=!!n.ignoreUndefinedProperties,void 0===n.cacheSizeBytes)this.cacheSizeBytes=41943040;else{if(-1!==n.cacheSizeBytes&&n.cacheSizeBytes<1048576)throw new u(t.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=n.cacheSizeBytes}this.experimentalForceLongPolling=!!n.experimentalForceLongPolling;this.experimentalAutoDetectLongPolling=!!n.experimentalAutoDetectLongPolling;this.useFetchStreams=!!n.useFetchStreams;dwt("experimentalForceLongPolling",n.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",n.experimentalAutoDetectLongPolling)}function fbt(n,i){for(var r,e=[],f=2;f<arguments.length;f++)e[f-2]=arguments[f];if(n=yt(n),hut("collection","path",i),n instanceof gv)return nbt(r=k.fromString.apply(k,g([i],e))),new so(n,null,r);if(!(n instanceof ht||n instanceof so))throw new u(t.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");return nbt(r=k.fromString.apply(k,g([n.path],e)).child(k.fromString(i))),new so(n.firestore,null,r)}function ok(n,i){for(var r,e=[],f=2;f<arguments.length;f++)e[f-2]=arguments[f];if(n=yt(n),hut("doc","path",i=1===arguments.length?wn.u():i),n instanceof gv)return gwt(r=k.fromString.apply(k,g([i],e))),new ht(n,null,new h(r));if(!(n instanceof ht||n instanceof so))throw new u(t.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");return gwt(r=n._path.child(k.fromString.apply(k,g([i],e)))),new ht(n.firestore,n instanceof so?n.converter:null,new h(r))}function ebt(n,t){return n=yt(n),t=yt(t),(n instanceof ht||n instanceof so)&&(t instanceof ht||t instanceof so)&&n.firestore===t.firestore&&n.path===t.path&&n.converter===t.converter}function obt(n,t){return n=yt(n),t=yt(t),n instanceof iu&&t instanceof iu&&n.firestore===t.firestore&&wa(n._query,t._query)&&n.converter===t.converter}function di(){var t=this,n;this.dc=Promise.resolve();this.wc=[];this._c=!1;this.mc=[];this.yc=null;this.gc=!1;this.Ec=[];this.Zi=new ort(this,"async_queue_retry");this.Tc=function(){var n=wb();n&&e("AsyncQueue","Visibility state changed to "+n.visibilityState);t.Zi.Gi()};n=wb();n&&"function"==typeof n.addEventListener&&n.addEventListener("visibilitychange",this.Tc)}function ll(n){return function(){var i;if("object"==typeof n&&null!==n)for(var r=n,t=0,u=["next","error","complete"];t<u.length;t++)if(i=u[t],i in r&&"function"==typeof r[i])return 1}()}function aut(n,t){var i=this;return(i=hbt.call(this,n,t)||this).type="firestore",i._queue=new sbt,i._persistenceKey="name"in n?n.name:"[DEFAULT]",i}function ih(){this._progressObserver={};this._taskCompletionResolver=new cr;this._lastProgress={taskState:"Running",totalBytes:0,totalDocuments:0,bytesLoaded:0,documentsLoaded:0}}function ci(n){return n._firestoreClient||lbt(n),n._firestoreClient.verifyNotTerminated(),n._firestoreClient}function lbt(n){var r,u,i,t=n._freezeSettings(),t=(r=n._databaseId,u=(null===(i=n._app)||void 0===i?void 0:i.options.appId)||"",i=n._persistenceKey,new hui(r,u,i,t.host,t.ssl,t.experimentalForceLongPolling,t.experimentalAutoDetectLongPolling,t.useFetchStreams));n._firestoreClient=new sui(n._credentials,n._queue,t)}function abt(n,u,f){var o=this,e=new cr;return n.asyncQueue.enqueue(function(){return r(o,void 0,void 0,function(){var r;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,hwt(n,f)];case 1:return i.sent(),[4,cwt(n,u)];case 2:return i.sent(),e.resolve(),[3,4];case 3:if(!("FirebaseError"===(r=i.sent()).name?r.code===t.FAILED_PRECONDITION||r.code===t.UNIMPLEMENTED:!("undefined"!=typeof DOMException&&r instanceof DOMException)||22===r.code||20===r.code||11===r.code))throw r;return console.warn("Error enabling offline persistence. Falling back to persistence disabled: "+r),e.reject(r),[3,4];case 4:return[2]}})})}).then(function(){return e.promise})}function vbt(n){if(n._initialized||n._terminated)throw new u(t.FAILED_PRECONDITION,"Firestore has already been started and persistence can no longer be enabled. You can only enable persistence before calling any other methods on a Firestore object.");}function pbt(n,t,i){this.data=n;this.fieldMask=t;this.fieldTransforms=i}function wbt(n,t,i){this.data=n;this.fieldMask=t;this.fieldTransforms=i}function al(n,i){if(!isFinite(n)||n<-90||90<n)throw new u(t.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+n);if(!isFinite(i)||i<-180||180<i)throw new u(t.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+i);this._lat=n;this._long=i}function oe(n){this._byteString=n}function bbt(){for(var r,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];for(r=0;r<n.length;++r)if(0===n[r].length)throw new u(t.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new ku(n)}function kbt(n){switch(n){case 0:case 2:case 1:return 1;case 3:case 4:return;default:throw s();}}function gbt(n,t,i){this.databaseId=n;this.ignoreUndefinedProperties=t;this.R=i||lv(n)}function yu(n,t,i,r,u,f){this.settings=n;this.databaseId=t;this.R=i;this.ignoreUndefinedProperties=r;void 0===u&&this.Dc();this.fieldTransforms=u||[];this.fieldMask=f||[]}function fh(n){var t=n._freezeSettings(),i=lv(n._databaseId);return new dbt(n._databaseId,!!t.ignoreUndefinedProperties,i)}function hk(n,i,r,f,e,o){var s=n.qc((o=void 0===o?{}:o).merge||o.mergeFields?2:0,i,r,e),h,l,f,c;if(kut("Data must be an object, but it was:",s,f),f=fkt(f,s),o.merge)h=new kh(s.fieldMask),l=s.fieldTransforms;else if(o.mergeFields){for(var a=[],v=0,y=o.mergeFields;v<y.length;v++){if(c=dut(i,y[v],r),!s.contains(c))throw new u(t.INVALID_ARGUMENT,"Field '"+c+"' is specified in your field mask but missing from your input data.");skt(a,c)||a.push(c)}h=new kh(a);l=s.fieldTransforms.filter(function(n){return h.covers(n.field)})}else h=null,l=s.fieldTransforms;return new pui(new kr(f),h,l)}function ny(){return null!==yut&&yut.apply(this,arguments)||this}function nkt(n,t,i){return new vut({Cc:3,Bc:t.settings.Bc,methodName:n._methodName,Fc:i},t.databaseId,t.R,t.ignoreUndefinedProperties)}function lk(n,t){var i=this;return(i=tkt.call(this,n)||this).Qc=t,i}function ak(n,t){var i=this;return(i=ikt.call(this,n)||this).Uc=t,i}function vk(n,t){var i=this;return(i=rkt.call(this,n)||this).Uc=t,i}function ty(){return null!==put&&put.apply(this,arguments)||this}function wut(n,t,i,r){var f=n.qc(1,t,i),u,e;return kut("Data must be an object, but it was:",f,r),u=[],e=kr.empty(),ns(r,function(n,r){var o=gut(t,n,i);r=yt(r);n=f.$c(o);r instanceof ck?u.push(o):null!=(n=eh(r,n))&&(u.push(o),e.set(o,n))}),r=new kh(u),new ybt(e,r,f.fieldTransforms)}function but(n,i,r,f,e,o){var p=n.qc(1,i,r),l=[dut(i,f,r)],w=[e],s;if(o.length%2!=0)throw new u(t.INVALID_ARGUMENT,"Function "+i+"() needs to be called with an even number of arguments that alternate between field names and values.");for(s=0;s<o.length;s+=2)l.push(dut(i,o[s])),w.push(o[s+1]);for(var h,a,v,y=[],b=kr.empty(),c=l.length-1;0<=c;--c)skt(y,l[c])||(h=l[c],a=yt(a=w[c]),v=p.$c(h),a instanceof ck?y.push(h):null!=(v=eh(a,v))&&(y.push(h),b.set(h,v)));return e=new kh(y),new ybt(b,e,p.fieldTransforms)}function ukt(n,t,i,r){return eh(i,n.qc((r=void 0===r?!1:r)?4:3,t))}function eh(n,t){if(ekt(n=yt(n)))return kut("Unsupported field value:",t,n),fkt(n,t);if(n instanceof uh)return function(n,t){if(!kbt(t.Cc))throw t.Mc(n._methodName+"() can only be used with update() and set()");if(!t.path)throw t.Mc(n._methodName+"() is not currently supported inside arrays");n=n._toFieldTransform(t);n&&t.fieldTransforms.push(n)}(n,t),null;if(void 0===n&&t.ignoreUndefinedProperties)return null;if(t.path&&t.fieldMask.push(t.path),n instanceof Array){if(t.settings.Fc&&4!==t.Cc)throw t.Mc("Nested arrays are not supported");return function(t){for(var i,u=[],f=0,r=0,e=n;r<e.length;r++)i=eh(e[r],t.Oc(f)),null==i&&(i={nullValue:"NULL_VALUE"}),u.push(i),f++;return{arrayValue:{values:u}}}(t)}return function(t,i){var r,u;if(null===(t=yt(n)))return{nullValue:"NULL_VALUE"};if("number"==typeof t)return vct(i.R,t);if("boolean"==typeof t)return{booleanValue:t};if("string"==typeof t)return{stringValue:t};if(t instanceof Date)return r=or.fromDate(t),{timestampValue:ka(i.R,r)};if(t instanceof or)return r=new or(t.seconds,1e3*Math.floor(t.nanoseconds/1e3)),{timestampValue:ka(i.R,r)};if(t instanceof sk)return{geoPointValue:{latitude:t.latitude,longitude:t.longitude}};if(t instanceof rh)return{bytesValue:eat(i.R,t._byteString)};if(t instanceof ht){if(r=i.databaseId,u=t.firestore._databaseId,!u.isEqual(r))throw i.Mc("Document reference is for database "+u.projectId+"/"+u.database+" but should be for database "+r.projectId+"/"+r.database);return{referenceValue:tit(t.firestore._databaseId||i.databaseId,t._key.path)}}throw i.Mc("Unsupported field value: "+ek(t));}(0,t)}function fkt(n,t){var i={};return hht(n)?t.path&&0<t.path.length&&t.fieldMask.push(t.path):ns(n,function(n,r){r=eh(r,t.xc(n));null!=r&&(i[n]=r)}),{mapValue:{fields:i}}}function ekt(n){return!("object"!=typeof n||null===n||n instanceof Array||n instanceof Date||n instanceof or||n instanceof sk||n instanceof rh||n instanceof ht||n instanceof uh)}function kut(n,t,i){if(!ekt(i)||"object"!=typeof(r=i)||null===r||Object.getPrototypeOf(r)!==Object.prototype&&null!==Object.getPrototypeOf(r)){i=ek(i);throw"an object"===i?t.Mc(n+" a custom object"):t.Mc(n+" "+i);}var r}function dut(n,t,i){if((t=yt(t))instanceof wf)return t._internalPath;if("string"==typeof t)return gut(n,t);throw yk("Field path arguments must be of type string or FieldPath.",n,!1,void 0,i);}function gut(n,t,i){if(0<=t.search(okt))throw yk("Invalid field path ("+t+"). Paths must not contain '~', '*', '/', '[', or ']'",n,!1,void 0,i);try{return(new(wf.bind.apply(wf,g([void 0],t.split(".")))))._internalPath}catch(r){throw yk("Invalid field path ("+t+"). Paths must not be empty, begin with '.', end with '.', or contain '..'",n,!1,void 0,i);}}function yk(n,i,r,f,e){var o=f&&!f.isEmpty(),s=void 0!==e,i="Function "+i+"() called with invalid data";return r&&(i+=" (via `toFirestore()`)"),r="",(o||s)&&(r+=" (found",o&&(r+=" in field "+f),s&&(r+=" in document "+e),r+=")"),new u(t.INVALID_ARGUMENT,(i+=". ")+n+r)}function skt(n,t){return n.some(function(n){return n.isEqual(t)})}function nft(){return null!==pk&&pk.apply(this,arguments)||this}function yl(n,t,i,r,u){this._firestore=n;this._userDataWriter=t;this._key=i;this._document=r;this._converter=u}function wk(n,t){return"string"==typeof t?gut(n,t):(t instanceof wf?t:t._delegate)._internalPath}function pl(n,t,i,r){this._firestore=n;this._userDataWriter=t;this._snapshot=r;this.metadata=new oh(r.hasPendingWrites,r.fromCache);this.query=i}function ift(){return null!==bk&&bk.apply(this,arguments)||this}function ry(n,t,i,r,u,f){var e=this;return(e=tft.call(this,n,t,i,r,f)||this)._firestore=n,e._firestoreImpl=n,e.metadata=u,e}function ckt(n,t){this.hasPendingWrites=n;this.fromCache=t}function lkt(n,t){return n instanceof se&&t instanceof se?n._firestore===t._firestore&&n._key.isEqual(t._key)&&(null===n._document?null===t._document:n._document.isEqual(t._document))&&n._converter===t._converter:n instanceof ho&&t instanceof ho&&n._firestore===t._firestore&&obt(n.query,t.query)&&n.metadata.isEqual(t.metadata)&&n._snapshot.isEqual(t._snapshot)}function akt(n){if(yw(n)&&0===n.explicitOrderBy.length)throw new u(t.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause");}function co(n){for(var i,u,r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];for(i=0,u=r;i<u.length;i++)n=u[i]._apply(n);return n}function rft(n,t,i){var r=this;return(r=vkt.call(this)||this).type=n,r.Jc=t,r.Yc=i,r}function uft(n,t,i){var r=this;return(r=ykt.call(this)||this).type=n,r.Jc=t,r.Yc=i,r}function fft(n,t,i){var r=this;return(r=pkt.call(this)||this).type=n,r.zc=t,r.Hc=i,r}function eft(n,t){var i=this;return(i=wkt.call(this)||this).Kc=n,i.Gc=t,i.type="orderBy",i}function oft(n,t,i){var r=this;return(r=bkt.call(this)||this).Kc=n,r.jc=t,r.Wc=i,r.type="where",r}function ndt(n,i,r,f){if(r[0]=yt(r[0]),r[0]instanceof vl)return function(n,r,f,e){var o,s;if(!f)throw new u(t.NOT_FOUND,"Can't use a DocumentSnapshot that doesn't exist for "+i+"().");for(var h=[],c=0,l=tc(n);c<l.length;c++)if(o=l[c],o.field.isKeyField())h.push(sw(r,f.key));else{if(s=f.data.field(o.field),gn(s))throw new u(t.INVALID_ARGUMENT,'Invalid query. You are trying to start or end a query using a document for which the field "'+o.field+'" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');if(null===s){o=o.field.canonicalString();throw new u(t.INVALID_ARGUMENT,"Invalid query. You are trying to start or end a query using a document for which the field '"+o+"' (used as the orderBy) does not exist.");}h.push(s)}return new pa(h,e)}(n._query,n.firestore._databaseId,r[0]._document,f);var e=fh(n.firestore);return function(n,i,r,f,e,o){var v=n.explicitOrderBy,a,l,s,c;if(e.length>v.length)throw new u(t.INVALID_ARGUMENT,"Too many arguments provided to "+f+"(). The number of arguments must be less than or equal to the number of orderBy() clauses");for(a=[],l=0;l<e.length;l++)if(s=e[l],v[l].field.isKeyField()){if("string"!=typeof s)throw new u(t.INVALID_ARGUMENT,"Invalid query. Expected a string for document ID in "+f+"(), but got a "+typeof s);if(!att(n)&&-1!==s.indexOf("/"))throw new u(t.INVALID_ARGUMENT,"Invalid query. When querying a collection and ordering by FieldPath.documentId(), the value passed to "+f+"() must be a plain document ID, but '"+s+"' contains a slash.");if(c=n.path.child(k.fromString(s)),!h.isDocumentKey(c))throw new u(t.INVALID_ARGUMENT,"Invalid query. When querying a collection group and ordering by FieldPath.documentId(), the value passed to "+f+"() must result in a valid document path, but '"+c+"' is not because it contains an odd number of segments.");c=new h(c);a.push(sw(i,c))}else s=ukt(r,f,s),a.push(s);return new pa(a,o)}(n._query,n.firestore._databaseId,e,i,r,f)}function tdt(n,i,r){if("string"==typeof(r=yt(r))){if(""===r)throw new u(t.INVALID_ARGUMENT,"Invalid query. When querying with FieldPath.documentId(), you must provide a valid document ID, but it was an empty string.");if(!att(i)&&-1!==r.indexOf("/"))throw new u(t.INVALID_ARGUMENT,"Invalid query. When querying a collection by FieldPath.documentId(), you must provide a plain document ID, but '"+r+"' contains a '/' character.");if(i=i.path.child(k.fromString(r)),!h.isDocumentKey(i))throw new u(t.INVALID_ARGUMENT,"Invalid query. When querying a collection group by FieldPath.documentId(), the value provided must result in a valid document path, but '"+i+"' is not because it has an odd number of segments ("+i.length+").");return sw(n,new h(i))}if(r instanceof ht)return sw(n,r._key);throw new u(t.INVALID_ARGUMENT,"Invalid query. When querying with FieldPath.documentId(), you must provide a valid string or a DocumentReference, but it was: "+ek(r)+".");}function idt(n,i){if(!Array.isArray(n)||0===n.length)throw new u(t.INVALID_ARGUMENT,"Invalid Query. A non-empty array is required for '"+i.toString()+"' filters.");if(10<n.length)throw new u(t.INVALID_ARGUMENT,"Invalid Query. '"+i.toString()+"' filters support a maximum of 10 elements in the value array.");}function rdt(n,i,r){if(!r.isEqual(i))throw new u(t.INVALID_ARGUMENT,"Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '"+i.toString()+"' and so you must also use '"+i.toString()+"' as your first argument to orderBy(), but your first orderBy() is on field '"+r.toString()+"' instead.");}function lo(){}function kk(n,t,i){return n?i&&(i.merge||i.mergeFields)?n.toFirestore(t,i):n.toFirestore(t):t}function wl(n,t){this._firestore=n;this._commitHandler=t;this._mutations=[];this._committed=!1;this._dataReader=fh(n)}function dk(n){var t=this;return(t=udt.call(this)||this).firestore=n,t}function ao(n,i){if((n=yt(n)).firestore!==i)throw new u(t.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return n}function gk(n){var t=this;return(t=odt.call(this)||this).firestore=n,t}function sdt(n,t,i){for(var f,e,u=[],r=3;r<arguments.length;r++)u[r-3]=arguments[r];return n=d(n,ht),f=d(n.firestore,at),e=fh(f),uy(f,[("string"==typeof(t=yt(t))||t instanceof wf?but(e,"updateDoc",n._key,t,i,u):wut(e,"updateDoc",n._key,t)).toMutation(n._key,yi.exists(!0))])}function hdt(n){for(var f,u,e,h,o,c,a,l,v,t=[],s=1;s<arguments.length;s++)t[s-1]=arguments[s];return n=yt(n),f={includeMetadataChanges:!1},u=0,"object"!=typeof t[u]||ll(t[u])||(f=t[u],u++),v={includeMetadataChanges:f.includeMetadataChanges},ll(t[u])&&(e=t[u],t[u]=null===(f=e.next)||void 0===f?void 0:f.bind(e),t[u+1]=null===(f=e.error)||void 0===f?void 0:f.bind(e),t[u+2]=null===(f=e.complete)||void 0===f?void 0:f.bind(e)),n instanceof ht?(o=d(n.firestore,at),c=nc(n._key.path),l={next:function(i){t[u]&&t[u](sft(o,n,i))},error:t[u+1],complete:t[u+2]}):(h=d(n,iu),o=d(h.firestore,at),c=h._query,a=new vo(o),l={next:function(n){t[u]&&t[u](new ho(o,a,h,n))},error:t[u+1],complete:t[u+2]},akt(n._query)),function(n,t,u){var f=this,e=new ik(l),o=new wrt(t,e,u);return n.asyncQueue.enqueueAndForget(function(){return r(f,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return t=vrt,[4,hl(n)];case 1:return[2,t.apply(void 0,[i.sent(),o])]}})})}),function(){e.Wo();n.asyncQueue.enqueueAndForget(function(){return r(f,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return t=yrt,[4,hl(n)];case 1:return[2,t.apply(void 0,[i.sent(),o])]}})})})}}(ci(o),c,v)}function uy(n,t){return function(n,t){var f=this,u=new cr;return n.asyncQueue.enqueueAndForget(function(){return r(f,void 0,void 0,function(){var r;return i(this,function(i){switch(i.label){case 0:return r=kri,[4,sut(n)];case 1:return[2,r.apply(void 0,[i.sent(),t,u])]}})})}),u.promise}(ci(n),t)}function sft(n,t,i){var r=i.docs.get(t._key),u=new vo(n);return new se(n,u,t._key,r,new oh(i.hasPendingWrites,i.fromCache),t.converter)}function cft(n,t){var i=this;return(i=hft.call(this,n,t)||this)._firestore=n,i}function fy(n,t){this._firestore=n;this._transaction=t;this._dataReader=fh(n)}function ldt(){if("undefined"==typeof Uint8Array)throw new u(t.UNIMPLEMENTED,"Uint8Arrays are not available in this environment.");}function adt(){if("undefined"==typeof atob)throw new u(t.UNIMPLEMENTED,"Blobs are unavailable in Firestore in this environment.");}function td(n){var t=this;return(t=vdt.call(this)||this).firestore=n,t}function ti(n,t,i){var r=this;this._delegate=t;this.Xc=i;this.INTERNAL={"delete":function(){return r.terminate()}};n instanceof uk||(this.Zc=n)}function id(){}function he(n){this._delegate=n}function bl(n,t,i){this._firestore=n;this._userDataWriter=t;this._delegate=i}function ey(n){this._delegate=n}function oy(n,t){this._firestore=n;this._delegate=t;this._userDataWriter=new nd(n)}function gi(n,t){this.firestore=n;this._delegate=t;this._userDataWriter=new nd(n)}function yr(n,t,i){return n.message=n.message.replace(t,i),n}function bdt(n){for(var i,t=0,r=n;t<r.length;t++)if(i=r[t],"object"==typeof i&&!ll(i))return i;return{}}function kdt(n,t){var i;return{next:function(n){i.next&&i.next(t(n))},error:null===(n=(i=ll(n[0])?n[0]:ll(n[1])?n[1]:"function"==typeof n[0]?{next:n[0],error:n[1],complete:n[2]}:{next:n[1],error:n[2],complete:n[3]}).error)||void 0===n?void 0:n.bind(i),complete:null===(n=i.complete)||void 0===n?void 0:n.bind(i)}}function bf(n,t){var i=this;return(i=ddt.call(this,n,t)||this).firestore=n,i._delegate=t,i}function ce(n,t){this._firestore=n;this._delegate=t}function ly(n,t){this._firestore=n;this._delegate=t}function vt(n,t){this.firestore=n;this._delegate=t;this._userDataWriter=new nd(n)}function yft(){return null!==aft&&aft.apply(this,arguments)||this}function po(n,t){this._firestore=n;this._delegate=t}function sh(n){return d(n,ht)}function pu(n){this._delegate=n}function fd(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._delegate=new(wf.bind.apply(wf,g([void 0],t)))}function rfi(n){return t=this._delegate,u=n,f=ci(t=d(t,at)),n=new cbt,function(n,t,f){var e,o=this,s=(e=u,t=lv(t),e=function(n){if(n instanceof Uint8Array)return swt(n,void 0);if(n instanceof ArrayBuffer)return swt(new Uint8Array(n),void 0);if(n instanceof ReadableStream)return n.getReader();throw new Error("Source of `toByteStreamReader` has to be a ArrayBuffer or ReadableStream");}("string"==typeof e?(new TextEncoder).encode(e):e),new fui(e,t));n.asyncQueue.enqueueAndForget(function(){return r(o,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return t=rui,[4,sut(n)];case 1:return t.apply(void 0,[i.sent(),s,f]),[2]}})})})}(f,t._databaseId,n),n;var t,u,f}function ufi(n){var u=this,t=this._delegate,n=n;return function(n,t){var u=this;return n.asyncQueue.enqueue(function(){return r(u,void 0,void 0,function(){var r;return i(this,function(i){switch(i.label){case 0:return r=function(n,t){var i=n;return i.persistence.runTransaction("Get named query","readonly",function(n){return i.Qe.getNamedQuery(n,t)})},[4,out(n)];case 1:return[2,r.apply(void 0,[i.sent(),t])]}})})})}(ci(t=d(t,at)),n).then(function(n){return n?new iu(t,null,n.query):null}).then(function(n){return n?new cy(u,n):null})}function ay(n,t,i){this.name=n;this.instanceFactory=t;this.type=i;this.multipleInstances=!1;this.serviceProps={};this.instantiationMode="LAZY";this.onInstanceCreated=null}var ugt=rgt(n),pft=function(n,t){return(pft=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])})(n,t)},wft=function(){return(wft=Object.assign||function(n){for(var r,i,t=1,u=arguments.length;t<u;t++)for(i in r=arguments[t])Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i]);return n}).apply(this,arguments)},bft={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(n,t){if(!Array.isArray(n))throw Error("encodeByteArray takes an array as a parameter");this.init_();for(var r=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,f=[],i=0;i<n.length;i+=3){var e=n[i],o=i+1<n.length,s=o?n[i+1]:0,h=i+2<n.length,u=h?n[i+2]:0,c=(15&s)<<2|u>>6,u=63&u;h||(u=64,o||(c=64));f.push(r[e>>2],r[(3&e)<<4|s>>4],r[c],r[u])}return f.join("")},encodeString:function(n,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(n):this.encodeByteArray(function(n){for(var t,i=[],r=0,u=0;u<n.length;u++)t=n.charCodeAt(u),t<128?i[r++]=t:(t<2048?i[r++]=t>>6|192:(55296==(64512&t)&&u+1<n.length&&56320==(64512&n.charCodeAt(u+1))?(t=65536+((1023&t)<<10)+(1023&n.charCodeAt(++u)),i[r++]=t>>18|240,i[r++]=t>>12&63|128):i[r++]=t>>12|224,i[r++]=t>>6&63|128),i[r++]=63&t|128);return i}(n),t)},decodeString:function(n,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(n):function(n){for(var e,f,o,t,r=[],i=0,u=0;i<n.length;)t=n[i++],t<128?r[u++]=String.fromCharCode(t):191<t&&t<224?(f=n[i++],r[u++]=String.fromCharCode((31&t)<<6|63&f)):239<t&&t<365?(e=((7&t)<<18|(63&(f=n[i++]))<<12|(63&(o=n[i++]))<<6|63&n[i++])-65536,r[u++]=String.fromCharCode(55296+(e>>10)),r[u++]=String.fromCharCode(56320+(1023&e))):(f=n[i++],o=n[i++],r[u++]=String.fromCharCode((15&t)<<12|(63&f)<<6|63&o));return r.join("")}(this.decodeStringToByteArray(n,t))},decodeStringToByteArray:function(n,t){this.init_();for(var r=t?this.charToByteMapWebSafe_:this.charToByteMap_,u=[],i=0;i<n.length;){var s=r[n.charAt(i++)],e=i<n.length?r[n.charAt(i)]:0,f=++i<n.length?r[n.charAt(i)]:64,o=++i<n.length?r[n.charAt(i)]:64;if(++i,null==s||null==e||null==f||null==o)throw Error();u.push(s<<2|e>>4);64!==f&&(u.push(e<<4&240|f>>2),64!==o&&u.push(f<<6&192|o))}return u},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={};this.charToByteMap_={};this.byteToCharMapWebSafe_={};this.charToByteMapWebSafe_={};for(var n=0;n<this.ENCODED_VALS.length;n++)this.byteToCharMap_[n]=this.ENCODED_VALS.charAt(n),this.charToByteMap_[this.byteToCharMap_[n]]=n,this.byteToCharMapWebSafe_[n]=this.ENCODED_VALS_WEBSAFE.charAt(n),(this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[n]]=n)>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(n)]=n,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(n)]=n)}}},kft,fgt="FirebaseError",egt=(c(ed,kft=Error),ed),ogt=(dft.prototype.create=function(n){for(var i=[],t=1;t<arguments.length;t++)i[t-1]=arguments[t];var r,u=i[0]||{},f=this.service+"/"+n,n=this.errors[n],n=n?(r=u,n.replace(sgt,function(n,t){var i=r[t];return null!=i?String(i):"<"+t+"?>"})):"Error",n=this.serviceName+": "+n+" ("+f+").";return new egt(f,n,u)},dft),nt,sgt=/\{\$([^}]+)}/g,od,yy,tet,hd,cd,rr,ad,ch,pd,ky,wr,set,aet,lh,vet,np,tp,ip,up,ug,fg,fp,og,cg,lg,op,get,ag,ve,yg,vi,rt,rn,kot,got,ust,fw,wn,or,y,cht,h,kr,ri,pht,bht,dr,rs,lf,pct,ytt,us,be,dct,ke,tlt,fs,ic,yi,olt,slt,rc,ne,bt,ylt,plt,uc,ww,gat,bi,ot,fi,uvt,uit,fvt,eit,lvt,pit,gu,wvt,uv,dvt,ryt,sb,fyt,apt,sbt,hbt,cbt,at,vut,dbt,yut,ck,okt,pk,vl,hkt,udt,fdt,edt,odt,vo,hft,cdt,yo,gdt,ngt,tgt,igt;(vi=nt=nt||{})[vi.DEBUG=0]="DEBUG";vi[vi.VERBOSE=1]="VERBOSE";vi[vi.INFO=2]="INFO";vi[vi.WARN=3]="WARN";vi[vi.ERROR=4]="ERROR";vi[vi.SILENT=5]="SILENT";var cgt={debug:nt.DEBUG,verbose:nt.VERBOSE,info:nt.INFO,warn:nt.WARN,error:nt.ERROR,silent:nt.SILENT},lgt=nt.INFO,agt=((rt={})[nt.DEBUG]="log",rt[nt.VERBOSE]="log",rt[nt.INFO]="info",rt[nt.WARN]="warn",rt[nt.ERROR]="error",rt),l=(Object.defineProperty(ff.prototype,"logLevel",{get:function(){return this._logLevel},set:function(n){if(!(n in nt))throw new TypeError('Invalid value "'+n+'" assigned to `logLevel`');this._logLevel=n},enumerable:!1,configurable:!0}),ff.prototype.setLogLevel=function(n){this._logLevel="string"==typeof n?cgt[n]:n},Object.defineProperty(ff.prototype,"logHandler",{get:function(){return this._logHandler},set:function(n){if("function"!=typeof n)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=n},enumerable:!1,configurable:!0}),Object.defineProperty(ff.prototype,"userLogHandler",{get:function(){return this._userLogHandler},set:function(n){this._userLogHandler=n},enumerable:!1,configurable:!0}),ff.prototype.debug=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,g([this,nt.DEBUG],t));this._logHandler.apply(this,g([this,nt.DEBUG],t))},ff.prototype.log=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,g([this,nt.VERBOSE],t));this._logHandler.apply(this,g([this,nt.VERBOSE],t))},ff.prototype.info=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,g([this,nt.INFO],t));this._logHandler.apply(this,g([this,nt.INFO],t))},ff.prototype.warn=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,g([this,nt.WARN],t));this._logHandler.apply(this,g([this,nt.WARN],t))},ff.prototype.error=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,g([this,nt.ERROR],t));this._logHandler.apply(this,g([this,nt.ERROR],t))},ff);od=function(n,t){return(od=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])})(n,t)};var o,hh="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},net={},v=hh||self;yy="closure_uid_"+(1e9*Math.random()>>>0);tet=0;le.prototype.j=!1;le.prototype.ka=function(){var n;!this.j&&(this.j=!0,this.H(),0)&&(n=this,Object.prototype.hasOwnProperty.call(n,yy)&&n[yy]||(n[yy]=++tet))};le.prototype.H=function(){if(this.i)for(;this.i.length;)this.i.shift()()};hd=Array.prototype.indexOf?function(n,t){return Array.prototype.indexOf.call(n,t,void 0)}:function(n,t){if("string"==typeof n)return"string"!=typeof t||1!=t.length?-1:n.indexOf(t,0);for(var i=0;i<n.length;i++)if(i in n&&n[i]===t)return i;return-1};cd=Array.prototype.forEach?function(n,t,i){Array.prototype.forEach.call(n,t,i)}:function(n,t,i){for(var f=n.length,u="string"==typeof n?n.split(""):n,r=0;r<f;r++)r in u&&t.call(i,u[r],r,n)};ad=String.prototype.trim?function(n){return n.trim()}:function(n){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(n)[1]};n:{if(ch=v.navigator,ch&&(ch=ch.userAgent,ch)){rr=ch;break n}rr=""}pd="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");wd[" "]=vy;var by,pgt=ur(rr,"Opera"),ae=ur(rr,"Trident")||ur(rr,"MSIE"),fet=ur(rr,"Edge"),bd=fet||ae,eet=ur(rr,"Gecko")&&!(ur(rr.toLowerCase(),"webkit")&&!ur(rr,"Edge"))&&!(ur(rr,"Trident")||ur(rr,"MSIE"))&&!ur(rr,"Edge"),wgt=ur(rr.toLowerCase(),"webkit")&&!ur(rr,"Edge");n:{if(ky="",wr=(wr=rr,eet?/rv:([^\);]+)(\)|;)/.exec(wr):fet?/Edge\/([\d\.]+)/.exec(wr):ae?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(wr):wgt?/WebKit\/(\S+)/.exec(wr):pgt?/(?:Version)[ \/]?(\S+)/.exec(wr):void 0),(wr&&(ky=wr?wr[1]:""),ae)&&(wr=oet(),null!=wr&&wr>parseFloat(ky))){by=String(wr);break n}by=ky}set={};var cet=v.document&&ae&&(oet()||parseInt(by,10))||void 0,kd=!ae||9<=Number(cet),bgt=ae&&!het("9"),kgt=function(){if(!v.addEventListener||!Object.defineProperty)return!1;var n=!1,t=Object.defineProperty({},"passive",{get:function(){n=!0}});try{v.addEventListener("test",vy,t);v.removeEventListener("test",vy,t)}catch(n){}return n}();nr.prototype.b=function(){this.defaultPrevented=!0};li(dl,nr);aet={2:"touch",3:"pen",4:"mouse"};dl.prototype.b=function(){dl.X.b.call(this);var n=this.c;if(n.preventDefault)n.preventDefault();else if(n.returnValue=!1,bgt)try{(n.ctrlKey||112<=n.keyCode&&n.keyCode<=123)&&(n.keyCode=-1)}catch(n){}};lh="closure_listenable_"+(1e6*Math.random()|0);vet=0;gy.prototype.add=function(n,t,i,r,u){var f=n.toString(),e;return(n=this.a[f])||(n=this.a[f]=[],this.b++),e=gd(n,t,r,u),-1<e?(t=n[e],i||(t.Z=!1)):((t=new dgt(t,this.src,f,!!r,u)).Z=i,n.push(t)),t};np="closure_lm_"+(1e6*Math.random()|0);tp={};ip="__closure_events_fn_"+(1e9*Math.random()>>>0);li(fr,le);fr.prototype[lh]=!0;(o=fr.prototype).addEventListener=function(n,t,i,r){ng(this,n,t,i,r)};o.removeEventListener=function(n,t,i,r){!function n(t,i,r,u,f){if(Array.isArray(i))for(var e=0;e<i.length;e++)n(t,i[e],r,u,f);else u=kl(u)?!!u.capture:!!u,r=rg(r),t&&t[lh]?(t=t.c,(i=String(i).toString())in t.a&&-1<(r=gd(e=t.a[i],r,u,f))&&(dy(e[r]),Array.prototype.splice.call(e,r,1),0==e.length&&(delete t.a[i],t.b--))):(t=t&&ig(t))&&(i=t.a[i.toString()],(r=(t=-1)<(t=i?gd(i,r,u,f):t)?i[t]:null)&&tg(r))}(this,n,t,i,r)};o.H=function(){var i,n,r,t;if(fr.X.H.call(this),this.c){n=this.c;for(i in n.a){for(r=n.a[i],t=0;t<r.length;t++)dy(r[t]);delete n.a[i];n.b--}}this.D=null};o.wa=function(n,t,i,r){return this.c.add(String(n),t,!1,i,r)};o.xa=function(n,t,i,r){return this.c.add(String(n),t,!0,i,r)};up=v.JSON.stringify;fg=(ket.prototype.get=function(){var n;return 0<this.b?(this.b--,n=this.a,this.a=n.next,n.next=null):n=this.c(),n},new ket(function(){return new eg},function(n){n.reset()}));bet.prototype.add=function(n,t){var i=fg.get();i.set(n,t);this.b?this.b.next=i:this.a=i;this.b=i};eg.prototype.set=function(n,t){this.a=n;this.b=t;this.next=null};fp=!(eg.prototype.reset=function(){this.next=this.b=this.a=null});og=new bet;li(ep,fr);(o=ep.prototype).aa=!1;o.M=null;o.eb=function(){var n;this.aa&&(0<(n=ef()-this.g)&&n<.8*this.b?this.M=this.a.setTimeout(this.f,this.b-n):(this.M&&(this.a.clearTimeout(this.M),this.M=null),ai(this,"tick"),this.aa&&(sg(this),this.start())))};o.start=function(){this.aa=!0;this.M||(this.M=this.a.setTimeout(this.f,this.b),this.g=ef())};o.H=function(){ep.X.H.call(this);sg(this);delete this.a};get=(od(lg=sp,op=cg=le),lg.prototype=null===op?Object.create(op):(not.prototype=op.prototype,new not),sp.prototype.f=function(n){this.b=arguments;this.a?this.c=!0:function n(t){t.a=hg(function(){t.a=null;t.c&&(t.c=!1,n(t))},t.h);var i=t.b;t.b=null;t.g.apply(null,i)}(this)},sp.prototype.H=function(){cg.prototype.H.call(this);this.a&&(v.clearTimeout(this.a),this.a=null,this.c=!1,this.b=null)},sp);li(gl,le);ag=[];gl.prototype.H=function(){gl.X.H.call(this);iot(this)};gl.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented");};vg.prototype.info=function(){};ve={};yg=null;ve.Ga="serverreachability";li(rot,nr);ve.STAT_EVENT="statevent";li(uot,nr);ve.Ha="timingevent";li(fot,nr);vi={NO_ERROR:0,fb:1,sb:2,rb:3,mb:4,qb:5,tb:6,Ea:7,TIMEOUT:8,wb:9};rt={kb:"complete",Gb:"success",Fa:"error",Ea:"abort",yb:"ready",zb:"readystatechange",TIMEOUT:"timeout",ub:"incrementaldata",xb:"progress",nb:"downloadprogress",Ob:"uploadprogress"};pg.prototype.b=null;hh={OPEN:"a",jb:"b",Fa:"c",vb:"d"};li(wg,nr);li(bg,nr);li(lp,pg);lp.prototype.a=function(){return new XMLHttpRequest};lp.prototype.c=function(){return{}};var sot=new lp,tnt=45e3,hot={},kg={};(o=ta.prototype).setTimeout=function(n){this.P=n};o.bb=function(n){n=n.target;var t=this.F;t&&3==pe(n)?t.f():this.Da(n)};o.Da=function(n){var t,o,i,r,f,e,u,s,h,c,l,a,v,y;try{if(n==this.a)n:{if(t=pe(this.a),o=this.a.va(),this.a.W(),!(t<3||3==t&&!bd&&!this.a.$()))if(this.A||4!=t||7==o||cp(),ap(this),i=this.a.W(),this.N=i,r=this.a.$(),this.b=200==i,s=this.c,h=this.m,c=this.l,l=this.f,a=this.S,v=t,y=i,s.info(function(){return"XMLHTTP RESP ("+l+") [ attempt "+a+"]: "+h+"\n"+c+"\n"+v+" "+y}),this.b){if(this.U&&!this.C){t:{if(this.a&&(e=this.a,(f=e.a?e.a.getResponseHeader("X-HTTP-Initial-Response"):null)&&!wy(f))){u=f;break t}u=null}if(!u){this.b=!1;this.h=3;er(12);vh(this);vp(this);break n}ah(this.c,this.f,u,"Initial handshake response via X-HTTP-Initial-Response");this.C=!0;gg(this,u)}this.I?(lot(this,t,r),bd&&this.b&&3==t&&(tot(this.J,this.R,"tick",this.ab),this.R.start())):(ah(this.c,this.f,r,null),gg(this,r));4==t&&vh(this);this.b&&!this.A&&(4==t?wst(this.g,this):(this.b=!1,ia(this)))}else 400==i&&0<r.indexOf("Unknown SID")?(this.h=3,er(12)):(this.h=0,er(13)),vh(this),vp(this)}}catch(n){}};o.ab=function(){var n,t;this.a&&(n=pe(this.a),t=this.a.$(),this.D<t.length&&(ap(this),lot(this,n,t),this.b&&4!=n&&ia(this)))};o.cancel=function(){this.A=!0;vh(this)};o.$a=function(){this.o=null;var n,t,i=ef();0<=i-this.T?(n=this.c,t=this.l,n.info(function(){return"TIMEOUT: "+t}),2!=this.G&&(cp(),er(17)),vh(this),this.h=2,vp(this)):aot(this,this.T-i)};(o=yh.prototype).K=function(){tn(this);for(var t=[],n=0;n<this.a.length;n++)t.push(this.b[this.a[n]]);return t};o.L=function(){return tn(this),this.a.concat()};o.get=function(n,t){return bo(this.b,n)?this.b[n]:t};o.set=function(n,t){bo(this.b,n)||(this.c++,this.a.push(n));this.b[n]=t};o.forEach=function(n,t){for(var u,f,r=this.L(),i=0;i<r.length;i++)u=r[i],f=this.get(u),n.call(t,f,u,this)};rn=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^\\/?#]*)@)?([^\\/?#]*?)(?::([0-9]+))?(?=[\\/?#]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;ko.prototype.toString=function(){var t=[],i=this.f,n;return i&&t.push(ua(i,yot,!0),":"),n=this.c,!n&&"file"!=i||(t.push("//"),(i=this.j)&&t.push(ua(i,yot,!0),"@"),t.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.h)&&t.push(":",String(n))),(n=this.g)&&(this.c&&"/"!=n.charAt(0)&&t.push("/"),t.push(ua(n,"/"==n.charAt(0)?unt:rnt,!0))),(n=this.b.toString())&&t.push("?",n),(n=this.i)&&t.push("#",ua(n,ent)),t.join("")};var yot=/[#\/\?@]/g,rnt=/[#\?:]/g,unt=/[#\?]/g,fnt=/[#\?@]/g,ent=/#/g;(o=fa.prototype).add=function(n,t){ye(this);this.c=null;n=ph(this,n);var i=this.a.get(n);return i||this.a.set(n,i=[]),i.push(t),this.b+=1,this};o.forEach=function(n,t){ye(this);this.a.forEach(function(i,r){cd(i,function(i){n.call(t,i,r,this)},this)},this)};o.L=function(){var u,t;ye(this);for(var f=this.a.K(),i=this.a.L(),r=[],n=0;n<i.length;n++)for(u=f[n],t=0;t<u.length;t++)r.push(i[n]);return r};o.K=function(n){var t,i;if(ye(this),t=[],"string"==typeof n)wot(this,n)&&(t=iet(t,this.a.get(ph(this,n))));else for(n=this.a.K(),i=0;i<n.length;i++)t=iet(t,n[i]);return t};o.set=function(n,t){return ye(this),this.c=null,wot(this,n=ph(this,n))&&(this.b-=this.a.get(n).length),this.a.set(n,[t]),this.b+=1,this};o.get=function(n,t){return n&&0<(n=this.K(n)).length?String(n[0]):t};o.toString=function(){var r;if(this.c)return this.c;if(!this.a)return"";for(var u=[],f=this.a.L(),i=0;i<f.length;i++)for(var n=f[i],e=encodeURIComponent(String(n)),n=this.K(n),t=0;t<n.length;t++)r=e,""!==n[t]&&(r+="="+encodeURIComponent(String(n[t]))),u.push(r);return this.c=u.join("&")};kot=function(n,t){this.b=n;this.a=t};got=10;dot.prototype.cancel=function(){var i,r,t,n;if(this.c=rst(this),this.b)this.b.cancel(),this.b=null;else if(this.a&&0!==this.a.size){try{for(t=gft(this.a.values()),n=t.next();!n.done;n=t.next())n.value.cancel()}catch(r){i={error:r}}finally{try{n&&!n.done&&(r=t.return)&&r.call(t)}finally{if(i)throw i.error;}}this.a.clear()}};en.prototype.stringify=function(n){return v.JSON.stringify(n,void 0)};en.prototype.parse=function(n){return v.JSON.parse(n,void 0)};ust=v.JSON.parse;li(kt,fr);var fst,snt="",hnt=/^https?$/i,cnt=["POST","PUT"];(o=kt.prototype).ba=function(n,t,i,r){if(this.a)throw Error("[goog.net.XhrIo] Object is active with another request="+this.C+"; newUri="+n);t=t?t.toUpperCase():"GET";this.C=n;this.f="";this.h=0;this.A=!1;this.b=!0;this.a=(this.l||sot).a();this.u=this.l?eot(this.l):eot(sot);this.a.onreadystatechange=pr(this.Aa,this);try{this.B=!0;this.a.open(t,String(n),!0);this.B=!1}catch(n){return void est(this,n)}n=i||"";var f,u=new yh(this.headers);r&&nn(r,function(n,t){u.set(t,n)});r=function(n){n:{for(var t=lnt,u=n.length,r="string"==typeof n?n.split(""):n,i=0;i<u;i++)if(i in r&&t.call(void 0,r[i],i,n)){t=i;break n}t=-1}return t<0?null:"string"==typeof n?n.charAt(t):n[t]}(u.L());i=v.FormData&&n instanceof v.FormData;0<=hd(cnt,t)&&!r&&!i&&u.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");u.forEach(function(n,t){this.a.setRequestHeader(t,n)},this);this.I&&(this.a.responseType=this.I);"withCredentials"in this.a&&this.a.withCredentials!==this.G&&(this.a.withCredentials=this.G);try{hst(this);0<this.s&&((this.F=(f=this.a,ae&&het(9)&&"number"==typeof f.timeout&&void 0!==f.ontimeout))?(this.a.timeout=this.s,this.a.ontimeout=pr(this.ya,this)):this.o=hg(this.ya,this.s,this));this.m=!0;this.a.send(n);this.m=!1}catch(n){est(this,n)}};o.ya=function(){void 0!==net&&this.a&&(this.f="Timed out after "+this.s+"ms, aborting",this.h=8,ai(this,"timeout"),this.abort(8))};o.abort=function(n){this.a&&this.b&&(this.b=!1,this.g=!0,this.a.abort(),this.g=!1,this.h=n||7,ai(this,"complete"),ai(this,"abort"),dp(this))};o.H=function(){this.a&&(this.b&&(this.b=!1,this.g=!0,this.a.abort(),this.g=!1),dp(this,!0));kt.X.H.call(this)};o.Aa=function(){this.j||(this.B||this.m||this.g?sst(this):this.Za())};o.Za=function(){sst(this)};o.W=function(){try{return 2<pe(this)?this.a.status:-1}catch(n){return-1}};o.$=function(){try{return this.a?this.a.responseText:""}catch(n){return""}};o.Qa=function(n){if(this.a){var t=this.a.responseText;return n&&0==t.indexOf(n)&&(t=t.substring(n.length)),ust(t)}};o.va=function(){return this.h};o.Ra=function(){return"string"==typeof this.f?this.f:String(this.f)};(o=cst.prototype).ia=8;o.v=1;o.Ca=function(n){var i,f,r,t,u;if(this.h)if(this.h=null,1==this.v){if(!n){if(this.R=Math.floor(1e5*Math.random()),n=this.R++,f=new ta(this,this.c,n,void 0),r=this.l,this.O&&(r?uet(r=ret(r),this.O):r=this.O),null===this.i&&(f.B=r),this.ea)n:{for(t=i=0;t<this.g.length;t++){if(u=this.g[t],u="__data__"in u.a&&"string"==typeof(u=u.a.__data__)?u.length:void 0,void 0===u)break;if(4096<(i+=u)){i=t;break n}if(4096===i||t===this.g.length-1){i=t+1;break n}}i=1e3}else i=1e3;i=vst(this,f,i);et(t=kf(this.B),"RID",n);et(t,"CVER",22);this.A&&et(t,"X-HTTP-Session-Id",this.A);oa(this,t);this.i&&r&&on(t,this.i,r);fn(this.b,f);this.Ja&&et(t,"TYPE","init");this.ea?(et(t,"$req",i),et(t,"SID","null"),f.U=!0,dg(f,t,null)):dg(f,t,i);this.v=2}}else 3==this.v&&(n?ast(this,n):0==this.g.length||nst(this.b)||ast(this))};o.Ba=function(){var n;this.j=null;pst(this);this.U&&!(this.F||null==this.a||this.N<=0)&&(n=2*this.N,this.c.info("BP detection timer enabled: "+n),this.s=na(pr(this.Ya,this),n))};o.Ya=function(){this.s&&(this.s=null,this.c.info("BP detection timeout reached."),this.c.info("Buffering proxy detected and switch to long-polling!"),this.G=!1,this.F=!0,er(10),gp(this),pst(this))};o.Xa=function(){null!=this.m&&(this.m=null,gp(this),cn(this),er(19))};o.cb=function(n){n?(this.c.info("Successfully pinged google.com"),er(2)):(this.c.info("Failed to ping google.com"),er(1))};(o=nht.prototype).ua=function(){};o.ta=function(){};o.sa=function(){};o.ra=function(){};o.Ka=function(){};iw.prototype.a=function(n,t){return new wu(n,t)};li(wu,fr);wu.prototype.h=function(){this.a.f=this.f;this.o&&(this.a.C=!0);var n=this.a,t=this.g,i=this.b||void 0;er(0);n.ga=t;n.V=i||{};n.G=n.S;n.B=dst(n,null,n.ga);nw(n)};wu.prototype.close=function(){sn(this.a)};wu.prototype.l=function(n){var t;"string"==typeof n?((t={}).__data__=n,hn(this.a,t)):this.m?((t={}).__data__=up(n),hn(this.a,t)):hn(this.a,n)};wu.prototype.H=function(){this.a.f=null;delete this.f;sn(this.a);delete this.a;wu.X.H.call(this)};li(tht,wg);li(iht,bg);li(wh,nht);wh.prototype.ua=function(){ai(this.a,"a")};wh.prototype.ta=function(n){ai(this.a,new tht(n))};wh.prototype.sa=function(){ai(this.a,new iht)};wh.prototype.ra=function(){ai(this.a,"b")};li(rw,pg);rw.prototype.a=function(){return new uw(this.f)};rw.prototype.c=(fst={},function(){return fst});li(uw,fr);fw=0;(o=uw.prototype).open=function(n,t){if(this.readyState!=fw)throw this.abort(),Error("Error reopening a connection");this.s=n;this.o=t;this.readyState=1;ha(this)};o.send=function(n){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.a=!0;var t={headers:this.l,method:this.s,credentials:this.h,cache:void 0};n&&(t.body=n);this.u.fetch(new Request(this.o,t)).then(this.Wa.bind(this),this.ca.bind(this))};o.abort=function(){this.responseText="";this.l=new Headers;this.status=0;this.f&&this.f.cancel("Request was aborted.");1<=this.readyState&&this.a&&4!=this.readyState&&(this.a=!1,sa(this));this.readyState=fw};o.Wa=function(n){this.a&&(this.g=n,this.b||(this.status=this.g.status,this.statusText=this.g.statusText,this.b=n.headers,this.readyState=2,ha(this)),this.a&&(this.readyState=3,ha(this),this.a&&("arraybuffer"===this.responseType?n.arrayBuffer().then(this.Ua.bind(this),this.ca.bind(this)):void 0!==v.ReadableStream&&"body"in n?(this.responseText="",this.f=n.body.getReader(),this.m=new TextDecoder,rht(this)):n.text().then(this.Va.bind(this),this.ca.bind(this)))))};o.Ta=function(n){var t;this.a&&((t=this.m.decode(n.value||new Uint8Array(0),{stream:!n.done}))&&(this.responseText+=t),(n.done?sa:ha)(this),3==this.readyState&&rht(this))};o.Va=function(n){this.a&&(this.responseText=n,sa(this))};o.Ua=function(){this.a&&sa(this)};o.ca=function(){this.a&&sa(this)};o.setRequestHeader=function(n,t){this.l.append(n,t)};o.getResponseHeader=function(n){return this.b&&this.b.get(n.toLowerCase())||""};o.getAllResponseHeaders=function(){if(!this.b)return"";for(var t=[],i=this.b.entries(),n=i.next();!n.done;)n=n.value,t.push(n[0]+": "+n[1]),n=i.next();return t.join("\r\n")};Object.defineProperty(uw.prototype,"withCredentials",{get:function(){return"include"===this.h},set:function(n){this.h=n?"include":"same-origin"}});iw.prototype.createWebChannel=iw.prototype.a;wu.prototype.send=wu.prototype.l;wu.prototype.open=wu.prototype.h;vi.NO_ERROR=0;vi.TIMEOUT=8;vi.HTTP_ERROR=6;rt.COMPLETE="complete";(oot.EventType=hh).OPEN="a";hh.CLOSE="b";hh.ERROR="c";hh.MESSAGE="d";fr.prototype.listen=fr.prototype.wa;kt.prototype.listenOnce=kt.prototype.xa;kt.prototype.getLastError=kt.prototype.Ra;kt.prototype.getLastErrorCode=kt.prototype.va;kt.prototype.getStatus=kt.prototype.W;kt.prototype.getResponseJson=kt.prototype.Qa;kt.prototype.getResponseText=kt.prototype.$;kt.prototype.send=kt.prototype.ba;var ant=hp,an=vi,vnt=rt,ynt=ve,pnt=10,wnt=11,bnt=rw,ew=oot,knt=kt,ru=(vn.prototype.t=function(n){return this.previousValue=Math.max(n,this.previousValue),this.previousValue},vn.prototype.next=function(){var n=++this.previousValue;return this.i&&this.i(n),n},vn);ru.o=-1;var uht,t={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"},u=(c(fht,uht=Error),fht),bu=new l("@firebase/firestore");wn=(eht.u=function(){for(var r,n,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",u=Math.floor(256/t.length)*t.length,i="";i.length<20;)for(r=function(n){var i="undefined"!=typeof self&&(self.crypto||self.msCrypto),r=new Uint8Array(n),t;if(i&&"function"==typeof i.getRandomValues)i.getRandomValues(r);else for(t=0;t<n;t++)r[t]=Math.floor(256*Math.random());return r}(40),n=0;n<r.length;++n)i.length<20&&r[n]<u&&(i+=t.charAt(r[n]%t.length));return i},eht);or=(br.now=function(){return br.fromMillis(Date.now())},br.fromDate=function(n){return br.fromMillis(n.getTime())},br.fromMillis=function(n){var t=Math.floor(n/1e3);return new br(t,Math.floor(1e6*(n-1e3*t)))},br.prototype.toDate=function(){return new Date(this.toMillis())},br.prototype.toMillis=function(){return 1e3*this.seconds+this.nanoseconds/1e6},br.prototype._compareTo=function(n){return this.seconds===n.seconds?w(this.nanoseconds,n.nanoseconds):w(this.seconds,n.seconds)},br.prototype.isEqual=function(n){return n.seconds===this.seconds&&n.nanoseconds===this.nanoseconds},br.prototype.toString=function(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"},br.prototype.toJSON=function(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}},br.prototype.valueOf=function(){var n=this.seconds- -62135596800;return String(n).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")},br);y=(of.fromTimestamp=function(n){return new of(n)},of.min=function(){return new of(new or(0,0))},of.prototype.compareTo=function(n){return this.timestamp._compareTo(n.timestamp)},of.prototype.isEqual=function(n){return this.timestamp.isEqual(n.timestamp)},of.prototype.toMicroseconds=function(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3},of.prototype.toString=function(){return"SnapshotVersion("+this.timestamp.toString()+")"},of.prototype.toTimestamp=function(){return this.timestamp},of);var bn,kn,rt=(Object.defineProperty(ii.prototype,"length",{get:function(){return this.len},enumerable:!1,configurable:!0}),ii.prototype.isEqual=function(n){return 0===ii.comparator(this,n)},ii.prototype.child=function(n){var t=this.segments.slice(this.offset,this.limit());return n instanceof ii?n.forEach(function(n){t.push(n)}):t.push(n),this.construct(t)},ii.prototype.limit=function(){return this.offset+this.length},ii.prototype.popFirst=function(n){return this.construct(this.segments,this.offset+(n=void 0===n?1:n),this.length-n)},ii.prototype.popLast=function(){return this.construct(this.segments,this.offset,this.length-1)},ii.prototype.firstSegment=function(){return this.segments[this.offset]},ii.prototype.lastSegment=function(){return this.get(this.length-1)},ii.prototype.get=function(n){return this.segments[this.offset+n]},ii.prototype.isEmpty=function(){return 0===this.length},ii.prototype.isPrefixOf=function(n){if(n.length<this.length)return!1;for(var t=0;t<this.length;t++)if(this.get(t)!==n.get(t))return!1;return!0},ii.prototype.isImmediateParentOf=function(n){if(this.length+1!==n.length)return!1;for(var t=0;t<this.length;t++)if(this.get(t)!==n.get(t))return!1;return!0},ii.prototype.forEach=function(n){for(var t=this.offset,i=this.limit();t<i;t++)n(this.segments[t])},ii.prototype.toArray=function(){return this.segments.slice(this.offset,this.limit())},ii.comparator=function(n,t){for(var r,u,f=Math.min(n.length,t.length),i=0;i<f;i++){if(r=n.get(i),u=t.get(i),r<u)return-1;if(u<r)return 1}return n.length<t.length?-1:n.length>t.length?1:0},ii),k=(c(hf,kn=rt),hf.prototype.construct=function(n,t,i){return new hf(n,t,i)},hf.prototype.canonicalString=function(){return this.toArray().join("/")},hf.prototype.toString=function(){return this.canonicalString()},hf.fromString=function(){for(var i,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];for(var f=[],e=0,o=r;e<o.length;e++){if(i=o[e],0<=i.indexOf("//"))throw new u(t.INVALID_ARGUMENT,"Invalid segment ("+i+"). Paths must not contain // in them.");f.push.apply(f,i.split("/").filter(function(n){return 0<n.length}))}return new hf(f)},hf.emptyPath=function(){return new hf([])},hf),dnt=/^[_a-zA-Z][_a-zA-Z0-9]*$/,ku=(c(hr,bn=rt),hr.prototype.construct=function(n,t,i){return new hr(n,t,i)},hr.isValidIdentifier=function(n){return dnt.test(n)},hr.prototype.canonicalString=function(){return this.toArray().map(function(n){return n=n.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),n=hr.isValidIdentifier(n)?n:"`"+n+"`"}).join(".")},hr.prototype.toString=function(){return this.canonicalString()},hr.prototype.isKeyField=function(){return 1===this.length&&"__name__"===this.get(0)},hr.keyField=function(){return new hr(["__name__"])},hr.fromServerFormat=function(n){for(var f,e,s=[],r="",i=0,h=function(){if(0===r.length)throw new u(t.INVALID_ARGUMENT,"Invalid field path ("+n+"). Paths must not be empty, begin with '.', end with '.', or contain '..'");s.push(r);r=""},o=!1;i<n.length;)if(f=n[i],"\\"===f){if(i+1===n.length)throw new u(t.INVALID_ARGUMENT,"Path has trailing escape character: "+n);if(e=n[i+1],"\\"!==e&&"."!==e&&"`"!==e)throw new u(t.INVALID_ARGUMENT,"Path has invalid escape sequence: "+n);r+=e;i+=2}else"`"===f?o=!o:"."!==f||o?r+=f:h(),i++;if(h(),o)throw new u(t.INVALID_ARGUMENT,"Unterminated ` in path: "+n);return new hr(s)},hr.emptyPath=function(){return new hr([])},hr),kh=(dn.prototype.covers=function(n){for(var t=0,i=this.fields;t<i.length;t++)if(i[t].isPrefixOf(n))return!0;return!1},dn.prototype.isEqual=function(n){return bh(this.fields,n.fields,function(n,t){return n.isEqual(t)})},dn),sr=(sf.fromBase64String=function(n){return new sf(atob(n))},sf.fromUint8Array=function(n){return new sf(function(n){for(var i="",t=0;t<n.length;++t)i+=String.fromCharCode(n[t]);return i}(n))},sf.prototype.toBase64=function(){return n=this.binaryString,btoa(n);var n},sf.prototype.toUint8Array=function(){return function(n){for(var i=new Uint8Array(n.length),t=0;t<n.length;t++)i[t]=n.charCodeAt(t);return i}(this.binaryString)},sf.prototype.approximateByteSize=function(){return 2*this.binaryString.length},sf.prototype.compareTo=function(n){return w(this.binaryString,n.binaryString)},sf.prototype.isEqual=function(n){return this.binaryString===n.binaryString},sf);sr.EMPTY_BYTE_STRING=new sr("");cht=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);h=(cu.fromPath=function(n){return new cu(k.fromString(n))},cu.fromName=function(n){return new cu(k.fromString(n).popFirst(5))},cu.prototype.hasCollectionId=function(n){return 2<=this.path.length&&this.path.get(this.path.length-2)===n},cu.prototype.isEqual=function(n){return null!==n&&0===k.comparator(this.path,n.path)},cu.prototype.toString=function(){return this.path.toString()},cu.comparator=function(n,t){return k.comparator(n.path,t.path)},cu.isDocumentKey=function(n){return n.length%2==0},cu.fromSegments=function(n){return new cu(new k(n.slice()))},cu);kr=(lu.empty=function(){return new lu({mapValue:{}})},lu.prototype.field=function(n){if(n.isEmpty())return this.value;for(var t=this.value,i=0;i<n.length-1;++i)if(!hw(t=(t.mapValue.fields||{})[n.get(i)]))return null;return(t=(t.mapValue.fields||{})[n.lastSegment()])||null},lu.prototype.set=function(n,t){this.getFieldsMap(n.popLast())[n.lastSegment()]=va(t)},lu.prototype.setAll=function(n){var u=this,t=ku.emptyPath(),i={},r=[];n.forEach(function(n,f){var e;t.isImmediateParentOf(f)||(e=u.getFieldsMap(t),u.applyChanges(e,i,r),i={},r=[],t=f.popLast());n?i[f.lastSegment()]=va(n):r.push(f.lastSegment())});n=this.getFieldsMap(t);this.applyChanges(n,i,r)},lu.prototype.delete=function(n){var t=this.field(n.popLast());hw(t)&&t.mapValue.fields&&delete t.mapValue.fields[n.lastSegment()]},lu.prototype.isEqual=function(n){return cf(this.value,n.value)},lu.prototype.getFieldsMap=function(n){var t=this.value,r,i;for(t.mapValue.fields||(t.mapValue={fields:{}}),r=0;r<n.length;++r)i=t.mapValue.fields[n.get(r)],hw(i)&&i.mapValue.fields||(i={mapValue:{fields:{}}},t.mapValue.fields[n.get(r)]=i),t=i;return t.mapValue.fields},lu.prototype.applyChanges=function(n,t,i){var r,u,f;for(ns(t,function(t,i){return n[t]=i}),r=0,u=i;r<u.length;r++)f=u[r],delete n[f]},lu.prototype.clone=function(){return new lu(va(this.value))},lu);ri=(ut.newInvalidDocument=function(n){return new ut(n,0,y.min(),kr.empty(),0)},ut.newFoundDocument=function(n,t,i){return new ut(n,1,t,i,0)},ut.newNoDocument=function(n,t){return new ut(n,2,t,kr.empty(),0)},ut.newUnknownDocument=function(n,t){return new ut(n,3,t,kr.empty(),2)},ut.prototype.convertToFoundDocument=function(n,t){return this.version=n,this.documentType=1,this.data=t,this.documentState=0,this},ut.prototype.convertToNoDocument=function(n){return this.version=n,this.documentType=2,this.data=kr.empty(),this.documentState=0,this},ut.prototype.convertToUnknownDocument=function(n){return this.version=n,this.documentType=3,this.data=kr.empty(),this.documentState=2,this},ut.prototype.setHasCommittedMutations=function(){return this.documentState=2,this},ut.prototype.setHasLocalMutations=function(){return this.documentState=1,this},Object.defineProperty(ut.prototype,"hasLocalMutations",{get:function(){return 1===this.documentState},enumerable:!1,configurable:!0}),Object.defineProperty(ut.prototype,"hasCommittedMutations",{get:function(){return 2===this.documentState},enumerable:!1,configurable:!0}),Object.defineProperty(ut.prototype,"hasPendingWrites",{get:function(){return this.hasLocalMutations||this.hasCommittedMutations},enumerable:!1,configurable:!0}),ut.prototype.isValidDocument=function(){return 0!==this.documentType},ut.prototype.isFoundDocument=function(){return 1===this.documentType},ut.prototype.isNoDocument=function(){return 2===this.documentType},ut.prototype.isUnknownDocument=function(){return 3===this.documentType},ut.prototype.isEqual=function(n){return n instanceof ut&&this.key.isEqual(n.key)&&this.version.isEqual(n.version)&&this.documentType===n.documentType&&this.documentState===n.documentState&&this.data.isEqual(n.data)},ut.prototype.clone=function(){return new ut(this.key,this.documentType,this.version,this.data.clone(),this.documentState)},ut.prototype.toString=function(){return"Document("+this.key+", "+this.version+", "+JSON.stringify(this.data.value)+", {documentType: "+this.documentType+"}), {documentState: "+this.documentState+"})"},ut);pht=function(n,t,i,r,u,f,e){void 0===t&&(t=null);void 0===i&&(i=[]);void 0===r&&(r=[]);void 0===u&&(u=null);void 0===f&&(f=null);void 0===e&&(e=null);this.path=n;this.collectionGroup=t;this.orderBy=i;this.filters=r;this.limit=u;this.startAt=f;this.endAt=e;this.h=null};dr=(c(we,bht=function(){}),we.create=function(n,t,i){return n.isKeyField()?"in"===t||"not-in"===t?this.l(n,t,i):new gnt(n,t,i):"array-contains"===t?new iti(n,i):"in"===t?new rti(n,i):"not-in"===t?new uti(n,i):"array-contains-any"===t?new fti(n,i):new we(n,t,i)},we.l=function(n,t,i){return new("in"===t?nti:tti)(n,i)},we.prototype.matches=function(n){return n=n.data.field(this.field),"!="===this.op?null!==n&&this.m(gh(n,this.value)):null!==n&&is(this.value)===is(n)&&this.m(gh(n,this.value))},we.prototype.m=function(n){switch(this.op){case"<":return n<0;case"<=":return n<=0;case"==":return 0===n;case"!=":return 0!==n;case">":return 0<n;case">=":return 0<=n;default:return s()}},we.prototype.g=function(){return 0<=["<","<=",">",">=","!=","not-in"].indexOf(this.op)},we);var kht,dht,ght,gnt=(c(ftt,ght=dr),ftt.prototype.matches=function(n){return n=h.comparator(n.key,this.key),this.m(n)},ftt),nti=(c(utt,dht=dr),utt.prototype.matches=function(n){return this.keys.some(function(t){return t.isEqual(n.key)})},utt),tti=(c(rtt,kht=dr),rtt.prototype.matches=function(n){return!this.keys.some(function(t){return t.isEqual(n.key)})},rtt);var tct,ict,rct,uct,iti=(c(htt,uct=dr),htt.prototype.matches=function(n){return n=n.data.field(this.field),itt(n)&&aa(n.arrayValue,this.value)},htt),rti=(c(stt,rct=dr),stt.prototype.matches=function(n){return n=n.data.field(this.field),null!==n&&aa(this.value.arrayValue,n)},stt),uti=(c(ott,ict=dr),ott.prototype.matches=function(n){return aa(this.value.arrayValue,{nullValue:"NULL_VALUE"})?!1:(n=n.data.field(this.field),null!==n&&!aa(this.value.arrayValue,n))},ott),fti=(c(ett,tct=dr),ett.prototype.matches=function(n){var t=this,n=n.data.field(this.field);return!(!itt(n)||!n.arrayValue.values)&&n.arrayValue.values.some(function(n){return aa(t.value.arrayValue,n)})},ett),pa=function(n,t){this.position=n;this.before=t};rs=function(n,t){void 0===t&&(t="asc");this.field=n;this.dir=t};lf=function(n,t,i,r,u,f,e,o){void 0===t&&(t=null);void 0===i&&(i=[]);void 0===r&&(r=[]);void 0===u&&(u=null);void 0===f&&(f="F");void 0===e&&(e=null);void 0===o&&(o=null);this.path=n;this.collectionGroup=t;this.explicitOrderBy=i;this.filters=r;this.limit=u;this.limitType=f;this.startAt=e;this.endAt=o;this.p=null;this.T=null;this.startAt;this.endAt};l=function(){this._=void 0};us=(c(bct,ytt=l),bct);be=(c(wct,pct=l),wct);ke=(c(gct,dct=l),gct);fs=(c(ilt,tlt=l),ilt);ic=function(n,t){this.field=n;this.transform=t};yi=(gf.none=function(){return new gf},gf.exists=function(n){return new gf(void 0,n)},gf.updateTime=function(n){return new gf(n)},Object.defineProperty(gf.prototype,"isNone",{get:function(){return void 0===this.updateTime&&void 0===this.exists},enumerable:!1,configurable:!0}),gf.prototype.isEqual=function(n){return this.exists===n.exists&&(this.updateTime?!!n.updateTime&&this.updateTime.isEqual(n.updateTime):!n.updateTime)},gf);rt=function(){};rc=(c(clt,slt=rt),clt);ne=(c(hlt,olt=rt),hlt);uc=(c(blt,plt=rt),blt);ww=(c(wlt,ylt=rt),wlt);(l=bt=bt||{})[l.OK=0]="OK";l[l.CANCELLED=1]="CANCELLED";l[l.UNKNOWN=2]="UNKNOWN";l[l.INVALID_ARGUMENT=3]="INVALID_ARGUMENT";l[l.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED";l[l.NOT_FOUND=5]="NOT_FOUND";l[l.ALREADY_EXISTS=6]="ALREADY_EXISTS";l[l.PERMISSION_DENIED=7]="PERMISSION_DENIED";l[l.UNAUTHENTICATED=16]="UNAUTHENTICATED";l[l.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED";l[l.FAILED_PRECONDITION=9]="FAILED_PRECONDITION";l[l.ABORTED=10]="ABORTED";l[l.OUT_OF_RANGE=11]="OUT_OF_RANGE";l[l.UNIMPLEMENTED=12]="UNIMPLEMENTED";l[l.INTERNAL=13]="INTERNAL";l[l.UNAVAILABLE=14]="UNAVAILABLE";l[l.DATA_LOSS=15]="DATA_LOSS";var tr=(dt.prototype.insert=function(n,t){return new dt(this.comparator,this.root.insert(n,t,this.comparator).copy(null,null,de.BLACK,null,null))},dt.prototype.remove=function(n){return new dt(this.comparator,this.root.remove(n,this.comparator).copy(null,null,de.BLACK,null,null))},dt.prototype.get=function(n){for(var i,t=this.root;!t.isEmpty();){if(i=this.comparator(n,t.key),0===i)return t.value;i<0?t=t.left:0<i&&(t=t.right)}return null},dt.prototype.indexOf=function(n){for(var r,i=0,t=this.root;!t.isEmpty();){if(r=this.comparator(n,t.key),0===r)return i+t.left.size;t=r<0?t.left:(i+=t.left.size+1,t.right)}return-1},dt.prototype.isEmpty=function(){return this.root.isEmpty()},Object.defineProperty(dt.prototype,"size",{get:function(){return this.root.size},enumerable:!1,configurable:!0}),dt.prototype.minKey=function(){return this.root.minKey()},dt.prototype.maxKey=function(){return this.root.maxKey()},dt.prototype.inorderTraversal=function(n){return this.root.inorderTraversal(n)},dt.prototype.forEach=function(n){this.inorderTraversal(function(t,i){return n(t,i),!1})},dt.prototype.toString=function(){var n=[];return this.inorderTraversal(function(t,i){return n.push(t+":"+i),!1}),"{"+n.join(", ")+"}"},dt.prototype.reverseTraversal=function(n){return this.root.reverseTraversal(n)},dt.prototype.getIterator=function(){return new bw(this.root,null,this.comparator,!1)},dt.prototype.getIteratorFrom=function(n){return new bw(this.root,n,this.comparator,!1)},dt.prototype.getReverseIterator=function(){return new bw(this.root,null,this.comparator,!0)},dt.prototype.getReverseIteratorFrom=function(n){return new bw(this.root,n,this.comparator,!0)},dt),bw=(kw.prototype.getNext=function(){var n=this.nodeStack.pop(),t={key:n.key,value:n.value};if(this.isReverse)for(n=n.left;!n.isEmpty();)this.nodeStack.push(n),n=n.right;else for(n=n.right;!n.isEmpty();)this.nodeStack.push(n),n=n.left;return t},kw.prototype.hasNext=function(){return 0<this.nodeStack.length},kw.prototype.peek=function(){if(0===this.nodeStack.length)return null;var n=this.nodeStack[this.nodeStack.length-1];return{key:n.key,value:n.value}},kw),de=(it.prototype.copy=function(n,t,i,r,u){return new it(null!=n?n:this.key,null!=t?t:this.value,null!=i?i:this.color,null!=r?r:this.left,null!=u?u:this.right)},it.prototype.isEmpty=function(){return!1},it.prototype.inorderTraversal=function(n){return this.left.inorderTraversal(n)||n(this.key,this.value)||this.right.inorderTraversal(n)},it.prototype.reverseTraversal=function(n){return this.right.reverseTraversal(n)||n(this.key,this.value)||this.left.reverseTraversal(n)},it.prototype.min=function(){return this.left.isEmpty()?this:this.left.min()},it.prototype.minKey=function(){return this.min().key},it.prototype.maxKey=function(){return this.right.isEmpty()?this.key:this.right.maxKey()},it.prototype.insert=function(n,t,i){var r=this,u=i(n,r.key);return(r=u<0?r.copy(null,null,null,r.left.insert(n,t,i),null):0===u?r.copy(null,t,null,null,null):r.copy(null,null,null,null,r.right.insert(n,t,i))).fixUp()},it.prototype.removeMin=function(){if(this.left.isEmpty())return it.EMPTY;var n=this;return(n=(n=!n.left.isRed()&&!n.left.left.isRed()?n.moveRedLeft():n).copy(null,null,null,n.left.removeMin(),null)).fixUp()},it.prototype.remove=function(n,t){var r,i=this;if(t(n,i.key)<0)i=(i=(i.left.isEmpty()||i.left.isRed()||i.left.left.isRed())?i:i.moveRedLeft()).copy(null,null,null,i.left.remove(n,t),null);else{if(0===t(n,(i=((i=i.left.isRed()?i.rotateRight():i).right.isEmpty()||i.right.isRed()||i.right.left.isRed())?i:i.moveRedRight()).key)){if(i.right.isEmpty())return it.EMPTY;r=i.right.min();i=i.copy(r.key,r.value,null,null,i.right.removeMin())}i=i.copy(null,null,null,null,i.right.remove(n,t))}return i.fixUp()},it.prototype.isRed=function(){return this.color},it.prototype.fixUp=function(){var n=this;return(n=(n=n.right.isRed()&&!n.left.isRed()?n.rotateLeft():n).left.isRed()&&n.left.left.isRed()?n.rotateRight():n).left.isRed()&&n.right.isRed()?n.colorFlip():n},it.prototype.moveRedLeft=function(){var n=this.colorFlip();return n.right.left.isRed()?(n=(n=n.copy(null,null,null,null,n.right.rotateRight())).rotateLeft()).colorFlip():n},it.prototype.moveRedRight=function(){var n=this.colorFlip();return n.left.left.isRed()?(n=n.rotateRight()).colorFlip():n},it.prototype.rotateLeft=function(){var n=this.copy(null,null,it.RED,null,this.right.left);return this.right.copy(null,null,this.color,n,null)},it.prototype.rotateRight=function(){var n=this.copy(null,null,it.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,n)},it.prototype.colorFlip=function(){var n=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,n,t)},it.prototype.checkMaxDepth=function(){var n=this.check();return Math.pow(2,n)<=this.size+1},it.prototype.check=function(){if(this.isRed()&&this.left.isRed())throw s();if(this.right.isRed())throw s();var n=this.left.check();if(n!==this.right.check())throw s();return n+(this.isRed()?0:1)},it);de.EMPTY=null;de.RED=!0;de.BLACK=!1;de.EMPTY=(Object.defineProperty(pi.prototype,"key",{get:function(){throw s();},enumerable:!1,configurable:!0}),Object.defineProperty(pi.prototype,"value",{get:function(){throw s();},enumerable:!1,configurable:!0}),Object.defineProperty(pi.prototype,"color",{get:function(){throw s();},enumerable:!1,configurable:!0}),Object.defineProperty(pi.prototype,"left",{get:function(){throw s();},enumerable:!1,configurable:!0}),Object.defineProperty(pi.prototype,"right",{get:function(){throw s();},enumerable:!1,configurable:!0}),pi.prototype.copy=function(){return this},pi.prototype.insert=function(n,t){return new de(n,t)},pi.prototype.remove=function(){return this},pi.prototype.isEmpty=function(){return!0},pi.prototype.inorderTraversal=function(){return!1},pi.prototype.reverseTraversal=function(){return!1},pi.prototype.minKey=function(){return null},pi.prototype.maxKey=function(){return null},pi.prototype.isRed=function(){return!1},pi.prototype.checkMaxDepth=function(){return!0},pi.prototype.check=function(){return 0},new pi);var gt=(ct.prototype.has=function(n){return null!==this.data.get(n)},ct.prototype.first=function(){return this.data.minKey()},ct.prototype.last=function(){return this.data.maxKey()},Object.defineProperty(ct.prototype,"size",{get:function(){return this.data.size},enumerable:!1,configurable:!0}),ct.prototype.indexOf=function(n){return this.data.indexOf(n)},ct.prototype.forEach=function(n){this.data.inorderTraversal(function(t){return n(t),!1})},ct.prototype.forEachInRange=function(n,t){for(var r,i=this.data.getIteratorFrom(n[0]);i.hasNext();){if(r=i.getNext(),0<=this.comparator(r.key,n[1]))return;t(r.key)}},ct.prototype.forEachWhile=function(n,t){for(var i=void 0!==t?this.data.getIteratorFrom(t):this.data.getIterator();i.hasNext();)if(!n(i.getNext().key))return},ct.prototype.firstAfterOrEqual=function(n){return n=this.data.getIteratorFrom(n),n.hasNext()?n.getNext().key:null},ct.prototype.getIterator=function(){return new glt(this.data.getIterator())},ct.prototype.getIteratorFrom=function(n){return new glt(this.data.getIteratorFrom(n))},ct.prototype.add=function(n){return this.copy(this.data.remove(n).insert(n,!0))},ct.prototype.delete=function(n){return this.has(n)?this.copy(this.data.remove(n)):this},ct.prototype.isEmpty=function(){return this.data.isEmpty()},ct.prototype.unionWith=function(n){var t=this;return t.size<n.size&&(t=n,n=this),n.forEach(function(n){t=t.add(n)}),t},ct.prototype.isEqual=function(n){var t,i,r,u;if(!(n instanceof ct)||this.size!==n.size)return!1;for(t=this.data.getIterator(),i=n.data.getIterator();t.hasNext();)if(r=t.getNext().key,u=i.getNext().key,0!==this.comparator(r,u))return!1;return!0},ct.prototype.toArray=function(){var n=[];return this.forEach(function(t){n.push(t)}),n},ct.prototype.toString=function(){var n=[];return this.forEach(function(t){return n.push(t)}),"SortedSet("+n.toString()+")"},ct.prototype.copy=function(n){var t=new ct(this.comparator);return t.data=n,t},ct),glt=(wtt.prototype.getNext=function(){return this.iter.getNext().key},wtt.prototype.hasNext=function(){return this.iter.hasNext()},wtt),vu=new tr(h.comparator);var btt=new tr(h.comparator),nat=new tr(h.comparator),sti=new gt(h.comparator);var dw=new gt(w),ktt=(nit.createSynthesizedRemoteEventForCurrentChange=function(n,t){var i=new Map;return i.set(n,dtt.createSynthesizedTargetChangeForCurrentChange(n,t)),new nit(y.min(),i,dw,vu,tt())},nit),dtt=(gtt.createSynthesizedTargetChangeForCurrentChange=function(n,t){return new gtt(sr.EMPTY_BYTE_STRING,t,tt(),tt(),tt())},gtt),gw=function(n,t,i,r){this.v=n;this.removedTargetIds=t;this.key=i;this.P=r},tat=function(n,t){this.targetId=n;this.V=t},iat=function(n,t,i,r){void 0===i&&(i=sr.EMPTY_BYTE_STRING);void 0===r&&(r=null);this.state=n;this.targetIds=t;this.resumeToken=i;this.cause=r},rat=(Object.defineProperty(uu.prototype,"current",{get:function(){return this.N},enumerable:!1,configurable:!0}),Object.defineProperty(uu.prototype,"resumeToken",{get:function(){return this.C},enumerable:!1,configurable:!0}),Object.defineProperty(uu.prototype,"k",{get:function(){return 0!==this.S},enumerable:!1,configurable:!0}),Object.defineProperty(uu.prototype,"$",{get:function(){return this.F},enumerable:!1,configurable:!0}),uu.prototype.O=function(n){0<n.approximateByteSize()&&(this.F=!0,this.C=n)},uu.prototype.M=function(){var n=tt(),t=tt(),i=tt();return this.D.forEach(function(r,u){switch(u){case 0:n=n.add(r);break;case 2:t=t.add(r);break;case 1:i=i.add(r);break;default:s()}}),new dtt(this.C,this.N,n,t,i)},uu.prototype.L=function(){this.F=!1;this.D=fat()},uu.prototype.B=function(n,t){this.F=!0;this.D=this.D.insert(n,t)},uu.prototype.q=function(n){this.F=!0;this.D=this.D.remove(n)},uu.prototype.U=function(){this.S+=1},uu.prototype.K=function(){--this.S},uu.prototype.j=function(){this.F=!0;this.N=!0},uu),hti=(wi.prototype.X=function(n){for(var t,r,f,i=0,u=n.v;i<u.length;i++)t=u[i],n.P&&n.P.isFoundDocument()?this.Z(t,n.P):this.tt(t,n.key,n.P);for(r=0,f=n.removedTargetIds;r<f.length;r++)t=f[r],this.tt(t,n.key,n.P)},wi.prototype.et=function(n){var t=this;this.forEachTarget(n,function(i){var r=t.nt(i);switch(n.state){case 0:t.st(i)&&r.O(n.resumeToken);break;case 1:r.K();r.k||r.L();r.O(n.resumeToken);break;case 2:r.K();r.k||t.removeTarget(i);break;case 3:t.st(i)&&(r.j(),r.O(n.resumeToken));break;case 4:t.st(i)&&(t.it(i),r.O(n.resumeToken));break;default:s()}})},wi.prototype.forEachTarget=function(n,t){var i=this;0<n.targetIds.length?n.targetIds.forEach(t):this.G.forEach(function(n,r){i.st(r)&&t(r)})},wi.prototype.rt=function(n){var t=n.targetId,i=n.V.count,n=this.ot(t);n&&(lw(n=n.target)?0===i?(n=new h(n.path),this.tt(t,n,ri.newNoDocument(n,y.min()))):a(1===i):this.ct(t)!==i&&(this.it(t),this.Y=this.Y.add(t)))},wi.prototype.ut=function(n){var t=this,r=new Map,i,u;return this.G.forEach(function(i,u){var f=t.ot(u);f&&(i.current&&lw(f.target)&&(f=new h(f.target.path),null!==t.H.get(f)||t.at(u,f)||t.tt(u,f,ri.newNoDocument(f,n))),i.$&&(r.set(u,i.M()),i.L()))}),i=tt(),this.J.forEach(function(n,r){var u=!0;r.forEachWhile(function(n){return n=t.ot(n),!n||2===n.purpose||(u=!1)});u&&(i=i.add(n))}),u=new ktt(n,r,this.Y,this.H,i),this.H=vu,this.J=uat(),this.Y=new gt(w),u},wi.prototype.Z=function(n,t){var i;this.st(n)&&(i=this.at(n,t.key)?2:0,this.nt(n).B(t.key,i),this.H=this.H.insert(t.key,t),this.J=this.J.insert(t.key,this.ht(t.key).add(n)))},wi.prototype.tt=function(n,t,i){var r;this.st(n)&&(r=this.nt(n),this.at(n,t)?r.B(t,1):r.q(t),this.J=this.J.insert(t,this.ht(t).delete(n)),i&&(this.H=this.H.insert(t,i)))},wi.prototype.removeTarget=function(n){this.G.delete(n)},wi.prototype.ct=function(n){var t=this.nt(n).M();return this.W.getRemoteKeysForTarget(n).size+t.addedDocuments.size-t.removedDocuments.size},wi.prototype.U=function(n){this.nt(n).U()},wi.prototype.nt=function(n){var t=this.G.get(n);return t||(t=new rat,this.G.set(n,t)),t},wi.prototype.ht=function(n){var t=this.J.get(n);return t||(t=new gt(w),this.J=this.J.insert(n,t)),t},wi.prototype.st=function(n){var t=null!==this.ot(n);return t||e("WatchChangeAggregator","Detected inactive target",n),t},wi.prototype.ot=function(n){var t=this.G.get(n);return t&&t.k?null:this.W.lt(n)},wi.prototype.it=function(n){var t=this;this.G.set(n,new rat);this.W.getRemoteKeysForTarget(n).forEach(function(i){t.tt(n,i,null)})},wi.prototype.at=function(n,t){return this.W.getRemoteKeysForTarget(n).has(t)},wi);var cti={asc:"ASCENDING",desc:"DESCENDING"},lti={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"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"},ati=function(n,t){this.databaseId=n;this.I=t};gat=function(n,t){this.seconds=n;this.nanoseconds=t};fu.store="owner";fu.key="owner";ge.store="mutationQueues";ge.keyPath="userId";ft.store="mutations";ft.keyPath="batchId";ft.userMutationsIndex="userMutationsIndex";ft.userMutationsKeyPath=["userId","batchId"];bi=(tb.prefixForUser=function(n){return[n]},tb.prefixForPath=function(n,t){return[n,du(t)]},tb.key=function(n,t,i){return[n,du(t),i]},tb);bi.store="documentMutations";bi.PLACEHOLDER=new bi;ot=function(n,t,i,r,u,f){this.unknownDocument=n;this.noDocument=t;this.document=i;this.hasCommittedMutations=r;this.readTime=u;this.parentPath=f};ot.store="remoteDocuments";ot.readTimeIndex="readTimeIndex";ot.readTimeIndexPath="readTime";ot.collectionReadTimeIndex="collectionReadTimeIndex";ot.collectionReadTimeIndexPath=["parentPath","readTime"];vf.store="remoteDocumentGlobal";vf.key="remoteDocumentGlobalKey";gr.store="targets";gr.keyPath="targetId";gr.queryTargetsIndexName="queryTargetsIndex";gr.queryTargetsKeyPath=["canonicalId","targetId"];fi=function(n,t,i){this.targetId=n;this.path=t;this.sequenceNumber=i};fi.store="targetDocuments";fi.keyPath=["targetId","path"];fi.documentTargetsIndex="documentTargetsIndex";fi.documentTargetsKeyPath=["path","targetId"];eu.key="targetGlobalKey";eu.store="targetGlobal";es.store="collectionParents";es.keyPath=["collectionId","parent"];ie.store="clientMetadata";ie.keyPath="clientId";oc.store="bundles";oc.keyPath="bundleId";sc.store="namedQueries";sc.keyPath="name";var nvt,bti=g(g([],g(g([],g(g([],g(g([],[ge.store,ft.store,bi.store,ot.store,gr.store,fu.store,eu.store,fi.store]),[ie.store])),[vf.store])),[es.store])),[oc.store,sc.store]),tvt="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.",rt=(rit.prototype.addOnCommittedListener=function(n){this.onCommittedListeners.push(n)},rit.prototype.raiseOnCommittedEvent=function(){this.onCommittedListeners.forEach(function(n){return n()})},rit),cr=function(){var n=this;this.promise=new Promise(function(t,i){n.resolve=t;n.reject=i})},f=(st.prototype.catch=function(n){return this.next(void 0,n)},st.prototype.next=function(n,t){var i=this;return this.callbackAttached&&s(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(t,this.error):this.wrapSuccess(n,this.result):new st(function(r,u){i.nextCallback=function(t){i.wrapSuccess(n,t).next(r,u)};i.catchCallback=function(n){i.wrapFailure(t,n).next(r,u)}})},st.prototype.toPromise=function(){var n=this;return new Promise(function(t,i){n.next(t,i)})},st.prototype.wrapUserFunction=function(n){try{var t=n();return t instanceof st?t:st.resolve(t)}catch(n){return st.reject(n)}},st.prototype.wrapSuccess=function(n,t){return n?this.wrapUserFunction(function(){return n(t)}):st.resolve(t)},st.prototype.wrapFailure=function(n,t){return n?this.wrapUserFunction(function(){return n(t)}):st.reject(t)},st.resolve=function(n){return new st(function(t){t(n)})},st.reject=function(n){return new st(function(t,i){i(n)})},st.waitFor=function(n){return new st(function(t,i){var r=0,u=0,f=!1;n.forEach(function(n){++r;n.next(function(){++u;f&&u===r&&t()},function(n){return i(n)})});f=!0;u===r&&t()})},st.or=function(n){for(var t=st.resolve(!1),i=0,r=n;i<r.length;i++)!function(n){t=t.next(function(t){return t?st.resolve(t):n()})}(r[i]);return t},st.forEach=function(n,t){var r=this,i=[];return n.forEach(function(n,u){i.push(t.call(r,n,u))}),this.waitFor(i)},st),ivt=(cc.open=function(n,t,i,r){try{return new cc(t,n.transaction(r,i))}catch(n){throw new nv(t,n);}},Object.defineProperty(cc.prototype,"dt",{get:function(){return this.ft.promise},enumerable:!1,configurable:!0}),cc.prototype.abort=function(n){n&&this.ft.reject(n);this.aborted||(e("SimpleDb","Aborting transaction:",n?n.message:"Client-initiated abort"),this.aborted=!0,this.transaction.abort())},cc.prototype.store=function(n){return n=this.transaction.objectStore(n),new uvt(n)},cc),hc=(lr.delete=function(n){return e("SimpleDb","Removing database:",n),hs(window.indexedDB.deleteDatabase(n)).toPromise()},lr.yt=function(){if("undefined"==typeof indexedDB)return!1;if(lr.gt())return!0;var n=wo(),t=lr._t(n),i=0<t&&t<10,t=lr.Et(n),t=0<t&&t<4.5;return!(0<n.indexOf("MSIE ")||0<n.indexOf("Trident/")||0<n.indexOf("Edge/")||i||t)},lr.gt=function(){var n;return"undefined"!=typeof process&&"YES"===(null===(n=process.env)||void 0===n?void 0:n.Tt)},lr.It=function(n,t){return n.store(t)},lr._t=function(n){return n=n.match(/i(?:phone|pad|pod) os ([\d_]+)/i),n=n?n[1].split("_").slice(0,2).join("."):"-1",Number(n)},lr.Et=function(n){return n=n.match(/Android ([\d.]+)/i),n=n?n[1].split(".").slice(0,2).join("."):"-1",Number(n)},lr.prototype.At=function(n){return r(this,void 0,void 0,function(){var f,r=this;return i(this,function(i){switch(i.label){case 0:return this.db?[3,2]:(e("SimpleDb","Opening database:",this.name),f=this,[4,new Promise(function(i,f){var o=indexedDB.open(r.name,r.version);o.onsuccess=function(n){n=n.target.result;i(n)};o.onblocked=function(){f(new nv(n,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))};o.onerror=function(i){i=i.target.error;"VersionError"===i.name?f(new u(t.FAILED_PRECONDITION,"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.")):f(new nv(n,i))};o.onupgradeneeded=function(n){e("SimpleDb",'Database "'+r.name+'" requires upgrade from version:',n.oldVersion);var t=n.target.result;r.wt.Rt(t,o.transaction,n.oldVersion,r.version).next(function(){e("SimpleDb","Database upgrade to version "+r.version+" complete")})}})]);case 1:f.db=i.sent();i.label=2;case 2:return[2,(this.bt&&(this.db.onversionchange=function(n){return r.bt(n)}),this.db)]}})})},lr.prototype.vt=function(n){this.bt=n;this.db&&(this.db.onversionchange=function(t){return n(t)})},lr.prototype.runTransaction=function(n,t,u,o){return r(this,void 0,void 0,function(){var c,h,r,s;return i(this,function(l){switch(l.label){case 0:c="readonly"===t;h=0;s=function(){var l,t,s;return i(this,function(i){switch(i.label){case 0:++h;i.label=1;case 1:return i.trys.push([1,4,,5]),[4,r.At(n)];case 2:return r.db=i.sent(),l=ivt.open(r.db,n,c?"readonly":"readwrite",u),t=o(l).catch(function(n){return l.abort(n),f.reject(n)}).toPromise(),s={},t.catch(function(){}),[4,l.dt];case 3:return[2,(s.value=(i.sent(),t),s)];case 4:return t=i.sent(),s="FirebaseError"!==t.name&&h<3,e("SimpleDb","Transaction failed with error:",t.message,"Retrying:",s),r.close(),s?[3,5]:[2,{value:Promise.reject(t)}];case 5:return[2]}})};r=this;l.label=1;case 1:return[5,s()];case 2:if("object"==typeof(s=l.sent()))return[2,s.value];l.label=3;case 3:return[3,1];case 4:return[2]}})})},lr.prototype.close=function(){this.db&&this.db.close();this.db=void 0},lr),kti=(Object.defineProperty(os.prototype,"isDone",{get:function(){return this.Vt},enumerable:!1,configurable:!0}),Object.defineProperty(os.prototype,"Dt",{get:function(){return this.St},enumerable:!1,configurable:!0}),Object.defineProperty(os.prototype,"cursor",{set:function(n){this.Pt=n},enumerable:!1,configurable:!0}),os.prototype.done=function(){this.Vt=!0},os.prototype.Ct=function(n){this.St=n},os.prototype.delete=function(){return hs(this.Pt.delete())},os),nv=(c(rvt,nvt=u),rvt);uvt=(ou.prototype.put=function(n,t){return n=void 0!==t?(e("SimpleDb","PUT",this.store.name,n,t),this.store.put(t,n)):(e("SimpleDb","PUT",this.store.name,"<auto-key>",n),this.store.put(n)),hs(n)},ou.prototype.add=function(n){return e("SimpleDb","ADD",this.store.name,n,n),hs(this.store.add(n))},ou.prototype.get=function(n){var t=this;return hs(this.store.get(n)).next(function(i){return e("SimpleDb","GET",t.store.name,n,i=void 0===i?null:i),i})},ou.prototype.delete=function(n){return e("SimpleDb","DELETE",this.store.name,n),hs(this.store.delete(n))},ou.prototype.count=function(){return e("SimpleDb","COUNT",this.store.name),hs(this.store.count())},ou.prototype.Nt=function(n,t){var t=this.cursor(this.options(n,t)),i=[];return this.xt(t,function(n,t){i.push(t)}).next(function(){return i})},ou.prototype.Ft=function(n,t){return e("SimpleDb","DELETE ALL",this.store.name),t=this.options(n,t),t.kt=!1,t=this.cursor(t),this.xt(t,function(n,t,i){return i.delete()})},ou.prototype.$t=function(n,t){t?i=n:(i={},t=n);var i=this.cursor(i);return this.xt(i,t)},ou.prototype.Ot=function(n){var t=this.cursor({});return new f(function(i,r){t.onerror=function(n){n=fit(n.target.error);r(n)};t.onsuccess=function(t){var r=t.target.result;r?n(r.primaryKey,r.value).next(function(n){n?r.continue():i()}):i()}})},ou.prototype.xt=function(n,t){var i=[];return new f(function(r,u){n.onerror=function(n){u(n.target.error)};n.onsuccess=function(n){var u,e=n.target.result;e?(u=new kti(e),(n=t(e.primaryKey,e.value,u))instanceof f&&(n=n.catch(function(n){return u.done(),f.reject(n)}),i.push(n)),u.isDone?r():null===u.Dt?e.continue():e.continue(u.Dt)):r()}}).next(function(){return f.waitFor(i)})},ou.prototype.options=function(n,t){var i;return void 0!==n&&("string"==typeof n?i=n:t=n),{index:i,range:t}},ou.prototype.cursor=function(n){var t="next",i;return(n.reverse&&(t="prev"),n.index)?(i=this.store.index(n.index),n.kt?i.openKeyCursor(n.range,t):i.openCursor(n.range,t)):this.store.openCursor(n.range,t)},ou);uit=!1;eit=(c(evt,fvt=rt),evt);var oit=(lc.prototype.applyToRemoteDocument=function(n,t){for(var u,s,h,i,f,e,r,c=t.mutationResults,o=0;o<this.mutations.length;o++)r=this.mutations[o],r.key.isEqual(n.key)&&(u=r,s=n,h=c[o],r=e=f=i=void 0,u instanceof rc?(f=s,e=h,r=(i=u).value.clone(),i=alt(i.fieldTransforms,f,e.transformResults),r.setAll(i),f.convertToFoundDocument(e.version,r).setHasCommittedMutations()):u instanceof ne?(i=s,f=h,pw((e=u).precondition,i)?(r=alt(e.fieldTransforms,i,f.transformResults),(u=i.data).setAll(llt(e)),u.setAll(r),i.convertToFoundDocument(f.version,u).setHasCommittedMutations()):i.convertToUnknownDocument(f.version)):s.convertToNoDocument(h.version).setHasCommittedMutations())},lc.prototype.applyToLocalView=function(n){for(var i,r,f,t=0,u=this.baseMutations;t<u.length;t++)(i=u[t]).key.isEqual(n.key)&&ptt(i,n,this.localWriteTime);for(r=0,f=this.mutations;r<f.length;r++)(i=f[r]).key.isEqual(n.key)&&ptt(i,n,this.localWriteTime)},lc.prototype.applyToLocalDocumentSet=function(n){var t=this;this.mutations.forEach(function(i){var r=n.get(i.key),i=r;t.applyToLocalView(i);r.isValidDocument()||i.convertToNoDocument(y.min())})},lc.prototype.keys=function(){return this.mutations.reduce(function(n,t){return n.add(t.key)},tt())},lc.prototype.isEqual=function(n){return this.batchId===n.batchId&&bh(this.mutations,n.mutations,flt)&&bh(this.baseMutations,n.baseMutations,flt)},lc),dti=(sit.from=function(n,t,i){a(n.mutations.length===i.length);for(var u=nat,f=n.mutations,r=0;r<f.length;r++)u=u.insert(f[r].key,i[r].version);return new sit(n,t,i,u)},sit),ib=(cs.prototype.withSequenceNumber=function(n){return new cs(this.target,this.targetId,this.purpose,n,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken)},cs.prototype.withResumeToken=function(n,t){return new cs(this.target,this.targetId,this.purpose,this.sequenceNumber,t,this.lastLimboFreeSnapshotVersion,n)},cs.prototype.withLastLimboFreeSnapshotVersion=function(n){return new cs(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,n,this.resumeToken)},cs),ovt=function(n){this.Lt=n};lvt=(iv.prototype.getBundleMetadata=function(n,t){return avt(n).get(t).next(function(n){if(n)return{id:(n=n).bundleId,createTime:vc(n.createTime),version:n.version}})},iv.prototype.saveBundleMetadata=function(n,t){return avt(n).put({bundleId:(t=t).id,createTime:ac(ui(t.createTime)),version:t.version})},iv.prototype.getNamedQuery=function(n,t){return vvt(n).get(t).next(function(n){if(n)return{name:(n=n).name,query:lit(n.bundledQuery),readTime:vc(n.readTime)}})},iv.prototype.saveNamedQuery=function(n,t){return vvt(n).put({name:(t=t).name,readTime:ac(ui(t.readTime)),bundledQuery:t.bundledQuery})},iv);var gti=(yit.prototype.addToCollectionParentIndex=function(n,t){return this.Bt.add(t),f.resolve()},yit.prototype.getCollectionParents=function(n,t){return f.resolve(this.Bt.getEntries(t))},yit),ait=(rb.prototype.add=function(n){var t=n.lastSegment(),i=n.popLast(),r=this.index[t]||new gt(k.comparator),n=!r.has(i);return this.index[t]=r.add(i),n},rb.prototype.has=function(n){var t=n.lastSegment(),n=n.popLast(),t=this.index[t];return t&&t.has(n)},rb.prototype.getEntries=function(n){return(this.index[n]||new gt(k.comparator)).toArray()},rb),nii=(vit.prototype.addToCollectionParentIndex=function(n,t){var u=this,r,i;return this.qt.has(t)?f.resolve():(r=t.lastSegment(),i=t.popLast(),n.addOnCommittedListener(function(){u.qt.add(t)}),i={collectionId:r,parent:du(i)},yvt(n).put(i))},vit.prototype.getCollectionParents=function(n,t){var i=[],r=IDBKeyRange.bound([t,""],[oht(t),""],!1,!0);return yvt(n).Nt(r).next(function(n){for(var f,r=0,u=n;r<u.length;r++){if(f=u[r],f.collectionId!==t)break;i.push(te(f.parent))}return i})},vit);pit={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0};gu=(rv.withCacheSize=function(n){return new rv(n,rv.DEFAULT_COLLECTION_PERCENTILE,rv.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)},rv);gu.DEFAULT_COLLECTION_PERCENTILE=10;gu.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3;gu.DEFAULT=new gu(41943040,gu.DEFAULT_COLLECTION_PERCENTILE,gu.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT);gu.DISABLED=new gu(-1,0,0);wvt=(ni.Kt=function(n,t,i,r){return a(""!==n.uid),new ni(n.isAuthenticated()?n.uid:"",t,i,r)},ni.prototype.checkEmpty=function(n){var t=!0,i=IDBKeyRange.bound([this.userId,Number.NEGATIVE_INFINITY],[this.userId,Number.POSITIVE_INFINITY]);return no(n).$t({index:ft.userMutationsIndex,range:i},function(n,i,r){t=!1;r.done()}).next(function(){return t})},ni.prototype.addMutationBatch=function(n,t,i,r){var u=this,o=pc(n),e=no(n);return e.add({}).next(function(s){a("number"==typeof s);for(var l,p,h,b,k,v=new oit(s,t,i,r),tt=(l=u.R,p=u.userId,b=(h=v).baseMutations.map(function(n){return nb(l.Lt,n)}),k=h.mutations.map(function(n){return nb(l.Lt,n)}),new ft(p,h.batchId,h.localWriteTime.toMillis(),b,k)),c=[],d=new gt(function(n,t){return w(n.canonicalString(),t.canonicalString())}),y=0,g=r;y<g.length;y++){var nt=g[y],it=bi.key(u.userId,nt.key.path,s),d=d.add(nt.key.path.popLast());c.push(e.put(tt));c.push(o.put(it,bi.PLACEHOLDER))}return d.forEach(function(t){c.push(u.Ut.addToCollectionParentIndex(n,t))}),n.addOnCommittedListener(function(){u.Qt[s]=v.keys()}),f.waitFor(c).next(function(){return v})})},ni.prototype.lookupMutationBatch=function(n,t){var i=this;return no(n).get(t).next(function(n){return n?(a(n.userId===i.userId),yc(i.R,n)):null})},ni.prototype.jt=function(n,t){var i=this;return this.Qt[t]?f.resolve(this.Qt[t]):this.lookupMutationBatch(n,t).next(function(n){return n?(n=n.keys(),i.Qt[t]=n):null})},ni.prototype.getNextMutationBatchAfterBatchId=function(n,t){var i=this,r=t+1,t=IDBKeyRange.lowerBound([this.userId,r]),u=null;return no(n).$t({index:ft.userMutationsIndex,range:t},function(n,t,f){t.userId===i.userId&&(a(t.batchId>=r),u=yc(i.R,t));f.done()}).next(function(){return u})},ni.prototype.getHighestUnacknowledgedBatchId=function(n){var i=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]),t=-1;return no(n).$t({index:ft.userMutationsIndex,range:i,reverse:!0},function(n,i,r){t=i.batchId;r.done()}).next(function(){return t})},ni.prototype.getAllMutationBatches=function(n){var t=this,i=IDBKeyRange.bound([this.userId,-1],[this.userId,Number.POSITIVE_INFINITY]);return no(n).Nt(ft.userMutationsIndex,i).next(function(n){return n.map(function(n){return yc(t.R,n)})})},ni.prototype.getAllMutationBatchesAffectingDocumentKey=function(n,t){var i=this,r=bi.prefixForPath(this.userId,t.path),r=IDBKeyRange.lowerBound(r),u=[];return pc(n).$t({range:r},function(r,f,e){var h=r[0],o=r[1],r=r[2],o=te(o);if(h===i.userId&&t.path.isEqual(o))return no(n).get(r).next(function(n){if(!n)throw s();a(n.userId===i.userId);u.push(yc(i.R,n))});e.done()}).next(function(){return u})},ni.prototype.getAllMutationBatchesAffectingDocumentKeys=function(n,t){var i=this,r=new gt(w),u=[];return t.forEach(function(t){var f=bi.prefixForPath(i.userId,t.path),f=IDBKeyRange.lowerBound(f),f=pc(n).$t({range:f},function(n,u,f){var o=n[0],e=n[1],n=n[2],e=te(e);o===i.userId&&t.path.isEqual(e)?r=r.add(n):f.done()});u.push(f)}),f.waitFor(u).next(function(){return i.Wt(n,r)})},ni.prototype.getAllMutationBatchesAffectingQuery=function(n,t){var u=this,i=t.path,f=i.length+1,t=bi.prefixForPath(this.userId,i),t=IDBKeyRange.lowerBound(t),r=new gt(w);return pc(n).$t({range:t},function(n,t,e){var s=n[0],o=n[1],n=n[2],o=te(o);s===u.userId&&i.isPrefixOf(o)?o.length===f&&(r=r.add(n)):e.done()}).next(function(){return u.Wt(n,r)})},ni.prototype.Wt=function(n,t){var i=this,r=[],u=[];return t.forEach(function(t){u.push(no(n).get(t).next(function(n){if(null===n)throw s();a(n.userId===i.userId);r.push(yc(i.R,n))}))}),f.waitFor(u).next(function(){return r})},ni.prototype.removeMutationBatch=function(n,t){var i=this;return pvt(n.Mt,this.userId,t).next(function(r){return n.addOnCommittedListener(function(){i.Gt(t.batchId)}),f.forEach(r,function(t){return i.referenceDelegate.markPotentiallyOrphaned(n,t)})})},ni.prototype.Gt=function(n){delete this.Qt[n]},ni.prototype.performConsistencyCheck=function(n){var t=this;return this.checkEmpty(n).next(function(i){if(!i)return f.resolve();var i=IDBKeyRange.lowerBound(bi.prefixForUser(t.userId)),r=[];return pc(n).$t({range:i},function(n,i,u){n[0]===t.userId?(n=te(n[1]),r.push(n)):u.done()}).next(function(){a(0===r.length)})})},ni.prototype.containsKey=function(n,t){return bvt(n,this.userId,t)},ni.prototype.zt=function(n){var t=this;return kvt(n).get(this.userId).next(function(n){return n||new ge(t.userId,-1,"")})},ni);uv=(wc.prototype.next=function(){return this.Ht+=2,this.Ht},wc.Jt=function(){return new wc(0)},wc.Yt=function(){return new wc(-1)},wc);dvt=(lt.prototype.allocateTargetId=function(n){var t=this;return this.Xt(n).next(function(i){var r=new uv(i.highestTargetId);return i.highestTargetId=r.next(),t.Zt(n,i).next(function(){return i.highestTargetId})})},lt.prototype.getLastRemoteSnapshotVersion=function(n){return this.Xt(n).next(function(n){return y.fromTimestamp(new or(n.lastRemoteSnapshotVersion.seconds,n.lastRemoteSnapshotVersion.nanoseconds))})},lt.prototype.getHighestSequenceNumber=function(n){return this.Xt(n).next(function(n){return n.highestListenSequenceNumber})},lt.prototype.setTargetsMetadata=function(n,t,i){var r=this;return this.Xt(n).next(function(u){return u.highestListenSequenceNumber=t,i&&(u.lastRemoteSnapshotVersion=i.toTimestamp()),t>u.highestListenSequenceNumber&&(u.highestListenSequenceNumber=t),r.Zt(n,u)})},lt.prototype.addTargetData=function(n,t){var i=this;return this.te(n,t).next(function(){return i.Xt(n).next(function(r){return r.targetCount+=1,i.ee(t,r),i.Zt(n,r)})})},lt.prototype.updateTargetData=function(n,t){return this.te(n,t)},lt.prototype.removeTargetData=function(n,t){var i=this;return this.removeMatchingKeysForTargetId(n,t.targetId).next(function(){return bc(n).delete(t.targetId)}).next(function(){return i.Xt(n)}).next(function(t){return a(0<t.targetCount),--t.targetCount,i.Zt(n,t)})},lt.prototype.removeTargets=function(n,t,i){var e=this,r=0,u=[];return bc(n).$t(function(f,o){o=tv(o);o.sequenceNumber<=t&&null===i.get(o.targetId)&&(r++,u.push(e.removeTargetData(n,o)))}).next(function(){return f.waitFor(u)}).next(function(){return r})},lt.prototype.forEachTarget=function(n,t){return bc(n).$t(function(n,i){i=tv(i);t(i)})},lt.prototype.Xt=function(n){return gvt(n).get(eu.key).next(function(n){return a(null!==n),n})},lt.prototype.Zt=function(n,t){return gvt(n).put(eu.key,t)},lt.prototype.te=function(n,t){return bc(n).put(cvt(this.R,t))},lt.prototype.ee=function(n,t){var i=!1;return n.targetId>t.highestTargetId&&(t.highestTargetId=n.targetId,i=!0),n.sequenceNumber>t.highestListenSequenceNumber&&(t.highestListenSequenceNumber=n.sequenceNumber,i=!0),i},lt.prototype.getTargetCount=function(n){return this.Xt(n).next(function(n){return n.targetCount})},lt.prototype.getTargetData=function(n,t){var i=ya(t),i=IDBKeyRange.bound([i,Number.NEGATIVE_INFINITY],[i,Number.POSITIVE_INFINITY]),r=null;return bc(n).$t({range:i,index:gr.queryTargetsIndexName},function(n,i,u){i=tv(i);cw(t,i.target)&&(r=i,u.done())}).next(function(){return r})},lt.prototype.addMatchingKeys=function(n,t,i){var u=this,r=[],e=to(n);return t.forEach(function(t){var f=du(t.path);r.push(e.put(new fi(i,f)));r.push(u.referenceDelegate.addReference(n,i,t))}),f.waitFor(r)},lt.prototype.removeMatchingKeys=function(n,t,i){var r=this,u=to(n);return f.forEach(t,function(t){var e=du(t.path);return f.waitFor([u.delete([i,e]),r.referenceDelegate.removeReference(n,i,t)])})},lt.prototype.removeMatchingKeysForTargetId=function(n,t){return n=to(n),t=IDBKeyRange.bound([t],[t+1],!1,!0),n.delete(t)},lt.prototype.getMatchingKeysForTargetId=function(n,t){var t=IDBKeyRange.bound([t],[t+1],!1,!0),n=to(n),i=tt();return n.$t({range:t,kt:!0},function(n){n=te(n[1]);n=new h(n);i=i.add(n)}).next(function(){return i})},lt.prototype.containsKey=function(n,t){var t=du(t.path),t=IDBKeyRange.bound([t],[oht(t)],!1,!0),i=0;return to(n).$t({index:fi.documentTargetsIndex,kt:!0,range:t},function(n,t,r){var u=n[0];n[1];0!==u&&(i++,r.done())}).next(function(){return 0<i})},lt.prototype.lt=function(n,t){return bc(n).get(t).next(function(n){return n?tv(n):null})},lt);var tii=(fb.prototype.ie=function(){return++this.se},fb.prototype.re=function(n){var t=[n,this.ie()];this.buffer.size<this.ne?this.buffer=this.buffer.add(t):nyt(t,n=this.buffer.last())<0&&(this.buffer=this.buffer.delete(n).add(t))},Object.defineProperty(fb.prototype,"maxValue",{get:function(){return this.buffer.last()[0]},enumerable:!1,configurable:!0}),fb),iii=(fv.prototype.start=function(n){-1!==this.garbageCollector.params.cacheSizeCollectionThreshold&&this.ue(n)},fv.prototype.stop=function(){this.ce&&(this.ce.cancel(),this.ce=null)},Object.defineProperty(fv.prototype,"started",{get:function(){return null!==this.ce},enumerable:!1,configurable:!0}),fv.prototype.ue=function(n){var u=this,t=this.oe?3e5:6e4;e("LruGarbageCollector","Garbage collection scheduled in "+t+"ms");this.ce=this.asyncQueue.enqueueAfterDelay("lru_garbage_collection",t,function(){return r(u,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:this.ce=null;this.oe=!0;i.label=1;case 1:return i.trys.push([1,3,,7]),[4,n.collectGarbage(this.garbageCollector)];case 2:return i.sent(),[3,7];case 3:return ss(t=i.sent())?(e("LruGarbageCollector","Ignoring IndexedDB error during garbage collection: ",t),[3,6]):[3,4];case 4:return[4,ls(t)];case 5:i.sent();i.label=6;case 6:return[3,7];case 7:return[4,this.ue(n)];case 8:return i.sent(),[2]}})})})},fv),rii=(io.prototype.calculateTargetCount=function(n,t){return this.ae.he(n).next(function(n){return Math.floor(t/100*n)})},io.prototype.nthSequenceNumber=function(n,t){var r=this,i;return 0===t?f.resolve(ru.o):(i=new tii(t),this.ae.forEachTarget(n,function(n){return i.re(n.sequenceNumber)}).next(function(){return r.ae.le(n,function(n){return i.re(n)})}).next(function(){return i.maxValue}))},io.prototype.removeTargets=function(n,t,i){return this.ae.removeTargets(n,t,i)},io.prototype.removeOrphanedDocuments=function(n,t){return this.ae.removeOrphanedDocuments(n,t)},io.prototype.collect=function(n,t){var i=this;return-1===this.params.cacheSizeCollectionThreshold?(e("LruGarbageCollector","Garbage collection skipped; disabled"),f.resolve(pit)):this.getCacheSize(n).next(function(r){return r<i.params.cacheSizeCollectionThreshold?(e("LruGarbageCollector","Garbage collection skipped; Cache size "+r+" is lower than threshold "+i.params.cacheSizeCollectionThreshold),pit):i.fe(n,t)})},io.prototype.getCacheSize=function(n){return this.ae.getCacheSize(n)},io.prototype.fe=function(n,t){var u,r,o,s,h,c,l,i=this,a=Date.now();return this.calculateTargetCount(n,this.params.percentileToCollect).next(function(t){return r=t>i.params.maximumSequenceNumbersToCollect?(e("LruGarbageCollector","Capping sequence numbers to collect down to the maximum of "+i.params.maximumSequenceNumbersToCollect+" from "+t),i.params.maximumSequenceNumbersToCollect):t,s=Date.now(),i.nthSequenceNumber(n,r)}).next(function(r){return u=r,h=Date.now(),i.removeTargets(n,u,t)}).next(function(t){return o=t,c=Date.now(),i.removeOrphanedDocuments(n,u)}).next(function(n){return l=Date.now(),yn()<=nt.DEBUG&&e("LruGarbageCollector","LRU Garbage Collection\n\tCounted targets in "+(s-a)+"ms\n\tDetermined least recently used "+r+" in "+(h-s)+"ms\n\tRemoved "+o+" targets in "+(c-h)+"ms\n\tRemoved "+n+" documents in "+(l-c)+"ms\nTotal Duration: "+(l-a)+"ms"),f.resolve({didRun:!0,sequenceNumbersCollected:r,targetsRemoved:o,documentsRemoved:n})})},io),uii=(ar.prototype.he=function(n){var t=this.de(n);return this.db.getTargetCache().getTargetCount(n).next(function(n){return t.next(function(t){return n+t})})},ar.prototype.de=function(n){var t=0;return this.le(n,function(){t++}).next(function(){return t})},ar.prototype.forEachTarget=function(n,t){return this.db.getTargetCache().forEachTarget(n,t)},ar.prototype.le=function(n,t){return this.we(n,function(n,i){return t(i)})},ar.prototype.addReference=function(n,t,i){return eb(n,i)},ar.prototype.removeReference=function(n,t,i){return eb(n,i)},ar.prototype.removeTargets=function(n,t,i){return this.db.getTargetCache().removeTargets(n,t,i)},ar.prototype.markPotentiallyOrphaned=eb,ar.prototype._e=function(n,t){return u=t,i=!1,kvt(r=n).Ot(function(n){return bvt(r,n,u).next(function(n){return n&&(i=!0),f.resolve(!n)})}).next(function(){return i});var r,u,i},ar.prototype.removeOrphanedDocuments=function(n,t){var e=this,i=this.db.getRemoteDocumentCache().newChangeBuffer(),r=[],u=0;return this.we(n,function(f,o){o<=t&&(o=e._e(n,f).next(function(t){if(!t)return u++,i.getEntry(n,f).next(function(){return i.removeEntry(f),to(n).delete([0,du(f.path)])})}),r.push(o))}).next(function(){return f.waitFor(r)}).next(function(){return i.apply(n)}).next(function(){return u})},ar.prototype.removeTarget=function(n,t){return t=t.withSequenceNumber(n.currentSequenceNumber),this.db.getTargetCache().updateTargetData(n,t)},ar.prototype.updateLimboDocument=eb,ar.prototype.we=function(n,t){var r,n=to(n),i=ru.o;return n.$t({index:fi.documentTargetsIndex},function(n,u){var f=n[0],n=(n[1],u.path),u=u.sequenceNumber;0===f?(i!==ru.o&&t(new h(te(r)),i),i=u,r=n):i=ru.o}).next(function(){i!==ru.o&&t(new h(te(r)),i)})},ar.prototype.getCacheSize=function(n){return this.db.getRemoteDocumentCache().getSize(n)},ar);var tyt,kc=(as.prototype.get=function(n){var i=this.mapKeyFn(n),i=this.inner[i],t,r;if(void 0!==i)for(t=0,r=i;t<r.length;t++){var u=r[t],f=u[0],u=u[1];if(this.equalsFn(f,n))return u}},as.prototype.has=function(n){return void 0!==this.get(n)},as.prototype.set=function(n,t){var u=this.mapKeyFn(n),i=this.inner[u],r;if(void 0!==i){for(r=0;r<i.length;r++)if(this.equalsFn(i[r][0],n))return void(i[r]=[n,t]);i.push([n,t])}else this.inner[u]=[[n,t]]},as.prototype.delete=function(n){var r=this.mapKeyFn(n),t=this.inner[r],i;if(void 0===t)return!1;for(i=0;i<t.length;i++)if(this.equalsFn(t[i][0],n))return 1===t.length?delete this.inner[r]:t.splice(i,1),!0;return!1},as.prototype.forEach=function(n){ns(this.inner,function(t,i){for(var r=0,u=i;r<u.length;r++){var f=u[r],e=f[0],f=f[1];n(e,f)}})},as.prototype.isEmpty=function(){return hht(this.inner)},as),l=(ro.prototype.getReadTime=function(n){return n=this.changes.get(n),n?n.readTime:y.min()},ro.prototype.addEntry=function(n,t){this.assertNotApplied();this.changes.set(n.key,{document:n,readTime:t})},ro.prototype.removeEntry=function(n,t){void 0===t&&(t=null);this.assertNotApplied();this.changes.set(n,{document:ri.newInvalidDocument(n),readTime:t})},ro.prototype.getEntry=function(n,t){this.assertNotApplied();var i=this.changes.get(t);return void 0!==i?f.resolve(i.document):this.getFromCache(n,t)},ro.prototype.getEntries=function(n,t){return this.getAllFromCache(n,t)},ro.prototype.apply=function(n){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(n)},ro.prototype.assertNotApplied=function(){},ro),fii=(vr.prototype.addEntry=function(n,t,i){return uo(n).put(ob(t),i)},vr.prototype.removeEntry=function(n,t){return n=uo(n),t=ob(t),n.delete(t)},vr.prototype.updateMetadata=function(n,t){var i=this;return this.getMetadata(n).next(function(r){return r.byteSize+=t,i.me(n,r)})},vr.prototype.getEntry=function(n,t){var i=this;return uo(n).get(ob(t)).next(function(n){return i.ye(t,n)})},vr.prototype.ge=function(n,t){var i=this;return uo(n).get(ob(t)).next(function(n){return{document:i.ye(t,n),size:ub(n)}})},vr.prototype.getEntries=function(n,t){var r=this,i=vu;return this.pe(n,t,function(n,t){t=r.ye(n,t);i=i.insert(n,t)}).next(function(){return i})},vr.prototype.Ee=function(n,t){var u=this,i=vu,r=new tr(h.comparator);return this.pe(n,t,function(n,t){var f=u.ye(n,t);i=i.insert(n,f);r=r.insert(n,ub(t))}).next(function(){return{documents:i,Te:r}})},vr.prototype.pe=function(n,t,i){if(t.isEmpty())return f.resolve();var e=IDBKeyRange.bound(t.first().path.toArray(),t.last().path.toArray()),u=t.getIterator(),r=u.getNext();return uo(n).$t({range:e},function(n,t,f){for(var e=h.fromSegments(n);r&&h.comparator(r,e)<0;)i(r,null),r=u.getNext();r&&r.isEqual(e)&&(i(r,t),r=u.hasNext()?u.getNext():null);r?f.Ct(r.path.toArray()):f.done()}).next(function(){for(;r;)i(r,null),r=u.hasNext()?u.getNext():null})},vr.prototype.getDocumentsMatchingQuery=function(n,t,i){var r,e=this,f=vu,o=t.path.length+1,u={};return i.isEqual(y.min())?(r=t.path.toArray(),u.range=IDBKeyRange.lowerBound(r)):(r=t.path.toArray(),i=cit(i),u.range=IDBKeyRange.lowerBound([r,i],!0),u.index=ot.collectionReadTimeIndex),uo(n).$t(u,function(n,i,r){n.length===o&&(i=hit(e.R,i),t.path.isPrefixOf(i.key.path)?ba(t,i)&&(f=f.insert(i.key,i)):r.done())}).next(function(){return f})},vr.prototype.newChangeBuffer=function(n){return new eii(this,!!n&&n.trackRemovals)},vr.prototype.getSize=function(n){return this.getMetadata(n).next(function(n){return n.byteSize})},vr.prototype.getMetadata=function(n){return iyt(n).get(vf.key).next(function(n){return a(!!n),n})},vr.prototype.me=function(n,t){return iyt(n).put(vf.key,t)},vr.prototype.ye=function(n,t){return t&&(t=hit(this.R,t),!t.isNoDocument()||!t.version.isEqual(y.min()))?t:ri.newInvalidDocument(n)},vr),eii=(c(ev,tyt=l),ev.prototype.applyChanges=function(n){var t=this,i=[],r=0,u=new gt(function(n,t){return w(n.canonicalString(),t.canonicalString())});return this.changes.forEach(function(f,e){var s,o=t.Ae.get(f);e.document.isValidDocument()?(s=svt(t.Ie.R,e.document,t.getReadTime(f)),u=u.add(f.path.popLast()),e=ub(s),r+=e-o,i.push(t.Ie.addEntry(n,f,s))):(r-=o,t.trackRemovals?(o=svt(t.Ie.R,ri.newNoDocument(f,y.min()),t.getReadTime(f)),i.push(t.Ie.addEntry(n,f,o))):i.push(t.Ie.removeEntry(n,f)))}),u.forEach(function(r){i.push(t.Ie.Ut.addToCollectionParentIndex(n,r))}),i.push(this.Ie.updateMetadata(n,r)),f.waitFor(i)},ev.prototype.getFromCache=function(n,t){var i=this;return this.Ie.ge(n,t).next(function(n){return i.Ae.set(t,n.size),n.document})},ev.prototype.getAllFromCache=function(n,t){var i=this;return this.Ie.Ee(n,t).next(function(n){var t=n.documents;return n.Te.forEach(function(n,t){i.Ae.set(n,t)}),t})},ev);ryt=(vs.prototype.Rt=function(n,t,i,r){var s=this,e,o,u;return a(i<r&&0<=i&&r<=11),e=new ivt("createOrUpgrade",t),i<1&&1<=r&&(n.createObjectStore(fu.store),(o=n).createObjectStore(ge.store,{keyPath:ge.keyPath}),o.createObjectStore(ft.store,{keyPath:ft.keyPath,autoIncrement:!0}).createIndex(ft.userMutationsIndex,ft.userMutationsKeyPath,{unique:!0}),o.createObjectStore(bi.store),uyt(n),n.createObjectStore(ot.store)),u=f.resolve(),i<3&&3<=r&&(0!==i&&((o=n).deleteObjectStore(fi.store),o.deleteObjectStore(gr.store),o.deleteObjectStore(eu.store),uyt(n)),u=u.next(function(){return n=e.store(eu.store),t=new eu(0,0,y.min().toTimestamp(),0),n.put(eu.key,t);var n,t})),i<4&&4<=r&&(u=(u=0!==i?u.next(function(){return t=n,(i=e).store(ft.store).Nt().next(function(n){t.deleteObjectStore(ft.store);t.createObjectStore(ft.store,{keyPath:ft.keyPath,autoIncrement:!0}).createIndex(ft.userMutationsIndex,ft.userMutationsKeyPath,{unique:!0});var r=i.store(ft.store),n=n.map(function(n){return r.put(n)});return f.waitFor(n)});var t,i}):u).next(function(){n.createObjectStore(ie.store,{keyPath:ie.keyPath})})),i<5&&5<=r&&(u=u.next(function(){return s.Re(e)})),i<6&&6<=r&&(u=u.next(function(){return n.createObjectStore(vf.store),s.be(e)})),i<7&&7<=r&&(u=u.next(function(){return s.ve(e)})),i<8&&8<=r&&(u=u.next(function(){return s.Pe(n,e)})),i<9&&9<=r&&(u=u.next(function(){var i;(i=n).objectStoreNames.contains("remoteDocumentChanges")&&i.deleteObjectStore("remoteDocumentChanges");(i=t.objectStore(ot.store)).createIndex(ot.readTimeIndex,ot.readTimeIndexPath,{unique:!1});i.createIndex(ot.collectionReadTimeIndex,ot.collectionReadTimeIndexPath,{unique:!1})})),i<10&&10<=r&&(u=u.next(function(){return s.Ve(e)})),u=i<11&&11<=r?u.next(function(){n.createObjectStore(oc.store,{keyPath:oc.keyPath});n.createObjectStore(sc.store,{keyPath:sc.keyPath})}):u},vs.prototype.be=function(n){var t=0;return n.store(ot.store).$t(function(n,i){t+=ub(i)}).next(function(){var i=new vf(t);return n.store(vf.store).put(vf.key,i)})},vs.prototype.Re=function(n){var t=this,i=n.store(ge.store),r=n.store(ft.store);return i.Nt().next(function(i){return f.forEach(i,function(i){var u=IDBKeyRange.bound([i.userId,-1],[i.userId,i.lastAcknowledgedBatchId]);return r.Nt(ft.userMutationsIndex,u).next(function(r){return f.forEach(r,function(r){return a(r.userId===i.userId),r=yc(t.R,r),pvt(n,i.userId,r).next(function(){})})})})})},vs.prototype.ve=function(n){var t=n.store(fi.store),i=n.store(ot.store);return n.store(eu.store).get(eu.key).next(function(n){var r=[];return i.$t(function(i){var u=new k(i),i=[0,du(u)];r.push(t.get(i).next(function(i){return i?f.resolve():t.put(new fi(0,du(u),n.highestListenSequenceNumber))}))}).next(function(){return f.waitFor(r)})})},vs.prototype.Pe=function(n,t){function i(n){if(u.add(n)){var t=n.lastSegment(),n=n.popLast();return r.put({collectionId:t,parent:du(n)})}}n.createObjectStore(es.store,{keyPath:es.keyPath});var r=t.store(es.store),u=new ait;return t.store(ot.store).$t({kt:!0},function(n){return n=new k(n),i(n.popLast())}).next(function(){return t.store(bi.store).$t({kt:!0},function(n){n[0];var t=n[1],t=(n[2],te(t));return i(t.popLast())})})},vs.prototype.Ve=function(n){var i=this,t=n.store(gr.store);return t.$t(function(n,r){return r=tv(r),r=cvt(i.R,r),t.put(r)})},vs);sb="Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.";fyt=(b.prototype.start=function(){var n=this;return this.je().then(function(){if(!n.isPrimary&&!n.allowTabSynchronization)throw new u(t.FAILED_PRECONDITION,sb);return n.We(),n.Ge(),n.ze(),n.runTransaction("getHighestListenSequenceNumber","readonly",function(t){return n.qe.getHighestSequenceNumber(t)})}).then(function(t){n.Ne=new ru(t,n.De)}).then(function(){n.xe=!0}).catch(function(t){return n.Be&&n.Be.close(),Promise.reject(t)})},b.prototype.He=function(n){var t=this;return this.Me=function(u){return r(t,void 0,void 0,function(){return i(this,function(){return this.started?[2,n(u)]:[2]})})},n(this.isPrimary)},b.prototype.setDatabaseDeletedListener=function(n){var t=this;this.Be.vt(function(u){return r(t,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return null===u.newVersion?[4,n()]:[3,2];case 1:t.sent();t.label=2;case 2:return[2]}})})})},b.prototype.setNetworkEnabled=function(n){var t=this;this.networkEnabled!==n&&(this.networkEnabled=n,this.Se.enqueueAndForget(function(){return r(t,void 0,void 0,function(){return i(this,function(n){switch(n.label){case 0:return this.started?[4,this.je()]:[3,2];case 1:n.sent();n.label=2;case 2:return[2]}})})}))},b.prototype.je=function(){var n=this;return this.runTransaction("updateClientMetadataAndTryBecomePrimary","readwrite",function(t){return hb(t).put(new ie(n.clientId,Date.now(),n.networkEnabled,n.inForeground)).next(function(){if(n.isPrimary)return n.Je(t).next(function(t){t||(n.isPrimary=!1,n.Se.enqueueRetryable(function(){return n.Me(!1)}))})}).next(function(){return n.Ye(t)}).next(function(i){return n.isPrimary&&!i?n.Xe(t).next(function(){return!1}):!!i&&n.Ze(t).next(function(){return!0})})}).catch(function(t){if(ss(t))return e("IndexedDbPersistence","Failed to extend owner lease: ",t),n.isPrimary;if(!n.allowTabSynchronization)throw t;return e("IndexedDbPersistence","Releasing owner lease after error during lease refresh",t),!1}).then(function(t){n.isPrimary!==t&&n.Se.enqueueRetryable(function(){return n.Me(t)});n.isPrimary=t})},b.prototype.Je=function(n){var t=this;return ov(n).get(fu.key).next(function(n){return f.resolve(t.tn(n))})},b.prototype.en=function(n){return hb(n).delete(this.clientId)},b.prototype.nn=function(){return r(this,void 0,void 0,function(){var r,n,t,u,e=this;return i(this,function(i){switch(i.label){case 0:return!this.isPrimary||this.sn(this.Oe,18e5)?[3,2]:(this.Oe=Date.now(),[4,this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",function(n){var t=nu(n,ie.store);return t.Nt().next(function(n){var r=e.rn(n,18e5),i=n.filter(function(n){return-1===r.indexOf(n)});return f.forEach(i,function(n){return t.delete(n.clientId)}).next(function(){return i})})}).catch(function(){return[]})]);case 1:if(r=i.sent(),this.Ke)for(n=0,t=r;n<t.length;n++)u=t[n],this.Ke.removeItem(this.on(u.clientId));i.label=2;case 2:return[2]}})})},b.prototype.ze=function(){var n=this;this.$e=this.Se.enqueueAfterDelay("client_metadata_refresh",4e3,function(){return n.je().then(function(){return n.nn()}).then(function(){return n.ze()})})},b.prototype.tn=function(n){return!!n&&n.ownerId===this.clientId},b.prototype.Ye=function(n){var i=this;return this.Ce?f.resolve(!0):ov(n).get(fu.key).next(function(r){if(null!==r&&i.sn(r.leaseTimestampMs,5e3)&&!i.cn(r.ownerId)){if(i.tn(r)&&i.networkEnabled)return!0;if(!i.tn(r)){if(!r.allowTabSynchronization)throw new u(t.FAILED_PRECONDITION,sb);return!1}}return!(!i.networkEnabled||!i.inForeground)||hb(n).Nt().next(function(n){return void 0===i.rn(n,5e3).find(function(n){if(i.clientId!==n.clientId){var t=!i.networkEnabled&&n.networkEnabled,r=!i.inForeground&&n.inForeground,n=i.networkEnabled===n.networkEnabled;if(t||r&&n)return!0}return!1})})}).next(function(n){return i.isPrimary!==n&&e("IndexedDbPersistence","Client "+(n?"is":"is not")+" eligible for a primary lease."),n})},b.prototype.shutdown=function(){return r(this,void 0,void 0,function(){var n=this;return i(this,function(t){switch(t.label){case 0:return this.xe=!1,this.un(),this.$e&&(this.$e.cancel(),this.$e=null),this.an(),this.hn(),[4,this.Be.runTransaction("shutdown","readwrite",[fu.store,ie.store],function(t){var i=new eit(t,ru.o);return n.Xe(i).next(function(){return n.en(i)})})];case 1:return t.sent(),this.Be.close(),this.ln(),[2]}})})},b.prototype.rn=function(n,t){var i=this;return n.filter(function(n){return i.sn(n.updateTimeMs,t)&&!i.cn(n.clientId)})},b.prototype.fn=function(){var n=this;return this.runTransaction("getActiveClients","readonly",function(t){return hb(t).Nt().next(function(t){return n.rn(t,18e5).map(function(n){return n.clientId})})})},Object.defineProperty(b.prototype,"started",{get:function(){return this.xe},enumerable:!1,configurable:!0}),b.prototype.getMutationQueue=function(n){return wvt.Kt(n,this.R,this.Ut,this.referenceDelegate)},b.prototype.getTargetCache=function(){return this.qe},b.prototype.getRemoteDocumentCache=function(){return this.Ue},b.prototype.getIndexManager=function(){return this.Ut},b.prototype.getBundleCache=function(){return this.Qe},b.prototype.runTransaction=function(n,i,r){var o,f=this;return e("IndexedDbPersistence","Starting transaction:",n),this.Be.runTransaction(n,"readonly"===i?"readonly":"readwrite",bti,function(e){return o=new eit(e,f.Ne?f.Ne.next():ru.o),"readwrite-primary"===i?f.Je(o).next(function(n){return!!n||f.Ye(o)}).next(function(i){if(!i)throw pt("Failed to obtain primary lease for action '"+n+"'."),f.isPrimary=!1,f.Se.enqueueRetryable(function(){return f.Me(!1)}),new u(t.FAILED_PRECONDITION,tvt);return r(o)}).next(function(n){return f.Ze(o).next(function(){return n})}):f.dn(o).next(function(){return r(o)})}).then(function(n){return o.raiseOnCommittedEvent(),n})},b.prototype.dn=function(n){var i=this;return ov(n).get(fu.key).next(function(n){if(null!==n&&i.sn(n.leaseTimestampMs,5e3)&&!i.cn(n.ownerId)&&!i.tn(n)&&!(i.Ce||i.allowTabSynchronization&&n.allowTabSynchronization))throw new u(t.FAILED_PRECONDITION,sb);})},b.prototype.Ze=function(n){var t=new fu(this.clientId,this.allowTabSynchronization,Date.now());return ov(n).put(fu.key,t)},b.yt=function(){return hc.yt()},b.prototype.Xe=function(n){var i=this,t=ov(n);return t.get(fu.key).next(function(n){return i.tn(n)?(e("IndexedDbPersistence","Releasing primary lease."),t.delete(fu.key)):f.resolve()})},b.prototype.sn=function(n,t){var i=Date.now();return!(n<i-t||i<n&&(pt("Detected an update time that is in the future: "+n+" > "+i),1))},b.prototype.We=function(){var n=this;null!==this.document&&"function"==typeof this.document.addEventListener&&(this.ke=function(){n.Se.enqueueAndForget(function(){return n.inForeground="visible"===n.document.visibilityState,n.je()})},this.document.addEventListener("visibilitychange",this.ke),this.inForeground="visible"===this.document.visibilityState)},b.prototype.an=function(){this.ke&&(this.document.removeEventListener("visibilitychange",this.ke),this.ke=null)},b.prototype.Ge=function(){var n,t=this;"function"==typeof(null===(n=this.window)||void 0===n?void 0:n.addEventListener)&&(this.Fe=function(){t.un();t.Se.enqueueAndForget(function(){return t.shutdown()})},this.window.addEventListener("pagehide",this.Fe))},b.prototype.hn=function(){this.Fe&&(this.window.removeEventListener("pagehide",this.Fe),this.Fe=null)},b.prototype.cn=function(n){var t,i;try{return i=null!==(null===(t=this.Ke)||void 0===t?void 0:t.getItem(this.on(n))),e("IndexedDbPersistence","Client '"+n+"' "+(i?"is":"is not")+" zombied in LocalStorage"),i}catch(n){return pt("IndexedDbPersistence","Failed to get zombied client id.",n),!1}},b.prototype.un=function(){if(this.Ke)try{this.Ke.setItem(this.on(this.clientId),String(Date.now()))}catch(n){pt("Failed to set zombie client id.",n)}},b.prototype.ln=function(){if(this.Ke)try{this.Ke.removeItem(this.on(this.clientId))}catch(n){}},b.prototype.on=function(n){return"firestore_zombie_"+this.persistenceKey+"_"+n},b);var eyt=(nf.prototype.mn=function(n,t){var i=this;return this._n.getAllMutationBatchesAffectingDocumentKey(n,t).next(function(r){return i.yn(n,t,r)})},nf.prototype.yn=function(n,t,i){return this.Ue.getEntry(n,t).next(function(n){for(var t=0,r=i;t<r.length;t++)r[t].applyToLocalView(n);return n})},nf.prototype.gn=function(n,t){n.forEach(function(n,i){for(var r=0,u=t;r<u.length;r++)u[r].applyToLocalView(i)})},nf.prototype.pn=function(n,t){var i=this;return this.Ue.getEntries(n,t).next(function(t){return i.En(n,t).next(function(){return t})})},nf.prototype.En=function(n,t){var i=this;return this._n.getAllMutationBatchesAffectingDocumentKeys(n,t).next(function(n){return i.gn(t,n)})},nf.prototype.getDocumentsMatchingQuery=function(n,t,i){return r=t,h.isDocumentKey(r.path)&&null===r.collectionGroup&&0===r.filters.length?this.Tn(n,t.path):att(t)?this.In(n,t,i):this.An(n,t,i);var r},nf.prototype.Tn=function(n,t){return this.mn(n,new h(t)).next(function(n){var t=btt;return n.isFoundDocument()?t.insert(n.key,n):t})},nf.prototype.In=function(n,t,i){var e=this,u=t.collectionGroup,r=btt;return this.Ut.getCollectionParents(n,u).next(function(o){return f.forEach(o,function(f){var o=(o=t,f=f.child(u),new lf(f,null,o.explicitOrderBy.slice(),o.filters.slice(),o.limit,o.limitType,o.startAt,o.endAt));return e.An(n,o,i).next(function(n){n.forEach(function(n,t){r=r.insert(n,t)})})}).next(function(){return r})})},nf.prototype.An=function(n,t,i){var r,u,f=this;return this.Ue.getDocumentsMatchingQuery(n,t,i).next(function(i){return r=i,f._n.getAllMutationBatchesAffectingQuery(n,t)}).next(function(t){return u=t,f.Rn(n,u,r).next(function(n){var i,e;for(r=n,i=0,e=u;i<e.length;i++)for(var s=e[i],o=0,h=s.mutations;o<h.length;o++){var c=h[o],f=c.key,t=r.get(f);null==t&&(t=ri.newInvalidDocument(f),r=r.insert(f,t));ptt(c,t,s.localWriteTime);t.isFoundDocument()||(r=r.remove(f))}})}).next(function(){return r.forEach(function(n,i){ba(t,i)||(r=r.remove(n))}),r})},nf.prototype.Rn=function(n,t,i){for(var r,s,u,f,e=tt(),o=0,h=t;o<h.length;o++)for(r=0,s=h[o].mutations;r<s.length;r++)u=s[r],u instanceof ne&&null===i.get(u.key)&&(e=e.add(u.key));return f=i,this.Ue.getEntries(n,e).next(function(n){return n.forEach(function(n,t){t.isFoundDocument()&&(f=f.insert(n,t))}),f})},nf),sii=(bit.Pn=function(n,t){for(var i,r=tt(),u=tt(),f=0,e=t.docChanges;f<e.length;f++){i=e[f];switch(i.type){case 0:r=r.add(i.doc.key);break;case 1:u=u.add(i.doc.key)}}return new bit(n,t.fromCache,r,u)},bit),oyt=(dc.prototype.Vn=function(n){this.Sn=n},dc.prototype.getDocumentsMatchingQuery=function(n,t,i,r){var u=this;return 0===t.filters.length&&null===t.limit&&null==t.startAt&&null==t.endAt&&(0===t.explicitOrderBy.length||1===t.explicitOrderBy.length&&t.explicitOrderBy[0].field.isKeyField())||i.isEqual(y.min())?this.Dn(n,t):this.Sn.pn(n,r).next(function(f){var o=u.Cn(t,f);return(vw(t)||yw(t))&&u.Nn(t.limitType,o,r,i)?u.Dn(n,t):(yn()<=nt.DEBUG&&e("QueryEngine","Re-using previous result from %s to execute query: %s",i.toString(),vtt(t)),u.Sn.getDocumentsMatchingQuery(n,t,i).next(function(n){return o.forEach(function(t){n=n.insert(t.key,t)}),n}))})},dc.prototype.Cn=function(n,t){var i=new gt(cct(n));return t.forEach(function(t,r){ba(n,r)&&(i=i.add(r))}),i},dc.prototype.Nn=function(n,t,i,r){return i.size!==t.size?!0:(t="F"===n?t.last():t.first(),!!t&&(t.hasPendingWrites||0<t.version.compareTo(r)))},dc.prototype.Dn=function(n,t){return yn()<=nt.DEBUG&&e("QueryEngine","Using full collection scan to execute query:",vtt(t)),this.Sn.getDocumentsMatchingQuery(n,t,y.min())},dc),hii=(syt.prototype.collectGarbage=function(n){var t=this;return this.persistence.runTransaction("Collect garbage","readwrite-primary",function(i){return n.collect(i,t.Fn)})},syt);var pyt,wyt,vii=(hv.prototype.getBundleMetadata=function(n,t){return f.resolve(this.Kn.get(t))},hv.prototype.saveBundleMetadata=function(n,t){return this.Kn.set(t.id,{id:t.id,version:t.version,createTime:ui(t.createTime)}),f.resolve()},hv.prototype.getNamedQuery=function(n,t){return f.resolve(this.jn.get(t))},hv.prototype.saveNamedQuery=function(n,t){return this.jn.set(t.name,{name:(t=t).name,query:lit(t.bundledQuery),readTime:ui(t.readTime)}),f.resolve()},hv),kit=(tf.prototype.isEmpty=function(){return this.Wn.isEmpty()},tf.prototype.addReference=function(n,t){t=new ei(n,t);this.Wn=this.Wn.add(t);this.zn=this.zn.add(t)},tf.prototype.Jn=function(n,t){var i=this;n.forEach(function(n){return i.addReference(n,t)})},tf.prototype.removeReference=function(n,t){this.Yn(new ei(n,t))},tf.prototype.Xn=function(n,t){var i=this;n.forEach(function(n){return i.removeReference(n,t)})},tf.prototype.Zn=function(n){var r=this,t=new h(new k([])),u=new ei(t,n),n=new ei(t,n+1),i=[];return this.zn.forEachInRange([u,n],function(n){r.Yn(n);i.push(n.key)}),i},tf.prototype.ts=function(){var n=this;this.Wn.forEach(function(t){return n.Yn(t)})},tf.prototype.Yn=function(n){this.Wn=this.Wn.delete(n);this.zn=this.zn.delete(n)},tf.prototype.es=function(n){var i=new h(new k([])),r=new ei(i,n),n=new ei(i,n+1),t=tt();return this.zn.forEachInRange([r,n],function(n){t=t.add(n.key)}),t},tf.prototype.containsKey=function(n){var t=new ei(n,0),t=this.Wn.firstAfterOrEqual(t);return null!==t&&n.isEqual(t.key)},tf),ei=(dit.Gn=function(n,t){return h.comparator(n.key,t.key)||w(n.ns,t.ns)},dit.Hn=function(n,t){return w(n.ns,t.ns)||h.comparator(n.key,t.key)},dit),yii=(si.prototype.checkEmpty=function(){return f.resolve(0===this._n.length)},si.prototype.addMutationBatch=function(n,t,i,r){var s=this.ss,u,e,o;for(this.ss++,0<this._n.length&&this._n[this._n.length-1],i=new oit(s,t,i,r),this._n.push(i),u=0,e=r;u<e.length;u++)o=e[u],this.rs=this.rs.add(new ei(o.key,s)),this.Ut.addToCollectionParentIndex(n,o.key.path.popLast());return f.resolve(i)},si.prototype.lookupMutationBatch=function(n,t){return f.resolve(this.os(t))},si.prototype.getNextMutationBatchAfterBatchId=function(n,t){return t=this.cs(t+1),t=t<0?0:t,f.resolve(this._n.length>t?this._n[t]:null)},si.prototype.getHighestUnacknowledgedBatchId=function(){return f.resolve(0===this._n.length?-1:this.ss-1)},si.prototype.getAllMutationBatches=function(){return f.resolve(this._n.slice())},si.prototype.getAllMutationBatchesAffectingDocumentKey=function(n,t){var r=this,u=new ei(t,0),t=new ei(t,Number.POSITIVE_INFINITY),i=[];return this.rs.forEachInRange([u,t],function(n){n=r.os(n.ns);i.push(n)}),f.resolve(i)},si.prototype.getAllMutationBatchesAffectingDocumentKeys=function(n,t){var r=this,i=new gt(w);return t.forEach(function(n){var t=new ei(n,0),n=new ei(n,Number.POSITIVE_INFINITY);r.rs.forEachInRange([t,n],function(n){i=i.add(n.ns)})}),f.resolve(this.us(i))},si.prototype.getAllMutationBatchesAffectingQuery=function(n,t){var r=t.path,u=r.length+1,t=r,i;return h.isDocumentKey(t)||(t=t.child("")),t=new ei(new h(t),0),i=new gt(w),this.rs.forEachWhile(function(n){var t=n.key.path;return!!r.isPrefixOf(t)&&(t.length===u&&(i=i.add(n.ns)),!0)},t),f.resolve(this.us(i))},si.prototype.us=function(n){var i=this,t=[];return n.forEach(function(n){n=i.os(n);null!==n&&t.push(n)}),t},si.prototype.removeMutationBatch=function(n,t){var r=this,i;return a(0===this.hs(t.batchId,"removed")),this._n.shift(),i=this.rs,f.forEach(t.mutations,function(u){var f=new ei(u.key,t.batchId);return i=i.delete(f),r.referenceDelegate.markPotentiallyOrphaned(n,u.key)}).next(function(){r.rs=i})},si.prototype.Gt=function(){},si.prototype.containsKey=function(n,t){var i=new ei(t,0),i=this.rs.firstAfterOrEqual(i);return f.resolve(t.isEqual(i&&i.key))},si.prototype.performConsistencyCheck=function(){return this._n.length,f.resolve()},si.prototype.hs=function(n){return this.cs(n)},si.prototype.cs=function(n){return 0===this._n.length?0:n-this._n[0].batchId},si.prototype.os=function(n){return n=this.cs(n),n<0||n>=this._n.length?null:this._n[n]},si),pii=(re.prototype.addEntry=function(n,t,i){var u=t.key,r=this.docs.get(u),f=r?r.size:0,r=this.ls(t);return this.docs=this.docs.insert(u,{document:t.clone(),size:r,readTime:i}),this.size+=r-f,this.Ut.addToCollectionParentIndex(n,u.path.popLast())},re.prototype.removeEntry=function(n){var t=this.docs.get(n);t&&(this.docs=this.docs.remove(n),this.size-=t.size)},re.prototype.getEntry=function(n,t){var i=this.docs.get(t);return f.resolve(i?i.document.clone():ri.newInvalidDocument(t))},re.prototype.getEntries=function(n,t){var r=this,i=vu;return t.forEach(function(n){var t=r.docs.get(n);i=i.insert(n,t?t.document.clone():ri.newInvalidDocument(n))}),f.resolve(i)},re.prototype.getDocumentsMatchingQuery=function(n,t,i){for(var u=vu,s=new h(t.path.child("")),o=this.docs.getIteratorFrom(s);o.hasNext();){var r=o.getNext(),c=r.key,e=r.value,r=e.document,e=e.readTime;if(!t.path.isPrefixOf(c.path))break;e.compareTo(i)<=0||ba(t,r)&&(u=u.insert(r.key,r.clone()))}return f.resolve(u)},re.prototype.fs=function(n,t){return f.forEach(this.docs,function(n){return t(n)})},re.prototype.newChangeBuffer=function(){return new wii(this)},re.prototype.getSize=function(){return f.resolve(this.size)},re),wii=(c(sv,wyt=l),sv.prototype.applyChanges=function(n){var t=this,i=[];return this.changes.forEach(function(r,u){u.document.isValidDocument()?i.push(t.Ie.addEntry(n,u.document,t.getReadTime(r))):t.Ie.removeEntry(r)}),f.waitFor(i)},sv.prototype.getFromCache=function(n,t){return this.Ie.getEntry(n,t)},sv.prototype.getAllFromCache=function(n,t){return this.Ie.getEntries(n,t)},sv),bii=(oi.prototype.forEachTarget=function(n,t){return this.ds.forEach(function(n,i){return t(i)}),f.resolve()},oi.prototype.getLastRemoteSnapshotVersion=function(){return f.resolve(this.lastRemoteSnapshotVersion)},oi.prototype.getHighestSequenceNumber=function(){return f.resolve(this.ws)},oi.prototype.allocateTargetId=function(){return this.highestTargetId=this.ys.next(),f.resolve(this.highestTargetId)},oi.prototype.setTargetsMetadata=function(n,t,i){return i&&(this.lastRemoteSnapshotVersion=i),t>this.ws&&(this.ws=t),f.resolve()},oi.prototype.te=function(n){this.ds.set(n.target,n);var t=n.targetId;t>this.highestTargetId&&(this.ys=new uv(t),this.highestTargetId=t);n.sequenceNumber>this.ws&&(this.ws=n.sequenceNumber)},oi.prototype.addTargetData=function(n,t){return this.te(t),this.targetCount+=1,f.resolve()},oi.prototype.updateTargetData=function(n,t){return this.te(t),f.resolve()},oi.prototype.removeTargetData=function(n,t){return this.ds.delete(t.target),this._s.Zn(t.targetId),--this.targetCount,f.resolve()},oi.prototype.removeTargets=function(n,t,i){var r=this,u=0,e=[];return this.ds.forEach(function(f,o){o.sequenceNumber<=t&&null===i.get(o.targetId)&&(r.ds.delete(f),e.push(r.removeMatchingKeysForTargetId(n,o.targetId)),u++)}),f.waitFor(e).next(function(){return u})},oi.prototype.getTargetCount=function(){return f.resolve(this.targetCount)},oi.prototype.getTargetData=function(n,t){return t=this.ds.get(t)||null,f.resolve(t)},oi.prototype.addMatchingKeys=function(n,t,i){return this._s.Jn(t,i),f.resolve()},oi.prototype.removeMatchingKeys=function(n,t,i){this._s.Xn(t,i);var r=this.persistence.referenceDelegate,u=[];return r&&t.forEach(function(t){u.push(r.markPotentiallyOrphaned(n,t))}),f.waitFor(u)},oi.prototype.removeMatchingKeysForTargetId=function(n,t){return this._s.Zn(t),f.resolve()},oi.prototype.getMatchingKeysForTargetId=function(n,t){return t=this._s.es(t),f.resolve(t)},oi.prototype.containsKey=function(n,t){return f.resolve(this._s.containsKey(t))},oi),kii=(hu.prototype.start=function(){return Promise.resolve()},hu.prototype.shutdown=function(){return this.xe=!1,Promise.resolve()},Object.defineProperty(hu.prototype,"started",{get:function(){return this.xe},enumerable:!1,configurable:!0}),hu.prototype.setDatabaseDeletedListener=function(){},hu.prototype.setNetworkEnabled=function(){},hu.prototype.getIndexManager=function(){return this.Ut},hu.prototype.getMutationQueue=function(n){var t=this.gs[n.toKey()];return t||(t=new yii(this.Ut,this.referenceDelegate),this.gs[n.toKey()]=t),t},hu.prototype.getTargetCache=function(){return this.qe},hu.prototype.getRemoteDocumentCache=function(){return this.Ue},hu.prototype.getBundleCache=function(){return this.Qe},hu.prototype.runTransaction=function(n,t,i){var u=this,r;return e("MemoryPersistence","Starting transaction:",n),r=new dii(this.Ne.next()),this.referenceDelegate.Es(),i(r).next(function(n){return u.referenceDelegate.Ts(r).next(function(){return n})}).toPromise().then(function(n){return r.raiseOnCommittedEvent(),n})},hu.prototype.Is=function(n,t){return f.or(Object.values(this.gs).map(function(i){return function(){return i.containsKey(n,t)}}))},hu),dii=(c(byt,pyt=rt),byt),gii=(su.bs=function(n){return new su(n)},Object.defineProperty(su.prototype,"vs",{get:function(){if(this.Rs)return this.Rs;throw s();},enumerable:!1,configurable:!0}),su.prototype.addReference=function(n,t,i){return this.As.addReference(i,t),this.vs.delete(i.toString()),f.resolve()},su.prototype.removeReference=function(n,t,i){return this.As.removeReference(i,t),this.vs.add(i.toString()),f.resolve()},su.prototype.markPotentiallyOrphaned=function(n,t){return this.vs.add(t.toString()),f.resolve()},su.prototype.removeTarget=function(n,t){var r=this,i;return this.As.Zn(t.targetId).forEach(function(n){return r.vs.add(n.toString())}),i=this.persistence.getTargetCache(),i.getMatchingKeysForTargetId(n,t.targetId).next(function(n){n.forEach(function(n){return r.vs.add(n.toString())})}).next(function(){return i.removeTargetData(n,t)})},su.prototype.Es=function(){this.Rs=new Set},su.prototype.Ts=function(n){var t=this,i=this.persistence.getRemoteDocumentCache().newChangeBuffer();return f.forEach(this.vs,function(r){var u=h.fromPath(r);return t.Ps(n,u).next(function(n){n||i.removeEntry(u)})}).next(function(){return t.Rs=null,i.apply(n)})},su.prototype.updateLimboDocument=function(n,t){var i=this;return this.Ps(n,t).next(function(n){n?i.vs.delete(t.toString()):i.vs.add(t.toString())})},su.prototype.ps=function(){return 0},su.prototype.Ps=function(n,t){var i=this;return f.or([function(){return f.resolve(i.As.containsKey(t))},function(){return i.persistence.getTargetCache().containsKey(n,t)},function(){return i.persistence.Is(n,t)}])},su),tu=(lb.prototype.isAuthenticated=function(){return null!=this.uid},lb.prototype.toKey=function(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"},lb.prototype.isEqual=function(n){return n.uid===this.uid},lb);tu.UNAUTHENTICATED=new tu(null);tu.GOOGLE_CREDENTIALS=new tu("google-credentials-uid");tu.FIRST_PARTY=new tu("first-party-uid");var gyt,npt=(pb.Vs=function(n,t,i){var e,r=JSON.parse(i),f="object"==typeof r&&-1!==["pending","acknowledged","rejected"].indexOf(r.state)&&(void 0===r.error||"object"==typeof r.error);return f&&r.error&&(f="string"==typeof r.error.message&&"string"==typeof r.error.code)&&(e=new u(r.error.code,r.error.message)),f?new pb(n,t,r.state,e):(pt("SharedClientState","Failed to parse mutation state for ID '"+t+"': "+i),null)},pb.prototype.Ss=function(){var n={state:this.state,updateTimeMs:Date.now()};return this.error&&(n.error={code:this.error.code,message:this.error.message}),JSON.stringify(n)},pb),nrt=(yb.Vs=function(n,t){var f,i=JSON.parse(t),r="object"==typeof i&&-1!==["not-current","current","rejected"].indexOf(i.state)&&(void 0===i.error||"object"==typeof i.error);return r&&i.error&&(r="string"==typeof i.error.message&&"string"==typeof i.error.code)&&(f=new u(i.error.code,i.error.message)),r?new yb(n,i.state,f):(pt("SharedClientState","Failed to parse target state for ID '"+n+"': "+t),null)},yb.prototype.Ss=function(){var n={state:this.state,updateTimeMs:Date.now()};return this.error&&(n.error={code:this.error.code,message:this.error.message}),JSON.stringify(n)},yb),tpt=(frt.Vs=function(n,t){for(var i=JSON.parse(t),u="object"==typeof i&&i.activeTargetIds instanceof Array,f=dw,r=0;u&&r<i.activeTargetIds.length;++r)u=lht(i.activeTargetIds[r]),f=f.add(i.activeTargetIds[r]);return u?new frt(n,f):(pt("SharedClientState","Failed to parse client data for instance '"+n+"': "+t),null)},frt),nri=(urt.Vs=function(n){var t=JSON.parse(n);return"object"==typeof t&&-1!==["Unknown","Online","Offline"].indexOf(t.onlineState)&&"string"==typeof t.clientId?new urt(t.clientId,t.onlineState):(pt("SharedClientState","Failed to parse online state: "+n),null)},urt),trt=(vb.prototype.Ds=function(n){this.activeTargetIds=this.activeTargetIds.add(n)},vb.prototype.Cs=function(n){this.activeTargetIds=this.activeTargetIds.delete(n)},vb.prototype.Ss=function(){var n={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(n)},vb),irt=(p.yt=function(n){return!(!n||!n.localStorage)},p.prototype.start=function(){return r(this,void 0,void 0,function(){var n,u,f,s,e,t,h,r,o,c,l=this;return i(this,function(i){switch(i.label){case 0:return[4,this.syncEngine.fn()];case 1:for(t=i.sent(),n=0,u=t;n<u.length;n++)(f=u[n])!==this.Ns&&(s=this.getItem(kyt(this.persistenceKey,f)))&&(e=tpt.Vs(f,s))&&(this.ks=this.ks.insert(e.clientId,e));for(this.Ks(),(t=this.storage.getItem(this.Us))&&(h=this.js(t))&&this.Ws(h),r=0,o=this.$s;r<o.length;r++)c=o[r],this.Fs(c);return this.$s=[],this.window.addEventListener("pagehide",function(){return l.shutdown()}),this.started=!0,[2]}})})},p.prototype.writeSequenceNumber=function(n){this.setItem(this.Ms,JSON.stringify(n))},p.prototype.getAllActiveQueryTargets=function(){return this.Gs(this.ks)},p.prototype.isActiveQueryTarget=function(n){var t=!1;return this.ks.forEach(function(i,r){r.activeTargetIds.has(n)&&(t=!0)}),t},p.prototype.addPendingMutation=function(n){this.zs(n,"pending")},p.prototype.updateMutationState=function(n,t,i){this.zs(n,t,i);this.Hs(n)},p.prototype.addLocalQueryTarget=function(n){var t,i="not-current";return this.isActiveQueryTarget(n)&&(!(t=this.storage.getItem(git(this.persistenceKey,n)))||(t=nrt.Vs(n,t))&&(i=t.state)),this.Js.Ds(n),this.Ks(),i},p.prototype.removeLocalQueryTarget=function(n){this.Js.Cs(n);this.Ks()},p.prototype.isLocalQueryTarget=function(n){return this.Js.activeTargetIds.has(n)},p.prototype.clearQueryState=function(n){this.removeItem(git(this.persistenceKey,n))},p.prototype.updateQueryState=function(n,t,i){this.Ys(n,t,i)},p.prototype.handleUserChange=function(n,t,i){var r=this;t.forEach(function(n){r.Hs(n)});this.currentUser=n;i.forEach(function(n){r.addPendingMutation(n)})},p.prototype.setOnlineState=function(n){this.Xs(n)},p.prototype.notifyBundleLoaded=function(){this.Zs()},p.prototype.shutdown=function(){this.started&&(this.window.removeEventListener("storage",this.xs),this.removeItem(this.Os),this.started=!1)},p.prototype.getItem=function(n){var t=this.storage.getItem(n);return e("SharedClientState","READ",n,t),t},p.prototype.setItem=function(n,t){e("SharedClientState","SET",n,t);this.storage.setItem(n,t)},p.prototype.removeItem=function(n){e("SharedClientState","REMOVE",n);this.storage.removeItem(n)},p.prototype.Fs=function(n){var u=this,t=n;t.storageArea===this.storage&&(e("SharedClientState","EVENT",t.key,t.newValue),t.key!==this.Os?this.Se.enqueueRetryable(function(){return r(u,void 0,void 0,function(){var n,u,f,r;return i(this,function(){if(this.started){if(null!==t.key)if(this.Ls.test(t.key)){if(null==t.newValue)return n=this.ti(t.key),[2,this.ei(n,null)];if(n=this.ni(t.key,t.newValue))return[2,this.ei(n.clientId,n)]}else if(this.Bs.test(t.key)){if(null!==t.newValue&&(u=this.si(t.key,t.newValue)))return[2,this.ii(u)]}else if(this.qs.test(t.key)){if(null!==t.newValue&&(f=this.ri(t.key,t.newValue)))return[2,this.oi(f)]}else if(t.key===this.Us){if(null!==t.newValue&&(r=this.js(t.newValue)))return[2,this.Ws(r)]}else if(t.key===this.Ms)(r=function(n){var i=ru.o,t;if(null!=n)try{t=JSON.parse(n);a("number"==typeof t);i=t}catch(n){pt("SharedClientState","Failed to read sequence number from WebStorage",n)}return i}(t.newValue))!==ru.o&&this.sequenceNumberHandler(r);else if(t.key===this.Qs)return[2,this.syncEngine.ci()]}else this.$s.push(t);return[2]})})}):pt("Received WebStorage notification for local change. Another client might have garbage-collected our state"))},Object.defineProperty(p.prototype,"Js",{get:function(){return this.ks.get(this.Ns)},enumerable:!1,configurable:!0}),p.prototype.Ks=function(){this.setItem(this.Os,this.Js.Ss())},p.prototype.zs=function(n,t,i){i=new npt(this.currentUser,n,t,i);n=dyt(this.persistenceKey,this.currentUser,n);this.setItem(n,i.Ss())},p.prototype.Hs=function(n){n=dyt(this.persistenceKey,this.currentUser,n);this.removeItem(n)},p.prototype.Xs=function(n){n={clientId:this.Ns,onlineState:n};this.storage.setItem(this.Us,JSON.stringify(n))},p.prototype.Ys=function(n,t,i){var r=git(this.persistenceKey,n),i=new nrt(n,t,i);this.setItem(r,i.Ss())},p.prototype.Zs=function(){this.setItem(this.Qs,"value-not-used")},p.prototype.ti=function(n){return n=this.Ls.exec(n),n?n[1]:null},p.prototype.ni=function(n,t){return n=this.ti(n),tpt.Vs(n,t)},p.prototype.si=function(n,t){var i=this.Bs.exec(n),n=Number(i[1]),i=void 0!==i[2]?i[2]:null;return npt.Vs(new tu(i),n,t)},p.prototype.ri=function(n,t){return n=this.qs.exec(n),n=Number(n[1]),nrt.Vs(n,t)},p.prototype.js=function(n){return nri.Vs(n)},p.prototype.ii=function(n){return r(this,void 0,void 0,function(){return i(this,function(){return n.user.uid===this.currentUser.uid?[2,this.syncEngine.ui(n.batchId,n.state,n.error)]:(e("SharedClientState","Ignoring mutation for non-active user "+n.user.uid),[2])})})},p.prototype.oi=function(n){return this.syncEngine.ai(n.targetId,n.state,n.error)},p.prototype.ei=function(n,t){var o=this,i=t?this.ks.insert(n,t):this.ks.remove(n),r=this.Gs(this.ks),u=this.Gs(i),f=[],e=[];return u.forEach(function(n){r.has(n)||f.push(n)}),r.forEach(function(n){u.has(n)||e.push(n)}),this.syncEngine.hi(f,e).then(function(){o.ks=i})},p.prototype.Ws=function(n){this.ks.get(n.clientId)&&this.onlineStateHandler(n.onlineState)},p.prototype.Gs=function(n){var t=dw;return n.forEach(function(n,i){t=t.unionWith(i.activeTargetIds)}),t},p),ipt=(ir.prototype.addPendingMutation=function(){},ir.prototype.updateMutationState=function(){},ir.prototype.addLocalQueryTarget=function(n){return this.li.Ds(n),this.fi[n]||"not-current"},ir.prototype.updateQueryState=function(n,t){this.fi[n]=t},ir.prototype.removeLocalQueryTarget=function(n){this.li.Cs(n)},ir.prototype.isLocalQueryTarget=function(n){return this.li.activeTargetIds.has(n)},ir.prototype.clearQueryState=function(n){delete this.fi[n]},ir.prototype.getAllActiveQueryTargets=function(){return this.li.activeTargetIds},ir.prototype.isActiveQueryTarget=function(n){return this.li.activeTargetIds.has(n)},ir.prototype.start=function(){return this.li=new trt,Promise.resolve()},ir.prototype.handleUserChange=function(){},ir.prototype.setOnlineState=function(){},ir.prototype.shutdown=function(){},ir.prototype.writeSequenceNumber=function(){},ir.prototype.notifyBundleLoaded=function(){},ir),tri=(rrt.prototype.di=function(){},rrt.prototype.shutdown=function(){},rrt),rpt=(ys.prototype.di=function(n){this.gi.push(n)},ys.prototype.shutdown=function(){window.removeEventListener("online",this.wi);window.removeEventListener("offline",this.mi)},ys.prototype.pi=function(){window.addEventListener("online",this.wi);window.addEventListener("offline",this.mi)},ys.prototype._i=function(){e("ConnectivityMonitor","Network connectivity changed: AVAILABLE");for(var n=0,t=this.gi;n<t.length;n++)t[n](0)},ys.prototype.yi=function(){e("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");for(var n=0,t=this.gi;n<t.length;n++)t[n](1)},ys.yt=function(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener},ys),iri={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery"},rri=(ue.prototype.Ii=function(n){this.Ai=n},ue.prototype.Ri=function(n){this.bi=n},ue.prototype.onMessage=function(n){this.vi=n},ue.prototype.close=function(){this.Ti()},ue.prototype.send=function(n){this.Ei(n)},ue.prototype.Pi=function(){this.Ai()},ue.prototype.Vi=function(n){this.bi(n)},ue.prototype.Si=function(n){this.vi(n)},ue),uri=(cv.prototype.Ni=function(n,t,i,r){var u=this.xi(n,t);return e("RestConnection","Sending: ",u,i),t={},this.Fi(t,r),this.ki(n,u,t,i).then(function(n){return e("RestConnection","Received: ",n),n},function(t){throw ca("RestConnection",n+" failed with error: ",t,"url: ",u,"request:",i),t;})},cv.prototype.$i=function(n,t,i,r){return this.Ni(n,t,i,r)},cv.prototype.Fi=function(n,t){if(n["X-Goog-Api-Client"]="gl-js/ fire/8.6.7",n["Content-Type"]="text/plain",this.databaseInfo.appId&&(n["X-Firebase-GMPID"]=this.databaseInfo.appId),t)for(var i in t.authHeaders)t.authHeaders.hasOwnProperty(i)&&(n[i]=t.authHeaders[i])},cv.prototype.xi=function(n,t){return this.Di+"/v1/"+t+":"+iri[n]},c(ab,gyt=cv),ab.prototype.ki=function(n,i,r,f){return new Promise(function(o,h){var c=new knt,l;c.listenOnce(vnt.COMPLETE,function(){var r,i,a,f,l;try{switch(c.getLastErrorCode()){case an.NO_ERROR:r=c.getResponseJson();e("Connection","XHR received:",JSON.stringify(r));o(r);break;case an.TIMEOUT:e("Connection",'RPC "'+n+'" timed out');h(new u(t.DEADLINE_EXCEEDED,"Request time out"));break;case an.HTTP_ERROR:f=c.getStatus();e("Connection",'RPC "'+n+'" failed with status:',f,"response text:",c.getResponseText());0<f?(i=c.getResponseJson().error)&&i.status&&i.message?(l=i.status.toLowerCase().replace(/_/g,"-"),a=0<=Object.values(t).indexOf(l)?l:t.UNKNOWN,h(new u(a,i.message))):h(new u(t.UNKNOWN,"Server responded with status "+c.getStatus())):h(new u(t.UNAVAILABLE,"Connection failed."));break;default:s()}}finally{e("Connection",'RPC "'+n+'" completed.')}});l=JSON.stringify(f);c.send(i,"POST",l,r,15)})},ab.prototype.Oi=function(n,i){var s,h=[this.Di,"/","google.firestore.v1.Firestore","/",n,"/channel"],l=new iw,v=ant(),n={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:"projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling};this.useFetchStreams&&(n.xmlHttpFactory=new bnt({}));this.Fi(n.initMessageHeaders,i);"undefined"!=typeof window&&(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(wo())||"object"==typeof navigator&&"ReactNative"===navigator.product||0<=wo().indexOf("Electron/")||0<=(s=wo()).indexOf("MSIE ")||0<=s.indexOf("Trident/")||0<=wo().indexOf("MSAppHost/")||"object"==typeof(s="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0)&&void 0!==s.id||(n.httpHeadersOverwriteParam="$httpHeaders");h=h.join("");e("Connection","Creating WebChannel: "+h,n);var r=l.createWebChannel(h,n),c=!1,f=!1,o=new rri({Ei:function(n){f?e("Connection","Not sending because WebChannel is closed:",n):(c||(e("Connection","Opening WebChannel transport."),r.open(),c=!0),e("Connection","WebChannel sending:",n),r.send(n))},Ti:function(){return r.close()}}),n=function(n,t,i){n.listen(t,function(n){try{i(n)}catch(n){setTimeout(function(){throw n;},0)}})};return n(r,ew.EventType.OPEN,function(){f||e("Connection","WebChannel transport opened.")}),n(r,ew.EventType.CLOSE,function(){f||(f=!0,e("Connection","WebChannel transport closed"),o.Vi())}),n(r,ew.EventType.ERROR,function(n){f||(f=!0,ca("Connection","WebChannel transport errored:",n),o.Vi(new u(t.UNAVAILABLE,"The operation could not be completed")))}),n(r,ew.EventType.MESSAGE,function(n){var s,h,c,i;f||(a(!!(s=n.data[0])),(h=s.error||(null===(i=s[0])||void 0===i?void 0:i.error))?(e("Connection","WebChannel received error:",h),c=h.status,n=function(){var n=bt[c];if(void 0!==n)return dlt(n)}(),i=h.message,void 0===n&&(n=t.INTERNAL,i="Unknown error status: "+c+" with message "+h.message),f=!0,o.Vi(new u(n,i)),r.close()):(e("Connection","WebChannel received:",s),o.Si(s)))}),n(v,ynt.STAT_EVENT,function(n){n.stat===pnt?e("Connection","Detected buffering proxy"):n.stat===wnt&&e("Connection","Detected no buffering proxy")}),setTimeout(function(){o.Pi()},0),o},ab);var fpt,ert,ept,ort=(ws.prototype.reset=function(){this.qi=0},ws.prototype.Ki=function(){this.qi=this.Bi},ws.prototype.ji=function(n){var u=this;this.cancel();var i=Math.floor(this.qi+this.Wi()),r=Math.max(0,Date.now()-this.Qi),t=Math.max(0,i-r);0<t&&e("ExponentialBackoff","Backing off for "+t+" ms (base delay: "+this.qi+" ms, delay with jitter: "+i+" ms, last attempt: "+r+" ms ago)");this.Ui=this.Se.enqueueAfterDelay(this.timerId,t,function(){return u.Qi=Date.now(),n()});this.qi*=this.Li;this.qi<this.Mi&&(this.qi=this.Mi);this.qi>this.Bi&&(this.qi=this.Bi)},ws.prototype.Gi=function(){null!==this.Ui&&(this.Ui.skipDelay(),this.Ui=null)},ws.prototype.cancel=function(){null!==this.Ui&&(this.Ui.cancel(),this.Ui=null)},ws.prototype.Wi=function(){return(Math.random()-.5)*this.qi},ws),l=(ki.prototype.tr=function(){return 1===this.state||2===this.state||4===this.state},ki.prototype.er=function(){return 2===this.state},ki.prototype.start=function(){3!==this.state?this.auth():this.nr()},ki.prototype.stop=function(){return r(this,void 0,void 0,function(){return i(this,function(n){switch(n.label){case 0:return this.tr()?[4,this.close(0)]:[3,2];case 1:n.sent();n.label=2;case 2:return[2]}})})},ki.prototype.sr=function(){this.state=0;this.Zi.reset()},ki.prototype.ir=function(){var n=this;this.er()&&null===this.Xi&&(this.Xi=this.Se.enqueueAfterDelay(this.zi,6e4,function(){return n.rr()}))},ki.prototype.cr=function(n){this.ur();this.stream.send(n)},ki.prototype.rr=function(){return r(this,void 0,void 0,function(){return i(this,function(){return this.er()?[2,this.close(0)]:[2]})})},ki.prototype.ur=function(){this.Xi&&(this.Xi.cancel(),this.Xi=null)},ki.prototype.close=function(n,u){return r(this,void 0,void 0,function(){return i(this,function(i){switch(i.label){case 0:return this.ur(),this.Zi.cancel(),this.Yi++,3!==n?this.Zi.reset():u&&u.code===t.RESOURCE_EXHAUSTED?(pt(u.toString()),pt("Using maximum backoff delay to prevent overloading the backend."),this.Zi.Ki()):u&&u.code===t.UNAUTHENTICATED&&this.Ji.invalidateToken(),null!==this.stream&&(this.ar(),this.stream.close(),this.stream=null),this.state=n,[4,this.listener.Ri(u)];case 1:return i.sent(),[2]}})})},ki.prototype.ar=function(){},ki.prototype.auth=function(){var n=this,i,r;this.state=1;i=this.hr(this.Yi);r=this.Yi;this.Ji.getToken().then(function(t){n.Yi===r&&n.lr(t)},function(r){i(function(){var i=new u(t.UNKNOWN,"Fetching auth token failed: "+r.message);return n.dr(i)})})},ki.prototype.lr=function(n){var t=this,i=this.hr(this.Yi);this.stream=this.wr(n);this.stream.Ii(function(){i(function(){return t.state=2,t.listener.Ii()})});this.stream.Ri(function(n){i(function(){return t.dr(n)})});this.stream.onMessage(function(n){i(function(){return t.onMessage(n)})})},ki.prototype.nr=function(){var n=this;this.state=4;this.Zi.ji(function(){return r(n,void 0,void 0,function(){return i(this,function(){return this.state=0,this.start(),[2]})})})},ki.prototype.dr=function(n){return e("PersistentStream","close with error: "+n),this.stream=null,this.close(3,n)},ki.prototype.hr=function(n){var t=this;return function(i){t.Se.enqueueAndForget(function(){return t.Yi===n?i():(e("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())})}},ki),eri=(c(il,ept=l),il.prototype.wr=function(n){return this.Hi.Oi("Listen",n)},il.prototype.onMessage=function(n){this.Zi.reset();var i=function(n,i){if("targetChange"in i){i.targetChange;var r="NO_CHANGE"===(e=i.targetChange.targetChangeType||"NO_CHANGE")?0:"ADD"===e?1:"REMOVE"===e?2:"CURRENT"===e?3:"RESET"===e?4:s(),o=i.targetChange.targetIds||[],h=(f=i.targetChange.resumeToken,n.I?(a(void 0===f||"string"==typeof f),sr.fromBase64String(f||"")):(a(void 0===f||f instanceof Uint8Array),sr.fromUint8Array(f||new Uint8Array))),e=(c=i.targetChange.cause)&&(v=void 0===(l=c).code?t.UNKNOWN:dlt(l.code),new u(v,l.message||"")),f=new iat(r,o,h,e||null)}else if("documentChange"in i){i.documentChange;(r=i.documentChange).document;r.document.name;r.document.updateTime;var o=af(n,r.document.name),h=ui(r.document.updateTime),c=new kr({mapValue:{fields:r.document.fields}}),v=(e=ri.newFoundDocument(o,h,c),r.targetIds||[]),l=r.removedTargetIds||[];f=new gw(v,l,e.key,e)}else if("documentDelete"in i)i.documentDelete,(r=i.documentDelete).document,o=af(n,r.document),h=r.readTime?ui(r.readTime):y.min(),c=ri.newNoDocument(o,h),e=r.removedTargetIds||[],f=new gw([],e,c.key,c);else if("documentRemove"in i)i.documentRemove,(r=i.documentRemove).document,o=af(n,r.document),h=r.removedTargetIds||[],f=new gw([],h,o,null);else{if(!("filter"in i))return s();i.filter;i=i.filter;i.targetId;r=i.count||0;o=new oti(r);h=i.targetId;f=new tat(h,o)}return f}(this.R,n),n=function(n){return("targetChange"in n)?(n=n.targetChange,(!n.targetIds||!n.targetIds.length)&&n.readTime?ui(n.readTime):y.min()):y.min()}(n);return this.listener._r(i,n)},il.prototype.mr=function(n){var r,i,t,u={},f,n;u.database=ga(this.R);u.addTarget=(r=this.R,(t=lw(t=(i=n).target)?{documents:vat(r,t)}:{query:yat(r,t)}).targetId=i.targetId,0<i.resumeToken.approximateByteSize()?t.resumeToken=eat(r,i.resumeToken):0<i.snapshotVersion.compareTo(y.min())&&(t.readTime=ka(r,i.snapshotVersion.toTimestamp())),t);n=(this.R,f=n,null==(n=function(){switch(f.purpose){case 0:return null;case 1:return"existence-filter-mismatch";case 2:return"limbo-document";default:return s()}}())?null:{"goog-listen-tags":n});n&&(u.labels=n);this.cr(u)},il.prototype.yr=function(n){var t={};t.database=ga(this.R);t.removeTarget=n;this.cr(t)},il),ori=(c(fe,ert=l),Object.defineProperty(fe.prototype,"pr",{get:function(){return this.gr},enumerable:!1,configurable:!0}),fe.prototype.start=function(){this.gr=!1;this.lastStreamToken=void 0;ert.prototype.start.call(this)},fe.prototype.ar=function(){this.gr&&this.Er([])},fe.prototype.wr=function(n){return this.Hi.Oi("Write",n)},fe.prototype.onMessage=function(n){var r,t,i;return(a(!!n.streamToken),this.lastStreamToken=n.streamToken,this.gr)?(this.Zi.reset(),r=(t=n.writeResults,i=n.commitTime,t&&0<t.length?(a(void 0!==i),t.map(function(n){return r=i,(n=(t=n).updateTime?ui(t.updateTime):ui(r)).isEqual(y.min())&&(n=ui(r)),new eti(n,t.transformResults||[]);var t,r})):[]),t=ui(n.commitTime),this.listener.Tr(t,r)):(a(!n.writeResults||0===n.writeResults.length),this.gr=!0,this.listener.Ir())},fe.prototype.Ar=function(){var n={};n.database=ga(this.R);this.cr(n)},fe.prototype.Er=function(n){var t=this,n={streamToken:this.lastStreamToken,writes:n.map(function(n){return nb(t.R,n)})};this.cr(n)},fe),sri=(c(tl,fpt=function(){}),tl.prototype.br=function(){if(this.Rr)throw new u(t.FAILED_PRECONDITION,"The client has already been terminated.");},tl.prototype.Ni=function(n,i,r){var f=this;return this.br(),this.credentials.getToken().then(function(t){return f.Hi.Ni(n,i,r,t)}).catch(function(n){throw"FirebaseError"===n.name?(n.code===t.UNAUTHENTICATED&&f.credentials.invalidateToken(),n):new u(t.UNKNOWN,n.toString());})},tl.prototype.$i=function(n,i,r){var f=this;return this.br(),this.credentials.getToken().then(function(t){return f.Hi.$i(n,i,r,t)}).catch(function(n){throw"FirebaseError"===n.name?(n.code===t.UNAUTHENTICATED&&f.credentials.invalidateToken(),n):new u(t.UNKNOWN,n.toString());})},tl.prototype.terminate=function(){this.Rr=!0},tl),hri=(ps.prototype.Sr=function(){var n=this;0===this.vr&&(this.Dr("Unknown"),this.Pr=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,function(){return n.Pr=null,n.Cr("Backend didn't respond within 10 seconds."),n.Dr("Offline"),Promise.resolve()}))},ps.prototype.Nr=function(n){"Online"===this.state?this.Dr("Unknown"):(this.vr++,1<=this.vr&&(this.Fr(),this.Cr("Connection failed 1 times. Most recent error: "+n.toString()),this.Dr("Offline")))},ps.prototype.set=function(n){this.Fr();this.vr=0;"Online"===n&&(this.Vr=!1);this.Dr(n)},ps.prototype.Dr=function(n){n!==this.state&&(this.state=n,this.onlineStateHandler(n))},ps.prototype.Cr=function(n){n="Could not reach Cloud Firestore backend. "+n+"\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.";this.Vr?(pt(n),this.Vr=!1):e("OnlineStateTracker",n)},ps.prototype.Fr=function(){null!==this.Pr&&(this.Pr.cancel(),this.Pr=null)},ps);apt=(oo.createAndSchedule=function(n,t,i,r,u){return u=new oo(n,t,Date.now()+i,r,u),u.start(i),u},oo.prototype.start=function(n){var t=this;this.timerHandle=setTimeout(function(){return t.handleDelayElapsed()},n)},oo.prototype.skipDelay=function(){return this.handleDelayElapsed()},oo.prototype.cancel=function(n){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new u(t.CANCELLED,"Operation cancelled"+(n?": "+n:""))))},oo.prototype.handleDelayElapsed=function(){var n=this;this.asyncQueue.enqueueAndForget(function(){return null!==n.timerHandle?(n.clearTimeout(),n.op().then(function(t){return n.deferred.resolve(t)})):Promise.resolve()})},oo.prototype.clearTimeout=function(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)},oo);var vpt=(hi.emptySet=function(n){return new hi(n.comparator)},hi.prototype.has=function(n){return null!=this.keyedMap.get(n)},hi.prototype.get=function(n){return this.keyedMap.get(n)},hi.prototype.first=function(){return this.sortedSet.minKey()},hi.prototype.last=function(){return this.sortedSet.maxKey()},hi.prototype.isEmpty=function(){return this.sortedSet.isEmpty()},hi.prototype.indexOf=function(n){return n=this.keyedMap.get(n),n?this.sortedSet.indexOf(n):-1},Object.defineProperty(hi.prototype,"size",{get:function(){return this.sortedSet.size},enumerable:!1,configurable:!0}),hi.prototype.forEach=function(n){this.sortedSet.inorderTraversal(function(t){return n(t),!1})},hi.prototype.add=function(n){var t=this.delete(n.key);return t.copy(t.keyedMap.insert(n.key,n),t.sortedSet.insert(n,null))},hi.prototype.delete=function(n){var t=this.get(n);return t?this.copy(this.keyedMap.remove(n),this.sortedSet.remove(t)):this},hi.prototype.isEqual=function(n){var t,i,r,u;if(!(n instanceof hi)||this.size!==n.size)return!1;for(t=this.sortedSet.getIterator(),i=n.sortedSet.getIterator();t.hasNext();)if(r=t.getNext().key,u=i.getNext().key,!r.isEqual(u))return!1;return!0},hi.prototype.toString=function(){var n=[];return this.forEach(function(t){n.push(t.toString())}),0===n.length?"DocumentSet ()":"DocumentSet (\n  "+n.join("  \n")+"\n)"},hi.prototype.copy=function(n,t){var i=new hi;return i.comparator=this.comparator,i.keyedMap=n,i.sortedSet=t,i},hi),ypt=(art.prototype.track=function(n){var i=n.doc.key,t=this.Kr.get(i);!t||0!==n.type&&3===t.type?this.Kr=this.Kr.insert(i,n):3===n.type&&1!==t.type?this.Kr=this.Kr.insert(i,{type:t.type,doc:n.doc}):2===n.type&&2===t.type?this.Kr=this.Kr.insert(i,{type:2,doc:n.doc}):2===n.type&&0===t.type?this.Kr=this.Kr.insert(i,{type:0,doc:n.doc}):1===n.type&&0===t.type?this.Kr=this.Kr.remove(i):1===n.type&&2===t.type?this.Kr=this.Kr.insert(i,{type:1,doc:t.doc}):0===n.type&&1===t.type?this.Kr=this.Kr.insert(i,{type:2,doc:n.doc}):s()},art.prototype.jr=function(){var n=[];return this.Kr.inorderTraversal(function(t,i){n.push(i)}),n},art),db=(yv.fromInitialDocuments=function(n,t,i,r){var u=[];return t.forEach(function(n){u.push({type:0,doc:n})}),new yv(n,t,vpt.emptySet(t),u,i,r,!0,!1)},Object.defineProperty(yv.prototype,"hasPendingWrites",{get:function(){return!this.mutatedKeys.isEmpty()},enumerable:!1,configurable:!0}),yv.prototype.isEqual=function(n){var i,r,t;if(!(this.fromCache===n.fromCache&&this.syncStateChanged===n.syncStateChanged&&this.mutatedKeys.isEqual(n.mutatedKeys)&&wa(this.query,n.query)&&this.docs.isEqual(n.docs)&&this.oldDocs.isEqual(n.oldDocs))||(i=this.docChanges,r=n.docChanges,i.length!==r.length))return!1;for(t=0;t<i.length;t++)if(i[t].type!==r[t].type||!i[t].doc.isEqual(r[t].doc))return!1;return!0},yv),ari=function(){this.Wr=void 0;this.listeners=[]};var wrt=(bs.prototype.Hr=function(n){var r,t;if(!this.options.includeMetadataChanges){for(var u=[],i=0,f=n.docChanges;i<f.length;i++)r=f[i],3!==r.type&&u.push(r);n=new db(n.query,n.docs,n.oldDocs,u,n.mutatedKeys,n.fromCache,n.syncStateChanged,!0)}return t=!1,this.Yr?this.Zr(n)&&(this.Jr.next(n),t=!0):this.eo(n,this.onlineState)&&(this.no(n),t=!0),this.Xr=n,t},bs.prototype.onError=function(n){this.Jr.error(n)},bs.prototype.zr=function(n){this.onlineState=n;var t=!1;return this.Xr&&!this.Yr&&this.eo(this.Xr,n)&&(this.no(this.Xr),t=!0),t},bs.prototype.eo=function(n,t){return!n.fromCache||!(this.options.so&&"Offline"!==t||n.docs.isEmpty()&&"Offline"!==t)},bs.prototype.Zr=function(n){if(0<n.docChanges.length)return!0;var t=this.Xr&&this.Xr.hasPendingWrites!==n.hasPendingWrites;return!(!n.syncStateChanged&&!t)&&!0===this.options.includeMetadataChanges},bs.prototype.no=function(n){n=db.fromInitialDocuments(n.query,n.docs,n.mutatedKeys,n.fromCache);this.Yr=!0;this.Jr.next(n)},bs),vri=(wpt.prototype.io=function(){return"metadata"in this.payload},wpt),ppt=(nk.prototype.qn=function(n){return af(this.R,n)},nk.prototype.Un=function(n){return n.metadata.exists?lat(this.R,n.document,!1):ri.newNoDocument(this.qn(n.metadata.name),this.Qn(n.metadata.readTime))},nk.prototype.Qn=ui,nk),yri=(gb.prototype.oo=function(n){this.progress.bytesLoaded+=n.byteLength;var t=this.progress.documentsLoaded;return n.payload.namedQuery?this.queries.push(n.payload.namedQuery):n.payload.documentMetadata?(this.documents.push({metadata:n.payload.documentMetadata}),n.payload.documentMetadata.exists||++t):n.payload.document&&(this.documents[this.documents.length-1].document=n.payload.document,++t),t!==this.progress.documentsLoaded?(this.progress.documentsLoaded=t,Object.assign({},this.progress)):null},gb.prototype.co=function(n){for(var t,f,s,i=new Map,h=new ppt(this.R),r=0,e=n;r<e.length;r++)if(t=e[r],t.metadata.queries)for(var c=h.qn(t.metadata.name),u=0,o=t.metadata.queries;u<o.length;u++)f=o[u],s=(i.get(f)||tt()).add(c),i.set(f,s);return i},gb.prototype.complete=function(){return r(this,void 0,void 0,function(){var u,f,t,n;return i(this,function(e){switch(e.label){case 0:return[4,function(n,t,u,f){return r(this,void 0,void 0,function(){var r,o,s,h,c,a,e,l,v,p;return i(this,function(i){switch(i.label){case 0:for(r=n,o=tt(),s=vu,h=nat,c=0,a=u;c<a.length;c++)e=a[c],l=t.qn(e.metadata.name),e.document&&(o=o.add(l)),s=s.insert(l,t.Un(e)),h=h.insert(l,t.Qn(e.metadata.readTime));return v=r.On.newChangeBuffer({trackRemovals:!0}),[4,gc(r,au(nc(k.fromString("__bundle__/docs/"+f))))];case 1:return p=i.sent(),[2,r.persistence.runTransaction("Apply bundle documents","readwrite",function(n){return ayt(n,v,s,y.min(),h).next(function(t){return v.apply(n),t}).next(function(t){return r.qe.removeMatchingKeysForTargetId(n,p.targetId).next(function(){return r.qe.addMatchingKeys(n,o,p.targetId)}).next(function(){return r.Mn.En(n,t)}).next(function(){return t})})})]}})})}(this.localStore,new ppt(this.R),this.documents,this.ro.id)];case 1:u=e.sent();f=this.co(this.documents);t=0;n=this.queries;e.label=2;case 2:return t<n.length?(n=n[t],[4,function(n,t,u){return void 0===u&&(u=tt()),r(this,void 0,void 0,function(){var f,r;return i(this,function(i){switch(i.label){case 0:return[4,gc(n,au(lit(t.bundledQuery)))];case 1:return f=i.sent(),[2,(r=n).persistence.runTransaction("Save named query","readwrite",function(n){var i=ui(t.readTime);return 0<=f.snapshotVersion.compareTo(i)?r.Qe.saveNamedQuery(n,t):(i=f.withResumeToken(sr.EMPTY_BYTE_STRING,i),r.Fn=r.Fn.insert(i.targetId,i),r.qe.updateTargetData(n,i).next(function(){return r.qe.removeMatchingKeysForTargetId(n,f.targetId)}).next(function(){return r.qe.addMatchingKeys(n,u,f.targetId)}).next(function(){return r.Qe.saveNamedQuery(n,t)}))})]}})})}(this.localStore,n,f.get(n.name))]):[3,5];case 3:e.sent();e.label=4;case 4:return t++,[3,2];case 5:return[2,(this.progress.taskState="Success",new oii(Object.assign({},this.progress),u))]}})})},gb);var kpt=function(n){this.key=n},dpt=function(n){this.key=n},gpt=(Object.defineProperty(rf.prototype,"wo",{get:function(){return this.uo},enumerable:!1,configurable:!0}),rf.prototype._o=function(n,t){var r=this,u=t?t.mo:new ypt,f=(t||this).fo,e=(t||this).mutatedKeys,i=f,o=!1,s=vw(this.query)&&f.size===this.query.limit?f.last():null,h=yw(this.query)&&f.size===this.query.limit?f.first():null;if(n.inorderTraversal(function(n,t){var l=f.get(n),c=ba(r.query,t)?t:null,v=!!l&&r.mutatedKeys.has(l.key),a=!!c&&(c.hasLocalMutations||r.mutatedKeys.has(c.key)&&c.hasCommittedMutations),t=!1;l&&c?l.data.isEqual(c.data)?v!==a&&(u.track({type:3,doc:c}),t=!0):r.yo(l,c)||(u.track({type:2,doc:c}),t=!0,(s&&0<r.lo(c,s)||h&&r.lo(c,h)<0)&&(o=!0)):!l&&c?(u.track({type:0,doc:c}),t=!0):l&&!c&&(u.track({type:1,doc:l}),t=!0,(s||h)&&(o=!0));t&&(e=c?(i=i.add(c),a?e.add(n):e.delete(n)):(i=i.delete(n),e.delete(n)))}),vw(this.query)||yw(this.query))for(;i.size>this.query.limit;){var c=vw(this.query)?i.last():i.first(),i=i.delete(c.key),e=e.delete(c.key);u.track({type:1,doc:c})}return{fo:i,mo:u,Nn:o,mutatedKeys:e}},rf.prototype.yo=function(n,t){return n.hasLocalMutations&&t.hasCommittedMutations&&!t.hasLocalMutations},rf.prototype.applyChanges=function(n,t,i){var f=this,e=this.fo,r;this.fo=n.fo;this.mutatedKeys=n.mutatedKeys;r=n.mo.jr();r.sort(function(n,t){function i(n){switch(n){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return s()}}return r=n.type,u=t.type,i(r)-i(u)||f.lo(n.doc,t.doc);var r,u});this.po(i);var u=t?this.Eo():[],i=0===this.ho.size&&this.current?1:0,t=i!==this.ao;return this.ao=i,0!==r.length||t?{snapshot:new db(this.query,n.fo,e,r,n.mutatedKeys,0==i,t,!1),To:u}:{To:u}},rf.prototype.zr=function(n){return this.current&&"Offline"===n?(this.current=!1,this.applyChanges({fo:this.fo,mo:new ypt,mutatedKeys:this.mutatedKeys,Nn:!1},!1)):{To:[]}},rf.prototype.Io=function(n){return!this.uo.has(n)&&!!this.fo.has(n)&&!this.fo.get(n).hasLocalMutations},rf.prototype.po=function(n){var t=this;n&&(n.addedDocuments.forEach(function(n){return t.uo=t.uo.add(n)}),n.modifiedDocuments.forEach(function(){}),n.removedDocuments.forEach(function(n){return t.uo=t.uo.delete(n)}),this.current=n.current)},rf.prototype.Eo=function(){var n=this,i,t;return this.current?(i=this.ho,this.ho=tt(),this.fo.forEach(function(t){n.Io(t.key)&&(n.ho=n.ho.add(t.key))}),t=[],i.forEach(function(i){n.ho.has(i)||t.push(new dpt(i))}),this.ho.forEach(function(n){i.has(n)||t.push(new kpt(n))}),t):[]},rf.prototype.Ao=function(n){return this.uo=n.Bn,this.ho=tt(),n=this._o(n.documents),this.applyChanges(n,!0)},rf.prototype.Ro=function(){return db.fromInitialDocuments(this.query,this.fo,this.mutatedKeys,0===this.ao)},rf),pri=function(n,t,i){this.query=n;this.targetId=t;this.view=i},wri=function(n){this.key=n;this.bo=!1},bri=(Object.defineProperty(nwt.prototype,"isPrimaryClient",{get:function(){return!0===this.$o},enumerable:!1,configurable:!0}),nwt);var rut,uut,ewt=(gs.prototype.initialize=function(n){return r(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return this.R=lv(n.databaseInfo.databaseId),this.sharedClientState=this.Bo(n),this.persistence=this.qo(n),[4,this.persistence.start()];case 1:return t.sent(),this.gcScheduler=this.Uo(n),this.localStore=this.Qo(n),[2]}})})},gs.prototype.Uo=function(){return null},gs.prototype.Qo=function(n){return hyt(this.persistence,new oyt,n.initialUser,this.R)},gs.prototype.qo=function(){return new kii(gii.bs,this.R)},gs.prototype.Bo=function(){return new ipt},gs.prototype.terminate=function(){return r(this,void 0,void 0,function(){return i(this,function(n){switch(n.label){case 0:return this.gcScheduler&&this.gcScheduler.stop(),[4,this.sharedClientState.shutdown()];case 1:return n.sent(),[4,this.persistence.shutdown()];case 2:return n.sent(),[2]}})})},gs),owt=(c(ds,uut=ewt),ds.prototype.initialize=function(n){return r(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,uut.prototype.initialize.call(this,n)];case 1:return t.sent(),[4,aii(this.localStore)];case 2:return t.sent(),[4,this.Ko.initialize(this,n)];case 3:return t.sent(),[4,iut(this.Ko.syncEngine)];case 4:return t.sent(),[4,ul(this.Ko.remoteStore)];case 5:return t.sent(),[2]}})})},ds.prototype.Qo=function(n){return hyt(this.persistence,new oyt,n.initialUser,this.R)},ds.prototype.Uo=function(n){var t=this.persistence.referenceDelegate.garbageCollector;return new iii(t,n.asyncQueue)},ds.prototype.qo=function(n){var t=wit(n.databaseInfo.databaseId,n.databaseInfo.persistenceKey),i=void 0!==this.cacheSizeBytes?gu.withCacheSize(this.cacheSizeBytes):gu.DEFAULT;return new fyt(this.synchronizeTabs,t,n.clientId,i,n.asyncQueue,upt(),wb(),this.R,this.sharedClientState,!!this.forceOwnership)},ds.prototype.Bo=function(){return new ipt},ds),uui=(c(tk,rut=owt),tk.prototype.initialize=function(n){return r(this,void 0,void 0,function(){var t,u=this;return i(this,function(f){switch(f.label){case 0:return[4,rut.prototype.initialize.call(this,n)];case 1:return f.sent(),t=this.Ko.syncEngine,this.sharedClientState instanceof irt?(this.sharedClientState.syncEngine={ui:tui.bind(null,t),ai:function(n,t,u,f){return r(this,void 0,void 0,function(){var r,o,h;return i(this,function(i){switch(i.label){case 0:return(r=n).$o?(e("SyncEngine","Ignoring unexpected query state notification."),[3,8]):[3,1];case 1:if(!r.Vo.has(t))return[3,8];switch(u){case"current":case"not-current":return[3,2];case"rejected":return[3,5]}return[3,7];case 2:return[4,yyt(r.localStore)];case 3:return o=i.sent(),h=ktt.createSynthesizedRemoteEventForCurrentChange(t,"current"===u),[4,ee(r,o,h)];case 4:return i.sent(),[3,8];case 5:return[4,nl(r.localStore,t,!0)];case 6:return i.sent(),ol(r,t,f),[3,8];case 7:s();i.label=8;case 8:return[2]}})})}.bind(null,t),hi:function(n,t,u){return r(this,void 0,void 0,function(){var r,s,f,c,l,a,h,o;return i(this,function(v){switch(v.label){case 0:if(!(r=tut(n)).$o)return[3,10];s=0;f=t;v.label=1;case 1:return s<f.length?(f=f[s],r.Vo.has(f)?(e("SyncEngine","Adding an already active target "+f),[3,5]):[4,vyt(r.localStore,f)]):[3,6];case 2:return c=v.sent(),[4,gc(r.localStore,c)];case 3:return l=v.sent(),[4,brt(r,fwt(c),l.targetId,!1)];case 4:v.sent();bb(r.remoteStore,l);v.label=5;case 5:return s++,[3,1];case 6:a=function(n){return i(this,function(t){switch(t.label){case 0:return r.Vo.has(n)?[4,nl(r.localStore,n,!1).then(function(){vv(r.remoteStore,n);ol(r,n)}).catch(ls)]:[3,2];case 1:t.sent();t.label=2;case 2:return[2]}})};h=0;o=u;v.label=7;case 7:return h<o.length?(o=o[h],[5,a(o)]):[3,10];case 8:v.sent();v.label=9;case 9:return h++,[3,7];case 10:return[2]}})})}.bind(null,t),fn:function(n){return n.localStore.persistence.fn()}.bind(null,t),ci:function(n){return r(this,void 0,void 0,function(){var t;return i(this,function(){return[2,yyt((t=n).localStore).then(function(n){return ee(t,n)})]})})}.bind(null,t)},[4,this.sharedClientState.start()]):[3,3];case 2:f.sent();f.label=3;case 3:return[4,this.persistence.He(function(n){return r(u,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,iui(this.Ko.syncEngine,n)];case 1:return t.sent(),this.gcScheduler&&(n&&!this.gcScheduler.started?this.gcScheduler.start(this.localStore):n||this.gcScheduler.stop()),[2]}})})})];case 4:return f.sent(),[2]}})})},tk.prototype.Bo=function(n){var i=upt(),r;if(!irt.yt(i))throw new u(t.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");return r=wit(n.databaseInfo.databaseId,n.databaseInfo.persistenceKey),new irt(i,n.asyncQueue,r,n.clientId,n.initialUser)},tk),fut=(ks.prototype.initialize=function(n,t){return r(this,void 0,void 0,function(){var r=this;return i(this,function(i){switch(i.label){case 0:return this.localStore?[3,2]:(this.localStore=n.localStore,this.sharedClientState=n.sharedClientState,this.datastore=this.createDatastore(t),this.remoteStore=this.createRemoteStore(t),this.eventManager=this.createEventManager(t),this.syncEngine=this.createSyncEngine(t,!n.synchronizeTabs),this.sharedClientState.onlineStateHandler=function(n){return iwt(r.syncEngine,n,1)},this.remoteStore.remoteSyncer.handleCredentialChange=nui.bind(null,this.syncEngine),[4,lrt(this.remoteStore,this.syncEngine.isPrimaryClient)]);case 1:i.sent();i.label=2;case 2:return[2]}})})},ks.prototype.createEventManager=function(){return new lri},ks.prototype.createDatastore=function(n){var i=lv(n.databaseInfo.databaseId),t=(t=n.databaseInfo,new uri(t));return n=n.credentials,new sri(n,t,i)},ks.prototype.createRemoteStore=function(n){var t=this,i=this.localStore,r=this.datastore,u=n.asyncQueue,f=function(n){return iwt(t.syncEngine,n,0)},n=new(rpt.yt()?rpt:tri);return new fri(i,r,u,f,n)},ks.prototype.createSyncEngine=function(n,t){return function(n,t,i,r,u,f,e){return f=new bri(n,t,i,r,u,f),e&&(f.$o=!0),f}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,n.initialUser,n.maxConcurrentLimboResolutions,t)},ks.prototype.terminate=function(){return function(n){return r(this,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return t=n,e("RemoteStore","RemoteStore shutting down."),t.Or.add(5),[4,rl(t)];case 1:return i.sent(),t.Lr.shutdown(),t.Br.set("Unknown"),[2]}})})}(this.remoteStore)},ks);var ik=(wv.prototype.next=function(n){this.observer.next&&this.jo(this.observer.next,n)},wv.prototype.error=function(n){this.observer.error?this.jo(this.observer.error,n):console.error("Uncaught Error in snapshot listener:",n)},wv.prototype.Wo=function(){this.muted=!0},wv.prototype.jo=function(n,t){var i=this;this.muted||setTimeout(function(){i.muted||n(t)},0)},wv),fui=(yf.prototype.close=function(){return this.Go.cancel()},yf.prototype.getMetadata=function(){return r(this,void 0,void 0,function(){return i(this,function(){return[2,this.metadata.promise]})})},yf.prototype.Lo=function(){return r(this,void 0,void 0,function(){return i(this,function(n){switch(n.label){case 0:return[4,this.getMetadata()];case 1:return[2,(n.sent(),this.Ho())]}})})},yf.prototype.Ho=function(){return r(this,void 0,void 0,function(){var r,t,n;return i(this,function(i){switch(i.label){case 0:return[4,this.Jo()];case 1:return null===(r=i.sent())?[2,null]:(n=this.zo.decode(r),t=Number(n),isNaN(t)&&this.Yo("length string ("+n+") is not valid number"),[4,this.Xo(t)]);case 2:return n=i.sent(),[2,new vri(JSON.parse(n),r.length+t)]}})})},yf.prototype.Zo=function(){return this.buffer.findIndex(function(n){return n==="{".charCodeAt(0)})},yf.prototype.Jo=function(){return r(this,void 0,void 0,function(){var n,t;return i(this,function(i){switch(i.label){case 0:return this.Zo()<0?[4,this.tc()]:[3,3];case 1:if(i.sent())return[3,3];i.label=2;case 2:return[3,0];case 3:return 0===this.buffer.length?[2,null]:((n=this.Zo())<0&&this.Yo("Reached the end of bundle when a length string is expected."),t=this.buffer.slice(0,n),[2,(this.buffer=this.buffer.slice(n),t)])}})})},yf.prototype.Xo=function(n){return r(this,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return this.buffer.length<n?[4,this.tc()]:[3,3];case 1:i.sent()&&this.Yo("Reached the end of bundle when more is expected.");i.label=2;case 2:return[3,0];case 3:return t=this.zo.decode(this.buffer.slice(0,n)),[2,(this.buffer=this.buffer.slice(n),t)]}})})},yf.prototype.Yo=function(n){throw this.Go.cancel(),new Error("Invalid bundle format: "+n);},yf.prototype.tc=function(){return r(this,void 0,void 0,function(){var n,t;return i(this,function(i){switch(i.label){case 0:return[4,this.Go.read()];case 1:return(n=i.sent()).done||((t=new Uint8Array(this.buffer.length+n.value.length)).set(this.buffer),t.set(n.value,this.buffer.length),this.buffer=t),[2,n.done]}})})},yf),eui=(uf.prototype.lookup=function(n){return r(this,void 0,void 0,function(){var f,e=this;return i(this,function(o){switch(o.label){case 0:if(this.ensureCommitNotCalled(),0<this.mutations.length)throw new u(t.INVALID_ARGUMENT,"Firestore transactions require all reads to be executed before all writes.");return[4,function(n,t){return r(this,void 0,void 0,function(){var r,o,u,f,e;return i(this,function(i){switch(i.label){case 0:return o=ga((r=n).R)+"/documents",u={documents:t.map(function(n){return da(r.R,n)})},[4,r.$i("BatchGetDocuments",o,u)];case 1:return u=i.sent(),f=new Map,u.forEach(function(n){var t,n=(t=r.R,"found"in(n=n)?function(n,t){a(!!t.found);t.found.name;t.found.updateTime;var i=af(n,t.found.name),n=ui(t.found.updateTime),t=new kr({mapValue:{fields:t.found.fields}});return ri.newFoundDocument(i,n,t)}(t,n):"missing"in n?function(n,t){return a(!!t.missing),a(!!t.readTime),n=af(n,t.missing),t=ui(t.readTime),ri.newNoDocument(n,t)}(t,n):s());f.set(n.key.toString(),n)}),e=[],[2,(t.forEach(function(n){n=f.get(n.toString());a(!!n);e.push(n)}),e)]}})})}(this.datastore,n)];case 1:return[2,((f=o.sent()).forEach(function(n){return e.recordVersion(n)}),f)]}})})},uf.prototype.set=function(n,t){this.write(t.toMutation(n,this.precondition(n)));this.writtenDocs.add(n.toString())},uf.prototype.update=function(n,t){try{this.write(t.toMutation(n,this.preconditionForUpdate(n)))}catch(n){this.lastWriteError=n}this.writtenDocs.add(n.toString())},uf.prototype.delete=function(n){this.write(new uc(n,this.precondition(n)));this.writtenDocs.add(n.toString())},uf.prototype.commit=function(){return r(this,void 0,void 0,function(){var n,t=this;return i(this,function(u){switch(u.label){case 0:if(this.ensureCommitNotCalled(),this.lastWriteError)throw this.lastWriteError;return n=this.readVersions,this.mutations.forEach(function(t){n.delete(t.key.toString())}),n.forEach(function(n,i){i=h.fromPath(i);t.mutations.push(new ww(i,t.precondition(i)))}),[4,function(n,t){return r(this,void 0,void 0,function(){var r,u,f;return i(this,function(i){switch(i.label){case 0:return u=ga((r=n).R)+"/documents",f={writes:t.map(function(n){return nb(r.R,n)})},[4,r.Ni("Commit",u,f)];case 1:return i.sent(),[2]}})})}(this.datastore,this.mutations)];case 1:return u.sent(),this.committed=!0,[2]}})})},uf.prototype.recordVersion=function(n){var i,r;if(n.isFoundDocument())i=n.version;else{if(!n.isNoDocument())throw s();i=y.min()}if(r=this.readVersions.get(n.key.toString()),r){if(!i.isEqual(r))throw new u(t.ABORTED,"Document version changed between two reads.");}else this.readVersions.set(n.key.toString(),i)},uf.prototype.precondition=function(n){var t=this.readVersions.get(n.toString());return!this.writtenDocs.has(n.toString())&&t?yi.updateTime(t):yi.none()},uf.prototype.preconditionForUpdate=function(n){var i=this.readVersions.get(n.toString());if(this.writtenDocs.has(n.toString())||!i)return yi.exists(!0);if(i.isEqual(y.min()))throw new u(t.INVALID_ARGUMENT,"Can't update a document that doesn't exist.");return yi.updateTime(i)},uf.prototype.write=function(n){this.ensureCommitNotCalled();this.mutations.push(n)},uf.prototype.ensureCommitNotCalled=function(){},uf),oui=(sl.prototype.run=function(){this.nc()},sl.prototype.nc=function(){var n=this;this.Zi.ji(function(){return r(n,void 0,void 0,function(){var t,r,n=this;return i(this,function(){return t=new eui(this.datastore),(r=this.sc(t))&&r.then(function(i){n.asyncQueue.enqueueAndForget(function(){return t.commit().then(function(){n.deferred.resolve(i)}).catch(function(t){n.ic(t)})})}).catch(function(t){n.ic(t)}),[2]})})})},sl.prototype.sc=function(n){try{var t=this.updateFunction(n);return!ts(t)&&t.catch&&t.then?t:(this.deferred.reject(Error("Transaction callback must return a Promise")),null)}catch(n){return this.deferred.reject(n),null}},sl.prototype.ic=function(n){var t=this;0<this.ec&&this.rc(n)?(--this.ec,this.asyncQueue.enqueueAndForget(function(){return t.nc(),Promise.resolve()})):this.deferred.reject(n)},sl.prototype.rc=function(n){return"FirebaseError"!==n.name?!1:(n=n.code,"aborted"===n||"failed-precondition"===n||!klt(n))},sl),sui=(pv.prototype.getConfiguration=function(){return r(this,void 0,void 0,function(){return i(this,function(){return[2,{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,credentials:this.credentials,initialUser:this.user,maxConcurrentLimboResolutions:100}]})})},pv.prototype.setCredentialChangeListener=function(n){this.credentialListener=n},pv.prototype.verifyNotTerminated=function(){if(this.asyncQueue.isShuttingDown)throw new u(t.FAILED_PRECONDITION,"The client has already been terminated.");},pv.prototype.terminate=function(){var t=this,n;return this.asyncQueue.enterRestrictedMode(),n=new cr,this.asyncQueue.enqueueAndForgetEvenWhileRestricted(function(){return r(t,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,5,,6]),this.onlineComponents?[4,this.onlineComponents.terminate()]:[3,2];case 1:i.sent();i.label=2;case 2:return this.offlineComponents?[4,this.offlineComponents.terminate()]:[3,4];case 3:i.sent();i.label=4;case 4:return this.credentials.removeChangeListener(),n.resolve(),[3,6];case 5:return t=i.sent(),t=el(t,"Failed to shutdown persistence"),n.reject(t),[3,6];case 6:return[2]}})})}),n.promise},pv);var hui=function(n,t,i,r,u,f,e,o){this.databaseId=n;this.appId=t;this.persistenceKey=i;this.host=r;this.ssl=u;this.forceLongPolling=f;this.autoDetectLongPolling=e;this.useFetchStreams=o},uk=(Object.defineProperty(fk.prototype,"isDefaultDatabase",{get:function(){return"(default)"===this.database},enumerable:!1,configurable:!0}),fk.prototype.isEqual=function(n){return n instanceof fk&&n.projectId===this.projectId&&n.database===this.database},fk),wwt=new Map,bwt=(dv.prototype.getToken=function(){return Promise.resolve(null)},dv.prototype.invalidateToken=function(){},dv.prototype.setChangeListener=function(n,t){this.changeListener=t;n.enqueueRetryable(function(){return t(tu.UNAUTHENTICATED)})},dv.prototype.removeChangeListener=function(){this.changeListener=null},dv),cui=(kv.prototype.getToken=function(){return Promise.resolve(this.token)},kv.prototype.invalidateToken=function(){},kv.prototype.setChangeListener=function(n,t){var i=this;this.changeListener=t;n.enqueueRetryable(function(){return t(i.token.user)})},kv.prototype.removeChangeListener=function(){this.changeListener=null},kv),lui=(cl.prototype.getToken=function(){var n=this,t=this.cc,i=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(i).then(function(i){return n.cc!==t?(e("FirebaseCredentialsProvider","getToken aborted due to token change."),n.getToken()):i?(a("string"==typeof i.accessToken),new pwt(i.accessToken,n.currentUser)):null}):Promise.resolve(null)},cl.prototype.invalidateToken=function(){this.forceRefresh=!0},cl.prototype.setChangeListener=function(n,t){var u=this;this.asyncQueue=n;this.asyncQueue.enqueueRetryable(function(){return r(u,void 0,void 0,function(){return i(this,function(n){switch(n.label){case 0:return[4,this.oc.promise];case 1:return n.sent(),[4,t(this.currentUser)];case 2:return n.sent(),this.changeListener=t,[2]}})})})},cl.prototype.removeChangeListener=function(){this.auth&&this.auth.removeAuthTokenListener(this.uc);this.changeListener=function(){return Promise.resolve()}},cl.prototype.ac=function(){var n=this.auth&&this.auth.getUid();return a(null===n||"string"==typeof n),new tu(n)},cl),aui=(Object.defineProperty(kwt.prototype,"authHeaders",{get:function(){var n={"X-Goog-AuthUser":this.lc},t=this.hc.auth.getAuthHeaderValueForFirstParty([]);return t&&(n.Authorization=t),this.fc&&(n["X-Goog-Iam-Authorization-Token"]=this.fc),n},enumerable:!1,configurable:!0}),kwt),vui=(bv.prototype.getToken=function(){return Promise.resolve(new aui(this.hc,this.lc,this.fc))},bv.prototype.setChangeListener=function(n,t){n.enqueueRetryable(function(){return t(tu.FIRST_PARTY)})},bv.prototype.removeChangeListener=function(){},bv.prototype.invalidateToken=function(){},bv);var ibt,rbt=(ubt.prototype.isEqual=function(n){return this.host===n.host&&this.ssl===n.ssl&&this.credentials===n.credentials&&this.cacheSizeBytes===n.cacheSizeBytes&&this.experimentalForceLongPolling===n.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===n.experimentalAutoDetectLongPolling&&this.ignoreUndefinedProperties===n.ignoreUndefinedProperties&&this.useFetchStreams===n.useFetchStreams},ubt),gv=(Object.defineProperty(pf.prototype,"app",{get:function(){if(!this._app)throw new u(t.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app},enumerable:!1,configurable:!0}),Object.defineProperty(pf.prototype,"_initialized",{get:function(){return this._settingsFrozen},enumerable:!1,configurable:!0}),Object.defineProperty(pf.prototype,"_terminated",{get:function(){return void 0!==this._terminateTask},enumerable:!1,configurable:!0}),pf.prototype._setSettings=function(n){if(this._settingsFrozen)throw new u(t.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new rbt(n);void 0!==n.credentials&&(this._credentials=function(n){if(!n)return new bwt;switch(n.type){case"gapi":var i=n.client;return a(!("object"!=typeof i||null===i||!i.auth||!i.auth.getAuthHeaderValueForFirstParty)),new vui(i,n.sessionIndex||"0",n.iamToken||null);case"provider":return n.client;default:throw new u(t.INVALID_ARGUMENT,"makeCredentialsProvider failed due to invalid credential type");}}(n.credentials))},pf.prototype._getSettings=function(){return this._settings},pf.prototype._freezeSettings=function(){return this._settingsFrozen=!0,this._settings},pf.prototype._delete=function(){return this._terminateTask||(this._terminateTask=this._terminate()),this._terminateTask},pf.prototype.toJSON=function(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}},pf.prototype._terminate=function(){return(n=wwt.get(this))&&(e("ComponentProvider","Removing Datastore"),wwt.delete(this),n.terminate()),Promise.resolve();var n},pf),ht=(Object.defineProperty(th.prototype,"_path",{get:function(){return this._key.path},enumerable:!1,configurable:!0}),Object.defineProperty(th.prototype,"id",{get:function(){return this._key.path.lastSegment()},enumerable:!1,configurable:!0}),Object.defineProperty(th.prototype,"path",{get:function(){return this._key.path.canonicalString()},enumerable:!1,configurable:!0}),Object.defineProperty(th.prototype,"parent",{get:function(){return new so(this.firestore,this.converter,this._key.path.popLast())},enumerable:!1,configurable:!0}),th.prototype.withConverter=function(n){return new th(this.firestore,n,this._key)},th),iu=(lut.prototype.withConverter=function(n){return new lut(this.firestore,n,this._query)},lut),so=(c(nh,ibt=iu),Object.defineProperty(nh.prototype,"id",{get:function(){return this._query.path.lastSegment()},enumerable:!1,configurable:!0}),Object.defineProperty(nh.prototype,"path",{get:function(){return this._query.path.canonicalString()},enumerable:!1,configurable:!0}),Object.defineProperty(nh.prototype,"parent",{get:function(){var n=this._path.popLast();return n.isEmpty()?null:new ht(this.firestore,null,new h(n))},enumerable:!1,configurable:!0}),nh.prototype.withConverter=function(n){return new nh(this.firestore,n,this._path)},nh);sbt=(Object.defineProperty(di.prototype,"isShuttingDown",{get:function(){return this._c},enumerable:!1,configurable:!0}),di.prototype.enqueueAndForget=function(n){this.enqueue(n)},di.prototype.enqueueAndForgetEvenWhileRestricted=function(n){this.Ic();this.Ac(n)},di.prototype.enterRestrictedMode=function(){var n;this._c||(this._c=!0,(n=wb())&&"function"==typeof n.removeEventListener&&n.removeEventListener("visibilitychange",this.Tc))},di.prototype.enqueue=function(n){return this.Ic(),this._c?new Promise(function(){}):this.Ac(n)},di.prototype.enqueueRetryable=function(n){var t=this;this.enqueueAndForget(function(){return t.wc.push(n),t.Rc()})},di.prototype.Rc=function(){return r(this,void 0,void 0,function(){var n,t=this;return i(this,function(i){switch(i.label){case 0:if(0===this.wc.length)return[3,5];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.wc[0]()];case 2:return i.sent(),this.wc.shift(),this.Zi.reset(),[3,4];case 3:if(!ss(n=i.sent()))throw n;return e("AsyncQueue","Operation failed with retryable error: "+n),[3,4];case 4:0<this.wc.length&&this.Zi.ji(function(){return t.Rc()});i.label=5;case 5:return[2]}})})},di.prototype.Ac=function(n){var t=this,i=this.dc.then(function(){return t.gc=!0,n().catch(function(n){throw t.yc=n,t.gc=!1,pt("INTERNAL UNHANDLED ERROR: ",(r=(i=n).message||"",r=i.stack?i.stack.includes(i.message)?i.stack:i.message+"\n"+i.stack:r)),n;var i,r}).then(function(n){return t.gc=!1,n})});return this.dc=i},di.prototype.enqueueAfterDelay=function(n,t,i){var r=this;return this.Ic(),-1<this.Ec.indexOf(n)&&(t=0),i=apt.createAndSchedule(this,n,t,i,function(n){return r.bc(n)}),this.mc.push(i),i},di.prototype.Ic=function(){this.yc&&s()},di.prototype.verifyOperationInProgress=function(){},di.prototype.vc=function(){return r(this,void 0,void 0,function(){var n;return i(this,function(t){switch(t.label){case 0:return[4,n=this.dc];case 1:t.sent();t.label=2;case 2:if(n!==this.dc)return[3,0];t.label=3;case 3:return[2]}})})},di.prototype.Pc=function(n){for(var t=0,i=this.mc;t<i.length;t++)if(i[t].timerId===n)return!0;return!1},di.prototype.Vc=function(n){var t=this;return this.vc().then(function(){var i,r,u;for(t.mc.sort(function(n,t){return n.targetTimeMs-t.targetTimeMs}),i=0,r=t.mc;i<r.length;i++)if(u=r[i],u.skipDelay(),"all"!==n&&u.timerId===n)break;return t.vc()})},di.prototype.Sc=function(n){this.Ec.push(n)},di.prototype.bc=function(n){n=this.mc.indexOf(n);this.mc.splice(n,1)},di);cbt=(ih.prototype.onProgress=function(n,t,i){this._progressObserver={next:n,error:t,complete:i}},ih.prototype.catch=function(n){return this._taskCompletionResolver.promise.catch(n)},ih.prototype.then=function(n,t){return this._taskCompletionResolver.promise.then(n,t)},ih.prototype._completeWith=function(n){this._updateProgress(n);this._progressObserver.complete&&this._progressObserver.complete();this._taskCompletionResolver.resolve(n)},ih.prototype._failWith=function(n){this._lastProgress.taskState="Error";this._progressObserver.next&&this._progressObserver.next(this._lastProgress);this._progressObserver.error&&this._progressObserver.error(n);this._taskCompletionResolver.reject(n)},ih.prototype._updateProgress=function(n){this._lastProgress=n;this._progressObserver.next&&this._progressObserver.next(n)},ih);at=(c(aut,hbt=gv),aut.prototype._terminate=function(){return this._firestoreClient||lbt(this),this._firestoreClient.terminate()},aut);var wf=(bbt.prototype.isEqual=function(n){return this._internalPath.isEqual(n._internalPath)},bbt),rh=(oe.fromBase64String=function(n){try{return new oe(sr.fromBase64String(n))}catch(n){throw new u(t.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+n);}},oe.fromUint8Array=function(n){return new oe(sr.fromUint8Array(n))},oe.prototype.toBase64=function(){return this._byteString.toBase64()},oe.prototype.toUint8Array=function(){return this._byteString.toUint8Array()},oe.prototype.toString=function(){return"Bytes(base64: "+this.toBase64()+")"},oe.prototype.isEqual=function(n){return this._byteString.isEqual(n._byteString)},oe),uh=function(n){this._methodName=n},sk=(Object.defineProperty(al.prototype,"latitude",{get:function(){return this._lat},enumerable:!1,configurable:!0}),Object.defineProperty(al.prototype,"longitude",{get:function(){return this._long},enumerable:!1,configurable:!0}),al.prototype.isEqual=function(n){return this._lat===n._lat&&this._long===n._long},al.prototype.toJSON=function(){return{latitude:this._lat,longitude:this._long}},al.prototype._compareTo=function(n){return w(this._lat,n._lat)||w(this._long,n._long)},al),yui=/^__.*__$/,pui=(wbt.prototype.toMutation=function(n,t){return null!==this.fieldMask?new ne(n,this.data,this.fieldMask,t,this.fieldTransforms):new rc(n,this.data,t,this.fieldTransforms)},wbt),ybt=(pbt.prototype.toMutation=function(n,t){return new ne(n,this.data,this.fieldMask,t,this.fieldTransforms)},pbt);vut=(Object.defineProperty(yu.prototype,"path",{get:function(){return this.settings.path},enumerable:!1,configurable:!0}),Object.defineProperty(yu.prototype,"Cc",{get:function(){return this.settings.Cc},enumerable:!1,configurable:!0}),yu.prototype.Nc=function(n){return new yu(Object.assign(Object.assign({},this.settings),n),this.databaseId,this.R,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)},yu.prototype.xc=function(n){var t=null===(t=this.path)||void 0===t?void 0:t.child(n),t=this.Nc({path:t,Fc:!1});return t.kc(n),t},yu.prototype.$c=function(n){var t,n=null===(t=this.path)||void 0===t?void 0:t.child(n),n=this.Nc({path:n,Fc:!1});return n.Dc(),n},yu.prototype.Oc=function(){return this.Nc({path:void 0,Fc:!0})},yu.prototype.Mc=function(n){return yk(n,this.settings.methodName,this.settings.Lc||!1,this.path,this.settings.Bc)},yu.prototype.contains=function(n){return void 0!==this.fieldMask.find(function(t){return n.isPrefixOf(t)})||void 0!==this.fieldTransforms.find(function(t){return n.isPrefixOf(t.field)})},yu.prototype.Dc=function(){if(this.path)for(var n=0;n<this.path.length;n++)this.kc(this.path.get(n))},yu.prototype.kc=function(n){if(0===n.length)throw this.Mc("Document fields must not be empty");if(kbt(this.Cc)&&yui.test(n))throw this.Mc('Document fields cannot begin and end with "__"');},yu);dbt=(gbt.prototype.qc=function(n,t,i,r){return void 0===r&&(r=!1),new vut({Cc:n,methodName:t,Bc:i,path:ku.emptyPath(),Fc:!1,Lc:r},this.databaseId,this.R,this.ignoreUndefinedProperties)},gbt);ck=(c(ny,yut=uh),ny.prototype._toFieldTransform=function(n){if(2!==n.Cc)throw 1===n.Cc?n.Mc(this._methodName+"() can only appear at the top level of your update data"):n.Mc(this._methodName+"() cannot be used with set() unless you pass {merge:true}");return n.fieldMask.push(n.path),null},ny.prototype.isEqual=function(n){return n instanceof ny},ny);var tkt,ikt,rkt,put,wui=(c(ty,put=uh),ty.prototype._toFieldTransform=function(n){return new ic(n.path,new us)},ty.prototype.isEqual=function(n){return n instanceof ty},ty),bui=(c(vk,rkt=uh),vk.prototype._toFieldTransform=function(n){var i=nkt(this,n,!0),t=this.Uc.map(function(n){return eh(n,i)}),t=new be(t);return new ic(n.path,t)},vk.prototype.isEqual=function(n){return this===n},vk),kui=(c(ak,ikt=uh),ak.prototype._toFieldTransform=function(n){var i=nkt(this,n,!0),t=this.Uc.map(function(n){return eh(n,i)}),t=new ke(t);return new ic(n.path,t)},ak.prototype.isEqual=function(n){return this===n},ak),dui=(c(lk,tkt=uh),lk.prototype._toFieldTransform=function(n){var t=new fs(n.R,vct(n.R,this.Qc));return new ic(n.path,t)},lk.prototype.isEqual=function(n){return this===n},lk);okt=new RegExp("[~\\*/\\[\\]]");vl=(Object.defineProperty(yl.prototype,"id",{get:function(){return this._key.path.lastSegment()},enumerable:!1,configurable:!0}),Object.defineProperty(yl.prototype,"ref",{get:function(){return new ht(this._firestore,this._converter,this._key)},enumerable:!1,configurable:!0}),yl.prototype.exists=function(){return null!==this._document},yl.prototype.data=function(){if(this._document){if(this._converter){var n=new hkt(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(n)}return this._userDataWriter.convertValue(this._document.data.value)}},yl.prototype.get=function(n){if(this._document&&(n=this._document.data.field(wk("DocumentSnapshot.get",n)),null!==n))return this._userDataWriter.convertValue(n)},yl);hkt=(c(nft,pk=vl),nft.prototype.data=function(){return pk.prototype.data.call(this)},nft);var bk,tft,oh=(ckt.prototype.isEqual=function(n){return this.hasPendingWrites===n.hasPendingWrites&&this.fromCache===n.fromCache},ckt),se=(c(ry,tft=vl),ry.prototype.exists=function(){return tft.prototype.exists.call(this)},ry.prototype.data=function(n){if(void 0===n&&(n={}),this._document){if(this._converter){var t=new iy(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(t,n)}return this._userDataWriter.convertValue(this._document.data.value,n.serverTimestamps)}},ry.prototype.get=function(n,t){if((void 0===t&&(t={}),this._document)&&(n=this._document.data.field(wk("DocumentSnapshot.get",n)),null!==n))return this._userDataWriter.convertValue(n,t.serverTimestamps)},ry),iy=(c(ift,bk=se),ift.prototype.data=function(n){return bk.prototype.data.call(this,n=void 0===n?{}:n)},ift),ho=(Object.defineProperty(pl.prototype,"docs",{get:function(){var n=[];return this.forEach(function(t){return n.push(t)}),n},enumerable:!1,configurable:!0}),Object.defineProperty(pl.prototype,"size",{get:function(){return this._snapshot.docs.size},enumerable:!1,configurable:!0}),Object.defineProperty(pl.prototype,"empty",{get:function(){return 0===this.size},enumerable:!1,configurable:!0}),pl.prototype.forEach=function(n,t){var i=this;this._snapshot.docs.forEach(function(r){n.call(t,new iy(i._firestore,i._userDataWriter,r.key,r,new oh(i._snapshot.mutatedKeys.has(r.key),i._snapshot.fromCache),i.query.converter))})},pl.prototype.docChanges=function(n){if(n=!!(n=void 0===n?{}:n).includeMetadataChanges,n&&this._snapshot.excludesMetadataChanges)throw new u(t.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===n||(this._cachedChanges=function(n,t){var r,i;return n._snapshot.oldDocs.isEmpty()?(r=0,n._snapshot.docChanges.map(function(t){var i=new iy(n._firestore,n._userDataWriter,t.doc.key,t.doc,new oh(n._snapshot.mutatedKeys.has(t.doc.key),n._snapshot.fromCache),n.query.converter);return t.doc,{type:"added",doc:i,oldIndex:-1,newIndex:r++}})):(i=n._snapshot.oldDocs,n._snapshot.docChanges.filter(function(n){return t||3!==n.type}).map(function(t){var f=new iy(n._firestore,n._userDataWriter,t.doc.key,t.doc,new oh(n._snapshot.mutatedKeys.has(t.doc.key),n._snapshot.fromCache),n.query.converter),r=-1,u=-1;return 0!==t.type&&(r=i.indexOf(t.doc.key),i=i.delete(t.doc.key)),1!==t.type&&(u=(i=i.add(t.doc)).indexOf(t.doc.key)),{type:function(n){switch(n){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return s()}}(t.type),doc:f,oldIndex:r,newIndex:u}}))}(this,n),this._cachedChangesIncludeMetadataChanges=n),this._cachedChanges},pl);rt=function(){};var vkt,ykt,pkt,wkt,bkt,gui=(c(oft,bkt=rt),oft.prototype._apply=function(n){var i=fh(n.firestore),i=function(n,i,r,f,e,o){var a,s;if(f.isKeyField()){if("array-contains"===e||"array-contains-any"===e)throw new u(t.INVALID_ARGUMENT,"Invalid Query. You can't perform '"+e+"' queries on FieldPath.documentId().");if("in"===e||"not-in"===e){idt(o,e);for(var c=[],h=0,l=o;h<l.length;h++)a=l[h],c.push(tdt(r,n,a));s={arrayValue:{values:c}}}else s=tdt(r,n,o)}else"in"!==e&&"not-in"!==e&&"array-contains-any"!==e||idt(o,e),s=ukt(i,"where",o,"in"===e||"not-in"===e);return s=dr.create(f,e,s),function(n,i){if(i.g()){var r=ltt(n);if(null!==r&&!r.isEqual(i.field))throw new u(t.INVALID_ARGUMENT,"Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '"+r.toString()+"' and '"+i.field.toString()+"'");r=ctt(n);null!==r&&rdt(0,i.field,r)}if(n=function(n,t){for(var u,i=0,r=n.filters;i<r.length;i++)if(u=r[i],0<=t.indexOf(u.op))return u.op;return null}(n,function(){switch(i.op){case"!=":return["!=","not-in"];case"array-contains":return["array-contains","array-contains-any","not-in"];case"in":return["array-contains-any","in","not-in"];case"array-contains-any":return["array-contains","array-contains-any","in","not-in"];case"not-in":return["array-contains","array-contains-any","in","not-in","!="];default:return[]}}()),null!==n)throw n===i.op?new u(t.INVALID_ARGUMENT,"Invalid query. You cannot use more than one '"+i.op.toString()+"' filter."):new u(t.INVALID_ARGUMENT,"Invalid query. You cannot use '"+i.op.toString()+"' filters with '"+n.toString()+"' filters.");}(n,s),s}(n._query,i,n.firestore._databaseId,this.Kc,this.jc,this.Wc);return new iu(n.firestore,n.converter,(n=n._query,i=n.filters.concat([i]),new lf(n.path,n.collectionGroup,n.explicitOrderBy.slice(),i,n.limit,n.limitType,n.startAt,n.endAt)))},oft),nfi=(c(eft,wkt=rt),eft.prototype._apply=function(n){var i=function(n,i,r){if(null!==n.startAt)throw new u(t.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(null!==n.endAt)throw new u(t.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");var f=new rs(i,r);return i=f,null!==ctt(r=n)||null!==(n=ltt(r))&&rdt(0,n,i.field),f}(n._query,this.Kc,this.Gc);return new iu(n.firestore,n.converter,(n=n._query,i=n.explicitOrderBy.concat([i]),new lf(n.path,n.collectionGroup,i,n.filters.slice(),n.limit,n.limitType,n.startAt,n.endAt)))},eft),kkt=(c(fft,pkt=rt),fft.prototype._apply=function(n){return new iu(n.firestore,n.converter,sct(n._query,this.zc,this.Hc))},fft),dkt=(c(uft,ykt=rt),uft.prototype._apply=function(n){var t=ndt(n,this.type,this.Jc,this.Yc);return new iu(n.firestore,n.converter,(n=n._query,t=t,new lf(n.path,n.collectionGroup,n.explicitOrderBy.slice(),n.filters.slice(),n.limit,n.limitType,t,n.endAt)))},uft),gkt=(c(rft,vkt=rt),rft.prototype._apply=function(n){var t=ndt(n,this.type,this.Jc,this.Yc);return new iu(n.firestore,n.converter,(n=n._query,t=t,new lf(n.path,n.collectionGroup,n.explicitOrderBy.slice(),n.filters.slice(),n.limit,n.limitType,n.startAt,t)))},rft);lo.prototype.convertValue=function(n,t){switch(void 0===t&&(t="none"),is(n)){case 0:return null;case 1:return n.booleanValue;case 2:return wt(n.integerValue||n.doubleValue);case 3:return this.convertTimestamp(n.timestampValue);case 4:return this.convertServerTimestamp(n,t);case 5:return n.stringValue;case 6:return this.convertBytes(dh(n.bytesValue));case 7:return this.convertReference(n.referenceValue);case 8:return this.convertGeoPoint(n.geoPointValue);case 9:return this.convertArray(n.arrayValue,t);case 10:return this.convertObject(n.mapValue,t);default:throw s();}};lo.prototype.convertObject=function(n,t){var r=this,i={};return ns(n.fields,function(n,u){i[n]=r.convertValue(u,t)}),i};lo.prototype.convertGeoPoint=function(n){return new sk(wt(n.latitude),wt(n.longitude))};lo.prototype.convertArray=function(n,t){var i=this;return(n.values||[]).map(function(n){return i.convertValue(n,t)})};lo.prototype.convertServerTimestamp=function(n,t){switch(t){case"previous":var i=function n(t){return t=t.mapValue.fields.__previous_value__,gn(t)?n(t):t}(n);return null==i?null:this.convertValue(i,t);case"estimate":return this.convertTimestamp(la(n));default:return null}};lo.prototype.convertTimestamp=function(n){return n=df(n),new or(n.seconds,n.nanos)};lo.prototype.convertDocumentKey=function(n,t){var i=k.fromString(n);return a(kat(i)),n=new uk(i.get(1),i.get(3)),i=new h(i.popFirst(5)),n.isEqual(t)||pt("Document "+i+" contains a document reference within a different database ("+n.projectId+"/"+n.database+") which is not supported. It will be treated as a reference in the current database ("+t.projectId+"/"+t.database+") instead."),i};l=lo;fdt=(c(dk,udt=l),dk.prototype.convertBytes=function(n){return new rh(n)},dk.prototype.convertReference=function(n){return n=this.convertDocumentKey(n,this.firestore._databaseId),new ht(this.firestore,null,n)},dk);edt=(wl.prototype.set=function(n,t,i){return this._verifyNotCommitted(),n=ao(n,this._firestore),t=kk(n.converter,t,i),i=hk(this._dataReader,"WriteBatch.set",n._key,t,null!==n.converter,i),this._mutations.push(i.toMutation(n._key,yi.none())),this},wl.prototype.update=function(n,t,i){for(var u=[],r=3;r<arguments.length;r++)u[r-3]=arguments[r];return this._verifyNotCommitted(),n=ao(n,this._firestore),t="string"==typeof(t=yt(t))||t instanceof wf?but(this._dataReader,"WriteBatch.update",n._key,t,i,u):wut(this._dataReader,"WriteBatch.update",n._key,t),this._mutations.push(t.toMutation(n._key,yi.exists(!0))),this},wl.prototype.delete=function(n){return this._verifyNotCommitted(),n=ao(n,this._firestore),this._mutations=this._mutations.concat(new uc(n._key,yi.none())),this},wl.prototype.commit=function(){return this._verifyNotCommitted(),this._committed=!0,0<this._mutations.length?this._commitHandler(this._mutations):Promise.resolve()},wl.prototype._verifyNotCommitted=function(){if(this._committed)throw new u(t.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.");},wl);vo=(c(gk,odt=l),gk.prototype.convertBytes=function(n){return new rh(n)},gk.prototype.convertReference=function(n){return n=this.convertDocumentKey(n,this.firestore._databaseId),new ht(this.firestore,null,n)},gk);cdt=(fy.prototype.get=function(n){var i=this,t=ao(n,this._firestore),r=new fdt(this._firestore);return this._transaction.lookup([t._key]).then(function(n){if(!n||1!==n.length)return s();if(n=n[0],n.isFoundDocument())return new vl(i._firestore,r,n.key,n,t.converter);if(n.isNoDocument())return new vl(i._firestore,r,t._key,null,t.converter);throw s();})},fy.prototype.set=function(n,t,i){return n=ao(n,this._firestore),t=kk(n.converter,t,i),i=hk(this._dataReader,"Transaction.set",n._key,t,null!==n.converter,i),this._transaction.set(n._key,i),this},fy.prototype.update=function(n,t,i){for(var u=[],r=3;r<arguments.length;r++)u[r-3]=arguments[r];return n=ao(n,this._firestore),t="string"==typeof(t=yt(t))||t instanceof wf?but(this._dataReader,"Transaction.update",n._key,t,i,u):wut(this._dataReader,"Transaction.update",n._key,t),this._transaction.update(n._key,t),this},fy.prototype.delete=function(n){return n=ao(n,this._firestore),this._transaction.delete(n._key),this},c(cft,hft=fy),cft.prototype.get=function(n){var i=this,t=ao(n,this._firestore),r=new vo(this._firestore);return hft.prototype.get.call(this,n).then(function(n){return new se(i._firestore,r,t._key,n._document,new oh(!1,!1),t.converter)})},cft);var vdt,ydt=(he.fromBase64String=function(n){return adt(),new he(rh.fromBase64String(n))},he.fromUint8Array=function(n){return ldt(),new he(rh.fromUint8Array(n))},he.prototype.toBase64=function(){return adt(),this._delegate.toBase64()},he.prototype.toUint8Array=function(){return ldt(),this._delegate.toUint8Array()},he.prototype.isEqual=function(n){return this._delegate.isEqual(n._delegate)},he.prototype.toString=function(){return"Blob(base64: "+this.toBase64()+")"},he),tfi=(id.prototype.enableIndexedDbPersistence=function(n,t){return function(n,t){vbt(n=d(n,at));var i=ci(n),r=n._freezeSettings(),n=new fut;return abt(i,n,new owt(n,r.cacheSizeBytes,null==t?void 0:t.forceOwnership))}(n._delegate,{forceOwnership:t})},id.prototype.enableMultiTabIndexedDbPersistence=function(n){return function(n){vbt(n=d(n,at));var t=ci(n),i=n._freezeSettings(),n=new fut;return abt(t,n,new uui(n,i.cacheSizeBytes))}(n._delegate)},id.prototype.clearIndexedDbPersistence=function(n){return function(n){var e=this,f;if(n._initialized&&!n._terminated)throw new u(t.FAILED_PRECONDITION,"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.");return f=new cr,n._queue.enqueueAndForgetEvenWhileRestricted(function(){return r(e,void 0,void 0,function(){var t;return i(this,function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),[4,function(n){return r(this,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return hc.yt()?(t=n+"main",[4,hc.delete(t)]):[2,Promise.resolve()];case 1:return i.sent(),[2]}})})}(wit(n._databaseId,n._persistenceKey))];case 1:return u.sent(),f.resolve(),[3,3];case 2:return t=u.sent(),f.reject(t),[3,3];case 3:return[2]}})})}),f.promise}(n._delegate)},id),lft=(Object.defineProperty(ti.prototype,"_databaseId",{get:function(){return this._delegate._databaseId},enumerable:!1,configurable:!0}),ti.prototype.settings=function(n){var t=this._delegate._getSettings();n.merge||t.host===n.host||ca("You are overriding the original host. If you did not intend to override your settings, use {merge: true}.");n.merge&&delete(n=Object.assign(Object.assign({},t),n)).merge;this._delegate._setSettings(n)},ti.prototype.useEmulator=function(n,i,r){(function(n,i,r,f){void 0===f&&(f={});var e=(n=d(n,gv))._getSettings();if("firestore.googleapis.com"!==e.host&&e.host!==i&&ca("Host has been set in both settings() and useEmulator(), emulator host will be used"),n._setSettings(Object.assign(Object.assign({},e),{host:i+":"+r,ssl:!1})),f.mockUserToken){if(r=function(n,t){if(n.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');var r=t||"demo-project",i=n.iat||0;if(!(t=n.sub||n.user_id))throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");return n=wft({iss:"https://securetoken.google.com/"+r,aud:r,iat:i,exp:i+3600,auth_time:i,sub:t,user_id:t,firebase:{sign_in_provider:"custom",identities:{}}},n),[bft.encodeString(JSON.stringify({alg:"none",type:"JWT"}),!1),bft.encodeString(JSON.stringify(n),!1),""].join(".")}(f.mockUserToken),f=f.mockUserToken.sub||f.mockUserToken.user_id,!f)throw new u(t.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");n._credentials=new cui(new pwt(r,new tu(f)))}})(this._delegate,n,i,r=void 0===r?{}:r)},ti.prototype.enableNetwork=function(){return function(n){var t=this;return n.asyncQueue.enqueue(function(){return r(t,void 0,void 0,function(){var t,r;return i(this,function(i){switch(i.label){case 0:return[4,lwt(n)];case 1:return t=i.sent(),[4,awt(n)];case 2:return r=i.sent(),[2,(t.setNetworkEnabled(!0),(u=r).Or.delete(0),av(u))]}var u})})})}(ci(d(this._delegate,at)))},ti.prototype.disableNetwork=function(){return function(n){var t=this;return n.asyncQueue.enqueue(function(){return r(t,void 0,void 0,function(){var t,u;return i(this,function(f){switch(f.label){case 0:return[4,lwt(n)];case 1:return t=f.sent(),[4,awt(n)];case 2:return u=f.sent(),[2,(t.setNetworkEnabled(!1),function(n){return r(this,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return(t=n).Or.add(0),[4,rl(t)];case 1:return i.sent(),t.Br.set("Offline"),[2]}})})}(u))]}})})})}(ci(d(this._delegate,at)))},ti.prototype.enablePersistence=function(n){var t=!1,i=!1;return n&&dwt("synchronizeTabs",t=!!n.synchronizeTabs,"experimentalForceOwningTab",i=!!n.experimentalForceOwningTab),t?this.Xc.enableMultiTabIndexedDbPersistence(this):this.Xc.enableIndexedDbPersistence(this,i)},ti.prototype.clearPersistence=function(){return this.Xc.clearIndexedDbPersistence(this)},ti.prototype.terminate=function(){return this.Zc&&(this.Zc._removeServiceInstance("firestore"),this.Zc._removeServiceInstance("firestore-exp")),this._delegate._delete()},ti.prototype.waitForPendingWrites=function(){return function(n){var u=this,t=new cr;return n.asyncQueue.enqueueAndForget(function(){return r(u,void 0,void 0,function(){var r;return i(this,function(i){switch(i.label){case 0:return r=gri,[4,sut(n)];case 1:return[2,r.apply(void 0,[i.sent(),t])]}})})}),t.promise}(ci(d(this._delegate,at)))},ti.prototype.onSnapshotsInSync=function(n){return t=this._delegate,n=n,function(n,t){var f=this,u=new ik(t);return n.asyncQueue.enqueueAndForget(function(){return r(f,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return t=function(n,t){n.Gr.add(t);t.next()},[4,hl(n)];case 1:return[2,t.apply(void 0,[i.sent(),u])]}})})}),function(){u.Wo();n.asyncQueue.enqueueAndForget(function(){return r(f,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return t=function(n,t){n.Gr.delete(t)},[4,hl(n)];case 1:return[2,t.apply(void 0,[i.sent(),u])]}})})})}}(ci(d(t,at)),ll(n)?n:{next:n});var t},Object.defineProperty(ti.prototype,"app",{get:function(){if(!this.Zc)throw new u(t.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this.Zc},enumerable:!1,configurable:!0}),ti.prototype.collection=function(n){try{return new ud(this,fbt(this._delegate,n))}catch(n){throw yr(n,"collection()","Firestore.collection()");}},ti.prototype.doc=function(n){try{return new yo(this,ok(this._delegate,n))}catch(n){throw yr(n,"doc()","Firestore.doc()");}},ti.prototype.collectionGroup=function(n){try{return new cy(this,function(n,i){if(n=d(n,gv),hut("collectionGroup","collection id",i),0<=i.indexOf("/"))throw new u(t.INVALID_ARGUMENT,"Invalid collection ID '"+i+"' passed to function collectionGroup(). Collection IDs must not contain '/'.");return new iu(n,null,(i=i,new lf(k.emptyPath(),i)))}(this._delegate,n))}catch(n){throw yr(n,"collectionGroup()","Firestore.collectionGroup()");}},ti.prototype.runTransaction=function(n){var t,u=this;return function(n,t){var f=this,u=new cr;return n.asyncQueue.enqueueAndForget(function(){return r(f,void 0,void 0,function(){var r;return i(this,function(i){switch(i.label){case 0:return[4,rk(n).then(function(n){return n.datastore})];case 1:return r=i.sent(),new oui(n.asyncQueue,r,t,u).run(),[2]}})})}),u.promise}(ci(t=this._delegate),function(i){return i=new cdt(t,i),n(new pdt(u,i))})},ti.prototype.batch=function(){var n=this;return ci(this._delegate),new wdt(new edt(this._delegate,function(t){return uy(n._delegate,t)}))},ti.prototype.loadBundle=function(){throw new u(t.FAILED_PRECONDITION,'"loadBundle()" does not exist, have you imported "firebase/firestore/bundle"?');},ti.prototype.namedQuery=function(){throw new u(t.FAILED_PRECONDITION,'"namedQuery()" does not exist, have you imported "firebase/firestore/bundle"?');},ti),nd=(c(td,vdt=l),td.prototype.convertBytes=function(n){return new ydt(new rh(n))},td.prototype.convertReference=function(n){return n=this.convertDocumentKey(n,this.firestore._databaseId),yo.tu(n,this.firestore,null)},td);var pdt=(oy.prototype.get=function(n){var t=this,i=sh(n);return this._delegate.get(i).then(function(n){return new sy(t._firestore,new se(t._firestore._delegate,t._userDataWriter,n._key,n._document,n.metadata,i.converter))})},oy.prototype.set=function(n,t,i){return n=sh(n),i?(cut("Transaction.set",i),this._delegate.set(n,t,i)):this._delegate.set(n,t),this},oy.prototype.update=function(n,t,i){for(var f,u=[],r=3;r<arguments.length;r++)u[r-3]=arguments[r];return f=sh(n),2===arguments.length?this._delegate.update(f,t):(n=this._delegate).update.apply(n,g([f,t,i],u)),this},oy.prototype.delete=function(n){return n=sh(n),this._delegate.delete(n),this},oy),wdt=(ey.prototype.set=function(n,t,i){return n=sh(n),i?(cut("WriteBatch.set",i),this._delegate.set(n,t,i)):this._delegate.set(n,t),this},ey.prototype.update=function(n,t,i){for(var f,u=[],r=3;r<arguments.length;r++)u[r-3]=arguments[r];return f=sh(n),2===arguments.length?this._delegate.update(f,t):(n=this._delegate).update.apply(n,g([f,t,i],u)),this},ey.prototype.delete=function(n){return n=sh(n),this._delegate.delete(n),this},ey.prototype.commit=function(){return this._delegate.commit()},ey),rd=(bl.prototype.fromFirestore=function(n,t){return n=new iy(this._firestore._delegate,this._userDataWriter,n._key,n._document,n.metadata,null),this._delegate.fromFirestore(new hy(this._firestore,n),null!=t?t:{})},bl.prototype.toFirestore=function(n,t){return t?this._delegate.toFirestore(n,t):this._delegate.toFirestore(n)},bl.eu=function(n,t){var i=bl.nu,r=i.get(n);return r||(r=new WeakMap,i.set(n,r)),i=r.get(t),i||(i=new bl(n,new nd(n),t),r.set(t,i)),i},bl);rd.nu=new WeakMap;yo=(gi.su=function(n,i,r){if(n.length%2!=0)throw new u(t.INVALID_ARGUMENT,"Invalid document reference. Document references must have an even number of segments, but "+n.canonicalString()+" has "+n.length);return new gi(i,new ht(i._delegate,r,new h(n)))},gi.tu=function(n,t,i){return new gi(t,new ht(t._delegate,i,n))},Object.defineProperty(gi.prototype,"id",{get:function(){return this._delegate.id},enumerable:!1,configurable:!0}),Object.defineProperty(gi.prototype,"parent",{get:function(){return new ud(this.firestore,this._delegate.parent)},enumerable:!1,configurable:!0}),Object.defineProperty(gi.prototype,"path",{get:function(){return this._delegate.path},enumerable:!1,configurable:!0}),gi.prototype.collection=function(n){try{return new ud(this.firestore,fbt(this._delegate,n))}catch(n){throw yr(n,"collection()","DocumentReference.collection()");}},gi.prototype.isEqual=function(n){return(n=yt(n))instanceof ht&&ebt(this._delegate,n)},gi.prototype.set=function(n,t){t=cut("DocumentReference.set",t);try{return function(n,t,i){n=d(n,ht);var r=d(n.firestore,at),t=kk(n.converter,t,i);return uy(r,[hk(fh(r),"setDoc",n._key,t,null!==n.converter,i).toMutation(n._key,yi.none())])}(this._delegate,n,t)}catch(n){throw yr(n,"setDoc()","DocumentReference.set()");}},gi.prototype.update=function(n,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];try{return 1===arguments.length?sdt(this._delegate,n):sdt.apply(void 0,g([this._delegate,n,t],r))}catch(n){throw yr(n,"updateDoc()","DocumentReference.update()");}},gi.prototype.delete=function(){return uy(d((n=this._delegate).firestore,at),[new uc(n._key,yi.none())]);var n},gi.prototype.onSnapshot=function(){for(var r,u,n=this,i=[],t=0;t<arguments.length;t++)i[t]=arguments[t];return r=bdt(i),u=kdt(i,function(t){return new sy(n.firestore,new se(n.firestore._delegate,n._userDataWriter,t._key,t._document,t.metadata,n._delegate.converter))}),hdt(this._delegate,r,u)},gi.prototype.get=function(n){var f=this;return("cache"===(null==n?void 0:n.source)?function(n){n=d(n,ht);var f=d(n.firestore,at),e=ci(f),o=new vo(f);return function(n,f){var o=this,e=new cr;return n.asyncQueue.enqueueAndForget(function(){return r(o,void 0,void 0,function(){var o;return i(this,function(s){switch(s.label){case 0:return o=function(n,f,e){return r(this,void 0,void 0,function(){var o,r;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,(s=f,(h=n).persistence.runTransaction("read document","readonly",function(n){return h.Mn.mn(n,s)}))];case 1:return(r=i.sent()).isFoundDocument()?e.resolve(r):r.isNoDocument()?e.resolve(null):e.reject(new u(t.UNAVAILABLE,"Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)")),[3,3];case 2:return o=i.sent(),r=el(o,"Failed to get document '"+f+" from cache"),e.reject(r),[3,3];case 3:return[2]}var s,h})})},[4,out(n)];case 1:return[2,o.apply(void 0,[s.sent(),f,e])]}})})}),e.promise}(e,n._key).then(function(t){return new se(f,o,n._key,t,new oh(null!==t&&t.hasLocalMutations,!0),n.converter)})}:"server"===(null==n?void 0:n.source)?function(n){n=d(n,ht);var t=d(n.firestore,at);return vwt(ci(t),n._key,{source:"server"}).then(function(i){return sft(t,n,i)})}:function(n){n=d(n,ht);var t=d(n.firestore,at);return vwt(ci(t),n._key).then(function(i){return sft(t,n,i)})})(this._delegate).then(function(n){return new sy(f.firestore,new se(f.firestore._delegate,f._userDataWriter,n._key,n._document,n.metadata,f._delegate.converter))})},gi.prototype.withConverter=function(n){return new gi(this.firestore,n?this._delegate.withConverter(rd.eu(this.firestore,n)):this._delegate.withConverter(null))},gi);var ddt,aft,sy=(Object.defineProperty(po.prototype,"ref",{get:function(){return new yo(this._firestore,this._delegate.ref)},enumerable:!1,configurable:!0}),Object.defineProperty(po.prototype,"id",{get:function(){return this._delegate.id},enumerable:!1,configurable:!0}),Object.defineProperty(po.prototype,"metadata",{get:function(){return this._delegate.metadata},enumerable:!1,configurable:!0}),Object.defineProperty(po.prototype,"exists",{get:function(){return this._delegate.exists()},enumerable:!1,configurable:!0}),po.prototype.data=function(n){return this._delegate.data(n)},po.prototype.get=function(n,t){return this._delegate.get(n,t)},po.prototype.isEqual=function(n){return lkt(this._delegate,n._delegate)},po),hy=(c(yft,aft=sy),yft.prototype.data=function(n){return this._delegate.data(n)},yft),cy=(vt.prototype.where=function(n,t,i){try{return new vt(this.firestore,co(this._delegate,(r=i,u=t,f=wk("where",n),new gui(f,u,r))))}catch(n){throw yr(n,/(orderBy|where)\(\)/,"Query.$1()");}var r,u,f},vt.prototype.orderBy=function(n,t){try{return new vt(this.firestore,co(this._delegate,(i=void 0===t?"asc":t,r=wk("orderBy",n),new nfi(r,i))))}catch(n){throw yr(n,/(orderBy|where)\(\)/,"Query.$1()");}var i,r},vt.prototype.limit=function(n){try{return new vt(this.firestore,co(this._delegate,(tbt("limit",t=n),new kkt("limit",t,"F"))))}catch(n){throw yr(n,"limit()","Query.limit()");}var t},vt.prototype.limitToLast=function(n){try{return new vt(this.firestore,co(this._delegate,(tbt("limitToLast",t=n),new kkt("limitToLast",t,"L"))))}catch(n){throw yr(n,"limitToLast()","Query.limitToLast()");}var t},vt.prototype.startAt=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return new vt(this.firestore,co(this._delegate,function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new dkt("startAt",t,!0)}.apply(void 0,t)))}catch(t){throw yr(t,"startAt()","Query.startAt()");}},vt.prototype.startAfter=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return new vt(this.firestore,co(this._delegate,function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new dkt("startAfter",t,!1)}.apply(void 0,t)))}catch(t){throw yr(t,"startAfter()","Query.startAfter()");}},vt.prototype.endBefore=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return new vt(this.firestore,co(this._delegate,function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new gkt("endBefore",t,!0)}.apply(void 0,t)))}catch(t){throw yr(t,"endBefore()","Query.endBefore()");}},vt.prototype.endAt=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return new vt(this.firestore,co(this._delegate,function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new gkt("endAt",t,!1)}.apply(void 0,t)))}catch(t){throw yr(t,"endAt()","Query.endAt()");}},vt.prototype.isEqual=function(n){return obt(this._delegate,n._delegate)},vt.prototype.get=function(n){var t=this;return("cache"===(null==n?void 0:n.source)?function(n){n=d(n,iu);var t=d(n.firestore,at),u=ci(t),f=new vo(t);return function(n,t){var f=this,u=new cr;return n.asyncQueue.enqueueAndForget(function(){return r(f,void 0,void 0,function(){var f;return i(this,function(e){switch(e.label){case 0:return f=function(n,t,u){return r(this,void 0,void 0,function(){var e,r,f;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,cb(n,t,!0)];case 1:return f=i.sent(),e=new gpt(t,f.Bn),r=e._o(f.documents),r=e.applyChanges(r,!1),u.resolve(r.snapshot),[3,3];case 2:return r=i.sent(),f=el(r,"Failed to execute query '"+t+" against cache"),u.reject(f),[3,3];case 3:return[2]}})})},[4,out(n)];case 1:return[2,f.apply(void 0,[e.sent(),t,u])]}})})}),u.promise}(u,n._query).then(function(i){return new ho(t,f,n,i)})}:"server"===(null==n?void 0:n.source)?function(n){n=d(n,iu);var t=d(n.firestore,at),i=ci(t),r=new vo(t);return ywt(i,n._query,{source:"server"}).then(function(i){return new ho(t,r,n,i)})}:function(n){n=d(n,iu);var t=d(n.firestore,at),i=ci(t),r=new vo(t);return akt(n._query),ywt(i,n._query).then(function(i){return new ho(t,r,n,i)})})(this._delegate).then(function(n){return new vft(t.firestore,new ho(t.firestore._delegate,t._userDataWriter,t._delegate,n._snapshot))})},vt.prototype.onSnapshot=function(){for(var r,u,n=this,i=[],t=0;t<arguments.length;t++)i[t]=arguments[t];return r=bdt(i),u=kdt(i,function(t){return new vft(n.firestore,new ho(n.firestore._delegate,n._userDataWriter,n._delegate,t._snapshot))}),hdt(this._delegate,r,u)},vt.prototype.withConverter=function(n){return new vt(this.firestore,n?this._delegate.withConverter(rd.eu(this.firestore,n)):this._delegate.withConverter(null))},vt),ifi=(Object.defineProperty(ly.prototype,"type",{get:function(){return this._delegate.type},enumerable:!1,configurable:!0}),Object.defineProperty(ly.prototype,"doc",{get:function(){return new hy(this._firestore,this._delegate.doc)},enumerable:!1,configurable:!0}),Object.defineProperty(ly.prototype,"oldIndex",{get:function(){return this._delegate.oldIndex},enumerable:!1,configurable:!0}),Object.defineProperty(ly.prototype,"newIndex",{get:function(){return this._delegate.newIndex},enumerable:!1,configurable:!0}),ly),vft=(Object.defineProperty(ce.prototype,"query",{get:function(){return new cy(this._firestore,this._delegate.query)},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"metadata",{get:function(){return this._delegate.metadata},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"size",{get:function(){return this._delegate.size},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"empty",{get:function(){return this._delegate.empty},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"docs",{get:function(){var n=this;return this._delegate.docs.map(function(t){return new hy(n._firestore,t)})},enumerable:!1,configurable:!0}),ce.prototype.docChanges=function(n){var t=this;return this._delegate.docChanges(n).map(function(n){return new ifi(t._firestore,n)})},ce.prototype.forEach=function(n,t){var i=this;this._delegate.forEach(function(r){n.call(t,new hy(i._firestore,r))})},ce.prototype.isEqual=function(n){return lkt(this._delegate,n._delegate)},ce),ud=(c(bf,ddt=cy),Object.defineProperty(bf.prototype,"id",{get:function(){return this._delegate.id},enumerable:!1,configurable:!0}),Object.defineProperty(bf.prototype,"path",{get:function(){return this._delegate.path},enumerable:!1,configurable:!0}),Object.defineProperty(bf.prototype,"parent",{get:function(){var n=this._delegate.parent;return n?new yo(this.firestore,n):null},enumerable:!1,configurable:!0}),bf.prototype.doc=function(n){try{return new yo(this.firestore,void 0===n?ok(this._delegate):ok(this._delegate,n))}catch(n){throw yr(n,"doc()","CollectionReference.doc()");}},bf.prototype.add=function(n){var t,i,r,u=this;return t=this._delegate,i=n,n=d(t.firestore,at),r=ok(t),i=kk(t.converter,i),uy(n,[hk(fh(t.firestore),"addDoc",r._key,i,null!==t.converter,{}).toMutation(r._key,yi.exists(!1))]).then(function(){return r}).then(function(n){return new yo(u.firestore,n)})},bf.prototype.isEqual=function(n){return ebt(this._delegate,n._delegate)},bf.prototype.withConverter=function(n){return new bf(this.firestore,n?this._delegate.withConverter(rd.eu(this.firestore,n)):this._delegate.withConverter(null))},bf);fd.documentId=function(){return new fd(ku.keyField().canonicalString())};fd.prototype.isEqual=function(n){return(n=yt(n))instanceof wf&&this._delegate._internalPath.isEqual(n._internalPath)};rt=fd;pu.serverTimestamp=function(){var n=new wui("serverTimestamp");return n._methodName="FieldValue.serverTimestamp",new pu(n)};pu.delete=function(){var n=new ck("deleteField");return n._methodName="FieldValue.delete",new pu(n)};pu.arrayUnion=function(){for(var i,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return i=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new bui("arrayUnion",t)}.apply(void 0,t),i._methodName="FieldValue.arrayUnion",new pu(i)};pu.arrayRemove=function(){for(var i,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return i=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new kui("arrayRemove",t)}.apply(void 0,t),i._methodName="FieldValue.arrayRemove",new pu(i)};pu.increment=function(n){return n=new dui("increment",n),n._methodName="FieldValue.increment",new pu(n)};pu.prototype.isEqual=function(n){return this._delegate.isEqual(n._delegate)};l=pu;gdt=(ay.prototype.setInstantiationMode=function(n){return this.instantiationMode=n,this},ay.prototype.setMultipleInstances=function(n){return this.multipleInstances=n,this},ay.prototype.setServiceProps=function(n){return this.serviceProps=n,this},ay.prototype.setInstanceCreatedCallback=function(n){return this.onInstanceCreated=n,this},ay);igt={Firestore:lft,GeoPoint:sk,Timestamp:or,Blob:ydt,Transaction:pdt,WriteBatch:wdt,DocumentReference:yo,DocumentSnapshot:sy,Query:cy,QueryDocumentSnapshot:hy,QuerySnapshot:vft,CollectionReference:ud,FieldPath:rt,FieldValue:l,setLogLevel:function(n){bu.setLogLevel(n)},CACHE_SIZE_UNLIMITED:-1};(ngt=ugt.default).INTERNAL.registerComponent(new gdt("firestore",function(n){var t=n.getProvider("app").getImmediate();return t=t,n=n.getProvider("auth-internal"),new lft(t,new at(t,n),new tfi)},"PUBLIC").setServiceProps(Object.assign({},igt)));ngt.registerVersion("@firebase/firestore","2.3.6");(tgt=lft).prototype.loadBundle=rfi;tgt.prototype.namedQuery=ufi}.apply(this,arguments)}catch(t){throw console.error(t),new Error("Cannot instantiate firebase-firestore.js - be sure to load firebase-app.js first.");}});firebaseConfig={apiKey:"AIzaSyBiWMv__leyyn_wP2ErRX3W5AyvLivQAEo",authDomain:"indianauto-ee90c.firebaseapp.com",databaseURL:"https://indianauto-ee90c.firebaseio.com",projectId:"indianauto-ee90c",storageBucket:"indianauto-ee90c.appspot.com",messagingSenderId:"373323466333",appId:"1:373323466333:web:603bdfe1acbe0348a6afb4",measurementId:"G-V8YT4202QZ"};firebase.initializeApp(firebaseConfig);firebase.analytics().logEvent("notification_received");const messaging=firebase.messaging();messaging.usePublicVapidKey("BP9BQOHLTVsVNzghg5lPZ1FEE-8soVTGkxYKBd2-qkZkaNOqlVuizF62fNh4V7auJ7yl_UAZ-SnFvuo77uVjmQg");messaging.onTokenRefresh(()=>{messaging.getToken().then(()=>{getFirebaseToken()}).catch(n=>{console.log("Unable to retrieve refreshed token ",n)})});messaging.onMessage(n=>{console.log("onMessage Received background message ",n)});subscribe=cookie_manager.get_cookie("subscribe_site");subscribe===null||subscribe===undefined||subscribe===""?setTimeout(function(){$("#hdIsMobile").length>0?$(".notifycation-container").animate({bottom:"0px"},1e3):$(".notifycation-container").animate({top:"0px"},1e3);$(".notifycation-container #btnMayBeLate").click(function(){cookie_manager.set_cookie("subscribe_site","1",30);$(".notifycation-container").remove()});$(".notifycation-container #btnSubscribe").click(function(n){n.preventDefault();window.Notification?Notification.requestPermission().then(n=>{n==="granted"?messaging.getToken().then(n=>{n?(cookie_manager.set_cookie("notify_token",n,3650),cookie_manager.set_cookie("subscribe_site","1",3650),apiRecallAfterSubscribe!==undefined&&apiRecallAfterSubscribe!==null&&$.ajax({url:apiRecallAfterSubscribe,xhrFields:{withCredentials:!0},method:"POST",success:function(n){console.log(n)}})):requestPermission(),console.log("currentToken: "),console.log(n)}).catch(n=>{console.log("An error occurred while retrieving token. ",n)}):cookie_manager.set_cookie("subscribe_site","1",30)}):(alert("Your browser not supprot notify"),cookie_manager.set_cookie("subscribe_site","1",30));$(".notifycation-container").remove()})},3e4):$(".notifycation-container").remove();